@depict-ai/ui 4.8.3 → 4.8.5

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/ES10/index.cjs CHANGED
@@ -114,7 +114,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $335c02c1241a9ca8$export$5b7
114
114
  $parcel$export(module.exports, "QuickLinks", () => $335c02c1241a9ca8$export$de035477d6fef996);
115
115
  $parcel$export(module.exports, "CategoryPage", () => $c10e33c4681f8c9b$export$e2bf8ce7779e827e);
116
116
  /*! Depict.ai search and product listing SDK */
117
- const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.8.3";
117
+ const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.8.5";
118
118
  function $054b1113e4897051$export$54c6d6ff54e72743(whatToWatch) {
119
119
  const [width, setWidth] = $52FdA$solidjs.createSignal(0);
120
120
  const [height, setHeight] = $52FdA$solidjs.createSignal(0);
@@ -3257,10 +3257,10 @@ function $068bde7fa83ac02c$export$92f2da32c6e7e7ee(_ref) {
3257
3257
  i18n_: i18n_
3258
3258
  } = _ref;
3259
3259
  return $52FdA$solidjs.createMemo(() => {
3260
- const n_hits = number_();
3261
- if (isNaN(n_hits)) return "";
3260
+ const numberToFormat = number_();
3261
+ if (isNaN(numberToFormat)) return "";
3262
3262
  const price_formatting = i18n_.price_formatting_();
3263
- return $52FdA$depictaiutilishared.standard_price_format(n_hits, 0,
3263
+ return $52FdA$depictaiutilishared.standard_price_format(numberToFormat, 0,
3264
3264
  // we never want places after comma here it looks weird as hell
3265
3265
  price_formatting.decimal_places_delimiter_, price_formatting.thousands_delimiter_);
3266
3266
  });
@@ -5789,9 +5789,10 @@ function $43600b30502feeda$var$RawSearchModalV2(_ref) {
5789
5789
  });
5790
5790
  // total number of results = content results + product results + category suggestions
5791
5791
  const totalNumberResults = $52FdA$solidjs.createMemo(() => {
5792
- var _get_modal_search_res4, _results$content_sear, _listing_suggestions_;
5792
+ var _get_modal_search_res4, _results$displays, _results$content_sear, _listing_suggestions_;
5793
5793
  const results = (_get_modal_search_res4 = get_modal_search_results_()) === null || _get_modal_search_res4 === void 0 ? void 0 : _get_modal_search_res4();
5794
- const hits = results === null || results === void 0 ? void 0 : results.n_hits;
5794
+ // Show actual number of result (more accurate) if there's no cursor (backend doesn't have more products)
5795
+ const hits = results !== null && results !== void 0 && results.cursor ? results === null || results === void 0 ? void 0 : results.n_hits : results === null || results === void 0 ? void 0 : (_results$displays = results.displays) === null || _results$displays === void 0 ? void 0 : _results$displays.length;
5795
5796
  const content_results = content_search_enabled_() && (results === null || results === void 0 ? void 0 : (_results$content_sear = results.content_search_links) === null || _results$content_sear === void 0 ? void 0 : _results$content_sear.length) || 0;
5796
5797
  const category_results = ((_listing_suggestions_ = listing_suggestions_()) === null || _listing_suggestions_ === void 0 ? void 0 : _listing_suggestions_.length) || 0;
5797
5798
  return (hits !== null && hits !== void 0 ? hits : 0) + content_results + category_results;
@@ -7355,6 +7356,10 @@ function $c5842bdb10e57229$export$fecbb157621501bd(_ref) {
7355
7356
  }
7356
7357
  }), _el$21, _co$7);
7357
7358
  $52FdA$solidjsweb.insert(_el$10, () => price_formatting_().post_, _el$23, _co$8);
7359
+ $52FdA$solidjsweb.effect(() => {
7360
+ var _matching_filter3, _matching_filter3$met;
7361
+ return $52FdA$solidjsweb.setAttribute(_el$9, "data-group-title", (_matching_filter3 = matching_filter()) === null || _matching_filter3 === void 0 ? void 0 : (_matching_filter3$met = _matching_filter3.meta) === null || _matching_filter3$met === void 0 ? void 0 : _matching_filter3$met.group_title);
7362
+ });
7358
7363
  $52FdA$solidjsweb.runHydrationEvents();
7359
7364
  return _el$9;
7360
7365
  })();
@@ -7450,6 +7455,10 @@ function $c5842bdb10e57229$export$fecbb157621501bd(_ref) {
7450
7455
  }), true);
7451
7456
  $52FdA$solidjsweb.insert(_el$26, $52FdA$solidjsweb.createComponent((0, $083b2336093176cf$export$3b621d86b1566b2), {}), _el$29, _co$10);
7452
7457
  $52FdA$solidjsweb.insert(_el$27, name);
