@depict-ai/ui 2.1.12 → 2.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/latest/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { add_to_version_info as $9HbP8$add_to_version_info, base64_encode_unicode as $9HbP8$base64_encode_unicode, base64_decode_unicode as $9HbP8$base64_decode_unicode, dlog as $9HbP8$dlog, queueMacroTask as $9HbP8$queueMacroTask, catchify as $9HbP8$catchify, is_safari as $9HbP8$is_safari, observer as $9HbP8$observer, dwarn as $9HbP8$dwarn, Amazing_Slider as $9HbP8$Amazing_Slider, slider_snap_css as $9HbP8$slider_snap_css, slider_fading_factory as $9HbP8$slider_fading_factory, slider_fractional_factory as $9HbP8$slider_fractional_factory, camelCasifyObject as $9HbP8$camelCasifyObject, make_random_classname as $9HbP8$make_random_classname, n_col_styling_with_dist as $9HbP8$n_col_styling_with_dist, layout_get_visible_recs_without_partial_rows as $9HbP8$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $9HbP8$layout_get_total_rec_amount_for_row, layout_media_query_header as $9HbP8$layout_media_query_header, report as $9HbP8$report, useExpandingContainer as $9HbP8$useExpandingContainer, standard_price_format as $9HbP8$standard_price_format, hex_to_rgb as $9HbP8$hex_to_rgb, relative_luminance_from_rgb as $9HbP8$relative_luminance_from_rgb, fetch_recs as $9HbP8$fetch_recs, snakeCasifyObject as $9HbP8$snakeCasifyObject, instant_exec_on_suspect_history_change as $9HbP8$instant_exec_on_suspect_history_change, base_url as $9HbP8$base_url, get_depict_id as $9HbP8$get_depict_id, get_user_id as $9HbP8$get_user_id, get_session_id as $9HbP8$get_session_id, sort_obj as $9HbP8$sort_obj, fetch_retry as $9HbP8$fetch_retry, add_version_query_params as $9HbP8$add_version_query_params, make_url_with_query_params as $9HbP8$make_url_with_query_params, edit_current_page_meta_tags as $9HbP8$edit_current_page_meta_tags, javascript_media_query as $9HbP8$javascript_media_query, use_href_accessor as $9HbP8$use_href_accessor, is_debug as $9HbP8$is_debug, make_asyncIterable_exiter as $9HbP8$make_asyncIterable_exiter, href_change_ipns as $9HbP8$href_change_ipns, ContainedImage as $9HbP8$ContainedImage, buildThresholdList as $9HbP8$buildThresholdList, deparallelize_no_drop as $9HbP8$deparallelize_no_drop, ListenableSet as $9HbP8$ListenableSet, insert_surfaces as $9HbP8$insert_surfaces } from "@depict-ai/utilishared/latest";
2
- import { createComponent as $9HbP8$createComponent, insert as $9HbP8$insert, template as $9HbP8$template, getNextElement as $9HbP8$getNextElement, effect as $9HbP8$effect, style as $9HbP8$style, spread as $9HbP8$spread, setAttribute as $9HbP8$setAttribute, mergeProps as $9HbP8$mergeProps1, isServer as $9HbP8$isServer, runHydrationEvents as $9HbP8$runHydrationEvents, addEventListener as $9HbP8$addEventListener, className as $9HbP8$className, memo as $9HbP8$memo, delegateEvents as $9HbP8$delegateEvents, getNextMarker as $9HbP8$getNextMarker, classList as $9HbP8$classList, Dynamic as $9HbP8$Dynamic, use as $9HbP8$use, setProperty as $9HbP8$setProperty } from "solid-js/web";
2
+ import { createComponent as $9HbP8$createComponent, insert as $9HbP8$insert, template as $9HbP8$template, getNextElement as $9HbP8$getNextElement, effect as $9HbP8$effect, style as $9HbP8$style, spread as $9HbP8$spread, setAttribute as $9HbP8$setAttribute, mergeProps as $9HbP8$mergeProps1, isServer as $9HbP8$isServer, runHydrationEvents as $9HbP8$runHydrationEvents, addEventListener as $9HbP8$addEventListener, className as $9HbP8$className, memo as $9HbP8$memo, delegateEvents as $9HbP8$delegateEvents, getNextMarker as $9HbP8$getNextMarker, classList as $9HbP8$classList, use as $9HbP8$use, Dynamic as $9HbP8$Dynamic, setProperty as $9HbP8$setProperty } from "solid-js/web";
3
3
  import { createSignal as $9HbP8$createSignal, getOwner as $9HbP8$getOwner, createEffect as $9HbP8$createEffect, runWithOwner as $9HbP8$runWithOwner, onCleanup as $9HbP8$onCleanup, createMemo as $9HbP8$createMemo, createContext as $9HbP8$createContext, useContext as $9HbP8$useContext, mergeProps as $9HbP8$mergeProps, Show as $9HbP8$Show, createResource as $9HbP8$createResource, Suspense as $9HbP8$Suspense, untrack as $9HbP8$untrack, createRenderEffect as $9HbP8$createRenderEffect, Index as $9HbP8$Index, createRoot as $9HbP8$createRoot, For as $9HbP8$For, createUniqueId as $9HbP8$createUniqueId, createComputed as $9HbP8$createComputed, ErrorBoundary as $9HbP8$ErrorBoundary, on as $9HbP8$on, batch as $9HbP8$batch, createReaction as $9HbP8$createReaction, mapArray as $9HbP8$mapArray } from "solid-js";
4
4
  import { createStore as $9HbP8$createStore, reconcile as $9HbP8$reconcile } from "solid-js/store";
5
5
 
6
6
  /*! Depict.ai search and product listing SDK */
7
7
  import { register_es_version } from "../multi_import_deduplicator.mjs";
8
8
  register_es_version("ui", "latest");
9
- const $ec291e0010116877$export$83d89fbfd8236492 = "2.1.12";
9
+ const $ec291e0010116877$export$83d89fbfd8236492 = "2.1.13";
10
10
  const $4147651646da990a$var$fallback_operator = "in";
11
11
  const $4147651646da990a$var$fallback_token = "";
12
12
  const $4147651646da990a$var$legacy_filter_prefix = "filter_";
@@ -447,24 +447,30 @@ function $f32e14878e75af51$export$6649caad96ef8870({
447
447
 
448
448
  /** @jsxImportSource solid-js */
449
449
 
450
- function $0fdb37d8ddabef25$export$9f191182275e9ef(what_to_watch) {
451
- const [size, setSize] = $9HbP8$createSignal();
450
+ function $2449872a62a75a20$export$ebdc3711f7e02ccd(what_to_watch) {
451
+ const [width, setWidth] = $9HbP8$createSignal();
452
452
  const resizeObserver = new ResizeObserver($9HbP8$catchify(records => {
453
453
  for (let j = 0; j < records.length; j++) {
454
454
  const width = records[j].borderBoxSize?.[0]?.inlineSize ?? what_to_watch.getBoundingClientRect().width;
455
- setSize(width);
455
+ setWidth(width);
456
456
  }
457
457
  }));
458
458
  // If we start observing elements before they're in the DOM Chrome (Version 117.0.5938.92 (Official Build) (arm64)) sometimes gives us a resize event with a width of 0 and then doesn't dispatch one with the actual width once it's in the DOM. So we wait until the element is in the DOM before we start observing it.
459
459
  // It doesn't seem to work even when waiting for it to be in the DOM, also wait an animation frame
460
460
  const disconnect = (0, $9HbP8$observer).onexists(what_to_watch, ({
461
461
  element: element
462
- }) => requestAnimationFrame($9HbP8$catchify(() => resizeObserver.observe(element))));
462
+ }) => requestAnimationFrame($9HbP8$catchify(() => {
463
+ const current_size = what_to_watch.getBoundingClientRect().width;
464
+ if (current_size)
465
+ // If element has size, set signal to that. ResizeObserver only triggers when the content is visible in some cases, but it might already have a size. This reduces size filter expanding animation jank in chrome.
466
+ setWidth(current_size);
467
+ resizeObserver.observe(element);
468
+ })));
463
469
  $9HbP8$onCleanup(() => {
464
470
  resizeObserver.disconnect();
465
471
  disconnect();
466
472
  });
467
- return size;
473
+ return width;
468
474
  }
