@depict-ai/ui 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +8 -1
- package/dist/main.js +601 -488
- package/dist/module.js +603 -490
- package/package.json +2 -2
package/dist/main.js
CHANGED
|
@@ -525,7 +525,7 @@ async function $7b4bc889571cc67b$var$download_categories(tenant, market) {
|
|
|
525
525
|
|
|
526
526
|
|
|
527
527
|
|
|
528
|
-
const $6f604560873e4f69$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="instant-card"><div class="
|
|
528
|
+
const $6f604560873e4f69$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="instant-card"><div class="img-part"></div><div class="right-part"><div class="title-brand-tagline"><span class="title"></span></div></div></div>`, 10);
|
|
529
529
|
function $6f604560873e4f69$export$ee1733d9a8495996() {
|
|
530
530
|
return (()=>{
|
|
531
531
|
const _el$ = $6f604560873e4f69$var$_tmpl$.cloneNode(true), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild;
|
|
@@ -584,17 +584,21 @@ function $fd463ff0edb29915$export$b3ad617e9036868(modal_body_style, input_field,
|
|
|
584
584
|
} : {}
|
|
585
585
|
}));
|
|
586
586
|
};
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
587
|
+
let ro;
|
|
588
|
+
if (one_axies_only !== "top") {
|
|
589
|
+
ro = new ResizeObserver((0, $iBTHO$depictaiutilishared.catchify)((records)=>{
|
|
590
|
+
records.forEach(({ contentRect: { width: width } })=>{
|
|
591
|
+
if (width_transformer) width = width_transformer(width);
|
|
592
|
+
modal_body_style[1]((old_value)=>({
|
|
593
|
+
...old_value,
|
|
594
|
+
"max-width": "unset",
|
|
595
|
+
width: `${width}px`
|
|
596
|
+
}));
|
|
597
|
+
});
|
|
598
|
+
align_position();
|
|
599
|
+
}));
|
|
600
|
+
ro.observe(input_field);
|
|
601
|
+
}
|
|
598
602
|
window.addEventListener("resize", align_position);
|
|
599
603
|
window.addEventListener("orientationchange", align_position);
|
|
600
604
|
// "resize" doesn't fire sometimes when it should, also it doesn't when showing/hiding scrollbars which disabling scrolling does
|
|
@@ -604,7 +608,7 @@ function $fd463ff0edb29915$export$b3ad617e9036868(modal_body_style, input_field,
|
|
|
604
608
|
resize_resize_observer.observe(document.documentElement);
|
|
605
609
|
(0, $iBTHO$depictaiutilishared.observer).wait_for_element("body").then(resize_resize_observer.observe.bind(resize_resize_observer));
|
|
606
610
|
(0, $iBTHO$solidjs.onCleanup)((0, $iBTHO$depictaiutilishared.catchify)(()=>{
|
|
607
|
-
ro
|
|
611
|
+
ro?.disconnect();
|
|
608
612
|
resize_resize_observer.disconnect();
|
|
609
613
|
window.removeEventListener("resize", align_position);
|
|
610
614
|
window.removeEventListener("orientationchange", align_position);
|
|
@@ -1821,6 +1825,8 @@ class $0a6acf31d1eae57c$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
1821
1825
|
|
|
1822
1826
|
|
|
1823
1827
|
|
|
1828
|
+
|
|
1829
|
+
|
|
1824
1830
|
function $6e22b5314fb52f4c$export$e183a13865960371(params_to_default_value) {
|
|
1825
1831
|
const signals = {};
|
|
1826
1832
|
const entries = Object.entries(params_to_default_value);
|
|
@@ -1875,6 +1881,8 @@ function $26a56f6b44703084$export$9862539c89138352(get_default_values) {
|
|
|
1875
1881
|
|
|
1876
1882
|
|
|
1877
1883
|
|
|
1884
|
+
|
|
1885
|
+
|
|
1878
1886
|
const $6b384adf40a5f4d7$var$get_available_range = (available_filters_, search_for_field)=>{
|
|
1879
1887
|
const maybe_meta = (0, $iBTHO$solidjs.untrack)(available_filters_)?.find(({ op: op , field: field })=>field === search_for_field && op === "inrange")?.meta;
|
|
1880
1888
|
if (maybe_meta?.min != undefined && maybe_meta?.max != undefined) return [
|
|
@@ -2597,9 +2605,10 @@ function $a69e505a12a77874$export$6c6d7a51fa9aa15d(props) {
|
|
|
2597
2605
|
duration: duration_ ?? 250,
|
|
2598
2606
|
delay: delay_ ?? 0
|
|
2599
2607
|
});
|
|
2600
|
-
const toggle = ()=>props.is_open_[1](!(0, $iBTHO$solidjs.untrack)(()=>props.is_open_ /* reactive getter */ [0]()));
|
|
2601
2608
|
const [is_in_dom, set_is_in_dom] = (0, $iBTHO$solidjs.createSignal)(document.documentElement.contains(details_));
|
|
2602
|
-
|
|
2609
|
+
// we want this extra layer for if the props.is_open_ function changes itself but not the value of the signal. If we re-run below effect it flickers sometimes for some reason
|
|
2610
|
+
const is_open_memo = (0, $iBTHO$solidjs.createMemo)(()=>props.is_open_[0]());
|
|
2611
|
+
const toggle = ()=>props.is_open_[1](!(0, $iBTHO$solidjs.untrack)(is_open_memo));
|
|
2603
2612
|
(0, $iBTHO$solidjsweb.insert)(details_, [
|
|
2604
2613
|
summary_,
|
|
2605
2614
|
(0, $iBTHO$solidjsweb.createComponent)(ExpandingContainer, {
|
|
@@ -2620,8 +2629,15 @@ function $a69e505a12a77874$export$6c6d7a51fa9aa15d(props) {
|
|
|
2620
2629
|
const do_duration = dont_animate_if_instant_open_ && fresh_component ? $a69e505a12a77874$var$has_new_animate ? 0 : 1 /* if the zero duration is 1 modern chrome will paint a frame with unexpanded and then one with expanded which doesn't look nice, if you have 0 on older browsers they won't play the animation at all (i.e. iOS 12.5.5) */ : duration_;
|
|
2621
2630
|
await expand(0, do_duration);
|
|
2622
2631
|
} else {
|
|
2632
|
+
const closeModal = (0, $iBTHO$depictaiutilishared.catchify)(()=>{
|
|
2633
|
+
/*
|
|
2634
|
+
TODO: we currently should not enable the following line, since it causes the following bug:
|
|
2635
|
+
https://linear.app/depictai/issue/FRO-413/on-estoreno-the-browser-crashes-when-expandingcollapsing-filtre-on
|
|
2636
|
+
It seems to be a chrome issue and a bug has been reported to them:
|
|
2637
|
+
https://bugs.chromium.org/p/chromium/issues/detail?id=1404121#c2 */ // details_.open = false;
|
|
2638
|
+
});
|
|
2623
2639
|
const animation = await collapse();
|
|
2624
|
-
animation.addEventListener("finish",
|
|
2640
|
+
animation.addEventListener("finish", closeModal);
|
|
2625
2641
|
}
|
|
2626
2642
|
}));
|
|
2627
2643
|
details_.addEventListener("toggle", (0, $iBTHO$depictaiutilishared.catchify)(()=>{
|
|
@@ -3044,7 +3060,7 @@ async function $9abb0a35d4b60ed3$export$79b1565500412d9b(search_modal, modal_fn_
|
|
|
3044
3060
|
|
|
3045
3061
|
|
|
3046
3062
|
|
|
3047
|
-
const $b3cf6ca8dc0e9998$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<span class="count"></span>`, 2), $b3cf6ca8dc0e9998$var$_tmpl$2 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<label class="
|
|
3063
|
+
const $b3cf6ca8dc0e9998$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<span class="count"></span>`, 2), $b3cf6ca8dc0e9998$var$_tmpl$2 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<label class="input-row"><div class="left"><input type="checkbox"><span class="custom-indicator"></span><span class="text"></span></div></label>`, 9);
|
|
3048
3064
|
const $b3cf6ca8dc0e9998$export$48513f6b9f8ce62d = (props)=>{
|
|
3049
3065
|
const id = (0, $iBTHO$depictaiutilishared.make_random_classname)();
|
|
3050
3066
|
return /* We can't use actual margin because ExpandingContainer gets messed up */ (()=>{
|
|
@@ -3087,7 +3103,7 @@ const $b3cf6ca8dc0e9998$export$48513f6b9f8ce62d = (props)=>{
|
|
|
3087
3103
|
|
|
3088
3104
|
|
|
3089
3105
|
|
|
3090
|
-
const $0fe1e7efdf4200d6$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<button type="button" class="
|
|
3106
|
+
const $0fe1e7efdf4200d6$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<button type="button" class="expand-filter"><span></span></button>`, 4);
|
|
3091
3107
|
function $0fe1e7efdf4200d6$export$ca21a16d65b3dd8({ show_extras_: [get_show_extras, set_show_extras] , i18n_: i18n_ }) {
|
|
3092
3108
|
return (()=>{
|
|
3093
3109
|
const _el$ = $0fe1e7efdf4200d6$var$_tmpl$.cloneNode(true), _el$2 = _el$.firstChild;
|
|
@@ -3221,7 +3237,7 @@ function $d94869c80e337a3d$export$dd948f91abc3a1c4({ filter_: filter_ , selected
|
|
|
3221
3237
|
|
|
3222
3238
|
|
|
3223
3239
|
|
|
3224
|
-
const $c1dc1554c1b94233$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<form class="radios"></form>`, 2), $c1dc1554c1b94233$var$_tmpl$2 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<span class="count"></span>`, 2), $c1dc1554c1b94233$var$_tmpl$3 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<label class="
|
|
3240
|
+
const $c1dc1554c1b94233$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<form class="radios"></form>`, 2), $c1dc1554c1b94233$var$_tmpl$2 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<span class="count"></span>`, 2), $c1dc1554c1b94233$var$_tmpl$3 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<label class="input-row"><div class="left"><input type="radio"><span class="custom-indicator"></span></div></label>`, 7);
|
|
3225
3241
|
function $c1dc1554c1b94233$export$430444115f70a734({ selected_filters_: selected_filters_ , filter_: filter_ }) {
|
|
3226
3242
|
const radio_name = (0, $iBTHO$depictaiutilishared.make_random_classname)();
|
|
3227
3243
|
const existing_filter = (0, $iBTHO$solidjs.createMemo)(()=>{
|
|
@@ -3300,7 +3316,7 @@ function $c1dc1554c1b94233$export$430444115f70a734({ selected_filters_: selected
|
|
|
3300
3316
|
|
|
3301
3317
|
|
|
3302
3318
|
|
|
3303
|
-
const $0b7222ba8a8bb72f$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="range"><div class="
|
|
3319
|
+
const $0b7222ba8a8bb72f$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="range"><div class="input-group"><div class="field"><input type="number"></div><div class="separator">-</div><div class="field"><input type="number"></div></div><div class="value-text"><span class="min"></span><span class="max"></span></div></div>`, 18), $0b7222ba8a8bb72f$var$_tmpl$2 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="slider"><div class="progress"></div></div>`, 4), $0b7222ba8a8bb72f$var$_tmpl$3 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="range-group"><input type="range" step="any"><input type="range" step="any"></div>`, 4);
|
|
3304
3320
|
function $0b7222ba8a8bb72f$export$e0d834a0ad870cda({ filter_: filter_ , selected_filters_: selected_filters_ , i18n_: i18n_ }) {
|
|
3305
3321
|
const current_range = (0, $iBTHO$solidjs.createSignal)((0, $iBTHO$solidjs.untrack)(()=>filter_().data));
|
|
3306
3322
|
const selected_filter = (0, $iBTHO$solidjs.createMemo)(()=>selected_filters_[0]().find(({ field: checking_field , op: checking_op })=>checking_field === filter_().field && checking_op === filter_().op));
|
|
@@ -3628,7 +3644,7 @@ function $7567511a7c3e4bd7$export$e5c2828934226505({ expanded_: expanded_ , i18n
|
|
|
3628
3644
|
|
|
3629
3645
|
|
|
3630
3646
|
|
|
3631
|
-
const $3bdc00a1353c1150$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<form class="checkboxes hierarchical"></form>`, 2), $3bdc00a1353c1150$var$_tmpl$2 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="
|
|
3647
|
+
const $3bdc00a1353c1150$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<form class="checkboxes hierarchical"></form>`, 2), $3bdc00a1353c1150$var$_tmpl$2 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="checkbox-details"></div>`, 2), $3bdc00a1353c1150$var$_tmpl$3 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<details></details>`, 2), $3bdc00a1353c1150$var$_tmpl$4 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<summary class="category-parent"><div class="summary"><span class="count"></span></div></summary>`, 6);
|
|
3632
3648
|
const $3bdc00a1353c1150$var$max_visible_without_collapsing = 7;
|
|
3633
3649
|
const $3bdc00a1353c1150$var$show_non_collapsible_when_collapsed = 4;
|
|
3634
3650
|
function $3bdc00a1353c1150$export$a32086fa6616eafd({ filter_: filter_ , selected_filters_: selected_filters_ , i18n_: i18n_ , view_more_button_below_group_: view_more_button_below_group_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ }) {
|
|
@@ -3748,7 +3764,7 @@ function $3bdc00a1353c1150$export$a32086fa6616eafd({ filter_: filter_ , selected
|
|
|
3748
3764
|
typeof _ref$ === "function" ? (0, $iBTHO$solidjsweb.use)(_ref$, _el$) : form = _el$;
|
|
3749
3765
|
(0, $iBTHO$solidjsweb.insert)(_el$, ()=>$3bdc00a1353c1150$var$render_stuff((0, $iBTHO$solidjs.createMemo)(()=>some_top_level_are_hidden() ? Object.fromEntries(Object.entries(structured_categories()).slice(0, $3bdc00a1353c1150$var$show_non_collapsible_when_collapsed)) : structured_categories()), existing_filter, i18n_), null);
|
|
3750
3766
|
(0, $iBTHO$solidjsweb.insert)(_el$, expanding_container_els, null);
|
|
3751
|
-
(0, $iBTHO$solidjsweb.effect)(()=>_el$.classList.toggle("
|
|
3767
|
+
(0, $iBTHO$solidjsweb.effect)(()=>_el$.classList.toggle("any-expandable", !!Object.values(structured_categories()).some((category)=>Object.keys(category.children_).length)));
|
|
3752
3768
|
return _el$;
|
|
3753
3769
|
})();
|
|
3754
3770
|
}
|
|
@@ -3804,7 +3820,7 @@ function $3bdc00a1353c1150$var$render_stuff(data, existing_filter, i18n_) {
|
|
|
3804
3820
|
}
|
|
3805
3821
|
return are_checked;
|
|
3806
3822
|
});
|
|
3807
|
-
(0, $iBTHO$solidjs.createEffect)(()=>input.classList[any_kids_checked() ? "add" : "remove"]("
|
|
3823
|
+
(0, $iBTHO$solidjs.createEffect)(()=>input.classList[any_kids_checked() ? "add" : "remove"]("fake-checked"));
|
|
3808
3824
|
}
|
|
3809
3825
|
}), null);
|
|
3810
3826
|
(0, $iBTHO$solidjsweb.insert)(_el$2, (0, $iBTHO$solidjsweb.createComponent)((0, $iBTHO$solidjs.Show), {
|
|
@@ -4388,7 +4404,7 @@ function $edafe91daf3091d7$export$b69d0d92862de18b(props) {
|
|
|
4388
4404
|
|
|
4389
4405
|
|
|
4390
4406
|
|
|
4391
|
-
const $aff9a96d30ed3563$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="
|
|
4407
|
+
const $aff9a96d30ed3563$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="filter-collapsible"></div>`, 2), $aff9a96d30ed3563$var$_tmpl$2 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<button class="clear-group"><span></span></button>`, 4), $aff9a96d30ed3563$var$_tmpl$3 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="view-more-clear"></div>`, 2), $aff9a96d30ed3563$var$_tmpl$4 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="filter-collapsible-body"><div class="filter-part"></div></div>`, 4), $aff9a96d30ed3563$var$_tmpl$5 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<details class="filter-collapsible"></details>`, 2), $aff9a96d30ed3563$var$_tmpl$6 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<summary class="filter-group-summary"><div class="summary"><span></span><div class="selected-w-sign"></div></div></summary>`, 8), $aff9a96d30ed3563$var$_tmpl$7 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="ungrouped"></div>`, 2), $aff9a96d30ed3563$var$_tmpl$8 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<button class="clear-all-filters major"></button>`, 2);
|
|
4392
4408
|
function $aff9a96d30ed3563$export$3f1a388cc0d8fed7(props) {
|
|
4393
4409
|
// Split like this to make placeholder wrapping more visible & this component is exported and used in MobileModal
|
|
4394
4410
|
return (0, $iBTHO$solidjsweb.createComponent)((0, $iBTHO$solidjs.Show), {
|
|
@@ -4617,7 +4633,7 @@ function $aff9a96d30ed3563$var$ActualFilterBody(props) {
|
|
|
4617
4633
|
|
|
4618
4634
|
|
|
4619
4635
|
|
|
4620
|
-
const $be89be42ce9ea60f$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="sorting-attributes"></div>`, 2), $be89be42ce9ea60f$var$_tmpl$2 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="sorting-direction"></div>`, 2), $be89be42ce9ea60f$var$_tmpl$3 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div><div class="
|
|
4636
|
+
const $be89be42ce9ea60f$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="sorting-attributes"></div>`, 2), $be89be42ce9ea60f$var$_tmpl$2 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="sorting-direction"></div>`, 2), $be89be42ce9ea60f$var$_tmpl$3 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div><div class="input-row"><input type="radio"><span class="custom-indicator"></span></div></div>`, 7), $be89be42ce9ea60f$var$_tmpl$4 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div><label class="input-row"><input type="radio"><span class="custom-indicator"></span></label></div>`, 7);
|
|
4621
4637
|
function $be89be42ce9ea60f$export$1f1775a58da589b5({ available_sortings_: available_sortings_ , current_sorting_: current_sorting_ }) {
|
|
4622
4638
|
const title_radio_name = (0, $iBTHO$depictaiutilishared.make_random_classname)();
|
|
4623
4639
|
const order_radio_name = (0, $iBTHO$depictaiutilishared.make_random_classname)();
|
|
@@ -4724,8 +4740,8 @@ function $be89be42ce9ea60f$export$1f1775a58da589b5({ available_sortings_: availa
|
|
|
4724
4740
|
|
|
4725
4741
|
|
|
4726
4742
|
|
|
4727
|
-
const $1872ceb56ede7a52$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<button class="clear minor"></button>`, 2), $1872ceb56ede7a52$var$_tmpl$2 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="depict plp depict-filter-sort-mobile-modal-container"><div class="depict-filter-sort-modal-backdrop"></div><button class="dismiss-modal"></button><div class="
|
|
4728
|
-
const $1872ceb56ede7a52$var$no_go_selector = ".range .
|
|
4743
|
+
const $1872ceb56ede7a52$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<button class="clear minor"></button>`, 2), $1872ceb56ede7a52$var$_tmpl$2 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="depict plp depict-filter-sort-mobile-modal-container"><div class="depict-filter-sort-modal-backdrop"></div><button class="dismiss-modal"></button><div class="filter-sort-modal"><div class="body"></div><div class="bottom-row"><button class="show-results major"></button></div></div></div>`, 14), $1872ceb56ede7a52$var$_tmpl$3 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<details class="sorting"></details>`, 2), $1872ceb56ede7a52$var$_tmpl$4 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<summary class="sort-filter-summary"><div class="summary"><div class="left-els"><span></span></div></div></summary>`, 8), $1872ceb56ede7a52$var$_tmpl$5 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="body"></div>`, 2), $1872ceb56ede7a52$var$_tmpl$6 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<details class="filters"></details>`, 2), $1872ceb56ede7a52$var$_tmpl$7 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<b></b>`, 2);
|
|
4744
|
+
const $1872ceb56ede7a52$var$no_go_selector = ".range .range-group";
|
|
4729
4745
|
function $1872ceb56ede7a52$export$9bf11afa910f536e({ args_for_sorting_: args_for_sorting_ , args_for_filtering_: args_for_filtering_ , search_filters_open_: [get_search_filters_open, set_search_filters_open] , search_sorting_open_: [get_search_sorting_open, set_search_sorting_open] , dismiss_modal_: dismiss_modal_ , register_closing_animation_: register_closing_animation_ , formatted_number_of_results_: formatted_number_of_results_ , i18n_: i18n_ }) {
|
|
4730
4746
|
(0, $ca1176b694a6ee2e$export$fe334901e8bebd57)();
|
|
4731
4747
|
let modal;
|
|
@@ -4995,7 +5011,7 @@ function $1872ceb56ede7a52$export$9bf11afa910f536e({ args_for_sorting_: args_for
|
|
|
4995
5011
|
|
|
4996
5012
|
|
|
4997
5013
|
|
|
4998
|
-
const $f8f64d05c525825b$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="filters"><div class="body"></div></div>`, 4), $f8f64d05c525825b$var$_tmpl$2 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="sorting"><div class="body"></div></div>`, 4), $f8f64d05c525825b$var$_tmpl$3 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="sort-and-filter-buttons"><div class="outer"><div class="inner"></div></div></div>`, 6), $f8f64d05c525825b$var$_tmpl$4 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<span class="
|
|
5014
|
+
const $f8f64d05c525825b$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="filters"><div class="body"></div></div>`, 4), $f8f64d05c525825b$var$_tmpl$2 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="sorting"><div class="body"></div></div>`, 4), $f8f64d05c525825b$var$_tmpl$3 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="sort-and-filter-buttons"><div class="outer"><div class="inner"></div></div></div>`, 6), $f8f64d05c525825b$var$_tmpl$4 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<span class="num-filters"></span>`, 2), $f8f64d05c525825b$var$_tmpl$5 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="open-filters-button-container"><button class="filter toggle-button major-minor-transition" type="button"><span></span></button></div>`, 6), $f8f64d05c525825b$var$_tmpl$6 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<button class="toggle-button for-sorting major-minor-transition"><span></span></button>`, 4);
|
|
4999
5015
|
function $f8f64d05c525825b$export$d7841e452f2e59a8({ current_sorting_: current_sorting_ , set_extra_els_in_results_container_: set_extra_els_in_results_container_ , search_filters_open_: search_filters_open_ , search_sorting_open_: search_sorting_open_ , set_sort_or_filter_open_: set_sort_or_filter_open_ , i18n_: i18n_ , available_sortings_: available_sortings_ , available_filters_: available_filters_ , expanded_filters_: expanded_filters_ , middle_elements_: middle_elements_ , input_modal_open_: input_modal_open_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_ , set_sort_and_filter_element_: set_sort_and_filter_element_ , formatted_number_of_results_: formatted_number_of_results_ , filter_button_width_: filter_button_width_ , sort_button_width_: sort_button_width_ , selected_filters_: selected_filters_ , local_filter_cache_: local_filter_cache_ , get_extra_filters_button_: get_extra_filters_button_ , get_extra_sorting_button_: get_extra_sorting_button_ }) {
|
|
5000
5016
|
return (0, $edafe91daf3091d7$export$b69d0d92862de18b)({
|
|
5001
5017
|
severity_: "error",
|
|
@@ -5227,7 +5243,7 @@ function $f8f64d05c525825b$var$OpenSortingButton({ i18n_: i18n_ , current_sortin
|
|
|
5227
5243
|
|
|
5228
5244
|
|
|
5229
5245
|
|
|
5230
|
-
const $2fb324fbcc7b4a7b$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="
|
|
5246
|
+
const $2fb324fbcc7b4a7b$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="floating-buttons"><button class="filter"><div></div></button><button class="sort"><div></div></button><button class="up"><div></div></button></div>`, 14);
|
|
5231
5247
|
function $2fb324fbcc7b4a7b$export$b23abd26de154ede(props) {
|
|
5232
5248
|
const [is_small, set_is_small] = (0, $iBTHO$solidjs.createSignal)(true);
|
|
5233
5249
|
(0, $iBTHO$solidjs.onCleanup)((0, $iBTHO$depictaiutilishared.javascript_media_query)("(max-width:651px)", ({ matches: matches })=>set_is_small(matches)).remove);
|
|
@@ -5342,7 +5358,7 @@ function $2fb324fbcc7b4a7b$var$ActualFloatingButtons({ search_filters_open_: [ge
|
|
|
5342
5358
|
(0, $iBTHO$solidjsweb.insert)(_el$7, (0, $iBTHO$solidjsweb.createComponent)((0, $iBTHO$depictaiutilishared.ArrowUp), {}));
|
|
5343
5359
|
(0, $iBTHO$solidjsweb.effect)((_p$)=>{
|
|
5344
5360
|
const _v$ = !!(is_scrolling_upwards() && modal_is_closed() && !regular_buttons_are_in_view() && !get_is_showing_toast()), _v$2 = i18n_.filter_text_(), _v$3 = i18n_.sorting_text_(), _v$4 = i18n_.scroll_to_top_();
|
|
5345
|
-
_v$ !== _p$._v$ && _el$.classList.toggle("
|
|
5361
|
+
_v$ !== _p$._v$ && _el$.classList.toggle("show-them", _p$._v$ = _v$);
|
|
5346
5362
|
_v$2 !== _p$._v$2 && (0, $iBTHO$solidjsweb.setAttribute)(_el$2, "aria-label", _p$._v$2 = _v$2);
|
|
5347
5363
|
_v$3 !== _p$._v$3 && (0, $iBTHO$solidjsweb.setAttribute)(_el$4, "aria-label", _p$._v$3 = _v$3);
|
|
5348
5364
|
_v$4 !== _p$._v$4 && (0, $iBTHO$solidjsweb.setAttribute)(_el$6, "aria-label", _p$._v$4 = _v$4);
|
|
@@ -5743,6 +5759,14 @@ function $8cd545330f2674dc$export$210f130a61ac1e8d(fn) {
|
|
|
5743
5759
|
|
|
5744
5760
|
|
|
5745
5761
|
|
|
5762
|
+
let $0b6e2070a98de347$export$44dad306455dddf;
|
|
5763
|
+
(function(DEPICT_ID) {
|
|
5764
|
+
DEPICT_ID["SEARCH_MODAL"] = "depict-search-modal";
|
|
5765
|
+
DEPICT_ID["SEARCH_PAGE"] = "depict-search-page";
|
|
5766
|
+
DEPICT_ID["PLP_CATEGORY"] = "depict-plp-category";
|
|
5767
|
+
})($0b6e2070a98de347$export$44dad306455dddf || ($0b6e2070a98de347$export$44dad306455dddf = {}));
|
|
5768
|
+
|
|
5769
|
+
|
|
5746
5770
|
const $840d88a04b2d22a7$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="product-count"> </div>`, 2), $840d88a04b2d22a7$var$_tmpl$2 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div></div>`, 2), $840d88a04b2d22a7$var$_tmpl$3 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="filter-results-for-one-row"></div>`, 2), $840d88a04b2d22a7$var$_tmpl$4 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="depict plp category"><div class="listing-page"></div></div>`, 4);
|
|
5747
5771
|
function $840d88a04b2d22a7$export$f7d2f673fc2f091d({ depict_api_: depict_api_ , page_replacer_: page_replacer_ , query_id_: query_id_ , current_sorting_: current_sorting_ , min_products_to_fetch_: min_products_to_fetch_ , category_filters_open_: category_filters_open_ , category_sorting_open_: category_sorting_open_ , expanded_filters_: expanded_filters_ , selected_filters_: selected_filters_ , get_quicklinks_accessor_: get_quicklinks_accessor_ , i18n_: incoming_i18n , get_breadcrumb_accessor_: get_breadcrumb_accessor_ , slider_arrow_button_: slider_arrow_button_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , local_filter_cache_: local_filter_cache_ , tenant_: tenant_ , market_: market_ , on_category_link_click_: on_category_link_click_ , show_quicklinks_: show_quicklinks_ , category_title_: category_title_ , show_breadcrumbs_: show_breadcrumbs_ , layout_options_: layout_options_ , scroll_restoration_data_: scroll_restoration_data_ , rr_options_: rr_options_ , get_product_id_: get_product_id_ }) {
|
|
5748
5772
|
return (0, $iBTHO$solidjs.createRoot)((dispose)=>{
|
|
@@ -6043,6 +6067,7 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({ depict_api_: depict_api_ ,
|
|
|
6043
6067
|
});
|
|
6044
6068
|
}
|
|
6045
6069
|
}), null);
|
|
6070
|
+
(0, $iBTHO$solidjsweb.effect)(()=>(0, $iBTHO$solidjsweb.setAttribute)(_el$5, "id", (0, $0b6e2070a98de347$export$44dad306455dddf).PLP_CATEGORY));
|
|
6046
6071
|
return _el$5;
|
|
6047
6072
|
})()
|
|
6048
6073
|
];
|
|
@@ -6087,6 +6112,7 @@ function $d84fe647b84b5dc5$var$proxy_push_state(function_name, thing) {
|
|
|
6087
6112
|
}
|
|
6088
6113
|
|
|
6089
6114
|
|
|
6115
|
+
|
|
6090
6116
|
const $7cb9c8285dbd453e$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="depict plp category"></div>`, 2);
|
|
6091
6117
|
class $7cb9c8285dbd453e$export$3a8840c5b2ecf003 {
|
|
6092
6118
|
#locale_signal = (0, $iBTHO$solidjs.createSignal)();
|
|
@@ -6107,7 +6133,11 @@ class $7cb9c8285dbd453e$export$3a8840c5b2ecf003 {
|
|
|
6107
6133
|
}
|
|
6108
6134
|
get #external_area_div() {
|
|
6109
6135
|
// creates a new node every time this is accessed, doing like this for DRY purposes
|
|
6110
|
-
return
|
|
6136
|
+
return (()=>{
|
|
6137
|
+
const _el$ = $7cb9c8285dbd453e$var$_tmpl$.cloneNode(true);
|
|
6138
|
+
(0, $iBTHO$solidjsweb.effect)(()=>(0, $iBTHO$solidjsweb.setAttribute)(_el$, "id", (0, $0b6e2070a98de347$export$44dad306455dddf).PLP_CATEGORY));
|
|
6139
|
+
return _el$;
|
|
6140
|
+
})();
|
|
6111
6141
|
}
|
|
6112
6142
|
get locale_() {
|
|
6113
6143
|
// allow reactive access
|
|
@@ -6237,113 +6267,42 @@ class $7cb9c8285dbd453e$export$3a8840c5b2ecf003 {
|
|
|
6237
6267
|
|
|
6238
6268
|
|
|
6239
6269
|
|
|
6240
|
-
function $b34ce0b89e6db4e1$export$e026af0c7b64ea5f({ selected_filters_: selected_filters_ , search_query_: [get_search_query] , current_sorting_: current_sorting_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , i18n_: i18n_ , local_filter_cache_: local_filter_cache_ }) {
|
|
6241
|
-
const [get_selected_filters, set_selected_filters] = selected_filters_;
|
|
6242
|
-
const clear_filters_next_submit_ = (0, $iBTHO$solidjs.createSignal)(false); // we store this here (and not in history.state) (maybe there's a better place) because it's a very temporary thing. I.e. as soon as anything breaks the "flow of intent" to make a new search we want this reset
|
|
6243
|
-
const [get_clear_filters_next_submit, set_clear_filters_next_submit] = clear_filters_next_submit_;
|
|
6244
|
-
const clear_filters = ()=>set_clear_filters_next_submit(true);
|
|
6245
|
-
(0, $iBTHO$solidjs.createComputed)((0, $iBTHO$solidjs.on)(get_selected_filters, ()=>{
|
|
6246
|
-
// if the selected filters update, clear the clearing signal
|
|
6247
|
-
set_clear_filters_next_submit(false);
|
|
6248
|
-
}, {
|
|
6249
|
-
defer: true
|
|
6250
|
-
}));
|
|
6251
|
-
(0, $iBTHO$solidjs.createComputed)((0, $iBTHO$solidjs.on)(get_search_query, (0, $iBTHO$depictaiutilishared.catchify)(()=>{
|
|
6252
|
-
// when a query was submitted, clear filters if clear was pressed before
|
|
6253
|
-
if ((0, $iBTHO$solidjs.untrack)(get_clear_filters_next_submit)) {
|
|
6254
|
-
set_clear_filters_next_submit(false);
|
|
6255
|
-
set_selected_filters([]);
|
|
6256
|
-
// also collapse expanded filters in hierarchical filter tree again
|
|
6257
|
-
expanded_hierarchical_filters_[1]([]);
|
|
6258
|
-
// also clear sorting
|
|
6259
|
-
current_sorting_[1](undefined);
|
|
6260
|
-
(0, $47e2cc552c02110c$export$8895d39404bd2bb1)({
|
|
6261
|
-
user_triggered_: true,
|
|
6262
|
-
selected_filters_: selected_filters_,
|
|
6263
|
-
i18n_: i18n_,
|
|
6264
|
-
also_clear_sorting_: true,
|
|
6265
|
-
current_sorting_: current_sorting_,
|
|
6266
|
-
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
6267
|
-
local_filter_cache_: local_filter_cache_
|
|
6268
|
-
});
|
|
6269
|
-
}
|
|
6270
|
-
}), {
|
|
6271
|
-
defer: true
|
|
6272
|
-
}));
|
|
6273
|
-
return clear_filters;
|
|
6274
|
-
}
|
|
6275
|
-
|
|
6276
|
-
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
-
|
|
6280
6270
|
|
|
6281
|
-
function $2b7a005a65221045$export$84bba84a7b837187(search_query) {
|
|
6282
|
-
const ls = localStorage;
|
|
6283
|
-
const key = "depict_searches";
|
|
6284
|
-
const previous_searches = (0, $iBTHO$solidjs.createSignal)(JSON.parse(ls[key] || "[]"));
|
|
6285
|
-
const [read_previous_searches, write_previous_searches] = previous_searches;
|
|
6286
|
-
const [read_search_query] = search_query;
|
|
6287
|
-
(0, $iBTHO$solidjs.createEffect)((0, $iBTHO$depictaiutilishared.catchify)(()=>{
|
|
6288
|
-
const json_encoded = JSON.stringify(read_previous_searches());
|
|
6289
|
-
if (ls[key] !== json_encoded) ls[key] = json_encoded;
|
|
6290
|
-
}));
|
|
6291
|
-
(0, $iBTHO$solidjs.createComputed)((0, $iBTHO$depictaiutilishared.catchify)(()=>{
|
|
6292
|
-
const searches = (0, $iBTHO$solidjs.untrack)((0, $iBTHO$depictaiutilishared.catchify)(()=>read_previous_searches()));
|
|
6293
|
-
const current_query = read_search_query();
|
|
6294
|
-
if (!current_query) // don't save no query in history
|
|
6295
|
-
return;
|
|
6296
|
-
const new_value = [
|
|
6297
|
-
...searches.filter((value)=>value !== current_query),
|
|
6298
|
-
current_query
|
|
6299
|
-
].slice(-30); // keep max 30 values (one could be deleted later because it's the search query), if value we add already exists remove it first
|
|
6300
|
-
write_previous_searches(new_value);
|
|
6301
|
-
}));
|
|
6302
|
-
return previous_searches;
|
|
6303
|
-
}
|
|
6304
6271
|
|
|
6305
6272
|
|
|
6306
6273
|
|
|
6307
6274
|
|
|
6308
|
-
function $f328bd45f8ede33c$export$e16630ecb9644a1c({ on_submit_with_unchanged_value_: on_submit_with_unchanged_value_ , search_param_name_: search_param_name_ , search_field_value_: [read_field_value, write_field_value] , search_query_: [read_search_query] , url_transformer_: url_transformer_ , on_submit_: on_submit_ = (0, $c8c0cecd8d3d832a$export$26df08e242fe83a3) , after_submit_: after_submit_ }) {
|
|
6309
|
-
const new_search_query = (0, $iBTHO$solidjs.untrack)(read_field_value);
|
|
6310
|
-
const previous_query = (0, $iBTHO$solidjs.untrack)(read_search_query);
|
|
6311
|
-
if (previous_query === new_search_query && new URLSearchParams(location.search).has(search_param_name_)) {
|
|
6312
|
-
// don't push a history entry / re-search if someone submits a search again
|
|
6313
|
-
// do close the modal though
|
|
6314
|
-
on_submit_with_unchanged_value_?.();
|
|
6315
|
-
return;
|
|
6316
|
-
}
|
|
6317
|
-
write_field_value(previous_query); // restore the value to the previous query since this one goes to the new history entry
|
|
6318
|
-
on_submit_(search_param_name_, new_search_query, url_transformer_);
|
|
6319
|
-
write_field_value(new_search_query);
|
|
6320
|
-
scrollTo(0, 0);
|
|
6321
|
-
after_submit_?.();
|
|
6322
|
-
}
|
|
6323
6275
|
|
|
6324
6276
|
|
|
6325
6277
|
|
|
6326
6278
|
|
|
6327
|
-
|
|
6328
|
-
|
|
6329
|
-
|
|
6330
|
-
|
|
6331
|
-
|
|
6332
|
-
|
|
6333
|
-
|
|
6334
|
-
|
|
6335
|
-
|
|
6336
|
-
|
|
6337
|
-
|
|
6338
|
-
|
|
6339
|
-
|
|
6340
|
-
|
|
6341
|
-
|
|
6279
|
+
const $dae23104ba8bb78c$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<span class="parent-title"></span>`, 2), $dae23104ba8bb78c$var$_tmpl$2 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<a class="category-suggestion"><span class="title"></span></a>`, 4);
|
|
6280
|
+
function $dae23104ba8bb78c$export$d757d54550ebfb3d({ category_suggestion_: category_suggestion_ , on_navigation_: on_navigation_ }) {
|
|
6281
|
+
return (()=>{
|
|
6282
|
+
const _el$ = $dae23104ba8bb78c$var$_tmpl$2.cloneNode(true), _el$2 = _el$.firstChild;
|
|
6283
|
+
(0, $iBTHO$solidjsweb.addEventListener)(_el$, "click", (0, $iBTHO$depictaiutilishared.catchify)((e)=>{
|
|
6284
|
+
if (e.button || e.metaKey || e.ctrlKey) // Not single page navigating because button is not 0 or ctrl/command click
|
|
6285
|
+
return;
|
|
6286
|
+
return on_navigation_?.(category_suggestion_().page_url);
|
|
6287
|
+
}), true);
|
|
6288
|
+
(0, $iBTHO$solidjsweb.insert)(_el$2, ()=>category_suggestion_().title);
|
|
6289
|
+
(0, $iBTHO$solidjsweb.insert)(_el$, (0, $iBTHO$solidjsweb.createComponent)((0, $iBTHO$solidjs.Show), {
|
|
6290
|
+
get when () {
|
|
6291
|
+
return typeof category_suggestion_().parent_title === "string";
|
|
6292
|
+
},
|
|
6293
|
+
get children () {
|
|
6294
|
+
const _el$3 = $dae23104ba8bb78c$var$_tmpl$.cloneNode(true);
|
|
6295
|
+
(0, $iBTHO$solidjsweb.insert)(_el$3, ()=>category_suggestion_().parent_title);
|
|
6296
|
+
return _el$3;
|
|
6342
6297
|
}
|
|
6343
|
-
}
|
|
6298
|
+
}), null);
|
|
6299
|
+
(0, $iBTHO$solidjsweb.effect)(()=>(0, $iBTHO$solidjsweb.setAttribute)(_el$, "href", category_suggestion_().page_url));
|
|
6300
|
+
return _el$;
|
|
6344
6301
|
})();
|
|
6345
|
-
return signals;
|
|
6346
6302
|
}
|
|
6303
|
+
(0, $iBTHO$solidjsweb.delegateEvents)([
|
|
6304
|
+
"click"
|
|
6305
|
+
]);
|
|
6347
6306
|
|
|
6348
6307
|
|
|
6349
6308
|
|
|
@@ -6357,20 +6316,7 @@ function $b7d0212db218bf0b$export$2542ffb77b620b02(params_to_default_value) {
|
|
|
6357
6316
|
|
|
6358
6317
|
|
|
6359
6318
|
|
|
6360
|
-
|
|
6361
|
-
|
|
6362
|
-
|
|
6363
|
-
|
|
6364
|
-
|
|
6365
|
-
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6369
|
-
|
|
6370
|
-
|
|
6371
|
-
|
|
6372
|
-
|
|
6373
|
-
const $2f8c7dc07090fca9$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<button class="back" type="button"></button>`, 2), $2f8c7dc07090fca9$var$_tmpl$2 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="query_input"><div class="field"><input class="query" tabindex="0"><button type="button" class="clear"></button></div><button class="submit major" type="button"></button></div>`, 9);
|
|
6319
|
+
const $2f8c7dc07090fca9$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<button class="back" type="button"></button>`, 2), $2f8c7dc07090fca9$var$_tmpl$2 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="query-input"><div class="field"><input class="query" tabindex="0"><button type="button" class="clear"></button></div><button class="submit major" type="button"></button></div>`, 9);
|
|
6374
6320
|
function $2f8c7dc07090fca9$export$ff21851bb5d30e15({ search_field_value_: search_field_value_ , input_field_ref_: input_field_ref_ , field_element_ref_: field_element_ref_ , submit_query_: submit_query_ , override_on_enter_: override_on_enter_ , clear_filters_: clear_filters_ , disabled_: disabled_ = false , on_back_: on_back_ , i18n_: i18n_ }) {
|
|
6375
6321
|
let input_field;
|
|
6376
6322
|
(0, $iBTHO$solidjs.createEffect)((0, $iBTHO$depictaiutilishared.catchify)(async ()=>{
|
|
@@ -6469,76 +6415,417 @@ function $2f8c7dc07090fca9$export$ff21851bb5d30e15({ search_field_value_: search
|
|
|
6469
6415
|
|
|
6470
6416
|
|
|
6471
6417
|
|
|
6472
|
-
const $
|
|
6473
|
-
|
|
6474
|
-
|
|
6475
|
-
const [
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
|
|
6479
|
-
|
|
6480
|
-
|
|
6481
|
-
|
|
6482
|
-
|
|
6483
|
-
});
|
|
6484
|
-
const [
|
|
6485
|
-
|
|
6486
|
-
|
|
6487
|
-
|
|
6488
|
-
|
|
6489
|
-
|
|
6490
|
-
|
|
6491
|
-
|
|
6492
|
-
|
|
6493
|
-
|
|
6418
|
+
const $fb29c6201c369e39$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="cards"></div>`, 2), $fb29c6201c369e39$var$_tmpl$2 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="search-recs"><h3 class="search-recs-title"></h3></div>`, 4), $fb29c6201c369e39$var$_tmpl$3 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<button class="show-more major" type="button"></button>`, 2);
|
|
6419
|
+
const $fb29c6201c369e39$export$1c8c715550dc689d = 2;
|
|
6420
|
+
function $fb29c6201c369e39$export$7de92c4c2205ebf3({ depict_api_: depict_api_ , i18n_: i18n_ , tenant_object_: tenant_object_ , search_query_base_: search_query_base_ , rr_options_: rr_options_ , showing_recommendation_rows_: showing_recommendation_rows_ , view_more_button_: view_more_button_ = true , layout_options_: layout_options_ }) {
|
|
6421
|
+
const [is_showing_something, set_is_showing_something] = (0, $iBTHO$solidjs.createSignal)(false);
|
|
6422
|
+
const cards = $fb29c6201c369e39$var$_tmpl$.cloneNode(true);
|
|
6423
|
+
const on_next_render = [];
|
|
6424
|
+
const main_element = (()=>{
|
|
6425
|
+
const _el$2 = $fb29c6201c369e39$var$_tmpl$2.cloneNode(true), _el$3 = _el$2.firstChild;
|
|
6426
|
+
(0, $iBTHO$solidjsweb.insert)(_el$3, ()=>i18n_.search_recs_title_());
|
|
6427
|
+
(0, $iBTHO$solidjsweb.insert)(_el$2, cards, null);
|
|
6428
|
+
return _el$2;
|
|
6429
|
+
})();
|
|
6430
|
+
const [get_showing_recommendation_rows] = showing_recommendation_rows_;
|
|
6431
|
+
const rows_object = view_more_button_ ? $fb29c6201c369e39$var$make_state_saved_rows(showing_recommendation_rows_, i18n_) : "all";
|
|
6432
|
+
const cleanup_old_cards = [];
|
|
6433
|
+
(0, $iBTHO$depictaiutilishared.Layout)({
|
|
6434
|
+
container_element: cards,
|
|
6435
|
+
layout: "grid",
|
|
6436
|
+
rows: rows_object,
|
|
6437
|
+
...layout_options_
|
|
6438
|
+
}).catch((e)=>(0, $iBTHO$depictaiutilishared.report)([
|
|
6439
|
+
e,
|
|
6440
|
+
"Layout failed"
|
|
6441
|
+
], "error"));
|
|
6442
|
+
// copied from RecommendationGrid
|
|
6443
|
+
// convoluted lazy loading that
|
|
6444
|
+
// when the elements are in the DOM starts IntersectionObserver on whole grid
|
|
6445
|
+
// when grid intersects starts Lazyfier
|
|
6446
|
+
// this is because Lazyfier is fucking stupid
|
|
6447
|
+
(0, $iBTHO$depictaiutilishared.observer).wait_for_element(cards).then((0, $iBTHO$depictaiutilishared.catchify)((element)=>{
|
|
6448
|
+
let start_lazy_loading;
|
|
6449
|
+
const lazy_loading_promise = new Promise((r)=>start_lazy_loading = r);
|
|
6450
|
+
const lf = new (0, $iBTHO$depictaiutilishared.Lazyfier)({
|
|
6451
|
+
only_load_intersecting: true,
|
|
6452
|
+
wait_for_dominsertion: lazy_loading_promise,
|
|
6453
|
+
ignore_data_urls: true,
|
|
6454
|
+
lazyfinder: {
|
|
6455
|
+
unload () {}
|
|
6456
|
+
}
|
|
6494
6457
|
});
|
|
6495
|
-
|
|
6496
|
-
|
|
6497
|
-
|
|
6498
|
-
|
|
6499
|
-
|
|
6500
|
-
|
|
6501
|
-
search_results();
|
|
6502
|
-
return {};
|
|
6503
|
-
});
|
|
6504
|
-
const sliced_displays = (0, $iBTHO$solidjs.createMemo)(()=>search_results()?.displays?.slice(0, max_cards));
|
|
6505
|
-
let placeholder;
|
|
6506
|
-
const container = (()=>{
|
|
6507
|
-
const _el$ = $6ae556e536054e87$var$_tmpl$.cloneNode(true);
|
|
6508
|
-
(0, $iBTHO$solidjsweb.insert)(_el$, (0, $iBTHO$solidjsweb.createComponent)((0, $iBTHO$solidjs.Show), {
|
|
6509
|
-
get when () {
|
|
6510
|
-
return sliced_displays()?.length;
|
|
6511
|
-
},
|
|
6512
|
-
get fallback () {
|
|
6513
|
-
return (0, $iBTHO$solidjs.createMemo)(()=>{
|
|
6514
|
-
if (Array.isArray(search_results()?.displays)) // remove placeholders if we have a response but no results
|
|
6515
|
-
return undefined;
|
|
6516
|
-
return new Array(max_cards).fill(1).map(()=>(placeholder ||= render_instant_card_placeholder_()).cloneNode(true));
|
|
6517
|
-
})();
|
|
6518
|
-
},
|
|
6519
|
-
get children () {
|
|
6520
|
-
return (0, $iBTHO$solidjsweb.createComponent)((0, $iBTHO$solidjs.Index), {
|
|
6521
|
-
get each () {
|
|
6522
|
-
return sliced_displays();
|
|
6523
|
-
},
|
|
6524
|
-
children: (d, i)=>$6ae556e536054e87$var$track_elements(d, i, render_instant_card_(d, i, rendering_options, i18n_), tenant_, market_)
|
|
6525
|
-
});
|
|
6458
|
+
lf.start_observing_for_new_children_(element);
|
|
6459
|
+
const i_o = new IntersectionObserver((0, $iBTHO$depictaiutilishared.catchify)((records)=>{
|
|
6460
|
+
for (const record of records)if (record.intersectionRatio > 0) {
|
|
6461
|
+
start_lazy_loading();
|
|
6462
|
+
i_o.disconnect();
|
|
6463
|
+
return;
|
|
6526
6464
|
}
|
|
6527
6465
|
}));
|
|
6528
|
-
|
|
6529
|
-
})
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
|
|
6466
|
+
i_o.observe(cards);
|
|
6467
|
+
}));
|
|
6468
|
+
const deparallelized_recs_fetcher = (0, $iBTHO$depictaiutilishared.deparallelize_no_drop)((0, $iBTHO$depictaiutilishared.catchify)(async (base_query)=>{
|
|
6469
|
+
const recs_promise = depict_api_.get_recommended(base_query).then((r)=>r.displays);
|
|
6470
|
+
// create owner to run product cards with an Owner, so they know when they've gotten removed
|
|
6471
|
+
const [owner_for_cards, dispose_our_cards] = (0, $iBTHO$solidjs.createRoot)((dispose)=>[
|
|
6472
|
+
(0, $iBTHO$solidjs.getOwner)(),
|
|
6473
|
+
dispose
|
|
6474
|
+
]);
|
|
6475
|
+
const rendering_result = await (await (0, $iBTHO$depictaiutilishared.make_placeholder_rr)({
|
|
6476
|
+
// render the max amount of elements that there could be, to make sure scroll restoration works (placeholders can't be shorter than actual content)
|
|
6477
|
+
num_items: (0, $aec24316ed262dc0$export$6c9030e511152266) + (0, $iBTHO$solidjs.untrack)(get_showing_recommendation_rows) * Math.max(...layout_options_.cols_at_size.map(([per_column])=>per_column))
|
|
6478
|
+
}))(tenant_object_, {
|
|
6479
|
+
type: "search_recs",
|
|
6480
|
+
recs: recs_promise,
|
|
6481
|
+
...rr_options_,
|
|
6482
|
+
...typeof rr_options_.template === "function" ? {
|
|
6483
|
+
template: (...args)=>(0, $iBTHO$solidjs.runWithOwner)(owner_for_cards, ()=>// give template the possibility to know when it gets removed from the DOM by using solid-js onCleanup
|
|
6484
|
+
rr_options_.template(...args))
|
|
6485
|
+
} : {}
|
|
6486
|
+
});
|
|
6487
|
+
const { elements: elements , should_stay_inserted: should_stay_inserted } = rendering_result;
|
|
6488
|
+
let dead = false;
|
|
6489
|
+
while(on_next_render.length)on_next_render.pop()();
|
|
6490
|
+
on_next_render.push(()=>dead = true);
|
|
6491
|
+
if (!elements) {
|
|
6492
|
+
set_is_showing_something(false);
|
|
6493
|
+
return;
|
|
6494
|
+
}
|
|
6495
|
+
cards.replaceChildren(...elements);
|
|
6496
|
+
// Dispose the old cards just after the cards have been removed from the DOM
|
|
6497
|
+
cleanup_old_cards.forEach((cleanup_function)=>cleanup_function());
|
|
6498
|
+
cleanup_old_cards.push(dispose_our_cards); // push after calling, so that we don't instantly demolish ourselves lol
|
|
6499
|
+
set_is_showing_something(true);
|
|
6500
|
+
should_stay_inserted?.then((should)=>{
|
|
6501
|
+
if (!should && !dead /* just in case */ ) set_is_showing_something(false);
|
|
6502
|
+
});
|
|
6503
|
+
}));
|
|
6504
|
+
(0, $iBTHO$solidjs.createRenderEffect)(()=>deparallelized_recs_fetcher(search_query_base_()));
|
|
6505
|
+
(0, $iBTHO$solidjs.onCleanup)(()=>cleanup_old_cards.forEach((fn)=>fn())); // if everything gets cleaned up without new cards replacing the old ones, clean up the last cards
|
|
6506
|
+
return (0, $iBTHO$solidjsweb.createComponent)((0, $iBTHO$solidjs.Show), {
|
|
6507
|
+
get when () {
|
|
6508
|
+
return is_showing_something();
|
|
6509
|
+
},
|
|
6510
|
+
children: main_element
|
|
6511
|
+
});
|
|
6512
|
+
}
|
|
6513
|
+
function $fb29c6201c369e39$var$make_state_saved_rows([get_showing_recommendation_rows, set_showing_recommendation_rows], i18n_) {
|
|
6514
|
+
const ipns = (0, $iBTHO$depictaiutilishared.async_iterable_ipns)();
|
|
6515
|
+
const rows = {
|
|
6516
|
+
ipns: ipns,
|
|
6517
|
+
start_rows: (0, $iBTHO$solidjs.untrack)(get_showing_recommendation_rows) ?? $fb29c6201c369e39$export$1c8c715550dc689d,
|
|
6518
|
+
rows_per_click: 3,
|
|
6519
|
+
button: (()=>{
|
|
6520
|
+
const _el$4 = $fb29c6201c369e39$var$_tmpl$3.cloneNode(true);
|
|
6521
|
+
(0, $iBTHO$solidjsweb.insert)(_el$4, ()=>i18n_.view_more_());
|
|
6522
|
+
return _el$4;
|
|
6523
|
+
})()
|
|
6524
|
+
};
|
|
6525
|
+
(0, $iBTHO$depictaiutilishared.catchify)(async ()=>{
|
|
6526
|
+
for await (const number of ipns)set_showing_recommendation_rows(number);
|
|
6527
|
+
})();
|
|
6528
|
+
(0, $iBTHO$solidjs.createComputed)((0, $iBTHO$solidjs.on)(get_showing_recommendation_rows, (new_rows = $fb29c6201c369e39$export$1c8c715550dc689d)=>{
|
|
6529
|
+
if (ipns.latest_call_value !== new_rows && ipns.state !== new_rows) ipns(new_rows);
|
|
6530
|
+
}, {
|
|
6531
|
+
defer: true
|
|
6532
|
+
}));
|
|
6533
|
+
return rows;
|
|
6534
|
+
}
|
|
6535
|
+
|
|
6536
|
+
|
|
6537
|
+
|
|
6538
|
+
|
|
6539
|
+
|
|
6540
|
+
|
|
6541
|
+
function $b34ce0b89e6db4e1$export$e026af0c7b64ea5f({ selected_filters_: selected_filters_ , search_query_: [get_search_query] , current_sorting_: current_sorting_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , i18n_: i18n_ , local_filter_cache_: local_filter_cache_ }) {
|
|
6542
|
+
const [get_selected_filters, set_selected_filters] = selected_filters_;
|
|
6543
|
+
const clear_filters_next_submit_ = (0, $iBTHO$solidjs.createSignal)(false); // we store this here (and not in history.state) (maybe there's a better place) because it's a very temporary thing. I.e. as soon as anything breaks the "flow of intent" to make a new search we want this reset
|
|
6544
|
+
const [get_clear_filters_next_submit, set_clear_filters_next_submit] = clear_filters_next_submit_;
|
|
6545
|
+
const clear_filters = ()=>set_clear_filters_next_submit(true);
|
|
6546
|
+
(0, $iBTHO$solidjs.createComputed)((0, $iBTHO$solidjs.on)(get_selected_filters, ()=>{
|
|
6547
|
+
// if the selected filters update, clear the clearing signal
|
|
6548
|
+
set_clear_filters_next_submit(false);
|
|
6549
|
+
}, {
|
|
6550
|
+
defer: true
|
|
6551
|
+
}));
|
|
6552
|
+
(0, $iBTHO$solidjs.createComputed)((0, $iBTHO$solidjs.on)(get_search_query, (0, $iBTHO$depictaiutilishared.catchify)(()=>{
|
|
6553
|
+
// when a query was submitted, clear filters if clear was pressed before
|
|
6554
|
+
if ((0, $iBTHO$solidjs.untrack)(get_clear_filters_next_submit)) {
|
|
6555
|
+
set_clear_filters_next_submit(false);
|
|
6556
|
+
set_selected_filters([]);
|
|
6557
|
+
// also collapse expanded filters in hierarchical filter tree again
|
|
6558
|
+
expanded_hierarchical_filters_[1]([]);
|
|
6559
|
+
// also clear sorting
|
|
6560
|
+
current_sorting_[1](undefined);
|
|
6561
|
+
(0, $47e2cc552c02110c$export$8895d39404bd2bb1)({
|
|
6562
|
+
user_triggered_: true,
|
|
6563
|
+
selected_filters_: selected_filters_,
|
|
6564
|
+
i18n_: i18n_,
|
|
6565
|
+
also_clear_sorting_: true,
|
|
6566
|
+
current_sorting_: current_sorting_,
|
|
6567
|
+
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
6568
|
+
local_filter_cache_: local_filter_cache_
|
|
6569
|
+
});
|
|
6570
|
+
}
|
|
6571
|
+
}), {
|
|
6572
|
+
defer: true
|
|
6573
|
+
}));
|
|
6574
|
+
return clear_filters;
|
|
6575
|
+
}
|
|
6576
|
+
|
|
6577
|
+
|
|
6578
|
+
|
|
6579
|
+
|
|
6580
|
+
|
|
6581
|
+
function $2b7a005a65221045$export$84bba84a7b837187(search_query) {
|
|
6582
|
+
const ls = localStorage;
|
|
6583
|
+
const key = "depict_searches";
|
|
6584
|
+
const previous_searches = (0, $iBTHO$solidjs.createSignal)(JSON.parse(ls[key] || "[]"));
|
|
6585
|
+
const [read_previous_searches, write_previous_searches] = previous_searches;
|
|
6586
|
+
const [read_search_query] = search_query;
|
|
6587
|
+
(0, $iBTHO$solidjs.createEffect)((0, $iBTHO$depictaiutilishared.catchify)(()=>{
|
|
6588
|
+
const json_encoded = JSON.stringify(read_previous_searches());
|
|
6589
|
+
if (ls[key] !== json_encoded) ls[key] = json_encoded;
|
|
6590
|
+
}));
|
|
6591
|
+
(0, $iBTHO$solidjs.createComputed)((0, $iBTHO$depictaiutilishared.catchify)(()=>{
|
|
6592
|
+
const searches = (0, $iBTHO$solidjs.untrack)((0, $iBTHO$depictaiutilishared.catchify)(()=>read_previous_searches()));
|
|
6593
|
+
const current_query = read_search_query();
|
|
6594
|
+
if (!current_query) // don't save no query in history
|
|
6595
|
+
return;
|
|
6596
|
+
const new_value = [
|
|
6597
|
+
...searches.filter((value)=>value !== current_query),
|
|
6598
|
+
current_query
|
|
6599
|
+
].slice(-30); // keep max 30 values (one could be deleted later because it's the search query), if value we add already exists remove it first
|
|
6600
|
+
write_previous_searches(new_value);
|
|
6601
|
+
}));
|
|
6602
|
+
return previous_searches;
|
|
6603
|
+
}
|
|
6604
|
+
|
|
6605
|
+
|
|
6606
|
+
|
|
6607
|
+
|
|
6608
|
+
function $f328bd45f8ede33c$export$e16630ecb9644a1c({ on_submit_with_unchanged_value_: on_submit_with_unchanged_value_ , search_param_name_: search_param_name_ , search_field_value_: [read_field_value, write_field_value] , search_query_: [read_search_query] , url_transformer_: url_transformer_ , on_submit_: on_submit_ = (0, $c8c0cecd8d3d832a$export$26df08e242fe83a3) , after_submit_: after_submit_ }) {
|
|
6609
|
+
const new_search_query = (0, $iBTHO$solidjs.untrack)(read_field_value);
|
|
6610
|
+
const previous_query = (0, $iBTHO$solidjs.untrack)(read_search_query);
|
|
6611
|
+
if (previous_query === new_search_query && new URLSearchParams(location.search).has(search_param_name_)) {
|
|
6612
|
+
// don't push a history entry / re-search if someone submits a search again
|
|
6613
|
+
// do close the modal though
|
|
6614
|
+
on_submit_with_unchanged_value_?.();
|
|
6615
|
+
return;
|
|
6616
|
+
}
|
|
6617
|
+
write_field_value(previous_query); // restore the value to the previous query since this one goes to the new history entry
|
|
6618
|
+
on_submit_(search_param_name_, new_search_query, url_transformer_);
|
|
6619
|
+
write_field_value(new_search_query);
|
|
6620
|
+
scrollTo(0, 0);
|
|
6621
|
+
after_submit_?.();
|
|
6622
|
+
}
|
|
6623
|
+
|
|
6624
|
+
|
|
6625
|
+
|
|
6626
|
+
|
|
6627
|
+
function $b7d0212db218bf0b$export$2542ffb77b620b02(params_to_default_value) {
|
|
6628
|
+
const signals = {};
|
|
6629
|
+
const entries = Object.entries(params_to_default_value);
|
|
6630
|
+
for (const [param, default_value] of entries)signals[param] = (0, $iBTHO$solidjs.createSignal)(default_value ?? "");
|
|
6631
|
+
const [exit_iterable, exitable_iterable] = (0, $iBTHO$depictaiutilishared.make_asyncIterable_exiter)((0, $iBTHO$depictaiutilishared.href_change_ipns));
|
|
6632
|
+
(0, $iBTHO$solidjs.onCleanup)((0, $iBTHO$depictaiutilishared.catchify)(exit_iterable));
|
|
6633
|
+
(0, $iBTHO$depictaiutilishared.catchify)(async ()=>{
|
|
6634
|
+
for await (const href of exitable_iterable){
|
|
6635
|
+
const { searchParams: searchParams } = new URL(href);
|
|
6636
|
+
for (const [param, default_value] of entries){
|
|
6637
|
+
const [_get, set] = signals[param];
|
|
6638
|
+
if (searchParams.has(param)) {
|
|
6639
|
+
const new_val = searchParams.get(param) ?? default_value ?? "";
|
|
6640
|
+
set(new_val);
|
|
6641
|
+
} else set(default_value ?? "");
|
|
6642
|
+
}
|
|
6643
|
+
}
|
|
6644
|
+
})();
|
|
6645
|
+
return signals;
|
|
6646
|
+
}
|
|
6647
|
+
|
|
6648
|
+
|
|
6649
|
+
|
|
6650
|
+
|
|
6651
|
+
|
|
6652
|
+
|
|
6653
|
+
|
|
6654
|
+
|
|
6655
|
+
|
|
6656
|
+
|
|
6657
|
+
|
|
6658
|
+
|
|
6659
|
+
|
|
6660
|
+
|
|
6661
|
+
|
|
6662
|
+
|
|
6663
|
+
|
|
6664
|
+
|
|
6665
|
+
|
|
6666
|
+
|
|
6667
|
+
|
|
6668
|
+
|
|
6669
|
+
|
|
6670
|
+
|
|
6671
|
+
|
|
6672
|
+
|
|
6673
|
+
|
|
6674
|
+
|
|
6675
|
+
|
|
6676
|
+
|
|
6677
|
+
|
|
6678
|
+
const $6ae613870d3380fc$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<span class="orig price"></span>`, 2), $6ae613870d3380fc$var$_tmpl$2 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<a class="instant-card"><div class="img-part"></div><div class="right-part"><div class="title-brand-tagline"><span class="brand"></span><span class="title"></span></div><div class="price-container"><span class="price"></span></div></div></a>`, 16), $6ae613870d3380fc$var$_tmpl$3 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="tagline"></div>`, 2);
|
|
6679
|
+
const $6ae613870d3380fc$export$b05c0ae390cf3e06 = (display_or_variant_container, { i18n: i18n })=>{
|
|
6680
|
+
// Support for Spendrups displays, should probably be in the Spendrups script
|
|
6681
|
+
const display = (0, $iBTHO$solidjs.createMemo)(()=>{
|
|
6682
|
+
const display = display_or_variant_container();
|
|
6683
|
+
if (display.page_url) return display;
|
|
6684
|
+
if (!display?.variants?.length) return;
|
|
6685
|
+
return display.variants.filter((v)=>v.product_id == display.product_id)[0];
|
|
6686
|
+
});
|
|
6687
|
+
const image_url = (0, $iBTHO$solidjs.createMemo)(()=>display().image_url);
|
|
6688
|
+
const contained_image = (0, $iBTHO$solidjs.createMemo)(()=>(0, $iBTHO$depictaiutilishared.ContainedImage)({
|
|
6689
|
+
aspect_ratio: 1,
|
|
6690
|
+
alt: "",
|
|
6691
|
+
// @ts-ignore
|
|
6692
|
+
"data-src": image_url(),
|
|
6693
|
+
srcset_opts: {
|
|
6694
|
+
set_dataset: true
|
|
6695
|
+
},
|
|
6696
|
+
init_with_placeholder: true
|
|
6697
|
+
}));
|
|
6698
|
+
const is_sale = (0, $iBTHO$solidjs.createMemo)(()=>display().sale_price !== display().original_price);
|
|
6699
|
+
const returnVal = (()=>{
|
|
6700
|
+
const _el$ = $6ae613870d3380fc$var$_tmpl$2.cloneNode(true), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling, _el$7 = _el$4.nextSibling, _el$9 = _el$7.firstChild;
|
|
6701
|
+
(0, $iBTHO$solidjsweb.insert)(_el$2, contained_image);
|
|
6702
|
+
(0, $iBTHO$solidjsweb.insert)(_el$5, ()=>display().brand);
|
|
6703
|
+
(0, $iBTHO$solidjsweb.insert)(_el$6, ()=>display().title);
|
|
6704
|
+
(0, $iBTHO$solidjsweb.insert)(_el$4, (()=>{
|
|
6705
|
+
const _c$ = (0, $iBTHO$solidjsweb.memo)(()=>!!(display().sub_heading_1 || display().sub_heading_2));
|
|
6706
|
+
return ()=>_c$() && (()=>{
|
|
6707
|
+
const _el$10 = $6ae613870d3380fc$var$_tmpl$3.cloneNode(true);
|
|
6708
|
+
(0, $iBTHO$solidjsweb.insert)(_el$10, ()=>[
|
|
6709
|
+
display().sub_heading_1,
|
|
6710
|
+
display().sub_heading_2
|
|
6711
|
+
].filter((v)=>v).join(" | "));
|
|
6712
|
+
return _el$10;
|
|
6713
|
+
})();
|
|
6714
|
+
})(), null);
|
|
6715
|
+
(0, $iBTHO$solidjsweb.insert)(_el$7, (0, $iBTHO$solidjsweb.createComponent)((0, $iBTHO$solidjs.Show), {
|
|
6716
|
+
get when () {
|
|
6717
|
+
return is_sale();
|
|
6718
|
+
},
|
|
6719
|
+
get children () {
|
|
6720
|
+
const _el$8 = $6ae613870d3380fc$var$_tmpl$.cloneNode(true);
|
|
6721
|
+
(0, $iBTHO$solidjsweb.insert)(_el$8, ()=>i18n.price_formatting_().pre_, null);
|
|
6722
|
+
(0, $iBTHO$solidjsweb.insert)(_el$8, ()=>(0, $d659702496cb72ea$export$469c7af753d08925)({
|
|
6723
|
+
price_: (0, $iBTHO$solidjs.createMemo)(()=>display().original_price),
|
|
6724
|
+
price_formatting_: i18n.price_formatting_
|
|
6725
|
+
}), null);
|
|
6726
|
+
(0, $iBTHO$solidjsweb.insert)(_el$8, ()=>i18n.price_formatting_().post_, null);
|
|
6727
|
+
return _el$8;
|
|
6728
|
+
}
|
|
6729
|
+
}), _el$9);
|
|
6730
|
+
(0, $iBTHO$solidjsweb.insert)(_el$9, ()=>i18n.price_formatting_().pre_, null);
|
|
6731
|
+
(0, $iBTHO$solidjsweb.insert)(_el$9, ()=>(0, $d659702496cb72ea$export$469c7af753d08925)({
|
|
6732
|
+
price_: (0, $iBTHO$solidjs.createMemo)(()=>display().sale_price),
|
|
6733
|
+
price_formatting_: i18n.price_formatting_
|
|
6734
|
+
}), null);
|
|
6735
|
+
(0, $iBTHO$solidjsweb.insert)(_el$9, ()=>i18n.price_formatting_().post_, null);
|
|
6736
|
+
(0, $iBTHO$solidjsweb.effect)((_p$)=>{
|
|
6737
|
+
const _v$ = display().page_url, _v$2 = !!is_sale();
|
|
6738
|
+
_v$ !== _p$._v$ && (0, $iBTHO$solidjsweb.setAttribute)(_el$, "href", _p$._v$ = _v$);
|
|
6739
|
+
_v$2 !== _p$._v$2 && _el$9.classList.toggle("sales-price", _p$._v$2 = _v$2);
|
|
6740
|
+
return _p$;
|
|
6741
|
+
}, {
|
|
6742
|
+
_v$: undefined,
|
|
6743
|
+
_v$2: undefined
|
|
6744
|
+
});
|
|
6745
|
+
return _el$;
|
|
6746
|
+
})();
|
|
6747
|
+
// This solves a JSX type issue where the return value does not match with the explicit JSX.Element type for some reason
|
|
6748
|
+
return returnVal;
|
|
6749
|
+
};
|
|
6750
|
+
|
|
6751
|
+
|
|
6752
|
+
const $6ae556e536054e87$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="instant-results"></div>`, 2);
|
|
6753
|
+
function $6ae556e536054e87$export$62f101a8aa597bf8({ depict_api_: depict_api_ , search_field_value_: [get_search_field_value] , tenant_: tenant_ , market_: market_ , render_instant_card_: render_instant_card_ , render_instant_card_placeholder_: render_instant_card_placeholder_ , min_products_to_fetch_: min_products_to_fetch_ , has_sort_or_filters_: has_sort_or_filters_ , set_num_results_accessor_: set_num_results_accessor_ , i18n_: i18n_ }) {
|
|
6754
|
+
const max_cards = 4;
|
|
6755
|
+
const [read_current_instant_query, write_current_instant_query] = (0, $iBTHO$solidjs.createSignal)("");
|
|
6756
|
+
let timeout;
|
|
6757
|
+
(0, $iBTHO$solidjs.createComputed)(()=>{
|
|
6758
|
+
const value = get_search_field_value();
|
|
6759
|
+
if (timeout == null) // don't wait if it's the first request
|
|
6760
|
+
write_current_instant_query(value);
|
|
6761
|
+
clearTimeout(timeout);
|
|
6762
|
+
timeout = setTimeout((0, $iBTHO$depictaiutilishared.catchify)(()=>write_current_instant_query(value)), 250);
|
|
6763
|
+
});
|
|
6764
|
+
const [search_results] = (0, $iBTHO$solidjs.createResource)((0, $iBTHO$solidjs.createMemo)(()=>({
|
|
6765
|
+
tenant: tenant_(),
|
|
6766
|
+
market: market_(),
|
|
6767
|
+
query: read_current_instant_query()
|
|
6768
|
+
})), (0, $iBTHO$depictaiutilishared.catchify)((variable_data)=>{
|
|
6769
|
+
return depict_api_.query({
|
|
6770
|
+
// here it is (unfortunately) important that the keys in the object are in the same order as in SearchPage.tsx, because when JSON-encoding them to compare for caching the strings will be different otherwise
|
|
6771
|
+
limit: (0, $iBTHO$solidjs.untrack)(has_sort_or_filters_) ? max_cards : min_products_to_fetch_,
|
|
6772
|
+
// if there's no sorting or filters we can fetch min_products_to_fetch_ many since then the cached request can be re-used by the search page, otherwise, no reason to waste bytes
|
|
6773
|
+
...variable_data
|
|
6774
|
+
});
|
|
6775
|
+
}));
|
|
6776
|
+
set_num_results_accessor_(()=>(0, $0f400c3f7248d5f1$export$92f2da32c6e7e7ee)({
|
|
6777
|
+
search_results_: search_results,
|
|
6778
|
+
i18n_: i18n_
|
|
6779
|
+
}));
|
|
6780
|
+
const sliced_displays = (0, $iBTHO$solidjs.createMemo)(()=>search_results()?.displays?.slice(0, max_cards));
|
|
6781
|
+
let placeholder;
|
|
6782
|
+
const container = (()=>{
|
|
6783
|
+
const _el$ = $6ae556e536054e87$var$_tmpl$.cloneNode(true);
|
|
6784
|
+
(0, $iBTHO$solidjsweb.insert)(_el$, (0, $iBTHO$solidjsweb.createComponent)((0, $iBTHO$solidjs.Show), {
|
|
6785
|
+
get when () {
|
|
6786
|
+
return sliced_displays()?.length;
|
|
6787
|
+
},
|
|
6788
|
+
get fallback () {
|
|
6789
|
+
return (0, $iBTHO$solidjs.createMemo)(()=>{
|
|
6790
|
+
if (Array.isArray(search_results()?.displays)) // remove placeholders if we have a response but no results
|
|
6791
|
+
return undefined;
|
|
6792
|
+
return new Array(max_cards).fill(1).map(()=>(placeholder ||= render_instant_card_placeholder_()).cloneNode(true));
|
|
6793
|
+
})();
|
|
6794
|
+
},
|
|
6795
|
+
get children () {
|
|
6796
|
+
return (0, $iBTHO$solidjsweb.createComponent)((0, $iBTHO$solidjs.Index), {
|
|
6797
|
+
get each () {
|
|
6798
|
+
return sliced_displays();
|
|
6799
|
+
},
|
|
6800
|
+
children: (d, i)=>$6ae556e536054e87$var$track_elements(d, i, // Custom instant card requires a re-render on every display update
|
|
6801
|
+
render_instant_card_ ? (0, $iBTHO$solidjs.createMemo)(()=>render_instant_card_(d(), {
|
|
6802
|
+
index: i,
|
|
6803
|
+
i18n: i18n_,
|
|
6804
|
+
merchant: tenant_(),
|
|
6805
|
+
market: market_()
|
|
6806
|
+
})) : (0, $6ae613870d3380fc$export$b05c0ae390cf3e06)(d, {
|
|
6807
|
+
index: i,
|
|
6808
|
+
i18n: i18n_,
|
|
6809
|
+
merchant: tenant_(),
|
|
6810
|
+
market: market_()
|
|
6811
|
+
}), tenant_, market_)
|
|
6812
|
+
});
|
|
6813
|
+
}
|
|
6814
|
+
}));
|
|
6815
|
+
return _el$;
|
|
6816
|
+
})();
|
|
6817
|
+
new (0, $iBTHO$depictaiutilishared.Lazyfier)({
|
|
6818
|
+
container: container,
|
|
6819
|
+
lazyfinder: {
|
|
6820
|
+
unload () {}
|
|
6821
|
+
},
|
|
6822
|
+
ignore_data_urls: true
|
|
6823
|
+
});
|
|
6824
|
+
return container;
|
|
6825
|
+
}
|
|
6826
|
+
function $6ae556e536054e87$var$track_elements(display, index, elements, tenant, market) {
|
|
6827
|
+
const type = "instant_result";
|
|
6828
|
+
const unwrapped_elements = $6ae556e536054e87$var$unwrap_solid_jsx_element(elements);
|
|
6542
6829
|
const disconnectors = [];
|
|
6543
6830
|
(0, $iBTHO$solidjs.createComputed)(()=>{
|
|
6544
6831
|
let stop = false;
|
|
@@ -6644,7 +6931,7 @@ function $7b98f0cf558884f7$export$50b90be27d8502d9(el, [get_style_props, set_sty
|
|
|
6644
6931
|
|
|
6645
6932
|
|
|
6646
6933
|
|
|
6647
|
-
function $496cde876b53ce1e$export$91c3b6774e8be0f5({ param_: param_ , value_: value_ , url_transformer_: url_transformer_ , alternative_query_submitter_for_spas_: alternative_query_submitter_for_spas_ , set_search_field_value_: set_search_field_value_ , get_search_query_: get_search_query_ , after_submit_: after_submit_ }) {
|
|
6934
|
+
function $496cde876b53ce1e$export$91c3b6774e8be0f5({ param_: param_ , value_: value_ , url_transformer_: url_transformer_ , alternative_query_submitter_for_spas_: alternative_query_submitter_for_spas_ , set_search_field_value_: set_search_field_value_ , get_search_query_: get_search_query_ , after_submit_: after_submit_ , on_submit_with_unchanged_value_: on_submit_with_unchanged_value_ }) {
|
|
6648
6935
|
const [read_link, write_link] = (0, $iBTHO$solidjs.createSignal)();
|
|
6649
6936
|
const [exit_iterable, exitable_iterable] = (0, $iBTHO$depictaiutilishared.make_asyncIterable_exiter)((0, $iBTHO$depictaiutilishared.href_change_ipns));
|
|
6650
6937
|
(0, $iBTHO$solidjs.onCleanup)(exit_iterable);
|
|
@@ -6661,8 +6948,11 @@ function $496cde876b53ce1e$export$91c3b6774e8be0f5({ param_: param_ , value_: va
|
|
|
6661
6948
|
if (e.button || e.metaKey || e.ctrlKey) // not button 0 or cmd/ctrl click
|
|
6662
6949
|
return;
|
|
6663
6950
|
e.preventDefault();
|
|
6664
|
-
if (new URLSearchParams(location.search).get(param_) === value_)
|
|
6665
|
-
|
|
6951
|
+
if (new URLSearchParams(location.search).get(param_) === value_) {
|
|
6952
|
+
// don't do anything if we're already searching for this
|
|
6953
|
+
on_submit_with_unchanged_value_?.();
|
|
6954
|
+
return;
|
|
6955
|
+
}
|
|
6666
6956
|
set_search_field_value_((0, $iBTHO$solidjs.untrack)(get_search_query_)); // fill in old query in previous history entry before making new one, like we do in submit_query
|
|
6667
6957
|
if (typeof alternative_query_submitter_for_spas_ === "function") alternative_query_submitter_for_spas_(param_, value_, url_transformer_);
|
|
6668
6958
|
else {
|
|
@@ -6681,7 +6971,7 @@ function $496cde876b53ce1e$export$91c3b6774e8be0f5({ param_: param_ , value_: va
|
|
|
6681
6971
|
|
|
6682
6972
|
|
|
6683
6973
|
const $9a268bf73b31a717$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="previous-searches"><h2 class="text"></h2><div class="list"></div></div>`, 6), $9a268bf73b31a717$var$_tmpl$2 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<a class="item"><div class="left"><span></span></div><button class="delete"></button></a>`, 8);
|
|
6684
|
-
function $9a268bf73b31a717$export$a146ac6fa8346a25({ text_: text_ , previous_searches_: previous_searches_ , search_query_param_name_: search_query_param_name_ , currently_showing_suggestions_: currently_showing_suggestions_ , set_unfiltered_previous_searches_: set_unfiltered_previous_searches_ , search_field_value_: search_field_value_ , selected_index_: [read_selected_index_, write_selected_index_] , url_transformer_: url_transformer_ , alternative_query_submitter_for_spas_: alternative_query_submitter_for_spas_ , i18n_: i18n_ , get_search_query_: get_search_query_ , after_submit_: after_submit_ }) {
|
|
6974
|
+
function $9a268bf73b31a717$export$a146ac6fa8346a25({ text_: text_ , previous_searches_: previous_searches_ , search_query_param_name_: search_query_param_name_ , currently_showing_suggestions_: currently_showing_suggestions_ , set_unfiltered_previous_searches_: set_unfiltered_previous_searches_ , search_field_value_: search_field_value_ , selected_index_: [read_selected_index_, write_selected_index_] , url_transformer_: url_transformer_ , alternative_query_submitter_for_spas_: alternative_query_submitter_for_spas_ , i18n_: i18n_ , get_search_query_: get_search_query_ , after_submit_: after_submit_ , on_submit_with_unchanged_value_: on_submit_with_unchanged_value_ }) {
|
|
6685
6975
|
const has_entries = (0, $iBTHO$solidjs.createMemo)(()=>previous_searches_().length >= 1);
|
|
6686
6976
|
currently_showing_suggestions_[1]((value)=>{
|
|
6687
6977
|
value[0] = (0, $iBTHO$solidjs.createMemo)(()=>previous_searches_().map((result)=>({
|
|
@@ -6714,7 +7004,8 @@ function $9a268bf73b31a717$export$a146ac6fa8346a25({ text_: text_ , previous_sea
|
|
|
6714
7004
|
alternative_query_submitter_for_spas_: alternative_query_submitter_for_spas_,
|
|
6715
7005
|
set_search_field_value_: search_field_value_[1],
|
|
6716
7006
|
get_search_query_: get_search_query_,
|
|
6717
|
-
after_submit_: after_submit_
|
|
7007
|
+
after_submit_: after_submit_,
|
|
7008
|
+
on_submit_with_unchanged_value_: on_submit_with_unchanged_value_
|
|
6718
7009
|
}));
|
|
6719
7010
|
return (()=>{
|
|
6720
7011
|
const _el$4 = $9a268bf73b31a717$var$_tmpl$2.cloneNode(true), _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$5.nextSibling;
|
|
@@ -6842,8 +7133,8 @@ function $d023ed916c84e75d$export$ba17c5b7e6dda39f({ whole_text_to_display_: who
|
|
|
6842
7133
|
}
|
|
6843
7134
|
|
|
6844
7135
|
|
|
6845
|
-
const $6b65ba8af12c5a26$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<a class="suggestion"></a>`, 2), $6b65ba8af12c5a26$var$_tmpl$2 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="search-icon"></div>`, 2), $6b65ba8af12c5a26$var$_tmpl$3 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<span class="type"></span>`, 2), $6b65ba8af12c5a26$var$_tmpl$4 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div><span class="value"></span></div>`, 4), $6b65ba8af12c5a26$var$_tmpl$5 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<h2 class="text"></h2>`, 2), $6b65ba8af12c5a26$var$_tmpl$6 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="
|
|
6846
|
-
function $6b65ba8af12c5a26$export$e872e2339fb04a7f({ suggestion_memo_: suggestion_memo_ , search_field_value_: search_field_value_ , search_page_url_param_name_: search_page_url_param_name_ , selected_index_: [read_selected_index_, write_selected_index_] , url_transformer_: url_transformer_ , filtered_previous_searches_: filtered_previous_searches_ , currently_showing_suggestions_: currently_showing_suggestions_ , on_previous_searches_page_: on_previous_searches_page_ , alternative_query_submitter_for_spas_: alternative_query_submitter_for_spas_ , i18n_: i18n_ , include_category_suggestions_: include_category_suggestions_ , searching_for_value_: searching_for_value_ , get_search_query_: get_search_query_ , after_submit_: after_submit_ }) {
|
|
7136
|
+
const $6b65ba8af12c5a26$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<a class="suggestion"></a>`, 2), $6b65ba8af12c5a26$var$_tmpl$2 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="search-icon"></div>`, 2), $6b65ba8af12c5a26$var$_tmpl$3 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<span class="type"></span>`, 2), $6b65ba8af12c5a26$var$_tmpl$4 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div><span class="value"></span></div>`, 4), $6b65ba8af12c5a26$var$_tmpl$5 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<h2 class="text"></h2>`, 2), $6b65ba8af12c5a26$var$_tmpl$6 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="suggestion-container query"></div>`, 2), $6b65ba8af12c5a26$var$_tmpl$7 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="suggestion-container page"></div>`, 2), $6b65ba8af12c5a26$var$_tmpl$8 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="suggestions"></div>`, 2);
|
|
7137
|
+
function $6b65ba8af12c5a26$export$e872e2339fb04a7f({ suggestion_memo_: suggestion_memo_ , search_field_value_: search_field_value_ , search_page_url_param_name_: search_page_url_param_name_ , selected_index_: [read_selected_index_, write_selected_index_] , url_transformer_: url_transformer_ , filtered_previous_searches_: filtered_previous_searches_ , currently_showing_suggestions_: currently_showing_suggestions_ , on_previous_searches_page_: on_previous_searches_page_ , alternative_query_submitter_for_spas_: alternative_query_submitter_for_spas_ , i18n_: i18n_ , include_category_suggestions_: include_category_suggestions_ , searching_for_value_: searching_for_value_ , get_search_query_: get_search_query_ , after_submit_: after_submit_ , navigate_page_to_href_: navigate_page_to_href_ , on_submit_with_unchanged_value_: on_submit_with_unchanged_value_ }) {
|
|
6847
7138
|
const queries_memo = (0, $iBTHO$solidjs.createMemo)(()=>suggestion_memo_().filter(({ type: type , title: title })=>type === (0, $3ec9e21d6b6debdd$export$3cf9497e790da491) && !filtered_previous_searches_().includes(title) // don't show the ones we already show from the history
|
|
6848
7139
|
));
|
|
6849
7140
|
const not_queries_memo = (0, $iBTHO$solidjs.createMemo)(()=>suggestion_memo_().filter(({ type: type })=>type !== (0, $3ec9e21d6b6debdd$export$3cf9497e790da491)));
|
|
@@ -6856,7 +7147,8 @@ function $6b65ba8af12c5a26$export$e872e2339fb04a7f({ suggestion_memo_: suggestio
|
|
|
6856
7147
|
alternative_query_submitter_for_spas_: alternative_query_submitter_for_spas_,
|
|
6857
7148
|
get_search_query_: get_search_query_,
|
|
6858
7149
|
set_search_field_value_: search_field_value_[1],
|
|
6859
|
-
after_submit_: after_submit_
|
|
7150
|
+
after_submit_: after_submit_,
|
|
7151
|
+
on_submit_with_unchanged_value_: on_submit_with_unchanged_value_
|
|
6860
7152
|
}) : undefined);
|
|
6861
7153
|
const [href, set_href] = (0, $iBTHO$solidjs.createSignal)();
|
|
6862
7154
|
(0, $iBTHO$solidjs.createComputed)(()=>{
|
|
@@ -6869,6 +7161,14 @@ function $6b65ba8af12c5a26$export$e872e2339fb04a7f({ suggestion_memo_: suggestio
|
|
|
6869
7161
|
(0, $iBTHO$solidjsweb.use)((element)=>element.addEventListener("click", (0, $iBTHO$depictaiutilishared.catchify)((ev)=>{
|
|
6870
7162
|
// Viskan's Oscar Jacobson site requires us to add the event listener normally here. They do too much when this element is clicked. We work around it by blocking the event and just dispatching it non-bubbling on this element.
|
|
6871
7163
|
if (is_query()) return param_change_obj().on_click_handler_(ev);
|
|
7164
|
+
else if (navigate_page_to_href_) {
|
|
7165
|
+
// single page navigate to category suggestions if enabled
|
|
7166
|
+
// object should have a href where we want to go
|
|
7167
|
+
if (ev.button || ev.metaKey || ev.ctrlKey) // not button 0 or cmd/ctrl click
|
|
7168
|
+
return;
|
|
7169
|
+
ev.preventDefault();
|
|
7170
|
+
navigate_page_to_href_(input_obj().page_url);
|
|
7171
|
+
}
|
|
6872
7172
|
})), _el$);
|
|
6873
7173
|
(0, $iBTHO$solidjsweb.addEventListener)(_el$, "mouseleave", (0, $iBTHO$depictaiutilishared.catchify)(()=>write_selected_index_(undefined)));
|
|
6874
7174
|
(0, $iBTHO$solidjsweb.addEventListener)(_el$, "mouseenter", (0, $iBTHO$depictaiutilishared.catchify)(()=>write_selected_index_([
|
|
@@ -7043,6 +7343,9 @@ function $6b65ba8af12c5a26$export$e872e2339fb04a7f({ suggestion_memo_: suggestio
|
|
|
7043
7343
|
|
|
7044
7344
|
|
|
7045
7345
|
|
|
7346
|
+
|
|
7347
|
+
|
|
7348
|
+
const $6a374b16bfe947d0$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<a target="_blank"></a>`, 2);
|
|
7046
7349
|
function $6a374b16bfe947d0$export$217899a935ef803b({ selected_index_: [read_selected_index, write_selected_index] , currently_showing_suggestions_: [read_currently_showing_suggestions] , ...rest_of_props }) {
|
|
7047
7350
|
const last_suggestion_index_ = (0, $iBTHO$solidjs.createMemo)(()=>{
|
|
7048
7351
|
const currently_showing_suggestions = read_currently_showing_suggestions();
|
|
@@ -7097,7 +7400,7 @@ function $6a374b16bfe947d0$export$217899a935ef803b({ selected_index_: [read_sele
|
|
|
7097
7400
|
write_selected_fake_index_: write_selected_fake_index_
|
|
7098
7401
|
});
|
|
7099
7402
|
}
|
|
7100
|
-
function $6a374b16bfe947d0$var$actual_navigation_working_on_fake_data({ element_: element_ , search_field_value_: [get_search_field_value, set_search_field_value] , updating_blocked_: [read_updating_blocked, write_updating_blocked] , last_suggestion_index_: last_suggestion_index_ , read_selected_fake_index_: read_selected_fake_index_ , write_selected_fake_index_: write_selected_fake_index_ , set_override_on_enter_fn_: set_override_on_enter_fn_ }) {
|
|
7403
|
+
function $6a374b16bfe947d0$var$actual_navigation_working_on_fake_data({ element_: element_ , search_field_value_: [get_search_field_value, set_search_field_value] , updating_blocked_: [read_updating_blocked, write_updating_blocked] , last_suggestion_index_: last_suggestion_index_ , read_selected_fake_index_: read_selected_fake_index_ , write_selected_fake_index_: write_selected_fake_index_ , set_override_on_enter_fn_: set_override_on_enter_fn_ , navigate_page_to_href_: navigate_page_to_href_ , url_transformer_: url_transformer_ , search_query_param_name_: search_query_param_name_ }) {
|
|
7101
7404
|
let previous_value;
|
|
7102
7405
|
(0, $iBTHO$solidjs.createEffect)(()=>{
|
|
7103
7406
|
const sfv = get_search_field_value();
|
|
@@ -7119,21 +7422,37 @@ function $6a374b16bfe947d0$var$actual_navigation_working_on_fake_data({ element_
|
|
|
7119
7422
|
calls++;
|
|
7120
7423
|
});
|
|
7121
7424
|
};
|
|
7122
|
-
|
|
7123
|
-
|
|
7124
|
-
|
|
7125
|
-
set_search_field_value(selected_entry.title);
|
|
7126
|
-
} else if (selected_entry?.type == "category") {
|
|
7127
|
-
set_override_on_enter_fn_(()=>{
|
|
7128
|
-
location.href = selected_entry.page_url;
|
|
7129
|
-
return true;
|
|
7130
|
-
});
|
|
7425
|
+
const override_on_enter_for_this_entry = (new_fn)=>{
|
|
7426
|
+
set_override_on_enter_fn_(new_fn);
|
|
7427
|
+
// Only override while this item has been selected with the keyboard
|
|
7131
7428
|
(0, $iBTHO$solidjs.createComputed)((run)=>{
|
|
7132
7429
|
if (!run) read_selected_fake_index_();
|
|
7133
7430
|
else set_override_on_enter_fn_(()=>false);
|
|
7134
7431
|
return run + 1;
|
|
7135
7432
|
}, 0);
|
|
7136
|
-
}
|
|
7433
|
+
};
|
|
7434
|
+
// update text field value if needed
|
|
7435
|
+
if (selected_entry?.type == "query") {
|
|
7436
|
+
const { title: title } = selected_entry;
|
|
7437
|
+
block_updating_for_one_change();
|
|
7438
|
+
set_search_field_value(title);
|
|
7439
|
+
override_on_enter_for_this_entry((e)=>{
|
|
7440
|
+
// Open search query in new tab on cmd+enter
|
|
7441
|
+
const url = new URL(location);
|
|
7442
|
+
url_transformer_?.(url);
|
|
7443
|
+
url.searchParams.set(search_query_param_name_, title);
|
|
7444
|
+
return $6a374b16bfe947d0$var$open_link_on_cmd_pressed(e, url.href);
|
|
7445
|
+
});
|
|
7446
|
+
} else if (selected_entry?.type == "category") override_on_enter_for_this_entry((e)=>{
|
|
7447
|
+
const { page_url: page_url } = selected_entry;
|
|
7448
|
+
if (!$6a374b16bfe947d0$var$open_link_on_cmd_pressed(e, page_url)) {
|
|
7449
|
+
// Above fn will return true if it opened a new tab, and we won't make these checks anymore
|
|
7450
|
+
if (navigate_page_to_href_) navigate_page_to_href_(page_url);
|
|
7451
|
+
else location.href = page_url;
|
|
7452
|
+
}
|
|
7453
|
+
return true;
|
|
7454
|
+
});
|
|
7455
|
+
else if (!selected_entry) {
|
|
7137
7456
|
block_updating_for_one_change();
|
|
7138
7457
|
set_search_field_value(previous_value);
|
|
7139
7458
|
}
|
|
@@ -7145,10 +7464,25 @@ function $6a374b16bfe947d0$var$actual_navigation_working_on_fake_data({ element_
|
|
|
7145
7464
|
(0, $iBTHO$solidjs.onCleanup)((0, $iBTHO$depictaiutilishared.catchify)(()=>el.removeEventListener("keyup", handler)));
|
|
7146
7465
|
});
|
|
7147
7466
|
}
|
|
7467
|
+
function $6a374b16bfe947d0$var$open_link_on_cmd_pressed(e, href) {
|
|
7468
|
+
if (e.metaKey || e.ctrlKey) {
|
|
7469
|
+
// Open link in a new tab with cmd/ctrl + enter.
|
|
7470
|
+
const link = (()=>{
|
|
7471
|
+
const _el$ = $6a374b16bfe947d0$var$_tmpl$.cloneNode(true);
|
|
7472
|
+
(0, $iBTHO$solidjsweb.setAttribute)(_el$, "href", href);
|
|
7473
|
+
return _el$;
|
|
7474
|
+
})();
|
|
7475
|
+
document.body.append(link);
|
|
7476
|
+
link.click();
|
|
7477
|
+
link.remove();
|
|
7478
|
+
return true;
|
|
7479
|
+
}
|
|
7480
|
+
return false;
|
|
7481
|
+
}
|
|
7148
7482
|
|
|
7149
7483
|
|
|
7150
7484
|
const $3ec9e21d6b6debdd$export$3cf9497e790da491 = "query";
|
|
7151
|
-
function $3ec9e21d6b6debdd$export$2f2b9559550c7bbc({ search_field_value_: search_field_value_ , search_query_: [get_search_query_] , search_page_url_param_name_: search_page_url_param_name_ , previous_searches_: unfiltered_previous_searches , previous_searches_text_: previous_searches_text_ , depict_api_: depict_api_ , tenant_: tenant_ , market_: market_ , input_field_: input_field_ , url_transformer_: url_transformer_ , currently_showing_suggestions_: currently_showing_suggestions_ , set_override_on_enter_fn_: set_override_on_enter_fn_ , selected_index_: selected_index_ , i18n_: i18n_ , include_category_suggestions_: include_category_suggestions_ , alternative_query_submitter_for_spas_: alternative_query_submitter_for_spas_ , after_submit_: after_submit_ }) {
|
|
7485
|
+
function $3ec9e21d6b6debdd$export$2f2b9559550c7bbc({ search_field_value_: search_field_value_ , search_query_: [get_search_query_] , search_page_url_param_name_: search_page_url_param_name_ , previous_searches_: unfiltered_previous_searches , previous_searches_text_: previous_searches_text_ , depict_api_: depict_api_ , tenant_: tenant_ , market_: market_ , input_field_: input_field_ , url_transformer_: url_transformer_ , currently_showing_suggestions_: currently_showing_suggestions_ , set_override_on_enter_fn_: set_override_on_enter_fn_ , selected_index_: selected_index_ , i18n_: i18n_ , include_category_suggestions_: include_category_suggestions_ , alternative_query_submitter_for_spas_: alternative_query_submitter_for_spas_ , after_submit_: after_submit_ , navigate_page_to_href_: navigate_page_to_href_ , on_submit_with_unchanged_value_: on_submit_with_unchanged_value_ }) {
|
|
7152
7486
|
const [searching_for_value, set_searching_for_value] = (0, $iBTHO$solidjs.createSignal)();
|
|
7153
7487
|
const [read_search_field_value] = search_field_value_;
|
|
7154
7488
|
const updating_blocked = (0, $iBTHO$solidjs.createSignal)(false);
|
|
@@ -7188,7 +7522,10 @@ function $3ec9e21d6b6debdd$export$2f2b9559550c7bbc({ search_field_value_: search
|
|
|
7188
7522
|
search_field_value_: search_field_value_,
|
|
7189
7523
|
updating_blocked_: updating_blocked,
|
|
7190
7524
|
currently_showing_suggestions_: currently_showing_suggestions_,
|
|
7191
|
-
set_override_on_enter_fn_: set_override_on_enter_fn_
|
|
7525
|
+
set_override_on_enter_fn_: set_override_on_enter_fn_,
|
|
7526
|
+
search_query_param_name_: search_page_url_param_name_,
|
|
7527
|
+
url_transformer_: url_transformer_,
|
|
7528
|
+
navigate_page_to_href_: navigate_page_to_href_
|
|
7192
7529
|
});
|
|
7193
7530
|
return [
|
|
7194
7531
|
(0, $iBTHO$solidjsweb.createComponent)((0, $iBTHO$solidjs.Show), {
|
|
@@ -7212,7 +7549,8 @@ function $3ec9e21d6b6debdd$export$2f2b9559550c7bbc({ search_field_value_: search
|
|
|
7212
7549
|
url_transformer_: url_transformer_,
|
|
7213
7550
|
get_search_query_: get_search_query_,
|
|
7214
7551
|
alternative_query_submitter_for_spas_: alternative_query_submitter_for_spas_,
|
|
7215
|
-
after_submit_: after_submit_
|
|
7552
|
+
after_submit_: after_submit_,
|
|
7553
|
+
on_submit_with_unchanged_value_: on_submit_with_unchanged_value_
|
|
7216
7554
|
});
|
|
7217
7555
|
}
|
|
7218
7556
|
}),
|
|
@@ -7239,7 +7577,9 @@ function $3ec9e21d6b6debdd$export$2f2b9559550c7bbc({ search_field_value_: search
|
|
|
7239
7577
|
currently_showing_suggestions_: currently_showing_suggestions_,
|
|
7240
7578
|
get_search_query_: get_search_query_,
|
|
7241
7579
|
include_category_suggestions_: include_category_suggestions_,
|
|
7242
|
-
after_submit_: after_submit_
|
|
7580
|
+
after_submit_: after_submit_,
|
|
7581
|
+
navigate_page_to_href_: navigate_page_to_href_,
|
|
7582
|
+
on_submit_with_unchanged_value_: on_submit_with_unchanged_value_
|
|
7243
7583
|
})
|
|
7244
7584
|
];
|
|
7245
7585
|
}
|
|
@@ -7301,8 +7641,9 @@ function $036d367ce3058351$export$3340fdd8259bd4fd({ get_search_field_value_: ge
|
|
|
7301
7641
|
}
|
|
7302
7642
|
|
|
7303
7643
|
|
|
7304
|
-
|
|
7305
|
-
|
|
7644
|
+
|
|
7645
|
+
const $f40a47a30a358305$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="discover-more"><button class="major" type="button"></button></div>`, 4), $f40a47a30a358305$var$_tmpl$2 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<b></b>`, 2), $f40a47a30a358305$var$_tmpl$3 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="depict-search-modal"><div class="body"><div class="padded"></div></div></div>`, 6), $f40a47a30a358305$var$_tmpl$4 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="depict plp search"><div class="depict-search-modal-backdrop"></div></div>`, 4);
|
|
7646
|
+
function $f40a47a30a358305$export$1c593cbd6f1e10bc({ search_field_value_: search_field_value_ , search_query_: search_query_ , search_page_url_param_name_: search_page_url_param_name_ , previous_searches_: previous_searches_ , close_modal_: close_modal_ , style_props_: style_props_ = (0, $iBTHO$solidjs.createSignal)({}) , depict_api_: depict_api_ , tenant_: tenant_ , market_: market_ , submit_query_: submit_query_ , instant_results_options_: instant_results_options_ , register_closing_animation_: register_closing_animation_ , url_transformer_: url_transformer_ , closing_animation_: closing_animation_ , alternative_query_submitter_for_spas_: alternative_query_submitter_for_spas_ , clear_filters_: clear_filters_ , i18n_: i18n_ , disable_scrolling_: disable_scrolling_ = true , enable_category_suggestions_: enable_category_suggestions_ , class_list_: class_list_ , after_submit_: after_submit_ , bottom_distance_under_modal_: bottom_distance_under_modal_ , navigate_page_to_href_: navigate_page_to_href_ , on_submit_with_unchanged_value_: on_submit_with_unchanged_value_ }) {
|
|
7306
7647
|
let on_enter_in_query_input_function;
|
|
7307
7648
|
const [input_field, set_input_field] = (0, $iBTHO$solidjs.createSignal)();
|
|
7308
7649
|
const [get_search_field_value_] = search_field_value_;
|
|
@@ -7382,7 +7723,9 @@ function $f40a47a30a358305$export$1c593cbd6f1e10bc({ search_field_value_: search
|
|
|
7382
7723
|
url_transformer_: url_transformer_,
|
|
7383
7724
|
i18n_: i18n_,
|
|
7384
7725
|
include_category_suggestions_: enable_category_suggestions_ ?? true,
|
|
7385
|
-
after_submit_: after_submit_
|
|
7726
|
+
after_submit_: after_submit_,
|
|
7727
|
+
navigate_page_to_href_: navigate_page_to_href_,
|
|
7728
|
+
on_submit_with_unchanged_value_: on_submit_with_unchanged_value_
|
|
7386
7729
|
});
|
|
7387
7730
|
}
|
|
7388
7731
|
}), null);
|
|
@@ -7411,7 +7754,15 @@ function $f40a47a30a358305$export$1c593cbd6f1e10bc({ search_field_value_: search
|
|
|
7411
7754
|
const _el$7 = $f40a47a30a358305$var$_tmpl$4.cloneNode(true), _el$8 = _el$7.firstChild;
|
|
7412
7755
|
(0, $iBTHO$solidjsweb.addEventListener)(_el$8, "click", close_modal_, true);
|
|
7413
7756
|
(0, $iBTHO$solidjsweb.insert)(_el$7, modal_element, null);
|
|
7414
|
-
(0, $iBTHO$solidjsweb.effect)((
|
|
7757
|
+
(0, $iBTHO$solidjsweb.effect)((_p$)=>{
|
|
7758
|
+
const _v$ = (0, $0b6e2070a98de347$export$44dad306455dddf).SEARCH_MODAL, _v$2 = class_list_?.();
|
|
7759
|
+
_v$ !== _p$._v$ && (0, $iBTHO$solidjsweb.setAttribute)(_el$7, "id", _p$._v$ = _v$);
|
|
7760
|
+
_p$._v$2 = (0, $iBTHO$solidjsweb.classList)(_el$7, _v$2, _p$._v$2);
|
|
7761
|
+
return _p$;
|
|
7762
|
+
}, {
|
|
7763
|
+
_v$: undefined,
|
|
7764
|
+
_v$2: undefined
|
|
7765
|
+
});
|
|
7415
7766
|
return _el$7;
|
|
7416
7767
|
})()
|
|
7417
7768
|
];
|
|
@@ -7458,6 +7809,8 @@ function $f40a47a30a358305$var$close_modal_when_navigating_away(close_modal, sea
|
|
|
7458
7809
|
|
|
7459
7810
|
|
|
7460
7811
|
|
|
7812
|
+
|
|
7813
|
+
|
|
7461
7814
|
const $04048c1bef16c249$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="category-suggestions"></div>`, 2), $04048c1bef16c249$var$_tmpl$2 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="category-suggestion"></div>`, 2);
|
|
7462
7815
|
function $04048c1bef16c249$export$c05a196222ba1302({ suggestions_: suggestions_ , children: children , selected_filters_: selected_filters_ , slider_arrow_button_: slider_arrow_button_ }) {
|
|
7463
7816
|
const category_suggestions_ = (0, $iBTHO$solidjs.createMemo)(()=>suggestions_()?.suggestions.filter((s)=>s.type === "category"));
|
|
@@ -7510,130 +7863,6 @@ function $04048c1bef16c249$export$c05a196222ba1302({ suggestions_: suggestions_
|
|
|
7510
7863
|
|
|
7511
7864
|
|
|
7512
7865
|
|
|
7513
|
-
const $fb29c6201c369e39$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="cards"></div>`, 2), $fb29c6201c369e39$var$_tmpl$2 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="search-recs"><h3 class="search-recs-title"></h3></div>`, 4), $fb29c6201c369e39$var$_tmpl$3 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<button class="show_more major" type="button"></button>`, 2);
|
|
7514
|
-
const $fb29c6201c369e39$export$1c8c715550dc689d = 2;
|
|
7515
|
-
function $fb29c6201c369e39$export$7de92c4c2205ebf3({ depict_api_: depict_api_ , i18n_: i18n_ , tenant_object_: tenant_object_ , search_query_base_: search_query_base_ , rr_options_: rr_options_ , showing_recommendation_rows_: showing_recommendation_rows_ , view_more_button_: view_more_button_ = true , layout_options_: layout_options_ }) {
|
|
7516
|
-
const [is_showing_something, set_is_showing_something] = (0, $iBTHO$solidjs.createSignal)(false);
|
|
7517
|
-
const cards = $fb29c6201c369e39$var$_tmpl$.cloneNode(true);
|
|
7518
|
-
const on_next_render = [];
|
|
7519
|
-
const main_element = (()=>{
|
|
7520
|
-
const _el$2 = $fb29c6201c369e39$var$_tmpl$2.cloneNode(true), _el$3 = _el$2.firstChild;
|
|
7521
|
-
(0, $iBTHO$solidjsweb.insert)(_el$3, ()=>i18n_.search_recs_title_());
|
|
7522
|
-
(0, $iBTHO$solidjsweb.insert)(_el$2, cards, null);
|
|
7523
|
-
return _el$2;
|
|
7524
|
-
})();
|
|
7525
|
-
const [get_showing_recommendation_rows] = showing_recommendation_rows_;
|
|
7526
|
-
const rows_object = view_more_button_ ? $fb29c6201c369e39$var$make_state_saved_rows(showing_recommendation_rows_, i18n_) : "all";
|
|
7527
|
-
const cleanup_old_cards = [];
|
|
7528
|
-
(0, $iBTHO$depictaiutilishared.Layout)({
|
|
7529
|
-
container_element: cards,
|
|
7530
|
-
layout: "grid",
|
|
7531
|
-
rows: rows_object,
|
|
7532
|
-
...layout_options_
|
|
7533
|
-
}).catch((e)=>(0, $iBTHO$depictaiutilishared.report)([
|
|
7534
|
-
e,
|
|
7535
|
-
"Layout failed"
|
|
7536
|
-
], "error"));
|
|
7537
|
-
// copied from RecommendationGrid
|
|
7538
|
-
// convoluted lazy loading that
|
|
7539
|
-
// when the elements are in the DOM starts IntersectionObserver on whole grid
|
|
7540
|
-
// when grid intersects starts Lazyfier
|
|
7541
|
-
// this is because Lazyfier is fucking stupid
|
|
7542
|
-
(0, $iBTHO$depictaiutilishared.observer).wait_for_element(cards).then((0, $iBTHO$depictaiutilishared.catchify)((element)=>{
|
|
7543
|
-
let start_lazy_loading;
|
|
7544
|
-
const lazy_loading_promise = new Promise((r)=>start_lazy_loading = r);
|
|
7545
|
-
const lf = new (0, $iBTHO$depictaiutilishared.Lazyfier)({
|
|
7546
|
-
only_load_intersecting: true,
|
|
7547
|
-
wait_for_dominsertion: lazy_loading_promise,
|
|
7548
|
-
ignore_data_urls: true,
|
|
7549
|
-
lazyfinder: {
|
|
7550
|
-
unload () {}
|
|
7551
|
-
}
|
|
7552
|
-
});
|
|
7553
|
-
lf.start_observing_for_new_children_(element);
|
|
7554
|
-
const i_o = new IntersectionObserver((0, $iBTHO$depictaiutilishared.catchify)((records)=>{
|
|
7555
|
-
for (const record of records)if (record.intersectionRatio > 0) {
|
|
7556
|
-
start_lazy_loading();
|
|
7557
|
-
i_o.disconnect();
|
|
7558
|
-
return;
|
|
7559
|
-
}
|
|
7560
|
-
}));
|
|
7561
|
-
i_o.observe(cards);
|
|
7562
|
-
}));
|
|
7563
|
-
const deparallelized_recs_fetcher = (0, $iBTHO$depictaiutilishared.deparallelize_no_drop)((0, $iBTHO$depictaiutilishared.catchify)(async (base_query)=>{
|
|
7564
|
-
const recs_promise = depict_api_.get_recommended(base_query).then((r)=>r.displays);
|
|
7565
|
-
// create owner to run product cards with an Owner, so they know when they've gotten removed
|
|
7566
|
-
const [owner_for_cards, dispose_our_cards] = (0, $iBTHO$solidjs.createRoot)((dispose)=>[
|
|
7567
|
-
(0, $iBTHO$solidjs.getOwner)(),
|
|
7568
|
-
dispose
|
|
7569
|
-
]);
|
|
7570
|
-
const rendering_result = await (await (0, $iBTHO$depictaiutilishared.make_placeholder_rr)({
|
|
7571
|
-
// render the max amount of elements that there could be, to make sure scroll restoration works (placeholders can't be shorter than actual content)
|
|
7572
|
-
num_items: (0, $aec24316ed262dc0$export$6c9030e511152266) + (0, $iBTHO$solidjs.untrack)(get_showing_recommendation_rows) * Math.max(...layout_options_.cols_at_size.map(([per_column])=>per_column))
|
|
7573
|
-
}))(tenant_object_, {
|
|
7574
|
-
type: "search_recs",
|
|
7575
|
-
recs: recs_promise,
|
|
7576
|
-
...rr_options_,
|
|
7577
|
-
...typeof rr_options_.template === "function" ? {
|
|
7578
|
-
template: (...args)=>(0, $iBTHO$solidjs.runWithOwner)(owner_for_cards, ()=>// give template the possibility to know when it gets removed from the DOM by using solid-js onCleanup
|
|
7579
|
-
rr_options_.template(...args))
|
|
7580
|
-
} : {}
|
|
7581
|
-
});
|
|
7582
|
-
const { elements: elements , should_stay_inserted: should_stay_inserted } = rendering_result;
|
|
7583
|
-
let dead = false;
|
|
7584
|
-
while(on_next_render.length)on_next_render.pop()();
|
|
7585
|
-
on_next_render.push(()=>dead = true);
|
|
7586
|
-
if (!elements) {
|
|
7587
|
-
set_is_showing_something(false);
|
|
7588
|
-
return;
|
|
7589
|
-
}
|
|
7590
|
-
cards.replaceChildren(...elements);
|
|
7591
|
-
// Dispose the old cards just after the cards have been removed from the DOM
|
|
7592
|
-
cleanup_old_cards.forEach((cleanup_function)=>cleanup_function());
|
|
7593
|
-
cleanup_old_cards.push(dispose_our_cards); // push after calling, so that we don't instantly demolish ourselves lol
|
|
7594
|
-
set_is_showing_something(true);
|
|
7595
|
-
should_stay_inserted?.then((should)=>{
|
|
7596
|
-
if (!should && !dead /* just in case */ ) set_is_showing_something(false);
|
|
7597
|
-
});
|
|
7598
|
-
}));
|
|
7599
|
-
(0, $iBTHO$solidjs.createRenderEffect)(()=>deparallelized_recs_fetcher(search_query_base_()));
|
|
7600
|
-
(0, $iBTHO$solidjs.onCleanup)(()=>cleanup_old_cards.forEach((fn)=>fn())); // if everything gets cleaned up without new cards replacing the old ones, clean up the last cards
|
|
7601
|
-
return (0, $iBTHO$solidjsweb.createComponent)((0, $iBTHO$solidjs.Show), {
|
|
7602
|
-
get when () {
|
|
7603
|
-
return is_showing_something();
|
|
7604
|
-
},
|
|
7605
|
-
children: main_element
|
|
7606
|
-
});
|
|
7607
|
-
}
|
|
7608
|
-
function $fb29c6201c369e39$var$make_state_saved_rows([get_showing_recommendation_rows, set_showing_recommendation_rows], i18n_) {
|
|
7609
|
-
const ipns = (0, $iBTHO$depictaiutilishared.async_iterable_ipns)();
|
|
7610
|
-
const rows = {
|
|
7611
|
-
ipns: ipns,
|
|
7612
|
-
start_rows: (0, $iBTHO$solidjs.untrack)(get_showing_recommendation_rows) ?? $fb29c6201c369e39$export$1c8c715550dc689d,
|
|
7613
|
-
rows_per_click: 3,
|
|
7614
|
-
button: (()=>{
|
|
7615
|
-
const _el$4 = $fb29c6201c369e39$var$_tmpl$3.cloneNode(true);
|
|
7616
|
-
(0, $iBTHO$solidjsweb.insert)(_el$4, ()=>i18n_.view_more_());
|
|
7617
|
-
return _el$4;
|
|
7618
|
-
})()
|
|
7619
|
-
};
|
|
7620
|
-
(0, $iBTHO$depictaiutilishared.catchify)(async ()=>{
|
|
7621
|
-
for await (const number of ipns)set_showing_recommendation_rows(number);
|
|
7622
|
-
})();
|
|
7623
|
-
(0, $iBTHO$solidjs.createComputed)((0, $iBTHO$solidjs.on)(get_showing_recommendation_rows, (new_rows = $fb29c6201c369e39$export$1c8c715550dc689d)=>{
|
|
7624
|
-
if (ipns.latest_call_value !== new_rows && ipns.state !== new_rows) ipns(new_rows);
|
|
7625
|
-
}, {
|
|
7626
|
-
defer: true
|
|
7627
|
-
}));
|
|
7628
|
-
return rows;
|
|
7629
|
-
}
|
|
7630
|
-
|
|
7631
|
-
|
|
7632
|
-
|
|
7633
|
-
|
|
7634
|
-
|
|
7635
|
-
|
|
7636
|
-
|
|
7637
7866
|
|
|
7638
7867
|
|
|
7639
7868
|
const $65a0c4b1c2eb5d0b$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<b></b>`, 2), $65a0c4b1c2eb5d0b$var$_tmpl$2 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="results-for"></div>`, 2);
|
|
@@ -7663,6 +7892,7 @@ function $65a0c4b1c2eb5d0b$export$9dd50d35b9d94fdf({ search_query_: search_query
|
|
|
7663
7892
|
|
|
7664
7893
|
|
|
7665
7894
|
|
|
7895
|
+
|
|
7666
7896
|
const $f1d7cb69f839a526$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="filter-results-for-one-row"></div>`, 2), $f1d7cb69f839a526$var$_tmpl$2 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="depict plp search"><div class="listing-page"></div></div>`, 4);
|
|
7667
7897
|
function $f1d7cb69f839a526$export$a54ec244c8863715(opts) {
|
|
7668
7898
|
const { depict_api_: depict_api_ , search_field_value_: search_field_value_ , search_query_: search_query_ , open_modal_: open_modal_ , submit_query_: submit_query_ , current_sorting_: current_sorting_ , min_products_to_fetch_: min_products_to_fetch_ , search_filters_open_: search_filters_open_ , search_sorting_open_: search_sorting_open_ , expanded_filters_: expanded_filters_ , input_modal_open_: input_modal_open_ , selected_filters_: selected_filters_ , i18n_: i18n_ , slider_arrow_button_: slider_arrow_button_ , make_category_suggestion_card_: make_category_suggestion_card_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , clear_filters_on_next_submit_: clear_filters_on_next_submit_ , local_filter_cache_: local_filter_cache_ , include_input_field_: include_input_field_ , tenant_: tenant_ , market_: market_ , showing_recommendation_rows_: showing_recommendation_rows_ , rr_options_: rr_options_ , recommendations_rr_options_: recommendations_rr_options_ = rr_options_ , search_recs_view_more_: search_recs_view_more_ , get_product_id_: get_product_id_ , disable_search_recommendations_: disable_search_recommendations_ , layout_options_: layout_options_ , recommendations_layout_options_: recommendations_layout_options_ = layout_options_ , scroll_restoration_data_: scroll_restoration_data_ } = opts;
|
|
@@ -7940,6 +8170,7 @@ function $f1d7cb69f839a526$export$a54ec244c8863715(opts) {
|
|
|
7940
8170
|
});
|
|
7941
8171
|
}
|
|
7942
8172
|
}), null);
|
|
8173
|
+
(0, $iBTHO$solidjsweb.effect)(()=>(0, $iBTHO$solidjsweb.setAttribute)(_el$2, "id", (0, $0b6e2070a98de347$export$44dad306455dddf).SEARCH_PAGE));
|
|
7943
8174
|
return _el$2;
|
|
7944
8175
|
})()
|
|
7945
8176
|
];
|
|
@@ -7948,125 +8179,6 @@ function $f1d7cb69f839a526$export$a54ec244c8863715(opts) {
|
|
|
7948
8179
|
|
|
7949
8180
|
|
|
7950
8181
|
|
|
7951
|
-
|
|
7952
|
-
|
|
7953
|
-
|
|
7954
|
-
|
|
7955
|
-
|
|
7956
|
-
|
|
7957
|
-
|
|
7958
|
-
|
|
7959
|
-
|
|
7960
|
-
const $ad63d2a35e827266$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<span class="orig price"></span>`, 2), $ad63d2a35e827266$var$_tmpl$2 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<a class="instant-card"><div class="img_part"></div><div class="right_part"><div class="title_brand_tagline"><span class="brand"></span><span class="title"></span></div><div class="price_container"><span class="price"></span></div></div></a>`, 16), $ad63d2a35e827266$var$_tmpl$3 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="tagline"></div>`, 2);
|
|
7961
|
-
function $ad63d2a35e827266$export$3b5becc25bbaed73(display_or_variant_container, _index, get_fake_rendering_options, i18n_) {
|
|
7962
|
-
// Support for Spendrups displays, should probably be in the Spendrups script
|
|
7963
|
-
const display = (0, $iBTHO$solidjs.createMemo)(()=>{
|
|
7964
|
-
const display = display_or_variant_container();
|
|
7965
|
-
if (display.page_url) return display;
|
|
7966
|
-
if (!display?.variants?.length) return;
|
|
7967
|
-
return display.variants.filter((v)=>v.product_id == display.product_id)[0];
|
|
7968
|
-
});
|
|
7969
|
-
const image_url = (0, $iBTHO$solidjs.createMemo)(()=>display().image_url);
|
|
7970
|
-
const contained_image = (0, $iBTHO$solidjs.createMemo)(()=>(0, $iBTHO$depictaiutilishared.ContainedImage)({
|
|
7971
|
-
aspect_ratio: 1,
|
|
7972
|
-
alt: "",
|
|
7973
|
-
// @ts-ignore
|
|
7974
|
-
"data-src": image_url(),
|
|
7975
|
-
rendering_options: (0, $iBTHO$solidjs.untrack)(()=>get_fake_rendering_options()),
|
|
7976
|
-
srcset_opts: {
|
|
7977
|
-
set_dataset: true
|
|
7978
|
-
},
|
|
7979
|
-
init_with_placeholder: true
|
|
7980
|
-
}));
|
|
7981
|
-
const is_sale = (0, $iBTHO$solidjs.createMemo)(()=>display().sale_price !== display().original_price);
|
|
7982
|
-
return (()=>{
|
|
7983
|
-
const _el$ = $ad63d2a35e827266$var$_tmpl$2.cloneNode(true), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling, _el$7 = _el$4.nextSibling, _el$9 = _el$7.firstChild;
|
|
7984
|
-
(0, $iBTHO$solidjsweb.insert)(_el$2, contained_image);
|
|
7985
|
-
(0, $iBTHO$solidjsweb.insert)(_el$5, ()=>display().brand);
|
|
7986
|
-
(0, $iBTHO$solidjsweb.insert)(_el$6, ()=>display().title);
|
|
7987
|
-
(0, $iBTHO$solidjsweb.insert)(_el$4, ()=>display().sub_heading_1 || display().sub_heading_2 && (()=>{
|
|
7988
|
-
const _el$10 = $ad63d2a35e827266$var$_tmpl$3.cloneNode(true);
|
|
7989
|
-
(0, $iBTHO$solidjsweb.insert)(_el$10, ()=>[
|
|
7990
|
-
display().sub_heading_1,
|
|
7991
|
-
display().sub_heading_2
|
|
7992
|
-
].filter((v)=>v).join(" | "));
|
|
7993
|
-
return _el$10;
|
|
7994
|
-
})(), null);
|
|
7995
|
-
(0, $iBTHO$solidjsweb.insert)(_el$7, (0, $iBTHO$solidjsweb.createComponent)((0, $iBTHO$solidjs.Show), {
|
|
7996
|
-
get when () {
|
|
7997
|
-
return is_sale();
|
|
7998
|
-
},
|
|
7999
|
-
get children () {
|
|
8000
|
-
const _el$8 = $ad63d2a35e827266$var$_tmpl$.cloneNode(true);
|
|
8001
|
-
(0, $iBTHO$solidjsweb.insert)(_el$8, ()=>i18n_.price_formatting_().pre_, null);
|
|
8002
|
-
(0, $iBTHO$solidjsweb.insert)(_el$8, ()=>(0, $d659702496cb72ea$export$469c7af753d08925)({
|
|
8003
|
-
price_: (0, $iBTHO$solidjs.createMemo)(()=>display().original_price),
|
|
8004
|
-
price_formatting_: i18n_.price_formatting_
|
|
8005
|
-
}), null);
|
|
8006
|
-
(0, $iBTHO$solidjsweb.insert)(_el$8, ()=>i18n_.price_formatting_().post_, null);
|
|
8007
|
-
return _el$8;
|
|
8008
|
-
}
|
|
8009
|
-
}), _el$9);
|
|
8010
|
-
(0, $iBTHO$solidjsweb.insert)(_el$9, ()=>i18n_.price_formatting_().pre_, null);
|
|
8011
|
-
(0, $iBTHO$solidjsweb.insert)(_el$9, ()=>(0, $d659702496cb72ea$export$469c7af753d08925)({
|
|
8012
|
-
price_: (0, $iBTHO$solidjs.createMemo)(()=>display().sale_price),
|
|
8013
|
-
price_formatting_: i18n_.price_formatting_
|
|
8014
|
-
}), null);
|
|
8015
|
-
(0, $iBTHO$solidjsweb.insert)(_el$9, ()=>i18n_.price_formatting_().post_, null);
|
|
8016
|
-
(0, $iBTHO$solidjsweb.effect)((_p$)=>{
|
|
8017
|
-
const _v$ = display().page_url, _v$2 = !!is_sale();
|
|
8018
|
-
_v$ !== _p$._v$ && (0, $iBTHO$solidjsweb.setAttribute)(_el$, "href", _p$._v$ = _v$);
|
|
8019
|
-
_v$2 !== _p$._v$2 && _el$9.classList.toggle("sales_price", _p$._v$2 = _v$2);
|
|
8020
|
-
return _p$;
|
|
8021
|
-
}, {
|
|
8022
|
-
_v$: undefined,
|
|
8023
|
-
_v$2: undefined
|
|
8024
|
-
});
|
|
8025
|
-
return _el$;
|
|
8026
|
-
})();
|
|
8027
|
-
}
|
|
8028
|
-
|
|
8029
|
-
|
|
8030
|
-
|
|
8031
|
-
|
|
8032
|
-
|
|
8033
|
-
|
|
8034
|
-
|
|
8035
|
-
|
|
8036
|
-
|
|
8037
|
-
|
|
8038
|
-
|
|
8039
|
-
|
|
8040
|
-
|
|
8041
|
-
const $dae23104ba8bb78c$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<span class="parent_title"></span>`, 2), $dae23104ba8bb78c$var$_tmpl$2 = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<a class="category-suggestion"><span class="title"></span></a>`, 4);
|
|
8042
|
-
function $dae23104ba8bb78c$export$d757d54550ebfb3d({ category_suggestion_: category_suggestion_ , on_navigation_: on_navigation_ }) {
|
|
8043
|
-
return (()=>{
|
|
8044
|
-
const _el$ = $dae23104ba8bb78c$var$_tmpl$2.cloneNode(true), _el$2 = _el$.firstChild;
|
|
8045
|
-
(0, $iBTHO$solidjsweb.addEventListener)(_el$, "click", (0, $iBTHO$depictaiutilishared.catchify)((e)=>{
|
|
8046
|
-
if (e.button || e.metaKey || e.ctrlKey) // Not single page navigating because button is not 0 or ctrl/command click
|
|
8047
|
-
return;
|
|
8048
|
-
return on_navigation_?.(category_suggestion_().page_url);
|
|
8049
|
-
}), true);
|
|
8050
|
-
(0, $iBTHO$solidjsweb.insert)(_el$2, ()=>category_suggestion_().title);
|
|
8051
|
-
(0, $iBTHO$solidjsweb.insert)(_el$, (0, $iBTHO$solidjsweb.createComponent)((0, $iBTHO$solidjs.Show), {
|
|
8052
|
-
get when () {
|
|
8053
|
-
return typeof category_suggestion_().parent_title === "string";
|
|
8054
|
-
},
|
|
8055
|
-
get children () {
|
|
8056
|
-
const _el$3 = $dae23104ba8bb78c$var$_tmpl$.cloneNode(true);
|
|
8057
|
-
(0, $iBTHO$solidjsweb.insert)(_el$3, ()=>category_suggestion_().parent_title);
|
|
8058
|
-
return _el$3;
|
|
8059
|
-
}
|
|
8060
|
-
}), null);
|
|
8061
|
-
(0, $iBTHO$solidjsweb.effect)(()=>(0, $iBTHO$solidjsweb.setAttribute)(_el$, "href", category_suggestion_().page_url));
|
|
8062
|
-
return _el$;
|
|
8063
|
-
})();
|
|
8064
|
-
}
|
|
8065
|
-
(0, $iBTHO$solidjsweb.delegateEvents)([
|
|
8066
|
-
"click"
|
|
8067
|
-
]);
|
|
8068
|
-
|
|
8069
|
-
|
|
8070
8182
|
const $4e04be41243c3d80$var$transform_elements = (sorted_cols_at_size)=>{
|
|
8071
8183
|
const cols_at_size = [];
|
|
8072
8184
|
for(let i = 0; i < sorted_cols_at_size.length; i++){
|
|
@@ -8113,6 +8225,8 @@ const $4e04be41243c3d80$export$6daf8749b65a1b77 = (cols_at_size)=>{
|
|
|
8113
8225
|
|
|
8114
8226
|
|
|
8115
8227
|
|
|
8228
|
+
|
|
8229
|
+
|
|
8116
8230
|
const $fd2d5ef67fc09716$var$_tmpl$ = /*#__PURE__*/ (0, $iBTHO$solidjsweb.template)(`<div class="depict plp search"></div>`, 2);
|
|
8117
8231
|
/**
|
|
8118
8232
|
* Type for the private properties that are shared between the different exported search SDK wrapper functions. SDK users are not allowed to change/access these, they're an internal implementation detail.
|
|
@@ -8126,7 +8240,7 @@ class $fd2d5ef67fc09716$export$ac6237957a15b3f0 {
|
|
|
8126
8240
|
#modal_open_signal = (0, $iBTHO$solidjs.createSignal)(false);
|
|
8127
8241
|
static #has_been_constructed = false;
|
|
8128
8242
|
constructor({ search_query_url_param_name: search_query_url_param_name = "search_query" , url_transformer: url_transformer , on_navigation: on_navigation , enable_category_suggestions: enable_category_suggestions = true , disable_scrolling_during_modal: // Stuff needed for non-standard customer deployments that we shouldn't actually expose
|
|
8129
|
-
disable_scrolling_during_modal = true , api: api , bottom_distance_under_modal_: bottom_distance_under_modal_ , ...props_on_class }){
|
|
8243
|
+
disable_scrolling_during_modal = true , api: api , bottom_distance_under_modal_: bottom_distance_under_modal_ , render_instant_card: render_instant_card , ...props_on_class }){
|
|
8130
8244
|
if ($fd2d5ef67fc09716$export$ac6237957a15b3f0.#has_been_constructed) throw new Error("You can only have one instance of DepictSearch");
|
|
8131
8245
|
Object.assign(this, props_on_class);
|
|
8132
8246
|
const alternative_query_submitter_for_spas_ = on_navigation && ((search_param_name, new_search_query, url_transformer)=>{
|
|
@@ -8157,8 +8271,9 @@ class $fd2d5ef67fc09716$export$ac6237957a15b3f0 {
|
|
|
8157
8271
|
const previous_searches = (0, $2b7a005a65221045$export$84bba84a7b837187)(search_query_signal_);
|
|
8158
8272
|
const [, set_search_showing_recommendation_rows] = state_.search_showing_recommendation_rows;
|
|
8159
8273
|
const after_submit_ = ()=>set_search_showing_recommendation_rows((0, $fb29c6201c369e39$export$1c8c715550dc689d)); // do this every time after we have submitted a new query - otherwise there might already be a saved number of rows in the state
|
|
8274
|
+
const on_submit_with_unchanged_value_ = ()=>this.modal_open = false;
|
|
8160
8275
|
const configured_submit_query_ = ()=>(0, $f328bd45f8ede33c$export$e16630ecb9644a1c)({
|
|
8161
|
-
on_submit_with_unchanged_value_:
|
|
8276
|
+
on_submit_with_unchanged_value_: on_submit_with_unchanged_value_,
|
|
8162
8277
|
search_field_value_: state_.search_field_value,
|
|
8163
8278
|
search_query_: search_query_signal_,
|
|
8164
8279
|
search_param_name_: search_query_url_param_name,
|
|
@@ -8216,9 +8331,11 @@ class $fd2d5ef67fc09716$export$ac6237957a15b3f0 {
|
|
|
8216
8331
|
submit_query_: configured_submit_query_,
|
|
8217
8332
|
alternative_query_submitter_for_spas_: alternative_query_submitter_for_spas_,
|
|
8218
8333
|
url_transformer_: url_transformer,
|
|
8334
|
+
navigate_page_to_href_: on_navigation,
|
|
8335
|
+
on_submit_with_unchanged_value_: on_submit_with_unchanged_value_,
|
|
8219
8336
|
instant_results_options_: {
|
|
8220
8337
|
min_products_to_fetch_: $fd2d5ef67fc09716$var$min_products_to_fetch_,
|
|
8221
|
-
render_instant_card_:
|
|
8338
|
+
render_instant_card_: render_instant_card,
|
|
8222
8339
|
render_instant_card_placeholder_: (0, $6f604560873e4f69$export$ee1733d9a8495996),
|
|
8223
8340
|
has_sort_or_filters_: (0, $iBTHO$solidjs.createMemo)(()=>!!(Object.keys(state_.search_selected_filters[0]())?.length || state_.search_sorting[0]()))
|
|
8224
8341
|
},
|
|
@@ -8261,21 +8378,16 @@ class $fd2d5ef67fc09716$export$ac6237957a15b3f0 {
|
|
|
8261
8378
|
}
|
|
8262
8379
|
// Open centered modal
|
|
8263
8380
|
const supports_hover = (0, $b54e6192d0caa293$export$d9f36cf74e24d595)("(hover: hover) and (pointer: fine)");
|
|
8264
|
-
const slim = (0, $b54e6192d0caa293$export$d9f36cf74e24d595)("(max-width: 600px)");
|
|
8265
8381
|
const desktop_short = (0, $b54e6192d0caa293$export$d9f36cf74e24d595)("(max-height: 790px)");
|
|
8266
8382
|
const mobile_short = (0, $b54e6192d0caa293$export$d9f36cf74e24d595)("(max-height: 1000px)");
|
|
8267
|
-
const
|
|
8268
|
-
const transform_y = (0, $iBTHO$solidjs.createSignal)(false);
|
|
8383
|
+
const transform_y = (0, $iBTHO$solidjs.createMemo)(()=>supports_hover() ? !desktop_short() : !mobile_short());
|
|
8269
8384
|
const style_props_ = (0, $iBTHO$solidjs.createSignal)({
|
|
8270
8385
|
position: "fixed",
|
|
8271
|
-
top: "50%"
|
|
8272
|
-
left: "50%"
|
|
8386
|
+
top: "50%"
|
|
8273
8387
|
});
|
|
8274
|
-
(0, $iBTHO$solidjs.createComputed)(()=>transform_y[1](supports_hover() ? !desktop_short() : !mobile_short()));
|
|
8275
|
-
(0, $iBTHO$solidjs.createComputed)(()=>transform_x[1](transform_y[0]() || !slim()));
|
|
8276
8388
|
(0, $iBTHO$solidjs.createComputed)(()=>style_props_[1]((old_value)=>({
|
|
8277
8389
|
...old_value,
|
|
8278
|
-
transform:
|
|
8390
|
+
transform: transform_y() ? "translateY(-50%)" : "unset"
|
|
8279
8391
|
})));
|
|
8280
8392
|
if (signal_value_is_options) {
|
|
8281
8393
|
const [options_arg1, ...rest1] = open_signal_value;
|
|
@@ -8440,6 +8552,7 @@ function $fd2d5ef67fc09716$export$b94867ecbd698f21({ depict_search: depict_searc
|
|
|
8440
8552
|
(()=>{
|
|
8441
8553
|
const _el$ = $fd2d5ef67fc09716$var$_tmpl$.cloneNode(true);
|
|
8442
8554
|
(0, $iBTHO$solidjsweb.insert)(_el$, input);
|
|
8555
|
+
(0, $iBTHO$solidjsweb.effect)(()=>(0, $iBTHO$solidjsweb.setAttribute)(_el$, "id", (0, $0b6e2070a98de347$export$44dad306455dddf).SEARCH_MODAL));
|
|
8443
8556
|
return _el$;
|
|
8444
8557
|
})()
|
|
8445
8558
|
];
|