@best-bundles/bundle-ui 0.0.13 → 0.0.14
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/context/BundleProvider.d.ts.map +1 -1
- package/dist/index.js +51 -49
- package/dist/index.js.map +1 -1
- package/dist/liquid/bundle-ui.iife.js +7 -7
- package/dist/liquid/bundle-ui.iife.js.map +1 -1
- package/dist/utils/analytics.d.ts +1 -0
- package/dist/utils/analytics.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BundleProvider.d.ts","sourceRoot":"","sources":["../../src/context/BundleProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2E,MAAM,OAAO,CAAC;AAGhG,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAGnH,KAAK,kBAAkB,GAAG;IACxB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,MAAM,EAAE,YAAY,CAAC;IACrB,gBAAgB,EAAE,qBAAqB,EAAE,CAAC;CAC3C,CAAC;AAEF,KAAK,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACnD,KAAK,oBAAoB,GAAG,MAAM,EAAE,CAAC;AAErC,MAAM,MAAM,mBAAmB,GAAG;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,iBAAiB,CAAC;IAE/B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,WAAW,CAAC,EAAE,kBAAkB,CAAC;IAEjC;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,KAAK,OA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oB,CAAC;IACrC,WAAW,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/D,eAAe,EAAE,MAAM,IAAI,CAAC;IAE5B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,oBAAoB,iDAAwD,CAAC;AAkB1F,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,2CAkXxD"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode('._button_18rtl_1{display:inline-flex;align-items:center;justify-content:center;gap:8px;font-family:var(--bb-font-family, inherit);border:1px solid var(--bb-button-border, rgba(0, 0, 0, .12));background:var(--bb-button-bg, #111827);color:var(--bb-button-text, #ffffff);font:inherit;line-height:1;padding:10px 14px;border-radius:var(--bb-button-radius, 10px);cursor:pointer;transition:transform .12s ease,background .12s ease,border-color .12s ease,opacity .12s ease}._button_18rtl_1:hover{background:var(--bb-button-bg-hover, #0b1220)}._button_18rtl_1:active{transform:translateY(1px)}._button_18rtl_1:disabled{opacity:.6;cursor:not-allowed}._button_18rtl_1:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._backdrop_364yo_1{position:fixed;top:0;right:0;bottom:0;left:0;z-index:var(--bb-backdrop-z-index, 9999);display:flex;justify-content:flex-end;background:var(--bb-backdrop-bg, rgba(0, 0, 0, .5));-webkit-backdrop-filter:blur(var(--bb-backdrop-blur, 2px));backdrop-filter:blur(var(--bb-backdrop-blur, 2px));padding:var(--bb-backdrop-padding, 12px);opacity:0;transition:opacity var(--bb-drawer-transition-duration, .22s) ease}._celebrationOverlay_364yo_14{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;pointer-events:none;z-index:50}._celebrationChip_364yo_23{font-family:var(--bb-font-family-body, "Cabin", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif);letter-spacing:.03em;font-size:18px;line-height:1;padding:12px 16px;border-radius:999px;color:#0b1b44;background:linear-gradient(180deg,#fff,#bae6fd);border:2px solid rgba(37,99,235,.28);box-shadow:0 18px 55px #0006,0 10px 28px #2563eb33,inset 0 1px #ffffffbf;transform-origin:50% 60%;will-change:transform,opacity,filter;animation:_bbCelebrationPop_364yo_1 2.8s cubic-bezier(.16,1,.3,1) forwards;filter:saturate(1.05)}@keyframes _bbCelebrationPop_364yo_1{0%{opacity:0;transform:translateY(10px) scale(.6);filter:blur(1px) saturate(1.1)}12%{opacity:1;transform:translateY(0) scale(1.12);filter:blur(0px) saturate(1.1)}22%{opacity:1;transform:translateY(0) scale(1)}80%{opacity:1;transform:translateY(0) scale(1)}to{opacity:0;transform:translateY(-10px) scale(.98)}}._backdropOpen_364yo_74{opacity:1}._backdropClosed_364yo_78{opacity:0}._panel_364yo_82{width:440px;max-width:100%;height:100%;background:var(--bb-surface-bg, #ffffff);color:var(--bb-text-color, #111827);font-family:var(--bb-font-family-body, "Cabin", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif);border-radius:var(--bb-panel-radius, 16px);box-shadow:0 20px 60px #00000059;display:grid;grid-template-rows:auto 1fr auto;overflow:hidden;outline:none;position:relative;top:unset;right:unset;bottom:unset;left:unset}._panelOpen_364yo_102{animation:_bbSlideInFromRight_364yo_1 var(--bb-drawer-transition-duration, .22s) ease forwards}._panelClosed_364yo_106{animation:_bbSlideOutToRight_364yo_1 var(--bb-drawer-transition-duration, .22s) ease forwards}@keyframes _bbSlideInFromRight_364yo_1{0%{transform:translate(110%)}to{transform:translate(0)}}@keyframes _bbSlideOutToRight_364yo_1{0%{transform:translate(0)}to{transform:translate(110%)}}@media(prefers-reduced-motion:reduce){._backdrop_364yo_1{transition:none}._celebrationChip_364yo_23,._panelOpen_364yo_102,._panelClosed_364yo_106{animation:none}}._header_364yo_145{display:grid;grid-template-columns:36px 1fr 36px;align-items:center;column-gap:12px;padding:var(--bb-header-padding, 16px 16px 12px 16px);border-bottom:1px solid var(--bb-border-color, rgba(17, 24, 39, .08))}._headerCenter_364yo_154{position:relative;min-width:0;display:flex;justify-content:center;align-items:center}._title_364yo_162{font-size:24px;margin:0;line-height:1.2;font-family:var(--bb-font-family-title, "Bebas Neue", "Cabin", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif);letter-spacing:.02em;color:var(--bb-title-color, var(--bb-text-color, #111827))}._searchIconButton_364yo_171{width:36px;height:36px;border-radius:10px;border:1px solid var(--bb-border-strong-color, rgba(17, 24, 39, .12));background:var(--bb-surface-bg, #ffffff);color:var(--bb-text-color, #111827);cursor:pointer;display:inline-flex;align-items:center;justify-content:center}._searchIconButton_364yo_171:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._searchIconButton_364yo_171:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._headerTitleWrap_364yo_193{transition:opacity .18s ease,transform .22s ease}._headerSearchWrap_364yo_197{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;pointer-events:none;opacity:0;transform:translateY(-2px);transition:opacity .18s ease,transform .22s ease}._headerSearchOpen_364yo_209 ._headerTitleWrap_364yo_193{opacity:0;transform:translateY(2px);pointer-events:none}._headerSearchOpen_364yo_209 ._headerSearchWrap_364yo_197{opacity:1;transform:translateY(0);pointer-events:auto}._searchBar_364yo_221{width:min(320px,100%);height:36px;display:flex;align-items:center;gap:8px;background:var(--bb-surface-bg, #ffffff);border:1px solid var(--bb-border-strong-color, rgba(17, 24, 39, .12));border-radius:10px;padding:0 8px}._searchInput_364yo_233{width:100%;border:none;outline:none;background:transparent;font:inherit;font-size:14px;min-width:0;height:100%;line-height:36px;padding:0}._searchInput_364yo_233::-webkit-search-cancel-button,._searchInput_364yo_233::-webkit-search-decoration,._searchInput_364yo_233::-webkit-search-results-button,._searchInput_364yo_233::-webkit-search-results-decoration{-webkit-appearance:none;-moz-appearance:none;appearance:none}._searchClearButton_364yo_254{border:none;background:transparent;color:var(--bb-text-color, #111827);font:inherit;font-size:13px;font-weight:700;cursor:pointer;padding:6px;border-radius:10px;line-height:1}._searchClearButton_364yo_254:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._searchClearButton_364yo_254:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._closeButton_364yo_276{border:1px solid var(--bb-border-strong-color, rgba(17, 24, 39, .12));background:var(--bb-surface-bg, #ffffff);color:var(--bb-text-color, #111827);width:36px;height:36px;border-radius:10px;cursor:pointer;flex:0 0 auto}._closeButton_364yo_276:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._closeButton_364yo_276:disabled{opacity:.6;cursor:not-allowed}._closeButton_364yo_276:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}@media(prefers-reduced-motion:reduce){._headerTitleWrap_364yo_193,._headerSearchWrap_364yo_197{transition:none}}._body_364yo_309{padding:var(--bb-body-padding, 8px 16px);overflow:auto}._muted_364yo_314{color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65));margin:0 0 12px}._error_364yo_319{color:var(--bb-error-color, #b91c1c);margin:0 0 12px}._variants_364yo_324{margin-top:4px}._variantList_364yo_328{list-style:none;padding:0;margin:0;display:grid;gap:10px}._variantRow_364yo_336{display:grid;grid-template-columns:1fr auto;gap:0px;align-items:stretch;padding:5px}._variantLeft_364yo_344{min-width:0;display:flex;gap:12px;align-items:center}._addToBundleButton_364yo_351{height:100%;align-self:stretch;border-radius:12px;border:none;background:var(--bb-cta-bg, #91aae5);color:var(--bb-cta-text, #ffffff);font:inherit;font-weight:800;padding:0 16px;cursor:pointer;white-space:nowrap}._addToBundleButton_364yo_351:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._addToBundleButton_364yo_351:disabled{opacity:.6;cursor:not-allowed}._addToBundleButton_364yo_351:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._variantThumb_364yo_379{width:60px;height:60px;border-radius:12px;overflow:hidden;border:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));background:var(--bb-surface-subtle-bg, rgba(17, 24, 39, .02));flex:0 0 auto}._variantThumbImg_364yo_389{width:100%;height:100%;object-fit:cover;display:block}._variantThumbFallback_364yo_396{width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-weight:800;color:var(--bb-text-color, #111827)}._variantInfo_364yo_406{min-width:0}._variantName_364yo_410{font-size:14px;font-weight:600;margin-bottom:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._variantMeta_364yo_419{font-size:12px;color:var(--bb-muted-color, rgba(17, 24, 39, .6));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._variantPriceRow_364yo_427{display:flex;align-items:baseline;gap:8px;margin-top:4px}._variantCompareAt_364yo_434{font-size:12px;color:var(--bb-muted-color, rgba(17, 24, 39, .6));text-decoration:line-through}._variantPrice_364yo_427{font-size:13px;font-weight:800}._qtyControls_364yo_445{display:inline-flex;align-items:center;gap:6px}._qtyButton_364yo_451{width:34px;height:34px;border-radius:10px;border:1px solid var(--bb-border-strong-color, rgba(17, 24, 39, .12));background:var(--bb-surface-bg, #ffffff);cursor:pointer;line-height:1;font-size:16px}._qtyButton_364yo_451:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._qtyButton_364yo_451:disabled{opacity:.6;cursor:not-allowed}._qtyButton_364yo_451:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._qtyValue_364yo_476{min-width:18px;text-align:center;font-variant-numeric:tabular-nums;font-weight:700}._footer_364yo_483{padding:var(--bb-footer-padding, 12px 16px 16px 16px);border-top:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));background:var(--bb-surface-bg, #ffffff);position:relative}._poweredBy_364yo_490{font-size:10px;color:var(rgba(17, 24, 39, .6));text-align:center;margin-top:10px}._poweredBy_364yo_490 a{color:inherit;text-decoration:none}._boxSummaryWindow_364yo_502{margin-bottom:6px;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;padding-bottom:6px;scrollbar-width:none;-ms-overflow-style:none}._boxSummaryWindow_364yo_502::-webkit-scrollbar{display:none}._boxSummaryRow_364yo_519{--bb-box-gap: 10px;display:flex;align-items:flex-start;gap:var(--bb-box-gap);width:100%}._boxSlot_364yo_527{flex:0 0 calc((100% - (4 * var(--bb-box-gap))) / 5);display:flex;flex-direction:column;align-items:stretch;gap:6px}._boxItem_364yo_535{width:100%;aspect-ratio:1 / 1;border-radius:12px;position:relative;display:flex;align-items:center;justify-content:center;-webkit-user-select:none;user-select:none;box-sizing:border-box}._boxItemClickable_364yo_547{cursor:pointer}._boxItemClickable_364yo_547:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._boxThresholdLabel_364yo_556{font-size:11px;line-height:1.15;font-weight:700;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65));text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._boxItemPlaceholder_364yo_567{border:1px dashed var(--bb-border-strong-color, rgba(17, 24, 39, .18));background:var(--bb-surface-subtle-bg, rgba(17, 24, 39, .02));color:var(--bb-muted-color, rgba(17, 24, 39, .6))}._boxItemFilled_364yo_573{border:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));background:var(--bb-surface-bg, #ffffff);overflow:hidden}._boxItemThreshold_364yo_579{border-style:solid;border-width:2px;border-color:var(--bb-tier-border, rgba(37, 99, 235, .55));background:linear-gradient(180deg,#2563eb1a,#2563eb08);color:var(--bb-tier-text, rgba(29, 78, 216, .95))}._boxItemDiscountText_364yo_587{font-size:12px;font-weight:800;text-align:center;line-height:1.1;padding:6px}._boxItemPlus_364yo_595{font-size:22px;font-weight:700;opacity:.5;line-height:1}._boxItemImage_364yo_602{width:100%;height:100%;object-fit:cover;display:block}._boxItemFallback_364yo_609{width:100%;height:100%;display:flex;align-items:center;justify-content:center;background:var(--bb-surface-subtle-bg, rgba(17, 24, 39, .04));color:var(--bb-text-color, #111827);font-weight:800}._cta_364yo_620{width:100%;border:1px solid var(--bb-cta-border, rgba(0, 0, 0, .12));background:var(--bb-cta-bg, #2563eb);color:var(--bb-cta-text, #ffffff);font:inherit;font-weight:700;padding:12px 14px;border-radius:12px;cursor:pointer}._ctaTotals_364yo_632{display:flex;justify-content:space-between;align-items:baseline;gap:10px;font-variant-numeric:tabular-nums}._ctaDiscountBadge_364yo_640{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;font-size:12px;font-weight:800;background:linear-gradient(180deg,#2563eb24,#2563eb0f);border:1px solid rgba(37,99,235,.3);color:#1d4ed8f2;white-space:nowrap}._ctaTotalsWrap_364yo_654{overflow:hidden;max-height:0;opacity:0;transform:translateY(4px);margin-bottom:0;transition:max-height .22s ease,opacity .16s ease,transform .22s ease,margin-bottom .22s ease}._ctaTotalsWrapVisible_364yo_667{max-height:40px;opacity:1;transform:translateY(0);margin-bottom:8px}._ctaTotalsStrike_364yo_674{opacity:.85;text-decoration:line-through;font-weight:700;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65))}._ctaTotalsPrice_364yo_681{font-weight:900;color:var(--bb-text-color, #111827)}@media(prefers-reduced-motion:reduce){._ctaTotalsWrap_364yo_654{transition:none}}._cta_364yo_620:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._cta_364yo_620:disabled{opacity:.6;cursor:not-allowed}._cta_364yo_620:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._helperText_364yo_706{margin-top:8px;font-size:12px;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65));text-align:center}@media(max-width:767px){._backdrop_364yo_1{padding:0;justify-content:stretch}._panel_364yo_82{width:100%;height:100%;border-radius:0}}')),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
2
|
import { jsx as h, jsxs as R, Fragment as lt } from "react/jsx-runtime";
|
|
3
|
-
import Ae, { useState as
|
|
3
|
+
import Ae, { useState as O, useRef as V, useEffect as j, useCallback as be, useMemo as N, createContext as ut, useContext as dt, forwardRef as rt, createElement as ze } from "react";
|
|
4
4
|
const ke = {
|
|
5
5
|
bundleId: "_bundle_id",
|
|
6
6
|
bundleConfig: "_bundle_config",
|
|
@@ -84,9 +84,9 @@ function Yn(i) {
|
|
|
84
84
|
configFetcher: l,
|
|
85
85
|
analyticsEndpoint: c,
|
|
86
86
|
children: f
|
|
87
|
-
} = i, v = c ?? `${e}/api/public/bundle-analytics`, [
|
|
87
|
+
} = i, v = c ?? `${e}/api/public/bundle-analytics`, [P, k] = O(!1), [x, X] = O(!n), [J, re] = O(!1), [M, q] = O(null), [T, Z] = O((n == null ? void 0 : n.currencyCode) ?? null), [g, we] = O((n == null ? void 0 : n.config) ?? null), [ee, oe] = O(
|
|
88
88
|
(n == null ? void 0 : n.eligibleVariants) ?? []
|
|
89
|
-
), [Ne, Te] =
|
|
89
|
+
), [Ne, Te] = O(
|
|
90
90
|
() => ({ selections: {}, order: [] })
|
|
91
91
|
), Me = V(null);
|
|
92
92
|
j(() => {
|
|
@@ -108,7 +108,7 @@ function Yn(i) {
|
|
|
108
108
|
}).finally(() => X(!1)), () => y.abort();
|
|
109
109
|
}, [e, t, n, l]);
|
|
110
110
|
const _e = be(() => {
|
|
111
|
-
if (
|
|
111
|
+
if (k(!0), v)
|
|
112
112
|
try {
|
|
113
113
|
const y = Fe();
|
|
114
114
|
Re(v, t, {
|
|
@@ -122,8 +122,8 @@ function Yn(i) {
|
|
|
122
122
|
} catch (y) {
|
|
123
123
|
console.warn("[Bundle Analytics] Error in open() callback:", y);
|
|
124
124
|
}
|
|
125
|
-
}, [v, t]), me = be(() =>
|
|
126
|
-
|
|
125
|
+
}, [v, t]), me = be(() => k(!1), []), Oe = be(() => {
|
|
126
|
+
k((y) => {
|
|
127
127
|
if (!y && v)
|
|
128
128
|
try {
|
|
129
129
|
const C = Fe();
|
|
@@ -189,7 +189,7 @@ function Yn(i) {
|
|
|
189
189
|
}, [ve, Q, v, t]), de = be(() => Te({ selections: {}, order: [] }), []), K = Ne.selections, Pe = Ne.order, Y = N(() => Object.values(K).reduce((y, C) => y + (C || 0), 0), [K]), pe = N(() => {
|
|
190
190
|
const y = (g == null ? void 0 : g.rules) ?? [], C = y.length ? Math.min(...y.map((A) => A.minBundleSize)) : 2;
|
|
191
191
|
return Number.isFinite(C) && C > 0 ? C : 2;
|
|
192
|
-
}, [g]), ie = N(() => !(x || J ||
|
|
192
|
+
}, [g]), ie = N(() => !(x || J || M || !(g != null && g.isActive) || Y < pe), [Y, g == null ? void 0 : g.isActive, M, x, pe, J]), xe = be(async () => {
|
|
193
193
|
var ce, B;
|
|
194
194
|
if (!ie || !g) return;
|
|
195
195
|
const y = ft(), C = (g.title ?? "").trim().slice(0, 255), A = Object.entries(K).map(([b, te]) => ({ merchandiseId: b, quantity: Ze(te) })).filter((b) => b.quantity > 0).filter((b) => Q.has(b.merchandiseId)).map((b) => ({
|
|
@@ -233,6 +233,7 @@ function Yn(i) {
|
|
|
233
233
|
productVariantIds: se,
|
|
234
234
|
grossPrice: D,
|
|
235
235
|
discountedPrice: $,
|
|
236
|
+
currency: T ?? void 0,
|
|
236
237
|
discountThresholdIdentifier: z,
|
|
237
238
|
discountLabel: L,
|
|
238
239
|
discountPercentage: F,
|
|
@@ -252,6 +253,7 @@ function Yn(i) {
|
|
|
252
253
|
me,
|
|
253
254
|
g,
|
|
254
255
|
r,
|
|
256
|
+
T,
|
|
255
257
|
K,
|
|
256
258
|
Q,
|
|
257
259
|
ee,
|
|
@@ -260,14 +262,14 @@ function Yn(i) {
|
|
|
260
262
|
t
|
|
261
263
|
]), ae = N(
|
|
262
264
|
() => ({
|
|
263
|
-
isOpen:
|
|
265
|
+
isOpen: P,
|
|
264
266
|
open: _e,
|
|
265
267
|
close: me,
|
|
266
268
|
toggle: Oe,
|
|
267
269
|
loading: x,
|
|
268
270
|
submitting: J,
|
|
269
|
-
error:
|
|
270
|
-
currencyCode:
|
|
271
|
+
error: M,
|
|
272
|
+
currencyCode: T,
|
|
271
273
|
config: g,
|
|
272
274
|
eligibleVariants: ee,
|
|
273
275
|
selections: K,
|
|
@@ -280,14 +282,14 @@ function Yn(i) {
|
|
|
280
282
|
submit: xe
|
|
281
283
|
}),
|
|
282
284
|
[
|
|
283
|
-
|
|
285
|
+
P,
|
|
284
286
|
_e,
|
|
285
287
|
me,
|
|
286
288
|
Oe,
|
|
287
289
|
x,
|
|
288
290
|
J,
|
|
291
|
+
M,
|
|
289
292
|
T,
|
|
290
|
-
k,
|
|
291
293
|
g,
|
|
292
294
|
ee,
|
|
293
295
|
K,
|
|
@@ -516,23 +518,23 @@ class xt {
|
|
|
516
518
|
const r = U(this.x, this.w + this.x), n = U(this.y, this.h + this.y);
|
|
517
519
|
return new gt(this.context, this.getOptions, r, n);
|
|
518
520
|
}, this.animate = (r) => {
|
|
519
|
-
const { canvas: n, context: l, particlesGenerated: c, lastNumberOfPieces: f } = this, { run: v, recycle:
|
|
521
|
+
const { canvas: n, context: l, particlesGenerated: c, lastNumberOfPieces: f } = this, { run: v, recycle: P, numberOfPieces: k, debug: x, tweenFunction: X, tweenDuration: J } = this.getOptions();
|
|
520
522
|
if (!v)
|
|
521
523
|
return !1;
|
|
522
|
-
const re = this.particles.length,
|
|
523
|
-
if (
|
|
524
|
-
f !==
|
|
525
|
-
const q = X(this.tweenProgress, this.tweenFrom,
|
|
526
|
-
for (let Z = 0; Z <
|
|
524
|
+
const re = this.particles.length, M = P ? re : c;
|
|
525
|
+
if (M < k) {
|
|
526
|
+
f !== k && (this.tweenProgress = 0, this.tweenFrom = M, this.lastNumberOfPieces = k), this.tweenProgress = Math.min(J, Math.max(0, this.tweenProgress + r));
|
|
527
|
+
const q = X(this.tweenProgress, this.tweenFrom, k, J), T = Math.round(q - M);
|
|
528
|
+
for (let Z = 0; Z < T; Z++)
|
|
527
529
|
this.particles.push(this.getParticle());
|
|
528
|
-
this.particlesGenerated +=
|
|
530
|
+
this.particlesGenerated += T;
|
|
529
531
|
}
|
|
530
532
|
x && (l.font = "12px sans-serif", l.fillStyle = "#333", l.textAlign = "right", l.fillText(`Particles: ${re}`, n.width - 10, n.height - 20));
|
|
531
533
|
for (let q = this.particles.length - 1; q >= 0; q--) {
|
|
532
|
-
const
|
|
533
|
-
|
|
534
|
+
const T = this.particles[q];
|
|
535
|
+
T.update(r), (T.y > n.height || T.y < -100 || T.x > n.width + 100 || T.x < -100) && (P && M <= k ? this.particles[q] = this.getParticle() : this.removeParticleAt(q));
|
|
534
536
|
}
|
|
535
|
-
return re > 0 ||
|
|
537
|
+
return re > 0 || M < k;
|
|
536
538
|
}, this.canvas = e;
|
|
537
539
|
const o = this.canvas.getContext("2d");
|
|
538
540
|
if (!o)
|
|
@@ -592,12 +594,12 @@ class It {
|
|
|
592
594
|
...r
|
|
593
595
|
}, Object.assign(this, r.confettiSource);
|
|
594
596
|
}, this.update = (r = 0) => {
|
|
595
|
-
const { options: { run: n, onConfettiComplete: l, frameRate: c }, canvas: f, context: v } = this,
|
|
596
|
-
if (c &&
|
|
597
|
+
const { options: { run: n, onConfettiComplete: l, frameRate: c }, canvas: f, context: v } = this, P = Math.min(r - this.lastFrameTime, 50);
|
|
598
|
+
if (c && P < 1e3 / c) {
|
|
597
599
|
this.rafId = requestAnimationFrame(this.update);
|
|
598
600
|
return;
|
|
599
601
|
}
|
|
600
|
-
this.lastFrameTime = r - (c ?
|
|
602
|
+
this.lastFrameTime = r - (c ? P % c : 0), n && (v.fillStyle = "white", v.clearRect(0, 0, f.width, f.height)), this.generator.animate(P) ? this.rafId = requestAnimationFrame(this.update) : (l && typeof l == "function" && this.generator.particlesGenerated > 0 && l.call(this, this), this._options.run = !1);
|
|
601
603
|
}, this.reset = () => {
|
|
602
604
|
this.generator && this.generator.particlesGenerated > 0 && (this.generator.particlesGenerated = 0, this.generator.particles = [], this.generator.lastNumberOfPieces = 0);
|
|
603
605
|
}, this.stop = () => {
|
|
@@ -732,7 +734,7 @@ const Ot = rt(
|
|
|
732
734
|
...c
|
|
733
735
|
},
|
|
734
736
|
[
|
|
735
|
-
...l.map(([v,
|
|
737
|
+
...l.map(([v, P]) => ze(v, P)),
|
|
736
738
|
...Array.isArray(n) ? n : [n]
|
|
737
739
|
]
|
|
738
740
|
)
|
|
@@ -842,13 +844,13 @@ function Hn(i) {
|
|
|
842
844
|
config: c,
|
|
843
845
|
eligibleVariants: f,
|
|
844
846
|
selections: v,
|
|
845
|
-
selectionOrder:
|
|
846
|
-
setQuantity:
|
|
847
|
+
selectionOrder: P,
|
|
848
|
+
setQuantity: k,
|
|
847
849
|
bundleSize: x,
|
|
848
850
|
minRequired: X,
|
|
849
851
|
canSubmit: J,
|
|
850
852
|
submit: re
|
|
851
|
-
} = We(), [
|
|
853
|
+
} = We(), [M, q] = O(!1), [T, Z] = O(""), g = V(null), we = V(null), ee = V(null), [oe, Ne] = O(() => typeof window > "u" ? { width: 0, height: 0 } : { width: window.innerWidth, height: window.innerHeight }), [Te, Me] = O(0), [_e, me] = O(null), [Oe, ve] = O(!1), Q = V(null), ge = V(x), de = 7e3, [K, Pe] = O(0), [Y, pe] = O(null), [ie, xe] = O(!1), ae = V(null), y = 2800, C = (a) => {
|
|
852
854
|
const s = Number.parseFloat(a);
|
|
853
855
|
return Number.isFinite(s) ? String(Math.round(s)) : a;
|
|
854
856
|
}, A = (a) => {
|
|
@@ -864,7 +866,7 @@ function Hn(i) {
|
|
|
864
866
|
}, D = (a) => {
|
|
865
867
|
const s = _(a), d = A(a.selectedOptions);
|
|
866
868
|
return [s, d].filter(Boolean).join(" — ");
|
|
867
|
-
}, [he, E] =
|
|
869
|
+
}, [he, E] = O(e), F = V(null), $ = (a) => {
|
|
868
870
|
const s = Number(a);
|
|
869
871
|
if (!Number.isFinite(s)) return a;
|
|
870
872
|
if (l)
|
|
@@ -877,7 +879,7 @@ function Hn(i) {
|
|
|
877
879
|
const a = Number((c == null ? void 0 : c.maxBundleSize) ?? NaN), s = Number.isFinite(a) ? Math.floor(a) : 100;
|
|
878
880
|
return Math.max(2, Math.min(100, s));
|
|
879
881
|
}, [c == null ? void 0 : c.maxBundleSize]), z = x >= se, L = N(() => [...f].sort((a, s) => a.displayName.localeCompare(s.displayName)), [f]), ce = N(() => {
|
|
880
|
-
const a =
|
|
882
|
+
const a = T.trim().toLowerCase();
|
|
881
883
|
if (!a) return L;
|
|
882
884
|
const s = a.split(/\s+/).filter(Boolean), d = (p) => {
|
|
883
885
|
var w;
|
|
@@ -889,7 +891,7 @@ function Hn(i) {
|
|
|
889
891
|
return s.every((S) => I.includes(S));
|
|
890
892
|
};
|
|
891
893
|
return L.filter(d);
|
|
892
|
-
}, [
|
|
894
|
+
}, [T, L]), B = N(() => [...(c == null ? void 0 : c.rules) ?? []].sort((a, s) => a.minBundleSize - s.minBundleSize), [c == null ? void 0 : c.rules]), b = N(() => Math.max(0, X - x), [x, X]), te = N(() => {
|
|
893
895
|
let a = null;
|
|
894
896
|
for (const s of B)
|
|
895
897
|
x >= s.minBundleSize && (a = s);
|
|
@@ -919,8 +921,8 @@ function Hn(i) {
|
|
|
919
921
|
return Math.round(a * 100) / 100;
|
|
920
922
|
}, [le, Ce]), Qe = N(() => B.length ? Math.max(...B.map((a) => a.minBundleSize)) : 0, [B]), De = N(() => {
|
|
921
923
|
const a = new Map(f.map((s) => [s.id, s]));
|
|
922
|
-
return
|
|
923
|
-
}, [f,
|
|
924
|
+
return P.map((s) => a.get(s)).filter((s) => !!s);
|
|
925
|
+
}, [f, P]), st = N(() => {
|
|
924
926
|
var s;
|
|
925
927
|
const a = /* @__PURE__ */ new Map();
|
|
926
928
|
for (const d of B) {
|
|
@@ -967,13 +969,13 @@ function Hn(i) {
|
|
|
967
969
|
}, []), j(() => () => {
|
|
968
970
|
ae.current != null && window.clearTimeout(ae.current);
|
|
969
971
|
}, []), j(() => {
|
|
970
|
-
if (!e || !
|
|
972
|
+
if (!e || !M) return;
|
|
971
973
|
const a = requestAnimationFrame(() => {
|
|
972
974
|
var s;
|
|
973
975
|
return (s = g.current) == null ? void 0 : s.focus();
|
|
974
976
|
});
|
|
975
977
|
return () => cancelAnimationFrame(a);
|
|
976
|
-
}, [e,
|
|
978
|
+
}, [e, M]), j(() => {
|
|
977
979
|
const a = Ge.current;
|
|
978
980
|
if (Ge.current = x, x <= a) return;
|
|
979
981
|
const s = Ke.current;
|
|
@@ -1058,14 +1060,14 @@ function Hn(i) {
|
|
|
1058
1060
|
) : null,
|
|
1059
1061
|
/* @__PURE__ */ R("aside", { ref: qe, className: [u.panel, e ? u.panelOpen : u.panelClosed].filter(Boolean).join(" "), tabIndex: -1, children: [
|
|
1060
1062
|
ie && Y ? /* @__PURE__ */ h("div", { className: u.celebrationOverlay, "aria-hidden": "true", children: /* @__PURE__ */ h("div", { ref: ee, className: u.celebrationChip, children: Y }, K) }) : null,
|
|
1061
|
-
/* @__PURE__ */ R("header", { className: [u.header,
|
|
1063
|
+
/* @__PURE__ */ R("header", { className: [u.header, M ? u.headerSearchOpen : null].filter(Boolean).join(" "), children: [
|
|
1062
1064
|
/* @__PURE__ */ h(
|
|
1063
1065
|
"button",
|
|
1064
1066
|
{
|
|
1065
1067
|
type: "button",
|
|
1066
1068
|
className: u.searchIconButton,
|
|
1067
|
-
"aria-label":
|
|
1068
|
-
"aria-expanded":
|
|
1069
|
+
"aria-label": M ? "Search (expanded)" : "Search",
|
|
1070
|
+
"aria-expanded": M,
|
|
1069
1071
|
onClick: () => {
|
|
1070
1072
|
q(!0);
|
|
1071
1073
|
},
|
|
@@ -1073,23 +1075,23 @@ function Hn(i) {
|
|
|
1073
1075
|
}
|
|
1074
1076
|
),
|
|
1075
1077
|
/* @__PURE__ */ R("div", { className: u.headerCenter, children: [
|
|
1076
|
-
/* @__PURE__ */ h("div", { className: u.headerTitleWrap, "aria-hidden":
|
|
1077
|
-
/* @__PURE__ */ h("div", { className: u.headerSearchWrap, "aria-hidden": !
|
|
1078
|
+
/* @__PURE__ */ h("div", { className: u.headerTitleWrap, "aria-hidden": M, children: /* @__PURE__ */ h("h2", { className: u.title, children: G }) }),
|
|
1079
|
+
/* @__PURE__ */ h("div", { className: u.headerSearchWrap, "aria-hidden": !M, children: /* @__PURE__ */ R("div", { className: u.searchBar, children: [
|
|
1078
1080
|
/* @__PURE__ */ h(
|
|
1079
1081
|
"input",
|
|
1080
1082
|
{
|
|
1081
1083
|
ref: g,
|
|
1082
1084
|
className: u.searchInput,
|
|
1083
1085
|
type: "search",
|
|
1084
|
-
value:
|
|
1086
|
+
value: T,
|
|
1085
1087
|
placeholder: "Search",
|
|
1086
1088
|
onChange: (a) => Z(a.target.value),
|
|
1087
1089
|
onBlur: () => {
|
|
1088
|
-
|
|
1090
|
+
T.trim() === "" && q(!1);
|
|
1089
1091
|
}
|
|
1090
1092
|
}
|
|
1091
1093
|
),
|
|
1092
|
-
|
|
1094
|
+
T.trim() ? /* @__PURE__ */ h(
|
|
1093
1095
|
"button",
|
|
1094
1096
|
{
|
|
1095
1097
|
type: "button",
|
|
@@ -1142,7 +1144,7 @@ function Hn(i) {
|
|
|
1142
1144
|
"button",
|
|
1143
1145
|
{
|
|
1144
1146
|
type: "button",
|
|
1145
|
-
onClick: () =>
|
|
1147
|
+
onClick: () => k(a.id, 1),
|
|
1146
1148
|
disabled: r || z,
|
|
1147
1149
|
className: u.addToBundleButton,
|
|
1148
1150
|
"aria-label": `Add ${m} to bundle`,
|
|
@@ -1153,7 +1155,7 @@ function Hn(i) {
|
|
|
1153
1155
|
"button",
|
|
1154
1156
|
{
|
|
1155
1157
|
type: "button",
|
|
1156
|
-
onClick: () =>
|
|
1158
|
+
onClick: () => k(a.id, s - 1),
|
|
1157
1159
|
disabled: r || s <= 0,
|
|
1158
1160
|
className: u.qtyButton,
|
|
1159
1161
|
"aria-label": `Decrease ${m}`,
|
|
@@ -1165,7 +1167,7 @@ function Hn(i) {
|
|
|
1165
1167
|
"button",
|
|
1166
1168
|
{
|
|
1167
1169
|
type: "button",
|
|
1168
|
-
onClick: () =>
|
|
1170
|
+
onClick: () => k(a.id, s + 1),
|
|
1169
1171
|
disabled: r || z,
|
|
1170
1172
|
className: u.qtyButton,
|
|
1171
1173
|
"aria-label": `Increase ${m}`,
|
|
@@ -1263,8 +1265,8 @@ async function Vn() {
|
|
|
1263
1265
|
for (const c of r) {
|
|
1264
1266
|
const f = o[c];
|
|
1265
1267
|
if (!f) continue;
|
|
1266
|
-
const v = new DOMParser().parseFromString(f, "text/html"),
|
|
1267
|
-
|
|
1268
|
+
const v = new DOMParser().parseFromString(f, "text/html"), P = v.getElementById(c) || v.querySelector(c), k = document.getElementById(c) || document.querySelector(c);
|
|
1269
|
+
k && P && k.replaceWith(P);
|
|
1268
1270
|
}
|
|
1269
1271
|
const n = document.querySelector("cart-drawer");
|
|
1270
1272
|
if (n && typeof n.open == "function") {
|