469
475
  const $b5cccc8ee7d24677$var$transform_elements = sorted_cols_at_size => {
470
476
  const cols_at_size = [];
@@ -1450,16 +1456,11 @@ function $e9342fb3ac73a54a$export$8895d39404bd2bb1(props) {
1450
1456
  if (delay_toast_) return show_configured_toast;else show_configured_toast();
1451
1457
  }
1452
1458
  $9HbP8$delegateEvents(["click"]);
1453
- const $19976a74d273070d$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<svg><path d="M11.669 10.531l9.156-9.156a.78.78 0 0 0 .237-.569c0-.221-.079-.412-.237-.569A.8.8 0 0 0 20.24 0a.77.77 0 0 0-.569.237l-9.14 9.14-9.14-9.14A.79.79 0 0 0 .807 0a.77.77 0 0 0-.569.237A.78.78 0 0 0 0 .807a.77.77 0 0 0 .237.569l9.156 9.156-9.156 9.14c-.159.157-.237.349-.237.569s.079.412.237.569c.085.085.174.148.268.19a1.095 1.095 0 0 0 .316.048.894.894 0 0 0 .285-.048.84.84 0 0 0 .285-.19l9.139-9.14 9.14 9.14a.894.894 0 0 0 .268.19 1.049 1.049 0 0 0 .301.048.941.941 0 0 0 .301-.048.84.84 0 0 0 .285-.19.78.78 0 0 0 .237-.569c0-.221-.079-.412-.237-.569z">`);
1459
+ const $19976a74d273070d$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<svg xmlns=http://www.w3.org/2000/svg width=21.064 height=21.047 viewBox="0 0 21.064 21.064"><path d="M11.669 10.531l9.156-9.156a.78.78 0 0 0 .237-.569c0-.221-.079-.412-.237-.569A.8.8 0 0 0 20.24 0a.77.77 0 0 0-.569.237l-9.14 9.14-9.14-9.14A.79.79 0 0 0 .807 0a.77.77 0 0 0-.569.237A.78.78 0 0 0 0 .807a.77.77 0 0 0 .237.569l9.156 9.156-9.156 9.14c-.159.157-.237.349-.237.569s.079.412.237.569c.085.085.174.148.268.19a1.095 1.095 0 0 0 .316.048.894.894 0 0 0 .285-.048.84.84 0 0 0 .285-.19l9.139-9.14 9.14 9.14a.894.894 0 0 0 .268.19 1.049 1.049 0 0 0 .301.048.941.941 0 0 0 .301-.048.84.84 0 0 0 .285-.19.78.78 0 0 0 .237-.569c0-.221-.079-.412-.237-.569z">`);
1454
1460
  function $19976a74d273070d$export$3b621d86b1566b2(props = {}) {
1455
1461
  return (() => {
1456
1462
  const _el$ = $9HbP8$getNextElement($19976a74d273070d$var$_tmpl$);
1457
- $9HbP8$spread(_el$, $9HbP8$mergeProps1(props, {
1458
- "xmlns": "http://www.w3.org/2000/svg",
1459
- "width": "21.064",
1460
- "height": "21.047",
1461
- "viewBox": "0 0 21.064 21.064"
1462
- }), true, true);
1463
+ $9HbP8$spread(_el$, props, true, true);
1463
1464
  $9HbP8$runHydrationEvents();
1464
1465
  return _el$;
1465
1466
  })();
@@ -1773,7 +1774,7 @@ $9HbP8$delegateEvents(["click"]);
1773
1774
  const $49b79728e7d9e2a1$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<span class=count>`),
1774
1775
  $49b79728e7d9e2a1$var$_tmpl$2 = /*#__PURE__*/$9HbP8$template(`<label class=input-row><div class=left><input type=checkbox><span class=custom-indicator></span><span class="text line-clamp"></span></div><!$><!/>`);
1775
1776
  const $49b79728e7d9e2a1$export$48513f6b9f8ce62d = props => {
1776
- // It seems like there's no diffing without memos here (since we often just have computations in the getters above that update to the same result often because their dependencies change with unrelated changes often), so put memos here to avoid unneeded DOM changes
1777
+ /* don't destructure props, it could have reactive getters */ // It seems like there's no diffing without memos here (since we often just have computations in the getters above that update to the same result often because their dependencies change with unrelated changes often), so put memos here to avoid unneeded DOM changes
1777
1778
  const count = $9HbP8$createMemo(() => props.count_);
1778
1779
  const label = $9HbP8$createMemo(() => props.label_);
1779
1780
  const checked = $9HbP8$createMemo(() => props.checked_);
@@ -1866,6 +1867,78 @@ function $67b173f9db427028$export$ca21a16d65b3dd8({
1866
1867
  })();
1867
1868
  }
1868
1869
  $9HbP8$delegateEvents(["click"]);
1870
+ const $f3213c0640246d58$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<span class=highlighted-part>`),
1871
+ $f3213c0640246d58$var$_tmpl$2 = /*#__PURE__*/$9HbP8$template(`<span>`);
1872
+ function $f3213c0640246d58$export$ba17c5b7e6dda39f({
1873
+ whole_text_to_display_: whole_text_to_display_memo,
1874
+ searching_for_value_: searching_for_value_memo,
1875
+ class_: class_
1876
+ }) {
1877
+ const [get_has_highlighted, set_has_highlighted] = $9HbP8$createSignal(false);
1878
+ const text_itself = $9HbP8$createMemo(() => $9HbP8$batch(() => {
1879
+ set_has_highlighted(false);
1880
+ const searching_for_value = searching_for_value_memo();
1881
+ const whole_text_to_display_ = whole_text_to_display_memo();
1882
+ let for_black = "";
1883
+ let pushed_grey = false;
1884
+ const search_q = searching_for_value;
1885
+ if (!search_q) return whole_text_to_display_;
1886
+ const output = [];
1887
+ const searching_for = search_q.toLowerCase();
1888
+ const push_black = () => {
1889
+ if (for_black) {
1890
+ set_has_highlighted(true);
1891
+ output.push((() => {
1892
+ const _el$ = $9HbP8$getNextElement($f3213c0640246d58$var$_tmpl$);
1893
+ $9HbP8$insert(_el$, for_black);
1894
+ return _el$;
1895
+ })()); // "black"
1896
+ for_black = "";
1897
+ }
1898
+ };
1899
+ for (let i = 0; i < whole_text_to_display_.length;) {
1900
+ let is_whole_word = true;
1901
+ let searching_for_but_with_texts_casing = "";
1902
+ const i_at_start = i;
1903
+ for (let j = 0; j < searching_for.length; i++, j++) {
1904
+ const letter_in_suggestion = whole_text_to_display_[i];
1905
+ if (letter_in_suggestion?.toLowerCase() !== searching_for[j]) {
1906
+ is_whole_word = false;
1907
+ i = i_at_start;
1908
+ break;
1909
+ }
1910
+ searching_for_but_with_texts_casing += letter_in_suggestion;
1911
+ }
1912
+ if (is_whole_word) {
1913
+ push_black();
1914
+ output.push(searching_for_but_with_texts_casing);
1915
+ pushed_grey = true;
1916
+ } else for_black += whole_text_to_display_[i++];
1917
+ }
1918
+ push_black();
1919
+ if (!pushed_grey) {
1920
+ set_has_highlighted(false);
1921
+ return whole_text_to_display_;
1922
+ }
1923
+ return output;
1924
+ }));
1925
+ return (() => {
1926
+ const _el$2 = $9HbP8$getNextElement($f3213c0640246d58$var$_tmpl$2);
1927
+ $9HbP8$className(_el$2, class_);
1928
+ $9HbP8$insert(_el$2, text_itself);
1929
+ $9HbP8$effect(_p$ => {
1930
+ const _v$ = !!get_has_highlighted(),
1931
+ _v$2 = whole_text_to_display_memo() /* for when line-clamped, users can see full text on hover */;
1932
+ _v$ !== _p$._v$ && _el$2.classList.toggle("has-match", _p$._v$ = _v$);
1933
+ _v$2 !== _p$._v$2 && $9HbP8$setAttribute(_el$2, "title", _p$._v$2 = _v$2);
1934
+ return _p$;
1935
+ }, {
1936
+ _v$: undefined,
1937
+ _v$2: undefined
1938
+ });
1939
+ return _el$2;
1940
+ })();
1941
+ }
1869
1942
  const $a4601e6bea3ed1e6$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<form class=checkboxes><!$><!/><!$><!/>`);
1870
1943
  const $a4601e6bea3ed1e6$var$max_visible_without_collapsing = 15;
1871
1944
  const $a4601e6bea3ed1e6$var$show_non_collapsible_when_collapsed = 4;
@@ -1873,7 +1946,8 @@ function $a4601e6bea3ed1e6$export$dd948f91abc3a1c4({
1873
1946
  filter_: filter_,
1874
1947
  selected_filters_: [get_selected_filters, set_selected_filters],
1875
1948
  i18n_: i18n_,
1876
- view_more_button_below_group_: [, set_view_more_button_below_group_]
1949
+ view_more_button_below_group_: [, set_view_more_button_below_group_],
1950
+ filter_query_: filter_query_
1877
1951
  }) {
1878
1952
  const existing_filter = $9HbP8$createMemo(() => {
1879
1953
  const {
@@ -1901,12 +1975,18 @@ function $a4601e6bea3ed1e6$export$dd948f91abc3a1c4({
1901
1975
  const value = $91aa8ee9f431800d$export$325f75597868c4f0(checkbox().value_);
1902
1976
  return !!data?.some(item => $91aa8ee9f431800d$export$325f75597868c4f0(item) === value);
1903
1977
  });
1978
+ const value = $9HbP8$createMemo(() => checkbox().value_);
1904
1979
  return $9HbP8$createComponent((0, $49b79728e7d9e2a1$export$48513f6b9f8ce62d), {
1905
1980
  get value_() {
1906
- return checkbox().value_;
1981
+ return value();
1907
1982
  },
1908
1983
  get label_() {
1909
- return checkbox().name_;
1984
+ return $9HbP8$createComponent((0, $f3213c0640246d58$export$ba17c5b7e6dda39f), {
1985
+ get whole_text_to_display_() {
1986
+ return $9HbP8$createMemo(() => checkbox().name_ || value());
1987
+ },
1988
+ searching_for_value_: () => filter_query_?.()
1989
+ });
1910
1990
  },
1911
1991
  get count_() {
1912
1992
  return checkbox().count_;
@@ -1998,7 +2078,8 @@ const $eb8d9bf3b5700c26$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<form class=r
1998
2078
  $eb8d9bf3b5700c26$var$_tmpl$3 = /*#__PURE__*/$9HbP8$template(`<label class=input-row><div class=left><input type=radio><span class=custom-indicator></span><!$><!/></div><!$><!/>`);
1999
2079
  function $eb8d9bf3b5700c26$export$430444115f70a734({
2000
2080
  selected_filters_: selected_filters_,
2001
- filter_: filter_
2081
+ filter_: filter_,
2082
+ filter_query_: filter_query_
2002
2083
  }) {
2003
2084
  const radio_name = $9HbP8$make_random_classname();
2004
2085
  const existing_filter = $9HbP8$createMemo(() => {
@@ -2020,6 +2101,12 @@ function $eb8d9bf3b5700c26$export$430444115f70a734({
2020
2101
  children: (value, index) => {
2021
2102
  const random_selector = $9HbP8$make_random_classname();
2022
2103
  const count = $9HbP8$createMemo(() => filter_().meta.counts?.[index]);
2104
+ const label = $9HbP8$createMemo(() => {
2105
+ const name = filter_().meta?.names?.[index];
2106
+ if (name) return name;
2107
+ const v = value();
2108
+ return Array.isArray(v) ? v.join(" - ") : v + "";
2109
+ });
2023
2110
  return (() => {
2024
2111
  const _el$2 = $9HbP8$getNextElement($eb8d9bf3b5700c26$var$_tmpl$3),
2025
2112
  _el$3 = _el$2.firstChild,
@@ -2044,11 +2131,9 @@ function $eb8d9bf3b5700c26$export$430444115f70a734({
2044
2131
  }));
2045
2132
  $9HbP8$setAttribute(_el$4, "id", random_selector);
2046
2133
  $9HbP8$setAttribute(_el$4, "name", radio_name);
2047
- $9HbP8$insert(_el$3, $9HbP8$createMemo(() => {
2048
- const name = filter_().meta?.names?.[index];
2049
- if (name) return name;
2050
- const v = value();
2051
- return Array.isArray(v) ? v.join(" - ") : v;
2134
+ $9HbP8$insert(_el$3, $9HbP8$createComponent((0, $f3213c0640246d58$export$ba17c5b7e6dda39f), {
2135
+ whole_text_to_display_: label,
2136
+ searching_for_value_: () => filter_query_?.()
2052
2137
  }), _el$7, _co$);
2053
2138
  $9HbP8$insert(_el$2, $9HbP8$createComponent((0, $9HbP8$Show), {
2054
2139
  get when() {
@@ -2080,7 +2165,8 @@ const $a6b08770e164eced$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<div class=ra
2080
2165
  function $a6b08770e164eced$export$e0d834a0ad870cda({
2081
2166
  filter_: filter_,
2082
2167
  selected_filters_: selected_filters_,
2083
- i18n_: i18n_
2168
+ i18n_: i18n_,
2169
+ filter_query_: filter_query_
2084
2170
  }) {
2085
2171
  // If you ever attempt to implement that one can drag one range "knob" over the other like on prisjakt, see https://gitlab.com/depict-ai/depict.ai/-/merge_requests/8458/diffs?commit_id=c52dbdd15ca073489bee138b15d27bb6bf2992df
2086
2172
  // The issue with it is that one wants to discard the changes to the lower value as soon as the lower value has become the upper value when dragging the initially lower knob over the initially upper knob
@@ -2459,141 +2545,410 @@ function $0b6bc2f8309efa8a$export$e5c2828934226505({
2459
2545
  });
2460
2546
  return outer_div;
2461
2547
  }
2462
- const $1c8cac76cb67e9af$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<form class="checkboxes hierarchical"><!$><!/><!$><!/>`),
2463
- $1c8cac76cb67e9af$var$_tmpl$2 = /*#__PURE__*/$9HbP8$template(`<div class=checkbox-details><!$><!/><!$><!/>`),
2464
- $1c8cac76cb67e9af$var$_tmpl$3 = /*#__PURE__*/$9HbP8$template(`<details>`),
2465
- $1c8cac76cb67e9af$var$_tmpl$4 = /*#__PURE__*/$9HbP8$template(`<summary class=category-parent><div class=summary><span class=count></span><!$><!/>`);
2466
- const $1c8cac76cb67e9af$var$max_visible_without_collapsing = 15;
2467
- const $1c8cac76cb67e9af$var$show_non_collapsible_when_collapsed = 4;
2468
- function $1c8cac76cb67e9af$export$a32086fa6616eafd({
2469
- filter_: filter_,
2470
- selected_filters_: selected_filters_,
2471
- i18n_: i18n_,
2472
- view_more_button_below_group_: view_more_button_below_group_,
2473
- expanded_hierarchical_filters_: expanded_hierarchical_filters_
2548
+ const $522a690e0e2bd46d$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<span class=highlighted-part>`);
2549
+ const $522a690e0e2bd46d$var$dont_cut_in_between_less_than_characters = 30;
2550
+ function $522a690e0e2bd46d$export$e1a98a189fd2c0e7({
2551
+ content_result_: content_result_,
2552
+ key_: key_,
2553
+ cut_when_possible_: cut_when_possible_
2474
2554
  }) {
2475
- let form;
2476
- const existing_filter = $9HbP8$createMemo(() => {
2477
- const {
2478
- field: field,
2479
- op: op
2480
- } = filter_();
2481
- return selected_filters_[0]().find(({
2482
- field: checking_field,
2483
- op: checking_op
2484
- }) => checking_field === field && checking_op === op);
2485
- });
2486
- const show_extras = $9HbP8$createSignal(false);
2487
- const trigger_sync_ = $1c8cac76cb67e9af$var$batching_filter_state_syncer({
2488
- filter_: filter_,
2489
- existing_filter_: existing_filter,
2490
- selected_filters_: selected_filters_,
2491
- get category_structure_() {
2492
- return structured_categories();
2493
- }
2494
- });
2495
- const structured_categories = $9HbP8$createMemo(() => {
2496
- const execute_when_structure_finished = [];
2497
- const {
2498
- values: values,
2499
- names: names,
2500
- counts: counts
2501
- } = filter_().meta;
2502
- const data_structure = {};
2503
- for (let i = 0; i < values.length; i++) {
2504
- const value = values[i];
2505
- let pointer = data_structure;
2506
- let parent_ = {};
2507
- let created_an_object = false;
2508
- for (let j = 0; j < value.length; j++) {
2509
- const this_categories_name = value[j];
2510
- const obj = pointer[this_categories_name] ||= (() => {
2511
- const value_as_string = value.map(v => typeof v === "number" ? v + "" : v); // don't think backend will ever send numbers but technically it's allowed;
2512
- const created_obj = {
2513
- name_: names[i],
2514
- count_: counts?.[i],
2515
- parent_: parent_,
2516
- is_expanded_: $1c8cac76cb67e9af$var$make_expanded_signal({
2517
- expanded_hierarchical_filters_: expanded_hierarchical_filters_,
2518
- filter_value_: value_as_string
2519
- }),
2520
- value_: value_as_string,
2521
- children_: {}
2522
- };
2523
- const {
2524
- signal_: signal_,
2525
- on_structure_complete_: on_structure_complete_
2526
- } = $1c8cac76cb67e9af$var$create_updating_signal({
2527
- self_: created_obj,
2528
- existing_filter_: $9HbP8$untrack(existing_filter),
2529
- trigger_sync_: trigger_sync_
2530
- });
2531
- execute_when_structure_finished.push(on_structure_complete_);
2532
- created_obj.is_checked_ = signal_;
2533
- parent_ = created_obj;
2534
- created_an_object = true;
2535
- return created_obj;
2536
- })();
2537
- pointer = obj.children_;
2538
- parent_ = obj;
2539
- }
2540
- if (!created_an_object && "value_" in parent_) {
2541
- // if an object was created for our "depth" in the hierarchy but not for our specific entry this means that the entry array was unsorted and looked something like
2542
- // [
2543
- // ["Öl", "IPA"],
2544
- // ["Öl", "Pale Ale"],
2545
- // ["Öl", "Ale"],
2546
- // ["Öl", "Mörk Lager"],
2547
- // ["Öl", "Suröl"],
2548
- // ["Öl", "Veteöl"],
2549
- // ["Öl", "Stout och Porter"],
2550
- // ["Öl"], // <- We are here, our `hierarchical_data_structure[string]`-object was created when we iterated over ["Öl", "IPA"]
2551
- // ["Öl", "Ljus Lager"],
2552
- // ];
2553
- // In this case we want to just correct the name and value of the already created object, which will be in parent_
2554
- parent_.value_ = value.map(v => v + "");
2555
- parent_.name_ = names[i];
2556
- parent_.count_ = counts[i];
2557
- parent_.is_expanded_ = $1c8cac76cb67e9af$var$make_expanded_signal({
2558
- expanded_hierarchical_filters_: expanded_hierarchical_filters_,
2559
- filter_value_: parent_.value_
2560
- });
2561
- }
2562
- }
2563
- while (execute_when_structure_finished.length) execute_when_structure_finished.pop()();
2564
- $1c8cac76cb67e9af$var$expand_until_choice(data_structure);
2565
- $9HbP8$dlog("CheckboxHierarchicalFilter: Recomputed structured_categories", data_structure);
2566
- return data_structure;
2567
- });
2568
- const some_top_level_are_hidden = $9HbP8$createMemo(() => Object.keys(structured_categories()).length > $1c8cac76cb67e9af$var$max_visible_without_collapsing);
2569
- const {
2570
- expand: expand,
2571
- collapse: collapse,
2572
- ExpandingContainer: ExpandingContainer
2573
- } = $24e27fab9c821b86$export$5bad61ecde080b1f({
2574
- duration: 200
2575
- });
2576
- const expanding_container_els = $9HbP8$createComponent(ExpandingContainer, {
2555
+ const matched_tokens = $9HbP8$createMemo(() => content_result_().highlights?.find(highlight => highlight.field == key_)?.matched_tokens);
2556
+ const full_value = $9HbP8$createMemo(() => content_result_()[key_]?.replaceAll("\n", " "));
2557
+ return $9HbP8$createComponent((0, $9HbP8$Show), {
2558
+ get when() {
2559
+ return matched_tokens()?.length;
2560
+ },
2561
+ get fallback() {
2562
+ return full_value();
2563
+ },
2577
2564
  get children() {
2578
- return $9HbP8$createComponent((0, $9HbP8$Show), {
2579
- get when() {
2580
- return some_top_level_are_hidden();
2581
- },
2582
- get children() {
2583
- return $1c8cac76cb67e9af$var$render_stuff($9HbP8$createMemo(() => Object.fromEntries(Object.entries(structured_categories()).slice($1c8cac76cb67e9af$var$show_non_collapsible_when_collapsed))), existing_filter, i18n_);
2584
- }
2585
- });
2565
+ return (() => {
2566
+ const segmented_cut_text = $9HbP8$createMemo(() => {
2567
+ const segmented_text = $522a690e0e2bd46d$export$1b00d74faf266c56(full_value(), matched_tokens());
2568
+ if (cut_when_possible_) $522a690e0e2bd46d$var$cut_text(segmented_text);
2569
+ return segmented_text;
2570
+ });
2571
+ return $9HbP8$createComponent((0, $9HbP8$Index), {
2572
+ get each() {
2573
+ return segmented_cut_text();
2574
+ },
2575
+ children: item => {
2576
+ return $9HbP8$createComponent((0, $9HbP8$Show), {
2577
+ get when() {
2578
+ return item().highlighted_;
2579
+ },
2580
+ get fallback() {
2581
+ return item().text_;
2582
+ },
2583
+ get children() {
2584
+ const _el$ = $9HbP8$getNextElement($522a690e0e2bd46d$var$_tmpl$);
2585
+ $9HbP8$insert(_el$, () => item().text_);
2586
+ return _el$;
2587
+ }
2588
+ });
2589
+ }
2590
+ });
2591
+ })();
2586
2592
  }
2587
2593
  });
2588
- $9HbP8$createRenderEffect(() => {
2589
- view_more_button_below_group_[1](some_top_level_are_hidden() ? $9HbP8$createComponent((0, $67b173f9db427028$export$ca21a16d65b3dd8), {
2590
- show_extras_: show_extras,
2591
- i18n_: i18n_
2592
- }) : []);
2593
- });
2594
- $9HbP8$createEffect($9HbP8$catchify(async () => {
2595
- if (!some_top_level_are_hidden()) {
2596
- await collapse();
2594
+ }
2595
+ function $522a690e0e2bd46d$var$cut_text(segmented_text) {
2596
+ // cut away chunks of text that are not highlighted to give a google-like overview of the content
2597
+ const highlighted_segments = segmented_text?.filter(segment => segment.highlighted_);
2598
+ if (!segmented_text || !highlighted_segments?.length) return;
2599
+ // We have one or more highlighted segments
2600
+ if (highlighted_segments.length === 1) {
2601
+ // cut away from the left until the start of the highlighted sentence if just one sentence is highlighted
2602
+ $522a690e0e2bd46d$var$cut_start(segmented_text.indexOf(highlighted_segments[0]), segmented_text);
2603
+ return;
2604
+ }
2605
+ // We have two or more highlighted segments, take the two biggest chunks and show them + a bit text around
2606
+ const sorted_highlighted_segments = [...highlighted_segments].sort((a, b) => b.text_.trim().length - a.text_.trim().length // trim to avoid unfair comparisons due to whitespace
2607
+ );
2608
+
2609
+ const [longest_segment, next_longest_segment] = sorted_highlighted_segments;
2610
+ // We need to cut before the first segment - possibly through other segments - and maybe between segments
2611
+ let [index_of_first_segment, index_of_second_segment] = [segmented_text.indexOf(longest_segment), segmented_text.indexOf(next_longest_segment)].sort((a, b) => a - b);
2612
+ $522a690e0e2bd46d$var$cut_start(index_of_first_segment, segmented_text);
2613
+ // update indexes since we might have removed segments
2614
+ [index_of_first_segment, index_of_second_segment] = [segmented_text.indexOf(longest_segment), segmented_text.indexOf(next_longest_segment)].sort((a, b) => a - b);
2615
+ let number_of_characters_between_segments = 0;
2616
+ for (let i = index_of_first_segment + 1; i < index_of_second_segment; i++) {
2617
+ const segment = segmented_text[i];
2618
+ number_of_characters_between_segments += segment.text_.length;
2619
+ }
2620
+ if (number_of_characters_between_segments < $522a690e0e2bd46d$var$dont_cut_in_between_less_than_characters)
2621
+ // don't cut if there are less than 30 characters between the two segments
2622
+ return;
2623
+ // We have more than 50 characters between the two segments, cut between them
2624
+ const [split_start_segment, split_start_character] = $522a690e0e2bd46d$var$find_split_point(index_of_first_segment, index_of_second_segment, segmented_text);
2625
+ const [split_end_segment, split_end_character] = $522a690e0e2bd46d$var$find_split_point(index_of_second_segment, index_of_first_segment, segmented_text);
2626
+ if (split_start_segment === undefined || split_end_segment === undefined ||
2627
+ // identical split point, or split end before split start, can't do anything
2628
+ split_start_segment == split_end_segment && split_start_character >= split_end_character || split_start_segment > split_end_segment) return;
2629
+ const dots_segment = {
2630
+ text_: " … ",
2631
+ highlighted_: false
2632
+ };
2633
+ const split_and_dotted_values = segmented_text.flatMap((segment, i) => {
2634
+ if (i < split_start_segment || i > split_end_segment) return segment;
2635
+ const text = segment.text_;
2636
+ if (i == split_end_segment && i == split_start_segment) return [{
2637
+ ...segment,
2638
+ text_: text.slice(0, split_start_character).trimEnd()
2639
+ }, dots_segment, {
2640
+ ...segment,
2641
+ text_: text.slice(split_end_character + 1, text.length).trimStart()
2642
+ }];else if (i == split_start_segment) {
2643
+ segment.text_ = text.slice(0, split_start_character).trimEnd(); // this would be split_start_character + 1, but we want to remove the last "dot" because . ... looks weird
2644
+ return segment;
2645
+ } else if (i == split_end_segment) return [dots_segment, {
2646
+ ...segment,
2647
+ text_: text.slice(split_end_character + 1, text.length).trimStart()
2648
+ }];
2649
+ return []; // remove all segments inbetween
2650
+ });
2651
+
2652
+ segmented_text.splice(0, segmented_text.length, ...split_and_dotted_values); // Sorry…
2653
+ $522a690e0e2bd46d$var$heal_holes(segmented_text);
2654
+ }
2655
+ function $522a690e0e2bd46d$var$heal_holes(segmented_text) {
2656
+ // try to heal "holes" created in the segments so there are only alternating segments
2657
+ const segments_to_delete = new Set();
2658
+ for (let i = 0; i < segmented_text.length; i++) {
2659
+ const segment = segmented_text[i];
2660
+ let previous_segment;
2661
+ for (let j = i - 1; j >= 0; j--) {
2662
+ previous_segment = segmented_text[j];
2663
+ // Don't write to a segment that's marked for deletion or the contents we write to it will be deleted
2664
+ if (!segments_to_delete.has(previous_segment)) break;
2665
+ }
2666
+ if (previous_segment?.highlighted_ && segment.highlighted_ || previous_segment?.highlighted_ === false && segment.highlighted_ === false) {
2667
+ previous_segment.text_ += segment.text_; // IDK if this ever happens
2668
+ segments_to_delete.add(segment);
2669
+ }
2670
+ }
2671
+ for (const segment of segments_to_delete) {
2672
+ const index = segmented_text.indexOf(segment);
2673
+ segmented_text.splice(index, 1);
2674
+ }
2675
+ }
2676
+ function $522a690e0e2bd46d$var$find_split_point(index_of_start_segment, index_of_end_segment, segmented_text, be_very_aggressive = true) {
2677
+ const should_loop_backwards = index_of_start_segment > index_of_end_segment;
2678
+ const step = should_loop_backwards ? -1 : 1;
2679
+ const desperate_split_attempts = [":", ";", ","];
2680
+ while (desperate_split_attempts.length) {
2681
+ const split_point_between_words = [];
2682
+ // for the middle also try to split with a few more characters if the default ones don't work over a full run
2683
+ const desperate_split_attempt = desperate_split_attempts.pop();
2684
+ let is_first_character = true;
2685
+ for (let i = index_of_start_segment + step; should_loop_backwards ? i > index_of_end_segment : i < index_of_end_segment; i += step) {
2686
+ const segment = segmented_text[i];
2687
+ const text = segment.text_;
2688
+ for (let j = should_loop_backwards ? text.length - 1 : 0; should_loop_backwards ? j >= 0 : j < text.length; j += step) {
2689
+ const character = text[j];
2690
+ if (character == "." || character == "?" || character == "!" || character == desperate_split_attempt) return [i, j]; // segment index, character index
2691
+ if (is_first_character) is_first_character = false;else if (be_very_aggressive && character == " ") {
2692
+ split_point_between_words.push([i, j]);
2693
+ if (split_point_between_words.length > 3)
2694
+ // We can't find a split point, so we'll just split between words
2695
+ // This is because for UI reasons we only want to show 2 lines of text, so we need to be very aggressive with getting the second match soon
2696
+ return split_point_between_words[1];
2697
+ }
2698
+ }
2699
+ }
2700
+ }
2701
+ return [];
2702
+ }
2703
+ function $522a690e0e2bd46d$var$cut_start(cut_left_of_index, segmented_text) {
2704
+ // Cut the start of the text to bring the first matching token
2705
+ let is_first_character = false;
2706
+ let words_encountered = 0;
2707
+ outmost_loop: for (let i = cut_left_of_index - 1; i >= 0; i--) {
2708
+ const segment = segmented_text[i];
2709
+ // We assume that two adjacent highlighted segments don't exist and have been merged if they were to have existed
2710
+ const text = segment.text_;
2711
+ for (let j = text.length - 1; j >= 0; j--) {
2712
+ const character = text[j];
2713
+ const is_space = character == " ";
2714
+ if (!is_first_character && is_space) words_encountered++;
2715
+ if (character == "." || character == "?" || character == "!" || character == "," || words_encountered > 8 && is_space) {
2716
+ // We have to be really aggressive at the start of sentences so stuff can be seen on mobile, hence comma
2717
+ segment.text_ = text.slice(j + 1).trimStart();
2718
+ segmented_text.splice(0, i);
2719
+ if (character === "," || is_space)
2720
+ // if we cut at a comma or psace, we add a … at the beginning
2721
+ segmented_text.unshift({
2722
+ text_: "… ",
2723
+ highlighted_: false
2724
+ });
2725
+ break outmost_loop;
2726
+ }
2727
+ if (is_first_character) is_first_character = false;
2728
+ }
2729
+ }
2730
+ $522a690e0e2bd46d$var$heal_holes(segmented_text); // if we added a ... there could now be a sequence that's not alternating true/false
2731
+ }
2732
+
2733
+ function $522a690e0e2bd46d$export$1b00d74faf266c56(text, matched_strings, loose = false) {
2734
+ const output = [];
2735
+ if (!text) return; // shouldn't happen but whatever
2736
+ for (let i = 0; i < text.length; i++) {
2737
+ const found_strings = [];
2738
+ if (!i || text[i - 1] == " " || loose)
2739
+ // only match at the start of a word or string, it looks weird if i.e. "we" is highlighted in "activewear
2740
+ for (let j = 0; j < matched_strings.length; j++) {
2741
+ const matched_string = matched_strings[j];
2742
+ const part_in_text = text.slice(i, i + matched_string.length);
2743
+ if (matched_string.length < 2 && !loose) continue; // don't match on single characters, i.e. "I", it looks weird
2744
+ if (part_in_text.toLowerCase() === matched_string.toLowerCase()) found_strings.push(part_in_text); // use the casing from the text, not from typesense, can look weird otherwise
2745
+ }
2746
+
2747
+ const last_index_in_output = output.length - 1;
2748
+ if (!found_strings.length) {
2749
+ const character = text[i];
2750
+ if (output[last_index_in_output]?.highlighted_ === false || output.length && /\s/.test(character))
2751
+ // always push whitespace characters to the last segment, this is because typesense doesn't see them as part of the matched tokens but we want to be able to detect "phat" matched segments
2752
+ output[last_index_in_output].text_ += character;else output.push({
2753
+ highlighted_: false,
2754
+ text_: character
2755
+ });
2756
+ } else {
2757
+ const longest_found_string = found_strings.reduce((a, b) => a.length > b.length ? a : b);
2758
+ if (output[last_index_in_output]?.highlighted_) output[last_index_in_output].text_ += longest_found_string;else output.push({
2759
+ highlighted_: true,
2760
+ text_: longest_found_string
2761
+ });
2762
+ i += longest_found_string.length - 1;
2763
+ }
2764
+ }
2765
+ return output;
2766
+ }
2767
+ const $3ec2b9489931358d$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<span>`),
2768
+ $3ec2b9489931358d$var$_tmpl$2 = /*#__PURE__*/$9HbP8$template(`<span class=highlighted-part>`);
2769
+ function $3ec2b9489931358d$export$8e79c28529dbfa90(props) {
2770
+ const segmented_text = $9HbP8$createMemo(() => {
2771
+ const {
2772
+ to_highlight_: to_highlight_,
2773
+ text_: text_
2774
+ } = props;
2775
+ return $522a690e0e2bd46d$export$1b00d74faf266c56(text_, to_highlight_ ? [to_highlight_] : [], true);
2776
+ });
2777
+ const has_highlights = $9HbP8$createMemo(() => segmented_text().some(segment => segment.highlighted_));
2778
+ return (() => {
2779
+ const _el$ = $9HbP8$getNextElement($3ec2b9489931358d$var$_tmpl$);
2780
+ $9HbP8$insert(_el$, $9HbP8$createComponent((0, $9HbP8$Index), {
2781
+ get each() {
2782
+ return segmented_text();
2783
+ },
2784
+ children: item => {
2785
+ return $9HbP8$createComponent((0, $9HbP8$Show), {
2786
+ get when() {
2787
+ return item().highlighted_;
2788
+ },
2789
+ get fallback() {
2790
+ return item().text_;
2791
+ },
2792
+ get children() {
2793
+ const _el$2 = $9HbP8$getNextElement($3ec2b9489931358d$var$_tmpl$2);
2794
+ $9HbP8$insert(_el$2, () => item().text_);
2795
+ return _el$2;
2796
+ }
2797
+ });
2798
+ }
2799
+ }));
2800
+ $9HbP8$effect(_p$ => {
2801
+ const _v$ = props.text_,
2802
+ _v$2 = !!has_highlights();
2803
+ _v$ !== _p$._v$ && $9HbP8$setAttribute(_el$, "title", _p$._v$ = _v$);
2804
+ _v$2 !== _p$._v$2 && _el$.classList.toggle("has-match", _p$._v$2 = _v$2);
2805
+ return _p$;
2806
+ }, {
2807
+ _v$: undefined,
2808
+ _v$2: undefined
2809
+ });
2810
+ return _el$;
2811
+ })();
2812
+ }
2813
+ const $1c8cac76cb67e9af$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<form class="checkboxes hierarchical"><!$><!/><!$><!/>`),
2814
+ $1c8cac76cb67e9af$var$_tmpl$2 = /*#__PURE__*/$9HbP8$template(`<div class=checkbox-details><!$><!/><!$><!/>`),
2815
+ $1c8cac76cb67e9af$var$_tmpl$3 = /*#__PURE__*/$9HbP8$template(`<details>`),
2816
+ $1c8cac76cb67e9af$var$_tmpl$4 = /*#__PURE__*/$9HbP8$template(`<summary class=category-parent><div class=summary><span class=count></span><!$><!/>`);
2817
+ const $1c8cac76cb67e9af$var$max_visible_without_collapsing = 15;
2818
+ const $1c8cac76cb67e9af$var$show_non_collapsible_when_collapsed = 4;
2819
+ function $1c8cac76cb67e9af$export$a32086fa6616eafd({
2820
+ filter_: filter_,
2821
+ selected_filters_: selected_filters_,
2822
+ i18n_: i18n_,
2823
+ view_more_button_below_group_: view_more_button_below_group_,
2824
+ expanded_hierarchical_filters_: expanded_hierarchical_filters_,
2825
+ filter_query_: filter_query_
2826
+ }) {
2827
+ let form;
2828
+ const existing_filter = $9HbP8$createMemo(() => {
2829
+ const {
2830
+ field: field,
2831
+ op: op
2832
+ } = filter_();
2833
+ return selected_filters_[0]().find(({
2834
+ field: checking_field,
2835
+ op: checking_op
2836
+ }) => checking_field === field && checking_op === op);
2837
+ });
2838
+ const show_extras = $9HbP8$createSignal(false);
2839
+ const is_being_searched_ = $9HbP8$createMemo(() => !!filter_query_?.()); // If the user is searching in the filter
2840
+ const trigger_sync_ = $1c8cac76cb67e9af$var$batching_filter_state_syncer({
2841
+ filter_: filter_,
2842
+ existing_filter_: existing_filter,
2843
+ selected_filters_: selected_filters_,
2844
+ get category_structure_() {
2845
+ return structured_categories();
2846
+ }
2847
+ });
2848
+ const structured_categories = $9HbP8$createMemo(() => {
2849
+ const execute_when_structure_finished = [];
2850
+ const {
2851
+ values: values,
2852
+ names: names,
2853
+ counts: counts
2854
+ } = filter_().meta;
2855
+ const data_structure = {};
2856
+ for (let i = 0; i < values.length; i++) {
2857
+ const value = values[i];
2858
+ let pointer = data_structure;
2859
+ let parent_ = {};
2860
+ let created_an_object = false;
2861
+ for (let j = 0; j < value.length; j++) {
2862
+ const this_categories_name = value[j];
2863
+ const obj = pointer[this_categories_name] ||= (() => {
2864
+ const value_as_string = value.map(v => typeof v === "number" ? v + "" : v); // don't think backend will ever send numbers but technically it's allowed;
2865
+ const created_obj = {
2866
+ name_: names[i],
2867
+ count_: counts?.[i],
2868
+ parent_: parent_,
2869
+ is_expanded_: $1c8cac76cb67e9af$var$make_expanded_signal({
2870
+ expanded_hierarchical_filters_: expanded_hierarchical_filters_,
2871
+ filter_value_: value_as_string,
2872
+ is_being_searched_: is_being_searched_
2873
+ }),
2874
+ value_: value_as_string,
2875
+ children_: {}
2876
+ };
2877
+ const {
2878
+ signal_: signal_,
2879
+ on_structure_complete_: on_structure_complete_
2880
+ } = $1c8cac76cb67e9af$var$create_updating_signal({
2881
+ self_: created_obj,
2882
+ existing_filter_: $9HbP8$untrack(existing_filter),
2883
+ trigger_sync_: trigger_sync_
2884
+ });
2885
+ execute_when_structure_finished.push(on_structure_complete_);
2886
+ created_obj.is_checked_ = signal_;
2887
+ parent_ = created_obj;
2888
+ created_an_object = true;
2889
+ return created_obj;
2890
+ })();
2891
+ pointer = obj.children_;
2892
+ parent_ = obj;
2893
+ }
2894
+ if (!created_an_object && "value_" in parent_) {
2895
+ // if an object was created for our "depth" in the hierarchy but not for our specific entry this means that the entry array was unsorted and looked something like
2896
+ // [
2897
+ // ["Öl", "IPA"],
2898
+ // ["Öl", "Pale Ale"],
2899
+ // ["Öl", "Ale"],
2900
+ // ["Öl", "Mörk Lager"],
2901
+ // ["Öl", "Suröl"],
2902
+ // ["Öl", "Veteöl"],
2903
+ // ["Öl", "Stout och Porter"],
2904
+ // ["Öl"], // <- We are here, our `hierarchical_data_structure[string]`-object was created when we iterated over ["Öl", "IPA"]
2905
+ // ["Öl", "Ljus Lager"],
2906
+ // ];
2907
+ // In this case we want to just correct the name and value of the already created object, which will be in parent_
2908
+ parent_.value_ = value.map(v => v + "");
2909
+ parent_.name_ = names[i];
2910
+ parent_.count_ = counts[i];
2911
+ parent_.is_expanded_ = $1c8cac76cb67e9af$var$make_expanded_signal({
2912
+ expanded_hierarchical_filters_: expanded_hierarchical_filters_,
2913
+ filter_value_: parent_.value_,
2914
+ is_being_searched_: is_being_searched_
2915
+ });
2916
+ }
2917
+ }
2918
+ while (execute_when_structure_finished.length) execute_when_structure_finished.pop()();
2919
+ $1c8cac76cb67e9af$var$expand_until_choice(data_structure);
2920
+ $9HbP8$dlog("CheckboxHierarchicalFilter: Recomputed structured_categories", data_structure);
2921
+ return data_structure;
2922
+ });
2923
+ const some_top_level_are_hidden = $9HbP8$createMemo(() => Object.keys(structured_categories()).length > $1c8cac76cb67e9af$var$max_visible_without_collapsing);
2924
+ const {
2925
+ expand: expand,
2926
+ collapse: collapse,
2927
+ ExpandingContainer: ExpandingContainer
2928
+ } = $24e27fab9c821b86$export$5bad61ecde080b1f({
2929
+ duration: 200
2930
+ });
2931
+ const expanding_container_els = $9HbP8$createComponent(ExpandingContainer, {
2932
+ get children() {
2933
+ return $9HbP8$createComponent((0, $9HbP8$Show), {
2934
+ get when() {
2935
+ return some_top_level_are_hidden();
2936
+ },
2937
+ get children() {
2938
+ return $1c8cac76cb67e9af$var$render_stuff($9HbP8$createMemo(() => Object.fromEntries(Object.entries(structured_categories()).slice($1c8cac76cb67e9af$var$show_non_collapsible_when_collapsed))), existing_filter, i18n_, filter_query_);
2939
+ }
2940
+ });
2941
+ }
2942
+ });
2943
+ $9HbP8$createRenderEffect(() => {
2944
+ view_more_button_below_group_[1](some_top_level_are_hidden() ? $9HbP8$createComponent((0, $67b173f9db427028$export$ca21a16d65b3dd8), {
2945
+ show_extras_: show_extras,
2946
+ i18n_: i18n_
2947
+ }) : []);
2948
+ });
2949
+ $9HbP8$createEffect($9HbP8$catchify(async () => {
2950
+ if (!some_top_level_are_hidden()) {
2951
+ await collapse();
2597
2952
  return;
2598
2953
  }
2599
2954
  if (show_extras[0]()) await expand();else await collapse();
@@ -2606,13 +2961,13 @@ function $1c8cac76cb67e9af$export$a32086fa6616eafd({
2606
2961
  [_el$5, _co$2] = $9HbP8$getNextMarker(_el$4.nextSibling);
2607
2962
  const _ref$ = form;
2608
2963
  typeof _ref$ === "function" ? $9HbP8$use(_ref$, _el$) : form = _el$;
2609
- $9HbP8$insert(_el$, () => $1c8cac76cb67e9af$var$render_stuff($9HbP8$createMemo(() => some_top_level_are_hidden() ? Object.fromEntries(Object.entries(structured_categories()).slice(0, $1c8cac76cb67e9af$var$show_non_collapsible_when_collapsed)) : structured_categories()), existing_filter, i18n_), _el$3, _co$);
2964
+ $9HbP8$insert(_el$, () => $1c8cac76cb67e9af$var$render_stuff($9HbP8$createMemo(() => some_top_level_are_hidden() ? Object.fromEntries(Object.entries(structured_categories()).slice(0, $1c8cac76cb67e9af$var$show_non_collapsible_when_collapsed)) : structured_categories()), existing_filter, i18n_, filter_query_), _el$3, _co$);
2610
2965
  $9HbP8$insert(_el$, expanding_container_els, _el$5, _co$2);
2611
2966
  $9HbP8$effect(() => _el$.classList.toggle("any-expandable", !!Object.values(structured_categories()).some(category => Object.keys(category.children_).length)));
2612
2967
  return _el$;
2613
2968
  })();
2614
2969
  }
2615
- function $1c8cac76cb67e9af$var$render_stuff(data, existing_filter, i18n_) {
2970
+ function $1c8cac76cb67e9af$var$render_stuff(data, existing_filter, i18n_, filter_query_) {
2616
2971
  const keys = $9HbP8$createMemo(() => Object.keys(data()));
2617
2972
  return $9HbP8$createComponent((0, $9HbP8$For), {
2618
2973
  get each() {
@@ -2627,6 +2982,8 @@ function $1c8cac76cb67e9af$var$render_stuff(data, existing_filter, i18n_) {
2627
2982
  // for some reason the for thing doesn't dispose of us if the key no longer exists?? so I'm doing it with show instead
2628
2983
  const value = $9HbP8$createMemo(() => data()[key]); // still sometimes get undefined here even though we have <Show>
2629
2984
  const has_expandable = $9HbP8$createMemo(() => !!Object.keys(value()?.children_ || {}).length);
2985
+ const value_as_string = $9HbP8$createMemo(() => JSON.stringify(value()?.value_));
2986
+ const label_text = $9HbP8$createMemo(() => value()?.name_ || value_as_string());
2630
2987
  return (() => {
2631
2988
  const _el$6 = $9HbP8$getNextElement($1c8cac76cb67e9af$var$_tmpl$2),
2632
2989
  _el$7 = _el$6.firstChild,
@@ -2635,10 +2992,17 @@ function $1c8cac76cb67e9af$var$render_stuff(data, existing_filter, i18n_) {
2635
2992
  [_el$10, _co$4] = $9HbP8$getNextMarker(_el$9.nextSibling);
2636
2993
  $9HbP8$insert(_el$6, $9HbP8$createComponent((0, $49b79728e7d9e2a1$export$48513f6b9f8ce62d), {
2637
2994
  get value_() {
2638
- return JSON.stringify(value()?.value_);
2995
+ return value_as_string();
2639
2996
  },
2640
2997
  get label_() {
2641
- return value()?.name_;
2998
+ return $9HbP8$createComponent((0, $3ec2b9489931358d$export$8e79c28529dbfa90), {
2999
+ get text_() {
3000
+ return label_text();
3001
+ },
3002
+ get to_highlight_() {
3003
+ return filter_query_?.();
3004
+ }
3005
+ });
2642
3006
  },
2643
3007
  get count_() {
2644
3008
  return $9HbP8$memo(() => !!has_expandable())() ? undefined : value()?.count_;
@@ -2718,7 +3082,7 @@ function $1c8cac76cb67e9af$var$render_stuff(data, existing_filter, i18n_) {
2718
3082
  return is_open();
2719
3083
  },
2720
3084
  get children() {
2721
- return $1c8cac76cb67e9af$var$render_stuff($9HbP8$createMemo(() => value()?.children_ || {}), existing_filter, i18n_);
3085
+ return $1c8cac76cb67e9af$var$render_stuff($9HbP8$createMemo(() => value()?.children_ || {}), existing_filter, i18n_, filter_query_);
2722
3086
  }
2723
3087
  });
2724
3088
  })();
@@ -2829,7 +3193,8 @@ function $1c8cac76cb67e9af$var$create_updating_signal({
2829
3193
  }
2830
3194
  function $1c8cac76cb67e9af$var$make_expanded_signal({
2831
3195
  expanded_hierarchical_filters_: [read_expanded_hierarchical_filters, write_expanded_hierarchical_filters],
2832
- filter_value_: filter_value_
3196
+ filter_value_: filter_value_,
3197
+ is_being_searched_: is_being_searched_
2833
3198
  }) {
2834
3199
  const index_in_expanded_filters = $9HbP8$createMemo(() => read_expanded_hierarchical_filters().findIndex(({
2835
3200
  value_: value_
@@ -2868,7 +3233,9 @@ function $1c8cac76cb67e9af$var$make_expanded_signal({
2868
3233
  defer: true
2869
3234
  }));
2870
3235
  return {
2871
- ui_should_show_expanded_: $9HbP8$createMemo(() => user_choice_signal[0]() ?? get_low_precedence_expanded()),
3236
+ ui_should_show_expanded_: $9HbP8$createMemo(
3237
+ // When user is searching through filters, expand everything they haven't collapsed, so they can see the results
3238
+ () => user_choice_signal[0]() ?? (is_being_searched_() || get_low_precedence_expanded())),
2872
3239
  set_low_precedence_expanded_: set_low_precedence_expanded,
2873
3240
  set_user_expanded_: set_user_choice_expanded
2874
3241
  };
@@ -2897,7 +3264,9 @@ const $93716a9ad0dea854$var$gap_px = 5;
2897
3264
  const $93716a9ad0dea854$var$max_columns = 3;
2898
3265
  const $93716a9ad0dea854$export$414f6a19d38e655c = ({
2899
3266
  filter_: filter_,
2900
- selected_filters_: [get_selected_filters, set_selected_filters]
3267
+ selected_filters_: [get_selected_filters, set_selected_filters],
3268
+ filter_query_: filter_query_,
3269
+ details_element_width_: details_element_width_
2901
3270
  }) => {
2902
3271
  const existing_filter = $9HbP8$createMemo(() => {
2903
3272
  const {
@@ -2925,7 +3294,7 @@ const $93716a9ad0dea854$export$414f6a19d38e655c = ({
2925
3294
  const container_width_accessor = $9HbP8$createMemo(() => {
2926
3295
  const element = container();
2927
3296
  if (!element) return;
2928
- return $0fdb37d8ddabef25$export$9f191182275e9ef(element);
3297
+ return $2449872a62a75a20$export$ebdc3711f7e02ccd(element);
2929
3298
  });
2930
3299
  const [shadow_children, set_shadow_children] = $9HbP8$createSignal(new Set(), {
2931
3300
  equals: false
@@ -2936,11 +3305,11 @@ const $93716a9ad0dea854$export$414f6a19d38e655c = ({
2936
3305
  return _el$;
2937
3306
  })(); // for getting the smallest possible sizes of all the items
2938
3307
  $9HbP8$createEffect(() => {
2939
- const container_width = container_width_accessor()?.();
2940
- if (container_width == undefined) return;
3308
+ const container_width = container_width_accessor()?.() || details_element_width_();
3309
+ if (container_width === undefined) return; // On firefox, unexpanded <details> elements' contents dont't have a width, fall back to the width of the details element itself to not have janky expanding animations due to wrong number of columns at point of expanding
2941
3310
  $93716a9ad0dea854$var$adjust_sizes(container_width, sizes_set(), set_cols_at_size);
2942
3311
  });
2943
- return [shadow_grid, $9HbP8$createComponent((0, $c8d5ff4524619fcd$export$d21e32dfedac04be), {
3312
+ return [$9HbP8$createComponent((0, $c8d5ff4524619fcd$export$d21e32dfedac04be), {
2944
3313
  get cols_at_size() {
2945
3314
  return cols_at_size();
2946
3315
  },
@@ -2962,66 +3331,72 @@ const $93716a9ad0dea854$export$414f6a19d38e655c = ({
2962
3331
  const current_value = $91aa8ee9f431800d$export$325f75597868c4f0(value().value_);
2963
3332
  return !!data?.some(item => $91aa8ee9f431800d$export$325f75597868c4f0(item) === current_value);
2964
3333
  });
2965
- const MakeButton = attributes => (() => {
2966
- const _el$2 = $9HbP8$getNextElement($93716a9ad0dea854$var$_tmpl$3),
2967
- _el$5 = _el$2.firstChild,
2968
- [_el$6, _co$] = $9HbP8$getNextMarker(_el$5.nextSibling),
2969
- _el$7 = _el$6.nextSibling,
2970
- [_el$8, _co$2] = $9HbP8$getNextMarker(_el$7.nextSibling);
2971
- $9HbP8$spread(_el$2, $9HbP8$mergeProps1(attributes, {
2972
- get disabled() {
2973
- return $9HbP8$memo(() => value().count_ === 0)() && !is_selected();
2974
- },
2975
- get classList() {
2976
- return {
2977
- minor: !is_selected(),
2978
- major: is_selected(),
2979
- "major-minor-transition": true
2980
- };
2981
- },
2982
- get onClick() {
2983
- return $9HbP8$catchify(() => {
2984
- const set_filter = existing_filter();
2985
- const {
2986
- field: field,
2987
- op: op
2988
- } = filter_();
2989
- const base_object = set_filter ? set_filter : {
2990
- op: op,
2991
- field: field
2992
- };
2993
- const old_data = base_object.data;
2994
- const new_data = [...(Array.isArray(old_data) ? [...old_data] : old_data ? [old_data] : [])];
2995
- const new_filter_object = {
2996
- ...base_object,
2997
- data: new_data
3334
+ const MakeButton = attributes => {
3335
+ const label = $9HbP8$createMemo(() => value().name_ || value().value_ + "");
3336
+ return (() => {
3337
+ const _el$2 = $9HbP8$getNextElement($93716a9ad0dea854$var$_tmpl$3),
3338
+ _el$5 = _el$2.firstChild,
3339
+ [_el$6, _co$] = $9HbP8$getNextMarker(_el$5.nextSibling),
3340
+ _el$7 = _el$6.nextSibling,
3341
+ [_el$8, _co$2] = $9HbP8$getNextMarker(_el$7.nextSibling);
3342
+ $9HbP8$spread(_el$2, $9HbP8$mergeProps1(attributes, {
3343
+ get disabled() {
3344
+ return $9HbP8$memo(() => value().count_ === 0)() && !is_selected();
3345
+ },
3346
+ get classList() {
3347
+ return {
3348
+ minor: !is_selected(),
3349
+ major: is_selected(),
3350
+ "major-minor-transition": true
2998
3351
  };
2999
- if (!is_selected()) new_filter_object.data.push(value().value_);else {
3000
- const current_value_lower = $91aa8ee9f431800d$export$325f75597868c4f0(value().value_);
3001
- new_filter_object.data = new_filter_object.data.filter(v => $91aa8ee9f431800d$export$325f75597868c4f0(v) !== current_value_lower);
3002
- }
3003
- const selected_filters = [...get_selected_filters().filter(f => f !== set_filter), ...(new_filter_object.data.length ? [new_filter_object] : [])];
3004
- set_selected_filters(selected_filters);
3005
- });
3006
- }
3007
- }), false, true);
3008
- $9HbP8$insert(_el$2, () => value().value_, _el$6, _co$);
3009
- $9HbP8$insert(_el$2, $9HbP8$createComponent((0, $9HbP8$Show), {
3010
- get when() {
3011
- return value().count_ != undefined;
3012
- },
3013
- get children() {
3014
- const _el$3 = $9HbP8$getNextElement($93716a9ad0dea854$var$_tmpl$2),
3015
- _el$4 = _el$3.firstChild;
3016
- $9HbP8$insert(_el$4, () => value().count_);
3017
- return _el$3;
3018
- }
3019
- }), _el$8, _co$2);
3020
- $9HbP8$runHydrationEvents();
3021
- return _el$2;
3022
- })();
3352
+ },
3353
+ get onClick() {
3354
+ return $9HbP8$catchify(() => {
3355
+ const set_filter = existing_filter();
3356
+ const {
3357
+ field: field,
3358
+ op: op
3359
+ } = filter_();
3360
+ const base_object = set_filter ? set_filter : {
3361
+ op: op,
3362
+ field: field
3363
+ };
3364
+ const old_data = base_object.data;
3365
+ const new_data = [...(Array.isArray(old_data) ? [...old_data] : old_data ? [old_data] : [])];
3366
+ const new_filter_object = {
3367
+ ...base_object,
3368
+ data: new_data
3369
+ };
3370
+ if (!is_selected()) new_filter_object.data.push(value().value_);else {
3371
+ const current_value_lower = $91aa8ee9f431800d$export$325f75597868c4f0(value().value_);
3372
+ new_filter_object.data = new_filter_object.data.filter(v => $91aa8ee9f431800d$export$325f75597868c4f0(v) !== current_value_lower);
3373
+ }
3374
+ const selected_filters = [...get_selected_filters().filter(f => f !== set_filter), ...(new_filter_object.data.length ? [new_filter_object] : [])];
3375
+ set_selected_filters(selected_filters);
3376
+ });
3377
+ }
3378
+ }), false, true);
3379
+ $9HbP8$insert(_el$2, $9HbP8$createComponent((0, $f3213c0640246d58$export$ba17c5b7e6dda39f), {
3380
+ whole_text_to_display_: label,
3381
+ searching_for_value_: () => filter_query_?.()
3382
+ }), _el$6, _co$);
3383
+ $9HbP8$insert(_el$2, $9HbP8$createComponent((0, $9HbP8$Show), {
3384
+ get when() {
3385
+ return value().count_ != undefined;
3386
+ },
3387
+ get children() {
3388
+ const _el$3 = $9HbP8$getNextElement($93716a9ad0dea854$var$_tmpl$2),
3389
+ _el$4 = _el$3.firstChild;
3390
+ $9HbP8$insert(_el$4, () => value().count_);
3391
+ return _el$3;
3392
+ }
3393
+ }), _el$8, _co$2);
3394
+ $9HbP8$runHydrationEvents();
3395
+ return _el$2;
3396
+ })();
3397
+ };
3023
3398
  const invisible_size_button = $9HbP8$createComponent(MakeButton, {});
3024
- const smallest_possible_size = $0fdb37d8ddabef25$export$9f191182275e9ef(invisible_size_button); // create ResizeObserver for the invisible size button where the div hugs its content
3399
+ const smallest_possible_size = $2449872a62a75a20$export$ebdc3711f7e02ccd(invisible_size_button); // create ResizeObserver for the invisible size button where the div hugs its content
3025
3400
  const sizes_value = $9HbP8$untrack(sizes_set);
3026
3401
  const shadow_children_value = $9HbP8$untrack(shadow_children);
3027
3402
  sizes_value.add(smallest_possible_size);
@@ -3041,7 +3416,7 @@ const $93716a9ad0dea854$export$414f6a19d38e655c = ({
3041
3416
  }
3042
3417
  });
3043
3418
  }
3044
- })];
3419
+ }), shadow_grid];
3045
3420
  };
3046
3421
  /**
3047
3422
  * Calculate and apply cols_at_size overrides to fit as many items as possible in a row, evenly spaced
@@ -3107,7 +3482,8 @@ function $e731d52d97444b7c$export$82ed4b28ecb67608({
3107
3482
  filter_: filter_,
3108
3483
  selected_filters_: [get_selected_filters, set_selected_filters],
3109
3484
  i18n_: i18n_,
3110
- view_more_button_below_group_: [_get_view_more_button_below_group_, set_view_more_button_below_group_]
3485
+ view_more_button_below_group_: [_get_view_more_button_below_group_, set_view_more_button_below_group_],
3486
+ filter_query_: filter_query_
3111
3487
  }) {
3112
3488
  // same as in CheckboxFilter, maybe we should make this DRY at some point
3113
3489
  const existing_filter = $9HbP8$createMemo(() => {
@@ -3141,12 +3517,17 @@ function $e731d52d97444b7c$export$82ed4b28ecb67608({
3141
3517
  const value = $91aa8ee9f431800d$export$325f75597868c4f0(checkbox().value_);
3142
3518
  return !!data?.some(item => $91aa8ee9f431800d$export$325f75597868c4f0(item) === value);
3143
3519
  });
3520
+ const value = $9HbP8$createMemo(() => checkbox().value_);
3521
+ const label_text = $9HbP8$createMemo(() => checkbox().name_ || value() + "");
3144
3522
  const input_row = $9HbP8$createComponent((0, $49b79728e7d9e2a1$export$48513f6b9f8ce62d), {
3145
3523
  get value_() {
3146
- return checkbox().value_;
3524
+ return value();
3147
3525
  },
3148
3526
  get label_() {
3149
- return checkbox().name_;
3527
+ return $9HbP8$createComponent((0, $f3213c0640246d58$export$ba17c5b7e6dda39f), {
3528
+ whole_text_to_display_: label_text,
3529
+ searching_for_value_: () => filter_query_?.()
3530
+ });
3150
3531
  },
3151
3532
  get count_() {
3152
3533
  return checkbox().count_;
@@ -3449,10 +3830,165 @@ function $d134eae24341b4a1$export$89c6019e4baa40b1(props) {
3449
3830
  }
3450
3831
  });
3451
3832
  }
3833
+ const $16f0ed5ea30d8d9c$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<svg xmlns=http://www.w3.org/2000/svg width=20 height=22 viewBox="0 0 20 22"><path d="M19.811 20.174l-6.234-6.809a7.96 7.96 0 0 0 .923-1.179c.274-.424.502-.865.687-1.323a8.04 8.04 0 0 0 .42-1.436 7.88 7.88 0 0 0 .144-1.507c0-.526-.051-1.042-.154-1.548-.096-.506-.243-.995-.441-1.466s-.441-.919-.728-1.343a8.28 8.28 0 0 0-.984-1.21 7.86 7.86 0 0 0-1.2-.984A7.56 7.56 0 0 0 10.89.651C10.418.453 9.929.302 9.423.2S8.401.046 7.875.046 6.833.097 6.327.2 5.332.453 4.86.651a7.56 7.56 0 0 0-1.354.718c-.431.287-.831.615-1.2.984a8.28 8.28 0 0 0-.984 1.21 7.73 7.73 0 0 0-.728 1.343c-.198.472-.349.96-.451 1.466A8.31 8.31 0 0 0 0 7.921a8.31 8.31 0 0 0 .144 1.548c.103.506.253.995.451 1.466a8.08 8.08 0 0 0 .728 1.354 7.86 7.86 0 0 0 .984 1.2 7.54 7.54 0 0 0 1.2.995c.431.287.882.53 1.354.728.472.191.96.338 1.466.441a8.31 8.31 0 0 0 1.548.144c.451 0 .896-.038 1.333-.113a7.83 7.83 0 0 0 1.282-.328 7.55 7.55 0 0 0 1.2-.533 8.08 8.08 0 0 0 1.107-.749l6.245 6.809a.45.45 0 0 0 .174.123.55.55 0 0 0 .205.041.61.61 0 0 0 .195-.031c.061-.021.116-.055.164-.102.109-.096.164-.219.164-.369.007-.144-.038-.267-.133-.369zM1.046 7.921c0-.937.178-1.818.533-2.646.362-.834.851-1.559 1.466-2.174.622-.615 1.347-1.101 2.174-1.456.827-.362 1.712-.543 2.656-.543s1.829.181 2.656.543c.827.355 1.548.841 2.164 1.456.622.615 1.111 1.34 1.466 2.174a6.52 6.52 0 0 1 .543 2.646c0 .943-.181 1.829-.543 2.656a6.89 6.89 0 0 1-1.466 2.174c-.615.615-1.336 1.104-2.164 1.466-.827.356-1.712.533-2.656.533s-1.829-.178-2.656-.533c-.827-.362-1.552-.851-2.174-1.466-.615-.622-1.104-1.347-1.466-2.174-.355-.827-.533-1.712-.533-2.656z">`);
3834
+ function $16f0ed5ea30d8d9c$export$82eafebb825fc23f(props = {}) {
3835
+ return (() => {
3836
+ const _el$ = $9HbP8$getNextElement($16f0ed5ea30d8d9c$var$_tmpl$);
3837
+ $9HbP8$spread(_el$, props, true, true);
3838
+ $9HbP8$runHydrationEvents();
3839
+ return _el$;
3840
+ })();
3841
+ }
3842
+ const $e01b34f289b61435$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<div class=search-in-filters><input type=text class=query><!$><!/><button class=clear>`);
3843
+ const $e01b34f289b61435$var$min_items_to_enable_filter_searching = 10; // For checkbox hierarchical we 2x this
3844
+ function $e01b34f289b61435$export$4b2c5292ffe0c5dd(filter_array_, section, i18n_) {
3845
+ const [filter_query_, set_filter_query_] = $9HbP8$createSignal();
3846
+ // Check if we have enough items to enable searching
3847
+ const enable_searchability = $9HbP8$createMemo(() => {
3848
+ let count = 0;
3849
+ for (const filter of filter_array_()) {
3850
+ const type = filter.meta?.type;
3851
+ if (type === "range") continue;
3852
+ const length = filter.meta.values.length;
3853
+ count += type === "checkbox-color" ? length / 2 : type === "checkbox-grid" ? length / 3 : length; // For checkbox-color we have two columns, checkbox-grid three, so we can show search later
3854
+ }
3855
+
3856
+ return count >= $e01b34f289b61435$var$min_items_to_enable_filter_searching;
3857
+ });
3858
+ const SearchThisFilterGroup_ = () => {
3859
+ return $9HbP8$createComponent((0, $9HbP8$Show), {
3860
+ get when() {
3861
+ return enable_searchability();
3862
+ },
3863
+ get children() {
3864
+ const _el$ = $9HbP8$getNextElement($e01b34f289b61435$var$_tmpl$),
3865
+ _el$2 = _el$.firstChild,
3866
+ _el$4 = _el$2.nextSibling,
3867
+ [_el$5, _co$] = $9HbP8$getNextMarker(_el$4.nextSibling),
3868
+ _el$3 = _el$5.nextSibling;
3869
+ _el$2.$$input = ev => set_filter_query_(ev.currentTarget.value);
3870
+ $9HbP8$insert(_el$, $9HbP8$createComponent((0, $16f0ed5ea30d8d9c$export$82eafebb825fc23f), {
3871
+ width: "16",
3872
+ height: "17.6",
3873
+ "class": "search-icon"
3874
+ }), _el$5, _co$);
3875
+ _el$3.$$click = () => set_filter_query_();
3876
+ $9HbP8$insert(_el$3, $9HbP8$createComponent((0, $19976a74d273070d$export$3b621d86b1566b2), {
3877
+ width: "12",
3878
+ height: "12"
3879
+ }));
3880
+ $9HbP8$effect(_p$ => {
3881
+ const _v$ = i18n_.search_a_filter_()(section),
3882
+ _v$2 = filter_query_() ? "" : "none";
3883
+ _v$ !== _p$._v$ && $9HbP8$setAttribute(_el$2, "placeholder", _p$._v$ = _v$);
3884
+ _v$2 !== _p$._v$2 && ((_p$._v$2 = _v$2) != null ? _el$3.style.setProperty("display", _v$2) : _el$3.style.removeProperty("display"));
3885
+ return _p$;
3886
+ }, {
3887
+ _v$: undefined,
3888
+ _v$2: undefined
3889
+ });
3890
+ $9HbP8$effect(() => $9HbP8$setProperty(_el$2, "value", filter_query_() || ""));
3891
+ $9HbP8$runHydrationEvents();
3892
+ return _el$;
3893
+ }
3894
+ });
3895
+ };
3896
+ const searched_filter_array_ = $9HbP8$createMemo(() => {
3897
+ const query = filter_query_();
3898
+ if (!enable_searchability() || !query) return filter_array_();
3899
+ const lowercase_query = query.toLowerCase();
3900
+ const check_string_match = to_check => {
3901
+ to_check = to_check.toLowerCase();
3902
+ return to_check.includes(lowercase_query) || lowercase_query.includes(to_check);
3903
+ };
3904
+ return filter_array_().map(filter => {
3905
+ const type = filter.meta?.type;
3906
+ if (type === "range") return filter; // can't search in range filters and for checkbox-hierarchical we do the searching in the filter component since we have access to a hierarchical structure there
3907
+ const meta = filter.meta;
3908
+ const {
3909
+ values: values,
3910
+ names: names,
3911
+ counts: counts
3912
+ } = meta;
3913
+ if (!Array.isArray(values)) return filter; // Might have to adjust this in the future, but I think these super simple filters won't need search
3914
+ const is_hierarchical_checkbox = type === "checkbox-hierarchical";
3915
+ // Which index of counts, values and names should be kept
3916
+ const filtered_indexes = values.map((item, index) => {
3917
+ const item_from_names = names?.[index];
3918
+ if (item_from_names && !is_hierarchical_checkbox)
3919
+ // We should use names if they exist, but sometimes backend doesn't provide any at all, and sometimes they are undefined, presumably from create_modified_filters
3920
+ item = item_from_names;
3921
+ if (typeof item === "number") return true;
3922
+ if (is_hierarchical_checkbox && names)
3923
+ // Special case for hierarchical checkboxes where we need to check if any of the names in the path match the query
3924
+ item = item.map((_, index) => names[$e01b34f289b61435$var$find_str_arr_in_str_arr_arr("findIndex", values, item.slice(0, index + 1))]);
3925
+ if (Array.isArray(item)) return item.some(item => check_string_match(item + "")); // If any of the items in the array match, keep it
3926
+ return check_string_match(item);
3927
+ });
3928
+ const new_values = values.filter((_, i) => filtered_indexes[i]);
3929
+ if (!new_values.length) return false; // false = please delete this filter, see below
3930
+ const new_filter_object = {
3931
+ ...filter,
3932
+ meta: {
3933
+ ...meta,
3934
+ counts: counts?.filter((_, i) => filtered_indexes[i]),
3935
+ ...(names ? {
3936
+ names: meta.names?.filter((_, i) => filtered_indexes[i])
3937
+ } : {}),
3938
+ values: new_values
3939
+ }
3940
+ };
3941
+ if (is_hierarchical_checkbox) {
3942
+ // For hierarchical checkbox we need to fill the holes created by filtering, for example if there is
3943
+ // ["Clothes"]
3944
+ // ["Clothes", "Blazers"]
3945
+ // And the user searched for "blazers" we need to add back ["Clothes"] so CheckboxHierarchicalFilter doesn't get confused
3946
+ // I explored doing the filtering there instead, but it's very hard to do it early enough before the expansion/collapsedness is calculated and check-logic is set up in relation to other items
3947
+ // So we do it here instead
3948
+ const new_meta = new_filter_object.meta;
3949
+ const new_values = new_meta.values;
3950
+ for (const value of new_values) {
3951
+ if (!Array.isArray(value)) continue; // Shouldn't happen
3952
+ if (value.length < 2) continue; // No parent
3953
+ const parent = value.slice(0, -1);
3954
+ // Check if parent exists
3955
+ if ($e01b34f289b61435$var$find_str_arr_in_str_arr_arr("some", new_values, parent)) continue; // Parent exists
3956
+ // Otherwise, put it back
3957
+ const index_to_restore = $e01b34f289b61435$var$find_str_arr_in_str_arr_arr("findIndex", values, parent);
3958
+ if (index_to_restore < 0) {
3959
+ $9HbP8$dwarn("Can't restore", parent, "to", new_values);
3960
+ continue;
3961
+ }
3962
+ const current_index_of_us = new_values.findIndex(item => item === value);
3963
+ new_values.splice(current_index_of_us, 0, values[index_to_restore]);
3964
+ const count_to_restore = counts?.[index_to_restore];
3965
+ if (count_to_restore) new_meta.counts?.splice(current_index_of_us, 0, count_to_restore);
3966
+ const name_to_restore = names?.[index_to_restore];
3967
+ if (name_to_restore) new_meta.names?.splice(current_index_of_us, 0, name_to_restore);
3968
+ }
3969
+ }
3970
+ return new_filter_object;
3971
+ }).filter(filter => filter); // Delete filters that don't have a value anymore
3972
+ });
3973
+
3974
+ return {
3975
+ SearchThisFilterGroup_: SearchThisFilterGroup_,
3976
+ searched_filter_array_: searched_filter_array_,
3977
+ filter_query_: filter_query_
3978
+ };
3979
+ }
3980
+ /**
3981
+ * Finds/whatevers what's effectively one hierarchical filter item in an array of hierarchical filter items
3982
+ * Functions similar to this happen loads in create_modified_filters, but they have additional checks so not touching them RN
3983
+ */
3984
+ function $e01b34f289b61435$var$find_str_arr_in_str_arr_arr(operation, haystack, needle) {
3985
+ return haystack[operation](value => value.length === needle.length && value.every((item, index) => item === needle[index]));
3986
+ }
3987
+ $9HbP8$delegateEvents(["input", "click"]);
3452
3988
  const $fab07f52c9861732$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<div class=filter-collapsible>`),