7458
+ $52FdA$solidjsweb.effect(() => {
7459
+ var _matching_filter4, _matching_filter4$met;
7460
+ return $52FdA$solidjsweb.setAttribute(_el$26, "data-group-title", (_matching_filter4 = matching_filter()) === null || _matching_filter4 === void 0 ? void 0 : (_matching_filter4$met = _matching_filter4.meta) === null || _matching_filter4$met === void 0 ? void 0 : _matching_filter4$met.group_title);
7461
+ });
7453
7462
  $52FdA$solidjsweb.runHydrationEvents();
7454
7463
  return _el$26;
7455
7464
  })();
@@ -12019,7 +12028,8 @@ function $0d3ee7000f047e67$export$a1fd619a4743ca08(_ref) {
12019
12028
  query_base_: query_base_,
12020
12029
  depict_api_: depict_api_,
12021
12030
  is_loading_: is_loading_,
12022
- content_blocks_: content_blocks_
12031
+ content_blocks_: content_blocks_,
12032
+ setCurrentlyLoadedDisplays_: setCurrentlyLoadedDisplays_
12023
12033
  } = _ref;
12024
12034
  // Although typing doesn't reflect it, plp_results is guaranteed to contain an array of at least one display at this point
12025
12035
  const [get_extra_displays, set_extra_displays_] = $52FdA$solidjs.createSignal([], {
@@ -12046,6 +12056,7 @@ function $0d3ee7000f047e67$export$a1fd619a4743ca08(_ref) {
12046
12056
  is_loading_: is_loading_,
12047
12057
  get_extra_displays: get_extra_displays
12048
12058
  });
12059
+ $52FdA$solidjs.createComputed(() => setCurrentlyLoadedDisplays_(displays_by_key_().size));
12049
12060
  $19438fea513c9d01$export$5e4aed86c12acdd9({
12050
12061
  percentage_in_view_: percentage_in_view_,
12051
12062
  set_extra_displays_: set_extra_displays_,
@@ -12106,7 +12117,8 @@ function $484eec37514a982e$export$3925f87b1545cfc6(_ref) {
12106
12117
  layout_options_: layout_options_,
12107
12118
  id_currently_querying_for_: id_currently_querying_for_,
12108
12119
  content_blocks_by_row_: content_blocks_by_row_,
12109
- ConfiguredScrollStatus_: ConfiguredScrollStatus_
12120
+ ConfiguredScrollStatus_: ConfiguredScrollStatus_,
12121
+ setCurrentlyLoadedDisplays_: setCurrentlyLoadedDisplays_
12110
12122
  } = _ref;
12111
12123
  // 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
12112
12124
  const is_loading_ = $52FdA$solidjs.createMemo(() => plp_results_.loading || query_base_.loading);
@@ -12243,7 +12255,8 @@ function $484eec37514a982e$export$3925f87b1545cfc6(_ref) {
12243
12255
  query_base_: query_base_,
12244
12256
  depict_api_: depict_api_,
12245
12257
  is_loading_: is_loading_,
12246
- content_blocks_: content_blocks_
12258
+ content_blocks_: content_blocks_,
12259
+ setCurrentlyLoadedDisplays_: setCurrentlyLoadedDisplays_
12247
12260
  });
12248
12261
  $52FdA$solidjs.onCleanup(() => suspense_contents = undefined);
12249
12262
  return suspense_contents;
@@ -14105,6 +14118,17 @@ function $a60bc7692ce52705$export$44f738469d5570cf(_ref) {
14105
14118
  };
14106
14119
  });
14107
14120
  }
