@depict-ai/ui 4.7.24 → 4.7.26
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 +105 -33
- package/ES10/index.d.ts +5 -1
- package/ES10/index.js +323 -252
- package/latest/index.cjs +105 -33
- package/latest/index.d.ts +5 -1
- package/latest/index.js +323 -252
- package/package.json +1 -1
- package/server/ES10/index.cjs +76 -20
- package/server/ES10/index.d.ts +5 -1
- package/server/ES10/index.js +212 -157
- package/server/latest/index.cjs +76 -20
- package/server/latest/index.d.ts +5 -1
- package/server/latest/index.js +212 -157
package/server/latest/index.js
CHANGED
|
@@ -1,13 +1,67 @@
|
|
|
1
|
-
import { add_to_version_info as $i7OB2$add_to_version_info, slider_fading_factory as $i7OB2$slider_fading_factory, Amazing_Slider as $i7OB2$Amazing_Slider, slider_snap_css as $i7OB2$slider_snap_css, catchify as $i7OB2$
|
|
2
|
-
import {
|
|
1
|
+
import { add_to_version_info as $i7OB2$add_to_version_info, slider_fading_factory as $i7OB2$slider_fading_factory, Amazing_Slider as $i7OB2$Amazing_Slider, slider_snap_css as $i7OB2$slider_snap_css, catchify as $i7OB2$catchify1, dlog as $i7OB2$dlog1, camelCasifyObject as $i7OB2$camelCasifyObject, useExpandingContainer as $i7OB2$useExpandingContainer, fetch_retry as $i7OB2$fetch_retry, base_url as $i7OB2$base_url, dwarn as $i7OB2$dwarn, slider_fractional_factory as $i7OB2$slider_fractional_factory, make_random_classname as $i7OB2$make_random_classname, n_col_styling_with_dist as $i7OB2$n_col_styling_with_dist, layout_get_visible_recs_without_partial_rows as $i7OB2$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $i7OB2$layout_get_total_rec_amount_for_row, layout_media_query_header as $i7OB2$layout_media_query_header, report as $i7OB2$report, observer as $i7OB2$observer, javascript_media_query as $i7OB2$javascript_media_query, queueMacroTask as $i7OB2$queueMacroTask, findMostFrequentItem as $i7OB2$findMostFrequentItem, standard_price_format as $i7OB2$standard_price_format, instant_exec_on_suspect_history_change as $i7OB2$instant_exec_on_suspect_history_change, deparallelize_no_drop as $i7OB2$deparallelize_no_drop, ContainedImage as $i7OB2$ContainedImage, make_asyncIterable_exiter as $i7OB2$make_asyncIterable_exiter, href_change_ipns as $i7OB2$href_change_ipns, base64_encode_unicode as $i7OB2$base64_encode_unicode, base64_decode_unicode as $i7OB2$base64_decode_unicode, use_href_accessor as $i7OB2$use_href_accessor, get_session_id as $i7OB2$get_session_id, add_version_query_params as $i7OB2$add_version_query_params, hex_to_rgb as $i7OB2$hex_to_rgb, relative_luminance_from_rgb as $i7OB2$relative_luminance_from_rgb, snakeCasifyObject as $i7OB2$snakeCasifyObject, sort_obj as $i7OB2$sort_obj, make_url_with_query_params as $i7OB2$make_url_with_query_params, insert_surfaces as $i7OB2$insert_surfaces } from "@depict-ai/utilishared/latest";
|
|
2
|
+
import { dlog as $i7OB2$dlog, catchify as $i7OB2$catchify, ListenableSet as $i7OB2$ListenableSet, use_href_accessor as $i7OB2$use_href_accessor1, queueMacroTask as $i7OB2$queueMacroTask1, report as $i7OB2$report1 } from "@depict-ai/utilishared/latest";
|
|
3
|
+
import { createRoot as $i7OB2$createRoot, createSignal as $i7OB2$createSignal, createEffect as $i7OB2$createEffect, onCleanup as $i7OB2$onCleanup, createContext as $i7OB2$createContext, Show as $i7OB2$Show, useContext as $i7OB2$useContext, createMemo as $i7OB2$createMemo, untrack as $i7OB2$untrack, For as $i7OB2$For, getOwner as $i7OB2$getOwner, createResource as $i7OB2$createResource, runWithOwner as $i7OB2$runWithOwner, mergeProps as $i7OB2$mergeProps1, Suspense as $i7OB2$Suspense, createRenderEffect as $i7OB2$createRenderEffect, Index as $i7OB2$Index, createUniqueId as $i7OB2$createUniqueId, createComputed as $i7OB2$createComputed, ErrorBoundary as $i7OB2$ErrorBoundary, splitProps as $i7OB2$splitProps, on as $i7OB2$on, batch as $i7OB2$batch, createSelector as $i7OB2$createSelector, children as $i7OB2$children, createReaction as $i7OB2$createReaction, mapArray as $i7OB2$mapArray } from "solid-js";
|
|
3
4
|
import { ssr as $i7OB2$ssr, ssrHydrationKey as $i7OB2$ssrHydrationKey, escape as $i7OB2$escape, createComponent as $i7OB2$createComponent, isServer as $i7OB2$isServer, insert as $i7OB2$insert, ssrAttribute as $i7OB2$ssrAttribute, ssrStyle as $i7OB2$ssrStyle, mergeProps as $i7OB2$mergeProps, ssrElement as $i7OB2$ssrElement, ssrClassList as $i7OB2$ssrClassList, spread as $i7OB2$spread, Dynamic as $i7OB2$Dynamic } from "solid-js/web";
|
|
4
|
-
import { ListenableSet as $i7OB2$ListenableSet, catchify as $i7OB2$catchify1, use_href_accessor as $i7OB2$use_href_accessor1, queueMacroTask as $i7OB2$queueMacroTask1, report as $i7OB2$report1 } from "@depict-ai/utilishared/latest";
|
|
5
5
|
import { createStore as $i7OB2$createStore, reconcile as $i7OB2$reconcile } from "solid-js/store";
|
|
6
6
|
|
|
7
7
|
/*! Depict.ai search and product listing SDK */
|
|
8
8
|
import { register_es_version } from "../../multi_import_deduplicator.mjs";
|
|
9
9
|
register_es_version("ui", "latest");
|
|
10
|
-
const $ec291e0010116877$export$83d89fbfd8236492 = "4.7.
|
|
10
|
+
const $ec291e0010116877$export$83d89fbfd8236492 = "4.7.26";
|
|
11
|
+
let $4eb0a704f8f30273$var$elementsHoveredSignal;
|
|
12
|
+
let $4eb0a704f8f30273$var$consumersSignal;
|
|
13
|
+
function $4eb0a704f8f30273$export$d4d96868197be50e() {
|
|
14
|
+
if (!$4eb0a704f8f30273$var$elementsHoveredSignal || !$4eb0a704f8f30273$var$consumersSignal) $i7OB2$createRoot(dispose => {
|
|
15
|
+
$4eb0a704f8f30273$var$elementsHoveredSignal = $i7OB2$createSignal(new Set());
|
|
16
|
+
$4eb0a704f8f30273$var$consumersSignal = $i7OB2$createSignal(0);
|
|
17
|
+
const [consumers] = $4eb0a704f8f30273$var$consumersSignal;
|
|
18
|
+
// No matter how often useMobileHover is called, only add one listener and get hovered elements once per touchmove event, for efficiency
|
|
19
|
+
$4eb0a704f8f30273$var$doHeavyCalculations();
|
|
20
|
+
$i7OB2$createEffect(() => {
|
|
21
|
+
// No-one needs information anymore, stop listening
|
|
22
|
+
const users = consumers();
|
|
23
|
+
if (users < 1) {
|
|
24
|
+
$i7OB2$dlog("Stopping to listen for mobile hover");
|
|
25
|
+
dispose();
|
|
26
|
+
$4eb0a704f8f30273$var$elementsHoveredSignal = undefined;
|
|
27
|
+
$4eb0a704f8f30273$var$consumersSignal = undefined;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
const [elementsHovered] = $4eb0a704f8f30273$var$elementsHoveredSignal;
|
|
32
|
+
const [, setConsumers] = $4eb0a704f8f30273$var$consumersSignal;
|
|
33
|
+
setConsumers(prev => prev + 1);
|
|
34
|
+
$i7OB2$onCleanup(() => setConsumers(prev => prev - 1));
|
|
35
|
+
return elementsHovered;
|
|
36
|
+
}
|
|
37
|
+
function $4eb0a704f8f30273$var$doHeavyCalculations() {
|
|
38
|
+
$i7OB2$dlog("Starting to listen for mobile hover");
|
|
39
|
+
const [, setElementsHovered] = $4eb0a704f8f30273$var$elementsHoveredSignal;
|
|
40
|
+
const elementAtTouch = new Map();
|
|
41
|
+
const updateSet = () => setElementsHovered(new Set([...elementAtTouch.values()].filter(v => v)));
|
|
42
|
+
const setPositionHandler = $i7OB2$catchify(evt => {
|
|
43
|
+
for (const touch of evt.changedTouches) elementAtTouch.set(touch.identifier, document.elementFromPoint(touch.clientX, touch.clientY));
|
|
44
|
+
updateSet();
|
|
45
|
+
});
|
|
46
|
+
const deleteTouchHandler = $i7OB2$catchify(evt => {
|
|
47
|
+
for (const touch of evt.changedTouches) elementAtTouch.delete(touch.identifier);
|
|
48
|
+
updateSet();
|
|
49
|
+
});
|
|
50
|
+
addEventListener("touchstart", setPositionHandler, {
|
|
51
|
+
passive: true
|
|
52
|
+
});
|
|
53
|
+
addEventListener("touchend", deleteTouchHandler, {
|
|
54
|
+
passive: true
|
|
55
|
+
});
|
|
56
|
+
addEventListener("touchcancel", deleteTouchHandler, {
|
|
57
|
+
passive: true
|
|
58
|
+
});
|
|
59
|
+
$i7OB2$onCleanup(() => {
|
|
60
|
+
removeEventListener("touchstart", setPositionHandler);
|
|
61
|
+
removeEventListener("touchend", deleteTouchHandler);
|
|
62
|
+
removeEventListener("touchcancel", deleteTouchHandler);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
11
65
|
function $5e3d278ef4c80cd7$export$54299a3c81f5425() {
|
|
12
66
|
const d = document;
|
|
13
67
|
const [isVisible, setIsVisible] = $i7OB2$createSignal(d.visibilityState !== "hidden");
|
|
@@ -251,7 +305,7 @@ function $29ec7cddbe1d3484$export$43f0fb951fcb0c54({
|
|
|
251
305
|
} catch (e) {
|
|
252
306
|
if (!$29ec7cddbe1d3484$var$printedCloneError) {
|
|
253
307
|
$29ec7cddbe1d3484$var$printedCloneError = true;
|
|
254
|
-
$i7OB2$
|
|
308
|
+
$i7OB2$dlog1("Can't clone display", display, " (uncloneable objects in it), make sure you don't mutate it in the template since we cache.", e);
|
|
255
309
|
}
|
|
256
310
|
}
|
|
257
311
|
let renderingResult;
|
|
@@ -350,7 +404,7 @@ function $f091294da861020c$export$4a14175d33d81a96({
|
|
|
350
404
|
};
|
|
351
405
|
// The following sets up an intersection observer to determine which results are in the viewport, used for the ScrollStatus indicator, knowing when to load more and any other consumer of the useProductCardIsVisible hook.
|
|
352
406
|
const shouldObserve = $i7OB2$createMemo(() => alwaysObserveCards_ || listenersForIntersecting() > 0);
|
|
353
|
-
const intersection_observer = new IntersectionObserver($i7OB2$
|
|
407
|
+
const intersection_observer = new IntersectionObserver($i7OB2$catchify1(records => {
|
|
354
408
|
const intersectingValue = currentlyIntersecting();
|
|
355
409
|
for (let i = 0; i < records.length; i++) {
|
|
356
410
|
const record = records[i];
|
|
@@ -695,7 +749,7 @@ function $c8d5ff4524619fcd$export$445d8d3f5f706a40(props, container_element, ins
|
|
|
695
749
|
}
|
|
696
750
|
update_children_count();
|
|
697
751
|
if (!(0, $i7OB2$isServer)) {
|
|
698
|
-
const mutation_observer = new MutationObserver($i7OB2$
|
|
752
|
+
const mutation_observer = new MutationObserver($i7OB2$catchify1(update_children_count));
|
|
699
753
|
mutation_observer.observe(container_element, {
|
|
700
754
|
childList: true
|
|
701
755
|
});
|
|
@@ -973,7 +1027,7 @@ function $4ea56971d92eb0cd$export$2972b890694ced75(callback, {
|
|
|
973
1027
|
}
|
|
974
1028
|
function $e8ffe11ed01df0fe$export$e6fffe67d4cdd848(whatToWatch) {
|
|
975
1029
|
const [size, setSize] = $i7OB2$createSignal(0);
|
|
976
|
-
const resizeObserver = new ResizeObserver($i7OB2$
|
|
1030
|
+
const resizeObserver = new ResizeObserver($i7OB2$catchify1(records => {
|
|
977
1031
|
for (let j = 0; j < records.length; j++) {
|
|
978
1032
|
const {
|
|
979
1033
|
width: width
|
|
@@ -986,7 +1040,7 @@ function $e8ffe11ed01df0fe$export$e6fffe67d4cdd848(whatToWatch) {
|
|
|
986
1040
|
// It doesn't seem to work even when waiting for it to be in the DOM, also wait an animation frame
|
|
987
1041
|
const disconnect = (0, $i7OB2$observer).onexists(whatToWatch, ({
|
|
988
1042
|
element: element
|
|
989
|
-
}) => requestAnimationFrame($i7OB2$
|
|
1043
|
+
}) => requestAnimationFrame($i7OB2$catchify1(() => resizeObserver.observe(element))));
|
|
990
1044
|
$i7OB2$onCleanup(() => {
|
|
991
1045
|
resizeObserver.disconnect();
|
|
992
1046
|
disconnect();
|
|
@@ -1043,7 +1097,7 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
|
|
|
1043
1097
|
if (existingStack) return existingStack.add(fn);
|
|
1044
1098
|
const newStack = new Set([fn]);
|
|
1045
1099
|
if (listingContext) listingContext[$e8ffe11ed01df0fe$var$onIdleFunctionsSymbol] = newStack;
|
|
1046
|
-
const processStackWhenIdle = () => $4ea56971d92eb0cd$export$2972b890694ced75($i7OB2$
|
|
1100
|
+
const processStackWhenIdle = () => $4ea56971d92eb0cd$export$2972b890694ced75($i7OB2$catchify1(deadline => {
|
|
1047
1101
|
const start = performance.now();
|
|
1048
1102
|
const thirdDeadlineTime = deadline.timeRemaining() / 3; // observers coming after this take up 2-3x the time so don't use all of it
|
|
1049
1103
|
for (const fn of newStack) {
|
|
@@ -1075,7 +1129,7 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
|
|
|
1075
1129
|
let prevValue;
|
|
1076
1130
|
const aspectRatios = listingContext[$e8ffe11ed01df0fe$export$f8945274f08a3105] ||= new Set();
|
|
1077
1131
|
const [, setMostPrevalentAspectRatio] = listingContext[$e8ffe11ed01df0fe$export$6066eb417ed2e9f7] ||= $i7OB2$createSignal();
|
|
1078
|
-
img.addEventListener("load", $i7OB2$
|
|
1132
|
+
img.addEventListener("load", $i7OB2$catchify1(() => {
|
|
1079
1133
|
if (props.keyRatioUpdating) {
|
|
1080
1134
|
if (!srcJustChanged) return;
|
|
1081
1135
|
srcJustChanged = false;
|
|
@@ -1106,7 +1160,7 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
|
|
|
1106
1160
|
$i7OB2$createEffect(() => {
|
|
1107
1161
|
if (!props.size()) return; // wait until we have a size, run every time the size changes
|
|
1108
1162
|
if (timeoutSet) return;
|
|
1109
|
-
const handler = $i7OB2$
|
|
1163
|
+
const handler = $i7OB2$catchify1(() => {
|
|
1110
1164
|
if (gotCleanedUp) return;
|
|
1111
1165
|
img.sizes = sizePX(); // use latest available value of props.size
|
|
1112
1166
|
if (!sizeSetFastPath) {
|
|
@@ -1240,10 +1294,10 @@ function $8c0f86cb3e266eeb$export$a71e92cfbb498adc(props) {
|
|
|
1240
1294
|
return $i7OB2$standard_price_format(props.price_, price_formatting.places_after_comma_, price_formatting.decimal_places_delimiter_, price_formatting.thousands_delimiter_);
|
|
1241
1295
|
});
|
|
1242
1296
|
}
|
|
1243
|
-
var $
|
|
1244
|
-
$
|
|
1245
|
-
$
|
|
1246
|
-
function $
|
|
1297
|
+
var $08a49ecdcd5beaca$var$_tmpl$ = ["<div", ' class="img-wrapper">', "</div>"],
|
|
1298
|
+
$08a49ecdcd5beaca$var$_tmpl$2 = ["<span", ' class="d-price original">', "</span>"],
|
|
1299
|
+
$08a49ecdcd5beaca$var$_tmpl$3 = ["<div", ' class="right-part"><div class="text-container">', '<span class="', '">', "</span><!--$-->", "<!--/--></div><!--$-->", "<!--/--></div>"];
|
|
1300
|
+
function $08a49ecdcd5beaca$export$b73ed90f0ee50dc3({
|
|
1247
1301
|
display_: display_,
|
|
1248
1302
|
FavoriteButton_: FavoriteButton_,
|
|
1249
1303
|
userWantsExpandedSignal_: [userWantsExpanded, setUserWantsExpanded],
|
|
@@ -1280,7 +1334,7 @@ function $5a6c386e1bde5665$export$b73ed90f0ee50dc3({
|
|
|
1280
1334
|
});
|
|
1281
1335
|
},
|
|
1282
1336
|
get children() {
|
|
1283
|
-
return $i7OB2$ssr($
|
|
1337
|
+
return $i7OB2$ssr($08a49ecdcd5beaca$var$_tmpl$, $i7OB2$ssrHydrationKey(), $i7OB2$escape($i7OB2$createComponent((0, $i7OB2$Show), {
|
|
1284
1338
|
get when() {
|
|
1285
1339
|
return imageUrl();
|
|
1286
1340
|
},
|
|
@@ -1312,7 +1366,7 @@ function $5a6c386e1bde5665$export$b73ed90f0ee50dc3({
|
|
|
1312
1366
|
return (animationEffectExists() ? isExpandedThrottledByOurEffectRun() : userWantsExpanded()) || animationIsRunning();
|
|
1313
1367
|
},
|
|
1314
1368
|
get children() {
|
|
1315
|
-
return $i7OB2$ssr($
|
|
1369
|
+
return $i7OB2$ssr($08a49ecdcd5beaca$var$_tmpl$3, $i7OB2$ssrHydrationKey(), $i7OB2$ssrElement("span", $i7OB2$mergeProps({
|
|
1316
1370
|
"class": "d-title line-clamp"
|
|
1317
1371
|
}, () => title() && {
|
|
1318
1372
|
title: title()
|
|
@@ -1351,7 +1405,7 @@ function $5a6c386e1bde5665$export$b73ed90f0ee50dc3({
|
|
|
1351
1405
|
return isOnSale();
|
|
1352
1406
|
},
|
|
1353
1407
|
get children() {
|
|
1354
|
-
return $i7OB2$ssr($
|
|
1408
|
+
return $i7OB2$ssr($08a49ecdcd5beaca$var$_tmpl$2, $i7OB2$ssrHydrationKey(), $i7OB2$escape($i7OB2$createComponent((0, $i7OB2$Show), {
|
|
1355
1409
|
get when() {
|
|
1356
1410
|
return variantToUse() && !originalPrice.loading;
|
|
1357
1411
|
},
|
|
@@ -1405,7 +1459,7 @@ async function $1f9a34ca8a87d49f$var$checkIfIsAffectedByChromeBug326498383() {
|
|
|
1405
1459
|
const waitAFrame = () => new Promise(r => requestAnimationFrame(() => requestAnimationFrame(r)));
|
|
1406
1460
|
const timeoutPromise = new Promise(r => {
|
|
1407
1461
|
resolveTimeoutPromise = r;
|
|
1408
|
-
setTimeout($i7OB2$
|
|
1462
|
+
setTimeout($i7OB2$catchify1(() => {
|
|
1409
1463
|
r();
|
|
1410
1464
|
div.remove();
|
|
1411
1465
|
}), 500);
|
|
@@ -1437,12 +1491,12 @@ async function $1f9a34ca8a87d49f$var$checkIfIsAffectedByChromeBug326498383() {
|
|
|
1437
1491
|
});
|
|
1438
1492
|
await timeoutPromise;
|
|
1439
1493
|
} catch (e) {
|
|
1440
|
-
$i7OB2$
|
|
1494
|
+
$i7OB2$dlog1("Failed to check if affected by chrome bug 326498383", e);
|
|
1441
1495
|
}
|
|
1442
1496
|
return isAffected;
|
|
1443
1497
|
}
|
|
1444
|
-
var $
|
|
1445
|
-
function $
|
|
1498
|
+
var $11fb4b33b36ecfac$var$_tmpl$ = ["<div", ' class="scroll-padding"><div class="', '" style="', '">', "</div></div>"];
|
|
1499
|
+
function $11fb4b33b36ecfac$export$ebf0b1d4f90c09ae({
|
|
1446
1500
|
displays_: displays_,
|
|
1447
1501
|
FavoriteButton_: FavoriteButton_,
|
|
1448
1502
|
userWantsExpandedSignal_: userWantsExpandedSignal_,
|
|
@@ -1461,6 +1515,7 @@ function $7555dcad3b8a4632$export$ebf0b1d4f90c09ae({
|
|
|
1461
1515
|
const textFadeInAnimationRunning = $i7OB2$createSignal(false);
|
|
1462
1516
|
const [getSecondPartAnimationRunning] = textFadeInAnimationRunning;
|
|
1463
1517
|
const [userWantsExpanded, setUserWantsExpanded] = userWantsExpandedSignal_;
|
|
1518
|
+
//const elementsHovered = useMobileHover();
|
|
1464
1519
|
$1f9a34ca8a87d49f$export$7b9a0e99f0aeb2f3().then(is => isAffectedByChromeBug = is);
|
|
1465
1520
|
return $i7OB2$createComponent((0, $011607bdf658f807$export$e68cff63f76bd15b), {
|
|
1466
1521
|
get children() {
|
|
@@ -1469,7 +1524,7 @@ function $7555dcad3b8a4632$export$ebf0b1d4f90c09ae({
|
|
|
1469
1524
|
return containerWidth_() || !displays_();
|
|
1470
1525
|
},
|
|
1471
1526
|
get children() {
|
|
1472
|
-
return $i7OB2$ssr($
|
|
1527
|
+
return $i7OB2$ssr($11fb4b33b36ecfac$var$_tmpl$, $i7OB2$ssrHydrationKey(), `look-overlay ${userWantsExpanded() ? "expanded" : ""} ${!getSecondPartAnimationRunning() && userWantsExpanded() ? "resting-fully-expanded" : ""}`, $i7OB2$ssrStyle(displays_() &&
|
|
1473
1528
|
// The styling is written like this to eke out animation smoothness on low CPU devices, git blame for previous, more readable versions.
|
|
1474
1529
|
`--look-card-width:${containerWidth_()}px;--look-card-height:${containerHeight_()}px;--look-item-height:${lookItemHeight() || 200}px`), $i7OB2$escape($i7OB2$createComponent((0, $i7OB2$Index), {
|
|
1475
1530
|
get each() {
|
|
@@ -1478,7 +1533,7 @@ function $7555dcad3b8a4632$export$ebf0b1d4f90c09ae({
|
|
|
1478
1533
|
});
|
|
1479
1534
|
},
|
|
1480
1535
|
children: (display, index) => {
|
|
1481
|
-
return $i7OB2$createComponent((0, $
|
|
1536
|
+
return $i7OB2$createComponent((0, $08a49ecdcd5beaca$export$b73ed90f0ee50dc3), {
|
|
1482
1537
|
pseudoRouter_: pseudoRouter_,
|
|
1483
1538
|
animationDuration_: animationDuration_,
|
|
1484
1539
|
display_: display,
|
|
@@ -1488,7 +1543,7 @@ function $7555dcad3b8a4632$export$ebf0b1d4f90c09ae({
|
|
|
1488
1543
|
priceFormatting_: priceFormatting_,
|
|
1489
1544
|
outerRef_: el => $i7OB2$createEffect(() => {
|
|
1490
1545
|
if (index !== 0) return;
|
|
1491
|
-
const resizeObserver = new ResizeObserver($i7OB2$
|
|
1546
|
+
const resizeObserver = new ResizeObserver($i7OB2$catchify1(records => setLookItemHeight(records.at(-1).contentRect.height)));
|
|
1492
1547
|
resizeObserver.observe(el);
|
|
1493
1548
|
$i7OB2$onCleanup(() => resizeObserver.disconnect());
|
|
1494
1549
|
})
|
|
@@ -1503,11 +1558,11 @@ function $7555dcad3b8a4632$export$ebf0b1d4f90c09ae({
|
|
|
1503
1558
|
/**
|
|
1504
1559
|
* Workaround for Chrome bug 326498383, adapted version of https://stackoverflow.com/a/39494245
|
|
1505
1560
|
*/
|
|
1506
|
-
function $
|
|
1561
|
+
function $11fb4b33b36ecfac$var$scrollingFunctionForChrome(element, targetScrollY, duration) {
|
|
1507
1562
|
let start;
|
|
1508
1563
|
const startingY = element.scrollTop;
|
|
1509
1564
|
const diff = targetScrollY - startingY;
|
|
1510
|
-
const step = $i7OB2$
|
|
1565
|
+
const step = $i7OB2$catchify1(timestamp => {
|
|
1511
1566
|
if (!start) start = timestamp;
|
|
1512
1567
|
// Elapsed milliseconds since start of scrolling.
|
|
1513
1568
|
const time = timestamp - start;
|
|
@@ -1520,8 +1575,8 @@ function $7555dcad3b8a4632$var$scrollingFunctionForChrome(element, targetScrollY
|
|
|
1520
1575
|
// Bootstrap our animation - it will get called right before next frame shall be rendered.
|
|
1521
1576
|
requestAnimationFrame(step);
|
|
1522
1577
|
}
|
|
1523
|
-
var $
|
|
1524
|
-
function $
|
|
1578
|
+
var $e9d1d09be9e6471e$var$_tmpl$ = ["<div", ' class="', '"><!--$-->', "<!--/--><!--$-->", "<!--/--></div>"];
|
|
1579
|
+
function $e9d1d09be9e6471e$export$44809a8a3e867e30({
|
|
1525
1580
|
display_: display_,
|
|
1526
1581
|
expandedLooksSignal_: [expandedLooks_, setExpandedLooks],
|
|
1527
1582
|
FavoriteButton_: FavoriteButton_,
|
|
@@ -1538,7 +1593,7 @@ function $28ee4f7db3cc44b8$export$44809a8a3e867e30({
|
|
|
1538
1593
|
const index = $b6440e72ed83671a$export$e3faf4d95300054f();
|
|
1539
1594
|
const [containerWidth_, setContainerWidth] = $i7OB2$createSignal();
|
|
1540
1595
|
const [containerHeight_, setContainerHeight] = $i7OB2$createSignal();
|
|
1541
|
-
const clickHandler = $i7OB2$
|
|
1596
|
+
const clickHandler = $i7OB2$catchify1(({
|
|
1542
1597
|
target: target
|
|
1543
1598
|
}) => {
|
|
1544
1599
|
if (target !== container && !container.contains(target))
|
|
@@ -1577,7 +1632,7 @@ function $28ee4f7db3cc44b8$export$44809a8a3e867e30({
|
|
|
1577
1632
|
}
|
|
1578
1633
|
// Close us if another look expands
|
|
1579
1634
|
$i7OB2$createEffect(() => !expandedLooks_().has(us) && setUserWantsExpanded(false));
|
|
1580
|
-
return $i7OB2$ssr($
|
|
1635
|
+
return $i7OB2$ssr($e9d1d09be9e6471e$var$_tmpl$, $i7OB2$ssrHydrationKey(), `look-card ${!display_() ? "placeholder" : ""}`, $i7OB2$escape($i7OB2$createComponent((0, $i7OB2$Show), {
|
|
1581
1636
|
get when() {
|
|
1582
1637
|
return display_();
|
|
1583
1638
|
},
|
|
@@ -1595,7 +1650,7 @@ function $28ee4f7db3cc44b8$export$44809a8a3e867e30({
|
|
|
1595
1650
|
autoAdjustAspectRatio: true
|
|
1596
1651
|
});
|
|
1597
1652
|
}
|
|
1598
|
-
})), $i7OB2$escape($i7OB2$createComponent((0, $
|
|
1653
|
+
})), $i7OB2$escape($i7OB2$createComponent((0, $11fb4b33b36ecfac$export$ebf0b1d4f90c09ae), {
|
|
1599
1654
|
displays_: () => display_()?.displays,
|
|
1600
1655
|
userWantsExpandedSignal_: useWantsExpandedSignal_,
|
|
1601
1656
|
containerWidth_: containerWidth_,
|
|
@@ -1674,7 +1729,7 @@ class $4fd2ba03703a7d92$export$7e1297a3a19f10d8 {
|
|
|
1674
1729
|
* @param is_replace_ if you want to replace the current URL in history instead of pushing a new one
|
|
1675
1730
|
* @param listing_id_ If you are navigating to a category and know the listing_id of, please provide it. This is for making a better devEx in js-ui
|
|
1676
1731
|
*/
|
|
1677
|
-
go_to_: $i7OB2$
|
|
1732
|
+
go_to_: $i7OB2$catchify1(async ({
|
|
1678
1733
|
new_url_: raw_new_url,
|
|
1679
1734
|
event_: event_,
|
|
1680
1735
|
force_spa_navigation_: force_spa_navigation_,
|
|
@@ -1853,7 +1908,7 @@ function $07ef910e8ef6b783$export$2c9f9bf2092486aa(props) {
|
|
|
1853
1908
|
return $07ef910e8ef6b783$var$runDisplayTransformersForLooks(baseData, listings, props.displayTransformers_);
|
|
1854
1909
|
});
|
|
1855
1910
|
const sharedOptions = {
|
|
1856
|
-
product_card_template_: display => $
|
|
1911
|
+
product_card_template_: display => $e9d1d09be9e6471e$export$44809a8a3e867e30({
|
|
1857
1912
|
display_: () => display,
|
|
1858
1913
|
FavoriteButton_: props.FavoriteButton_,
|
|
1859
1914
|
placeholderImageAspectRatio_: props.imagePlaceholderAspectRatio_,
|
|
@@ -2162,7 +2217,7 @@ function $eea41f703612261b$export$62f101a8aa597bf8({
|
|
|
2162
2217
|
// don't wait if it's the first request
|
|
2163
2218
|
write_current_instant_query(value);
|
|
2164
2219
|
clearTimeout(timeout);
|
|
2165
|
-
timeout = setTimeout($i7OB2$
|
|
2220
|
+
timeout = setTimeout($i7OB2$catchify1(() => write_current_instant_query(value)), 250);
|
|
2166
2221
|
});
|
|
2167
2222
|
const [search_results] = $i7OB2$createResource($i7OB2$createMemo(() => ({
|
|
2168
2223
|
// <-- key order important, see comment below
|
|
@@ -2170,7 +2225,7 @@ function $eea41f703612261b$export$62f101a8aa597bf8({
|
|
|
2170
2225
|
market: market_(),
|
|
2171
2226
|
locale: i18n_.backend_locale_(),
|
|
2172
2227
|
query: read_current_instant_query()
|
|
2173
|
-
})), $i7OB2$
|
|
2228
|
+
})), $i7OB2$catchify1(async variable_data => {
|
|
2174
2229
|
return depict_api_.query({
|
|
2175
2230
|
// here it is (unfortunately) important that the keys in the object are in the same order as in SearchPage.tsx, because when JSON-encoding them to compare for caching the strings will be different otherwise
|
|
2176
2231
|
limit: $i7OB2$untrack(has_sort_or_filters_) ? max_cards : min_products_to_fetch_,
|
|
@@ -2261,7 +2316,7 @@ function $d78eea1e8707dc2d$export$c7e181728ad525f(url) {
|
|
|
2261
2316
|
return;
|
|
2262
2317
|
$d78eea1e8707dc2d$var$last_sent_value = new_value;
|
|
2263
2318
|
const args = ["depict.send", "pageview", new_value];
|
|
2264
|
-
$i7OB2$
|
|
2319
|
+
$i7OB2$dlog1("Calling ga with args", ...args);
|
|
2265
2320
|
// @ts-ignore
|
|
2266
2321
|
ga(...args);
|
|
2267
2322
|
}
|
|
@@ -2275,7 +2330,7 @@ function $c64d28ca12452b21$export$3340fdd8259bd4fd({
|
|
|
2275
2330
|
if (process.env.GA === "false") return;
|
|
2276
2331
|
let debounce_timeout;
|
|
2277
2332
|
const stop_timeout = () => clearTimeout(debounce_timeout);
|
|
2278
|
-
const send_to_ga = $i7OB2$
|
|
2333
|
+
const send_to_ga = $i7OB2$catchify1(() => {
|
|
2279
2334
|
const fake_url = new URL(location.href);
|
|
2280
2335
|
const {
|
|
2281
2336
|
searchParams: searchParams
|
|
@@ -2288,12 +2343,12 @@ function $c64d28ca12452b21$export$3340fdd8259bd4fd({
|
|
|
2288
2343
|
$i7OB2$onCleanup(() => {
|
|
2289
2344
|
setTimeout(
|
|
2290
2345
|
// do it next event loop because search_field_value_ is wrong this one and search_query might be too because we want the old value to be put into the history entry and a framework like NextJS might take some time to navigate
|
|
2291
|
-
$i7OB2$
|
|
2346
|
+
$i7OB2$catchify1(() => {
|
|
2292
2347
|
if ($i7OB2$untrack(get_search_query_) === $i7OB2$untrack(get_search_field_value_)) stop_timeout();
|
|
2293
2348
|
}));
|
|
2294
2349
|
});
|
|
2295
2350
|
let first_call = true;
|
|
2296
|
-
$i7OB2$createEffect($i7OB2$
|
|
2351
|
+
$i7OB2$createEffect($i7OB2$catchify1(() => {
|
|
2297
2352
|
get_search_field_value_();
|
|
2298
2353
|
if (first_call) {
|
|
2299
2354
|
// we only want to do stuff when it changes
|
|
@@ -2312,7 +2367,7 @@ function $a36cbc4f68bfd590$export$91c3b6774e8be0f5({
|
|
|
2312
2367
|
const [get_current_href, set_current_href] = $i7OB2$createSignal(location.href);
|
|
2313
2368
|
const [exit_iterable, exitable_iterable] = $i7OB2$make_asyncIterable_exiter((0, $i7OB2$href_change_ipns));
|
|
2314
2369
|
$i7OB2$onCleanup(exit_iterable);
|
|
2315
|
-
$i7OB2$
|
|
2370
|
+
$i7OB2$catchify1(async () => {
|
|
2316
2371
|
for await (const href of exitable_iterable)
|
|
2317
2372
|
// use native links so ppl can cmdclick/right click and open in new tab and see target URL
|
|
2318
2373
|
set_current_href(href);
|
|
@@ -2705,7 +2760,7 @@ function $6ef2e4ea23810f23$var$actual_navigation_working_on_fake_data({
|
|
|
2705
2760
|
if (!$i7OB2$untrack(() => read_updating_blocked())) previous_value = sfv;
|
|
2706
2761
|
});
|
|
2707
2762
|
const owner = $i7OB2$getOwner();
|
|
2708
|
-
const handler = $i7OB2$
|
|
2763
|
+
const handler = $i7OB2$catchify1(({
|
|
2709
2764
|
keyCode: keyCode
|
|
2710
2765
|
}) => $i7OB2$untrack(() => {
|
|
2711
2766
|
const up = keyCode === 38;
|
|
@@ -2769,7 +2824,7 @@ function $6ef2e4ea23810f23$var$actual_navigation_working_on_fake_data({
|
|
|
2769
2824
|
const el = element_();
|
|
2770
2825
|
if (!el) return;
|
|
2771
2826
|
el.addEventListener("keyup", handler);
|
|
2772
|
-
$i7OB2$onCleanup($i7OB2$
|
|
2827
|
+
$i7OB2$onCleanup($i7OB2$catchify1(() => el.removeEventListener("keyup", handler)));
|
|
2773
2828
|
});
|
|
2774
2829
|
}
|
|
2775
2830
|
function $1ae0eaca6ada9753$export$af0124069c150252({
|
|
@@ -2966,7 +3021,7 @@ let $f86ba724282f6690$export$44dad306455dddf;
|
|
|
2966
3021
|
|
|
2967
3022
|
function $2449872a62a75a20$export$ebdc3711f7e02ccd(what_to_watch) {
|
|
2968
3023
|
const [width, setWidth] = $i7OB2$createSignal();
|
|
2969
|
-
const resizeObserver = new ResizeObserver($i7OB2$
|
|
3024
|
+
const resizeObserver = new ResizeObserver($i7OB2$catchify1(records => {
|
|
2970
3025
|
for (let j = 0; j < records.length; j++) {
|
|
2971
3026
|
const width = records[j].borderBoxSize?.[0]?.inlineSize ?? what_to_watch.getBoundingClientRect().width;
|
|
2972
3027
|
setWidth(width);
|
|
@@ -2976,7 +3031,7 @@ function $2449872a62a75a20$export$ebdc3711f7e02ccd(what_to_watch) {
|
|
|
2976
3031
|
// It doesn't seem to work even when waiting for it to be in the DOM, also wait an animation frame
|
|
2977
3032
|
const disconnect = (0, $i7OB2$observer).onexists(what_to_watch, ({
|
|
2978
3033
|
element: element
|
|
2979
|
-
}) => requestAnimationFrame($i7OB2$
|
|
3034
|
+
}) => requestAnimationFrame($i7OB2$catchify1(() => {
|
|
2980
3035
|
const current_size = what_to_watch.getBoundingClientRect().width;
|
|
2981
3036
|
if (current_size)
|
|
2982
3037
|
// If element has size, set signal to that. ResizeObserver only triggers when the content is visible in some cases, but it might already have a size. This reduces size filter expanding animation jank in chrome.
|
|
@@ -3020,7 +3075,7 @@ function $5285d2814d0fac0c$export$b94867ecbd698f21({
|
|
|
3020
3075
|
let input_element;
|
|
3021
3076
|
// This is the div where we recommend (and ourselves do) attach the event listener to that opens the search modal.
|
|
3022
3077
|
let field_div;
|
|
3023
|
-
$i7OB2$createEffect($i7OB2$
|
|
3078
|
+
$i7OB2$createEffect($i7OB2$catchify1(async () => {
|
|
3024
3079
|
if (disabled_) return;
|
|
3025
3080
|
// we aren't in DOM yet unfortunately, wouldn't even be with onMount
|
|
3026
3081
|
await (0, $i7OB2$observer).wait_for_element(input_element);
|
|
@@ -3097,18 +3152,18 @@ function $aea1edf92433e81e$export$fe334901e8bebd57() {
|
|
|
3097
3152
|
offset: 0
|
|
3098
3153
|
}, 1);
|
|
3099
3154
|
animation.pause();
|
|
3100
|
-
const fn = $i7OB2$
|
|
3155
|
+
const fn = $i7OB2$catchify1(animation.play.bind(animation));
|
|
3101
3156
|
cleanup_fns.push(fn);
|
|
3102
3157
|
$i7OB2$onCleanup(fn);
|
|
3103
3158
|
} catch (e) {
|
|
3104
|
-
$i7OB2$
|
|
3159
|
+
$i7OB2$dlog1("Probably partial keyframe error", e);
|
|
3105
3160
|
}
|
|
3106
3161
|
if (getComputedStyle(element).overflow !== "hidden") {
|
|
3107
3162
|
// safari gets special hacky treatment
|
|
3108
3163
|
const style = element.style;
|
|
3109
3164
|
const original_value = style.overflow;
|
|
3110
3165
|
style.overflow = "hidden";
|
|
3111
|
-
const fn = $i7OB2$
|
|
3166
|
+
const fn = $i7OB2$catchify1(() => style.overflow = original_value);
|
|
3112
3167
|
cleanup_fns.push(fn);
|
|
3113
3168
|
$i7OB2$onCleanup(fn);
|
|
3114
3169
|
}
|
|
@@ -3131,8 +3186,8 @@ function $512b994d501f412b$export$93d9bfd0c9c1a5b8(close_modal, search_query_url
|
|
|
3131
3186
|
let set_initial_values = false;
|
|
3132
3187
|
let old_pathname;
|
|
3133
3188
|
let old_param_value;
|
|
3134
|
-
$i7OB2$onCleanup($i7OB2$
|
|
3135
|
-
$i7OB2$
|
|
3189
|
+
$i7OB2$onCleanup($i7OB2$catchify1(exit_iterable));
|
|
3190
|
+
$i7OB2$catchify1(async () => {
|
|
3136
3191
|
for await (const href of exitable_iterable) {
|
|
3137
3192
|
const u_o = new URL(href);
|
|
3138
3193
|
const new_pathname = u_o.pathname;
|
|
@@ -3203,7 +3258,7 @@ function $42912431795f188e$var$RawClassicSearchModal({
|
|
|
3203
3258
|
} = alignmentSignals_ || {};
|
|
3204
3259
|
const [bodyAlignmentStyle] = bodyAlignmentSignal;
|
|
3205
3260
|
const [get_modal_search_results, set_modal_search_results_] = $i7OB2$createSignal();
|
|
3206
|
-
const close_on_escape_handler = $i7OB2$
|
|
3261
|
+
const close_on_escape_handler = $i7OB2$catchify1(({
|
|
3207
3262
|
key: key
|
|
3208
3263
|
}) => {
|
|
3209
3264
|
if (key === "Escape") close_modal_();
|
|
@@ -3228,7 +3283,7 @@ function $42912431795f188e$var$RawClassicSearchModal({
|
|
|
3228
3283
|
if (disable_scrolling_) $aea1edf92433e81e$export$fe334901e8bebd57();
|
|
3229
3284
|
$512b994d501f412b$export$93d9bfd0c9c1a5b8(close_modal_, search_query_url_param_name_);
|
|
3230
3285
|
window.addEventListener("keydown", close_on_escape_handler);
|
|
3231
|
-
$i7OB2$onCleanup($i7OB2$
|
|
3286
|
+
$i7OB2$onCleanup($i7OB2$catchify1(() => window.removeEventListener("keydown", close_on_escape_handler)));
|
|
3232
3287
|
if (closing_animation_) register_closing_animation_(closing_animation_);
|
|
3233
3288
|
$c64d28ca12452b21$export$3340fdd8259bd4fd({
|
|
3234
3289
|
get_search_field_value_: get_search_field_value_,
|
|
@@ -3433,7 +3488,7 @@ function $4147651646da990a$var$decode_filter_data(op, encoded_data) {
|
|
|
3433
3488
|
try {
|
|
3434
3489
|
return JSON.parse($i7OB2$base64_decode_unicode(encoded_data));
|
|
3435
3490
|
} catch (e) {
|
|
3436
|
-
$i7OB2$
|
|
3491
|
+
$i7OB2$dlog1("Failed to fallback parse filter data", op, encoded_data, e);
|
|
3437
3492
|
}
|
|
3438
3493
|
return null;
|
|
3439
3494
|
}
|
|
@@ -3491,7 +3546,7 @@ function $4147651646da990a$export$766e9676e74997d3(search_params, sorting_query_
|
|
|
3491
3546
|
field: encoded_sorting.slice(0, -$4147651646da990a$var$descending_token.length),
|
|
3492
3547
|
order: "desc"
|
|
3493
3548
|
};
|
|
3494
|
-
$i7OB2$
|
|
3549
|
+
$i7OB2$dlog1("Invalid sorting query param value", encoded_sorting);
|
|
3495
3550
|
return;
|
|
3496
3551
|
}
|
|
3497
3552
|
function $4147651646da990a$export$916e6850778505f6(search_params, filter_query_param_prefix, sorting_query_param) {
|
|
@@ -4048,7 +4103,7 @@ function $500a16dd18ee5a71$var$RawSearchModalV2({
|
|
|
4048
4103
|
const random_classname_body = $i7OB2$make_random_classname();
|
|
4049
4104
|
const backdropRandomClassname = $i7OB2$make_random_classname();
|
|
4050
4105
|
const [get_modal_search_results_, set_modal_search_results_] = $i7OB2$createSignal();
|
|
4051
|
-
const close_on_escape_handler = $i7OB2$
|
|
4106
|
+
const close_on_escape_handler = $i7OB2$catchify1(evt => {
|
|
4052
4107
|
if (evt.key === "Escape") {
|
|
4053
4108
|
evt.preventDefault(); // Prevent the browser from closing/cancelling the modal so our animations have time to run
|
|
4054
4109
|
close_modal_();
|
|
@@ -4144,7 +4199,7 @@ function $500a16dd18ee5a71$var$RawSearchModalV2({
|
|
|
4144
4199
|
$i7OB2$createEffect($i7OB2$on(get_search_field_value_, () => {
|
|
4145
4200
|
setShowStaleListingSuggestions(true);
|
|
4146
4201
|
clearTimeout(listingSuggestionsDebounceTimeout);
|
|
4147
|
-
listingSuggestionsDebounceTimeout = setTimeout($i7OB2$
|
|
4202
|
+
listingSuggestionsDebounceTimeout = setTimeout($i7OB2$catchify1(() => setShowStaleListingSuggestions(false)), 350);
|
|
4148
4203
|
}, {
|
|
4149
4204
|
defer: true
|
|
4150
4205
|
}));
|
|
@@ -4279,7 +4334,7 @@ function $500a16dd18ee5a71$var$RawSearchModalV2({
|
|
|
4279
4334
|
}
|
|
4280
4335
|
});
|
|
4281
4336
|
if (setSearchFieldOuterWidth_) {
|
|
4282
|
-
const resizeObserver = new ResizeObserver($i7OB2$
|
|
4337
|
+
const resizeObserver = new ResizeObserver($i7OB2$catchify1(records => setSearchFieldOuterWidth_(records.at(-1).contentRect.width)));
|
|
4283
4338
|
resizeObserver.observe(search_field);
|
|
4284
4339
|
$i7OB2$onCleanup(() => resizeObserver.disconnect());
|
|
4285
4340
|
}
|
|
@@ -4329,7 +4384,7 @@ function $024fbc0a2d796fad$var$ActualTabs(props) {
|
|
|
4329
4384
|
});
|
|
4330
4385
|
const isSelected = $i7OB2$createSelector(currentlySelected);
|
|
4331
4386
|
const owner = $i7OB2$getOwner();
|
|
4332
|
-
const updateTabsSignal = $i7OB2$
|
|
4387
|
+
const updateTabsSignal = $i7OB2$catchify(() => $i7OB2$runWithOwner(owner, () => setTabsReactive([...ourTabsSet])));
|
|
4333
4388
|
const ourTabsSet = $024fbc0a2d796fad$var$useTabs();
|
|
4334
4389
|
const location = $i7OB2$use_href_accessor1();
|
|
4335
4390
|
const linkWithChangedHash = hash => {
|
|
@@ -4432,7 +4487,7 @@ function $024fbc0a2d796fad$export$3e41faf802a29e71(props) {
|
|
|
4432
4487
|
async function $194bd6b8e4c59830$export$79b1565500412d9b(search_modal, modal_fn_opts, parent) {
|
|
4433
4488
|
const body = parent || document.body || (await (0, $i7OB2$observer).wait_for_element("body"));
|
|
4434
4489
|
let dispose_and_remove;
|
|
4435
|
-
const open_modal_ = $i7OB2$
|
|
4490
|
+
const open_modal_ = $i7OB2$catchify1(async (extra_options_for_modal = {}, on_dispose) => {
|
|
4436
4491
|
// Below await is very intentional,
|
|
4437
4492
|
// The reason is that effects don't run in <Suspense> boundaries before they've resolved and this carries even through roots created, but if a modal is opened from a suspense boundary we still want the effects in it to run
|
|
4438
4493
|
// This is because the suspense is for the content in the page and not the modal (the modal goes above it)
|
|
@@ -4462,7 +4517,7 @@ async function $194bd6b8e4c59830$export$79b1565500412d9b(search_modal, modal_fn_
|
|
|
4462
4517
|
// Animation broke, close it this time
|
|
4463
4518
|
actually_close();else if (!animation_started && closing_animation) {
|
|
4464
4519
|
animation_started = +new Date();
|
|
4465
|
-
$i7OB2$
|
|
4520
|
+
$i7OB2$catchify1(closing_animation)()?.then($i7OB2$catchify1(actually_close));
|
|
4466
4521
|
} else actually_close();
|
|
4467
4522
|
};
|
|
4468
4523
|
return search_modal({
|
|
@@ -4475,7 +4530,7 @@ async function $194bd6b8e4c59830$export$79b1565500412d9b(search_modal, modal_fn_
|
|
|
4475
4530
|
});
|
|
4476
4531
|
body.append(...modal_els);
|
|
4477
4532
|
});
|
|
4478
|
-
const close_modal_ = $i7OB2$
|
|
4533
|
+
const close_modal_ = $i7OB2$catchify1(() => {
|
|
4479
4534
|
if (dispose_and_remove) {
|
|
4480
4535
|
// modal is open
|
|
4481
4536
|
const dispose_fn = dispose_and_remove;
|
|
@@ -4492,7 +4547,7 @@ async function $194bd6b8e4c59830$export$79b1565500412d9b(search_modal, modal_fn_
|
|
|
4492
4547
|
function $ca6f574bd8772184$export$e183a13865960371(params_to_default_value, router_) {
|
|
4493
4548
|
const signals = {};
|
|
4494
4549
|
const entries = Object.entries(params_to_default_value);
|
|
4495
|
-
const event_handler = $i7OB2$
|
|
4550
|
+
const event_handler = $i7OB2$catchify1((what_happened, args) => {
|
|
4496
4551
|
// Intentionally always update our signals to the history state to allow external control of SDK state for doing things like https://linear.app/depictai/issue/X-1432/is-this-possible-with-the-depict-sdk
|
|
4497
4552
|
if (what_happened !== "popstate") return;
|
|
4498
4553
|
// Had to undo the comment above,but leaving the history. Doing this because discovering why it doesn't work is a deja-vu and I don't want to have to discover it again.
|
|
@@ -4523,8 +4578,8 @@ function $ca6f574bd8772184$export$e183a13865960371(params_to_default_value, rout
|
|
|
4523
4578
|
});
|
|
4524
4579
|
// history_dot_state_to_state needs to update after its signals after url_state does BUT in the same task (might even have to be in the same tick in the microtask queue). If we'd use window.addEventListener("popstate") it would be guaranteed to be too late since each event listener has its own task
|
|
4525
4580
|
(0, $i7OB2$instant_exec_on_suspect_history_change).add(event_handler);
|
|
4526
|
-
$i7OB2$onCleanup($i7OB2$
|
|
4527
|
-
$i7OB2$createEffect($i7OB2$
|
|
4581
|
+
$i7OB2$onCleanup($i7OB2$catchify1(() => (0, $i7OB2$instant_exec_on_suspect_history_change).delete(event_handler)));
|
|
4582
|
+
$i7OB2$createEffect($i7OB2$catchify1(() => $i7OB2$untrack($i7OB2$catchify1(() => $ca6f574bd8772184$var$history_state_change(signals, entries, history.state))))); // we need this to run after reading the initial state from history.state to write the defaults to history.state
|
|
4528
4583
|
return signals;
|
|
4529
4584
|
}
|
|
4530
4585
|
function $ca6f574bd8772184$var$history_state_change(signals, entries, state) {
|
|
@@ -4658,7 +4713,7 @@ function $45d4ed34a22ab90c$export$6b35356958ae5587(props) {
|
|
|
4658
4713
|
// If someone clicks on a product card in the shop the look modal, close the modal the next time the href changes
|
|
4659
4714
|
for (const item of resolved()) {
|
|
4660
4715
|
if (!(item instanceof Element)) return;
|
|
4661
|
-
item.addEventListener("click", $i7OB2$
|
|
4716
|
+
item.addEventListener("click", $i7OB2$catchify1(() =>
|
|
4662
4717
|
// run with modal owner so we don't do stuff after the modal closes
|
|
4663
4718
|
// can't have the owner of the product card as that gets disposed if the productId changes which might be too early (before location.href has changed)
|
|
4664
4719
|
$i7OB2$runWithOwner(props.modalOwner_, () => $i7OB2$createEffect($i7OB2$on(hrefWithoutHash, props.actually_close_modal_, {
|
|
@@ -4867,7 +4922,7 @@ function $8560c919ff763930$var$actualSetupModal() {
|
|
|
4867
4922
|
(0, $90980bd87c9960f9$export$3064e1e8c6513da3).add(history_key);
|
|
4868
4923
|
const actually_close_modal_ = () => set_history_value(false);
|
|
4869
4924
|
const owner = $i7OB2$getOwner();
|
|
4870
|
-
$i7OB2$
|
|
4925
|
+
$i7OB2$catchify1(async () => {
|
|
4871
4926
|
const {
|
|
4872
4927
|
open_modal_: open_modal_,
|
|
4873
4928
|
close_modal_: close_modal_
|
|
@@ -4940,15 +4995,15 @@ function $6bb0a0c563dff4bb$export$6c6d7a51fa9aa15d(props) {
|
|
|
4940
4995
|
$i7OB2$insert(details_, [summary_, $i7OB2$createComponent(ExpandingContainer, {
|
|
4941
4996
|
children: children
|
|
4942
4997
|
})], null);
|
|
4943
|
-
if (!$i7OB2$untrack(is_in_dom)) (0, $i7OB2$observer).wait_for_element(details_).then($i7OB2$
|
|
4944
|
-
$i7OB2$createEffect($i7OB2$
|
|
4998
|
+
if (!$i7OB2$untrack(is_in_dom)) (0, $i7OB2$observer).wait_for_element(details_).then($i7OB2$catchify1(() => set_is_in_dom(true)));
|
|
4999
|
+
$i7OB2$createEffect($i7OB2$catchify1(async () => {
|
|
4945
5000
|
const is_open = is_open_memo();
|
|
4946
5001
|
if (!is_in_dom())
|
|
4947
5002
|
// wait with setting state until we're in DOM, animation won't work otherwise
|
|
4948
5003
|
return;
|
|
4949
5004
|
if (dont_animate_if_instant_open_ && fresh_component && !timeout_started) {
|
|
4950
5005
|
timeout_started = true;
|
|
4951
|
-
setTimeout($i7OB2$
|
|
5006
|
+
setTimeout($i7OB2$catchify1(() => fresh_component = false));
|
|
4952
5007
|
}
|
|
4953
5008
|
if (is_open) {
|
|
4954
5009
|
details_.open = true; // open up the toggle so the animation can happen
|
|
@@ -4956,10 +5011,10 @@ function $6bb0a0c563dff4bb$export$6c6d7a51fa9aa15d(props) {
|
|
|
4956
5011
|
await expand(0, do_duration);
|
|
4957
5012
|
} else {
|
|
4958
5013
|
const animation = await collapse();
|
|
4959
|
-
animation?.addEventListener("finish", $i7OB2$
|
|
5014
|
+
animation?.addEventListener("finish", $i7OB2$catchify1(() => details_.open = false));
|
|
4960
5015
|
}
|
|
4961
5016
|
}));
|
|
4962
|
-
details_.addEventListener("toggle", $i7OB2$
|
|
5017
|
+
details_.addEventListener("toggle", $i7OB2$catchify1(() => {
|
|
4963
5018
|
const {
|
|
4964
5019
|
open: open
|
|
4965
5020
|
} = details_;
|
|
@@ -4969,11 +5024,11 @@ function $6bb0a0c563dff4bb$export$6c6d7a51fa9aa15d(props) {
|
|
|
4969
5024
|
}) // in case someone somehow toggles it without us intercepting it at least follow suit
|
|
4970
5025
|
);
|
|
4971
5026
|
|
|
4972
|
-
summary_.addEventListener("click", $i7OB2$
|
|
5027
|
+
summary_.addEventListener("click", $i7OB2$catchify1(ev => {
|
|
4973
5028
|
ev.preventDefault();
|
|
4974
5029
|
toggle();
|
|
4975
5030
|
}));
|
|
4976
|
-
summary_.addEventListener("keydown", $i7OB2$
|
|
5031
|
+
summary_.addEventListener("keydown", $i7OB2$catchify1(ev => {
|
|
4977
5032
|
const {
|
|
4978
5033
|
key: key
|
|
4979
5034
|
} = ev;
|
|
@@ -5196,9 +5251,9 @@ function $1adfe60f3a14a1d7$export$fecbb157621501bd({
|
|
|
5196
5251
|
});
|
|
5197
5252
|
const [is_in_dom, set_is_in_dom] = $i7OB2$createSignal(document.documentElement.contains(outmost_element));
|
|
5198
5253
|
const hidden = $i7OB2$createMemo(() => get_search_filters_open_() || get_search_sorting_open_());
|
|
5199
|
-
if (!$i7OB2$untrack(is_in_dom)) (0, $i7OB2$observer).wait_for_element(outmost_element).then($i7OB2$
|
|
5254
|
+
if (!$i7OB2$untrack(is_in_dom)) (0, $i7OB2$observer).wait_for_element(outmost_element).then($i7OB2$catchify1(() => set_is_in_dom(true)));
|
|
5200
5255
|
outmost_element.classList.add("selected-filters");
|
|
5201
|
-
$i7OB2$createEffect($i7OB2$
|
|
5256
|
+
$i7OB2$createEffect($i7OB2$catchify1(async () => {
|
|
5202
5257
|
if (!is_in_dom())
|
|
5203
5258
|
// wait with setting state until we're in DOM, animation won't work otherwise
|
|
5204
5259
|
return;
|
|
@@ -5345,7 +5400,7 @@ function $a4601e6bea3ed1e6$export$dd948f91abc3a1c4({
|
|
|
5345
5400
|
}) : []);
|
|
5346
5401
|
});
|
|
5347
5402
|
$i7OB2$onCleanup(() => set_view_more_button_below_group_());
|
|
5348
|
-
$i7OB2$createEffect($i7OB2$
|
|
5403
|
+
$i7OB2$createEffect($i7OB2$catchify1(async () => {
|
|
5349
5404
|
if (!togglable_rest()) {
|
|
5350
5405
|
await collapse();
|
|
5351
5406
|
return;
|
|
@@ -5457,7 +5512,7 @@ function $a6b08770e164eced$export$e0d834a0ad870cda({
|
|
|
5457
5512
|
});
|
|
5458
5513
|
$i7OB2$createComputed(() => {
|
|
5459
5514
|
clearTimeout(debounce_timeout);
|
|
5460
|
-
debounce_timeout = setTimeout($i7OB2$
|
|
5515
|
+
debounce_timeout = setTimeout($i7OB2$catchify1(range => $i7OB2$untrack(() => {
|
|
5461
5516
|
const default_data = defaultRange();
|
|
5462
5517
|
const filter_object = {
|
|
5463
5518
|
op: filter_().op,
|
|
@@ -5984,7 +6039,7 @@ function $1c8cac76cb67e9af$export$a32086fa6616eafd({
|
|
|
5984
6039
|
}
|
|
5985
6040
|
while (execute_when_structure_finished.length) execute_when_structure_finished.pop()();
|
|
5986
6041
|
$1c8cac76cb67e9af$var$expand_until_choice(data_structure);
|
|
5987
|
-
$i7OB2$
|
|
6042
|
+
$i7OB2$dlog1("CheckboxHierarchicalFilter: Recomputed structured_categories", data_structure);
|
|
5988
6043
|
return data_structure;
|
|
5989
6044
|
});
|
|
5990
6045
|
const some_top_level_are_hidden = $i7OB2$createMemo(() => Object.keys(structured_categories()).length > $1c8cac76cb67e9af$var$max_visible_without_collapsing);
|
|
@@ -6014,7 +6069,7 @@ function $1c8cac76cb67e9af$export$a32086fa6616eafd({
|
|
|
6014
6069
|
}) : []);
|
|
6015
6070
|
});
|
|
6016
6071
|
$i7OB2$onCleanup(() => set_view_more_button_below_group());
|
|
6017
|
-
$i7OB2$createEffect($i7OB2$
|
|
6072
|
+
$i7OB2$createEffect($i7OB2$catchify1(async () => {
|
|
6018
6073
|
if (!some_top_level_are_hidden()) {
|
|
6019
6074
|
await collapse();
|
|
6020
6075
|
return;
|
|
@@ -6074,7 +6129,7 @@ function $1c8cac76cb67e9af$var$render_stuff(data, existing_filter, i18n_, filter
|
|
|
6074
6129
|
return value()?.is_checked_?.[0]?.() ?? false;
|
|
6075
6130
|
},
|
|
6076
6131
|
input_ref_: input => {
|
|
6077
|
-
input.addEventListener("change", $i7OB2$
|
|
6132
|
+
input.addEventListener("change", $i7OB2$catchify1(() => $i7OB2$untrack(() => {
|
|
6078
6133
|
const {
|
|
6079
6134
|
checked: checked
|
|
6080
6135
|
} = input;
|
|
@@ -6149,7 +6204,7 @@ function $1c8cac76cb67e9af$var$batching_filter_state_syncer(props) {
|
|
|
6149
6204
|
existing_filter_: existing_filter_
|
|
6150
6205
|
} = props;
|
|
6151
6206
|
let sync_queued = false;
|
|
6152
|
-
const sync_fn = $i7OB2$
|
|
6207
|
+
const sync_fn = $i7OB2$catchify1(async () => {
|
|
6153
6208
|
sync_queued = false;
|
|
6154
6209
|
// if we change, update filter state - next microtask, so that "reactions" to the change can process before we send it off to the API
|
|
6155
6210
|
const set_filter = existing_filter_();
|
|
@@ -6173,7 +6228,7 @@ function $1c8cac76cb67e9af$var$batching_filter_state_syncer(props) {
|
|
|
6173
6228
|
...base_object,
|
|
6174
6229
|
data: data
|
|
6175
6230
|
};
|
|
6176
|
-
$i7OB2$
|
|
6231
|
+
$i7OB2$dlog1("CheckboxHierarchicalFilter: Updating API state", filter_object);
|
|
6177
6232
|
const selected_filters = [...selected_filters_[0]()];
|
|
6178
6233
|
if (set_filter) selected_filters.splice(selected_filters.indexOf(set_filter), 1);
|
|
6179
6234
|
if (filter_object.data.length) selected_filters.push(filter_object);
|
|
@@ -6206,13 +6261,13 @@ function $1c8cac76cb67e9af$var$create_updating_signal({
|
|
|
6206
6261
|
$i7OB2$createComputed($i7OB2$on(read_checked, trigger_sync_, {
|
|
6207
6262
|
defer: true
|
|
6208
6263
|
}));
|
|
6209
|
-
$i7OB2$createComputed($i7OB2$on(read_checked, $i7OB2$
|
|
6264
|
+
$i7OB2$createComputed($i7OB2$on(read_checked, $i7OB2$catchify1(new_value => {
|
|
6210
6265
|
if (updating_blocked) return;
|
|
6211
6266
|
for (const child of child_objects) child.is_checked_[1](new_value);
|
|
6212
6267
|
}), {
|
|
6213
6268
|
defer: true
|
|
6214
6269
|
}));
|
|
6215
|
-
$i7OB2$createEffect($i7OB2$on(get_child_object_values, $i7OB2$
|
|
6270
|
+
$i7OB2$createEffect($i7OB2$on(get_child_object_values, $i7OB2$catchify1(() => {
|
|
6216
6271
|
const all_kids_checked = get_child_object_values.every(accessor => accessor());
|
|
6217
6272
|
if (all_kids_checked === read_checked()) return;
|
|
6218
6273
|
updating_blocked = true;
|
|
@@ -6637,7 +6692,7 @@ function $e731d52d97444b7c$export$82ed4b28ecb67608({
|
|
|
6637
6692
|
}) : []);
|
|
6638
6693
|
});
|
|
6639
6694
|
$i7OB2$onCleanup(() => set_view_more_button_below_group_());
|
|
6640
|
-
$i7OB2$createEffect($i7OB2$
|
|
6695
|
+
$i7OB2$createEffect($i7OB2$catchify1(async () => {
|
|
6641
6696
|
if (!togglable_rest()) {
|
|
6642
6697
|
await collapse();
|
|
6643
6698
|
set_having_expanding_in_dom(false); // Once animation has finished, remove expanding from DOM
|
|
@@ -7270,13 +7325,13 @@ async function $a0f0e923bad68a9b$export$58e808b1db15d3bc(options) {
|
|
|
7270
7325
|
headers: headers
|
|
7271
7326
|
} : {}),
|
|
7272
7327
|
method: "POST"
|
|
7273
|
-
}).catch(e => $i7OB2$
|
|
7328
|
+
}).catch(e => $i7OB2$dlog1("fetch_retry threw", e)).then(async maybe_response => {
|
|
7274
7329
|
if (!maybe_response) return [];
|
|
7275
7330
|
let decoded;
|
|
7276
7331
|
try {
|
|
7277
7332
|
decoded = await maybe_response.json();
|
|
7278
7333
|
} catch (e) {
|
|
7279
|
-
$i7OB2$
|
|
7334
|
+
$i7OB2$dlog1("Failed to decode JSON", e);
|
|
7280
7335
|
}
|
|
7281
7336
|
return decoded?.displays || [];
|
|
7282
7337
|
});
|
|
@@ -7320,7 +7375,7 @@ const $a6e23a834336fc19$export$824dde41348efed1 = /*@__PURE__*/(() => {
|
|
|
7320
7375
|
|
|
7321
7376
|
const observe_to_signal = (element, setter) => {
|
|
7322
7377
|
const computed_style = getComputedStyle(element);
|
|
7323
|
-
const resize_observer = new ResizeObserver($i7OB2$
|
|
7378
|
+
const resize_observer = new ResizeObserver($i7OB2$catchify1(() => {
|
|
7324
7379
|
setter(element.getBoundingClientRect().width + parseFloat(computed_style.marginLeft) + parseFloat(computed_style.marginRight) + parseFloat(computed_style.borderRightWidth) + parseFloat(computed_style.borderLeftWidth));
|
|
7325
7380
|
}));
|
|
7326
7381
|
resize_observer.observe(element);
|
|
@@ -7374,7 +7429,7 @@ async function $4b2134398dfa83fa$export$c1a6b039e689a58e(merchant, market, local
|
|
|
7374
7429
|
const in_ls = localStorage[localstorage_key];
|
|
7375
7430
|
if (in_ls) localstorage_value = JSON.parse(in_ls);
|
|
7376
7431
|
} catch (e) {
|
|
7377
|
-
$i7OB2$
|
|
7432
|
+
$i7OB2$dlog1("Failed parsing JSON from localStorage", e);
|
|
7378
7433
|
}
|
|
7379
7434
|
const updated = localstorage_value?.updated;
|
|
7380
7435
|
const now = +new Date();
|
|
@@ -7418,12 +7473,12 @@ async function $4b2134398dfa83fa$var$download_categories(merchant, market, local
|
|
|
7418
7473
|
if (!fetched) return [];
|
|
7419
7474
|
try {
|
|
7420
7475
|
if (fetched.status !== 200) {
|
|
7421
|
-
$i7OB2$
|
|
7476
|
+
$i7OB2$dlog1("failed to fetch queries, server responded with", fetched.status, fetched, await fetched.text());
|
|
7422
7477
|
return [];
|
|
7423
7478
|
}
|
|
7424
7479
|
return await fetched.json();
|
|
7425
7480
|
} catch (e) {
|
|
7426
|
-
$i7OB2$
|
|
7481
|
+
$i7OB2$dlog1("failed to decode queries json", fetched, e);
|
|
7427
7482
|
return [];
|
|
7428
7483
|
}
|
|
7429
7484
|
}
|
|
@@ -7558,9 +7613,9 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
7558
7613
|
return this.#cache_objs[endpoint] ||= {
|
|
7559
7614
|
in_progress_: {},
|
|
7560
7615
|
cache_: {},
|
|
7561
|
-
finalization_registry_: this.#supports_finalization_registry ? new FinalizationRegistry($i7OB2$
|
|
7616
|
+
finalization_registry_: this.#supports_finalization_registry ? new FinalizationRegistry($i7OB2$catchify1(key => {
|
|
7562
7617
|
const our_cache = this.#cache_objs[endpoint].cache_;
|
|
7563
|
-
$i7OB2$
|
|
7618
|
+
$i7OB2$dlog1("[Search API]: removing", key, "from", our_cache);
|
|
7564
7619
|
delete our_cache[key];
|
|
7565
7620
|
})) : undefined
|
|
7566
7621
|
};
|
|
@@ -7706,11 +7761,11 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
7706
7761
|
result = $e5014ccd0b76d9f4$export$967e966fca9515e(result);
|
|
7707
7762
|
cache_obj.cache_[body] = new WeakRef(result);
|
|
7708
7763
|
resolve_in_progress(result);
|
|
7709
|
-
setTimeout($i7OB2$
|
|
7764
|
+
setTimeout($i7OB2$catchify1(() => {
|
|
7710
7765
|
if (this.#supports_finalization_registry) cache_obj.finalization_registry_.register(result, body); // delete key from cache when value (WeakRefs) are collected
|
|
7711
7766
|
else
|
|
7712
7767
|
// delete things from cache after 5 minutes, so it doesn't get too heavy
|
|
7713
|
-
setTimeout($i7OB2$
|
|
7768
|
+
setTimeout($i7OB2$catchify1(() => delete cache_obj.cache_[body]), 300000);
|
|
7714
7769
|
}), 60000 // cache values for at least 60 seconds
|
|
7715
7770
|
);
|
|
7716
7771
|
|
|
@@ -7840,7 +7895,7 @@ function $ccd5db07a3a069c5$export$477caf01aecaeb2a(options) {
|
|
|
7840
7895
|
const [get_selected_filters_, set_selected_filters] = selected_filters_;
|
|
7841
7896
|
const [get_has_sideways_filter_clearing_flag_, set_has_sideways_filter_clearing_flag] = sideways_filter_clearing_flag_;
|
|
7842
7897
|
const [get_current_href, set_current_href] = $i7OB2$createSignal(globalThis?.location?.href ?? "https://example.com");
|
|
7843
|
-
const history_change_handler = $i7OB2$
|
|
7898
|
+
const history_change_handler = $i7OB2$catchify1(() => set_current_href(location.href));
|
|
7844
7899
|
const owner = $i7OB2$getOwner() || $i7OB2$createRoot(() => $i7OB2$getOwner());
|
|
7845
7900
|
const {
|
|
7846
7901
|
sorting_query_param_: sorting_query_param_,
|
|
@@ -7881,7 +7936,7 @@ function $ccd5db07a3a069c5$export$477caf01aecaeb2a(options) {
|
|
|
7881
7936
|
if (override_listing_id_query_param_names_) {
|
|
7882
7937
|
const found_override_listing_id = override_listing_id_query_param_names_.map(n => searchParams.get(n)).find(n => n);
|
|
7883
7938
|
set_override_listing_id(found_override_listing_id || null);
|
|
7884
|
-
if (found_override_listing_id) $i7OB2$
|
|
7939
|
+
if (found_override_listing_id) $i7OB2$dlog1("Found override query id:", found_override_listing_id); // This stuff might get confusing so better log it
|
|
7885
7940
|
}
|
|
7886
7941
|
|
|
7887
7942
|
if (hash === (0, $4147651646da990a$export$84daa4fa1471698b)) set_has_sideways_filter_clearing_flag(true);
|
|
@@ -8208,13 +8263,13 @@ function $bf52d9f9eebd1938$export$5196e4c01fa56fcb({
|
|
|
8208
8263
|
}) {
|
|
8209
8264
|
let close_toast_;
|
|
8210
8265
|
const stay_open_promise = new Promise(r => close_toast_ = r);
|
|
8211
|
-
$i7OB2$
|
|
8266
|
+
$i7OB2$catchify1(async () => {
|
|
8212
8267
|
const closing_animation_duration = 300; // ms
|
|
8213
8268
|
const element = $i7OB2$ssrElement("div", more_attributes, () => $i7OB2$escape(children), true);
|
|
8214
8269
|
const [, set_is_showing_toast] = $bf52d9f9eebd1938$export$22970a0140fc759c;
|
|
8215
8270
|
// if this is a memory leak the garbage collector is stupid - does someone know?
|
|
8216
|
-
for (const ev of ["pointerover", "focusin"]) element.addEventListener(ev, $i7OB2$
|
|
8217
|
-
for (const ev of ["pointerout", "focusout"]) element.addEventListener(ev, $i7OB2$
|
|
8271
|
+
for (const ev of ["pointerover", "focusin"]) element.addEventListener(ev, $i7OB2$catchify1(() => closing_animation.pause()));
|
|
8272
|
+
for (const ev of ["pointerout", "focusout"]) element.addEventListener(ev, $i7OB2$catchify1(() => closing_animation.play()));
|
|
8218
8273
|
const body = await (0, $i7OB2$observer).wait_for_element("body");
|
|
8219
8274
|
const x_translate = "translateX(-50%) ";
|
|
8220
8275
|
let remove_keyboard_listener;
|
|
@@ -8239,7 +8294,7 @@ function $bf52d9f9eebd1938$export$5196e4c01fa56fcb({
|
|
|
8239
8294
|
// let other toasts close us if they open while we're still here
|
|
8240
8295
|
$bf52d9f9eebd1938$var$closing_functions.add(close_toast_);
|
|
8241
8296
|
set_is_showing_toast(true);
|
|
8242
|
-
const handler = $i7OB2$
|
|
8297
|
+
const handler = $i7OB2$catchify1(({
|
|
8243
8298
|
key: key
|
|
8244
8299
|
}) => {
|
|
8245
8300
|
if (key === "Escape")
|
|
@@ -8372,7 +8427,7 @@ function $48d7e4a9707315b6$export$e026af0c7b64ea5f({
|
|
|
8372
8427
|
}, {
|
|
8373
8428
|
defer: true
|
|
8374
8429
|
}));
|
|
8375
|
-
$i7OB2$createComputed($i7OB2$on(get_search_query_, $i7OB2$
|
|
8430
|
+
$i7OB2$createComputed($i7OB2$on(get_search_query_, $i7OB2$catchify1(() => {
|
|
8376
8431
|
// when a query was submitted, clear filters if clear was pressed before
|
|
8377
8432
|
const clear_value = $i7OB2$untrack(get_clear_filters_next_submit);
|
|
8378
8433
|
if (clear_value) {
|
|
@@ -8399,11 +8454,11 @@ function $21f51c14cb3f586f$export$84bba84a7b837187(read_search_query) {
|
|
|
8399
8454
|
const key = "depict_searches";
|
|
8400
8455
|
const previous_searches = $i7OB2$createSignal(JSON.parse(ls[key] || "[]"));
|
|
8401
8456
|
const [read_previous_searches, write_previous_searches] = previous_searches;
|
|
8402
|
-
$i7OB2$createEffect($i7OB2$
|
|
8457
|
+
$i7OB2$createEffect($i7OB2$catchify1(() => {
|
|
8403
8458
|
const json_encoded = JSON.stringify(read_previous_searches());
|
|
8404
8459
|
if (ls[key] !== json_encoded) ls[key] = json_encoded;
|
|
8405
8460
|
}));
|
|
8406
|
-
$i7OB2$createComputed($i7OB2$
|
|
8461
|
+
$i7OB2$createComputed($i7OB2$catchify1(() => {
|
|
8407
8462
|
const searches = $i7OB2$untrack(read_previous_searches);
|
|
8408
8463
|
const current_query = read_search_query();
|
|
8409
8464
|
if (!current_query)
|
|
@@ -8446,7 +8501,7 @@ async function $bfd908d13d90934c$export$e16630ecb9644a1c({
|
|
|
8446
8501
|
after_submit_?.();
|
|
8447
8502
|
}
|
|
8448
8503
|
function $8f9120a1ca151e6a$export$205efb947c7ffd78(handler, passive = true, override_element) {
|
|
8449
|
-
const catchified_handler = $i7OB2$
|
|
8504
|
+
const catchified_handler = $i7OB2$catchify1(handler);
|
|
8450
8505
|
const owner = $i7OB2$getOwner();
|
|
8451
8506
|
// Some customers (e.g. equestrian) have `height: 100%` and/or `overflow-x: hidden` on the body, which means that scroll events won't get dispatched on `window`. The pages who get it on <body> won't get it on `window` and vice-versa, so there shouldn't be a worry about duplicate calling of the handler.
|
|
8452
8507
|
// Use observer in case that this gets called before body exists
|
|
@@ -8488,7 +8543,7 @@ function $d68658730065de95$export$181cceed5c91919e(callback, alsoRaF, passiveLis
|
|
|
8488
8543
|
$i7OB2$createEffect(() => {
|
|
8489
8544
|
if (alsoRaF?.()) {
|
|
8490
8545
|
let disposed = false;
|
|
8491
|
-
const fn = $i7OB2$
|
|
8546
|
+
const fn = $i7OB2$catchify1(() => {
|
|
8492
8547
|
if (disposed) return;
|
|
8493
8548
|
probablyCallCallback();
|
|
8494
8549
|
requestAnimationFrame(fn);
|
|
@@ -8501,10 +8556,10 @@ function $d68658730065de95$export$181cceed5c91919e(callback, alsoRaF, passiveLis
|
|
|
8501
8556
|
// "resize" doesn't fire sometimes when it should, also it doesn't when showing/hiding scrollbars which disabling scrolling does
|
|
8502
8557
|
// this works
|
|
8503
8558
|
// keeping resize just in case
|
|
8504
|
-
const resize_resize_observer = new ResizeObserver($i7OB2$
|
|
8559
|
+
const resize_resize_observer = new ResizeObserver($i7OB2$catchify1(probablyCallCallback));
|
|
8505
8560
|
resize_resize_observer.observe(document.documentElement);
|
|
8506
8561
|
(0, $i7OB2$observer).wait_for_element("body").then(resize_resize_observer.observe.bind(resize_resize_observer));
|
|
8507
|
-
$i7OB2$onCleanup($i7OB2$
|
|
8562
|
+
$i7OB2$onCleanup($i7OB2$catchify1(() => resize_resize_observer.disconnect()));
|
|
8508
8563
|
return probablyCallCallback;
|
|
8509
8564
|
}
|
|
8510
8565
|
const $b6d5529b253681aa$export$3f238c96c45e6cc6 = 1;
|
|
@@ -8535,7 +8590,7 @@ function $b6d5529b253681aa$export$b3ad617e9036868({
|
|
|
8535
8590
|
}, pollAlignment);
|
|
8536
8591
|
let ro;
|
|
8537
8592
|
if (alignment & $b6d5529b253681aa$export$902f8b4a7dae5d78 || alignment & $b6d5529b253681aa$export$5097308c5200105a) {
|
|
8538
|
-
ro = new ResizeObserver($i7OB2$
|
|
8593
|
+
ro = new ResizeObserver($i7OB2$catchify1(records => {
|
|
8539
8594
|
records.forEach(({
|
|
8540
8595
|
contentRect: {
|
|
8541
8596
|
width: width
|
|
@@ -8558,7 +8613,7 @@ function $b6d5529b253681aa$export$b3ad617e9036868({
|
|
|
8558
8613
|
}));
|
|
8559
8614
|
ro.observe(input_field);
|
|
8560
8615
|
}
|
|
8561
|
-
$i7OB2$onCleanup($i7OB2$
|
|
8616
|
+
$i7OB2$onCleanup($i7OB2$catchify1(() => ro?.disconnect()));
|
|
8562
8617
|
return ensureAlignedPosition;
|
|
8563
8618
|
}
|
|
8564
8619
|
const $fc5a12f3a857ca30$var$get_available_range = (available_filters_, search_for_field) => {
|
|
@@ -8758,7 +8813,7 @@ function $6db49ca163afa2c3$export$83fd5de5504a7a67({
|
|
|
8758
8813
|
fill: "forwards",
|
|
8759
8814
|
easing: "ease-in-out"
|
|
8760
8815
|
});
|
|
8761
|
-
animation.addEventListener("finish", $i7OB2$
|
|
8816
|
+
animation.addEventListener("finish", $i7OB2$catchify1(() => {
|
|
8762
8817
|
if (unpermit_when_possible) set_permitted_to_show(false);
|
|
8763
8818
|
animation = undefined;
|
|
8764
8819
|
element.style.display = "none";
|
|
@@ -8823,7 +8878,7 @@ function $056f6ac0a6caa919$export$5e4aed86c12acdd9({
|
|
|
8823
8878
|
is_first_load = true;
|
|
8824
8879
|
});
|
|
8825
8880
|
// percentage_in_view_ has equals: false so it should update even when set to the same value. That is to make sure that if the user bounces around below the "viewport" of our product listing we still start fetching as soon as is_loading_more becomes false again and we get IntersectionObserverEntries
|
|
8826
|
-
$i7OB2$createEffect($i7OB2$
|
|
8881
|
+
$i7OB2$createEffect($i7OB2$catchify1(async () => {
|
|
8827
8882
|
const be_above_percentage = is_first_load ? 50 : 75; // if first load, load earlier
|
|
8828
8883
|
if (percentage_in_view_() < be_above_percentage || is_loading_more) return;
|
|
8829
8884
|
if (!get_last_cursor()) {
|
|
@@ -9513,7 +9568,7 @@ function $f8c929beb82c512b$export$9dd50d35b9d94fdf({
|
|
|
9513
9568
|
number_of_results_: number_of_results_,
|
|
9514
9569
|
type: type
|
|
9515
9570
|
}) {
|
|
9516
|
-
const contents = $i7OB2$createMemo($i7OB2$
|
|
9571
|
+
const contents = $i7OB2$createMemo($i7OB2$catchify1(() => {
|
|
9517
9572
|
const q = get_search_query_();
|
|
9518
9573
|
return i18n_[type === $f8c929beb82c512b$export$2452208c79fe93ea.content ? "get_showing_pages_for_" : "get_showing_results_for_"]()($i7OB2$ssr($f8c929beb82c512b$var$_tmpl$, $i7OB2$ssrHydrationKey(), $i7OB2$escape(q)), $i7OB2$ssr($f8c929beb82c512b$var$_tmpl$, $i7OB2$ssrHydrationKey(), $i7OB2$escape(formatted_number_of_results_())), !!q, number_of_results_());
|
|
9519
9574
|
}));
|
|
@@ -9660,7 +9715,7 @@ function $757dac7f7c6c5241$export$9bf11afa910f536e({
|
|
|
9660
9715
|
set_search_sorting_open(true);
|
|
9661
9716
|
}
|
|
9662
9717
|
});
|
|
9663
|
-
$i7OB2$onCleanup($i7OB2$
|
|
9718
|
+
$i7OB2$onCleanup($i7OB2$catchify1(() => {
|
|
9664
9719
|
if (!sorting_expanded() && !filters_expanded()) {
|
|
9665
9720
|
set_search_filters_open(false);
|
|
9666
9721
|
set_search_sorting_open(false);
|
|
@@ -9769,7 +9824,7 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({
|
|
|
9769
9824
|
const [sorting_open, set_sorting_open] = search_sorting_open_;
|
|
9770
9825
|
const [get_current_sorting_] = current_sorting_;
|
|
9771
9826
|
const [is_small, set_is_small] = $i7OB2$createSignal(false);
|
|
9772
|
-
const dismiss_modal_ = $i7OB2$
|
|
9827
|
+
const dismiss_modal_ = $i7OB2$catchify1(() => {
|
|
9773
9828
|
set_filters_open(false);
|
|
9774
9829
|
set_sorting_open(false);
|
|
9775
9830
|
});
|
|
@@ -9855,7 +9910,7 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({
|
|
|
9855
9910
|
}));else set_extra_els_in_results_container_($i7OB2$ssr($cdea4cf8c5c071ef$var$_tmpl$2, $i7OB2$ssrHydrationKey(), $i7OB2$escape($i7OB2$createComponent((0, $68a258a92b88f02f$export$1f1775a58da589b5), sorting_options))));
|
|
9856
9911
|
}
|
|
9857
9912
|
});
|
|
9858
|
-
$i7OB2$
|
|
9913
|
+
$i7OB2$catchify1(async () => {
|
|
9859
9914
|
({
|
|
9860
9915
|
open_modal_: open_modal_,
|
|
9861
9916
|
close_modal_: close_modal_
|
|
@@ -10021,7 +10076,7 @@ function $0b0380f75d729d63$var$ActualFloatingButtons({
|
|
|
10021
10076
|
}
|
|
10022
10077
|
old_pos = new_pos;
|
|
10023
10078
|
});
|
|
10024
|
-
const touchstart_handler = $i7OB2$
|
|
10079
|
+
const touchstart_handler = $i7OB2$catchify1(e => {
|
|
10025
10080
|
is_in_touch_scroll = true;
|
|
10026
10081
|
if (e.touches.length === 1) {
|
|
10027
10082
|
// we had no touches but then we got some. Adding a new touch cancels the inertia. We are in a new touch so do reset the diff
|
|
@@ -10029,12 +10084,12 @@ function $0b0380f75d729d63$var$ActualFloatingButtons({
|
|
|
10029
10084
|
diff_over_second_or_touch = 0;
|
|
10030
10085
|
}
|
|
10031
10086
|
});
|
|
10032
|
-
const touchend_handler = $i7OB2$
|
|
10087
|
+
const touchend_handler = $i7OB2$catchify1(e => {
|
|
10033
10088
|
if (e.touches.length === 0)
|
|
10034
10089
|
// scroll gesture of any type (pinch can also be used as scroll, etc.) ended
|
|
10035
10090
|
inertia_timeout = setTimeout(
|
|
10036
10091
|
// inertia ends after 500ms (educated guess)
|
|
10037
|
-
$i7OB2$
|
|
10092
|
+
$i7OB2$catchify1(() => {
|
|
10038
10093
|
is_in_touch_scroll = false;
|
|
10039
10094
|
diff_over_second_or_touch = 0;
|
|
10040
10095
|
}), 500);
|
|
@@ -10052,9 +10107,9 @@ function $0b0380f75d729d63$var$ActualFloatingButtons({
|
|
|
10052
10107
|
const everything_closed = !get_search_filters_open_() && !get_search_sorting_open_();
|
|
10053
10108
|
if (!$i7OB2$untrack(modal_is_closed) && everything_closed)
|
|
10054
10109
|
// I think the point of this is to delay the animation a bit IIRC
|
|
10055
|
-
timeout = setTimeout($i7OB2$
|
|
10110
|
+
timeout = setTimeout($i7OB2$catchify1(() => set_if_modal_is_closed(true)), 200);else set_if_modal_is_closed(everything_closed);
|
|
10056
10111
|
});
|
|
10057
|
-
$i7OB2$createComputed($i7OB2$
|
|
10112
|
+
$i7OB2$createComputed($i7OB2$catchify1(async () => {
|
|
10058
10113
|
const element = sort_and_filter_element_();
|
|
10059
10114
|
if (!element) return;
|
|
10060
10115
|
await (0, $i7OB2$observer).wait_for_element(element);
|
|
@@ -10073,7 +10128,7 @@ function $587cd61972788655$export$210f130a61ac1e8d(fn) {
|
|
|
10073
10128
|
let last_queued;
|
|
10074
10129
|
let last_value;
|
|
10075
10130
|
let initial_run = true;
|
|
10076
|
-
$i7OB2$createComputed($i7OB2$
|
|
10131
|
+
$i7OB2$createComputed($i7OB2$catchify1(async () => {
|
|
10077
10132
|
last_value = fn();
|
|
10078
10133
|
if (initial_run) {
|
|
10079
10134
|
initial_run = false;
|
|
@@ -10120,7 +10175,7 @@ function $641bba2917fe862b$export$6e49da55e449af7c({
|
|
|
10120
10175
|
}]); // get rid of old data the browser saves the old state and will restore it later on
|
|
10121
10176
|
};
|
|
10122
10177
|
|
|
10123
|
-
$i7OB2$createComputed($i7OB2$
|
|
10178
|
+
$i7OB2$createComputed($i7OB2$catchify1(() => {
|
|
10124
10179
|
const last_result = get_last_result_in_viewport_();
|
|
10125
10180
|
if (last_result == undefined || last_result <= 0 || last_result == Infinity) return;
|
|
10126
10181
|
if (isNaN(last_result)) {
|
|
@@ -10147,7 +10202,7 @@ function $641bba2917fe862b$export$6e49da55e449af7c({
|
|
|
10147
10202
|
set_to_later = last_result;
|
|
10148
10203
|
// If a delayed push timeout is already running, just changing the value that will be pushed is sufficient
|
|
10149
10204
|
if (timeout) return;
|
|
10150
|
-
timeout = setTimeout($i7OB2$
|
|
10205
|
+
timeout = setTimeout($i7OB2$catchify1(() => {
|
|
10151
10206
|
timeout = undefined;
|
|
10152
10207
|
last_time_history_changed = +new Date();
|
|
10153
10208
|
set_min_results_loaded(set_to_later);
|
|
@@ -10249,7 +10304,7 @@ function $b2bf2cdcff8142d8$export$f631859cab12b342({
|
|
|
10249
10304
|
if (!result) return;
|
|
10250
10305
|
return {
|
|
10251
10306
|
href: result.page_url,
|
|
10252
|
-
onClick: $i7OB2$
|
|
10307
|
+
onClick: $i7OB2$catchify1(ev => router_.navigate_.go_to_({
|
|
10253
10308
|
new_url_: result.page_url,
|
|
10254
10309
|
is_replace_: false,
|
|
10255
10310
|
event_: ev
|
|
@@ -10610,7 +10665,7 @@ function $0e562a5b247b1fc2$export$44f738469d5570cf({
|
|
|
10610
10665
|
// We might only have changed the left position which align_field doesn't know about, make it poll the position for a while
|
|
10611
10666
|
setPollAlignment_(true);
|
|
10612
10667
|
if (disableResizePollingTimeout) clearTimeout(disableResizePollingTimeout);
|
|
10613
|
-
disableResizePollingTimeout = setTimeout($i7OB2$
|
|
10668
|
+
disableResizePollingTimeout = setTimeout($i7OB2$catchify1(() => {
|
|
10614
10669
|
setPollAlignment_(false);
|
|
10615
10670
|
disableResizePollingTimeout = undefined;
|
|
10616
10671
|
}), 1000);
|
|
@@ -10742,7 +10797,7 @@ function $7097477c78a89208$export$a54ec244c8863715({
|
|
|
10742
10797
|
} : {})
|
|
10743
10798
|
};
|
|
10744
10799
|
});
|
|
10745
|
-
const [search_results_] = $i7OB2$createResource(search_query_base_, $i7OB2$
|
|
10800
|
+
const [search_results_] = $i7OB2$createResource(search_query_base_, $i7OB2$catchify1(async base_query => {
|
|
10746
10801
|
set_all_products_loaded(false);
|
|
10747
10802
|
// only first page of results
|
|
10748
10803
|
return await $641bba2917fe862b$export$cc42dd29bf655ab6({
|
|
@@ -10781,7 +10836,7 @@ function $7097477c78a89208$export$a54ec244c8863715({
|
|
|
10781
10836
|
const [, setModalFieldStyle] = modal_field_style;
|
|
10782
10837
|
const [, setModalBackdropStyle] = modal_backdrop_style;
|
|
10783
10838
|
const [get_search_field_elements, set_search_field_elements] = $i7OB2$createSignal();
|
|
10784
|
-
const SafeSearchField = $i7OB2$
|
|
10839
|
+
const SafeSearchField = $i7OB2$catchify1((0, $5285d2814d0fac0c$export$b94867ecbd698f21));
|
|
10785
10840
|
const [sort_or_filter_open_, set_sort_or_filter_open_] = $i7OB2$createSignal(false);
|
|
10786
10841
|
const [desktop_filter_elements_, set_desktop_filter_elements] = $i7OB2$createSignal();
|
|
10787
10842
|
const n_hits = $i7OB2$createMemo(() => search_results_()?.n_hits);
|
|
@@ -10831,7 +10886,7 @@ function $7097477c78a89208$export$a54ec244c8863715({
|
|
|
10831
10886
|
$i7OB2$runWithOwner(owner, () => results_filters[1](matches ? [results_for, filters_opener] : $i7OB2$ssr($7097477c78a89208$var$_tmpl$, $i7OB2$ssrHydrationKey(), $i7OB2$escape(results_for), $i7OB2$escape(filters_opener))));
|
|
10832
10887
|
}).remove);
|
|
10833
10888
|
$2ab89d64b7f1d5ef$export$d31a1a1a83ad9413(search_results_, selected_filters_);
|
|
10834
|
-
$i7OB2$
|
|
10889
|
+
$i7OB2$catchify1((0, $641bba2917fe862b$export$6e49da55e449af7c))({
|
|
10835
10890
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
10836
10891
|
last_result_in_viewport_: last_result_in_viewport_,
|
|
10837
10892
|
id_: get_search_query_,
|
|
@@ -10877,8 +10932,8 @@ function $7097477c78a89208$export$a54ec244c8863715({
|
|
|
10877
10932
|
setModalBodyStyle({});
|
|
10878
10933
|
modalAlignmentSignalsRef_?.(alignmentSignals_);
|
|
10879
10934
|
const [pollAlignment, setPollAlignment_] = $i7OB2$createSignal(false);
|
|
10880
|
-
const align_position = $i7OB2$
|
|
10881
|
-
div_with_field_class.addEventListener("click", $i7OB2$
|
|
10935
|
+
const align_position = $i7OB2$catchify1((0, $b6d5529b253681aa$export$b3ad617e9036868))(alignmentSignals_, search_field, (0, $b6d5529b253681aa$export$3f238c96c45e6cc6) | (0, $b6d5529b253681aa$export$7895aadd1956b1c7) | (modalVersionUsed_ === 1 ? (0, $b6d5529b253681aa$export$902f8b4a7dae5d78) : (0, $b6d5529b253681aa$export$6060bc6bee850eb6) | (0, $b6d5529b253681aa$export$5097308c5200105a)), true, pollAlignment);
|
|
10936
|
+
div_with_field_class.addEventListener("click", $i7OB2$catchify1(e => {
|
|
10882
10937
|
const target = e.target;
|
|
10883
10938
|
const sel = ".submit";
|
|
10884
10939
|
if (target?.matches?.(sel) || target?.closest?.(sel))
|
|
@@ -11215,7 +11270,7 @@ class $806c97b931758897$export$ac6237957a15b3f0 {
|
|
|
11215
11270
|
BackIcon_: BackIcon_
|
|
11216
11271
|
});
|
|
11217
11272
|
$90980bd87c9960f9$export$5162a71f252e6122();
|
|
11218
|
-
$i7OB2$
|
|
11273
|
+
$i7OB2$catchify1(async () => {
|
|
11219
11274
|
const {
|
|
11220
11275
|
open_modal_: open_modal_,
|
|
11221
11276
|
close_modal_: close_modal_
|
|
@@ -11456,7 +11511,7 @@ function $806c97b931758897$export$f2dc7e4e4aa11abb(props) {
|
|
|
11456
11511
|
function $4ca91518c9a35379$export$828dcdd425fd3231(aligner) {
|
|
11457
11512
|
const style_element = document.createElement("style");
|
|
11458
11513
|
document.head.append(style_element);
|
|
11459
|
-
const resize_observer = new ResizeObserver($i7OB2$
|
|
11514
|
+
const resize_observer = new ResizeObserver($i7OB2$catchify1(() => {
|
|
11460
11515
|
const styles = $926b1b5ba2239356$export$1233ca167bf71f9a({
|
|
11461
11516
|
".depict.plp .depict-search-modal .search-field": {
|
|
11462
11517
|
"height": `${aligner?.clientHeight}px`
|
|
@@ -11525,7 +11580,7 @@ const $6891c018a834cfdd$export$d86a33413558014e = openModalParams => {
|
|
|
11525
11580
|
}, dispose_aligner];
|
|
11526
11581
|
};
|
|
11527
11582
|
function $6e8944558258054f$export$d0596b5cae35ad4(open_search) {
|
|
11528
|
-
const handler = $i7OB2$
|
|
11583
|
+
const handler = $i7OB2$catchify1(e => {
|
|
11529
11584
|
const {
|
|
11530
11585
|
key: key,
|
|
11531
11586
|
target: target
|
|
@@ -11544,7 +11599,7 @@ function $6e8944558258054f$export$d0596b5cae35ad4(open_search) {
|
|
|
11544
11599
|
function $6936724b9e0b98d5$export$689e204eadb33baf(pr) {
|
|
11545
11600
|
let old_url;
|
|
11546
11601
|
let disconnect_link_observer;
|
|
11547
|
-
const link_handler = $i7OB2$
|
|
11602
|
+
const link_handler = $i7OB2$catchify1(e => {
|
|
11548
11603
|
const link = e.currentTarget || e.target;
|
|
11549
11604
|
if (link.href === old_url) {
|
|
11550
11605
|
history.pushState(history.state, "", link.href);
|
|
@@ -11553,7 +11608,7 @@ function $6936724b9e0b98d5$export$689e204eadb33baf(pr) {
|
|
|
11553
11608
|
});
|
|
11554
11609
|
let remove_added_listeners;
|
|
11555
11610
|
let resolve_remove_added_listeners;
|
|
11556
|
-
pr.addEventListener("open", $i7OB2$
|
|
11611
|
+
pr.addEventListener("open", $i7OB2$catchify1(() => {
|
|
11557
11612
|
remove_added_listeners = new Promise(r => resolve_remove_added_listeners = r);
|
|
11558
11613
|
disconnect_link_observer = (0, $i7OB2$observer).onexists("a", async ({
|
|
11559
11614
|
element: element
|
|
@@ -11563,11 +11618,11 @@ function $6936724b9e0b98d5$export$689e204eadb33baf(pr) {
|
|
|
11563
11618
|
element.removeEventListener("click", link_handler);
|
|
11564
11619
|
});
|
|
11565
11620
|
}));
|
|
11566
|
-
pr.addEventListener("close", $i7OB2$
|
|
11621
|
+
pr.addEventListener("close", $i7OB2$catchify1(() => {
|
|
11567
11622
|
disconnect_link_observer?.();
|
|
11568
11623
|
resolve_remove_added_listeners?.();
|
|
11569
11624
|
}));
|
|
11570
|
-
$i7OB2$
|
|
11625
|
+
$i7OB2$catchify1(async () => {
|
|
11571
11626
|
for await (const href of (0, $i7OB2$href_change_ipns)) if (!pr.is_page_(new URL(href))) old_url = href;
|
|
11572
11627
|
})();
|
|
11573
11628
|
}
|
|
@@ -11579,7 +11634,7 @@ class $753e9b2889a47c89$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
11579
11634
|
static #reverting_permitted = true;
|
|
11580
11635
|
static #visited_urls = /*@__PURE__*/(() => {
|
|
11581
11636
|
// Keep track of all URLs that have been visited since the document that was initially loaded (loaded means the process where the browser creates a new `document` and `window` object).
|
|
11582
|
-
$i7OB2$
|
|
11637
|
+
$i7OB2$catchify1(async () => {
|
|
11583
11638
|
// Static initialization blocks aren't supported in MobileSafari yet, otherwise this would be one.
|
|
11584
11639
|
// I don't think we want to ship a library that users are *forced* to transpile, it should run in the newest version of all major browsers. So we'll just use a function wrapper for now (adding "last 1 ios version" to the build target does a bunch of other unneeded transpilations).
|
|
11585
11640
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Static_initialization_blocks
|
|
@@ -11597,7 +11652,7 @@ class $753e9b2889a47c89$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
11597
11652
|
async #listen() {
|
|
11598
11653
|
const [exit_ipns, exitable_ipns] = $i7OB2$make_asyncIterable_exiter((0, $i7OB2$href_change_ipns));
|
|
11599
11654
|
this.#stop_listening = exit_ipns;
|
|
11600
|
-
const caught_page_check_fn = $i7OB2$
|
|
11655
|
+
const caught_page_check_fn = $i7OB2$catchify1(this.is_page_, "page check failed");
|
|
11601
11656
|
for await (const href of exitable_ipns) {
|
|
11602
11657
|
const url = new URL(href);
|
|
11603
11658
|
if (!caught_page_check_fn(url)) {
|
|
@@ -11615,17 +11670,17 @@ class $753e9b2889a47c89$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
11615
11670
|
this.addEventListener("close", dispose, {
|
|
11616
11671
|
once: true
|
|
11617
11672
|
});
|
|
11618
|
-
return $i7OB2$
|
|
11673
|
+
return $i7OB2$catchify1(this.render_, "rendering failed")() || [];
|
|
11619
11674
|
});
|
|
11620
11675
|
}
|
|
11621
|
-
#unload = /*@__PURE__*/$i7OB2$
|
|
11676
|
+
#unload = /*@__PURE__*/$i7OB2$catchify1(() => {
|
|
11622
11677
|
if (!this.#is_open) return;
|
|
11623
11678
|
this.#disconnect_observer?.();
|
|
11624
11679
|
if ($753e9b2889a47c89$export$3ccaa27d81dd8556.#reverting_permitted) while (this.#revert_fns.length) this.#revert_fns.pop()?.();
|
|
11625
11680
|
this.#is_open = false;
|
|
11626
11681
|
this.dispatchEvent(new CustomEvent("close"));
|
|
11627
11682
|
}, "failed to close page");
|
|
11628
|
-
#load = /*@__PURE__*/$i7OB2$
|
|
11683
|
+
#load = /*@__PURE__*/$i7OB2$catchify1(async els => {
|
|
11629
11684
|
this.#is_open = true;
|
|
11630
11685
|
// So that #load doesn't get called again
|
|
11631
11686
|
let set_should_stay_inserted;
|
|
@@ -11675,7 +11730,7 @@ class $753e9b2889a47c89$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
11675
11730
|
}, "failed to open page");
|
|
11676
11731
|
#empty_page_bugfix() {
|
|
11677
11732
|
// Called when a "page" is "opened" using PageReplacer
|
|
11678
|
-
const on_maybe_popstate = $i7OB2$
|
|
11733
|
+
const on_maybe_popstate = $i7OB2$catchify1(what_happened => {
|
|
11679
11734
|
if (what_happened !== "popstate") return;
|
|
11680
11735
|
const cleaned_current_url = $753e9b2889a47c89$var$clean_url(location.href);
|
|
11681
11736
|
if (!$753e9b2889a47c89$export$3ccaa27d81dd8556.#visited_urls.has(cleaned_current_url)) {
|
|
@@ -11699,7 +11754,7 @@ class $753e9b2889a47c89$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
11699
11754
|
PageReplacer unload itself and reveals the original document - it is expected to be the one under https://ehandel.spendrups.se/Product/1104201, but actually it is the one under /start/search - a white page.
|
|
11700
11755
|
The fix: is to remember all pages that we have visited since the creation of `window` (we do that by having a static property on PageReplacer since we assume the PageReplacer source code will only exist once on the page and will be loaded at page load, the latter assumption might be wrong, but I hope not). If we get a "popstate" event (meaning back or forwards button, not new page being pushed) to an unknown page we reload.
|
|
11701
11756
|
*/
|
|
11702
|
-
$i7OB2$
|
|
11757
|
+
$i7OB2$dlog1("PageReplacer: ", cleaned_current_url, " hasn't been visited since document was created, reloading since we won't be able to show this page otherwise");
|
|
11703
11758
|
location.reload();
|
|
11704
11759
|
$753e9b2889a47c89$export$3ccaa27d81dd8556.#reverting_permitted = false; // Disallow any reverting since we can't - it would flash a white page until the reload has finished.
|
|
11705
11760
|
this.#unload(); // Call unload to "kill" the solid-js stuff quicker so that it stops updating - the user is expecting the next thing that happens to be a navigation to the actual page the URL says they're on.
|
|
@@ -11777,7 +11832,7 @@ function $58b3487626e85ece$export$316f6f283ae64765(props) {
|
|
|
11777
11832
|
field_: $i7OB2$createSignal({}),
|
|
11778
11833
|
backdrop_: backdropAlignmentSignal_
|
|
11779
11834
|
};
|
|
11780
|
-
const defaultHandler = $i7OB2$
|
|
11835
|
+
const defaultHandler = $i7OB2$catchify1(e => {
|
|
11781
11836
|
const {
|
|
11782
11837
|
modalVersionUsed_: modalVersionUsed_
|
|
11783
11838
|
} = shared_properties;
|
|
@@ -11904,7 +11959,7 @@ function $06edf3aec9073663$export$466cdc317043f6cb({
|
|
|
11904
11959
|
}];
|
|
11905
11960
|
$i7OB2$createComputed(() => {
|
|
11906
11961
|
if (place_holdey_quicklinks_data()?.[0]?.listing_id) {
|
|
11907
|
-
if (last_was_placeholder) queueMicrotask($i7OB2$
|
|
11962
|
+
if (last_was_placeholder) queueMicrotask($i7OB2$catchify1(() => {
|
|
11908
11963
|
sliding_element?.scrollTo({
|
|
11909
11964
|
left: 0
|
|
11910
11965
|
}); // for some reason we land one element to the right after placeholder rendering otherwise
|
|
@@ -11970,7 +12025,7 @@ function $06edf3aec9073663$export$466cdc317043f6cb({
|
|
|
11970
12025
|
} else if (!(intersecting_items_object[selected_index()]?.intersectionRatio >= 0.95)) {
|
|
11971
12026
|
// negated larger than to handle left side of comparison being undefined
|
|
11972
12027
|
let done_work = false;
|
|
11973
|
-
$i7OB2$runWithOwner(owner, () => $i7OB2$createComputed($i7OB2$
|
|
12028
|
+
$i7OB2$runWithOwner(owner, () => $i7OB2$createComputed($i7OB2$catchify1(() => {
|
|
11974
12029
|
if (done_work || !Array.isArray(quicklinks_data_())) return;
|
|
11975
12030
|
const sel_index = selected_index();
|
|
11976
12031
|
const target_element = sel_index >= 0 ? sel_index : 0;
|
|
@@ -12115,7 +12170,7 @@ function $e7fce80abe608e01$export$3945d6db2dfd3d12({
|
|
|
12115
12170
|
const handler = () => allow_filter_clearing = false;
|
|
12116
12171
|
window.addEventListener("popstate", handler); // popstate only gets called when using back/forwards button of browser or the history navigate to achieve the same, but not on pushState or replaceState
|
|
12117
12172
|
$i7OB2$onCleanup(() => window.removeEventListener("popstate", handler));
|
|
12118
|
-
$i7OB2$createEffect($i7OB2$on(crumb_data_, $i7OB2$
|
|
12173
|
+
$i7OB2$createEffect($i7OB2$on(crumb_data_, $i7OB2$catchify1(new_crumb_data => {
|
|
12119
12174
|
const id_of_new_data = id_to_query_for_();
|
|
12120
12175
|
const type_of_id_of_new_data = id_type_();
|
|
12121
12176
|
if (allow_filter_clearing && previous_crumb_data && new_crumb_data && (id_of_new_data !== id_when_we_got_previous_data.id_ || type_of_id_of_new_data !== id_when_we_got_previous_data.type_)) {
|
|
@@ -12165,7 +12220,7 @@ function $e7fce80abe608e01$var$clear_if_opened_new_tab_with_sideways_url_params_
|
|
|
12165
12220
|
// On first rendering of the CategoryPage (after we have results), check if we got to this URL by going sideways in QuickLinks and clear filters with toast if so
|
|
12166
12221
|
if (!$i7OB2$untrack(get_sideways_filter_clearing_flag_)) return;
|
|
12167
12222
|
set_sideways_filter_clearing_flag_(false);
|
|
12168
|
-
$i7OB2$
|
|
12223
|
+
$i7OB2$dlog1("Flag to clear filters was set, clearing filters");
|
|
12169
12224
|
$i7OB2$queueMacroTask(() => {
|
|
12170
12225
|
// Do it next task so that all the filters have time to populate
|
|
12171
12226
|
$e9342fb3ac73a54a$export$8895d39404bd2bb1({
|
|
@@ -12256,7 +12311,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
12256
12311
|
// Make "Get products in listing" request to get products in listing
|
|
12257
12312
|
const [plp_products_] = $i7OB2$createResource(products_query_base_,
|
|
12258
12313
|
// only first page of results, unless the history state says we should load more (can't do that in load more thing, I tested, they need to be added at once for the browser to not give up scroll restoration)
|
|
12259
|
-
$i7OB2$
|
|
12314
|
+
$i7OB2$catchify(base_query => $641bba2917fe862b$export$cc42dd29bf655ab6({
|
|
12260
12315
|
id_: $i7OB2$untrack(id_to_query_for_),
|
|
12261
12316
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
12262
12317
|
min_products_to_fetch_: min_products_to_fetch_,
|
|
@@ -12276,7 +12331,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
12276
12331
|
id_type_: id_type_()
|
|
12277
12332
|
}));
|
|
12278
12333
|
// Make "Get Listing" request to get quicklinks, breadcrumbs, title, etc
|
|
12279
|
-
const [plp_meta] = $i7OB2$createResource(meta_query_base, $i7OB2$
|
|
12334
|
+
const [plp_meta] = $i7OB2$createResource(meta_query_base, $i7OB2$catchify(query => depict_api_.get_listing(query)));
|
|
12280
12335
|
const available_sortings_ = $i7OB2$createMemo(() => plp_products_()?.sorts?.map(sort => ({
|
|
12281
12336
|
...sort,
|
|
12282
12337
|
order: sort.order ?? "desc"
|
|
@@ -12385,7 +12440,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
12385
12440
|
filterModalParent_: filterModalParent_,
|
|
12386
12441
|
...extra_sort_and_filter_args_
|
|
12387
12442
|
});
|
|
12388
|
-
$i7OB2$
|
|
12443
|
+
$i7OB2$catchify((0, $641bba2917fe862b$export$6e49da55e449af7c))({
|
|
12389
12444
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
12390
12445
|
last_result_in_viewport_: last_result_in_viewport_,
|
|
12391
12446
|
id_: id_to_query_for_,
|
|
@@ -12398,7 +12453,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
12398
12453
|
$i7OB2$createComputed(() => {
|
|
12399
12454
|
if (plp_products_.loading) set_can_write_scroll_restoration(false);else if (plp_products_()) set_can_write_scroll_restoration(true);
|
|
12400
12455
|
});
|
|
12401
|
-
$i7OB2$createRenderEffect($i7OB2$
|
|
12456
|
+
$i7OB2$createRenderEffect($i7OB2$catchify(async () => {
|
|
12402
12457
|
const slim = is_slim_();
|
|
12403
12458
|
const only_show_filters_opener = only_show_filters_opener_?.();
|
|
12404
12459
|
const owner = $i7OB2$getOwner();
|
|
@@ -12643,4 +12698,4 @@ function $442f32a4d80abbde$export$e2bf8ce7779e827e(props) {
|
|
|
12643
12698
|
}, "Entire CategoryPage failed");
|
|
12644
12699
|
}
|
|
12645
12700
|
$i7OB2$add_to_version_info("ui", (0, $ec291e0010116877$export$83d89fbfd8236492));
|
|
12646
|
-
export { $5e3d278ef4c80cd7$export$54299a3c81f5425 as useVisibilityState, $f32e14878e75af51$export$eaa625fb39439e37 as useSlidableInformation, $f091294da861020c$export$80bb7300ce6a8be3 as useProductCardIsVisible, $f091294da861020c$export$f223d69ed12f5fb7 as CurrentlyIntersectingContext, $24e27fab9c821b86$export$5bad61ecde080b1f as useExpandingContainerReactive, $07ef910e8ef6b783$export$2c9f9bf2092486aa as LooksSliderOrGrid, $
|
|
12701
|
+
export { $4eb0a704f8f30273$export$d4d96868197be50e as useMobileHover, $5e3d278ef4c80cd7$export$54299a3c81f5425 as useVisibilityState, $f32e14878e75af51$export$eaa625fb39439e37 as useSlidableInformation, $f091294da861020c$export$80bb7300ce6a8be3 as useProductCardIsVisible, $f091294da861020c$export$f223d69ed12f5fb7 as CurrentlyIntersectingContext, $24e27fab9c821b86$export$5bad61ecde080b1f as useExpandingContainerReactive, $07ef910e8ef6b783$export$2c9f9bf2092486aa as LooksSliderOrGrid, $e9d1d09be9e6471e$export$44809a8a3e867e30 as LookCard, $4fd2ba03703a7d92$export$7e1297a3a19f10d8 as PseudoRouter, $de6ccd37192b5fc2$export$83bb9af5671e1dbe as promiseSafeStructuredClone, $90980bd87c9960f9$export$5162a71f252e6122 as preserve_items_in_history_dot_state, $90980bd87c9960f9$export$3064e1e8c6513da3 as prefixes_to_preserve_in_history_dot_state, $a281666e5c15c2ec$export$29d28dadc2d6b631 as allowNativeNavigation, $66db7a014e20802e$export$1ea76ea778b880dd as modalVersionSymbol, $136f1d4d6c7ba6ac$export$e417c49320921907 as createDeparallelizedNoDropResource, $d8dbf52fea1773e2$export$f50b88e2a00918b5 as throw_globally, $42912431795f188e$export$9265e66f26f8e383 as ClassicSearchModal, $500a16dd18ee5a71$export$b0c55aa2e87c4be7 as SearchModalV2, $70bb27cc6be01fc7$export$9d4a4b669b1929ab as ModernResponsiveContainedImage, $024fbc0a2d796fad$export$3e41faf802a29e71 as Tab, $024fbc0a2d796fad$export$b2539bed5023c21c as Tabs, $8560c919ff763930$export$d4973c31938cbfd1 as ShopTheLookButton, $ca6f574bd8772184$export$e183a13865960371 as history_dot_state_to_state, $4147651646da990a$export$916e6850778505f6 as strip_encoded_filter_and_sort, $4147651646da990a$export$58aa3f171519b6d7 as encode_filters, $4147651646da990a$export$f934fa24c3a86811 as decode_filters, $4147651646da990a$export$62acb285a7579555 as encode_sorting, $4147651646da990a$export$766e9676e74997d3 as decode_sorting, $660070e2a394b3c3$export$d7b7ab832c20e2f4 as shopifyContainedImageContextSymbol, $011607bdf658f807$export$e68cff63f76bd15b as ListingProvider, $011607bdf658f807$export$8d0c4fdbb05a2f2e as useListing, $b6440e72ed83671a$export$11354f017ddc9790 as ProductCardIndexProvider, $b6440e72ed83671a$export$e3faf4d95300054f as useProductCardIndex, $660070e2a394b3c3$export$e4b984597b71e989 as ShopifyContainedImage, $f32e14878e75af51$export$6649caad96ef8870 as SlidableItems, $2449872a62a75a20$export$ebdc3711f7e02ccd as make_accurate_width_accessor, $ee116da074deb002$export$9574e176201e5e8d as RecommendationSlider, $9ea5383493360761$export$9756467d34d91cdb as RecommendationGrid, $e8ffe11ed01df0fe$export$6e5611bc7e57e477 as ShopifyResponsiveImg, $e8ffe11ed01df0fe$export$e6fffe67d4cdd848 as makeSizeAccessor, $f18d425032111270$export$94026ee33dbabc26 as ImageContainer, $b7436a6d1fd64e3b$export$b69d0d92862de18b as SentryErrorBoundary, $b7436a6d1fd64e3b$export$240ecf5363d76c0f as ExtraSentryContextProvider, $6bb0a0c563dff4bb$export$6c6d7a51fa9aa15d as ExpandingDetails, $c16e74cfe125bb05$export$f091cbac892643a4 as accessor_of_object_to_object_with_accessor_values, $1adfe60f3a14a1d7$export$fecbb157621501bd as SelectedFilters, $fab07f52c9861732$export$3f1a388cc0d8fed7 as FilterBody, $5efb5894079b220e$export$b288c38ae3fddb56 as create_modified_filters, $c8d5ff4524619fcd$export$d21e32dfedac04be as SolidLayout, $c8d5ff4524619fcd$export$445d8d3f5f706a40 as SolidLayoutWithProvidedElement, $194bd6b8e4c59830$export$79b1565500412d9b as general_modal_abstraction, $19976a74d273070d$export$3b621d86b1566b2 as CrossIcon, $fbbadcb080ad1d4a$export$8be2714ec7f169ee as GenericSliderArrowButton, $a0f0e923bad68a9b$export$58e808b1db15d3bc as fetchDepictRecommendations, $e4615ecd1849548f$export$b91cec6bdc6b32a1 as CategoryTitle, $a6e23a834336fc19$export$824dde41348efed1 as embedded_num_products, $4b2134398dfa83fa$export$c1a6b039e689a58e as get_listings, $961b5c64bef4662f$export$f34314aa9505732e as DepictCategory, $806c97b931758897$export$ac6237957a15b3f0 as DepictSearch, $806c97b931758897$export$bde3eb976dfded9 as get_search_query_updating_blocked_signal, $806c97b931758897$export$f2dc7e4e4aa11abb as SearchPage, $4fd48cb976bf1789$export$aa14a9f43128f61f as ProductCardError, $6891c018a834cfdd$export$d86a33413558014e as open_modal_with_alignment, $bb15dfb548a7666e$export$ee1733d9a8495996 as DefaultInstantCardPlaceholder, $b6d5529b253681aa$export$b3ad617e9036868 as align_field, $b6d5529b253681aa$export$3f238c96c45e6cc6 as ALIGN_TOP, $b6d5529b253681aa$export$902f8b4a7dae5d78 as ALIGN_WIDTH_ON_MODAL, $b6d5529b253681aa$export$7895aadd1956b1c7 as ALIGN_LEFT, $b6d5529b253681aa$export$6060bc6bee850eb6 as SET_CENTERED_LEFT, $b5cccc8ee7d24677$export$6daf8749b65a1b77 as convert_sdk_cols_at_size_to_layout, $926b1b5ba2239356$export$1233ca167bf71f9a as styles_to_valid_css_string, $aea1edf92433e81e$export$fe334901e8bebd57 as disable_scrolling, $6e8944558258054f$export$d0596b5cae35ad4 as open_search_with_shift_slash, $7fa23e2a0079eca4$export$e015ed2f2950f2e3 as DepictAPI, $dc9262ef6f786812$export$d9f36cf74e24d595 as media_query_to_accessor, $6936724b9e0b98d5$export$689e204eadb33baf as setup_fast_leave, $bf52d9f9eebd1938$export$5196e4c01fa56fcb as show_toast, $8c0f86cb3e266eeb$export$a71e92cfbb498adc as SolidFormatPrice, $4ca91518c9a35379$export$828dcdd425fd3231 as connect_search_field_height_to_aligner_height, $d20eff0aadc28983$export$acb3eaade4b23afd as BasePlaceholder, $d134eae24341b4a1$export$89c6019e4baa40b1 as TextPlaceholder, $7f60f09116a3fe61$export$3f37af283f8fb843 as ImagePlaceholder, $753e9b2889a47c89$export$3ccaa27d81dd8556 as PageReplacer, $4690a06c8489dcd0$export$864d304a0bc46829 as defaultGridSpacing, $4690a06c8489dcd0$export$c3834fa86c616831 as defaultColsAtSize, $4690a06c8489dcd0$export$7bf543b9d9be2c22 as defaultCategoryTitlePlugin, $ec291e0010116877$export$83d89fbfd8236492 as version, $58b3487626e85ece$export$316f6f283ae64765 as SearchField, $feffae76d8dc0135$export$5b7c3ce0ebe51f86 as BreadCrumbs, $feffae76d8dc0135$export$de035477d6fef996 as QuickLinks, $442f32a4d80abbde$export$e2bf8ce7779e827e as CategoryPage };
|