@depict-ai/ui 4.3.11 → 4.3.13

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.
@@ -100,7 +100,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $335c02c1241a9ca8$export$5b7
100
100
  $parcel$export(module.exports, "QuickLinks", () => $335c02c1241a9ca8$export$de035477d6fef996);
101
101
  $parcel$export(module.exports, "CategoryPage", () => $c10e33c4681f8c9b$export$e2bf8ce7779e827e);
102
102
  /*! Depict.ai search and product listing SDK */
103
- const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.3.11";
103
+ const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.3.13";
104
104
  const $5401a6698b0c0658$var$transform_elements = sorted_cols_at_size => {
105
105
  const cols_at_size = [];
106
106
  for (let i = 0; i < sorted_cols_at_size.length; i++) {
@@ -704,7 +704,8 @@ function $236a257ee52e5414$export$d41d19e89346fa2(_ref) {
704
704
  recommendations_resource_: recommendations_resource_,
705
705
  product_card_template_: product_card_template_,
706
706
  layout_options_: layout_options_,
707
- title_: title_
707
+ title_: title_,
708
+ NoResultsFallback_: NoResultsFallback_
708
709
  } = _ref;
709
710
  const is_showing_something = $3hooq$solidjs.createMemo(() => {
710
711
  var _recommendations_reso;
@@ -763,6 +764,9 @@ function $236a257ee52e5414$export$d41d19e89346fa2(_ref) {
763
764
  get when() {
764
765
  return is_showing_something();
765
766
  },
767
+ get fallback() {
768
+ return NoResultsFallback_ === null || NoResultsFallback_ === void 0 ? void 0 : NoResultsFallback_();
769
+ },
766
770
  children: slider
767
771
  });
768
772
  }
@@ -1744,7 +1748,8 @@ function $2c920813c92d6987$export$7da560f849543dff(_ref) {
1744
1748
  layout_options_: layout_options_,
1745
1749
  title_: title_,
1746
1750
  max_rows_: max_rows_,
1747
- view_more_button_: view_more_button_
1751
+ view_more_button_: view_more_button_,
1752
+ NoResultsFallback_: NoResultsFallback_
1748
1753
  } = _ref;
1749
1754
  const rows_object_ = $3hooq$solidjs.createMemo(() => {
1750
1755
  var _view_more_button$row;
@@ -1810,6 +1815,9 @@ function $2c920813c92d6987$export$7da560f849543dff(_ref) {
1810
1815
  get when() {
1811
1816
  return is_showing_something();
1812
1817
  },
1818
+ get fallback() {
1819
+ return NoResultsFallback_ === null || NoResultsFallback_ === void 0 ? void 0 : NoResultsFallback_();
1820
+ },
1813
1821
  children: elements
1814
1822
  });
1815
1823
  }
@@ -1879,7 +1887,8 @@ function $e57cd46536ad992e$export$2c9f9bf2092486aa(props) {
1879
1887
  layout_options_: $3hooq$solidjs.createMemo(() => ({
1880
1888
  cols_at_size: $5401a6698b0c0658$export$6daf8749b65a1b77(props.columnsAtSize_),
1881
1889
  ...grid_spacing_override()
1882
- }))
1890
+ })),
1891
+ NoResultsFallback_: () => props.NoResultsFallback_
1883
1892
  };
