@partbot/grid-garage 0.1.12 → 0.1.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/js/vehicle-garage.es.js +346 -341
- package/dist/js/vehicle-garage.js +7 -7
- package/package.json +1 -1
|
@@ -375,13 +375,13 @@ function ae(t) {
|
|
|
375
375
|
//#endregion
|
|
376
376
|
//#region node_modules/@radix-ui/react-direction/dist/index.mjs
|
|
377
377
|
var oe = e.createContext(void 0);
|
|
378
|
-
function
|
|
378
|
+
function U(t) {
|
|
379
379
|
let n = e.useContext(oe);
|
|
380
380
|
return t || n || "ltr";
|
|
381
381
|
}
|
|
382
382
|
//#endregion
|
|
383
383
|
//#region node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
|
|
384
|
-
function
|
|
384
|
+
function W(t) {
|
|
385
385
|
let n = e.useRef(t);
|
|
386
386
|
return e.useEffect(() => {
|
|
387
387
|
n.current = t;
|
|
@@ -389,8 +389,8 @@ function U(t) {
|
|
|
389
389
|
}
|
|
390
390
|
//#endregion
|
|
391
391
|
//#region node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs
|
|
392
|
-
function
|
|
393
|
-
let r =
|
|
392
|
+
function se(t, n = globalThis?.document) {
|
|
393
|
+
let r = W(t);
|
|
394
394
|
e.useEffect(() => {
|
|
395
395
|
let e = (e) => {
|
|
396
396
|
e.key === "Escape" && r(e);
|
|
@@ -400,23 +400,23 @@ function W(t, n = globalThis?.document) {
|
|
|
400
400
|
}
|
|
401
401
|
//#endregion
|
|
402
402
|
//#region node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
|
|
403
|
-
var ce = "DismissableLayer", le = "dismissableLayer.update", ue = "dismissableLayer.pointerDownOutside",
|
|
403
|
+
var ce = "DismissableLayer", le = "dismissableLayer.update", ue = "dismissableLayer.pointerDownOutside", G = "dismissableLayer.focusOutside", de, fe = e.createContext({
|
|
404
404
|
layers: /* @__PURE__ */ new Set(),
|
|
405
405
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
406
406
|
branches: /* @__PURE__ */ new Set()
|
|
407
407
|
}), pe = e.forwardRef((t, n) => {
|
|
408
|
-
let { disableOutsidePointerEvents: r = !1, onEscapeKeyDown: i, onPointerDownOutside: a, onFocusOutside: o, onInteractOutside: s, onDismiss: c, ...l } = t, u = e.useContext(
|
|
408
|
+
let { disableOutsidePointerEvents: r = !1, onEscapeKeyDown: i, onPointerDownOutside: a, onFocusOutside: o, onInteractOutside: s, onDismiss: c, ...l } = t, u = e.useContext(fe), [d, f] = e.useState(null), p = d?.ownerDocument ?? globalThis?.document, [, m] = e.useState({}), g = x(n, (e) => f(e)), _ = Array.from(u.layers), [v] = [...u.layersWithOutsidePointerEventsDisabled].slice(-1), y = _.indexOf(v), b = d ? _.indexOf(d) : -1, S = u.layersWithOutsidePointerEventsDisabled.size > 0, C = b >= y, w = he((e) => {
|
|
409
409
|
let t = e.target, n = [...u.branches].some((e) => e.contains(t));
|
|
410
410
|
!C || n || (a?.(e), s?.(e), e.defaultPrevented || c?.());
|
|
411
411
|
}, p), T = ge((e) => {
|
|
412
412
|
let t = e.target;
|
|
413
413
|
[...u.branches].some((e) => e.contains(t)) || (o?.(e), s?.(e), e.defaultPrevented || c?.());
|
|
414
414
|
}, p);
|
|
415
|
-
return
|
|
415
|
+
return se((e) => {
|
|
416
416
|
b === u.layers.size - 1 && (i?.(e), !e.defaultPrevented && c && (e.preventDefault(), c()));
|
|
417
417
|
}, p), e.useEffect(() => {
|
|
418
|
-
if (d) return r && (u.layersWithOutsidePointerEventsDisabled.size === 0 && (
|
|
419
|
-
r && u.layersWithOutsidePointerEventsDisabled.size === 1 && (p.body.style.pointerEvents =
|
|
418
|
+
if (d) return r && (u.layersWithOutsidePointerEventsDisabled.size === 0 && (de = p.body.style.pointerEvents, p.body.style.pointerEvents = "none"), u.layersWithOutsidePointerEventsDisabled.add(d)), u.layers.add(d), q(), () => {
|
|
419
|
+
r && u.layersWithOutsidePointerEventsDisabled.size === 1 && (p.body.style.pointerEvents = de);
|
|
420
420
|
};
|
|
421
421
|
}, [
|
|
422
422
|
d,
|
|
@@ -424,7 +424,7 @@ var ce = "DismissableLayer", le = "dismissableLayer.update", ue = "dismissableLa
|
|
|
424
424
|
r,
|
|
425
425
|
u
|
|
426
426
|
]), e.useEffect(() => () => {
|
|
427
|
-
d && (u.layers.delete(d), u.layersWithOutsidePointerEventsDisabled.delete(d),
|
|
427
|
+
d && (u.layers.delete(d), u.layersWithOutsidePointerEventsDisabled.delete(d), q());
|
|
428
428
|
}, [d, u]), e.useEffect(() => {
|
|
429
429
|
let e = () => m({});
|
|
430
430
|
return document.addEventListener(le, e), () => document.removeEventListener(le, e);
|
|
@@ -442,7 +442,7 @@ var ce = "DismissableLayer", le = "dismissableLayer.update", ue = "dismissableLa
|
|
|
442
442
|
});
|
|
443
443
|
pe.displayName = ce;
|
|
444
444
|
var me = "DismissableLayerBranch", K = e.forwardRef((t, n) => {
|
|
445
|
-
let r = e.useContext(
|
|
445
|
+
let r = e.useContext(fe), i = e.useRef(null), a = x(n, i);
|
|
446
446
|
return e.useEffect(() => {
|
|
447
447
|
let e = i.current;
|
|
448
448
|
if (e) return r.branches.add(e), () => {
|
|
@@ -455,12 +455,12 @@ var me = "DismissableLayerBranch", K = e.forwardRef((t, n) => {
|
|
|
455
455
|
});
|
|
456
456
|
K.displayName = me;
|
|
457
457
|
function he(t, n = globalThis?.document) {
|
|
458
|
-
let r =
|
|
458
|
+
let r = W(t), i = e.useRef(!1), a = e.useRef(() => {});
|
|
459
459
|
return e.useEffect(() => {
|
|
460
460
|
let e = (e) => {
|
|
461
461
|
if (e.target && !i.current) {
|
|
462
462
|
let t = function() {
|
|
463
|
-
|
|
463
|
+
_e(ue, r, i, { discrete: !0 });
|
|
464
464
|
}, i = { originalEvent: e };
|
|
465
465
|
e.pointerType === "touch" ? (n.removeEventListener("click", a.current), a.current = t, n.addEventListener("click", a.current, { once: !0 })) : t();
|
|
466
466
|
} else n.removeEventListener("click", a.current);
|
|
@@ -474,10 +474,10 @@ function he(t, n = globalThis?.document) {
|
|
|
474
474
|
}, [n, r]), { onPointerDownCapture: () => i.current = !0 };
|
|
475
475
|
}
|
|
476
476
|
function ge(t, n = globalThis?.document) {
|
|
477
|
-
let r =
|
|
477
|
+
let r = W(t), i = e.useRef(!1);
|
|
478
478
|
return e.useEffect(() => {
|
|
479
479
|
let e = (e) => {
|
|
480
|
-
e.target && !i.current &&
|
|
480
|
+
e.target && !i.current && _e(G, r, { originalEvent: e }, { discrete: !1 });
|
|
481
481
|
};
|
|
482
482
|
return n.addEventListener("focusin", e), () => n.removeEventListener("focusin", e);
|
|
483
483
|
}, [n, r]), {
|
|
@@ -485,11 +485,11 @@ function ge(t, n = globalThis?.document) {
|
|
|
485
485
|
onBlurCapture: () => i.current = !1
|
|
486
486
|
};
|
|
487
487
|
}
|
|
488
|
-
function
|
|
488
|
+
function q() {
|
|
489
489
|
let e = new CustomEvent(le);
|
|
490
490
|
document.dispatchEvent(e);
|
|
491
491
|
}
|
|
492
|
-
function
|
|
492
|
+
function _e(e, t, n, { discrete: r }) {
|
|
493
493
|
let i = n.originalEvent.target, a = new CustomEvent(e, {
|
|
494
494
|
bubbles: !1,
|
|
495
495
|
cancelable: !0,
|
|
@@ -499,11 +499,11 @@ function ve(e, t, n, { discrete: r }) {
|
|
|
499
499
|
}
|
|
500
500
|
//#endregion
|
|
501
501
|
//#region node_modules/@radix-ui/react-focus-scope/dist/index.mjs
|
|
502
|
-
var
|
|
502
|
+
var ve = "focusScope.autoFocusOnMount", ye = "focusScope.autoFocusOnUnmount", be = {
|
|
503
503
|
bubbles: !1,
|
|
504
504
|
cancelable: !0
|
|
505
505
|
}, xe = "FocusScope", Se = e.forwardRef((t, n) => {
|
|
506
|
-
let { loop: r = !1, trapped: i = !1, onMountAutoFocus: a, onUnmountAutoFocus: o, ...s } = t, [c, l] = e.useState(null), u =
|
|
506
|
+
let { loop: r = !1, trapped: i = !1, onMountAutoFocus: a, onUnmountAutoFocus: o, ...s } = t, [c, l] = e.useState(null), u = W(a), d = W(o), f = e.useRef(null), p = x(n, (e) => l(e)), m = e.useRef({
|
|
507
507
|
paused: !1,
|
|
508
508
|
pause() {
|
|
509
509
|
this.paused = !0;
|
|
@@ -543,11 +543,11 @@ var q = "focusScope.autoFocusOnMount", ye = "focusScope.autoFocusOnUnmount", be
|
|
|
543
543
|
ke.add(m);
|
|
544
544
|
let e = document.activeElement;
|
|
545
545
|
if (!c.contains(e)) {
|
|
546
|
-
let t = new CustomEvent(
|
|
547
|
-
c.addEventListener(
|
|
546
|
+
let t = new CustomEvent(ve, be);
|
|
547
|
+
c.addEventListener(ve, u), c.dispatchEvent(t), t.defaultPrevented || (Ce(Me(we(c)), { select: !0 }), document.activeElement === e && Oe(c));
|
|
548
548
|
}
|
|
549
549
|
return () => {
|
|
550
|
-
c.removeEventListener(
|
|
550
|
+
c.removeEventListener(ve, u), setTimeout(() => {
|
|
551
551
|
let t = new CustomEvent(ye, be);
|
|
552
552
|
c.addEventListener(ye, d), c.dispatchEvent(t), t.defaultPrevented || Oe(e ?? document.body, { select: !0 }), c.removeEventListener(ye, d), ke.remove(m);
|
|
553
553
|
}, 0);
|
|
@@ -2599,7 +2599,7 @@ var ma = "PopperContent", [ha, ga] = sa(ma), _a = e.forwardRef((t, n) => {
|
|
|
2599
2599
|
...N
|
|
2600
2600
|
})
|
|
2601
2601
|
]
|
|
2602
|
-
}), [ee, B] = Ca(L), V =
|
|
2602
|
+
}), [ee, B] = Ca(L), V = W(g);
|
|
2603
2603
|
I(() => {
|
|
2604
2604
|
R && V?.();
|
|
2605
2605
|
}, [R, V]);
|
|
@@ -2718,12 +2718,12 @@ var wa = da, Ta = pa, Ea = _a, Da = ba, Oa = "rovingFocusGroup.onEntryFocus", ka
|
|
|
2718
2718
|
}));
|
|
2719
2719
|
Ra.displayName = Aa;
|
|
2720
2720
|
var za = e.forwardRef((t, n) => {
|
|
2721
|
-
let { __scopeRovingFocusGroup: r, orientation: i, loop: a = !1, dir: o, currentTabStopId: s, defaultCurrentTabStopId: c, onCurrentTabStopIdChange: l, onEntryFocus: u, preventScrollOnEntryFocus: d = !1, ...f } = t, p = e.useRef(null), m = x(n, p), g =
|
|
2721
|
+
let { __scopeRovingFocusGroup: r, orientation: i, loop: a = !1, dir: o, currentTabStopId: s, defaultCurrentTabStopId: c, onCurrentTabStopIdChange: l, onEntryFocus: u, preventScrollOnEntryFocus: d = !1, ...f } = t, p = e.useRef(null), m = x(n, p), g = U(o), [_, v] = R({
|
|
2722
2722
|
prop: s,
|
|
2723
2723
|
defaultProp: c ?? null,
|
|
2724
2724
|
onChange: l,
|
|
2725
2725
|
caller: Aa
|
|
2726
|
-
}), [y, b] = e.useState(!1), S =
|
|
2726
|
+
}), [y, b] = e.useState(!1), S = W(u), C = Ma(r), w = e.useRef(!1), [T, E] = e.useState(0);
|
|
2727
2727
|
return e.useEffect(() => {
|
|
2728
2728
|
let e = p.current;
|
|
2729
2729
|
if (e) return e.addEventListener(Oa, S), () => e.removeEventListener(Oa, S);
|
|
@@ -3041,7 +3041,7 @@ function jo(t, n) {
|
|
|
3041
3041
|
return e.useReducer((e, t) => n[e][t] ?? e, t);
|
|
3042
3042
|
}
|
|
3043
3043
|
var Mo = "ScrollArea", [No, Po] = M(Mo), [Fo, Io] = No(Mo), Lo = e.forwardRef((t, n) => {
|
|
3044
|
-
let { __scopeScrollArea: r, type: i = "hover", dir: a, scrollHideDelay: o = 600, ...s } = t, [c, l] = e.useState(null), [u, d] = e.useState(null), [f, p] = e.useState(null), [m, g] = e.useState(null), [_, v] = e.useState(null), [y, b] = e.useState(0), [S, C] = e.useState(0), [w, T] = e.useState(!1), [E, D] = e.useState(!1), O = x(n, (e) => l(e)), A =
|
|
3044
|
+
let { __scopeScrollArea: r, type: i = "hover", dir: a, scrollHideDelay: o = 600, ...s } = t, [c, l] = e.useState(null), [u, d] = e.useState(null), [f, p] = e.useState(null), [m, g] = e.useState(null), [_, v] = e.useState(null), [y, b] = e.useState(0), [S, C] = e.useState(0), [w, T] = e.useState(!1), [E, D] = e.useState(!1), O = x(n, (e) => l(e)), A = U(a);
|
|
3045
3045
|
return /* @__PURE__ */ h(Fo, {
|
|
3046
3046
|
scope: r,
|
|
3047
3047
|
type: i,
|
|
@@ -3340,7 +3340,7 @@ var Ho = e.forwardRef((t, n) => {
|
|
|
3340
3340
|
}
|
|
3341
3341
|
});
|
|
3342
3342
|
}), [Jo, Yo] = No(Bo), Xo = e.forwardRef((t, n) => {
|
|
3343
|
-
let { __scopeScrollArea: r, sizes: i, hasThumb: a, onThumbChange: o, onThumbPointerUp: s, onThumbPointerDown: c, onThumbPositionChange: l, onDragScroll: u, onWheelScroll: d, onResize: f, ...p } = t, m = Io(Bo, r), [g, _] = e.useState(null), v = x(n, (e) => _(e)), y = e.useRef(null), b = e.useRef(""), S = m.viewport, C = i.content - i.viewport, w =
|
|
3343
|
+
let { __scopeScrollArea: r, sizes: i, hasThumb: a, onThumbChange: o, onThumbPointerUp: s, onThumbPointerDown: c, onThumbPositionChange: l, onDragScroll: u, onWheelScroll: d, onResize: f, ...p } = t, m = Io(Bo, r), [g, _] = e.useState(null), v = x(n, (e) => _(e)), y = e.useRef(null), b = e.useRef(""), S = m.viewport, C = i.content - i.viewport, w = W(d), T = W(l), E = ds(f, 10);
|
|
3344
3344
|
function D(e) {
|
|
3345
3345
|
y.current && u({
|
|
3346
3346
|
x: e.clientX - y.current.left,
|
|
@@ -3362,10 +3362,10 @@ var Ho = e.forwardRef((t, n) => {
|
|
|
3362
3362
|
scope: r,
|
|
3363
3363
|
scrollbar: g,
|
|
3364
3364
|
hasThumb: a,
|
|
3365
|
-
onThumbChange:
|
|
3366
|
-
onThumbPointerUp:
|
|
3365
|
+
onThumbChange: W(o),
|
|
3366
|
+
onThumbPointerUp: W(s),
|
|
3367
3367
|
onThumbPositionChange: T,
|
|
3368
|
-
onThumbPointerDown:
|
|
3368
|
+
onThumbPointerDown: W(c),
|
|
3369
3369
|
children: /* @__PURE__ */ h(k.div, {
|
|
3370
3370
|
...p,
|
|
3371
3371
|
ref: v,
|
|
@@ -3501,13 +3501,13 @@ var us = (e, t = () => {}) => {
|
|
|
3501
3501
|
})(), () => window.cancelAnimationFrame(r);
|
|
3502
3502
|
};
|
|
3503
3503
|
function ds(t, n) {
|
|
3504
|
-
let r =
|
|
3504
|
+
let r = W(t), i = e.useRef(0);
|
|
3505
3505
|
return e.useEffect(() => () => window.clearTimeout(i.current), []), e.useCallback(() => {
|
|
3506
3506
|
window.clearTimeout(i.current), i.current = window.setTimeout(r, n);
|
|
3507
3507
|
}, [r, n]);
|
|
3508
3508
|
}
|
|
3509
3509
|
function fs(e, t) {
|
|
3510
|
-
let n =
|
|
3510
|
+
let n = W(t);
|
|
3511
3511
|
I(() => {
|
|
3512
3512
|
let t = 0;
|
|
3513
3513
|
if (e) {
|
|
@@ -3537,7 +3537,7 @@ function bs(e) {
|
|
|
3537
3537
|
return vs.includes(e);
|
|
3538
3538
|
}
|
|
3539
3539
|
var xs = ys, Ss = "Tabs", [Cs, ws] = M(Ss, [Fa]), Ts = Fa(), [Es, Ds] = Cs(Ss), Os = e.forwardRef((e, t) => {
|
|
3540
|
-
let { __scopeTabs: n, value: r, onValueChange: i, defaultValue: a, orientation: o = "horizontal", dir: s, activationMode: c = "automatic", ...l } = e, u =
|
|
3540
|
+
let { __scopeTabs: n, value: r, onValueChange: i, defaultValue: a, orientation: o = "horizontal", dir: s, activationMode: c = "automatic", ...l } = e, u = U(s), [d, f] = R({
|
|
3541
3541
|
prop: r,
|
|
3542
3542
|
onChange: i,
|
|
3543
3543
|
defaultProp: a ?? "",
|
|
@@ -3715,7 +3715,7 @@ var [Js, Ys] = Ws(Us), Xs = t.forwardRef((e, n) => {
|
|
|
3715
3715
|
});
|
|
3716
3716
|
qs.displayName = Us;
|
|
3717
3717
|
var [Qs, $s] = Ws(Us), ec = t.forwardRef((e, t) => {
|
|
3718
|
-
let { __scopeToggleGroup: n, disabled: r = !1, rovingFocus: i = !0, orientation: a, dir: o, loop: s = !0, ...c } = e, l = Ks(n), u =
|
|
3718
|
+
let { __scopeToggleGroup: n, disabled: r = !1, rovingFocus: i = !0, orientation: a, dir: o, loop: s = !0, ...c } = e, l = Ks(n), u = U(o), d = {
|
|
3719
3719
|
role: "group",
|
|
3720
3720
|
dir: u,
|
|
3721
3721
|
...c
|
|
@@ -4963,7 +4963,7 @@ var Ul = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Wl = Hl, Gl
|
|
|
4963
4963
|
Y,
|
|
4964
4964
|
Z,
|
|
4965
4965
|
X
|
|
4966
|
-
],
|
|
4966
|
+
], U = () => [
|
|
4967
4967
|
Nu,
|
|
4968
4968
|
"full",
|
|
4969
4969
|
...w()
|
|
@@ -5868,10 +5868,10 @@ var Ul = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Wl = Hl, Gl
|
|
|
5868
5868
|
] }],
|
|
5869
5869
|
"transform-origin": [{ origin: x() }],
|
|
5870
5870
|
"transform-style": [{ transform: ["3d", "flat"] }],
|
|
5871
|
-
translate: [{ translate:
|
|
5872
|
-
"translate-x": [{ "translate-x":
|
|
5873
|
-
"translate-y": [{ "translate-y":
|
|
5874
|
-
"translate-z": [{ "translate-z":
|
|
5871
|
+
translate: [{ translate: U() }],
|
|
5872
|
+
"translate-x": [{ "translate-x": U() }],
|
|
5873
|
+
"translate-y": [{ "translate-y": U() }],
|
|
5874
|
+
"translate-z": [{ "translate-z": U() }],
|
|
5875
5875
|
"translate-none": ["translate-none"],
|
|
5876
5876
|
accent: [{ accent: I() }],
|
|
5877
5877
|
appearance: [{ appearance: ["none", "auto"] }],
|
|
@@ -6688,7 +6688,7 @@ function Uf() {
|
|
|
6688
6688
|
enumerable: !0,
|
|
6689
6689
|
value: null
|
|
6690
6690
|
}
|
|
6691
|
-
})), H = !0, re = !0, ie = !1, ae = !0, oe = !1,
|
|
6691
|
+
})), H = !0, re = !0, ie = !1, ae = !0, oe = !1, U = !0, W = !1, se = !1, ce = !1, le = !1, ue = !1, G = !1, de = !0, fe = !1, pe = "user-content-", me = !0, K = !1, he = {}, ge = null, q = $({}, [
|
|
6692
6692
|
"annotation-xml",
|
|
6693
6693
|
"audio",
|
|
6694
6694
|
"colgroup",
|
|
@@ -6714,7 +6714,7 @@ function Uf() {
|
|
|
6714
6714
|
"title",
|
|
6715
6715
|
"video",
|
|
6716
6716
|
"xmp"
|
|
6717
|
-
]),
|
|
6717
|
+
]), _e = null, ve = $({}, [
|
|
6718
6718
|
"audio",
|
|
6719
6719
|
"video",
|
|
6720
6720
|
"img",
|
|
@@ -6757,7 +6757,7 @@ function Uf() {
|
|
|
6757
6757
|
}, Ie = function() {
|
|
6758
6758
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
6759
6759
|
if (Ne && Ne === e) return;
|
|
6760
|
-
(!e || typeof e != "object") && (e = {}), e = pf(e), Ae = je.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, Me = Ae === "application/xhtml+xml" ? Xd : Yd, L = of(e, "ALLOWED_TAGS") && Jd(e.ALLOWED_TAGS) ? $({}, e.ALLOWED_TAGS, Me) : R, z = of(e, "ALLOWED_ATTR") && Jd(e.ALLOWED_ATTR) ? $({}, e.ALLOWED_ATTR, Me) : ee, Te = of(e, "ALLOWED_NAMESPACES") && Jd(e.ALLOWED_NAMESPACES) ? $({}, e.ALLOWED_NAMESPACES, Xd) : Ee, ye = of(e, "ADD_URI_SAFE_ATTR") && Jd(e.ADD_URI_SAFE_ATTR) ? $(pf(be), e.ADD_URI_SAFE_ATTR, Me) : be,
|
|
6760
|
+
(!e || typeof e != "object") && (e = {}), e = pf(e), Ae = je.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, Me = Ae === "application/xhtml+xml" ? Xd : Yd, L = of(e, "ALLOWED_TAGS") && Jd(e.ALLOWED_TAGS) ? $({}, e.ALLOWED_TAGS, Me) : R, z = of(e, "ALLOWED_ATTR") && Jd(e.ALLOWED_ATTR) ? $({}, e.ALLOWED_ATTR, Me) : ee, Te = of(e, "ALLOWED_NAMESPACES") && Jd(e.ALLOWED_NAMESPACES) ? $({}, e.ALLOWED_NAMESPACES, Xd) : Ee, ye = of(e, "ADD_URI_SAFE_ATTR") && Jd(e.ADD_URI_SAFE_ATTR) ? $(pf(be), e.ADD_URI_SAFE_ATTR, Me) : be, _e = of(e, "ADD_DATA_URI_TAGS") && Jd(e.ADD_DATA_URI_TAGS) ? $(pf(ve), e.ADD_DATA_URI_TAGS, Me) : ve, ge = of(e, "FORBID_CONTENTS") && Jd(e.FORBID_CONTENTS) ? $({}, e.FORBID_CONTENTS, Me) : q, V = of(e, "FORBID_TAGS") && Jd(e.FORBID_TAGS) ? $({}, e.FORBID_TAGS, Me) : pf({}), te = of(e, "FORBID_ATTR") && Jd(e.FORBID_ATTR) ? $({}, e.FORBID_ATTR, Me) : pf({}), he = of(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? pf(e.USE_PROFILES) : e.USE_PROFILES : !1, H = e.ALLOW_ARIA_ATTR !== !1, re = e.ALLOW_DATA_ATTR !== !1, ie = e.ALLOW_UNKNOWN_PROTOCOLS || !1, ae = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, oe = e.SAFE_FOR_TEMPLATES || !1, U = e.SAFE_FOR_XML !== !1, W = e.WHOLE_DOCUMENT || !1, le = e.RETURN_DOM || !1, ue = e.RETURN_DOM_FRAGMENT || !1, G = e.RETURN_TRUSTED_TYPE || !1, ce = e.FORCE_BODY || !1, de = e.SANITIZE_DOM !== !1, fe = e.SANITIZE_NAMED_PROPS || !1, me = e.KEEP_CONTENT !== !1, K = e.IN_PLACE || !1, I = gf(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : Nf, J = typeof e.NAMESPACE == "string" ? e.NAMESPACE : Ce, De = of(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? pf(e.MATHML_TEXT_INTEGRATION_POINTS) : $({}, [
|
|
6761
6761
|
"mi",
|
|
6762
6762
|
"mo",
|
|
6763
6763
|
"mn",
|
|
@@ -6765,7 +6765,7 @@ function Uf() {
|
|
|
6765
6765
|
"mtext"
|
|
6766
6766
|
]), Oe = of(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? pf(e.HTML_INTEGRATION_POINTS) : $({}, ["annotation-xml"]);
|
|
6767
6767
|
let t = of(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? pf(e.CUSTOM_ELEMENT_HANDLING) : Bd(null);
|
|
6768
|
-
if (B = Bd(null), of(t, "tagNameCheck") && Fe(t.tagNameCheck) && (B.tagNameCheck = t.tagNameCheck), of(t, "attributeNameCheck") && Fe(t.attributeNameCheck) && (B.attributeNameCheck = t.attributeNameCheck), of(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (B.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), oe && (re = !1), ue && (le = !0), he && (L = $({}, Cf), z = Bd(null), he.html === !0 && ($(L, _f), $(z, wf)), he.svg === !0 && ($(L, vf), $(z, Tf), $(z, Df)), he.svgFilters === !0 && ($(L, yf), $(z, Tf), $(z, Df)), he.mathMl === !0 && ($(L, xf), $(z, Ef), $(z, Df))), ne.tagCheck = null, ne.attributeCheck = null, of(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? ne.tagCheck = e.ADD_TAGS : Jd(e.ADD_TAGS) && (L === R && (L = pf(L)), $(L, e.ADD_TAGS, Me))), of(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? ne.attributeCheck = e.ADD_ATTR : Jd(e.ADD_ATTR) && (z === ee && (z = pf(z)), $(z, e.ADD_ATTR, Me))), of(e, "ADD_URI_SAFE_ATTR") && Jd(e.ADD_URI_SAFE_ATTR) && $(ye, e.ADD_URI_SAFE_ATTR, Me), of(e, "FORBID_CONTENTS") && Jd(e.FORBID_CONTENTS) && (ge ===
|
|
6768
|
+
if (B = Bd(null), of(t, "tagNameCheck") && Fe(t.tagNameCheck) && (B.tagNameCheck = t.tagNameCheck), of(t, "attributeNameCheck") && Fe(t.attributeNameCheck) && (B.attributeNameCheck = t.attributeNameCheck), of(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (B.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), oe && (re = !1), ue && (le = !0), he && (L = $({}, Cf), z = Bd(null), he.html === !0 && ($(L, _f), $(z, wf)), he.svg === !0 && ($(L, vf), $(z, Tf), $(z, Df)), he.svgFilters === !0 && ($(L, yf), $(z, Tf), $(z, Df)), he.mathMl === !0 && ($(L, xf), $(z, Ef), $(z, Df))), ne.tagCheck = null, ne.attributeCheck = null, of(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? ne.tagCheck = e.ADD_TAGS : Jd(e.ADD_TAGS) && (L === R && (L = pf(L)), $(L, e.ADD_TAGS, Me))), of(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? ne.attributeCheck = e.ADD_ATTR : Jd(e.ADD_ATTR) && (z === ee && (z = pf(z)), $(z, e.ADD_ATTR, Me))), of(e, "ADD_URI_SAFE_ATTR") && Jd(e.ADD_URI_SAFE_ATTR) && $(ye, e.ADD_URI_SAFE_ATTR, Me), of(e, "FORBID_CONTENTS") && Jd(e.FORBID_CONTENTS) && (ge === q && (ge = pf(ge)), $(ge, e.FORBID_CONTENTS, Me)), of(e, "ADD_FORBID_CONTENTS") && Jd(e.ADD_FORBID_CONTENTS) && (ge === q && (ge = pf(ge)), $(ge, e.ADD_FORBID_CONTENTS, Me)), me && (L["#text"] = !0), W && $(L, [
|
|
6769
6769
|
"html",
|
|
6770
6770
|
"head",
|
|
6771
6771
|
"body"
|
|
@@ -6831,7 +6831,7 @@ function Uf() {
|
|
|
6831
6831
|
} catch {}
|
|
6832
6832
|
}
|
|
6833
6833
|
let a = t.body || t.documentElement;
|
|
6834
|
-
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), J === Ce ? T.call(t,
|
|
6834
|
+
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), J === Ce ? T.call(t, W ? "html" : "body")[0] : W ? t.documentElement : a;
|
|
6835
6835
|
}, Ue = function(e) {
|
|
6836
6836
|
return C.call(e.ownerDocument || e, e, l.SHOW_ELEMENT | l.SHOW_COMMENT | l.SHOW_TEXT | l.SHOW_PROCESSING_INSTRUCTION | l.SHOW_CDATA_SECTION, null);
|
|
6837
6837
|
}, We = function(e) {
|
|
@@ -6851,7 +6851,7 @@ function Uf() {
|
|
|
6851
6851
|
if (Ke(D.uponSanitizeElement, e, {
|
|
6852
6852
|
tagName: r,
|
|
6853
6853
|
allowedTags: L
|
|
6854
|
-
}),
|
|
6854
|
+
}), U && e.hasChildNodes() && !Ge(e.firstElementChild) && cf(/<[/\w!]/g, e.innerHTML) && cf(/<[/\w!]/g, e.textContent) || U && e.namespaceURI === Ce && r === "style" && Ge(e.firstElementChild) || e.nodeType === zf.progressingInstruction || U && e.nodeType === zf.comment && cf(/<[/\w]/g, e.data)) return Be(e), !0;
|
|
6855
6855
|
if (V[r] || !(ne.tagCheck instanceof Function && ne.tagCheck(r)) && !L[r]) {
|
|
6856
6856
|
if (!V[r] && Xe(r) && (B.tagNameCheck instanceof RegExp && cf(B.tagNameCheck, r) || B.tagNameCheck instanceof Function && B.tagNameCheck(r))) return !1;
|
|
6857
6857
|
if (me && !ge[r]) {
|
|
@@ -6874,11 +6874,11 @@ function Uf() {
|
|
|
6874
6874
|
n = Qd(n, e, " ");
|
|
6875
6875
|
}), e.textContent !== n && (Kd(t.removed, { element: e.cloneNode() }), e.textContent = n)), Ke(D.afterSanitizeElements, e, null), !1);
|
|
6876
6876
|
}, Je = function(e, t, r) {
|
|
6877
|
-
if (te[t] ||
|
|
6877
|
+
if (te[t] || de && (t === "id" || t === "name") && (r in n || r in Pe)) return !1;
|
|
6878
6878
|
if (!(re && !te[t] && cf(j, t)) && !(H && cf(M, t)) && !(ne.attributeCheck instanceof Function && ne.attributeCheck(t, e))) {
|
|
6879
6879
|
if (!z[t] || te[t]) {
|
|
6880
6880
|
if (!(Xe(e) && (B.tagNameCheck instanceof RegExp && cf(B.tagNameCheck, e) || B.tagNameCheck instanceof Function && B.tagNameCheck(e)) && (B.attributeNameCheck instanceof RegExp && cf(B.attributeNameCheck, t) || B.attributeNameCheck instanceof Function && B.attributeNameCheck(t, e)) || t === "is" && B.allowCustomizedBuiltInElements && (B.tagNameCheck instanceof RegExp && cf(B.tagNameCheck, r) || B.tagNameCheck instanceof Function && B.tagNameCheck(r)))) return !1;
|
|
6881
|
-
} else if (!ye[t] && !cf(I, Qd(r, P, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && $d(r, "data:") === 0 &&
|
|
6881
|
+
} else if (!ye[t] && !cf(I, Qd(r, P, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && $d(r, "data:") === 0 && _e[e]) && !(ie && !cf(N, Qd(r, P, ""))) && r) return !1;
|
|
6882
6882
|
}
|
|
6883
6883
|
return !0;
|
|
6884
6884
|
}, Ye = $({}, [
|
|
@@ -6905,7 +6905,7 @@ function Uf() {
|
|
|
6905
6905
|
}, i = n.length;
|
|
6906
6906
|
for (; i--;) {
|
|
6907
6907
|
let { name: a, namespaceURI: o, value: s } = n[i], c = Me(a), l = s, u = a === "value" ? l : ef(l);
|
|
6908
|
-
if (r.attrName = c, r.attrValue = u, r.keepAttr = !0, r.forceKeepAttr = void 0, Ke(D.uponSanitizeAttribute, e, r), u = r.attrValue,
|
|
6908
|
+
if (r.attrName = c, r.attrValue = u, r.keepAttr = !0, r.forceKeepAttr = void 0, Ke(D.uponSanitizeAttribute, e, r), u = r.attrValue, fe && (c === "id" || c === "name") && $d(u, pe) !== 0 && (Ve(a, e), u = pe + u), U && cf(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, u)) {
|
|
6909
6909
|
Ve(a, e);
|
|
6910
6910
|
continue;
|
|
6911
6911
|
}
|
|
@@ -6958,7 +6958,7 @@ function Uf() {
|
|
|
6958
6958
|
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, o = null, c = null, l = null;
|
|
6959
6959
|
if (we = !e, we && (e = "<!-->"), typeof e != "string" && !Ge(e) && (e = mf(e), typeof e != "string")) throw lf("dirty is not a string, aborting");
|
|
6960
6960
|
if (!t.isSupported) return e;
|
|
6961
|
-
if (
|
|
6961
|
+
if (se || Ie(n), t.removed = [], typeof e == "string" && (K = !1), K) {
|
|
6962
6962
|
let t = e.nodeName;
|
|
6963
6963
|
if (typeof t == "string") {
|
|
6964
6964
|
let e = Me(t);
|
|
@@ -6966,8 +6966,8 @@ function Uf() {
|
|
|
6966
6966
|
}
|
|
6967
6967
|
} else if (e instanceof s) i = He("<!---->"), o = i.ownerDocument.importNode(e, !0), o.nodeType === zf.element && o.nodeName === "BODY" || o.nodeName === "HTML" ? i = o : i.appendChild(o);
|
|
6968
6968
|
else {
|
|
6969
|
-
if (!le && !oe && !
|
|
6970
|
-
if (i = He(e), !i) return le ? null :
|
|
6969
|
+
if (!le && !oe && !W && e.indexOf("<") === -1) return b && G ? b.createHTML(e) : e;
|
|
6970
|
+
if (i = He(e), !i) return le ? null : G ? x : "";
|
|
6971
6971
|
}
|
|
6972
6972
|
i && ce && Be(i.firstChild);
|
|
6973
6973
|
let u = Ue(K ? e : i);
|
|
@@ -6989,18 +6989,18 @@ function Uf() {
|
|
|
6989
6989
|
else l = i;
|
|
6990
6990
|
return (z.shadowroot || z.shadowrootmode) && (l = E.call(r, l, !0)), l;
|
|
6991
6991
|
}
|
|
6992
|
-
let d =
|
|
6993
|
-
return
|
|
6992
|
+
let d = W ? i.outerHTML : i.innerHTML;
|
|
6993
|
+
return W && L["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && cf(If, i.ownerDocument.doctype.name) && (d = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + d), oe && Ud([
|
|
6994
6994
|
O,
|
|
6995
6995
|
k,
|
|
6996
6996
|
A
|
|
6997
6997
|
], (e) => {
|
|
6998
6998
|
d = Qd(d, e, " ");
|
|
6999
|
-
}), b &&
|
|
6999
|
+
}), b && G ? b.createHTML(d) : d;
|
|
7000
7000
|
}, t.setConfig = function() {
|
|
7001
|
-
Ie(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}),
|
|
7001
|
+
Ie(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}), se = !0;
|
|
7002
7002
|
}, t.clearConfig = function() {
|
|
7003
|
-
Ne = null,
|
|
7003
|
+
Ne = null, se = !1;
|
|
7004
7004
|
}, t.isValidAttribute = function(e, t, n) {
|
|
7005
7005
|
return Ne || Ie({}), Je(Me(e), Me(t), n);
|
|
7006
7006
|
}, t.addHook = function(e, t) {
|
|
@@ -7453,13 +7453,13 @@ function Tp({ apiKey: e, geocodeApiKey: t, drawerOpen: n, placeholder: r = "PL8S
|
|
|
7453
7453
|
].filter((e) => e != null && e !== "").map(String).join(" ");
|
|
7454
7454
|
window.open(`mailto:report@partbot.io?subject=Registration%20Search%20Issue&body=${encodeURIComponent(`Incorrect vehicles were shown for ${S} number plate: ${b}, vehicle: ${t}. Please provide details of the correct vehicle below:`)}`);
|
|
7455
7455
|
}
|
|
7456
|
-
function
|
|
7456
|
+
function U() {
|
|
7457
7457
|
x(""), T(null), D(null), j(Lc), bl(), _l(), Il();
|
|
7458
7458
|
}
|
|
7459
|
-
function
|
|
7459
|
+
function W() {
|
|
7460
7460
|
f && Bl(f);
|
|
7461
7461
|
}
|
|
7462
|
-
function
|
|
7462
|
+
function se(e) {
|
|
7463
7463
|
e.preventDefault(), re(Lc);
|
|
7464
7464
|
}
|
|
7465
7465
|
return /* @__PURE__ */ g("div", {
|
|
@@ -7493,13 +7493,13 @@ function Tp({ apiKey: e, geocodeApiKey: t, drawerOpen: n, placeholder: r = "PL8S
|
|
|
7493
7493
|
type: "button",
|
|
7494
7494
|
variant: "outline",
|
|
7495
7495
|
className: "w-full",
|
|
7496
|
-
onClick:
|
|
7496
|
+
onClick: U,
|
|
7497
7497
|
children: "Clear Vehicle"
|
|
7498
7498
|
}), f ? /* @__PURE__ */ g(gd, {
|
|
7499
7499
|
type: "button",
|
|
7500
7500
|
variant: "outline",
|
|
7501
7501
|
className: "w-full",
|
|
7502
|
-
onClick:
|
|
7502
|
+
onClick: W,
|
|
7503
7503
|
children: [/* @__PURE__ */ h(xc, { "data-icon": "inline-start" }), p]
|
|
7504
7504
|
}) : null]
|
|
7505
7505
|
})]
|
|
@@ -7617,14 +7617,14 @@ function Tp({ apiKey: e, geocodeApiKey: t, drawerOpen: n, placeholder: r = "PL8S
|
|
|
7617
7617
|
type: "button",
|
|
7618
7618
|
variant: "ghost",
|
|
7619
7619
|
size: "sm",
|
|
7620
|
-
onClick:
|
|
7620
|
+
onClick: U,
|
|
7621
7621
|
children: [/* @__PURE__ */ h(bc, { "data-icon": "inline-start" }), "Back to search"]
|
|
7622
7622
|
})]
|
|
7623
7623
|
})
|
|
7624
7624
|
]
|
|
7625
7625
|
}) : null,
|
|
7626
7626
|
!E && !w ? /* @__PURE__ */ g("form", {
|
|
7627
|
-
onSubmit:
|
|
7627
|
+
onSubmit: se,
|
|
7628
7628
|
className: "mx-auto flex w-full max-w-xl flex-col items-center gap-5 text-left",
|
|
7629
7629
|
children: [
|
|
7630
7630
|
L ? /* @__PURE__ */ g("div", {
|
|
@@ -8897,6 +8897,10 @@ function xm({ label: e, value: t, options: n, onChange: r, placeholder: i, disab
|
|
|
8897
8897
|
function L() {
|
|
8898
8898
|
r(null), y(""), x(!0), C(0), p.current?.focus();
|
|
8899
8899
|
}
|
|
8900
|
+
function R(e) {
|
|
8901
|
+
let t = e.target;
|
|
8902
|
+
t instanceof Node && f.current?.contains(t) && e.preventDefault();
|
|
8903
|
+
}
|
|
8900
8904
|
return /* @__PURE__ */ h(hm, { children: /* @__PURE__ */ h(_m, {
|
|
8901
8905
|
"data-disabled": A,
|
|
8902
8906
|
children: /* @__PURE__ */ g(Eo, {
|
|
@@ -8976,6 +8980,7 @@ function xm({ label: e, value: t, options: n, onChange: r, placeholder: i, disab
|
|
|
8976
8980
|
align: "start",
|
|
8977
8981
|
sideOffset: 8,
|
|
8978
8982
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
8983
|
+
onInteractOutside: R,
|
|
8979
8984
|
children: D.map((t, n) => {
|
|
8980
8985
|
let r = String(t.value), i = String(t.refinement) === N;
|
|
8981
8986
|
return /* @__PURE__ */ g("button", {
|
|
@@ -9022,28 +9027,17 @@ function Em(e) {
|
|
|
9022
9027
|
function Dm(e) {
|
|
9023
9028
|
return Object.entries(e).reduce((e, [t, n]) => (n && (e[t] = n.value), e), {});
|
|
9024
9029
|
}
|
|
9025
|
-
function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "", fields: s, fieldPrefix: d = "", modifyQueryString: f = !0,
|
|
9026
|
-
let
|
|
9030
|
+
function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "", fields: s, fieldPrefix: d = "", modifyQueryString: f = !0, useStoreVehicles: p = !0, fieldOrder: _ = "MMY", yearOptional: v = !1, enableFeatureFlags: y = !0, portalContainer: b, activeVehicle: x, onVehicleSelected: S }) {
|
|
9031
|
+
let C = l([]), w = l([]), T = l(null), E = l(null), D = l(null), O = l(null), k = l(null), [A, j] = u(Sm), [M, N] = u([]), [P, F] = u([]), [I, L] = u([]), [R, z] = u([]), [ee, B] = u([]), [V, te] = u([]), [ne, H] = u([]), [re, ie] = u([]), [ae, oe] = u([]), [U, W] = u(null), [se, ce] = u({}), [le, ue] = u(null), G = _ === "YMM", de = U?.searchKey ? `${U.host}|${U.indexName}|${U.searchKey}` : "", fe = U?.searchKey ? `${zc}|${U.mmyIndexName}|${U.searchKey}` : "", pe = c(() => s ? s.split(",").map((e) => e.trim()).filter((e) => Cm.includes(e)) : [], [s]), me = c(() => new Set(r.split(",").map((e) => rm(e)).filter(Boolean)), [r]), K = c(() => new Set(Object.keys(se).map((e) => rm(e))), [se]), he = i((e) => d ? `${d}${e}` : e, [d]), ge = i((e) => d ? e.replace(RegExp(`^${d}`), "") : e, [d]), q = i(({ query: e, value: t, remove: n = [] }) => {
|
|
9027
9032
|
if (typeof window > "u" || !f) return;
|
|
9028
|
-
let r = new URLSearchParams(window.location.search), i =
|
|
9033
|
+
let r = new URLSearchParams(window.location.search), i = he(e);
|
|
9029
9034
|
t != null && t !== "" ? r.set(i, String(t)) : r.delete(i), n.forEach((e) => {
|
|
9030
|
-
r.delete(
|
|
9035
|
+
r.delete(he(e));
|
|
9031
9036
|
});
|
|
9032
9037
|
let a = `${window.location.pathname}?${r.toString()}`;
|
|
9033
9038
|
window.history.pushState(null, "", a);
|
|
9034
|
-
}, [f,
|
|
9035
|
-
|
|
9036
|
-
selection: e,
|
|
9037
|
-
modifyQueryString: f,
|
|
9038
|
-
vehicleScopeTokens: p,
|
|
9039
|
-
yearTokens: y
|
|
9040
|
-
});
|
|
9041
|
-
}, [
|
|
9042
|
-
f,
|
|
9043
|
-
p,
|
|
9044
|
-
y
|
|
9045
|
-
]), be = i((e) => {
|
|
9046
|
-
N({
|
|
9039
|
+
}, [f, he]), _e = i((e) => {
|
|
9040
|
+
j({
|
|
9047
9041
|
make: Em(e.make),
|
|
9048
9042
|
model: Em(e.model),
|
|
9049
9043
|
year: Em(e.year),
|
|
@@ -9053,8 +9047,8 @@ function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "",
|
|
|
9053
9047
|
engine: Em(e.engine),
|
|
9054
9048
|
engine_capacity: Em(e.engine_capacity)
|
|
9055
9049
|
});
|
|
9056
|
-
}, []),
|
|
9057
|
-
if (typeof window > "u" ||
|
|
9050
|
+
}, []), ve = i(() => {
|
|
9051
|
+
if (typeof window > "u" || x) return;
|
|
9058
9052
|
let e = new URL(window.location.href).searchParams, t = [
|
|
9059
9053
|
"make",
|
|
9060
9054
|
"model",
|
|
@@ -9064,7 +9058,7 @@ function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "",
|
|
|
9064
9058
|
"variant",
|
|
9065
9059
|
"engine",
|
|
9066
9060
|
"engine_capacity"
|
|
9067
|
-
], n = t.map(
|
|
9061
|
+
], n = t.map(he), r = {}, i = /^filter\.p\.m\.app--\d+--partbot\.vehicle_(\w+)$/;
|
|
9068
9062
|
for (let [n, a] of e.entries()) {
|
|
9069
9063
|
let e = n.match(i);
|
|
9070
9064
|
if (!e) continue;
|
|
@@ -9078,21 +9072,21 @@ function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "",
|
|
|
9078
9072
|
s === "engine_capacitie" && (s = "engine_capacity"), s === "bodie" && (s = "body"), s === "serie" && (s = "series"), t.includes(s) && (r[s] = a);
|
|
9079
9073
|
}
|
|
9080
9074
|
let a = Object.fromEntries(Array.from(e.entries()).filter(([e]) => n.includes(e)).map(([e, t]) => {
|
|
9081
|
-
let n =
|
|
9075
|
+
let n = ge(e);
|
|
9082
9076
|
return n === "year" && /^\d{4}$/.test(t) ? [n, Number.parseInt(t, 10)] : [n, t];
|
|
9083
9077
|
}));
|
|
9084
9078
|
Object.entries(r).forEach(([e, t]) => {
|
|
9085
9079
|
a[e] || (a[e] = e === "year" && /^\d{4}$/.test(t) ? Number.parseInt(t, 10) : t);
|
|
9086
|
-
}), Object.keys(a).length > 0 &&
|
|
9080
|
+
}), Object.keys(a).length > 0 && _e(a);
|
|
9087
9081
|
}, [
|
|
9088
|
-
|
|
9089
|
-
be,
|
|
9082
|
+
x,
|
|
9090
9083
|
_e,
|
|
9091
|
-
|
|
9084
|
+
he,
|
|
9085
|
+
ge
|
|
9092
9086
|
]);
|
|
9093
9087
|
a(() => {
|
|
9094
|
-
!
|
|
9095
|
-
}, [
|
|
9088
|
+
!x?.key || k.current === x.key || (k.current = x.key, _e(x.vehicle));
|
|
9089
|
+
}, [x, _e]), a(() => {
|
|
9096
9090
|
if (!e || e === "demo") return;
|
|
9097
9091
|
async function r() {
|
|
9098
9092
|
try {
|
|
@@ -9103,38 +9097,38 @@ function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "",
|
|
|
9103
9097
|
Authorization: `Bearer ${e}`
|
|
9104
9098
|
},
|
|
9105
9099
|
body: JSON.stringify({
|
|
9106
|
-
use_store_vehicles:
|
|
9100
|
+
use_store_vehicles: p,
|
|
9107
9101
|
...n ? { store: n } : {}
|
|
9108
9102
|
})
|
|
9109
9103
|
});
|
|
9110
9104
|
if (!r.ok) throw Error(`Error: ${r.status} ${r.statusText}`);
|
|
9111
9105
|
let i = await r.json();
|
|
9112
|
-
|
|
9106
|
+
C.current = (i.vehicle_makes ?? []).map((e) => ({
|
|
9113
9107
|
...e,
|
|
9114
9108
|
refinement: e.value
|
|
9115
|
-
})),
|
|
9109
|
+
})), p && i.vehicle_models ? typeof i.vehicle_models == "object" && !Array.isArray(i.vehicle_models) ? (w.current = i.vehicle_models, ce(i.vehicle_models)) : Array.isArray(i.vehicle_models) && (w.current = i.vehicle_models.map((e) => String(e?.value ?? "").trim()).filter(Boolean), ce({})) : (w.current = [], ce({})), T.current = Array.isArray(i.store_popular_makes) ? i.store_popular_makes.map((e) => String(e).trim().toUpperCase()) : null, E.current = i.store_popular_models ?? null, W({
|
|
9116
9110
|
host: mm(i.host, "https://search.partbot.io"),
|
|
9117
9111
|
searchKey: i.search_key || i.meilisearch_search_key || i.algolia_search_key || "",
|
|
9118
9112
|
indexName: i.vehicle_index_name || i.index_name || i.meilisearch_index_name || i.algolia_index_name || wm,
|
|
9119
9113
|
mmyIndexName: i.vehicle_mmy_index_name || i.mmy_index_name || i.meilisearch_mmy_index_name || Tm
|
|
9120
9114
|
});
|
|
9121
9115
|
} catch (e) {
|
|
9122
|
-
console.error("[VehicleGarage] MMY auth failed:", e),
|
|
9116
|
+
console.error("[VehicleGarage] MMY auth failed:", e), ue(e instanceof Error ? e.message : "Could not load vehicle search.");
|
|
9123
9117
|
}
|
|
9124
9118
|
}
|
|
9125
9119
|
r();
|
|
9126
9120
|
}, [
|
|
9127
9121
|
t,
|
|
9128
9122
|
e,
|
|
9129
|
-
|
|
9123
|
+
y,
|
|
9130
9124
|
n,
|
|
9131
|
-
|
|
9125
|
+
p
|
|
9132
9126
|
]);
|
|
9133
|
-
let
|
|
9127
|
+
let ye = i(async () => {
|
|
9134
9128
|
let e = [];
|
|
9135
|
-
if (
|
|
9136
|
-
else if (
|
|
9137
|
-
let t = await
|
|
9129
|
+
if (C.current.length > 0) e = [...C.current];
|
|
9130
|
+
else if (D.current) {
|
|
9131
|
+
let t = await D.current.search("", {
|
|
9138
9132
|
attributesToRetrieve: ["make", "make_popularity"],
|
|
9139
9133
|
limit: 1e3
|
|
9140
9134
|
}), n = /* @__PURE__ */ new Map();
|
|
@@ -9147,39 +9141,39 @@ function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "",
|
|
|
9147
9141
|
});
|
|
9148
9142
|
}), e = Array.from(n.values());
|
|
9149
9143
|
}
|
|
9150
|
-
if (
|
|
9151
|
-
let t = new Set(
|
|
9144
|
+
if (me.size > 0 ? e = e.filter((e) => me.has(rm(e.value))) : K.size > 0 && (e = e.filter((e) => K.has(rm(e.value)))), T.current?.length) {
|
|
9145
|
+
let t = new Set(T.current);
|
|
9152
9146
|
e.sort((e, n) => {
|
|
9153
9147
|
let r = t.has(String(e.value)), i = t.has(String(n.value));
|
|
9154
|
-
return r && !i ? -1 : !r && i ? 1 : r && i ?
|
|
9148
|
+
return r && !i ? -1 : !r && i ? 1 : r && i ? T.current.indexOf(String(e.value)) - T.current.indexOf(String(n.value)) : String(e.value).localeCompare(String(n.value));
|
|
9155
9149
|
});
|
|
9156
9150
|
} else e.sort((e, t) => (e.popularity ?? 0) === (t.popularity ?? 0) ? String(e.value).localeCompare(String(t.value)) : (t.popularity ?? 0) - (e.popularity ?? 0));
|
|
9157
|
-
|
|
9158
|
-
}, [
|
|
9151
|
+
N(e);
|
|
9152
|
+
}, [K, me]);
|
|
9159
9153
|
a(() => {
|
|
9160
|
-
if (!
|
|
9154
|
+
if (!U?.searchKey) return;
|
|
9161
9155
|
let e = !0;
|
|
9162
|
-
return
|
|
9163
|
-
host:
|
|
9164
|
-
apiKey:
|
|
9165
|
-
}).index(
|
|
9156
|
+
return D.current = new Jp({
|
|
9157
|
+
host: U.host || "https://search.partbot.io",
|
|
9158
|
+
apiKey: U.searchKey
|
|
9159
|
+
}).index(U.indexName), O.current = new Jp({
|
|
9166
9160
|
host: zc,
|
|
9167
|
-
apiKey:
|
|
9168
|
-
}).index(
|
|
9169
|
-
e &&
|
|
9161
|
+
apiKey: U.searchKey
|
|
9162
|
+
}).index(U.mmyIndexName), G || ye(), queueMicrotask(() => {
|
|
9163
|
+
e && ve();
|
|
9170
9164
|
}), () => {
|
|
9171
|
-
e = !1,
|
|
9165
|
+
e = !1, D.current = null, O.current = null;
|
|
9172
9166
|
};
|
|
9173
9167
|
}, [
|
|
9174
|
-
|
|
9168
|
+
U,
|
|
9175
9169
|
G,
|
|
9176
|
-
|
|
9177
|
-
|
|
9170
|
+
ye,
|
|
9171
|
+
ve
|
|
9178
9172
|
]), a(() => {
|
|
9179
9173
|
async function e() {
|
|
9180
|
-
if (!G || !
|
|
9181
|
-
let e = await
|
|
9182
|
-
filter: `year_from <= ${
|
|
9174
|
+
if (!G || !A.year || !D.current) return;
|
|
9175
|
+
let e = await D.current.search("", {
|
|
9176
|
+
filter: `year_from <= ${A.year.value} AND year_to >= ${A.year.value}`,
|
|
9183
9177
|
attributesToRetrieve: ["make", "make_popularity"],
|
|
9184
9178
|
limit: 1e4
|
|
9185
9179
|
}), t = /* @__PURE__ */ new Map();
|
|
@@ -9192,25 +9186,25 @@ function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "",
|
|
|
9192
9186
|
});
|
|
9193
9187
|
});
|
|
9194
9188
|
let n = Array.from(t.values());
|
|
9195
|
-
|
|
9189
|
+
me.size > 0 ? n = n.filter((e) => me.has(rm(e.value))) : K.size > 0 && (n = n.filter((e) => K.has(rm(e.value)))), N(n);
|
|
9196
9190
|
}
|
|
9197
9191
|
e();
|
|
9198
9192
|
}, [
|
|
9199
|
-
|
|
9200
|
-
|
|
9193
|
+
K,
|
|
9194
|
+
me,
|
|
9201
9195
|
G,
|
|
9202
|
-
|
|
9203
|
-
|
|
9196
|
+
A.year,
|
|
9197
|
+
de
|
|
9204
9198
|
]), a(() => {
|
|
9205
9199
|
async function e() {
|
|
9206
|
-
if (!G || !
|
|
9207
|
-
let e = await
|
|
9200
|
+
if (!G || !D.current || I.length > 0 || A.year) return;
|
|
9201
|
+
let e = await D.current.search("", {
|
|
9208
9202
|
attributesToRetrieve: ["year_from", "year_to"],
|
|
9209
9203
|
limit: 1e4
|
|
9210
9204
|
}), t = e.hits.map((e) => Number(e.year_from)).filter(Boolean), n = e.hits.map((e) => Number(e.year_to)).filter(Boolean);
|
|
9211
9205
|
if (t.length === 0 || n.length === 0) return;
|
|
9212
9206
|
let r = Math.min(...t), i = Math.max(...n);
|
|
9213
|
-
|
|
9207
|
+
L(Array.from({ length: i - r + 1 }, (e, t) => ({
|
|
9214
9208
|
value: i - t,
|
|
9215
9209
|
refinement: i - t
|
|
9216
9210
|
})));
|
|
@@ -9218,19 +9212,19 @@ function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "",
|
|
|
9218
9212
|
e();
|
|
9219
9213
|
}, [
|
|
9220
9214
|
G,
|
|
9221
|
-
|
|
9222
|
-
|
|
9223
|
-
|
|
9215
|
+
I.length,
|
|
9216
|
+
A.year,
|
|
9217
|
+
de
|
|
9224
9218
|
]);
|
|
9225
|
-
let
|
|
9226
|
-
|
|
9219
|
+
let be = i((e) => {
|
|
9220
|
+
F([]), !G && !v && L([]), z([]), B([]), te([]), H([]), ie([]), j((t) => ({
|
|
9227
9221
|
...Sm,
|
|
9228
9222
|
make: e,
|
|
9229
|
-
year: G ||
|
|
9223
|
+
year: G || v ? t.year : null
|
|
9230
9224
|
})), q({
|
|
9231
9225
|
query: "make",
|
|
9232
9226
|
value: e?.value ?? "",
|
|
9233
|
-
remove: G ||
|
|
9227
|
+
remove: G || v ? [
|
|
9234
9228
|
"model",
|
|
9235
9229
|
"body",
|
|
9236
9230
|
"series",
|
|
@@ -9246,16 +9240,16 @@ function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "",
|
|
|
9246
9240
|
"variant",
|
|
9247
9241
|
"engine_capacity"
|
|
9248
9242
|
]
|
|
9249
|
-
}), e ||
|
|
9243
|
+
}), e || oe([]);
|
|
9250
9244
|
}, [
|
|
9251
9245
|
G,
|
|
9252
9246
|
q,
|
|
9253
|
-
|
|
9254
|
-
]),
|
|
9255
|
-
!G && !
|
|
9247
|
+
v
|
|
9248
|
+
]), xe = i((e) => {
|
|
9249
|
+
!G && !v && L([]), z([]), B([]), te([]), H([]), ie([]), j((t) => ({
|
|
9256
9250
|
...t,
|
|
9257
9251
|
model: e,
|
|
9258
|
-
year: G ||
|
|
9252
|
+
year: G || v ? t.year : null,
|
|
9259
9253
|
body: null,
|
|
9260
9254
|
series: null,
|
|
9261
9255
|
variant: null,
|
|
@@ -9264,7 +9258,7 @@ function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "",
|
|
|
9264
9258
|
})), q({
|
|
9265
9259
|
query: "model",
|
|
9266
9260
|
value: e?.value ?? "",
|
|
9267
|
-
remove: G ||
|
|
9261
|
+
remove: G || v ? [
|
|
9268
9262
|
"body",
|
|
9269
9263
|
"series",
|
|
9270
9264
|
"engine",
|
|
@@ -9278,26 +9272,26 @@ function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "",
|
|
|
9278
9272
|
"variant",
|
|
9279
9273
|
"engine_capacity"
|
|
9280
9274
|
]
|
|
9281
|
-
}), e ||
|
|
9275
|
+
}), e || oe([]);
|
|
9282
9276
|
}, [
|
|
9283
9277
|
G,
|
|
9284
9278
|
q,
|
|
9285
|
-
|
|
9286
|
-
]),
|
|
9287
|
-
G ? (
|
|
9279
|
+
v
|
|
9280
|
+
]), Se = i((e) => {
|
|
9281
|
+
G ? (N([]), F([]), j({
|
|
9288
9282
|
...Sm,
|
|
9289
9283
|
year: e
|
|
9290
|
-
}), e ||
|
|
9284
|
+
}), e || L([])) : j((t) => ({
|
|
9291
9285
|
...t,
|
|
9292
9286
|
year: e,
|
|
9293
|
-
...
|
|
9287
|
+
...v ? {} : {
|
|
9294
9288
|
body: null,
|
|
9295
9289
|
series: null,
|
|
9296
9290
|
variant: null,
|
|
9297
9291
|
engine: null,
|
|
9298
9292
|
engine_capacity: null
|
|
9299
9293
|
}
|
|
9300
|
-
})),
|
|
9294
|
+
})), v || (z([]), B([]), te([]), H([]), ie([])), q({
|
|
9301
9295
|
query: "year",
|
|
9302
9296
|
value: e?.value ?? "",
|
|
9303
9297
|
remove: G ? [
|
|
@@ -9308,52 +9302,52 @@ function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "",
|
|
|
9308
9302
|
"variant",
|
|
9309
9303
|
"engine",
|
|
9310
9304
|
"engine_capacity"
|
|
9311
|
-
] :
|
|
9305
|
+
] : v ? [] : [
|
|
9312
9306
|
"body",
|
|
9313
9307
|
"series",
|
|
9314
9308
|
"variant",
|
|
9315
9309
|
"engine",
|
|
9316
9310
|
"engine_capacity"
|
|
9317
9311
|
]
|
|
9318
|
-
}), !
|
|
9312
|
+
}), !v && !e && oe([]);
|
|
9319
9313
|
}, [
|
|
9320
9314
|
G,
|
|
9321
9315
|
q,
|
|
9322
|
-
|
|
9323
|
-
]),
|
|
9324
|
-
|
|
9316
|
+
v
|
|
9317
|
+
]), Ce = i((e) => {
|
|
9318
|
+
j((t) => ({
|
|
9325
9319
|
...t,
|
|
9326
9320
|
body: e
|
|
9327
9321
|
})), q({
|
|
9328
9322
|
query: "body",
|
|
9329
9323
|
value: e?.value ?? ""
|
|
9330
9324
|
});
|
|
9331
|
-
}, [q]),
|
|
9332
|
-
|
|
9325
|
+
}, [q]), J = i((e) => {
|
|
9326
|
+
j((t) => ({
|
|
9333
9327
|
...t,
|
|
9334
9328
|
series: e
|
|
9335
9329
|
})), q({
|
|
9336
9330
|
query: "series",
|
|
9337
9331
|
value: e?.value ?? ""
|
|
9338
9332
|
});
|
|
9339
|
-
}, [q]),
|
|
9340
|
-
|
|
9333
|
+
}, [q]), we = i((e) => {
|
|
9334
|
+
j((t) => ({
|
|
9341
9335
|
...t,
|
|
9342
9336
|
variant: e
|
|
9343
9337
|
})), q({
|
|
9344
9338
|
query: "variant",
|
|
9345
9339
|
value: e?.value ?? ""
|
|
9346
9340
|
});
|
|
9347
|
-
}, [q]),
|
|
9348
|
-
|
|
9341
|
+
}, [q]), Te = i((e) => {
|
|
9342
|
+
j((t) => ({
|
|
9349
9343
|
...t,
|
|
9350
9344
|
engine: e
|
|
9351
9345
|
})), q({
|
|
9352
9346
|
query: "engine",
|
|
9353
9347
|
value: e?.value ?? ""
|
|
9354
9348
|
});
|
|
9355
|
-
}, [q]),
|
|
9356
|
-
|
|
9349
|
+
}, [q]), Ee = i((e) => {
|
|
9350
|
+
j((t) => ({
|
|
9357
9351
|
...t,
|
|
9358
9352
|
engine_capacity: e
|
|
9359
9353
|
})), q({
|
|
@@ -9363,30 +9357,30 @@ function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "",
|
|
|
9363
9357
|
}, [q]);
|
|
9364
9358
|
a(() => {
|
|
9365
9359
|
async function e() {
|
|
9366
|
-
if (!
|
|
9367
|
-
|
|
9360
|
+
if (!A.make?.refinement) {
|
|
9361
|
+
F([]);
|
|
9368
9362
|
return;
|
|
9369
9363
|
}
|
|
9370
|
-
let e = String(
|
|
9371
|
-
if (
|
|
9372
|
-
|
|
9364
|
+
let e = String(A.make.refinement), t = rm(e);
|
|
9365
|
+
if (me.size > 0 && !me.has(t)) {
|
|
9366
|
+
F([]);
|
|
9373
9367
|
return;
|
|
9374
9368
|
}
|
|
9375
|
-
if (
|
|
9376
|
-
|
|
9369
|
+
if (me.size === 0 && K.size > 0 && !K.has(t)) {
|
|
9370
|
+
F([]);
|
|
9377
9371
|
return;
|
|
9378
9372
|
}
|
|
9379
9373
|
let n = new Set(o.split(",").map((e) => rm(e)).filter(Boolean)), r = [];
|
|
9380
|
-
typeof
|
|
9374
|
+
typeof w.current == "object" && !Array.isArray(w.current) && (r = w.current[e] ?? w.current[Object.keys(w.current).find((e) => rm(e) === t) ?? ""] ?? []);
|
|
9381
9375
|
let i = new Set(r.map((e) => rm(e)));
|
|
9382
|
-
if (
|
|
9376
|
+
if (p && r.length > 0) {
|
|
9383
9377
|
let t = um(r.map((e) => ({
|
|
9384
9378
|
value: e,
|
|
9385
9379
|
refinement: e,
|
|
9386
9380
|
popularity: 0
|
|
9387
9381
|
})));
|
|
9388
9382
|
t = pm(t, n), t = pm(t, i);
|
|
9389
|
-
let a =
|
|
9383
|
+
let a = E.current?.[e];
|
|
9390
9384
|
if (a?.length) {
|
|
9391
9385
|
let e = new Map(a.map((e, t) => [e.toUpperCase(), a.length - t]));
|
|
9392
9386
|
t.sort((t, n) => {
|
|
@@ -9394,28 +9388,28 @@ function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "",
|
|
|
9394
9388
|
return r === i ? String(t.value).localeCompare(String(n.value)) : i - r;
|
|
9395
9389
|
});
|
|
9396
9390
|
} else t.sort((e, t) => String(e.value).localeCompare(String(t.value)));
|
|
9397
|
-
|
|
9391
|
+
F(t);
|
|
9398
9392
|
return;
|
|
9399
9393
|
}
|
|
9400
|
-
if (!
|
|
9394
|
+
if (!O.current) return;
|
|
9401
9395
|
let a;
|
|
9402
9396
|
try {
|
|
9403
|
-
a = await
|
|
9397
|
+
a = await O.current.search("", {
|
|
9404
9398
|
filter: em("make", e),
|
|
9405
9399
|
limit: 1
|
|
9406
9400
|
});
|
|
9407
9401
|
} catch (e) {
|
|
9408
|
-
console.error("[VehicleGarage] MMY model search failed:", e),
|
|
9402
|
+
console.error("[VehicleGarage] MMY model search failed:", e), F([]), ue(e instanceof Error ? e.message : "Could not load models for the selected make.");
|
|
9409
9403
|
return;
|
|
9410
9404
|
}
|
|
9411
|
-
|
|
9405
|
+
ue(null);
|
|
9412
9406
|
let s = um((a.hits[0]?.models ?? []).map((e) => ({
|
|
9413
9407
|
value: e.name,
|
|
9414
9408
|
refinement: e.name,
|
|
9415
9409
|
popularity: e.popularity ?? 0
|
|
9416
9410
|
})));
|
|
9417
9411
|
s = pm(s, n), s = pm(s, i);
|
|
9418
|
-
let c =
|
|
9412
|
+
let c = E.current?.[e];
|
|
9419
9413
|
if (c?.length) {
|
|
9420
9414
|
let e = c.map((e) => e.toUpperCase());
|
|
9421
9415
|
s.sort((t, n) => {
|
|
@@ -9423,65 +9417,65 @@ function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "",
|
|
|
9423
9417
|
return r >= 0 && i < 0 ? -1 : r < 0 && i >= 0 ? 1 : r >= 0 && i >= 0 ? r - i : String(t.value).localeCompare(String(n.value));
|
|
9424
9418
|
});
|
|
9425
9419
|
} else s.sort((e, t) => (e.popularity ?? 0) === (t.popularity ?? 0) ? String(e.value).localeCompare(String(t.value)) : (t.popularity ?? 0) - (e.popularity ?? 0));
|
|
9426
|
-
|
|
9420
|
+
F(s);
|
|
9427
9421
|
}
|
|
9428
9422
|
e();
|
|
9429
9423
|
}, [
|
|
9430
|
-
|
|
9431
|
-
he,
|
|
9432
|
-
o,
|
|
9424
|
+
K,
|
|
9433
9425
|
me,
|
|
9434
|
-
|
|
9435
|
-
|
|
9426
|
+
o,
|
|
9427
|
+
fe,
|
|
9428
|
+
A.make,
|
|
9429
|
+
p
|
|
9436
9430
|
]), a(() => {
|
|
9437
9431
|
async function e() {
|
|
9438
|
-
if (!
|
|
9432
|
+
if (!D.current || !A.make || !A.model) return;
|
|
9439
9433
|
let e = [
|
|
9440
|
-
dm("model",
|
|
9441
|
-
...
|
|
9442
|
-
...
|
|
9443
|
-
...
|
|
9444
|
-
...
|
|
9445
|
-
...
|
|
9446
|
-
], t = await
|
|
9434
|
+
dm("model", A.model, [A.make]),
|
|
9435
|
+
...v && A.body ? [dm("body", A.body, [A.make, A.model])] : [],
|
|
9436
|
+
...v && A.series ? [dm("series", A.series)] : [],
|
|
9437
|
+
...v && A.variant ? [dm("variant", A.variant)] : [],
|
|
9438
|
+
...v && A.engine ? [dm("engine", A.engine)] : [],
|
|
9439
|
+
...v && A.engine_capacity ? [dm("engine_capacity", A.engine_capacity)] : []
|
|
9440
|
+
], t = await D.current.search("", {
|
|
9447
9441
|
filter: nm(e, []),
|
|
9448
9442
|
attributesToRetrieve: ["year_from", "year_to"],
|
|
9449
9443
|
limit: 200
|
|
9450
9444
|
}), n = t.hits.map((e) => Number(e.year_from)).filter(Boolean), r = t.hits.map((e) => Number(e.year_to)).filter(Boolean);
|
|
9451
9445
|
if (n.length === 0 || r.length === 0) {
|
|
9452
|
-
|
|
9446
|
+
L([]);
|
|
9453
9447
|
return;
|
|
9454
9448
|
}
|
|
9455
9449
|
let i = Math.min(...n), a = Math.max(...r);
|
|
9456
|
-
|
|
9450
|
+
L(Array.from({ length: a - i + 1 }, (e, t) => ({
|
|
9457
9451
|
value: a - t,
|
|
9458
9452
|
refinement: a - t
|
|
9459
9453
|
})));
|
|
9460
9454
|
}
|
|
9461
9455
|
e();
|
|
9462
9456
|
}, [
|
|
9463
|
-
|
|
9464
|
-
|
|
9465
|
-
|
|
9466
|
-
|
|
9467
|
-
|
|
9468
|
-
|
|
9469
|
-
|
|
9470
|
-
|
|
9471
|
-
|
|
9457
|
+
A.make,
|
|
9458
|
+
A.model,
|
|
9459
|
+
A.body,
|
|
9460
|
+
A.series,
|
|
9461
|
+
A.variant,
|
|
9462
|
+
A.engine,
|
|
9463
|
+
A.engine_capacity,
|
|
9464
|
+
v,
|
|
9465
|
+
de
|
|
9472
9466
|
]), a(() => {
|
|
9473
9467
|
async function e() {
|
|
9474
|
-
let e =
|
|
9475
|
-
if (!
|
|
9476
|
-
|
|
9468
|
+
let e = v ? !!(A.make && A.model) : !!(A.make && A.model && A.year);
|
|
9469
|
+
if (!D.current || !e) {
|
|
9470
|
+
z([]);
|
|
9477
9471
|
return;
|
|
9478
9472
|
}
|
|
9479
|
-
let t =
|
|
9480
|
-
filter: nm([dm("model",
|
|
9473
|
+
let t = A.year ? [`year_from <= ${A.year.value}`, `year_to >= ${A.year.value}`] : [], n = await D.current.search("", {
|
|
9474
|
+
filter: nm([dm("model", A.model, [A.make])], t),
|
|
9481
9475
|
attributesToRetrieve: ["body"],
|
|
9482
9476
|
limit: 1e3
|
|
9483
9477
|
});
|
|
9484
|
-
|
|
9478
|
+
z(um([...new Map(n.hits.map((e) => [e.body, e])).values()].map((e) => {
|
|
9485
9479
|
let t = String(e.body ?? "").match(/[^>]*$/)?.[0]?.trim() ?? "";
|
|
9486
9480
|
return {
|
|
9487
9481
|
value: t,
|
|
@@ -9491,13 +9485,13 @@ function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "",
|
|
|
9491
9485
|
}
|
|
9492
9486
|
e();
|
|
9493
9487
|
}, [
|
|
9494
|
-
|
|
9495
|
-
|
|
9496
|
-
|
|
9497
|
-
|
|
9498
|
-
|
|
9488
|
+
A.year,
|
|
9489
|
+
A.make,
|
|
9490
|
+
A.model,
|
|
9491
|
+
v,
|
|
9492
|
+
de
|
|
9499
9493
|
]);
|
|
9500
|
-
let
|
|
9494
|
+
let De = i(({ hits: e, attribute: t, stateCallback: n }) => {
|
|
9501
9495
|
n(um([...new Map(e.map((e) => [e[t], e])).values()].map((e) => {
|
|
9502
9496
|
let n = String(e[t] ?? "").match(/[^|]*$/)?.[0]?.trim() ?? "";
|
|
9503
9497
|
return {
|
|
@@ -9508,20 +9502,20 @@ function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "",
|
|
|
9508
9502
|
}, []);
|
|
9509
9503
|
a(() => {
|
|
9510
9504
|
async function e() {
|
|
9511
|
-
let e =
|
|
9512
|
-
if (!
|
|
9513
|
-
|
|
9505
|
+
let e = v ? !!(A.make && A.model) : !!(A.make && A.model && A.year);
|
|
9506
|
+
if (!D.current || !e) {
|
|
9507
|
+
B([]), te([]), H([]), ie([]);
|
|
9514
9508
|
return;
|
|
9515
9509
|
}
|
|
9516
9510
|
let t = [
|
|
9517
|
-
dm("make",
|
|
9518
|
-
dm("model",
|
|
9519
|
-
|
|
9520
|
-
|
|
9521
|
-
|
|
9522
|
-
|
|
9523
|
-
|
|
9524
|
-
].filter((e) => e.length > 0), n =
|
|
9511
|
+
dm("make", A.make),
|
|
9512
|
+
dm("model", A.model, [A.make]),
|
|
9513
|
+
A.body ? dm("body", A.body, [A.make, A.model]) : [],
|
|
9514
|
+
A.series ? dm("series", A.series) : [],
|
|
9515
|
+
A.variant ? dm("variant", A.variant) : [],
|
|
9516
|
+
A.engine ? dm("engine", A.engine) : [],
|
|
9517
|
+
A.engine_capacity ? dm("engine_capacity", A.engine_capacity) : []
|
|
9518
|
+
].filter((e) => e.length > 0), n = A.year ? [`year_from <= ${A.year.value}`, `year_to >= ${A.year.value}`] : [], r = (await D.current.search("", {
|
|
9525
9519
|
filter: nm(t, n),
|
|
9526
9520
|
attributesToRetrieve: [
|
|
9527
9521
|
"series",
|
|
@@ -9531,196 +9525,196 @@ function Om({ apiKey: e, apiBaseUrl: t, store: n, makes: r = "", models: o = "",
|
|
|
9531
9525
|
],
|
|
9532
9526
|
limit: 1e3
|
|
9533
9527
|
})).hits;
|
|
9534
|
-
|
|
9528
|
+
De({
|
|
9535
9529
|
hits: r,
|
|
9536
9530
|
attribute: "series",
|
|
9537
|
-
stateCallback:
|
|
9538
|
-
}),
|
|
9531
|
+
stateCallback: B
|
|
9532
|
+
}), De({
|
|
9539
9533
|
hits: r,
|
|
9540
9534
|
attribute: "variant",
|
|
9541
|
-
stateCallback:
|
|
9542
|
-
}),
|
|
9535
|
+
stateCallback: te
|
|
9536
|
+
}), De({
|
|
9543
9537
|
hits: r,
|
|
9544
9538
|
attribute: "engine",
|
|
9545
|
-
stateCallback:
|
|
9546
|
-
}),
|
|
9539
|
+
stateCallback: H
|
|
9540
|
+
}), De({
|
|
9547
9541
|
hits: r,
|
|
9548
9542
|
attribute: "engine_capacity",
|
|
9549
|
-
stateCallback:
|
|
9543
|
+
stateCallback: ie
|
|
9550
9544
|
});
|
|
9551
9545
|
}
|
|
9552
9546
|
e();
|
|
9553
9547
|
}, [
|
|
9554
|
-
|
|
9555
|
-
|
|
9556
|
-
|
|
9557
|
-
|
|
9558
|
-
|
|
9559
|
-
|
|
9560
|
-
|
|
9561
|
-
|
|
9562
|
-
|
|
9563
|
-
|
|
9564
|
-
|
|
9548
|
+
De,
|
|
9549
|
+
A.body,
|
|
9550
|
+
A.engine,
|
|
9551
|
+
A.engine_capacity,
|
|
9552
|
+
A.make,
|
|
9553
|
+
A.model,
|
|
9554
|
+
A.series,
|
|
9555
|
+
A.variant,
|
|
9556
|
+
A.year,
|
|
9557
|
+
v,
|
|
9558
|
+
de
|
|
9565
9559
|
]), a(() => {
|
|
9566
9560
|
async function e() {
|
|
9567
|
-
if (!
|
|
9568
|
-
|
|
9561
|
+
if (!A.make || !D.current) {
|
|
9562
|
+
oe([]);
|
|
9569
9563
|
return;
|
|
9570
9564
|
}
|
|
9571
9565
|
let e = [
|
|
9572
|
-
dm("make",
|
|
9573
|
-
|
|
9574
|
-
|
|
9575
|
-
|
|
9576
|
-
|
|
9577
|
-
|
|
9578
|
-
|
|
9579
|
-
].filter((e) => e.length > 0), t =
|
|
9580
|
-
|
|
9566
|
+
dm("make", A.make),
|
|
9567
|
+
A.model ? dm("model", A.model, [A.make]) : [],
|
|
9568
|
+
A.body ? dm("body", A.body, [A.make, A.model]) : [],
|
|
9569
|
+
A.series ? dm("series", A.series) : [],
|
|
9570
|
+
A.variant ? dm("variant", A.variant) : [],
|
|
9571
|
+
A.engine ? dm("engine", A.engine) : [],
|
|
9572
|
+
A.engine_capacity ? dm("engine_capacity", A.engine_capacity) : []
|
|
9573
|
+
].filter((e) => e.length > 0), t = A.year ? [`year_from <= ${A.year.value}`, `year_to >= ${A.year.value}`] : [];
|
|
9574
|
+
oe((await D.current.search("", {
|
|
9581
9575
|
filter: nm(e, t),
|
|
9582
9576
|
attributesToRetrieve: ["otto_id"],
|
|
9583
9577
|
limit: 500
|
|
9584
9578
|
})).hits.map((e) => Number(e.otto_id)).filter(Boolean));
|
|
9585
9579
|
}
|
|
9586
9580
|
e();
|
|
9587
|
-
}, [
|
|
9588
|
-
let
|
|
9581
|
+
}, [A, de]);
|
|
9582
|
+
let Oe = !!(A.make && A.model) && (v || !!A.year), ke = !A.make || !A.model || !v && !A.year, Ae = !!(A.make && A.model), je = {
|
|
9589
9583
|
body: {
|
|
9590
9584
|
label: "Body",
|
|
9591
|
-
value:
|
|
9592
|
-
options:
|
|
9593
|
-
onChange:
|
|
9585
|
+
value: A.body,
|
|
9586
|
+
options: R,
|
|
9587
|
+
onChange: Ce,
|
|
9594
9588
|
placeholder: "Select body",
|
|
9595
|
-
loading:
|
|
9589
|
+
loading: Ae && !A.body && R.length === 0
|
|
9596
9590
|
},
|
|
9597
9591
|
series: {
|
|
9598
9592
|
label: "Series",
|
|
9599
|
-
value:
|
|
9600
|
-
options:
|
|
9601
|
-
onChange:
|
|
9593
|
+
value: A.series,
|
|
9594
|
+
options: ee,
|
|
9595
|
+
onChange: J,
|
|
9602
9596
|
placeholder: "Select series",
|
|
9603
|
-
loading:
|
|
9597
|
+
loading: Ae && !A.series && ee.length === 0
|
|
9604
9598
|
},
|
|
9605
9599
|
variant: {
|
|
9606
9600
|
label: "Variant",
|
|
9607
|
-
value:
|
|
9608
|
-
options:
|
|
9609
|
-
onChange:
|
|
9601
|
+
value: A.variant,
|
|
9602
|
+
options: V,
|
|
9603
|
+
onChange: we,
|
|
9610
9604
|
placeholder: "Select variant",
|
|
9611
|
-
loading:
|
|
9605
|
+
loading: Ae && !A.variant && V.length === 0
|
|
9612
9606
|
},
|
|
9613
9607
|
engine: {
|
|
9614
9608
|
label: "Engine",
|
|
9615
|
-
value:
|
|
9616
|
-
options:
|
|
9617
|
-
onChange:
|
|
9609
|
+
value: A.engine,
|
|
9610
|
+
options: ne,
|
|
9611
|
+
onChange: Te,
|
|
9618
9612
|
placeholder: "Select engine",
|
|
9619
|
-
loading:
|
|
9613
|
+
loading: Ae && !A.engine && ne.length === 0
|
|
9620
9614
|
},
|
|
9621
9615
|
engine_capacity: {
|
|
9622
9616
|
label: "Engine Capacity",
|
|
9623
|
-
value:
|
|
9624
|
-
options:
|
|
9625
|
-
onChange:
|
|
9617
|
+
value: A.engine_capacity,
|
|
9618
|
+
options: re,
|
|
9619
|
+
onChange: Ee,
|
|
9626
9620
|
placeholder: "Select engine capacity",
|
|
9627
|
-
loading:
|
|
9621
|
+
loading: Ae && !A.engine_capacity && re.length === 0
|
|
9628
9622
|
}
|
|
9629
9623
|
};
|
|
9630
9624
|
return /* @__PURE__ */ g("div", {
|
|
9631
9625
|
className: "flex flex-col gap-5",
|
|
9632
|
-
children: [
|
|
9626
|
+
children: [le ? /* @__PURE__ */ g(np, { children: [
|
|
9633
9627
|
/* @__PURE__ */ h(kc, {}),
|
|
9634
9628
|
/* @__PURE__ */ h(rp, { children: "Vehicle search unavailable" }),
|
|
9635
|
-
/* @__PURE__ */ h(ip, { children:
|
|
9629
|
+
/* @__PURE__ */ h(ip, { children: le })
|
|
9636
9630
|
] }) : null, /* @__PURE__ */ g("div", {
|
|
9637
9631
|
className: "flex flex-col gap-4",
|
|
9638
9632
|
children: [
|
|
9639
9633
|
G ? /* @__PURE__ */ g(m, { children: [
|
|
9640
9634
|
/* @__PURE__ */ h(xm, {
|
|
9641
9635
|
label: "Year",
|
|
9642
|
-
value:
|
|
9643
|
-
options:
|
|
9644
|
-
onChange:
|
|
9636
|
+
value: A.year,
|
|
9637
|
+
options: I,
|
|
9638
|
+
onChange: Se,
|
|
9645
9639
|
placeholder: "Select year",
|
|
9646
|
-
loading: !!
|
|
9647
|
-
portalContainer:
|
|
9640
|
+
loading: !!U?.searchKey && !A.year && I.length === 0,
|
|
9641
|
+
portalContainer: b
|
|
9648
9642
|
}),
|
|
9649
9643
|
/* @__PURE__ */ h(xm, {
|
|
9650
9644
|
label: "Make",
|
|
9651
|
-
value:
|
|
9652
|
-
options:
|
|
9653
|
-
onChange:
|
|
9654
|
-
placeholder:
|
|
9655
|
-
disabled: !
|
|
9656
|
-
loading: !!
|
|
9657
|
-
portalContainer:
|
|
9645
|
+
value: A.make,
|
|
9646
|
+
options: M,
|
|
9647
|
+
onChange: be,
|
|
9648
|
+
placeholder: A.year ? "Select make" : "Select a year first",
|
|
9649
|
+
disabled: !A.year,
|
|
9650
|
+
loading: !!A.year && !A.make && M.length === 0,
|
|
9651
|
+
portalContainer: b
|
|
9658
9652
|
}),
|
|
9659
9653
|
/* @__PURE__ */ h(xm, {
|
|
9660
9654
|
label: "Model",
|
|
9661
|
-
value:
|
|
9662
|
-
options:
|
|
9663
|
-
onChange:
|
|
9664
|
-
placeholder:
|
|
9665
|
-
disabled: !
|
|
9666
|
-
loading: !!
|
|
9667
|
-
portalContainer:
|
|
9655
|
+
value: A.model,
|
|
9656
|
+
options: P,
|
|
9657
|
+
onChange: xe,
|
|
9658
|
+
placeholder: A.make ? "Select model" : "Select a make first",
|
|
9659
|
+
disabled: !A.make,
|
|
9660
|
+
loading: !!A.make && !A.model && P.length === 0,
|
|
9661
|
+
portalContainer: b
|
|
9668
9662
|
})
|
|
9669
9663
|
] }) : /* @__PURE__ */ g(m, { children: [
|
|
9670
9664
|
/* @__PURE__ */ h(xm, {
|
|
9671
9665
|
label: "Make",
|
|
9672
|
-
value:
|
|
9673
|
-
options:
|
|
9674
|
-
onChange:
|
|
9666
|
+
value: A.make,
|
|
9667
|
+
options: M,
|
|
9668
|
+
onChange: be,
|
|
9675
9669
|
placeholder: "Select make",
|
|
9676
|
-
loading: !!
|
|
9677
|
-
portalContainer:
|
|
9670
|
+
loading: !!U?.searchKey && !A.make && M.length === 0,
|
|
9671
|
+
portalContainer: b
|
|
9678
9672
|
}),
|
|
9679
9673
|
/* @__PURE__ */ h(xm, {
|
|
9680
9674
|
label: "Model",
|
|
9681
|
-
value:
|
|
9682
|
-
options:
|
|
9683
|
-
onChange:
|
|
9684
|
-
placeholder:
|
|
9685
|
-
disabled: !
|
|
9686
|
-
loading: !!
|
|
9687
|
-
portalContainer:
|
|
9675
|
+
value: A.model,
|
|
9676
|
+
options: P,
|
|
9677
|
+
onChange: xe,
|
|
9678
|
+
placeholder: A.make ? "Select model" : "Select a make first",
|
|
9679
|
+
disabled: !A.make,
|
|
9680
|
+
loading: !!A.make && !A.model && P.length === 0,
|
|
9681
|
+
portalContainer: b
|
|
9688
9682
|
}),
|
|
9689
9683
|
/* @__PURE__ */ h(xm, {
|
|
9690
9684
|
label: "Year",
|
|
9691
|
-
value:
|
|
9692
|
-
options:
|
|
9693
|
-
onChange:
|
|
9694
|
-
placeholder:
|
|
9695
|
-
disabled: !
|
|
9696
|
-
loading: !!
|
|
9697
|
-
portalContainer:
|
|
9685
|
+
value: A.year,
|
|
9686
|
+
options: I,
|
|
9687
|
+
onChange: Se,
|
|
9688
|
+
placeholder: A.model ? "Select year" : v ? "Optional after model" : "Select a model first",
|
|
9689
|
+
disabled: !A.model && !v,
|
|
9690
|
+
loading: !!A.model && !A.year && I.length === 0,
|
|
9691
|
+
portalContainer: b
|
|
9698
9692
|
})
|
|
9699
9693
|
] }),
|
|
9700
|
-
|
|
9701
|
-
let t =
|
|
9694
|
+
pe.map((e) => {
|
|
9695
|
+
let t = je[e];
|
|
9702
9696
|
return /* @__PURE__ */ h(xm, {
|
|
9703
9697
|
label: t.label,
|
|
9704
9698
|
value: t.value,
|
|
9705
9699
|
options: t.options,
|
|
9706
9700
|
onChange: t.onChange,
|
|
9707
9701
|
placeholder: t.placeholder,
|
|
9708
|
-
disabled:
|
|
9702
|
+
disabled: ke,
|
|
9709
9703
|
loading: t.loading,
|
|
9710
|
-
portalContainer:
|
|
9704
|
+
portalContainer: b
|
|
9711
9705
|
}, e);
|
|
9712
9706
|
}),
|
|
9713
9707
|
/* @__PURE__ */ h(gd, {
|
|
9714
9708
|
className: "w-full",
|
|
9715
9709
|
onClick: () => {
|
|
9716
|
-
let e = Dm(
|
|
9717
|
-
|
|
9710
|
+
let e = Dm(A);
|
|
9711
|
+
S({ legacyVehicle: {
|
|
9718
9712
|
description: il(e),
|
|
9719
|
-
vehicle_ids:
|
|
9713
|
+
vehicle_ids: ae,
|
|
9720
9714
|
vehicle: e
|
|
9721
9715
|
} });
|
|
9722
9716
|
},
|
|
9723
|
-
disabled: !
|
|
9717
|
+
disabled: !Oe,
|
|
9724
9718
|
children: "Select vehicle"
|
|
9725
9719
|
})
|
|
9726
9720
|
]
|
|
@@ -10216,6 +10210,10 @@ function Qm({ name: e, label: t, ariaLabel: n = t, placeholder: r, value: i, opt
|
|
|
10216
10210
|
function M() {
|
|
10217
10211
|
s(""), v(""), b(!0), S(0), f.current?.focus();
|
|
10218
10212
|
}
|
|
10213
|
+
function N(e) {
|
|
10214
|
+
let t = e.target;
|
|
10215
|
+
t instanceof Node && d.current?.contains(t) && e.preventDefault();
|
|
10216
|
+
}
|
|
10219
10217
|
return /* @__PURE__ */ g("label", {
|
|
10220
10218
|
className: "flex flex-col gap-1.5 text-sm font-medium text-foreground",
|
|
10221
10219
|
children: [t, /* @__PURE__ */ g(Eo, {
|
|
@@ -10301,6 +10299,7 @@ function Qm({ name: e, label: t, ariaLabel: n = t, placeholder: r, value: i, opt
|
|
|
10301
10299
|
align: "start",
|
|
10302
10300
|
sideOffset: 8,
|
|
10303
10301
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
10302
|
+
onInteractOutside: N,
|
|
10304
10303
|
children: [/* @__PURE__ */ g("button", {
|
|
10305
10304
|
type: "button",
|
|
10306
10305
|
role: "option",
|
|
@@ -10790,8 +10789,8 @@ function bh(e, t, n) {
|
|
|
10790
10789
|
activeVehicle: a
|
|
10791
10790
|
};
|
|
10792
10791
|
}
|
|
10793
|
-
function xh({ apiKey: e, callbackUrl: t, productsUrl: n, themeColor: r, buttonColor: o, buttonHoverColor: s, buttonLabelColor: l, buttonHoverLabelColor: d, themeTextColor: f, mobileBackgroundColor: p, borderColor: _, overlayColor: v, overlayOpacity: y, overlayBlur: b, radius: x, buttonBorderRadius: S, fontFamily: C, fontSize: w, padding: T, inputShadow: E, inputBorderColor: D, inputBorderWidth: O, buttonTheme: k = "light", useGeolocation: A, geocodeApiKey: j, placeholder: M, intro: N, supportMessage: P, actionButtonLabel: F = "Show Products", demoMode: I, modal: L = !0, showOverlay: R = !0, hideOverlay: z = !1, isOpen: ee, onOpenChange: B, hideDefaultButton: V = !1, onModalClose: te, autoCloseOnSelect: ne = !0, closeOnInteractOutside: H = !0, triggerLabel: re = "Garage", showGarageIcon: ie = !0, garageIconUrl: ae, showBranding: oe = !0, hideBranding:
|
|
10794
|
-
let he = uh(ue,
|
|
10792
|
+
function xh({ apiKey: e, callbackUrl: t, productsUrl: n, themeColor: r, buttonColor: o, buttonHoverColor: s, buttonLabelColor: l, buttonHoverLabelColor: d, themeTextColor: f, mobileBackgroundColor: p, borderColor: _, overlayColor: v, overlayOpacity: y, overlayBlur: b, radius: x, buttonBorderRadius: S, fontFamily: C, fontSize: w, padding: T, inputShadow: E, inputBorderColor: D, inputBorderWidth: O, buttonTheme: k = "light", useGeolocation: A, geocodeApiKey: j, placeholder: M, intro: N, supportMessage: P, actionButtonLabel: F = "Show Products", demoMode: I, modal: L = !0, showOverlay: R = !0, hideOverlay: z = !1, isOpen: ee, onOpenChange: B, hideDefaultButton: V = !1, onModalClose: te, autoCloseOnSelect: ne = !0, closeOnInteractOutside: H = !0, triggerLabel: re = "Garage", showGarageIcon: ie = !0, garageIconUrl: ae, showBranding: oe = !0, hideBranding: U = !1, drawerSide: W = "right", defaultTab: se = "plate", apiBaseUrl: ce, wheelTyreFitmentUrl: le, showWheelTyreTab: ue, onWheelTyreFitmentResult: G, garageLimit: de = 4, onVehicleActivate: fe, onGarageChange: pe, portalContainer: me, ...K }) {
|
|
10793
|
+
let he = uh(ue, se), ge = dh(se, he), [q, _e] = u(!1), [ve, ye] = u(ge), [be, xe] = u(null), [Se, Ce] = u(!1), [J, we] = u(() => xl()), Te = c(() => Yc({
|
|
10795
10794
|
themeColor: r,
|
|
10796
10795
|
buttonColor: o,
|
|
10797
10796
|
buttonHoverColor: s,
|
|
@@ -10833,9 +10832,9 @@ function xh({ apiKey: e, callbackUrl: t, productsUrl: n, themeColor: r, buttonCo
|
|
|
10833
10832
|
r
|
|
10834
10833
|
]), Ee = c(() => ah(), []), De = i((e) => {
|
|
10835
10834
|
xe(e);
|
|
10836
|
-
}, []), Oe = ee !== void 0, ke = Oe ? !!ee :
|
|
10835
|
+
}, []), Oe = ee !== void 0, ke = Oe ? !!ee : q, Ae = W === "left" ? "left" : "right", je = oh(ie), Me = ch({
|
|
10837
10836
|
showBranding: oe,
|
|
10838
|
-
hideBranding:
|
|
10837
|
+
hideBranding: U
|
|
10839
10838
|
}), Ne = lh({
|
|
10840
10839
|
showOverlay: R,
|
|
10841
10840
|
hideOverlay: z
|
|
@@ -10843,7 +10842,7 @@ function xh({ apiKey: e, callbackUrl: t, productsUrl: n, themeColor: r, buttonCo
|
|
|
10843
10842
|
let t = vh(e);
|
|
10844
10843
|
Fl(t), pe?.(t);
|
|
10845
10844
|
}, [pe]), Ie = i((e) => {
|
|
10846
|
-
Oe ||
|
|
10845
|
+
Oe || _e(e), B?.(e), e || (Ll(), te?.());
|
|
10847
10846
|
}, [
|
|
10848
10847
|
Oe,
|
|
10849
10848
|
te,
|
|
@@ -10851,7 +10850,7 @@ function xh({ apiKey: e, callbackUrl: t, productsUrl: n, themeColor: r, buttonCo
|
|
|
10851
10850
|
]), Le = i((e) => {
|
|
10852
10851
|
H || e.preventDefault();
|
|
10853
10852
|
}, [H]), Re = i(({ source: e, nextState: n, vehicle: r, plateDetails: i, closeAfter: a = ne, emitLegacySelection: o = !0 }) => {
|
|
10854
|
-
if (ml(n), we(n), gl(_h(r)), e === "plate" ? yl(i ?? yh(r) ?? {}) : bl(), o && Pl(e, r), Fe(n),
|
|
10853
|
+
if (ml(n), we(n), gl(_h(r)), e === "plate" ? yl(i ?? yh(r) ?? {}) : bl(), o && Pl(e, r), Fe(n), fe?.({
|
|
10855
10854
|
source: e,
|
|
10856
10855
|
vehicle: r,
|
|
10857
10856
|
vehicles: n.vehicles
|
|
@@ -10866,15 +10865,21 @@ function xh({ apiKey: e, callbackUrl: t, productsUrl: n, themeColor: r, buttonCo
|
|
|
10866
10865
|
window.location.href = e;
|
|
10867
10866
|
return;
|
|
10868
10867
|
}
|
|
10869
|
-
|
|
10868
|
+
jl({
|
|
10869
|
+
selection: r.vehicle,
|
|
10870
|
+
modifyQueryString: K.modifyQueryString,
|
|
10871
|
+
vehicleScopeTokens: K.vehicleScopeTokens,
|
|
10872
|
+
yearTokens: K.yearTokens
|
|
10873
|
+
}), a && Ie(!1);
|
|
10870
10874
|
}, [
|
|
10871
10875
|
ne,
|
|
10872
10876
|
t,
|
|
10873
10877
|
Fe,
|
|
10874
10878
|
Ie,
|
|
10879
|
+
K.modifyQueryString,
|
|
10875
10880
|
K.vehicleScopeTokens,
|
|
10876
10881
|
K.yearTokens,
|
|
10877
|
-
|
|
10882
|
+
fe
|
|
10878
10883
|
]), ze = i(({ source: e, legacyVehicle: t, plateDetails: n, closeAfter: r }) => {
|
|
10879
10884
|
let i = ll(t);
|
|
10880
10885
|
if (!i) return !1;
|
|
@@ -10882,7 +10887,7 @@ function xh({ apiKey: e, callbackUrl: t, productsUrl: n, themeColor: r, buttonCo
|
|
|
10882
10887
|
legacyVehicle: i,
|
|
10883
10888
|
source: e,
|
|
10884
10889
|
plateDetails: n
|
|
10885
|
-
}),
|
|
10890
|
+
}), de);
|
|
10886
10891
|
return Re({
|
|
10887
10892
|
source: e,
|
|
10888
10893
|
nextState: a.state,
|
|
@@ -10892,7 +10897,7 @@ function xh({ apiKey: e, callbackUrl: t, productsUrl: n, themeColor: r, buttonCo
|
|
|
10892
10897
|
}), !0;
|
|
10893
10898
|
}, [
|
|
10894
10899
|
Re,
|
|
10895
|
-
|
|
10900
|
+
de,
|
|
10896
10901
|
J
|
|
10897
10902
|
]), Be = i((e) => {
|
|
10898
10903
|
let t = hl();
|
|
@@ -10901,9 +10906,9 @@ function xh({ apiKey: e, callbackUrl: t, productsUrl: n, themeColor: r, buttonCo
|
|
|
10901
10906
|
legacyVehicle: t,
|
|
10902
10907
|
source: e,
|
|
10903
10908
|
plateDetails: e === "plate" ? vl() : null
|
|
10904
|
-
}),
|
|
10909
|
+
}), de);
|
|
10905
10910
|
ml(n.state), we(n.state);
|
|
10906
|
-
}, [
|
|
10911
|
+
}, [de, J]), Ve = i((e) => {
|
|
10907
10912
|
let t = J.vehicles.find((t) => t.key === e);
|
|
10908
10913
|
t && Re({
|
|
10909
10914
|
source: t.source,
|
|
@@ -11098,7 +11103,7 @@ function xh({ apiKey: e, callbackUrl: t, productsUrl: n, themeColor: r, buttonCo
|
|
|
11098
11103
|
className: "flex flex-1 flex-col gap-5 overflow-hidden px-5 py-4",
|
|
11099
11104
|
children: [
|
|
11100
11105
|
/* @__PURE__ */ g(Dd, {
|
|
11101
|
-
value:
|
|
11106
|
+
value: ve,
|
|
11102
11107
|
onValueChange: (e) => ye(e),
|
|
11103
11108
|
className: "flex min-h-0 flex-1 flex-col overflow-hidden",
|
|
11104
11109
|
children: [
|
|
@@ -11171,12 +11176,12 @@ function xh({ apiKey: e, callbackUrl: t, productsUrl: n, themeColor: r, buttonCo
|
|
|
11171
11176
|
wheelTyreFitmentUrl: le,
|
|
11172
11177
|
activeVehicle: Pe,
|
|
11173
11178
|
portalContainer: be ?? me,
|
|
11174
|
-
onWheelTyreFitmentResult:
|
|
11179
|
+
onWheelTyreFitmentResult: G
|
|
11175
11180
|
})
|
|
11176
11181
|
}) : null
|
|
11177
11182
|
]
|
|
11178
11183
|
}),
|
|
11179
|
-
n && Pe && !(
|
|
11184
|
+
n && Pe && !(ve === "plate" && Pe.source === "plate") ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(Md, {}), /* @__PURE__ */ h(gd, {
|
|
11180
11185
|
className: "w-full",
|
|
11181
11186
|
onClick: () => Bl(n),
|
|
11182
11187
|
children: F
|
|
@@ -11292,7 +11297,7 @@ var Oh = r(function(e, t) {
|
|
|
11292
11297
|
portalContainer: f
|
|
11293
11298
|
}), s) : null
|
|
11294
11299
|
});
|
|
11295
|
-
}), kh = "0.1.
|
|
11300
|
+
}), kh = "0.1.14", Ah = new Map([
|
|
11296
11301
|
["show-garage-icon", "showGarageIcon"],
|
|
11297
11302
|
["garage-icon-url", "garageIconUrl"],
|
|
11298
11303
|
["show-branding", "showBranding"],
|