@depict-ai/ui 1.4.4 → 1.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ES10/index.cjs +1080 -251
- package/ES10/index.d.ts +105 -24
- package/ES10/index.js +1080 -251
- package/latest/index.cjs +978 -219
- package/latest/index.d.ts +105 -24
- package/latest/index.js +978 -219
- package/locales/ES10/index.cjs +128 -26
- package/locales/ES10/index.d.ts +4 -1
- package/locales/ES10/index.js +128 -26
- package/locales/latest/index.cjs +128 -26
- package/locales/latest/index.d.ts +4 -1
- package/locales/latest/index.js +128 -26
- package/package.json +4 -4
- package/server/ES10/index.cjs +915 -179
- package/server/ES10/index.d.ts +105 -24
- package/server/ES10/index.js +915 -179
- package/server/latest/index.cjs +822 -153
- package/server/latest/index.d.ts +105 -24
- package/server/latest/index.js +822 -153
package/server/ES10/index.cjs
CHANGED
|
@@ -60,7 +60,7 @@ $parcel$export(module.exports, "defaultColsAtSize", () => $33eed84f447aa0c0$expo
|
|
|
60
60
|
$parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $33eed84f447aa0c0$export$7bf543b9d9be2c22);
|
|
61
61
|
$parcel$export(module.exports, "version", () => $aa1938dec50d6c12$export$83d89fbfd8236492);
|
|
62
62
|
/*! Depict.ai search and product listing SDK */
|
|
63
|
-
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "1.4.
|
|
63
|
+
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "1.4.6";
|
|
64
64
|
function $d6d51b09cb2116a6$export$5bad61ecde080b1f() {
|
|
65
65
|
const {
|
|
66
66
|
collapse: collapse,
|
|
@@ -439,7 +439,7 @@ function $c5842bdb10e57229$export$fecbb157621501bd(_ref) {
|
|
|
439
439
|
return outmost_element;
|
|
440
440
|
}
|
|
441
441
|
const $6b92e147c6e24046$var$_tmpl$ = ["<span", ' class="count">', "</span>"],
|
|
442
|
-
$6b92e147c6e24046$var$_tmpl$2 = ["<label", ' class="', '"', '><div class="left"><input type="checkbox"', "", '><span class="custom-indicator"></span><span class="text">', "</span></div><!--#-->", "<!--/--></label>"];
|
|
442
|
+
$6b92e147c6e24046$var$_tmpl$2 = ["<label", ' class="', '"', '><div class="left"><input type="checkbox"', "", '><span class="custom-indicator"></span><span class="text line-clamp">', "</span></div><!--#-->", "<!--/--></label>"];
|
|
443
443
|
const $6b92e147c6e24046$export$48513f6b9f8ce62d = props => {
|
|
444
444
|
// 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
|
|
445
445
|
const count = (0, $3hooq$solidjs.createMemo)(() => props.count_);
|
|
@@ -2073,9 +2073,14 @@ function $6c2c739b113a8ddf$var$ActualSolidLayout(props, container_element) {
|
|
|
2073
2073
|
// Copy of Layout from utilishared but using solid-js signals instead of async iterable IPNS
|
|
2074
2074
|
const show_all_rows = (0, $3hooq$solidjs.createMemo)(() => props.rows === "all");
|
|
2075
2075
|
const rows_or_empty_object = (0, $3hooq$solidjs.createMemo)(() => show_all_rows() ? {} : props.rows);
|
|
2076
|
-
const
|
|
2077
|
-
const
|
|
2078
|
-
|
|
2076
|
+
const view_more_button_elements = (0, $e82d0d417fa613e8$export$2f0cbfbb4354bb52)((0, $3hooq$solidjs.createMemo)(() => rows_or_empty_object().button));
|
|
2077
|
+
const view_less_button_elements = (0, $e82d0d417fa613e8$export$2f0cbfbb4354bb52)((0, $3hooq$solidjs.createMemo)(() => rows_or_empty_object().view_less_button));
|
|
2078
|
+
const have_a_view_more_button = (0, $3hooq$solidjs.createMemo)(() => {
|
|
2079
|
+
const button = view_more_button_elements();
|
|
2080
|
+
return !(!button || Array.isArray(button) && !button.length);
|
|
2081
|
+
});
|
|
2082
|
+
const have_a_view_less_button = (0, $3hooq$solidjs.createMemo)(() => {
|
|
2083
|
+
const button = view_less_button_elements();
|
|
2079
2084
|
return !(!button || Array.isArray(button) && !button.length);
|
|
2080
2085
|
});
|
|
2081
2086
|
const [get_styling, set_styling] = (0, $3hooq$solidjs.createSignal)();
|
|
@@ -2084,12 +2089,18 @@ function $6c2c739b113a8ddf$var$ActualSolidLayout(props, container_element) {
|
|
|
2084
2089
|
const [get_children_count, set_children_count] = (0, $3hooq$solidjs.createSignal)(0);
|
|
2085
2090
|
const update_children_count = () => set_children_count(container_element.children.length);
|
|
2086
2091
|
const col_styling = (0, $3hooq$solidjs.createMemo)(() => (0, $3hooq$depictaiutilishared.n_col_styling_with_dist)(selector_beginning, props.grid_spacing, props.cols_at_size, props.layout, props.override_vertical_spacing));
|
|
2087
|
-
const default_currently_visible_signal = (0, $3hooq$solidjs.createSignal)(0)
|
|
2092
|
+
const default_currently_visible_signal = (0, $3hooq$solidjs.createSignal)((0, $3hooq$solidjs.untrack)(() => {
|
|
2093
|
+
var _rows_or_empty_object;
|
|
2094
|
+
return (_rows_or_empty_object = rows_or_empty_object().start_rows) !== null && _rows_or_empty_object !== void 0 ? _rows_or_empty_object : 1;
|
|
2095
|
+
})); // Keep this signal here, so it doesn't change when rows_or_empty_object and I think it's to be expected that the "internal default signal" stays the same
|
|
2088
2096
|
const rows_visible_signal = (0, $3hooq$solidjs.createMemo)(() => rows_or_empty_object().currently_visible || default_currently_visible_signal);
|
|
2089
2097
|
const get_rows_visible = (0, $3hooq$solidjs.createMemo)(() => rows_visible_signal()[0]());
|
|
2090
2098
|
const set_rows_visible = (0, $3hooq$solidjs.createMemo)(() => rows_visible_signal()[1]);
|
|
2091
|
-
const
|
|
2092
|
-
const
|
|
2099
|
+
const view_more_button_class = (0, $3hooq$depictaiutilishared.make_random_classname)();
|
|
2100
|
+
const view_less_button_class = (0, $3hooq$depictaiutilishared.make_random_classname)();
|
|
2101
|
+
const view_more_button_container = (0, $3hooq$solidjs.createMemo)(() => have_a_view_more_button() && (0, $3hooq$solidjsweb.ssr)($6c2c739b113a8ddf$var$_tmpl$, (0, $3hooq$solidjsweb.ssrHydrationKey)(), "load-more-container ".concat((0, $3hooq$solidjsweb.escape)(view_more_button_class, true)), (0, $3hooq$solidjsweb.escape)(rows_or_empty_object().button)));
|
|
2102
|
+
// We need to have duplicate buttons because which ones is shown depends on the number of rows visible and therefore on the viewport size and therefore on the css media queries
|
|
2103
|
+
const view_less_button_container = (0, $3hooq$solidjs.createMemo)(() => have_a_view_less_button() && (0, $3hooq$solidjsweb.ssr)($6c2c739b113a8ddf$var$_tmpl$, (0, $3hooq$solidjsweb.ssrHydrationKey)(), "load-less-container ".concat((0, $3hooq$solidjsweb.escape)(view_less_button_class, true)), (0, $3hooq$solidjsweb.escape)(rows_or_empty_object().view_less_button)));
|
|
2093
2104
|
container_element.classList.add(container_class);
|
|
2094
2105
|
(0, $3hooq$solidjs.createComputed)(() => {
|
|
2095
2106
|
// Make sure we don't have more rows visible than max_rows (this could happen by max_rows being decreased)
|
|
@@ -2104,10 +2115,6 @@ function $6c2c739b113a8ddf$var$ActualSolidLayout(props, container_element) {
|
|
|
2104
2115
|
set_styling(() => col_styling);
|
|
2105
2116
|
return;
|
|
2106
2117
|
}
|
|
2107
|
-
(0, $3hooq$solidjs.untrack)(() => {
|
|
2108
|
-
var _rows_or_empty_object;
|
|
2109
|
-
return set_rows_visible()((_rows_or_empty_object = rows_or_empty_object().start_rows) !== null && _rows_or_empty_object !== void 0 ? _rows_or_empty_object : 1);
|
|
2110
|
-
});
|
|
2111
2118
|
update_children_count();
|
|
2112
2119
|
const mutation_observer = new MutationObserver((0, $3hooq$depictaiutilishared.catchify)(update_children_count));
|
|
2113
2120
|
mutation_observer.observe(container_element, {
|
|
@@ -2119,30 +2126,33 @@ function $6c2c739b113a8ddf$var$ActualSolidLayout(props, container_element) {
|
|
|
2119
2126
|
() => (0, $3hooq$solidjs.createMemo)(() => {
|
|
2120
2127
|
const {
|
|
2121
2128
|
rows_per_click: rows_per_click,
|
|
2122
|
-
max_rows = -1
|
|
2129
|
+
max_rows = -1,
|
|
2130
|
+
start_rows: start_rows
|
|
2123
2131
|
} = rows_or_empty_object();
|
|
2124
2132
|
const rows_visible = get_rows_visible();
|
|
2125
2133
|
const children_count = get_children_count();
|
|
2126
2134
|
return col_styling() + props.cols_at_size.map(options => {
|
|
2127
|
-
const [, min, max] = options;
|
|
2128
|
-
let
|
|
2135
|
+
const [recs_per_row, min, max] = options;
|
|
2136
|
+
let should_hide_view_more_button;
|
|
2129
2137
|
let visible_recs;
|
|
2130
2138
|
if (props.disable_partial_rows) {
|
|
2131
2139
|
visible_recs = (0, $3hooq$depictaiutilishared.layout_get_visible_recs_without_partial_rows)(rows_visible, children_count, options);
|
|
2132
2140
|
const visible_recs_next_show_more = (0, $3hooq$depictaiutilishared.layout_get_visible_recs_without_partial_rows)(rows_visible + (rows_per_click || 0),
|
|
2133
2141
|
// Should this really be zero when we default rows_per_click to 1?
|
|
2134
2142
|
children_count, options);
|
|
2135
|
-
|
|
2143
|
+
should_hide_view_more_button = visible_recs === visible_recs_next_show_more;
|
|
2136
2144
|
} else {
|
|
2137
2145
|
visible_recs = (0, $3hooq$depictaiutilishared.layout_get_total_rec_amount_for_row)(rows_visible, options);
|
|
2138
|
-
|
|
2146
|
+
should_hide_view_more_button = visible_recs >= children_count;
|
|
2139
2147
|
}
|
|
2140
|
-
const should_hide_button_final =
|
|
2141
|
-
|
|
2148
|
+
const should_hide_button_final = should_hide_view_more_button || max_rows !== -1 && rows_visible >= max_rows;
|
|
2149
|
+
// I don't really understand the logic for when the view more button gets hidden so IDK if below is correct, but it works how it should for now
|
|
2150
|
+
const should_hide_view_less_button = !should_hide_view_more_button || start_rows == undefined || rows_visible <= start_rows || children_count <= recs_per_row * start_rows;
|
|
2151
|
+
return "".concat((0, $3hooq$depictaiutilishared.layout_media_query_header)(min, max), "{").concat(selector_beginning, ":nth-child(n+").concat(visible_recs + 1, "){display:none}").concat(props.layout == "slider" ? "".concat(selector_beginning, ":nth-child(n+").concat(visible_recs, "){margin-right:0}") : "").concat(should_hide_button_final ? ".depict .".concat(view_more_button_class, "{display:none!important}") : "").concat(should_hide_view_less_button ? ".depict .".concat(view_less_button_class, "{display:none!important}") : "", "}");
|
|
2142
2152
|
}).join("");
|
|
2143
2153
|
}));
|
|
2144
2154
|
});
|
|
2145
|
-
return [container_element,
|
|
2155
|
+
return [container_element, view_more_button_container(), view_less_button_container(), (0, $3hooq$solidjsweb.ssr)($6c2c739b113a8ddf$var$_tmpl$2, (0, $3hooq$solidjsweb.ssrHydrationKey)(), get_styling)];
|
|
2146
2156
|
}
|
|
2147
2157
|
async function $4cf7d9829d60d844$export$79b1565500412d9b(search_modal, modal_fn_opts) {
|
|
2148
2158
|
const body = await (0, $3hooq$depictaiutilishared.observer).wait_for_element("body");
|
|
@@ -2247,6 +2257,43 @@ function $367b536a2a94d24e$var$history_state_change(signals, entries, state) {
|
|
|
2247
2257
|
}
|
|
2248
2258
|
});
|
|
2249
2259
|
}
|
|
2260
|
+
const $cfcd56242923775d$export$3064e1e8c6513da3 = new Set();
|
|
2261
|
+
let $cfcd56242923775d$var$has_ran = false;
|
|
2262
|
+
function $cfcd56242923775d$export$5162a71f252e6122() {
|
|
2263
|
+
if ($cfcd56242923775d$var$has_ran || typeof history !== "object") return;
|
|
2264
|
+
$cfcd56242923775d$var$has_ran = true;
|
|
2265
|
+
for (const function_name of ["replaceState", "pushState"]) {
|
|
2266
|
+
if (Object.getOwnPropertyNames(history).includes(function_name)) $cfcd56242923775d$var$proxy_push_state(function_name, history);
|
|
2267
|
+
$cfcd56242923775d$var$proxy_push_state(function_name, History.prototype);
|
|
2268
|
+
}
|
|
2269
|
+
}
|
|
2270
|
+
function $cfcd56242923775d$var$proxy_push_state(function_name, thing) {
|
|
2271
|
+
thing[function_name] = new Proxy(thing[function_name], {
|
|
2272
|
+
apply(target, this_arg, arg_list) {
|
|
2273
|
+
try {
|
|
2274
|
+
if (typeof arg_list[0] == "object") {
|
|
2275
|
+
const cloned_object = {
|
|
2276
|
+
...arg_list[0]
|
|
2277
|
+
};
|
|
2278
|
+
const old_state = history.state;
|
|
2279
|
+
for (const key in old_state) {
|
|
2280
|
+
if (!$cfcd56242923775d$var$starts_with_any_prefix(key)) continue;
|
|
2281
|
+
if (!(key in cloned_object)) cloned_object[key] = old_state[key];
|
|
2282
|
+
}
|
|
2283
|
+
arg_list[0] = cloned_object;
|
|
2284
|
+
}
|
|
2285
|
+
} catch (e) {
|
|
2286
|
+
(0, $3hooq$depictaiutilishared.report)([e, "Failed to preserve items in history.state"], "error");
|
|
2287
|
+
}
|
|
2288
|
+
return Reflect.apply(target, this_arg, arg_list);
|
|
2289
|
+
}
|
|
2290
|
+
});
|
|
2291
|
+
}
|
|
2292
|
+
function $cfcd56242923775d$var$starts_with_any_prefix(key) {
|
|
2293
|
+
for (const prefix of $cfcd56242923775d$export$3064e1e8c6513da3) {
|
|
2294
|
+
if (key.startsWith(prefix)) return true;
|
|
2295
|
+
}
|
|
2296
|
+
}
|
|
2250
2297
|
function $2b15291bd38ac551$export$9862539c89138352(_ref) {
|
|
2251
2298
|
let {
|
|
2252
2299
|
get_default_values_: get_default_values_,
|
|
@@ -2273,6 +2320,8 @@ function $2b15291bd38ac551$export$9862539c89138352(_ref) {
|
|
|
2273
2320
|
let [key, value] = _ref3;
|
|
2274
2321
|
return [key.slice(prefix_.length), value];
|
|
2275
2322
|
}));
|
|
2323
|
+
(0, $cfcd56242923775d$export$3064e1e8c6513da3).add(prefix_);
|
|
2324
|
+
// There's intentionally no onCleanup here since we want to preserve the state even if all components (in i.e. react-ui) that use the provider running this are unmounted and the provider is destroyed, since it might be re-created and need the old state (for example for doing scroll restoration)
|
|
2276
2325
|
return [reset_state, unprefixed_state];
|
|
2277
2326
|
}
|
|
2278
2327
|
|
|
@@ -2334,16 +2383,17 @@ var $e270e9f953fcbc58$var$_get_user_id = /*#__PURE__*/new WeakMap();
|
|
|
2334
2383
|
var $e270e9f953fcbc58$var$_get_session_id = /*#__PURE__*/new WeakMap();
|
|
2335
2384
|
var $e270e9f953fcbc58$var$_guard_url_creator_length = /*#__PURE__*/new WeakSet();
|
|
2336
2385
|
var $e270e9f953fcbc58$var$_run_url_creator_for_suggest = /*#__PURE__*/new WeakSet();
|
|
2337
|
-
var $e270e9f953fcbc58$var$
|
|
2386
|
+
var $e270e9f953fcbc58$var$_run_display_transformers_for_rest = /*#__PURE__*/new WeakSet();
|
|
2338
2387
|
var $e270e9f953fcbc58$var$_cached_post_request = /*#__PURE__*/new WeakSet();
|
|
2339
2388
|
class $e270e9f953fcbc58$export$e015ed2f2950f2e3 {
|
|
2340
2389
|
constructor(options) {
|
|
2341
2390
|
$e270e9f953fcbc58$var$_classPrivateMethodInitSpec(this, $e270e9f953fcbc58$var$_cached_post_request);
|
|
2342
|
-
$e270e9f953fcbc58$var$_classPrivateMethodInitSpec(this, $e270e9f953fcbc58$var$
|
|
2391
|
+
$e270e9f953fcbc58$var$_classPrivateMethodInitSpec(this, $e270e9f953fcbc58$var$_run_display_transformers_for_rest);
|
|
2343
2392
|
$e270e9f953fcbc58$var$_classPrivateMethodInitSpec(this, $e270e9f953fcbc58$var$_run_url_creator_for_suggest);
|
|
2344
2393
|
$e270e9f953fcbc58$var$_classPrivateMethodInitSpec(this, $e270e9f953fcbc58$var$_guard_url_creator_length);
|
|
2345
2394
|
$e270e9f953fcbc58$var$_classPrivateMethodInitSpec(this, $e270e9f953fcbc58$var$_get_cache_obj_for_endpoint);
|
|
2346
2395
|
(0, $parcel$interopDefault($3hooq$babelruntimehelpersdefineProperty))(this, "page_url_creator", void 0);
|
|
2396
|
+
(0, $parcel$interopDefault($3hooq$babelruntimehelpersdefineProperty))(this, "display_transformers", void 0);
|
|
2347
2397
|
$e270e9f953fcbc58$var$_classPrivateFieldInitSpec(this, $e270e9f953fcbc58$var$_supports_finalization_registry, {
|
|
2348
2398
|
writable: true,
|
|
2349
2399
|
value: typeof FinalizationRegistry === "function"
|
|
@@ -2382,12 +2432,14 @@ class $e270e9f953fcbc58$export$e015ed2f2950f2e3 {
|
|
|
2382
2432
|
get_metadata: get_metadata,
|
|
2383
2433
|
get_user_id: _get_user_id2,
|
|
2384
2434
|
get_session_id: _get_session_id2,
|
|
2385
|
-
page_url_creator:
|
|
2435
|
+
page_url_creator: _page_url_creator,
|
|
2436
|
+
display_transformers: _display_transformers
|
|
2386
2437
|
} = options !== null && options !== void 0 ? options : {};
|
|
2387
2438
|
(0, $parcel$interopDefault($3hooq$babelruntimehelpersclassPrivateFieldSet))(this, $e270e9f953fcbc58$var$_get_metadata, get_metadata);
|
|
2388
2439
|
(0, $parcel$interopDefault($3hooq$babelruntimehelpersclassPrivateFieldSet))(this, $e270e9f953fcbc58$var$_get_user_id, _get_user_id2);
|
|
2389
2440
|
(0, $parcel$interopDefault($3hooq$babelruntimehelpersclassPrivateFieldSet))(this, $e270e9f953fcbc58$var$_get_session_id, _get_session_id2);
|
|
2390
|
-
this.page_url_creator =
|
|
2441
|
+
this.page_url_creator = _page_url_creator;
|
|
2442
|
+
this.display_transformers = _display_transformers;
|
|
2391
2443
|
}
|
|
2392
2444
|
async suggest(input_req) {
|
|
2393
2445
|
var _classPrivateFieldGet4;
|
|
@@ -2464,14 +2516,19 @@ function $e270e9f953fcbc58$var$_guard_url_creator_length2(expected, received) {
|
|
|
2464
2516
|
}
|
|
2465
2517
|
}
|
|
2466
2518
|
async function $e270e9f953fcbc58$var$_run_url_creator_for_suggest2(merchant, market, response) {
|
|
2467
|
-
|
|
2519
|
+
var _this$display_transfo;
|
|
2520
|
+
const page_url_creator = this.page_url_creator;
|
|
2521
|
+
const category_transformer = (_this$display_transfo = this.display_transformers) === null || _this$display_transfo === void 0 ? void 0 : _this$display_transfo.categories;
|
|
2522
|
+
if (!page_url_creator && !category_transformer) return response;
|
|
2468
2523
|
// find category suggestions, run thing with them, and then replace them
|
|
2469
2524
|
const category_suggestions = response.suggestions.filter(suggestion => suggestion.type === "category");
|
|
2470
|
-
const page_urls = await
|
|
2471
|
-
type: "categories",
|
|
2525
|
+
const page_urls = await (page_url_creator || category_transformer)({
|
|
2472
2526
|
market: market,
|
|
2473
2527
|
merchant: merchant,
|
|
2474
|
-
data: [...category_suggestions]
|
|
2528
|
+
data: [...category_suggestions],
|
|
2529
|
+
...(page_url_creator ? {
|
|
2530
|
+
type: "categories"
|
|
2531
|
+
} : {})
|
|
2475
2532
|
});
|
|
2476
2533
|
$e270e9f953fcbc58$var$_classPrivateMethodGet(this, $e270e9f953fcbc58$var$_guard_url_creator_length, $e270e9f953fcbc58$var$_guard_url_creator_length2).call(this, category_suggestions, page_urls);
|
|
2477
2534
|
while (page_urls.length)
|
|
@@ -2479,17 +2536,29 @@ async function $e270e9f953fcbc58$var$_run_url_creator_for_suggest2(merchant, mar
|
|
|
2479
2536
|
Object.defineProperties(category_suggestions.pop(), Object.getOwnPropertyDescriptors(page_urls.pop()));
|
|
2480
2537
|
return response;
|
|
2481
2538
|
}
|
|
2482
|
-
async function $e270e9f953fcbc58$var$
|
|
2483
|
-
|
|
2539
|
+
async function $e270e9f953fcbc58$var$_run_display_transformers_for_rest2(merchant, market, input_data) {
|
|
2540
|
+
const {
|
|
2541
|
+
page_url_creator: page_url_creator,
|
|
2542
|
+
display_transformers: display_transformers
|
|
2543
|
+
} = this;
|
|
2544
|
+
if (!page_url_creator && !display_transformers) return input_data;
|
|
2545
|
+
const product_transformer = display_transformers === null || display_transformers === void 0 ? void 0 : display_transformers.products;
|
|
2546
|
+
const category_transformer = display_transformers === null || display_transformers === void 0 ? void 0 : display_transformers.categories;
|
|
2547
|
+
const content_result_transformer = display_transformers === null || display_transformers === void 0 ? void 0 : display_transformers.contentResults;
|
|
2484
2548
|
const displays = input_data.displays;
|
|
2485
|
-
const
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2549
|
+
const {
|
|
2550
|
+
breadcrumb: breadcrumb,
|
|
2551
|
+
quick_links: quick_links,
|
|
2552
|
+
content_search_links: content_search_links
|
|
2553
|
+
} = input_data;
|
|
2554
|
+
if (displays && (page_url_creator || product_transformer)) {
|
|
2555
|
+
const page_urls = await (page_url_creator || product_transformer)({
|
|
2490
2556
|
merchant: merchant,
|
|
2491
2557
|
market: market,
|
|
2492
|
-
displays: [...input_data.displays]
|
|
2558
|
+
displays: [...input_data.displays],
|
|
2559
|
+
...(page_url_creator ? {
|
|
2560
|
+
type: "products"
|
|
2561
|
+
} : {})
|
|
2493
2562
|
});
|
|
2494
2563
|
$e270e9f953fcbc58$var$_classPrivateMethodGet(this, $e270e9f953fcbc58$var$_guard_url_creator_length, $e270e9f953fcbc58$var$_guard_url_creator_length2).call(this, displays, page_urls);
|
|
2495
2564
|
for (let i = 0; i < displays.length; i++) {
|
|
@@ -2507,19 +2576,30 @@ async function $e270e9f953fcbc58$var$_run_url_creator_for_rest2(merchant, market
|
|
|
2507
2576
|
displays[i] = new_display_or_page_url;
|
|
2508
2577
|
}
|
|
2509
2578
|
}
|
|
2510
|
-
for (const category_display_array of [breadcrumb, quick_links]) {
|
|
2579
|
+
if (page_url_creator || category_transformer) for (const category_display_array of [breadcrumb, quick_links]) {
|
|
2511
2580
|
if (!category_display_array) continue;
|
|
2512
|
-
const page_urls = await
|
|
2513
|
-
type: "categories",
|
|
2581
|
+
const page_urls = await (page_url_creator || category_transformer)({
|
|
2514
2582
|
merchant: merchant,
|
|
2515
2583
|
market: market,
|
|
2516
|
-
data: [...category_display_array]
|
|
2584
|
+
data: [...category_display_array],
|
|
2585
|
+
...(page_url_creator ? {
|
|
2586
|
+
type: "categories"
|
|
2587
|
+
} : {})
|
|
2517
2588
|
});
|
|
2518
2589
|
$e270e9f953fcbc58$var$_classPrivateMethodGet(this, $e270e9f953fcbc58$var$_guard_url_creator_length, $e270e9f953fcbc58$var$_guard_url_creator_length2).call(this, category_display_array, page_urls);
|
|
2519
2590
|
for (let i = 0; i < category_display_array.length; i++)
|
|
2520
2591
|
// Copy over getters so we sneakily can make this reactive
|
|
2521
2592
|
Object.defineProperties(category_display_array[i], Object.getOwnPropertyDescriptors(page_urls[i]));
|
|
2522
2593
|
}
|
|
2594
|
+
if (content_search_links !== null && content_search_links !== void 0 && content_search_links.length && content_result_transformer) {
|
|
2595
|
+
const result = await content_result_transformer({
|
|
2596
|
+
merchant: merchant,
|
|
2597
|
+
market: market,
|
|
2598
|
+
data: [...content_search_links]
|
|
2599
|
+
});
|
|
2600
|
+
$e270e9f953fcbc58$var$_classPrivateMethodGet(this, $e270e9f953fcbc58$var$_guard_url_creator_length, $e270e9f953fcbc58$var$_guard_url_creator_length2).call(this, content_search_links, result);
|
|
2601
|
+
input_data.content_search_links = result;
|
|
2602
|
+
}
|
|
2523
2603
|
return input_data;
|
|
2524
2604
|
}
|
|
2525
2605
|
async function $e270e9f953fcbc58$var$_cached_post_request2(endpoint, input_req, fallback_response) {
|
|
@@ -2547,7 +2627,7 @@ async function $e270e9f953fcbc58$var$_cached_post_request2(endpoint, input_req,
|
|
|
2547
2627
|
let result;
|
|
2548
2628
|
try {
|
|
2549
2629
|
const unmodified_result = await api_response.json();
|
|
2550
|
-
result = await $e270e9f953fcbc58$var$_classPrivateMethodGet(this, $e270e9f953fcbc58$var$
|
|
2630
|
+
result = await $e270e9f953fcbc58$var$_classPrivateMethodGet(this, $e270e9f953fcbc58$var$_run_display_transformers_for_rest, $e270e9f953fcbc58$var$_run_display_transformers_for_rest2).call(this, input_req.tenant, input_req.market, unmodified_result);
|
|
2551
2631
|
} catch (e) {
|
|
2552
2632
|
(0, $3hooq$depictaiutilishared.dwarn)("URL creator or json decoding failed", e);
|
|
2553
2633
|
break return_successfully;
|
|
@@ -2637,12 +2717,11 @@ function $55f06aa93e360e7f$var$correct_range_filter_range_once(_ref3) {
|
|
|
2637
2717
|
}
|
|
2638
2718
|
function $068bde7fa83ac02c$export$92f2da32c6e7e7ee(_ref) {
|
|
2639
2719
|
let {
|
|
2640
|
-
|
|
2720
|
+
number_: number_,
|
|
2641
2721
|
i18n_: i18n_
|
|
2642
2722
|
} = _ref;
|
|
2643
2723
|
return (0, $3hooq$solidjs.createMemo)(() => {
|
|
2644
|
-
|
|
2645
|
-
const n_hits = (_search_results_ = search_results_()) === null || _search_results_ === void 0 ? void 0 : _search_results_.n_hits;
|
|
2724
|
+
const n_hits = number_();
|
|
2646
2725
|
if (isNaN(n_hits)) return "";
|
|
2647
2726
|
const price_formatting = i18n_.price_formatting_();
|
|
2648
2727
|
return (0, $3hooq$depictaiutilishared.standard_price_format)(n_hits, 0,
|
|
@@ -4863,7 +4942,10 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
4863
4942
|
const [sort_or_filter_open_, set_sort_or_filter_open_] = (0, $3hooq$solidjs.createSignal)(false);
|
|
4864
4943
|
const [desktop_filter_elements_, set_desktop_filter_elements] = (0, $3hooq$solidjs.createSignal)();
|
|
4865
4944
|
const formatted_number_of_results_ = (0, $068bde7fa83ac02c$export$92f2da32c6e7e7ee)({
|
|
4866
|
-
|
|
4945
|
+
number_: (0, $3hooq$solidjs.createMemo)(() => {
|
|
4946
|
+
var _plp_results_5;
|
|
4947
|
+
return (_plp_results_5 = plp_results_()) === null || _plp_results_5 === void 0 ? void 0 : _plp_results_5.n_hits;
|
|
4948
|
+
}),
|
|
4867
4949
|
i18n_: i18n_
|
|
4868
4950
|
});
|
|
4869
4951
|
const [sort_and_filter_element_, set_sort_and_filter_element_] = (0, $3hooq$solidjs.createSignal)();
|
|
@@ -4886,8 +4968,8 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
4886
4968
|
}
|
|
4887
4969
|
})), (0, $3hooq$solidjsweb.escape)((0, $3hooq$solidjsweb.createComponent)((0, $3hooq$solidjs.Show), {
|
|
4888
4970
|
get when() {
|
|
4889
|
-
var
|
|
4890
|
-
return ((
|
|
4971
|
+
var _plp_results_6;
|
|
4972
|
+
return ((_plp_results_6 = plp_results_()) === null || _plp_results_6 === void 0 ? void 0 : _plp_results_6.n_hits) === 1;
|
|
4891
4973
|
},
|
|
4892
4974
|
get fallback() {
|
|
4893
4975
|
return i18n_.products_();
|
|
@@ -5069,8 +5151,8 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
5069
5151
|
formatted_number_of_results_: formatted_number_of_results_,
|
|
5070
5152
|
i18n_: i18n_,
|
|
5071
5153
|
number_of_results_: (0, $3hooq$solidjs.createMemo)(() => {
|
|
5072
|
-
var
|
|
5073
|
-
return (
|
|
5154
|
+
var _plp_results_7;
|
|
5155
|
+
return (_plp_results_7 = plp_results_()) === null || _plp_results_7 === void 0 ? void 0 : _plp_results_7.n_hits;
|
|
5074
5156
|
})
|
|
5075
5157
|
});
|
|
5076
5158
|
}
|
|
@@ -5088,37 +5170,6 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
5088
5170
|
}
|
|
5089
5171
|
})))];
|
|
5090
5172
|
}
|
|
5091
|
-
let $cfcd56242923775d$var$has_ran = false;
|
|
5092
|
-
function $cfcd56242923775d$export$5162a71f252e6122() {
|
|
5093
|
-
if ($cfcd56242923775d$var$has_ran || typeof history !== "object") return;
|
|
5094
|
-
$cfcd56242923775d$var$has_ran = true;
|
|
5095
|
-
for (const function_name of ["replaceState", "pushState"]) {
|
|
5096
|
-
if (Object.getOwnPropertyNames(history).includes(function_name)) $cfcd56242923775d$var$proxy_push_state(function_name, history);
|
|
5097
|
-
$cfcd56242923775d$var$proxy_push_state(function_name, History.prototype);
|
|
5098
|
-
}
|
|
5099
|
-
}
|
|
5100
|
-
function $cfcd56242923775d$var$proxy_push_state(function_name, thing) {
|
|
5101
|
-
thing[function_name] = new Proxy(thing[function_name], {
|
|
5102
|
-
apply(target, this_arg, arg_list) {
|
|
5103
|
-
try {
|
|
5104
|
-
if (typeof arg_list[0] == "object") {
|
|
5105
|
-
const cloned_object = {
|
|
5106
|
-
...arg_list[0]
|
|
5107
|
-
};
|
|
5108
|
-
const old_state = history.state;
|
|
5109
|
-
for (const key in old_state) {
|
|
5110
|
-
if (!key.startsWith("category_") && !key.startsWith("search_")) continue;
|
|
5111
|
-
if (!(key in cloned_object)) cloned_object[key] = old_state[key];
|
|
5112
|
-
}
|
|
5113
|
-
arg_list[0] = cloned_object;
|
|
5114
|
-
}
|
|
5115
|
-
} catch (e) {
|
|
5116
|
-
(0, $3hooq$depictaiutilishared.report)([e, "Failed to preserve items in history.state"], "error");
|
|
5117
|
-
}
|
|
5118
|
-
return Reflect.apply(target, this_arg, arg_list);
|
|
5119
|
-
}
|
|
5120
|
-
});
|
|
5121
|
-
}
|
|
5122
5173
|
const $5401a6698b0c0658$var$transform_elements = sorted_cols_at_size => {
|
|
5123
5174
|
const cols_at_size = [];
|
|
5124
5175
|
for (let i = 0; i < sorted_cols_at_size.length; i++) {
|
|
@@ -5461,7 +5512,6 @@ function $9cbefc32b9dab36d$var$_classApplyDescriptorGet(receiver, descriptor) {
|
|
|
5461
5512
|
return descriptor.value;
|
|
5462
5513
|
}
|
|
5463
5514
|
// We just pass page_url_creator to DepictAPI when we instantiate it, so don't allow it to be specified if api is already specified
|
|
5464
|
-
// on old displays, no page_url_creator can be specified
|
|
5465
5515
|
/**
|
|
5466
5516
|
* Type for the private properties that are shared between the different exported search SDK wrapper functions.
|
|
5467
5517
|
* SDK users are not allowed to change/access these, they're an internal implementation detail.
|
|
@@ -5524,6 +5574,7 @@ class $9cbefc32b9dab36d$export$f34314aa9505732e {
|
|
|
5524
5574
|
api: api,
|
|
5525
5575
|
on_navigation: on_navigation,
|
|
5526
5576
|
page_url_creator: page_url_creator,
|
|
5577
|
+
display_transformers: display_transformers,
|
|
5527
5578
|
unique_instance_key_for_state = "",
|
|
5528
5579
|
query_id_state_key: query_id_state_key,
|
|
5529
5580
|
...props_on_class
|
|
@@ -5592,8 +5643,10 @@ class $9cbefc32b9dab36d$export$f34314aa9505732e {
|
|
|
5592
5643
|
quicklinks_signal_: (0, $3hooq$solidjs.createSignal)(),
|
|
5593
5644
|
i18n_: i18n_,
|
|
5594
5645
|
reset_history_state_: reset_history_state_,
|
|
5646
|
+
// @ts-ignore
|
|
5595
5647
|
depict_api_: api !== null && api !== void 0 ? api : new (0, $e270e9f953fcbc58$export$e015ed2f2950f2e3)({
|
|
5596
|
-
page_url_creator: page_url_creator
|
|
5648
|
+
page_url_creator: page_url_creator,
|
|
5649
|
+
display_transformers: display_transformers
|
|
5597
5650
|
}),
|
|
5598
5651
|
router_: (0, $parcel$interopDefault($3hooq$babelruntimehelpersclassPrivateFieldGet))(this, $9cbefc32b9dab36d$var$_router),
|
|
5599
5652
|
selected_filters_: selected_filters_,
|
|
@@ -6078,13 +6131,12 @@ function $c77adcdf5346b187$export$7de92c4c2205ebf3(_ref) {
|
|
|
6078
6131
|
});
|
|
6079
6132
|
}
|
|
6080
6133
|
function $c77adcdf5346b187$var$make_state_saved_rows(_ref3, i18n_) {
|
|
6081
|
-
var _untrack;
|
|
6082
6134
|
let [get_showing_recommendation_rows, set_showing_recommendation_rows] = _ref3;
|
|
6083
|
-
const currently_visible = (0, $3hooq$solidjs.createSignal)(0);
|
|
6135
|
+
const currently_visible = (0, $3hooq$solidjs.createSignal)((0, $3hooq$solidjs.untrack)(get_showing_recommendation_rows));
|
|
6084
6136
|
const [get_currently_visible, set_currently_visible] = currently_visible;
|
|
6085
6137
|
const rows = {
|
|
6086
6138
|
currently_visible: currently_visible,
|
|
6087
|
-
start_rows:
|
|
6139
|
+
start_rows: $c77adcdf5346b187$export$1c8c715550dc689d,
|
|
6088
6140
|
rows_per_click: 3,
|
|
6089
6141
|
button: (0, $3hooq$solidjsweb.ssr)($c77adcdf5346b187$var$_tmpl$2, (0, $3hooq$solidjsweb.ssrHydrationKey)(), (0, $3hooq$solidjsweb.escape)(i18n_.view_more_()))
|
|
6090
6142
|
};
|
|
@@ -6253,7 +6305,7 @@ const $65353359a9fbdacd$export$27b710c08412a7ad = obj => {
|
|
|
6253
6305
|
return Object.fromEntries(Object.keys(obj).map(key => [key, obj[key]()]));
|
|
6254
6306
|
};
|
|
6255
6307
|
const $82d079b68975fbf7$var$_tmpl$ = ["<span", ' class="orig price"><!--#-->', "<!--/--><!--#-->", "<!--/--><!--#-->", "<!--/--></span>"],
|
|
6256
|
-
$82d079b68975fbf7$var$_tmpl$2 = ["<a", ' class="instant-card"', '><div class="img-part">', '</div><div class="right-part"><div class="title-brand-tagline"><span class="brand">', '</span><span class="title">', "</span><!--#-->", '<!--/--></div><div class="price-container"><!--#-->', '<!--/--><span class="', '"><!--#-->', "<!--/--><!--#-->", "<!--/--><!--#-->", "<!--/--></span></div></div></a>"],
|
|
6308
|
+
$82d079b68975fbf7$var$_tmpl$2 = ["<a", ' class="instant-card"', '><div class="img-part">', '</div><div class="right-part"><div class="title-brand-tagline"><span class="brand">', '</span><span class="title line-clamp">', "</span><!--#-->", '<!--/--></div><div class="price-container"><!--#-->', '<!--/--><span class="', '"><!--#-->', "<!--/--><!--#-->", "<!--/--><!--#-->", "<!--/--></span></div></div></a>"],
|
|
6257
6309
|
$82d079b68975fbf7$var$_tmpl$3 = ["<div", ' class="tagline">', "</div>"];
|
|
6258
6310
|
const $82d079b68975fbf7$export$b05c0ae390cf3e06 = (display_or_variant_container, _ref, router_) => {
|
|
6259
6311
|
let {
|
|
@@ -6326,9 +6378,11 @@ function $6e8d48eea3d0469d$export$62f101a8aa597bf8(_ref) {
|
|
|
6326
6378
|
render_instant_card_placeholder_: render_instant_card_placeholder_,
|
|
6327
6379
|
min_products_to_fetch_: min_products_to_fetch_,
|
|
6328
6380
|
has_sort_or_filters_: has_sort_or_filters_,
|
|
6329
|
-
|
|
6381
|
+
set_total_num_results_accessor_: set_total_num_results_accessor_,
|
|
6330
6382
|
i18n_: i18n_,
|
|
6331
|
-
router_: router_
|
|
6383
|
+
router_: router_,
|
|
6384
|
+
set_modal_search_results_: set_modal_search_results_,
|
|
6385
|
+
content_search_enabled_: content_search_enabled_
|
|
6332
6386
|
} = _ref;
|
|
6333
6387
|
const max_cards = 4;
|
|
6334
6388
|
const [read_current_instant_query, write_current_instant_query] = (0, $3hooq$solidjs.createSignal)("");
|
|
@@ -6353,13 +6407,23 @@ function $6e8d48eea3d0469d$export$62f101a8aa597bf8(_ref) {
|
|
|
6353
6407
|
...variable_data
|
|
6354
6408
|
});
|
|
6355
6409
|
}));
|
|
6356
|
-
|
|
6357
|
-
|
|
6410
|
+
// Maybe we should move this createResoure out of this component, on the other hand it bloats the parent component and if it fails it takes more than needed with it, so I think writing the content results from here is better
|
|
6411
|
+
// This is for the press-enter-to-instant-content-result feature which gets called from Autocomplete.tsx
|
|
6412
|
+
set_modal_search_results_(() => search_results);
|
|
6413
|
+
(0, $3hooq$solidjs.onCleanup)(() => set_modal_search_results_(undefined)); // for consistency, in case this component crashes
|
|
6414
|
+
set_total_num_results_accessor_(() => (0, $068bde7fa83ac02c$export$92f2da32c6e7e7ee)({
|
|
6415
|
+
number_: (0, $3hooq$solidjs.createMemo)(() => {
|
|
6416
|
+
var _search_results, _search_results2, _search_results2$cont;
|
|
6417
|
+
const hits = (_search_results = search_results()) === null || _search_results === void 0 ? void 0 : _search_results.n_hits;
|
|
6418
|
+
const content_results = (_search_results2 = search_results()) === null || _search_results2 === void 0 ? void 0 : (_search_results2$cont = _search_results2.content_search_links) === null || _search_results2$cont === void 0 ? void 0 : _search_results2$cont.length;
|
|
6419
|
+
if (!content_results || !content_search_enabled_()) return hits;
|
|
6420
|
+
return (hits !== null && hits !== void 0 ? hits : 0) + content_results;
|
|
6421
|
+
}),
|
|
6358
6422
|
i18n_: i18n_
|
|
6359
6423
|
}));
|
|
6360
6424
|
const sliced_displays = (0, $3hooq$solidjs.createMemo)(() => {
|
|
6361
|
-
var
|
|
6362
|
-
return (
|
|
6425
|
+
var _search_results3, _search_results3$disp;
|
|
6426
|
+
return (_search_results3 = search_results()) === null || _search_results3 === void 0 ? void 0 : (_search_results3$disp = _search_results3.displays) === null || _search_results3$disp === void 0 ? void 0 : _search_results3$disp.slice(0, max_cards);
|
|
6363
6427
|
});
|
|
6364
6428
|
let placeholder;
|
|
6365
6429
|
return (0, $3hooq$solidjsweb.ssr)($6e8d48eea3d0469d$var$_tmpl$, (0, $3hooq$solidjsweb.ssrHydrationKey)(), (0, $3hooq$solidjsweb.escape)((0, $3hooq$solidjsweb.createComponent)((0, $3hooq$solidjs.Show), {
|
|
@@ -6369,8 +6433,8 @@ function $6e8d48eea3d0469d$export$62f101a8aa597bf8(_ref) {
|
|
|
6369
6433
|
},
|
|
6370
6434
|
get fallback() {
|
|
6371
6435
|
return (0, $3hooq$solidjs.createMemo)(() => {
|
|
6372
|
-
var
|
|
6373
|
-
if (Array.isArray((
|
|
6436
|
+
var _search_results4;
|
|
6437
|
+
if (Array.isArray((_search_results4 = search_results()) === null || _search_results4 === void 0 ? void 0 : _search_results4.displays))
|
|
6374
6438
|
// remove placeholders if we have a response but no results
|
|
6375
6439
|
return undefined;
|
|
6376
6440
|
return new Array(max_cards).fill(1).map(() => (placeholder || (placeholder = render_instant_card_placeholder_())).cloneNode(true));
|
|
@@ -6425,7 +6489,7 @@ function $8767e7eba5066d2b$export$5d2caaa6b530761c() {
|
|
|
6425
6489
|
return (0, $3hooq$solidjsweb.ssr)($8767e7eba5066d2b$var$_tmpl$, (0, $3hooq$solidjsweb.ssrHydrationKey)());
|
|
6426
6490
|
}
|
|
6427
6491
|
const $4edbc04f5c5a1843$var$_tmpl$ = ["<div", ' class="previous-searches"><h2 class="text">', '</h2><div class="list">', "</div></div>"],
|
|
6428
|
-
$4edbc04f5c5a1843$var$_tmpl$2 = ["<a", ' class="', '"', '><div class="left"><!--#-->',
|
|
6492
|
+
$4edbc04f5c5a1843$var$_tmpl$2 = ["<a", ' class="', '"', '><div class="left"><!--#-->', '<!--/--><span class="line-clamp"', ">", '</span></div><button class="delete"', ">", "</button></a>"];
|
|
6429
6493
|
function $4edbc04f5c5a1843$export$a146ac6fa8346a25(_ref) {
|
|
6430
6494
|
let {
|
|
6431
6495
|
text_: text_,
|
|
@@ -6469,14 +6533,14 @@ function $4edbc04f5c5a1843$export$a146ac6fa8346a25(_ref) {
|
|
|
6469
6533
|
return (0, $3hooq$solidjsweb.ssr)($4edbc04f5c5a1843$var$_tmpl$2, (0, $3hooq$solidjsweb.ssrHydrationKey)(), "".concat("item", " ").concat((0, $3hooq$solidjs.createMemo)(() => {
|
|
6470
6534
|
var _read_selected_index_, _read_selected_index_2;
|
|
6471
6535
|
return ((_read_selected_index_ = read_selected_index_()) === null || _read_selected_index_ === void 0 ? void 0 : _read_selected_index_[0]) === 0 && ((_read_selected_index_2 = read_selected_index_()) === null || _read_selected_index_2 === void 0 ? void 0 : _read_selected_index_2[1]) === index;
|
|
6472
|
-
})() ? "selected" : ""), (0, $3hooq$solidjsweb.ssrAttribute)("href", (0, $3hooq$solidjsweb.escape)(href(), true), false), (0, $3hooq$solidjsweb.escape)((0, $3hooq$solidjsweb.createComponent)((0, $8767e7eba5066d2b$export$5d2caaa6b530761c), {})), (0, $3hooq$solidjsweb.escape)(item()), (0, $3hooq$solidjsweb.ssrAttribute)("title", (0, $3hooq$solidjsweb.escape)(i18n_.previous_searches_delete_entry_from_history_(), true), false), (0, $3hooq$solidjsweb.escape)((0, $3hooq$solidjsweb.createComponent)((0, $083b2336093176cf$export$3b621d86b1566b2), {})));
|
|
6536
|
+
})() ? "selected" : ""), (0, $3hooq$solidjsweb.ssrAttribute)("href", (0, $3hooq$solidjsweb.escape)(href(), true), false), (0, $3hooq$solidjsweb.escape)((0, $3hooq$solidjsweb.createComponent)((0, $8767e7eba5066d2b$export$5d2caaa6b530761c), {})), (0, $3hooq$solidjsweb.ssrAttribute)("title", (0, $3hooq$solidjsweb.escape)(item(), true), false), (0, $3hooq$solidjsweb.escape)(item()), (0, $3hooq$solidjsweb.ssrAttribute)("title", (0, $3hooq$solidjsweb.escape)(i18n_.previous_searches_delete_entry_from_history_(), true), false), (0, $3hooq$solidjsweb.escape)((0, $3hooq$solidjsweb.createComponent)((0, $083b2336093176cf$export$3b621d86b1566b2), {})));
|
|
6473
6537
|
}
|
|
6474
6538
|
})));
|
|
6475
6539
|
}
|
|
6476
6540
|
});
|
|
6477
6541
|
}
|
|
6478
6542
|
const $23c3f390dee33ff8$var$_tmpl$ = ["<span", ' class="highlighted-part">', "</span>"],
|
|
6479
|
-
$23c3f390dee33ff8$var$_tmpl$2 = ["<span", ' class="', '"
|
|
6543
|
+
$23c3f390dee33ff8$var$_tmpl$2 = ["<span", ' class="', '"', ">", "</span>"];
|
|
6480
6544
|
function $23c3f390dee33ff8$export$ba17c5b7e6dda39f(_ref) {
|
|
6481
6545
|
let {
|
|
6482
6546
|
whole_text_to_display_: whole_text_to_display_memo,
|
|
@@ -6527,16 +6591,28 @@ function $23c3f390dee33ff8$export$ba17c5b7e6dda39f(_ref) {
|
|
|
6527
6591
|
}
|
|
6528
6592
|
return output;
|
|
6529
6593
|
}));
|
|
6530
|
-
return (0, $3hooq$solidjsweb.ssr)($23c3f390dee33ff8$var$_tmpl$2, (0, $3hooq$solidjsweb.ssrHydrationKey)(), "".concat((0, $3hooq$solidjsweb.escape)(class_, true) || "", " ").concat(get_has_highlighted() ? "has-history-match" : ""), (0, $3hooq$solidjsweb.escape)(text_itself()));
|
|
6594
|
+
return (0, $3hooq$solidjsweb.ssr)($23c3f390dee33ff8$var$_tmpl$2, (0, $3hooq$solidjsweb.ssrHydrationKey)(), "".concat((0, $3hooq$solidjsweb.escape)(class_, true) || "", " ").concat(get_has_highlighted() ? "has-history-match" : ""), (0, $3hooq$solidjsweb.ssrAttribute)("title", (0, $3hooq$solidjsweb.escape)(whole_text_to_display_memo(), true), false), (0, $3hooq$solidjsweb.escape)(text_itself()));
|
|
6595
|
+
}
|
|
6596
|
+
const $3cf7b4db1e203c93$var$_tmpl$ = '<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"></path>';
|
|
6597
|
+
function $3cf7b4db1e203c93$export$605674723bcc715c() {
|
|
6598
|
+
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
6599
|
+
return (0, $3hooq$solidjsweb.ssrElement)("svg", () => ({
|
|
6600
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
6601
|
+
"width": "32",
|
|
6602
|
+
"height": "32",
|
|
6603
|
+
"viewBox": "0 0 256 256",
|
|
6604
|
+
...props
|
|
6605
|
+
}), () => (0, $3hooq$solidjsweb.ssr)($3cf7b4db1e203c93$var$_tmpl$), true);
|
|
6531
6606
|
}
|
|
6532
6607
|
const $0677d509ad208e22$var$_tmpl$ = ["<a", ' class="', '"', ">", "</a>"],
|
|
6533
6608
|
$0677d509ad208e22$var$_tmpl$2 = ["<div", ' class="search-icon">', "</div>"],
|
|
6534
6609
|
$0677d509ad208e22$var$_tmpl$3 = ["<span", ' class="type">', "</span>"],
|
|
6535
6610
|
$0677d509ad208e22$var$_tmpl$4 = ["<div", "><!--#-->", '<!--/--><span class="value">', "</span></div>"],
|
|
6536
|
-
$0677d509ad208e22$var$_tmpl$5 = ["<
|
|
6537
|
-
$0677d509ad208e22$var$_tmpl$6 = ["<
|
|
6538
|
-
$0677d509ad208e22$var$_tmpl$7 = ["<div", ' class="suggestion-container
|
|
6539
|
-
$0677d509ad208e22$var$_tmpl$8 = ["<div", ' class="
|
|
6611
|
+
$0677d509ad208e22$var$_tmpl$5 = ["<div", ' class="with-icon"><!--#-->', "<!--/--><!--#-->", "<!--/--></div>"],
|
|
6612
|
+
$0677d509ad208e22$var$_tmpl$6 = ["<h2", ' class="text">', "</h2>"],
|
|
6613
|
+
$0677d509ad208e22$var$_tmpl$7 = ["<div", ' class="suggestion-container query"><!--#-->', "<!--/--><!--#-->", "<!--/--></div>"],
|
|
6614
|
+
$0677d509ad208e22$var$_tmpl$8 = ["<div", ' class="suggestion-container page">', "</div>"],
|
|
6615
|
+
$0677d509ad208e22$var$_tmpl$9 = ["<div", ' class="', '"><!--#-->', "<!--/--><!--#-->", "<!--/--><!--#-->", "<!--/--></div>"];
|
|
6540
6616
|
function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
|
|
6541
6617
|
let {
|
|
6542
6618
|
suggestion_memo_: suggestion_memo_,
|
|
@@ -6550,7 +6626,8 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
|
|
|
6550
6626
|
include_category_suggestions_: include_category_suggestions_,
|
|
6551
6627
|
searching_for_value_: searching_for_value_,
|
|
6552
6628
|
router_: router_,
|
|
6553
|
-
submit_query_: submit_query_
|
|
6629
|
+
submit_query_: submit_query_,
|
|
6630
|
+
get_content_results_: get_content_results_
|
|
6554
6631
|
} = _ref;
|
|
6555
6632
|
const queries_memo = (0, $3hooq$solidjs.createMemo)(() => suggestion_memo_().filter(_ref2 => {
|
|
6556
6633
|
let {
|
|
@@ -6561,12 +6638,18 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
|
|
|
6561
6638
|
} // don't show the ones we already show from the history
|
|
6562
6639
|
));
|
|
6563
6640
|
|
|
6564
|
-
const not_queries_memo = (0, $3hooq$solidjs.createMemo)(() =>
|
|
6565
|
-
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
|
|
6641
|
+
const not_queries_memo = (0, $3hooq$solidjs.createMemo)(() => {
|
|
6642
|
+
// For the section that shows categories and content results
|
|
6643
|
+
// We want to limit to 3 items, and we want to show the categories first
|
|
6644
|
+
const content_results = get_content_results_() || [];
|
|
6645
|
+
const from_suggest_request = include_category_suggestions_ ? suggestion_memo_().filter(_ref3 => {
|
|
6646
|
+
let {
|
|
6647
|
+
type: type
|
|
6648
|
+
} = _ref3;
|
|
6649
|
+
return type !== (0, $ce079d50d380ee11$export$3cf9497e790da491);
|
|
6650
|
+
}) : [];
|
|
6651
|
+
return [...from_suggest_request.slice(0, content_results.length ? 2 : 3), ...content_results.slice(0, 1)];
|
|
6652
|
+
});
|
|
6570
6653
|
const render_entry = function (input_obj, autocomplete_data_index, index) {
|
|
6571
6654
|
let is_history = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
6572
6655
|
const is_query = (0, $3hooq$solidjs.createMemo)(() => input_obj().type === (0, $ce079d50d380ee11$export$3cf9497e790da491));
|
|
@@ -6576,10 +6659,11 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
|
|
|
6576
6659
|
url_transformer_: url_transformer_
|
|
6577
6660
|
}) : undefined);
|
|
6578
6661
|
const href = (0, $3hooq$solidjs.createMemo)(() => is_query() ? href_with_changed_params_accessor()() : input_obj().page_url);
|
|
6579
|
-
|
|
6662
|
+
const is_selected = (0, $3hooq$solidjs.createMemo)(() => {
|
|
6580
6663
|
var _read_selected_index_, _read_selected_index_2;
|
|
6581
6664
|
return ((_read_selected_index_ = read_selected_index_()) === null || _read_selected_index_ === void 0 ? void 0 : _read_selected_index_[0]) === autocomplete_data_index && ((_read_selected_index_2 = read_selected_index_()) === null || _read_selected_index_2 === void 0 ? void 0 : _read_selected_index_2[1]) === index;
|
|
6582
|
-
})
|
|
6665
|
+
});
|
|
6666
|
+
return (0, $3hooq$solidjsweb.ssr)($0677d509ad208e22$var$_tmpl$, (0, $3hooq$solidjsweb.ssrHydrationKey)(), "suggestion ".concat(is_selected() ? "selected" : "", " ").concat(is_history ? "history" : "", " ").concat((0, $3hooq$solidjsweb.escape)((0, $3hooq$solidjsweb.escape)("type-" + input_obj().type, true), true)), (0, $3hooq$solidjsweb.ssrAttribute)("href", (0, $3hooq$solidjsweb.escape)(href(), true), false), is_query() ? (0, $3hooq$solidjsweb.escape)([(0, $3hooq$solidjsweb.createComponent)((0, $3hooq$solidjs.Show), {
|
|
6583
6667
|
when: is_history,
|
|
6584
6668
|
get fallback() {
|
|
6585
6669
|
return (0, $3hooq$solidjsweb.ssr)($0677d509ad208e22$var$_tmpl$2, (0, $3hooq$solidjsweb.ssrHydrationKey)(), (0, $3hooq$solidjsweb.escape)((0, $3hooq$solidjsweb.createComponent)((0, $5b88b077e48a4451$export$82eafebb825fc23f), {})));
|
|
@@ -6588,24 +6672,34 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
|
|
|
6588
6672
|
return (0, $3hooq$solidjsweb.createComponent)((0, $8767e7eba5066d2b$export$5d2caaa6b530761c), {});
|
|
6589
6673
|
}
|
|
6590
6674
|
}), (0, $3hooq$solidjsweb.createComponent)((0, $23c3f390dee33ff8$export$ba17c5b7e6dda39f), {
|
|
6591
|
-
class_: "value",
|
|
6675
|
+
class_: "value line-clamp",
|
|
6676
|
+
get whole_text_to_display_() {
|
|
6677
|
+
return (0, $3hooq$solidjs.createMemo)(() => input_obj().title);
|
|
6678
|
+
},
|
|
6679
|
+
searching_for_value_: searching_for_value_
|
|
6680
|
+
})]) : (0, $3hooq$solidjsweb.escape)([typeof input_obj() /* this is a harmless lie */.parent_title === "string" ? (0, $3hooq$solidjsweb.ssr)($0677d509ad208e22$var$_tmpl$4, (0, $3hooq$solidjsweb.ssrHydrationKey)(), (0, $3hooq$solidjsweb.escape)((0, $3hooq$solidjsweb.createComponent)((0, $23c3f390dee33ff8$export$ba17c5b7e6dda39f), {
|
|
6681
|
+
class_: "category line-clamp",
|
|
6592
6682
|
get whole_text_to_display_() {
|
|
6593
6683
|
return (0, $3hooq$solidjs.createMemo)(() => input_obj().title);
|
|
6594
6684
|
},
|
|
6595
6685
|
searching_for_value_: searching_for_value_
|
|
6596
|
-
})
|
|
6597
|
-
|
|
6686
|
+
})), (0, $3hooq$solidjsweb.escape)(input_obj().parent_title)) : input_obj().type === "content" ? (0, $3hooq$solidjsweb.ssr)($0677d509ad208e22$var$_tmpl$5, (0, $3hooq$solidjsweb.ssrHydrationKey)(), (0, $3hooq$solidjsweb.escape)((0, $3hooq$solidjsweb.createComponent)((0, $3cf7b4db1e203c93$export$605674723bcc715c), {
|
|
6687
|
+
width: "16",
|
|
6688
|
+
height: "16"
|
|
6689
|
+
})), (0, $3hooq$solidjsweb.escape)((0, $3hooq$solidjsweb.createComponent)((0, $23c3f390dee33ff8$export$ba17c5b7e6dda39f), {
|
|
6690
|
+
class_: "content line-clamp",
|
|
6598
6691
|
get whole_text_to_display_() {
|
|
6599
6692
|
return (0, $3hooq$solidjs.createMemo)(() => input_obj().title);
|
|
6600
6693
|
},
|
|
6601
6694
|
searching_for_value_: searching_for_value_
|
|
6602
|
-
}))
|
|
6603
|
-
class_: "category",
|
|
6695
|
+
}))) : (0, $3hooq$solidjsweb.createComponent)((0, $23c3f390dee33ff8$export$ba17c5b7e6dda39f), {
|
|
6696
|
+
class_: "category line-clamp",
|
|
6604
6697
|
get whole_text_to_display_() {
|
|
6605
6698
|
return (0, $3hooq$solidjs.createMemo)(() => input_obj().title);
|
|
6606
6699
|
},
|
|
6607
6700
|
searching_for_value_: searching_for_value_
|
|
6608
6701
|
}), (0, $3hooq$solidjsweb.ssr)($0677d509ad208e22$var$_tmpl$3, (0, $3hooq$solidjsweb.ssrHydrationKey)(), (0, $3hooq$solidjsweb.escape)((0, $3hooq$solidjs.createMemo)(() => {
|
|
6702
|
+
if (input_obj().type === "content") return i18n_.content_();
|
|
6609
6703
|
if (input_obj().category_type === "BRAND") return i18n_.brand_();
|
|
6610
6704
|
return i18n_.category_();
|
|
6611
6705
|
})()))]));
|
|
@@ -6622,8 +6716,8 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
|
|
|
6622
6716
|
};
|
|
6623
6717
|
const should_show_previous_searches_in_query_part = (0, $3hooq$solidjs.createMemo)(() => !on_previous_searches_page_());
|
|
6624
6718
|
const should_show_at_all = (0, $3hooq$solidjs.createMemo)(() => {
|
|
6625
|
-
var _suggestion_memo_;
|
|
6626
|
-
return ((_suggestion_memo_ = suggestion_memo_()) === null || _suggestion_memo_ === void 0 ? void 0 : _suggestion_memo_.length) || should_show_previous_searches_in_query_part() && filtered_previous_searches_().length;
|
|
6719
|
+
var _suggestion_memo_, _get_content_results_;
|
|
6720
|
+
return ((_suggestion_memo_ = suggestion_memo_()) === null || _suggestion_memo_ === void 0 ? void 0 : _suggestion_memo_.length) || should_show_previous_searches_in_query_part() && filtered_previous_searches_().length || ((_get_content_results_ = get_content_results_()) === null || _get_content_results_ === void 0 ? void 0 : _get_content_results_.length);
|
|
6627
6721
|
});
|
|
6628
6722
|
const should_show_query_part = (0, $3hooq$solidjs.createMemo)(() => queries_memo().length || filtered_previous_searches_().length);
|
|
6629
6723
|
return (0, $3hooq$solidjsweb.createComponent)((0, $3hooq$solidjs.Show), {
|
|
@@ -6631,19 +6725,19 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
|
|
|
6631
6725
|
return should_show_at_all();
|
|
6632
6726
|
},
|
|
6633
6727
|
get children() {
|
|
6634
|
-
return (0, $3hooq$solidjsweb.ssr)($0677d509ad208e22$var$_tmpl$
|
|
6728
|
+
return (0, $3hooq$solidjsweb.ssr)($0677d509ad208e22$var$_tmpl$9, (0, $3hooq$solidjsweb.ssrHydrationKey)(), "suggestions ".concat(on_previous_searches_page_() ? "compact" : ""), (0, $3hooq$solidjsweb.escape)((0, $3hooq$solidjsweb.createComponent)((0, $3hooq$solidjs.Show), {
|
|
6635
6729
|
get when() {
|
|
6636
6730
|
return on_previous_searches_page_();
|
|
6637
6731
|
},
|
|
6638
6732
|
get children() {
|
|
6639
|
-
return (0, $3hooq$solidjsweb.ssr)($0677d509ad208e22$var$_tmpl$
|
|
6733
|
+
return (0, $3hooq$solidjsweb.ssr)($0677d509ad208e22$var$_tmpl$6, (0, $3hooq$solidjsweb.ssrHydrationKey)(), (0, $3hooq$solidjsweb.escape)(i18n_.suggestions_()));
|
|
6640
6734
|
}
|
|
6641
6735
|
})), (0, $3hooq$solidjsweb.escape)((0, $3hooq$solidjsweb.createComponent)((0, $3hooq$solidjs.Show), {
|
|
6642
6736
|
get when() {
|
|
6643
6737
|
return should_show_query_part();
|
|
6644
6738
|
},
|
|
6645
6739
|
get children() {
|
|
6646
|
-
return (0, $3hooq$solidjsweb.ssr)($0677d509ad208e22$var$_tmpl$
|
|
6740
|
+
return (0, $3hooq$solidjsweb.ssr)($0677d509ad208e22$var$_tmpl$7, (0, $3hooq$solidjsweb.ssrHydrationKey)(), (0, $3hooq$solidjsweb.escape)((0, $3hooq$solidjsweb.createComponent)((0, $3hooq$solidjs.Show), {
|
|
6647
6741
|
get when() {
|
|
6648
6742
|
return should_show_previous_searches_in_query_part();
|
|
6649
6743
|
},
|
|
@@ -6679,11 +6773,11 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
|
|
|
6679
6773
|
}
|
|
6680
6774
|
})), (0, $3hooq$solidjsweb.escape)((0, $3hooq$solidjsweb.createComponent)((0, $3hooq$solidjs.Show), {
|
|
6681
6775
|
get when() {
|
|
6682
|
-
return not_queries_memo().length
|
|
6776
|
+
return not_queries_memo().length;
|
|
6683
6777
|
},
|
|
6684
6778
|
keyed: false,
|
|
6685
6779
|
get children() {
|
|
6686
|
-
return (0, $3hooq$solidjsweb.ssr)($0677d509ad208e22$var$_tmpl$
|
|
6780
|
+
return (0, $3hooq$solidjsweb.ssr)($0677d509ad208e22$var$_tmpl$8, (0, $3hooq$solidjsweb.ssrHydrationKey)(), (() => {
|
|
6687
6781
|
const index_in_autocomplete = 3;
|
|
6688
6782
|
set_list_until_cleanup(not_queries_memo, index_in_autocomplete);
|
|
6689
6783
|
return (0, $3hooq$solidjsweb.escape)((0, $3hooq$solidjsweb.createComponent)((0, $3hooq$solidjs.Index), {
|
|
@@ -6698,7 +6792,18 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
|
|
|
6698
6792
|
}
|
|
6699
6793
|
});
|
|
6700
6794
|
}
|
|
6701
|
-
const $
|
|
6795
|
+
const $1730e5b4d47679a3$var$_tmpl$ = ["<a", ' target="_blank"></a>'];
|
|
6796
|
+
function $1730e5b4d47679a3$export$1efe1013da60d0e4(e, href) {
|
|
6797
|
+
if (e.metaKey || e.ctrlKey) {
|
|
6798
|
+
// Open link in a new tab with cmd/ctrl + enter.
|
|
6799
|
+
const link = (0, $3hooq$solidjsweb.ssr)($1730e5b4d47679a3$var$_tmpl$, (0, $3hooq$solidjsweb.ssrHydrationKey)() + (0, $3hooq$solidjsweb.ssrAttribute)("href", (0, $3hooq$solidjsweb.escape)(href, true), false));
|
|
6800
|
+
document.body.append(link);
|
|
6801
|
+
link.click();
|
|
6802
|
+
link.remove();
|
|
6803
|
+
return true;
|
|
6804
|
+
}
|
|
6805
|
+
return false;
|
|
6806
|
+
}
|
|
6702
6807
|
function $1a7b2e0cdf65293a$export$217899a935ef803b(_ref) {
|
|
6703
6808
|
let {
|
|
6704
6809
|
selected_index_: [read_selected_index, write_selected_index],
|
|
@@ -6776,6 +6881,7 @@ function $1a7b2e0cdf65293a$var$actual_navigation_working_on_fake_data(_ref2) {
|
|
|
6776
6881
|
const sfv = get_search_field_value();
|
|
6777
6882
|
if (!(0, $3hooq$solidjs.untrack)(() => read_updating_blocked())) previous_value = sfv;
|
|
6778
6883
|
});
|
|
6884
|
+
const owner = (0, $3hooq$solidjs.getOwner)();
|
|
6779
6885
|
const handler = (0, $3hooq$depictaiutilishared.catchify)(_ref3 => {
|
|
6780
6886
|
let {
|
|
6781
6887
|
keyCode: keyCode
|
|
@@ -6808,29 +6914,29 @@ function $1a7b2e0cdf65293a$var$actual_navigation_working_on_fake_data(_ref2) {
|
|
|
6808
6914
|
const {
|
|
6809
6915
|
title: title
|
|
6810
6916
|
} = selected_entry;
|
|
6811
|
-
|
|
6917
|
+
(0, $3hooq$solidjs.runWithOwner)(owner, block_updating_for_one_change);
|
|
6812
6918
|
set_search_field_value(title);
|
|
6813
|
-
override_on_enter_for_this_entry(e => {
|
|
6919
|
+
(0, $3hooq$solidjs.runWithOwner)(owner, () => override_on_enter_for_this_entry(e => {
|
|
6814
6920
|
// Open search query in new tab on cmd+enter
|
|
6815
6921
|
// If it's not cmd+enter, pressing enter will just submit the value that was put into the field while selecting with the arrow keys ;)
|
|
6816
6922
|
const url = new URL(location);
|
|
6817
6923
|
url_transformer_ === null || url_transformer_ === void 0 || url_transformer_(url);
|
|
6818
6924
|
url.searchParams.set(search_query_param_name_, title);
|
|
6819
|
-
return $
|
|
6820
|
-
});
|
|
6821
|
-
} else if ((selected_entry === null || selected_entry === void 0 ? void 0 : selected_entry.type) == "category") override_on_enter_for_this_entry(e => {
|
|
6925
|
+
return (0, $1730e5b4d47679a3$export$1efe1013da60d0e4)(e, url.href);
|
|
6926
|
+
}));
|
|
6927
|
+
} else if ((selected_entry === null || selected_entry === void 0 ? void 0 : selected_entry.type) == "category" || (selected_entry === null || selected_entry === void 0 ? void 0 : selected_entry.type) === "content") (0, $3hooq$solidjs.runWithOwner)(owner, () => override_on_enter_for_this_entry(e => {
|
|
6822
6928
|
const {
|
|
6823
6929
|
page_url: page_url
|
|
6824
6930
|
} = selected_entry;
|
|
6825
|
-
if (
|
|
6931
|
+
if (!(0, $1730e5b4d47679a3$export$1efe1013da60d0e4)(e, page_url))
|
|
6826
6932
|
// Above fn will return true if it opened a new tab, and we won't make these checks anymore
|
|
6827
6933
|
router_.navigate_.go_to_({
|
|
6828
6934
|
new_url_: page_url,
|
|
6829
6935
|
is_replace_: false
|
|
6830
6936
|
});
|
|
6831
6937
|
return true;
|
|
6832
|
-
});else if (!selected_entry) {
|
|
6833
|
-
|
|
6938
|
+
}));else if (!selected_entry) {
|
|
6939
|
+
(0, $3hooq$solidjs.runWithOwner)(owner, block_updating_for_one_change);
|
|
6834
6940
|
set_search_field_value(previous_value);
|
|
6835
6941
|
}
|
|
6836
6942
|
});
|
|
@@ -6842,16 +6948,39 @@ function $1a7b2e0cdf65293a$var$actual_navigation_working_on_fake_data(_ref2) {
|
|
|
6842
6948
|
(0, $3hooq$solidjs.onCleanup)((0, $3hooq$depictaiutilishared.catchify)(() => el.removeEventListener("keyup", handler)));
|
|
6843
6949
|
});
|
|
6844
6950
|
}
|
|
6845
|
-
function $
|
|
6846
|
-
|
|
6847
|
-
|
|
6848
|
-
|
|
6849
|
-
|
|
6850
|
-
|
|
6851
|
-
|
|
6852
|
-
|
|
6853
|
-
|
|
6854
|
-
|
|
6951
|
+
function $4d9996ee79548b4b$export$af0124069c150252(_ref) {
|
|
6952
|
+
let {
|
|
6953
|
+
set_override_on_enter_fn_: set_override_on_enter_fn_,
|
|
6954
|
+
get_modal_search_results_: get_modal_search_results_,
|
|
6955
|
+
read_suggestion_signal_: read_suggestion_signal_,
|
|
6956
|
+
router_: router_,
|
|
6957
|
+
content_results_: content_results_
|
|
6958
|
+
} = _ref;
|
|
6959
|
+
const [get_autocomplete_wants_override_function, set_autocomplete_wants_override_function] = (0, $3hooq$solidjs.createSignal)(() => false);
|
|
6960
|
+
(0, $3hooq$solidjs.createComputed)(() => {
|
|
6961
|
+
var _get_modal_search_res, _search_results$displ;
|
|
6962
|
+
const suggestions = read_suggestion_signal_();
|
|
6963
|
+
const search_results = (_get_modal_search_res = get_modal_search_results_()) === null || _get_modal_search_res === void 0 ? void 0 : _get_modal_search_res();
|
|
6964
|
+
const content_results = content_results_();
|
|
6965
|
+
// If we only have one content result and nothing else, go there when pressing enter
|
|
6966
|
+
if (!suggestions.length && !(search_results !== null && search_results !== void 0 && (_search_results$displ = search_results.displays) !== null && _search_results$displ !== void 0 && _search_results$displ.length) && (content_results === null || content_results === void 0 ? void 0 : content_results.length) === 1) {
|
|
6967
|
+
const [{
|
|
6968
|
+
page_url: page_url
|
|
6969
|
+
}] = content_results;
|
|
6970
|
+
set_override_on_enter_fn_(e => {
|
|
6971
|
+
if (!(0, $1730e5b4d47679a3$export$1efe1013da60d0e4)(e, page_url))
|
|
6972
|
+
// Above fn will return true if it opened a new tab, and we won't make these checks anymore
|
|
6973
|
+
router_.navigate_.go_to_({
|
|
6974
|
+
new_url_: page_url,
|
|
6975
|
+
is_replace_: false
|
|
6976
|
+
});
|
|
6977
|
+
return true;
|
|
6978
|
+
});
|
|
6979
|
+
return;
|
|
6980
|
+
}
|
|
6981
|
+
set_override_on_enter_fn_(get_autocomplete_wants_override_function());
|
|
6982
|
+
});
|
|
6983
|
+
return new_fn => set_autocomplete_wants_override_function(() => new_fn);
|
|
6855
6984
|
}
|
|
6856
6985
|
const $ce079d50d380ee11$export$3cf9497e790da491 = "query";
|
|
6857
6986
|
function $ce079d50d380ee11$export$2f2b9559550c7bbc(_ref) {
|
|
@@ -6872,12 +7001,15 @@ function $ce079d50d380ee11$export$2f2b9559550c7bbc(_ref) {
|
|
|
6872
7001
|
i18n_: i18n_,
|
|
6873
7002
|
include_category_suggestions_: include_category_suggestions_,
|
|
6874
7003
|
submit_query_: submit_query_,
|
|
6875
|
-
router_: router_
|
|
7004
|
+
router_: router_,
|
|
7005
|
+
get_modal_search_results_: get_modal_search_results_,
|
|
7006
|
+
content_search_enabled_: content_search_enabled_
|
|
6876
7007
|
} = _ref;
|
|
6877
7008
|
const [searching_for_value, set_searching_for_value] = (0, $3hooq$solidjs.createSignal)();
|
|
7009
|
+
const [show_stale_content_results, set_show_stale_content_results] = (0, $3hooq$solidjs.createSignal)(false);
|
|
6878
7010
|
const [read_search_field_value] = search_field_value_;
|
|
6879
7011
|
const updating_blocked = (0, $3hooq$solidjs.createSignal)(false);
|
|
6880
|
-
const [
|
|
7012
|
+
const [read_suggestion_signal_, write_suggestion_signal] = (0, $3hooq$solidjs.createSignal)([]);
|
|
6881
7013
|
const filtered_previous_searches = (0, $3hooq$solidjs.createMemo)(() => [...unfiltered_previous_searches[0]()].reverse().filter(q => q !== get_search_query_()));
|
|
6882
7014
|
const deparallelized_fn = (0, $3hooq$depictaiutilishared.deparallelize_no_drop)(async request_obj => {
|
|
6883
7015
|
var _api_response$suggest;
|
|
@@ -6901,15 +7033,39 @@ function $ce079d50d380ee11$export$2f2b9559550c7bbc(_ref) {
|
|
|
6901
7033
|
});
|
|
6902
7034
|
|
|
6903
7035
|
const show_previous_searches_component = (0, $3hooq$solidjs.createMemo)(() => !read_search_field_value() || (0, $3hooq$solidjs.untrack)(updating_blocked[0]) && !(0, $3hooq$solidjs.untrack)(searching_for_value));
|
|
7036
|
+
const get_content_results_ = (0, $3hooq$solidjs.createMemo)(prev => {
|
|
7037
|
+
var _get_modal_search_res, _get_modal_search_res2, _get_modal_search_res3;
|
|
7038
|
+
if (!content_search_enabled_()) return [];
|
|
7039
|
+
if (show_stale_content_results())
|
|
7040
|
+
// don't update content results when query suggestions don't update because otherwise they disappear when trying to keyboard navigate to them
|
|
7041
|
+
return prev;
|
|
7042
|
+
return (_get_modal_search_res = get_modal_search_results_()) === null || _get_modal_search_res === void 0 ? void 0 : (_get_modal_search_res2 = _get_modal_search_res()) === null || _get_modal_search_res2 === void 0 ? void 0 : (_get_modal_search_res3 = _get_modal_search_res2.content_search_links) === null || _get_modal_search_res3 === void 0 ? void 0 : _get_modal_search_res3.map(link => ({
|
|
7043
|
+
page_url: link.page_url,
|
|
7044
|
+
type: "content",
|
|
7045
|
+
title: link.title
|
|
7046
|
+
}));
|
|
7047
|
+
});
|
|
7048
|
+
// Ideally we'd propagate up the suggestion signal too and call this from SearchModal.tsx? Because it's not super related with autocomplete, but it's not a huge feature, and it's easier here so keeping it.
|
|
7049
|
+
// It's the functionality to open the content results page when you press enter, in the modal, when there's only one content result
|
|
7050
|
+
const manipulated_set_override_on_enter_fn_ = (0, $4d9996ee79548b4b$export$af0124069c150252)({
|
|
7051
|
+
set_override_on_enter_fn_: set_override_on_enter_fn_,
|
|
7052
|
+
get_modal_search_results_: get_modal_search_results_,
|
|
7053
|
+
read_suggestion_signal_: read_suggestion_signal_,
|
|
7054
|
+
router_: router_,
|
|
7055
|
+
content_results_: get_content_results_
|
|
7056
|
+
});
|
|
6904
7057
|
(0, $3hooq$solidjs.createComputed)(() => {
|
|
6905
7058
|
const field_value = read_search_field_value();
|
|
6906
|
-
if (
|
|
7059
|
+
if ((0, $3hooq$solidjs.untrack)(updating_blocked[0]))
|
|
7060
|
+
// not using updating_blocked instead of below signal since I presume they'd start updating too early then
|
|
7061
|
+
set_show_stale_content_results(true);else {
|
|
6907
7062
|
set_searching_for_value(field_value);
|
|
6908
7063
|
deparallelized_fn({
|
|
6909
7064
|
query: field_value,
|
|
6910
7065
|
tenant: tenant_(),
|
|
6911
7066
|
market: market_()
|
|
6912
7067
|
});
|
|
7068
|
+
set_show_stale_content_results(false);
|
|
6913
7069
|
}
|
|
6914
7070
|
});
|
|
6915
7071
|
(0, $3hooq$solidjs.createComputed)((0, $3hooq$solidjs.on)(search_field_value_[0], () => !updating_blocked[0]() && selected_index_[1](undefined), {
|
|
@@ -6921,7 +7077,7 @@ function $ce079d50d380ee11$export$2f2b9559550c7bbc(_ref) {
|
|
|
6921
7077
|
search_field_value_: search_field_value_,
|
|
6922
7078
|
updating_blocked_: updating_blocked,
|
|
6923
7079
|
currently_showing_suggestions_: currently_showing_suggestions_,
|
|
6924
|
-
set_override_on_enter_fn_:
|
|
7080
|
+
set_override_on_enter_fn_: manipulated_set_override_on_enter_fn_,
|
|
6925
7081
|
search_query_param_name_: search_query_url_param_name_,
|
|
6926
7082
|
url_transformer_: url_transformer_,
|
|
6927
7083
|
router_: router_
|
|
@@ -6961,11 +7117,12 @@ function $ce079d50d380ee11$export$2f2b9559550c7bbc(_ref) {
|
|
|
6961
7117
|
},
|
|
6962
7118
|
on_previous_searches_page_: show_previous_searches_component,
|
|
6963
7119
|
i18n_: i18n_,
|
|
7120
|
+
get_content_results_: get_content_results_,
|
|
6964
7121
|
url_transformer_: url_transformer_,
|
|
6965
7122
|
searching_for_value_: searching_for_value,
|
|
6966
7123
|
search_query_url_param_name_: search_query_url_param_name_,
|
|
6967
7124
|
selected_index_: selected_index_,
|
|
6968
|
-
suggestion_memo_:
|
|
7125
|
+
suggestion_memo_: read_suggestion_signal_,
|
|
6969
7126
|
currently_showing_suggestions_: currently_showing_suggestions_,
|
|
6970
7127
|
include_category_suggestions_: include_category_suggestions_,
|
|
6971
7128
|
router_: router_,
|
|
@@ -7073,7 +7230,8 @@ function $24419668d5fcfcd5$export$1c593cbd6f1e10bc(_ref) {
|
|
|
7073
7230
|
bottom_distance_under_modal_: bottom_distance_under_modal_,
|
|
7074
7231
|
selected_text_range_: selected_text_range_,
|
|
7075
7232
|
dont_sync_search_field_value_except_on_submit_ = false,
|
|
7076
|
-
router_: router_
|
|
7233
|
+
router_: router_,
|
|
7234
|
+
content_search_enabled_: content_search_enabled_
|
|
7077
7235
|
} = _ref;
|
|
7078
7236
|
let on_enter_in_search_field_function;
|
|
7079
7237
|
// As per feedback from stronger we sometimes want a modal with the search field value disconnected from the one in the rest of the UI, see https://depictaiworkspace.slack.com/archives/C02J16R9XEH/p1679065878487709.
|
|
@@ -7090,34 +7248,24 @@ function $24419668d5fcfcd5$export$1c593cbd6f1e10bc(_ref) {
|
|
|
7090
7248
|
};
|
|
7091
7249
|
const [input_field, set_input_field] = (0, $3hooq$solidjs.createSignal)();
|
|
7092
7250
|
const [get_search_field_value_] = search_field_value_;
|
|
7093
|
-
const [
|
|
7094
|
-
const [elements_inside_scrollable, set_elements_inside_scrollable] = (0, $3hooq$solidjs.createSignal)();
|
|
7251
|
+
const [get_modal_search_results, set_modal_search_results_] = (0, $3hooq$solidjs.createSignal)();
|
|
7095
7252
|
const close_on_escape_handler = (0, $3hooq$depictaiutilishared.catchify)(_ref2 => {
|
|
7096
7253
|
let {
|
|
7097
7254
|
key: key
|
|
7098
7255
|
} = _ref2;
|
|
7099
7256
|
if (key === "Escape") close_modal_();
|
|
7100
7257
|
});
|
|
7101
|
-
const [
|
|
7258
|
+
const [get_total_num_results_accessor, set_total_num_results_accessor_] = (0, $3hooq$solidjs.createSignal)();
|
|
7102
7259
|
const selected_index = (0, $3hooq$solidjs.createSignal)();
|
|
7103
7260
|
const currently_showing_suggestions_ = (0, $3hooq$solidjs.createSignal)([], {
|
|
7104
7261
|
equals: false
|
|
7105
7262
|
});
|
|
7263
|
+
const less_than_700_high = (0, $3e17e871e9d0911d$export$d9f36cf74e24d595)("(max-height:700px)");
|
|
7264
|
+
const DiscoverMoreSection = () => (0, $3hooq$solidjsweb.ssr)($24419668d5fcfcd5$var$_tmpl$, (0, $3hooq$solidjsweb.ssrHydrationKey)(), get_search_field_value_() ? (0, $3hooq$solidjsweb.escape)(i18n_.modal_view_all_results_()((0, $3hooq$solidjsweb.ssr)($24419668d5fcfcd5$var$_tmpl$2, (0, $3hooq$solidjsweb.ssrHydrationKey)(), (0, $3hooq$solidjsweb.escape)(get_total_num_results_accessor === null || get_total_num_results_accessor === void 0 ? void 0 : get_total_num_results_accessor())))) : (0, $3hooq$solidjsweb.escape)(i18n_.modal_discover_more_()));
|
|
7106
7265
|
if (disable_scrolling_) (0, $8c2e68c6d458169b$export$fe334901e8bebd57)();
|
|
7107
7266
|
$24419668d5fcfcd5$var$close_modal_when_navigating_away(close_modal_, search_query_url_param_name_);
|
|
7108
7267
|
window.addEventListener("keydown", close_on_escape_handler);
|
|
7109
7268
|
(0, $3hooq$solidjs.onCleanup)((0, $3hooq$depictaiutilishared.catchify)(() => window.removeEventListener("keydown", close_on_escape_handler)));
|
|
7110
|
-
const owner = (0, $3hooq$solidjs.getOwner)();
|
|
7111
|
-
(0, $3hooq$solidjs.onCleanup)((0, $3hooq$depictaiutilishared.javascript_media_query)("(max-height:700px)", _ref3 => {
|
|
7112
|
-
let {
|
|
7113
|
-
matches: matches
|
|
7114
|
-
} = _ref3;
|
|
7115
|
-
return (0, $3hooq$solidjs.runWithOwner)(owner, () => {
|
|
7116
|
-
// the if below is reactive so we need an owner
|
|
7117
|
-
(matches ? set_elements_outside_scrollable : set_elements_inside_scrollable)("");
|
|
7118
|
-
(matches ? set_elements_inside_scrollable : set_elements_outside_scrollable)((0, $3hooq$solidjsweb.ssr)($24419668d5fcfcd5$var$_tmpl$, (0, $3hooq$solidjsweb.ssrHydrationKey)(), get_search_field_value_() ? (0, $3hooq$solidjsweb.escape)(i18n_.modal_view_all_results_()((0, $3hooq$solidjsweb.ssr)($24419668d5fcfcd5$var$_tmpl$2, (0, $3hooq$solidjsweb.ssrHydrationKey)(), (0, $3hooq$solidjsweb.escape)(get_num_results_accessor === null || get_num_results_accessor === void 0 ? void 0 : get_num_results_accessor())))) : (0, $3hooq$solidjsweb.escape)(i18n_.modal_discover_more_())));
|
|
7119
|
-
});
|
|
7120
|
-
}).remove);
|
|
7121
7269
|
if (closing_animation_) register_closing_animation_(closing_animation_);
|
|
7122
7270
|
(0, $4e44eb7e21ff022a$export$3340fdd8259bd4fd)({
|
|
7123
7271
|
get_search_field_value_: get_search_field_value_,
|
|
@@ -7179,7 +7327,9 @@ function $24419668d5fcfcd5$export$1c593cbd6f1e10bc(_ref) {
|
|
|
7179
7327
|
i18n_: i18n_,
|
|
7180
7328
|
include_category_suggestions_: enable_category_suggestions_ !== null && enable_category_suggestions_ !== void 0 ? enable_category_suggestions_ : true,
|
|
7181
7329
|
router_: router_,
|
|
7182
|
-
submit_query_: submit_query_
|
|
7330
|
+
submit_query_: submit_query_,
|
|
7331
|
+
get_modal_search_results_: get_modal_search_results,
|
|
7332
|
+
content_search_enabled_: content_search_enabled_
|
|
7183
7333
|
});
|
|
7184
7334
|
}
|
|
7185
7335
|
})), (0, $3hooq$solidjsweb.escape)((0, $3hooq$solidjsweb.createComponent)((0, $1b3cf201cdd38687$export$b69d0d92862de18b), {
|
|
@@ -7192,12 +7342,28 @@ function $24419668d5fcfcd5$export$1c593cbd6f1e10bc(_ref) {
|
|
|
7192
7342
|
tenant_: tenant_,
|
|
7193
7343
|
i18n_: i18n_,
|
|
7194
7344
|
market_: market_,
|
|
7195
|
-
|
|
7345
|
+
set_total_num_results_accessor_: set_total_num_results_accessor_,
|
|
7196
7346
|
router_: router_,
|
|
7347
|
+
set_modal_search_results_: set_modal_search_results_,
|
|
7348
|
+
content_search_enabled_: content_search_enabled_,
|
|
7197
7349
|
...instant_results_options_
|
|
7198
7350
|
});
|
|
7199
7351
|
}
|
|
7200
|
-
})), (0, $3hooq$solidjsweb.escape)(
|
|
7352
|
+
})), (0, $3hooq$solidjsweb.escape)((0, $3hooq$solidjsweb.createComponent)((0, $3hooq$solidjs.Show), {
|
|
7353
|
+
get when() {
|
|
7354
|
+
return less_than_700_high();
|
|
7355
|
+
},
|
|
7356
|
+
get children() {
|
|
7357
|
+
return (0, $3hooq$solidjsweb.createComponent)(DiscoverMoreSection, {});
|
|
7358
|
+
}
|
|
7359
|
+
})), (0, $3hooq$solidjsweb.escape)((0, $3hooq$solidjsweb.createComponent)((0, $3hooq$solidjs.Show), {
|
|
7360
|
+
get when() {
|
|
7361
|
+
return !less_than_700_high();
|
|
7362
|
+
},
|
|
7363
|
+
get children() {
|
|
7364
|
+
return (0, $3hooq$solidjsweb.createComponent)(DiscoverMoreSection, {});
|
|
7365
|
+
}
|
|
7366
|
+
})), (0, $3hooq$solidjsweb.escape)((0, $3hooq$solidjsweb.createComponent)((0, $cc66bbf6e783bb58$export$f021bdedd3ec901a), {
|
|
7201
7367
|
styles: body_style
|
|
7202
7368
|
})));
|
|
7203
7369
|
return [(0, $3hooq$solidjsweb.ssr)($24419668d5fcfcd5$var$_tmpl$4, (0, $3hooq$solidjsweb.ssrHydrationKey)() + (0, $3hooq$solidjsweb.ssrAttribute)("id", (0, $3hooq$solidjsweb.escape)((0, $c95c6dd9e93acd82$export$44dad306455dddf).SEARCH_MODAL, true), false), "depict plp search ".concat((0, $3hooq$solidjsweb.escape)((0, $3hooq$solidjsweb.ssrClassList)(class_list_ === null || class_list_ === void 0 ? void 0 : class_list_()), true) || ""), (0, $3hooq$solidjsweb.escape)(modal_element))];
|
|
@@ -7275,14 +7441,21 @@ function $9870a8a48ee126af$export$9dd50d35b9d94fdf(_ref) {
|
|
|
7275
7441
|
let {
|
|
7276
7442
|
get_search_query_: get_search_query_,
|
|
7277
7443
|
i18n_: i18n_,
|
|
7278
|
-
formatted_number_of_results_: formatted_number_of_results_
|
|
7444
|
+
formatted_number_of_results_: formatted_number_of_results_,
|
|
7445
|
+
number_of_results_: number_of_results_,
|
|
7446
|
+
type: type
|
|
7279
7447
|
} = _ref;
|
|
7280
7448
|
const contents = (0, $3hooq$solidjs.createMemo)((0, $3hooq$depictaiutilishared.catchify)(() => {
|
|
7281
7449
|
const q = get_search_query_();
|
|
7282
|
-
return i18n_.get_showing_results_for_()((0, $3hooq$solidjsweb.ssr)($9870a8a48ee126af$var$_tmpl$, (0, $3hooq$solidjsweb.ssrHydrationKey)(), (0, $3hooq$solidjsweb.escape)(q)), (0, $3hooq$solidjsweb.ssr)($9870a8a48ee126af$var$_tmpl$, (0, $3hooq$solidjsweb.ssrHydrationKey)(), (0, $3hooq$solidjsweb.escape)(formatted_number_of_results_())));
|
|
7450
|
+
return i18n_[type === $9870a8a48ee126af$export$2452208c79fe93ea.content ? "get_showing_pages_for_" : "get_showing_results_for_"]()((0, $3hooq$solidjsweb.ssr)($9870a8a48ee126af$var$_tmpl$, (0, $3hooq$solidjsweb.ssrHydrationKey)(), (0, $3hooq$solidjsweb.escape)(q)), (0, $3hooq$solidjsweb.ssr)($9870a8a48ee126af$var$_tmpl$, (0, $3hooq$solidjsweb.ssrHydrationKey)(), (0, $3hooq$solidjsweb.escape)(formatted_number_of_results_())), !!q, number_of_results_());
|
|
7283
7451
|
}));
|
|
7284
7452
|
return (0, $3hooq$solidjsweb.ssr)($9870a8a48ee126af$var$_tmpl$2, (0, $3hooq$solidjsweb.ssrHydrationKey)(), (0, $3hooq$solidjsweb.escape)(contents()));
|
|
7285
7453
|
}
|
|
7454
|
+
let $9870a8a48ee126af$export$2452208c79fe93ea;
|
|
7455
|
+
(function (ShowingResultsForType) {
|
|
7456
|
+
ShowingResultsForType[ShowingResultsForType["products"] = 0] = "products";
|
|
7457
|
+
ShowingResultsForType[ShowingResultsForType["content"] = 1] = "content";
|
|
7458
|
+
})($9870a8a48ee126af$export$2452208c79fe93ea || ($9870a8a48ee126af$export$2452208c79fe93ea = {}));
|
|
7286
7459
|
function $996102a9349df6d7$export$41b4894022a3580f() {
|
|
7287
7460
|
let {
|
|
7288
7461
|
style_props_ = (0, $3hooq$solidjs.createSignal)({})
|
|
@@ -7302,8 +7475,464 @@ function $996102a9349df6d7$export$41b4894022a3580f() {
|
|
|
7302
7475
|
})));
|
|
7303
7476
|
return style_props_;
|
|
7304
7477
|
}
|
|
7478
|
+
const $99472afa7112c427$var$_tmpl$ = ["<span", ' class="highlighted-part">', "</span>"];
|
|
7479
|
+
const $99472afa7112c427$var$dont_cut_in_between_less_than_characters = 30;
|
|
7480
|
+
function $99472afa7112c427$export$e1a98a189fd2c0e7(_ref) {
|
|
7481
|
+
let {
|
|
7482
|
+
content_result_: content_result_,
|
|
7483
|
+
key_: key_,
|
|
7484
|
+
cut_when_possible_: cut_when_possible_
|
|
7485
|
+
} = _ref;
|
|
7486
|
+
const matched_tokens = (0, $3hooq$solidjs.createMemo)(() => {
|
|
7487
|
+
var _content_result_$high, _content_result_$high2;
|
|
7488
|
+
return (_content_result_$high = content_result_().highlights) === null || _content_result_$high === void 0 ? void 0 : (_content_result_$high2 = _content_result_$high.find(highlight => highlight.field == key_)) === null || _content_result_$high2 === void 0 ? void 0 : _content_result_$high2.matched_tokens;
|
|
7489
|
+
});
|
|
7490
|
+
const full_value = (0, $3hooq$solidjs.createMemo)(() => {
|
|
7491
|
+
var _content_result_$key_;
|
|
7492
|
+
return (_content_result_$key_ = content_result_()[key_]) === null || _content_result_$key_ === void 0 ? void 0 : _content_result_$key_.replaceAll("\n", " ");
|
|
7493
|
+
});
|
|
7494
|
+
return (0, $3hooq$solidjsweb.createComponent)((0, $3hooq$solidjs.Show), {
|
|
7495
|
+
get when() {
|
|
7496
|
+
var _matched_tokens;
|
|
7497
|
+
return (_matched_tokens = matched_tokens()) === null || _matched_tokens === void 0 ? void 0 : _matched_tokens.length;
|
|
7498
|
+
},
|
|
7499
|
+
get fallback() {
|
|
7500
|
+
return full_value();
|
|
7501
|
+
},
|
|
7502
|
+
get children() {
|
|
7503
|
+
return (() => {
|
|
7504
|
+
const segmented_cut_text = (0, $3hooq$solidjs.createMemo)(() => {
|
|
7505
|
+
const segmented_text = $99472afa7112c427$var$segment_text(full_value(), matched_tokens());
|
|
7506
|
+
if (cut_when_possible_) $99472afa7112c427$var$cut_text(segmented_text);
|
|
7507
|
+
return segmented_text;
|
|
7508
|
+
});
|
|
7509
|
+
return (0, $3hooq$solidjsweb.createComponent)((0, $3hooq$solidjs.Index), {
|
|
7510
|
+
get each() {
|
|
7511
|
+
return segmented_cut_text();
|
|
7512
|
+
},
|
|
7513
|
+
children: item => {
|
|
7514
|
+
return (0, $3hooq$solidjsweb.createComponent)((0, $3hooq$solidjs.Show), {
|
|
7515
|
+
get when() {
|
|
7516
|
+
return item().highlighted_;
|
|
7517
|
+
},
|
|
7518
|
+
get fallback() {
|
|
7519
|
+
return item().text_;
|
|
7520
|
+
},
|
|
7521
|
+
get children() {
|
|
7522
|
+
return (0, $3hooq$solidjsweb.ssr)($99472afa7112c427$var$_tmpl$, (0, $3hooq$solidjsweb.ssrHydrationKey)(), (0, $3hooq$solidjsweb.escape)(item().text_));
|
|
7523
|
+
}
|
|
7524
|
+
});
|
|
7525
|
+
}
|
|
7526
|
+
});
|
|
7527
|
+
})();
|
|
7528
|
+
}
|
|
7529
|
+
});
|
|
7530
|
+
}
|
|
7531
|
+
function $99472afa7112c427$var$cut_text(segmented_text) {
|
|
7532
|
+
// cut away chunks of text that are not highlighted to give a google-like overview of the content
|
|
7533
|
+
const highlighted_segments = segmented_text === null || segmented_text === void 0 ? void 0 : segmented_text.filter(segment => segment.highlighted_);
|
|
7534
|
+
if (!segmented_text || !(highlighted_segments !== null && highlighted_segments !== void 0 && highlighted_segments.length)) return;
|
|
7535
|
+
// We have one or more highlighted segments
|
|
7536
|
+
if (highlighted_segments.length === 1) {
|
|
7537
|
+
// cut away from the left until the start of the highlighted sentence if just one sentence is highlighted
|
|
7538
|
+
$99472afa7112c427$var$cut_start(segmented_text.indexOf(highlighted_segments[0]), segmented_text);
|
|
7539
|
+
return;
|
|
7540
|
+
}
|
|
7541
|
+
// We have two or more highlighted segments, take the two biggest chunks and show them + a bit text around
|
|
7542
|
+
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
|
|
7543
|
+
);
|
|
7544
|
+
|
|
7545
|
+
const [longest_segment, next_longest_segment] = sorted_highlighted_segments;
|
|
7546
|
+
// We need to cut before the first segment - possibly through other segments - and maybe between segments
|
|
7547
|
+
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);
|
|
7548
|
+
$99472afa7112c427$var$cut_start(index_of_first_segment, segmented_text);
|
|
7549
|
+
// update indexes since we might have removed segments
|
|
7550
|
+
[index_of_first_segment, index_of_second_segment] = [segmented_text.indexOf(longest_segment), segmented_text.indexOf(next_longest_segment)].sort((a, b) => a - b);
|
|
7551
|
+
let number_of_characters_between_segments = 0;
|
|
7552
|
+
for (let i = index_of_first_segment + 1; i < index_of_second_segment; i++) {
|
|
7553
|
+
const segment = segmented_text[i];
|
|
7554
|
+
number_of_characters_between_segments += segment.text_.length;
|
|
7555
|
+
}
|
|
7556
|
+
if (number_of_characters_between_segments < $99472afa7112c427$var$dont_cut_in_between_less_than_characters)
|
|
7557
|
+
// don't cut if there are less than 30 characters between the two segments
|
|
7558
|
+
return;
|
|
7559
|
+
// We have more than 50 characters between the two segments, cut between them
|
|
7560
|
+
const [split_start_segment, split_start_character] = $99472afa7112c427$var$find_split_point(index_of_first_segment, index_of_second_segment, segmented_text);
|
|
7561
|
+
const [split_end_segment, split_end_character] = $99472afa7112c427$var$find_split_point(index_of_second_segment, index_of_first_segment, segmented_text);
|
|
7562
|
+
if (split_start_segment === undefined || split_end_segment === undefined ||
|
|
7563
|
+
// identical split point, or split end before split start, can't do anything
|
|
7564
|
+
split_start_segment == split_end_segment && split_start_character >= split_end_character || split_start_segment > split_end_segment) return;
|
|
7565
|
+
const dots_segment = {
|
|
7566
|
+
text_: " … ",
|
|
7567
|
+
highlighted_: false
|
|
7568
|
+
};
|
|
7569
|
+
const split_and_dotted_values = segmented_text.flatMap((segment, i) => {
|
|
7570
|
+
if (i < split_start_segment || i > split_end_segment) return segment;
|
|
7571
|
+
const text = segment.text_;
|
|
7572
|
+
if (i == split_end_segment && i == split_start_segment) return [{
|
|
7573
|
+
...segment,
|
|
7574
|
+
text_: text.slice(0, split_start_character).trimEnd()
|
|
7575
|
+
}, dots_segment, {
|
|
7576
|
+
...segment,
|
|
7577
|
+
text_: text.slice(split_end_character + 1, text.length).trimStart()
|
|
7578
|
+
}];else if (i == split_start_segment) {
|
|
7579
|
+
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
|
|
7580
|
+
return segment;
|
|
7581
|
+
} else if (i == split_end_segment) return [dots_segment, {
|
|
7582
|
+
...segment,
|
|
7583
|
+
text_: text.slice(split_end_character + 1, text.length).trimStart()
|
|
7584
|
+
}];
|
|
7585
|
+
return []; // remove all segments inbetween
|
|
7586
|
+
});
|
|
7587
|
+
|
|
7588
|
+
segmented_text.splice(0, segmented_text.length, ...split_and_dotted_values); // Sorry…
|
|
7589
|
+
$99472afa7112c427$var$heal_holes(segmented_text);
|
|
7590
|
+
}
|
|
7591
|
+
function $99472afa7112c427$var$heal_holes(segmented_text) {
|
|
7592
|
+
// try to heal "holes" created in the segments so there are only alternating segments
|
|
7593
|
+
const segments_to_delete = new Set();
|
|
7594
|
+
for (let i = 0; i < segmented_text.length; i++) {
|
|
7595
|
+
var _previous_segment, _previous_segment2;
|
|
7596
|
+
const segment = segmented_text[i];
|
|
7597
|
+
let previous_segment;
|
|
7598
|
+
for (let j = i - 1; j >= 0; j--) {
|
|
7599
|
+
previous_segment = segmented_text[j];
|
|
7600
|
+
// Don't write to a segment that's marked for deletion or the contents we write to it will be deleted
|
|
7601
|
+
if (!segments_to_delete.has(previous_segment)) break;
|
|
7602
|
+
}
|
|
7603
|
+
if ((_previous_segment = previous_segment) !== null && _previous_segment !== void 0 && _previous_segment.highlighted_ && segment.highlighted_ || ((_previous_segment2 = previous_segment) === null || _previous_segment2 === void 0 ? void 0 : _previous_segment2.highlighted_) === false && segment.highlighted_ === false) {
|
|
7604
|
+
previous_segment.text_ += segment.text_; // IDK if this ever happens
|
|
7605
|
+
segments_to_delete.add(segment);
|
|
7606
|
+
}
|
|
7607
|
+
}
|
|
7608
|
+
for (const segment of segments_to_delete) {
|
|
7609
|
+
const index = segmented_text.indexOf(segment);
|
|
7610
|
+
segmented_text.splice(index, 1);
|
|
7611
|
+
}
|
|
7612
|
+
}
|
|
7613
|
+
function $99472afa7112c427$var$find_split_point(index_of_start_segment, index_of_end_segment, segmented_text) {
|
|
7614
|
+
let be_very_aggressive = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
7615
|
+
const should_loop_backwards = index_of_start_segment > index_of_end_segment;
|
|
7616
|
+
const step = should_loop_backwards ? -1 : 1;
|
|
7617
|
+
const desperate_split_attempts = [":", ";", ","];
|
|
7618
|
+
while (desperate_split_attempts.length) {
|
|
7619
|
+
const split_point_between_words = [];
|
|
7620
|
+
// for the middle also try to split with a few more characters if the default ones don't work over a full run
|
|
7621
|
+
const desperate_split_attempt = desperate_split_attempts.pop();
|
|
7622
|
+
let is_first_character = true;
|
|
7623
|
+
for (let i = index_of_start_segment + step; should_loop_backwards ? i > index_of_end_segment : i < index_of_end_segment; i += step) {
|
|
7624
|
+
const segment = segmented_text[i];
|
|
7625
|
+
const text = segment.text_;
|
|
7626
|
+
for (let j = should_loop_backwards ? text.length - 1 : 0; should_loop_backwards ? j >= 0 : j < text.length; j += step) {
|
|
7627
|
+
const character = text[j];
|
|
7628
|
+
if (character == "." || character == "?" || character == "!" || character == desperate_split_attempt) return [i, j]; // segment index, character index
|
|
7629
|
+
if (is_first_character) is_first_character = false;else if (be_very_aggressive && character == " ") {
|
|
7630
|
+
split_point_between_words.push([i, j]);
|
|
7631
|
+
if (split_point_between_words.length > 3)
|
|
7632
|
+
// We can't find a split point, so we'll just split between words
|
|
7633
|
+
// 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
|
|
7634
|
+
return split_point_between_words[1];
|
|
7635
|
+
}
|
|
7636
|
+
}
|
|
7637
|
+
}
|
|
7638
|
+
}
|
|
7639
|
+
return [];
|
|
7640
|
+
}
|
|
7641
|
+
function $99472afa7112c427$var$cut_start(cut_left_of_index, segmented_text) {
|
|
7642
|
+
// Cut the start of the text to bring the first matching token
|
|
7643
|
+
let is_first_character = false;
|
|
7644
|
+
let words_encountered = 0;
|
|
7645
|
+
outmost_loop: for (let i = cut_left_of_index - 1; i >= 0; i--) {
|
|
7646
|
+
const segment = segmented_text[i];
|
|
7647
|
+
// We assume that two adjacent highlighted segments don't exist and have been merged if they were to have existed
|
|
7648
|
+
const text = segment.text_;
|
|
7649
|
+
for (let j = text.length - 1; j >= 0; j--) {
|
|
7650
|
+
const character = text[j];
|
|
7651
|
+
const is_space = character == " ";
|
|
7652
|
+
if (!is_first_character && is_space) words_encountered++;
|
|
7653
|
+
if (character == "." || character == "?" || character == "!" || character == "," || words_encountered > 8 && is_space) {
|
|
7654
|
+
// We have to be really aggressive at the start of sentences so stuff can be seen on mobile, hence comma
|
|
7655
|
+
segment.text_ = text.slice(j + 1).trimStart();
|
|
7656
|
+
segmented_text.splice(0, i);
|
|
7657
|
+
if (character === "," || is_space)
|
|
7658
|
+
// if we cut at a comma or psace, we add a … at the beginning
|
|
7659
|
+
segmented_text.unshift({
|
|
7660
|
+
text_: "… ",
|
|
7661
|
+
highlighted_: false
|
|
7662
|
+
});
|
|
7663
|
+
break outmost_loop;
|
|
7664
|
+
}
|
|
7665
|
+
if (is_first_character) is_first_character = false;
|
|
7666
|
+
}
|
|
7667
|
+
}
|
|
7668
|
+
$99472afa7112c427$var$heal_holes(segmented_text); // if we added a ... there could now be a sequence that's not alternating true/false
|
|
7669
|
+
}
|
|
7670
|
+
|
|
7671
|
+
function $99472afa7112c427$var$segment_text(text, matched_strings) {
|
|
7672
|
+
// segment text where the matched strings are highlighted sections
|
|
7673
|
+
const output = [];
|
|
7674
|
+
if (!text) return; // shouldn't happen but whatever
|
|
7675
|
+
for (let i = 0; i < text.length; i++) {
|
|
7676
|
+
const found_strings = [];
|
|
7677
|
+
if (!i || text[i - 1] == " ")
|
|
7678
|
+
// only match at the start of a word or string, it looks weird if i.e. "we" is highlighted in "activewear
|
|
7679
|
+
for (let j = 0; j < matched_strings.length; j++) {
|
|
7680
|
+
const matched_string = matched_strings[j];
|
|
7681
|
+
const part_in_text = text.slice(i, i + matched_string.length);
|
|
7682
|
+
if (matched_string.length < 2) continue; // don't match on single characters, i.e. "I", it looks weird
|
|
7683
|
+
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
|
|
7684
|
+
}
|
|
7685
|
+
|
|
7686
|
+
const last_index_in_output = output.length - 1;
|
|
7687
|
+
if (!found_strings.length) {
|
|
7688
|
+
var _output$last_index_in;
|
|
7689
|
+
const character = text[i];
|
|
7690
|
+
if (((_output$last_index_in = output[last_index_in_output]) === null || _output$last_index_in === void 0 ? void 0 : _output$last_index_in.highlighted_) === false || output.length && /\s/.test(character))
|
|
7691
|
+
// 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
|
|
7692
|
+
output[last_index_in_output].text_ += character;else output.push({
|
|
7693
|
+
highlighted_: false,
|
|
7694
|
+
text_: character
|
|
7695
|
+
});
|
|
7696
|
+
} else {
|
|
7697
|
+
var _output$last_index_in2;
|
|
7698
|
+
const longest_found_string = found_strings.reduce((a, b) => a.length > b.length ? a : b);
|
|
7699
|
+
if ((_output$last_index_in2 = output[last_index_in_output]) !== null && _output$last_index_in2 !== void 0 && _output$last_index_in2.highlighted_) output[last_index_in_output].text_ += longest_found_string;else output.push({
|
|
7700
|
+
highlighted_: true,
|
|
7701
|
+
text_: longest_found_string
|
|
7702
|
+
});
|
|
7703
|
+
i += longest_found_string.length - 1;
|
|
7704
|
+
}
|
|
7705
|
+
}
|
|
7706
|
+
return output;
|
|
7707
|
+
}
|
|
7708
|
+
const $f1fc9ea3e7632eba$var$_tmpl$ = ["<div", ' class="description line-clamp">', "</div>"],
|
|
7709
|
+
$f1fc9ea3e7632eba$var$_tmpl$2 = ["<div", ' class="content-card"><div class="image">', '</div><div class="info"><!--#-->', "<!--/--><!--#-->", "<!--/--></div></div>"];
|
|
7710
|
+
function $f1fc9ea3e7632eba$export$f631859cab12b342(_ref) {
|
|
7711
|
+
let {
|
|
7712
|
+
router_: router_,
|
|
7713
|
+
content_result_: content_result_
|
|
7714
|
+
} = _ref;
|
|
7715
|
+
const make_link_attributes = () => {
|
|
7716
|
+
const result = content_result_ === null || content_result_ === void 0 ? void 0 : content_result_();
|
|
7717
|
+
if (!result) return;
|
|
7718
|
+
return {
|
|
7719
|
+
href: result.page_url,
|
|
7720
|
+
onClick: (0, $3hooq$depictaiutilishared.catchify)(ev => router_.navigate_.go_to_({
|
|
7721
|
+
new_url_: result.page_url,
|
|
7722
|
+
is_replace_: false,
|
|
7723
|
+
event_: ev
|
|
7724
|
+
}))
|
|
7725
|
+
};
|
|
7726
|
+
};
|
|
7727
|
+
const LinkIfPossible = _ref2 => {
|
|
7728
|
+
let {
|
|
7729
|
+
children: children,
|
|
7730
|
+
...attributes
|
|
7731
|
+
} = _ref2;
|
|
7732
|
+
if (content_result_) return (0, $3hooq$solidjsweb.ssrElement)("a", attributes, () => (0, $3hooq$solidjsweb.escape)(children), true);
|
|
7733
|
+
return (0, $3hooq$solidjsweb.ssrElement)("div", attributes, () => (0, $3hooq$solidjsweb.escape)(children), true);
|
|
7734
|
+
};
|
|
7735
|
+
return (0, $3hooq$solidjsweb.ssr)($f1fc9ea3e7632eba$var$_tmpl$2, (0, $3hooq$solidjsweb.ssrHydrationKey)(), (0, $3hooq$solidjsweb.escape)((0, $3hooq$solidjsweb.createComponent)(LinkIfPossible, (0, $3hooq$solidjsweb.mergeProps)(make_link_attributes, {
|
|
7736
|
+
tabIndex: "-1",
|
|
7737
|
+
get children() {
|
|
7738
|
+
return (0, $3hooq$solidjsweb.createComponent)((0, $3cf7b4db1e203c93$export$605674723bcc715c), {
|
|
7739
|
+
width: "28",
|
|
7740
|
+
height: "28"
|
|
7741
|
+
});
|
|
7742
|
+
}
|
|
7743
|
+
}))), (0, $3hooq$solidjsweb.escape)((0, $3hooq$solidjsweb.createComponent)(LinkIfPossible, (0, $3hooq$solidjsweb.mergeProps)({
|
|
7744
|
+
"class": "content-title line-clamp"
|
|
7745
|
+
}, make_link_attributes, {
|
|
7746
|
+
get title() {
|
|
7747
|
+
return content_result_ === null || content_result_ === void 0 ? void 0 : content_result_().title;
|
|
7748
|
+
},
|
|
7749
|
+
get children() {
|
|
7750
|
+
return content_result_ ? (0, $3hooq$solidjsweb.createComponent)((0, $99472afa7112c427$export$e1a98a189fd2c0e7), {
|
|
7751
|
+
content_result_: content_result_,
|
|
7752
|
+
key_: "title",
|
|
7753
|
+
cut_when_possible_: false
|
|
7754
|
+
}) : (0, $3hooq$solidjsweb.createComponent)((0, $a7f7d416e6f61504$export$89c6019e4baa40b1), {
|
|
7755
|
+
height: "1em",
|
|
7756
|
+
width: "20ch"
|
|
7757
|
+
});
|
|
7758
|
+
}
|
|
7759
|
+
}))), (0, $3hooq$solidjsweb.escape)((0, $3hooq$solidjsweb.createComponent)((0, $3hooq$solidjs.Show), {
|
|
7760
|
+
get when() {
|
|
7761
|
+
return (content_result_ === null || content_result_ === void 0 ? void 0 : content_result_().description) || !content_result_;
|
|
7762
|
+
},
|
|
7763
|
+
get children() {
|
|
7764
|
+
return (0, $3hooq$solidjsweb.ssr)($f1fc9ea3e7632eba$var$_tmpl$, (0, $3hooq$solidjsweb.ssrHydrationKey)(), (0, $3hooq$solidjsweb.escape)((0, $3hooq$solidjsweb.createComponent)((0, $3hooq$solidjs.Show), {
|
|
7765
|
+
when: content_result_,
|
|
7766
|
+
get fallback() {
|
|
7767
|
+
return Array.from({
|
|
7768
|
+
length: 4
|
|
7769
|
+
}).map(() => (0, $3hooq$solidjsweb.createComponent)((0, $a7f7d416e6f61504$export$89c6019e4baa40b1), {
|
|
7770
|
+
height: "1em",
|
|
7771
|
+
width: "min(50ch, 100%)"
|
|
7772
|
+
}));
|
|
7773
|
+
},
|
|
7774
|
+
get children() {
|
|
7775
|
+
return (0, $3hooq$solidjsweb.createComponent)((0, $99472afa7112c427$export$e1a98a189fd2c0e7), {
|
|
7776
|
+
content_result_: content_result_,
|
|
7777
|
+
key_: "description",
|
|
7778
|
+
cut_when_possible_: true
|
|
7779
|
+
});
|
|
7780
|
+
}
|
|
7781
|
+
})));
|
|
7782
|
+
}
|
|
7783
|
+
})));
|
|
7784
|
+
}
|
|
7785
|
+
function $bf4a8d57aa8dd1c8$export$9ff751cd77687edc(_ref) {
|
|
7786
|
+
let {
|
|
7787
|
+
search_results_: search_results_,
|
|
7788
|
+
router_: router_
|
|
7789
|
+
} = _ref;
|
|
7790
|
+
const content_results = (0, $3hooq$solidjs.createMemo)(() => {
|
|
7791
|
+
var _search_results_;
|
|
7792
|
+
return (_search_results_ = search_results_()) === null || _search_results_ === void 0 ? void 0 : _search_results_.content_search_links;
|
|
7793
|
+
});
|
|
7794
|
+
const content_results_by_page_url = (0, $3hooq$solidjs.createMemo)(() => {
|
|
7795
|
+
const map = new Map();
|
|
7796
|
+
const results = content_results();
|
|
7797
|
+
if (!results) return map;
|
|
7798
|
+
for (let i = 0; i < results.length; i++) {
|
|
7799
|
+
const content_result = results[i];
|
|
7800
|
+
map.set(content_result.page_url, content_result);
|
|
7801
|
+
}
|
|
7802
|
+
return map;
|
|
7803
|
+
});
|
|
7804
|
+
return (0, $3hooq$solidjsweb.createComponent)((0, $3hooq$solidjs.For), {
|
|
7805
|
+
get each() {
|
|
7806
|
+
return [...content_results_by_page_url().keys()];
|
|
7807
|
+
},
|
|
7808
|
+
children: page_url => {
|
|
7809
|
+
const content_result = (0, $3hooq$solidjs.createMemo)(() => content_results_by_page_url().get(page_url));
|
|
7810
|
+
return (0, $3hooq$solidjsweb.createComponent)((0, $f1fc9ea3e7632eba$export$f631859cab12b342), {
|
|
7811
|
+
content_result_: content_result,
|
|
7812
|
+
router_: router_
|
|
7813
|
+
});
|
|
7814
|
+
}
|
|
7815
|
+
});
|
|
7816
|
+
}
|
|
7817
|
+
function $05f255c0a94b9ca1$export$4405d077f0a20494(_ref) {
|
|
7818
|
+
let {
|
|
7819
|
+
content_results_rows_: [get_history_state_content_results_rows],
|
|
7820
|
+
cols_at_size_: cols_at_size_
|
|
7821
|
+
} = _ref;
|
|
7822
|
+
const largest_column = (0, $3hooq$solidjs.createMemo)(() => {
|
|
7823
|
+
const largest_in_cols_at_size = Math.max(...cols_at_size_().map(_ref2 => {
|
|
7824
|
+
let [cols] = _ref2;
|
|
7825
|
+
return cols;
|
|
7826
|
+
}));
|
|
7827
|
+
if (isNaN(largest_in_cols_at_size) || Math.abs(largest_in_cols_at_size) === Infinity) return 4; // fallback to something big so we always have the right amount of placeholders
|
|
7828
|
+
return largest_in_cols_at_size;
|
|
7829
|
+
});
|
|
7830
|
+
const num_placeholders = (0, $3hooq$solidjs.createMemo)(() => {
|
|
7831
|
+
var _get_history_state_co;
|
|
7832
|
+
return ((_get_history_state_co = get_history_state_content_results_rows()) !== null && _get_history_state_co !== void 0 ? _get_history_state_co : (0, $eab939d0b95b75ee$export$70ceae36059a1036)) * largest_column();
|
|
7833
|
+
});
|
|
7834
|
+
return (0, $3hooq$solidjsweb.createComponent)((0, $3hooq$solidjs.Index), {
|
|
7835
|
+
get each() {
|
|
7836
|
+
return Array.from({
|
|
7837
|
+
length: num_placeholders()
|
|
7838
|
+
});
|
|
7839
|
+
},
|
|
7840
|
+
children: () => (0, $3hooq$solidjsweb.createComponent)((0, $f1fc9ea3e7632eba$export$f631859cab12b342), {})
|
|
7841
|
+
});
|
|
7842
|
+
}
|
|
7843
|
+
const $eab939d0b95b75ee$var$_tmpl$ = ["<div", ' class="', '" style="', '"><!--#-->', "<!--/--><!--#-->", "<!--/--></div>"],
|
|
7844
|
+
$eab939d0b95b75ee$var$_tmpl$2 = ["<button", ' class="view-more">', "</button>"],
|
|
7845
|
+
$eab939d0b95b75ee$var$_tmpl$3 = ["<button", ' class="view-less">', "</button>"];
|
|
7846
|
+
const $eab939d0b95b75ee$export$70ceae36059a1036 = 1;
|
|
7847
|
+
function $eab939d0b95b75ee$export$6d0c9c22f6652669(_ref) {
|
|
7848
|
+
var _content_results2;
|
|
7849
|
+
let {
|
|
7850
|
+
search_results_: search_results_,
|
|
7851
|
+
get_search_query_: get_search_query_,
|
|
7852
|
+
i18n_: i18n_,
|
|
7853
|
+
layout_options_: layout_options_,
|
|
7854
|
+
router_: router_,
|
|
7855
|
+
query_base_: query_base_,
|
|
7856
|
+
content_results_rows_: content_results_rows_
|
|
7857
|
+
} = _ref;
|
|
7858
|
+
const content_results = (0, $3hooq$solidjs.createMemo)(() => {
|
|
7859
|
+
var _search_results_;
|
|
7860
|
+
return (_search_results_ = search_results_()) === null || _search_results_ === void 0 ? void 0 : _search_results_.content_search_links;
|
|
7861
|
+
});
|
|
7862
|
+
const num_results = (0, $3hooq$solidjs.createMemo)(() => {
|
|
7863
|
+
var _content_results;
|
|
7864
|
+
return (_content_results = content_results()) === null || _content_results === void 0 ? void 0 : _content_results.length;
|
|
7865
|
+
});
|
|
7866
|
+
const is_loading_ = (0, $3hooq$solidjs.createMemo)(() => search_results_.loading || query_base_.loading); // See comment in PLPResults/index.tsx on why we need this
|
|
7867
|
+
const formatted_number_of_results_ = (0, $068bde7fa83ac02c$export$92f2da32c6e7e7ee)({
|
|
7868
|
+
number_: num_results,
|
|
7869
|
+
i18n_: i18n_
|
|
7870
|
+
});
|
|
7871
|
+
const [is_showing_placeholders, set_is_showing_placeholders] = (0, $3hooq$solidjs.createSignal)(false);
|
|
7872
|
+
const rows_object = $eab939d0b95b75ee$var$make_state_saved_rows(content_results_rows_, i18n_);
|
|
7873
|
+
return (0, $3hooq$solidjsweb.ssr)($eab939d0b95b75ee$var$_tmpl$, (0, $3hooq$solidjsweb.ssrHydrationKey)(), "content-results ".concat(is_showing_placeholders() ? "loading" : ""), "display:" + (is_loading_() || ((_content_results2 = content_results()) === null || _content_results2 === void 0 ? void 0 : _content_results2.length) > 0 ? "" : "none"), (0, $3hooq$solidjsweb.escape)((0, $3hooq$solidjsweb.createComponent)((0, $9870a8a48ee126af$export$9dd50d35b9d94fdf), {
|
|
7874
|
+
get_search_query_: get_search_query_,
|
|
7875
|
+
i18n_: i18n_,
|
|
7876
|
+
formatted_number_of_results_: formatted_number_of_results_,
|
|
7877
|
+
get type() {
|
|
7878
|
+
return (0, $9870a8a48ee126af$export$2452208c79fe93ea).content;
|
|
7879
|
+
},
|
|
7880
|
+
number_of_results_: num_results
|
|
7881
|
+
})), (0, $3hooq$solidjsweb.escape)((0, $3hooq$solidjsweb.createComponent)((0, $6c2c739b113a8ddf$export$d21e32dfedac04be), (0, $3hooq$solidjsweb.mergeProps)({
|
|
7882
|
+
layout: "grid",
|
|
7883
|
+
element_attributes: {
|
|
7884
|
+
class: "cards"
|
|
7885
|
+
}
|
|
7886
|
+
}, layout_options_, {
|
|
7887
|
+
rows: rows_object,
|
|
7888
|
+
get children() {
|
|
7889
|
+
return (0, $3hooq$solidjsweb.createComponent)((0, $3hooq$solidjs.Suspense), {
|
|
7890
|
+
get fallback() {
|
|
7891
|
+
return (() => {
|
|
7892
|
+
set_is_showing_placeholders(true);
|
|
7893
|
+
(0, $3hooq$solidjs.onCleanup)(() => set_is_showing_placeholders(false));
|
|
7894
|
+
return (0, $3hooq$solidjsweb.createComponent)((0, $05f255c0a94b9ca1$export$4405d077f0a20494), {
|
|
7895
|
+
content_results_rows_: content_results_rows_,
|
|
7896
|
+
get cols_at_size_() {
|
|
7897
|
+
return (0, $3hooq$solidjs.createMemo)(() => layout_options_().cols_at_size);
|
|
7898
|
+
}
|
|
7899
|
+
});
|
|
7900
|
+
})();
|
|
7901
|
+
},
|
|
7902
|
+
get children() {
|
|
7903
|
+
return (0, $3hooq$solidjsweb.createComponent)((0, $bf4a8d57aa8dd1c8$export$9ff751cd77687edc), {
|
|
7904
|
+
router_: router_,
|
|
7905
|
+
search_results_: search_results_
|
|
7906
|
+
});
|
|
7907
|
+
}
|
|
7908
|
+
});
|
|
7909
|
+
}
|
|
7910
|
+
}))));
|
|
7911
|
+
}
|
|
7912
|
+
function $eab939d0b95b75ee$var$make_state_saved_rows(_ref2, i18n_) {
|
|
7913
|
+
let [get_showing_content_results_rows, set_showing_content_results_rows] = _ref2;
|
|
7914
|
+
const currently_visible = (0, $3hooq$solidjs.createSignal)((0, $3hooq$solidjs.untrack)(get_showing_content_results_rows));
|
|
7915
|
+
const [get_currently_visible, set_currently_visible] = currently_visible;
|
|
7916
|
+
const rows = {
|
|
7917
|
+
currently_visible: currently_visible,
|
|
7918
|
+
start_rows: $eab939d0b95b75ee$export$70ceae36059a1036,
|
|
7919
|
+
button: (0, $3hooq$solidjsweb.ssr)($eab939d0b95b75ee$var$_tmpl$2, (0, $3hooq$solidjsweb.ssrHydrationKey)(), (0, $3hooq$solidjsweb.escape)(i18n_.view_more_())),
|
|
7920
|
+
view_less_button: (0, $3hooq$solidjsweb.ssr)($eab939d0b95b75ee$var$_tmpl$3, (0, $3hooq$solidjsweb.ssrHydrationKey)(), (0, $3hooq$solidjsweb.escape)(i18n_.view_less_())),
|
|
7921
|
+
rows_per_click: 3
|
|
7922
|
+
};
|
|
7923
|
+
(0, $3hooq$solidjs.createComputed)((0, $3hooq$solidjs.on)(get_currently_visible, new_visible => set_showing_content_results_rows(new_visible), {
|
|
7924
|
+
defer: true
|
|
7925
|
+
}));
|
|
7926
|
+
(0, $3hooq$solidjs.createComputed)((0, $3hooq$solidjs.on)(get_showing_content_results_rows, function () {
|
|
7927
|
+
let new_rows = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : $eab939d0b95b75ee$export$70ceae36059a1036;
|
|
7928
|
+
return set_currently_visible(new_rows);
|
|
7929
|
+
}, {
|
|
7930
|
+
defer: true
|
|
7931
|
+
}));
|
|
7932
|
+
return rows;
|
|
7933
|
+
}
|
|
7305
7934
|
const $739c927cbecd26b0$var$_tmpl$ = ["<div", ' class="filter-results-for-one-row"><!--#-->', "<!--/--><!--#-->", "<!--/--></div>"],
|
|
7306
|
-
$739c927cbecd26b0$var$_tmpl$2 = ["<div", ' class="depict plp search"><div class="listing-page"><!--#-->', "<!--/--><!--#-->", "<!--/--><!--#-->", "<!--/--><!--#-->", "<!--/--><!--#-->", "<!--/--><!--#-->", "<!--/--></div><!--#-->", "<!--/--><!--#-->", "<!--/--></div>"];
|
|
7935
|
+
$739c927cbecd26b0$var$_tmpl$2 = ["<div", ' class="depict plp search"><div class="listing-page"><!--#-->', "<!--/--><!--#-->", "<!--/--><!--#-->", "<!--/--><!--#-->", "<!--/--><!--#-->", "<!--/--><!--#-->", "<!--/--><!--#-->", "<!--/--></div><!--#-->", "<!--/--><!--#-->", "<!--/--></div>"];
|
|
7307
7936
|
function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
|
|
7308
7937
|
let {
|
|
7309
7938
|
depict_api_: depict_api_,
|
|
@@ -7333,7 +7962,11 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
|
|
|
7333
7962
|
recommendations_layout_options_: recommendations_layout_options_,
|
|
7334
7963
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
7335
7964
|
product_card_template_: product_card_template_,
|
|
7336
|
-
modal_body_style_ref_: modal_body_style_ref_
|
|
7965
|
+
modal_body_style_ref_: modal_body_style_ref_,
|
|
7966
|
+
router_: router_,
|
|
7967
|
+
content_results_rows_: content_results_rows_,
|
|
7968
|
+
content_layout_options_: content_layout_options_,
|
|
7969
|
+
content_search_enabled_: content_search_enabled_
|
|
7337
7970
|
} = _ref;
|
|
7338
7971
|
const [get_sorting] = current_sorting_;
|
|
7339
7972
|
const all_products_loaded_ = (0, $3hooq$solidjs.createSignal)(false);
|
|
@@ -7400,16 +8033,29 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
|
|
|
7400
8033
|
const SafeSearchField = (0, $3hooq$depictaiutilishared.catchify)((0, $29e5dbeb69da7a36$export$b94867ecbd698f21));
|
|
7401
8034
|
const [sort_or_filter_open_, set_sort_or_filter_open_] = (0, $3hooq$solidjs.createSignal)(false);
|
|
7402
8035
|
const [desktop_filter_elements_, set_desktop_filter_elements] = (0, $3hooq$solidjs.createSignal)();
|
|
8036
|
+
const n_hits = (0, $3hooq$solidjs.createMemo)(() => {
|
|
8037
|
+
var _search_results_3;
|
|
8038
|
+
return (_search_results_3 = search_results_()) === null || _search_results_3 === void 0 ? void 0 : _search_results_3.n_hits;
|
|
8039
|
+
});
|
|
7403
8040
|
const formatted_number_of_results_ = (0, $068bde7fa83ac02c$export$92f2da32c6e7e7ee)({
|
|
7404
|
-
|
|
8041
|
+
number_: n_hits,
|
|
7405
8042
|
i18n_: i18n_
|
|
7406
8043
|
});
|
|
7407
8044
|
const [sort_and_filter_element_, set_sort_and_filter_element_] = (0, $3hooq$solidjs.createSignal)();
|
|
7408
|
-
const
|
|
8045
|
+
const no_results_text_ = (0, $3hooq$solidjs.createMemo)(() => {
|
|
8046
|
+
var _search_results_4, _search_results_4$con;
|
|
8047
|
+
return ((_search_results_4 = search_results_()) !== null && _search_results_4 !== void 0 && (_search_results_4$con = _search_results_4.content_search_links) !== null && _search_results_4$con !== void 0 && _search_results_4$con.length ? i18n_.no_products_ : i18n_.no_results_text_)();
|
|
8048
|
+
});
|
|
8049
|
+
const results_for = (0, $3hooq$solidjsweb.createComponent)((0, $9870a8a48ee126af$export$9dd50d35b9d94fdf), (0, $3hooq$solidjsweb.mergeProps)({
|
|
8050
|
+
get type() {
|
|
8051
|
+
return (0, $9870a8a48ee126af$export$2452208c79fe93ea).products;
|
|
8052
|
+
},
|
|
8053
|
+
number_of_results_: n_hits
|
|
8054
|
+
}, {
|
|
7409
8055
|
get_search_query_: get_search_query_,
|
|
7410
8056
|
i18n_: i18n_,
|
|
7411
8057
|
formatted_number_of_results_: formatted_number_of_results_
|
|
7412
|
-
});
|
|
8058
|
+
}));
|
|
7413
8059
|
const filters_opener = (0, $f70cc6dfcadf0fd5$export$d7841e452f2e59a8)({
|
|
7414
8060
|
set_sort_or_filter_open_: set_sort_or_filter_open_,
|
|
7415
8061
|
set_extra_els_in_results_container_: set_desktop_filter_elements,
|
|
@@ -7518,7 +8164,28 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
|
|
|
7518
8164
|
children: make_category_suggestion_card_
|
|
7519
8165
|
});
|
|
7520
8166
|
}
|
|
7521
|
-
})) : (0, $3hooq$solidjsweb.escape)(null), (0, $3hooq$solidjsweb.escape)(
|
|
8167
|
+
})) : (0, $3hooq$solidjsweb.escape)(null), (0, $3hooq$solidjsweb.escape)((0, $3hooq$solidjsweb.createComponent)((0, $1b3cf201cdd38687$export$b69d0d92862de18b), {
|
|
8168
|
+
severity_: "error",
|
|
8169
|
+
message_: "ContentResults failed",
|
|
8170
|
+
get children() {
|
|
8171
|
+
return (0, $3hooq$solidjsweb.createComponent)((0, $3hooq$solidjs.Show), {
|
|
8172
|
+
get when() {
|
|
8173
|
+
return content_search_enabled_();
|
|
8174
|
+
},
|
|
8175
|
+
get children() {
|
|
8176
|
+
return (0, $3hooq$solidjsweb.createComponent)((0, $eab939d0b95b75ee$export$6d0c9c22f6652669), {
|
|
8177
|
+
content_results_rows_: content_results_rows_,
|
|
8178
|
+
search_results_: search_results_,
|
|
8179
|
+
i18n_: i18n_,
|
|
8180
|
+
get_search_query_: get_search_query_,
|
|
8181
|
+
layout_options_: content_layout_options_,
|
|
8182
|
+
router_: router_,
|
|
8183
|
+
query_base_: search_query_base_
|
|
8184
|
+
});
|
|
8185
|
+
}
|
|
8186
|
+
});
|
|
8187
|
+
}
|
|
8188
|
+
})), (0, $3hooq$solidjsweb.escape)(results_filters[0]()), (0, $3hooq$solidjsweb.escape)((0, $3hooq$solidjsweb.createComponent)((0, $3hooq$solidjs.Show), {
|
|
7522
8189
|
get when() {
|
|
7523
8190
|
var _selected_filters_$;
|
|
7524
8191
|
return (_selected_filters_$ = selected_filters_[0]()) === null || _selected_filters_$ === void 0 ? void 0 : _selected_filters_$.length;
|
|
@@ -7563,7 +8230,10 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
|
|
|
7563
8230
|
selected_filters_: selected_filters_,
|
|
7564
8231
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
7565
8232
|
local_filter_cache_: local_filter_cache_,
|
|
7566
|
-
i18n_:
|
|
8233
|
+
i18n_: {
|
|
8234
|
+
...i18n_,
|
|
8235
|
+
no_results_text_: no_results_text_
|
|
8236
|
+
}
|
|
7567
8237
|
}
|
|
7568
8238
|
});
|
|
7569
8239
|
}
|
|
@@ -7604,8 +8274,8 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
|
|
|
7604
8274
|
formatted_number_of_results_: formatted_number_of_results_,
|
|
7605
8275
|
i18n_: i18n_,
|
|
7606
8276
|
number_of_results_: (0, $3hooq$solidjs.createMemo)(() => {
|
|
7607
|
-
var
|
|
7608
|
-
return (
|
|
8277
|
+
var _search_results_5;
|
|
8278
|
+
return (_search_results_5 = search_results_()) === null || _search_results_5 === void 0 ? void 0 : _search_results_5.n_hits;
|
|
7609
8279
|
})
|
|
7610
8280
|
});
|
|
7611
8281
|
}
|
|
@@ -7643,6 +8313,38 @@ function $98bd00c15a2e3159$export$828dcdd425fd3231(aligner) {
|
|
|
7643
8313
|
cleanup: cleanup
|
|
7644
8314
|
};
|
|
7645
8315
|
}
|
|
8316
|
+
|
|
8317
|
+
/**
|
|
8318
|
+
* Content results ContentCard look stupid on mobile if there are two columns of them, so we limit the number of columns to 1 if the screen is too small
|
|
8319
|
+
*/
|
|
8320
|
+
function $b1ea8d47bcf03111$export$ff7109b9b2b206ba(sdk_cols_at_size) {
|
|
8321
|
+
let min_width_for_more_than_one_column = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
|
|
8322
|
+
if (!sdk_cols_at_size.length) return sdk_cols_at_size;
|
|
8323
|
+
const sorted_sizes = sdk_cols_at_size.map(_ref => {
|
|
8324
|
+
let [cols, max_width] = _ref;
|
|
8325
|
+
return [cols, max_width !== null && max_width !== void 0 ? max_width : Infinity];
|
|
8326
|
+
}).sort((_ref2, _ref3) => {
|
|
8327
|
+
let [, a] = _ref2;
|
|
8328
|
+
let [, b] = _ref3;
|
|
8329
|
+
return a - b;
|
|
8330
|
+
});
|
|
8331
|
+
const [[, smallest_max_width]] = sorted_sizes;
|
|
8332
|
+
if (smallest_max_width > min_width_for_more_than_one_column)
|
|
8333
|
+
// If everything above min_width_for_more_than_one_column, we can just add a 1 column at the beginning
|
|
8334
|
+
return [[1, min_width_for_more_than_one_column], ...sdk_cols_at_size];
|
|
8335
|
+
const to_delete = [];
|
|
8336
|
+
for (let i = 0; i < sorted_sizes.length; i++) {
|
|
8337
|
+
const [, max_width] = sorted_sizes[i];
|
|
8338
|
+
if (max_width > min_width_for_more_than_one_column) continue;
|
|
8339
|
+
to_delete.push(i);
|
|
8340
|
+
}
|
|
8341
|
+
while (to_delete.length) sorted_sizes.splice(to_delete.pop(), 1);
|
|
8342
|
+
sorted_sizes.unshift([1, min_width_for_more_than_one_column]);
|
|
8343
|
+
return sorted_sizes.map(_ref4 => {
|
|
8344
|
+
let [cols, max_width] = _ref4;
|
|
8345
|
+
return max_width == Infinity ? [cols] : [cols, max_width];
|
|
8346
|
+
});
|
|
8347
|
+
}
|
|
7646
8348
|
const $ddd39c5f36f49703$var$_tmpl$ = ["<div", ' class="depict plp search">', "</div>"];
|
|
7647
8349
|
function $ddd39c5f36f49703$var$_classPrivateFieldInitSpec(obj, privateMap, value) {
|
|
7648
8350
|
$ddd39c5f36f49703$var$_checkPrivateRedeclaration(obj, privateMap);
|
|
@@ -7674,6 +8376,7 @@ function $ddd39c5f36f49703$var$_classApplyDescriptorGet(receiver, descriptor) {
|
|
|
7674
8376
|
* Type for the private properties that are shared between the different exported search SDK wrapper functions. SDK users are not allowed to change/access these, they're an internal implementation detail.
|
|
7675
8377
|
*/
|
|
7676
8378
|
const $ddd39c5f36f49703$var$privately_shared_properties = /*@__PURE__*/new WeakMap();
|
|
8379
|
+
const $ddd39c5f36f49703$var$content_search_default = false;
|
|
7677
8380
|
const $ddd39c5f36f49703$var$min_products_to_fetch_ = 20;
|
|
7678
8381
|
const $ddd39c5f36f49703$export$bde3eb976dfded9 = depict_search => {
|
|
7679
8382
|
var _privately_shared_pro;
|
|
@@ -7683,6 +8386,7 @@ var $ddd39c5f36f49703$var$_locale_signal = /*#__PURE__*/new WeakMap();
|
|
|
7683
8386
|
var $ddd39c5f36f49703$var$_merchant_signal = /*#__PURE__*/new WeakMap();
|
|
7684
8387
|
var $ddd39c5f36f49703$var$_market_signal = /*#__PURE__*/new WeakMap();
|
|
7685
8388
|
var $ddd39c5f36f49703$var$_modal_open_signal = /*#__PURE__*/new WeakMap();
|
|
8389
|
+
var $ddd39c5f36f49703$var$_content_search_signal = /*#__PURE__*/new WeakMap();
|
|
7686
8390
|
var $ddd39c5f36f49703$var$_router = /*#__PURE__*/new WeakMap();
|
|
7687
8391
|
class $ddd39c5f36f49703$export$ac6237957a15b3f0 {
|
|
7688
8392
|
constructor(_ref) {
|
|
@@ -7694,9 +8398,10 @@ class $ddd39c5f36f49703$export$ac6237957a15b3f0 {
|
|
|
7694
8398
|
on_navigation: on_navigation,
|
|
7695
8399
|
enable_category_suggestions = true,
|
|
7696
8400
|
page_url_creator: page_url_creator,
|
|
8401
|
+
display_transformers: display_transformers,
|
|
8402
|
+
api: api,
|
|
7697
8403
|
// Stuff needed for non-standard customer deployments that we shouldn't actually expose
|
|
7698
8404
|
disable_scrolling_during_modal = true,
|
|
7699
|
-
api: api,
|
|
7700
8405
|
bottom_distance_under_modal: bottom_distance_under_modal,
|
|
7701
8406
|
render_instant_card: render_instant_card,
|
|
7702
8407
|
...props_on_class
|
|
@@ -7717,6 +8422,10 @@ class $ddd39c5f36f49703$export$ac6237957a15b3f0 {
|
|
|
7717
8422
|
writable: true,
|
|
7718
8423
|
value: (0, $3hooq$solidjs.createSignal)(false)
|
|
7719
8424
|
});
|
|
8425
|
+
$ddd39c5f36f49703$var$_classPrivateFieldInitSpec(this, $ddd39c5f36f49703$var$_content_search_signal, {
|
|
8426
|
+
writable: true,
|
|
8427
|
+
value: (0, $3hooq$solidjs.createSignal)()
|
|
8428
|
+
});
|
|
7720
8429
|
$ddd39c5f36f49703$var$_classPrivateFieldInitSpec(this, $ddd39c5f36f49703$var$_router, {
|
|
7721
8430
|
writable: true,
|
|
7722
8431
|
value: new (0, $73014ff36186a4dd$export$7e1297a3a19f10d8)("hard_navigation")
|
|
@@ -7752,6 +8461,7 @@ class $ddd39c5f36f49703$export$ac6237957a15b3f0 {
|
|
|
7752
8461
|
local_filter_cache: [],
|
|
7753
8462
|
expanded_hierarchical_filters: [],
|
|
7754
8463
|
showing_recommendation_rows: (0, $c77adcdf5346b187$export$1c8c715550dc689d),
|
|
8464
|
+
content_results_rows: (0, $eab939d0b95b75ee$export$70ceae36059a1036),
|
|
7755
8465
|
scroll_restoration_data: []
|
|
7756
8466
|
};
|
|
7757
8467
|
},
|
|
@@ -7763,12 +8473,18 @@ class $ddd39c5f36f49703$export$ac6237957a15b3f0 {
|
|
|
7763
8473
|
const get_search_query_ = (0, $3hooq$solidjs.createMemo)(previous_value => {
|
|
7764
8474
|
if (get_search_query_updating_blocked()) return previous_value;else return raw_search_query_accessor();
|
|
7765
8475
|
});
|
|
8476
|
+
// @ts-ignore
|
|
7766
8477
|
const depict_api_ = api !== null && api !== void 0 ? api : new (0, $e270e9f953fcbc58$export$e015ed2f2950f2e3)({
|
|
7767
|
-
page_url_creator: page_url_creator
|
|
8478
|
+
page_url_creator: page_url_creator,
|
|
8479
|
+
display_transformers: display_transformers
|
|
7768
8480
|
});
|
|
7769
8481
|
const previous_searches = (0, $cfeb65948dbdcaab$export$84bba84a7b837187)(get_search_query_);
|
|
7770
8482
|
const [, set_search_showing_recommendation_rows] = state_.showing_recommendation_rows;
|
|
7771
|
-
const
|
|
8483
|
+
const [, set_search_content_results_rows] = state_.content_results_rows;
|
|
8484
|
+
const after_submit_ = () => {
|
|
8485
|
+
set_search_showing_recommendation_rows((0, $c77adcdf5346b187$export$1c8c715550dc689d));
|
|
8486
|
+
set_search_content_results_rows((0, $eab939d0b95b75ee$export$70ceae36059a1036));
|
|
8487
|
+
}; // do this every time after we have submitted a new query - otherwise there might already be a saved number of rows in the state
|
|
7772
8488
|
const on_submit_with_unchanged_value_ = () => this.modal_open = false;
|
|
7773
8489
|
const [get_search_field_value_, set_search_field_value_] = state_.field_value;
|
|
7774
8490
|
const configured_submit_query_ = new_query => (0, $7f680455a2aa1079$export$e16630ecb9644a1c)({
|
|
@@ -7826,6 +8542,10 @@ class $ddd39c5f36f49703$export$ac6237957a15b3f0 {
|
|
|
7826
8542
|
submit_query_: configured_submit_query_,
|
|
7827
8543
|
url_transformer_: url_transformer,
|
|
7828
8544
|
router_: (0, $parcel$interopDefault($3hooq$babelruntimehelpersclassPrivateFieldGet))(this, $ddd39c5f36f49703$var$_router),
|
|
8545
|
+
content_search_enabled_: () => {
|
|
8546
|
+
var _classPrivateFieldGet2;
|
|
8547
|
+
return (_classPrivateFieldGet2 = (0, $parcel$interopDefault($3hooq$babelruntimehelpersclassPrivateFieldGet))(this, $ddd39c5f36f49703$var$_content_search_signal)[0]()) !== null && _classPrivateFieldGet2 !== void 0 ? _classPrivateFieldGet2 : $ddd39c5f36f49703$var$content_search_default;
|
|
8548
|
+
},
|
|
7829
8549
|
instant_results_options_: {
|
|
7830
8550
|
min_products_to_fetch_: $ddd39c5f36f49703$var$min_products_to_fetch_,
|
|
7831
8551
|
render_instant_card_: render_instant_card,
|
|
@@ -7894,6 +8614,12 @@ class $ddd39c5f36f49703$export$ac6237957a15b3f0 {
|
|
|
7894
8614
|
(0, $3hooq$solidjs.onCleanup)(() => $ddd39c5f36f49703$var$_classStaticPrivateFieldSpecGet($ddd39c5f36f49703$export$ac6237957a15b3f0, $ddd39c5f36f49703$export$ac6237957a15b3f0, $ddd39c5f36f49703$var$_keys_constructed_with).delete(unique_instance_key_for_state));
|
|
7895
8615
|
});
|
|
7896
8616
|
}
|
|
8617
|
+
get enable_content_search() {
|
|
8618
|
+
return (0, $parcel$interopDefault($3hooq$babelruntimehelpersclassPrivateFieldGet))(this, $ddd39c5f36f49703$var$_content_search_signal)[0]();
|
|
8619
|
+
}
|
|
8620
|
+
set enable_content_search(new_state) {
|
|
8621
|
+
(0, $parcel$interopDefault($3hooq$babelruntimehelpersclassPrivateFieldGet))(this, $ddd39c5f36f49703$var$_content_search_signal)[1](new_state);
|
|
8622
|
+
}
|
|
7897
8623
|
get on_navigation() {
|
|
7898
8624
|
// The only non-reactive public property on the class (I don't see it making sense to have it reactive)
|
|
7899
8625
|
return (0, $parcel$interopDefault($3hooq$babelruntimehelpersclassPrivateFieldGet))(this, $ddd39c5f36f49703$var$_router).on_navigation_;
|
|
@@ -7980,6 +8706,10 @@ function $ddd39c5f36f49703$export$f2dc7e4e4aa11abb(props) {
|
|
|
7980
8706
|
depict_api_: shared_properties.depict_api_,
|
|
7981
8707
|
min_products_to_fetch_: $ddd39c5f36f49703$var$min_products_to_fetch_,
|
|
7982
8708
|
local_filter_cache_: state_.local_filter_cache,
|
|
8709
|
+
content_search_enabled_: () => {
|
|
8710
|
+
var _depict_search$enable;
|
|
8711
|
+
return (_depict_search$enable = depict_search.enable_content_search) !== null && _depict_search$enable !== void 0 ? _depict_search$enable : $ddd39c5f36f49703$var$content_search_default;
|
|
8712
|
+
},
|
|
7983
8713
|
search_field_value_: state_.field_value,
|
|
7984
8714
|
get_search_query_: shared_properties.get_search_query_,
|
|
7985
8715
|
clear_filters_on_next_submit_: shared_properties.clear_filters_on_next_submit_,
|
|
@@ -8009,6 +8739,8 @@ function $ddd39c5f36f49703$export$f2dc7e4e4aa11abb(props) {
|
|
|
8009
8739
|
search_filters_open_: state_.filters_open,
|
|
8010
8740
|
search_sorting_open_: state_.sorting_open,
|
|
8011
8741
|
expanded_filters_: state_.expanded_filters,
|
|
8742
|
+
content_results_rows_: state_.content_results_rows,
|
|
8743
|
+
router_: shared_properties.router_,
|
|
8012
8744
|
make_category_suggestion_card_: shared_properties.enable_category_suggestions_ ? category_suggestion_ => {
|
|
8013
8745
|
return (0, $3001ad378baf39dc$export$d757d54550ebfb3d)({
|
|
8014
8746
|
category_suggestion_: category_suggestion_,
|
|
@@ -8024,6 +8756,10 @@ function $ddd39c5f36f49703$export$f2dc7e4e4aa11abb(props) {
|
|
|
8024
8756
|
cols_at_size: (0, $5401a6698b0c0658$export$6daf8749b65a1b77)(props.cols_at_size),
|
|
8025
8757
|
...grid_spacing_override()
|
|
8026
8758
|
})),
|
|
8759
|
+
content_layout_options_: (0, $3hooq$solidjs.createMemo)(() => ({
|
|
8760
|
+
cols_at_size: (0, $5401a6698b0c0658$export$6daf8749b65a1b77)((0, $b1ea8d47bcf03111$export$ff7109b9b2b206ba)(props.cols_at_size)),
|
|
8761
|
+
...grid_spacing_override()
|
|
8762
|
+
})),
|
|
8027
8763
|
recommendations_layout_options_: (0, $3hooq$solidjs.createMemo)(() => {
|
|
8028
8764
|
const {
|
|
8029
8765
|
extra_depict_options: extra_depict_options
|