3453
3989
  $fab07f52c9861732$var$_tmpl$2 = /*#__PURE__*/$9HbP8$template(`<button class=clear-group><!$><!/><span>`),
3454
3990
  $fab07f52c9861732$var$_tmpl$3 = /*#__PURE__*/$9HbP8$template(`<div class=view-more-clear><!$><!/><!$><!/>`),
3455
- $fab07f52c9861732$var$_tmpl$4 = /*#__PURE__*/$9HbP8$template(`<div class=filter-collapsible-body><div class=filter-part></div><!$><!/>`),
3991
+ $fab07f52c9861732$var$_tmpl$4 = /*#__PURE__*/$9HbP8$template(`<div class=filter-collapsible-body><div class=filter-part><!$><!/><!$><!/></div><!$><!/>`),
3456
3992
  $fab07f52c9861732$var$_tmpl$5 = /*#__PURE__*/$9HbP8$template(`<details class=filter-collapsible>`),
3457
3993
  $fab07f52c9861732$var$_tmpl$6 = /*#__PURE__*/$9HbP8$template(`<summary class=filter-group-summary><div class=summary><span></span><div class=selected-w-sign><!$><!/><!$><!/>`),
3458
3994
  $fab07f52c9861732$var$_tmpl$7 = /*#__PURE__*/$9HbP8$template(`<div class=ungrouped>`),
