@best-bundles/bundle-ui 0.0.39 → 0.0.41
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/adapters/LiquidAdapter.d.ts.map +1 -1
- package/dist/components/BundleBuilderDrawer.d.ts.map +1 -1
- package/dist/components/BundleBuilderPanel.d.ts.map +1 -1
- package/dist/context/BundleProvider.d.ts +2 -0
- package/dist/context/BundleProvider.d.ts.map +1 -1
- package/dist/index.js +1492 -1376
- package/dist/index.js.map +1 -1
- package/dist/liquid/bundle-ui.iife.css +1 -1
- package/dist/liquid/bundle-ui.iife.js +17 -17
- package/dist/liquid/bundle-ui.iife.js.map +1 -1
- package/dist/liquid/iife.d.ts.map +1 -1
- package/dist/stories/BundleUI.stories.d.ts.map +1 -1
- package/dist/stories/fixtures/productBundle.d.ts.map +1 -1
- package/dist/types.d.ts +5 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/stock.d.ts +4 -0
- package/dist/utils/stock.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,100 +1,106 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('._button_18rtl_1{display:inline-flex;align-items:center;justify-content:center;gap:8px;font-family:var(--bb-font-family, inherit);border:1px solid var(--bb-button-border, rgba(0, 0, 0, .12));background:var(--bb-button-bg, #111827);color:var(--bb-button-text, #ffffff);font:inherit;line-height:1;padding:10px 14px;border-radius:var(--bb-button-radius, 10px);cursor:pointer;transition:transform .12s ease,background .12s ease,border-color .12s ease,opacity .12s ease}._button_18rtl_1:hover{background:var(--bb-button-bg-hover, #0b1220)}._button_18rtl_1:active{transform:translateY(1px)}._button_18rtl_1:disabled{opacity:.6;cursor:not-allowed}._button_18rtl_1:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._backdrop_18x6y_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_18x6y_14{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;pointer-events:none;z-index:50}._celebrationChip_18x6y_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_18x6y_1 2.8s cubic-bezier(.16,1,.3,1) forwards;filter:saturate(1.05)}@keyframes _bbCelebrationPop_18x6y_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_18x6y_74{opacity:1}._backdropClosed_18x6y_78{opacity:0}._panel_18x6y_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_18x6y_103{animation:_bbSlideInFromRight_18x6y_1 var(--bb-drawer-transition-duration, .22s) ease forwards}._panelClosed_18x6y_107{animation:_bbSlideOutToRight_18x6y_1 var(--bb-drawer-transition-duration, .22s) ease forwards}@keyframes _bbSlideInFromRight_18x6y_1{0%{transform:translate(110%)}to{transform:translate(0)}}@keyframes _bbSlideOutToRight_18x6y_1{0%{transform:translate(0)}to{transform:translate(110%)}}@media(prefers-reduced-motion:reduce){._backdrop_18x6y_1{transition:none}._celebrationChip_18x6y_23,._panelOpen_18x6y_103,._panelClosed_18x6y_107{animation:none}}._header_18x6y_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_18x6y_155{position:relative;min-width:0;display:flex;justify-content:center;align-items:center}._title_18x6y_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_18x6y_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_18x6y_172:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._searchIconButton_18x6y_172:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._headerTitleWrap_18x6y_195{transition:opacity .18s ease,transform .22s ease}._headerSearchWrap_18x6y_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_18x6y_211 ._headerTitleWrap_18x6y_195{opacity:0;transform:translateY(2px);pointer-events:none}._headerSearchOpen_18x6y_211 ._headerSearchWrap_18x6y_199{opacity:1;transform:translateY(0);pointer-events:auto}._searchBar_18x6y_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_18x6y_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_18x6y_235::-webkit-search-cancel-button,._searchInput_18x6y_235::-webkit-search-decoration,._searchInput_18x6y_235::-webkit-search-results-button,._searchInput_18x6y_235::-webkit-search-results-decoration{-webkit-appearance:none;-moz-appearance:none;appearance:none}._searchClearButton_18x6y_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_18x6y_256:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._searchClearButton_18x6y_256:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._closeButton_18x6y_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_18x6y_278:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._closeButton_18x6y_278:disabled{opacity:.6;cursor:not-allowed}._closeButton_18x6y_278:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}@media(prefers-reduced-motion:reduce){._headerTitleWrap_18x6y_195,._headerSearchWrap_18x6y_199{transition:none}}._body_18x6y_312{padding:var(--bb-body-padding, 8px 16px);overflow:auto}._muted_18x6y_317{color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65));margin:0 0 12px}._error_18x6y_322{color:var(--bb-error-color, #b91c1c);margin:0 0 12px}._variants_18x6y_327{margin-top:4px}._variantList_18x6y_331{list-style:none;padding:0;margin:0;display:grid;gap:10px}._variantRow_18x6y_339{display:grid;grid-template-columns:1fr auto;gap:0px;align-items:stretch;padding:5px}._variantRowSoldOut_18x6y_347{opacity:.65}._variantLeft_18x6y_351{min-width:0;display:flex;gap:12px;align-items:center}._addToBundleButton_18x6y_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_18x6y_358:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._addToBundleButton_18x6y_358:disabled{opacity:.6;cursor:not-allowed}._addToBundleButton_18x6y_358:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._soldOutContainer_18x6y_386{display:flex;align-items:center;justify-content:center;height:100%;padding:0 16px}._soldOut_18x6y_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}._variantThumb_18x6y_403{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_18x6y_413{width:100%;height:100%;object-fit:cover;display:block}._variantThumbFallback_18x6y_420{width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-weight:800;color:var(--bb-text-color, #111827)}._variantInfo_18x6y_430{min-width:0}._variantName_18x6y_434{font-size:14px;font-weight:600;margin-bottom:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._variantMeta_18x6y_443{font-size:12px;color:var(--bb-muted-color, rgba(17, 24, 39, .6));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._variantPriceRow_18x6y_451{display:flex;align-items:baseline;gap:8px;margin-top:4px}._variantCompareAt_18x6y_458{font-size:12px;color:var(--bb-muted-color, rgba(17, 24, 39, .6));text-decoration:line-through}._variantPrice_18x6y_451{font-size:13px;font-weight:800}._qtyControls_18x6y_469{display:inline-flex;align-items:center;gap:6px}._qtyButton_18x6y_475{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_18x6y_475:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._qtyButton_18x6y_475:disabled{opacity:.6;cursor:not-allowed}._qtyButton_18x6y_475:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._qtyValue_18x6y_501{min-width:18px;text-align:center;font-variant-numeric:tabular-nums;font-weight:700}._footer_18x6y_508{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_18x6y_516{font-size:10px;color:var(rgba(17, 24, 39, .6));text-align:center;margin-top:10px}._poweredBy_18x6y_516 a{color:inherit;text-decoration:none}._boxSummaryWindow_18x6y_528{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_18x6y_528::-webkit-scrollbar{display:none}._boxSummaryRow_18x6y_546{--bb-box-gap: 10px;display:flex;align-items:flex-start;gap:var(--bb-box-gap);width:100%}._boxSlot_18x6y_554{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_18x6y_563{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_18x6y_575{cursor:pointer}._boxItemClickable_18x6y_575:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._boxThresholdLabel_18x6y_584{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_18x6y_595{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_18x6y_601{border:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));background:var(--bb-surface-bg, #ffffff);overflow:hidden}._boxItemThreshold_18x6y_607{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_18x6y_615{font-size:12px;font-weight:800;text-align:center;line-height:1.1;padding:6px}._boxItemPlus_18x6y_623{font-size:22px;font-weight:700;opacity:.5;line-height:1}._boxItemImage_18x6y_630{width:100%;height:100%;object-fit:cover;display:block}._boxItemFallback_18x6y_637{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_18x6y_648{display:flex;gap:8px;width:100%;transition:gap .3s cubic-bezier(.4,0,.2,1)}._ctaButtonGroupAnimating_18x6y_655{gap:0}._cta_18x6y_648{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_18x6y_671{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_18x6y_683{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_18x6y_701{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_18x6y_701>span{opacity:0}._ctaDualRight_18x6y_714{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_18x6y_730{border-top-left-radius:0;border-bottom-left-radius:0;border-left-width:0;opacity:.6}._ctaDualRightAnimating_18x6y_730>span{opacity:0}._ctaTotals_18x6y_741{display:flex;justify-content:space-between;align-items:baseline;gap:10px;font-variant-numeric:tabular-nums}._ctaDiscountBadge_18x6y_749{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_18x6y_763{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_18x6y_776{max-height:40px;opacity:1;transform:translateY(0);margin-bottom:8px}._ctaTotalsStrike_18x6y_783{opacity:.85;text-decoration:line-through;font-weight:700;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65))}._ctaTotalsPrice_18x6y_790{font-weight:900;color:var(--bb-text-color, #111827)}@media(prefers-reduced-motion:reduce){._ctaTotalsWrap_18x6y_763{transition:none}}._cta_18x6y_648:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._cta_18x6y_648:disabled{opacity:.6;cursor:not-allowed}._cta_18x6y_648:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaSecondary_18x6y_671:hover{background:var(--bb-cta-bg, #2563eb);color:var(--bb-cta-text, #ffffff)}._ctaSecondary_18x6y_671:disabled{opacity:.6;cursor:not-allowed}._ctaSecondary_18x6y_671:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaDualLeft_18x6y_683:hover{background:var(--bb-cta-bg, #2563eb);color:var(--bb-cta-text, #ffffff)}._ctaDualLeft_18x6y_683:disabled{opacity:.6;cursor:not-allowed}._ctaDualLeft_18x6y_683:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaDualRight_18x6y_714:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._ctaDualRight_18x6y_714:disabled{opacity:.6;cursor:not-allowed}._ctaDualRight_18x6y_714:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._helperText_18x6y_859{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_18x6y_1{padding:0;justify-content:stretch}._panel_18x6y_82{width:100%;height:100%;border-radius:0}}._panel_1n9m6_2 button,._panel_1n9m6_2 input,._panel_1n9m6_2 [role=button]{box-sizing:border-box;margin:0}._panel_1n9m6_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_1n9m6_20{text-align:start}._title_1n9m6_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_1n9m6_32{font-size:13px;color:var(--bb-muted-color, rgba(15, 23, 42, .6))}._error_1n9m6_37{font-size:13px;color:#b91c1c;font-weight:600}._inactive_1n9m6_43{font-size:13px;color:#b45309;font-weight:600}._section_1n9m6_49{display:grid;gap:6px}._sectionTitle_1n9m6_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_1n9m6_63{display:flex;justify-content:center;gap:6px}._rulesList_1n9m6_69{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:6px;list-style:none;margin:0;padding:0}._ruleItem_1n9m6_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_1n9m6_92{font-weight:600;font-size:13px}._ruleDiscount_1n9m6_97{font-weight:700;font-size:13px}._ruleLabel_1n9m6_102{font-size:12px;opacity:.7}._rulesVisual_1n9m6_107{display:flex;flex-direction:column;gap:4px;width:100%}._rulesLabelsRow_1n9m6_114,._rulesLinesRow_1n9m6_121{display:flex;flex-direction:row;gap:4px;width:100%}._rulesLineLabelCell_1n9m6_128{flex:1 1 0;display:flex;align-items:flex-end;justify-content:center}._rulesLineLabelCell_1n9m6_128:empty{display:flex!important}._rulesLineLabel_1n9m6_128{font-size:11px;font-weight:600;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65))}._rulesLineLabelSpacer_1n9m6_145{height:1em}._rulesLine_1n9m6_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_1n9m6_121:empty{display:block!important}._rulesLineEmpty_1n9m6_162{background-color:var(--bb-tier-background, rgba(148, 163, 184, .22))}._rulesLineFilled_1n9m6_166{background-color:var(--bb-tier-border, rgba(37, 99, 235, .8))}._variants_1n9m6_170{display:grid;gap:12px;max-height:400px;overflow-y:auto;padding-right:6px}._variantList_1n9m6_178{list-style:none;padding:0;margin:0;display:grid;gap:10px}._variantRow_1n9m6_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_1n9m6_198{cursor:pointer}._variantRowSelected_1n9m6_202{border-color:#2563eb40;box-shadow:0 0 0 1px #2563eb14}._variantRowSoldOut_1n9m6_207{opacity:.65}._variantMedia_1n9m6_211{display:grid;align-items:start;justify-items:center;width:76px;aspect-ratio:1 / 1}._variantContent_1n9m6_219{display:flex;flex-direction:column;justify-content:space-between;gap:4px;height:100%}._variantHeader_1n9m6_227{display:flex;flex-direction:column;gap:4px}._variantTitle_1n9m6_233{font-weight:700;font-size:14px;color:var(--bb-text-color, #111827)}._variantDetailsRow_1n9m6_239{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto;gap:6px;align-items:start}._variantImage_1n9m6_247{width:100%;height:100%;border-radius:var(--bb-border-radius, 12px);object-fit:cover;background:#94a3b833}._variantImageFallback_1n9m6_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_1n9m6_268{font-size:12px;color:var(--bb-muted-color, rgba(15, 23, 42, .6))}._variantPrice_1n9m6_273{font-size:13px;font-weight:600;color:#0f172a}._variantFooterRow_1n9m6_279{display:flex;align-items:center;justify-content:space-between;width:100%}._variantActions_1n9m6_286{display:grid;align-items:end;justify-items:end}._qtyActions_1n9m6_292{display:inline-flex;align-items:center;gap:6px}._variantUnavailable_1n9m6_298{display:none}._qtyControls_1n9m6_302{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_1n9m6_312{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_1n9m6_312:disabled{cursor:not-allowed;opacity:.4}._qtyButton_1n9m6_312:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._qtyValue_1n9m6_336{min-width:22px;text-align:center;font-weight:600;font-size:13px}._soldOut_1n9m6_343{color:var(--bb-muted-color, rgba(17, 24, 39));font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase}._qtyChip_1n9m6_351{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_1n9m6_366{cursor:pointer}._qtyChipValue_1n9m6_370{min-width:14px;padding-left:3px;text-align:center}._qtyChipPlus_1n9m6_376{margin-bottom:-3px;font-weight:500}._qtyChipClear_1n9m6_381{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_1n9m6_351:hover ._qtyChipClear_1n9m6_381{background:#0f172a;color:#fff}._qtyTrash_1n9m6_400{width:22px;height:22px;border:0;background:transparent;color:#0f172a;display:grid;place-items:center;cursor:pointer;padding:0}._footer_1n9m6_412{display:grid;padding-top:6px}._boxSummaryWindow_1n9m6_417{margin-bottom:6px;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;padding-bottom:6px;scrollbar-width:none;-ms-overflow-style:none}._boxSummaryWindow_1n9m6_417::-webkit-scrollbar{display:none}._boxSummaryRow_1n9m6_431{--bb-box-gap: 10px;display:flex;align-items:flex-start;gap:var(--bb-box-gap);width:100%}._boxSlot_1n9m6_439{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_1n9m6_448{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_1n9m6_448:before{content:"";display:block;padding-bottom:100%}._boxItemFilled_1n9m6_465{border:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));background:var(--bb-surface-bg, #ffffff);overflow:hidden}._boxItemPlaceholder_1n9m6_471{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_1n9m6_477{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_1n9m6_485{cursor:pointer}._boxItemClickable_1n9m6_485:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._boxItemImage_1n9m6_494{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_1n9m6_505{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_1n9m6_518{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_1n9m6_530{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_1n9m6_543{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_1n9m6_554{max-height:0;padding-bottom:12px;opacity:0;overflow:hidden;transition:max-height .26s ease,opacity .2s ease}._totalsRevealOpen_1n9m6_562{max-height:80px;opacity:1}._ctaTotalsWrap_1n9m6_567{opacity:0;transition:opacity .18s ease .12s}._ctaTotalsWrapVisible_1n9m6_572{opacity:1}._ctaTotals_1n9m6_567{display:flex;justify-content:space-between;align-items:center;padding:10px 12px;border-radius:14px;background:#0f172a0a;font-size:13px;font-weight:600}._ctaDiscountBadge_1n9m6_587{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_1n9m6_598{text-decoration:line-through;color:#64748bcc;margin-right:6px}._ctaTotalsPrice_1n9m6_604{font-weight:700;color:#0f172a}._cta_1n9m6_567{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_1n9m6_567:hover{transform:translateY(-1px);background:var(--bb-cta-bg-hover, #0f172a)}._cta_1n9m6_567:disabled{cursor:not-allowed;transform:none;box-shadow:none;opacity:.6}._ctaButtonGroup_1n9m6_636{display:grid;grid-template-columns:1fr 1fr;gap:10px}._ctaDualLeft_1n9m6_642,._ctaDualRight_1n9m6_643{border:0;border-radius:var(--bb-border-radius, 12px);padding:12px 16px;min-height:44px;font-weight:700;font-size:13px;cursor:pointer}._ctaDualLeft_1n9m6_642{background:#fff;color:#0f172a;border:1px solid rgba(15,23,42,.15)}._ctaDualRight_1n9m6_643{background:var(--bb-cta-bg, #111827);color:var(--bb-cta-text, #ffffff)}._ctaDualLeft_1n9m6_642:disabled,._ctaDualRight_1n9m6_643:disabled{cursor:not-allowed;opacity:.6}._poweredBy_1n9m6_670{padding-top:12px;font-size:11px;color:#64748bcc;text-align:center}._poweredBy_1n9m6_670 a{color:inherit;text-decoration:none;font-weight:700}@media(max-width:640px){._panel_1n9m6_2{padding:16px}._variantRow_1n9m6_186{grid-template-columns:64px minmax(0,1fr);gap:10px}._qtyControls_1n9m6_302{justify-self:start}._variantDetailsRow_1n9m6_239{grid-template-columns:1fr}}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
-
import { jsx as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
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 l, jsxs as N, 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 = {
|
|
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
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
const
|
|
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, {
|
|
14
14
|
method: "GET",
|
|
15
15
|
signal: a.signal,
|
|
16
16
|
headers: { "Content-Type": "application/json" }
|
|
17
17
|
})).json().catch(() => null);
|
|
18
|
-
return !
|
|
18
|
+
return !o || typeof o != "object" ? { ok: !1, error: "Invalid response." } : o;
|
|
19
19
|
}
|
|
20
|
-
async function
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
const
|
|
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, {
|
|
24
24
|
method: "GET",
|
|
25
25
|
signal: a.signal,
|
|
26
26
|
headers: { "Content-Type": "application/json" }
|
|
27
27
|
})).json().catch(() => null);
|
|
28
|
-
return !
|
|
28
|
+
return !o || typeof o != "object" ? { ok: !1, error: "Invalid response." } : o;
|
|
29
29
|
}
|
|
30
|
-
async function
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
const
|
|
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, {
|
|
34
34
|
method: "GET",
|
|
35
35
|
signal: a.signal,
|
|
36
36
|
headers: { "Content-Type": "application/json" }
|
|
37
37
|
})).json().catch(() => null);
|
|
38
|
-
return !
|
|
38
|
+
return !o || typeof o != "object" ? { ok: !1, error: "Invalid response." } : o;
|
|
39
39
|
}
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
function pe(a) {
|
|
41
|
+
if (!a || a.availableForSale === !1) return 0;
|
|
42
|
+
if (a.inventoryPolicy === "CONTINUE" || a.sellableOnlineQuantity == null) return Number.POSITIVE_INFINITY;
|
|
43
|
+
const t = Number(a.sellableOnlineQuantity);
|
|
44
|
+
return !Number.isFinite(t) || t <= 0 && a.availableForSale === !0 ? Number.POSITIVE_INFINITY : Math.max(0, Math.floor(t));
|
|
45
|
+
}
|
|
46
|
+
const Te = "bb_anonymous_user_id";
|
|
47
|
+
function de() {
|
|
42
48
|
if (typeof window > "u" || typeof localStorage > "u")
|
|
43
49
|
return `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
|
|
44
50
|
try {
|
|
45
|
-
const a = localStorage.getItem(
|
|
51
|
+
const a = localStorage.getItem(Te);
|
|
46
52
|
if (a && typeof a == "string" && a.length > 0)
|
|
47
53
|
return a;
|
|
48
|
-
let
|
|
54
|
+
let t;
|
|
49
55
|
try {
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
52
|
-
|
|
56
|
+
const e = globalThis.crypto;
|
|
57
|
+
if (e != null && e.randomUUID)
|
|
58
|
+
t = e.randomUUID();
|
|
53
59
|
else
|
|
54
60
|
throw new Error("crypto.randomUUID not available");
|
|
55
61
|
} catch {
|
|
56
|
-
|
|
62
|
+
t = `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
|
|
57
63
|
}
|
|
58
|
-
return localStorage.setItem(
|
|
64
|
+
return localStorage.setItem(Te, t), t;
|
|
59
65
|
} catch {
|
|
60
66
|
return `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
|
|
61
67
|
}
|
|
62
68
|
}
|
|
63
|
-
async function
|
|
69
|
+
async function te(a, t, e) {
|
|
64
70
|
if (!(typeof window > "u"))
|
|
65
71
|
try {
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
const
|
|
72
|
+
const o = new URL(a, window.location.origin);
|
|
73
|
+
o.searchParams.set("shop", t);
|
|
74
|
+
const i = await fetch(o, {
|
|
69
75
|
method: "POST",
|
|
70
76
|
headers: {
|
|
71
77
|
"Content-Type": "application/json"
|
|
72
78
|
},
|
|
73
|
-
body: JSON.stringify(
|
|
79
|
+
body: JSON.stringify(e),
|
|
74
80
|
// Don't wait for response - fire and forget
|
|
75
81
|
keepalive: !0
|
|
76
82
|
});
|
|
77
|
-
|
|
78
|
-
`[Bundle Analytics] Event tracking failed with status ${
|
|
79
|
-
await
|
|
83
|
+
i.ok || console.warn(
|
|
84
|
+
`[Bundle Analytics] Event tracking failed with status ${i.status}:`,
|
|
85
|
+
await i.text().catch(() => "Unable to read response")
|
|
80
86
|
);
|
|
81
|
-
} catch (
|
|
82
|
-
console.warn("[Bundle Analytics] Failed to track event:",
|
|
87
|
+
} catch (o) {
|
|
88
|
+
console.warn("[Bundle Analytics] Failed to track event:", o);
|
|
83
89
|
}
|
|
84
90
|
}
|
|
85
|
-
const
|
|
86
|
-
function
|
|
87
|
-
const
|
|
88
|
-
return
|
|
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";
|
|
89
95
|
}
|
|
90
|
-
function
|
|
91
|
-
const
|
|
92
|
-
if (!
|
|
93
|
-
if (
|
|
94
|
-
const
|
|
95
|
-
return
|
|
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;
|
|
96
102
|
}
|
|
97
|
-
const
|
|
103
|
+
const He = {
|
|
98
104
|
primaryColor: "--bb-cta-bg",
|
|
99
105
|
primaryHoverColor: "--bb-cta-bg-hover",
|
|
100
106
|
primaryTextColor: "--bb-cta-text",
|
|
@@ -116,48 +122,48 @@ const Mt = {
|
|
|
116
122
|
celebrationBorderColor: "--bb-celebration-border",
|
|
117
123
|
fontFamilyBody: "--bb-font-family-body",
|
|
118
124
|
fontFamilyTitle: "--bb-font-family-title"
|
|
119
|
-
},
|
|
120
|
-
function
|
|
121
|
-
const
|
|
122
|
-
return
|
|
125
|
+
}, _e = "bb-google-fonts";
|
|
126
|
+
function Re(a) {
|
|
127
|
+
const t = (a ?? "").trim().replace(/^["']|["']$/g, "");
|
|
128
|
+
return t ? encodeURIComponent(t).replace(/%20/g, "+") : "";
|
|
123
129
|
}
|
|
124
|
-
function
|
|
125
|
-
var
|
|
130
|
+
function Qe(a) {
|
|
131
|
+
var d;
|
|
126
132
|
if (typeof document > "u" || !document.head) return;
|
|
127
133
|
if (!a) {
|
|
128
|
-
(
|
|
134
|
+
(d = document.getElementById(_e)) == null || d.remove();
|
|
129
135
|
return;
|
|
130
136
|
}
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
const
|
|
134
|
-
if (
|
|
135
|
-
|
|
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) {
|
|
141
|
+
i == null || i.remove();
|
|
136
142
|
return;
|
|
137
143
|
}
|
|
138
|
-
const
|
|
139
|
-
if (
|
|
140
|
-
|
|
144
|
+
const r = `https://fonts.googleapis.com/css2?${o.join("&")}&display=swap`;
|
|
145
|
+
if (i) {
|
|
146
|
+
i.getAttribute("href") !== r && i.setAttribute("href", r);
|
|
141
147
|
return;
|
|
142
148
|
}
|
|
143
|
-
const
|
|
144
|
-
|
|
149
|
+
const m = document.createElement("link");
|
|
150
|
+
m.id = _e, m.rel = "stylesheet", m.href = r, document.head.appendChild(m);
|
|
145
151
|
}
|
|
146
|
-
function
|
|
152
|
+
function Me(a) {
|
|
147
153
|
if (!a) return;
|
|
148
|
-
|
|
149
|
-
const
|
|
150
|
-
Object.entries(
|
|
151
|
-
let
|
|
152
|
-
|
|
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));
|
|
153
159
|
});
|
|
154
160
|
}
|
|
155
|
-
function
|
|
161
|
+
function Le(a) {
|
|
156
162
|
if (typeof window > "u") return a;
|
|
157
|
-
const
|
|
158
|
-
return
|
|
163
|
+
const t = window.__BUNDLE_PREVIEW_STYLES__;
|
|
164
|
+
return t && typeof t == "object" ? t : a;
|
|
159
165
|
}
|
|
160
|
-
function
|
|
166
|
+
function Ge() {
|
|
161
167
|
try {
|
|
162
168
|
const a = globalThis.crypto;
|
|
163
169
|
if (a != null && a.randomUUID) return a.randomUUID();
|
|
@@ -165,636 +171,704 @@ function Lt() {
|
|
|
165
171
|
}
|
|
166
172
|
return `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
|
|
167
173
|
}
|
|
168
|
-
function
|
|
174
|
+
function me(a) {
|
|
169
175
|
return Number.isFinite(a) ? Math.max(0, Math.floor(a)) : 0;
|
|
170
176
|
}
|
|
171
|
-
function
|
|
172
|
-
|
|
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;
|
|
180
|
+
}
|
|
181
|
+
function Ye(a, t) {
|
|
182
|
+
return !a && !t;
|
|
173
183
|
}
|
|
174
|
-
function
|
|
184
|
+
function li(a) {
|
|
175
185
|
const {
|
|
176
|
-
apiBaseUrl:
|
|
177
|
-
shop:
|
|
178
|
-
cartAdapter:
|
|
179
|
-
configHandle:
|
|
180
|
-
initialData:
|
|
181
|
-
configFetcher:
|
|
182
|
-
activeConfigsFetcher:
|
|
183
|
-
configStatusFetcher:
|
|
184
|
-
analyticsEndpoint:
|
|
185
|
-
allowDrawerWhenInactive:
|
|
186
|
-
children:
|
|
187
|
-
} = a,
|
|
188
|
-
!
|
|
189
|
-
), [
|
|
186
|
+
apiBaseUrl: t,
|
|
187
|
+
shop: e,
|
|
188
|
+
cartAdapter: o,
|
|
189
|
+
configHandle: i = "default",
|
|
190
|
+
initialData: r,
|
|
191
|
+
configFetcher: m,
|
|
192
|
+
activeConfigsFetcher: d,
|
|
193
|
+
configStatusFetcher: S,
|
|
194
|
+
analyticsEndpoint: ct,
|
|
195
|
+
allowDrawerWhenInactive: A = !1,
|
|
196
|
+
children: O
|
|
197
|
+
} = a, et = qt(i), C = ct ?? `${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, It] = q(() => r ? { [et]: r } : {}), [ht, zt] = q(Y), [kt, Ct] = q(
|
|
198
|
+
!Y && !r ? et : null
|
|
199
|
+
), [Nt, Dt] = q(null), [Rt, Wt] = q(null), [Xt, wt] = q(
|
|
190
200
|
() => ({ selections: {}, order: [] })
|
|
191
|
-
),
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
}, [
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
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;
|
|
207
|
+
}, {});
|
|
208
|
+
}, [o]), M = K(async () => {
|
|
209
|
+
const n = ++ft.current;
|
|
210
|
+
$t(!0);
|
|
211
|
+
try {
|
|
212
|
+
const s = await H();
|
|
213
|
+
return s && n === ft.current && ut(s), s;
|
|
214
|
+
} catch {
|
|
215
|
+
return null;
|
|
216
|
+
} finally {
|
|
217
|
+
n === ft.current && $t(!1);
|
|
218
|
+
}
|
|
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)
|
|
203
233
|
try {
|
|
204
|
-
const
|
|
205
|
-
|
|
234
|
+
const n = de();
|
|
235
|
+
te(C, e, {
|
|
206
236
|
eventType: "DRAWER_CLOSED",
|
|
207
|
-
shop:
|
|
208
|
-
anonymousUserId:
|
|
237
|
+
shop: e,
|
|
238
|
+
anonymousUserId: n,
|
|
209
239
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
210
240
|
mixpanelEvent: "bundle_closed"
|
|
211
|
-
}).catch((
|
|
212
|
-
console.warn("[Bundle Analytics] Failed to track drawer closed:",
|
|
241
|
+
}).catch((s) => {
|
|
242
|
+
console.warn("[Bundle Analytics] Failed to track drawer closed:", s);
|
|
213
243
|
});
|
|
214
|
-
} catch (
|
|
215
|
-
console.warn("[Bundle Analytics] Error in close() callback:",
|
|
244
|
+
} catch (n) {
|
|
245
|
+
console.warn("[Bundle Analytics] Error in close() callback:", n);
|
|
216
246
|
}
|
|
217
|
-
|
|
218
|
-
}, [
|
|
219
|
-
|
|
220
|
-
if (
|
|
221
|
-
if (
|
|
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)
|
|
222
252
|
try {
|
|
223
|
-
const
|
|
224
|
-
|
|
253
|
+
const s = de();
|
|
254
|
+
te(C, e, {
|
|
225
255
|
eventType: "DRAWER_OPENED",
|
|
226
|
-
shop:
|
|
227
|
-
anonymousUserId:
|
|
256
|
+
shop: e,
|
|
257
|
+
anonymousUserId: s,
|
|
228
258
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
229
259
|
mixpanelEvent: "bundle_opened"
|
|
230
|
-
}).catch((
|
|
231
|
-
console.warn("[Bundle Analytics] Failed to track drawer opened:",
|
|
260
|
+
}).catch((u) => {
|
|
261
|
+
console.warn("[Bundle Analytics] Failed to track drawer opened:", u);
|
|
232
262
|
});
|
|
233
|
-
} catch (
|
|
234
|
-
console.warn("[Bundle Analytics] Error in open() callback:",
|
|
263
|
+
} catch (s) {
|
|
264
|
+
console.warn("[Bundle Analytics] Error in open() callback:", s);
|
|
235
265
|
}
|
|
236
266
|
return !0;
|
|
237
267
|
});
|
|
238
|
-
}, [
|
|
239
|
-
if (!
|
|
240
|
-
const
|
|
241
|
-
return delete
|
|
242
|
-
}), !
|
|
243
|
-
...
|
|
244
|
-
[
|
|
245
|
-
currencyCode:
|
|
246
|
-
config:
|
|
247
|
-
eligibleVariants:
|
|
268
|
+
}, [C, e]), Ut = K((n, s) => !s.ok || s.config.isActive === !1 ? (It((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) : (It((u) => ({
|
|
273
|
+
...u,
|
|
274
|
+
[n]: {
|
|
275
|
+
currencyCode: s.currencyCode ?? null,
|
|
276
|
+
config: s.config,
|
|
277
|
+
eligibleVariants: s.eligibleVariants ?? []
|
|
248
278
|
}
|
|
249
|
-
})),
|
|
250
|
-
var
|
|
251
|
-
const
|
|
252
|
-
(
|
|
253
|
-
const
|
|
254
|
-
|
|
255
|
-
apiBaseUrl:
|
|
256
|
-
shop:
|
|
257
|
-
configHandle:
|
|
258
|
-
fresh: (
|
|
259
|
-
signal:
|
|
260
|
-
}).then((
|
|
261
|
-
|
|
262
|
-
}).catch((
|
|
263
|
-
if (
|
|
264
|
-
const
|
|
265
|
-
|
|
279
|
+
})), h.current === n && Z(null), !0), [A]), mt = K((n, s) => {
|
|
280
|
+
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);
|
|
266
296
|
}).finally(() => {
|
|
267
|
-
|
|
297
|
+
p.signal.aborted || Ct((g) => g === u ? null : g);
|
|
268
298
|
});
|
|
269
|
-
}, [
|
|
270
|
-
const
|
|
271
|
-
|
|
272
|
-
}, [
|
|
273
|
-
var
|
|
274
|
-
const
|
|
275
|
-
if (
|
|
276
|
-
|
|
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 });
|
|
277
307
|
return;
|
|
278
308
|
}
|
|
279
|
-
if (
|
|
280
|
-
|
|
309
|
+
if (dt(u), A) {
|
|
310
|
+
L(), mt(u, { blocking: !p });
|
|
281
311
|
return;
|
|
282
312
|
}
|
|
283
|
-
if ((
|
|
284
|
-
|
|
313
|
+
if ((g = p == null ? void 0 : p.config) != null && g.isActive) {
|
|
314
|
+
Z(null), L(), mt(u, { blocking: !1 });
|
|
285
315
|
return;
|
|
286
316
|
}
|
|
287
|
-
|
|
288
|
-
const
|
|
289
|
-
|
|
290
|
-
apiBaseUrl:
|
|
291
|
-
shop:
|
|
292
|
-
configHandle:
|
|
293
|
-
signal:
|
|
294
|
-
}).then((
|
|
295
|
-
if (!
|
|
296
|
-
if (
|
|
297
|
-
|
|
317
|
+
Dt(u), (x = Lt.current) == null || x.abort();
|
|
318
|
+
const y = new AbortController();
|
|
319
|
+
Lt.current = y, $({
|
|
320
|
+
apiBaseUrl: t,
|
|
321
|
+
shop: e,
|
|
322
|
+
configHandle: u,
|
|
323
|
+
signal: y.signal
|
|
324
|
+
}).then((k) => {
|
|
325
|
+
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);
|
|
298
328
|
return;
|
|
299
329
|
}
|
|
300
|
-
|
|
330
|
+
Z(null), dt(u), L(), mt(u, { blocking: !0 });
|
|
301
331
|
}
|
|
302
332
|
}).catch(() => {
|
|
303
|
-
|
|
333
|
+
y.signal.aborted || Dt((k) => k === u ? null : k);
|
|
304
334
|
});
|
|
305
335
|
}, [
|
|
306
|
-
|
|
307
|
-
e,
|
|
308
|
-
q,
|
|
309
|
-
Q,
|
|
336
|
+
A,
|
|
310
337
|
t,
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
}, [
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
338
|
+
L,
|
|
339
|
+
mt,
|
|
340
|
+
e,
|
|
341
|
+
$,
|
|
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();
|
|
322
352
|
return;
|
|
323
353
|
}
|
|
324
|
-
|
|
325
|
-
}, [
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
}, [
|
|
329
|
-
var
|
|
330
|
-
if (!
|
|
331
|
-
|
|
354
|
+
M(), vt(h.current, "api");
|
|
355
|
+
}, [Q, X, vt, M]);
|
|
356
|
+
F(() => {
|
|
357
|
+
dt(qt(i));
|
|
358
|
+
}, [i]), F(() => {
|
|
359
|
+
var s;
|
|
360
|
+
if (!Y) {
|
|
361
|
+
zt(!1), r || mt(et, { blocking: !0 });
|
|
332
362
|
return;
|
|
333
363
|
}
|
|
334
|
-
(
|
|
335
|
-
const
|
|
336
|
-
return
|
|
337
|
-
|
|
338
|
-
const
|
|
339
|
-
for (const [
|
|
340
|
-
|
|
341
|
-
currencyCode:
|
|
342
|
-
config:
|
|
343
|
-
eligibleVariants:
|
|
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 && It((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 ?? []
|
|
344
374
|
};
|
|
345
|
-
return
|
|
375
|
+
return y;
|
|
346
376
|
});
|
|
347
377
|
}).catch(() => {
|
|
348
378
|
}).finally(() => {
|
|
349
|
-
|
|
350
|
-
}), () =>
|
|
351
|
-
}, [
|
|
352
|
-
|
|
353
|
-
}, [
|
|
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(() => {
|
|
354
384
|
if (typeof window > "u") return;
|
|
355
|
-
const
|
|
356
|
-
var
|
|
357
|
-
const
|
|
358
|
-
|
|
385
|
+
const n = () => {
|
|
386
|
+
var u;
|
|
387
|
+
const s = ke(window.location.hash);
|
|
388
|
+
s && ((u = B.current) == null || u.call(B, s, "hash"));
|
|
359
389
|
};
|
|
360
|
-
return
|
|
390
|
+
return n(), window.addEventListener("hashchange", n), () => window.removeEventListener("hashchange", n);
|
|
361
391
|
}, []);
|
|
362
|
-
const
|
|
363
|
-
|
|
364
|
-
const
|
|
365
|
-
|
|
366
|
-
}, [
|
|
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 || Nt === 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(() => {
|
|
367
397
|
if (typeof window > "u") return;
|
|
368
|
-
const
|
|
369
|
-
const
|
|
370
|
-
|
|
398
|
+
const n = () => {
|
|
399
|
+
const s = Le(void 0);
|
|
400
|
+
s && Me(s);
|
|
371
401
|
};
|
|
372
|
-
return window.addEventListener("bundle-preview-styles-updated",
|
|
373
|
-
}, []),
|
|
402
|
+
return window.addEventListener("bundle-preview-styles-updated", n), () => window.removeEventListener("bundle-preview-styles-updated", n);
|
|
403
|
+
}, []), F(() => {
|
|
374
404
|
if (typeof window > "u") return;
|
|
375
|
-
const
|
|
376
|
-
const
|
|
377
|
-
if (!
|
|
378
|
-
const
|
|
379
|
-
|
|
380
|
-
var
|
|
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
|
+
It((y) => {
|
|
410
|
+
var g;
|
|
381
411
|
return {
|
|
382
|
-
...
|
|
383
|
-
[
|
|
384
|
-
currencyCode:
|
|
385
|
-
config:
|
|
386
|
-
eligibleVariants:
|
|
412
|
+
...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) ?? []
|
|
387
417
|
}
|
|
388
418
|
};
|
|
389
|
-
}),
|
|
419
|
+
}), n.__BUNDLE_PREVIEW_VARIANTS_LOADING__ === !0 ? Ct(h.current) : Ct((y) => y === h.current ? null : y);
|
|
390
420
|
};
|
|
391
|
-
return
|
|
392
|
-
}, [
|
|
393
|
-
const
|
|
394
|
-
const
|
|
395
|
-
return Math.max(2, Math.min(100,
|
|
396
|
-
}, [
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
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 le = T(() => {
|
|
424
|
+
const n = Number((v == null ? void 0 : v.maxBundleSize) ?? Number.NaN), s = Number.isFinite(n) ? Math.floor(n) : 100;
|
|
425
|
+
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)];
|
|
432
|
+
})
|
|
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]), ce = K((n, s) => {
|
|
439
|
+
if (gt || !St.has(n) && !st)
|
|
403
440
|
return;
|
|
404
|
-
const
|
|
405
|
-
|
|
406
|
-
const
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
else
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
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, le - 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 I = y.order[Zt];
|
|
461
|
+
if (I === n && it > 0) {
|
|
462
|
+
it--;
|
|
422
463
|
continue;
|
|
423
464
|
}
|
|
424
|
-
|
|
465
|
+
tt.push(I);
|
|
425
466
|
}
|
|
426
|
-
|
|
467
|
+
tt.reverse(), pt = tt;
|
|
427
468
|
}
|
|
428
|
-
if (
|
|
429
|
-
const
|
|
430
|
-
if (
|
|
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)
|
|
431
472
|
try {
|
|
432
|
-
const
|
|
473
|
+
const it = de(), tt = {
|
|
433
474
|
eventType: "VARIANT_SELECTION_CHANGED",
|
|
434
|
-
shop:
|
|
435
|
-
anonymousUserId:
|
|
436
|
-
before: { ...
|
|
437
|
-
after: { ...
|
|
475
|
+
shop: e,
|
|
476
|
+
anonymousUserId: it,
|
|
477
|
+
before: { ...y.selections },
|
|
478
|
+
after: { ...at },
|
|
438
479
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
439
480
|
};
|
|
440
|
-
|
|
441
|
-
...
|
|
481
|
+
te(C, e, tt), Gt === 0 && Yt >= 1 && te(C, e, {
|
|
482
|
+
...tt,
|
|
442
483
|
mixpanelEvent: "bundle_started"
|
|
443
|
-
}),
|
|
444
|
-
...
|
|
484
|
+
}), Gt < Ot && Yt >= Ot && te(C, e, {
|
|
485
|
+
...tt,
|
|
445
486
|
mixpanelEvent: "bundle_completed"
|
|
446
487
|
});
|
|
447
488
|
} catch {
|
|
448
489
|
}
|
|
449
|
-
return { selections:
|
|
490
|
+
return { selections: at, order: pt };
|
|
450
491
|
});
|
|
451
|
-
}, [
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
const
|
|
455
|
-
|
|
492
|
+
}, [C, gt, St, st, le, 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);
|
|
502
|
+
});
|
|
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 };
|
|
456
504
|
});
|
|
457
|
-
}, [
|
|
458
|
-
|
|
459
|
-
}, [
|
|
460
|
-
const
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
const
|
|
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);
|
|
512
|
+
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((I) => {
|
|
518
|
+
const lt = pe(I);
|
|
519
|
+
if (!Number.isFinite(lt)) return [I.id, lt];
|
|
520
|
+
const Kt = me((p ?? j)[I.id] ?? 0);
|
|
521
|
+
return [I.id, Math.max(0, Math.floor(lt) - Kt)];
|
|
522
|
+
})
|
|
523
|
+
), g = Object.entries(Bt).map(([I, lt]) => ({
|
|
524
|
+
merchandiseId: I,
|
|
525
|
+
quantity: ye(lt, y.get(I) ?? 0)
|
|
526
|
+
})).filter((I) => I.quantity > 0).filter((I) => St.has(I.merchandiseId)).map((I) => ({
|
|
464
527
|
merchandiseId: I.merchandiseId,
|
|
465
528
|
quantity: I.quantity,
|
|
466
529
|
attributes: [
|
|
467
|
-
{ key:
|
|
468
|
-
{ key:
|
|
469
|
-
{ key:
|
|
470
|
-
...
|
|
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 }] : []
|
|
471
534
|
]
|
|
472
535
|
}));
|
|
473
|
-
if (!
|
|
474
|
-
const
|
|
475
|
-
let
|
|
476
|
-
for (const
|
|
477
|
-
const
|
|
478
|
-
if (
|
|
479
|
-
const
|
|
480
|
-
Number.isFinite(
|
|
536
|
+
if (!g.length) return;
|
|
537
|
+
const x = new Map(xt.map((I) => [I.id, I]));
|
|
538
|
+
let k = 0;
|
|
539
|
+
for (const I of g) {
|
|
540
|
+
const lt = I.quantity ?? 0;
|
|
541
|
+
if (lt <= 0) continue;
|
|
542
|
+
const Kt = x.get(I.merchandiseId), Be = Number(Kt == null ? void 0 : Kt.price);
|
|
543
|
+
Number.isFinite(Be) && (k += Be * lt);
|
|
481
544
|
}
|
|
482
|
-
|
|
483
|
-
const
|
|
484
|
-
let
|
|
485
|
-
for (const I of
|
|
486
|
-
|
|
487
|
-
const
|
|
488
|
-
const I = Number.parseFloat(
|
|
545
|
+
k = Math.round(k * 100) / 100;
|
|
546
|
+
const D = [...v.rules ?? []].sort((I, lt) => I.minBundleSize - lt.minBundleSize);
|
|
547
|
+
let P = null;
|
|
548
|
+
for (const I of D)
|
|
549
|
+
At >= I.minBundleSize && (P = I);
|
|
550
|
+
const G = P ? (() => {
|
|
551
|
+
const I = Number.parseFloat(P.discountPercent);
|
|
489
552
|
return Number.isFinite(I) && I > 0 ? I : null;
|
|
490
|
-
})() : null,
|
|
491
|
-
|
|
553
|
+
})() : null, at = G ? Math.round(k * (1 - G / 100) * 100) / 100 : k, pt = k - at, Gt = g.map((I) => I.merchandiseId), Yt = (P == null ? void 0 : P.handle) ?? "", it = ((tt = P == null ? void 0 : P.label) == null ? void 0 : tt.trim()) || "";
|
|
554
|
+
z(!0);
|
|
492
555
|
try {
|
|
493
|
-
if (
|
|
556
|
+
if (n != null && n.checkout ? await o.linesAddForCheckout(g) : await o.linesAdd(g), C)
|
|
494
557
|
try {
|
|
495
|
-
const I =
|
|
496
|
-
|
|
558
|
+
const I = de(), lt = !!(n != null && n.checkout);
|
|
559
|
+
te(C, e, {
|
|
497
560
|
eventType: "BUNDLE_ADDED_TO_BASKET",
|
|
498
|
-
shop:
|
|
561
|
+
shop: e,
|
|
499
562
|
anonymousUserId: I,
|
|
500
|
-
bundleId:
|
|
501
|
-
productVariantIds:
|
|
502
|
-
grossPrice:
|
|
503
|
-
discountedPrice:
|
|
504
|
-
currency:
|
|
505
|
-
discountThresholdIdentifier:
|
|
506
|
-
discountLabel:
|
|
507
|
-
discountPercentage:
|
|
508
|
-
discountedAmount:
|
|
563
|
+
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,
|
|
509
572
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
510
|
-
checkout:
|
|
511
|
-
mixpanelEvent:
|
|
573
|
+
checkout: lt,
|
|
574
|
+
mixpanelEvent: lt ? "checkout_started_with_bundle" : "bundle_added_to_cart"
|
|
512
575
|
});
|
|
513
576
|
} catch {
|
|
514
577
|
}
|
|
515
|
-
|
|
578
|
+
Et(), Q(), M(), (Zt = n == null ? void 0 : n.onComplete) == null || Zt.call(n), Z(null);
|
|
579
|
+
} catch (I) {
|
|
580
|
+
const lt = I instanceof Error ? I.message : "", Kt = /stock|sold out|inventory|insufficient|available|422/i.test(lt);
|
|
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();
|
|
516
584
|
} finally {
|
|
517
|
-
|
|
585
|
+
z(!1);
|
|
518
586
|
}
|
|
519
587
|
}, [
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
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({
|
|
535
605
|
onComplete: () => {
|
|
536
|
-
var
|
|
537
|
-
(
|
|
606
|
+
var n;
|
|
607
|
+
(n = o.openCartUI) == null || n.call(o);
|
|
538
608
|
}
|
|
539
609
|
});
|
|
540
|
-
}, [
|
|
541
|
-
await
|
|
610
|
+
}, [o, Qt]), ie = K(async () => {
|
|
611
|
+
await Qt({
|
|
542
612
|
checkout: !0,
|
|
543
613
|
onComplete: () => {
|
|
544
|
-
var
|
|
545
|
-
(
|
|
614
|
+
var n;
|
|
615
|
+
(n = o.navigateToCheckout) == null || n.call(o);
|
|
546
616
|
}
|
|
547
617
|
});
|
|
548
|
-
}, [
|
|
549
|
-
isOpen:
|
|
550
|
-
open:
|
|
551
|
-
openForHandle:
|
|
552
|
-
close:
|
|
553
|
-
toggle:
|
|
554
|
-
currentHandle:
|
|
555
|
-
setConfigHandle:
|
|
556
|
-
loadHandle:
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
618
|
+
}, [o, Qt]), c = 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: ce,
|
|
638
|
+
clearSelections: Et,
|
|
639
|
+
bundleSize: At,
|
|
640
|
+
minRequired: Ot,
|
|
641
|
+
canSubmit: Ht,
|
|
642
|
+
submit: ae,
|
|
643
|
+
submitAndCheckout: ie
|
|
572
644
|
}), [
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
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,
|
|
581
659
|
re,
|
|
582
|
-
|
|
660
|
+
Bt,
|
|
583
661
|
W,
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
Ze,
|
|
593
|
-
Ue,
|
|
594
|
-
j,
|
|
595
|
-
Pe
|
|
662
|
+
Jt,
|
|
663
|
+
ee,
|
|
664
|
+
ne,
|
|
665
|
+
ce,
|
|
666
|
+
ae,
|
|
667
|
+
ie,
|
|
668
|
+
J,
|
|
669
|
+
rt
|
|
596
670
|
]);
|
|
597
|
-
return /* @__PURE__ */
|
|
671
|
+
return /* @__PURE__ */ l(De.Provider, { value: c, children: O });
|
|
598
672
|
}
|
|
599
|
-
function
|
|
600
|
-
const a =
|
|
673
|
+
function be() {
|
|
674
|
+
const a = Ve(De);
|
|
601
675
|
if (!a)
|
|
602
676
|
throw new Error("useBundleBuilder must be used within <BundleProvider />");
|
|
603
677
|
return a;
|
|
604
678
|
}
|
|
605
|
-
function
|
|
606
|
-
const { isOpen: a, open:
|
|
607
|
-
return { isOpen: a, open:
|
|
679
|
+
function ci() {
|
|
680
|
+
const { isOpen: a, open: t, close: e, toggle: o } = be();
|
|
681
|
+
return { isOpen: a, open: t, close: e, toggle: o };
|
|
608
682
|
}
|
|
609
|
-
const
|
|
610
|
-
button:
|
|
683
|
+
const Ke = "_button_18rtl_1", Xe = {
|
|
684
|
+
button: Ke
|
|
611
685
|
};
|
|
612
|
-
function
|
|
613
|
-
const { toggle:
|
|
614
|
-
return /* @__PURE__ */
|
|
686
|
+
function ui(a) {
|
|
687
|
+
const { toggle: t } = be();
|
|
688
|
+
return /* @__PURE__ */ l(
|
|
615
689
|
"button",
|
|
616
690
|
{
|
|
617
691
|
type: "button",
|
|
618
|
-
onClick:
|
|
619
|
-
className: [
|
|
692
|
+
onClick: t,
|
|
693
|
+
className: [Xe.button, a.className].filter(Boolean).join(" "),
|
|
620
694
|
children: a.children ?? "Build a bundle"
|
|
621
695
|
}
|
|
622
696
|
);
|
|
623
697
|
}
|
|
624
|
-
var
|
|
625
|
-
function
|
|
626
|
-
if (
|
|
627
|
-
|
|
698
|
+
var ge, Pe;
|
|
699
|
+
function Je() {
|
|
700
|
+
if (Pe) return ge;
|
|
701
|
+
Pe = 1;
|
|
628
702
|
var a = {
|
|
629
|
-
linear: function(e,
|
|
630
|
-
var
|
|
631
|
-
return
|
|
703
|
+
linear: function(t, e, o, i) {
|
|
704
|
+
var r = o - e;
|
|
705
|
+
return r * t / i + e;
|
|
632
706
|
},
|
|
633
|
-
easeInQuad: function(e,
|
|
634
|
-
var
|
|
635
|
-
return
|
|
707
|
+
easeInQuad: function(t, e, o, i) {
|
|
708
|
+
var r = o - e;
|
|
709
|
+
return r * (t /= i) * t + e;
|
|
636
710
|
},
|
|
637
|
-
easeOutQuad: function(e,
|
|
638
|
-
var
|
|
639
|
-
return -
|
|
711
|
+
easeOutQuad: function(t, e, o, i) {
|
|
712
|
+
var r = o - e;
|
|
713
|
+
return -r * (t /= i) * (t - 2) + e;
|
|
640
714
|
},
|
|
641
|
-
easeInOutQuad: function(e,
|
|
642
|
-
var
|
|
643
|
-
return (
|
|
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;
|
|
644
718
|
},
|
|
645
|
-
easeInCubic: function(e,
|
|
646
|
-
var
|
|
647
|
-
return
|
|
719
|
+
easeInCubic: function(t, e, o, i) {
|
|
720
|
+
var r = o - e;
|
|
721
|
+
return r * (t /= i) * t * t + e;
|
|
648
722
|
},
|
|
649
|
-
easeOutCubic: function(e,
|
|
650
|
-
var
|
|
651
|
-
return
|
|
723
|
+
easeOutCubic: function(t, e, o, i) {
|
|
724
|
+
var r = o - e;
|
|
725
|
+
return r * ((t = t / i - 1) * t * t + 1) + e;
|
|
652
726
|
},
|
|
653
|
-
easeInOutCubic: function(e,
|
|
654
|
-
var
|
|
655
|
-
return (
|
|
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;
|
|
656
730
|
},
|
|
657
|
-
easeInQuart: function(e,
|
|
658
|
-
var
|
|
659
|
-
return
|
|
731
|
+
easeInQuart: function(t, e, o, i) {
|
|
732
|
+
var r = o - e;
|
|
733
|
+
return r * (t /= i) * t * t * t + e;
|
|
660
734
|
},
|
|
661
|
-
easeOutQuart: function(e,
|
|
662
|
-
var
|
|
663
|
-
return -
|
|
735
|
+
easeOutQuart: function(t, e, o, i) {
|
|
736
|
+
var r = o - e;
|
|
737
|
+
return -r * ((t = t / i - 1) * t * t * t - 1) + e;
|
|
664
738
|
},
|
|
665
|
-
easeInOutQuart: function(e,
|
|
666
|
-
var
|
|
667
|
-
return (
|
|
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;
|
|
668
742
|
},
|
|
669
|
-
easeInQuint: function(e,
|
|
670
|
-
var
|
|
671
|
-
return
|
|
743
|
+
easeInQuint: function(t, e, o, i) {
|
|
744
|
+
var r = o - e;
|
|
745
|
+
return r * (t /= i) * t * t * t * t + e;
|
|
672
746
|
},
|
|
673
|
-
easeOutQuint: function(e,
|
|
674
|
-
var
|
|
675
|
-
return
|
|
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;
|
|
676
750
|
},
|
|
677
|
-
easeInOutQuint: function(e,
|
|
678
|
-
var
|
|
679
|
-
return (
|
|
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;
|
|
680
754
|
},
|
|
681
|
-
easeInSine: function(e,
|
|
682
|
-
var
|
|
683
|
-
return -
|
|
755
|
+
easeInSine: function(t, e, o, i) {
|
|
756
|
+
var r = o - e;
|
|
757
|
+
return -r * Math.cos(t / i * (Math.PI / 2)) + r + e;
|
|
684
758
|
},
|
|
685
|
-
easeOutSine: function(e,
|
|
686
|
-
var
|
|
687
|
-
return
|
|
759
|
+
easeOutSine: function(t, e, o, i) {
|
|
760
|
+
var r = o - e;
|
|
761
|
+
return r * Math.sin(t / i * (Math.PI / 2)) + e;
|
|
688
762
|
},
|
|
689
|
-
easeInOutSine: function(e,
|
|
690
|
-
var
|
|
691
|
-
return -
|
|
763
|
+
easeInOutSine: function(t, e, o, i) {
|
|
764
|
+
var r = o - e;
|
|
765
|
+
return -r / 2 * (Math.cos(Math.PI * t / i) - 1) + e;
|
|
692
766
|
},
|
|
693
|
-
easeInExpo: function(e,
|
|
694
|
-
var
|
|
695
|
-
return
|
|
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;
|
|
696
770
|
},
|
|
697
|
-
easeOutExpo: function(e,
|
|
698
|
-
var
|
|
699
|
-
return
|
|
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;
|
|
700
774
|
},
|
|
701
|
-
easeInOutExpo: function(e,
|
|
702
|
-
var
|
|
703
|
-
return
|
|
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;
|
|
704
778
|
},
|
|
705
|
-
easeInCirc: function(e,
|
|
706
|
-
var
|
|
707
|
-
return -
|
|
779
|
+
easeInCirc: function(t, e, o, i) {
|
|
780
|
+
var r = o - e;
|
|
781
|
+
return -r * (Math.sqrt(1 - (t /= i) * t) - 1) + e;
|
|
708
782
|
},
|
|
709
|
-
easeOutCirc: function(e,
|
|
710
|
-
var
|
|
711
|
-
return
|
|
783
|
+
easeOutCirc: function(t, e, o, i) {
|
|
784
|
+
var r = o - e;
|
|
785
|
+
return r * Math.sqrt(1 - (t = t / i - 1) * t) + e;
|
|
712
786
|
},
|
|
713
|
-
easeInOutCirc: function(e,
|
|
714
|
-
var
|
|
715
|
-
return (
|
|
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;
|
|
716
790
|
},
|
|
717
|
-
easeInElastic: function(e,
|
|
718
|
-
var
|
|
719
|
-
return
|
|
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);
|
|
720
794
|
},
|
|
721
|
-
easeOutElastic: function(e,
|
|
722
|
-
var
|
|
723
|
-
return
|
|
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);
|
|
724
798
|
},
|
|
725
|
-
easeInOutElastic: function(e,
|
|
726
|
-
var
|
|
727
|
-
return
|
|
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);
|
|
728
802
|
},
|
|
729
|
-
easeInBack: function(e,
|
|
730
|
-
var
|
|
731
|
-
return
|
|
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;
|
|
732
806
|
},
|
|
733
|
-
easeOutBack: function(e,
|
|
734
|
-
var
|
|
735
|
-
return
|
|
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;
|
|
736
810
|
},
|
|
737
|
-
easeInOutBack: function(e,
|
|
738
|
-
var
|
|
739
|
-
return
|
|
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;
|
|
740
814
|
},
|
|
741
|
-
easeInBounce: function(e,
|
|
742
|
-
var
|
|
743
|
-
return
|
|
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;
|
|
744
818
|
},
|
|
745
|
-
easeOutBounce: function(e,
|
|
746
|
-
var
|
|
747
|
-
return (
|
|
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;
|
|
748
822
|
},
|
|
749
|
-
easeInOutBounce: function(e,
|
|
750
|
-
var
|
|
751
|
-
return
|
|
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);
|
|
752
826
|
}
|
|
753
827
|
};
|
|
754
|
-
return
|
|
828
|
+
return ge = a, ge;
|
|
755
829
|
}
|
|
756
|
-
var
|
|
757
|
-
function
|
|
830
|
+
var Ze = Je();
|
|
831
|
+
function tn(a) {
|
|
758
832
|
return a * Math.PI / 180;
|
|
759
833
|
}
|
|
760
|
-
function
|
|
761
|
-
return a + Math.random() * (
|
|
834
|
+
function _t(a, t) {
|
|
835
|
+
return a + Math.random() * (t - a);
|
|
762
836
|
}
|
|
763
|
-
function
|
|
764
|
-
return Math.floor(a + Math.random() * (
|
|
837
|
+
function en(a, t) {
|
|
838
|
+
return Math.floor(a + Math.random() * (t - a + 1));
|
|
765
839
|
}
|
|
766
|
-
var
|
|
840
|
+
var se;
|
|
767
841
|
(function(a) {
|
|
768
842
|
a[a.Circle = 0] = "Circle", a[a.Square = 1] = "Square", a[a.Strip = 2] = "Strip";
|
|
769
|
-
})(
|
|
770
|
-
var
|
|
843
|
+
})(se || (se = {}));
|
|
844
|
+
var Vt;
|
|
771
845
|
(function(a) {
|
|
772
846
|
a[a.Positive = 1] = "Positive", a[a.Negative = -1] = "Negative";
|
|
773
|
-
})(
|
|
774
|
-
const
|
|
775
|
-
class
|
|
776
|
-
constructor(e,
|
|
777
|
-
this.getOptions =
|
|
778
|
-
const { colors:
|
|
779
|
-
this.context =
|
|
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;
|
|
780
854
|
}
|
|
781
|
-
update(
|
|
782
|
-
const { gravity:
|
|
783
|
-
this.x += this.vx *
|
|
784
|
-
const
|
|
785
|
-
if (this.rotateY +=
|
|
786
|
-
|
|
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);
|
|
787
861
|
else
|
|
788
862
|
switch (this.shape) {
|
|
789
|
-
case
|
|
863
|
+
case se.Circle: {
|
|
790
864
|
this.context.beginPath(), this.context.arc(0, 0, this.radius, 0, 2 * Math.PI), this.context.fill();
|
|
791
865
|
break;
|
|
792
866
|
}
|
|
793
|
-
case
|
|
867
|
+
case se.Square: {
|
|
794
868
|
this.context.fillRect(-this.w / 2, -this.h / 2, this.w, this.h);
|
|
795
869
|
break;
|
|
796
870
|
}
|
|
797
|
-
case
|
|
871
|
+
case se.Strip: {
|
|
798
872
|
this.context.fillRect(-this.w / 6, -this.h / 2, this.w / 3, this.h);
|
|
799
873
|
break;
|
|
800
874
|
}
|
|
@@ -802,39 +876,39 @@ class Ut {
|
|
|
802
876
|
this.context.closePath(), this.context.restore();
|
|
803
877
|
}
|
|
804
878
|
}
|
|
805
|
-
class
|
|
806
|
-
constructor(
|
|
807
|
-
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 = (
|
|
808
|
-
this.particles.splice(
|
|
879
|
+
class an {
|
|
880
|
+
constructor(t, e) {
|
|
881
|
+
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
|
+
this.particles.splice(i, 1);
|
|
809
883
|
}, this.getParticle = () => {
|
|
810
|
-
const
|
|
811
|
-
return new
|
|
812
|
-
}, this.animate = (
|
|
813
|
-
const { canvas:
|
|
814
|
-
if (!
|
|
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);
|
|
886
|
+
}, this.animate = (i) => {
|
|
887
|
+
const { canvas: r, context: m, particlesGenerated: d, lastNumberOfPieces: S } = this, { run: ct, recycle: A, numberOfPieces: O, debug: et, tweenFunction: C, tweenDuration: Y } = this.getOptions();
|
|
888
|
+
if (!ct)
|
|
815
889
|
return !1;
|
|
816
|
-
const
|
|
817
|
-
if (
|
|
818
|
-
|
|
819
|
-
const
|
|
820
|
-
for (let
|
|
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++)
|
|
821
895
|
this.particles.push(this.getParticle());
|
|
822
|
-
this.particlesGenerated +=
|
|
896
|
+
this.particlesGenerated += z;
|
|
823
897
|
}
|
|
824
|
-
|
|
825
|
-
for (let
|
|
826
|
-
const
|
|
827
|
-
|
|
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));
|
|
828
902
|
}
|
|
829
|
-
return
|
|
830
|
-
}, this.canvas =
|
|
831
|
-
const
|
|
832
|
-
if (!
|
|
903
|
+
return X > 0 || ot < O;
|
|
904
|
+
}, this.canvas = t;
|
|
905
|
+
const o = this.canvas.getContext("2d");
|
|
906
|
+
if (!o)
|
|
833
907
|
throw new Error("Could not get canvas context");
|
|
834
|
-
this.context =
|
|
908
|
+
this.context = o, this.getOptions = e;
|
|
835
909
|
}
|
|
836
910
|
}
|
|
837
|
-
const
|
|
911
|
+
const Ie = {
|
|
838
912
|
width: typeof window < "u" ? window.innerWidth : 300,
|
|
839
913
|
height: typeof window < "u" ? window.innerHeight : 200,
|
|
840
914
|
numberOfPieces: 200,
|
|
@@ -864,15 +938,15 @@ const ht = {
|
|
|
864
938
|
],
|
|
865
939
|
opacity: 1,
|
|
866
940
|
debug: !1,
|
|
867
|
-
tweenFunction:
|
|
941
|
+
tweenFunction: Ze.easeInOutQuad,
|
|
868
942
|
tweenDuration: 5e3,
|
|
869
943
|
recycle: !0,
|
|
870
944
|
run: !0
|
|
871
945
|
};
|
|
872
|
-
class
|
|
873
|
-
constructor(
|
|
874
|
-
this.lastFrameTime = 0, this.setOptionsWithDefaults = (
|
|
875
|
-
const
|
|
946
|
+
class on {
|
|
947
|
+
constructor(t, e) {
|
|
948
|
+
this.lastFrameTime = 0, this.setOptionsWithDefaults = (i) => {
|
|
949
|
+
const r = {
|
|
876
950
|
confettiSource: {
|
|
877
951
|
x: 0,
|
|
878
952
|
y: 0,
|
|
@@ -881,56 +955,56 @@ class Gt {
|
|
|
881
955
|
}
|
|
882
956
|
};
|
|
883
957
|
this._options = {
|
|
884
|
-
...
|
|
885
|
-
...
|
|
886
|
-
...
|
|
887
|
-
}, Object.assign(this,
|
|
888
|
-
}, this.update = (
|
|
889
|
-
const { options: { run:
|
|
890
|
-
if (
|
|
958
|
+
...r,
|
|
959
|
+
...Ie,
|
|
960
|
+
...i
|
|
961
|
+
}, Object.assign(this, i.confettiSource);
|
|
962
|
+
}, this.update = (i = 0) => {
|
|
963
|
+
const { options: { run: r, onConfettiComplete: m, frameRate: d }, canvas: S, context: ct } = this, A = Math.min(i - this.lastFrameTime, 50);
|
|
964
|
+
if (d && A < 1e3 / d) {
|
|
891
965
|
this.rafId = requestAnimationFrame(this.update);
|
|
892
966
|
return;
|
|
893
967
|
}
|
|
894
|
-
this.lastFrameTime =
|
|
968
|
+
this.lastFrameTime = i - (d ? A % d : 0), r && (ct.fillStyle = "white", ct.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);
|
|
895
969
|
}, this.reset = () => {
|
|
896
970
|
this.generator && this.generator.particlesGenerated > 0 && (this.generator.particlesGenerated = 0, this.generator.particles = [], this.generator.lastNumberOfPieces = 0);
|
|
897
971
|
}, this.stop = () => {
|
|
898
972
|
this.options = { run: !1 }, this.rafId && (cancelAnimationFrame(this.rafId), this.rafId = void 0);
|
|
899
|
-
}, this.canvas =
|
|
900
|
-
const
|
|
901
|
-
if (!
|
|
973
|
+
}, this.canvas = t;
|
|
974
|
+
const o = this.canvas.getContext("2d");
|
|
975
|
+
if (!o)
|
|
902
976
|
throw new Error("Could not get canvas context");
|
|
903
|
-
this.context =
|
|
977
|
+
this.context = o, this.generator = new an(this.canvas, () => this.options), this.options = e, this.update();
|
|
904
978
|
}
|
|
905
979
|
get options() {
|
|
906
980
|
return this._options;
|
|
907
981
|
}
|
|
908
|
-
set options(
|
|
909
|
-
var
|
|
910
|
-
const
|
|
911
|
-
this.setOptionsWithDefaults(
|
|
982
|
+
set options(t) {
|
|
983
|
+
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();
|
|
912
986
|
}
|
|
913
987
|
}
|
|
914
|
-
const
|
|
915
|
-
class
|
|
916
|
-
constructor(
|
|
917
|
-
super(
|
|
988
|
+
const sn = fe.createRef();
|
|
989
|
+
class Ne extends fe.Component {
|
|
990
|
+
constructor(t) {
|
|
991
|
+
super(t), this.canvas = fe.createRef(), this.canvas = t.canvasRef || sn;
|
|
918
992
|
}
|
|
919
993
|
componentDidMount() {
|
|
920
994
|
if (this.canvas.current) {
|
|
921
|
-
const
|
|
922
|
-
this.confetti = new
|
|
995
|
+
const t = we(this.props)[0];
|
|
996
|
+
this.confetti = new on(this.canvas.current, t);
|
|
923
997
|
}
|
|
924
998
|
}
|
|
925
999
|
componentDidUpdate() {
|
|
926
|
-
const
|
|
927
|
-
this.confetti && (this.confetti.options =
|
|
1000
|
+
const t = we(this.props)[0];
|
|
1001
|
+
this.confetti && (this.confetti.options = t);
|
|
928
1002
|
}
|
|
929
1003
|
componentWillUnmount() {
|
|
930
1004
|
this.confetti && this.confetti.stop(), this.confetti = void 0;
|
|
931
1005
|
}
|
|
932
1006
|
render() {
|
|
933
|
-
const [
|
|
1007
|
+
const [t, e] = we(this.props), o = {
|
|
934
1008
|
zIndex: 2,
|
|
935
1009
|
position: "absolute",
|
|
936
1010
|
pointerEvents: "none",
|
|
@@ -938,45 +1012,45 @@ class mt extends at.Component {
|
|
|
938
1012
|
left: 0,
|
|
939
1013
|
bottom: 0,
|
|
940
1014
|
right: 0,
|
|
941
|
-
...
|
|
1015
|
+
...e.style
|
|
942
1016
|
};
|
|
943
|
-
return
|
|
1017
|
+
return l("canvas", { width: t.width, height: t.height, ref: this.canvas, ...e, style: o });
|
|
944
1018
|
}
|
|
945
1019
|
}
|
|
946
|
-
|
|
947
|
-
...
|
|
1020
|
+
Ne.defaultProps = {
|
|
1021
|
+
...Ie
|
|
948
1022
|
};
|
|
949
|
-
|
|
950
|
-
function
|
|
951
|
-
const
|
|
952
|
-
...Object.keys(
|
|
1023
|
+
Ne.displayName = "ReactConfetti";
|
|
1024
|
+
function we(a) {
|
|
1025
|
+
const t = {}, e = {}, o = {}, i = [
|
|
1026
|
+
...Object.keys(Ie),
|
|
953
1027
|
"confettiSource",
|
|
954
1028
|
"drawShape",
|
|
955
1029
|
"onConfettiComplete",
|
|
956
1030
|
"frameRate"
|
|
957
|
-
],
|
|
958
|
-
for (const
|
|
959
|
-
const
|
|
960
|
-
|
|
1031
|
+
], 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;
|
|
961
1035
|
}
|
|
962
|
-
return [
|
|
1036
|
+
return [t, o, e];
|
|
963
1037
|
}
|
|
964
|
-
const
|
|
1038
|
+
const ln = fe.forwardRef((a, t) => l(Ne, { canvasRef: t, ...a }));
|
|
965
1039
|
/**
|
|
966
1040
|
* @license lucide-react v0.515.0 - ISC
|
|
967
1041
|
*
|
|
968
1042
|
* This source code is licensed under the ISC license.
|
|
969
1043
|
* See the LICENSE file in the root directory of this source tree.
|
|
970
1044
|
*/
|
|
971
|
-
const
|
|
1045
|
+
const cn = (a) => a.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), un = (a) => a.replace(
|
|
972
1046
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
973
|
-
(
|
|
974
|
-
),
|
|
975
|
-
const
|
|
976
|
-
return
|
|
977
|
-
},
|
|
978
|
-
for (const
|
|
979
|
-
if (
|
|
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")
|
|
980
1054
|
return !0;
|
|
981
1055
|
};
|
|
982
1056
|
/**
|
|
@@ -985,7 +1059,7 @@ const Yt = (a) => a.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Xt = (
|
|
|
985
1059
|
* This source code is licensed under the ISC license.
|
|
986
1060
|
* See the LICENSE file in the root directory of this source tree.
|
|
987
1061
|
*/
|
|
988
|
-
var
|
|
1062
|
+
var hn = {
|
|
989
1063
|
xmlns: "http://www.w3.org/2000/svg",
|
|
990
1064
|
width: 24,
|
|
991
1065
|
height: 24,
|
|
@@ -1002,32 +1076,32 @@ var Jt = {
|
|
|
1002
1076
|
* This source code is licensed under the ISC license.
|
|
1003
1077
|
* See the LICENSE file in the root directory of this source tree.
|
|
1004
1078
|
*/
|
|
1005
|
-
const
|
|
1079
|
+
const mn = $e(
|
|
1006
1080
|
({
|
|
1007
1081
|
color: a = "currentColor",
|
|
1008
|
-
size:
|
|
1009
|
-
strokeWidth:
|
|
1010
|
-
absoluteStrokeWidth:
|
|
1011
|
-
className:
|
|
1012
|
-
children:
|
|
1013
|
-
iconNode:
|
|
1014
|
-
...
|
|
1015
|
-
},
|
|
1082
|
+
size: t = 24,
|
|
1083
|
+
strokeWidth: e = 2,
|
|
1084
|
+
absoluteStrokeWidth: o,
|
|
1085
|
+
className: i = "",
|
|
1086
|
+
children: r,
|
|
1087
|
+
iconNode: m,
|
|
1088
|
+
...d
|
|
1089
|
+
}, S) => Ce(
|
|
1016
1090
|
"svg",
|
|
1017
1091
|
{
|
|
1018
|
-
ref:
|
|
1019
|
-
...
|
|
1020
|
-
width:
|
|
1021
|
-
height:
|
|
1092
|
+
ref: S,
|
|
1093
|
+
...hn,
|
|
1094
|
+
width: t,
|
|
1095
|
+
height: t,
|
|
1022
1096
|
stroke: a,
|
|
1023
|
-
strokeWidth:
|
|
1024
|
-
className:
|
|
1025
|
-
...!
|
|
1026
|
-
...
|
|
1097
|
+
strokeWidth: o ? Number(e) * 24 / Number(t) : e,
|
|
1098
|
+
className: Ee("lucide", i),
|
|
1099
|
+
...!r && !dn(d) && { "aria-hidden": "true" },
|
|
1100
|
+
...d
|
|
1027
1101
|
},
|
|
1028
1102
|
[
|
|
1029
|
-
...
|
|
1030
|
-
...Array.isArray(
|
|
1103
|
+
...m.map(([ct, A]) => Ce(ct, A)),
|
|
1104
|
+
...Array.isArray(r) ? r : [r]
|
|
1031
1105
|
]
|
|
1032
1106
|
)
|
|
1033
1107
|
);
|
|
@@ -1037,20 +1111,20 @@ const en = St(
|
|
|
1037
1111
|
* This source code is licensed under the ISC license.
|
|
1038
1112
|
* See the LICENSE file in the root directory of this source tree.
|
|
1039
1113
|
*/
|
|
1040
|
-
const
|
|
1041
|
-
const
|
|
1042
|
-
({ className:
|
|
1043
|
-
ref:
|
|
1044
|
-
iconNode:
|
|
1045
|
-
className:
|
|
1046
|
-
`lucide-${
|
|
1114
|
+
const Se = (a, t) => {
|
|
1115
|
+
const e = $e(
|
|
1116
|
+
({ className: o, ...i }, r) => Ce(mn, {
|
|
1117
|
+
ref: r,
|
|
1118
|
+
iconNode: t,
|
|
1119
|
+
className: Ee(
|
|
1120
|
+
`lucide-${cn(Fe(a))}`,
|
|
1047
1121
|
`lucide-${a}`,
|
|
1048
|
-
|
|
1122
|
+
o
|
|
1049
1123
|
),
|
|
1050
|
-
...
|
|
1124
|
+
...i
|
|
1051
1125
|
})
|
|
1052
1126
|
);
|
|
1053
|
-
return
|
|
1127
|
+
return e.displayName = Fe(a), e;
|
|
1054
1128
|
};
|
|
1055
1129
|
/**
|
|
1056
1130
|
* @license lucide-react v0.515.0 - ISC
|
|
@@ -1058,323 +1132,327 @@ const ft = (a, e) => {
|
|
|
1058
1132
|
* This source code is licensed under the ISC license.
|
|
1059
1133
|
* See the LICENSE file in the root directory of this source tree.
|
|
1060
1134
|
*/
|
|
1061
|
-
const
|
|
1135
|
+
const fn = [
|
|
1062
1136
|
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
1063
1137
|
["path", { d: "M12 5v14", key: "s699le" }]
|
|
1064
|
-
],
|
|
1138
|
+
], Oe = Se("plus", fn);
|
|
1065
1139
|
/**
|
|
1066
1140
|
* @license lucide-react v0.515.0 - ISC
|
|
1067
1141
|
*
|
|
1068
1142
|
* This source code is licensed under the ISC license.
|
|
1069
1143
|
* See the LICENSE file in the root directory of this source tree.
|
|
1070
1144
|
*/
|
|
1071
|
-
const
|
|
1145
|
+
const bn = [
|
|
1072
1146
|
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
1073
1147
|
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
1074
|
-
],
|
|
1148
|
+
], pn = Se("search", bn);
|
|
1075
1149
|
/**
|
|
1076
1150
|
* @license lucide-react v0.515.0 - ISC
|
|
1077
1151
|
*
|
|
1078
1152
|
* This source code is licensed under the ISC license.
|
|
1079
1153
|
* See the LICENSE file in the root directory of this source tree.
|
|
1080
1154
|
*/
|
|
1081
|
-
const
|
|
1155
|
+
const _n = [
|
|
1082
1156
|
["path", { d: "M3 6h18", key: "d0wm0j" }],
|
|
1083
1157
|
["path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6", key: "4alrt4" }],
|
|
1084
1158
|
["path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2", key: "v07s0e" }],
|
|
1085
1159
|
["line", { x1: "10", x2: "10", y1: "11", y2: "17", key: "1uufr5" }],
|
|
1086
1160
|
["line", { x1: "14", x2: "14", y1: "11", y2: "17", key: "xtxkd" }]
|
|
1087
|
-
],
|
|
1088
|
-
backdrop:
|
|
1089
|
-
celebrationOverlay:
|
|
1090
|
-
celebrationChip:
|
|
1091
|
-
backdropOpen:
|
|
1092
|
-
backdropClosed:
|
|
1093
|
-
panel:
|
|
1094
|
-
panelOpen:
|
|
1095
|
-
panelClosed:
|
|
1096
|
-
header:
|
|
1097
|
-
headerCenter:
|
|
1098
|
-
title:
|
|
1099
|
-
searchIconButton:
|
|
1100
|
-
headerTitleWrap:
|
|
1101
|
-
headerSearchWrap:
|
|
1102
|
-
headerSearchOpen:
|
|
1103
|
-
searchBar:
|
|
1104
|
-
searchInput:
|
|
1105
|
-
searchClearButton:
|
|
1106
|
-
closeButton:
|
|
1107
|
-
body:
|
|
1108
|
-
muted:
|
|
1109
|
-
error:
|
|
1110
|
-
variants:
|
|
1111
|
-
variantList:
|
|
1112
|
-
variantRow:
|
|
1113
|
-
variantRowSoldOut:
|
|
1114
|
-
variantLeft:
|
|
1115
|
-
addToBundleButton:
|
|
1116
|
-
soldOutContainer:
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
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", In = "_panel_ta0om_82", Nn = "_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", lr = "_qtyButton_ta0om_499", cr = "_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", Ir = "_boxItemFallback_ta0om_661", Nr = "_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: In,
|
|
1168
|
+
panelOpen: Nn,
|
|
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: lr,
|
|
1206
|
+
qtyValue: cr,
|
|
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: Ir,
|
|
1222
|
+
ctaButtonGroup: Nr,
|
|
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
|
|
1158
1235
|
};
|
|
1159
|
-
function
|
|
1160
|
-
var ae,
|
|
1236
|
+
function di(a) {
|
|
1237
|
+
var ae, ie;
|
|
1161
1238
|
const {
|
|
1162
|
-
isOpen:
|
|
1163
|
-
close:
|
|
1164
|
-
loading:
|
|
1165
|
-
submitting:
|
|
1166
|
-
error:
|
|
1167
|
-
currencyCode:
|
|
1168
|
-
config:
|
|
1169
|
-
eligibleVariants:
|
|
1170
|
-
selections:
|
|
1171
|
-
selectionOrder:
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1239
|
+
isOpen: t,
|
|
1240
|
+
close: e,
|
|
1241
|
+
loading: o,
|
|
1242
|
+
submitting: i,
|
|
1243
|
+
error: r,
|
|
1244
|
+
currencyCode: m,
|
|
1245
|
+
config: d,
|
|
1246
|
+
eligibleVariants: S,
|
|
1247
|
+
selections: ct,
|
|
1248
|
+
selectionOrder: A,
|
|
1249
|
+
getVariantMaxSelectableQuantity: O,
|
|
1250
|
+
setQuantity: et,
|
|
1251
|
+
bundleSize: C,
|
|
1252
|
+
minRequired: Y,
|
|
1175
1253
|
canSubmit: X,
|
|
1176
|
-
submit:
|
|
1177
|
-
submitAndCheckout:
|
|
1178
|
-
} =
|
|
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, It] = q(0), [ht, zt] = q(null), [kt, Ct] = q(!1), Nt = V(null), Dt = V(C), Rt = 7e3, [Wt, Xt] = q(0), [wt, jt] = q(null), [Mt, Lt] = q(!1), ft = V(null), h = 2800, _ = [
|
|
1179
1257
|
"#2563eb",
|
|
1180
1258
|
"#3b82f6",
|
|
1181
1259
|
"#60a5fa",
|
|
1182
1260
|
"#93c5fd",
|
|
1183
1261
|
"#bae6fd",
|
|
1184
1262
|
"#e0f2fe"
|
|
1185
|
-
], w =
|
|
1186
|
-
var
|
|
1187
|
-
const
|
|
1188
|
-
return Array.isArray(
|
|
1189
|
-
(
|
|
1190
|
-
) : [...
|
|
1191
|
-
}, [(ae =
|
|
1192
|
-
const
|
|
1193
|
-
return Number.isFinite(
|
|
1194
|
-
},
|
|
1195
|
-
const
|
|
1196
|
-
var
|
|
1197
|
-
const
|
|
1198
|
-
return !(!
|
|
1263
|
+
], w = T(() => {
|
|
1264
|
+
var n;
|
|
1265
|
+
const c = (n = d == null ? void 0 : d.styleSettings) == null ? void 0 : n.confettiColors;
|
|
1266
|
+
return Array.isArray(c) && c.length >= 6 ? c.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 = (c) => {
|
|
1270
|
+
const n = Number.parseFloat(c);
|
|
1271
|
+
return Number.isFinite(n) ? String(Math.round(n)) : c;
|
|
1272
|
+
}, R = (c) => {
|
|
1273
|
+
const n = (c ?? []).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");
|
|
1199
1277
|
});
|
|
1200
|
-
return
|
|
1201
|
-
},
|
|
1202
|
-
var
|
|
1203
|
-
return ((
|
|
1204
|
-
},
|
|
1205
|
-
const
|
|
1206
|
-
return [
|
|
1207
|
-
}, [
|
|
1208
|
-
const
|
|
1209
|
-
if (!Number.isFinite(
|
|
1210
|
-
if (
|
|
1278
|
+
return n.length ? n.map((s) => `${s.name}: ${s.value}`).join(" · ") : null;
|
|
1279
|
+
}, E = (c) => {
|
|
1280
|
+
var n;
|
|
1281
|
+
return ((n = c.product) == null ? void 0 : n.title) ?? c.displayName ?? c.title;
|
|
1282
|
+
}, $ = (c) => {
|
|
1283
|
+
const n = E(c), s = R(c.selectedOptions);
|
|
1284
|
+
return [n, s].filter(Boolean).join(" — ");
|
|
1285
|
+
}, [H, M] = q(t), W = V(null), Q = (c) => {
|
|
1286
|
+
const n = Number(c);
|
|
1287
|
+
if (!Number.isFinite(n)) return c;
|
|
1288
|
+
if (m)
|
|
1211
1289
|
try {
|
|
1212
|
-
return new Intl.NumberFormat(void 0, { style: "currency", currency:
|
|
1290
|
+
return new Intl.NumberFormat(void 0, { style: "currency", currency: m }).format(n);
|
|
1213
1291
|
} catch {
|
|
1214
1292
|
}
|
|
1215
|
-
return `$${
|
|
1216
|
-
},
|
|
1217
|
-
const
|
|
1218
|
-
return Math.max(2, Math.min(100,
|
|
1219
|
-
}, [
|
|
1220
|
-
const
|
|
1221
|
-
if (!
|
|
1222
|
-
const
|
|
1223
|
-
var
|
|
1224
|
-
const
|
|
1225
|
-
|
|
1226
|
-
for (const
|
|
1227
|
-
|
|
1228
|
-
const
|
|
1229
|
-
return
|
|
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 c = Number((d == null ? void 0 : d.maxBundleSize) ?? NaN), n = Number.isFinite(c) ? Math.floor(c) : 100;
|
|
1296
|
+
return Math.max(2, Math.min(100, n));
|
|
1297
|
+
}, [d == null ? void 0 : d.maxBundleSize]), mt = C >= Ut, Jt = T(() => [...S].sort((c, n) => c.displayName.localeCompare(n.displayName)), [S]), vt = T(() => {
|
|
1298
|
+
const c = Z.trim().toLowerCase();
|
|
1299
|
+
if (!c) return Jt;
|
|
1300
|
+
const n = c.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));
|
|
1230
1308
|
};
|
|
1231
|
-
return
|
|
1232
|
-
}, [
|
|
1233
|
-
let
|
|
1234
|
-
for (const
|
|
1235
|
-
|
|
1236
|
-
return
|
|
1237
|
-
}, [
|
|
1238
|
-
if (!
|
|
1239
|
-
const
|
|
1240
|
-
return !Number.isFinite(
|
|
1241
|
-
}, [
|
|
1242
|
-
const
|
|
1243
|
-
let
|
|
1244
|
-
for (const [
|
|
1245
|
-
const
|
|
1246
|
-
if (
|
|
1247
|
-
const
|
|
1248
|
-
Number.isFinite(
|
|
1309
|
+
return Jt.filter(s);
|
|
1310
|
+
}, [Z, Jt]), nt = T(() => [...(d == null ? void 0 : d.rules) ?? []].sort((c, n) => c.minBundleSize - n.minBundleSize), [d == null ? void 0 : d.rules]), rt = T(() => Math.max(0, Y - C), [C, Y]), bt = T(() => {
|
|
1311
|
+
let c = null;
|
|
1312
|
+
for (const n of nt)
|
|
1313
|
+
C >= n.minBundleSize && (c = n);
|
|
1314
|
+
return c;
|
|
1315
|
+
}, [C, nt]), v = T(() => {
|
|
1316
|
+
if (!bt) return null;
|
|
1317
|
+
const c = Number.parseFloat(bt.discountPercent);
|
|
1318
|
+
return !Number.isFinite(c) || c <= 0 ? null : c;
|
|
1319
|
+
}, [bt]), xt = nt[0], Pt = !!(xt && C >= xt.minBundleSize), st = T(() => {
|
|
1320
|
+
const c = new Map(S.map((s) => [s.id, s]));
|
|
1321
|
+
let n = 0;
|
|
1322
|
+
for (const [s, u] of Object.entries(ct)) {
|
|
1323
|
+
const p = u ?? 0;
|
|
1324
|
+
if (p <= 0) continue;
|
|
1325
|
+
const y = c.get(s), g = Number(y == null ? void 0 : y.price);
|
|
1326
|
+
Number.isFinite(g) && (n += g * p);
|
|
1249
1327
|
}
|
|
1250
|
-
return Math.round(
|
|
1251
|
-
}, [
|
|
1252
|
-
if (!
|
|
1253
|
-
const
|
|
1254
|
-
return Math.round(
|
|
1255
|
-
}, [
|
|
1256
|
-
const
|
|
1257
|
-
return
|
|
1258
|
-
}, [
|
|
1259
|
-
var
|
|
1260
|
-
const
|
|
1261
|
-
for (const
|
|
1262
|
-
const
|
|
1263
|
-
|
|
1264
|
-
discountPercent:
|
|
1265
|
-
minBundleSize:
|
|
1266
|
-
label: ((
|
|
1328
|
+
return Math.round(n * 100) / 100;
|
|
1329
|
+
}, [S, ct]), le = T(() => {
|
|
1330
|
+
if (!v) return st;
|
|
1331
|
+
const c = st * (1 - v / 100);
|
|
1332
|
+
return Math.round(c * 100) / 100;
|
|
1333
|
+
}, [v, st]), Ft = T(() => nt.length ? Math.max(...nt.map((c) => c.minBundleSize)) : 0, [nt]), St = T(() => {
|
|
1334
|
+
const c = new Map(S.map((n) => [n.id, n]));
|
|
1335
|
+
return A.map((n) => c.get(n)).filter((n) => !!n);
|
|
1336
|
+
}, [S, A]), Ot = T(() => {
|
|
1337
|
+
var n;
|
|
1338
|
+
const c = /* @__PURE__ */ new Map();
|
|
1339
|
+
for (const s of nt) {
|
|
1340
|
+
const u = Math.max(0, s.minBundleSize - 1);
|
|
1341
|
+
c.set(u, {
|
|
1342
|
+
discountPercent: s.discountPercent,
|
|
1343
|
+
minBundleSize: s.minBundleSize,
|
|
1344
|
+
label: ((n = s.label) == null ? void 0 : n.trim()) || `Buy ${s.minBundleSize}+`
|
|
1267
1345
|
});
|
|
1268
1346
|
}
|
|
1269
|
-
return
|
|
1270
|
-
}, [
|
|
1271
|
-
|
|
1272
|
-
if (((
|
|
1273
|
-
const
|
|
1274
|
-
|
|
1347
|
+
return c;
|
|
1348
|
+
}, [nt]), ce = 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));
|
|
1275
1353
|
}
|
|
1276
|
-
|
|
1277
|
-
}, [
|
|
1278
|
-
const
|
|
1279
|
-
const
|
|
1280
|
-
if (!
|
|
1281
|
-
const
|
|
1282
|
-
if (!
|
|
1283
|
-
const
|
|
1284
|
-
if (
|
|
1285
|
-
const
|
|
1286
|
-
|
|
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 = (c) => {
|
|
1357
|
+
const n = re.current;
|
|
1358
|
+
if (!n) return;
|
|
1359
|
+
const s = n.querySelector(`[data-variant-row="${c}"]`);
|
|
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" });
|
|
1287
1365
|
};
|
|
1288
|
-
return
|
|
1289
|
-
if (!
|
|
1290
|
-
const
|
|
1291
|
-
|
|
1366
|
+
return F(() => {
|
|
1367
|
+
if (!t) return;
|
|
1368
|
+
const c = (n) => {
|
|
1369
|
+
n.key === "Escape" && e();
|
|
1292
1370
|
};
|
|
1293
|
-
return window.addEventListener("keydown",
|
|
1294
|
-
}, [
|
|
1371
|
+
return window.addEventListener("keydown", c), () => window.removeEventListener("keydown", c);
|
|
1372
|
+
}, [e, t]), F(() => {
|
|
1295
1373
|
if (typeof window > "u") return;
|
|
1296
|
-
const
|
|
1297
|
-
return
|
|
1298
|
-
}, []),
|
|
1299
|
-
if (
|
|
1300
|
-
|
|
1374
|
+
const c = () => dt({ width: window.innerWidth, height: window.innerHeight });
|
|
1375
|
+
return c(), window.addEventListener("resize", c), () => window.removeEventListener("resize", c);
|
|
1376
|
+
}, []), F(() => {
|
|
1377
|
+
if (W.current != null && (window.clearTimeout(W.current), W.current = null), t) {
|
|
1378
|
+
M(!0);
|
|
1301
1379
|
return;
|
|
1302
1380
|
}
|
|
1303
|
-
|
|
1304
|
-
|
|
1381
|
+
W.current = window.setTimeout(() => {
|
|
1382
|
+
M(!1), W.current = null;
|
|
1305
1383
|
}, 220);
|
|
1306
|
-
}, [
|
|
1307
|
-
|
|
1308
|
-
}, []),
|
|
1309
|
-
|
|
1310
|
-
}, []),
|
|
1311
|
-
|
|
1312
|
-
}, []),
|
|
1313
|
-
if (!
|
|
1314
|
-
const
|
|
1315
|
-
var
|
|
1316
|
-
return (
|
|
1384
|
+
}, [t]), F(() => () => {
|
|
1385
|
+
W.current != null && window.clearTimeout(W.current);
|
|
1386
|
+
}, []), F(() => () => {
|
|
1387
|
+
Nt.current != null && window.clearTimeout(Nt.current);
|
|
1388
|
+
}, []), F(() => () => {
|
|
1389
|
+
ft.current != null && window.clearTimeout(ft.current);
|
|
1390
|
+
}, []), F(() => {
|
|
1391
|
+
if (!t || !z) return;
|
|
1392
|
+
const c = requestAnimationFrame(() => {
|
|
1393
|
+
var n;
|
|
1394
|
+
return (n = $t.current) == null ? void 0 : n.focus();
|
|
1317
1395
|
});
|
|
1318
|
-
return () => cancelAnimationFrame(
|
|
1319
|
-
}, [
|
|
1320
|
-
const
|
|
1321
|
-
if (
|
|
1322
|
-
const
|
|
1323
|
-
if (!
|
|
1324
|
-
const
|
|
1325
|
-
if (
|
|
1326
|
-
const
|
|
1327
|
-
const
|
|
1328
|
-
if (!
|
|
1329
|
-
const
|
|
1330
|
-
if (
|
|
1331
|
-
const
|
|
1332
|
-
|
|
1396
|
+
return () => cancelAnimationFrame(c);
|
|
1397
|
+
}, [t, z]), F(() => {
|
|
1398
|
+
const c = Ht.current;
|
|
1399
|
+
if (Ht.current = C, C <= c) 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" });
|
|
1333
1411
|
});
|
|
1334
|
-
return () => cancelAnimationFrame(
|
|
1335
|
-
}, [
|
|
1336
|
-
if (!
|
|
1337
|
-
const
|
|
1338
|
-
if (
|
|
1339
|
-
const
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
},
|
|
1343
|
-
}, [
|
|
1344
|
-
if (!
|
|
1345
|
-
const
|
|
1346
|
-
var
|
|
1347
|
-
const
|
|
1348
|
-
x:
|
|
1349
|
-
y:
|
|
1412
|
+
return () => cancelAnimationFrame(y);
|
|
1413
|
+
}, [C, nt]), F(() => {
|
|
1414
|
+
if (!t) return;
|
|
1415
|
+
const c = Dt.current;
|
|
1416
|
+
if (Dt.current = C, C <= c) 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 c = 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,
|
|
1350
1428
|
w: 4,
|
|
1351
1429
|
h: 4
|
|
1352
1430
|
};
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
},
|
|
1431
|
+
zt(g), It((k) => k + 1), Ct(!0), Nt.current != null && window.clearTimeout(Nt.current), Nt.current = window.setTimeout(() => {
|
|
1432
|
+
Ct(!1), Nt.current = null;
|
|
1433
|
+
}, Rt);
|
|
1356
1434
|
});
|
|
1357
|
-
return () => cancelAnimationFrame(
|
|
1358
|
-
}, [
|
|
1359
|
-
var
|
|
1360
|
-
|
|
1361
|
-
}, [
|
|
1435
|
+
return () => cancelAnimationFrame(c);
|
|
1436
|
+
}, [Wt, wt, Rt, Mt, t]), F(() => {
|
|
1437
|
+
var c;
|
|
1438
|
+
t && ((c = Bt.current) == null || c.focus());
|
|
1439
|
+
}, [t]), H ? /* @__PURE__ */ N(
|
|
1362
1440
|
"div",
|
|
1363
1441
|
{
|
|
1364
1442
|
role: "dialog",
|
|
1365
1443
|
"aria-modal": "true",
|
|
1366
1444
|
"aria-label": "Bundle builder",
|
|
1367
|
-
className: [
|
|
1368
|
-
onMouseDown: (
|
|
1369
|
-
|
|
1445
|
+
className: [f.backdrop, t ? f.backdropOpen : f.backdropClosed, a.className].filter(Boolean).join(" "),
|
|
1446
|
+
onMouseDown: (c) => {
|
|
1447
|
+
c.target === c.currentTarget && e();
|
|
1370
1448
|
},
|
|
1371
1449
|
children: [
|
|
1372
|
-
|
|
1373
|
-
|
|
1450
|
+
kt && ht && U.width > 0 && U.height > 0 ? /* @__PURE__ */ l(
|
|
1451
|
+
ln,
|
|
1374
1452
|
{
|
|
1375
|
-
width:
|
|
1376
|
-
height:
|
|
1377
|
-
confettiSource:
|
|
1453
|
+
width: U.width,
|
|
1454
|
+
height: U.height,
|
|
1455
|
+
confettiSource: ht,
|
|
1378
1456
|
colors: w,
|
|
1379
1457
|
recycle: !1,
|
|
1380
1458
|
numberOfPieces: 70,
|
|
@@ -1384,52 +1462,52 @@ function Hr(a) {
|
|
|
1384
1462
|
initialVelocityX: { min: -6, max: 6 },
|
|
1385
1463
|
style: { position: "fixed", inset: 0, pointerEvents: "none", zIndex: 2147483646 }
|
|
1386
1464
|
},
|
|
1387
|
-
|
|
1465
|
+
Tt
|
|
1388
1466
|
) : null,
|
|
1389
|
-
/* @__PURE__ */
|
|
1390
|
-
|
|
1391
|
-
/* @__PURE__ */
|
|
1392
|
-
/* @__PURE__ */
|
|
1467
|
+
/* @__PURE__ */ N("aside", { ref: Bt, className: [f.panel, t ? f.panelOpen : f.panelClosed].filter(Boolean).join(" "), tabIndex: -1, children: [
|
|
1468
|
+
Mt && wt ? /* @__PURE__ */ l("div", { className: f.celebrationOverlay, "aria-hidden": "true", children: /* @__PURE__ */ l("div", { ref: ut, className: f.celebrationChip, children: wt }, Wt) }) : null,
|
|
1469
|
+
/* @__PURE__ */ N("header", { className: [f.header, z ? f.headerSearchOpen : null].filter(Boolean).join(" "), children: [
|
|
1470
|
+
/* @__PURE__ */ l(
|
|
1393
1471
|
"button",
|
|
1394
1472
|
{
|
|
1395
1473
|
type: "button",
|
|
1396
|
-
className:
|
|
1397
|
-
"aria-label":
|
|
1398
|
-
"aria-expanded":
|
|
1474
|
+
className: f.searchIconButton,
|
|
1475
|
+
"aria-label": z ? "Search (expanded)" : "Search",
|
|
1476
|
+
"aria-expanded": z,
|
|
1399
1477
|
onClick: () => {
|
|
1400
|
-
|
|
1478
|
+
yt(!0);
|
|
1401
1479
|
},
|
|
1402
|
-
children: /* @__PURE__ */
|
|
1480
|
+
children: /* @__PURE__ */ l(pn, { size: 18, "aria-hidden": "true" })
|
|
1403
1481
|
}
|
|
1404
1482
|
),
|
|
1405
|
-
/* @__PURE__ */
|
|
1406
|
-
/* @__PURE__ */
|
|
1407
|
-
/* @__PURE__ */
|
|
1408
|
-
/* @__PURE__ */
|
|
1483
|
+
/* @__PURE__ */ N("div", { className: f.headerCenter, children: [
|
|
1484
|
+
/* @__PURE__ */ l("div", { className: f.headerTitleWrap, "aria-hidden": z, children: /* @__PURE__ */ l("h2", { className: f.title, children: L }) }),
|
|
1485
|
+
/* @__PURE__ */ l("div", { className: f.headerSearchWrap, "aria-hidden": !z, children: /* @__PURE__ */ N("div", { className: f.searchBar, children: [
|
|
1486
|
+
/* @__PURE__ */ l(
|
|
1409
1487
|
"input",
|
|
1410
1488
|
{
|
|
1411
|
-
ref:
|
|
1412
|
-
className:
|
|
1489
|
+
ref: $t,
|
|
1490
|
+
className: f.searchInput,
|
|
1413
1491
|
type: "search",
|
|
1414
|
-
value:
|
|
1492
|
+
value: Z,
|
|
1415
1493
|
placeholder: "Search",
|
|
1416
|
-
onChange: (
|
|
1494
|
+
onChange: (c) => gt(c.target.value),
|
|
1417
1495
|
onBlur: () => {
|
|
1418
|
-
|
|
1496
|
+
Z.trim() === "" && yt(!1);
|
|
1419
1497
|
}
|
|
1420
1498
|
}
|
|
1421
1499
|
),
|
|
1422
|
-
|
|
1500
|
+
Z.trim() ? /* @__PURE__ */ l(
|
|
1423
1501
|
"button",
|
|
1424
1502
|
{
|
|
1425
1503
|
type: "button",
|
|
1426
|
-
className:
|
|
1427
|
-
onMouseDown: (
|
|
1428
|
-
|
|
1504
|
+
className: f.searchClearButton,
|
|
1505
|
+
onMouseDown: (c) => {
|
|
1506
|
+
c.preventDefault();
|
|
1429
1507
|
},
|
|
1430
1508
|
onClick: () => {
|
|
1431
|
-
var
|
|
1432
|
-
|
|
1509
|
+
var c;
|
|
1510
|
+
gt(""), (c = $t.current) == null || c.focus();
|
|
1433
1511
|
},
|
|
1434
1512
|
"aria-label": "Clear search",
|
|
1435
1513
|
children: "Clear"
|
|
@@ -1437,168 +1515,171 @@ function Hr(a) {
|
|
|
1437
1515
|
) : null
|
|
1438
1516
|
] }) })
|
|
1439
1517
|
] }),
|
|
1440
|
-
/* @__PURE__ */
|
|
1518
|
+
/* @__PURE__ */ l("button", { type: "button", onClick: e, disabled: i, className: f.closeButton, "aria-label": "Close", children: "×" })
|
|
1441
1519
|
] }),
|
|
1442
|
-
/* @__PURE__ */
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
/* @__PURE__ */
|
|
1446
|
-
var
|
|
1447
|
-
const
|
|
1448
|
-
return /* @__PURE__ */
|
|
1520
|
+
/* @__PURE__ */ N("div", { className: f.body, ref: re, children: [
|
|
1521
|
+
o ? /* @__PURE__ */ l("p", { className: f.muted, children: "Loading…" }) : null,
|
|
1522
|
+
r ? /* @__PURE__ */ l("p", { className: f.error, children: r }) : null,
|
|
1523
|
+
/* @__PURE__ */ l("div", { className: f.variants, children: /* @__PURE__ */ l("ul", { className: f.variantList, children: vt.map((c) => {
|
|
1524
|
+
var Gt, Yt, it, tt;
|
|
1525
|
+
const n = ct[c.id] ?? 0, s = E(c), u = R(c.selectedOptions), p = $(c), y = O(c.id), g = y ?? Number.POSITIVE_INFINITY, x = n >= g, k = c.availableForSale !== !1 && !mt && !x, D = c.availableForSale === !1 ? null : x ? "Max Reached" : null, P = v, G = Number(c.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__ */ N(
|
|
1449
1527
|
"li",
|
|
1450
1528
|
{
|
|
1451
|
-
className: [
|
|
1452
|
-
"data-variant-row":
|
|
1529
|
+
className: [f.variantRow, c.availableForSale === !1 && f.variantRowSoldOut].filter(Boolean).join(" "),
|
|
1530
|
+
"data-variant-row": c.id,
|
|
1453
1531
|
children: [
|
|
1454
|
-
/* @__PURE__ */
|
|
1455
|
-
/* @__PURE__ */
|
|
1532
|
+
/* @__PURE__ */ N("div", { className: f.variantLeft, children: [
|
|
1533
|
+
/* @__PURE__ */ l("div", { className: f.variantThumb, "aria-hidden": "true", children: (Gt = c.image) != null && Gt.url ? /* @__PURE__ */ l(
|
|
1456
1534
|
"img",
|
|
1457
1535
|
{
|
|
1458
|
-
className:
|
|
1459
|
-
src:
|
|
1460
|
-
alt:
|
|
1536
|
+
className: f.variantThumbImg,
|
|
1537
|
+
src: c.image.url,
|
|
1538
|
+
alt: c.image.altText ?? p,
|
|
1461
1539
|
loading: "lazy"
|
|
1462
1540
|
}
|
|
1463
|
-
) : /* @__PURE__ */
|
|
1464
|
-
/* @__PURE__ */
|
|
1465
|
-
/* @__PURE__ */
|
|
1466
|
-
|
|
1467
|
-
/* @__PURE__ */
|
|
1468
|
-
|
|
1469
|
-
/* @__PURE__ */
|
|
1470
|
-
|
|
1541
|
+
) : /* @__PURE__ */ l("div", { className: f.variantThumbFallback, children: ((tt = (it = (Yt = c.product) == null ? void 0 : Yt.title) == null ? void 0 : it.slice(0, 1)) == null ? void 0 : tt.toUpperCase()) ?? "•" }) }),
|
|
1542
|
+
/* @__PURE__ */ N("div", { className: f.variantInfo, children: [
|
|
1543
|
+
/* @__PURE__ */ l("div", { className: f.variantName, children: s }),
|
|
1544
|
+
u ? /* @__PURE__ */ l("div", { className: f.variantMeta, children: u }) : null,
|
|
1545
|
+
/* @__PURE__ */ N("div", { className: f.variantPriceRow, children: [
|
|
1546
|
+
at ? /* @__PURE__ */ l("span", { className: f.variantCompareAt, children: Q(Number.isFinite(G) ? G.toFixed(2) : c.price) }) : null,
|
|
1547
|
+
/* @__PURE__ */ l("span", { className: f.variantPrice, children: Q(
|
|
1548
|
+
pt != null ? pt.toFixed(2) : Number.isFinite(G) ? G.toFixed(2) : c.price
|
|
1471
1549
|
) })
|
|
1472
1550
|
] })
|
|
1473
1551
|
] })
|
|
1474
1552
|
] }),
|
|
1475
|
-
|
|
1553
|
+
c.availableForSale === !1 ? /* @__PURE__ */ l("div", { className: f.soldOutContainer, children: /* @__PURE__ */ N("span", { className: f.soldOut, "aria-label": `${p} is sold out`, children: [
|
|
1476
1554
|
"Sold",
|
|
1477
|
-
/* @__PURE__ */
|
|
1555
|
+
/* @__PURE__ */ l("br", {}),
|
|
1478
1556
|
"Out"
|
|
1479
|
-
] }) }) : l <= 0 ? /* @__PURE__ */
|
|
1557
|
+
] }) }) : n <= 0 && g <= 0 ? /* @__PURE__ */ l("div", { className: f.stockLimitContainer, children: /* @__PURE__ */ l("span", { className: f.stockLimitNotice, "aria-label": `${p} max available selected`, children: "Max Added To Cart" }) }) : n <= 0 ? /* @__PURE__ */ l(
|
|
1480
1558
|
"button",
|
|
1481
1559
|
{
|
|
1482
1560
|
type: "button",
|
|
1483
|
-
onClick: () =>
|
|
1484
|
-
disabled:
|
|
1485
|
-
className:
|
|
1486
|
-
"aria-label": `Add ${
|
|
1561
|
+
onClick: () => et(c.id, 1),
|
|
1562
|
+
disabled: i || !k,
|
|
1563
|
+
className: f.addToBundleButton,
|
|
1564
|
+
"aria-label": D ? `${p} ${D.toLowerCase()}` : `Add ${p} to bundle`,
|
|
1487
1565
|
children: "Add"
|
|
1488
1566
|
}
|
|
1489
|
-
) : /* @__PURE__ */
|
|
1490
|
-
/* @__PURE__ */
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1567
|
+
) : /* @__PURE__ */ N("div", { className: f.qtyControlsWrap, children: [
|
|
1568
|
+
/* @__PURE__ */ N("div", { className: f.qtyControls, children: [
|
|
1569
|
+
/* @__PURE__ */ l(
|
|
1570
|
+
"button",
|
|
1571
|
+
{
|
|
1572
|
+
type: "button",
|
|
1573
|
+
onClick: () => et(c.id, n - 1),
|
|
1574
|
+
disabled: i || n <= 0,
|
|
1575
|
+
className: f.qtyButton,
|
|
1576
|
+
"aria-label": `Decrease ${p}`,
|
|
1577
|
+
children: "−"
|
|
1578
|
+
}
|
|
1579
|
+
),
|
|
1580
|
+
/* @__PURE__ */ l("span", { className: f.qtyValue, "aria-label": `Quantity ${n}`, children: n }),
|
|
1581
|
+
/* @__PURE__ */ l(
|
|
1582
|
+
"button",
|
|
1583
|
+
{
|
|
1584
|
+
type: "button",
|
|
1585
|
+
onClick: () => et(c.id, n + 1),
|
|
1586
|
+
disabled: i || !k,
|
|
1587
|
+
className: f.qtyButton,
|
|
1588
|
+
"aria-label": D ? `${p} ${D.toLowerCase()}` : `Increase ${p}`,
|
|
1589
|
+
children: "+"
|
|
1590
|
+
}
|
|
1591
|
+
)
|
|
1592
|
+
] }),
|
|
1593
|
+
D ? /* @__PURE__ */ l("div", { className: f.stockLimitNotice, children: D }) : null
|
|
1513
1594
|
] })
|
|
1514
1595
|
]
|
|
1515
1596
|
},
|
|
1516
|
-
|
|
1597
|
+
c.id
|
|
1517
1598
|
);
|
|
1518
1599
|
}) }) })
|
|
1519
1600
|
] }),
|
|
1520
|
-
/* @__PURE__ */
|
|
1521
|
-
/* @__PURE__ */
|
|
1522
|
-
var
|
|
1523
|
-
const
|
|
1524
|
-
return /* @__PURE__ */
|
|
1525
|
-
/* @__PURE__ */
|
|
1601
|
+
/* @__PURE__ */ N("footer", { className: f.footer, ref: j, children: [
|
|
1602
|
+
/* @__PURE__ */ l("div", { className: f.boxSummaryWindow, ref: At, children: /* @__PURE__ */ l("div", { className: f.boxSummaryRow, "aria-label": "Bundle box summary", children: Array.from({ length: ce }).map((c, 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__ */ N("div", { "data-box-slot": n, className: f.boxSlot, children: [
|
|
1606
|
+
/* @__PURE__ */ l(
|
|
1526
1607
|
"div",
|
|
1527
1608
|
{
|
|
1528
1609
|
className: [
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1610
|
+
f.boxItem,
|
|
1611
|
+
p ? f.boxItemFilled : f.boxItemPlaceholder,
|
|
1612
|
+
y ? f.boxItemThreshold : null,
|
|
1613
|
+
p ? f.boxItemClickable : null
|
|
1533
1614
|
].filter(Boolean).join(" "),
|
|
1534
|
-
role:
|
|
1535
|
-
tabIndex:
|
|
1536
|
-
onClick:
|
|
1537
|
-
onKeyDown:
|
|
1538
|
-
(
|
|
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));
|
|
1539
1620
|
} : void 0,
|
|
1540
|
-
"aria-label":
|
|
1541
|
-
title:
|
|
1542
|
-
children:
|
|
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__ */ l(
|
|
1543
1624
|
"img",
|
|
1544
1625
|
{
|
|
1545
|
-
className:
|
|
1546
|
-
src:
|
|
1547
|
-
alt:
|
|
1626
|
+
className: f.boxItemImage,
|
|
1627
|
+
src: s.image.url,
|
|
1628
|
+
alt: s.image.altText ?? s.displayName,
|
|
1548
1629
|
loading: "lazy"
|
|
1549
1630
|
}
|
|
1550
|
-
) : /* @__PURE__ */
|
|
1631
|
+
) : /* @__PURE__ */ l("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__ */ l("div", { className: f.boxItemDiscountText, children: x }) : /* @__PURE__ */ l("div", { className: f.boxItemPlus, "aria-hidden": "true", children: "+" })
|
|
1551
1632
|
}
|
|
1552
1633
|
),
|
|
1553
|
-
|
|
1554
|
-
] },
|
|
1634
|
+
y ? /* @__PURE__ */ l("div", { className: f.boxThresholdLabel, children: u.label }) : null
|
|
1635
|
+
] }, n);
|
|
1555
1636
|
}) }) }),
|
|
1556
|
-
/* @__PURE__ */
|
|
1637
|
+
/* @__PURE__ */ l(
|
|
1557
1638
|
"div",
|
|
1558
1639
|
{
|
|
1559
|
-
className: [
|
|
1560
|
-
"aria-hidden": !
|
|
1561
|
-
children: /* @__PURE__ */
|
|
1562
|
-
|
|
1563
|
-
|
|
1640
|
+
className: [f.ctaTotalsWrap, Pt ? f.ctaTotalsWrapVisible : null].filter(Boolean).join(" "),
|
|
1641
|
+
"aria-hidden": !Pt,
|
|
1642
|
+
children: /* @__PURE__ */ N("div", { className: f.ctaTotals, "aria-label": "Totals", children: [
|
|
1643
|
+
v ? /* @__PURE__ */ N("span", { className: f.ctaDiscountBadge, children: [
|
|
1644
|
+
v,
|
|
1564
1645
|
"% Discount"
|
|
1565
|
-
] }) : /* @__PURE__ */
|
|
1566
|
-
/* @__PURE__ */
|
|
1567
|
-
/* @__PURE__ */
|
|
1646
|
+
] }) : /* @__PURE__ */ l("span", {}),
|
|
1647
|
+
/* @__PURE__ */ l("span", { children: v ? /* @__PURE__ */ N(xe, { children: [
|
|
1648
|
+
/* @__PURE__ */ l("span", { className: f.ctaTotalsStrike, children: Q(st.toFixed(2)) }),
|
|
1568
1649
|
" ",
|
|
1569
|
-
/* @__PURE__ */
|
|
1570
|
-
] }) : /* @__PURE__ */
|
|
1650
|
+
/* @__PURE__ */ l("span", { className: f.ctaTotalsPrice, children: Q(le.toFixed(2)) })
|
|
1651
|
+
] }) : /* @__PURE__ */ l("span", { className: f.ctaTotalsPrice, children: Q(st.toFixed(2)) }) })
|
|
1571
1652
|
] })
|
|
1572
1653
|
}
|
|
1573
1654
|
),
|
|
1574
1655
|
(() => {
|
|
1575
|
-
const
|
|
1576
|
-
return
|
|
1577
|
-
/* @__PURE__ */
|
|
1656
|
+
const c = (d == null ? void 0 : d.ctaButtonMode) || "add_to_cart";
|
|
1657
|
+
return c === "add_to_cart_checkout" ? rt > 0 ? /* @__PURE__ */ l("button", { type: "button", onClick: ot, disabled: !X, className: f.cta, children: i ? "Adding…" : `Add ${rt} more product${rt === 1 ? "" : "s"}` }) : /* @__PURE__ */ N("div", { className: `${f.ctaButtonGroup} ${Et ? f.ctaButtonGroupAnimating : ""}`, children: [
|
|
1658
|
+
/* @__PURE__ */ l(
|
|
1578
1659
|
"button",
|
|
1579
1660
|
{
|
|
1580
1661
|
type: "button",
|
|
1581
|
-
onClick:
|
|
1662
|
+
onClick: ot,
|
|
1582
1663
|
disabled: !X,
|
|
1583
|
-
className: `${
|
|
1584
|
-
children: /* @__PURE__ */
|
|
1664
|
+
className: `${f.ctaDualLeft} ${Et ? f.ctaDualLeftAnimating : ""}`,
|
|
1665
|
+
children: /* @__PURE__ */ l("span", { children: i ? "Adding…" : "Add to Basket" })
|
|
1585
1666
|
}
|
|
1586
1667
|
),
|
|
1587
|
-
/* @__PURE__ */
|
|
1668
|
+
/* @__PURE__ */ l(
|
|
1588
1669
|
"button",
|
|
1589
1670
|
{
|
|
1590
1671
|
type: "button",
|
|
1591
|
-
onClick:
|
|
1672
|
+
onClick: J,
|
|
1592
1673
|
disabled: !X,
|
|
1593
|
-
className: `${
|
|
1594
|
-
children: /* @__PURE__ */
|
|
1674
|
+
className: `${f.ctaDualRight} ${Et ? f.ctaDualRightAnimating : ""}`,
|
|
1675
|
+
children: /* @__PURE__ */ l("span", { children: i ? "Processing…" : "Checkout" })
|
|
1595
1676
|
}
|
|
1596
1677
|
)
|
|
1597
|
-
] }) :
|
|
1678
|
+
] }) : c === "checkout" ? /* @__PURE__ */ l("button", { type: "button", onClick: J, disabled: !X, className: f.cta, children: i ? "Processing…" : rt > 0 ? `Add ${rt} more product${rt === 1 ? "" : "s"}` : "Checkout" }) : /* @__PURE__ */ l("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" });
|
|
1598
1679
|
})(),
|
|
1599
|
-
/* @__PURE__ */
|
|
1680
|
+
/* @__PURE__ */ N("div", { className: f.poweredBy, children: [
|
|
1600
1681
|
"powered by ",
|
|
1601
|
-
/* @__PURE__ */
|
|
1682
|
+
/* @__PURE__ */ l("a", { href: "https://apps.shopify.com/best-bundles", target: "_blank", rel: "noopener noreferrer", children: " BestBundles" })
|
|
1602
1683
|
] })
|
|
1603
1684
|
] })
|
|
1604
1685
|
] })
|
|
@@ -1606,451 +1687,486 @@ function Hr(a) {
|
|
|
1606
1687
|
}
|
|
1607
1688
|
) : null;
|
|
1608
1689
|
}
|
|
1609
|
-
const
|
|
1610
|
-
panel:
|
|
1611
|
-
header:
|
|
1612
|
-
title:
|
|
1613
|
-
status:
|
|
1614
|
-
error:
|
|
1615
|
-
inactive:
|
|
1616
|
-
section:
|
|
1617
|
-
sectionTitle:
|
|
1618
|
-
rulesVisual:
|
|
1619
|
-
rulesLabelsRow:
|
|
1620
|
-
rulesLinesRow:
|
|
1621
|
-
rulesLineLabelCell:
|
|
1622
|
-
rulesLineLabel:
|
|
1623
|
-
rulesLine:
|
|
1624
|
-
rulesLineEmpty:
|
|
1625
|
-
rulesLineFilled:
|
|
1626
|
-
variants:
|
|
1627
|
-
variantList:
|
|
1628
|
-
variantRow:
|
|
1629
|
-
variantRowInteractive:
|
|
1630
|
-
variantRowSelected:
|
|
1631
|
-
variantRowSoldOut:
|
|
1632
|
-
variantMedia:
|
|
1633
|
-
variantContent:
|
|
1634
|
-
variantHeader:
|
|
1635
|
-
variantTitle:
|
|
1636
|
-
variantImage:
|
|
1637
|
-
variantImageFallback:
|
|
1638
|
-
variantMeta:
|
|
1639
|
-
variantPrice:
|
|
1640
|
-
variantFooterRow:
|
|
1641
|
-
variantActions:
|
|
1642
|
-
qtyActions:
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
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", la = "_variantHeader_96rr4_227", ca = "_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", Ia = "_qtyChipClear_96rr4_396", Na = "_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: la,
|
|
1716
|
+
variantTitle: ca,
|
|
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: Ia,
|
|
1732
|
+
qtyTrash: Na,
|
|
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
|
|
1677
1760
|
};
|
|
1678
|
-
function
|
|
1679
|
-
var
|
|
1761
|
+
function hi(a) {
|
|
1762
|
+
var ft;
|
|
1680
1763
|
const {
|
|
1681
|
-
loading:
|
|
1682
|
-
submitting:
|
|
1683
|
-
error:
|
|
1684
|
-
currencyCode:
|
|
1685
|
-
config:
|
|
1686
|
-
eligibleVariants:
|
|
1687
|
-
selections:
|
|
1688
|
-
selectionOrder:
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1764
|
+
loading: t,
|
|
1765
|
+
submitting: e,
|
|
1766
|
+
error: o,
|
|
1767
|
+
currencyCode: i,
|
|
1768
|
+
config: r,
|
|
1769
|
+
eligibleVariants: m,
|
|
1770
|
+
selections: d,
|
|
1771
|
+
selectionOrder: S,
|
|
1772
|
+
getVariantMaxSelectableQuantity: ct,
|
|
1773
|
+
setQuantity: A,
|
|
1774
|
+
bundleSize: O,
|
|
1775
|
+
minRequired: et,
|
|
1776
|
+
canSubmit: C,
|
|
1777
|
+
submit: Y,
|
|
1694
1778
|
submitAndCheckout: X
|
|
1695
|
-
} =
|
|
1696
|
-
className:
|
|
1697
|
-
showRules:
|
|
1698
|
-
showVariants:
|
|
1699
|
-
} = a,
|
|
1700
|
-
const
|
|
1701
|
-
return Number.isFinite(
|
|
1702
|
-
},
|
|
1703
|
-
const
|
|
1704
|
-
var
|
|
1705
|
-
const
|
|
1706
|
-
return !(!
|
|
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");
|
|
1707
1791
|
});
|
|
1708
|
-
return
|
|
1709
|
-
},
|
|
1710
|
-
const
|
|
1711
|
-
if (!Number.isFinite(
|
|
1712
|
-
if (
|
|
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)
|
|
1713
1797
|
try {
|
|
1714
|
-
return new Intl.NumberFormat(void 0, { style: "currency", currency:
|
|
1798
|
+
return new Intl.NumberFormat(void 0, { style: "currency", currency: i }).format(_);
|
|
1715
1799
|
} catch {
|
|
1716
1800
|
}
|
|
1717
|
-
return `$${
|
|
1718
|
-
},
|
|
1719
|
-
let
|
|
1720
|
-
for (const
|
|
1721
|
-
|
|
1722
|
-
return
|
|
1723
|
-
}, [
|
|
1724
|
-
if (!
|
|
1725
|
-
const
|
|
1726
|
-
return !Number.isFinite(
|
|
1727
|
-
}, [
|
|
1728
|
-
const
|
|
1729
|
-
let
|
|
1730
|
-
for (const [w,
|
|
1731
|
-
const
|
|
1732
|
-
if (
|
|
1733
|
-
const
|
|
1734
|
-
Number.isFinite(
|
|
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], It = !!(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);
|
|
1735
1819
|
}
|
|
1736
|
-
return Math.round(
|
|
1737
|
-
}, [
|
|
1738
|
-
if (!
|
|
1739
|
-
const
|
|
1740
|
-
return Math.round(
|
|
1741
|
-
}, [
|
|
1742
|
-
const
|
|
1743
|
-
return
|
|
1744
|
-
}, [
|
|
1745
|
-
var
|
|
1746
|
-
const
|
|
1747
|
-
for (const w of
|
|
1748
|
-
const
|
|
1749
|
-
|
|
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]), Nt = 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, {
|
|
1750
1834
|
discountPercent: w.discountPercent,
|
|
1751
1835
|
minBundleSize: w.minBundleSize,
|
|
1752
|
-
label: ((
|
|
1836
|
+
label: ((_ = w.label) == null ? void 0 : _.trim()) || `Buy ${w.minBundleSize}+`
|
|
1753
1837
|
});
|
|
1754
1838
|
}
|
|
1755
|
-
return
|
|
1756
|
-
}, [
|
|
1757
|
-
const
|
|
1758
|
-
return Math.max(2, Math.min(100,
|
|
1759
|
-
}, [
|
|
1760
|
-
|
|
1761
|
-
const
|
|
1762
|
-
if (
|
|
1763
|
-
const
|
|
1764
|
-
if (!
|
|
1765
|
-
const w =
|
|
1766
|
-
if (
|
|
1767
|
-
const
|
|
1768
|
-
const
|
|
1769
|
-
if (
|
|
1770
|
-
const
|
|
1771
|
-
if (
|
|
1772
|
-
const
|
|
1773
|
-
|
|
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;
|
|
1851
|
+
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" });
|
|
1774
1858
|
});
|
|
1775
|
-
return () => cancelAnimationFrame(
|
|
1776
|
-
}, [
|
|
1777
|
-
const
|
|
1778
|
-
const
|
|
1779
|
-
if (!
|
|
1780
|
-
const w =
|
|
1859
|
+
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}"]`);
|
|
1781
1865
|
w && w.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
1782
1866
|
};
|
|
1783
|
-
return /* @__PURE__ */
|
|
1784
|
-
/* @__PURE__ */
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
!
|
|
1788
|
-
|
|
1789
|
-
/* @__PURE__ */
|
|
1790
|
-
const w =
|
|
1791
|
-
return /* @__PURE__ */
|
|
1867
|
+
return /* @__PURE__ */ N("section", { className: [b.panel, ot].filter(Boolean).join(" "), "aria-busy": t, children: [
|
|
1868
|
+
/* @__PURE__ */ l("header", { className: b.header, children: /* @__PURE__ */ l("h2", { className: b.title, children: Rt }) }),
|
|
1869
|
+
t ? /* @__PURE__ */ l("div", { className: b.status, children: "Loading…" }) : null,
|
|
1870
|
+
o ? /* @__PURE__ */ l("div", { className: b.error, children: o }) : null,
|
|
1871
|
+
!t && r && !r.isActive ? /* @__PURE__ */ l("div", { className: b.inactive, children: "Bundles are not active." }) : null,
|
|
1872
|
+
J && j.length ? /* @__PURE__ */ l("div", { className: b.section, children: /* @__PURE__ */ N("div", { className: b.rulesVisual, children: [
|
|
1873
|
+
/* @__PURE__ */ l("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__ */ l("div", { className: b.rulesLineLabelCell, children: R ? /* @__PURE__ */ l("span", { className: b.rulesLineLabel, children: R }) : null }, w);
|
|
1792
1876
|
}) }),
|
|
1793
|
-
/* @__PURE__ */
|
|
1794
|
-
const w =
|
|
1795
|
-
return /* @__PURE__ */
|
|
1877
|
+
/* @__PURE__ */ l("div", { className: b.rulesLinesRow, children: Array.from({ length: kt }).map((h, _) => {
|
|
1878
|
+
const w = _ + 1, B = O >= w;
|
|
1879
|
+
return /* @__PURE__ */ l(
|
|
1796
1880
|
"div",
|
|
1797
1881
|
{
|
|
1798
1882
|
className: [
|
|
1799
|
-
|
|
1800
|
-
|
|
1883
|
+
b.rulesLine,
|
|
1884
|
+
B ? b.rulesLineFilled : b.rulesLineEmpty
|
|
1801
1885
|
].filter(Boolean).join(" ")
|
|
1802
1886
|
},
|
|
1803
1887
|
w
|
|
1804
1888
|
);
|
|
1805
1889
|
}) })
|
|
1806
1890
|
] }) }) : null,
|
|
1807
|
-
|
|
1808
|
-
/* @__PURE__ */
|
|
1809
|
-
/* @__PURE__ */
|
|
1810
|
-
var
|
|
1811
|
-
const
|
|
1812
|
-
return /* @__PURE__ */
|
|
1891
|
+
z ? /* @__PURE__ */ N("div", { className: b.section, ref: wt, children: [
|
|
1892
|
+
/* @__PURE__ */ l("div", { className: b.sectionTitle, children: "Select items" }),
|
|
1893
|
+
/* @__PURE__ */ l("div", { className: b.variants, children: /* @__PURE__ */ l("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 = ct(h.id), E = R ?? Number.POSITIVE_INFINITY, $ = _ >= E, H = !B && !Xt && !$, M = H, W = !B && $ ? "Max Reached" : null;
|
|
1896
|
+
return /* @__PURE__ */ N(
|
|
1813
1897
|
"li",
|
|
1814
1898
|
{
|
|
1815
1899
|
className: [
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1900
|
+
b.variantRow,
|
|
1901
|
+
M ? b.variantRowInteractive : null,
|
|
1902
|
+
_ > 0 ? b.variantRowSelected : null,
|
|
1903
|
+
B ? b.variantRowSoldOut : null
|
|
1820
1904
|
].filter(Boolean).join(" "),
|
|
1821
|
-
"data-variant-row":
|
|
1822
|
-
role:
|
|
1823
|
-
tabIndex:
|
|
1824
|
-
onClick:
|
|
1825
|
-
|
|
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);
|
|
1826
1910
|
} : void 0,
|
|
1827
|
-
onKeyDown:
|
|
1828
|
-
(
|
|
1911
|
+
onKeyDown: M ? (L) => {
|
|
1912
|
+
(L.key === "Enter" || L.key === " ") && (L.preventDefault(), A(h.id, _ + 1), Lt(h.id));
|
|
1829
1913
|
} : void 0,
|
|
1830
|
-
"aria-label":
|
|
1914
|
+
"aria-label": B ? `${h.displayName} is sold out` : W ? `${h.displayName} ${W.toLowerCase()}` : `Add ${h.displayName} to bundle`,
|
|
1831
1915
|
children: [
|
|
1832
|
-
/* @__PURE__ */
|
|
1916
|
+
/* @__PURE__ */ l("div", { className: b.variantMedia, children: (Q = h.image) != null && Q.url ? /* @__PURE__ */ l(
|
|
1833
1917
|
"img",
|
|
1834
1918
|
{
|
|
1835
|
-
src:
|
|
1836
|
-
alt:
|
|
1837
|
-
width:
|
|
1838
|
-
height:
|
|
1839
|
-
className:
|
|
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,
|
|
1840
1924
|
loading: "lazy"
|
|
1841
1925
|
}
|
|
1842
|
-
) : /* @__PURE__ */
|
|
1843
|
-
/* @__PURE__ */
|
|
1844
|
-
/* @__PURE__ */
|
|
1845
|
-
/* @__PURE__ */
|
|
1846
|
-
w ? /* @__PURE__ */
|
|
1926
|
+
) : /* @__PURE__ */ l("div", { className: b.variantImageFallback, children: "Item" }) }),
|
|
1927
|
+
/* @__PURE__ */ N("div", { className: b.variantContent, children: [
|
|
1928
|
+
/* @__PURE__ */ N("div", { className: b.variantHeader, children: [
|
|
1929
|
+
/* @__PURE__ */ l("div", { className: b.variantTitle, children: h.displayName }),
|
|
1930
|
+
w ? /* @__PURE__ */ l("div", { className: b.variantMeta, children: w }) : null
|
|
1847
1931
|
] }),
|
|
1848
|
-
/* @__PURE__ */
|
|
1849
|
-
/* @__PURE__ */
|
|
1850
|
-
/* @__PURE__ */
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
/* @__PURE__ */
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1932
|
+
/* @__PURE__ */ N("div", { className: b.variantFooterRow, children: [
|
|
1933
|
+
/* @__PURE__ */ l("div", { className: b.variantPrice, children: gt(h.price) }),
|
|
1934
|
+
/* @__PURE__ */ l("div", { className: b.variantActions, children: B ? /* @__PURE__ */ l("div", { className: b.soldOut, "aria-label": `${h.displayName} is sold out`, children: "Sold Out" }) : _ <= 0 && E <= 0 ? /* @__PURE__ */ l("div", { className: b.stockLimitNotice, "aria-label": `${h.displayName} max available selected`, children: "Max Added To Cart" }) : /* @__PURE__ */ N("div", { className: b.qtyActionsWrap, children: [
|
|
1935
|
+
/* @__PURE__ */ N("div", { className: b.qtyActions, children: [
|
|
1936
|
+
_ > 0 ? /* @__PURE__ */ l(
|
|
1937
|
+
"button",
|
|
1938
|
+
{
|
|
1939
|
+
type: "button",
|
|
1940
|
+
className: b.qtyTrash,
|
|
1941
|
+
"aria-label": `Remove ${h.displayName} from bundle`,
|
|
1942
|
+
onClick: (L) => {
|
|
1943
|
+
L.stopPropagation(), A(h.id, 0);
|
|
1944
|
+
},
|
|
1945
|
+
onKeyDown: (L) => {
|
|
1946
|
+
L.stopPropagation();
|
|
1947
|
+
},
|
|
1948
|
+
children: /* @__PURE__ */ l(yn, { size: 14 })
|
|
1949
|
+
}
|
|
1950
|
+
) : null,
|
|
1951
|
+
/* @__PURE__ */ l(
|
|
1952
|
+
"div",
|
|
1953
|
+
{
|
|
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);
|
|
1958
|
+
} : void 0,
|
|
1959
|
+
onKeyDown: (L) => {
|
|
1960
|
+
L.stopPropagation();
|
|
1961
|
+
},
|
|
1962
|
+
role: H ? "button" : void 0,
|
|
1963
|
+
tabIndex: H ? 0 : void 0,
|
|
1964
|
+
children: _ <= 0 ? /* @__PURE__ */ l("span", { className: b.qtyChipPlus, "aria-hidden": "true", children: /* @__PURE__ */ l(Oe, { size: 18, strokeWidth: 1.8 }) }) : /* @__PURE__ */ N(xe, { children: [
|
|
1965
|
+
/* @__PURE__ */ l("span", { className: b.qtyChipValue, children: _ }),
|
|
1966
|
+
/* @__PURE__ */ l(
|
|
1967
|
+
"button",
|
|
1968
|
+
{
|
|
1969
|
+
type: "button",
|
|
1970
|
+
className: b.qtyChipClear,
|
|
1971
|
+
"aria-label": `Add ${h.displayName}`,
|
|
1972
|
+
onClick: (L) => {
|
|
1973
|
+
L.stopPropagation(), A(h.id, _ + 1);
|
|
1974
|
+
},
|
|
1975
|
+
onKeyDown: (L) => {
|
|
1976
|
+
L.stopPropagation();
|
|
1977
|
+
},
|
|
1978
|
+
disabled: !H,
|
|
1979
|
+
children: /* @__PURE__ */ l(Oe, { size: 12, strokeWidth: 2 })
|
|
1980
|
+
}
|
|
1981
|
+
)
|
|
1982
|
+
] })
|
|
1983
|
+
}
|
|
1984
|
+
)
|
|
1985
|
+
] }),
|
|
1986
|
+
W ? /* @__PURE__ */ l("div", { className: b.stockLimitNotice, children: W }) : null
|
|
1899
1987
|
] }) })
|
|
1900
1988
|
] })
|
|
1901
1989
|
] })
|
|
1902
1990
|
]
|
|
1903
1991
|
},
|
|
1904
|
-
|
|
1992
|
+
h.id
|
|
1905
1993
|
);
|
|
1906
1994
|
}) }) })
|
|
1907
1995
|
] }) : null,
|
|
1908
|
-
/* @__PURE__ */
|
|
1909
|
-
/* @__PURE__ */
|
|
1910
|
-
var
|
|
1911
|
-
const w =
|
|
1912
|
-
return /* @__PURE__ */
|
|
1913
|
-
/* @__PURE__ */
|
|
1996
|
+
/* @__PURE__ */ N("footer", { className: b.footer, children: [
|
|
1997
|
+
/* @__PURE__ */ l("div", { className: b.boxSummaryWindow, ref: jt, children: /* @__PURE__ */ l("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 = Nt.get(_), R = !!w, E = !!B, $ = E && !R, H = B ? `${B.discountPercent}% off` : null, M = R ? w.displayName : `Slot ${_ + 1}`;
|
|
2000
|
+
return /* @__PURE__ */ N("div", { "data-box-slot": _, className: b.boxSlot, children: [
|
|
2001
|
+
/* @__PURE__ */ l(
|
|
1914
2002
|
"div",
|
|
1915
2003
|
{
|
|
1916
2004
|
className: [
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
2005
|
+
b.boxItem,
|
|
2006
|
+
R ? b.boxItemFilled : b.boxItemPlaceholder,
|
|
2007
|
+
E ? b.boxItemThreshold : null,
|
|
2008
|
+
R ? b.boxItemClickable : null
|
|
1921
2009
|
].filter(Boolean).join(" "),
|
|
1922
|
-
role:
|
|
1923
|
-
tabIndex:
|
|
1924
|
-
onClick:
|
|
1925
|
-
onKeyDown:
|
|
1926
|
-
(
|
|
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));
|
|
1927
2015
|
} : void 0,
|
|
1928
|
-
"aria-label":
|
|
1929
|
-
title:
|
|
1930
|
-
children:
|
|
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__ */ l(
|
|
1931
2019
|
"img",
|
|
1932
2020
|
{
|
|
1933
|
-
className:
|
|
2021
|
+
className: b.boxItemImage,
|
|
1934
2022
|
src: w.image.url,
|
|
1935
2023
|
alt: w.image.altText ?? w.displayName,
|
|
1936
2024
|
width: 1,
|
|
1937
2025
|
height: 1,
|
|
1938
2026
|
loading: "lazy"
|
|
1939
2027
|
}
|
|
1940
|
-
) : /* @__PURE__ */
|
|
2028
|
+
) : /* @__PURE__ */ l("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__ */ l("div", { className: b.boxItemDiscountText, children: H }) : /* @__PURE__ */ l("div", { className: b.boxItemPlus, "aria-hidden": "true", children: "+" })
|
|
1941
2029
|
}
|
|
1942
2030
|
),
|
|
1943
|
-
|
|
1944
|
-
] },
|
|
2031
|
+
E ? /* @__PURE__ */ l("div", { className: b.boxThresholdLabel, children: B.label }) : null
|
|
2032
|
+
] }, _);
|
|
1945
2033
|
}) }) }),
|
|
1946
|
-
/* @__PURE__ */
|
|
2034
|
+
/* @__PURE__ */ l("div", { className: [b.totalsReveal, It ? b.totalsRevealOpen : null].filter(Boolean).join(" "), children: /* @__PURE__ */ l(
|
|
1947
2035
|
"div",
|
|
1948
2036
|
{
|
|
1949
|
-
className: [
|
|
1950
|
-
"aria-hidden": !
|
|
1951
|
-
children: /* @__PURE__ */
|
|
1952
|
-
|
|
1953
|
-
|
|
2037
|
+
className: [b.ctaTotalsWrap, It ? b.ctaTotalsWrapVisible : null].filter(Boolean).join(" "),
|
|
2038
|
+
"aria-hidden": !It,
|
|
2039
|
+
children: /* @__PURE__ */ N("div", { className: b.ctaTotals, "aria-label": "Totals", children: [
|
|
2040
|
+
dt ? /* @__PURE__ */ N("span", { className: b.ctaDiscountBadge, children: [
|
|
2041
|
+
dt,
|
|
1954
2042
|
"% Discount"
|
|
1955
|
-
] }) : /* @__PURE__ */
|
|
1956
|
-
/* @__PURE__ */
|
|
1957
|
-
/* @__PURE__ */
|
|
2043
|
+
] }) : /* @__PURE__ */ l("span", {}),
|
|
2044
|
+
/* @__PURE__ */ l("span", { children: dt ? /* @__PURE__ */ N(xe, { children: [
|
|
2045
|
+
/* @__PURE__ */ l("span", { className: b.ctaTotalsStrike, children: gt(ht.toFixed(2)) }),
|
|
1958
2046
|
" ",
|
|
1959
|
-
/* @__PURE__ */
|
|
1960
|
-
] }) : /* @__PURE__ */
|
|
2047
|
+
/* @__PURE__ */ l("span", { className: b.ctaTotalsPrice, children: gt(zt.toFixed(2)) })
|
|
2048
|
+
] }) : /* @__PURE__ */ l("span", { className: b.ctaTotalsPrice, children: gt(ht.toFixed(2)) }) })
|
|
1961
2049
|
] })
|
|
1962
2050
|
}
|
|
1963
2051
|
) }),
|
|
1964
2052
|
(() => {
|
|
1965
|
-
const
|
|
1966
|
-
return
|
|
1967
|
-
/* @__PURE__ */
|
|
1968
|
-
/* @__PURE__ */
|
|
1969
|
-
] }) :
|
|
2053
|
+
const h = (r == null ? void 0 : r.ctaButtonMode) || "add_to_cart";
|
|
2054
|
+
return h === "add_to_cart_checkout" ? ut > 0 ? /* @__PURE__ */ l("button", { type: "button", onClick: Y, disabled: !C, className: b.cta, children: e ? "Adding…" : `Add ${ut} more product${ut === 1 ? "" : "s"}` }) : /* @__PURE__ */ N("div", { className: b.ctaButtonGroup, children: [
|
|
2055
|
+
/* @__PURE__ */ l("button", { type: "button", onClick: Y, disabled: !C, className: b.ctaDualLeft, children: /* @__PURE__ */ l("span", { children: e ? "Adding…" : "Add to Basket" }) }),
|
|
2056
|
+
/* @__PURE__ */ l("button", { type: "button", onClick: X, disabled: !C, className: b.ctaDualRight, children: /* @__PURE__ */ l("span", { children: e ? "Processing…" : "Checkout" }) })
|
|
2057
|
+
] }) : h === "checkout" ? /* @__PURE__ */ l("button", { type: "button", onClick: X, disabled: !C, className: b.cta, children: e ? "Processing…" : ut > 0 ? `Add ${ut} more product${ut === 1 ? "" : "s"}` : "Checkout" }) : /* @__PURE__ */ l("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" });
|
|
1970
2058
|
})(),
|
|
1971
|
-
/* @__PURE__ */
|
|
2059
|
+
/* @__PURE__ */ N("div", { className: b.poweredBy, children: [
|
|
1972
2060
|
"powered by",
|
|
1973
2061
|
" ",
|
|
1974
|
-
/* @__PURE__ */
|
|
2062
|
+
/* @__PURE__ */ l("a", { href: "https://apps.shopify.com/best-bundles", target: "_blank", rel: "noopener noreferrer", children: "BestBundles" })
|
|
1975
2063
|
] })
|
|
1976
2064
|
] })
|
|
1977
2065
|
] });
|
|
1978
2066
|
}
|
|
1979
|
-
function
|
|
2067
|
+
function ve(a) {
|
|
1980
2068
|
if (a != null && a.length)
|
|
1981
|
-
return a.reduce((
|
|
2069
|
+
return a.reduce((t, e) => (e != null && e.key && (t[e.key] = e.value ?? ""), t), {});
|
|
2070
|
+
}
|
|
2071
|
+
function Ae(a) {
|
|
2072
|
+
const t = /\/(\d+)$/.exec(a);
|
|
2073
|
+
return t ? t[1] : a;
|
|
1982
2074
|
}
|
|
1983
|
-
function
|
|
1984
|
-
|
|
1985
|
-
|
|
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;
|
|
1986
2079
|
}
|
|
1987
|
-
function
|
|
2080
|
+
function ti() {
|
|
1988
2081
|
var a;
|
|
1989
2082
|
return typeof window > "u" ? null : ((a = window.Shopify) == null ? void 0 : a.theme) ?? null;
|
|
1990
2083
|
}
|
|
1991
|
-
function
|
|
1992
|
-
const a =
|
|
2084
|
+
function ei() {
|
|
2085
|
+
const a = ti();
|
|
1993
2086
|
return a ? a.schema_name === "Sleek" ? !0 : /sleek/i.test(a.name ?? "") : !1;
|
|
1994
2087
|
}
|
|
1995
|
-
function
|
|
2088
|
+
function ni() {
|
|
1996
2089
|
return typeof document > "u" ? !1 : !!document.querySelector("cart-drawer");
|
|
1997
2090
|
}
|
|
1998
|
-
function
|
|
1999
|
-
return !
|
|
2091
|
+
function ri() {
|
|
2092
|
+
return !ei() || !ni() ? !1 : (document.dispatchEvent(new CustomEvent("cart:refresh", {
|
|
2000
2093
|
bubbles: !0,
|
|
2001
2094
|
detail: { open: !0 }
|
|
2002
2095
|
})), !0);
|
|
2003
2096
|
}
|
|
2004
|
-
function
|
|
2097
|
+
function ai() {
|
|
2005
2098
|
window.location.reload();
|
|
2006
2099
|
}
|
|
2007
|
-
async function
|
|
2008
|
-
const
|
|
2100
|
+
async function he(a, t) {
|
|
2101
|
+
const e = await fetch(a, {
|
|
2009
2102
|
method: "POST",
|
|
2010
2103
|
headers: {
|
|
2011
2104
|
Accept: "application/json",
|
|
2012
2105
|
"Content-Type": "application/json"
|
|
2013
2106
|
},
|
|
2014
|
-
body: JSON.stringify(
|
|
2107
|
+
body: JSON.stringify(t)
|
|
2015
2108
|
});
|
|
2016
|
-
if (!
|
|
2017
|
-
const
|
|
2018
|
-
throw new Error(
|
|
2109
|
+
if (!e.ok) {
|
|
2110
|
+
const o = await e.text().catch(() => "");
|
|
2111
|
+
throw new Error(o || `Cart request failed: ${e.status}`);
|
|
2019
2112
|
}
|
|
2020
|
-
return
|
|
2113
|
+
return e.json().catch(() => null);
|
|
2021
2114
|
}
|
|
2022
|
-
function
|
|
2115
|
+
async function ii() {
|
|
2116
|
+
const a = await fetch("/cart.js", {
|
|
2117
|
+
method: "GET",
|
|
2118
|
+
cache: "no-store",
|
|
2119
|
+
headers: {
|
|
2120
|
+
Accept: "application/json",
|
|
2121
|
+
"Content-Type": "application/json"
|
|
2122
|
+
}
|
|
2123
|
+
});
|
|
2124
|
+
if (!a.ok)
|
|
2125
|
+
throw new Error(`Cart request failed: ${a.status}`);
|
|
2126
|
+
return a.json();
|
|
2127
|
+
}
|
|
2128
|
+
function mi() {
|
|
2023
2129
|
return {
|
|
2024
2130
|
async linesAdd(a) {
|
|
2025
|
-
const
|
|
2026
|
-
id:
|
|
2027
|
-
quantity:
|
|
2028
|
-
properties:
|
|
2131
|
+
const t = a.map((e) => ({
|
|
2132
|
+
id: Ae(e.merchandiseId),
|
|
2133
|
+
quantity: e.quantity,
|
|
2134
|
+
properties: ve(e.attributes)
|
|
2029
2135
|
}));
|
|
2030
|
-
await
|
|
2136
|
+
await he("/cart/add.js", { items: t });
|
|
2031
2137
|
},
|
|
2032
2138
|
async linesAddForCheckout(a) {
|
|
2033
|
-
const
|
|
2034
|
-
id:
|
|
2035
|
-
quantity:
|
|
2036
|
-
properties:
|
|
2139
|
+
const t = a.map((e) => ({
|
|
2140
|
+
id: Ae(e.merchandiseId),
|
|
2141
|
+
quantity: e.quantity,
|
|
2142
|
+
properties: ve(e.attributes)
|
|
2037
2143
|
}));
|
|
2038
|
-
await
|
|
2144
|
+
await he("/cart/add.js", { items: t });
|
|
2039
2145
|
},
|
|
2040
2146
|
async linesUpdate(a) {
|
|
2041
|
-
for (const
|
|
2042
|
-
await
|
|
2043
|
-
id:
|
|
2044
|
-
quantity:
|
|
2045
|
-
properties:
|
|
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)
|
|
2046
2152
|
});
|
|
2047
2153
|
},
|
|
2048
2154
|
async linesRemove(a) {
|
|
2049
|
-
for (const
|
|
2050
|
-
await
|
|
2155
|
+
for (const t of a)
|
|
2156
|
+
await he("/cart/change.js", { id: t, quantity: 0 });
|
|
2157
|
+
},
|
|
2158
|
+
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));
|
|
2165
|
+
}
|
|
2166
|
+
return t;
|
|
2051
2167
|
},
|
|
2052
2168
|
openCartUI() {
|
|
2053
|
-
|
|
2169
|
+
ri() || window.setTimeout(() => ai(), 0);
|
|
2054
2170
|
},
|
|
2055
2171
|
navigateToCheckout() {
|
|
2056
2172
|
window.location.href = "/checkout";
|
|
@@ -2058,13 +2174,13 @@ function Qr() {
|
|
|
2058
2174
|
};
|
|
2059
2175
|
}
|
|
2060
2176
|
export {
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2177
|
+
di as BundleBuilderDrawer,
|
|
2178
|
+
hi as BundleBuilderPanel,
|
|
2179
|
+
ui as BundleButton,
|
|
2180
|
+
ue as BundleLineAttributeKeys,
|
|
2181
|
+
li as BundleProvider,
|
|
2182
|
+
mi as createLiquidCartAdapter,
|
|
2183
|
+
be as useBundleBuilder,
|
|
2184
|
+
ci as useBundleBuilderDrawer
|
|
2069
2185
|
};
|
|
2070
2186
|
//# sourceMappingURL=index.js.map
|