1884
1893
  $3hooq$solidjs.createEffect(() => {
1885
1894
  const {
@@ -5773,40 +5782,13 @@ function $0257c760a99bfacb$var$set_range_with_sanitation(min_, max_, current_ran
5773
5782
  new_value[index] = value_as_number;
5774
5783
  current_range_signal[1](new_value);
5775
5784
  }
5776
- var $ac040bdfeed58ee4$var$_tmpl$ = ["<div", ' class="morphing-sign" role="img"', "><span></span><span></span></div>"];
5785
+ var $ac040bdfeed58ee4$var$_tmpl$ = ["<div", ' class="', '" role="img"', "><span></span><span></span></div>"];
5777
5786
  function $ac040bdfeed58ee4$export$e5c2828934226505(_ref) {
5778
5787
  let {
5779
5788
  expanded_: expanded_,
5780
5789
  i18n_: i18n_
5781
5790
  } = _ref;
5782
- let first_span;
5783
- let second_span;
5784
- const animation_options = {
5785
- fill: "forwards",
5786
- duration: 200
5787
- };
5788
- const outer_div = $3hooq$solidjsweb.ssr($ac040bdfeed58ee4$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.ssrAttribute("aria-label", expanded_() ? $3hooq$solidjsweb.escape(i18n_.morphing_sign_expanded_aria_label_(), true) : $3hooq$solidjsweb.escape(i18n_.morphing_sign_collapsed_aria_label_(), true), false));
5789
- const [is_in_dom, set_is_in_dom] = $3hooq$solidjs.createSignal(false);
5790
- (0, $3hooq$depictaiutilishared.observer).wait_for_element(outer_div).then($3hooq$depictaiutilishared.catchify(() => set_is_in_dom(true)));
5791
- $3hooq$solidjs.createEffect(() => {
5792
- if (!is_in_dom())
5793
- // wait for us to being in DOM as animations don't work otherwise
5794
- return;
5795
- try {
5796
- const expanded = expanded_();
5797
- for (const span of [first_span, second_span]) span.animate([{
5798
- transform: "rotate(".concat(expanded ? 90 : "0", "deg)")
5799
- }], animation_options);
5800
- const percentage_value = "".concat(expanded ? 50 : 25, "%");
5801
- second_span.animate([{
5802
- left: percentage_value,
5803
- right: percentage_value
5804
- }], animation_options);
5805
- } catch (e) {
5806
- $3hooq$depictaiutilishared.dlog("partial keyframes probably not supported", e);
5807
- }
5808
- });
5809
- return outer_div;
5791
+ return $3hooq$solidjsweb.ssr($ac040bdfeed58ee4$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), "morphing-sign ".concat(expanded_() ? "expanded" : ""), $3hooq$solidjsweb.ssrAttribute("aria-label", expanded_() ? $3hooq$solidjsweb.escape(i18n_.morphing_sign_expanded_aria_label_(), true) : $3hooq$solidjsweb.escape(i18n_.morphing_sign_collapsed_aria_label_(), true), false));
5810
5792
  }
5811
5793
  var $99472afa7112c427$var$_tmpl$ = ["<span", ' class="highlighted-part">', "</span>"];
5812
5794
  const $99472afa7112c427$var$dont_cut_in_between_less_than_characters = 30;
@@ -7438,19 +7420,21 @@ function $a162c9a08dc208c2$export$b288c38ae3fddb56(_ref) {
7438
7420
  // can't or shouldn't be merged due to not being selected, just take remote one
7439
7421
  new_local_filter_state.push(remote_filter);else {
7440
7422
  const data_objs_in_remote = Object.fromEntries(remote_meta.values.map((value, index) => {
7441
- var _remote_meta$counts, _remote_meta$names;
7423
+ var _remote_meta$counts, _remote_meta$names, _swatches;
7442
7424
  return [JSON.stringify(value), {
7443
7425
  value_: value,
7444
7426
  count_: (_remote_meta$counts = remote_meta.counts) === null || _remote_meta$counts === void 0 ? void 0 : _remote_meta$counts[index],
7445
- name_: (_remote_meta$names = remote_meta.names) === null || _remote_meta$names === void 0 ? void 0 : _remote_meta$names[index]
7427
+ name_: (_remote_meta$names = remote_meta.names) === null || _remote_meta$names === void 0 ? void 0 : _remote_meta$names[index],
7428
+ swatches_: (_swatches = remote_meta.swatches) === null || _swatches === void 0 ? void 0 : _swatches[index]
7446
7429
  }];
7447
7430
  }));
7448
7431
  const data_objs_in_local = Object.fromEntries(local_meta.values.map((value, index) => {
7449
- var _local_meta$names;
7432
+ var _local_meta$names, _swatches2;
7450
7433
  return [JSON.stringify(value), {
7451
7434
  value_: value,
7452
7435
  count_: 0,
7453
- name_: (_local_meta$names = local_meta.names) === null || _local_meta$names === void 0 ? void 0 : _local_meta$names[index]
7436
+ name_: (_local_meta$names = local_meta.names) === null || _local_meta$names === void 0 ? void 0 : _local_meta$names[index],
7437
+ swatches_: (_swatches2 = local_meta.swatches) === null || _swatches2 === void 0 ? void 0 : _swatches2[index]
7454
7438
  }];
7455
7439
  }));
7456
7440
  const new_data = [...Object.keys(data_objs_in_local).filter(key => {
@@ -7495,6 +7479,14 @@ function $a162c9a08dc208c2$export$b288c38ae3fddb56(_ref) {
7495
7479
  count_: count_
7496
7480
  } = _ref4;
7497
7481
  return count_;
7482
+ }),
7483
+ ...("swatches" in remote_filter && {
7484
+ swatches: new_data.map(_ref5 => {
7485
+ let {
7486
+ swatches_: swatches_
7487
+ } = _ref5;
7488
+ return swatches_;
7489
+ })
7498
7490
  })
7499
7491
  }
7500
7492
  };
@@ -7544,6 +7536,10 @@ function $a162c9a08dc208c2$var$modify_only_local_filter(local_filter_object, sel
7544
7536
  }
7545
7537
  new_meta.values = values.filter((_, index) => !indexes_to_remove.has(index));
7546
7538
  if (new_meta.names) new_meta.names = new_meta.names.filter((_, index) => !indexes_to_remove.has(index));
7539
+ if ("swatches" in new_meta) {
7540
+ var _new_meta$swatches;
7541
+ new_meta.swatches = (_new_meta$swatches = new_meta.swatches) === null || _new_meta$swatches === void 0 ? void 0 : _new_meta$swatches.filter((_, index) => !indexes_to_remove.has(index));
7542
+ }
7547
7543
  if (new_meta.counts)
7548
7544
  // remove counts that are too much, they're all zero anyway if they exist
7549
7545
  new_meta.counts.length -= indexes_to_remove.size;
@@ -10885,7 +10881,7 @@ function $bf4a8d57aa8dd1c8$export$9ff751cd77687edc(_ref) {
10885
10881
  let {
10886
10882
  search_results_: search_results_,
10887
10883
  router_: router_,
10888
- queries_without_content_results_: queries_without_content_results_,
10884
+ setNumberContentResultsPerQuery_: setNumberContentResultsPerQuery_,
10889
10885
  get_search_query_: get_search_query_
10890
10886
  } = _ref;
10891
10887
  const content_results = $3hooq$solidjs.createMemo(() => {
@@ -10904,7 +10900,11 @@ function $bf4a8d57aa8dd1c8$export$9ff751cd77687edc(_ref) {
10904
10900
  });
10905
10901
  $3hooq$solidjs.createEffect(() => {
10906
10902
  const results = content_results();
10907
- if (Array.isArray(results) && results.length === 0) queries_without_content_results_.add($3hooq$solidjs.untrack(get_search_query_));
10903
+ const numberResults = Array.isArray(results) ? results.length : 0;
10904
+ setNumberContentResultsPerQuery_(prev => {
10905
+ prev.set($3hooq$solidjs.untrack(get_search_query_), numberResults);
10906
+ return prev;
10907
+ });
10908
10908
  });
10909
10909
  return $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.For), {
10910
10910
  get each() {
@@ -10922,7 +10922,8 @@ function $bf4a8d57aa8dd1c8$export$9ff751cd77687edc(_ref) {
10922
10922
  function $05f255c0a94b9ca1$export$4405d077f0a20494(_ref) {
10923
10923
  let {
10924
10924
  content_results_rows_: [get_history_state_content_results_rows],
10925
- cols_at_size_: cols_at_size_
10925
+ cols_at_size_: cols_at_size_,
10926
+ overrideAmount_: overrideAmount_
10926
10927
  } = _ref;
10927
10928
  const colsShowingNow = $478e5a09664da64c$export$a79e666719b3647c(cols_at_size_);
10928
10929
  const largest_column = $3hooq$solidjs.createMemo(() => {
@@ -10935,10 +10936,10 @@ function $05f255c0a94b9ca1$export$4405d077f0a20494(_ref) {
10935
10936
  });
10936
10937
  const num_placeholders = $3hooq$solidjs.createMemo(() => {
10937
10938
  var _get_history_state_co;
10938
- return (
10939
- // Use how many columns we're actually showing, if available, so that we're showing exactly as many placeholders as we'd show content, so that the view more button doesn't appear/disappear and makes the layout shift
10940
- ((_get_history_state_co = get_history_state_content_results_rows()) !== null && _get_history_state_co !== void 0 ? _get_history_state_co : (0, $eab939d0b95b75ee$export$70ceae36059a1036)) * (colsShowingNow() || largest_column())
10941
- );
10939
+ const override = overrideAmount_();
10940
+ if (override !== undefined) return override;
10941
+ // Use how many columns we're actually showing, if available, so that we're showing exactly as many placeholders as we'd show content, so that the view more button doesn't appear/disappear and makes the layout shift
10942
+ return ((_get_history_state_co = get_history_state_content_results_rows()) !== null && _get_history_state_co !== void 0 ? _get_history_state_co : (0, $eab939d0b95b75ee$export$70ceae36059a1036)) * (colsShowingNow() || largest_column());
10942
10943
  });
10943
10944
  return $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Index), {
10944
10945
  get each() {
@@ -10977,15 +10978,13 @@ function $eab939d0b95b75ee$export$6d0c9c22f6652669(_ref) {
10977
10978
  number_: num_results,
10978
10979
  i18n_: i18n_
10979
10980
  });
10980
- const queries_without_content_results_ = new (0, $3hooq$depictaiutilishared.ListenableSet)();
10981
- const [check_query, set_check_query] = $3hooq$solidjs.createSignal(false);
10982
- const placeholders_enabled = $3hooq$solidjs.createMemo(() => {
10983
- // don't show placeholders when the user toggles filters
10984
- check_query();
10985
- return !queries_without_content_results_.has(get_search_query_());
10981
+ const [numberContentResultsPerQuery, setNumberContentResultsPerQuery_] = $3hooq$solidjs.createSignal(new Map(), {
10982
+ equals: false
10986
10983
  });
10984
+ const contentResultsForCurrentQuery = $3hooq$solidjs.createMemo(() => numberContentResultsPerQuery().get(get_search_query_()));
10985
+ // Don't show placeholder if we know there will not be any content results and someone is just toggling filters
10986
+ const placeholders_enabled = $3hooq$solidjs.createMemo(() => contentResultsForCurrentQuery() !== 0);
10987
10987
  const rows_object = $eab939d0b95b75ee$var$make_state_saved_rows(content_results_rows_, i18n_);
10988
- for (const ev of ["add", "delete"]) queries_without_content_results_.addEventListener(ev, () => set_check_query(prev => !prev));
10989
10988
  return $3hooq$solidjsweb.ssr($eab939d0b95b75ee$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), "display:" + (is_loading_() && placeholders_enabled() || ((_content_results2 = content_results()) === null || _content_results2 === void 0 ? void 0 : _content_results2.length) > 0 ? "" : "none"), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $9870a8a48ee126af$export$9dd50d35b9d94fdf), {
10990
10989
  get_search_query_: get_search_query_,
10991
10990
  i18n_: i18n_,
@@ -11008,14 +11007,15 @@ function $eab939d0b95b75ee$export$6d0c9c22f6652669(_ref) {
11008
11007
  content_results_rows_: content_results_rows_,
11009
11008
  get cols_at_size_() {
11010
11009
  return $3hooq$solidjs.createMemo(() => layout_options_().cols_at_size);
11011
- }
11010
+ },
11011
+ overrideAmount_: contentResultsForCurrentQuery
11012
11012
  });
11013
11013
  },
11014
11014
  get children() {
11015
11015
  return $3hooq$solidjsweb.createComponent((0, $bf4a8d57aa8dd1c8$export$9ff751cd77687edc), {
11016
11016
  router_: router_,
11017
11017
  search_results_: search_results_,
11018
- queries_without_content_results_: queries_without_content_results_,
11018
+ setNumberContentResultsPerQuery_: setNumberContentResultsPerQuery_,
11019
11019
  get_search_query_: get_search_query_
11020
11020
  });
11021
11021
  }
@@ -10,7 +10,7 @@ import { ProductListingRequestV3 } from "@depict-ai/types/api/ProductListingRequ
10
10
  import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
11
11
  import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
12
12
  import { SearchFilter as _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
13
- export const version = "4.3.11";
13
+ export const version = "4.3.13";
14
14
  declare const LISTING_ID = "listingId";
15
15
  declare const EXTERNAL_ID = "externalId";
16
16
  type ScrollRestorationData = {
@@ -877,6 +877,7 @@ export function LooksSliderOrGrid(props: {
877
877
  FavoriteButton_?: (props: {
878
878
  display_: Accessor<ModernDisplay | null | undefined>;
879
879
  }) => JSX.Element;
880
+ NoResultsFallback_?: () => JSX.Element;
880
881
  displayTransformers_?: DisplayTransformers<ModernDisplay, ModernDisplayWithPageUrl<ModernDisplay>>;
881
882
  /**
882
883
  * If provided, will render as grid instead of slider
@@ -1,4 +1,4 @@
1
- import { add_to_version_info as $b8hua$add_to_version_info, fetch_retry as $b8hua$fetch_retry, base_url as $b8hua$base_url, dwarn as $b8hua$dwarn, slider_fractional_factory as $b8hua$slider_fractional_factory, dlog as $b8hua$dlog, camelCasifyObject as $b8hua$camelCasifyObject, make_random_classname as $b8hua$make_random_classname, n_col_styling_with_dist as $b8hua$n_col_styling_with_dist, catchify as $b8hua$catchify, layout_get_visible_recs_without_partial_rows as $b8hua$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $b8hua$layout_get_total_rec_amount_for_row, layout_media_query_header as $b8hua$layout_media_query_header, report as $b8hua$report, slider_fading_factory as $b8hua$slider_fading_factory, Amazing_Slider as $b8hua$Amazing_Slider, slider_snap_css as $b8hua$slider_snap_css, observer as $b8hua$observer, javascript_media_query as $b8hua$javascript_media_query, queueMacroTask as $b8hua$queueMacroTask, findMostFrequentItem as $b8hua$findMostFrequentItem, standard_price_format as $b8hua$standard_price_format, instant_exec_on_suspect_history_change as $b8hua$instant_exec_on_suspect_history_change, deparallelize_no_drop as $b8hua$deparallelize_no_drop, ContainedImage as $b8hua$ContainedImage, make_asyncIterable_exiter as $b8hua$make_asyncIterable_exiter, href_change_ipns as $b8hua$href_change_ipns, base64_encode_unicode as $b8hua$base64_encode_unicode, base64_decode_unicode as $b8hua$base64_decode_unicode, use_href_accessor as $b8hua$use_href_accessor, get_session_id as $b8hua$get_session_id, add_version_query_params as $b8hua$add_version_query_params, useExpandingContainer as $b8hua$useExpandingContainer, hex_to_rgb as $b8hua$hex_to_rgb, relative_luminance_from_rgb as $b8hua$relative_luminance_from_rgb, snakeCasifyObject as $b8hua$snakeCasifyObject, make_url_with_query_params as $b8hua$make_url_with_query_params, sort_obj as $b8hua$sort_obj, ListenableSet as $b8hua$ListenableSet1, insert_surfaces as $b8hua$insert_surfaces } from "@depict-ai/utilishared/ES10";
1
+ import { add_to_version_info as $b8hua$add_to_version_info, fetch_retry as $b8hua$fetch_retry, base_url as $b8hua$base_url, dwarn as $b8hua$dwarn, slider_fractional_factory as $b8hua$slider_fractional_factory, dlog as $b8hua$dlog, camelCasifyObject as $b8hua$camelCasifyObject, make_random_classname as $b8hua$make_random_classname, n_col_styling_with_dist as $b8hua$n_col_styling_with_dist, catchify as $b8hua$catchify, layout_get_visible_recs_without_partial_rows as $b8hua$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $b8hua$layout_get_total_rec_amount_for_row, layout_media_query_header as $b8hua$layout_media_query_header, report as $b8hua$report, slider_fading_factory as $b8hua$slider_fading_factory, Amazing_Slider as $b8hua$Amazing_Slider, slider_snap_css as $b8hua$slider_snap_css, observer as $b8hua$observer, javascript_media_query as $b8hua$javascript_media_query, queueMacroTask as $b8hua$queueMacroTask, findMostFrequentItem as $b8hua$findMostFrequentItem, standard_price_format as $b8hua$standard_price_format, instant_exec_on_suspect_history_change as $b8hua$instant_exec_on_suspect_history_change, deparallelize_no_drop as $b8hua$deparallelize_no_drop, ContainedImage as $b8hua$ContainedImage, make_asyncIterable_exiter as $b8hua$make_asyncIterable_exiter, href_change_ipns as $b8hua$href_change_ipns, base64_encode_unicode as $b8hua$base64_encode_unicode, base64_decode_unicode as $b8hua$base64_decode_unicode, use_href_accessor as $b8hua$use_href_accessor, get_session_id as $b8hua$get_session_id, add_version_query_params as $b8hua$add_version_query_params, useExpandingContainer as $b8hua$useExpandingContainer, hex_to_rgb as $b8hua$hex_to_rgb, relative_luminance_from_rgb as $b8hua$relative_luminance_from_rgb, snakeCasifyObject as $b8hua$snakeCasifyObject, make_url_with_query_params as $b8hua$make_url_with_query_params, sort_obj as $b8hua$sort_obj, insert_surfaces as $b8hua$insert_surfaces } from "@depict-ai/utilishared/ES10";
2
2
  import { ssr as $b8hua$ssr, ssrHydrationKey as $b8hua$ssrHydrationKey, escape as $b8hua$escape, ssrStyle as $b8hua$ssrStyle, createComponent as $b8hua$createComponent, mergeProps as $b8hua$mergeProps, isServer as $b8hua$isServer, ssrElement as $b8hua$ssrElement, ssrClassList as $b8hua$ssrClassList, insert as $b8hua$insert, ssrAttribute as $b8hua$ssrAttribute, spread as $b8hua$spread, Dynamic as $b8hua$Dynamic } from "solid-js/web";
3
3
  import { createSignal as $b8hua$createSignal, createMemo as $b8hua$createMemo, createResource as $b8hua$createResource, createEffect as $b8hua$createEffect, Show as $b8hua$Show, mergeProps as $b8hua$mergeProps1, Suspense as $b8hua$Suspense, untrack as $b8hua$untrack, createRenderEffect as $b8hua$createRenderEffect, Index as $b8hua$Index, createRoot as $b8hua$createRoot, onCleanup as $b8hua$onCleanup, For as $b8hua$For, getOwner as $b8hua$getOwner, runWithOwner as $b8hua$runWithOwner, createContext as $b8hua$createContext, useContext as $b8hua$useContext, createUniqueId as $b8hua$createUniqueId, createComputed as $b8hua$createComputed, ErrorBoundary as $b8hua$ErrorBoundary, splitProps as $b8hua$splitProps, on as $b8hua$on, batch as $b8hua$batch, createSelector as $b8hua$createSelector, children as $b8hua$children, createReaction as $b8hua$createReaction, mapArray as $b8hua$mapArray } from "solid-js";
4
4
  import $b8hua$babelruntimehelpersdefineProperty from "@babel/runtime/helpers/defineProperty";
@@ -10,7 +10,7 @@ import { createStore as $b8hua$createStore, reconcile as $b8hua$reconcile } from
10
10
  /*! Depict.ai search and product listing SDK */
11
11
  import { register_es_version } from "../../multi_import_deduplicator.mjs";
12
12
  register_es_version("ui", "ES10");
13
- const $8db9a15135765c11$export$83d89fbfd8236492 = "4.3.11";
13
+ const $8db9a15135765c11$export$83d89fbfd8236492 = "4.3.13";
14
14
  const $a9c7ba6087881ac2$var$transform_elements = sorted_cols_at_size => {
15
15
  const cols_at_size = [];
16
16
  for (let i = 0; i < sorted_cols_at_size.length; i++) {
@@ -614,7 +614,8 @@ function $39ddb986053fb759$export$d41d19e89346fa2(_ref) {
614
614
  recommendations_resource_: recommendations_resource_,
615
615
  product_card_template_: product_card_template_,
616
616
  layout_options_: layout_options_,
617
- title_: title_
617
+ title_: title_,
618
+ NoResultsFallback_: NoResultsFallback_
618
619
  } = _ref;
619
620
  const is_showing_something = $b8hua$createMemo(() => {
620
621
  var _recommendations_reso;
@@ -673,6 +674,9 @@ function $39ddb986053fb759$export$d41d19e89346fa2(_ref) {
673
674
  get when() {
674
675
  return is_showing_something();
675
676
  },
677
+ get fallback() {
678
+ return NoResultsFallback_ === null || NoResultsFallback_ === void 0 ? void 0 : NoResultsFallback_();
679
+ },
676
680
  children: slider
677
681
  });
678
682
  }
@@ -1654,7 +1658,8 @@ function $e3efeb558d952696$export$7da560f849543dff(_ref) {
1654
1658
  layout_options_: layout_options_,
1655
1659
  title_: title_,
1656
1660
  max_rows_: max_rows_,
1657
- view_more_button_: view_more_button_
1661
+ view_more_button_: view_more_button_,
1662
+ NoResultsFallback_: NoResultsFallback_
1658
1663
  } = _ref;
1659
1664
  const rows_object_ = $b8hua$createMemo(() => {
1660
1665
  var _view_more_button$row;
@@ -1720,6 +1725,9 @@ function $e3efeb558d952696$export$7da560f849543dff(_ref) {
1720
1725
  get when() {
1721
1726
  return is_showing_something();
1722
1727
  },
1728
+ get fallback() {
1729
+ return NoResultsFallback_ === null || NoResultsFallback_ === void 0 ? void 0 : NoResultsFallback_();
1730
+ },
1723
1731
  children: elements
1724
1732
  });
1725
1733
  }
@@ -1789,7 +1797,8 @@ function $bb34cd283e904784$export$2c9f9bf2092486aa(props) {
1789
1797
  layout_options_: $b8hua$createMemo(() => ({
1790
1798
  cols_at_size: $a9c7ba6087881ac2$export$6daf8749b65a1b77(props.columnsAtSize_),
1791
1799
  ...grid_spacing_override()
1792
- }))
1800
+ })),
1801
+ NoResultsFallback_: () => props.NoResultsFallback_
1793
1802
  };
1794
1803
  $b8hua$createEffect(() => {
1795
1804
  const {
@@ -5683,40 +5692,13 @@ function $1e7465a8ffa97f6c$var$set_range_with_sanitation(min_, max_, current_ran
5683
5692
  new_value[index] = value_as_number;
5684
5693
  current_range_signal[1](new_value);
5685
5694
  }
5686
- var $457279ff15864cb9$var$_tmpl$ = ["<div", ' class="morphing-sign" role="img"', "><span></span><span></span></div>"];
5695
+ var $457279ff15864cb9$var$_tmpl$ = ["<div", ' class="', '" role="img"', "><span></span><span></span></div>"];
5687
5696
  function $457279ff15864cb9$export$e5c2828934226505(_ref) {
5688
5697
  let {
5689
5698
  expanded_: expanded_,
5690
5699
  i18n_: i18n_
5691
5700
  } = _ref;
5692
- let first_span;
5693
- let second_span;
5694
- const animation_options = {
5695
- fill: "forwards",
5696
- duration: 200
5697
- };
5698
- const outer_div = $b8hua$ssr($457279ff15864cb9$var$_tmpl$, $b8hua$ssrHydrationKey(), $b8hua$ssrAttribute("aria-label", expanded_() ? $b8hua$escape(i18n_.morphing_sign_expanded_aria_label_(), true) : $b8hua$escape(i18n_.morphing_sign_collapsed_aria_label_(), true), false));
5699
- const [is_in_dom, set_is_in_dom] = $b8hua$createSignal(false);
5700
- (0, $b8hua$observer).wait_for_element(outer_div).then($b8hua$catchify(() => set_is_in_dom(true)));
5701
- $b8hua$createEffect(() => {
5702
- if (!is_in_dom())
5703
- // wait for us to being in DOM as animations don't work otherwise
5704
- return;
5705
- try {
5706
- const expanded = expanded_();
5707
- for (const span of [first_span, second_span]) span.animate([{
5708
- transform: "rotate(".concat(expanded ? 90 : "0", "deg)")
5709
- }], animation_options);
5710
- const percentage_value = "".concat(expanded ? 50 : 25, "%");
5711
- second_span.animate([{
5712
- left: percentage_value,
5713
- right: percentage_value
5714
- }], animation_options);
5715
- } catch (e) {
5716
- $b8hua$dlog("partial keyframes probably not supported", e);
5717
- }
5718
- });
5719
- return outer_div;
5701
+ return $b8hua$ssr($457279ff15864cb9$var$_tmpl$, $b8hua$ssrHydrationKey(), "morphing-sign ".concat(expanded_() ? "expanded" : ""), $b8hua$ssrAttribute("aria-label", expanded_() ? $b8hua$escape(i18n_.morphing_sign_expanded_aria_label_(), true) : $b8hua$escape(i18n_.morphing_sign_collapsed_aria_label_(), true), false));
5720
5702
  }
5721
5703
  var $f3a159279dc1a8fb$var$_tmpl$ = ["<span", ' class="highlighted-part">', "</span>"];
5722
5704
  const $f3a159279dc1a8fb$var$dont_cut_in_between_less_than_characters = 30;
@@ -7348,19 +7330,21 @@ function $44aa24b1bb793549$export$b288c38ae3fddb56(_ref) {
7348
7330
  // can't or shouldn't be merged due to not being selected, just take remote one
7349
7331
  new_local_filter_state.push(remote_filter);else {
7350
7332
  const data_objs_in_remote = Object.fromEntries(remote_meta.values.map((value, index) => {
7351
- var _remote_meta$counts, _remote_meta$names;
7333
+ var _remote_meta$counts, _remote_meta$names, _swatches;
7352
7334
  return [JSON.stringify(value), {
7353
7335
  value_: value,
7354
7336
  count_: (_remote_meta$counts = remote_meta.counts) === null || _remote_meta$counts === void 0 ? void 0 : _remote_meta$counts[index],
7355
- name_: (_remote_meta$names = remote_meta.names) === null || _remote_meta$names === void 0 ? void 0 : _remote_meta$names[index]
7337
+ name_: (_remote_meta$names = remote_meta.names) === null || _remote_meta$names === void 0 ? void 0 : _remote_meta$names[index],
7338
+ swatches_: (_swatches = remote_meta.swatches) === null || _swatches === void 0 ? void 0 : _swatches[index]
7356
7339
  }];
7357
7340
  }));
7358
7341
  const data_objs_in_local = Object.fromEntries(local_meta.values.map((value, index) => {
7359
- var _local_meta$names;
7342
+ var _local_meta$names, _swatches2;
7360
7343
  return [JSON.stringify(value), {
7361
7344
  value_: value,
7362
7345
  count_: 0,
7363
- name_: (_local_meta$names = local_meta.names) === null || _local_meta$names === void 0 ? void 0 : _local_meta$names[index]
7346
+ name_: (_local_meta$names = local_meta.names) === null || _local_meta$names === void 0 ? void 0 : _local_meta$names[index],
7347
+ swatches_: (_swatches2 = local_meta.swatches) === null || _swatches2 === void 0 ? void 0 : _swatches2[index]
7364
7348
  }];
7365
7349
  }));
7366
7350
  const new_data = [...Object.keys(data_objs_in_local).filter(key => {
@@ -7405,6 +7389,14 @@ function $44aa24b1bb793549$export$b288c38ae3fddb56(_ref) {
7405
7389
  count_: count_
7406
7390
  } = _ref4;
7407
7391
  return count_;
7392
+ }),
7393
+ ...("swatches" in remote_filter && {
7394
+ swatches: new_data.map(_ref5 => {
7395
+ let {
7396
+ swatches_: swatches_
7397
+ } = _ref5;
7398
+ return swatches_;
7399
+ })
7408
7400
  })
7409
7401
  }
7410
7402
  };
@@ -7454,6 +7446,10 @@ function $44aa24b1bb793549$var$modify_only_local_filter(local_filter_object, sel
7454
7446
  }
7455
7447
  new_meta.values = values.filter((_, index) => !indexes_to_remove.has(index));
7456
7448
  if (new_meta.names) new_meta.names = new_meta.names.filter((_, index) => !indexes_to_remove.has(index));
7449
+ if ("swatches" in new_meta) {
7450
+ var _new_meta$swatches;
7451
+ new_meta.swatches = (_new_meta$swatches = new_meta.swatches) === null || _new_meta$swatches === void 0 ? void 0 : _new_meta$swatches.filter((_, index) => !indexes_to_remove.has(index));
7452
+ }
7457
7453
  if (new_meta.counts)
7458
7454
  // remove counts that are too much, they're all zero anyway if they exist
7459
7455
  new_meta.counts.length -= indexes_to_remove.size;
@@ -10795,7 +10791,7 @@ function $881e8953a9103f10$export$9ff751cd77687edc(_ref) {
10795
10791
  let {
10796
10792
  search_results_: search_results_,
10797
10793
  router_: router_,
10798
- queries_without_content_results_: queries_without_content_results_,
10794
+ setNumberContentResultsPerQuery_: setNumberContentResultsPerQuery_,
10799
10795
  get_search_query_: get_search_query_
10800
10796
  } = _ref;
10801
10797
  const content_results = $b8hua$createMemo(() => {
@@ -10814,7 +10810,11 @@ function $881e8953a9103f10$export$9ff751cd77687edc(_ref) {
10814
10810
  });
10815
10811
  $b8hua$createEffect(() => {
10816
10812
  const results = content_results();
10817
- if (Array.isArray(results) && results.length === 0) queries_without_content_results_.add($b8hua$untrack(get_search_query_));
10813
+ const numberResults = Array.isArray(results) ? results.length : 0;
10814
+ setNumberContentResultsPerQuery_(prev => {
10815
+ prev.set($b8hua$untrack(get_search_query_), numberResults);
10816
+ return prev;
10817
+ });
10818
10818
  });
10819
10819
  return $b8hua$createComponent((0, $b8hua$For), {
10820
10820
  get each() {
@@ -10832,7 +10832,8 @@ function $881e8953a9103f10$export$9ff751cd77687edc(_ref) {
10832
10832
  function $ad4f3c9872fbeb48$export$4405d077f0a20494(_ref) {
10833
10833
  let {
10834
10834
  content_results_rows_: [get_history_state_content_results_rows],
10835
- cols_at_size_: cols_at_size_
10835
+ cols_at_size_: cols_at_size_,
10836
+ overrideAmount_: overrideAmount_
10836
10837
  } = _ref;
10837
10838
  const colsShowingNow = $40e2fa435715a1a0$export$a79e666719b3647c(cols_at_size_);
10838
10839
  const largest_column = $b8hua$createMemo(() => {
@@ -10845,10 +10846,10 @@ function $ad4f3c9872fbeb48$export$4405d077f0a20494(_ref) {
10845
10846
  });
10846
10847
  const num_placeholders = $b8hua$createMemo(() => {
10847
10848
  var _get_history_state_co;
10848
- return (
10849
- // Use how many columns we're actually showing, if available, so that we're showing exactly as many placeholders as we'd show content, so that the view more button doesn't appear/disappear and makes the layout shift
10850
- ((_get_history_state_co = get_history_state_content_results_rows()) !== null && _get_history_state_co !== void 0 ? _get_history_state_co : (0, $d53ebed6f63304e4$export$70ceae36059a1036)) * (colsShowingNow() || largest_column())
10851
- );
10849
+ const override = overrideAmount_();
10850
+ if (override !== undefined) return override;
10851
+ // Use how many columns we're actually showing, if available, so that we're showing exactly as many placeholders as we'd show content, so that the view more button doesn't appear/disappear and makes the layout shift
10852
+ return ((_get_history_state_co = get_history_state_content_results_rows()) !== null && _get_history_state_co !== void 0 ? _get_history_state_co : (0, $d53ebed6f63304e4$export$70ceae36059a1036)) * (colsShowingNow() || largest_column());
10852
10853
  });
10853
10854
  return $b8hua$createComponent((0, $b8hua$Index), {
10854
10855
  get each() {
@@ -10887,15 +10888,13 @@ function $d53ebed6f63304e4$export$6d0c9c22f6652669(_ref) {
10887
10888
  number_: num_results,
10888
10889
  i18n_: i18n_
10889
10890
  });
10890
- const queries_without_content_results_ = new (0, $b8hua$ListenableSet1)();
10891
- const [check_query, set_check_query] = $b8hua$createSignal(false);
10892
- const placeholders_enabled = $b8hua$createMemo(() => {
10893
- // don't show placeholders when the user toggles filters
10894
- check_query();
10895
- return !queries_without_content_results_.has(get_search_query_());
10891
+ const [numberContentResultsPerQuery, setNumberContentResultsPerQuery_] = $b8hua$createSignal(new Map(), {
10892
+ equals: false
10896
10893
  });
10894
+ const contentResultsForCurrentQuery = $b8hua$createMemo(() => numberContentResultsPerQuery().get(get_search_query_()));
10895
+ // Don't show placeholder if we know there will not be any content results and someone is just toggling filters
10896
+ const placeholders_enabled = $b8hua$createMemo(() => contentResultsForCurrentQuery() !== 0);
10897
10897
  const rows_object = $d53ebed6f63304e4$var$make_state_saved_rows(content_results_rows_, i18n_);
10898
- for (const ev of ["add", "delete"]) queries_without_content_results_.addEventListener(ev, () => set_check_query(prev => !prev));
10899
10898
  return $b8hua$ssr($d53ebed6f63304e4$var$_tmpl$, $b8hua$ssrHydrationKey(), "display:" + (is_loading_() && placeholders_enabled() || ((_content_results2 = content_results()) === null || _content_results2 === void 0 ? void 0 : _content_results2.length) > 0 ? "" : "none"), $b8hua$escape($b8hua$createComponent((0, $69602b3d8fd54c38$export$9dd50d35b9d94fdf), {
10900
10899
  get_search_query_: get_search_query_,
10901
10900
  i18n_: i18n_,
@@ -10918,14 +10917,15 @@ function $d53ebed6f63304e4$export$6d0c9c22f6652669(_ref) {
10918
10917
  content_results_rows_: content_results_rows_,
10919
10918
  get cols_at_size_() {
10920
10919
  return $b8hua$createMemo(() => layout_options_().cols_at_size);
10921
- }
10920
+ },
10921
+ overrideAmount_: contentResultsForCurrentQuery
10922
10922
  });
10923
10923
  },
10924
10924
  get children() {
10925
10925
  return $b8hua$createComponent((0, $881e8953a9103f10$export$9ff751cd77687edc), {
10926
10926
  router_: router_,
10927
10927
  search_results_: search_results_,
10928
- queries_without_content_results_: queries_without_content_results_,
10928
+ setNumberContentResultsPerQuery_: setNumberContentResultsPerQuery_,
10929
10929
  get_search_query_: get_search_query_
10930
10930
  });
10931
10931
  }