14121
+ function $e335e2ff536c1a0b$export$a86bc18439445599(plp_products_, _ref, currentlyLoadedDisplays) {
14122
+ let [allProductsLoaded] = _ref;
14123
+ return $52FdA$solidjs.createMemo(() => {
14124
+ var _plp_products_;
14125
+ const backendSays = (_plp_products_ = plp_products_()) === null || _plp_products_ === void 0 ? void 0 : _plp_products_.n_hits;
14126
+ const loadedAll = allProductsLoaded();
14127
+ if (!backendSays || !loadedAll) return backendSays;
14128
+ // People can remove displays in the displayTransformers, for example houdini do it (https://depictaiworkspace.slack.com/archives/C061H2TF7K4/p1713261063439089). Correct the n_hits as well as possible in that case.
14129
+ return currentlyLoadedDisplays();
14130
+ });
14131
+ }
14108
14132
  var $739c927cbecd26b0$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class=filter-results-for-one-row><!$><!/><!$><!/>`),
14109
14133
  $739c927cbecd26b0$var$_tmpl$2 = /*#__PURE__*/$52FdA$solidjsweb.template(`<div><div class=listing-page><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/></div><!$><!/><!$><!/>`);
14110
14134
  function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
@@ -14146,6 +14170,7 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
14146
14170
  } = _ref;
14147
14171
  const [get_sorting] = current_sorting_;
14148
14172
  const all_products_loaded_ = $52FdA$solidjs.createSignal(false);
14173
+ const [currentlyLoadedDisplays, setCurrentlyLoadedDisplays_] = $52FdA$solidjs.createSignal(0);
14149
14174
  const [get_all_products_loaded, set_all_products_loaded] = all_products_loaded_;
14150
14175
  const number_of_rendered_selected_filters_items_ = $52FdA$solidjs.createSignal(0);
14151
14176
  const first_result_in_viewport_ = $52FdA$solidjs.createSignal();
@@ -14224,24 +14249,21 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
14224
14249
  const SafeSearchField = $52FdA$depictaiutilishared.catchify((0, $29e5dbeb69da7a36$export$b94867ecbd698f21));
14225
14250
  const [sort_or_filter_open_, set_sort_or_filter_open_] = $52FdA$solidjs.createSignal(false);
14226
14251
  const [desktop_filter_elements_, set_desktop_filter_elements] = $52FdA$solidjs.createSignal();
14227
- const n_hits = $52FdA$solidjs.createMemo(() => {
14228
- var _search_results_3;
14229
- return (_search_results_3 = search_results_()) === null || _search_results_3 === void 0 ? void 0 : _search_results_3.n_hits;
14230
- });
14252
+ const countOfProductsForUI = $e335e2ff536c1a0b$export$a86bc18439445599(search_results_, all_products_loaded_, currentlyLoadedDisplays);
14231
14253
  const formatted_number_of_results_ = $068bde7fa83ac02c$export$92f2da32c6e7e7ee({
14232
- number_: n_hits,
14254
+ number_: countOfProductsForUI,
14233
14255
  i18n_: i18n_
14234
14256
  });
14235
14257
  const [sort_and_filter_element_, set_sort_and_filter_element_] = $52FdA$solidjs.createSignal();
14236
14258
  const no_results_text_ = $52FdA$solidjs.createMemo(() => {
14237
- var _search_results_4, _search_results_4$con;
14238
- return ((_search_results_4 = search_results_()) !== null && _search_results_4 !== void 0 && (_search_results_4$con = _search_results_4.content_search_links) !== null && _search_results_4$con !== void 0 && _search_results_4$con.length ? i18n_.no_products_ : i18n_.no_results_text_)();
14259
+ var _search_results_3, _search_results_3$con;
14260
+ return ((_search_results_3 = search_results_()) !== null && _search_results_3 !== void 0 && (_search_results_3$con = _search_results_3.content_search_links) !== null && _search_results_3$con !== void 0 && _search_results_3$con.length ? i18n_.no_products_ : i18n_.no_results_text_)();
14239
14261
  });
14240
14262
  const results_for = $52FdA$solidjsweb.createComponent((0, $9870a8a48ee126af$export$9dd50d35b9d94fdf), $52FdA$solidjsweb.mergeProps({
14241
14263
  get type() {
14242
14264
  return (0, $9870a8a48ee126af$export$2452208c79fe93ea).products;
14243
14265
  },
14244
- number_of_results_: n_hits
14266
+ number_of_results_: countOfProductsForUI
14245
14267
  }, {
14246
14268
  get_search_query_: get_search_query_,
14247
14269
  i18n_: i18n_,
@@ -14502,6 +14524,7 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
14502
14524
  sort_or_filter_open_: sort_or_filter_open_,
14503
14525
  id_currently_querying_for_: get_search_query_,
14504
14526
  content_blocks_by_row_: content_blocks_by_row_,
14527
+ setCurrentlyLoadedDisplays_: setCurrentlyLoadedDisplays_,
14505
14528
  no_results_options_: {
14506
14529
  selected_filters_: selected_filters_,
14507
14530
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
@@ -14544,10 +14567,7 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
14544
14567
  last_result_in_viewport_: last_result_in_viewport_,
14545
14568
  formatted_number_of_results_: formatted_number_of_results_,
14546
14569
  i18n_: i18n_,
14547
- number_of_results_: $52FdA$solidjs.createMemo(() => {
14548
- var _search_results_5;
14549
- return (_search_results_5 = search_results_()) === null || _search_results_5 === void 0 ? void 0 : _search_results_5.n_hits;
14550
- })
14570
+ number_of_results_: countOfProductsForUI
14551
14571
  });
14552
14572
  }
14553
14573
  }), _el$23, _co$10);
@@ -16167,6 +16187,8 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
16167
16187
  const number_of_rendered_selected_filters_items_ = $52FdA$solidjs.createSignal(0);
16168
16188
  const first_result_in_viewport_ = $52FdA$solidjs.createSignal();
16169
16189
  const last_result_in_viewport_ = $52FdA$solidjs.createSignal();
16190
+ const all_products_loaded_ = $52FdA$solidjs.createSignal(false);
16191
+ const [currentlyLoadedDisplays, setCurrentlyLoadedDisplays_] = $52FdA$solidjs.createSignal(0);
16170
16192
  const [can_write_scroll_restoration_, set_can_write_scroll_restoration] = $52FdA$solidjs.createSignal(false);
16171
16193
  const products_query_base_ = $e4bc31358c414b18$export$210f130a61ac1e8d(() => {
16172
16194
  const sort_obj = get_sorting() && {
@@ -16213,6 +16235,7 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
16213
16235
  // Make "Get Listing" request to get quicklinks, breadcrumbs, title, etc
16214
16236
  const [plp_meta] = $52FdA$solidjs.createResource(meta_query_base, $52FdA$depictaiutilisharedlatest.catchify(query => depict_api_.get_listing(query)));
16215
16237
  const contentBlocksByRow = $0c035bbe7e30b438$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_);
16238
+ const countOfProductsForUI = $e335e2ff536c1a0b$export$a86bc18439445599(plp_products_, all_products_loaded_, currentlyLoadedDisplays);
16216
16239
  const available_sortings_ = $52FdA$solidjs.createMemo(() => {
16217
16240
  var _plp_products_, _plp_products_$sorts;
16218
16241
  return (_plp_products_ = plp_products_()) === null || _plp_products_ === void 0 ? void 0 : (_plp_products_$sorts = _plp_products_.sorts) === null || _plp_products_$sorts === void 0 ? void 0 : _plp_products_$sorts.map(sort => {
@@ -16239,10 +16262,7 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
16239
16262
  const [sort_or_filter_open_, set_sort_or_filter_open_] = $52FdA$solidjs.createSignal(false);
16240
16263
  const [desktop_filter_elements_, set_desktop_filter_elements] = $52FdA$solidjs.createSignal();
16241
16264
  const formatted_number_of_results_ = $068bde7fa83ac02c$export$92f2da32c6e7e7ee({
16242
- number_: $52FdA$solidjs.createMemo(() => {
16243
- var _plp_products_3;
16244
- return (_plp_products_3 = plp_products_()) === null || _plp_products_3 === void 0 ? void 0 : _plp_products_3.n_hits;
16245
- }),
16265
+ number_: countOfProductsForUI,
16246
16266
  i18n_: i18n_
16247
16267
  });
16248
16268
  const [sort_and_filter_element_, set_sort_and_filter_element_] = $52FdA$solidjs.createSignal();
@@ -16265,10 +16285,7 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
16265
16285
  last_result_in_viewport_: last_result_in_viewport_,
16266
16286
  formatted_number_of_results_: formatted_number_of_results_,
16267
16287
  i18n_: i18n_,
16268
- number_of_results_: $52FdA$solidjs.createMemo(() => {
16269
- var _plp_products_4;
16270
- return (_plp_products_4 = plp_products_()) === null || _plp_products_4 === void 0 ? void 0 : _plp_products_4.n_hits;
16271
- }),
16288
+ number_of_results_: countOfProductsForUI,
16272
16289
  ...extraProps
16273
16290
  });
16274
16291
  }
@@ -16295,8 +16312,7 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
16295
16312
  }), _el$4, _co$);
16296
16313
  $52FdA$solidjsweb.insert(_el$, $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Show), {
16297
16314
  get when() {
16298
- var _plp_products_5;
16299
- return ((_plp_products_5 = plp_products_()) === null || _plp_products_5 === void 0 ? void 0 : _plp_products_5.n_hits) === 1;
16315
+ return countOfProductsForUI() === 1;
16300
16316
  },
16301
16317
  get fallback() {
16302
16318
  return i18n_.products_();
@@ -16504,6 +16520,8 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
16504
16520
  content_blocks_by_row_: contentBlocksByRow,
16505
16521
  ConfiguredScrollStatus_: ConfiguredScrollStatus_,
16506
16522
  id_currently_querying_for_: id_to_query_for_,
16523
+ setCurrentlyLoadedDisplays_: setCurrentlyLoadedDisplays_,
16524
+ all_products_loaded_: all_products_loaded_,
16507
16525
  no_results_options_: {
16508
16526
  selected_filters_: selected_filters_,
16509
16527
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
package/ES10/index.d.ts CHANGED
@@ -11,7 +11,7 @@ import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
11
11
  import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
12
12
  import { FeaturedInDisplay } from "@depict-ai/types/api/FeaturedInResponseV3";
13
13
  import { SearchFilter as _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
14
- export const version = "4.8.3";
14
+ export const version = "4.8.5";
15
15
  /**
16
16
  * Returns two accessors (one width and one height) that will update when the size of the provided element changes, to be used with ResponsiveImg
17
17
  */
@@ -1506,7 +1506,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
1506
1506
  * Open the modal with support for alignment.
1507
1507
  * @returns {void}
1508
1508
  */
1509
- export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends unknown>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1509
+ export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends ModernDisplay>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1510
1510
  export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
1511
1511
  export interface PageReplacer {
1512
1512
  readonly render_: () => Node_Array;
@@ -1585,5 +1585,5 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
1585
1585
  content_blocks_by_row?: ContentBlocksByRow;
1586
1586
  layout?: PossibleLayout;
1587
1587
  filterModalParent_?: HTMLElement | ShadowRoot;
1588
- }): import("@depict-ai/utilishared").Node_Array;
1588
+ }): import("@depict-ai/utilishared/latest").Node_Array;
1589
1589
  export type { SearchFilter } from "@depict-ai/types/api/SearchRequestV3";
package/ES10/index.js CHANGED
@@ -10,7 +10,7 @@ import $8tj43$babelruntimehelpersclassPrivateFieldGet from "@babel/runtime/helpe
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.8.3";
13
+ const $8db9a15135765c11$export$83d89fbfd8236492 = "4.8.5";
14
14
  function $4be619ec2cd7bba3$export$54c6d6ff54e72743(whatToWatch) {
15
15
  const [width, setWidth] = $8tj43$createSignal(0);
16
16
  const [height, setHeight] = $8tj43$createSignal(0);
@@ -3153,10 +3153,10 @@ function $43fbdca0f726a34b$export$92f2da32c6e7e7ee(_ref) {
3153
3153
  i18n_: i18n_
3154
3154
  } = _ref;
3155
3155
  return $8tj43$createMemo(() => {
3156
- const n_hits = number_();
3157
- if (isNaN(n_hits)) return "";
3156
+ const numberToFormat = number_();
3157
+ if (isNaN(numberToFormat)) return "";
3158
3158
  const price_formatting = i18n_.price_formatting_();
3159
- return $8tj43$standard_price_format(n_hits, 0,
3159
+ return $8tj43$standard_price_format(numberToFormat, 0,
3160
3160
  // we never want places after comma here it looks weird as hell
3161
3161
  price_formatting.decimal_places_delimiter_, price_formatting.thousands_delimiter_);
3162
3162
  });
@@ -5685,9 +5685,10 @@ function $06fcd2a345efd24d$var$RawSearchModalV2(_ref) {
5685
5685
  });
5686
5686
  // total number of results = content results + product results + category suggestions
5687
5687
  const totalNumberResults = $8tj43$createMemo(() => {
5688
- var _get_modal_search_res4, _results$content_sear, _listing_suggestions_;
5688
+ var _get_modal_search_res4, _results$displays, _results$content_sear, _listing_suggestions_;
5689
5689
  const results = (_get_modal_search_res4 = get_modal_search_results_()) === null || _get_modal_search_res4 === void 0 ? void 0 : _get_modal_search_res4();
5690
- const hits = results === null || results === void 0 ? void 0 : results.n_hits;
5690
+ // Show actual number of result (more accurate) if there's no cursor (backend doesn't have more products)
5691
+ const hits = results !== null && results !== void 0 && results.cursor ? results === null || results === void 0 ? void 0 : results.n_hits : results === null || results === void 0 ? void 0 : (_results$displays = results.displays) === null || _results$displays === void 0 ? void 0 : _results$displays.length;
5691
5692
  const content_results = content_search_enabled_() && (results === null || results === void 0 ? void 0 : (_results$content_sear = results.content_search_links) === null || _results$content_sear === void 0 ? void 0 : _results$content_sear.length) || 0;
5692
5693
  const category_results = ((_listing_suggestions_ = listing_suggestions_()) === null || _listing_suggestions_ === void 0 ? void 0 : _listing_suggestions_.length) || 0;
5693
5694
  return (hits !== null && hits !== void 0 ? hits : 0) + content_results + category_results;
@@ -7251,6 +7252,10 @@ function $4711a82d08d2021b$export$fecbb157621501bd(_ref) {
7251
7252
  }
7252
7253
  }), _el$21, _co$7);
7253
7254
  $8tj43$insert(_el$10, () => price_formatting_().post_, _el$23, _co$8);
7255
+ $8tj43$effect(() => {
7256
+ var _matching_filter3, _matching_filter3$met;
7257
+ return $8tj43$setAttribute(_el$9, "data-group-title", (_matching_filter3 = matching_filter()) === null || _matching_filter3 === void 0 ? void 0 : (_matching_filter3$met = _matching_filter3.meta) === null || _matching_filter3$met === void 0 ? void 0 : _matching_filter3$met.group_title);
7258
+ });
7254
7259
  $8tj43$runHydrationEvents();
7255
7260
  return _el$9;
7256
7261
  })();
@@ -7346,6 +7351,10 @@ function $4711a82d08d2021b$export$fecbb157621501bd(_ref) {
7346
7351
  }), true);
7347
7352
  $8tj43$insert(_el$26, $8tj43$createComponent((0, $9783d437ad61594c$export$3b621d86b1566b2), {}), _el$29, _co$10);
7348
7353
  $8tj43$insert(_el$27, name);
7354
+ $8tj43$effect(() => {
7355
+ var _matching_filter4, _matching_filter4$met;
7356
+ return $8tj43$setAttribute(_el$26, "data-group-title", (_matching_filter4 = matching_filter()) === null || _matching_filter4 === void 0 ? void 0 : (_matching_filter4$met = _matching_filter4.meta) === null || _matching_filter4$met === void 0 ? void 0 : _matching_filter4$met.group_title);
7357
+ });
7349
7358
  $8tj43$runHydrationEvents();
7350
7359
  return _el$26;
7351
7360
  })();
@@ -11915,7 +11924,8 @@ function $45a8953d760b5e58$export$a1fd619a4743ca08(_ref) {
11915
11924
  query_base_: query_base_,
11916
11925
  depict_api_: depict_api_,
11917
11926
  is_loading_: is_loading_,
11918
- content_blocks_: content_blocks_
11927
+ content_blocks_: content_blocks_,
11928
+ setCurrentlyLoadedDisplays_: setCurrentlyLoadedDisplays_
11919
11929
  } = _ref;
11920
11930
  // Although typing doesn't reflect it, plp_results is guaranteed to contain an array of at least one display at this point
11921
11931
  const [get_extra_displays, set_extra_displays_] = $8tj43$createSignal([], {
@@ -11942,6 +11952,7 @@ function $45a8953d760b5e58$export$a1fd619a4743ca08(_ref) {
11942
11952
  is_loading_: is_loading_,
11943
11953
  get_extra_displays: get_extra_displays
11944
11954
  });
11955
+ $8tj43$createComputed(() => setCurrentlyLoadedDisplays_(displays_by_key_().size));
11945
11956
  $6d2962bc9370f884$export$5e4aed86c12acdd9({
11946
11957
  percentage_in_view_: percentage_in_view_,
11947
11958
  set_extra_displays_: set_extra_displays_,
@@ -12002,7 +12013,8 @@ function $7faea0096f14b59b$export$3925f87b1545cfc6(_ref) {
12002
12013
  layout_options_: layout_options_,
12003
12014
  id_currently_querying_for_: id_currently_querying_for_,
12004
12015
  content_blocks_by_row_: content_blocks_by_row_,
12005
- ConfiguredScrollStatus_: ConfiguredScrollStatus_
12016
+ ConfiguredScrollStatus_: ConfiguredScrollStatus_,
12017
+ setCurrentlyLoadedDisplays_: setCurrentlyLoadedDisplays_
12006
12018
  } = _ref;
12007
12019
  // 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
12008
12020
  const is_loading_ = $8tj43$createMemo(() => plp_results_.loading || query_base_.loading);
@@ -12139,7 +12151,8 @@ function $7faea0096f14b59b$export$3925f87b1545cfc6(_ref) {
12139
12151
  query_base_: query_base_,
12140
12152
  depict_api_: depict_api_,
12141
12153
  is_loading_: is_loading_,
12142
- content_blocks_: content_blocks_
12154
+ content_blocks_: content_blocks_,
12155
+ setCurrentlyLoadedDisplays_: setCurrentlyLoadedDisplays_
12143
12156
  });
12144
12157
  $8tj43$onCleanup(() => suspense_contents = undefined);
12145
12158
  return suspense_contents;
@@ -14001,6 +14014,17 @@ function $937791b86d3d1509$export$44f738469d5570cf(_ref) {
14001
14014
  };
14002
14015
  });
14003
14016
  }
14017
+ function $0728458b46ee9d32$export$a86bc18439445599(plp_products_, _ref, currentlyLoadedDisplays) {
14018
+ let [allProductsLoaded] = _ref;
14019
+ return $8tj43$createMemo(() => {
14020
+ var _plp_products_;
14021
+ const backendSays = (_plp_products_ = plp_products_()) === null || _plp_products_ === void 0 ? void 0 : _plp_products_.n_hits;
14022
+ const loadedAll = allProductsLoaded();
14023
+ if (!backendSays || !loadedAll) return backendSays;
14024
+ // People can remove displays in the displayTransformers, for example houdini do it (https://depictaiworkspace.slack.com/archives/C061H2TF7K4/p1713261063439089). Correct the n_hits as well as possible in that case.
14025
+ return currentlyLoadedDisplays();
14026
+ });
14027
+ }
14004
14028
  var $da279c5a540c6846$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<div class=filter-results-for-one-row><!$><!/><!$><!/>`),
