@depict-ai/ui 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/main.js +228 -219
- package/dist/module.js +230 -221
- package/package.json +4 -5
package/dist/module.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {add_to_version_info as $g9l4l$add_to_version_info, fetch_recs as $g9l4l$fetch_recs, snakeCasifyObject as $g9l4l$snakeCasifyObject, GenericSliderArrowButton as $g9l4l$GenericSliderArrowButton, catchify as $g9l4l$catchify, instant_exec_on_suspect_history_change as $g9l4l$instant_exec_on_suspect_history_change, base_url as $g9l4l$base_url, dlog as $g9l4l$dlog, get_depict_id as $g9l4l$get_depict_id, get_user_id as $g9l4l$get_user_id, get_session_id as $g9l4l$get_session_id, make_url_with_query_params as $g9l4l$make_url_with_query_params, fetch_retry as $g9l4l$fetch_retry, add_version_query_params as $g9l4l$add_version_query_params, sort_obj as $g9l4l$sort_obj, Placeholder as $g9l4l$Placeholder, report as $g9l4l$report, javascript_media_query as $g9l4l$javascript_media_query, standard_price_format as $g9l4l$standard_price_format, make_random_classname as $g9l4l$make_random_classname, n_col_styling_with_dist as $g9l4l$n_col_styling_with_dist, observer as $g9l4l$observer, CrossIcon as $g9l4l$CrossIcon, useExpandingContainer as $g9l4l$useExpandingContainer, Amazing_Slider as $g9l4l$Amazing_Slider, slider_snap_css as $g9l4l$slider_snap_css, slider_fading_factory as $g9l4l$slider_fading_factory, MinusIcon as $g9l4l$MinusIcon, FilterIcon as $g9l4l$FilterIcon, SortIconAsc as $g9l4l$SortIconAsc, SortIconDesc as $g9l4l$SortIconDesc, PlusIcon as $g9l4l$PlusIcon, hsl_to_rgb as $g9l4l$hsl_to_rgb, relative_luminance_from_rgb as $g9l4l$relative_luminance_from_rgb, TickIcon as $g9l4l$TickIcon, ArrowUp as $g9l4l$ArrowUp, queueMacroTask as $g9l4l$queueMacroTask, dwarn as $g9l4l$dwarn, ContainedPlaceholderImage as $g9l4l$ContainedPlaceholderImage, BackIcon as $g9l4l$BackIcon, SearchIcon as $g9l4l$SearchIcon, Layout as $g9l4l$Layout, async_iterable_ipns as $g9l4l$async_iterable_ipns, make_asyncIterable_exiter as $g9l4l$make_asyncIterable_exiter, href_change_ipns as $g9l4l$href_change_ipns, ContainedImage as $g9l4l$ContainedImage, buildThresholdList as $g9l4l$buildThresholdList, deparallelize_no_drop as $g9l4l$deparallelize_no_drop, PreviousSearchIcon as $g9l4l$PreviousSearchIcon, insert_surfaces as $g9l4l$insert_surfaces} from "@depict-ai/utilishared";
|
|
1
|
+
import {add_to_version_info as $g9l4l$add_to_version_info, fetch_recs as $g9l4l$fetch_recs, snakeCasifyObject as $g9l4l$snakeCasifyObject, GenericSliderArrowButton as $g9l4l$GenericSliderArrowButton, catchify as $g9l4l$catchify, instant_exec_on_suspect_history_change as $g9l4l$instant_exec_on_suspect_history_change, base_url as $g9l4l$base_url, dlog as $g9l4l$dlog, get_depict_id as $g9l4l$get_depict_id, get_user_id as $g9l4l$get_user_id, get_session_id as $g9l4l$get_session_id, make_url_with_query_params as $g9l4l$make_url_with_query_params, fetch_retry as $g9l4l$fetch_retry, add_version_query_params as $g9l4l$add_version_query_params, sort_obj as $g9l4l$sort_obj, Placeholder as $g9l4l$Placeholder, report as $g9l4l$report, javascript_media_query as $g9l4l$javascript_media_query, standard_price_format as $g9l4l$standard_price_format, make_random_classname as $g9l4l$make_random_classname, n_col_styling_with_dist as $g9l4l$n_col_styling_with_dist, observer as $g9l4l$observer, CrossIcon as $g9l4l$CrossIcon, useExpandingContainer as $g9l4l$useExpandingContainer, Amazing_Slider as $g9l4l$Amazing_Slider, slider_snap_css as $g9l4l$slider_snap_css, slider_fading_factory as $g9l4l$slider_fading_factory, MinusIcon as $g9l4l$MinusIcon, FilterIcon as $g9l4l$FilterIcon, SortIconAsc as $g9l4l$SortIconAsc, SortIconDesc as $g9l4l$SortIconDesc, PlusIcon as $g9l4l$PlusIcon, hsl_to_rgb as $g9l4l$hsl_to_rgb, relative_luminance_from_rgb as $g9l4l$relative_luminance_from_rgb, TickIcon as $g9l4l$TickIcon, ArrowUp as $g9l4l$ArrowUp, base64_encode_unicode as $g9l4l$base64_encode_unicode, base64_decode_unicode as $g9l4l$base64_decode_unicode, queueMacroTask as $g9l4l$queueMacroTask, dwarn as $g9l4l$dwarn, ContainedPlaceholderImage as $g9l4l$ContainedPlaceholderImage, BackIcon as $g9l4l$BackIcon, SearchIcon as $g9l4l$SearchIcon, Layout as $g9l4l$Layout, async_iterable_ipns as $g9l4l$async_iterable_ipns, make_asyncIterable_exiter as $g9l4l$make_asyncIterable_exiter, href_change_ipns as $g9l4l$href_change_ipns, ContainedImage as $g9l4l$ContainedImage, buildThresholdList as $g9l4l$buildThresholdList, deparallelize_no_drop as $g9l4l$deparallelize_no_drop, PreviousSearchIcon as $g9l4l$PreviousSearchIcon, insert_surfaces as $g9l4l$insert_surfaces} from "@depict-ai/utilishared";
|
|
2
2
|
import {template as $g9l4l$template, insert as $g9l4l$insert, effect as $g9l4l$effect, setAttribute as $g9l4l$setAttribute, createComponent as $g9l4l$createComponent, use as $g9l4l$use, memo as $g9l4l$memo, addEventListener as $g9l4l$addEventListener, delegateEvents as $g9l4l$delegateEvents, spread as $g9l4l$spread, classList as $g9l4l$classList, style as $g9l4l$style, Dynamic as $g9l4l$Dynamic, mergeProps as $g9l4l$mergeProps, className as $g9l4l$className} from "solid-js/web";
|
|
3
|
-
import {createSignal as $g9l4l$createSignal, onCleanup as $g9l4l$onCleanup, createComputed as $g9l4l$createComputed, createRenderEffect as $g9l4l$createRenderEffect, createEffect as $g9l4l$createEffect, untrack as $g9l4l$untrack, batch as $g9l4l$batch, createResource as $g9l4l$createResource, createMemo as $g9l4l$createMemo, Show as $g9l4l$Show, createReaction as $g9l4l$createReaction, Suspense as $g9l4l$Suspense, on as $g9l4l$on,
|
|
4
|
-
import {compressToBase64 as $g9l4l$compressToBase64, decompressFromBase64 as $g9l4l$decompressFromBase64} from "lz-string";
|
|
3
|
+
import {createSignal as $g9l4l$createSignal, getOwner as $g9l4l$getOwner, createRoot as $g9l4l$createRoot, runWithOwner as $g9l4l$runWithOwner, onCleanup as $g9l4l$onCleanup, createComputed as $g9l4l$createComputed, createRenderEffect as $g9l4l$createRenderEffect, createEffect as $g9l4l$createEffect, untrack as $g9l4l$untrack, batch as $g9l4l$batch, createResource as $g9l4l$createResource, createMemo as $g9l4l$createMemo, Show as $g9l4l$Show, createReaction as $g9l4l$createReaction, Suspense as $g9l4l$Suspense, on as $g9l4l$on, ErrorBoundary as $g9l4l$ErrorBoundary, For as $g9l4l$For, Index as $g9l4l$Index} from "solid-js";
|
|
5
4
|
|
|
6
|
-
/*! Depict.ai search and product listing SDK */ const $18bf1d29fb889cca$export$83d89fbfd8236492 = "1.0.
|
|
5
|
+
/*! Depict.ai search and product listing SDK */ const $18bf1d29fb889cca$export$83d89fbfd8236492 = "1.0.2";
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
|
|
@@ -4399,7 +4398,7 @@ function $73294c7089bfc7c9$var$encode_filter_data(op, data) {
|
|
|
4399
4398
|
return encoded_data;
|
|
4400
4399
|
}
|
|
4401
4400
|
// Fallback encoding
|
|
4402
|
-
return (0, $g9l4l$
|
|
4401
|
+
return (0, $g9l4l$base64_encode_unicode)(JSON.stringify(data));
|
|
4403
4402
|
}
|
|
4404
4403
|
function $73294c7089bfc7c9$var$decode_filter_data(op, encoded_data) {
|
|
4405
4404
|
if (encoded_data === "1") return "true";
|
|
@@ -4407,7 +4406,7 @@ function $73294c7089bfc7c9$var$decode_filter_data(op, encoded_data) {
|
|
|
4407
4406
|
if (op === "inrange" && encoded_data.includes($73294c7089bfc7c9$var$range_delimiter)) return encoded_data.split($73294c7089bfc7c9$var$range_delimiter).map((x)=>parseFloat(x));
|
|
4408
4407
|
if (encoded_data.includes($73294c7089bfc7c9$var$string_item_delimiter) || encoded_data.includes($73294c7089bfc7c9$var$array_item_delimiter)) return $73294c7089bfc7c9$var$decode_array(encoded_data);
|
|
4409
4408
|
try {
|
|
4410
|
-
return JSON.parse((0, $g9l4l$
|
|
4409
|
+
return JSON.parse((0, $g9l4l$base64_decode_unicode)(encoded_data));
|
|
4411
4410
|
} catch (e) {
|
|
4412
4411
|
(0, $g9l4l$dlog)("Failed to fallback parse filter data", op, encoded_data, e);
|
|
4413
4412
|
}
|
|
@@ -4468,13 +4467,13 @@ function $73294c7089bfc7c9$export$af4a870a0ee262c4(search_params) {
|
|
|
4468
4467
|
];
|
|
4469
4468
|
for (const key of keys)if (key.startsWith($73294c7089bfc7c9$var$filter_query_param_prefix) || key === $73294c7089bfc7c9$var$sorting_query_param) search_params.delete(key);
|
|
4470
4469
|
}
|
|
4471
|
-
const $73294c7089bfc7c9$export$
|
|
4470
|
+
const $73294c7089bfc7c9$export$cf5feb2102aec7f2 = "went_sideways_clear_filters";
|
|
4472
4471
|
function $73294c7089bfc7c9$export$43cd1e747fecd42e(to_url, set_clearing_flag, from_search_params = new URLSearchParams(location.search)) {
|
|
4473
4472
|
if (!to_url) return to_url;
|
|
4474
4473
|
const was_url_object = to_url instanceof URL;
|
|
4475
4474
|
const url_object = was_url_object ? to_url : new URL(to_url, location.origin);
|
|
4476
4475
|
const { searchParams: searchParams } = url_object;
|
|
4477
|
-
if (set_clearing_flag) searchParams.set($73294c7089bfc7c9$export$
|
|
4476
|
+
if (set_clearing_flag) searchParams.set($73294c7089bfc7c9$export$cf5feb2102aec7f2, "true");
|
|
4478
4477
|
if (from_search_params.has($73294c7089bfc7c9$var$sorting_query_param)) searchParams.set($73294c7089bfc7c9$var$sorting_query_param, from_search_params.get($73294c7089bfc7c9$var$sorting_query_param));
|
|
4479
4478
|
for (const key of from_search_params.keys())if (key.startsWith($73294c7089bfc7c9$var$filter_query_param_prefix)) searchParams.set(key, from_search_params.get(key));
|
|
4480
4479
|
if (was_url_object) return url_object;
|
|
@@ -4648,6 +4647,7 @@ function $6af87e1502f04aa3$export$466cdc317043f6cb({ quicklinks_data_: quicklink
|
|
|
4648
4647
|
const quicklinks_data = quicklinks_data_(); // this signal should have updated by now since this is a createEffect
|
|
4649
4648
|
const current_id = current_query_id_();
|
|
4650
4649
|
if (!new_data || !quicklinks_data || !current_id) return;
|
|
4650
|
+
const owner = (0, $g9l4l$getOwner)();
|
|
4651
4651
|
queueMicrotask(()=>{
|
|
4652
4652
|
// has to be in microtask so that elements have rendered and are scroll-to-able
|
|
4653
4653
|
scrolling_logic_ran_for_query_id = true;
|
|
@@ -4660,17 +4660,17 @@ function $6af87e1502f04aa3$export$466cdc317043f6cb({ quicklinks_data_: quicklink
|
|
|
4660
4660
|
} else if (!(intersecting_items_object[selected_index()]?.intersectionRatio >= 0.95)) {
|
|
4661
4661
|
// negated larger than to handle left side of comparison being undefined
|
|
4662
4662
|
let done_work = false;
|
|
4663
|
-
(0, $g9l4l$createComputed)((0, $g9l4l$catchify)(()=>{
|
|
4664
|
-
|
|
4665
|
-
|
|
4666
|
-
|
|
4667
|
-
|
|
4668
|
-
|
|
4669
|
-
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
|
|
4663
|
+
(0, $g9l4l$runWithOwner)(owner, ()=>(0, $g9l4l$createComputed)((0, $g9l4l$catchify)(()=>{
|
|
4664
|
+
if (done_work || !Array.isArray(quicklinks_data_())) return;
|
|
4665
|
+
const sel_index = selected_index();
|
|
4666
|
+
const target_element = sel_index >= 0 ? sel_index : 0;
|
|
4667
|
+
if (document.documentElement.contains(insert_here)) {
|
|
4668
|
+
slider.scroll_to_abs(target_element, true); // if nothing selected and no selected scroll position, go to left
|
|
4669
|
+
last_scroll_position = insert_here.scrollLeft; // update this because it might get removed from the DOM before intersection observers triggered (actually happened for me)
|
|
4670
|
+
} else // can't scroll if not in the DOM, scroll when we're back instead
|
|
4671
|
+
scroll_to_element_on_dom_insertion = target_element;
|
|
4672
|
+
done_work = true;
|
|
4673
|
+
})));
|
|
4674
4674
|
}
|
|
4675
4675
|
});
|
|
4676
4676
|
}, {
|
|
@@ -4857,8 +4857,7 @@ let $01115659405f3c64$export$44dad306455dddf;
|
|
|
4857
4857
|
|
|
4858
4858
|
|
|
4859
4859
|
|
|
4860
|
-
|
|
4861
|
-
function $cb20e79516018342$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_ , router_: router_ }) {
|
|
4860
|
+
function $cb20e79516018342$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_ }) {
|
|
4862
4861
|
// If we just got opened in a new tab, clear filters instantly and remove the flag
|
|
4863
4862
|
$cb20e79516018342$var$clear_if_opened_new_tab_with_sideways_url_params_flag({
|
|
4864
4863
|
plp_results_: plp_results_,
|
|
@@ -4866,7 +4865,7 @@ function $cb20e79516018342$export$3945d6db2dfd3d12({ crumb_data_: crumb_data_ ,
|
|
|
4866
4865
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
4867
4866
|
selected_filters_: selected_filters_,
|
|
4868
4867
|
i18n_: i18n_,
|
|
4869
|
-
|
|
4868
|
+
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_
|
|
4870
4869
|
});
|
|
4871
4870
|
// Code below is for when we're already open and the user navigates to a new category
|
|
4872
4871
|
let previous_crumb_data = (0, $g9l4l$untrack)(crumb_data_);
|
|
@@ -4896,7 +4895,7 @@ function $cb20e79516018342$export$3945d6db2dfd3d12({ crumb_data_: crumb_data_ ,
|
|
|
4896
4895
|
local_filter_cache_: local_filter_cache_
|
|
4897
4896
|
});
|
|
4898
4897
|
// Also ensure we don't have `sideways_url_params_flag` set anymore
|
|
4899
|
-
|
|
4898
|
+
sideways_filter_clearing_flag_[1](false);
|
|
4900
4899
|
}
|
|
4901
4900
|
}
|
|
4902
4901
|
query_id_when_we_got_previous_data = query_id_of_new_data;
|
|
@@ -4904,11 +4903,11 @@ function $cb20e79516018342$export$3945d6db2dfd3d12({ crumb_data_: crumb_data_ ,
|
|
|
4904
4903
|
if (!allow_filter_clearing) allow_filter_clearing = true;
|
|
4905
4904
|
})));
|
|
4906
4905
|
}
|
|
4907
|
-
function $cb20e79516018342$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_ ,
|
|
4906
|
+
function $cb20e79516018342$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_] }) {
|
|
4908
4907
|
const tracking_function_for_plp_results = (0, $g9l4l$createReaction)(()=>{
|
|
4909
4908
|
// 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
|
|
4910
|
-
|
|
4911
|
-
|
|
4909
|
+
if (!(0, $g9l4l$untrack)(get_sideways_filter_clearing_flag_)) return;
|
|
4910
|
+
set_sideways_filter_clearing_flag_(false);
|
|
4912
4911
|
(0, $g9l4l$dlog)("Flag to clear filters was set, clearing filters");
|
|
4913
4912
|
(0, $g9l4l$queueMacroTask)(()=>{
|
|
4914
4913
|
// Do it next task so that all the filters have time to populate
|
|
@@ -4924,22 +4923,10 @@ function $cb20e79516018342$var$clear_if_opened_new_tab_with_sideways_url_params_
|
|
|
4924
4923
|
});
|
|
4925
4924
|
tracking_function_for_plp_results(plp_results_);
|
|
4926
4925
|
}
|
|
4927
|
-
function $cb20e79516018342$var$delete_sideways_param_flag(router) {
|
|
4928
|
-
const url_object = new URL(location.href);
|
|
4929
|
-
const { searchParams: searchParams } = url_object;
|
|
4930
|
-
if (searchParams.get((0, $73294c7089bfc7c9$export$e2cf3f19dd3f8aac)) !== "true") return false;
|
|
4931
|
-
searchParams.delete((0, $73294c7089bfc7c9$export$e2cf3f19dd3f8aac));
|
|
4932
|
-
router.navigate_.go_to_({
|
|
4933
|
-
new_url_: url_object,
|
|
4934
|
-
is_replace_: true,
|
|
4935
|
-
force_spa_navigation_: true
|
|
4936
|
-
});
|
|
4937
|
-
return true;
|
|
4938
|
-
}
|
|
4939
4926
|
|
|
4940
4927
|
|
|
4941
4928
|
const $1ae892b13d7746ab$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$g9l4l$template)(`<div class="product-count"> </div>`, 2), $1ae892b13d7746ab$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$g9l4l$template)(`<div></div>`, 2), $1ae892b13d7746ab$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$g9l4l$template)(`<div class="filter-results-for-one-row"></div>`, 2), $1ae892b13d7746ab$var$_tmpl$4 = /*@__PURE__*/ (0, /*@__PURE__*/$g9l4l$template)(`<div class="depict plp category"><div class="listing-page"></div></div>`, 4);
|
|
4942
|
-
function $1ae892b13d7746ab$export$f7d2f673fc2f091d({ depict_api_: depict_api_ , query_id_: query_id_ , current_sorting_: current_sorting_ , min_products_to_fetch_: min_products_to_fetch_ , category_filters_open_: category_filters_open_ , category_sorting_open_: category_sorting_open_ , expanded_filters_: expanded_filters_ , selected_filters_: selected_filters_ , get_quicklinks_accessor_: get_quicklinks_accessor_ , i18n_: incoming_i18n , get_breadcrumb_accessor_: get_breadcrumb_accessor_ , slider_arrow_button_: slider_arrow_button_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , local_filter_cache_: local_filter_cache_ , tenant_: tenant_ , market_: market_ , 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_ }) {
|
|
4929
|
+
function $1ae892b13d7746ab$export$f7d2f673fc2f091d({ depict_api_: depict_api_ , query_id_: query_id_ , current_sorting_: current_sorting_ , min_products_to_fetch_: min_products_to_fetch_ , category_filters_open_: category_filters_open_ , category_sorting_open_: category_sorting_open_ , expanded_filters_: expanded_filters_ , selected_filters_: selected_filters_ , get_quicklinks_accessor_: get_quicklinks_accessor_ , i18n_: incoming_i18n , get_breadcrumb_accessor_: get_breadcrumb_accessor_ , slider_arrow_button_: slider_arrow_button_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , local_filter_cache_: local_filter_cache_ , tenant_: tenant_ , market_: market_ , 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_ }) {
|
|
4943
4930
|
let results_for;
|
|
4944
4931
|
let only_show_filters_opener_;
|
|
4945
4932
|
let middle_elements_;
|
|
@@ -5115,7 +5102,7 @@ function $1ae892b13d7746ab$export$f7d2f673fc2f091d({ depict_api_: depict_api_ ,
|
|
|
5115
5102
|
local_filter_cache_: local_filter_cache_,
|
|
5116
5103
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
5117
5104
|
plp_results_: plp_results_,
|
|
5118
|
-
|
|
5105
|
+
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_
|
|
5119
5106
|
});
|
|
5120
5107
|
get_breadcrumb_accessor_?.(crumb_data_);
|
|
5121
5108
|
get_quicklinks_accessor_?.(quicklinks_data_);
|
|
@@ -5307,7 +5294,9 @@ const $b4e6a093ae83373b$export$6daf8749b65a1b77 = (cols_at_size)=>{
|
|
|
5307
5294
|
];
|
|
5308
5295
|
}
|
|
5309
5296
|
// Sort widths in ascending order
|
|
5310
|
-
const sorted_cols_at_size =
|
|
5297
|
+
const sorted_cols_at_size = [
|
|
5298
|
+
...cols_at_size
|
|
5299
|
+
].sort((a, b)=>{
|
|
5311
5300
|
const [_b, width_A] = a;
|
|
5312
5301
|
const [_a, width_b] = b;
|
|
5313
5302
|
if (width_A === undefined) return -1;
|
|
@@ -5365,14 +5354,18 @@ function $c7f938ac40924f3b$export$23fca46f3143581f(component, error_message) {
|
|
|
5365
5354
|
|
|
5366
5355
|
|
|
5367
5356
|
|
|
5368
|
-
function $f01b3a0b9fbf6519$export$477caf01aecaeb2a(
|
|
5357
|
+
function $f01b3a0b9fbf6519$export$477caf01aecaeb2a(options) {
|
|
5358
|
+
const router_ = options.router_;
|
|
5359
|
+
const search_query_url_param_name_ = "search_query_url_param_name_" in options ? options.search_query_url_param_name_ : undefined;
|
|
5369
5360
|
const search_query_ = search_query_url_param_name_ ? (0, $g9l4l$createSignal)("") : undefined;
|
|
5370
5361
|
const get_search_query_ = search_query_?.[0];
|
|
5371
5362
|
const set_search_query = search_query_?.[1];
|
|
5372
5363
|
const current_sorting_ = (0, $g9l4l$createSignal)();
|
|
5373
5364
|
const selected_filters_ = (0, $g9l4l$createSignal)([]);
|
|
5365
|
+
const sideways_filter_clearing_flag_ = (0, $g9l4l$createSignal)(false);
|
|
5374
5366
|
const [get_sorting_, set_sorting] = current_sorting_;
|
|
5375
5367
|
const [get_selected_filters_, set_selected_filters] = selected_filters_;
|
|
5368
|
+
const [get_has_sideways_filter_clearing_flag_, set_has_sideways_filter_clearing_flag] = sideways_filter_clearing_flag_;
|
|
5376
5369
|
const [get_current_href, set_current_href] = (0, $g9l4l$createSignal)(location.href);
|
|
5377
5370
|
const history_change_handler = (0, $g9l4l$catchify)(()=>set_current_href(location.href));
|
|
5378
5371
|
const owner = (0, $g9l4l$getOwner)() || (0, $g9l4l$createRoot)(()=>(0, $g9l4l$getOwner)());
|
|
@@ -5406,12 +5399,14 @@ function $f01b3a0b9fbf6519$export$477caf01aecaeb2a({ search_query_url_param_name
|
|
|
5406
5399
|
const found_query = searchParams.get(search_query_url_param_name_);
|
|
5407
5400
|
set_search_query(found_query || "");
|
|
5408
5401
|
}
|
|
5402
|
+
if (searchParams.get((0, $73294c7089bfc7c9$export$cf5feb2102aec7f2)) === "true") set_has_sideways_filter_clearing_flag(true);
|
|
5409
5403
|
if (!writer_started) {
|
|
5410
5404
|
// The owner here is the createComputed which gets disposed the next time the computation runs - but we actually just want to delay the start of the href_writer until our signals contain the current value of the URL, therefore the runWithOwner
|
|
5411
5405
|
(0, $g9l4l$runWithOwner)(owner, ()=>$f01b3a0b9fbf6519$var$start_href_writer({
|
|
5412
5406
|
get_sorting_: get_sorting_,
|
|
5413
5407
|
get_selected_filters_: get_selected_filters_,
|
|
5414
|
-
router_: router_
|
|
5408
|
+
router_: router_,
|
|
5409
|
+
get_has_sideways_filter_clearing_flag_: get_has_sideways_filter_clearing_flag_
|
|
5415
5410
|
}));
|
|
5416
5411
|
writer_started = true;
|
|
5417
5412
|
}
|
|
@@ -5423,22 +5418,26 @@ function $f01b3a0b9fbf6519$export$477caf01aecaeb2a({ search_query_url_param_name
|
|
|
5423
5418
|
selected_filters_: selected_filters_,
|
|
5424
5419
|
...typeof search_query_url_param_name_ === "string" ? {
|
|
5425
5420
|
search_query_accessor_: get_search_query_
|
|
5426
|
-
} : {
|
|
5421
|
+
} : {
|
|
5422
|
+
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_
|
|
5423
|
+
}
|
|
5427
5424
|
};
|
|
5428
5425
|
}
|
|
5429
5426
|
/**
|
|
5430
5427
|
* Writes the sorting and filters to the URL query parameters when they change.
|
|
5431
|
-
*/ function $f01b3a0b9fbf6519$var$start_href_writer({ get_sorting_: get_sorting_ , get_selected_filters_: get_selected_filters_ , router_: router_ }) {
|
|
5428
|
+
*/ function $f01b3a0b9fbf6519$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_ }) {
|
|
5432
5429
|
(0, $g9l4l$createEffect)((0, $g9l4l$on)([
|
|
5433
5430
|
get_sorting_,
|
|
5434
|
-
get_selected_filters_
|
|
5435
|
-
|
|
5431
|
+
get_selected_filters_,
|
|
5432
|
+
get_has_sideways_filter_clearing_flag_
|
|
5433
|
+
], ([sorting, filters, has_sideways_filter_clearing_flag])=>{
|
|
5436
5434
|
const current_href = location.href;
|
|
5437
5435
|
const url_object = new URL(current_href);
|
|
5438
5436
|
const { searchParams: searchParams } = url_object;
|
|
5439
5437
|
(0, $73294c7089bfc7c9$export$af4a870a0ee262c4)(searchParams);
|
|
5440
5438
|
(0, $73294c7089bfc7c9$export$62acb285a7579555)(sorting, searchParams);
|
|
5441
5439
|
(0, $73294c7089bfc7c9$export$58aa3f171519b6d7)(filters, searchParams);
|
|
5440
|
+
if (!has_sideways_filter_clearing_flag) $f01b3a0b9fbf6519$var$delete_sideways_param_flag(searchParams);
|
|
5442
5441
|
// We can't just check if the URL is equal since sometimes the order of the parameters in the URL changes (randomly?) so we need to compare them one by one
|
|
5443
5442
|
const unmodified_search_params = [
|
|
5444
5443
|
...new URL(current_href).searchParams
|
|
@@ -5458,6 +5457,9 @@ function $f01b3a0b9fbf6519$export$477caf01aecaeb2a({ search_query_url_param_name
|
|
|
5458
5457
|
defer: true
|
|
5459
5458
|
}));
|
|
5460
5459
|
}
|
|
5460
|
+
function $f01b3a0b9fbf6519$var$delete_sideways_param_flag(searchParams) {
|
|
5461
|
+
if (searchParams.get((0, $73294c7089bfc7c9$export$cf5feb2102aec7f2)) === "true") searchParams.delete((0, $73294c7089bfc7c9$export$cf5feb2102aec7f2));
|
|
5462
|
+
}
|
|
5461
5463
|
|
|
5462
5464
|
|
|
5463
5465
|
|
|
@@ -5591,38 +5593,42 @@ class $ec52ef1e6c117813$export$f34314aa9505732e {
|
|
|
5591
5593
|
this.#router.on_navigation_ = new_function;
|
|
5592
5594
|
}
|
|
5593
5595
|
constructor({ api: api , on_navigation: on_navigation , ...props_on_class }){
|
|
5594
|
-
|
|
5595
|
-
$
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
|
|
5600
|
-
|
|
5601
|
-
|
|
5602
|
-
|
|
5603
|
-
|
|
5604
|
-
|
|
5605
|
-
|
|
5606
|
-
|
|
5607
|
-
|
|
5608
|
-
|
|
5609
|
-
|
|
5610
|
-
|
|
5611
|
-
|
|
5612
|
-
|
|
5613
|
-
|
|
5614
|
-
|
|
5615
|
-
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
|
|
5596
|
+
const owner = (0, $g9l4l$getOwner)() || (0, $g9l4l$createRoot)(()=>(0, $g9l4l$getOwner)()); // we might have an owner, if so, pass it on. Otherwise, create one so solid doesn't print warnings to the console
|
|
5597
|
+
(0, $g9l4l$runWithOwner)(owner, ()=>{
|
|
5598
|
+
if ($ec52ef1e6c117813$export$f34314aa9505732e.#has_been_constructed) throw new Error("You can only have one instance of DepictCategory due to state limitations");
|
|
5599
|
+
$ec52ef1e6c117813$export$f34314aa9505732e.#has_been_constructed = true;
|
|
5600
|
+
Object.assign(this, props_on_class); // set initial signal values
|
|
5601
|
+
(0, $2864fd26f57ff474$export$5162a71f252e6122)();
|
|
5602
|
+
if (on_navigation) this.#router.on_navigation_ = on_navigation;
|
|
5603
|
+
const { selected_filters_: selected_filters_ , current_sorting_: current_sorting_ , sideways_filter_clearing_flag_: sideways_filter_clearing_flag_ } = (0, $f01b3a0b9fbf6519$export$477caf01aecaeb2a)({
|
|
5604
|
+
router_: this.#router
|
|
5605
|
+
});
|
|
5606
|
+
const [reset_history_state_, state_] = (0, $3075a4497054bec6$export$9862539c89138352)(()=>({
|
|
5607
|
+
category_filters_open: false,
|
|
5608
|
+
category_sorting_open: false,
|
|
5609
|
+
category_expanded_filters: [],
|
|
5610
|
+
// Please make sure that the signal created by below line always updates AFTER selected_filters_ updates on a "popstate" event. If the filter cache is popped before the selected filters are the code in create_modified_filters() is going to re-calculate search_local_filter_cache without knowing the real value of search_selected_filters, and we'll end up with too few filters in search_local_filter_cache in some cases
|
|
5611
|
+
category_local_filter_cache: [],
|
|
5612
|
+
category_expanded_hierarchical_filters: [],
|
|
5613
|
+
category_scroll_restoration_data: []
|
|
5614
|
+
}), this.#router);
|
|
5615
|
+
const i18n_ = (0, $0466953901b38f18$export$f091cbac892643a4)(this.#locale_signal[0]);
|
|
5616
|
+
$ec52ef1e6c117813$var$privately_shared_properties.set(this, {
|
|
5617
|
+
state_: state_,
|
|
5618
|
+
breadcrumb_signal_: (0, $g9l4l$createSignal)(),
|
|
5619
|
+
quicklinks_signal_: (0, $g9l4l$createSignal)(),
|
|
5620
|
+
i18n_: i18n_,
|
|
5621
|
+
reset_history_state_: reset_history_state_,
|
|
5622
|
+
depict_api_: api ?? new (0, $3846bb34098c738f$export$e015ed2f2950f2e3)(),
|
|
5623
|
+
router_: this.#router,
|
|
5624
|
+
selected_filters_: selected_filters_,
|
|
5625
|
+
current_sorting_: current_sorting_,
|
|
5626
|
+
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
|
|
5627
|
+
slider_arrow_button_: (0, $g9l4l$GenericSliderArrowButton)({
|
|
5628
|
+
height_: 12,
|
|
5629
|
+
width_: 6.46
|
|
5630
|
+
})
|
|
5631
|
+
});
|
|
5626
5632
|
});
|
|
5627
5633
|
}
|
|
5628
5634
|
}
|
|
@@ -5635,7 +5641,7 @@ function $ec52ef1e6c117813$export$e2bf8ce7779e827e({ depict_category: depict_cat
|
|
|
5635
5641
|
grid_spacing: grid_spacing.horizontal
|
|
5636
5642
|
};
|
|
5637
5643
|
return (0, $c7f938ac40924f3b$export$23fca46f3143581f)(()=>{
|
|
5638
|
-
const { state_: { category_local_filter_cache: local_filter_cache_ , category_filters_open: category_filters_open_ , category_sorting_open: category_sorting_open_ , category_expanded_filters: expanded_filters_ , category_expanded_hierarchical_filters: expanded_hierarchical_filters_ , category_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_ , slider_arrow_button_: slider_arrow_button_ } = shared_properties;
|
|
5644
|
+
const { state_: { category_local_filter_cache: local_filter_cache_ , category_filters_open: category_filters_open_ , category_sorting_open: category_sorting_open_ , category_expanded_filters: expanded_filters_ , category_expanded_hierarchical_filters: expanded_hierarchical_filters_ , category_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_ , slider_arrow_button_: slider_arrow_button_ , sideways_filter_clearing_flag_: sideways_filter_clearing_flag_ } = shared_properties;
|
|
5639
5645
|
(0, $g9l4l$onCleanup)(reset_history_state_);
|
|
5640
5646
|
return (0, $1ae892b13d7746ab$export$f7d2f673fc2f091d)({
|
|
5641
5647
|
tenant_: ()=>depict_category.merchant,
|
|
@@ -5658,6 +5664,7 @@ function $ec52ef1e6c117813$export$e2bf8ce7779e827e({ depict_category: depict_cat
|
|
|
5658
5664
|
expanded_filters_: expanded_filters_,
|
|
5659
5665
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
5660
5666
|
selected_filters_: selected_filters_,
|
|
5667
|
+
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
|
|
5661
5668
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
5662
5669
|
layout_options_: {
|
|
5663
5670
|
cols_at_size: (0, $b4e6a093ae83373b$export$6daf8749b65a1b77)(cols_at_size),
|
|
@@ -7866,159 +7873,161 @@ class $540e930c58500cbe$export$ac6237957a15b3f0 {
|
|
|
7866
7873
|
#router = new (0, $cfa2761d36e5714c$export$7e1297a3a19f10d8)("hard_navigation");
|
|
7867
7874
|
constructor({ search_query_url_param_name: search_query_url_param_name_ = "query" , url_transformer: url_transformer , on_navigation: on_navigation , enable_category_suggestions: enable_category_suggestions = true , disable_scrolling_during_modal: // Stuff needed for non-standard customer deployments that we shouldn't actually expose
|
|
7868
7875
|
disable_scrolling_during_modal = true , api: api , bottom_distance_under_modal: bottom_distance_under_modal , render_instant_card: render_instant_card , ...props_on_class }){
|
|
7869
|
-
|
|
7870
|
-
|
|
7871
|
-
|
|
7872
|
-
|
|
7873
|
-
|
|
7874
|
-
|
|
7875
|
-
|
|
7876
|
-
const [reset_history_state_, state_] = (0, $3075a4497054bec6$export$9862539c89138352)(()=>({
|
|
7877
|
-
search_field_value: new URLSearchParams(location.search).get(search_query_url_param_name_) ?? "",
|
|
7878
|
-
search_filters_open: false,
|
|
7879
|
-
search_sorting_open: false,
|
|
7880
|
-
search_expanded_filters: [],
|
|
7881
|
-
// Please make sure that the signal created by below line always updates AFTER selected_filters_ updates on a "popstate" event. If the filter cache is popped before the selected filters are the code in create_modified_filters() is going to re-calculate search_local_filter_cache without knowing the real value of search_selected_filters, and we'll end up with too few filters in search_local_filter_cache in some cases
|
|
7882
|
-
search_local_filter_cache: [],
|
|
7883
|
-
search_expanded_hierarchical_filters: [],
|
|
7884
|
-
search_showing_recommendation_rows: (0, $aee0c68312d971f4$export$1c8c715550dc689d),
|
|
7885
|
-
search_scroll_restoration_data: []
|
|
7886
|
-
}), this.#router);
|
|
7887
|
-
const search_query_updating_blocked_ = (0, $g9l4l$createSignal)(false);
|
|
7888
|
-
const [get_search_query_updating_blocked] = search_query_updating_blocked_;
|
|
7889
|
-
const get_search_query_ = (0, $g9l4l$createMemo)((previous_value)=>{
|
|
7890
|
-
if (get_search_query_updating_blocked()) return previous_value;
|
|
7891
|
-
else return raw_search_query_accessor();
|
|
7892
|
-
});
|
|
7893
|
-
const depict_api_ = api ?? new (0, $3846bb34098c738f$export$e015ed2f2950f2e3)();
|
|
7894
|
-
const previous_searches = (0, $4d62f5daa51642fe$export$84bba84a7b837187)(get_search_query_);
|
|
7895
|
-
const [, set_search_showing_recommendation_rows] = state_.search_showing_recommendation_rows;
|
|
7896
|
-
const after_submit_ = ()=>set_search_showing_recommendation_rows((0, $aee0c68312d971f4$export$1c8c715550dc689d)); // do this every time after we have submitted a new query - otherwise there might already be a saved number of rows in the state
|
|
7897
|
-
const on_submit_with_unchanged_value_ = ()=>this.modal_open = false;
|
|
7898
|
-
const [get_search_field_value_, set_search_field_value_] = state_.search_field_value;
|
|
7899
|
-
const configured_submit_query_ = (new_query)=>(0, $7f6ddd9a7e868c4d$export$e16630ecb9644a1c)({
|
|
7900
|
-
on_submit_with_unchanged_value_: on_submit_with_unchanged_value_,
|
|
7901
|
-
set_search_field_value_: set_search_field_value_,
|
|
7902
|
-
get_search_query_: get_search_query_,
|
|
7903
|
-
search_param_name_: search_query_url_param_name_,
|
|
7904
|
-
after_submit_: after_submit_,
|
|
7905
|
-
get_new_query: ()=>new_query || (0, $g9l4l$untrack)(get_search_field_value_),
|
|
7906
|
-
url_transformer_: url_transformer,
|
|
7876
|
+
const owner = (0, $g9l4l$getOwner)() || (0, $g9l4l$createRoot)(()=>(0, $g9l4l$getOwner)()); // we might have an owner, if so, pass it on. Otherwise, create one so solid doesn't print warnings to the console
|
|
7877
|
+
(0, $g9l4l$runWithOwner)(owner, ()=>{
|
|
7878
|
+
if ($540e930c58500cbe$export$ac6237957a15b3f0.#has_been_constructed) throw new Error("You can only have one instance of DepictSearch");
|
|
7879
|
+
Object.assign(this, props_on_class);
|
|
7880
|
+
if (on_navigation) this.#router.on_navigation_ = on_navigation;
|
|
7881
|
+
const { current_sorting_: current_sorting_ , selected_filters_: selected_filters_ , search_query_accessor_: raw_search_query_accessor } = (0, $f01b3a0b9fbf6519$export$477caf01aecaeb2a)({
|
|
7882
|
+
search_query_url_param_name_: search_query_url_param_name_,
|
|
7907
7883
|
router_: this.#router
|
|
7908
7884
|
});
|
|
7909
|
-
|
|
7910
|
-
|
|
7911
|
-
|
|
7912
|
-
|
|
7913
|
-
|
|
7914
|
-
|
|
7915
|
-
|
|
7916
|
-
|
|
7917
|
-
|
|
7918
|
-
|
|
7919
|
-
|
|
7920
|
-
|
|
7921
|
-
|
|
7922
|
-
|
|
7923
|
-
|
|
7924
|
-
|
|
7925
|
-
|
|
7926
|
-
|
|
7927
|
-
|
|
7928
|
-
|
|
7929
|
-
|
|
7930
|
-
|
|
7931
|
-
|
|
7932
|
-
|
|
7933
|
-
|
|
7934
|
-
|
|
7935
|
-
|
|
7936
|
-
|
|
7937
|
-
|
|
7938
|
-
|
|
7939
|
-
|
|
7940
|
-
|
|
7941
|
-
|
|
7885
|
+
const [reset_history_state_, state_] = (0, $3075a4497054bec6$export$9862539c89138352)(()=>({
|
|
7886
|
+
search_field_value: new URLSearchParams(location.search).get(search_query_url_param_name_) ?? "",
|
|
7887
|
+
search_filters_open: false,
|
|
7888
|
+
search_sorting_open: false,
|
|
7889
|
+
search_expanded_filters: [],
|
|
7890
|
+
// Please make sure that the signal created by below line always updates AFTER selected_filters_ updates on a "popstate" event. If the filter cache is popped before the selected filters are the code in create_modified_filters() is going to re-calculate search_local_filter_cache without knowing the real value of search_selected_filters, and we'll end up with too few filters in search_local_filter_cache in some cases
|
|
7891
|
+
search_local_filter_cache: [],
|
|
7892
|
+
search_expanded_hierarchical_filters: [],
|
|
7893
|
+
search_showing_recommendation_rows: (0, $aee0c68312d971f4$export$1c8c715550dc689d),
|
|
7894
|
+
search_scroll_restoration_data: []
|
|
7895
|
+
}), this.#router);
|
|
7896
|
+
const search_query_updating_blocked_ = (0, $g9l4l$createSignal)(false);
|
|
7897
|
+
const [get_search_query_updating_blocked] = search_query_updating_blocked_;
|
|
7898
|
+
const get_search_query_ = (0, $g9l4l$createMemo)((previous_value)=>{
|
|
7899
|
+
if (get_search_query_updating_blocked()) return previous_value;
|
|
7900
|
+
else return raw_search_query_accessor();
|
|
7901
|
+
});
|
|
7902
|
+
const depict_api_ = api ?? new (0, $3846bb34098c738f$export$e015ed2f2950f2e3)();
|
|
7903
|
+
const previous_searches = (0, $4d62f5daa51642fe$export$84bba84a7b837187)(get_search_query_);
|
|
7904
|
+
const [, set_search_showing_recommendation_rows] = state_.search_showing_recommendation_rows;
|
|
7905
|
+
const after_submit_ = ()=>set_search_showing_recommendation_rows((0, $aee0c68312d971f4$export$1c8c715550dc689d)); // do this every time after we have submitted a new query - otherwise there might already be a saved number of rows in the state
|
|
7906
|
+
const on_submit_with_unchanged_value_ = ()=>this.modal_open = false;
|
|
7907
|
+
const [get_search_field_value_, set_search_field_value_] = state_.search_field_value;
|
|
7908
|
+
const configured_submit_query_ = (new_query)=>(0, $7f6ddd9a7e868c4d$export$e16630ecb9644a1c)({
|
|
7909
|
+
on_submit_with_unchanged_value_: on_submit_with_unchanged_value_,
|
|
7910
|
+
set_search_field_value_: set_search_field_value_,
|
|
7911
|
+
get_search_query_: get_search_query_,
|
|
7912
|
+
search_param_name_: search_query_url_param_name_,
|
|
7913
|
+
after_submit_: after_submit_,
|
|
7914
|
+
get_new_query: ()=>new_query || (0, $g9l4l$untrack)(get_search_field_value_),
|
|
7915
|
+
url_transformer_: url_transformer,
|
|
7916
|
+
router_: this.#router
|
|
7917
|
+
});
|
|
7918
|
+
const i18n_ = (0, $0466953901b38f18$export$f091cbac892643a4)(this.#locale_signal[0]);
|
|
7919
|
+
const clear_filters_on_next_submit_ = (0, $a0d89ff25220eb8d$export$e026af0c7b64ea5f)({
|
|
7920
|
+
selected_filters_: selected_filters_,
|
|
7942
7921
|
get_search_query_: get_search_query_,
|
|
7922
|
+
current_sorting_: current_sorting_,
|
|
7923
|
+
expanded_hierarchical_filters_: state_.search_expanded_hierarchical_filters,
|
|
7924
|
+
i18n_: i18n_,
|
|
7925
|
+
local_filter_cache_: state_.search_local_filter_cache
|
|
7926
|
+
});
|
|
7927
|
+
$540e930c58500cbe$var$privately_shared_properties.set(this, {
|
|
7943
7928
|
search_query_url_param_name_: search_query_url_param_name_,
|
|
7944
|
-
|
|
7945
|
-
|
|
7946
|
-
tenant_: this.#merchant_signal[0],
|
|
7947
|
-
clear_filters_: clear_filters_on_next_submit_,
|
|
7948
|
-
market_: this.#market_signal[0],
|
|
7949
|
-
submit_query_: configured_submit_query_,
|
|
7950
|
-
url_transformer_: url_transformer,
|
|
7929
|
+
reset_history_state_: reset_history_state_,
|
|
7930
|
+
state_: state_,
|
|
7951
7931
|
router_: this.#router,
|
|
7952
|
-
|
|
7953
|
-
|
|
7954
|
-
render_instant_card_: render_instant_card,
|
|
7955
|
-
render_instant_card_placeholder_: (0, $aaacfac0064e97d9$export$ee1733d9a8495996),
|
|
7956
|
-
has_sort_or_filters_: (0, $g9l4l$createMemo)(()=>!!(Object.keys(selected_filters_[0]())?.length || current_sorting_[0]()))
|
|
7957
|
-
},
|
|
7958
|
-
i18n_: i18n_,
|
|
7932
|
+
url_transformer_: url_transformer,
|
|
7933
|
+
depict_api_: depict_api_,
|
|
7959
7934
|
enable_category_suggestions_: enable_category_suggestions,
|
|
7960
|
-
|
|
7961
|
-
|
|
7935
|
+
clear_filters_on_next_submit_: clear_filters_on_next_submit_,
|
|
7936
|
+
configured_submit_query_: configured_submit_query_,
|
|
7937
|
+
get_search_query_: get_search_query_,
|
|
7938
|
+
i18n_: i18n_,
|
|
7939
|
+
search_query_updating_blocked_: search_query_updating_blocked_,
|
|
7940
|
+
current_sorting_: current_sorting_,
|
|
7941
|
+
selected_filters_: selected_filters_
|
|
7962
7942
|
});
|
|
7963
|
-
|
|
7964
|
-
|
|
7965
|
-
|
|
7966
|
-
|
|
7967
|
-
|
|
7968
|
-
|
|
7969
|
-
|
|
7970
|
-
|
|
7971
|
-
|
|
7972
|
-
|
|
7973
|
-
|
|
7974
|
-
|
|
7975
|
-
|
|
7976
|
-
|
|
7977
|
-
|
|
7978
|
-
|
|
7979
|
-
|
|
7980
|
-
|
|
7981
|
-
|
|
7943
|
+
(0, $2864fd26f57ff474$export$5162a71f252e6122)();
|
|
7944
|
+
(0, $g9l4l$catchify)(async ()=>{
|
|
7945
|
+
const { open_modal_: open_modal_ , close_modal_: close_modal_ } = await (0, $3786428a06ed81c4$export$79b1565500412d9b)((...args)=>{
|
|
7946
|
+
(0, $g9l4l$onCleanup)(()=>this.modal_open = false);
|
|
7947
|
+
return (0, $a9f6faeac82c322b$export$1c593cbd6f1e10bc)(...args);
|
|
7948
|
+
}, {
|
|
7949
|
+
search_field_value_: state_.search_field_value,
|
|
7950
|
+
get_search_query_: get_search_query_,
|
|
7951
|
+
search_query_url_param_name_: search_query_url_param_name_,
|
|
7952
|
+
previous_searches_: previous_searches,
|
|
7953
|
+
depict_api_: depict_api_,
|
|
7954
|
+
tenant_: this.#merchant_signal[0],
|
|
7955
|
+
clear_filters_: clear_filters_on_next_submit_,
|
|
7956
|
+
market_: this.#market_signal[0],
|
|
7957
|
+
submit_query_: configured_submit_query_,
|
|
7958
|
+
url_transformer_: url_transformer,
|
|
7959
|
+
router_: this.#router,
|
|
7960
|
+
instant_results_options_: {
|
|
7961
|
+
min_products_to_fetch_: $540e930c58500cbe$var$min_products_to_fetch_,
|
|
7962
|
+
render_instant_card_: render_instant_card,
|
|
7963
|
+
render_instant_card_placeholder_: (0, $aaacfac0064e97d9$export$ee1733d9a8495996),
|
|
7964
|
+
has_sort_or_filters_: (0, $g9l4l$createMemo)(()=>!!(Object.keys(selected_filters_[0]())?.length || current_sorting_[0]()))
|
|
7965
|
+
},
|
|
7966
|
+
i18n_: i18n_,
|
|
7967
|
+
enable_category_suggestions_: enable_category_suggestions,
|
|
7968
|
+
disable_scrolling_: disable_scrolling_during_modal,
|
|
7969
|
+
bottom_distance_under_modal_: bottom_distance_under_modal
|
|
7970
|
+
});
|
|
7971
|
+
// This will add some default behaviour to open_modal_ if no style_props_ are supplied
|
|
7972
|
+
// The default behaviour is to align the modal with the input field if possible
|
|
7973
|
+
const modal_opening_effect = ()=>{
|
|
7974
|
+
const open_signal_value = this.modal_open;
|
|
7975
|
+
const signal_value_is_options = Array.isArray(open_signal_value);
|
|
7976
|
+
// Close modal if signal is false
|
|
7977
|
+
if (!open_signal_value) {
|
|
7978
|
+
close_modal_();
|
|
7979
|
+
return;
|
|
7980
|
+
}
|
|
7981
|
+
const { search_page_aligned_modal_body_style_signal_: search_page_aligned_modal_body_style_signal_ } = $540e930c58500cbe$var$privately_shared_properties.get(this);
|
|
7982
|
+
if (signal_value_is_options && open_signal_value[0]?.style_props_) {
|
|
7983
|
+
// They know what they're doing, just call the modal with the provided options
|
|
7984
|
+
open_modal_(...open_signal_value);
|
|
7985
|
+
return;
|
|
7986
|
+
}
|
|
7987
|
+
if (!open_signal_value[0]?.style_props_ && search_page_aligned_modal_body_style_signal_) {
|
|
7988
|
+
// Open modal aligned with search page if no alignment specified and possible to align with search page
|
|
7989
|
+
if (!signal_value_is_options) {
|
|
7990
|
+
open_modal_({
|
|
7991
|
+
style_props_: search_page_aligned_modal_body_style_signal_
|
|
7992
|
+
});
|
|
7993
|
+
return;
|
|
7994
|
+
}
|
|
7995
|
+
const [options_arg, ...rest] = open_signal_value;
|
|
7982
7996
|
open_modal_({
|
|
7997
|
+
...options_arg,
|
|
7983
7998
|
style_props_: search_page_aligned_modal_body_style_signal_
|
|
7984
|
-
});
|
|
7999
|
+
}, ...rest);
|
|
8000
|
+
return;
|
|
8001
|
+
}
|
|
8002
|
+
// Open centered modal
|
|
8003
|
+
const supports_hover = (0, $fefe7683325039b3$export$d9f36cf74e24d595)("(hover: hover) and (pointer: fine)");
|
|
8004
|
+
const desktop_short = (0, $fefe7683325039b3$export$d9f36cf74e24d595)("(max-height: 790px)");
|
|
8005
|
+
const mobile_short = (0, $fefe7683325039b3$export$d9f36cf74e24d595)("(max-height: 1000px)");
|
|
8006
|
+
const transform_y = (0, $g9l4l$createMemo)(()=>supports_hover() ? !desktop_short() : !mobile_short());
|
|
8007
|
+
const style_props_ = (0, $g9l4l$createSignal)({
|
|
8008
|
+
position: "fixed",
|
|
8009
|
+
top: "50%"
|
|
8010
|
+
});
|
|
8011
|
+
(0, $g9l4l$createComputed)(()=>style_props_[1]((old_value)=>({
|
|
8012
|
+
...old_value,
|
|
8013
|
+
transform: transform_y() ? "translateY(-50%)" : "unset"
|
|
8014
|
+
})));
|
|
8015
|
+
if (signal_value_is_options) {
|
|
8016
|
+
const [options_arg, ...rest] = open_signal_value;
|
|
8017
|
+
open_modal_({
|
|
8018
|
+
...options_arg,
|
|
8019
|
+
style_props_: search_page_aligned_modal_body_style_signal_ || style_props_
|
|
8020
|
+
}, ...rest);
|
|
7985
8021
|
return;
|
|
7986
8022
|
}
|
|
7987
|
-
const [options_arg, ...rest] = open_signal_value;
|
|
7988
|
-
open_modal_({
|
|
7989
|
-
...options_arg,
|
|
7990
|
-
style_props_: search_page_aligned_modal_body_style_signal_
|
|
7991
|
-
}, ...rest);
|
|
7992
|
-
return;
|
|
7993
|
-
}
|
|
7994
|
-
// Open centered modal
|
|
7995
|
-
const supports_hover = (0, $fefe7683325039b3$export$d9f36cf74e24d595)("(hover: hover) and (pointer: fine)");
|
|
7996
|
-
const desktop_short = (0, $fefe7683325039b3$export$d9f36cf74e24d595)("(max-height: 790px)");
|
|
7997
|
-
const mobile_short = (0, $fefe7683325039b3$export$d9f36cf74e24d595)("(max-height: 1000px)");
|
|
7998
|
-
const transform_y = (0, $g9l4l$createMemo)(()=>supports_hover() ? !desktop_short() : !mobile_short());
|
|
7999
|
-
const style_props_ = (0, $g9l4l$createSignal)({
|
|
8000
|
-
position: "fixed",
|
|
8001
|
-
top: "50%"
|
|
8002
|
-
});
|
|
8003
|
-
(0, $g9l4l$createComputed)(()=>style_props_[1]((old_value)=>({
|
|
8004
|
-
...old_value,
|
|
8005
|
-
transform: transform_y() ? "translateY(-50%)" : "unset"
|
|
8006
|
-
})));
|
|
8007
|
-
if (signal_value_is_options) {
|
|
8008
|
-
const [options_arg, ...rest] = open_signal_value;
|
|
8009
8023
|
open_modal_({
|
|
8010
|
-
|
|
8011
|
-
|
|
8012
|
-
|
|
8013
|
-
|
|
8014
|
-
|
|
8015
|
-
|
|
8016
|
-
|
|
8017
|
-
});
|
|
8018
|
-
};
|
|
8019
|
-
(0, $g9l4l$runWithOwner)(owner, ()=>(0, $g9l4l$createEffect)(modal_opening_effect));
|
|
8020
|
-
})();
|
|
8021
|
-
$540e930c58500cbe$export$ac6237957a15b3f0.#has_been_constructed = true;
|
|
8024
|
+
style_props_: style_props_
|
|
8025
|
+
});
|
|
8026
|
+
};
|
|
8027
|
+
(0, $g9l4l$runWithOwner)(owner, ()=>(0, $g9l4l$createEffect)(modal_opening_effect));
|
|
8028
|
+
})();
|
|
8029
|
+
$540e930c58500cbe$export$ac6237957a15b3f0.#has_been_constructed = true;
|
|
8030
|
+
});
|
|
8022
8031
|
}
|
|
8023
8032
|
get on_navigation() {
|
|
8024
8033
|
// The only non-reactive public property on the class (I don't see it making sense to have it reactive)
|