@depict-ai/ui 4.9.7 → 4.9.9

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
@@ -115,7 +115,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $335c02c1241a9ca8$export$5b7
115
115
  $parcel$export(module.exports, "QuickLinks", () => $335c02c1241a9ca8$export$de035477d6fef996);
116
116
  $parcel$export(module.exports, "CategoryPage", () => $c10e33c4681f8c9b$export$e2bf8ce7779e827e);
117
117
  /*! Depict.ai search and product listing SDK */
118
- const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.9.7";
118
+ const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.9.9";
119
119
  function $3e17e871e9d0911d$export$d9f36cf74e24d595(media_query) {
120
120
  const signal = $52FdA$solidjs.createSignal(false);
121
121
  $52FdA$solidjs.onCleanup($52FdA$depictaiutilishared.javascript_media_query(media_query, _ref => {
@@ -5215,11 +5215,29 @@ function $164d474fea221d77$export$3f1a388cc0d8fed7(props) {
5215
5215
  }
5216
5216
  function $164d474fea221d77$var$ActualFilterBody(props) {
5217
5217
  const [modified_available_filters_with_selected_unexisting_ones_injected_from_local_state] = props.local_filter_cache_;
5218
- const togglable_filters = $52FdA$solidjs.createMemo(() => modified_available_filters_with_selected_unexisting_ones_injected_from_local_state().filter(item => {
5218
+ const withMaybeCount0Removed = $52FdA$solidjs.createMemo(() => {
5219
+ const filters = modified_available_filters_with_selected_unexisting_ones_injected_from_local_state();
5220
+ if (!props.hideCount0FilterOptions_()) return filters;
5221
+ return filters.map(filter => {
5222
+ const oldMeta = filter.meta;
5223
+ if (!oldMeta) return filter;
5224
+ const modifiedMeta = {
5225
+ ...oldMeta
5226
+ };
5227
+ if ("counts" in modifiedMeta)
5228
+ // Remove all count 0 filter options, important that counts is last option
5229
+ for (const key of ["names", "values", "swatches", "counts"]) modifiedMeta[key] && (modifiedMeta[key] = modifiedMeta[key].filter((_, index) => modifiedMeta.counts[index] !== 0));
5230
+ return {
5231
+ ...filter,
5232
+ meta: modifiedMeta
5233
+ };
5234
+ });
5235
+ });
5236
+ const togglable_filters = $52FdA$solidjs.createMemo(() => withMaybeCount0Removed().filter(item => {
5219
5237
  var _item$meta;
5220
5238
  return item === null || item === void 0 ? void 0 : (_item$meta = item.meta) === null || _item$meta === void 0 ? void 0 : _item$meta.group_title;
5221
5239
  }));
5222
- const untogglable_filters = $52FdA$solidjs.createMemo(() => modified_available_filters_with_selected_unexisting_ones_injected_from_local_state().filter(item => {
5240
+ const untogglable_filters = $52FdA$solidjs.createMemo(() => withMaybeCount0Removed().filter(item => {
5223
5241
  var _item$meta2;
5224
5242
  return !(item !== null && item !== void 0 && (_item$meta2 = item.meta) !== null && _item$meta2 !== void 0 && _item$meta2.group_title);
5225
5243
  }));
@@ -5244,9 +5262,7 @@ function $164d474fea221d77$var$ActualFilterBody(props) {
5244
5262
  },
5245
5263
  get children() {
5246
5264
  return (() => {
5247
- const filter_array_ = $52FdA$solidjs.createMemo(() => {
5248
- return Object.values(togglable_filters_grouped_by_collapsible())[get_section_index()];
5249
- });
5265
+ const filter_array_ = $52FdA$solidjs.createMemo(() => Object.values(togglable_filters_grouped_by_collapsible())[get_section_index()]);
5250
5266
  const {
5251
5267
  SearchThisFilterGroup_: SearchThisFilterGroup_,
5252
5268
  searched_filter_array_: searched_filter_array_,
@@ -6275,7 +6291,8 @@ function $f70cc6dfcadf0fd5$export$d7841e452f2e59a8(_ref) {
6275
6291
  local_filter_cache_: local_filter_cache_,
6276
6292
  get_extra_filters_button_: get_extra_filters_button_,
6277
6293
  get_extra_sorting_button_: get_extra_sorting_button_,
6278
- filterModalParent_: filterModalParent_
6294
+ filterModalParent_: filterModalParent_,
6295
+ hideCount0FilterOptions_: hideCount0FilterOptions_
6279
6296
  } = _ref;
6280
6297
  const Self = () => {
6281
6298
  // This could technically be in SearchPage and CategoryPage and would be better suited there since it writes into local_filter_cache_ which i.e. SelectedFilters uses, but it's better suited here IMO due to DRY and being inside the correct error boundary here
@@ -6310,7 +6327,8 @@ function $f70cc6dfcadf0fd5$export$d7841e452f2e59a8(_ref) {
6310
6327
  available_filters_: available_filters_,
6311
6328
  expanded_filters_: expanded_filters_,
6312
6329
  selected_filters_: selected_filters_,
6313
- i18n_: i18n_
6330
+ i18n_: i18n_,
6331
+ hideCount0FilterOptions_: hideCount0FilterOptions_
6314
6332
  };
6315
6333
  const hide_filters = $52FdA$solidjs.createMemo(() => $8b9c2fa4593b29df$export$50f68cc9882e36a4(filter_options));
6316
6334
  const sorting_options = {
@@ -8252,7 +8270,8 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
8252
8270
  filter_query_param_prefix_: filter_query_param_prefix_,
8253
8271
  content_blocks_by_row_: content_blocks_by_row_,
8254
8272
  filterModalParent_: filterModalParent_,
8255
- showSliderArrow_: showSliderArrow_
8273
+ showSliderArrow_: showSliderArrow_,
8274
+ hideCount0FilterOptions_: hideCount0FilterOptions_
8256
8275
  } = _ref;
8257
8276
  let results_for;
8258
8277
  let only_show_filters_opener_;
@@ -8484,6 +8503,7 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
8484
8503
  number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
8485
8504
  sort_and_filter_disabled_: sort_and_filter_disabled_,
8486
8505
  filterModalParent_: filterModalParent_,
8506
+ hideCount0FilterOptions_: hideCount0FilterOptions_,
8487
8507
  ...extra_sort_and_filter_args_
8488
8508
  });
8489
8509
  $52FdA$depictaiutilisharedlatest.catchify((0, $fef4890f1f8e0544$export$6e49da55e449af7c))({
@@ -8684,9 +8704,9 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
8684
8704
  function $ede6c70ecdca46fe$var$add_us_to_crumbs(plp_meta) {
8685
8705
  const href_accessor = $52FdA$depictaiutilisharedlatest.use_href_accessor();
8686
8706
  return $52FdA$solidjs.createMemo(() => {
8687
- var _plp_meta3;
8707
+ var _plp_meta3, _plp_meta4;
8688
8708
  const api_value = (_plp_meta3 = plp_meta()) === null || _plp_meta3 === void 0 ? void 0 : _plp_meta3.breadcrumbs;
8689
- if (!api_value) return api_value;
8709
+ if (!api_value || ((_plp_meta4 = plp_meta()) === null || _plp_meta4 === void 0 ? void 0 : _plp_meta4.show_in_breadcrumbs) === false) return api_value;
8690
8710
  return [...api_value, $52FdA$solidjs.mergeProps(plp_meta(), {
8691
8711
  get page_url() {
8692
8712
  return href_accessor();
@@ -15406,7 +15426,8 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
15406
15426
  BackIcon_: BackIcon_,
15407
15427
  filterModalParent_: filterModalParent_,
15408
15428
  class_: class_,
15409
- showSliderArrow_: showSliderArrow_
15429
+ showSliderArrow_: showSliderArrow_,
15430
+ hideCount0FilterOptions_: hideCount0FilterOptions_
15410
15431
  } = _ref;
15411
15432
  const [get_sorting] = current_sorting_;
15412
15433
  const all_products_loaded_ = $52FdA$solidjs.createSignal(false);
@@ -15526,7 +15547,8 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
15526
15547
  local_filter_cache_: local_filter_cache_,
15527
15548
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
15528
15549
  number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
15529
- filterModalParent_: filterModalParent_
15550
+ filterModalParent_: filterModalParent_,
15551
+ hideCount0FilterOptions_: hideCount0FilterOptions_
15530
15552
  });
15531
15553
  const results_filters = $52FdA$solidjs.createSignal();
15532
15554
  const shouldActuallyShowInputField = $52FdA$solidjs.createMemo(() => {
@@ -16304,7 +16326,11 @@ function $ddd39c5f36f49703$export$f2dc7e4e4aa11abb(props) {
16304
16326
  })),
16305
16327
  filterModalParent_: $52FdA$solidjs.untrack(() => props.filterModalParent_),
16306
16328
  product_card_template_: product_card_template,
16307
- class_: () => props.class
16329
+ class_: () => props.class,
16330
+ hideCount0FilterOptions_: () => {
16331
+ var _props$hideCount0Filt;
16332
+ return (_props$hideCount0Filt = props.hideCount0FilterOptions_) !== null && _props$hideCount0Filt !== void 0 ? _props$hideCount0Filt : false;
16333
+ }
16308
16334
  });
16309
16335
  }, "Entire SearchPage failed");
16310
16336
  }
@@ -16971,6 +16997,10 @@ function $c10e33c4681f8c9b$export$e2bf8ce7779e827e(props) {
16971
16997
  sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
16972
16998
  content_blocks_by_row_: () => props.content_blocks_by_row,
16973
16999
  showSliderArrow_: () => props.showSliderArrow_,
17000
+ hideCount0FilterOptions_: () => {
17001
+ var _props$hideCount0Filt;
17002
+ return (_props$hideCount0Filt = props.hideCount0FilterOptions_) !== null && _props$hideCount0Filt !== void 0 ? _props$hideCount0Filt : false;
17003
+ },
16974
17004
  scroll_restoration_data_: scroll_restoration_data_,
16975
17005
  history_content_blocks_: history_content_blocks_,
16976
17006
  layout_options_: $52FdA$solidjs.createMemo(() => ({
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.9.7";
14
+ export const version = "4.9.9";
15
15
  /**
16
16
  * Use `javascript_media_query` but return a reactive accessor instead of taking a callback function
17
17
  */
@@ -1046,6 +1046,7 @@ interface FilterBodyProps {
1046
1046
  expanded_: boolean;
1047
1047
  }[]>;
1048
1048
  are_in_modal_?: boolean;
1049
+ hideCount0FilterOptions_: Accessor<boolean>;
1049
1050
  }
1050
1051
  export function FilterBody(props: FilterBodyProps): JSX.Element;
1051
1052
  /**
@@ -1500,6 +1501,7 @@ export function SearchPage<OriginalDisplay extends Display, TransformedDisplay e
1500
1501
  filterModalParent_?: HTMLElement | ShadowRoot;
1501
1502
  class?: string;
1502
1503
  showSliderArrow_?: boolean;
1504
+ hideCount0FilterOptions_?: boolean;
1503
1505
  }): import("@depict-ai/utilishared").Node_Array;
1504
1506
  /**
1505
1507
  * Connects the height of the search field to the height of the aligner.
@@ -1619,5 +1621,6 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
1619
1621
  layout?: PossibleLayout;
1620
1622
  filterModalParent_?: HTMLElement | ShadowRoot;
1621
1623
  showSliderArrow_?: boolean;
1624
+ hideCount0FilterOptions_?: boolean;
1622
1625
  }): import("@depict-ai/utilishared").Node_Array;
1623
1626
  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.9.7";
13
+ const $8db9a15135765c11$export$83d89fbfd8236492 = "4.9.9";
14
14
  function $00a5b94f0c11efbb$export$d9f36cf74e24d595(media_query) {
15
15
  const signal = $8tj43$createSignal(false);
16
16
  $8tj43$onCleanup($8tj43$javascript_media_query(media_query, _ref => {
@@ -5110,11 +5110,29 @@ function $f6b0500577e1b210$export$3f1a388cc0d8fed7(props) {
5110
5110
  }
5111
5111
  function $f6b0500577e1b210$var$ActualFilterBody(props) {
5112
5112
  const [modified_available_filters_with_selected_unexisting_ones_injected_from_local_state] = props.local_filter_cache_;
5113
- const togglable_filters = $8tj43$createMemo(() => modified_available_filters_with_selected_unexisting_ones_injected_from_local_state().filter(item => {
5113
+ const withMaybeCount0Removed = $8tj43$createMemo(() => {
5114
+ const filters = modified_available_filters_with_selected_unexisting_ones_injected_from_local_state();
5115
+ if (!props.hideCount0FilterOptions_()) return filters;
5116
+ return filters.map(filter => {
5117
+ const oldMeta = filter.meta;
5118
+ if (!oldMeta) return filter;
5119
+ const modifiedMeta = {
5120
+ ...oldMeta
5121
+ };
5122
+ if ("counts" in modifiedMeta)
5123
+ // Remove all count 0 filter options, important that counts is last option
5124
+ for (const key of ["names", "values", "swatches", "counts"]) modifiedMeta[key] && (modifiedMeta[key] = modifiedMeta[key].filter((_, index) => modifiedMeta.counts[index] !== 0));
5125
+ return {
5126
+ ...filter,
5127
+ meta: modifiedMeta
5128
+ };
5129
+ });
5130
+ });
5131
+ const togglable_filters = $8tj43$createMemo(() => withMaybeCount0Removed().filter(item => {
5114
5132
  var _item$meta;
5115
5133
  return item === null || item === void 0 ? void 0 : (_item$meta = item.meta) === null || _item$meta === void 0 ? void 0 : _item$meta.group_title;
5116
5134
  }));
5117
- const untogglable_filters = $8tj43$createMemo(() => modified_available_filters_with_selected_unexisting_ones_injected_from_local_state().filter(item => {
5135
+ const untogglable_filters = $8tj43$createMemo(() => withMaybeCount0Removed().filter(item => {
5118
5136
  var _item$meta2;
5119
5137
  return !(item !== null && item !== void 0 && (_item$meta2 = item.meta) !== null && _item$meta2 !== void 0 && _item$meta2.group_title);
5120
5138
  }));
@@ -5139,9 +5157,7 @@ function $f6b0500577e1b210$var$ActualFilterBody(props) {
5139
5157
  },
5140
5158
  get children() {
5141
5159
  return (() => {
5142
- const filter_array_ = $8tj43$createMemo(() => {
5143
- return Object.values(togglable_filters_grouped_by_collapsible())[get_section_index()];
5144
- });
5160
+ const filter_array_ = $8tj43$createMemo(() => Object.values(togglable_filters_grouped_by_collapsible())[get_section_index()]);
5145
5161
  const {
5146
5162
  SearchThisFilterGroup_: SearchThisFilterGroup_,
5147
5163
  searched_filter_array_: searched_filter_array_,
@@ -6170,7 +6186,8 @@ function $7396052a1484264f$export$d7841e452f2e59a8(_ref) {
6170
6186
  local_filter_cache_: local_filter_cache_,
6171
6187
  get_extra_filters_button_: get_extra_filters_button_,
6172
6188
  get_extra_sorting_button_: get_extra_sorting_button_,
6173
- filterModalParent_: filterModalParent_
6189
+ filterModalParent_: filterModalParent_,
6190
+ hideCount0FilterOptions_: hideCount0FilterOptions_
6174
6191
  } = _ref;
6175
6192
  const Self = () => {
6176
6193
  // This could technically be in SearchPage and CategoryPage and would be better suited there since it writes into local_filter_cache_ which i.e. SelectedFilters uses, but it's better suited here IMO due to DRY and being inside the correct error boundary here
@@ -6205,7 +6222,8 @@ function $7396052a1484264f$export$d7841e452f2e59a8(_ref) {
6205
6222
  available_filters_: available_filters_,
6206
6223
  expanded_filters_: expanded_filters_,
6207
6224
  selected_filters_: selected_filters_,
6208
- i18n_: i18n_
6225
+ i18n_: i18n_,
6226
+ hideCount0FilterOptions_: hideCount0FilterOptions_
6209
6227
  };
6210
6228
  const hide_filters = $8tj43$createMemo(() => $6fcb97029a69ec44$export$50f68cc9882e36a4(filter_options));
6211
6229
  const sorting_options = {
@@ -8147,7 +8165,8 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
8147
8165
  filter_query_param_prefix_: filter_query_param_prefix_,
8148
8166
  content_blocks_by_row_: content_blocks_by_row_,
8149
8167
  filterModalParent_: filterModalParent_,
8150
- showSliderArrow_: showSliderArrow_
8168
+ showSliderArrow_: showSliderArrow_,
8169
+ hideCount0FilterOptions_: hideCount0FilterOptions_
8151
8170
  } = _ref;
8152
8171
  let results_for;
8153
8172
  let only_show_filters_opener_;
@@ -8379,6 +8398,7 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
8379
8398
  number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
8380
8399
  sort_and_filter_disabled_: sort_and_filter_disabled_,
8381
8400
  filterModalParent_: filterModalParent_,
8401
+ hideCount0FilterOptions_: hideCount0FilterOptions_,
8382
8402
  ...extra_sort_and_filter_args_
8383
8403
  });
8384
8404
  $8tj43$catchify((0, $5e6abec0dab4e610$export$6e49da55e449af7c))({
@@ -8579,9 +8599,9 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
8579
8599
  function $4b4b262708b516ee$var$add_us_to_crumbs(plp_meta) {
8580
8600
  const href_accessor = $8tj43$use_href_accessor();
8581
8601
  return $8tj43$createMemo(() => {
8582
- var _plp_meta3;
8602
+ var _plp_meta3, _plp_meta4;
8583
8603
  const api_value = (_plp_meta3 = plp_meta()) === null || _plp_meta3 === void 0 ? void 0 : _plp_meta3.breadcrumbs;
8584
- if (!api_value) return api_value;
8604
+ if (!api_value || ((_plp_meta4 = plp_meta()) === null || _plp_meta4 === void 0 ? void 0 : _plp_meta4.show_in_breadcrumbs) === false) return api_value;
8585
8605
  return [...api_value, $8tj43$mergeProps(plp_meta(), {
8586
8606
  get page_url() {
8587
8607
  return href_accessor();
@@ -15301,7 +15321,8 @@ function $da279c5a540c6846$export$a54ec244c8863715(_ref) {
15301
15321
  BackIcon_: BackIcon_,
15302
15322
  filterModalParent_: filterModalParent_,
15303
15323
  class_: class_,
15304
- showSliderArrow_: showSliderArrow_
15324
+ showSliderArrow_: showSliderArrow_,
15325
+ hideCount0FilterOptions_: hideCount0FilterOptions_
15305
15326
  } = _ref;
15306
15327
  const [get_sorting] = current_sorting_;
15307
15328
  const all_products_loaded_ = $8tj43$createSignal(false);
@@ -15421,7 +15442,8 @@ function $da279c5a540c6846$export$a54ec244c8863715(_ref) {
15421
15442
  local_filter_cache_: local_filter_cache_,
15422
15443
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
15423
15444
  number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
15424
- filterModalParent_: filterModalParent_
15445
+ filterModalParent_: filterModalParent_,
15446
+ hideCount0FilterOptions_: hideCount0FilterOptions_
15425
15447
  });
15426
15448
  const results_filters = $8tj43$createSignal();
15427
15449
  const shouldActuallyShowInputField = $8tj43$createMemo(() => {
@@ -16199,7 +16221,11 @@ function $eb064bc3350276c1$export$f2dc7e4e4aa11abb(props) {
16199
16221
  })),
16200
16222
  filterModalParent_: $8tj43$untrack(() => props.filterModalParent_),
16201
16223
  product_card_template_: product_card_template,
16202
- class_: () => props.class
16224
+ class_: () => props.class,
16225
+ hideCount0FilterOptions_: () => {
16226
+ var _props$hideCount0Filt;
16227
+ return (_props$hideCount0Filt = props.hideCount0FilterOptions_) !== null && _props$hideCount0Filt !== void 0 ? _props$hideCount0Filt : false;
16228
+ }
16203
16229
  });
16204
16230
  }, "Entire SearchPage failed");
16205
16231
  }
@@ -16866,6 +16892,10 @@ function $8821a19349c36651$export$e2bf8ce7779e827e(props) {
16866
16892
  sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
16867
16893
  content_blocks_by_row_: () => props.content_blocks_by_row,
16868
16894
  showSliderArrow_: () => props.showSliderArrow_,
16895
+ hideCount0FilterOptions_: () => {
16896
+ var _props$hideCount0Filt;
16897
+ return (_props$hideCount0Filt = props.hideCount0FilterOptions_) !== null && _props$hideCount0Filt !== void 0 ? _props$hideCount0Filt : false;
16898
+ },
16869
16899
  scroll_restoration_data_: scroll_restoration_data_,
16870
16900
  history_content_blocks_: history_content_blocks_,
16871
16901
  layout_options_: $8tj43$createMemo(() => ({
package/latest/index.cjs CHANGED
@@ -109,7 +109,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $1f4925833f07df29$export$5b7
109
109
  $parcel$export(module.exports, "QuickLinks", () => $1f4925833f07df29$export$de035477d6fef996);
110
110
  $parcel$export(module.exports, "CategoryPage", () => $14f289047713d67a$export$e2bf8ce7779e827e);
111
111
  /*! Depict.ai search and product listing SDK */
112
- const $b757f75811f3261f$export$83d89fbfd8236492 = "4.9.7";
112
+ const $b757f75811f3261f$export$83d89fbfd8236492 = "4.9.9";
113
113
  function $b54e6192d0caa293$export$d9f36cf74e24d595(media_query) {
114
114
  const signal = $gVhhF$solidjs.createSignal(false);
115
115
  $gVhhF$solidjs.onCleanup($gVhhF$depictaiutilishared.javascript_media_query(media_query, ({
@@ -4946,8 +4946,26 @@ function $aff9a96d30ed3563$export$3f1a388cc0d8fed7(props) {
4946
4946
  }
4947
4947
  function $aff9a96d30ed3563$var$ActualFilterBody(props) {
4948
4948
  const [modified_available_filters_with_selected_unexisting_ones_injected_from_local_state] = props.local_filter_cache_;
4949
- const togglable_filters = $gVhhF$solidjs.createMemo(() => modified_available_filters_with_selected_unexisting_ones_injected_from_local_state().filter(item => item?.meta?.group_title));
4950
- const untogglable_filters = $gVhhF$solidjs.createMemo(() => modified_available_filters_with_selected_unexisting_ones_injected_from_local_state().filter(item => !item?.meta?.group_title));
4949
+ const withMaybeCount0Removed = $gVhhF$solidjs.createMemo(() => {
4950
+ const filters = modified_available_filters_with_selected_unexisting_ones_injected_from_local_state();
4951
+ if (!props.hideCount0FilterOptions_()) return filters;
4952
+ return filters.map(filter => {
4953
+ const oldMeta = filter.meta;
4954
+ if (!oldMeta) return filter;
4955
+ const modifiedMeta = {
4956
+ ...oldMeta
4957
+ };
4958
+ if ("counts" in modifiedMeta)
4959
+ // Remove all count 0 filter options, important that counts is last option
4960
+ for (const key of ["names", "values", "swatches", "counts"]) modifiedMeta[key] &&= modifiedMeta[key].filter((_, index) => modifiedMeta.counts[index] !== 0);
4961
+ return {
4962
+ ...filter,
4963
+ meta: modifiedMeta
4964
+ };
4965
+ });
4966
+ });
4967
+ const togglable_filters = $gVhhF$solidjs.createMemo(() => withMaybeCount0Removed().filter(item => item?.meta?.group_title));
4968
+ const untogglable_filters = $gVhhF$solidjs.createMemo(() => withMaybeCount0Removed().filter(item => !item?.meta?.group_title));
4951
4969
  const togglable_filters_grouped_by_collapsible = $gVhhF$solidjs.createMemo(() => {
4952
4970
  const output = {};
4953
4971
  for (const filter of togglable_filters()) {
@@ -4968,9 +4986,7 @@ function $aff9a96d30ed3563$var$ActualFilterBody(props) {
4968
4986
  },
4969
4987
  get children() {
4970
4988
  return (() => {
4971
- const filter_array_ = $gVhhF$solidjs.createMemo(() => {
4972
- return Object.values(togglable_filters_grouped_by_collapsible())[get_section_index()];
4973
- });
4989
+ const filter_array_ = $gVhhF$solidjs.createMemo(() => Object.values(togglable_filters_grouped_by_collapsible())[get_section_index()]);
4974
4990
  const {
4975
4991
  SearchThisFilterGroup_: SearchThisFilterGroup_,
4976
4992
  searched_filter_array_: searched_filter_array_,
@@ -5929,7 +5945,8 @@ function $f8f64d05c525825b$export$d7841e452f2e59a8({
5929
5945
  local_filter_cache_: local_filter_cache_,
5930
5946
  get_extra_filters_button_: get_extra_filters_button_,
5931
5947
  get_extra_sorting_button_: get_extra_sorting_button_,
5932
- filterModalParent_: filterModalParent_
5948
+ filterModalParent_: filterModalParent_,
5949
+ hideCount0FilterOptions_: hideCount0FilterOptions_
5933
5950
  }) {
5934
5951
  const Self = () => {
5935
5952
  // This could technically be in SearchPage and CategoryPage and would be better suited there since it writes into local_filter_cache_ which i.e. SelectedFilters uses, but it's better suited here IMO due to DRY and being inside the correct error boundary here
@@ -5960,7 +5977,8 @@ function $f8f64d05c525825b$export$d7841e452f2e59a8({
5960
5977
  available_filters_: available_filters_,
5961
5978
  expanded_filters_: expanded_filters_,
5962
5979
  selected_filters_: selected_filters_,
5963
- i18n_: i18n_
5980
+ i18n_: i18n_,
5981
+ hideCount0FilterOptions_: hideCount0FilterOptions_
5964
5982
  };
5965
5983
  const hide_filters = $gVhhF$solidjs.createMemo(() => $7e91f9b0c6d56424$export$50f68cc9882e36a4(filter_options));
5966
5984
  const sorting_options = {
@@ -7810,7 +7828,8 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({
7810
7828
  filter_query_param_prefix_: filter_query_param_prefix_,
7811
7829
  content_blocks_by_row_: content_blocks_by_row_,
7812
7830
  filterModalParent_: filterModalParent_,
7813
- showSliderArrow_: showSliderArrow_
7831
+ showSliderArrow_: showSliderArrow_,
7832
+ hideCount0FilterOptions_: hideCount0FilterOptions_
7814
7833
  }) {
7815
7834
  let results_for;
7816
7835
  let only_show_filters_opener_;
@@ -8024,6 +8043,7 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({
8024
8043
  number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
8025
8044
  sort_and_filter_disabled_: sort_and_filter_disabled_,
8026
8045
  filterModalParent_: filterModalParent_,
8046
+ hideCount0FilterOptions_: hideCount0FilterOptions_,
8027
8047
  ...extra_sort_and_filter_args_
8028
8048
  });
8029
8049
  $gVhhF$depictaiutilisharedlatest.catchify((0, $276380e4607fb9fb$export$6e49da55e449af7c))({
@@ -8221,7 +8241,7 @@ function $840d88a04b2d22a7$var$add_us_to_crumbs(plp_meta) {
8221
8241
  const href_accessor = $gVhhF$depictaiutilisharedlatest.use_href_accessor();
8222
8242
  return $gVhhF$solidjs.createMemo(() => {
8223
8243
  const api_value = plp_meta()?.breadcrumbs;
8224
- if (!api_value) return api_value;
8244
+ if (!api_value || plp_meta()?.show_in_breadcrumbs === false) return api_value;
8225
8245
  return [...api_value, $gVhhF$solidjs.mergeProps(plp_meta(), {
8226
8246
  get page_url() {
8227
8247
  return href_accessor();
@@ -14530,7 +14550,8 @@ function $f1d7cb69f839a526$export$a54ec244c8863715({
14530
14550
  BackIcon_: BackIcon_,
14531
14551
  filterModalParent_: filterModalParent_,
14532
14552
  class_: class_,
14533
- showSliderArrow_: showSliderArrow_
14553
+ showSliderArrow_: showSliderArrow_,
14554
+ hideCount0FilterOptions_: hideCount0FilterOptions_
14534
14555
  }) {
14535
14556
  const [get_sorting] = current_sorting_;
14536
14557
  const all_products_loaded_ = $gVhhF$solidjs.createSignal(false);
@@ -14638,7 +14659,8 @@ function $f1d7cb69f839a526$export$a54ec244c8863715({
14638
14659
  local_filter_cache_: local_filter_cache_,
14639
14660
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
14640
14661
  number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
14641
- filterModalParent_: filterModalParent_
14662
+ filterModalParent_: filterModalParent_,
14663
+ hideCount0FilterOptions_: hideCount0FilterOptions_
14642
14664
  });
14643
14665
  const results_filters = $gVhhF$solidjs.createSignal();
14644
14666
  const shouldActuallyShowInputField = $gVhhF$solidjs.createMemo(() => include_input_field_?.() ?? true); // default to showing input field
@@ -15322,7 +15344,8 @@ function $2c61e4cd8229c49a$export$f2dc7e4e4aa11abb(props) {
15322
15344
  })),
15323
15345
  filterModalParent_: $gVhhF$solidjs.untrack(() => props.filterModalParent_),
15324
15346
  product_card_template_: product_card_template,
15325
- class_: () => props.class
15347
+ class_: () => props.class,
15348
+ hideCount0FilterOptions_: () => props.hideCount0FilterOptions_ ?? false
15326
15349
  });
15327
15350
  }, "Entire SearchPage failed");
15328
15351
  }
@@ -15885,6 +15908,7 @@ function $14f289047713d67a$export$e2bf8ce7779e827e(props) {
15885
15908
  sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
15886
15909
  content_blocks_by_row_: () => props.content_blocks_by_row,
15887
15910
  showSliderArrow_: () => props.showSliderArrow_,
15911
+ hideCount0FilterOptions_: () => props.hideCount0FilterOptions_ ?? false,
15888
15912
  scroll_restoration_data_: scroll_restoration_data_,
15889
15913
  history_content_blocks_: history_content_blocks_,
15890
15914
  layout_options_: $gVhhF$solidjs.createMemo(() => ({
package/latest/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.9.7";
14
+ export const version = "4.9.9";
15
15
  /**
16
16
  * Use `javascript_media_query` but return a reactive accessor instead of taking a callback function
17
17
  */
@@ -1046,6 +1046,7 @@ interface FilterBodyProps {
1046
1046
  expanded_: boolean;
1047
1047
  }[]>;
1048
1048
  are_in_modal_?: boolean;
1049
+ hideCount0FilterOptions_: Accessor<boolean>;
1049
1050
  }
1050
1051
  export function FilterBody(props: FilterBodyProps): JSX.Element;
1051
1052
  /**
@@ -1500,6 +1501,7 @@ export function SearchPage<OriginalDisplay extends Display, TransformedDisplay e
1500
1501
  filterModalParent_?: HTMLElement | ShadowRoot;
1501
1502
  class?: string;
1502
1503
  showSliderArrow_?: boolean;
1504
+ hideCount0FilterOptions_?: boolean;
1503
1505
  }): import("@depict-ai/utilishared").Node_Array;
1504
1506
  /**
1505
1507
  * Connects the height of the search field to the height of the aligner.
@@ -1619,5 +1621,6 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
1619
1621
  layout?: PossibleLayout;
1620
1622
  filterModalParent_?: HTMLElement | ShadowRoot;
1621
1623
  showSliderArrow_?: boolean;
1624
+ hideCount0FilterOptions_?: boolean;
1622
1625
  }): import("@depict-ai/utilishared").Node_Array;
1623
1626
  export type { SearchFilter } from "@depict-ai/types/api/SearchRequestV3";
package/latest/index.js CHANGED
@@ -7,7 +7,7 @@ import { createStore as $9HbP8$createStore, reconcile as $9HbP8$reconcile } from
7
7
  /*! Depict.ai search and product listing SDK */
8
8
  import { register_es_version } from "../multi_import_deduplicator.mjs";
9
9
  register_es_version("ui", "latest");
10
- const $ec291e0010116877$export$83d89fbfd8236492 = "4.9.7";
10
+ const $ec291e0010116877$export$83d89fbfd8236492 = "4.9.9";
11
11
  function $dc9262ef6f786812$export$d9f36cf74e24d595(media_query) {
12
12
  const signal = $9HbP8$createSignal(false);
13
13
  $9HbP8$onCleanup($9HbP8$javascript_media_query(media_query, ({
@@ -4844,8 +4844,26 @@ function $fab07f52c9861732$export$3f1a388cc0d8fed7(props) {
4844
4844
  }
4845
4845
  function $fab07f52c9861732$var$ActualFilterBody(props) {
4846
4846
  const [modified_available_filters_with_selected_unexisting_ones_injected_from_local_state] = props.local_filter_cache_;
4847
- const togglable_filters = $9HbP8$createMemo(() => modified_available_filters_with_selected_unexisting_ones_injected_from_local_state().filter(item => item?.meta?.group_title));
4848
- const untogglable_filters = $9HbP8$createMemo(() => modified_available_filters_with_selected_unexisting_ones_injected_from_local_state().filter(item => !item?.meta?.group_title));
4847
+ const withMaybeCount0Removed = $9HbP8$createMemo(() => {
4848
+ const filters = modified_available_filters_with_selected_unexisting_ones_injected_from_local_state();
4849
+ if (!props.hideCount0FilterOptions_()) return filters;
4850
+ return filters.map(filter => {
4851
+ const oldMeta = filter.meta;
4852
+ if (!oldMeta) return filter;
4853
+ const modifiedMeta = {
4854
+ ...oldMeta
4855
+ };
4856
+ if ("counts" in modifiedMeta)
4857
+ // Remove all count 0 filter options, important that counts is last option
4858
+ for (const key of ["names", "values", "swatches", "counts"]) modifiedMeta[key] &&= modifiedMeta[key].filter((_, index) => modifiedMeta.counts[index] !== 0);
4859
+ return {
4860
+ ...filter,
4861
+ meta: modifiedMeta
4862
+ };
4863
+ });
4864
+ });
4865
+ const togglable_filters = $9HbP8$createMemo(() => withMaybeCount0Removed().filter(item => item?.meta?.group_title));
4866
+ const untogglable_filters = $9HbP8$createMemo(() => withMaybeCount0Removed().filter(item => !item?.meta?.group_title));
4849
4867
  const togglable_filters_grouped_by_collapsible = $9HbP8$createMemo(() => {
4850
4868
  const output = {};
4851
4869
  for (const filter of togglable_filters()) {
@@ -4866,9 +4884,7 @@ function $fab07f52c9861732$var$ActualFilterBody(props) {
4866
4884
  },
4867
4885
  get children() {
4868
4886
  return (() => {
4869
- const filter_array_ = $9HbP8$createMemo(() => {
4870
- return Object.values(togglable_filters_grouped_by_collapsible())[get_section_index()];
4871
- });
4887
+ const filter_array_ = $9HbP8$createMemo(() => Object.values(togglable_filters_grouped_by_collapsible())[get_section_index()]);
4872
4888
  const {
4873
4889
  SearchThisFilterGroup_: SearchThisFilterGroup_,
4874
4890
  searched_filter_array_: searched_filter_array_,
@@ -5827,7 +5843,8 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({
5827
5843
  local_filter_cache_: local_filter_cache_,
5828
5844
  get_extra_filters_button_: get_extra_filters_button_,
5829
5845
  get_extra_sorting_button_: get_extra_sorting_button_,
5830
- filterModalParent_: filterModalParent_
5846
+ filterModalParent_: filterModalParent_,
5847
+ hideCount0FilterOptions_: hideCount0FilterOptions_
5831
5848
  }) {
5832
5849
  const Self = () => {
5833
5850
  // This could technically be in SearchPage and CategoryPage and would be better suited there since it writes into local_filter_cache_ which i.e. SelectedFilters uses, but it's better suited here IMO due to DRY and being inside the correct error boundary here
@@ -5858,7 +5875,8 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({
5858
5875
  available_filters_: available_filters_,
5859
5876
  expanded_filters_: expanded_filters_,
5860
5877
  selected_filters_: selected_filters_,
5861
- i18n_: i18n_
5878
+ i18n_: i18n_,
5879
+ hideCount0FilterOptions_: hideCount0FilterOptions_
5862
5880
  };
5863
5881
  const hide_filters = $9HbP8$createMemo(() => $4cc1c021eee2a432$export$50f68cc9882e36a4(filter_options));
5864
5882
  const sorting_options = {
@@ -7708,7 +7726,8 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
7708
7726
  filter_query_param_prefix_: filter_query_param_prefix_,
7709
7727
  content_blocks_by_row_: content_blocks_by_row_,
7710
7728
  filterModalParent_: filterModalParent_,
7711
- showSliderArrow_: showSliderArrow_
7729
+ showSliderArrow_: showSliderArrow_,
7730
+ hideCount0FilterOptions_: hideCount0FilterOptions_
7712
7731
  }) {
7713
7732
  let results_for;
7714
7733
  let only_show_filters_opener_;
@@ -7922,6 +7941,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
7922
7941
  number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
7923
7942
  sort_and_filter_disabled_: sort_and_filter_disabled_,
7924
7943
  filterModalParent_: filterModalParent_,
7944
+ hideCount0FilterOptions_: hideCount0FilterOptions_,
7925
7945
  ...extra_sort_and_filter_args_
7926
7946
  });
7927
7947
  $9HbP8$catchify((0, $641bba2917fe862b$export$6e49da55e449af7c))({
@@ -8119,7 +8139,7 @@ function $df5d81d0fe61ff21$var$add_us_to_crumbs(plp_meta) {
8119
8139
  const href_accessor = $9HbP8$use_href_accessor();
8120
8140
  return $9HbP8$createMemo(() => {
8121
8141
  const api_value = plp_meta()?.breadcrumbs;
8122
- if (!api_value) return api_value;
8142
+ if (!api_value || plp_meta()?.show_in_breadcrumbs === false) return api_value;
8123
8143
  return [...api_value, $9HbP8$mergeProps(plp_meta(), {
8124
8144
  get page_url() {
8125
8145
  return href_accessor();
@@ -14428,7 +14448,8 @@ function $7097477c78a89208$export$a54ec244c8863715({
14428
14448
  BackIcon_: BackIcon_,
14429
14449
  filterModalParent_: filterModalParent_,
14430
14450
  class_: class_,
14431
- showSliderArrow_: showSliderArrow_
14451
+ showSliderArrow_: showSliderArrow_,
14452
+ hideCount0FilterOptions_: hideCount0FilterOptions_
14432
14453
  }) {
14433
14454
  const [get_sorting] = current_sorting_;
14434
14455
  const all_products_loaded_ = $9HbP8$createSignal(false);
@@ -14536,7 +14557,8 @@ function $7097477c78a89208$export$a54ec244c8863715({
14536
14557
  local_filter_cache_: local_filter_cache_,
14537
14558
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
14538
14559
  number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
14539
- filterModalParent_: filterModalParent_
14560
+ filterModalParent_: filterModalParent_,
14561
+ hideCount0FilterOptions_: hideCount0FilterOptions_
14540
14562
  });
14541
14563
  const results_filters = $9HbP8$createSignal();
14542
14564
  const shouldActuallyShowInputField = $9HbP8$createMemo(() => include_input_field_?.() ?? true); // default to showing input field
@@ -15220,7 +15242,8 @@ function $806c97b931758897$export$f2dc7e4e4aa11abb(props) {
15220
15242
  })),
15221
15243
  filterModalParent_: $9HbP8$untrack(() => props.filterModalParent_),
15222
15244
  product_card_template_: product_card_template,
15223
- class_: () => props.class
15245
+ class_: () => props.class,
15246
+ hideCount0FilterOptions_: () => props.hideCount0FilterOptions_ ?? false
15224
15247
  });
15225
15248
  }, "Entire SearchPage failed");
15226
15249
  }
@@ -15783,6 +15806,7 @@ function $442f32a4d80abbde$export$e2bf8ce7779e827e(props) {
15783
15806
  sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
15784
15807
  content_blocks_by_row_: () => props.content_blocks_by_row,
15785
15808
  showSliderArrow_: () => props.showSliderArrow_,
15809
+ hideCount0FilterOptions_: () => props.hideCount0FilterOptions_ ?? false,
15786
15810
  scroll_restoration_data_: scroll_restoration_data_,
15787
15811
  history_content_blocks_: history_content_blocks_,
15788
15812
  layout_options_: $9HbP8$createMemo(() => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/ui",
3
- "version": "4.9.7",
3
+ "version": "4.9.9",
4
4
  "description": "Base package containing the actual UI of Depict UI along with translations, with a not-simplified API. We recommend using @depict-ai/js-ui or @depict-ai/react-ui instead.",
5
5
  "packageManager": "yarn@3.2.2",
6
6
  "sass": "styles.scss",
@@ -115,7 +115,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $335c02c1241a9ca8$export$5b7
115
115
  $parcel$export(module.exports, "QuickLinks", () => $335c02c1241a9ca8$export$de035477d6fef996);
116
116
  $parcel$export(module.exports, "CategoryPage", () => $c10e33c4681f8c9b$export$e2bf8ce7779e827e);
117
117
  /*! Depict.ai search and product listing SDK */
118
- const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.9.7";
118
+ const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.9.9";
119
119
  function $3e17e871e9d0911d$export$d9f36cf74e24d595(media_query) {
120
120
  const signal = $3hooq$solidjs.createSignal(false);
121
121
  $3hooq$solidjs.onCleanup($3hooq$depictaiutilishared.javascript_media_query(media_query, _ref => {
@@ -4265,11 +4265,29 @@ function $164d474fea221d77$export$3f1a388cc0d8fed7(props) {
4265
4265
  }
4266
4266
  function $164d474fea221d77$var$ActualFilterBody(props) {
4267
4267
  const [modified_available_filters_with_selected_unexisting_ones_injected_from_local_state] = props.local_filter_cache_;
4268
- const togglable_filters = $3hooq$solidjs.createMemo(() => modified_available_filters_with_selected_unexisting_ones_injected_from_local_state().filter(item => {
4268
+ const withMaybeCount0Removed = $3hooq$solidjs.createMemo(() => {
4269
+ const filters = modified_available_filters_with_selected_unexisting_ones_injected_from_local_state();
4270
+ if (!props.hideCount0FilterOptions_()) return filters;
4271
+ return filters.map(filter => {
4272
+ const oldMeta = filter.meta;
4273
+ if (!oldMeta) return filter;
4274
+ const modifiedMeta = {
4275
+ ...oldMeta
4276
+ };
4277
+ if ("counts" in modifiedMeta)
4278
+ // Remove all count 0 filter options, important that counts is last option
4279
+ for (const key of ["names", "values", "swatches", "counts"]) modifiedMeta[key] && (modifiedMeta[key] = modifiedMeta[key].filter((_, index) => modifiedMeta.counts[index] !== 0));
4280
+ return {
4281
+ ...filter,
4282
+ meta: modifiedMeta
4283
+ };
4284
+ });
4285
+ });
4286
+ const togglable_filters = $3hooq$solidjs.createMemo(() => withMaybeCount0Removed().filter(item => {
4269
4287
  var _item$meta;
4270
4288
  return item === null || item === void 0 ? void 0 : (_item$meta = item.meta) === null || _item$meta === void 0 ? void 0 : _item$meta.group_title;
4271
4289
  }));
4272
- const untogglable_filters = $3hooq$solidjs.createMemo(() => modified_available_filters_with_selected_unexisting_ones_injected_from_local_state().filter(item => {
4290
+ const untogglable_filters = $3hooq$solidjs.createMemo(() => withMaybeCount0Removed().filter(item => {
4273
4291
  var _item$meta2;
4274
4292
  return !(item !== null && item !== void 0 && (_item$meta2 = item.meta) !== null && _item$meta2 !== void 0 && _item$meta2.group_title);
4275
4293
  }));
@@ -4294,9 +4312,7 @@ function $164d474fea221d77$var$ActualFilterBody(props) {
4294
4312
  },
4295
4313
  get children() {
4296
4314
  return (() => {
4297
- const filter_array_ = $3hooq$solidjs.createMemo(() => {
4298
- return Object.values(togglable_filters_grouped_by_collapsible())[get_section_index()];
4299
- });
4315
+ const filter_array_ = $3hooq$solidjs.createMemo(() => Object.values(togglable_filters_grouped_by_collapsible())[get_section_index()]);
4300
4316
  const {
4301
4317
  SearchThisFilterGroup_: SearchThisFilterGroup_,
4302
4318
  searched_filter_array_: searched_filter_array_,
@@ -4990,7 +5006,8 @@ function $f70cc6dfcadf0fd5$export$d7841e452f2e59a8(_ref) {
4990
5006
  local_filter_cache_: local_filter_cache_,
4991
5007
  get_extra_filters_button_: get_extra_filters_button_,
4992
5008
  get_extra_sorting_button_: get_extra_sorting_button_,
4993
- filterModalParent_: filterModalParent_
5009
+ filterModalParent_: filterModalParent_,
5010
+ hideCount0FilterOptions_: hideCount0FilterOptions_
4994
5011
  } = _ref;
4995
5012
  const Self = () => {
4996
5013
  // This could technically be in SearchPage and CategoryPage and would be better suited there since it writes into local_filter_cache_ which i.e. SelectedFilters uses, but it's better suited here IMO due to DRY and being inside the correct error boundary here
@@ -5025,7 +5042,8 @@ function $f70cc6dfcadf0fd5$export$d7841e452f2e59a8(_ref) {
5025
5042
  available_filters_: available_filters_,
5026
5043
  expanded_filters_: expanded_filters_,
5027
5044
  selected_filters_: selected_filters_,
5028
- i18n_: i18n_
5045
+ i18n_: i18n_,
5046
+ hideCount0FilterOptions_: hideCount0FilterOptions_
5029
5047
  };
5030
5048
  const hide_filters = $3hooq$solidjs.createMemo(() => $8b9c2fa4593b29df$export$50f68cc9882e36a4(filter_options));
5031
5049
  const sorting_options = {
@@ -6784,7 +6802,8 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
6784
6802
  filter_query_param_prefix_: filter_query_param_prefix_,
6785
6803
  content_blocks_by_row_: content_blocks_by_row_,
6786
6804
  filterModalParent_: filterModalParent_,
6787
- showSliderArrow_: showSliderArrow_
6805
+ showSliderArrow_: showSliderArrow_,
6806
+ hideCount0FilterOptions_: hideCount0FilterOptions_
6788
6807
  } = _ref;
6789
6808
  let results_for;
6790
6809
  let only_show_filters_opener_;
@@ -7006,6 +7025,7 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
7006
7025
  number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
7007
7026
  sort_and_filter_disabled_: sort_and_filter_disabled_,
7008
7027
  filterModalParent_: filterModalParent_,
7028
+ hideCount0FilterOptions_: hideCount0FilterOptions_,
7009
7029
  ...extra_sort_and_filter_args_
7010
7030
  });
7011
7031
  $3hooq$depictaiutilisharedlatest.catchify((0, $fef4890f1f8e0544$export$6e49da55e449af7c))({
@@ -7170,9 +7190,9 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
7170
7190
  function $ede6c70ecdca46fe$var$add_us_to_crumbs(plp_meta) {
7171
7191
  const href_accessor = $3hooq$depictaiutilisharedlatest.use_href_accessor();
7172
7192
  return $3hooq$solidjs.createMemo(() => {
7173
- var _plp_meta3;
7193
+ var _plp_meta3, _plp_meta4;
7174
7194
  const api_value = (_plp_meta3 = plp_meta()) === null || _plp_meta3 === void 0 ? void 0 : _plp_meta3.breadcrumbs;
7175
- if (!api_value) return api_value;
7195
+ if (!api_value || ((_plp_meta4 = plp_meta()) === null || _plp_meta4 === void 0 ? void 0 : _plp_meta4.show_in_breadcrumbs) === false) return api_value;
7176
7196
  return [...api_value, $3hooq$solidjs.mergeProps(plp_meta(), {
7177
7197
  get page_url() {
7178
7198
  return href_accessor();
@@ -12740,7 +12760,8 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
12740
12760
  BackIcon_: BackIcon_,
12741
12761
  filterModalParent_: filterModalParent_,
12742
12762
  class_: class_,
12743
- showSliderArrow_: showSliderArrow_
12763
+ showSliderArrow_: showSliderArrow_,
12764
+ hideCount0FilterOptions_: hideCount0FilterOptions_
12744
12765
  } = _ref;
12745
12766
  const [get_sorting] = current_sorting_;
12746
12767
  const all_products_loaded_ = $3hooq$solidjs.createSignal(false);
@@ -12860,7 +12881,8 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
12860
12881
  local_filter_cache_: local_filter_cache_,
12861
12882
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
12862
12883
  number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
12863
- filterModalParent_: filterModalParent_
12884
+ filterModalParent_: filterModalParent_,
12885
+ hideCount0FilterOptions_: hideCount0FilterOptions_
12864
12886
  });
12865
12887
  const results_filters = $3hooq$solidjs.createSignal();
12866
12888
  const shouldActuallyShowInputField = $3hooq$solidjs.createMemo(() => {
@@ -13588,7 +13610,11 @@ function $ddd39c5f36f49703$export$f2dc7e4e4aa11abb(props) {
13588
13610
  })),
13589
13611
  filterModalParent_: $3hooq$solidjs.untrack(() => props.filterModalParent_),
13590
13612
  product_card_template_: product_card_template,
13591
- class_: () => props.class
13613
+ class_: () => props.class,
13614
+ hideCount0FilterOptions_: () => {
13615
+ var _props$hideCount0Filt;
13616
+ return (_props$hideCount0Filt = props.hideCount0FilterOptions_) !== null && _props$hideCount0Filt !== void 0 ? _props$hideCount0Filt : false;
13617
+ }
13592
13618
  });
13593
13619
  }, "Entire SearchPage failed");
13594
13620
  }
@@ -14246,6 +14272,10 @@ function $c10e33c4681f8c9b$export$e2bf8ce7779e827e(props) {
14246
14272
  sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
14247
14273
  content_blocks_by_row_: () => props.content_blocks_by_row,
14248
14274
  showSliderArrow_: () => props.showSliderArrow_,
14275
+ hideCount0FilterOptions_: () => {
14276
+ var _props$hideCount0Filt;
14277
+ return (_props$hideCount0Filt = props.hideCount0FilterOptions_) !== null && _props$hideCount0Filt !== void 0 ? _props$hideCount0Filt : false;
14278
+ },
14249
14279
  scroll_restoration_data_: scroll_restoration_data_,
14250
14280
  history_content_blocks_: history_content_blocks_,
14251
14281
  layout_options_: $3hooq$solidjs.createMemo(() => ({
@@ -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.9.7";
14
+ export const version = "4.9.9";
15
15
  /**
16
16
  * Use `javascript_media_query` but return a reactive accessor instead of taking a callback function
17
17
  */
@@ -1046,6 +1046,7 @@ interface FilterBodyProps {
1046
1046
  expanded_: boolean;
1047
1047
  }[]>;
1048
1048
  are_in_modal_?: boolean;
1049
+ hideCount0FilterOptions_: Accessor<boolean>;
1049
1050
  }
1050
1051
  export function FilterBody(props: FilterBodyProps): JSX.Element;
1051
1052
  /**
@@ -1500,6 +1501,7 @@ export function SearchPage<OriginalDisplay extends Display, TransformedDisplay e
1500
1501
  filterModalParent_?: HTMLElement | ShadowRoot;
1501
1502
  class?: string;
1502
1503
  showSliderArrow_?: boolean;
1504
+ hideCount0FilterOptions_?: boolean;
1503
1505
  }): import("@depict-ai/utilishared").Node_Array;
1504
1506
  /**
1505
1507
  * Connects the height of the search field to the height of the aligner.
@@ -1619,5 +1621,6 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
1619
1621
  layout?: PossibleLayout;
1620
1622
  filterModalParent_?: HTMLElement | ShadowRoot;
1621
1623
  showSliderArrow_?: boolean;
1624
+ hideCount0FilterOptions_?: boolean;
1622
1625
  }): import("@depict-ai/utilishared").Node_Array;
1623
1626
  export type { SearchFilter } from "@depict-ai/types/api/SearchRequestV3";
@@ -10,7 +10,7 @@ import $b8hua$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.9.7";
13
+ const $8db9a15135765c11$export$83d89fbfd8236492 = "4.9.9";
14
14
  function $00a5b94f0c11efbb$export$d9f36cf74e24d595(media_query) {
15
15
  const signal = $b8hua$createSignal(false);
16
16
  $b8hua$onCleanup($b8hua$javascript_media_query(media_query, _ref => {
@@ -4160,11 +4160,29 @@ function $f6b0500577e1b210$export$3f1a388cc0d8fed7(props) {
4160
4160
  }
4161
4161
  function $f6b0500577e1b210$var$ActualFilterBody(props) {
4162
4162
  const [modified_available_filters_with_selected_unexisting_ones_injected_from_local_state] = props.local_filter_cache_;
4163
- const togglable_filters = $b8hua$createMemo(() => modified_available_filters_with_selected_unexisting_ones_injected_from_local_state().filter(item => {
4163
+ const withMaybeCount0Removed = $b8hua$createMemo(() => {
4164
+ const filters = modified_available_filters_with_selected_unexisting_ones_injected_from_local_state();
4165
+ if (!props.hideCount0FilterOptions_()) return filters;
4166
+ return filters.map(filter => {
4167
+ const oldMeta = filter.meta;
4168
+ if (!oldMeta) return filter;
4169
+ const modifiedMeta = {
4170
+ ...oldMeta
4171
+ };
4172
+ if ("counts" in modifiedMeta)
4173
+ // Remove all count 0 filter options, important that counts is last option
4174
+ for (const key of ["names", "values", "swatches", "counts"]) modifiedMeta[key] && (modifiedMeta[key] = modifiedMeta[key].filter((_, index) => modifiedMeta.counts[index] !== 0));
4175
+ return {
4176
+ ...filter,
4177
+ meta: modifiedMeta
4178
+ };
4179
+ });
4180
+ });
4181
+ const togglable_filters = $b8hua$createMemo(() => withMaybeCount0Removed().filter(item => {
4164
4182
  var _item$meta;
4165
4183
  return item === null || item === void 0 ? void 0 : (_item$meta = item.meta) === null || _item$meta === void 0 ? void 0 : _item$meta.group_title;
4166
4184
  }));
4167
- const untogglable_filters = $b8hua$createMemo(() => modified_available_filters_with_selected_unexisting_ones_injected_from_local_state().filter(item => {
4185
+ const untogglable_filters = $b8hua$createMemo(() => withMaybeCount0Removed().filter(item => {
4168
4186
  var _item$meta2;
4169
4187
  return !(item !== null && item !== void 0 && (_item$meta2 = item.meta) !== null && _item$meta2 !== void 0 && _item$meta2.group_title);
4170
4188
  }));
@@ -4189,9 +4207,7 @@ function $f6b0500577e1b210$var$ActualFilterBody(props) {
4189
4207
  },
4190
4208
  get children() {
4191
4209
  return (() => {
4192
- const filter_array_ = $b8hua$createMemo(() => {
4193
- return Object.values(togglable_filters_grouped_by_collapsible())[get_section_index()];
4194
- });
4210
+ const filter_array_ = $b8hua$createMemo(() => Object.values(togglable_filters_grouped_by_collapsible())[get_section_index()]);
4195
4211
  const {
4196
4212
  SearchThisFilterGroup_: SearchThisFilterGroup_,
4197
4213
  searched_filter_array_: searched_filter_array_,
@@ -4885,7 +4901,8 @@ function $7396052a1484264f$export$d7841e452f2e59a8(_ref) {
4885
4901
  local_filter_cache_: local_filter_cache_,
4886
4902
  get_extra_filters_button_: get_extra_filters_button_,
4887
4903
  get_extra_sorting_button_: get_extra_sorting_button_,
4888
- filterModalParent_: filterModalParent_
4904
+ filterModalParent_: filterModalParent_,
4905
+ hideCount0FilterOptions_: hideCount0FilterOptions_
4889
4906
  } = _ref;
4890
4907
  const Self = () => {
4891
4908
  // This could technically be in SearchPage and CategoryPage and would be better suited there since it writes into local_filter_cache_ which i.e. SelectedFilters uses, but it's better suited here IMO due to DRY and being inside the correct error boundary here
@@ -4920,7 +4937,8 @@ function $7396052a1484264f$export$d7841e452f2e59a8(_ref) {
4920
4937
  available_filters_: available_filters_,
4921
4938
  expanded_filters_: expanded_filters_,
4922
4939
  selected_filters_: selected_filters_,
4923
- i18n_: i18n_
4940
+ i18n_: i18n_,
4941
+ hideCount0FilterOptions_: hideCount0FilterOptions_
4924
4942
  };
4925
4943
  const hide_filters = $b8hua$createMemo(() => $6fcb97029a69ec44$export$50f68cc9882e36a4(filter_options));
4926
4944
  const sorting_options = {
@@ -6679,7 +6697,8 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
6679
6697
  filter_query_param_prefix_: filter_query_param_prefix_,
6680
6698
  content_blocks_by_row_: content_blocks_by_row_,
6681
6699
  filterModalParent_: filterModalParent_,
6682
- showSliderArrow_: showSliderArrow_
6700
+ showSliderArrow_: showSliderArrow_,
6701
+ hideCount0FilterOptions_: hideCount0FilterOptions_
6683
6702
  } = _ref;
6684
6703
  let results_for;
6685
6704
  let only_show_filters_opener_;
@@ -6901,6 +6920,7 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
6901
6920
  number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
6902
6921
  sort_and_filter_disabled_: sort_and_filter_disabled_,
6903
6922
  filterModalParent_: filterModalParent_,
6923
+ hideCount0FilterOptions_: hideCount0FilterOptions_,
6904
6924
  ...extra_sort_and_filter_args_
6905
6925
  });
6906
6926
  $b8hua$catchify((0, $5e6abec0dab4e610$export$6e49da55e449af7c))({
@@ -7065,9 +7085,9 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
7065
7085
  function $4b4b262708b516ee$var$add_us_to_crumbs(plp_meta) {
7066
7086
  const href_accessor = $b8hua$use_href_accessor();
7067
7087
  return $b8hua$createMemo(() => {
7068
- var _plp_meta3;
7088
+ var _plp_meta3, _plp_meta4;
7069
7089
  const api_value = (_plp_meta3 = plp_meta()) === null || _plp_meta3 === void 0 ? void 0 : _plp_meta3.breadcrumbs;
7070
- if (!api_value) return api_value;
7090
+ if (!api_value || ((_plp_meta4 = plp_meta()) === null || _plp_meta4 === void 0 ? void 0 : _plp_meta4.show_in_breadcrumbs) === false) return api_value;
7071
7091
  return [...api_value, $b8hua$mergeProps(plp_meta(), {
7072
7092
  get page_url() {
7073
7093
  return href_accessor();
@@ -12635,7 +12655,8 @@ function $da279c5a540c6846$export$a54ec244c8863715(_ref) {
12635
12655
  BackIcon_: BackIcon_,
12636
12656
  filterModalParent_: filterModalParent_,
12637
12657
  class_: class_,
12638
- showSliderArrow_: showSliderArrow_
12658
+ showSliderArrow_: showSliderArrow_,
12659
+ hideCount0FilterOptions_: hideCount0FilterOptions_
12639
12660
  } = _ref;
12640
12661
  const [get_sorting] = current_sorting_;
12641
12662
  const all_products_loaded_ = $b8hua$createSignal(false);
@@ -12755,7 +12776,8 @@ function $da279c5a540c6846$export$a54ec244c8863715(_ref) {
12755
12776
  local_filter_cache_: local_filter_cache_,
12756
12777
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
12757
12778
  number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
12758
- filterModalParent_: filterModalParent_
12779
+ filterModalParent_: filterModalParent_,
12780
+ hideCount0FilterOptions_: hideCount0FilterOptions_
12759
12781
  });
12760
12782
  const results_filters = $b8hua$createSignal();
12761
12783
  const shouldActuallyShowInputField = $b8hua$createMemo(() => {
@@ -13483,7 +13505,11 @@ function $eb064bc3350276c1$export$f2dc7e4e4aa11abb(props) {
13483
13505
  })),
13484
13506
  filterModalParent_: $b8hua$untrack(() => props.filterModalParent_),
13485
13507
  product_card_template_: product_card_template,
13486
- class_: () => props.class
13508
+ class_: () => props.class,
13509
+ hideCount0FilterOptions_: () => {
13510
+ var _props$hideCount0Filt;
13511
+ return (_props$hideCount0Filt = props.hideCount0FilterOptions_) !== null && _props$hideCount0Filt !== void 0 ? _props$hideCount0Filt : false;
13512
+ }
13487
13513
  });
13488
13514
  }, "Entire SearchPage failed");
13489
13515
  }
@@ -14141,6 +14167,10 @@ function $8821a19349c36651$export$e2bf8ce7779e827e(props) {
14141
14167
  sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
14142
14168
  content_blocks_by_row_: () => props.content_blocks_by_row,
14143
14169
  showSliderArrow_: () => props.showSliderArrow_,
14170
+ hideCount0FilterOptions_: () => {
14171
+ var _props$hideCount0Filt;
14172
+ return (_props$hideCount0Filt = props.hideCount0FilterOptions_) !== null && _props$hideCount0Filt !== void 0 ? _props$hideCount0Filt : false;
14173
+ },
14144
14174
  scroll_restoration_data_: scroll_restoration_data_,
14145
14175
  history_content_blocks_: history_content_blocks_,
14146
14176
  layout_options_: $b8hua$createMemo(() => ({
@@ -109,7 +109,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $1f4925833f07df29$export$5b7
109
109
  $parcel$export(module.exports, "QuickLinks", () => $1f4925833f07df29$export$de035477d6fef996);
110
110
  $parcel$export(module.exports, "CategoryPage", () => $14f289047713d67a$export$e2bf8ce7779e827e);
111
111
  /*! Depict.ai search and product listing SDK */
112
- const $b757f75811f3261f$export$83d89fbfd8236492 = "4.9.7";
112
+ const $b757f75811f3261f$export$83d89fbfd8236492 = "4.9.9";
113
113
  function $b54e6192d0caa293$export$d9f36cf74e24d595(media_query) {
114
114
  const signal = $5vyXB$solidjs.createSignal(false);
115
115
  $5vyXB$solidjs.onCleanup($5vyXB$depictaiutilishared.javascript_media_query(media_query, ({
@@ -4037,8 +4037,26 @@ function $aff9a96d30ed3563$export$3f1a388cc0d8fed7(props) {
4037
4037
  }
4038
4038
  function $aff9a96d30ed3563$var$ActualFilterBody(props) {
4039
4039
  const [modified_available_filters_with_selected_unexisting_ones_injected_from_local_state] = props.local_filter_cache_;
4040
- const togglable_filters = $5vyXB$solidjs.createMemo(() => modified_available_filters_with_selected_unexisting_ones_injected_from_local_state().filter(item => item?.meta?.group_title));
4041
- const untogglable_filters = $5vyXB$solidjs.createMemo(() => modified_available_filters_with_selected_unexisting_ones_injected_from_local_state().filter(item => !item?.meta?.group_title));
4040
+ const withMaybeCount0Removed = $5vyXB$solidjs.createMemo(() => {
4041
+ const filters = modified_available_filters_with_selected_unexisting_ones_injected_from_local_state();
4042
+ if (!props.hideCount0FilterOptions_()) return filters;
4043
+ return filters.map(filter => {
4044
+ const oldMeta = filter.meta;
4045
+ if (!oldMeta) return filter;
4046
+ const modifiedMeta = {
4047
+ ...oldMeta
4048
+ };
4049
+ if ("counts" in modifiedMeta)
4050
+ // Remove all count 0 filter options, important that counts is last option
4051
+ for (const key of ["names", "values", "swatches", "counts"]) modifiedMeta[key] &&= modifiedMeta[key].filter((_, index) => modifiedMeta.counts[index] !== 0);
4052
+ return {
4053
+ ...filter,
4054
+ meta: modifiedMeta
4055
+ };
4056
+ });
4057
+ });
4058
+ const togglable_filters = $5vyXB$solidjs.createMemo(() => withMaybeCount0Removed().filter(item => item?.meta?.group_title));
4059
+ const untogglable_filters = $5vyXB$solidjs.createMemo(() => withMaybeCount0Removed().filter(item => !item?.meta?.group_title));
4042
4060
  const togglable_filters_grouped_by_collapsible = $5vyXB$solidjs.createMemo(() => {
4043
4061
  const output = {};
4044
4062
  for (const filter of togglable_filters()) {
@@ -4059,9 +4077,7 @@ function $aff9a96d30ed3563$var$ActualFilterBody(props) {
4059
4077
  },
4060
4078
  get children() {
4061
4079
  return (() => {
4062
- const filter_array_ = $5vyXB$solidjs.createMemo(() => {
4063
- return Object.values(togglable_filters_grouped_by_collapsible())[get_section_index()];
4064
- });
4080
+ const filter_array_ = $5vyXB$solidjs.createMemo(() => Object.values(togglable_filters_grouped_by_collapsible())[get_section_index()]);
4065
4081
  const {
4066
4082
  SearchThisFilterGroup_: SearchThisFilterGroup_,
4067
4083
  searched_filter_array_: searched_filter_array_,
@@ -4693,7 +4709,8 @@ function $f8f64d05c525825b$export$d7841e452f2e59a8({
4693
4709
  local_filter_cache_: local_filter_cache_,
4694
4710
  get_extra_filters_button_: get_extra_filters_button_,
4695
4711
  get_extra_sorting_button_: get_extra_sorting_button_,
4696
- filterModalParent_: filterModalParent_
4712
+ filterModalParent_: filterModalParent_,
4713
+ hideCount0FilterOptions_: hideCount0FilterOptions_
4697
4714
  }) {
4698
4715
  const Self = () => {
4699
4716
  // This could technically be in SearchPage and CategoryPage and would be better suited there since it writes into local_filter_cache_ which i.e. SelectedFilters uses, but it's better suited here IMO due to DRY and being inside the correct error boundary here
@@ -4724,7 +4741,8 @@ function $f8f64d05c525825b$export$d7841e452f2e59a8({
4724
4741
  available_filters_: available_filters_,
4725
4742
  expanded_filters_: expanded_filters_,
4726
4743
  selected_filters_: selected_filters_,
4727
- i18n_: i18n_
4744
+ i18n_: i18n_,
4745
+ hideCount0FilterOptions_: hideCount0FilterOptions_
4728
4746
  };
4729
4747
  const hide_filters = $5vyXB$solidjs.createMemo(() => $7e91f9b0c6d56424$export$50f68cc9882e36a4(filter_options));
4730
4748
  const sorting_options = {
@@ -6395,7 +6413,8 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({
6395
6413
  filter_query_param_prefix_: filter_query_param_prefix_,
6396
6414
  content_blocks_by_row_: content_blocks_by_row_,
6397
6415
  filterModalParent_: filterModalParent_,
6398
- showSliderArrow_: showSliderArrow_
6416
+ showSliderArrow_: showSliderArrow_,
6417
+ hideCount0FilterOptions_: hideCount0FilterOptions_
6399
6418
  }) {
6400
6419
  let results_for;
6401
6420
  let only_show_filters_opener_;
@@ -6599,6 +6618,7 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({
6599
6618
  number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
6600
6619
  sort_and_filter_disabled_: sort_and_filter_disabled_,
6601
6620
  filterModalParent_: filterModalParent_,
6621
+ hideCount0FilterOptions_: hideCount0FilterOptions_,
6602
6622
  ...extra_sort_and_filter_args_
6603
6623
  });
6604
6624
  $5vyXB$depictaiutilisharedlatest.catchify((0, $276380e4607fb9fb$export$6e49da55e449af7c))({
@@ -6760,7 +6780,7 @@ function $840d88a04b2d22a7$var$add_us_to_crumbs(plp_meta) {
6760
6780
  const href_accessor = $5vyXB$depictaiutilisharedlatest.use_href_accessor();
6761
6781
  return $5vyXB$solidjs.createMemo(() => {
6762
6782
  const api_value = plp_meta()?.breadcrumbs;
6763
- if (!api_value) return api_value;
6783
+ if (!api_value || plp_meta()?.show_in_breadcrumbs === false) return api_value;
6764
6784
  return [...api_value, $5vyXB$solidjs.mergeProps(plp_meta(), {
6765
6785
  get page_url() {
6766
6786
  return href_accessor();
@@ -11945,7 +11965,8 @@ function $f1d7cb69f839a526$export$a54ec244c8863715({
11945
11965
  BackIcon_: BackIcon_,
11946
11966
  filterModalParent_: filterModalParent_,
11947
11967
  class_: class_,
11948
- showSliderArrow_: showSliderArrow_
11968
+ showSliderArrow_: showSliderArrow_,
11969
+ hideCount0FilterOptions_: hideCount0FilterOptions_
11949
11970
  }) {
11950
11971
  const [get_sorting] = current_sorting_;
11951
11972
  const all_products_loaded_ = $5vyXB$solidjs.createSignal(false);
@@ -12053,7 +12074,8 @@ function $f1d7cb69f839a526$export$a54ec244c8863715({
12053
12074
  local_filter_cache_: local_filter_cache_,
12054
12075
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
12055
12076
  number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
12056
- filterModalParent_: filterModalParent_
12077
+ filterModalParent_: filterModalParent_,
12078
+ hideCount0FilterOptions_: hideCount0FilterOptions_
12057
12079
  });
12058
12080
  const results_filters = $5vyXB$solidjs.createSignal();
12059
12081
  const shouldActuallyShowInputField = $5vyXB$solidjs.createMemo(() => include_input_field_?.() ?? true); // default to showing input field
@@ -12687,7 +12709,8 @@ function $2c61e4cd8229c49a$export$f2dc7e4e4aa11abb(props) {
12687
12709
  })),
12688
12710
  filterModalParent_: $5vyXB$solidjs.untrack(() => props.filterModalParent_),
12689
12711
  product_card_template_: product_card_template,
12690
- class_: () => props.class
12712
+ class_: () => props.class,
12713
+ hideCount0FilterOptions_: () => props.hideCount0FilterOptions_ ?? false
12691
12714
  });
12692
12715
  }, "Entire SearchPage failed");
12693
12716
  }
@@ -13241,6 +13264,7 @@ function $14f289047713d67a$export$e2bf8ce7779e827e(props) {
13241
13264
  sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
13242
13265
  content_blocks_by_row_: () => props.content_blocks_by_row,
13243
13266
  showSliderArrow_: () => props.showSliderArrow_,
13267
+ hideCount0FilterOptions_: () => props.hideCount0FilterOptions_ ?? false,
13244
13268
  scroll_restoration_data_: scroll_restoration_data_,
13245
13269
  history_content_blocks_: history_content_blocks_,
13246
13270
  layout_options_: $5vyXB$solidjs.createMemo(() => ({
@@ -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.9.7";
14
+ export const version = "4.9.9";
15
15
  /**
16
16
  * Use `javascript_media_query` but return a reactive accessor instead of taking a callback function
17
17
  */
@@ -1046,6 +1046,7 @@ interface FilterBodyProps {
1046
1046
  expanded_: boolean;
1047
1047
  }[]>;
1048
1048
  are_in_modal_?: boolean;
1049
+ hideCount0FilterOptions_: Accessor<boolean>;
1049
1050
  }
1050
1051
  export function FilterBody(props: FilterBodyProps): JSX.Element;
1051
1052
  /**
@@ -1500,6 +1501,7 @@ export function SearchPage<OriginalDisplay extends Display, TransformedDisplay e
1500
1501
  filterModalParent_?: HTMLElement | ShadowRoot;
1501
1502
  class?: string;
1502
1503
  showSliderArrow_?: boolean;
1504
+ hideCount0FilterOptions_?: boolean;
1503
1505
  }): import("@depict-ai/utilishared").Node_Array;
1504
1506
  /**
1505
1507
  * Connects the height of the search field to the height of the aligner.
@@ -1619,5 +1621,6 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
1619
1621
  layout?: PossibleLayout;
1620
1622
  filterModalParent_?: HTMLElement | ShadowRoot;
1621
1623
  showSliderArrow_?: boolean;
1624
+ hideCount0FilterOptions_?: boolean;
1622
1625
  }): import("@depict-ai/utilishared").Node_Array;
1623
1626
  export type { SearchFilter } from "@depict-ai/types/api/SearchRequestV3";
@@ -7,7 +7,7 @@ import { createStore as $i7OB2$createStore, reconcile as $i7OB2$reconcile } from
7
7
  /*! Depict.ai search and product listing SDK */
8
8
  import { register_es_version } from "../../multi_import_deduplicator.mjs";
9
9
  register_es_version("ui", "latest");
10
- const $ec291e0010116877$export$83d89fbfd8236492 = "4.9.7";
10
+ const $ec291e0010116877$export$83d89fbfd8236492 = "4.9.9";
11
11
  function $dc9262ef6f786812$export$d9f36cf74e24d595(media_query) {
12
12
  const signal = $i7OB2$createSignal(false);
13
13
  $i7OB2$onCleanup($i7OB2$javascript_media_query(media_query, ({
@@ -3935,8 +3935,26 @@ function $fab07f52c9861732$export$3f1a388cc0d8fed7(props) {
3935
3935
  }
3936
3936
  function $fab07f52c9861732$var$ActualFilterBody(props) {
3937
3937
  const [modified_available_filters_with_selected_unexisting_ones_injected_from_local_state] = props.local_filter_cache_;
3938
- const togglable_filters = $i7OB2$createMemo(() => modified_available_filters_with_selected_unexisting_ones_injected_from_local_state().filter(item => item?.meta?.group_title));
3939
- const untogglable_filters = $i7OB2$createMemo(() => modified_available_filters_with_selected_unexisting_ones_injected_from_local_state().filter(item => !item?.meta?.group_title));
3938
+ const withMaybeCount0Removed = $i7OB2$createMemo(() => {
3939
+ const filters = modified_available_filters_with_selected_unexisting_ones_injected_from_local_state();
3940
+ if (!props.hideCount0FilterOptions_()) return filters;
3941
+ return filters.map(filter => {
3942
+ const oldMeta = filter.meta;
3943
+ if (!oldMeta) return filter;
3944
+ const modifiedMeta = {
3945
+ ...oldMeta
3946
+ };
3947
+ if ("counts" in modifiedMeta)
3948
+ // Remove all count 0 filter options, important that counts is last option
3949
+ for (const key of ["names", "values", "swatches", "counts"]) modifiedMeta[key] &&= modifiedMeta[key].filter((_, index) => modifiedMeta.counts[index] !== 0);
3950
+ return {
3951
+ ...filter,
3952
+ meta: modifiedMeta
3953
+ };
3954
+ });
3955
+ });
3956
+ const togglable_filters = $i7OB2$createMemo(() => withMaybeCount0Removed().filter(item => item?.meta?.group_title));
3957
+ const untogglable_filters = $i7OB2$createMemo(() => withMaybeCount0Removed().filter(item => !item?.meta?.group_title));
3940
3958
  const togglable_filters_grouped_by_collapsible = $i7OB2$createMemo(() => {
3941
3959
  const output = {};
3942
3960
  for (const filter of togglable_filters()) {
@@ -3957,9 +3975,7 @@ function $fab07f52c9861732$var$ActualFilterBody(props) {
3957
3975
  },
3958
3976
  get children() {
3959
3977
  return (() => {
3960
- const filter_array_ = $i7OB2$createMemo(() => {
3961
- return Object.values(togglable_filters_grouped_by_collapsible())[get_section_index()];
3962
- });
3978
+ const filter_array_ = $i7OB2$createMemo(() => Object.values(togglable_filters_grouped_by_collapsible())[get_section_index()]);
3963
3979
  const {
3964
3980
  SearchThisFilterGroup_: SearchThisFilterGroup_,
3965
3981
  searched_filter_array_: searched_filter_array_,
@@ -4591,7 +4607,8 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({
4591
4607
  local_filter_cache_: local_filter_cache_,
4592
4608
  get_extra_filters_button_: get_extra_filters_button_,
4593
4609
  get_extra_sorting_button_: get_extra_sorting_button_,
4594
- filterModalParent_: filterModalParent_
4610
+ filterModalParent_: filterModalParent_,
4611
+ hideCount0FilterOptions_: hideCount0FilterOptions_
4595
4612
  }) {
4596
4613
  const Self = () => {
4597
4614
  // This could technically be in SearchPage and CategoryPage and would be better suited there since it writes into local_filter_cache_ which i.e. SelectedFilters uses, but it's better suited here IMO due to DRY and being inside the correct error boundary here
@@ -4622,7 +4639,8 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({
4622
4639
  available_filters_: available_filters_,
4623
4640
  expanded_filters_: expanded_filters_,
4624
4641
  selected_filters_: selected_filters_,
4625
- i18n_: i18n_
4642
+ i18n_: i18n_,
4643
+ hideCount0FilterOptions_: hideCount0FilterOptions_
4626
4644
  };
4627
4645
  const hide_filters = $i7OB2$createMemo(() => $4cc1c021eee2a432$export$50f68cc9882e36a4(filter_options));
4628
4646
  const sorting_options = {
@@ -6293,7 +6311,8 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
6293
6311
  filter_query_param_prefix_: filter_query_param_prefix_,
6294
6312
  content_blocks_by_row_: content_blocks_by_row_,
6295
6313
  filterModalParent_: filterModalParent_,
6296
- showSliderArrow_: showSliderArrow_
6314
+ showSliderArrow_: showSliderArrow_,
6315
+ hideCount0FilterOptions_: hideCount0FilterOptions_
6297
6316
  }) {
6298
6317
  let results_for;
6299
6318
  let only_show_filters_opener_;
@@ -6497,6 +6516,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
6497
6516
  number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
6498
6517
  sort_and_filter_disabled_: sort_and_filter_disabled_,
6499
6518
  filterModalParent_: filterModalParent_,
6519
+ hideCount0FilterOptions_: hideCount0FilterOptions_,
6500
6520
  ...extra_sort_and_filter_args_
6501
6521
  });
6502
6522
  $i7OB2$catchify((0, $641bba2917fe862b$export$6e49da55e449af7c))({
@@ -6658,7 +6678,7 @@ function $df5d81d0fe61ff21$var$add_us_to_crumbs(plp_meta) {
6658
6678
  const href_accessor = $i7OB2$use_href_accessor();
6659
6679
  return $i7OB2$createMemo(() => {
6660
6680
  const api_value = plp_meta()?.breadcrumbs;
6661
- if (!api_value) return api_value;
6681
+ if (!api_value || plp_meta()?.show_in_breadcrumbs === false) return api_value;
6662
6682
  return [...api_value, $i7OB2$mergeProps(plp_meta(), {
6663
6683
  get page_url() {
6664
6684
  return href_accessor();
@@ -11843,7 +11863,8 @@ function $7097477c78a89208$export$a54ec244c8863715({
11843
11863
  BackIcon_: BackIcon_,
11844
11864
  filterModalParent_: filterModalParent_,
11845
11865
  class_: class_,
11846
- showSliderArrow_: showSliderArrow_
11866
+ showSliderArrow_: showSliderArrow_,
11867
+ hideCount0FilterOptions_: hideCount0FilterOptions_
11847
11868
  }) {
11848
11869
  const [get_sorting] = current_sorting_;
11849
11870
  const all_products_loaded_ = $i7OB2$createSignal(false);
@@ -11951,7 +11972,8 @@ function $7097477c78a89208$export$a54ec244c8863715({
11951
11972
  local_filter_cache_: local_filter_cache_,
11952
11973
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
11953
11974
  number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
11954
- filterModalParent_: filterModalParent_
11975
+ filterModalParent_: filterModalParent_,
11976
+ hideCount0FilterOptions_: hideCount0FilterOptions_
11955
11977
  });
11956
11978
  const results_filters = $i7OB2$createSignal();
11957
11979
  const shouldActuallyShowInputField = $i7OB2$createMemo(() => include_input_field_?.() ?? true); // default to showing input field
@@ -12585,7 +12607,8 @@ function $806c97b931758897$export$f2dc7e4e4aa11abb(props) {
12585
12607
  })),
12586
12608
  filterModalParent_: $i7OB2$untrack(() => props.filterModalParent_),
12587
12609
  product_card_template_: product_card_template,
12588
- class_: () => props.class
12610
+ class_: () => props.class,
12611
+ hideCount0FilterOptions_: () => props.hideCount0FilterOptions_ ?? false
12589
12612
  });
12590
12613
  }, "Entire SearchPage failed");
12591
12614
  }
@@ -13139,6 +13162,7 @@ function $442f32a4d80abbde$export$e2bf8ce7779e827e(props) {
13139
13162
  sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
13140
13163
  content_blocks_by_row_: () => props.content_blocks_by_row,
13141
13164
  showSliderArrow_: () => props.showSliderArrow_,
13165
+ hideCount0FilterOptions_: () => props.hideCount0FilterOptions_ ?? false,
13142
13166
  scroll_restoration_data_: scroll_restoration_data_,
13143
13167
  history_content_blocks_: history_content_blocks_,
13144
13168
  layout_options_: $i7OB2$createMemo(() => ({