@@ -3507,6 +4043,11 @@ function $fab07f52c9861732$var$ActualFilterBody(props) {
3507
4043
  const filter_array_ = $9HbP8$createMemo(() => {
3508
4044
  return Object.values(togglable_filters_grouped_by_collapsible())[get_section_index()];
3509
4045
  });
4046
+ const {
4047
+ SearchThisFilterGroup_: SearchThisFilterGroup_,
4048
+ searched_filter_array_: searched_filter_array_,
4049
+ filter_query_: filter_query_
4050
+ } = $e01b34f289b61435$export$4b2c5292ffe0c5dd(filter_array_, section_, props.i18n_);
3510
4051
  const is_open = $84d6cd10bb7b1589$export$ab34afce88557c0e({
3511
4052
  get expanded_filters_() {
3512
4053
  return props.expanded_filters_;
@@ -3519,27 +4060,30 @@ function $fab07f52c9861732$var$ActualFilterBody(props) {
3519
4060
  // this is absolutely not accurate which is why we have the .filter below, it's just the easiest way to get the typing of the map correct
3520
4061
  filter_from_api]).filter(([selected_filter]) => selected_filter)));
3521
4062
  const a_filter_is_selected = $9HbP8$createMemo(() => selected_filters_in_group().size);
4063
+ const [get_details_width, set_get_details_width] = $9HbP8$createSignal();
4064
+ const details_element_width_ = $9HbP8$createMemo(() => get_details_width?.()?.());
3522
4065
  return $9HbP8$createComponent((0, $6bb0a0c563dff4bb$export$6c6d7a51fa9aa15d), {
3523
4066
  is_open_: is_open,
3524
4067
  get details_() {
3525
4068
  return (() => {
3526
- const _el$15 = $9HbP8$getNextElement($fab07f52c9861732$var$_tmpl$5);
3527
- $9HbP8$setAttribute(_el$15, "data-group-title", section_);
3528
- return _el$15;
4069
+ const _el$19 = $9HbP8$getNextElement($fab07f52c9861732$var$_tmpl$5);
4070
+ $9HbP8$use(element => set_get_details_width(() => $2449872a62a75a20$export$ebdc3711f7e02ccd(element)), _el$19);
4071
+ $9HbP8$setAttribute(_el$19, "data-group-title", section_);
4072
+ return _el$19;
3529
4073
  })();
3530
4074
  },
3531
4075
  get summary_() {
3532
4076
  return (() => {
3533
- const _el$16 = $9HbP8$getNextElement($fab07f52c9861732$var$_tmpl$6),
3534
- _el$17 = _el$16.firstChild,
3535
- _el$18 = _el$17.firstChild,
3536
- _el$19 = _el$18.nextSibling,
3537
- _el$20 = _el$19.firstChild,
3538
- [_el$21, _co$5] = $9HbP8$getNextMarker(_el$20.nextSibling),
3539
- _el$22 = _el$21.nextSibling,
3540
- [_el$23, _co$6] = $9HbP8$getNextMarker(_el$22.nextSibling);
3541
- $9HbP8$insert(_el$18, section_);
3542
- $9HbP8$insert(_el$19, $9HbP8$createComponent((0, $9HbP8$Show), {
4077
+ const _el$20 = $9HbP8$getNextElement($fab07f52c9861732$var$_tmpl$6),
4078
+ _el$21 = _el$20.firstChild,
4079
+ _el$22 = _el$21.firstChild,
4080
+ _el$23 = _el$22.nextSibling,
4081
+ _el$24 = _el$23.firstChild,
4082
+ [_el$25, _co$7] = $9HbP8$getNextMarker(_el$24.nextSibling),
4083
+ _el$26 = _el$25.nextSibling,
4084
+ [_el$27, _co$8] = $9HbP8$getNextMarker(_el$26.nextSibling);
4085
+ $9HbP8$insert(_el$22, section_);
4086
+ $9HbP8$insert(_el$23, $9HbP8$createComponent((0, $9HbP8$Show), {
3543
4087
  get when() {
3544
4088
  return a_filter_is_selected();
3545
4089
  },
@@ -3551,26 +4095,31 @@ function $fab07f52c9861732$var$ActualFilterBody(props) {
3551
4095
  }
3552
4096
  });
3553
4097
  }
3554
- }), _el$21, _co$5);
3555
- $9HbP8$insert(_el$19, $9HbP8$createComponent((0, $0b6bc2f8309efa8a$export$e5c2828934226505), {
4098
+ }), _el$25, _co$7);
4099
+ $9HbP8$insert(_el$23, $9HbP8$createComponent((0, $0b6bc2f8309efa8a$export$e5c2828934226505), {
3556
4100
  get expanded_() {
3557
4101
  return is_open[0];
3558
4102
  },
3559
4103
  get i18n_() {
3560
4104
  return props.i18n_;
3561
4105
  }
3562
- }), _el$23, _co$6);
3563
- return _el$16;
4106
+ }), _el$27, _co$8);
4107
+ return _el$20;
3564
4108
  })();
3565
4109
  },
