@depict-ai/ui 1.4.1 → 1.4.3
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/client/main.cjs +343 -644
- package/dist/client/module.js +344 -645
- package/dist/index.d.ts +8 -4
- package/dist/server/main.cjs +319 -454
- package/dist/server/module.js +320 -455
- package/package.json +4 -4
package/dist/server/module.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import {add_to_version_info as $cV3wj$add_to_version_info, observer as $cV3wj$observer, catchify as $cV3wj$catchify, useExpandingContainer as $cV3wj$useExpandingContainer, standard_price_format as $cV3wj$standard_price_format, Amazing_Slider as $cV3wj$Amazing_Slider, slider_snap_css as $cV3wj$slider_snap_css, slider_fading_factory as $cV3wj$slider_fading_factory, make_random_classname as $cV3wj$make_random_classname, dlog as $cV3wj$dlog,
|
|
1
|
+
import {add_to_version_info as $cV3wj$add_to_version_info, observer as $cV3wj$observer, catchify as $cV3wj$catchify, useExpandingContainer as $cV3wj$useExpandingContainer, standard_price_format as $cV3wj$standard_price_format, Amazing_Slider as $cV3wj$Amazing_Slider, slider_snap_css as $cV3wj$slider_snap_css, slider_fading_factory as $cV3wj$slider_fading_factory, make_random_classname as $cV3wj$make_random_classname, dlog as $cV3wj$dlog, hex_to_rgb as $cV3wj$hex_to_rgb, report as $cV3wj$report, relative_luminance_from_rgb as $cV3wj$relative_luminance_from_rgb, javascript_media_query as $cV3wj$javascript_media_query, n_col_styling_with_dist as $cV3wj$n_col_styling_with_dist, layout_get_visible_recs_without_partial_rows as $cV3wj$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $cV3wj$layout_get_total_rec_amount_for_row, layout_media_query_header as $cV3wj$layout_media_query_header, fetch_recs as $cV3wj$fetch_recs, snakeCasifyObject as $cV3wj$snakeCasifyObject, instant_exec_on_suspect_history_change as $cV3wj$instant_exec_on_suspect_history_change, base_url as $cV3wj$base_url, get_depict_id as $cV3wj$get_depict_id, get_user_id as $cV3wj$get_user_id, get_session_id as $cV3wj$get_session_id, sort_obj as $cV3wj$sort_obj, fetch_retry as $cV3wj$fetch_retry, add_version_query_params as $cV3wj$add_version_query_params, dwarn as $cV3wj$dwarn, make_url_with_query_params as $cV3wj$make_url_with_query_params, base64_encode_unicode as $cV3wj$base64_encode_unicode, base64_decode_unicode as $cV3wj$base64_decode_unicode, queueMacroTask as $cV3wj$queueMacroTask, make_asyncIterable_exiter as $cV3wj$make_asyncIterable_exiter, href_change_ipns as $cV3wj$href_change_ipns, ContainedImage as $cV3wj$ContainedImage, deparallelize_no_drop as $cV3wj$deparallelize_no_drop, insert_surfaces as $cV3wj$insert_surfaces} from "@depict-ai/utilishared";
|
|
2
2
|
import {insert as $cV3wj$insert, createComponent as $cV3wj$createComponent, ssr as $cV3wj$ssr, ssrHydrationKey as $cV3wj$ssrHydrationKey, escape as $cV3wj$escape, ssrAttribute as $cV3wj$ssrAttribute, ssrElement as $cV3wj$ssrElement, Dynamic as $cV3wj$Dynamic, ssrStyle as $cV3wj$ssrStyle, ssrClassList as $cV3wj$ssrClassList, isServer as $cV3wj$isServer, mergeProps as $cV3wj$mergeProps} from "solid-js/web";
|
|
3
3
|
import {createSignal as $cV3wj$createSignal, createMemo as $cV3wj$createMemo, untrack as $cV3wj$untrack, createEffect as $cV3wj$createEffect, getOwner as $cV3wj$getOwner, Show as $cV3wj$Show, Index as $cV3wj$Index, onCleanup as $cV3wj$onCleanup, For as $cV3wj$For, createRenderEffect as $cV3wj$createRenderEffect, createComputed as $cV3wj$createComputed, on as $cV3wj$on, batch as $cV3wj$batch, ErrorBoundary as $cV3wj$ErrorBoundary, createRoot as $cV3wj$createRoot, runWithOwner as $cV3wj$runWithOwner, createResource as $cV3wj$createResource, createReaction as $cV3wj$createReaction, Suspense as $cV3wj$Suspense} from "solid-js";
|
|
4
4
|
|
|
5
|
-
/*! Depict.ai search and product listing SDK */ const $ec291e0010116877$export$83d89fbfd8236492 = "1.4.
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
/*! Depict.ai search and product listing SDK */ const $ec291e0010116877$export$83d89fbfd8236492 = "1.4.3";
|
|
8
6
|
|
|
9
7
|
|
|
10
8
|
|
|
@@ -14,11 +12,11 @@ import {createSignal as $cV3wj$createSignal, createMemo as $cV3wj$createMemo, un
|
|
|
14
12
|
|
|
15
13
|
|
|
16
14
|
function $24e27fab9c821b86$export$5bad61ecde080b1f(...params) {
|
|
17
|
-
const { collapse: collapse
|
|
15
|
+
const { collapse: collapse, expand: expand, ExpandingContainer: ExpandingContainer } = (0, $cV3wj$useExpandingContainer)(...params);
|
|
18
16
|
return {
|
|
19
17
|
collapse: collapse,
|
|
20
18
|
expand: expand,
|
|
21
|
-
ExpandingContainer: ({ children: children
|
|
19
|
+
ExpandingContainer: ({ children: children })=>{
|
|
22
20
|
// get reactive signals/solid's jsx elements into `ExpandingContainer`
|
|
23
21
|
const fake_div = document.createElement("div");
|
|
24
22
|
const outer_expanding = (0, $cV3wj$createComponent)(ExpandingContainer, {
|
|
@@ -39,8 +37,8 @@ const $6bb0a0c563dff4bb$var$has_new_animate = /*@__PURE__*/ $6bb0a0c563dff4bb$ex
|
|
|
39
37
|
function $6bb0a0c563dff4bb$export$6c6d7a51fa9aa15d(props) {
|
|
40
38
|
let fresh_component = true;
|
|
41
39
|
let timeout_started = false;
|
|
42
|
-
const { details_: details_
|
|
43
|
-
const { expand: expand
|
|
40
|
+
const { details_: details_, summary_: summary_, children: children, duration_: duration_, delay_: delay_, dont_animate_if_instant_open_: dont_animate_if_instant_open_ = true } = props;
|
|
41
|
+
const { expand: expand, ExpandingContainer: ExpandingContainer, collapse: collapse } = (0, $24e27fab9c821b86$export$5bad61ecde080b1f)({
|
|
44
42
|
duration: duration_ ?? 250,
|
|
45
43
|
delay: delay_ ?? 0
|
|
46
44
|
});
|
|
@@ -73,7 +71,7 @@ function $6bb0a0c563dff4bb$export$6c6d7a51fa9aa15d(props) {
|
|
|
73
71
|
}
|
|
74
72
|
}));
|
|
75
73
|
details_.addEventListener("toggle", (0, $cV3wj$catchify)(()=>{
|
|
76
|
-
const { open: open
|
|
74
|
+
const { open: open } = details_;
|
|
77
75
|
if (open !== (0, $cV3wj$untrack)(()=>props.is_open_[0]())) // diffing here since the two items in is_open might be setters and getters that aren't part of one signal like in CheckboxHierarchicalFilter
|
|
78
76
|
props.is_open_[1](open);
|
|
79
77
|
}) // in case someone somehow toggles it without us intercepting it at least follow suit
|
|
@@ -83,7 +81,7 @@ function $6bb0a0c563dff4bb$export$6c6d7a51fa9aa15d(props) {
|
|
|
83
81
|
toggle();
|
|
84
82
|
}));
|
|
85
83
|
summary_.addEventListener("keydown", (0, $cV3wj$catchify)((ev)=>{
|
|
86
|
-
const { key: key
|
|
84
|
+
const { key: key } = ev;
|
|
87
85
|
if (key === "Enter" || key === " ") {
|
|
88
86
|
ev.preventDefault();
|
|
89
87
|
toggle();
|
|
@@ -123,9 +121,6 @@ function $c16e74cfe125bb05$export$f091cbac892643a4(obj) {
|
|
|
123
121
|
|
|
124
122
|
|
|
125
123
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
124
|
function $8c0f86cb3e266eeb$export$a71e92cfbb498adc(props) {
|
|
130
125
|
return (0, $cV3wj$createMemo)(()=>{
|
|
131
126
|
const price_formatting = props.price_formatting_;
|
|
@@ -139,13 +134,6 @@ function $8c0f86cb3e266eeb$export$a71e92cfbb498adc(props) {
|
|
|
139
134
|
|
|
140
135
|
|
|
141
136
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
137
|
const $fbbadcb080ad1d4a$var$_tmpl$ = [
|
|
150
138
|
"<svg",
|
|
151
139
|
' xmlns="http://www.w3.org/2000/svg"',
|
|
@@ -161,7 +149,7 @@ const $f32e14878e75af51$var$_tmpl$ = [
|
|
|
161
149
|
">",
|
|
162
150
|
"</div>"
|
|
163
151
|
];
|
|
164
|
-
function $f32e14878e75af51$export$6649caad96ef8870({ children: children
|
|
152
|
+
function $f32e14878e75af51$export$6649caad96ef8870({ children: children, slider_ref_: slider_ref_, faded_opacity_: faded_opacity_ = 0.7, mutation_plugins_: mutation_plugins_ = [] }) {
|
|
165
153
|
const slider = new (0, $cV3wj$Amazing_Slider)({
|
|
166
154
|
button_contents: {
|
|
167
155
|
left: [
|
|
@@ -190,7 +178,6 @@ function $f32e14878e75af51$export$6649caad96ef8870({ children: children , slider
|
|
|
190
178
|
|
|
191
179
|
|
|
192
180
|
|
|
193
|
-
|
|
194
181
|
const $19976a74d273070d$var$_tmpl$ = '<path d="M11.669 10.531l9.156-9.156a.78.78 0 0 0 .237-.569c0-.221-.079-.412-.237-.569A.8.8 0 0 0 20.24 0a.77.77 0 0 0-.569.237l-9.14 9.14-9.14-9.14A.79.79 0 0 0 .807 0a.77.77 0 0 0-.569.237A.78.78 0 0 0 0 .807a.77.77 0 0 0 .237.569l9.156 9.156-9.156 9.14c-.159.157-.237.349-.237.569s.079.412.237.569c.085.085.174.148.268.19a1.095 1.095 0 0 0 .316.048.894.894 0 0 0 .285-.048.84.84 0 0 0 .285-.19l9.139-9.14 9.14 9.14a.894.894 0 0 0 .268.19 1.049 1.049 0 0 0 .301.048.941.941 0 0 0 .301-.048.84.84 0 0 0 .285-.19.78.78 0 0 0 .237-.569c0-.221-.079-.412-.237-.569z"></path>';
|
|
195
182
|
function $19976a74d273070d$export$3b621d86b1566b2(props = {}) {
|
|
196
183
|
return (0, $cV3wj$ssrElement)("svg", ()=>({
|
|
@@ -228,10 +215,10 @@ const $1adfe60f3a14a1d7$var$_tmpl$ = [
|
|
|
228
215
|
"<!--/--><span>",
|
|
229
216
|
"</span></button>"
|
|
230
217
|
];
|
|
231
|
-
function $1adfe60f3a14a1d7$export$fecbb157621501bd({ number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_
|
|
232
|
-
const { price_formatting_: price_formatting_
|
|
218
|
+
function $1adfe60f3a14a1d7$export$fecbb157621501bd({ number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_, i18n_: i18n_, selected_filters_: selected_filters_, local_filter_cache_: [read_local_filter_cache], get_search_filters_open_: get_search_filters_open_, get_search_sorting_open_: get_search_sorting_open_, local_filter_cache_: local_filter_cache_, expanded_hierarchical_filters_: expanded_hierarchical_filters_ }) {
|
|
219
|
+
const { price_formatting_: price_formatting_ } = i18n_;
|
|
233
220
|
const [read_selected_filters, write_selected_filters] = selected_filters_;
|
|
234
|
-
const { collapse: collapse
|
|
221
|
+
const { collapse: collapse, expand: expand, ExpandingContainer: ExpandingContainer } = (0, $24e27fab9c821b86$export$5bad61ecde080b1f)({
|
|
235
222
|
duration: 200
|
|
236
223
|
});
|
|
237
224
|
const owner = (0, $cV3wj$getOwner)();
|
|
@@ -255,7 +242,7 @@ function $1adfe60f3a14a1d7$export$fecbb157621501bd({ number_of_rendered_selected
|
|
|
255
242
|
const matching_filter = (0, $cV3wj$createMemo)(()=>read_local_filter_cache().find((hay)=>hay.field === filter().field && hay.op === filter().op));
|
|
256
243
|
const meta = (0, $cV3wj$createMemo)(()=>matching_filter()?.meta);
|
|
257
244
|
const iterable_selected_filter_data = (0, $cV3wj$createMemo)(()=>{
|
|
258
|
-
const { data: data
|
|
245
|
+
const { data: data } = filter();
|
|
259
246
|
if (Array.isArray(data)) return data;
|
|
260
247
|
else return [
|
|
261
248
|
data
|
|
@@ -264,7 +251,7 @@ function $1adfe60f3a14a1d7$export$fecbb157621501bd({ number_of_rendered_selected
|
|
|
264
251
|
const data_structure_if_hierarchical = (0, $cV3wj$createMemo)(()=>{
|
|
265
252
|
const m = meta();
|
|
266
253
|
if (m?.type !== "checkbox-hierarchical") return;
|
|
267
|
-
const { values: values
|
|
254
|
+
const { values: values } = m;
|
|
268
255
|
const data_structure = {};
|
|
269
256
|
for(let i = 0; i < values.length; i++){
|
|
270
257
|
const value = values[i];
|
|
@@ -369,7 +356,7 @@ function $1adfe60f3a14a1d7$export$fecbb157621501bd({ number_of_rendered_selected
|
|
|
369
356
|
if (siblings) return [
|
|
370
357
|
parent,
|
|
371
358
|
...Object.values(siblings)
|
|
372
|
-
].every(({ value_: value_
|
|
359
|
+
].every(({ value_: value_ })=>iterable_selected_filter_data()?.some((v)=>Array.isArray(v) && v.length === value_.length && value_.every((val, index)=>v[index] === val)));
|
|
373
360
|
return false;
|
|
374
361
|
});
|
|
375
362
|
return (0, $cV3wj$createComponent)((0, $cV3wj$Show), {
|
|
@@ -423,16 +410,6 @@ function $1adfe60f3a14a1d7$export$fecbb157621501bd({ number_of_rendered_selected
|
|
|
423
410
|
|
|
424
411
|
|
|
425
412
|
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
413
|
const $87c712b5b33f24f7$var$_tmpl$ = [
|
|
437
414
|
"<span",
|
|
438
415
|
' class="count">',
|
|
@@ -469,10 +446,6 @@ const $87c712b5b33f24f7$export$48513f6b9f8ce62d = (props)=>{
|
|
|
469
446
|
|
|
470
447
|
|
|
471
448
|
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
449
|
const $f8a56ba74eedd0c6$var$_tmpl$ = '<path d="M10.173 5.548H5.5V.875c0-.075-.027-.14-.081-.193S5.301.601 5.226.601s-.14.027-.193.081-.081.118-.081.193v4.673H.274c-.075 0-.14.027-.193.081A.27.27 0 0 0 0 5.827c0 .075.027.14.081.193s.118.081.193.081h4.678v4.673c0 .075.027.14.081.193s.118.081.193.081.14-.027.193-.081.081-.118.081-.193V6.101h4.673a.27.27 0 0 0 .199-.081c.054-.054.08-.118.08-.193a.27.27 0 0 0-.279-.279z" fill="#000"></path>';
|
|
477
450
|
function $f8a56ba74eedd0c6$export$f21ab0717a89c77f(props) {
|
|
478
451
|
return (0, $cV3wj$ssrElement)("svg", ()=>({
|
|
@@ -491,7 +464,7 @@ const $67b173f9db427028$var$_tmpl$ = [
|
|
|
491
464
|
"<!--/--><span>",
|
|
492
465
|
"</span></button>"
|
|
493
466
|
];
|
|
494
|
-
function $67b173f9db427028$export$ca21a16d65b3dd8({ show_extras_: [get_show_extras, set_show_extras]
|
|
467
|
+
function $67b173f9db427028$export$ca21a16d65b3dd8({ show_extras_: [get_show_extras, set_show_extras], i18n_: i18n_ }) {
|
|
495
468
|
return (0, $cV3wj$ssr)($67b173f9db427028$var$_tmpl$, (0, $cV3wj$ssrHydrationKey)(), `expand-filter ${get_show_extras() ? "expanded" : ""}`, (0, $cV3wj$escape)((0, $cV3wj$createComponent)((0, $f8a56ba74eedd0c6$export$f21ab0717a89c77f), {})), get_show_extras() ? (0, $cV3wj$escape)(i18n_.view_less_()) : (0, $cV3wj$escape)(i18n_.view_more_()));
|
|
496
469
|
}
|
|
497
470
|
|
|
@@ -504,10 +477,10 @@ const $a4601e6bea3ed1e6$var$_tmpl$ = [
|
|
|
504
477
|
];
|
|
505
478
|
const $a4601e6bea3ed1e6$var$max_visible_without_collapsing = 7;
|
|
506
479
|
const $a4601e6bea3ed1e6$var$show_non_collapsible_when_collapsed = 4;
|
|
507
|
-
function $a4601e6bea3ed1e6$export$dd948f91abc3a1c4({ filter_: filter_
|
|
480
|
+
function $a4601e6bea3ed1e6$export$dd948f91abc3a1c4({ filter_: filter_, selected_filters_: [get_selected_filters, set_selected_filters], i18n_: i18n_, view_more_button_below_group_: [, set_view_more_button_below_group_] }) {
|
|
508
481
|
const existing_filter = (0, $cV3wj$createMemo)(()=>{
|
|
509
|
-
const { field: field
|
|
510
|
-
return get_selected_filters().find(({ field: checking_field
|
|
482
|
+
const { field: field, op: op } = filter_();
|
|
483
|
+
return get_selected_filters().find(({ field: checking_field, op: checking_op })=>checking_field === field && checking_op === op);
|
|
511
484
|
});
|
|
512
485
|
let form;
|
|
513
486
|
const checkboxes = (0, $cV3wj$createMemo)(()=>{
|
|
@@ -538,7 +511,7 @@ function $a4601e6bea3ed1e6$export$dd948f91abc3a1c4({ filter_: filter_ , selected
|
|
|
538
511
|
const show_extras_signal = (0, $cV3wj$createSignal)(false);
|
|
539
512
|
const [get_show_extras] = show_extras_signal;
|
|
540
513
|
const togglable_rest = (0, $cV3wj$createMemo)(()=>checkboxes().length > $a4601e6bea3ed1e6$var$max_visible_without_collapsing);
|
|
541
|
-
const { expand: expand
|
|
514
|
+
const { expand: expand, collapse: collapse, ExpandingContainer: ExpandingContainer } = (0, $24e27fab9c821b86$export$5bad61ecde080b1f)({
|
|
542
515
|
duration: 200
|
|
543
516
|
});
|
|
544
517
|
const expanding_container_els = (0, $cV3wj$createComponent)(ExpandingContainer, {
|
|
@@ -584,10 +557,6 @@ function $a4601e6bea3ed1e6$export$dd948f91abc3a1c4({ filter_: filter_ , selected
|
|
|
584
557
|
|
|
585
558
|
|
|
586
559
|
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
560
|
const $eb8d9bf3b5700c26$var$_tmpl$ = [
|
|
592
561
|
"<form",
|
|
593
562
|
' class="radios">',
|
|
@@ -606,11 +575,11 @@ const $eb8d9bf3b5700c26$var$_tmpl$ = [
|
|
|
606
575
|
"<!--/--></div><!--#-->",
|
|
607
576
|
"<!--/--></label>"
|
|
608
577
|
];
|
|
609
|
-
function $eb8d9bf3b5700c26$export$430444115f70a734({ selected_filters_: selected_filters_
|
|
578
|
+
function $eb8d9bf3b5700c26$export$430444115f70a734({ selected_filters_: selected_filters_, filter_: filter_ }) {
|
|
610
579
|
const radio_name = (0, $cV3wj$make_random_classname)();
|
|
611
580
|
const existing_filter = (0, $cV3wj$createMemo)(()=>{
|
|
612
|
-
const { op: op
|
|
613
|
-
return selected_filters_[0]().find(({ field: checking_field
|
|
581
|
+
const { op: op, field: field } = filter_();
|
|
582
|
+
return selected_filters_[0]().find(({ field: checking_field, op: checking_op })=>checking_field === field && checking_op === op);
|
|
614
583
|
});
|
|
615
584
|
return (0, $cV3wj$ssr)($eb8d9bf3b5700c26$var$_tmpl$, (0, $cV3wj$ssrHydrationKey)(), (0, $cV3wj$escape)((0, $cV3wj$createComponent)((0, $cV3wj$Index), {
|
|
616
585
|
get each () {
|
|
@@ -646,11 +615,6 @@ function $eb8d9bf3b5700c26$export$430444115f70a734({ selected_filters_: selected
|
|
|
646
615
|
|
|
647
616
|
|
|
648
617
|
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
618
|
const $a6b08770e164eced$var$_tmpl$ = [
|
|
655
619
|
"<div",
|
|
656
620
|
' class="range"><div class="input-group"><div class="field"><input type="number"',
|
|
@@ -675,9 +639,9 @@ const $a6b08770e164eced$var$_tmpl$ = [
|
|
|
675
639
|
' type="range"',
|
|
676
640
|
' step="any"></div>'
|
|
677
641
|
];
|
|
678
|
-
function $a6b08770e164eced$export$e0d834a0ad870cda({ filter_: filter_
|
|
642
|
+
function $a6b08770e164eced$export$e0d834a0ad870cda({ filter_: filter_, selected_filters_: selected_filters_, i18n_: i18n_ }) {
|
|
679
643
|
const current_range = (0, $cV3wj$createSignal)((0, $cV3wj$untrack)(()=>filter_().data));
|
|
680
|
-
const selected_filter = (0, $cV3wj$createMemo)(()=>selected_filters_[0]().find(({ field: checking_field
|
|
644
|
+
const selected_filter = (0, $cV3wj$createMemo)(()=>selected_filters_[0]().find(({ field: checking_field, op: checking_op })=>checking_field === filter_().field && checking_op === filter_().op));
|
|
681
645
|
let debounce_timeout;
|
|
682
646
|
(0, $cV3wj$onCleanup)(()=>clearTimeout(debounce_timeout));
|
|
683
647
|
(0, $cV3wj$createComputed)(()=>{
|
|
@@ -728,7 +692,7 @@ function $a6b08770e164eced$export$e0d834a0ad870cda({ filter_: filter_ , selected
|
|
|
728
692
|
}
|
|
729
693
|
});
|
|
730
694
|
}
|
|
731
|
-
function $a6b08770e164eced$var$RangeSelector({ max_: max_
|
|
695
|
+
function $a6b08770e164eced$var$RangeSelector({ max_: max_, min_: min_, current_range_: current_range_, price_formatting_: price_formatting_, i18n_: i18n_ }) {
|
|
732
696
|
let price_input_1;
|
|
733
697
|
let price_input_2;
|
|
734
698
|
const [get_current_range] = current_range_;
|
|
@@ -755,7 +719,7 @@ function $a6b08770e164eced$var$RangeSelector({ max_: max_ , min_: min_ , current
|
|
|
755
719
|
}
|
|
756
720
|
})), (0, $cV3wj$escape)(post_price()));
|
|
757
721
|
}
|
|
758
|
-
function $a6b08770e164eced$var$ExponentialSlider({ current_range_: current_range_
|
|
722
|
+
function $a6b08770e164eced$var$ExponentialSlider({ current_range_: current_range_, min_: min_, i18n_: i18n_, max_: max_ }) {
|
|
759
723
|
// inspired by https://observablehq.com/@mbostock/nonlinear-slider
|
|
760
724
|
const transform_linear_to_nonlinear = ([smaller, larger])=>[
|
|
761
725
|
Math.sqrt(smaller),
|
|
@@ -793,7 +757,7 @@ function $a6b08770e164eced$var$ExponentialSlider({ current_range_: current_range
|
|
|
793
757
|
i18n_: i18n_
|
|
794
758
|
});
|
|
795
759
|
}
|
|
796
|
-
function $a6b08770e164eced$var$LinearSlider({ max_: max_
|
|
760
|
+
function $a6b08770e164eced$var$LinearSlider({ max_: max_, min_: min_, current_range_: current_range_, offset_value_calculator_: offset_value_calculator_, i18n_: i18n_ }) {
|
|
797
761
|
let range_input_1;
|
|
798
762
|
let range_input_2;
|
|
799
763
|
let clickable_slider;
|
|
@@ -849,18 +813,12 @@ function $a6b08770e164eced$var$set_range_with_sanitation(min_, max_, current_ran
|
|
|
849
813
|
|
|
850
814
|
|
|
851
815
|
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
816
|
const $0b6bc2f8309efa8a$var$_tmpl$ = [
|
|
859
817
|
"<div",
|
|
860
818
|
' class="morphing-sign" role="img"',
|
|
861
819
|
"><span></span><span></span></div>"
|
|
862
820
|
];
|
|
863
|
-
function $0b6bc2f8309efa8a$export$e5c2828934226505({ expanded_: expanded_
|
|
821
|
+
function $0b6bc2f8309efa8a$export$e5c2828934226505({ expanded_: expanded_, i18n_: i18n_ }) {
|
|
864
822
|
let first_span;
|
|
865
823
|
let second_span;
|
|
866
824
|
const animation_options = {
|
|
@@ -924,11 +882,11 @@ const $1c8cac76cb67e9af$var$_tmpl$ = [
|
|
|
924
882
|
];
|
|
925
883
|
const $1c8cac76cb67e9af$var$max_visible_without_collapsing = 7;
|
|
926
884
|
const $1c8cac76cb67e9af$var$show_non_collapsible_when_collapsed = 4;
|
|
927
|
-
function $1c8cac76cb67e9af$export$a32086fa6616eafd({ filter_: filter_
|
|
885
|
+
function $1c8cac76cb67e9af$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_ }) {
|
|
928
886
|
let form;
|
|
929
887
|
const existing_filter = (0, $cV3wj$createMemo)(()=>{
|
|
930
|
-
const { field: field
|
|
931
|
-
return selected_filters_[0]().find(({ field: checking_field
|
|
888
|
+
const { field: field, op: op } = filter_();
|
|
889
|
+
return selected_filters_[0]().find(({ field: checking_field, op: checking_op })=>checking_field === field && checking_op === op);
|
|
932
890
|
});
|
|
933
891
|
const show_extras = (0, $cV3wj$createSignal)(false);
|
|
934
892
|
const trigger_sync_ = $1c8cac76cb67e9af$var$batching_filter_state_syncer({
|
|
@@ -941,7 +899,7 @@ function $1c8cac76cb67e9af$export$a32086fa6616eafd({ filter_: filter_ , selected
|
|
|
941
899
|
});
|
|
942
900
|
const structured_categories = (0, $cV3wj$createMemo)(()=>{
|
|
943
901
|
const execute_when_structure_finished = [];
|
|
944
|
-
const { values: values
|
|
902
|
+
const { values: values, names: names, counts: counts } = filter_().meta;
|
|
945
903
|
const data_structure = {};
|
|
946
904
|
for(let i = 0; i < values.length; i++){
|
|
947
905
|
const value = values[i];
|
|
@@ -963,7 +921,7 @@ function $1c8cac76cb67e9af$export$a32086fa6616eafd({ filter_: filter_ , selected
|
|
|
963
921
|
value_: value_as_string,
|
|
964
922
|
children_: {}
|
|
965
923
|
};
|
|
966
|
-
const { signal_: signal_
|
|
924
|
+
const { signal_: signal_, on_structure_complete_: on_structure_complete_ } = $1c8cac76cb67e9af$var$create_updating_signal({
|
|
967
925
|
self_: created_obj,
|
|
968
926
|
existing_filter_: (0, $cV3wj$untrack)(existing_filter),
|
|
969
927
|
trigger_sync_: trigger_sync_
|
|
@@ -1006,7 +964,7 @@ function $1c8cac76cb67e9af$export$a32086fa6616eafd({ filter_: filter_ , selected
|
|
|
1006
964
|
return data_structure;
|
|
1007
965
|
});
|
|
1008
966
|
const some_top_level_are_hidden = (0, $cV3wj$createMemo)(()=>Object.keys(structured_categories()).length > $1c8cac76cb67e9af$var$max_visible_without_collapsing);
|
|
1009
|
-
const { expand: expand
|
|
967
|
+
const { expand: expand, collapse: collapse, ExpandingContainer: ExpandingContainer } = (0, $24e27fab9c821b86$export$5bad61ecde080b1f)({
|
|
1010
968
|
duration: 200
|
|
1011
969
|
});
|
|
1012
970
|
const expanding_container_els = (0, $cV3wj$createComponent)(ExpandingContainer, {
|
|
@@ -1070,7 +1028,7 @@ function $1c8cac76cb67e9af$var$render_stuff(data, existing_filter, i18n_) {
|
|
|
1070
1028
|
},
|
|
1071
1029
|
input_ref_: (input)=>{
|
|
1072
1030
|
input.addEventListener("change", (0, $cV3wj$catchify)(()=>(0, $cV3wj$untrack)(()=>{
|
|
1073
|
-
const { checked: checked
|
|
1031
|
+
const { checked: checked } = input;
|
|
1074
1032
|
if (checked) value()?.is_expanded_.set_user_expanded_(true);
|
|
1075
1033
|
value()?.is_checked_[1](checked);
|
|
1076
1034
|
})));
|
|
@@ -1111,7 +1069,7 @@ function $1c8cac76cb67e9af$var$render_stuff(data, existing_filter, i18n_) {
|
|
|
1111
1069
|
const v = value();
|
|
1112
1070
|
if (!v) // only to prevent cleanup errors
|
|
1113
1071
|
return (0, $cV3wj$createSignal)(false);
|
|
1114
|
-
const { is_expanded_: { ui_should_show_expanded_: ui_should_show_expanded_
|
|
1072
|
+
const { is_expanded_: { ui_should_show_expanded_: ui_should_show_expanded_, set_user_expanded_: set_user_expanded_ } } = v;
|
|
1115
1073
|
return [
|
|
1116
1074
|
ui_should_show_expanded_,
|
|
1117
1075
|
set_user_expanded_
|
|
@@ -1130,13 +1088,13 @@ function $1c8cac76cb67e9af$var$render_stuff(data, existing_filter, i18n_) {
|
|
|
1130
1088
|
});
|
|
1131
1089
|
}
|
|
1132
1090
|
function $1c8cac76cb67e9af$var$batching_filter_state_syncer(props) {
|
|
1133
|
-
const { filter_: filter_
|
|
1091
|
+
const { filter_: filter_, selected_filters_: selected_filters_, existing_filter_: existing_filter_ } = props;
|
|
1134
1092
|
let sync_queued = false;
|
|
1135
1093
|
const sync_fn = (0, $cV3wj$catchify)(async ()=>{
|
|
1136
1094
|
sync_queued = false;
|
|
1137
1095
|
// if we change, update filter state - next microtask, so that "reactions" to the change can process before we send it off to the API
|
|
1138
1096
|
const set_filter = existing_filter_();
|
|
1139
|
-
const { field: field
|
|
1097
|
+
const { field: field, op: op } = filter_();
|
|
1140
1098
|
const base_object = set_filter ? set_filter : {
|
|
1141
1099
|
op: op,
|
|
1142
1100
|
field: field
|
|
@@ -1169,7 +1127,7 @@ function $1c8cac76cb67e9af$var$batching_filter_state_syncer(props) {
|
|
|
1169
1127
|
};
|
|
1170
1128
|
return trigger_sync;
|
|
1171
1129
|
}
|
|
1172
|
-
function $1c8cac76cb67e9af$var$create_updating_signal({ self_: self_
|
|
1130
|
+
function $1c8cac76cb67e9af$var$create_updating_signal({ self_: self_, existing_filter_: existing_filter_, trigger_sync_: trigger_sync_ }) {
|
|
1173
1131
|
const signal_ = [];
|
|
1174
1132
|
const on_structure_complete_ = ()=>{
|
|
1175
1133
|
// wait for the children to have populated and us to have received the correct value_ and name_ values
|
|
@@ -1178,7 +1136,7 @@ function $1c8cac76cb67e9af$var$create_updating_signal({ self_: self_ , existing_
|
|
|
1178
1136
|
signal_.push(...(0, $cV3wj$createSignal)(index_of_us_in_selected_filter >= 0 ? true : false));
|
|
1179
1137
|
const [read_checked, write_checked] = signal_;
|
|
1180
1138
|
const child_objects = Object.values(self_.children_);
|
|
1181
|
-
const get_child_object_values = child_objects.map(({ is_checked_: [read_is_checked]
|
|
1139
|
+
const get_child_object_values = child_objects.map(({ is_checked_: [read_is_checked] })=>read_is_checked);
|
|
1182
1140
|
(0, $cV3wj$createComputed)((0, $cV3wj$on)(read_checked, trigger_sync_, {
|
|
1183
1141
|
defer: true
|
|
1184
1142
|
}));
|
|
@@ -1213,8 +1171,8 @@ function $1c8cac76cb67e9af$var$create_updating_signal({ self_: self_ , existing_
|
|
|
1213
1171
|
on_structure_complete_: on_structure_complete_
|
|
1214
1172
|
};
|
|
1215
1173
|
}
|
|
1216
|
-
function $1c8cac76cb67e9af$var$make_expanded_signal({ expanded_hierarchical_filters_: [read_expanded_hierarchical_filters, write_expanded_hierarchical_filters]
|
|
1217
|
-
const index_in_expanded_filters = (0, $cV3wj$createMemo)(()=>read_expanded_hierarchical_filters().findIndex(({ value_: value_
|
|
1174
|
+
function $1c8cac76cb67e9af$var$make_expanded_signal({ expanded_hierarchical_filters_: [read_expanded_hierarchical_filters, write_expanded_hierarchical_filters], filter_value_: filter_value_ }) {
|
|
1175
|
+
const index_in_expanded_filters = (0, $cV3wj$createMemo)(()=>read_expanded_hierarchical_filters().findIndex(({ value_: value_ })=>value_.length === filter_value_.length && value_.every((item, index)=>filter_value_[index] === item)), undefined, {
|
|
1218
1176
|
equals: false
|
|
1219
1177
|
} // we always want this to update so that we can make updates of the object on this index depend on this memo
|
|
1220
1178
|
);
|
|
@@ -1278,9 +1236,6 @@ function $1c8cac76cb67e9af$var$expand_until_choice(data_structure) {
|
|
|
1278
1236
|
|
|
1279
1237
|
|
|
1280
1238
|
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
1239
|
const $93716a9ad0dea854$var$_tmpl$ = [
|
|
1285
1240
|
"<div",
|
|
1286
1241
|
' class="checkbox-grid">',
|
|
@@ -1291,10 +1246,10 @@ const $93716a9ad0dea854$var$_tmpl$ = [
|
|
|
1291
1246
|
'">',
|
|
1292
1247
|
"</button>"
|
|
1293
1248
|
];
|
|
1294
|
-
const $93716a9ad0dea854$export$414f6a19d38e655c = ({ filter_: filter_
|
|
1249
|
+
const $93716a9ad0dea854$export$414f6a19d38e655c = ({ filter_: filter_, selected_filters_: [get_selected_filters, set_selected_filters] })=>{
|
|
1295
1250
|
const existing_filter = (0, $cV3wj$createMemo)(()=>{
|
|
1296
|
-
const { field: field
|
|
1297
|
-
return get_selected_filters().find(({ field: checking_field
|
|
1251
|
+
const { field: field, op: op } = filter_();
|
|
1252
|
+
return get_selected_filters().find(({ field: checking_field, op: checking_op })=>checking_field === field && checking_op === op);
|
|
1298
1253
|
});
|
|
1299
1254
|
const buttons = (0, $cV3wj$createMemo)(()=>{
|
|
1300
1255
|
const meta = filter_().meta;
|
|
@@ -1324,12 +1279,9 @@ const $93716a9ad0dea854$export$414f6a19d38e655c = ({ filter_: filter_ , selected
|
|
|
1324
1279
|
|
|
1325
1280
|
|
|
1326
1281
|
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
1282
|
function $dc9262ef6f786812$export$d9f36cf74e24d595(media_query) {
|
|
1331
1283
|
const signal = (0, $cV3wj$createSignal)(false);
|
|
1332
|
-
(0, $cV3wj$onCleanup)((0, $cV3wj$javascript_media_query)(media_query, ({ matches: matches
|
|
1284
|
+
(0, $cV3wj$onCleanup)((0, $cV3wj$javascript_media_query)(media_query, ({ matches: matches })=>signal[1](matches)).remove);
|
|
1333
1285
|
return signal[0];
|
|
1334
1286
|
}
|
|
1335
1287
|
|
|
@@ -1342,27 +1294,29 @@ const $e731d52d97444b7c$var$_tmpl$ = [
|
|
|
1342
1294
|
];
|
|
1343
1295
|
const $e731d52d97444b7c$var$max_visible_without_collapsing = 14;
|
|
1344
1296
|
const $e731d52d97444b7c$var$show_non_collapsible_when_collapsed = 8;
|
|
1345
|
-
function $e731d52d97444b7c$export$82ed4b28ecb67608({ filter_: filter_
|
|
1297
|
+
function $e731d52d97444b7c$export$82ed4b28ecb67608({ filter_: filter_, selected_filters_: [get_selected_filters, set_selected_filters], i18n_: i18n_, view_more_button_below_group_: [_get_view_more_button_below_group_, set_view_more_button_below_group_] }) {
|
|
1346
1298
|
const supports_hover = (0, $dc9262ef6f786812$export$d9f36cf74e24d595)("not all and (hover: none)");
|
|
1347
1299
|
// same as in CheckboxFilter, maybe we should make this DRY at some point
|
|
1348
1300
|
const existing_filter = (0, $cV3wj$createMemo)(()=>{
|
|
1349
|
-
const { field: field
|
|
1350
|
-
return get_selected_filters().find(({ field: checking_field
|
|
1301
|
+
const { field: field, op: op } = filter_();
|
|
1302
|
+
return get_selected_filters().find(({ field: checking_field, op: checking_op })=>checking_field === field && checking_op === op);
|
|
1351
1303
|
});
|
|
1352
1304
|
let form;
|
|
1353
1305
|
const checkboxes = (0, $cV3wj$createMemo)(()=>{
|
|
1354
1306
|
const meta = filter_().meta;
|
|
1355
|
-
return meta.values.map((value_, index)
|
|
1356
|
-
|
|
1307
|
+
return meta.values.map((value_, index)=>{
|
|
1308
|
+
return {
|
|
1357
1309
|
value_: value_,
|
|
1358
1310
|
name_: meta.names?.[index],
|
|
1359
|
-
count_: meta.counts?.[index]
|
|
1360
|
-
|
|
1361
|
-
|
|
1311
|
+
count_: meta.counts?.[index]
|
|
1312
|
+
};
|
|
1313
|
+
});
|
|
1362
1314
|
});
|
|
1363
1315
|
const render_checkbox = (checkbox)=>{
|
|
1364
|
-
|
|
1365
|
-
const
|
|
1316
|
+
const color_name = (0, $cV3wj$createMemo)(()=>checkbox().value_.split(";")?.[0] || "");
|
|
1317
|
+
const hex_color = (0, $cV3wj$createMemo)(()=>checkbox().value_.split(";")?.[1] || "");
|
|
1318
|
+
const rgb_color = (0, $cV3wj$createMemo)(()=>(0, $cV3wj$hex_to_rgb)(hex_color()));
|
|
1319
|
+
const black_contrast_better = (0, $cV3wj$createMemo)(()=>rgb_color() ? $e731d52d97444b7c$var$does_black_contrast_better(rgb_color()) : true);
|
|
1366
1320
|
const input_row = (0, $cV3wj$createComponent)((0, $87c712b5b33f24f7$export$48513f6b9f8ce62d), {
|
|
1367
1321
|
get value_ () {
|
|
1368
1322
|
return checkbox().value_;
|
|
@@ -1377,51 +1331,22 @@ function $e731d52d97444b7c$export$82ed4b28ecb67608({ filter_: filter_ , selected
|
|
|
1377
1331
|
return existing_filter()?.data?.includes(checkbox().value_);
|
|
1378
1332
|
},
|
|
1379
1333
|
custom_indicator_ref: (span)=>{
|
|
1380
|
-
const { classList: classList
|
|
1381
|
-
// create some memos for diffing
|
|
1382
|
-
const hue = (0, $cV3wj$createMemo)(()=>checkbox().color_[0]);
|
|
1383
|
-
const saturation = (0, $cV3wj$createMemo)(()=>checkbox().color_[1]);
|
|
1384
|
-
const lightness = (0, $cV3wj$createMemo)(()=>checkbox().color_[2]);
|
|
1385
|
-
const special_type = (0, $cV3wj$createMemo)(()=>checkbox().color_[3]);
|
|
1334
|
+
const { classList: classList, style: style } = span;
|
|
1386
1335
|
classList.add("color");
|
|
1387
1336
|
(0, $cV3wj$createComputed)(()=>{
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
// to generate darkened gradient, this was used:
|
|
1392
|
-
// $change: -5%;
|
|
1393
|
-
// background: linear-gradient(
|
|
1394
|
-
// 180deg,
|
|
1395
|
-
// color.adjust(#ff0000, $lightness: $change) 0%,
|
|
1396
|
-
// color.adjust(#ff6e00, $lightness: $change) 17.71%,
|
|
1397
|
-
// color.adjust(#ffff00, $lightness: $change) 33.33%,
|
|
1398
|
-
// color.adjust(#1eb41e, $lightness: $change) 50.52%,
|
|
1399
|
-
// color.adjust(#00d2ff, $lightness: $change) 67.71%,
|
|
1400
|
-
// color.adjust(#3737c8, $lightness: $change) 83.85%,
|
|
1401
|
-
// color.adjust(#d200ff, $lightness: $change) 100%
|
|
1402
|
-
// );
|
|
1403
|
-
classList.toggle("check-multi", true);
|
|
1404
|
-
style.backgroundImage = is_hovered ? `linear-gradient(#e60000 0%, #e66300 17.71%, #e6e600 33.33%, #1a9e1a 50.52%, #00bde6 67.71%, #3232b4 83.85%, #bd00e6 100%)` : `linear-gradient(180deg, #FF0000 0%, #FF6E00 17.71%, #FFFF00 33.33%, #1EB41E 50.52%, #00D2FF 67.71%, #3737C8 83.85%, #D200FF 100%)`;
|
|
1405
|
-
} else {
|
|
1406
|
-
const is_light = lightness() > 50;
|
|
1407
|
-
// lighten or darken (+/- 10) depending on it's over or under 50 lightness
|
|
1408
|
-
// lighten under 25 lightness by 20
|
|
1409
|
-
const target_lightness = is_hovered ? is_light ? lightness() - 10 : lightness() < 25 ? lightness() + 20 : lightness() + 10 : lightness();
|
|
1410
|
-
classList.toggle("check-dark", $e731d52d97444b7c$var$black_contrast_better(hue(), saturation(), lightness())); // Decide between black/white checkmark based on which one has better contrast according to WCAG contrast guidelines
|
|
1411
|
-
style.backgroundColor = `hsl(${hue()}, ${saturation()}%, ${target_lightness}%)`;
|
|
1412
|
-
}
|
|
1337
|
+
style.background = hex_color();
|
|
1338
|
+
span.dataset.colorName = color_name();
|
|
1339
|
+
classList.toggle("black-check", black_contrast_better());
|
|
1413
1340
|
});
|
|
1414
1341
|
}
|
|
1415
1342
|
});
|
|
1416
|
-
input_row.addEventListener("mouseover", (0, $cV3wj$catchify)(()=>set_is_hovered(true)));
|
|
1417
|
-
input_row.addEventListener("mouseout", (0, $cV3wj$catchify)(()=>set_is_hovered(false)));
|
|
1418
1343
|
return input_row;
|
|
1419
1344
|
};
|
|
1420
1345
|
const show_extras_signal = (0, $cV3wj$createSignal)(false);
|
|
1421
1346
|
const [get_show_extras] = show_extras_signal;
|
|
1422
1347
|
const togglable_rest = (0, $cV3wj$createMemo)(()=>checkboxes().length > $e731d52d97444b7c$var$max_visible_without_collapsing);
|
|
1423
1348
|
const expand_animation_duration = 200;
|
|
1424
|
-
const { expand: expand
|
|
1349
|
+
const { expand: expand, collapse: collapse, ExpandingContainer: ExpandingContainer } = (0, $24e27fab9c821b86$export$5bad61ecde080b1f)({
|
|
1425
1350
|
duration: expand_animation_duration
|
|
1426
1351
|
});
|
|
1427
1352
|
const [get_having_expanding_in_dom, set_having_expanding_in_dom] = (0, $cV3wj$createSignal)((0, $cV3wj$untrack)(togglable_rest)); // We need to remove the expanding els from the DOM if they're empty, otherwise the flexbox makes a weird gap to the right of the last item sometimes
|
|
@@ -1477,9 +1402,9 @@ function $e731d52d97444b7c$export$82ed4b28ecb67608({ filter_: filter_ , selected
|
|
|
1477
1402
|
children: expanding_container_els
|
|
1478
1403
|
})));
|
|
1479
1404
|
}
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
const luminance_color = (0, $cV3wj$relative_luminance_from_rgb)(...
|
|
1405
|
+
// Daniel's magic https://gitlab.com/depict-ai/depict.ai/-/merge_requests/7648#note_1468373350
|
|
1406
|
+
function $e731d52d97444b7c$var$does_black_contrast_better(rgb) {
|
|
1407
|
+
const luminance_color = (0, $cV3wj$relative_luminance_from_rgb)(...rgb);
|
|
1483
1408
|
const luminance_white = 1;
|
|
1484
1409
|
const luminance_black = 0;
|
|
1485
1410
|
const contrast_ratio_if_white = (luminance_white + 0.05) / (luminance_color + 0.05);
|
|
@@ -1504,10 +1429,6 @@ var $12497d09ef87296e$export$2e2bcd8739ae039 = {
|
|
|
1504
1429
|
|
|
1505
1430
|
|
|
1506
1431
|
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
1432
|
const $9bc34983fc5f7bdb$var$_tmpl$ = '<path d="M4.617 12.738a.48.48 0 0 1-.164-.027c-.051-.023-.094-.055-.129-.098L.125 8.414A.39.39 0 0 1 0 8.117c0-.113.039-.211.125-.293s.18-.125.293-.125.215.043.297.125l3.902 3.902L16.086.262c.082-.082.18-.125.297-.125s.211.043.293.125.125.184.125.301-.043.215-.125.297L4.914 12.613c-.039.043-.086.078-.141.098s-.102.027-.156.027zm0 0"></path>';
|
|
1512
1433
|
function $9bc34983fc5f7bdb$export$f2ca6fc699ca1fb4(props = {}) {
|
|
1513
1434
|
return (0, $cV3wj$ssrElement)("svg", ()=>({
|
|
@@ -1525,17 +1446,17 @@ const $a7b58cb3bcffd156$var$_tmpl$ = [
|
|
|
1525
1446
|
"</span><!--#-->",
|
|
1526
1447
|
"<!--/--></span>"
|
|
1527
1448
|
];
|
|
1528
|
-
function $a7b58cb3bcffd156$export$53c59af873b303c9({ selected_filters_in_group_: selected_filters_in_group_
|
|
1449
|
+
function $a7b58cb3bcffd156$export$53c59af873b303c9({ selected_filters_in_group_: selected_filters_in_group_, i18n_: { price_formatting_: price_formatting_ } }) {
|
|
1529
1450
|
const [show_tick_icon, set_show_tick_icon] = (0, $cV3wj$createSignal)(false);
|
|
1530
1451
|
const text = (0, $cV3wj$createMemo)(()=>(0, $cV3wj$batch)(()=>{
|
|
1531
1452
|
set_show_tick_icon(false);
|
|
1532
|
-
let { size: size
|
|
1453
|
+
let { size: size } = selected_filters_in_group_();
|
|
1533
1454
|
try_specific: {
|
|
1534
1455
|
if (size > 1) break try_specific;
|
|
1535
1456
|
for (const [selected_filter, filter_data] of selected_filters_in_group_()){
|
|
1536
1457
|
// we're intentionally not looping in this statement since we always just want to show the first thing in the filter group
|
|
1537
|
-
const { meta: meta
|
|
1538
|
-
const { type: type
|
|
1458
|
+
const { meta: meta } = filter_data;
|
|
1459
|
+
const { type: type } = meta;
|
|
1539
1460
|
if (type === "range") return [
|
|
1540
1461
|
price_formatting_().pre_,
|
|
1541
1462
|
(0, $cV3wj$createComponent)((0, $8c0f86cb3e266eeb$export$a71e92cfbb498adc), {
|
|
@@ -1560,7 +1481,7 @@ function $a7b58cb3bcffd156$export$53c59af873b303c9({ selected_filters_in_group_:
|
|
|
1560
1481
|
price_formatting_().post_
|
|
1561
1482
|
];
|
|
1562
1483
|
else {
|
|
1563
|
-
const { data: data
|
|
1484
|
+
const { data: data } = selected_filter;
|
|
1564
1485
|
const data_is_array = Array.isArray(data);
|
|
1565
1486
|
if (data_is_array && data.length !== 1) {
|
|
1566
1487
|
size = data.length;
|
|
@@ -1639,9 +1560,6 @@ function $84d6cd10bb7b1589$export$ab34afce88557c0e(props) {
|
|
|
1639
1560
|
|
|
1640
1561
|
|
|
1641
1562
|
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
1563
|
// Errors caused by SDK consuming code interfacing with the SDK, not the SDK itself or other Depict packages
|
|
1646
1564
|
class $4fd48cb976bf1789$export$e1d52e4f0c7557a1 extends Error {
|
|
1647
1565
|
}
|
|
@@ -1663,7 +1581,7 @@ const $b7436a6d1fd64e3b$var$_tmpl$ = [
|
|
|
1663
1581
|
function $b7436a6d1fd64e3b$export$b69d0d92862de18b(props) {
|
|
1664
1582
|
return (0, $cV3wj$ErrorBoundary)({
|
|
1665
1583
|
fallback (err, retry) {
|
|
1666
|
-
const { message_: message_
|
|
1584
|
+
const { message_: message_, severity_: severity_ } = props;
|
|
1667
1585
|
let message = message_;
|
|
1668
1586
|
if (err instanceof (0, $4fd48cb976bf1789$export$aa14a9f43128f61f)) {
|
|
1669
1587
|
console.error(err.cause);
|
|
@@ -1687,10 +1605,6 @@ function $b7436a6d1fd64e3b$export$b69d0d92862de18b(props) {
|
|
|
1687
1605
|
|
|
1688
1606
|
|
|
1689
1607
|
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
1608
|
const $d20eff0aadc28983$var$_tmpl$ = [
|
|
1695
1609
|
"<span",
|
|
1696
1610
|
' class="',
|
|
@@ -1705,7 +1619,7 @@ function $d20eff0aadc28983$export$acb3eaade4b23afd(props) {
|
|
|
1705
1619
|
|
|
1706
1620
|
function $d134eae24341b4a1$export$89c6019e4baa40b1(props) {
|
|
1707
1621
|
const style = (0, $cV3wj$createMemo)(()=>{
|
|
1708
|
-
const { style: style
|
|
1622
|
+
const { style: style, height: height, width: width } = props;
|
|
1709
1623
|
return {
|
|
1710
1624
|
...style || {},
|
|
1711
1625
|
height: height ?? "1em",
|
|
@@ -1953,7 +1867,7 @@ function $fab07f52c9861732$var$ActualFilterBody(props) {
|
|
|
1953
1867
|
|
|
1954
1868
|
|
|
1955
1869
|
|
|
1956
|
-
function $5efb5894079b220e$export$b288c38ae3fddb56({ available_filters_: available_filters_
|
|
1870
|
+
function $5efb5894079b220e$export$b288c38ae3fddb56({ available_filters_: available_filters_, local_filter_cache_: [read_local_cache, write_local_cache], selected_filters_: [read_selected_filters] }) {
|
|
1957
1871
|
let last_remote_state;
|
|
1958
1872
|
(0, $cV3wj$createComputed)(()=>{
|
|
1959
1873
|
const remote_filters = Object.fromEntries(available_filters_()?.map((filter)=>[
|
|
@@ -2040,14 +1954,14 @@ function $5efb5894079b220e$export$b288c38ae3fddb56({ available_filters_: availab
|
|
|
2040
1954
|
}).map((key)=>data_objs_in_local[key]),
|
|
2041
1955
|
...Object.values(data_objs_in_remote)
|
|
2042
1956
|
];
|
|
2043
|
-
const new_values = new_data.map(({ value_: value_
|
|
1957
|
+
const new_values = new_data.map(({ value_: value_ })=>value_);
|
|
2044
1958
|
const result = {
|
|
2045
1959
|
...remote_filter,
|
|
2046
1960
|
meta: {
|
|
2047
1961
|
...remote_filter.meta,
|
|
2048
1962
|
values: new_values,
|
|
2049
|
-
names: new_data.map(({ name_: name_
|
|
2050
|
-
counts: new_data.map(({ count_: count_
|
|
1963
|
+
names: new_data.map(({ name_: name_ })=>name_),
|
|
1964
|
+
counts: new_data.map(({ count_: count_ })=>count_)
|
|
2051
1965
|
}
|
|
2052
1966
|
};
|
|
2053
1967
|
new_local_filter_state.push(result);
|
|
@@ -2105,10 +2019,6 @@ function $5efb5894079b220e$export$b288c38ae3fddb56({ available_filters_: availab
|
|
|
2105
2019
|
|
|
2106
2020
|
|
|
2107
2021
|
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
2022
|
function $a52235d12ccf9c88$export$2f0cbfbb4354bb52(elements) {
|
|
2113
2023
|
// FYI this probably doesn't work on hugely deep nestings or large amount of elements
|
|
2114
2024
|
return (0, $cV3wj$createMemo)(()=>$a52235d12ccf9c88$var$unwrapping_helper(elements));
|
|
@@ -2137,17 +2047,18 @@ const $c8d5ff4524619fcd$var$_tmpl$ = [
|
|
|
2137
2047
|
"</style>"
|
|
2138
2048
|
];
|
|
2139
2049
|
function $c8d5ff4524619fcd$export$d21e32dfedac04be(props) {
|
|
2050
|
+
const container_element_ = (0, $cV3wj$ssrElement)("div", props.element_attributes, ()=>(0, $cV3wj$escape)(props.children), true); // Don't want this in the error boundary below, it should only be for the actual layouting
|
|
2140
2051
|
return (0, $cV3wj$createComponent)((0, $b7436a6d1fd64e3b$export$b69d0d92862de18b), {
|
|
2141
2052
|
get message_ () {
|
|
2142
2053
|
return "Failed calculating " + props.layout + " layout";
|
|
2143
2054
|
},
|
|
2144
2055
|
severity_: "error",
|
|
2145
2056
|
get children () {
|
|
2146
|
-
return $c8d5ff4524619fcd$var$ActualSolidLayout(props);
|
|
2057
|
+
return $c8d5ff4524619fcd$var$ActualSolidLayout(props, container_element_);
|
|
2147
2058
|
}
|
|
2148
2059
|
});
|
|
2149
2060
|
}
|
|
2150
|
-
function $c8d5ff4524619fcd$var$ActualSolidLayout(props) {
|
|
2061
|
+
function $c8d5ff4524619fcd$var$ActualSolidLayout(props, container_element) {
|
|
2151
2062
|
// Copy of Layout from utilishared but using solid-js signals instead of async iterable IPNS
|
|
2152
2063
|
const show_all_rows = (0, $cV3wj$createMemo)(()=>props.rows === "all");
|
|
2153
2064
|
const rows_or_empty_object = (0, $cV3wj$createMemo)(()=>show_all_rows() ? {} : props.rows);
|
|
@@ -2159,7 +2070,6 @@ function $c8d5ff4524619fcd$var$ActualSolidLayout(props) {
|
|
|
2159
2070
|
const [get_styling, set_styling] = (0, $cV3wj$createSignal)();
|
|
2160
2071
|
const container_class = (0, $cV3wj$make_random_classname)();
|
|
2161
2072
|
const selector_beginning = `.depict .${container_class}>`; // class so ppl can have id if needed
|
|
2162
|
-
const container_element = (0, $cV3wj$ssrElement)("div", props.element_attributes, ()=>(0, $cV3wj$escape)(props.children), true);
|
|
2163
2073
|
const [get_children_count, set_children_count] = (0, $cV3wj$createSignal)(0);
|
|
2164
2074
|
const update_children_count = ()=>set_children_count(container_element.children.length);
|
|
2165
2075
|
const col_styling = (0, $cV3wj$createMemo)(()=>(0, $cV3wj$n_col_styling_with_dist)(selector_beginning, props.grid_spacing, props.cols_at_size, props.layout, props.override_vertical_spacing));
|
|
@@ -2192,7 +2102,7 @@ function $c8d5ff4524619fcd$var$ActualSolidLayout(props) {
|
|
|
2192
2102
|
(0, $cV3wj$onCleanup)(()=>mutation_observer.disconnect());
|
|
2193
2103
|
set_styling(// this is needed because solid will think that the memo-accessor is a setter function otherwise
|
|
2194
2104
|
()=>(0, $cV3wj$createMemo)(()=>{
|
|
2195
|
-
const { rows_per_click: rows_per_click
|
|
2105
|
+
const { rows_per_click: rows_per_click, max_rows: max_rows = -1 } = rows_or_empty_object();
|
|
2196
2106
|
const rows_visible = get_rows_visible();
|
|
2197
2107
|
const children_count = get_children_count();
|
|
2198
2108
|
return col_styling() + props.cols_at_size.map((options)=>{
|
|
@@ -2274,7 +2184,7 @@ async function $194bd6b8e4c59830$export$79b1565500412d9b(search_modal, modal_fn_
|
|
|
2274
2184
|
|
|
2275
2185
|
|
|
2276
2186
|
|
|
2277
|
-
async function $c58717f39bf51647$export$58e808b1db15d3bc({ merchant: merchant
|
|
2187
|
+
async function $c58717f39bf51647$export$58e808b1db15d3bc({ merchant: merchant, market: market, headers: headers, ...fetch_recs_options }) {
|
|
2278
2188
|
return await (0, $cV3wj$fetch_recs)({
|
|
2279
2189
|
tenant: merchant,
|
|
2280
2190
|
market: market
|
|
@@ -2286,10 +2196,6 @@ async function $c58717f39bf51647$export$58e808b1db15d3bc({ merchant: merchant ,
|
|
|
2286
2196
|
|
|
2287
2197
|
|
|
2288
2198
|
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
2199
|
function $ca6f574bd8772184$export$e183a13865960371(params_to_default_value, router_) {
|
|
2294
2200
|
const signals = {};
|
|
2295
2201
|
const entries = Object.entries(params_to_default_value);
|
|
@@ -2299,7 +2205,7 @@ function $ca6f574bd8772184$export$e183a13865960371(params_to_default_value, rout
|
|
|
2299
2205
|
// createRenderEffect because we need the instant execution so the signals always contain values, even before solid's render phase
|
|
2300
2206
|
(0, $cV3wj$createRenderEffect)(()=>{
|
|
2301
2207
|
let signal_changed = false;
|
|
2302
|
-
let { state: state
|
|
2208
|
+
let { state: state } = globalThis?.history || {
|
|
2303
2209
|
state: {}
|
|
2304
2210
|
}; // cloning isn't necessary because we're calling replaceState on it anyway
|
|
2305
2211
|
if (state === null || typeof state != "object") state = {};
|
|
@@ -2330,7 +2236,7 @@ function $ca6f574bd8772184$var$history_state_change(signals, entries, state) {
|
|
|
2330
2236
|
}
|
|
2331
2237
|
|
|
2332
2238
|
|
|
2333
|
-
function $a8fa7302d6f93c0b$export$9862539c89138352({ get_default_values_: get_default_values_
|
|
2239
|
+
function $a8fa7302d6f93c0b$export$9862539c89138352({ get_default_values_: get_default_values_, router_: router_, prefix_: prefix_ }) {
|
|
2334
2240
|
const get_prefixed_default_values_ = ()=>{
|
|
2335
2241
|
const default_values = get_default_values_();
|
|
2336
2242
|
return Object.fromEntries(Object.entries(default_values).map(([key, value])=>[
|
|
@@ -2359,6 +2265,38 @@ function $a8fa7302d6f93c0b$export$9862539c89138352({ get_default_values_: get_de
|
|
|
2359
2265
|
|
|
2360
2266
|
|
|
2361
2267
|
|
|
2268
|
+
/**
|
|
2269
|
+
* We use group_title for more beautiful urls if possible, this function modifies the search filters in an API response to have group_title as field, when possible.
|
|
2270
|
+
* Backend supports accepting group_title as field, so we just pretend it was field in the whole app to avoid major refactoring.
|
|
2271
|
+
* But also because it would be a lot more code since it's not guaranteed for group_title to exist. So at all places where we take `field` to send it to the API we'd have to check if group_title exists and use that instead and at all places where we try to pair filters sent from the API and filters set we'd have to both check if `op` and `field` match or if `op` and `group_title` match.
|
|
2272
|
+
*
|
|
2273
|
+
* This way it's just much simpler - group_title _is_ field for all intents and purposes if it exists, and we don't have to change anything/add lots of if-statements. The only reason we need the old field (actual_field) is for the compatibility with the old filters (see fix_old_filter_links).
|
|
2274
|
+
*/ function $e5014ccd0b76d9f4$export$967e966fca9515e(api_response) {
|
|
2275
|
+
if ("filters" in api_response) {
|
|
2276
|
+
const filters = api_response.filters;
|
|
2277
|
+
if (!filters) return api_response;
|
|
2278
|
+
const new_filters = [];
|
|
2279
|
+
for(let i = 0; i < filters.length; i++){
|
|
2280
|
+
const filter = filters[i];
|
|
2281
|
+
const group_title = filter.meta?.group_title?.toLowerCase();
|
|
2282
|
+
const new_filter = {
|
|
2283
|
+
...filter
|
|
2284
|
+
};
|
|
2285
|
+
if (group_title) {
|
|
2286
|
+
new_filter.field = group_title;
|
|
2287
|
+
new_filter.actual_field = filter.field;
|
|
2288
|
+
}
|
|
2289
|
+
new_filters.push(new_filter);
|
|
2290
|
+
}
|
|
2291
|
+
return {
|
|
2292
|
+
...api_response,
|
|
2293
|
+
filters: new_filters
|
|
2294
|
+
};
|
|
2295
|
+
}
|
|
2296
|
+
return api_response;
|
|
2297
|
+
}
|
|
2298
|
+
|
|
2299
|
+
|
|
2362
2300
|
const $7fa23e2a0079eca4$var$v2_base_url = (0, $cV3wj$base_url) + "/v2/";
|
|
2363
2301
|
const $7fa23e2a0079eca4$var$search_base_url = $7fa23e2a0079eca4$var$v2_base_url + "search/";
|
|
2364
2302
|
class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
@@ -2414,7 +2352,7 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
2414
2352
|
Object.defineProperties(category_suggestions.pop(), Object.getOwnPropertyDescriptors(page_urls.pop()));
|
|
2415
2353
|
return response;
|
|
2416
2354
|
}
|
|
2417
|
-
async #run_url_creator_for_rest(
|
|
2355
|
+
async #run_url_creator_for_rest(merchant, market, input_data) {
|
|
2418
2356
|
if (!this.page_url_creator) return input_data;
|
|
2419
2357
|
const displays = input_data.displays;
|
|
2420
2358
|
const breadcrumb = input_data.breadcrumb;
|
|
@@ -2422,8 +2360,8 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
2422
2360
|
if (displays) {
|
|
2423
2361
|
const page_urls = await this.page_url_creator({
|
|
2424
2362
|
type: "products",
|
|
2425
|
-
merchant:
|
|
2426
|
-
market:
|
|
2363
|
+
merchant: merchant,
|
|
2364
|
+
market: market,
|
|
2427
2365
|
displays: [
|
|
2428
2366
|
...input_data.displays
|
|
2429
2367
|
]
|
|
@@ -2450,8 +2388,8 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
2450
2388
|
if (!category_display_array) continue;
|
|
2451
2389
|
const page_urls = await this.page_url_creator({
|
|
2452
2390
|
type: "categories",
|
|
2453
|
-
merchant:
|
|
2454
|
-
market:
|
|
2391
|
+
merchant: merchant,
|
|
2392
|
+
market: market,
|
|
2455
2393
|
data: [
|
|
2456
2394
|
...category_display_array
|
|
2457
2395
|
]
|
|
@@ -2462,8 +2400,8 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
2462
2400
|
}
|
|
2463
2401
|
return input_data;
|
|
2464
2402
|
}
|
|
2465
|
-
async #cached_post_request(
|
|
2466
|
-
const cache_obj = this.#get_cache_obj_for_endpoint(
|
|
2403
|
+
async #cached_post_request(endpoint, input_req, fallback_response) {
|
|
2404
|
+
const cache_obj = this.#get_cache_obj_for_endpoint(endpoint);
|
|
2467
2405
|
const with_ids = this.#add_ids_to_request(input_req);
|
|
2468
2406
|
const metaData = await this.#get_metadata?.();
|
|
2469
2407
|
const request = metaData ? Object.assign(with_ids, {
|
|
@@ -2477,7 +2415,7 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
2477
2415
|
let resolve_in_progress;
|
|
2478
2416
|
cache_obj.in_progress_[body] = new Promise((r)=>resolve_in_progress = r);
|
|
2479
2417
|
try {
|
|
2480
|
-
const api_response = await (0, $cV3wj$fetch_retry)((0, $cV3wj$add_version_query_params)(
|
|
2418
|
+
const api_response = await (0, $cV3wj$fetch_retry)((0, $cV3wj$add_version_query_params)(endpoint), {
|
|
2481
2419
|
method: "POST",
|
|
2482
2420
|
body: body
|
|
2483
2421
|
});
|
|
@@ -2491,6 +2429,8 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
2491
2429
|
(0, $cV3wj$dwarn)("URL creator or json decoding failed", e);
|
|
2492
2430
|
break return_successfully;
|
|
2493
2431
|
}
|
|
2432
|
+
// Here result actually becomes O
|
|
2433
|
+
result = (0, $e5014ccd0b76d9f4$export$967e966fca9515e)(result);
|
|
2494
2434
|
cache_obj.cache_[body] = new WeakRef(result);
|
|
2495
2435
|
resolve_in_progress(result);
|
|
2496
2436
|
setTimeout((0, $cV3wj$catchify)(()=>{
|
|
@@ -2510,7 +2450,7 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
2510
2450
|
}
|
|
2511
2451
|
}
|
|
2512
2452
|
constructor(options){
|
|
2513
|
-
const { get_metadata: get_metadata
|
|
2453
|
+
const { get_metadata: get_metadata, get_user_id: get_user_id, get_session_id: get_session_id, page_url_creator: page_url_creator } = options ?? {};
|
|
2514
2454
|
this.#get_metadata = get_metadata;
|
|
2515
2455
|
this.#get_user_id = get_user_id;
|
|
2516
2456
|
this.#get_session_id = get_session_id;
|
|
@@ -2575,18 +2515,14 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
2575
2515
|
|
|
2576
2516
|
|
|
2577
2517
|
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
2518
|
const $fc5a12f3a857ca30$var$get_available_range = (available_filters_, search_for_field)=>{
|
|
2583
|
-
const maybe_meta = (0, $cV3wj$untrack)(available_filters_)?.find(({ op: op
|
|
2519
|
+
const maybe_meta = (0, $cV3wj$untrack)(available_filters_)?.find(({ op: op, field: field })=>field === search_for_field && op === "inrange")?.meta;
|
|
2584
2520
|
if (maybe_meta?.min != undefined && maybe_meta?.max != undefined) return [
|
|
2585
2521
|
maybe_meta.min,
|
|
2586
2522
|
maybe_meta.max
|
|
2587
2523
|
];
|
|
2588
2524
|
};
|
|
2589
|
-
function $fc5a12f3a857ca30$export$e702733a056c40d6({ available_filters_: available_filters_
|
|
2525
|
+
function $fc5a12f3a857ca30$export$e702733a056c40d6({ available_filters_: available_filters_, selected_filters_: selected_filters_ }) {
|
|
2590
2526
|
(0, $cV3wj$createComputed)(()=>{
|
|
2591
2527
|
// we don't want to update (as selected_filters change) as navigating will change the selected range before the available range changes and we might ruin a perfectly valid filter range
|
|
2592
2528
|
available_filters_();
|
|
@@ -2596,7 +2532,7 @@ function $fc5a12f3a857ca30$export$e702733a056c40d6({ available_filters_: availab
|
|
|
2596
2532
|
});
|
|
2597
2533
|
});
|
|
2598
2534
|
}
|
|
2599
|
-
function $fc5a12f3a857ca30$var$correct_range_filter_range_once({ selected_filters_: [read_selected_filters_, write_selected_filters_]
|
|
2535
|
+
function $fc5a12f3a857ca30$var$correct_range_filter_range_once({ selected_filters_: [read_selected_filters_, write_selected_filters_], available_filters_: available_filters_ }) {
|
|
2600
2536
|
const selected_filters = (0, $cV3wj$untrack)(read_selected_filters_);
|
|
2601
2537
|
if (!selected_filters) return;
|
|
2602
2538
|
for(let i = 0; i < selected_filters.length; i++){
|
|
@@ -2639,7 +2575,7 @@ function $fc5a12f3a857ca30$var$correct_range_filter_range_once({ selected_filter
|
|
|
2639
2575
|
|
|
2640
2576
|
|
|
2641
2577
|
|
|
2642
|
-
function $511cc0abd9a64ce8$export$92f2da32c6e7e7ee({ search_results_: search_results_
|
|
2578
|
+
function $511cc0abd9a64ce8$export$92f2da32c6e7e7ee({ search_results_: search_results_, i18n_: i18n_ }) {
|
|
2643
2579
|
return (0, $cV3wj$createMemo)(()=>{
|
|
2644
2580
|
const n_hits = search_results_()?.n_hits;
|
|
2645
2581
|
if (isNaN(n_hits)) return "";
|
|
@@ -2656,15 +2592,12 @@ function $511cc0abd9a64ce8$export$92f2da32c6e7e7ee({ search_results_: search_res
|
|
|
2656
2592
|
|
|
2657
2593
|
|
|
2658
2594
|
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
2595
|
function $8f9120a1ca151e6a$export$205efb947c7ffd78(handler, passive = true) {
|
|
2663
2596
|
const catchified_handler = (0, $cV3wj$catchify)(handler);
|
|
2664
2597
|
const owner = (0, $cV3wj$getOwner)();
|
|
2665
2598
|
// Some customers (e.g. equestrian) have `height: 100%` and/or `overflow-x: hidden` on the body, which means that scroll events won't get dispatched on `window`. The pages who get it on <body> won't get it on `window` and vice-versa, so there shouldn't be a worry about duplicate calling of the handler.
|
|
2666
2599
|
// Use observer in case that this gets called before body exists
|
|
2667
|
-
const disconnect = (0, $cV3wj$observer).onexists("body", ({ element: element
|
|
2600
|
+
const disconnect = (0, $cV3wj$observer).onexists("body", ({ element: element })=>{
|
|
2668
2601
|
element.addEventListener("scroll", catchified_handler, {
|
|
2669
2602
|
passive: passive
|
|
2670
2603
|
});
|
|
@@ -2684,7 +2617,6 @@ function $8f9120a1ca151e6a$export$205efb947c7ffd78(handler, passive = true) {
|
|
|
2684
2617
|
}
|
|
2685
2618
|
|
|
2686
2619
|
|
|
2687
|
-
|
|
2688
2620
|
const $6db49ca163afa2c3$var$_tmpl$ = [
|
|
2689
2621
|
"<div",
|
|
2690
2622
|
' class="scroll-status" style="display:none"><span class="text"><b>',
|
|
@@ -2693,7 +2625,7 @@ const $6db49ca163afa2c3$var$_tmpl$ = [
|
|
|
2693
2625
|
"<!--/--> <b>",
|
|
2694
2626
|
"</b></span></div>"
|
|
2695
2627
|
];
|
|
2696
|
-
function $6db49ca163afa2c3$export$83fd5de5504a7a67({ formatted_number_of_results_: formatted_number_of_results_
|
|
2628
|
+
function $6db49ca163afa2c3$export$83fd5de5504a7a67({ formatted_number_of_results_: formatted_number_of_results_, first_result_in_viewport_: [get_first_result_in_viewport], last_result_in_viewport_: [get_last_result_in_viewport], number_of_results_: number_of_results_, i18n_: { price_formatting_: price_formatting_, of_: of_ } }) {
|
|
2697
2629
|
if (0, $cV3wj$isServer) return; // won't show in initial render and need scroll position
|
|
2698
2630
|
const [first_to_show, set_first_to_show] = (0, $cV3wj$createSignal)(0);
|
|
2699
2631
|
const [last_to_show, set_last_to_show] = (0, $cV3wj$createSignal)(0);
|
|
@@ -2808,12 +2740,6 @@ function $6db49ca163afa2c3$export$83fd5de5504a7a67({ formatted_number_of_results
|
|
|
2808
2740
|
|
|
2809
2741
|
|
|
2810
2742
|
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
2743
|
const $598245ecfe38f34b$var$_tmpl$ = [
|
|
2818
2744
|
"<a",
|
|
2819
2745
|
' class="hint" href="javascript:void(0)">',
|
|
@@ -2824,7 +2750,7 @@ const $598245ecfe38f34b$var$_tmpl$ = [
|
|
|
2824
2750
|
"</div><!--#-->",
|
|
2825
2751
|
"<!--/--></div>"
|
|
2826
2752
|
];
|
|
2827
|
-
function $598245ecfe38f34b$export$ef6006467f04ee41({ i18n_: i18n_
|
|
2753
|
+
function $598245ecfe38f34b$export$ef6006467f04ee41({ i18n_: i18n_, expanded_hierarchical_filters_: expanded_hierarchical_filters_, selected_filters_: selected_filters_, local_filter_cache_: local_filter_cache_ }) {
|
|
2828
2754
|
const root = (0, $cV3wj$getOwner)();
|
|
2829
2755
|
return [
|
|
2830
2756
|
(0, $cV3wj$ssr)($598245ecfe38f34b$var$_tmpl$2, (0, $cV3wj$ssrHydrationKey)(), (0, $cV3wj$escape)(i18n_.no_results_text_()), (0, $cV3wj$escape)((0, $cV3wj$createComponent)((0, $cV3wj$Show), {
|
|
@@ -2852,7 +2778,7 @@ function $a458486f22b22f63$export$a2cc176055f8f08() {
|
|
|
2852
2778
|
|
|
2853
2779
|
let $6e41f1fde994db72$var$cached_placeholder_element;
|
|
2854
2780
|
let $6e41f1fde994db72$var$rendering_cached_placeholder_element;
|
|
2855
|
-
function $6e41f1fde994db72$export$f33414a4df0afd3f({ product_card_template_: product_card_template_
|
|
2781
|
+
function $6e41f1fde994db72$export$f33414a4df0afd3f({ product_card_template_: product_card_template_, num_placeholders_: num_placeholders_ }) {
|
|
2856
2782
|
const [get_elements, set_elements] = (0, $cV3wj$createSignal)([]);
|
|
2857
2783
|
let existing_num = 0;
|
|
2858
2784
|
if (0, $cV3wj$isServer) // want to render simple placeholders on server, effects don't run there
|
|
@@ -2883,7 +2809,7 @@ function $6e41f1fde994db72$export$f33414a4df0afd3f({ product_card_template_: pro
|
|
|
2883
2809
|
}
|
|
2884
2810
|
/**
|
|
2885
2811
|
* Get one placeholder element. It will be cloned for each placeholder for ultimate performance even when solid-js isn't rendering the placeholders.
|
|
2886
|
-
*/ function $6e41f1fde994db72$var$Placeholder({ product_card_template_: product_card_template_
|
|
2812
|
+
*/ function $6e41f1fde994db72$var$Placeholder({ product_card_template_: product_card_template_ }) {
|
|
2887
2813
|
const get_cloned_placeholders = (element_to_clone = $6e41f1fde994db72$var$cached_placeholder_element)=>Array.isArray(element_to_clone) ? element_to_clone.map((el)=>el instanceof Node ? el.cloneNode(true) : el) : element_to_clone;
|
|
2888
2814
|
if ($6e41f1fde994db72$var$cached_placeholder_element) return get_cloned_placeholders();
|
|
2889
2815
|
let dispose_original_copy;
|
|
@@ -2936,7 +2862,7 @@ function $6e41f1fde994db72$export$f33414a4df0afd3f({ product_card_template_: pro
|
|
|
2936
2862
|
|
|
2937
2863
|
|
|
2938
2864
|
|
|
2939
|
-
function $056f6ac0a6caa919$export$5e4aed86c12acdd9({ percentage_in_view_: percentage_in_view_
|
|
2865
|
+
function $056f6ac0a6caa919$export$5e4aed86c12acdd9({ percentage_in_view_: percentage_in_view_, set_extra_displays_: set_extra_displays_, all_products_loaded_: all_products_loaded_, plp_results_: plp_results_, min_products_to_fetch_: min_products_to_fetch_, query_base_: query_base_, depict_api_: depict_api_ }) {
|
|
2940
2866
|
let last_loaded = +new Date();
|
|
2941
2867
|
let is_loading_more = false;
|
|
2942
2868
|
let is_first_load = true;
|
|
@@ -2986,7 +2912,7 @@ function $056f6ac0a6caa919$export$5e4aed86c12acdd9({ percentage_in_view_: percen
|
|
|
2986
2912
|
|
|
2987
2913
|
|
|
2988
2914
|
|
|
2989
|
-
function $0e0b96a8dc1ad492$export$63dd0350f8559dda({ displays_by_key_: displays_by_key_
|
|
2915
|
+
function $0e0b96a8dc1ad492$export$63dd0350f8559dda({ displays_by_key_: displays_by_key_, get_last_result_in_viewport_: get_last_result_in_viewport_, index_to_target_map_: index_to_target_map_, is_loading_: is_loading_, get_extra_displays: get_extra_displays }) {
|
|
2990
2916
|
const [get_has_rendered_toggle, set_has_rendered_toggle] = (0, $cV3wj$createSignal)(false);
|
|
2991
2917
|
(0, $cV3wj$createEffect)(()=>{
|
|
2992
2918
|
// We need this to run after the "render phase"
|
|
@@ -3047,7 +2973,7 @@ function $29ec7cddbe1d3484$export$7f8bd308237ab5a5(get_displays_) {
|
|
|
3047
2973
|
});
|
|
3048
2974
|
return displays_by_key_;
|
|
3049
2975
|
}
|
|
3050
|
-
function $29ec7cddbe1d3484$export$43f0fb951fcb0c54({ displays_by_key_: displays_by_key_
|
|
2976
|
+
function $29ec7cddbe1d3484$export$43f0fb951fcb0c54({ displays_by_key_: displays_by_key_, merchant_: merchant_, market_: market_, product_card_template_: product_card_template_, do_per_elements_: do_per_elements_ }) {
|
|
3051
2977
|
return (0, $cV3wj$createComponent)((0, $cV3wj$For), {
|
|
3052
2978
|
get each () {
|
|
3053
2979
|
return [
|
|
@@ -3079,8 +3005,8 @@ function $29ec7cddbe1d3484$export$43f0fb951fcb0c54({ displays_by_key_: displays_
|
|
|
3079
3005
|
elements.push(element);
|
|
3080
3006
|
// Add tracking ids
|
|
3081
3007
|
if (!(element instanceof HTMLElement)) continue; // Apparently only HTMLElements have dataset
|
|
3082
|
-
const { dataset: dataset
|
|
3083
|
-
const { search_result_id: search_result_id
|
|
3008
|
+
const { dataset: dataset } = element;
|
|
3009
|
+
const { search_result_id: search_result_id, product_listing_result_id: product_listing_result_id, recommendation_id: recommendation_id } = display;
|
|
3084
3010
|
if (search_result_id) dataset.searchResultId = search_result_id;
|
|
3085
3011
|
else if (product_listing_result_id) dataset.productListingResultId = product_listing_result_id;
|
|
3086
3012
|
else if (recommendation_id) dataset.recommendationId = recommendation_id;
|
|
@@ -3093,7 +3019,7 @@ function $29ec7cddbe1d3484$export$43f0fb951fcb0c54({ displays_by_key_: displays_
|
|
|
3093
3019
|
}
|
|
3094
3020
|
|
|
3095
3021
|
|
|
3096
|
-
function $0449e7d49398c077$export$a1fd619a4743ca08({ plp_results_: plp_results_
|
|
3022
|
+
function $0449e7d49398c077$export$a1fd619a4743ca08({ plp_results_: plp_results_, product_card_template_: product_card_template_, first_result_in_viewport_: [, set_first_result_in_viewport], last_result_in_viewport_: [get_last_result_in_viewport_, set_last_result_in_viewport], merchant_: merchant_, market_: market_, all_products_loaded_: all_products_loaded_, min_products_to_fetch_: min_products_to_fetch_, query_base_: query_base_, depict_api_: depict_api_, is_loading_: is_loading_ }) {
|
|
3097
3023
|
// The following sets up an intersection observer to determine which results are in the viewport, used for the ScrollStatus indicator and knowing when to load more
|
|
3098
3024
|
const target_to_index_map = new Map();
|
|
3099
3025
|
const index_to_target_map_ = new Map();
|
|
@@ -3101,7 +3027,7 @@ function $0449e7d49398c077$export$a1fd619a4743ca08({ plp_results_: plp_results_
|
|
|
3101
3027
|
const intersection_observer = new IntersectionObserver((0, $cV3wj$catchify)((records)=>{
|
|
3102
3028
|
for(let i = 0; i < records.length; i++){
|
|
3103
3029
|
const record = records[i];
|
|
3104
|
-
const { target: target
|
|
3030
|
+
const { target: target, intersectionRatio: intersectionRatio } = record;
|
|
3105
3031
|
const index_of_target = target_to_index_map.get(target);
|
|
3106
3032
|
if (index_of_target == undefined) return; // It seems like it can happen that we get IntersectionObserverEntries after the onCleanup function for a recommendation card has run, in Firefox. Probably a bug in Firefox? If I understood the bug correctly, this is a workaround.
|
|
3107
3033
|
const is_in_set = currently_intersecting.has(index_of_target);
|
|
@@ -3171,7 +3097,7 @@ const $2d25e42846eac370$var$_tmpl$ = [
|
|
|
3171
3097
|
"<!--/--><!--#-->",
|
|
3172
3098
|
"<!--/--></div>"
|
|
3173
3099
|
];
|
|
3174
|
-
function $2d25e42846eac370$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
3100
|
+
function $2d25e42846eac370$export$3925f87b1545cfc6({ plp_results_: plp_results_, depict_api_: depict_api_, all_products_loaded_: all_products_loaded_, min_products_to_fetch_: min_products_to_fetch_, query_base_: query_base_, first_result_in_viewport_: first_result_in_viewport_, last_result_in_viewport_: last_result_in_viewport_, scroll_restoration_data_: [get_scroll_restoration_data], no_results_options_: no_results_options_, desktop_filter_elements_: desktop_filter_elements_, sort_or_filter_open_: sort_or_filter_open_, product_card_template_: product_card_template_, layout_options_: layout_options_, id_currently_querying_for_: id_currently_querying_for_ }) {
|
|
3175
3101
|
// The plp_results_ resource will be delayed because we're using createBatchedMemo to not make triplicate API requests, but we need to show the placeholders before already to match Chrome and Firefox's "content has to be there, ready for scroll restoration, before all popstate tasks have been completed"-requirement
|
|
3176
3102
|
const is_loading_ = (0, $cV3wj$createMemo)(()=>plp_results_.loading || query_base_.loading);
|
|
3177
3103
|
const merchant_ = (0, $cV3wj$createMemo)(()=>query_base_().tenant);
|
|
@@ -3216,7 +3142,7 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
|
3216
3142
|
product_card_template_: product_card_template_,
|
|
3217
3143
|
num_placeholders_: (0, $cV3wj$createMemo)(()=>{
|
|
3218
3144
|
// Can't use the data out of request_base for the id because request_base is too late, we need the correct amount of placeholders before the browser has restored the scroll state after processing all popstate events
|
|
3219
|
-
return (0, $7747fe1a8c5652e3$export$6c9030e511152266) + (get_scroll_restoration_data().find(({ for_id: for_id
|
|
3145
|
+
return (0, $7747fe1a8c5652e3$export$6c9030e511152266) + (get_scroll_restoration_data().find(({ for_id: for_id })=>for_id === id_currently_querying_for_())?.min_results_loaded ?? min_products_to_fetch_);
|
|
3220
3146
|
})
|
|
3221
3147
|
}) : undefined);
|
|
3222
3148
|
const [get_suspense_is_blocked, set_suspense_is_blocked] = (0, $cV3wj$createSignal)(false);
|
|
@@ -3319,7 +3245,7 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
|
3319
3245
|
/**
|
|
3320
3246
|
* Changes cols_at_size depending on if filters are open or not so one card less is shown when the filters are open
|
|
3321
3247
|
* This function is special to the actual PLPResults.
|
|
3322
|
-
*/ function $2d25e42846eac370$var$make_modified_cols_at_size({ layout_options_: layout_options_
|
|
3248
|
+
*/ function $2d25e42846eac370$var$make_modified_cols_at_size({ layout_options_: layout_options_, sort_or_filter_open_: sort_or_filter_open_ }) {
|
|
3323
3249
|
return (0, $cV3wj$createMemo)(()=>{
|
|
3324
3250
|
const layout_options = layout_options_();
|
|
3325
3251
|
// Add grid styling that changes when filters get opened/closed
|
|
@@ -3353,15 +3279,6 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
|
3353
3279
|
|
|
3354
3280
|
|
|
3355
3281
|
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
3282
|
|
|
3366
3283
|
const $68a258a92b88f02f$var$_tmpl$ = [
|
|
3367
3284
|
"<div",
|
|
@@ -3383,7 +3300,7 @@ const $68a258a92b88f02f$var$_tmpl$ = [
|
|
|
3383
3300
|
'><span class="custom-indicator"></span><!--#-->',
|
|
3384
3301
|
"<!--/--></label></div>"
|
|
3385
3302
|
];
|
|
3386
|
-
function $68a258a92b88f02f$export$1f1775a58da589b5({ available_sortings_: available_sortings_
|
|
3303
|
+
function $68a258a92b88f02f$export$1f1775a58da589b5({ available_sortings_: available_sortings_, current_sorting_: [get_current_sorting, set_current_sorting], meta_of_currently_selected_sorting_: meta_of_currently_selected_sorting_ }) {
|
|
3387
3304
|
const title_radio_name = (0, $cV3wj$make_random_classname)();
|
|
3388
3305
|
const order_radio_name = (0, $cV3wj$make_random_classname)();
|
|
3389
3306
|
return (0, $cV3wj$createComponent)((0, $cV3wj$Show), {
|
|
@@ -3444,12 +3361,6 @@ function $68a258a92b88f02f$export$1f1775a58da589b5({ available_sortings_: availa
|
|
|
3444
3361
|
|
|
3445
3362
|
|
|
3446
3363
|
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
3364
|
function $aea1edf92433e81e$export$fe334901e8bebd57() {
|
|
3454
3365
|
const cleanup_fns = [];
|
|
3455
3366
|
const cleanup = ()=>cleanup_fns.forEach((f)=>f());
|
|
@@ -3493,7 +3404,6 @@ function $aea1edf92433e81e$export$fe334901e8bebd57() {
|
|
|
3493
3404
|
|
|
3494
3405
|
|
|
3495
3406
|
|
|
3496
|
-
|
|
3497
3407
|
const $e1bb71e65e01a3a0$var$_tmpl$ = '<path d="M6.199 10.254a.35.35 0 0 0-.496 0L3.5 12.453V.348a.35.35 0 0 0-.7 0v12.105L.598 10.254c-.137-.137-.359-.137-.492 0a.35.35 0 0 0 0 .492l2.797 2.801a.35.35 0 0 0 .496 0L6.2 10.746c.137-.137.137-.355 0-.492zM9.449 3.5H8.051a.35.35 0 0 1-.352-.352V1.75c0-.191.156-.352.352-.352h1.398c.195 0 .352.16.352.352v1.398a.35.35 0 0 1-.352.352zm-1.051-.699h.703v-.699h-.703zm0 0"></path>', $e1bb71e65e01a3a0$var$_tmpl$2 = '<path d="M10.852 6.301H8.051a.35.35 0 0 1-.352-.352V4.551a.35.35 0 0 1 .352-.352h2.801a.35.35 0 0 1 .348.352v1.398a.35.35 0 0 1-.348.352zm-2.453-.699H10.5v-.703H8.398zm3.851 3.5H8.051c-.195 0-.352-.16-.352-.352V7.352A.35.35 0 0 1 8.051 7h4.199c.191 0 .352.156.352.352V8.75c0 .191-.16.352-.352.352zm-3.852-.703h3.5V7.7h-3.5zm5.25 3.499H8.051a.35.35 0 0 1-.352-.348v-1.402a.35.35 0 0 1 .352-.348h5.598a.35.35 0 0 1 .352.348v1.402a.35.35 0 0 1-.352.348zm-5.25-.699H13.3V10.5H8.398zm0 0"></path>';
|
|
3498
3408
|
function $e1bb71e65e01a3a0$export$da32f7add8a22e86(props = {}) {
|
|
3499
3409
|
return (0, $cV3wj$ssrElement)("svg", ()=>({
|
|
@@ -3510,7 +3420,6 @@ function $e1bb71e65e01a3a0$export$da32f7add8a22e86(props = {}) {
|
|
|
3510
3420
|
|
|
3511
3421
|
|
|
3512
3422
|
|
|
3513
|
-
|
|
3514
3423
|
const $05fbe84eb34564ec$var$_tmpl$ = '<path d="M6.199 10.254a.35.35 0 0 0-.496 0L3.5 12.453V.348a.35.35 0 0 0-.7 0v12.105L.598 10.254c-.137-.137-.359-.137-.492 0a.35.35 0 0 0 0 .492l2.797 2.801a.35.35 0 0 0 .496 0L6.2 10.746c.137-.137.137-.355 0-.492zm3.25 1.644H8.051a.35.35 0 0 1-.352-.348v-1.402a.35.35 0 0 1 .352-.348h1.398a.35.35 0 0 1 .352.348v1.402a.35.35 0 0 1-.352.348zm-1.051-.699h.703V10.5h-.703zm2.454-2.097H8.051c-.195 0-.352-.16-.352-.352V7.352A.35.35 0 0 1 8.051 7h2.801a.35.35 0 0 1 .348.352V8.75c0 .191-.156.352-.348.352zm-2.453-.703H10.5V7.7H8.398zm3.851-2.098H8.051a.35.35 0 0 1-.352-.352V4.551a.35.35 0 0 1 .352-.352h4.199c.191 0 .352.156.352.352v1.398c0 .195-.16.352-.352.352zm-3.852-.699h3.5v-.703h-3.5zm5.25-2.102H8.051a.35.35 0 0 1-.352-.352V1.75c0-.191.156-.352.352-.352h5.598c.195 0 .352.16.352.352v1.398a.35.35 0 0 1-.352.352zm-5.25-.699H13.3v-.699H8.398zm0 0"></path>';
|
|
3515
3424
|
function $05fbe84eb34564ec$export$d10e63059ddb9fd4(props = {}) {
|
|
3516
3425
|
return (0, $cV3wj$ssrElement)("svg", ()=>({
|
|
@@ -3524,7 +3433,6 @@ function $05fbe84eb34564ec$export$d10e63059ddb9fd4(props = {}) {
|
|
|
3524
3433
|
|
|
3525
3434
|
|
|
3526
3435
|
|
|
3527
|
-
|
|
3528
3436
|
const $b9bf7fce0ae60241$var$_tmpl$ = [
|
|
3529
3437
|
"<svg",
|
|
3530
3438
|
' xmlns="http://www.w3.org/2000/svg" width="14" height="15" class="filter-icon"><path d="M1.75 14.697c-.096 0-.178-.034-.246-.103s-.103-.15-.103-.246V8.75c0-.096.034-.178.103-.246s.15-.103.246-.103.178.034.246.103.103.15.103.246v5.599c0 .096-.034.178-.103.246s-.15.103-.246.103zm0-9.796c-.096 0-.178-.034-.246-.103s-.103-.15-.103-.246v-3.5c0-.1.034-.185.103-.253s.15-.103.246-.103.178.034.246.103.103.153.103.253v3.5c0 .096-.034.178-.103.246s-.15.103-.246.103zm.697 2.796H1.053c-.292 0-.54-.103-.745-.308S0 6.938 0 6.651s.103-.54.308-.745.453-.308.745-.308h1.395c.292 0 .54.103.745.308s.308.453.308.745-.103.533-.308.738-.453.308-.745.308zM1.053 6.303c-.1 0-.185.034-.253.103s-.103.15-.103.246.034.178.103.246S.952 7 1.053 7h1.395c.1 0 .185-.034.253-.103s.103-.15.103-.246-.034-.178-.103-.246-.153-.103-.253-.103H1.053zm5.599 8.395c-.096 0-.178-.034-.246-.103s-.103-.15-.103-.246v-2.796c0-.1.034-.184.103-.253s.15-.102.246-.102.178.034.246.102.103.153.103.253v2.796c0 .096-.034.178-.103.246s-.15.103-.246.103zm0-7c-.096 0-.178-.034-.246-.103s-.103-.15-.103-.246V1.053c0-.1.034-.185.103-.253s.15-.103.246-.103.178.034.246.103S7 .952 7 1.053v6.296c0 .096-.034.178-.103.246s-.15.103-.246.103zm.697 2.803H5.947c-.287 0-.533-.102-.738-.308s-.308-.453-.308-.745.103-.533.308-.738.451-.308.738-.308h1.401c.292 0 .54.103.745.308s.308.451.308.738-.103.54-.308.745-.453.308-.745.308zM5.947 9.099c-.096 0-.178.034-.246.103s-.103.15-.103.246.034.185.103.253.15.103.246.103h1.401c.096 0 .178-.034.246-.103s.103-.153.103-.253-.034-.178-.103-.246-.15-.103-.246-.103H5.947zm5.605 5.599c-.1 0-.184-.034-.253-.103s-.102-.15-.102-.246v-7c0-.096.034-.178.102-.246S11.453 7 11.553 7s.178.034.246.103.103.15.103.246v7c0 .096-.034.178-.103.246s-.15.103-.246.103zm0-11.197c-.1 0-.184-.034-.253-.103s-.102-.15-.102-.246V1.053c0-.1.034-.185.102-.253s.153-.103.253-.103.178.034.246.103.103.153.103.253v2.099c0 .096-.034.178-.103.246s-.15.103-.246.103zm.697 2.803h-1.401c-.287 0-.533-.103-.738-.308s-.308-.453-.308-.745.103-.54.308-.745.451-.308.738-.308h1.401c.292 0 .54.103.745.308s.308.453.308.745-.102.54-.308.745-.453.308-.745.308zm-1.401-1.401c-.096 0-.178.034-.246.103s-.102.15-.102.246.034.178.102.246.15.103.246.103h1.401c.096 0 .178-.034.246-.103s.102-.15.102-.246-.034-.178-.102-.246-.15-.103-.246-.103h-1.401z"></path></svg>'
|
|
@@ -3570,7 +3478,7 @@ const $757dac7f7c6c5241$var$_tmpl$ = [
|
|
|
3570
3478
|
"</b>"
|
|
3571
3479
|
];
|
|
3572
3480
|
const $757dac7f7c6c5241$var$no_go_selector = ".range .range-group";
|
|
3573
|
-
function $757dac7f7c6c5241$export$9bf11afa910f536e({ args_for_sorting_: args_for_sorting_
|
|
3481
|
+
function $757dac7f7c6c5241$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_ }) {
|
|
3574
3482
|
(0, $aea1edf92433e81e$export$fe334901e8bebd57)();
|
|
3575
3483
|
let modal;
|
|
3576
3484
|
let modal_body;
|
|
@@ -3668,7 +3576,6 @@ function $757dac7f7c6c5241$export$9bf11afa910f536e({ args_for_sorting_: args_for
|
|
|
3668
3576
|
|
|
3669
3577
|
|
|
3670
3578
|
|
|
3671
|
-
|
|
3672
3579
|
const $11d594c749b76228$var$_tmpl$ = [
|
|
3673
3580
|
"<svg",
|
|
3674
3581
|
' xmlns="http://www.w3.org/2000/svg" width="14" height="14"><path d="M12.949 7.699H.352A.35.35 0 0 1 0 7.352.35.35 0 0 1 .352 7h12.598a.35.35 0 0 1 .352.352.35.35 0 0 1-.352.348zm0 0"></path></svg>'
|
|
@@ -3681,7 +3588,6 @@ function $11d594c749b76228$export$cb808a3c41736d8e() {
|
|
|
3681
3588
|
|
|
3682
3589
|
|
|
3683
3590
|
|
|
3684
|
-
|
|
3685
3591
|
const $cdea4cf8c5c071ef$var$_tmpl$ = [
|
|
3686
3592
|
"<div",
|
|
3687
3593
|
' class="filters"><div class="body">',
|
|
@@ -3720,7 +3626,7 @@ const $cdea4cf8c5c071ef$var$_tmpl$ = [
|
|
|
3720
3626
|
"</span><!--#-->",
|
|
3721
3627
|
"<!--/--></button>"
|
|
3722
3628
|
];
|
|
3723
|
-
function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({ current_sorting_: current_sorting_
|
|
3629
|
+
function $cdea4cf8c5c071ef$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_ }) {
|
|
3724
3630
|
const Self = ()=>{
|
|
3725
3631
|
// This could technically be in SearchPage and CategoryPage and would be better suited there since it writes into local_filter_cache_ which i.e. SelectedFilters uses, but it's better suited here IMO due to DRY and being inside the correct error boundary here
|
|
3726
3632
|
(0, $5efb5894079b220e$export$b288c38ae3fddb56)({
|
|
@@ -3806,7 +3712,7 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({ current_sorting_: current_s
|
|
|
3806
3712
|
}
|
|
3807
3713
|
});
|
|
3808
3714
|
(0, $cV3wj$catchify)(async ()=>{
|
|
3809
|
-
({ open_modal_: open_modal_
|
|
3715
|
+
({ open_modal_: open_modal_, close_modal_: close_modal_ } = await (0, $194bd6b8e4c59830$export$79b1565500412d9b)((0, $757dac7f7c6c5241$export$9bf11afa910f536e), {
|
|
3810
3716
|
args_for_sorting_: sorting_options,
|
|
3811
3717
|
args_for_filtering_: filter_options,
|
|
3812
3718
|
search_filters_open_: search_filters_open_,
|
|
@@ -3815,7 +3721,7 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({ current_sorting_: current_s
|
|
|
3815
3721
|
dismiss_modal_: dismiss_modal_,
|
|
3816
3722
|
i18n_: i18n_
|
|
3817
3723
|
}));
|
|
3818
|
-
const { remove: remove
|
|
3724
|
+
const { remove: remove } = (0, $cV3wj$javascript_media_query)("(max-width:651px)", ({ matches: matches })=>set_is_small(matches));
|
|
3819
3725
|
cleanup_promise.then(remove);
|
|
3820
3726
|
})();
|
|
3821
3727
|
get_extra_filters_button_?.(make_open_filters_button());
|
|
@@ -3830,7 +3736,7 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({ current_sorting_: current_s
|
|
|
3830
3736
|
}
|
|
3831
3737
|
});
|
|
3832
3738
|
}
|
|
3833
|
-
function $cdea4cf8c5c071ef$var$OpenFiltersButton({ i18n_: i18n_
|
|
3739
|
+
function $cdea4cf8c5c071ef$var$OpenFiltersButton({ i18n_: i18n_, search_filters_open_: search_filters_open_, search_sorting_open_: search_sorting_open_, filter_button_width_: filter_button_width_, tabindex_: tabindex_, number_of_rendered_selected_filters_items_: [num_selected_filters] }) {
|
|
3834
3740
|
const filters_closed = (0, $cV3wj$createMemo)(()=>!search_filters_open_[0]());
|
|
3835
3741
|
// We assume in embedded_num_products that this is a single HTMLElement so pls change there if you change it here
|
|
3836
3742
|
return (0, $cV3wj$ssr)($cdea4cf8c5c071ef$var$_tmpl$5, (0, $cV3wj$ssrHydrationKey)(), (0, $cV3wj$escape)((0, $cV3wj$createComponent)((0, $cV3wj$Show), {
|
|
@@ -3854,7 +3760,7 @@ function $cdea4cf8c5c071ef$var$OpenFiltersButton({ i18n_: i18n_ , search_filters
|
|
|
3854
3760
|
}
|
|
3855
3761
|
})), (0, $cV3wj$escape)(i18n_.filter_text_()));
|
|
3856
3762
|
}
|
|
3857
|
-
function $cdea4cf8c5c071ef$var$OpenSortingButton({ i18n_: i18n_
|
|
3763
|
+
function $cdea4cf8c5c071ef$var$OpenSortingButton({ i18n_: i18n_, get_current_sorting_: get_current_sorting_, search_filters_open_: search_filters_open_, available_sortings_: available_sortings_, search_sorting_open_: search_sorting_open_, sort_button_width_: sort_button_width_, tabindex_: tabindex_, meta_of_currently_selected_sorting_: meta_of_currently_selected_sorting_ }) {
|
|
3858
3764
|
const sorting_closed = (0, $cV3wj$createMemo)(()=>!search_sorting_open_[0]());
|
|
3859
3765
|
// We assume in embedded_num_products that this is a single HTMLElement so pls change there if you change it here
|
|
3860
3766
|
return (0, $cV3wj$ssr)($cdea4cf8c5c071ef$var$_tmpl$6, (0, $cV3wj$ssrHydrationKey)(), `${!sorting_closed() ? "major" : ""} ${sorting_closed() ? "minor" : ""} toggle-button for-sorting major-minor-transition`, (0, $cV3wj$ssrAttribute)("tabindex", (0, $cV3wj$escape)(tabindex_, true), false) + (0, $cV3wj$ssrAttribute)("aria-label", (0, $cV3wj$escape)((sorting_closed() ? i18n_.open_sorting_ : i18n_.close_sorting_)(), true), false), (0, $cV3wj$ssrStyle)(sort_button_width_?.() ? {
|
|
@@ -3882,14 +3788,9 @@ function $cdea4cf8c5c071ef$var$OpenSortingButton({ i18n_: i18n_ , get_current_so
|
|
|
3882
3788
|
|
|
3883
3789
|
|
|
3884
3790
|
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
3791
|
const $bf52d9f9eebd1938$var$closing_functions = /*@__PURE__*/ new Set();
|
|
3891
3792
|
const $bf52d9f9eebd1938$export$22970a0140fc759c = /*@__PURE__*/ (0, $cV3wj$createSignal)(false);
|
|
3892
|
-
function $bf52d9f9eebd1938$export$5196e4c01fa56fcb({ children: children
|
|
3793
|
+
function $bf52d9f9eebd1938$export$5196e4c01fa56fcb({ children: children, on_close_: on_close_, close_after_: close_after_, ...more_attributes }) {
|
|
3893
3794
|
let close_toast_;
|
|
3894
3795
|
const stay_open_promise = new Promise((r)=>close_toast_ = r);
|
|
3895
3796
|
(0, $cV3wj$catchify)(async ()=>{
|
|
@@ -3935,7 +3836,7 @@ function $bf52d9f9eebd1938$export$5196e4c01fa56fcb({ children: children , on_clo
|
|
|
3935
3836
|
// let other toasts close us if they open while we're still here
|
|
3936
3837
|
$bf52d9f9eebd1938$var$closing_functions.add(close_toast_);
|
|
3937
3838
|
set_is_showing_toast(true);
|
|
3938
|
-
const handler = (0, $cV3wj$catchify)(({ key: key
|
|
3839
|
+
const handler = (0, $cV3wj$catchify)(({ key: key })=>{
|
|
3939
3840
|
if (key === "Escape") // make pressing escape close the toast
|
|
3940
3841
|
close_toast_();
|
|
3941
3842
|
});
|
|
@@ -3991,7 +3892,6 @@ function $bf52d9f9eebd1938$export$5196e4c01fa56fcb({ children: children , on_clo
|
|
|
3991
3892
|
|
|
3992
3893
|
|
|
3993
3894
|
|
|
3994
|
-
|
|
3995
3895
|
const $f9182ab2348d1080$var$_tmpl$ = [
|
|
3996
3896
|
"<svg",
|
|
3997
3897
|
' xmlns="http://www.w3.org/2000/svg" width="14" height="14"><path d="M6.402.453L2.203 4.652a.35.35 0 0 0 0 .496c.137.137.359.137.492 0l3.605-3.605v11.406a.35.35 0 0 0 .348.352.35.35 0 0 0 .352-.352V1.543l3.602 3.605a.35.35 0 0 0 .496 0c.066-.07.102-.16.102-.25a.35.35 0 0 0-.102-.246L6.895.453c-.133-.137-.355-.137-.492 0zm0 0"></path></svg>'
|
|
@@ -4001,7 +3901,6 @@ function $f9182ab2348d1080$export$2624c5890f1bbcf7() {
|
|
|
4001
3901
|
}
|
|
4002
3902
|
|
|
4003
3903
|
|
|
4004
|
-
|
|
4005
3904
|
const $0b0380f75d729d63$var$_tmpl$ = [
|
|
4006
3905
|
"<div",
|
|
4007
3906
|
' class="',
|
|
@@ -4016,7 +3915,7 @@ const $0b0380f75d729d63$var$_tmpl$ = [
|
|
|
4016
3915
|
function $0b0380f75d729d63$export$b23abd26de154ede(props) {
|
|
4017
3916
|
if (0, $cV3wj$isServer) return; // won't show in initial render and need scroll position
|
|
4018
3917
|
const [is_small, set_is_small] = (0, $cV3wj$createSignal)(true);
|
|
4019
|
-
(0, $cV3wj$onCleanup)((0, $cV3wj$javascript_media_query)("(max-width:651px)", ({ matches: matches
|
|
3918
|
+
(0, $cV3wj$onCleanup)((0, $cV3wj$javascript_media_query)("(max-width:651px)", ({ matches: matches })=>set_is_small(matches)).remove);
|
|
4020
3919
|
return (0, $cV3wj$createComponent)((0, $cV3wj$Show), {
|
|
4021
3920
|
get when () {
|
|
4022
3921
|
return is_small();
|
|
@@ -4026,7 +3925,7 @@ function $0b0380f75d729d63$export$b23abd26de154ede(props) {
|
|
|
4026
3925
|
}
|
|
4027
3926
|
});
|
|
4028
3927
|
}
|
|
4029
|
-
function $0b0380f75d729d63$var$ActualFloatingButtons({ search_filters_open_: [get_search_filters_open_, set_search_filters_open_]
|
|
3928
|
+
function $0b0380f75d729d63$var$ActualFloatingButtons({ search_filters_open_: [get_search_filters_open_, set_search_filters_open_], search_sorting_open_: [get_search_sorting_open_, set_search_sorting_open_], current_sorting_: current_sorting_, sort_and_filter_element_: sort_and_filter_element_, i18n_: i18n_ }) {
|
|
4030
3929
|
let old_pos = scrollY;
|
|
4031
3930
|
let diff_over_second_or_touch = 0; // for things not supporting touch events
|
|
4032
3931
|
let timeout;
|
|
@@ -4105,10 +4004,9 @@ function $0b0380f75d729d63$var$ActualFloatingButtons({ search_filters_open_: [ge
|
|
|
4105
4004
|
|
|
4106
4005
|
|
|
4107
4006
|
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4007
|
+
const $4147651646da990a$var$fallback_operator = "in";
|
|
4008
|
+
const $4147651646da990a$var$fallback_token = "";
|
|
4009
|
+
const $4147651646da990a$var$legacy_filter_prefix = "filter_";
|
|
4112
4010
|
const $4147651646da990a$var$operator_map = {
|
|
4113
4011
|
"eq": "≡",
|
|
4114
4012
|
"neq": "≠",
|
|
@@ -4124,6 +4022,10 @@ const $4147651646da990a$var$range_delimiter = "-";
|
|
|
4124
4022
|
const $4147651646da990a$var$string_item_delimiter = "‚"; // This is not a comma but a comma-like character that browsers will render in the URL bar.
|
|
4125
4023
|
const $4147651646da990a$var$array_item_delimiter = "‣"; // FIXME: decide on a character. Could theoretically be a double string delimiter.
|
|
4126
4024
|
const $4147651646da990a$var$empty_item_replacement = "0️⃣";
|
|
4025
|
+
const $4147651646da990a$var$op_to_token = (op)=>{
|
|
4026
|
+
if (op === $4147651646da990a$var$fallback_operator) return $4147651646da990a$var$fallback_token;
|
|
4027
|
+
return $4147651646da990a$var$operator_map[op];
|
|
4028
|
+
};
|
|
4127
4029
|
/**
|
|
4128
4030
|
* Checks if a given array of filter data can be neatly serialized into an URL query parameter, or if it should fall back to JSON+base64.
|
|
4129
4031
|
* The requirements are either an array of strings, containing no reserved characters, or an array of arrays of strings, containing no reserved characters.
|
|
@@ -4187,35 +4089,40 @@ function $4147651646da990a$var$decode_filter_data(op, encoded_data) {
|
|
|
4187
4089
|
}
|
|
4188
4090
|
function $4147651646da990a$export$58aa3f171519b6d7(filters, search_params, filter_query_param_prefix) {
|
|
4189
4091
|
for (const filter of filters){
|
|
4190
|
-
const { field: field
|
|
4092
|
+
const { field: field, op: op, data: data } = filter;
|
|
4191
4093
|
const encoded_data = $4147651646da990a$var$encode_filter_data(op, data);
|
|
4192
|
-
search_params.set(filter_query_param_prefix + field + $4147651646da990a$var$
|
|
4094
|
+
search_params.set(filter_query_param_prefix + field + $4147651646da990a$var$op_to_token(op), encoded_data);
|
|
4193
4095
|
}
|
|
4194
4096
|
}
|
|
4195
4097
|
function $4147651646da990a$export$f934fa24c3a86811(search_params, filter_query_param_prefix) {
|
|
4196
4098
|
const found_filters = [];
|
|
4197
4099
|
for (const key of search_params.keys()){
|
|
4198
|
-
|
|
4100
|
+
// Allow for backwards compatibility with the old filter query param prefix
|
|
4101
|
+
let chosen_prefix = filter_query_param_prefix;
|
|
4102
|
+
if (!key.startsWith(chosen_prefix)) {
|
|
4103
|
+
chosen_prefix = $4147651646da990a$var$legacy_filter_prefix;
|
|
4104
|
+
if (!key.startsWith(chosen_prefix)) continue;
|
|
4105
|
+
}
|
|
4199
4106
|
const encoded_data = search_params.get(key);
|
|
4200
4107
|
if (!encoded_data) continue;
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
}
|
|
4108
|
+
const [op, token] = Object.entries($4147651646da990a$var$operator_map).find(([, token])=>key.endsWith(token)) || [
|
|
4109
|
+
$4147651646da990a$var$fallback_operator,
|
|
4110
|
+
$4147651646da990a$var$fallback_token
|
|
4111
|
+
];
|
|
4112
|
+
const data = $4147651646da990a$var$decode_filter_data(op, encoded_data);
|
|
4113
|
+
if (!data) continue;
|
|
4114
|
+
const field = key.slice(chosen_prefix.length, token ? -token.length : undefined);
|
|
4115
|
+
found_filters.push({
|
|
4116
|
+
field: field,
|
|
4117
|
+
op: op,
|
|
4118
|
+
data: data
|
|
4119
|
+
});
|
|
4213
4120
|
}
|
|
4214
4121
|
return found_filters;
|
|
4215
4122
|
}
|
|
4216
4123
|
function $4147651646da990a$export$62acb285a7579555(sorting, search_params, sorting_query_param) {
|
|
4217
4124
|
if (!sorting) return;
|
|
4218
|
-
const { field: field
|
|
4125
|
+
const { field: field, order: order } = sorting;
|
|
4219
4126
|
const ascending = order === "asc";
|
|
4220
4127
|
search_params.set(sorting_query_param, field + (ascending ? $4147651646da990a$var$ascending_token : $4147651646da990a$var$descending_token));
|
|
4221
4128
|
}
|
|
@@ -4238,14 +4145,14 @@ function $4147651646da990a$export$916e6850778505f6(search_params, filter_query_p
|
|
|
4238
4145
|
const keys = [
|
|
4239
4146
|
...search_params.keys()
|
|
4240
4147
|
];
|
|
4241
|
-
for (const key of keys)if (key.startsWith(filter_query_param_prefix) || key === sorting_query_param) search_params.delete(key);
|
|
4148
|
+
for (const key of keys)if (key.startsWith(filter_query_param_prefix) || key === sorting_query_param || key.startsWith($4147651646da990a$var$legacy_filter_prefix)) search_params.delete(key);
|
|
4242
4149
|
}
|
|
4243
4150
|
const $4147651646da990a$export$cf5feb2102aec7f2 = "went_sideways_clear_filters";
|
|
4244
|
-
function $4147651646da990a$export$43cd1e747fecd42e({ to_url_: to_url_
|
|
4151
|
+
function $4147651646da990a$export$43cd1e747fecd42e({ to_url_: to_url_, set_clearing_flag_: set_clearing_flag_, from_search_params_: from_search_params_ = new URLSearchParams(location.search), sorting_query_param_: sorting_query_param_, filter_query_param_prefix_: filter_query_param_prefix_ }) {
|
|
4245
4152
|
if (!to_url_) return to_url_;
|
|
4246
4153
|
const was_url_object = to_url_ instanceof URL;
|
|
4247
4154
|
const url_object = was_url_object ? to_url_ : new URL(to_url_, location.origin);
|
|
4248
|
-
const { searchParams: searchParams
|
|
4155
|
+
const { searchParams: searchParams } = url_object;
|
|
4249
4156
|
if (set_clearing_flag_) searchParams.set($4147651646da990a$export$cf5feb2102aec7f2, "true");
|
|
4250
4157
|
if (from_search_params_.has(sorting_query_param_)) searchParams.set(sorting_query_param_, from_search_params_.get(sorting_query_param_));
|
|
4251
4158
|
for (const key of from_search_params_.keys())if (key.startsWith(filter_query_param_prefix_)) searchParams.set(key, from_search_params_.get(key));
|
|
@@ -4270,7 +4177,7 @@ const $dfa5b6f7c5e421df$var$_tmpl$ = [
|
|
|
4270
4177
|
' class="separator">',
|
|
4271
4178
|
"</span>"
|
|
4272
4179
|
];
|
|
4273
|
-
function $dfa5b6f7c5e421df$export$5646050d516e06bc({ crumb_data_: get_api_crumb_data
|
|
4180
|
+
function $dfa5b6f7c5e421df$export$5646050d516e06bc({ crumb_data_: get_api_crumb_data, router_: router_, i18n_: i18n_, filter_query_param_prefix_: filter_query_param_prefix_, sorting_query_param_: sorting_query_param_ }) {
|
|
4274
4181
|
const placeholder_crumb_data = [
|
|
4275
4182
|
,
|
|
4276
4183
|
,
|
|
@@ -4328,10 +4235,6 @@ function $dfa5b6f7c5e421df$export$5646050d516e06bc({ crumb_data_: get_api_crumb_
|
|
|
4328
4235
|
|
|
4329
4236
|
|
|
4330
4237
|
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
4238
|
const $06edf3aec9073663$var$_tmpl$ = [
|
|
4336
4239
|
"<nav",
|
|
4337
4240
|
' class="quicklinks"',
|
|
@@ -4347,7 +4250,7 @@ const $06edf3aec9073663$var$_tmpl$ = [
|
|
|
4347
4250
|
">",
|
|
4348
4251
|
"</a>"
|
|
4349
4252
|
];
|
|
4350
|
-
function $06edf3aec9073663$export$466cdc317043f6cb({ quicklinks_data_: quicklinks_data_
|
|
4253
|
+
function $06edf3aec9073663$export$466cdc317043f6cb({ quicklinks_data_: quicklinks_data_, router_: router_, current_query_id_: current_query_id_, breadcrumb_data_: breadcrumb_data_, i18n_: i18n_, sorting_query_param_: sorting_query_param_, filter_query_param_prefix_: filter_query_param_prefix_ }) {
|
|
4351
4254
|
let scrolling_logic_ran_for_query_id = false;
|
|
4352
4255
|
let last_scroll_position;
|
|
4353
4256
|
let scroll_to_element_on_dom_insertion;
|
|
@@ -4367,7 +4270,7 @@ function $06edf3aec9073663$export$466cdc317043f6cb({ quicklinks_data_: quicklink
|
|
|
4367
4270
|
const mutation_plugins = [
|
|
4368
4271
|
function() {
|
|
4369
4272
|
if (!scrolling_logic_ran_for_query_id) return;
|
|
4370
|
-
const { scrollLeft: scrollLeft
|
|
4273
|
+
const { scrollLeft: scrollLeft } = this.insert_here;
|
|
4371
4274
|
if (scrollLeft > 0) {
|
|
4372
4275
|
last_scroll_position = scrollLeft;
|
|
4373
4276
|
const current_id = (0, $cV3wj$untrack)(current_query_id_);
|
|
@@ -4405,9 +4308,9 @@ function $06edf3aec9073663$export$466cdc317043f6cb({ quicklinks_data_: quicklink
|
|
|
4405
4308
|
faded_opacity_: 0.5,
|
|
4406
4309
|
mutation_plugins_: mutation_plugins,
|
|
4407
4310
|
slider_ref_: (slider)=>{
|
|
4408
|
-
const { insert_here: insert_here
|
|
4311
|
+
const { insert_here: insert_here, intersecting_items_object: intersecting_items_object } = slider;
|
|
4409
4312
|
sliding_element = insert_here;
|
|
4410
|
-
(0, $cV3wj$observer).onexists(insert_here, ({ element: element
|
|
4313
|
+
(0, $cV3wj$observer).onexists(insert_here, ({ element: element })=>{
|
|
4411
4314
|
if (scroll_to_element_on_dom_insertion == undefined) {
|
|
4412
4315
|
if (!element.scrollLeft) {
|
|
4413
4316
|
const target_position = last_scroll_position;
|
|
@@ -4478,7 +4381,7 @@ function $06edf3aec9073663$export$466cdc317043f6cb({ quicklinks_data_: quicklink
|
|
|
4478
4381
|
// Solution: instead of not adding the state to the url, add a flag to the link if it's a sibling and then display the toast on load if the flag is set
|
|
4479
4382
|
const is_sibling = (0, $cV3wj$createMemo)(()=>{
|
|
4480
4383
|
const current_id = current_query_id_();
|
|
4481
|
-
return quicklinks_data_()?.some(({ query_id: query_id
|
|
4384
|
+
return quicklinks_data_()?.some(({ query_id: query_id })=>query_id === current_id);
|
|
4482
4385
|
});
|
|
4483
4386
|
const href = (0, $cV3wj$createMemo)(()=>// We don't want these links to delete the sort and filter state by default, only if `clear_filters_when_going_sideways` explicitly clears them
|
|
4484
4387
|
(0, $4147651646da990a$export$43cd1e747fecd42e)({
|
|
@@ -4504,7 +4407,7 @@ function $06edf3aec9073663$export$466cdc317043f6cb({ quicklinks_data_: quicklink
|
|
|
4504
4407
|
|
|
4505
4408
|
const $641bba2917fe862b$var$max_history_change_frequency = 300;
|
|
4506
4409
|
const $641bba2917fe862b$var$api_max_products_per_request = 100;
|
|
4507
|
-
function $641bba2917fe862b$export$6e49da55e449af7c({ scroll_restoration_data_: [, set_scroll_restoration_data]
|
|
4410
|
+
function $641bba2917fe862b$export$6e49da55e449af7c({ scroll_restoration_data_: [, set_scroll_restoration_data], last_result_in_viewport_: [get_last_result_in_viewport_], id_: id_, can_write_scroll_restoration_: can_write_scroll_restoration_ }) {
|
|
4508
4411
|
// store last actually seen (within viewport) product in history.state
|
|
4509
4412
|
let last_time_history_changed = 0;
|
|
4510
4413
|
let set_to_later;
|
|
@@ -4553,8 +4456,8 @@ function $641bba2917fe862b$export$6e49da55e449af7c({ scroll_restoration_data_: [
|
|
|
4553
4456
|
}));
|
|
4554
4457
|
(0, $cV3wj$onCleanup)(()=>clearTimeout(timeout)); // could cause weird bugs otherwise
|
|
4555
4458
|
}
|
|
4556
|
-
async function $641bba2917fe862b$export$cc42dd29bf655ab6({ scroll_restoration_data_: [get_scroll_restoration_data]
|
|
4557
|
-
const to_fetch_according_to_state = (0, $cV3wj$untrack)(get_scroll_restoration_data).find(({ for_id: for_id
|
|
4459
|
+
async function $641bba2917fe862b$export$cc42dd29bf655ab6({ scroll_restoration_data_: [get_scroll_restoration_data], make_request_: make_request_, min_products_to_fetch_: min_products_to_fetch_, id_: id_ }) {
|
|
4460
|
+
const to_fetch_according_to_state = (0, $cV3wj$untrack)(get_scroll_restoration_data).find(({ for_id: for_id })=>for_id === id_)?.min_results_loaded ?? 0;
|
|
4558
4461
|
const total_products_to_fetch = to_fetch_according_to_state < min_products_to_fetch_ ? min_products_to_fetch_ : to_fetch_according_to_state + 20; // if we fetch according to state, fetch some more in case that the screen size increased, there's some in-accuracy or for the user to scroll. Sometimes the load more post processor will trigger to fetch more after this, but I think that's ok.
|
|
4559
4462
|
if (total_products_to_fetch <= $641bba2917fe862b$var$api_max_products_per_request) return await make_request_(total_products_to_fetch);
|
|
4560
4463
|
const displays = [];
|
|
@@ -4626,8 +4529,6 @@ let $f86ba724282f6690$export$44dad306455dddf;
|
|
|
4626
4529
|
|
|
4627
4530
|
|
|
4628
4531
|
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
4532
|
const $e9342fb3ac73a54a$var$_tmpl$ = [
|
|
4632
4533
|
"<div",
|
|
4633
4534
|
' class="statement">',
|
|
@@ -4645,7 +4546,7 @@ function $e9342fb3ac73a54a$export$8895d39404bd2bb1(props) {
|
|
|
4645
4546
|
// if we get called to close the toast before it has shown, never show it
|
|
4646
4547
|
show_configured_toast = ()=>{};
|
|
4647
4548
|
};
|
|
4648
|
-
const { user_triggered_: user_triggered_
|
|
4549
|
+
const { user_triggered_: user_triggered_, i18n_: i18n_, also_clear_sorting_: also_clear_sorting_, local_filter_cache_: [get_local_filter_cache, set_local_filter_cache], selected_filters_: [get_selected_filters, set_selected_filters], expanded_hierarchical_filters_: [get_expanded_hierarchical_filters, set_expanded_hierarchical_filters], delay_toast_: delay_toast_ } = props;
|
|
4649
4550
|
const previous_selected_filters = (0, $cV3wj$untrack)(get_selected_filters);
|
|
4650
4551
|
if (!previous_selected_filters.length) {
|
|
4651
4552
|
// no filters selected, still clear sorting if applicable but don't display a toast for that since it's very minor
|
|
@@ -4677,7 +4578,7 @@ function $e9342fb3ac73a54a$export$8895d39404bd2bb1(props) {
|
|
|
4677
4578
|
}));
|
|
4678
4579
|
});
|
|
4679
4580
|
let show_configured_toast = ()=>{
|
|
4680
|
-
({ close_toast_: close_toast_
|
|
4581
|
+
({ close_toast_: close_toast_ } = (0, $bf52d9f9eebd1938$export$5196e4c01fa56fcb)({
|
|
4681
4582
|
class: "cleared_filters",
|
|
4682
4583
|
close_after_: 30000,
|
|
4683
4584
|
on_close_: on_toast_hidden,
|
|
@@ -4692,7 +4593,7 @@ function $e9342fb3ac73a54a$export$8895d39404bd2bb1(props) {
|
|
|
4692
4593
|
}
|
|
4693
4594
|
|
|
4694
4595
|
|
|
4695
|
-
function $e7fce80abe608e01$export$3945d6db2dfd3d12({ crumb_data_: crumb_data_
|
|
4596
|
+
function $e7fce80abe608e01$export$3945d6db2dfd3d12({ crumb_data_: crumb_data_, query_id_: query_id_, i18n_: i18n_, selected_filters_: selected_filters_, local_filter_cache_: local_filter_cache_, expanded_hierarchical_filters_: expanded_hierarchical_filters_, plp_results_: plp_results_, sideways_filter_clearing_flag_: sideways_filter_clearing_flag_ }) {
|
|
4696
4597
|
// If we just got opened in a new tab, clear filters instantly and remove the flag
|
|
4697
4598
|
$e7fce80abe608e01$var$clear_if_opened_new_tab_with_sideways_url_params_flag({
|
|
4698
4599
|
plp_results_: plp_results_,
|
|
@@ -4719,7 +4620,7 @@ function $e7fce80abe608e01$export$3945d6db2dfd3d12({ crumb_data_: crumb_data_ ,
|
|
|
4719
4620
|
const went_downwards = previous_length < new_length;
|
|
4720
4621
|
const shorter_array = went_upwards ? new_crumb_data : previous_crumb_data;
|
|
4721
4622
|
const longer_array = went_upwards ? previous_crumb_data : new_crumb_data;
|
|
4722
|
-
if (!((went_upwards || went_downwards) && shorter_array.every(({ query_id: query_id
|
|
4623
|
+
if (!((went_upwards || went_downwards) && shorter_array.every(({ query_id: query_id }, index)=>longer_array[index].query_id === query_id))) {
|
|
4723
4624
|
// We went sideways, not up or down. Clear filters.
|
|
4724
4625
|
(0, $e9342fb3ac73a54a$export$8895d39404bd2bb1)({
|
|
4725
4626
|
user_triggered_: false,
|
|
@@ -4738,7 +4639,7 @@ function $e7fce80abe608e01$export$3945d6db2dfd3d12({ crumb_data_: crumb_data_ ,
|
|
|
4738
4639
|
if (!allow_filter_clearing) allow_filter_clearing = true;
|
|
4739
4640
|
})));
|
|
4740
4641
|
}
|
|
4741
|
-
function $e7fce80abe608e01$var$clear_if_opened_new_tab_with_sideways_url_params_flag({ plp_results_: plp_results_
|
|
4642
|
+
function $e7fce80abe608e01$var$clear_if_opened_new_tab_with_sideways_url_params_flag({ plp_results_: plp_results_, expanded_hierarchical_filters_: expanded_hierarchical_filters_, i18n_: i18n_, selected_filters_: selected_filters_, local_filter_cache_: local_filter_cache_, sideways_filter_clearing_flag_: [get_sideways_filter_clearing_flag_, set_sideways_filter_clearing_flag_] }) {
|
|
4742
4643
|
const tracking_function_for_plp_results = (0, $cV3wj$createReaction)(()=>{
|
|
4743
4644
|
// On first rendering of the CategoryPage (after we have results), check if we got to this URL by going sideways in QuickLinks and clear filters with toast if so
|
|
4744
4645
|
if (!(0, $cV3wj$untrack)(get_sideways_filter_clearing_flag_)) return;
|
|
@@ -4761,10 +4662,36 @@ function $e7fce80abe608e01$var$clear_if_opened_new_tab_with_sideways_url_params_
|
|
|
4761
4662
|
|
|
4762
4663
|
|
|
4763
4664
|
|
|
4764
|
-
|
|
4765
4665
|
const $4fb3a1cf207a7d5c$export$5c28802497c8a83c = /*@__PURE__*/ Symbol("category_title_type");
|
|
4766
4666
|
|
|
4767
4667
|
|
|
4668
|
+
|
|
4669
|
+
function $2ab89d64b7f1d5ef$export$d31a1a1a83ad9413(plp_results_, [get_selected_filters, set_selected_filters]) {
|
|
4670
|
+
(0, $cV3wj$createComputed)(()=>{
|
|
4671
|
+
const available_filters = plp_results_()?.filters;
|
|
4672
|
+
if (!available_filters) return;
|
|
4673
|
+
const selected_filters = get_selected_filters();
|
|
4674
|
+
if (!selected_filters) return;
|
|
4675
|
+
const new_filters = [];
|
|
4676
|
+
let modified_filters = false;
|
|
4677
|
+
for(let i = 0; i < selected_filters.length; i++){
|
|
4678
|
+
const selected_filter = selected_filters[i];
|
|
4679
|
+
const available_filter = available_filters.find((available_filter)=>available_filter.field === selected_filter.field && available_filter.op === selected_filter.op);
|
|
4680
|
+
const available_filter_old_filter_link = available_filters.find((available_filter)=>available_filter.actual_field === selected_filter.field && available_filter.op === selected_filter.op);
|
|
4681
|
+
if (!available_filter && available_filter_old_filter_link) {
|
|
4682
|
+
new_filters.push({
|
|
4683
|
+
...selected_filter,
|
|
4684
|
+
field: available_filter_old_filter_link.field
|
|
4685
|
+
}); // <- Change the field to be the new field which actually is group_title
|
|
4686
|
+
modified_filters = true;
|
|
4687
|
+
} else new_filters.push(selected_filter);
|
|
4688
|
+
}
|
|
4689
|
+
if (modified_filters) // This will unfortunately trigger a refetch which isn't great UX but it's the best we can do for now
|
|
4690
|
+
set_selected_filters(new_filters);
|
|
4691
|
+
});
|
|
4692
|
+
}
|
|
4693
|
+
|
|
4694
|
+
|
|
4768
4695
|
const $df5d81d0fe61ff21$var$_tmpl$ = [
|
|
4769
4696
|
"<div",
|
|
4770
4697
|
' class="product-count"><!--#-->',
|
|
@@ -4790,7 +4717,7 @@ const $df5d81d0fe61ff21$var$_tmpl$ = [
|
|
|
4790
4717
|
"<!--/--><!--#-->",
|
|
4791
4718
|
"<!--/--></div>"
|
|
4792
4719
|
];
|
|
4793
|
-
function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({ depict_api_: depict_api_
|
|
4720
|
+
function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({ depict_api_: depict_api_, query_id_: query_id_, listing_type_: listing_type_, 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_, expanded_hierarchical_filters_: expanded_hierarchical_filters_, local_filter_cache_: local_filter_cache_, tenant_: tenant_, market_: market_, router_: router_, show_quicklinks_: show_quicklinks_, category_title_: category_title_, show_breadcrumbs_: show_breadcrumbs_, layout_options_: layout_options_, scroll_restoration_data_: scroll_restoration_data_, product_card_template_: product_card_template_, sideways_filter_clearing_flag_: sideways_filter_clearing_flag_, sorting_query_param_: sorting_query_param_, filter_query_param_prefix_: filter_query_param_prefix_ }) {
|
|
4794
4721
|
let results_for;
|
|
4795
4722
|
let only_show_filters_opener_;
|
|
4796
4723
|
let middle_elements_;
|
|
@@ -4882,6 +4809,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({ depict_api_: depict_api_ ,
|
|
|
4882
4809
|
return i18n_.product_();
|
|
4883
4810
|
}
|
|
4884
4811
|
})));
|
|
4812
|
+
(0, $2ab89d64b7f1d5ef$export$d31a1a1a83ad9413)(plp_results_, selected_filters_);
|
|
4885
4813
|
// aiming to have as little unneeded functionality in the bundle as possible, therefore we have two kinds of components that can "plug in" here depending on if there should be a title in the category page along with the count in a row above the buttons on mobile or if it should merge between the buttons when possible
|
|
4886
4814
|
if (category_title_type === "simple") {
|
|
4887
4815
|
const CategoryTitleComponent = category_title_;
|
|
@@ -4894,7 +4822,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({ depict_api_: depict_api_ ,
|
|
|
4894
4822
|
}
|
|
4895
4823
|
});
|
|
4896
4824
|
} else if (category_title_type == "interactive") {
|
|
4897
|
-
({ middle_elements_: middle_elements_
|
|
4825
|
+
({ middle_elements_: middle_elements_, only_show_filters_opener_: only_show_filters_opener_, on_filters_constructed_: on_filters_constructed_ } = category_title_({
|
|
4898
4826
|
make_product_count_: make_product_count_,
|
|
4899
4827
|
is_slim_: is_slim_,
|
|
4900
4828
|
set_observed_results_filters_elements_: set_observed_results_filters_elements_,
|
|
@@ -5213,12 +5141,12 @@ function $ccd5db07a3a069c5$export$477caf01aecaeb2a(options) {
|
|
|
5213
5141
|
const [get_current_href, set_current_href] = (0, $cV3wj$createSignal)(globalThis?.location?.href ?? "https://example.com");
|
|
5214
5142
|
const history_change_handler = (0, $cV3wj$catchify)(()=>set_current_href(location.href));
|
|
5215
5143
|
const owner = (0, $cV3wj$getOwner)() || (0, $cV3wj$createRoot)(()=>(0, $cV3wj$getOwner)());
|
|
5216
|
-
const { sorting_query_param_: sorting_query_param_
|
|
5144
|
+
const { sorting_query_param_: sorting_query_param_, filter_query_param_prefix_: filter_query_param_prefix_ } = options;
|
|
5217
5145
|
let writer_started = false;
|
|
5218
5146
|
(0, $cV3wj$instant_exec_on_suspect_history_change).add(history_change_handler);
|
|
5219
5147
|
(0, $cV3wj$onCleanup)(()=>(0, $cV3wj$instant_exec_on_suspect_history_change).delete(history_change_handler));
|
|
5220
5148
|
(0, $cV3wj$createComputed)(()=>{
|
|
5221
|
-
const { searchParams: searchParams
|
|
5149
|
+
const { searchParams: searchParams } = new URL(get_current_href());
|
|
5222
5150
|
(0, $cV3wj$batch)(()=>{
|
|
5223
5151
|
const found_sorting = (0, $4147651646da990a$export$766e9676e74997d3)(searchParams, sorting_query_param_);
|
|
5224
5152
|
if (found_sorting) {
|
|
@@ -5228,7 +5156,7 @@ function $ccd5db07a3a069c5$export$477caf01aecaeb2a(options) {
|
|
|
5228
5156
|
} else set_sorting();
|
|
5229
5157
|
const found_filters = (0, $4147651646da990a$export$f934fa24c3a86811)(searchParams, filter_query_param_prefix_);
|
|
5230
5158
|
const selected_filters = (0, $cV3wj$untrack)(get_selected_filters_);
|
|
5231
|
-
const found_filters_map = new Map(found_filters.map(({ field: field
|
|
5159
|
+
const found_filters_map = new Map(found_filters.map(({ field: field, op: op, data: data })=>[
|
|
5232
5160
|
JSON.stringify([
|
|
5233
5161
|
field,
|
|
5234
5162
|
op
|
|
@@ -5236,7 +5164,7 @@ function $ccd5db07a3a069c5$export$477caf01aecaeb2a(options) {
|
|
|
5236
5164
|
data
|
|
5237
5165
|
]));
|
|
5238
5166
|
// Sorry for this diffing algorithm lol. Looking forwards to Records and Tuples.
|
|
5239
|
-
if (selected_filters.length !== found_filters.length || !selected_filters.every(({ field: field
|
|
5167
|
+
if (selected_filters.length !== found_filters.length || !selected_filters.every(({ field: field, op: op, data: data })=>JSON.stringify(found_filters_map.get(JSON.stringify([
|
|
5240
5168
|
field,
|
|
5241
5169
|
op
|
|
5242
5170
|
]))) === JSON.stringify(data))) set_selected_filters(found_filters);
|
|
@@ -5272,7 +5200,7 @@ function $ccd5db07a3a069c5$export$477caf01aecaeb2a(options) {
|
|
|
5272
5200
|
}
|
|
5273
5201
|
/**
|
|
5274
5202
|
* Writes the sorting and filters to the URL query parameters when they change.
|
|
5275
|
-
*/ function $ccd5db07a3a069c5$var$start_href_writer({ get_sorting_: get_sorting_
|
|
5203
|
+
*/ function $ccd5db07a3a069c5$var$start_href_writer({ get_sorting_: get_sorting_, get_selected_filters_: get_selected_filters_, router_: router_, get_has_sideways_filter_clearing_flag_: get_has_sideways_filter_clearing_flag_, sorting_query_param_: sorting_query_param_, filter_query_param_prefix_: filter_query_param_prefix_ }) {
|
|
5276
5204
|
(0, $cV3wj$createEffect)((0, $cV3wj$on)([
|
|
5277
5205
|
get_sorting_,
|
|
5278
5206
|
get_selected_filters_,
|
|
@@ -5280,7 +5208,7 @@ function $ccd5db07a3a069c5$export$477caf01aecaeb2a(options) {
|
|
|
5280
5208
|
], ([sorting, filters, has_sideways_filter_clearing_flag])=>{
|
|
5281
5209
|
const current_href = location.href;
|
|
5282
5210
|
const url_object = new URL(current_href);
|
|
5283
|
-
const { searchParams: searchParams
|
|
5211
|
+
const { searchParams: searchParams } = url_object;
|
|
5284
5212
|
(0, $4147651646da990a$export$916e6850778505f6)(searchParams, filter_query_param_prefix_, sorting_query_param_);
|
|
5285
5213
|
(0, $4147651646da990a$export$62acb285a7579555)(sorting, searchParams, sorting_query_param_);
|
|
5286
5214
|
(0, $4147651646da990a$export$58aa3f171519b6d7)(filters, searchParams, filter_query_param_prefix_);
|
|
@@ -5317,7 +5245,7 @@ class $4fd2ba03703a7d92$export$7e1297a3a19f10d8 {
|
|
|
5317
5245
|
*/ /**
|
|
5318
5246
|
* We store query_id in history.state and do operate on this both here and in js-ui, this is the key to be used which js-ui provides
|
|
5319
5247
|
*/ #throwing_on_navigation(...args) {
|
|
5320
|
-
const { on_navigation_: on_navigation_
|
|
5248
|
+
const { on_navigation_: on_navigation_ } = this;
|
|
5321
5249
|
if (typeof on_navigation_ !== "function") throw new Error("on_navigation_ is not a function");
|
|
5322
5250
|
// make sure that we don't accidentally catchify if the SDK consumer has fucked up
|
|
5323
5251
|
try {
|
|
@@ -5361,7 +5289,7 @@ class $4fd2ba03703a7d92$export$7e1297a3a19f10d8 {
|
|
|
5361
5289
|
* @param force_spa_navigation_ if you want to force SPA navigation even if on_navigation_ is set to "hard_navigation". You should only set this to true for inter-SDK-page navigations
|
|
5362
5290
|
* @param is_replace_ if you want to replace the current URL in history instead of pushing a new one
|
|
5363
5291
|
* @param category_query_id_ If you are navigating to a category and know the query_id of, please provide it. This is for making a better devEx in js-ui
|
|
5364
|
-
*/ go_to_: (0, $cV3wj$catchify)(async ({ new_url_: raw_new_url
|
|
5292
|
+
*/ go_to_: (0, $cV3wj$catchify)(async ({ new_url_: raw_new_url, event_: event_, force_spa_navigation_: force_spa_navigation_, is_replace_: is_replace_, category_query_id_: category_query_id_, scroll: scroll = true })=>{
|
|
5365
5293
|
const new_url_ = raw_new_url instanceof URL ? raw_new_url : new URL(raw_new_url, location.origin);
|
|
5366
5294
|
const wants_hard_navigation = this.on_navigation_ === "hard_navigation";
|
|
5367
5295
|
if (this.#dont_attempt_navigation(event_)) return;
|
|
@@ -5399,7 +5327,6 @@ class $4fd2ba03703a7d92$export$7e1297a3a19f10d8 {
|
|
|
5399
5327
|
}
|
|
5400
5328
|
|
|
5401
5329
|
|
|
5402
|
-
|
|
5403
5330
|
const $961b5c64bef4662f$var$_tmpl$ = [
|
|
5404
5331
|
"<div",
|
|
5405
5332
|
' class="depict plp category">',
|
|
@@ -5407,7 +5334,7 @@ const $961b5c64bef4662f$var$_tmpl$ = [
|
|
|
5407
5334
|
];
|
|
5408
5335
|
const $961b5c64bef4662f$var$min_products_to_fetch_ = 20;
|
|
5409
5336
|
const $961b5c64bef4662f$var$privately_shared_properties = /*@__PURE__*/ new WeakMap();
|
|
5410
|
-
const $961b5c64bef4662f$var$InExternalAreaDiv = ({ children: children
|
|
5337
|
+
const $961b5c64bef4662f$var$InExternalAreaDiv = ({ children: children })=>(0, $cV3wj$ssr)($961b5c64bef4662f$var$_tmpl$, (0, $cV3wj$ssrHydrationKey)() + (0, $cV3wj$ssrAttribute)("id", (0, $cV3wj$escape)((0, $f86ba724282f6690$export$44dad306455dddf).PLP_CATEGORY, true), false), (0, $cV3wj$escape)(children));
|
|
5411
5338
|
class $961b5c64bef4662f$export$f34314aa9505732e {
|
|
5412
5339
|
#router;
|
|
5413
5340
|
#locale_signal = (0, $cV3wj$createSignal)();
|
|
@@ -5415,7 +5342,7 @@ class $961b5c64bef4662f$export$f34314aa9505732e {
|
|
|
5415
5342
|
#market_signal = (0, $cV3wj$createSignal)();
|
|
5416
5343
|
#query_id_signal = (0, $cV3wj$createSignal)("");
|
|
5417
5344
|
#listing_type_signal = (0, $cV3wj$createSignal)();
|
|
5418
|
-
static #keys_constructed_with =
|
|
5345
|
+
static #keys_constructed_with = new Set();
|
|
5419
5346
|
get localization() {
|
|
5420
5347
|
// allow reactive access
|
|
5421
5348
|
return this.#locale_signal[0]();
|
|
@@ -5454,18 +5381,18 @@ class $961b5c64bef4662f$export$f34314aa9505732e {
|
|
|
5454
5381
|
set on_navigation(new_function) {
|
|
5455
5382
|
this.#router.on_navigation_ = new_function;
|
|
5456
5383
|
}
|
|
5457
|
-
constructor({ api: api
|
|
5384
|
+
constructor({ api: api, on_navigation: on_navigation, page_url_creator: page_url_creator, unique_instance_key_for_state: unique_instance_key_for_state = "", query_id_state_key: query_id_state_key, ...props_on_class }){
|
|
5458
5385
|
const owner = (0, $cV3wj$getOwner)() || (0, $cV3wj$createRoot)(()=>(0, $cV3wj$getOwner)()); // we might have an owner, if so, pass it on. Otherwise, create one so solid doesn't print warnings to the console
|
|
5459
5386
|
(0, $cV3wj$runWithOwner)(owner, ()=>{
|
|
5460
|
-
if ($961b5c64bef4662f$export$f34314aa9505732e.#keys_constructed_with.
|
|
5387
|
+
if ($961b5c64bef4662f$export$f34314aa9505732e.#keys_constructed_with.has(unique_instance_key_for_state) && !(0, $cV3wj$isServer)) // on the server we can't write stuff to history.state anyway so can have multiple
|
|
5461
5388
|
throw new Error("You can only have one instance of DepictCategory with the same uniqueInstanceKeyForState");
|
|
5462
5389
|
Object.assign(this, props_on_class); // set initial signal values
|
|
5463
5390
|
(0, $90980bd87c9960f9$export$5162a71f252e6122)();
|
|
5464
5391
|
this.#router = new (0, $4fd2ba03703a7d92$export$7e1297a3a19f10d8)("hard_navigation", query_id_state_key);
|
|
5465
5392
|
if (on_navigation) this.#router.on_navigation_ = on_navigation;
|
|
5466
5393
|
const sorting_query_param_ = "sorting" + unique_instance_key_for_state;
|
|
5467
|
-
const filter_query_param_prefix_ = "
|
|
5468
|
-
const { selected_filters_: selected_filters_
|
|
5394
|
+
const filter_query_param_prefix_ = "f" + unique_instance_key_for_state + "_";
|
|
5395
|
+
const { selected_filters_: selected_filters_, current_sorting_: current_sorting_, sideways_filter_clearing_flag_: sideways_filter_clearing_flag_ } = (0, $ccd5db07a3a069c5$export$477caf01aecaeb2a)({
|
|
5469
5396
|
router_: this.#router,
|
|
5470
5397
|
sorting_query_param_: sorting_query_param_,
|
|
5471
5398
|
filter_query_param_prefix_: filter_query_param_prefix_
|
|
@@ -5500,16 +5427,17 @@ class $961b5c64bef4662f$export$f34314aa9505732e {
|
|
|
5500
5427
|
sorting_query_param_: sorting_query_param_,
|
|
5501
5428
|
filter_query_param_prefix_: filter_query_param_prefix_
|
|
5502
5429
|
});
|
|
5503
|
-
$961b5c64bef4662f$export$f34314aa9505732e.#keys_constructed_with.
|
|
5430
|
+
$961b5c64bef4662f$export$f34314aa9505732e.#keys_constructed_with.add(unique_instance_key_for_state);
|
|
5431
|
+
(0, $cV3wj$onCleanup)(()=>$961b5c64bef4662f$export$f34314aa9505732e.#keys_constructed_with.delete(unique_instance_key_for_state));
|
|
5504
5432
|
});
|
|
5505
5433
|
}
|
|
5506
5434
|
}
|
|
5507
5435
|
function $961b5c64bef4662f$export$e2bf8ce7779e827e(props) {
|
|
5508
|
-
const { depict_category: depict_category
|
|
5436
|
+
const { depict_category: depict_category, product_card_template: product_card_template, category_title: category_title } = props;
|
|
5509
5437
|
const shared_properties = $961b5c64bef4662f$var$get_shared_properties(depict_category);
|
|
5510
5438
|
return (0, $16b52438165aafe2$export$23fca46f3143581f)(()=>{
|
|
5511
5439
|
const grid_spacing_override = (0, $cV3wj$createMemo)(()=>{
|
|
5512
|
-
const { grid_spacing: grid_spacing
|
|
5440
|
+
const { grid_spacing: grid_spacing } = props; // can be reactive
|
|
5513
5441
|
return typeof grid_spacing === "string" ? {
|
|
5514
5442
|
grid_spacing: grid_spacing
|
|
5515
5443
|
} : {
|
|
@@ -5517,7 +5445,7 @@ function $961b5c64bef4662f$export$e2bf8ce7779e827e(props) {
|
|
|
5517
5445
|
grid_spacing: grid_spacing.horizontal
|
|
5518
5446
|
};
|
|
5519
5447
|
});
|
|
5520
|
-
const { state_: { local_filter_cache: local_filter_cache_
|
|
5448
|
+
const { state_: { local_filter_cache: local_filter_cache_, filters_open: category_filters_open_, sorting_open: category_sorting_open_, expanded_filters: expanded_filters_, expanded_hierarchical_filters: expanded_hierarchical_filters_, scroll_restoration_data: scroll_restoration_data_ }, current_sorting_: current_sorting_, selected_filters_: selected_filters_, reset_history_state_: reset_history_state_, depict_api_: depict_api_, i18n_: i18n_, router_: router_, breadcrumb_signal_: breadcrumb_signal_, quicklinks_signal_: quicklinks_signal_, sideways_filter_clearing_flag_: sideways_filter_clearing_flag_, sorting_query_param_: sorting_query_param_, filter_query_param_prefix_: filter_query_param_prefix_ } = shared_properties;
|
|
5521
5449
|
(0, $cV3wj$onCleanup)(reset_history_state_);
|
|
5522
5450
|
return (0, $df5d81d0fe61ff21$export$f7d2f673fc2f091d)({
|
|
5523
5451
|
tenant_: ()=>depict_category.merchant,
|
|
@@ -5552,8 +5480,8 @@ function $961b5c64bef4662f$export$e2bf8ce7779e827e(props) {
|
|
|
5552
5480
|
});
|
|
5553
5481
|
}, "Entire CategoryPage failed");
|
|
5554
5482
|
}
|
|
5555
|
-
function $961b5c64bef4662f$export$5b7c3ce0ebe51f86({ depict_category: depict_category
|
|
5556
|
-
const { i18n_: i18n_
|
|
5483
|
+
function $961b5c64bef4662f$export$5b7c3ce0ebe51f86({ depict_category: depict_category }) {
|
|
5484
|
+
const { i18n_: i18n_, breadcrumb_signal_: [crumb_data_], router_: router_, sorting_query_param_: sorting_query_param_, filter_query_param_prefix_: filter_query_param_prefix_ } = $961b5c64bef4662f$var$get_shared_properties(depict_category);
|
|
5557
5485
|
return (0, $cV3wj$createComponent)($961b5c64bef4662f$var$InExternalAreaDiv, {
|
|
5558
5486
|
get children () {
|
|
5559
5487
|
return (0, $dfa5b6f7c5e421df$export$5646050d516e06bc)({
|
|
@@ -5566,8 +5494,8 @@ function $961b5c64bef4662f$export$5b7c3ce0ebe51f86({ depict_category: depict_cat
|
|
|
5566
5494
|
}
|
|
5567
5495
|
});
|
|
5568
5496
|
}
|
|
5569
|
-
function $961b5c64bef4662f$export$de035477d6fef996({ depict_category: depict_category
|
|
5570
|
-
const { i18n_: i18n_
|
|
5497
|
+
function $961b5c64bef4662f$export$de035477d6fef996({ depict_category: depict_category }) {
|
|
5498
|
+
const { i18n_: i18n_, quicklinks_signal_: [quicklinks_data_], breadcrumb_signal_: [breadcrumb_data_], router_: router_, sorting_query_param_: sorting_query_param_, filter_query_param_prefix_: filter_query_param_prefix_ } = $961b5c64bef4662f$var$get_shared_properties(depict_category);
|
|
5571
5499
|
return (0, $cV3wj$createComponent)($961b5c64bef4662f$var$InExternalAreaDiv, {
|
|
5572
5500
|
get children () {
|
|
5573
5501
|
return (0, $06edf3aec9073663$export$466cdc317043f6cb)({
|
|
@@ -5592,10 +5520,6 @@ function $961b5c64bef4662f$var$get_shared_properties(depict_category) {
|
|
|
5592
5520
|
|
|
5593
5521
|
|
|
5594
5522
|
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
5523
|
const $e4615ecd1849548f$var$_tmpl$ = [
|
|
5600
5524
|
"<div",
|
|
5601
5525
|
' class="category-title"><h1 class="title">',
|
|
@@ -5603,7 +5527,7 @@ const $e4615ecd1849548f$var$_tmpl$ = [
|
|
|
5603
5527
|
"<!--/--></span></div>"
|
|
5604
5528
|
];
|
|
5605
5529
|
const $e4615ecd1849548f$export$b91cec6bdc6b32a1 = /*@__PURE__*/ (()=>{
|
|
5606
|
-
const actual_function = ({ category_title_: category_title_
|
|
5530
|
+
const actual_function = ({ category_title_: category_title_, product_count_: product_count_ })=>{
|
|
5607
5531
|
return (0, $cV3wj$ssr)($e4615ecd1849548f$var$_tmpl$, (0, $cV3wj$ssrHydrationKey)(), (0, $cV3wj$escape)(category_title_()) || (0, $cV3wj$escape)((0, $cV3wj$createComponent)((0, $d134eae24341b4a1$export$89c6019e4baa40b1), {
|
|
5608
5532
|
height: "1em",
|
|
5609
5533
|
width: "10ch"
|
|
@@ -5619,8 +5543,6 @@ const $e4615ecd1849548f$export$b91cec6bdc6b32a1 = /*@__PURE__*/ (()=>{
|
|
|
5619
5543
|
|
|
5620
5544
|
|
|
5621
5545
|
|
|
5622
|
-
|
|
5623
|
-
|
|
5624
5546
|
const $a6e23a834336fc19$var$_tmpl$ = [
|
|
5625
5547
|
"<div",
|
|
5626
5548
|
' class="sort-and-filter-buttons fake" aria-hidden="true" style="position:absolute;z-index:-1;pointer-events:none;opacity:0"><div class="outer"><div class="inner"><!--#-->',
|
|
@@ -5629,7 +5551,7 @@ const $a6e23a834336fc19$var$_tmpl$ = [
|
|
|
5629
5551
|
"<!--/--></div></div></div>"
|
|
5630
5552
|
];
|
|
5631
5553
|
const $a6e23a834336fc19$export$824dde41348efed1 = /*@__PURE__*/ (()=>{
|
|
5632
|
-
const actual_function = ({ make_product_count_: make_product_count_
|
|
5554
|
+
const actual_function = ({ make_product_count_: make_product_count_, set_observed_results_filters_elements_: set_observed_results_filters_elements_, is_slim_: is_slim_, sort_and_filter_element_: sort_and_filter_element_, extra_sort_and_filter_args_: extra_sort_and_filter_args_ })=>{
|
|
5633
5555
|
// this does two things: make the sorting and filters button the same width and move the number of products out of the SortAndFilter middle_elements_ if it doesn't fit
|
|
5634
5556
|
let extra_sort_button_;
|
|
5635
5557
|
let extra_filter_button_;
|
|
@@ -5786,16 +5708,9 @@ async function $c9312089e8983364$var$download_categories(tenant, market, type) {
|
|
|
5786
5708
|
|
|
5787
5709
|
|
|
5788
5710
|
|
|
5789
|
-
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
|
|
5795
|
-
|
|
5796
5711
|
function $7f60f09116a3fe61$export$3f37af283f8fb843(props) {
|
|
5797
5712
|
const style = (0, $cV3wj$createMemo)(()=>{
|
|
5798
|
-
const { style: style
|
|
5713
|
+
const { style: style, height: height, width: width, aspectRatio: aspectRatio } = props;
|
|
5799
5714
|
const is_image = aspectRatio != undefined;
|
|
5800
5715
|
const size_data = is_image ? {
|
|
5801
5716
|
width: "100%",
|
|
@@ -5840,10 +5755,6 @@ function $bb15dfb548a7666e$export$ee1733d9a8495996() {
|
|
|
5840
5755
|
|
|
5841
5756
|
|
|
5842
5757
|
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
5758
|
const $897bd4a76f611b38$var$_tmpl$ = [
|
|
5848
5759
|
"<span",
|
|
5849
5760
|
' class="parent-title">',
|
|
@@ -5855,7 +5766,7 @@ const $897bd4a76f611b38$var$_tmpl$ = [
|
|
|
5855
5766
|
"</span><!--#-->",
|
|
5856
5767
|
"<!--/--></a>"
|
|
5857
5768
|
];
|
|
5858
|
-
function $897bd4a76f611b38$export$d757d54550ebfb3d({ category_suggestion_: category_suggestion_
|
|
5769
|
+
function $897bd4a76f611b38$export$d757d54550ebfb3d({ category_suggestion_: category_suggestion_, router_: router_ }) {
|
|
5859
5770
|
return (0, $cV3wj$ssr)($897bd4a76f611b38$var$_tmpl$2, (0, $cV3wj$ssrHydrationKey)(), (0, $cV3wj$ssrAttribute)("href", (0, $cV3wj$escape)(category_suggestion_().page_url, true), false), (0, $cV3wj$escape)(category_suggestion_().title), (0, $cV3wj$escape)((0, $cV3wj$createComponent)((0, $cV3wj$Show), {
|
|
5860
5771
|
get when () {
|
|
5861
5772
|
return typeof category_suggestion_().parent_title === "string";
|
|
@@ -5871,12 +5782,6 @@ function $897bd4a76f611b38$export$d757d54550ebfb3d({ category_suggestion_: categ
|
|
|
5871
5782
|
|
|
5872
5783
|
|
|
5873
5784
|
|
|
5874
|
-
|
|
5875
|
-
|
|
5876
|
-
|
|
5877
|
-
|
|
5878
|
-
|
|
5879
|
-
|
|
5880
5785
|
const $22e59517c2ec94d3$var$_tmpl$ = [
|
|
5881
5786
|
"<svg",
|
|
5882
5787
|
' xmlns="http://www.w3.org/2000/svg" width="24" height="16"><path d="M.773 7.371L7.98.176C8.098.059 8.238 0 8.402 0s.305.059.422.176S9 .434 9 .598s-.059.305-.176.422L2.648 7.195h19.547a.59.59 0 0 1 .609.609c0 .172-.059.305-.176.422s-.262.176-.434.176H2.648l6.176 6.176a.59.59 0 0 1 .176.426c0 .16-.059.301-.176.422-.055.059-.121.109-.199.137s-.148.039-.223.039-.156-.012-.234-.039a.54.54 0 0 1-.187-.137L.773 8.227c-.117-.117-.176-.258-.176-.422a.6.6 0 0 1 .176-.434zm0 0"></path></svg>'
|
|
@@ -5888,7 +5793,6 @@ function $22e59517c2ec94d3$export$1c641004b5485fed() {
|
|
|
5888
5793
|
|
|
5889
5794
|
|
|
5890
5795
|
|
|
5891
|
-
|
|
5892
5796
|
const $16f0ed5ea30d8d9c$var$_tmpl$ = '<path d="M19.811 20.174l-6.234-6.809a7.96 7.96 0 0 0 .923-1.179c.274-.424.502-.865.687-1.323a8.04 8.04 0 0 0 .42-1.436 7.88 7.88 0 0 0 .144-1.507c0-.526-.051-1.042-.154-1.548-.096-.506-.243-.995-.441-1.466s-.441-.919-.728-1.343a8.28 8.28 0 0 0-.984-1.21 7.86 7.86 0 0 0-1.2-.984A7.56 7.56 0 0 0 10.89.651C10.418.453 9.929.302 9.423.2S8.401.046 7.875.046 6.833.097 6.327.2 5.332.453 4.86.651a7.56 7.56 0 0 0-1.354.718c-.431.287-.831.615-1.2.984a8.28 8.28 0 0 0-.984 1.21 7.73 7.73 0 0 0-.728 1.343c-.198.472-.349.96-.451 1.466A8.31 8.31 0 0 0 0 7.921a8.31 8.31 0 0 0 .144 1.548c.103.506.253.995.451 1.466a8.08 8.08 0 0 0 .728 1.354 7.86 7.86 0 0 0 .984 1.2 7.54 7.54 0 0 0 1.2.995c.431.287.882.53 1.354.728.472.191.96.338 1.466.441a8.31 8.31 0 0 0 1.548.144c.451 0 .896-.038 1.333-.113a7.83 7.83 0 0 0 1.282-.328 7.55 7.55 0 0 0 1.2-.533 8.08 8.08 0 0 0 1.107-.749l6.245 6.809a.45.45 0 0 0 .174.123.55.55 0 0 0 .205.041.61.61 0 0 0 .195-.031c.061-.021.116-.055.164-.102.109-.096.164-.219.164-.369.007-.144-.038-.267-.133-.369zM1.046 7.921c0-.937.178-1.818.533-2.646.362-.834.851-1.559 1.466-2.174.622-.615 1.347-1.101 2.174-1.456.827-.362 1.712-.543 2.656-.543s1.829.181 2.656.543c.827.355 1.548.841 2.164 1.456.622.615 1.111 1.34 1.466 2.174a6.52 6.52 0 0 1 .543 2.646c0 .943-.181 1.829-.543 2.656a6.89 6.89 0 0 1-1.466 2.174c-.615.615-1.336 1.104-2.164 1.466-.827.356-1.712.533-2.656.533s-1.829-.178-2.656-.533c-.827-.362-1.552-.851-2.174-1.466-.615-.622-1.104-1.347-1.466-2.174-.355-.827-.533-1.712-.533-2.656z"></path>';
|
|
5893
5797
|
function $16f0ed5ea30d8d9c$export$82eafebb825fc23f(props = {}) {
|
|
5894
5798
|
return (0, $cV3wj$ssrElement)("svg", ()=>({
|
|
@@ -5917,7 +5821,7 @@ const $5285d2814d0fac0c$var$_tmpl$ = [
|
|
|
5917
5821
|
">",
|
|
5918
5822
|
"</button></div>"
|
|
5919
5823
|
];
|
|
5920
|
-
function $5285d2814d0fac0c$export$b94867ecbd698f21({ search_field_value_: search_field_value_
|
|
5824
|
+
function $5285d2814d0fac0c$export$b94867ecbd698f21({ 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_, after_focusing_: after_focusing_ }) {
|
|
5921
5825
|
let input_element;
|
|
5922
5826
|
// This is the div where we recommend (and ourselves do) attach the event listener to that opens the search modal.
|
|
5923
5827
|
let field_div;
|
|
@@ -5945,10 +5849,6 @@ function $5285d2814d0fac0c$export$b94867ecbd698f21({ search_field_value_: search
|
|
|
5945
5849
|
|
|
5946
5850
|
|
|
5947
5851
|
|
|
5948
|
-
|
|
5949
|
-
|
|
5950
|
-
|
|
5951
|
-
|
|
5952
5852
|
const $172e1b898d457050$var$_tmpl$ = [
|
|
5953
5853
|
"<div",
|
|
5954
5854
|
' class="search-recs"><h3 class="search-recs-title">',
|
|
@@ -5961,7 +5861,7 @@ const $172e1b898d457050$var$_tmpl$ = [
|
|
|
5961
5861
|
"</button>"
|
|
5962
5862
|
];
|
|
5963
5863
|
const $172e1b898d457050$export$1c8c715550dc689d = 2;
|
|
5964
|
-
function $172e1b898d457050$export$7de92c4c2205ebf3({ depict_api_: depict_api_
|
|
5864
|
+
function $172e1b898d457050$export$7de92c4c2205ebf3({ depict_api_: depict_api_, i18n_: i18n_, search_query_base_: search_query_base_, product_card_template_: product_card_template_, showing_recommendation_rows_: showing_recommendation_rows_, view_more_button_: view_more_button_ = true, layout_options_: layout_options_ }) {
|
|
5965
5865
|
const [get_showing_recommendation_rows] = showing_recommendation_rows_; // We reset this in after_submit in search.tsx FYI
|
|
5966
5866
|
const rows_object = view_more_button_ ? $172e1b898d457050$var$make_state_saved_rows(showing_recommendation_rows_, i18n_) : "all";
|
|
5967
5867
|
const [recommendations_resource] = (0, $cV3wj$createResource)(search_query_base_, (query)=>depict_api_.get_recommended(query).then((r)=>r.displays));
|
|
@@ -6047,7 +5947,7 @@ function $b6d5529b253681aa$export$b3ad617e9036868(modal_body_style, input_field,
|
|
|
6047
5947
|
let ro;
|
|
6048
5948
|
if (one_axies_only !== "top") {
|
|
6049
5949
|
ro = new ResizeObserver((0, $cV3wj$catchify)((records)=>{
|
|
6050
|
-
records.forEach(({ contentRect: { width: width
|
|
5950
|
+
records.forEach(({ contentRect: { width: width } })=>{
|
|
6051
5951
|
if (width_transformer) width = width_transformer(width);
|
|
6052
5952
|
modal_body_style[1]((old_value)=>({
|
|
6053
5953
|
...old_value,
|
|
@@ -6077,7 +5977,7 @@ function $b6d5529b253681aa$export$b3ad617e9036868(modal_body_style, input_field,
|
|
|
6077
5977
|
|
|
6078
5978
|
|
|
6079
5979
|
|
|
6080
|
-
function $48d7e4a9707315b6$export$e026af0c7b64ea5f({ selected_filters_: selected_filters_
|
|
5980
|
+
function $48d7e4a9707315b6$export$e026af0c7b64ea5f({ selected_filters_: selected_filters_, get_search_query_: get_search_query_, current_sorting_: current_sorting_, expanded_hierarchical_filters_: expanded_hierarchical_filters_, i18n_: i18n_, local_filter_cache_: local_filter_cache_ }) {
|
|
6081
5981
|
const [get_selected_filters] = selected_filters_;
|
|
6082
5982
|
// Possible values:
|
|
6083
5983
|
// 0 - we should not clear next submit
|
|
@@ -6142,7 +6042,7 @@ function $21f51c14cb3f586f$export$84bba84a7b837187(read_search_query) {
|
|
|
6142
6042
|
|
|
6143
6043
|
|
|
6144
6044
|
|
|
6145
|
-
async function $bfd908d13d90934c$export$e16630ecb9644a1c({ on_submit_with_unchanged_value_: on_submit_with_unchanged_value_
|
|
6045
|
+
async function $bfd908d13d90934c$export$e16630ecb9644a1c({ on_submit_with_unchanged_value_: on_submit_with_unchanged_value_, search_param_name_: search_param_name_, set_search_field_value_: set_search_field_value_, get_search_query_: get_search_query_, url_transformer_: url_transformer_, router_: router_, after_submit_: after_submit_, get_new_query: get_new_query }) {
|
|
6146
6046
|
const new_search_query = get_new_query();
|
|
6147
6047
|
const previous_query = (0, $cV3wj$untrack)(get_search_query_);
|
|
6148
6048
|
if (previous_query === new_search_query && new URLSearchParams(location.search).has(search_param_name_)) {
|
|
@@ -6173,14 +6073,6 @@ async function $bfd908d13d90934c$export$e16630ecb9644a1c({ on_submit_with_unchan
|
|
|
6173
6073
|
|
|
6174
6074
|
|
|
6175
6075
|
|
|
6176
|
-
|
|
6177
|
-
|
|
6178
|
-
|
|
6179
|
-
|
|
6180
|
-
|
|
6181
|
-
|
|
6182
|
-
|
|
6183
|
-
|
|
6184
6076
|
/**
|
|
6185
6077
|
* Expand an object where every value in the top-level is an accessor into a normal object. Used for converting solid_i18n objects into external i18n typed objects.
|
|
6186
6078
|
*/ const $c97b1f0e44afb9d2$export$27b710c08412a7ad = (obj)=>{
|
|
@@ -6196,10 +6088,6 @@ async function $bfd908d13d90934c$export$e16630ecb9644a1c({ on_submit_with_unchan
|
|
|
6196
6088
|
|
|
6197
6089
|
|
|
6198
6090
|
|
|
6199
|
-
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
|
|
6203
6091
|
const $e003be2a50d9e5bc$var$_tmpl$ = [
|
|
6204
6092
|
"<span",
|
|
6205
6093
|
' class="orig price"><!--#-->',
|
|
@@ -6224,7 +6112,7 @@ const $e003be2a50d9e5bc$var$_tmpl$ = [
|
|
|
6224
6112
|
' class="tagline">',
|
|
6225
6113
|
"</div>"
|
|
6226
6114
|
];
|
|
6227
|
-
const $e003be2a50d9e5bc$export$b05c0ae390cf3e06 = (display_or_variant_container, { i18n: i18n
|
|
6115
|
+
const $e003be2a50d9e5bc$export$b05c0ae390cf3e06 = (display_or_variant_container, { i18n: i18n }, router_)=>{
|
|
6228
6116
|
const search_result_id = (0, $cV3wj$createMemo)(()=>display_or_variant_container().search_result_id);
|
|
6229
6117
|
const display = (0, $cV3wj$createMemo)(()=>{
|
|
6230
6118
|
const display = display_or_variant_container();
|
|
@@ -6289,7 +6177,7 @@ const $eea41f703612261b$var$_tmpl$ = [
|
|
|
6289
6177
|
' class="instant-results">',
|
|
6290
6178
|
"</div>"
|
|
6291
6179
|
];
|
|
6292
|
-
function $eea41f703612261b$export$62f101a8aa597bf8({ depict_api_: depict_api_
|
|
6180
|
+
function $eea41f703612261b$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_, router_: router_ }) {
|
|
6293
6181
|
const max_cards = 4;
|
|
6294
6182
|
const [read_current_instant_query, write_current_instant_query] = (0, $cV3wj$createSignal)("");
|
|
6295
6183
|
let timeout;
|
|
@@ -6362,11 +6250,7 @@ function $eea41f703612261b$export$62f101a8aa597bf8({ depict_api_: depict_api_ ,
|
|
|
6362
6250
|
|
|
6363
6251
|
|
|
6364
6252
|
|
|
6365
|
-
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6369
|
-
function $a36cbc4f68bfd590$export$91c3b6774e8be0f5({ param_: param_ , value_: value_ , url_transformer_: url_transformer_ }) {
|
|
6253
|
+
function $a36cbc4f68bfd590$export$91c3b6774e8be0f5({ param_: param_, value_: value_, url_transformer_: url_transformer_ }) {
|
|
6370
6254
|
const [get_current_href, set_current_href] = (0, $cV3wj$createSignal)(location.href);
|
|
6371
6255
|
const [exit_iterable, exitable_iterable] = (0, $cV3wj$make_asyncIterable_exiter)((0, $cV3wj$href_change_ipns));
|
|
6372
6256
|
(0, $cV3wj$onCleanup)(exit_iterable);
|
|
@@ -6385,7 +6269,6 @@ function $a36cbc4f68bfd590$export$91c3b6774e8be0f5({ param_: param_ , value_: va
|
|
|
6385
6269
|
|
|
6386
6270
|
|
|
6387
6271
|
|
|
6388
|
-
|
|
6389
6272
|
const $694b7f90501fea4c$var$_tmpl$ = [
|
|
6390
6273
|
"<svg",
|
|
6391
6274
|
' xmlns="http://www.w3.org/2000/svg" width="12" height="13"><path d="M6 12.598a5.88 5.88 0 0 1-1.611-.223c-.52-.145-1.008-.352-1.465-.621s-.875-.605-1.254-.996-.693-.83-.955-1.318c-.039-.07-.047-.145-.023-.223s.072-.143.146-.182.145-.047.223-.023.143.072.182.146a5.54 5.54 0 0 0 .861 1.184c.34.352.715.65 1.125.897s.85.435 1.318.568A5.5 5.5 0 0 0 6 12a5.24 5.24 0 0 0 2.098-.422c.656-.285 1.229-.672 1.717-1.16s.879-1.061 1.16-1.717a5.22 5.22 0 0 0 .428-2.104c0-.742-.143-1.441-.428-2.098s-.668-1.229-1.16-1.717a5.42 5.42 0 0 0-1.717-1.154A5.18 5.18 0 0 0 6 1.201c-.496 0-.979.066-1.447.199s-.904.316-1.318.563-.785.539-1.125.891a5.31 5.31 0 0 0-.855 1.172.32.32 0 0 1-.164.141c-.066.023-.135.023-.205 0a.3.3 0 0 1-.158-.135C.691 3.965.682 3.895.697 3.82l.51-2.385c.016-.078.059-.141.129-.187a.28.28 0 0 1 .229-.041c.078.016.141.059.188.129a.28.28 0 0 1 .041.229l-.211.973a5.91 5.91 0 0 1 .926-.814 5.78 5.78 0 0 1 1.066-.609A5.79 5.79 0 0 1 4.746.732C5.156.643 5.574.598 6 .598c.402 0 .795.039 1.178.117s.76.191 1.119.34a5.95 5.95 0 0 1 1.031.551c.328.219.633.469.914.75s.535.592.75.92a5.77 5.77 0 0 1 .551 1.025 5.53 5.53 0 0 1 .34 1.119c.078.387.117.779.117 1.178s-.039.797-.117 1.184-.187.754-.34 1.113a5.96 5.96 0 0 1-.551 1.031 5.56 5.56 0 0 1-.75.914c-.281.285-.586.537-.914.756a5.95 5.95 0 0 1-1.031.551c-.359.148-.732.26-1.119.334s-.775.117-1.178.117zm0-5.695c-.023 0-.049-.004-.076-.012s-.047-.018-.07-.029l-2.701-1.5c-.07-.039-.117-.098-.141-.176a.29.29 0 0 1 .023-.229c.043-.074.104-.123.182-.146s.158-.014.229.029l2.543 1.412 3.152-2.004c.07-.047.145-.061.223-.041a.29.29 0 0 1 .188.135c.047.066.061.141.041.223a.27.27 0 0 1-.129.188L6.158 6.855a.27.27 0 0 1-.076.035c-.027.008-.055.012-.082.012z" fill="#0f0f0f"></path></svg>'
|
|
@@ -6411,7 +6294,7 @@ const $7ad3a93cbe6fa208$var$_tmpl$ = [
|
|
|
6411
6294
|
">",
|
|
6412
6295
|
"</button></a>"
|
|
6413
6296
|
];
|
|
6414
|
-
function $7ad3a93cbe6fa208$export$a146ac6fa8346a25({ text_: text_
|
|
6297
|
+
function $7ad3a93cbe6fa208$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_, selected_index_: [read_selected_index_, write_selected_index_], url_transformer_: url_transformer_, i18n_: i18n_, submit_query_: submit_query_ }) {
|
|
6415
6298
|
const has_entries = (0, $cV3wj$createMemo)(()=>previous_searches_().length >= 1);
|
|
6416
6299
|
currently_showing_suggestions_[1]((value)=>{
|
|
6417
6300
|
value[0] = (0, $cV3wj$createMemo)(()=>previous_searches_().map((result)=>({
|
|
@@ -6454,12 +6337,6 @@ function $7ad3a93cbe6fa208$export$a146ac6fa8346a25({ text_: text_ , previous_sea
|
|
|
6454
6337
|
|
|
6455
6338
|
|
|
6456
6339
|
|
|
6457
|
-
|
|
6458
|
-
|
|
6459
|
-
|
|
6460
|
-
|
|
6461
|
-
|
|
6462
|
-
|
|
6463
6340
|
const $f3213c0640246d58$var$_tmpl$ = [
|
|
6464
6341
|
"<span",
|
|
6465
6342
|
' class="highlighted-part">',
|
|
@@ -6470,7 +6347,7 @@ const $f3213c0640246d58$var$_tmpl$ = [
|
|
|
6470
6347
|
'">',
|
|
6471
6348
|
"</span>"
|
|
6472
6349
|
];
|
|
6473
|
-
function $f3213c0640246d58$export$ba17c5b7e6dda39f({ whole_text_to_display_: whole_text_to_display_memo
|
|
6350
|
+
function $f3213c0640246d58$export$ba17c5b7e6dda39f({ whole_text_to_display_: whole_text_to_display_memo, searching_for_value_: searching_for_value_memo, class_: class_ }) {
|
|
6474
6351
|
const [get_has_highlighted, set_has_highlighted] = (0, $cV3wj$createSignal)(false);
|
|
6475
6352
|
const text_itself = (0, $cV3wj$createMemo)(()=>(0, $cV3wj$batch)(()=>{
|
|
6476
6353
|
set_has_highlighted(false);
|
|
@@ -6561,10 +6438,10 @@ const $cea52f6b24092f05$var$_tmpl$ = [
|
|
|
6561
6438
|
"<!--/--><!--#-->",
|
|
6562
6439
|
"<!--/--></div>"
|
|
6563
6440
|
];
|
|
6564
|
-
function $cea52f6b24092f05$export$e872e2339fb04a7f({ suggestion_memo_: suggestion_memo_
|
|
6565
|
-
const queries_memo = (0, $cV3wj$createMemo)(()=>suggestion_memo_().filter(({ type: type
|
|
6441
|
+
function $cea52f6b24092f05$export$e872e2339fb04a7f({ suggestion_memo_: suggestion_memo_, search_query_url_param_name_: search_query_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_, i18n_: i18n_, include_category_suggestions_: include_category_suggestions_, searching_for_value_: searching_for_value_, router_: router_, submit_query_: submit_query_ }) {
|
|
6442
|
+
const queries_memo = (0, $cV3wj$createMemo)(()=>suggestion_memo_().filter(({ type: type, title: title })=>type === (0, $a0eb8b431ec1f87b$export$3cf9497e790da491) && !filtered_previous_searches_().includes(title) // don't show the ones we already show from the history
|
|
6566
6443
|
));
|
|
6567
|
-
const not_queries_memo = (0, $cV3wj$createMemo)(()=>suggestion_memo_().filter(({ type: type
|
|
6444
|
+
const not_queries_memo = (0, $cV3wj$createMemo)(()=>suggestion_memo_().filter(({ type: type })=>type !== (0, $a0eb8b431ec1f87b$export$3cf9497e790da491)));
|
|
6568
6445
|
const render_entry = (input_obj, autocomplete_data_index, index, is_history = false)=>{
|
|
6569
6446
|
const is_query = (0, $cV3wj$createMemo)(()=>input_obj().type === (0, $a0eb8b431ec1f87b$export$3cf9497e790da491));
|
|
6570
6447
|
const href_with_changed_params_accessor = (0, $cV3wj$createMemo)(()=>is_query() ? (0, $a36cbc4f68bfd590$export$91c3b6774e8be0f5)({
|
|
@@ -6699,14 +6576,11 @@ function $cea52f6b24092f05$export$e872e2339fb04a7f({ suggestion_memo_: suggestio
|
|
|
6699
6576
|
|
|
6700
6577
|
|
|
6701
6578
|
|
|
6702
|
-
|
|
6703
|
-
|
|
6704
|
-
|
|
6705
6579
|
const $15f380f0ce2812cc$var$_tmpl$ = [
|
|
6706
6580
|
"<a",
|
|
6707
6581
|
' target="_blank"></a>'
|
|
6708
6582
|
];
|
|
6709
|
-
function $15f380f0ce2812cc$export$217899a935ef803b({ selected_index_: [read_selected_index, write_selected_index]
|
|
6583
|
+
function $15f380f0ce2812cc$export$217899a935ef803b({ selected_index_: [read_selected_index, write_selected_index], currently_showing_suggestions_: [read_currently_showing_suggestions], ...rest_of_props }) {
|
|
6710
6584
|
const last_suggestion_index_ = (0, $cV3wj$createMemo)(()=>{
|
|
6711
6585
|
const currently_showing_suggestions = read_currently_showing_suggestions();
|
|
6712
6586
|
let total_length = 0;
|
|
@@ -6761,13 +6635,13 @@ function $15f380f0ce2812cc$export$217899a935ef803b({ selected_index_: [read_sele
|
|
|
6761
6635
|
write_selected_fake_index_: write_selected_fake_index_
|
|
6762
6636
|
});
|
|
6763
6637
|
}
|
|
6764
|
-
function $15f380f0ce2812cc$var$actual_navigation_working_on_fake_data({ element_: element_
|
|
6638
|
+
function $15f380f0ce2812cc$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_, url_transformer_: url_transformer_, search_query_param_name_: search_query_param_name_, router_: router_ }) {
|
|
6765
6639
|
let previous_value;
|
|
6766
6640
|
(0, $cV3wj$createEffect)(()=>{
|
|
6767
6641
|
const sfv = get_search_field_value();
|
|
6768
6642
|
if (!(0, $cV3wj$untrack)(()=>read_updating_blocked())) previous_value = sfv;
|
|
6769
6643
|
});
|
|
6770
|
-
const handler = (0, $cV3wj$catchify)(({ keyCode: keyCode
|
|
6644
|
+
const handler = (0, $cV3wj$catchify)(({ keyCode: keyCode })=>(0, $cV3wj$untrack)(()=>{
|
|
6771
6645
|
const up = keyCode === 38;
|
|
6772
6646
|
const down = keyCode === 40;
|
|
6773
6647
|
if (!up && !down) return;
|
|
@@ -6794,7 +6668,7 @@ function $15f380f0ce2812cc$var$actual_navigation_working_on_fake_data({ element_
|
|
|
6794
6668
|
};
|
|
6795
6669
|
// update text field value if needed
|
|
6796
6670
|
if (selected_entry?.type == "query") {
|
|
6797
|
-
const { title: title
|
|
6671
|
+
const { title: title } = selected_entry;
|
|
6798
6672
|
block_updating_for_one_change();
|
|
6799
6673
|
set_search_field_value(title);
|
|
6800
6674
|
override_on_enter_for_this_entry((e)=>{
|
|
@@ -6806,7 +6680,7 @@ function $15f380f0ce2812cc$var$actual_navigation_working_on_fake_data({ element_
|
|
|
6806
6680
|
return $15f380f0ce2812cc$var$open_link_on_cmd_pressed(e, url.href);
|
|
6807
6681
|
});
|
|
6808
6682
|
} else if (selected_entry?.type == "category") override_on_enter_for_this_entry((e)=>{
|
|
6809
|
-
const { page_url: page_url
|
|
6683
|
+
const { page_url: page_url } = selected_entry;
|
|
6810
6684
|
if (!$15f380f0ce2812cc$var$open_link_on_cmd_pressed(e, page_url)) // Above fn will return true if it opened a new tab, and we won't make these checks anymore
|
|
6811
6685
|
router_.navigate_.go_to_({
|
|
6812
6686
|
new_url_: page_url,
|
|
@@ -6840,7 +6714,7 @@ function $15f380f0ce2812cc$var$open_link_on_cmd_pressed(e, href) {
|
|
|
6840
6714
|
|
|
6841
6715
|
|
|
6842
6716
|
const $a0eb8b431ec1f87b$export$3cf9497e790da491 = "query";
|
|
6843
|
-
function $a0eb8b431ec1f87b$export$2f2b9559550c7bbc({ search_field_value_: search_field_value_
|
|
6717
|
+
function $a0eb8b431ec1f87b$export$2f2b9559550c7bbc({ search_field_value_: search_field_value_, get_search_query_: get_search_query_, search_query_url_param_name_: search_query_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_, submit_query_: submit_query_, router_: router_ }) {
|
|
6844
6718
|
const [searching_for_value, set_searching_for_value] = (0, $cV3wj$createSignal)();
|
|
6845
6719
|
const [read_search_field_value] = search_field_value_;
|
|
6846
6720
|
const updating_blocked = (0, $cV3wj$createSignal)(false);
|
|
@@ -6854,7 +6728,7 @@ function $a0eb8b431ec1f87b$export$2f2b9559550c7bbc({ search_field_value_: search
|
|
|
6854
6728
|
write_suggestion_signal([]);
|
|
6855
6729
|
return;
|
|
6856
6730
|
}
|
|
6857
|
-
const new_value = api_response.suggestions.sort(({ type: a_type
|
|
6731
|
+
const new_value = api_response.suggestions.sort(({ type: a_type }, { type: b_type } // this is probably stupid? But in the UI we show query suggestions first so for the keyboard suggestions to make sense with the index we sort them first here
|
|
6858
6732
|
)=>a_type === $a0eb8b431ec1f87b$export$3cf9497e790da491 && b_type === $a0eb8b431ec1f87b$export$3cf9497e790da491 || a_type !== $a0eb8b431ec1f87b$export$3cf9497e790da491 && b_type !== $a0eb8b431ec1f87b$export$3cf9497e790da491 ? 0 : a_type === $a0eb8b431ec1f87b$export$3cf9497e790da491 ? -1 : 1);
|
|
6859
6733
|
write_suggestion_signal(new_value);
|
|
6860
6734
|
selected_index_[1](undefined); // reset selected index on new results
|
|
@@ -6899,7 +6773,7 @@ function $a0eb8b431ec1f87b$export$2f2b9559550c7bbc({ search_field_value_: search
|
|
|
6899
6773
|
search_query_param_name_: search_query_url_param_name_,
|
|
6900
6774
|
text_: previous_searches_text_,
|
|
6901
6775
|
get previous_searches_ () {
|
|
6902
|
-
return (0, $cV3wj$createMemo)(()=>filtered_previous_searches().slice(0,
|
|
6776
|
+
return (0, $cV3wj$createMemo)(()=>filtered_previous_searches().slice(0, 3));
|
|
6903
6777
|
},
|
|
6904
6778
|
selected_index_: selected_index_,
|
|
6905
6779
|
currently_showing_suggestions_: currently_showing_suggestions_,
|
|
@@ -6916,7 +6790,7 @@ function $a0eb8b431ec1f87b$export$2f2b9559550c7bbc({ search_field_value_: search
|
|
|
6916
6790
|
const value = searching_for_value()?.toLowerCase();
|
|
6917
6791
|
if (!value) return false;
|
|
6918
6792
|
return search.includes(value) || value.includes(search);
|
|
6919
|
-
}).slice(0,
|
|
6793
|
+
}).slice(0, 2);
|
|
6920
6794
|
});
|
|
6921
6795
|
},
|
|
6922
6796
|
on_previous_searches_page_: show_previous_searches_component,
|
|
@@ -6958,14 +6832,14 @@ function $d78eea1e8707dc2d$export$c7e181728ad525f(url) {
|
|
|
6958
6832
|
}
|
|
6959
6833
|
|
|
6960
6834
|
|
|
6961
|
-
function $c64d28ca12452b21$export$3340fdd8259bd4fd({ get_search_field_value_: get_search_field_value_
|
|
6835
|
+
function $c64d28ca12452b21$export$3340fdd8259bd4fd({ get_search_field_value_: get_search_field_value_, search_query_url_param_name_: search_query_url_param_name_, url_transformer_: url_transformer_, get_search_query_: get_search_query_ }) {
|
|
6962
6836
|
// @ts-ignore
|
|
6963
6837
|
if (process.env.GA === "false") return;
|
|
6964
6838
|
let debounce_timeout;
|
|
6965
6839
|
const stop_timeout = ()=>clearTimeout(debounce_timeout);
|
|
6966
6840
|
const send_to_ga = (0, $cV3wj$catchify)(()=>{
|
|
6967
6841
|
const fake_url = new URL(location.href);
|
|
6968
|
-
const { searchParams: searchParams
|
|
6842
|
+
const { searchParams: searchParams } = fake_url;
|
|
6969
6843
|
searchParams.set(search_query_url_param_name_, (0, $cV3wj$untrack)(get_search_field_value_));
|
|
6970
6844
|
searchParams.set("instant_result", "true");
|
|
6971
6845
|
url_transformer_?.(fake_url);
|
|
@@ -6993,7 +6867,6 @@ function $c64d28ca12452b21$export$3340fdd8259bd4fd({ get_search_field_value_: ge
|
|
|
6993
6867
|
|
|
6994
6868
|
|
|
6995
6869
|
|
|
6996
|
-
|
|
6997
6870
|
const $926b1b5ba2239356$export$af8311b651139246 = (css_properties)=>{
|
|
6998
6871
|
return Object.entries(css_properties).map(([key, value])=>`${key}: ${value};`).join(" ");
|
|
6999
6872
|
};
|
|
@@ -7041,7 +6914,7 @@ const $fabfda1230351b1a$var$_tmpl$ = [
|
|
|
7041
6914
|
'"><div class="depict-search-modal-backdrop"></div><!--#-->',
|
|
7042
6915
|
"<!--/--></div>"
|
|
7043
6916
|
];
|
|
7044
|
-
function $fabfda1230351b1a$export$1c593cbd6f1e10bc({ search_field_value_: props_search_field_value
|
|
6917
|
+
function $fabfda1230351b1a$export$1c593cbd6f1e10bc({ search_field_value_: props_search_field_value, get_search_query_: get_search_query_, search_query_url_param_name_: search_query_url_param_name_, previous_searches_: previous_searches_, close_modal_: close_modal_, style_props_: style_props_ = (0, $cV3wj$createSignal)({}), depict_api_: depict_api_, tenant_: tenant_, market_: market_, submit_query_: props_submit_query, instant_results_options_: instant_results_options_, register_closing_animation_: register_closing_animation_, url_transformer_: url_transformer_, closing_animation_: closing_animation_, clear_filters_: clear_filters_, i18n_: i18n_, disable_scrolling_: disable_scrolling_ = true, enable_category_suggestions_: enable_category_suggestions_, class_list_: class_list_, bottom_distance_under_modal_: bottom_distance_under_modal_, selected_text_range_: selected_text_range_, dont_sync_search_field_value_except_on_submit_: dont_sync_search_field_value_except_on_submit_ = false, router_: router_ }) {
|
|
7045
6918
|
let on_enter_in_search_field_function;
|
|
7046
6919
|
// As per feedback from stronger we sometimes want a modal with the search field value disconnected from the one in the rest of the UI, see https://depictaiworkspace.slack.com/archives/C02J16R9XEH/p1679065878487709.
|
|
7047
6920
|
// This is desired for when the modal is opened from a UI element that visually does not look connected with the search page or current query
|
|
@@ -7059,7 +6932,7 @@ function $fabfda1230351b1a$export$1c593cbd6f1e10bc({ search_field_value_: props_
|
|
|
7059
6932
|
const [get_search_field_value_] = search_field_value_;
|
|
7060
6933
|
const [elements_outside_scrollable, set_elements_outside_scrollable] = (0, $cV3wj$createSignal)();
|
|
7061
6934
|
const [elements_inside_scrollable, set_elements_inside_scrollable] = (0, $cV3wj$createSignal)();
|
|
7062
|
-
const close_on_escape_handler = (0, $cV3wj$catchify)(({ key: key
|
|
6935
|
+
const close_on_escape_handler = (0, $cV3wj$catchify)(({ key: key })=>{
|
|
7063
6936
|
if (key === "Escape") close_modal_();
|
|
7064
6937
|
});
|
|
7065
6938
|
const [get_num_results_accessor, set_num_results_accessor_] = (0, $cV3wj$createSignal)();
|
|
@@ -7072,7 +6945,7 @@ function $fabfda1230351b1a$export$1c593cbd6f1e10bc({ search_field_value_: props_
|
|
|
7072
6945
|
window.addEventListener("keydown", close_on_escape_handler);
|
|
7073
6946
|
(0, $cV3wj$onCleanup)((0, $cV3wj$catchify)(()=>window.removeEventListener("keydown", close_on_escape_handler)));
|
|
7074
6947
|
const owner = (0, $cV3wj$getOwner)();
|
|
7075
|
-
(0, $cV3wj$onCleanup)((0, $cV3wj$javascript_media_query)("(max-height:700px)", ({ matches: matches
|
|
6948
|
+
(0, $cV3wj$onCleanup)((0, $cV3wj$javascript_media_query)("(max-height:700px)", ({ matches: matches })=>(0, $cV3wj$runWithOwner)(owner, ()=>{
|
|
7076
6949
|
// the if below is reactive so we need an owner
|
|
7077
6950
|
(matches ? set_elements_outside_scrollable : set_elements_inside_scrollable)("");
|
|
7078
6951
|
(matches ? set_elements_inside_scrollable : set_elements_outside_scrollable)((0, $cV3wj$ssr)($fabfda1230351b1a$var$_tmpl$, (0, $cV3wj$ssrHydrationKey)(), get_search_field_value_() ? (0, $cV3wj$escape)(i18n_.modal_view_all_results_()((0, $cV3wj$ssr)($fabfda1230351b1a$var$_tmpl$2, (0, $cV3wj$ssrHydrationKey)(), (0, $cV3wj$escape)(get_num_results_accessor?.())))) : (0, $cV3wj$escape)(i18n_.modal_discover_more_())));
|
|
@@ -7195,13 +7068,6 @@ function $fabfda1230351b1a$var$close_modal_when_navigating_away(close_modal, sea
|
|
|
7195
7068
|
|
|
7196
7069
|
|
|
7197
7070
|
|
|
7198
|
-
|
|
7199
|
-
|
|
7200
|
-
|
|
7201
|
-
|
|
7202
|
-
|
|
7203
|
-
|
|
7204
|
-
|
|
7205
7071
|
const $793905995512612d$var$_tmpl$ = [
|
|
7206
7072
|
"<div",
|
|
7207
7073
|
' class="category-suggestions">',
|
|
@@ -7211,7 +7077,7 @@ const $793905995512612d$var$_tmpl$ = [
|
|
|
7211
7077
|
' class="category-suggestion">',
|
|
7212
7078
|
"</div>"
|
|
7213
7079
|
];
|
|
7214
|
-
function $793905995512612d$export$c05a196222ba1302({ suggestions_: suggestions_
|
|
7080
|
+
function $793905995512612d$export$c05a196222ba1302({ suggestions_: suggestions_, children: children }) {
|
|
7215
7081
|
const category_suggestions_ = (0, $cV3wj$createMemo)(()=>suggestions_()?.suggestions.filter((s)=>s.type === "category"));
|
|
7216
7082
|
return (0, $cV3wj$createComponent)((0, $cV3wj$Show), {
|
|
7217
7083
|
get when () {
|
|
@@ -7256,8 +7122,6 @@ function $793905995512612d$export$c05a196222ba1302({ suggestions_: suggestions_
|
|
|
7256
7122
|
|
|
7257
7123
|
|
|
7258
7124
|
|
|
7259
|
-
|
|
7260
|
-
|
|
7261
7125
|
const $f8c929beb82c512b$var$_tmpl$ = [
|
|
7262
7126
|
"<b",
|
|
7263
7127
|
">",
|
|
@@ -7267,7 +7131,7 @@ const $f8c929beb82c512b$var$_tmpl$ = [
|
|
|
7267
7131
|
' class="results-for">',
|
|
7268
7132
|
"</div>"
|
|
7269
7133
|
];
|
|
7270
|
-
function $f8c929beb82c512b$export$9dd50d35b9d94fdf({ get_search_query_: get_search_query_
|
|
7134
|
+
function $f8c929beb82c512b$export$9dd50d35b9d94fdf({ get_search_query_: get_search_query_, i18n_: i18n_, formatted_number_of_results_: formatted_number_of_results_ }) {
|
|
7271
7135
|
const contents = (0, $cV3wj$createMemo)((0, $cV3wj$catchify)(()=>{
|
|
7272
7136
|
const q = get_search_query_();
|
|
7273
7137
|
return i18n_.get_showing_results_for_()((0, $cV3wj$ssr)($f8c929beb82c512b$var$_tmpl$, (0, $cV3wj$ssrHydrationKey)(), (0, $cV3wj$escape)(q)), (0, $cV3wj$ssr)($f8c929beb82c512b$var$_tmpl$, (0, $cV3wj$ssrHydrationKey)(), (0, $cV3wj$escape)(formatted_number_of_results_())));
|
|
@@ -7284,7 +7148,7 @@ function $f8c929beb82c512b$export$9dd50d35b9d94fdf({ get_search_query_: get_sear
|
|
|
7284
7148
|
|
|
7285
7149
|
|
|
7286
7150
|
|
|
7287
|
-
function $1801dbce7adb3f19$export$41b4894022a3580f({ style_props_: style_props_ = (0, $cV3wj$createSignal)({})
|
|
7151
|
+
function $1801dbce7adb3f19$export$41b4894022a3580f({ style_props_: style_props_ = (0, $cV3wj$createSignal)({}) } = {}) {
|
|
7288
7152
|
const [, set_style_props] = style_props_;
|
|
7289
7153
|
const supports_hover = (0, $dc9262ef6f786812$export$d9f36cf74e24d595)("(hover: hover) and (pointer: fine)");
|
|
7290
7154
|
const desktop_short = (0, $dc9262ef6f786812$export$d9f36cf74e24d595)("(max-height: 790px)");
|
|
@@ -7320,7 +7184,7 @@ const $7097477c78a89208$var$_tmpl$ = [
|
|
|
7320
7184
|
"<!--/--><!--#-->",
|
|
7321
7185
|
"<!--/--></div>"
|
|
7322
7186
|
];
|
|
7323
|
-
function $7097477c78a89208$export$a54ec244c8863715({ depict_api_: depict_api_
|
|
7187
|
+
function $7097477c78a89208$export$a54ec244c8863715({ depict_api_: depict_api_, search_field_value_: search_field_value_, get_search_query_: get_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_, 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_, search_recs_view_more_: search_recs_view_more_, disable_search_recommendations_: disable_search_recommendations_, layout_options_: layout_options_, recommendations_layout_options_: recommendations_layout_options_, scroll_restoration_data_: scroll_restoration_data_, product_card_template_: product_card_template_, modal_body_style_ref_: modal_body_style_ref_ }) {
|
|
7324
7188
|
const [get_sorting] = current_sorting_;
|
|
7325
7189
|
const all_products_loaded_ = (0, $cV3wj$createSignal)(false);
|
|
7326
7190
|
const [get_all_products_loaded, set_all_products_loaded] = all_products_loaded_;
|
|
@@ -7407,7 +7271,7 @@ function $7097477c78a89208$export$a54ec244c8863715({ depict_api_: depict_api_ ,
|
|
|
7407
7271
|
});
|
|
7408
7272
|
const results_filters = (0, $cV3wj$createSignal)();
|
|
7409
7273
|
const owner = (0, $cV3wj$getOwner)();
|
|
7410
|
-
(0, $cV3wj$onCleanup)((0, $cV3wj$javascript_media_query)("(max-width:600px)", async ({ matches: matches
|
|
7274
|
+
(0, $cV3wj$onCleanup)((0, $cV3wj$javascript_media_query)("(max-width:600px)", async ({ matches: matches })=>{
|
|
7411
7275
|
results_filters[1]();
|
|
7412
7276
|
await new Promise((r)=>queueMicrotask(r));
|
|
7413
7277
|
(0, $cV3wj$runWithOwner)(owner, ()=>results_filters[1](matches ? [
|
|
@@ -7415,6 +7279,7 @@ function $7097477c78a89208$export$a54ec244c8863715({ depict_api_: depict_api_ ,
|
|
|
7415
7279
|
filters_opener
|
|
7416
7280
|
] : (0, $cV3wj$ssr)($7097477c78a89208$var$_tmpl$, (0, $cV3wj$ssrHydrationKey)(), (0, $cV3wj$escape)(results_for), (0, $cV3wj$escape)(filters_opener))));
|
|
7417
7281
|
}).remove);
|
|
7282
|
+
(0, $2ab89d64b7f1d5ef$export$d31a1a1a83ad9413)(search_results_, selected_filters_);
|
|
7418
7283
|
(0, $cV3wj$catchify)((0, $641bba2917fe862b$export$6e49da55e449af7c))({
|
|
7419
7284
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
7420
7285
|
last_result_in_viewport_: last_result_in_viewport_,
|
|
@@ -7628,7 +7493,6 @@ function $4ca91518c9a35379$export$828dcdd425fd3231(aligner) {
|
|
|
7628
7493
|
|
|
7629
7494
|
|
|
7630
7495
|
|
|
7631
|
-
|
|
7632
7496
|
const $806c97b931758897$var$_tmpl$ = [
|
|
7633
7497
|
"<div",
|
|
7634
7498
|
' class="depict plp search">',
|
|
@@ -7644,19 +7508,19 @@ class $806c97b931758897$export$ac6237957a15b3f0 {
|
|
|
7644
7508
|
#merchant_signal = (0, $cV3wj$createSignal)();
|
|
7645
7509
|
#market_signal = (0, $cV3wj$createSignal)();
|
|
7646
7510
|
#modal_open_signal = (0, $cV3wj$createSignal)(false);
|
|
7647
|
-
static #keys_constructed_with =
|
|
7511
|
+
static #keys_constructed_with = new Set();
|
|
7648
7512
|
#router = new (0, $4fd2ba03703a7d92$export$7e1297a3a19f10d8)("hard_navigation");
|
|
7649
|
-
constructor({ unique_instance_key_for_state: unique_instance_key_for_state = ""
|
|
7650
|
-
disable_scrolling_during_modal = true
|
|
7513
|
+
constructor({ unique_instance_key_for_state: unique_instance_key_for_state = "", search_query_url_param_name: search_query_url_param_name_ = "query" + unique_instance_key_for_state, url_transformer: url_transformer, on_navigation: on_navigation, enable_category_suggestions: enable_category_suggestions = true, page_url_creator: page_url_creator, disable_scrolling_during_modal: // Stuff needed for non-standard customer deployments that we shouldn't actually expose
|
|
7514
|
+
disable_scrolling_during_modal = true, api: api, bottom_distance_under_modal: bottom_distance_under_modal, render_instant_card: render_instant_card, ...props_on_class }){
|
|
7651
7515
|
const owner = (0, $cV3wj$getOwner)() || (0, $cV3wj$createRoot)(()=>(0, $cV3wj$getOwner)()); // we might have an owner, if so, pass it on. Otherwise, create one so solid doesn't print warnings to the console
|
|
7652
7516
|
(0, $cV3wj$runWithOwner)(owner, ()=>{
|
|
7653
|
-
if ($806c97b931758897$export$ac6237957a15b3f0.#keys_constructed_with.
|
|
7517
|
+
if ($806c97b931758897$export$ac6237957a15b3f0.#keys_constructed_with.has(unique_instance_key_for_state) && !(0, $cV3wj$isServer)) // on the server we can't write stuff to history.state anyway so can have multiple
|
|
7654
7518
|
throw new Error("You can only have one instance of DepictSearch with the same uniqueInstanceKeyForState");
|
|
7655
7519
|
Object.assign(this, props_on_class);
|
|
7656
7520
|
if (on_navigation) this.#router.on_navigation_ = on_navigation;
|
|
7657
7521
|
const sorting_query_param_ = "sorting" + unique_instance_key_for_state;
|
|
7658
|
-
const filter_query_param_prefix_ = "
|
|
7659
|
-
const { current_sorting_: current_sorting_
|
|
7522
|
+
const filter_query_param_prefix_ = "f" + unique_instance_key_for_state + "_";
|
|
7523
|
+
const { current_sorting_: current_sorting_, selected_filters_: selected_filters_, search_query_accessor_: raw_search_query_accessor } = (0, $ccd5db07a3a069c5$export$477caf01aecaeb2a)({
|
|
7660
7524
|
search_query_url_param_name_: search_query_url_param_name_,
|
|
7661
7525
|
router_: this.#router,
|
|
7662
7526
|
sorting_query_param_: sorting_query_param_,
|
|
@@ -7728,7 +7592,7 @@ class $806c97b931758897$export$ac6237957a15b3f0 {
|
|
|
7728
7592
|
});
|
|
7729
7593
|
(0, $90980bd87c9960f9$export$5162a71f252e6122)();
|
|
7730
7594
|
(0, $cV3wj$catchify)(async ()=>{
|
|
7731
|
-
const { open_modal_: open_modal_
|
|
7595
|
+
const { open_modal_: open_modal_, close_modal_: close_modal_ } = await (0, $194bd6b8e4c59830$export$79b1565500412d9b)((...args)=>{
|
|
7732
7596
|
(0, $cV3wj$onCleanup)(()=>this.modal_open = false);
|
|
7733
7597
|
return (0, $fabfda1230351b1a$export$1c593cbd6f1e10bc)(...args);
|
|
7734
7598
|
}, {
|
|
@@ -7764,7 +7628,7 @@ class $806c97b931758897$export$ac6237957a15b3f0 {
|
|
|
7764
7628
|
close_modal_();
|
|
7765
7629
|
return;
|
|
7766
7630
|
}
|
|
7767
|
-
const { search_page_aligned_modal_body_style_signal_: search_page_aligned_modal_body_style_signal_
|
|
7631
|
+
const { search_page_aligned_modal_body_style_signal_: search_page_aligned_modal_body_style_signal_ } = $806c97b931758897$var$privately_shared_properties.get(this);
|
|
7768
7632
|
if (signal_value_is_options && open_signal_value[0]?.style_props_) {
|
|
7769
7633
|
// They know what they're doing, just call the modal with the provided options
|
|
7770
7634
|
open_modal_(...open_signal_value);
|
|
@@ -7801,7 +7665,8 @@ class $806c97b931758897$export$ac6237957a15b3f0 {
|
|
|
7801
7665
|
};
|
|
7802
7666
|
(0, $cV3wj$runWithOwner)(owner, ()=>(0, $cV3wj$createEffect)(modal_opening_effect));
|
|
7803
7667
|
})();
|
|
7804
|
-
$806c97b931758897$export$ac6237957a15b3f0.#keys_constructed_with.
|
|
7668
|
+
$806c97b931758897$export$ac6237957a15b3f0.#keys_constructed_with.add(unique_instance_key_for_state);
|
|
7669
|
+
(0, $cV3wj$onCleanup)(()=>$806c97b931758897$export$ac6237957a15b3f0.#keys_constructed_with.delete(unique_instance_key_for_state));
|
|
7805
7670
|
});
|
|
7806
7671
|
}
|
|
7807
7672
|
get on_navigation() {
|
|
@@ -7837,7 +7702,7 @@ class $806c97b931758897$export$ac6237957a15b3f0 {
|
|
|
7837
7702
|
this.#market_signal[1](market);
|
|
7838
7703
|
}
|
|
7839
7704
|
async fetchSearchResults(query, filters, maxResults = 48) {
|
|
7840
|
-
const { depict_api_: depict_api_
|
|
7705
|
+
const { depict_api_: depict_api_ } = $806c97b931758897$var$privately_shared_properties.get(this);
|
|
7841
7706
|
const result = await depict_api_.query({
|
|
7842
7707
|
tenant: this.merchant,
|
|
7843
7708
|
market: this.market,
|
|
@@ -7855,12 +7720,12 @@ function $806c97b931758897$var$get_shared_properties(depict_search) {
|
|
|
7855
7720
|
return shared_properties;
|
|
7856
7721
|
}
|
|
7857
7722
|
function $806c97b931758897$export$f2dc7e4e4aa11abb(props) {
|
|
7858
|
-
const { depict_search: depict_search
|
|
7723
|
+
const { depict_search: depict_search, product_card_template: product_card_template } = props;
|
|
7859
7724
|
const shared_properties = $806c97b931758897$var$get_shared_properties(depict_search);
|
|
7860
7725
|
return (0, $16b52438165aafe2$export$23fca46f3143581f)(()=>{
|
|
7861
|
-
const { state_: state_
|
|
7726
|
+
const { state_: state_ } = shared_properties;
|
|
7862
7727
|
const grid_spacing_override = (0, $cV3wj$createMemo)(()=>{
|
|
7863
|
-
const { grid_spacing: grid_spacing
|
|
7728
|
+
const { grid_spacing: grid_spacing } = props; // can be reactive
|
|
7864
7729
|
return typeof grid_spacing === "string" ? {
|
|
7865
7730
|
grid_spacing: grid_spacing
|
|
7866
7731
|
} : {
|
|
@@ -7918,7 +7783,7 @@ function $806c97b931758897$export$f2dc7e4e4aa11abb(props) {
|
|
|
7918
7783
|
...grid_spacing_override()
|
|
7919
7784
|
})),
|
|
7920
7785
|
recommendations_layout_options_: (0, $cV3wj$createMemo)(()=>{
|
|
7921
|
-
const { extra_depict_options: extra_depict_options
|
|
7786
|
+
const { extra_depict_options: extra_depict_options } = props;
|
|
7922
7787
|
return extra_depict_options?.recommendations_cols_at_size ? {
|
|
7923
7788
|
cols_at_size: (0, $b5cccc8ee7d24677$export$6daf8749b65a1b77)(extra_depict_options.recommendations_cols_at_size),
|
|
7924
7789
|
...grid_spacing_override()
|
|
@@ -7929,7 +7794,7 @@ function $806c97b931758897$export$f2dc7e4e4aa11abb(props) {
|
|
|
7929
7794
|
}, "Entire SearchPage failed");
|
|
7930
7795
|
}
|
|
7931
7796
|
function $806c97b931758897$export$316f6f283ae64765(props) {
|
|
7932
|
-
const { depict_search: depict_search
|
|
7797
|
+
const { depict_search: depict_search, modal_dispose_handler: modal_dispose_handler, click_handler: click_handler } = props;
|
|
7933
7798
|
const shared_properties = $806c97b931758897$var$get_shared_properties(depict_search);
|
|
7934
7799
|
return (0, $16b52438165aafe2$export$23fca46f3143581f)(()=>{
|
|
7935
7800
|
let input_element;
|
|
@@ -7958,7 +7823,7 @@ function $806c97b931758897$export$316f6f283ae64765(props) {
|
|
|
7958
7823
|
input_element.selectionStart,
|
|
7959
7824
|
input_element.selectionEnd
|
|
7960
7825
|
];
|
|
7961
|
-
const { cleanup: cleanup
|
|
7826
|
+
const { cleanup: cleanup } = $806c97b931758897$var$align_field_modal(style_props_, search_field, ()=>props.aligner_ref);
|
|
7962
7827
|
const complete_modal_dispose_handler = ()=>{
|
|
7963
7828
|
modal_dispose_handler?.();
|
|
7964
7829
|
cleanup();
|
|
@@ -7990,7 +7855,7 @@ function $806c97b931758897$var$align_field_modal(style_props_, input, aligner_re
|
|
|
7990
7855
|
(0, $b6d5529b253681aa$export$b3ad617e9036868)(style_props_, input);
|
|
7991
7856
|
return;
|
|
7992
7857
|
}
|
|
7993
|
-
const { cleanup: cleanup
|
|
7858
|
+
const { cleanup: cleanup } = (0, $4ca91518c9a35379$export$828dcdd425fd3231)(aligner_ref);
|
|
7994
7859
|
(0, $cV3wj$onCleanup)(cleanup);
|
|
7995
7860
|
(0, $b6d5529b253681aa$export$b3ad617e9036868)(style_props_, aligner_ref, undefined, false, "top");
|
|
7996
7861
|
});
|
|
@@ -8006,7 +7871,7 @@ function $806c97b931758897$var$align_field_modal(style_props_, input, aligner_re
|
|
|
8006
7871
|
|
|
8007
7872
|
|
|
8008
7873
|
const $6891c018a834cfdd$export$d86a33413558014e = (openModalParams)=>{
|
|
8009
|
-
const { search: search
|
|
7874
|
+
const { search: search, makesNewSearch: makesNewSearch = true } = openModalParams;
|
|
8010
7875
|
openModalParams.location ||= "centered";
|
|
8011
7876
|
if (openModalParams.location === "aligned" && !openModalParams.element) throw new Error("No active search header aligner on the page!");
|
|
8012
7877
|
if (openModalParams.location !== "aligned") {
|
|
@@ -8028,7 +7893,7 @@ const $6891c018a834cfdd$export$d86a33413558014e = (openModalParams)=>{
|
|
|
8028
7893
|
];
|
|
8029
7894
|
return;
|
|
8030
7895
|
}
|
|
8031
|
-
const { cleanup: cleanup
|
|
7896
|
+
const { cleanup: cleanup } = (0, $4ca91518c9a35379$export$828dcdd425fd3231)(openModalParams.element);
|
|
8032
7897
|
let dispose_aligner;
|
|
8033
7898
|
/**
|
|
8034
7899
|
* Setting position to fixed is important to make the modal work with align_field.
|
|
@@ -8060,8 +7925,8 @@ const $6891c018a834cfdd$export$d86a33413558014e = (openModalParams)=>{
|
|
|
8060
7925
|
|
|
8061
7926
|
function $6e8944558258054f$export$d0596b5cae35ad4(open_search) {
|
|
8062
7927
|
const handler = (0, $cV3wj$catchify)((e)=>{
|
|
8063
|
-
const { key: key
|
|
8064
|
-
const { body: body
|
|
7928
|
+
const { key: key, target: target } = e;
|
|
7929
|
+
const { body: body } = document;
|
|
8065
7930
|
if (key === "/" && (target === body || !body.contains(target))) {
|
|
8066
7931
|
open_search();
|
|
8067
7932
|
e.preventDefault();
|
|
@@ -8089,7 +7954,7 @@ function $6936724b9e0b98d5$export$689e204eadb33baf(pr) {
|
|
|
8089
7954
|
let resolve_remove_added_listeners;
|
|
8090
7955
|
pr.addEventListener("open", (0, $cV3wj$catchify)(()=>{
|
|
8091
7956
|
remove_added_listeners = new Promise((r)=>resolve_remove_added_listeners = r);
|
|
8092
|
-
disconnect_link_observer = (0, $cV3wj$observer).onexists("a", async ({ element: element
|
|
7957
|
+
disconnect_link_observer = (0, $cV3wj$observer).onexists("a", async ({ element: element })=>{
|
|
8093
7958
|
element.addEventListener("click", link_handler);
|
|
8094
7959
|
await remove_added_listeners;
|
|
8095
7960
|
element.removeEventListener("click", link_handler);
|
|
@@ -8187,13 +8052,13 @@ class $753e9b2889a47c89$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
8187
8052
|
try_forever: true
|
|
8188
8053
|
});
|
|
8189
8054
|
const first_element_found = new Promise((r)=>{
|
|
8190
|
-
this.#disconnect_observer = (0, $cV3wj$observer).onexists(this.selector_, ({ element: element
|
|
8055
|
+
this.#disconnect_observer = (0, $cV3wj$observer).onexists(this.selector_, ({ element: element, disconnector: disconnector })=>{
|
|
8191
8056
|
r();
|
|
8192
8057
|
if (this.append_instead_of_replace_) {
|
|
8193
8058
|
disconnector();
|
|
8194
8059
|
return;
|
|
8195
8060
|
}
|
|
8196
|
-
const { style: style
|
|
8061
|
+
const { style: style } = element;
|
|
8197
8062
|
const old_display_value = style.display;
|
|
8198
8063
|
style.setProperty("display", "none", "important");
|
|
8199
8064
|
this.#revert_fns.push(()=>{
|
|
@@ -8202,7 +8067,7 @@ class $753e9b2889a47c89$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
8202
8067
|
});
|
|
8203
8068
|
});
|
|
8204
8069
|
await first_element_found;
|
|
8205
|
-
const { title: title
|
|
8070
|
+
const { title: title } = document;
|
|
8206
8071
|
if (this.title_) {
|
|
8207
8072
|
document.title = this.title_;
|
|
8208
8073
|
this.#revert_fns.push(()=>document.title = title);
|
|
@@ -8250,7 +8115,7 @@ class $753e9b2889a47c89$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
8250
8115
|
this.#unload();
|
|
8251
8116
|
this.#stop_listening?.();
|
|
8252
8117
|
}
|
|
8253
|
-
constructor({ is_spa_: is_spa_
|
|
8118
|
+
constructor({ is_spa_: is_spa_, ...options }){
|
|
8254
8119
|
super();
|
|
8255
8120
|
Object.assign(this, options);
|
|
8256
8121
|
this.#listen().catch((e)=>(0, $cV3wj$report)([
|