14005
14029
  $da279c5a540c6846$var$_tmpl$2 = /*#__PURE__*/$8tj43$template(`<div><div class=listing-page><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/></div><!$><!/><!$><!/>`);
14006
14030
  function $da279c5a540c6846$export$a54ec244c8863715(_ref) {
@@ -14042,6 +14066,7 @@ function $da279c5a540c6846$export$a54ec244c8863715(_ref) {
14042
14066
  } = _ref;
14043
14067
  const [get_sorting] = current_sorting_;
14044
14068
  const all_products_loaded_ = $8tj43$createSignal(false);
14069
+ const [currentlyLoadedDisplays, setCurrentlyLoadedDisplays_] = $8tj43$createSignal(0);
14045
14070
  const [get_all_products_loaded, set_all_products_loaded] = all_products_loaded_;
14046
14071
  const number_of_rendered_selected_filters_items_ = $8tj43$createSignal(0);
14047
14072
  const first_result_in_viewport_ = $8tj43$createSignal();
@@ -14120,24 +14145,21 @@ function $da279c5a540c6846$export$a54ec244c8863715(_ref) {
14120
14145
  const SafeSearchField = $8tj43$catchify((0, $584c06c09cf4609d$export$b94867ecbd698f21));
14121
14146
  const [sort_or_filter_open_, set_sort_or_filter_open_] = $8tj43$createSignal(false);
14122
14147
  const [desktop_filter_elements_, set_desktop_filter_elements] = $8tj43$createSignal();
14123
- const n_hits = $8tj43$createMemo(() => {
14124
- var _search_results_3;
14125
- return (_search_results_3 = search_results_()) === null || _search_results_3 === void 0 ? void 0 : _search_results_3.n_hits;
14126
- });
14148
+ const countOfProductsForUI = $0728458b46ee9d32$export$a86bc18439445599(search_results_, all_products_loaded_, currentlyLoadedDisplays);
14127
14149
  const formatted_number_of_results_ = $43fbdca0f726a34b$export$92f2da32c6e7e7ee({
14128
- number_: n_hits,
14150
+ number_: countOfProductsForUI,
14129
14151
  i18n_: i18n_
14130
14152
  });
14131
14153
  const [sort_and_filter_element_, set_sort_and_filter_element_] = $8tj43$createSignal();
14132
14154
  const no_results_text_ = $8tj43$createMemo(() => {
14133
- var _search_results_4, _search_results_4$con;
14134
- return ((_search_results_4 = search_results_()) !== null && _search_results_4 !== void 0 && (_search_results_4$con = _search_results_4.content_search_links) !== null && _search_results_4$con !== void 0 && _search_results_4$con.length ? i18n_.no_products_ : i18n_.no_results_text_)();
14155
+ var _search_results_3, _search_results_3$con;
14156
+ return ((_search_results_3 = search_results_()) !== null && _search_results_3 !== void 0 && (_search_results_3$con = _search_results_3.content_search_links) !== null && _search_results_3$con !== void 0 && _search_results_3$con.length ? i18n_.no_products_ : i18n_.no_results_text_)();
14135
14157
  });
14136
14158
  const results_for = $8tj43$createComponent((0, $69602b3d8fd54c38$export$9dd50d35b9d94fdf), $8tj43$mergeProps({
14137
14159
  get type() {
14138
14160
  return (0, $69602b3d8fd54c38$export$2452208c79fe93ea).products;
14139
14161
  },
14140
- number_of_results_: n_hits
14162
+ number_of_results_: countOfProductsForUI
14141
14163
  }, {
14142
14164
  get_search_query_: get_search_query_,
14143
14165
  i18n_: i18n_,
@@ -14398,6 +14420,7 @@ function $da279c5a540c6846$export$a54ec244c8863715(_ref) {
14398
14420
  sort_or_filter_open_: sort_or_filter_open_,
14399
14421
  id_currently_querying_for_: get_search_query_,
14400
14422
  content_blocks_by_row_: content_blocks_by_row_,
14423
+ setCurrentlyLoadedDisplays_: setCurrentlyLoadedDisplays_,
14401
14424
  no_results_options_: {
14402
14425
  selected_filters_: selected_filters_,
14403
14426
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
@@ -14440,10 +14463,7 @@ function $da279c5a540c6846$export$a54ec244c8863715(_ref) {
14440
14463
  last_result_in_viewport_: last_result_in_viewport_,
14441
14464
  formatted_number_of_results_: formatted_number_of_results_,
14442
14465
  i18n_: i18n_,
14443
- number_of_results_: $8tj43$createMemo(() => {
14444
- var _search_results_5;
14445
- return (_search_results_5 = search_results_()) === null || _search_results_5 === void 0 ? void 0 : _search_results_5.n_hits;
14446
- })
14466
+ number_of_results_: countOfProductsForUI
14447
14467
  });
14448
14468
  }
14449
14469
  }), _el$23, _co$10);
@@ -16063,6 +16083,8 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
16063
16083
  const number_of_rendered_selected_filters_items_ = $8tj43$createSignal(0);
16064
16084
  const first_result_in_viewport_ = $8tj43$createSignal();
16065
16085
  const last_result_in_viewport_ = $8tj43$createSignal();
16086
+ const all_products_loaded_ = $8tj43$createSignal(false);
16087
+ const [currentlyLoadedDisplays, setCurrentlyLoadedDisplays_] = $8tj43$createSignal(0);
16066
16088
  const [can_write_scroll_restoration_, set_can_write_scroll_restoration] = $8tj43$createSignal(false);
16067
16089
  const products_query_base_ = $ec225bf1f1627ea8$export$210f130a61ac1e8d(() => {
16068
16090
  const sort_obj = get_sorting() && {
@@ -16109,6 +16131,7 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
16109
16131
  // Make "Get Listing" request to get quicklinks, breadcrumbs, title, etc
16110
16132
  const [plp_meta] = $8tj43$createResource(meta_query_base, $8tj43$catchify1(query => depict_api_.get_listing(query)));
16111
16133
  const contentBlocksByRow = $12ff24fdc4b26d88$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_);
16134
+ const countOfProductsForUI = $0728458b46ee9d32$export$a86bc18439445599(plp_products_, all_products_loaded_, currentlyLoadedDisplays);
16112
16135
  const available_sortings_ = $8tj43$createMemo(() => {
16113
16136
  var _plp_products_, _plp_products_$sorts;
16114
16137
  return (_plp_products_ = plp_products_()) === null || _plp_products_ === void 0 ? void 0 : (_plp_products_$sorts = _plp_products_.sorts) === null || _plp_products_$sorts === void 0 ? void 0 : _plp_products_$sorts.map(sort => {
@@ -16135,10 +16158,7 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
16135
16158
  const [sort_or_filter_open_, set_sort_or_filter_open_] = $8tj43$createSignal(false);
16136
16159
  const [desktop_filter_elements_, set_desktop_filter_elements] = $8tj43$createSignal();
16137
16160
  const formatted_number_of_results_ = $43fbdca0f726a34b$export$92f2da32c6e7e7ee({
16138
- number_: $8tj43$createMemo(() => {
16139
- var _plp_products_3;
16140
- return (_plp_products_3 = plp_products_()) === null || _plp_products_3 === void 0 ? void 0 : _plp_products_3.n_hits;
16141
- }),
16161
+ number_: countOfProductsForUI,
16142
16162
  i18n_: i18n_
16143
16163
  });
16144
16164
  const [sort_and_filter_element_, set_sort_and_filter_element_] = $8tj43$createSignal();
@@ -16161,10 +16181,7 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
16161
16181
  last_result_in_viewport_: last_result_in_viewport_,
16162
16182
  formatted_number_of_results_: formatted_number_of_results_,
16163
16183
  i18n_: i18n_,
16164
- number_of_results_: $8tj43$createMemo(() => {
16165
- var _plp_products_4;
16166
- return (_plp_products_4 = plp_products_()) === null || _plp_products_4 === void 0 ? void 0 : _plp_products_4.n_hits;
16167
- }),
16184
+ number_of_results_: countOfProductsForUI,
16168
16185
  ...extraProps
16169
16186
  });
16170
16187
  }
@@ -16191,8 +16208,7 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
16191
16208
  }), _el$4, _co$);
16192
16209
  $8tj43$insert(_el$, $8tj43$createComponent((0, $8tj43$Show), {
16193
16210
  get when() {
16194
- var _plp_products_5;
16195
- return ((_plp_products_5 = plp_products_()) === null || _plp_products_5 === void 0 ? void 0 : _plp_products_5.n_hits) === 1;
16211
+ return countOfProductsForUI() === 1;
16196
16212
  },
16197
16213
  get fallback() {
16198
16214
  return i18n_.products_();
@@ -16400,6 +16416,8 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
16400
16416
  content_blocks_by_row_: contentBlocksByRow,
16401
16417
  ConfiguredScrollStatus_: ConfiguredScrollStatus_,
16402
16418
  id_currently_querying_for_: id_to_query_for_,
16419
+ setCurrentlyLoadedDisplays_: setCurrentlyLoadedDisplays_,
16420
+ all_products_loaded_: all_products_loaded_,
16403
16421
  no_results_options_: {
16404
16422
  selected_filters_: selected_filters_,
16405
16423
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,