3566
4110
  get children() {
3567
4111
  const _el$2 = $9HbP8$getNextElement($fab07f52c9861732$var$_tmpl$4),
3568
4112
  _el$3 = _el$2.firstChild,
3569
- _el$13 = _el$3.nextSibling,
3570
- [_el$14, _co$4] = $9HbP8$getNextMarker(_el$13.nextSibling);
4113
+ _el$4 = _el$3.firstChild,
4114
+ [_el$5, _co$] = $9HbP8$getNextMarker(_el$4.nextSibling),
4115
+ _el$6 = _el$5.nextSibling,
4116
+ [_el$7, _co$2] = $9HbP8$getNextMarker(_el$6.nextSibling),
4117
+ _el$17 = _el$3.nextSibling,
4118
+ [_el$18, _co$6] = $9HbP8$getNextMarker(_el$17.nextSibling);
4119
+ $9HbP8$insert(_el$3, $9HbP8$createComponent(SearchThisFilterGroup_, {}), _el$5, _co$);
3571
4120
  $9HbP8$insert(_el$3, $9HbP8$createComponent((0, $9HbP8$Index), {
3572
4121
  get each() {
3573
- return filter_array_();
4122
+ return searched_filter_array_();
3574
4123
  },
3575
4124
  children: filter => $9HbP8$createComponent((0, $b7436a6d1fd64e3b$export$b69d0d92862de18b), {
3576
4125
  severity_: "error",
@@ -3592,11 +4141,13 @@ function $fab07f52c9861732$var$ActualFilterBody(props) {
3592
4141
  get i18n_() {
3593
4142
  return props.i18n_;
3594
4143
  },
3595
- view_more_button_below_group_: view_more_button_below_group
4144
+ view_more_button_below_group_: view_more_button_below_group,
4145
+ filter_query_: filter_query_,
4146
+ details_element_width_: details_element_width_
3596
4147
  });
3597
4148
  }
3598
4149
  })
3599
- }));
4150
+ }), _el$7, _co$2);
3600
4151
  $9HbP8$insert(_el$2, $9HbP8$createComponent((0, $9HbP8$Show), {
3601
4152
  get when() {
3602
4153
  return $9HbP8$createMemo(() => {
@@ -3605,22 +4156,22 @@ function $fab07f52c9861732$var$ActualFilterBody(props) {
3605
4156
  })();
3606
4157
  },
3607
4158
  get children() {
3608
- const _el$4 = $9HbP8$getNextElement($fab07f52c9861732$var$_tmpl$3),
3609
- _el$9 = _el$4.firstChild,
3610
- [_el$10, _co$2] = $9HbP8$getNextMarker(_el$9.nextSibling),
3611
- _el$11 = _el$10.nextSibling,
3612
- [_el$12, _co$3] = $9HbP8$getNextMarker(_el$11.nextSibling);
3613
- $9HbP8$insert(_el$4, () => view_more_button_below_group[0](), _el$10, _co$2);
3614
- $9HbP8$insert(_el$4, $9HbP8$createComponent((0, $9HbP8$Show), {
4159
+ const _el$8 = $9HbP8$getNextElement($fab07f52c9861732$var$_tmpl$3),
4160
+ _el$13 = _el$8.firstChild,
4161
+ [_el$14, _co$4] = $9HbP8$getNextMarker(_el$13.nextSibling),
4162
+ _el$15 = _el$14.nextSibling,
4163
+ [_el$16, _co$5] = $9HbP8$getNextMarker(_el$15.nextSibling);
4164
+ $9HbP8$insert(_el$8, () => view_more_button_below_group[0](), _el$14, _co$4);
4165
+ $9HbP8$insert(_el$8, $9HbP8$createComponent((0, $9HbP8$Show), {
3615
4166
  get when() {
3616
4167
  return a_filter_is_selected();
3617
4168
  },
3618
4169
  get children() {
3619
- const _el$5 = $9HbP8$getNextElement($fab07f52c9861732$var$_tmpl$2),
3620
- _el$7 = _el$5.firstChild,
3621
- [_el$8, _co$] = $9HbP8$getNextMarker(_el$7.nextSibling),
3622
- _el$6 = _el$8.nextSibling;
3623
- $9HbP8$addEventListener(_el$5, "click", $9HbP8$catchify(() => {
4170
+ const _el$9 = $9HbP8$getNextElement($fab07f52c9861732$var$_tmpl$2),
4171
+ _el$11 = _el$9.firstChild,
4172
+ [_el$12, _co$3] = $9HbP8$getNextMarker(_el$11.nextSibling),
4173
+ _el$10 = _el$12.nextSibling;
4174
+ $9HbP8$addEventListener(_el$9, "click", $9HbP8$catchify(() => {
3624
4175
  const new_filter_obj = [...props.selected_filters_[0]()];
3625
4176
  for (const filter of filter_array_()) {
3626
4177
  const index = new_filter_obj.findIndex(({
@@ -3631,15 +4182,15 @@ function $fab07f52c9861732$var$ActualFilterBody(props) {
3631
4182
  }
3632
4183
  props.selected_filters_[1](new_filter_obj);
3633
4184
  }), true);
3634
- $9HbP8$insert(_el$5, $9HbP8$createComponent((0, $19976a74d273070d$export$3b621d86b1566b2), {}), _el$8, _co$);
3635
- $9HbP8$insert(_el$6, () => props.i18n_.clear_individual_filter_());
4185
+ $9HbP8$insert(_el$9, $9HbP8$createComponent((0, $19976a74d273070d$export$3b621d86b1566b2), {}), _el$12, _co$3);
4186
+ $9HbP8$insert(_el$10, () => props.i18n_.clear_individual_filter_());
3636
4187
  $9HbP8$runHydrationEvents();
3637
- return _el$5;
4188
+ return _el$9;
3638
4189
  }
3639
- }), _el$12, _co$3);
3640
- return _el$4;
4190
+ }), _el$16, _co$5);
4191
+ return _el$8;
3641
4192
  }
3642
- }), _el$14, _co$4);
4193
+ }), _el$18, _co$6);
3643
4194
  return _el$2;
3644
4195
  }
3645
4196
  });
@@ -3652,8 +4203,8 @@ function $fab07f52c9861732$var$ActualFilterBody(props) {
3652
4203
  return untogglable_filters()?.length;
3653
4204
  },
3654
4205
  get children() {
3655
- const _el$24 = $9HbP8$getNextElement($fab07f52c9861732$var$_tmpl$7);
3656
- $9HbP8$insert(_el$24, $9HbP8$createComponent((0, $9HbP8$Index), {
4206
+ const _el$28 = $9HbP8$getNextElement($fab07f52c9861732$var$_tmpl$7);
4207
+ $9HbP8$insert(_el$28, $9HbP8$createComponent((0, $9HbP8$Index), {
3657
4208
  get each() {
3658
4209
  return untogglable_filters();
3659
4210
  },
@@ -3678,15 +4229,15 @@ function $fab07f52c9861732$var$ActualFilterBody(props) {
3678
4229
  }), $9HbP8$memo(get_view_more_button_below_group)];
3679
4230
  }
3680
4231
  }));
3681
- return _el$24;
4232
+ return _el$28;
3682
4233
  }
3683
4234
  }), $9HbP8$createComponent((0, $9HbP8$Show), {
3684
4235
  get when() {
3685
4236
  return $9HbP8$memo(() => !!!props.are_in_modal_ /* modal has its own clear button */)() && props.selected_filters_[0]()?.length;
3686
4237
  },
3687
4238
  get children() {
3688
- const _el$25 = $9HbP8$getNextElement($fab07f52c9861732$var$_tmpl$8);
3689
- $9HbP8$addEventListener(_el$25, "click", $9HbP8$catchify(() => $e9342fb3ac73a54a$export$8895d39404bd2bb1({
4239
+ const _el$29 = $9HbP8$getNextElement($fab07f52c9861732$var$_tmpl$8);
4240
+ $9HbP8$addEventListener(_el$29, "click", $9HbP8$catchify(() => $e9342fb3ac73a54a$export$8895d39404bd2bb1({
3690
4241
  user_triggered_: true,
3691
4242
  selected_filters_: props.selected_filters_,
3692
4243
  i18n_: props.i18n_,
@@ -3694,9 +4245,9 @@ function $fab07f52c9861732$var$ActualFilterBody(props) {
3694
4245
  expanded_hierarchical_filters_: props.expanded_hierarchical_filters_,
3695
4246
  local_filter_cache_: props.local_filter_cache_
3696
4247
  })), true);
3697
- $9HbP8$insert(_el$25, () => props.i18n_.clear_all_filters_from_big_button_());
4248
+ $9HbP8$insert(_el$29, () => props.i18n_.clear_all_filters_from_big_button_());
3698
4249
  $9HbP8$runHydrationEvents();
3699
- return _el$25;
4250
+ return _el$29;
3700
4251
  }
3701
4252
  })];
3702
4253
  }
@@ -7937,19 +8488,6 @@ const $22e59517c2ec94d3$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<svg xmlns=ht
7937
8488
  function $22e59517c2ec94d3$export$1c641004b5485fed() {
7938
8489
  return $9HbP8$getNextElement($22e59517c2ec94d3$var$_tmpl$);
7939
8490
  }
7940
- const $16f0ed5ea30d8d9c$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<svg><path d="M19.811 20.174l-6.234-6.809a7.96 7.96 0 0 0 .923-1.179c.274-.424.502-.865.687-1.323a8.04 8.04 0 0 0 .42-1.436 7.88 7.88 0 0 0 .144-1.507c0-.526-.051-1.042-.154-1.548-.096-.506-.243-.995-.441-1.466s-.441-.919-.728-1.343a8.28 8.28 0 0 0-.984-1.21 7.86 7.86 0 0 0-1.2-.984A7.56 7.56 0 0 0 10.89.651C10.418.453 9.929.302 9.423.2S8.401.046 7.875.046 6.833.097 6.327.2 5.332.453 4.86.651a7.56 7.56 0 0 0-1.354.718c-.431.287-.831.615-1.2.984a8.28 8.28 0 0 0-.984 1.21 7.73 7.73 0 0 0-.728 1.343c-.198.472-.349.96-.451 1.466A8.31 8.31 0 0 0 0 7.921a8.31 8.31 0 0 0 .144 1.548c.103.506.253.995.451 1.466a8.08 8.08 0 0 0 .728 1.354 7.86 7.86 0 0 0 .984 1.2 7.54 7.54 0 0 0 1.2.995c.431.287.882.53 1.354.728.472.191.96.338 1.466.441a8.31 8.31 0 0 0 1.548.144c.451 0 .896-.038 1.333-.113a7.83 7.83 0 0 0 1.282-.328 7.55 7.55 0 0 0 1.2-.533 8.08 8.08 0 0 0 1.107-.749l6.245 6.809a.45.45 0 0 0 .174.123.55.55 0 0 0 .205.041.61.61 0 0 0 .195-.031c.061-.021.116-.055.164-.102.109-.096.164-.219.164-.369.007-.144-.038-.267-.133-.369zM1.046 7.921c0-.937.178-1.818.533-2.646.362-.834.851-1.559 1.466-2.174.622-.615 1.347-1.101 2.174-1.456.827-.362 1.712-.543 2.656-.543s1.829.181 2.656.543c.827.355 1.548.841 2.164 1.456.622.615 1.111 1.34 1.466 2.174a6.52 6.52 0 0 1 .543 2.646c0 .943-.181 1.829-.543 2.656a6.89 6.89 0 0 1-1.466 2.174c-.615.615-1.336 1.104-2.164 1.466-.827.356-1.712.533-2.656.533s-1.829-.178-2.656-.533c-.827-.362-1.552-.851-2.174-1.466-.615-.622-1.104-1.347-1.466-2.174-.355-.827-.533-1.712-.533-2.656z">`);
7941
- function $16f0ed5ea30d8d9c$export$82eafebb825fc23f(props = {}) {
7942
- return (() => {
7943
- const _el$ = $9HbP8$getNextElement($16f0ed5ea30d8d9c$var$_tmpl$);
7944
- $9HbP8$spread(_el$, $9HbP8$mergeProps1(props, {
7945
- "xmlns": "http://www.w3.org/2000/svg",
7946
- "width": "20",
7947
- "height": "22"
7948
- }), true, true);
7949
- $9HbP8$runHydrationEvents();
7950
- return _el$;
7951
- })();
7952
- }
7953
8491
  const $5285d2814d0fac0c$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<button class=back type=button>`),
7954
8492
  $5285d2814d0fac0c$var$_tmpl$2 = /*#__PURE__*/$9HbP8$template(`<div class=search-field><!$><!/><div class=field><input class=query tabindex=0><button type=button class=clear></button></div><button class="submit major"type=button>`);
7955
8493
  function $5285d2814d0fac0c$export$b94867ecbd698f21({
@@ -8687,91 +9225,19 @@ function $7ad3a93cbe6fa208$export$a146ac6fa8346a25({
8687
9225
  _v$3 !== _p$._v$3 && $9HbP8$setAttribute(_el$6, "title", _p$._v$3 = _v$3);
8688
9226
  _v$4 !== _p$._v$4 && $9HbP8$setAttribute(_el$9, "title", _p$._v$4 = _v$4);
8689
9227
  return _p$;
8690
- }, {
8691
- _v$: undefined,
8692
- _v$2: undefined,
8693
- _v$3: undefined,
8694
- _v$4: undefined
8695
- });
8696
- return _el$4;
8697
- })();
8698
- }
8699
- }));
8700
- return _el$;
8701
- }
8702
- });
8703
- }
8704
- const $f3213c0640246d58$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<span class=highlighted-part>`),
8705
- $f3213c0640246d58$var$_tmpl$2 = /*#__PURE__*/$9HbP8$template(`<span>`);
8706
- function $f3213c0640246d58$export$ba17c5b7e6dda39f({
8707
- whole_text_to_display_: whole_text_to_display_memo,
8708
- searching_for_value_: searching_for_value_memo,
8709
- class_: class_
8710
- }) {
8711
- const [get_has_highlighted, set_has_highlighted] = $9HbP8$createSignal(false);
8712
- const text_itself = $9HbP8$createMemo(() => $9HbP8$batch(() => {
8713
- set_has_highlighted(false);
8714
- const searching_for_value = searching_for_value_memo();
8715
- const whole_text_to_display_ = whole_text_to_display_memo();
8716
- let for_black = "";
8717
- let pushed_grey = false;
8718
- const search_q = searching_for_value;
8719
- if (!search_q) return whole_text_to_display_;
8720
- const output = [];
8721
- const searching_for = search_q.toLowerCase();
8722
- const push_black = () => {
8723
- if (for_black) {
8724
- set_has_highlighted(true);
8725
- output.push((() => {
8726
- const _el$ = $9HbP8$getNextElement($f3213c0640246d58$var$_tmpl$);
8727
- $9HbP8$insert(_el$, for_black);
8728
- return _el$;
8729
- })()); // "black"
8730
- for_black = "";
8731
- }
8732
- };
8733
- for (let i = 0; i < whole_text_to_display_.length;) {
8734
- let is_whole_word = true;
8735
- let searching_for_but_with_texts_casing = "";
8736
- const i_at_start = i;
8737
- for (let j = 0; j < searching_for.length; i++, j++) {
8738
- const letter_in_suggestion = whole_text_to_display_[i];
8739
- if (letter_in_suggestion?.toLowerCase() !== searching_for[j]) {
8740
- is_whole_word = false;
8741
- i = i_at_start;
8742
- break;
9228
+ }, {
9229
+ _v$: undefined,
9230
+ _v$2: undefined,
9231
+ _v$3: undefined,
9232
+ _v$4: undefined
9233
+ });
9234
+ return _el$4;
9235
+ })();
8743
9236
  }
8744
- searching_for_but_with_texts_casing += letter_in_suggestion;
8745
- }
8746
- if (is_whole_word) {
8747
- push_black();
8748
- output.push(searching_for_but_with_texts_casing);
8749
- pushed_grey = true;
8750
- } else for_black += whole_text_to_display_[i++];
8751
- }
8752
- push_black();
8753
- if (!pushed_grey) {
8754
- set_has_highlighted(false);
8755
- return whole_text_to_display_;
9237
+ }));
9238
+ return _el$;
8756
9239
  }
8757
- return output;
8758
- }));
8759
- return (() => {
8760
- const _el$2 = $9HbP8$getNextElement($f3213c0640246d58$var$_tmpl$2);
8761
- $9HbP8$className(_el$2, class_);
8762
- $9HbP8$insert(_el$2, text_itself);
8763
- $9HbP8$effect(_p$ => {
8764
- const _v$ = !!get_has_highlighted(),
8765
- _v$2 = whole_text_to_display_memo() /* for when line-clamped, users can see full text on hover */;
8766
- _v$ !== _p$._v$ && _el$2.classList.toggle("has-history-match", _p$._v$ = _v$);
8767
- _v$2 !== _p$._v$2 && $9HbP8$setAttribute(_el$2, "title", _p$._v$2 = _v$2);
8768
- return _p$;
8769
- }, {
8770
- _v$: undefined,
8771
- _v$2: undefined
8772
- });
8773
- return _el$2;
8774
- })();
9240
+ });
8775
9241
  }
8776
9242
  const $190927650b4840eb$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 256 256"><path d="M56 26.455a13.71 13.71 0 0 0-9.578 3.967A13.71 13.71 0 0 0 42.455 40v176a13.71 13.71 0 0 0 3.967 9.578A13.71 13.71 0 0 0 56 229.545h144A13.71 13.71 0 0 0 213.545 216V88a2.456 2.456 0 0 1 0-.002c.001-1.452-.597-2.895-1.623-3.922l-55.998-55.998a5.61 5.61 0 0 0-3.922-1.623 2.456 2.456 0 0 1-.002 0zm0 11.09h88A2.456 2.456 0 0 1 146.455 40v48c0 2.903 2.642 5.545 5.545 5.545h48A2.456 2.456 0 0 1 202.455 96v120a2.456 2.456 0 0 1-2.455 2.455H56A2.456 2.456 0 0 1 53.545 216V40A2.456 2.456 0 0 1 56 37.545zm103.061 11.498a2.456 2.456 0 0 1 2.676.531l28.689 28.689a2.456 2.456 0 0 1-1.736 4.191H160A2.456 2.456 0 0 1 157.545 80V51.311a2.456 2.456 0 0 1 1.516-2.268zM96 130.455c-2.903 0-5.545 2.642-5.545 5.545s2.642 5.545 5.545 5.545h64c2.903 0 5.545-2.642 5.545-5.545s-2.642-5.545-5.545-5.545zm0 32c-2.903 0-5.545 2.642-5.545 5.545s2.642 5.545 5.545 5.545h64c2.903 0 5.545-2.642 5.545-5.545s-2.642-5.545-5.545-5.545z">`);
8777
9243
  function $190927650b4840eb$export$605674723bcc715c(props = {}) {
@@ -8810,8 +9276,8 @@ function $cea52f6b24092f05$export$e872e2339fb04a7f({
8810
9276
  type: type,
8811
9277
  title: title
8812
9278
  }) => type === (0, $a0eb8b431ec1f87b$export$3cf9497e790da491) && !filtered_previous_searches_().includes(title) // don't show the ones we already show from the history
8813
- ));
8814
-
9279
+ ) // + limit to three query suggestions, API sends more sometimes
9280
+ .slice(0, 3));
8815
9281
  const not_queries_memo = $9HbP8$createMemo(() => {
8816
9282
  // For the section that shows categories and content results
8817
9283
  // We want to limit to 3 items, and we want to show the categories first
@@ -9791,226 +10257,6 @@ function $1801dbce7adb3f19$export$41b4894022a3580f({
9791
10257
  })));
9792
10258
  return style_props_;
9793
10259
  }
9794
- const $522a690e0e2bd46d$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<span class=highlighted-part>`);
9795
- const $522a690e0e2bd46d$var$dont_cut_in_between_less_than_characters = 30;
9796
- function $522a690e0e2bd46d$export$e1a98a189fd2c0e7({
9797
- content_result_: content_result_,
9798
- key_: key_,
9799
- cut_when_possible_: cut_when_possible_
9800
- }) {
9801
- const matched_tokens = $9HbP8$createMemo(() => content_result_().highlights?.find(highlight => highlight.field == key_)?.matched_tokens);
9802
- const full_value = $9HbP8$createMemo(() => content_result_()[key_]?.replaceAll("\n", " "));
9803
- return $9HbP8$createComponent((0, $9HbP8$Show), {
9804
- get when() {
9805
- return matched_tokens()?.length;
9806
- },
9807
- get fallback() {
9808
- return full_value();
9809
- },
9810
- get children() {
9811
- return (() => {
9812
- const segmented_cut_text = $9HbP8$createMemo(() => {
9813
- const segmented_text = $522a690e0e2bd46d$var$segment_text(full_value(), matched_tokens());
9814
- if (cut_when_possible_) $522a690e0e2bd46d$var$cut_text(segmented_text);
9815
- return segmented_text;
9816
- });
9817
- return $9HbP8$createComponent((0, $9HbP8$Index), {
9818
- get each() {
9819
- return segmented_cut_text();
9820
- },
9821
- children: item => {
9822
- return $9HbP8$createComponent((0, $9HbP8$Show), {
9823
- get when() {
9824
- return item().highlighted_;
9825
- },
9826
- get fallback() {
9827
- return item().text_;
9828
- },
9829
- get children() {
9830
- const _el$ = $9HbP8$getNextElement($522a690e0e2bd46d$var$_tmpl$);
9831
- $9HbP8$insert(_el$, () => item().text_);
9832
- return _el$;
9833
- }
9834
- });
9835
- }
9836
- });
9837
- })();
9838
- }
9839
- });
9840
- }
9841
- function $522a690e0e2bd46d$var$cut_text(segmented_text) {
9842
- // cut away chunks of text that are not highlighted to give a google-like overview of the content
9843
- const highlighted_segments = segmented_text?.filter(segment => segment.highlighted_);
9844
- if (!segmented_text || !highlighted_segments?.length) return;
9845
- // We have one or more highlighted segments
9846
- if (highlighted_segments.length === 1) {
9847
- // cut away from the left until the start of the highlighted sentence if just one sentence is highlighted
9848
- $522a690e0e2bd46d$var$cut_start(segmented_text.indexOf(highlighted_segments[0]), segmented_text);
9849
- return;
9850
- }
9851
- // We have two or more highlighted segments, take the two biggest chunks and show them + a bit text around
9852
- const sorted_highlighted_segments = [...highlighted_segments].sort((a, b) => b.text_.trim().length - a.text_.trim().length // trim to avoid unfair comparisons due to whitespace
9853
- );
9854
-
9855
- const [longest_segment, next_longest_segment] = sorted_highlighted_segments;
9856
- // We need to cut before the first segment - possibly through other segments - and maybe between segments
9857
- let [index_of_first_segment, index_of_second_segment] = [segmented_text.indexOf(longest_segment), segmented_text.indexOf(next_longest_segment)].sort((a, b) => a - b);
9858
- $522a690e0e2bd46d$var$cut_start(index_of_first_segment, segmented_text);
9859
- // update indexes since we might have removed segments
9860
- [index_of_first_segment, index_of_second_segment] = [segmented_text.indexOf(longest_segment), segmented_text.indexOf(next_longest_segment)].sort((a, b) => a - b);
9861
- let number_of_characters_between_segments = 0;
9862
- for (let i = index_of_first_segment + 1; i < index_of_second_segment; i++) {
9863
- const segment = segmented_text[i];
9864
- number_of_characters_between_segments += segment.text_.length;
9865
- }
9866
- if (number_of_characters_between_segments < $522a690e0e2bd46d$var$dont_cut_in_between_less_than_characters)
9867
- // don't cut if there are less than 30 characters between the two segments
9868
- return;
9869
- // We have more than 50 characters between the two segments, cut between them
9870
- const [split_start_segment, split_start_character] = $522a690e0e2bd46d$var$find_split_point(index_of_first_segment, index_of_second_segment, segmented_text);
9871
- const [split_end_segment, split_end_character] = $522a690e0e2bd46d$var$find_split_point(index_of_second_segment, index_of_first_segment, segmented_text);
9872
- if (split_start_segment === undefined || split_end_segment === undefined ||
9873
- // identical split point, or split end before split start, can't do anything
9874
- split_start_segment == split_end_segment && split_start_character >= split_end_character || split_start_segment > split_end_segment) return;
9875
- const dots_segment = {
9876
- text_: " … ",
9877
- highlighted_: false
9878
- };
9879
- const split_and_dotted_values = segmented_text.flatMap((segment, i) => {
9880
- if (i < split_start_segment || i > split_end_segment) return segment;
9881
- const text = segment.text_;
9882
- if (i == split_end_segment && i == split_start_segment) return [{
9883
- ...segment,
9884
- text_: text.slice(0, split_start_character).trimEnd()
9885
- }, dots_segment, {
9886
- ...segment,
9887
- text_: text.slice(split_end_character + 1, text.length).trimStart()
9888
- }];else if (i == split_start_segment) {
9889
- segment.text_ = text.slice(0, split_start_character).trimEnd(); // this would be split_start_character + 1, but we want to remove the last "dot" because . ... looks weird
9890
- return segment;
9891
- } else if (i == split_end_segment) return [dots_segment, {
9892
- ...segment,
9893
- text_: text.slice(split_end_character + 1, text.length).trimStart()
9894
- }];
9895
- return []; // remove all segments inbetween
9896
- });
9897
-
9898
- segmented_text.splice(0, segmented_text.length, ...split_and_dotted_values); // Sorry…
9899
- $522a690e0e2bd46d$var$heal_holes(segmented_text);
9900
- }
9901
- function $522a690e0e2bd46d$var$heal_holes(segmented_text) {
9902
- // try to heal "holes" created in the segments so there are only alternating segments
9903
- const segments_to_delete = new Set();
9904
- for (let i = 0; i < segmented_text.length; i++) {
9905
- const segment = segmented_text[i];
9906
- let previous_segment;
9907
- for (let j = i - 1; j >= 0; j--) {
9908
- previous_segment = segmented_text[j];
9909
- // Don't write to a segment that's marked for deletion or the contents we write to it will be deleted
9910
- if (!segments_to_delete.has(previous_segment)) break;
9911
- }
9912
- if (previous_segment?.highlighted_ && segment.highlighted_ || previous_segment?.highlighted_ === false && segment.highlighted_ === false) {
9913
- previous_segment.text_ += segment.text_; // IDK if this ever happens
9914
- segments_to_delete.add(segment);
9915
- }
9916
- }
9917
- for (const segment of segments_to_delete) {
9918
- const index = segmented_text.indexOf(segment);
9919
- segmented_text.splice(index, 1);
9920
- }
9921
- }
9922
- function $522a690e0e2bd46d$var$find_split_point(index_of_start_segment, index_of_end_segment, segmented_text, be_very_aggressive = true) {
9923
- const should_loop_backwards = index_of_start_segment > index_of_end_segment;
9924
- const step = should_loop_backwards ? -1 : 1;
9925
- const desperate_split_attempts = [":", ";", ","];
9926
- while (desperate_split_attempts.length) {
9927
- const split_point_between_words = [];
9928
- // for the middle also try to split with a few more characters if the default ones don't work over a full run
9929
- const desperate_split_attempt = desperate_split_attempts.pop();
9930
- let is_first_character = true;
9931
- for (let i = index_of_start_segment + step; should_loop_backwards ? i > index_of_end_segment : i < index_of_end_segment; i += step) {
9932
- const segment = segmented_text[i];
9933
- const text = segment.text_;
9934
- for (let j = should_loop_backwards ? text.length - 1 : 0; should_loop_backwards ? j >= 0 : j < text.length; j += step) {
9935
- const character = text[j];
9936
- if (character == "." || character == "?" || character == "!" || character == desperate_split_attempt) return [i, j]; // segment index, character index
9937
- if (is_first_character) is_first_character = false;else if (be_very_aggressive && character == " ") {
9938
- split_point_between_words.push([i, j]);
9939
- if (split_point_between_words.length > 3)
9940
- // We can't find a split point, so we'll just split between words
9941
- // This is because for UI reasons we only want to show 2 lines of text, so we need to be very aggressive with getting the second match soon
9942
- return split_point_between_words[1];
9943
- }
9944
- }
9945
- }
9946
- }
9947
- return [];
9948
- }
9949
- function $522a690e0e2bd46d$var$cut_start(cut_left_of_index, segmented_text) {
9950
- // Cut the start of the text to bring the first matching token
9951
- let is_first_character = false;
9952
- let words_encountered = 0;
9953
- outmost_loop: for (let i = cut_left_of_index - 1; i >= 0; i--) {
9954
- const segment = segmented_text[i];
9955
- // We assume that two adjacent highlighted segments don't exist and have been merged if they were to have existed
9956
- const text = segment.text_;
9957
- for (let j = text.length - 1; j >= 0; j--) {
9958
- const character = text[j];
9959
- const is_space = character == " ";
9960
- if (!is_first_character && is_space) words_encountered++;
9961
- if (character == "." || character == "?" || character == "!" || character == "," || words_encountered > 8 && is_space) {
9962
- // We have to be really aggressive at the start of sentences so stuff can be seen on mobile, hence comma
9963
- segment.text_ = text.slice(j + 1).trimStart();
9964
- segmented_text.splice(0, i);
9965
- if (character === "," || is_space)
9966
- // if we cut at a comma or psace, we add a … at the beginning
9967
- segmented_text.unshift({
9968
- text_: "… ",
9969
- highlighted_: false
9970
- });
9971
- break outmost_loop;
9972
- }
9973
- if (is_first_character) is_first_character = false;
9974
- }
9975
- }
9976
- $522a690e0e2bd46d$var$heal_holes(segmented_text); // if we added a ... there could now be a sequence that's not alternating true/false
9977
- }
9978
-
9979
- function $522a690e0e2bd46d$var$segment_text(text, matched_strings) {
9980
- // segment text where the matched strings are highlighted sections
9981
- const output = [];
9982
- if (!text) return; // shouldn't happen but whatever
9983
- for (let i = 0; i < text.length; i++) {
9984
- const found_strings = [];
9985
- if (!i || text[i - 1] == " ")
9986
- // only match at the start of a word or string, it looks weird if i.e. "we" is highlighted in "activewear
9987
- for (let j = 0; j < matched_strings.length; j++) {
9988
- const matched_string = matched_strings[j];
9989
- const part_in_text = text.slice(i, i + matched_string.length);
9990
- if (matched_string.length < 2) continue; // don't match on single characters, i.e. "I", it looks weird
9991
- if (part_in_text.toLowerCase() === matched_string.toLowerCase()) found_strings.push(part_in_text); // use the casing from the text, not from typesense, can look weird otherwise
9992
- }
9993
-
9994
- const last_index_in_output = output.length - 1;
9995
- if (!found_strings.length) {
9996
- const character = text[i];
9997
- if (output[last_index_in_output]?.highlighted_ === false || output.length && /\s/.test(character))
9998
- // always push whitespace characters to the last segment, this is because typesense doesn't see them as part of the matched tokens but we want to be able to detect "phat" matched segments
9999
- output[last_index_in_output].text_ += character;else output.push({
10000
- highlighted_: false,
10001
- text_: character
10002
- });
10003
- } else {
10004
- const longest_found_string = found_strings.reduce((a, b) => a.length > b.length ? a : b);
10005
- if (output[last_index_in_output]?.highlighted_) output[last_index_in_output].text_ += longest_found_string;else output.push({
10006
- highlighted_: true,
10007
- text_: longest_found_string
10008
- });
10009
- i += longest_found_string.length - 1;
10010
- }
10011
- }
10012
- return output;
10013
- }
10014
10260
  const $b2bf2cdcff8142d8$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<a>`),
10015
10261
  $b2bf2cdcff8142d8$var$_tmpl$2 = /*#__PURE__*/$9HbP8$template(`<div>`),
10016
10262
  $b2bf2cdcff8142d8$var$_tmpl$3 = /*#__PURE__*/$9HbP8$template(`<div class="description line-clamp">`),
@@ -11400,4 +11646,4 @@ const $4690a06c8489dcd0$export$c3834fa86c616831 = [[4], [3, 1024], [2, 901]];
11400
11646
  const $4690a06c8489dcd0$export$864d304a0bc46829 = "2%";
11401
11647
  const $4690a06c8489dcd0$export$7bf543b9d9be2c22 = (0, $e4615ecd1849548f$export$b91cec6bdc6b32a1);
11402
11648
  $9HbP8$add_to_version_info("ui", (0, $ec291e0010116877$export$83d89fbfd8236492));
11403
- export { $4147651646da990a$export$916e6850778505f6 as strip_encoded_filter_and_sort, $4147651646da990a$export$58aa3f171519b6d7 as encode_filters, $4147651646da990a$export$f934fa24c3a86811 as decode_filters, $660070e2a394b3c3$export$d7b7ab832c20e2f4 as shopifyContainedImageContextSymbol, $011607bdf658f807$export$e68cff63f76bd15b as ListingProvider, $011607bdf658f807$export$8d0c4fdbb05a2f2e as useListing, $660070e2a394b3c3$export$e4b984597b71e989 as ShopifyContainedImage, $f32e14878e75af51$export$6649caad96ef8870 as SlidableItems, $0fdb37d8ddabef25$export$9f191182275e9ef as make_accurate_size_accessor, $ee116da074deb002$export$9574e176201e5e8d as RecommendationSlider, $9ea5383493360761$export$9756467d34d91cdb as RecommendationGrid, $e8ffe11ed01df0fe$export$6e5611bc7e57e477 as ShopifyResponsiveImg, $e8ffe11ed01df0fe$export$e6fffe67d4cdd848 as makeSizeAccessor, $f18d425032111270$export$94026ee33dbabc26 as ImageContainer, $b7436a6d1fd64e3b$export$b69d0d92862de18b as SentryErrorBoundary, $6bb0a0c563dff4bb$export$6c6d7a51fa9aa15d as ExpandingDetails, $c16e74cfe125bb05$export$f091cbac892643a4 as accessor_of_object_to_object_with_accessor_values, $1adfe60f3a14a1d7$export$fecbb157621501bd as SelectedFilters, $fab07f52c9861732$export$3f1a388cc0d8fed7 as FilterBody, $5efb5894079b220e$export$b288c38ae3fddb56 as create_modified_filters, $c8d5ff4524619fcd$export$d21e32dfedac04be as SolidLayout, $194bd6b8e4c59830$export$79b1565500412d9b as general_modal_abstraction, $19976a74d273070d$export$3b621d86b1566b2 as CrossIcon, $fbbadcb080ad1d4a$export$8be2714ec7f169ee as GenericSliderArrowButton, $c58717f39bf51647$export$58e808b1db15d3bc as fetchDepictRecommendations, $961b5c64bef4662f$export$de035477d6fef996 as QuickLinks, $961b5c64bef4662f$export$5b7c3ce0ebe51f86 as BreadCrumbs, $e4615ecd1849548f$export$b91cec6bdc6b32a1 as CategoryTitle, $a6e23a834336fc19$export$824dde41348efed1 as embedded_num_products, $c9312089e8983364$export$643598a327b5833e as get_categories, $961b5c64bef4662f$export$f34314aa9505732e as DepictCategory, $961b5c64bef4662f$export$e2bf8ce7779e827e as CategoryPage, $806c97b931758897$export$ac6237957a15b3f0 as DepictSearch, $806c97b931758897$export$bde3eb976dfded9 as get_search_query_updating_blocked_signal, $806c97b931758897$export$f2dc7e4e4aa11abb as SearchPage, $806c97b931758897$export$316f6f283ae64765 as SearchField, $4fd48cb976bf1789$export$aa14a9f43128f61f as ProductCardError, $6891c018a834cfdd$export$d86a33413558014e as open_modal_with_alignment, $bb15dfb548a7666e$export$ee1733d9a8495996 as DefaultInstantCardPlaceholder, $b6d5529b253681aa$export$b3ad617e9036868 as align_field, $b5cccc8ee7d24677$export$6daf8749b65a1b77 as convert_sdk_cols_at_size_to_layout, $926b1b5ba2239356$export$1233ca167bf71f9a as styles_to_valid_css_string, $aea1edf92433e81e$export$fe334901e8bebd57 as disable_scrolling, $6e8944558258054f$export$d0596b5cae35ad4 as open_search_with_shift_slash, $7fa23e2a0079eca4$export$e015ed2f2950f2e3 as DepictAPI, $dc9262ef6f786812$export$d9f36cf74e24d595 as media_query_to_accessor, $6936724b9e0b98d5$export$689e204eadb33baf as setup_fast_leave, $bf52d9f9eebd1938$export$5196e4c01fa56fcb as show_toast, $8c0f86cb3e266eeb$export$a71e92cfbb498adc as SolidFormatPrice, $4ca91518c9a35379$export$828dcdd425fd3231 as connect_search_field_height_to_aligner_height, $d20eff0aadc28983$export$acb3eaade4b23afd as BasePlaceholder, $d134eae24341b4a1$export$89c6019e4baa40b1 as TextPlaceholder, $7f60f09116a3fe61$export$3f37af283f8fb843 as ImagePlaceholder, $753e9b2889a47c89$export$3ccaa27d81dd8556 as PageReplacer, $4690a06c8489dcd0$export$864d304a0bc46829 as defaultGridSpacing, $4690a06c8489dcd0$export$c3834fa86c616831 as defaultColsAtSize, $4690a06c8489dcd0$export$7bf543b9d9be2c22 as defaultCategoryTitlePlugin, $ec291e0010116877$export$83d89fbfd8236492 as version };
11649
+ export { $4147651646da990a$export$916e6850778505f6 as strip_encoded_filter_and_sort, $4147651646da990a$export$58aa3f171519b6d7 as encode_filters, $4147651646da990a$export$f934fa24c3a86811 as decode_filters, $660070e2a394b3c3$export$d7b7ab832c20e2f4 as shopifyContainedImageContextSymbol, $011607bdf658f807$export$e68cff63f76bd15b as ListingProvider, $011607bdf658f807$export$8d0c4fdbb05a2f2e as useListing, $660070e2a394b3c3$export$e4b984597b71e989 as ShopifyContainedImage, $f32e14878e75af51$export$6649caad96ef8870 as SlidableItems, $2449872a62a75a20$export$ebdc3711f7e02ccd as make_accurate_width_accessor, $ee116da074deb002$export$9574e176201e5e8d as RecommendationSlider, $9ea5383493360761$export$9756467d34d91cdb as RecommendationGrid, $e8ffe11ed01df0fe$export$6e5611bc7e57e477 as ShopifyResponsiveImg, $e8ffe11ed01df0fe$export$e6fffe67d4cdd848 as makeSizeAccessor, $f18d425032111270$export$94026ee33dbabc26 as ImageContainer, $b7436a6d1fd64e3b$export$b69d0d92862de18b as SentryErrorBoundary, $6bb0a0c563dff4bb$export$6c6d7a51fa9aa15d as ExpandingDetails, $c16e74cfe125bb05$export$f091cbac892643a4 as accessor_of_object_to_object_with_accessor_values, $1adfe60f3a14a1d7$export$fecbb157621501bd as SelectedFilters, $fab07f52c9861732$export$3f1a388cc0d8fed7 as FilterBody, $5efb5894079b220e$export$b288c38ae3fddb56 as create_modified_filters, $c8d5ff4524619fcd$export$d21e32dfedac04be as SolidLayout, $194bd6b8e4c59830$export$79b1565500412d9b as general_modal_abstraction, $19976a74d273070d$export$3b621d86b1566b2 as CrossIcon, $fbbadcb080ad1d4a$export$8be2714ec7f169ee as GenericSliderArrowButton, $c58717f39bf51647$export$58e808b1db15d3bc as fetchDepictRecommendations, $961b5c64bef4662f$export$de035477d6fef996 as QuickLinks, $961b5c64bef4662f$export$5b7c3ce0ebe51f86 as BreadCrumbs, $e4615ecd1849548f$export$b91cec6bdc6b32a1 as CategoryTitle, $a6e23a834336fc19$export$824dde41348efed1 as embedded_num_products, $c9312089e8983364$export$643598a327b5833e as get_categories, $961b5c64bef4662f$export$f34314aa9505732e as DepictCategory, $961b5c64bef4662f$export$e2bf8ce7779e827e as CategoryPage, $806c97b931758897$export$ac6237957a15b3f0 as DepictSearch, $806c97b931758897$export$bde3eb976dfded9 as get_search_query_updating_blocked_signal, $806c97b931758897$export$f2dc7e4e4aa11abb as SearchPage, $806c97b931758897$export$316f6f283ae64765 as SearchField, $4fd48cb976bf1789$export$aa14a9f43128f61f as ProductCardError, $6891c018a834cfdd$export$d86a33413558014e as open_modal_with_alignment, $bb15dfb548a7666e$export$ee1733d9a8495996 as DefaultInstantCardPlaceholder, $b6d5529b253681aa$export$b3ad617e9036868 as align_field, $b5cccc8ee7d24677$export$6daf8749b65a1b77 as convert_sdk_cols_at_size_to_layout, $926b1b5ba2239356$export$1233ca167bf71f9a as styles_to_valid_css_string, $aea1edf92433e81e$export$fe334901e8bebd57 as disable_scrolling, $6e8944558258054f$export$d0596b5cae35ad4 as open_search_with_shift_slash, $7fa23e2a0079eca4$export$e015ed2f2950f2e3 as DepictAPI, $dc9262ef6f786812$export$d9f36cf74e24d595 as media_query_to_accessor, $6936724b9e0b98d5$export$689e204eadb33baf as setup_fast_leave, $bf52d9f9eebd1938$export$5196e4c01fa56fcb as show_toast, $8c0f86cb3e266eeb$export$a71e92cfbb498adc as SolidFormatPrice, $4ca91518c9a35379$export$828dcdd425fd3231 as connect_search_field_height_to_aligner_height, $d20eff0aadc28983$export$acb3eaade4b23afd as BasePlaceholder, $d134eae24341b4a1$export$89c6019e4baa40b1 as TextPlaceholder, $7f60f09116a3fe61$export$3f37af283f8fb843 as ImagePlaceholder, $753e9b2889a47c89$export$3ccaa27d81dd8556 as PageReplacer, $4690a06c8489dcd0$export$864d304a0bc46829 as defaultGridSpacing, $4690a06c8489dcd0$export$c3834fa86c616831 as defaultColsAtSize, $4690a06c8489dcd0$export$7bf543b9d9be2c22 as defaultCategoryTitlePlugin, $ec291e0010116877$export$83d89fbfd8236492 as version };