@depict-ai/ui 4.3.1 → 4.3.3
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 +327 -203
- package/ES10/index.d.ts +242 -235
- package/ES10/index.js +361 -237
- package/latest/index.cjs +307 -188
- package/latest/index.d.ts +242 -235
- package/latest/index.js +341 -222
- package/package.json +2 -2
- package/server/ES10/index.cjs +312 -197
- package/server/ES10/index.d.ts +242 -235
- package/server/ES10/index.js +352 -237
- package/server/latest/index.cjs +290 -180
- package/server/latest/index.d.ts +242 -235
- package/server/latest/index.js +330 -220
package/ES10/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { add_to_version_info as $8tj43$add_to_version_info, fetch_retry as $8tj43$fetch_retry, base_url as $8tj43$base_url, slider_fractional_factory as $8tj43$slider_fractional_factory, dlog as $8tj43$dlog, camelCasifyObject as $8tj43$camelCasifyObject, make_random_classname as $8tj43$make_random_classname, n_col_styling_with_dist as $8tj43$n_col_styling_with_dist, catchify as $8tj43$catchify, layout_get_visible_recs_without_partial_rows as $8tj43$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $8tj43$layout_get_total_rec_amount_for_row, layout_media_query_header as $8tj43$layout_media_query_header, report as $8tj43$report, slider_fading_factory as $8tj43$slider_fading_factory, Amazing_Slider as $8tj43$Amazing_Slider, slider_snap_css as $8tj43$slider_snap_css, observer as $8tj43$observer, javascript_media_query as $8tj43$javascript_media_query, queueMacroTask as $8tj43$queueMacroTask, findMostFrequentItem as $8tj43$findMostFrequentItem,
|
|
2
|
-
import { template as $8tj43$template, getNextElement as $8tj43$getNextElement, insert as $8tj43$insert, createComponent as $8tj43$createComponent, mergeProps as $8tj43$
|
|
3
|
-
import { createSignal as $8tj43$createSignal, createMemo as $8tj43$createMemo, createResource as $8tj43$createResource, Show as $8tj43$Show, Suspense as $8tj43$Suspense, untrack as $8tj43$untrack, createRenderEffect as $8tj43$createRenderEffect, Index as $8tj43$Index, createRoot as $8tj43$createRoot, onCleanup as $8tj43$onCleanup, For as $8tj43$For, getOwner as $8tj43$getOwner, runWithOwner as $8tj43$runWithOwner,
|
|
4
|
-
import { ListenableSet as $8tj43$ListenableSet, catchify as $8tj43$catchify1, use_href_accessor as $8tj43$use_href_accessor1, report as $8tj43$report1 } from "@depict-ai/utilishared/ES10";
|
|
1
|
+
import { add_to_version_info as $8tj43$add_to_version_info, fetch_retry as $8tj43$fetch_retry, base_url as $8tj43$base_url, dwarn as $8tj43$dwarn, slider_fractional_factory as $8tj43$slider_fractional_factory, dlog as $8tj43$dlog, camelCasifyObject as $8tj43$camelCasifyObject, make_random_classname as $8tj43$make_random_classname, n_col_styling_with_dist as $8tj43$n_col_styling_with_dist, catchify as $8tj43$catchify, layout_get_visible_recs_without_partial_rows as $8tj43$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $8tj43$layout_get_total_rec_amount_for_row, layout_media_query_header as $8tj43$layout_media_query_header, report as $8tj43$report, slider_fading_factory as $8tj43$slider_fading_factory, Amazing_Slider as $8tj43$Amazing_Slider, slider_snap_css as $8tj43$slider_snap_css, observer as $8tj43$observer, javascript_media_query as $8tj43$javascript_media_query, queueMacroTask as $8tj43$queueMacroTask, findMostFrequentItem as $8tj43$findMostFrequentItem, standard_price_format as $8tj43$standard_price_format, instant_exec_on_suspect_history_change as $8tj43$instant_exec_on_suspect_history_change, deparallelize_no_drop as $8tj43$deparallelize_no_drop, ContainedImage as $8tj43$ContainedImage, buildThresholdList as $8tj43$buildThresholdList, make_asyncIterable_exiter as $8tj43$make_asyncIterable_exiter, href_change_ipns as $8tj43$href_change_ipns, base64_encode_unicode as $8tj43$base64_encode_unicode, base64_decode_unicode as $8tj43$base64_decode_unicode, use_href_accessor as $8tj43$use_href_accessor, get_session_id as $8tj43$get_session_id, add_version_query_params as $8tj43$add_version_query_params, useExpandingContainer as $8tj43$useExpandingContainer, hex_to_rgb as $8tj43$hex_to_rgb, relative_luminance_from_rgb as $8tj43$relative_luminance_from_rgb, snakeCasifyObject as $8tj43$snakeCasifyObject, make_url_with_query_params as $8tj43$make_url_with_query_params, sort_obj as $8tj43$sort_obj, ListenableSet as $8tj43$ListenableSet1, insert_surfaces as $8tj43$insert_surfaces, is_debug as $8tj43$is_debug } from "@depict-ai/utilishared/ES10";
|
|
2
|
+
import { template as $8tj43$template, getNextElement as $8tj43$getNextElement, insert as $8tj43$insert, createComponent as $8tj43$createComponent, mergeProps as $8tj43$mergeProps1, isServer as $8tj43$isServer, spread as $8tj43$spread, runHydrationEvents as $8tj43$runHydrationEvents, addEventListener as $8tj43$addEventListener, className as $8tj43$className, memo as $8tj43$memo, delegateEvents as $8tj43$delegateEvents, getNextMarker as $8tj43$getNextMarker, effect as $8tj43$effect, classList as $8tj43$classList, setAttribute as $8tj43$setAttribute, style as $8tj43$style, use as $8tj43$use, setProperty as $8tj43$setProperty, Dynamic as $8tj43$Dynamic } from "solid-js/web";
|
|
3
|
+
import { createSignal as $8tj43$createSignal, createMemo as $8tj43$createMemo, createResource as $8tj43$createResource, createEffect as $8tj43$createEffect, mergeProps as $8tj43$mergeProps, Show as $8tj43$Show, Suspense as $8tj43$Suspense, untrack as $8tj43$untrack, createRenderEffect as $8tj43$createRenderEffect, Index as $8tj43$Index, createRoot as $8tj43$createRoot, onCleanup as $8tj43$onCleanup, For as $8tj43$For, getOwner as $8tj43$getOwner, runWithOwner as $8tj43$runWithOwner, createContext as $8tj43$createContext, useContext as $8tj43$useContext, createUniqueId as $8tj43$createUniqueId, createComputed as $8tj43$createComputed, ErrorBoundary as $8tj43$ErrorBoundary, splitProps as $8tj43$splitProps, on as $8tj43$on, batch as $8tj43$batch, createSelector as $8tj43$createSelector, children as $8tj43$children, createReaction as $8tj43$createReaction, mapArray as $8tj43$mapArray } from "solid-js";
|
|
5
4
|
import $8tj43$babelruntimehelpersdefineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
|
+
import { ListenableSet as $8tj43$ListenableSet, catchify as $8tj43$catchify1, use_href_accessor as $8tj43$use_href_accessor1, report as $8tj43$report1 } from "@depict-ai/utilishared/ES10";
|
|
6
6
|
import $8tj43$babelruntimehelpersclassPrivateFieldSet from "@babel/runtime/helpers/classPrivateFieldSet";
|
|
7
7
|
import $8tj43$babelruntimehelpersclassPrivateFieldGet from "@babel/runtime/helpers/classPrivateFieldGet";
|
|
8
8
|
import { createStore as $8tj43$createStore, reconcile as $8tj43$reconcile } from "solid-js/store";
|
|
@@ -10,7 +10,7 @@ import { createStore as $8tj43$createStore, reconcile as $8tj43$reconcile } from
|
|
|
10
10
|
/*! Depict.ai search and product listing SDK */
|
|
11
11
|
import { register_es_version } from "../multi_import_deduplicator.mjs";
|
|
12
12
|
register_es_version("ui", "ES10");
|
|
13
|
-
const $8db9a15135765c11$export$83d89fbfd8236492 = "4.3.
|
|
13
|
+
const $8db9a15135765c11$export$83d89fbfd8236492 = "4.3.3";
|
|
14
14
|
const $a9c7ba6087881ac2$var$transform_elements = sorted_cols_at_size => {
|
|
15
15
|
const cols_at_size = [];
|
|
16
16
|
for (let i = 0; i < sorted_cols_at_size.length; i++) {
|
|
@@ -453,7 +453,7 @@ function $63f1f8dbcd07d3b0$export$d21e32dfedac04be(props) {
|
|
|
453
453
|
const container_class = "x" + $8tj43$createUniqueId();
|
|
454
454
|
const container_element_ = (() => {
|
|
455
455
|
var _el$ = $8tj43$getNextElement($63f1f8dbcd07d3b0$var$_tmpl$);
|
|
456
|
-
$8tj43$spread(_el$, $8tj43$
|
|
456
|
+
$8tj43$spread(_el$, $8tj43$mergeProps1(() => props.element_attributes, {
|
|
457
457
|
"classList": {
|
|
458
458
|
[container_class]: true
|
|
459
459
|
}
|
|
@@ -714,7 +714,7 @@ function $39ddb986053fb759$export$d41d19e89346fa2(_ref) {
|
|
|
714
714
|
} = slider;
|
|
715
715
|
const Layout = props => $63f1f8dbcd07d3b0$export$445d8d3f5f706a40(props, insert_here, true);
|
|
716
716
|
// Do like this, so we don't have to call mergeProps ourselves
|
|
717
|
-
$8tj43$createComponent(Layout, $8tj43$
|
|
717
|
+
$8tj43$createComponent(Layout, $8tj43$mergeProps1({
|
|
718
718
|
rows: "all",
|
|
719
719
|
layout: "slider"
|
|
720
720
|
}, layout_options_));
|
|
@@ -1031,7 +1031,7 @@ function $56047603f9d212b6$export$6e5611bc7e57e477(props) {
|
|
|
1031
1031
|
});
|
|
1032
1032
|
// Work around https://github.com/solidjs/solid/issues/1828
|
|
1033
1033
|
const img = new Image(); // Need to use new Image or browser might not start loading image before it's in the DOM
|
|
1034
|
-
const [, otherAttributes] = $8tj43$splitProps(props, ["resolutions", "size", "src", "srcSet", "loading", "customUrls" // Can't have properties ending on underscore because the property name mangling will get confused by this <-
|
|
1034
|
+
const [, otherAttributes] = $8tj43$splitProps(props, ["resolutions", "size", "src", "srcSet", "loading", "keyRatioUpdating", "customUrls" // Can't have properties ending on underscore because the property name mangling will get confused by this <-
|
|
1035
1035
|
]);
|
|
1036
1036
|
|
|
1037
1037
|
const [hasSetSize, setHasSetSize] = $8tj43$createSignal(false);
|
|
@@ -1047,7 +1047,7 @@ function $56047603f9d212b6$export$6e5611bc7e57e477(props) {
|
|
|
1047
1047
|
if (loading === "force-lazy") return true;
|
|
1048
1048
|
return loading === "lazy" && !isPrioritisedImage();
|
|
1049
1049
|
});
|
|
1050
|
-
const modifiedOtherAttributes = $8tj43$
|
|
1050
|
+
const modifiedOtherAttributes = $8tj43$mergeProps(otherAttributes, {
|
|
1051
1051
|
get loading() {
|
|
1052
1052
|
return shouldActuallyEnableLazyLoading() ? "lazy" : undefined;
|
|
1053
1053
|
}
|
|
@@ -1087,13 +1087,18 @@ function $56047603f9d212b6$export$6e5611bc7e57e477(props) {
|
|
|
1087
1087
|
let hasDecodedFastPath = false;
|
|
1088
1088
|
let timeoutSet = false;
|
|
1089
1089
|
let gotCleanedUp = false;
|
|
1090
|
+
let srcJustChanged = true;
|
|
1090
1091
|
img.classList.add("s-responsive-image");
|
|
1091
1092
|
if (listingContext) {
|
|
1092
1093
|
let prevValue;
|
|
1093
1094
|
const aspectRatios = listingContext[$56047603f9d212b6$export$f8945274f08a3105] || (listingContext[$56047603f9d212b6$export$f8945274f08a3105] = new Set());
|
|
1094
1095
|
const [, setMostPrevalentAspectRatio] = listingContext[$56047603f9d212b6$export$6066eb417ed2e9f7] || (listingContext[$56047603f9d212b6$export$6066eb417ed2e9f7] = $8tj43$createSignal());
|
|
1095
1096
|
img.addEventListener("load", $8tj43$catchify(() => {
|
|
1096
|
-
|
|
1097
|
+
if (props.keyRatioUpdating) {
|
|
1098
|
+
if (!srcJustChanged) return;
|
|
1099
|
+
srcJustChanged = false;
|
|
1100
|
+
}
|
|
1101
|
+
// Save our aspect ratio whenever it changes, so that we can base the containers on the most dominant aspect ratio, used in SearchModalV2 and LookItem
|
|
1097
1102
|
const aspectRatio_ = img.naturalWidth / img.naturalHeight;
|
|
1098
1103
|
if (prevValue) aspectRatios.delete(prevValue);
|
|
1099
1104
|
const newValue = !isNaN(aspectRatio_) ? {
|
|
@@ -1114,7 +1119,11 @@ function $56047603f9d212b6$export$6e5611bc7e57e477(props) {
|
|
|
1114
1119
|
$8tj43$onCleanup(() => prevValue && aspectRatios.delete(prevValue));
|
|
1115
1120
|
}
|
|
1116
1121
|
$8tj43$onCleanup(() => gotCleanedUp = true);
|
|
1117
|
-
$8tj43$spread(img, $8tj43$
|
|
1122
|
+
$8tj43$spread(img, $8tj43$mergeProps(modifiedOtherAttributes), false, true);
|
|
1123
|
+
$8tj43$createRenderEffect(() => {
|
|
1124
|
+
props.src;
|
|
1125
|
+
srcJustChanged = true;
|
|
1126
|
+
});
|
|
1118
1127
|
$8tj43$createEffect(() => {
|
|
1119
1128
|
if (!props.size()) return; // wait until we have a size, run every time the size changes
|
|
1120
1129
|
if (timeoutSet) return;
|
|
@@ -1182,48 +1191,22 @@ function $4df489344a0f97c7$export$e4b984597b71e989(props) {
|
|
|
1182
1191
|
context[$4df489344a0f97c7$export$d7b7ab832c20e2f4] = $8tj43$createSignal();
|
|
1183
1192
|
const [currentImageSize, setCurrentImageSize] = (context === null || context === void 0 ? void 0 : context[$4df489344a0f97c7$export$d7b7ab832c20e2f4]) || $4df489344a0f97c7$var$backupSizeSignal; // use global fallback signal (might lead to blurry images) if no context is available
|
|
1184
1193
|
const [mostPrevalentAspectRatio] = context ? context[(0, $56047603f9d212b6$export$6066eb417ed2e9f7)] || (context[(0, $56047603f9d212b6$export$6066eb417ed2e9f7)] = $8tj43$createSignal()) : [];
|
|
1185
|
-
const [aspectRatio, setAspectRatio] = $8tj43$createSignal($8tj43$untrack(() => props.aspectRatio));
|
|
1186
1194
|
const container = $801e8845d3fa3653$export$94026ee33dbabc26({
|
|
1187
1195
|
// Write getters manually instead of using JSX, so we can do more complex logic in the aspectRatio getter without increasing bundle size
|
|
1188
1196
|
get class() {
|
|
1189
1197
|
return props.class;
|
|
1190
1198
|
},
|
|
1191
1199
|
get aspectRatio() {
|
|
1192
|
-
|
|
1200
|
+
if (props.autoAdjustAspectRatio) {
|
|
1201
|
+
const targetRatio = mostPrevalentAspectRatio === null || mostPrevalentAspectRatio === void 0 ? void 0 : mostPrevalentAspectRatio();
|
|
1202
|
+
if (targetRatio != undefined) return "var(".concat((0, $5eaa00b951637e96$export$8a2234b5b1a5ebd4), ", ").concat(targetRatio, ")");
|
|
1203
|
+
}
|
|
1204
|
+
return props.aspectRatio;
|
|
1193
1205
|
}
|
|
1194
1206
|
});
|
|
1195
1207
|
const owner = $8tj43$getOwner();
|
|
1196
1208
|
let createdSizeAccessor = false;
|
|
1197
1209
|
let wasCleanedUp = false;
|
|
1198
|
-
let timeout;
|
|
1199
|
-
$8tj43$createEffect(() => {
|
|
1200
|
-
const {
|
|
1201
|
-
autoAdjustAspectRatio: autoAdjustAspectRatio
|
|
1202
|
-
} = props;
|
|
1203
|
-
if (autoAdjustAspectRatio) {
|
|
1204
|
-
const targetRatio = mostPrevalentAspectRatio === null || mostPrevalentAspectRatio === void 0 ? void 0 : mostPrevalentAspectRatio();
|
|
1205
|
-
if (targetRatio != undefined) {
|
|
1206
|
-
const targetValue = "var(".concat((0, $5eaa00b951637e96$export$8a2234b5b1a5ebd4), ", ").concat(targetRatio, ")");
|
|
1207
|
-
const updateAspectRatio = $8tj43$catchify(() => setAspectRatio(targetValue));
|
|
1208
|
-
if (autoAdjustAspectRatio === "smoothed") {
|
|
1209
|
-
if (!timeout)
|
|
1210
|
-
// If we don't have a timeout yet, also update instantly. This is so that the aspect ratio does get set at the start of a transition, if it changes (when using smoothing).
|
|
1211
|
-
updateAspectRatio();
|
|
1212
|
-
clearTimeout(timeout);
|
|
1213
|
-
timeout = setTimeout(() => {
|
|
1214
|
-
timeout = undefined;
|
|
1215
|
-
updateAspectRatio();
|
|
1216
|
-
}, 500);
|
|
1217
|
-
return;
|
|
1218
|
-
}
|
|
1219
|
-
return updateAspectRatio();
|
|
1220
|
-
}
|
|
1221
|
-
} else {
|
|
1222
|
-
clearTimeout(timeout);
|
|
1223
|
-
timeout = undefined;
|
|
1224
|
-
}
|
|
1225
|
-
setAspectRatio(props.aspectRatio);
|
|
1226
|
-
});
|
|
1227
1210
|
$8tj43$createEffect(() => {
|
|
1228
1211
|
if (currentImageSize() || wasCleanedUp) return; // We get into the effect when onCleanup is called if we don't have wasCleanedUp
|
|
1229
1212
|
// ensure we always have a size accessor
|
|
@@ -1237,7 +1220,7 @@ function $4df489344a0f97c7$export$e4b984597b71e989(props) {
|
|
|
1237
1220
|
$8tj43$queueMacroTask(() => setCurrentImageSize()); // unset the size accessor next event loop iteration, so that all onCleanup's have time to run, since the effects run more aggressively and can create a size accessor with a cleaned up owner otherwise
|
|
1238
1221
|
});
|
|
1239
1222
|
|
|
1240
|
-
$8tj43$insert(container, $8tj43$createComponent((0, $56047603f9d212b6$export$6e5611bc7e57e477), $8tj43$
|
|
1223
|
+
$8tj43$insert(container, $8tj43$createComponent((0, $56047603f9d212b6$export$6e5611bc7e57e477), $8tj43$mergeProps1({
|
|
1241
1224
|
get size() {
|
|
1242
1225
|
return $8tj43$createMemo(() => {
|
|
1243
1226
|
var _currentImageSize;
|
|
@@ -1256,7 +1239,7 @@ function $4df489344a0f97c7$export$e4b984597b71e989(props) {
|
|
|
1256
1239
|
return container;
|
|
1257
1240
|
}
|
|
1258
1241
|
function $98688279b9059f50$export$9d4a4b669b1929ab(props) {
|
|
1259
|
-
return $8tj43$createComponent((0, $4df489344a0f97c7$export$e4b984597b71e989), $8tj43$
|
|
1242
|
+
return $8tj43$createComponent((0, $4df489344a0f97c7$export$e4b984597b71e989), $8tj43$mergeProps1(props, {
|
|
1260
1243
|
get imgProps() {
|
|
1261
1244
|
return {
|
|
1262
1245
|
...props.imgProps,
|
|
@@ -1273,6 +1256,12 @@ function $98688279b9059f50$export$9d4a4b669b1929ab(props) {
|
|
|
1273
1256
|
}
|
|
1274
1257
|
}));
|
|
1275
1258
|
}
|
|
1259
|
+
function $60ec7a29849d81db$export$a71e92cfbb498adc(props) {
|
|
1260
|
+
return $8tj43$createMemo(() => {
|
|
1261
|
+
const price_formatting = props.price_formatting_;
|
|
1262
|
+
return $8tj43$standard_price_format(props.price_, price_formatting.places_after_comma_, price_formatting.decimal_places_delimiter_, price_formatting.thousands_delimiter_);
|
|
1263
|
+
});
|
|
1264
|
+
}
|
|
1276
1265
|
var $0c5b1686f971e5e7$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<div class=img-wrapper>`),
|
|
1277
1266
|
$0c5b1686f971e5e7$var$_tmpl$2 = /*#__PURE__*/$8tj43$template(`<span class="d-price original">`),
|
|
1278
1267
|
$0c5b1686f971e5e7$var$_tmpl$3 = /*#__PURE__*/$8tj43$template(`<div class=right-part><div class=text-container><span class="d-title line-clamp"></span><span class=d-price></span><!$><!/></div><!$><!/>`),
|
|
@@ -1281,10 +1270,12 @@ function $0c5b1686f971e5e7$export$b73ed90f0ee50dc3(_ref) {
|
|
|
1281
1270
|
let {
|
|
1282
1271
|
display_: display_,
|
|
1283
1272
|
FavoriteButton_: FavoriteButton_,
|
|
1284
|
-
|
|
1273
|
+
userWantsExpandedSignal_: [userWantsExpanded, setUserWantsExpanded],
|
|
1285
1274
|
textFadeInAnimationRunning_: textFadeInAnimationRunning_,
|
|
1286
1275
|
outerRef_: outerRef_,
|
|
1287
|
-
animationDuration_: animationDuration_
|
|
1276
|
+
animationDuration_: animationDuration_,
|
|
1277
|
+
priceFormatting_: priceFormatting_,
|
|
1278
|
+
pseudoRouter_: pseudoRouter_
|
|
1288
1279
|
} = _ref;
|
|
1289
1280
|
const variantToUse = $8tj43$createMemo(() => {
|
|
1290
1281
|
const display = display_();
|
|
@@ -1295,7 +1286,7 @@ function $0c5b1686f971e5e7$export$b73ed90f0ee50dc3(_ref) {
|
|
|
1295
1286
|
return (_variantToUse = variantToUse()) === null || _variantToUse === void 0 ? void 0 : (_variantToUse$image_u = _variantToUse.image_urls) === null || _variantToUse$image_u === void 0 ? void 0 : _variantToUse$image_u[0];
|
|
1296
1287
|
});
|
|
1297
1288
|
const [animationIsRunning, setAnimationIsRunning] = textFadeInAnimationRunning_;
|
|
1298
|
-
const [isExpandedThrottledByOurEffectRun, setIsExpandedThrottledByOurEffectRun] = $8tj43$createSignal($8tj43$untrack(
|
|
1289
|
+
const [isExpandedThrottledByOurEffectRun, setIsExpandedThrottledByOurEffectRun] = $8tj43$createSignal($8tj43$untrack(userWantsExpanded));
|
|
1299
1290
|
const [animationEffectExists, setAnimationEffectExists] = $8tj43$createSignal(false);
|
|
1300
1291
|
const [salePrice] = $8tj43$createResource(() => {
|
|
1301
1292
|
var _variantToUse2;
|
|
@@ -1305,7 +1296,12 @@ function $0c5b1686f971e5e7$export$b73ed90f0ee50dc3(_ref) {
|
|
|
1305
1296
|
var _variantToUse3;
|
|
1306
1297
|
return (_variantToUse3 = variantToUse()) === null || _variantToUse3 === void 0 ? void 0 : _variantToUse3.original_price;
|
|
1307
1298
|
});
|
|
1308
|
-
const isOnSale = $8tj43$createMemo(() => salePrice.latest !== originalPrice.latest); // .latest doesn't trigger suspense
|
|
1299
|
+
const isOnSale = $8tj43$createMemo(() => !salePrice.loading && !originalPrice.loading && salePrice.latest !== originalPrice.latest); // .latest doesn't trigger suspense after the initial load
|
|
1300
|
+
const enableLink = $8tj43$createMemo(() => userWantsExpanded() && !animationIsRunning());
|
|
1301
|
+
const href = $8tj43$createMemo(() => {
|
|
1302
|
+
var _variantToUse4;
|
|
1303
|
+
return (_variantToUse4 = variantToUse()) === null || _variantToUse4 === void 0 ? void 0 : _variantToUse4.page_url;
|
|
1304
|
+
});
|
|
1309
1305
|
const FavoriteButton = FavoriteButton_; // Just to get rid of the type error - TS doesn't understand <Show>
|
|
1310
1306
|
return (() => {
|
|
1311
1307
|
var _el$ = $8tj43$getNextElement($0c5b1686f971e5e7$var$_tmpl$4),
|
|
@@ -1315,11 +1311,23 @@ function $0c5b1686f971e5e7$export$b73ed90f0ee50dc3(_ref) {
|
|
|
1315
1311
|
[_el$15, _co$4] = $8tj43$getNextMarker(_el$14.nextSibling);
|
|
1316
1312
|
var _ref$ = outerRef_;
|
|
1317
1313
|
typeof _ref$ === "function" ? $8tj43$use(_ref$, _el$) : outerRef_ = _el$;
|
|
1318
|
-
$8tj43$spread(_el$, $8tj43$
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1314
|
+
$8tj43$spread(_el$, $8tj43$mergeProps1(() => enableLink() ? {
|
|
1315
|
+
href: href()
|
|
1316
|
+
} : {}, {
|
|
1317
|
+
get onClick() {
|
|
1318
|
+
return $8tj43$catchify(event_ => {
|
|
1319
|
+
if (enableLink()) {
|
|
1320
|
+
pseudoRouter_.navigate_.go_to_({
|
|
1321
|
+
new_url_: href(),
|
|
1322
|
+
is_replace_: false,
|
|
1323
|
+
event_: event_
|
|
1324
|
+
});
|
|
1325
|
+
if (event_.defaultPrevented)
|
|
1326
|
+
// We single-page-navigated in this tab, close the look
|
|
1327
|
+
setUserWantsExpanded(false);
|
|
1328
|
+
}
|
|
1329
|
+
});
|
|
1330
|
+
}
|
|
1323
1331
|
}), false, true);
|
|
1324
1332
|
$8tj43$insert(_el$, $8tj43$createComponent((0, $8tj43$Show), {
|
|
1325
1333
|
when: imageUrl,
|
|
@@ -1345,10 +1353,13 @@ function $0c5b1686f971e5e7$export$b73ed90f0ee50dc3(_ref) {
|
|
|
1345
1353
|
return imageUrl();
|
|
1346
1354
|
},
|
|
1347
1355
|
get aspectRatio() {
|
|
1348
|
-
return
|
|
1356
|
+
return userWantsExpanded() ? 0.75 : 1;
|
|
1349
1357
|
},
|
|
1350
1358
|
get autoAdjustAspectRatio() {
|
|
1351
|
-
return
|
|
1359
|
+
return userWantsExpanded();
|
|
1360
|
+
},
|
|
1361
|
+
imgProps: {
|
|
1362
|
+
keyRatioUpdating: true
|
|
1352
1363
|
}
|
|
1353
1364
|
});
|
|
1354
1365
|
}
|
|
@@ -1358,7 +1369,7 @@ function $0c5b1686f971e5e7$export$b73ed90f0ee50dc3(_ref) {
|
|
|
1358
1369
|
}), _el$13, _co$3);
|
|
1359
1370
|
$8tj43$insert(_el$, $8tj43$createComponent((0, $8tj43$Show), {
|
|
1360
1371
|
get when() {
|
|
1361
|
-
return (animationEffectExists() ? isExpandedThrottledByOurEffectRun() :
|
|
1372
|
+
return (animationEffectExists() ? isExpandedThrottledByOurEffectRun() : userWantsExpanded()) || animationIsRunning();
|
|
1362
1373
|
},
|
|
1363
1374
|
get children() {
|
|
1364
1375
|
var _el$3 = $8tj43$getNextElement($0c5b1686f971e5e7$var$_tmpl$3),
|
|
@@ -1386,7 +1397,7 @@ function $0c5b1686f971e5e7$export$b73ed90f0ee50dc3(_ref) {
|
|
|
1386
1397
|
setAnimationIsRunning(true);
|
|
1387
1398
|
$8tj43$runWithOwner(owner, () => {
|
|
1388
1399
|
$8tj43$createRenderEffect(() => {
|
|
1389
|
-
const expanded =
|
|
1400
|
+
const expanded = userWantsExpanded();
|
|
1390
1401
|
// Still glitches in chrome (probably not fixable) and sometimes the timing is off in Safari but fuck it, I couldn't massage the WAAPI to improve it in any way (without reading computed style) to make the reversing of animations glitch less
|
|
1391
1402
|
textContainerAnimation.pause();
|
|
1392
1403
|
textContainerAnimation.updatePlaybackRate(expanded ? 1 : -1);
|
|
@@ -1409,26 +1420,68 @@ function $0c5b1686f971e5e7$export$b73ed90f0ee50dc3(_ref) {
|
|
|
1409
1420
|
width: "20ch"
|
|
1410
1421
|
});
|
|
1411
1422
|
});
|
|
1412
|
-
$8tj43$insert(_el$6, (()
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1423
|
+
$8tj43$insert(_el$6, $8tj43$createComponent((0, $8tj43$Show), {
|
|
1424
|
+
get when() {
|
|
1425
|
+
return variantToUse() && !salePrice.loading;
|
|
1426
|
+
},
|
|
1427
|
+
get fallback() {
|
|
1428
|
+
return $8tj43$createComponent((0, $ceafb6fb91c6f394$export$89c6019e4baa40b1), {
|
|
1429
|
+
height: "1em",
|
|
1430
|
+
width: "20ch"
|
|
1431
|
+
});
|
|
1432
|
+
},
|
|
1433
|
+
get children() {
|
|
1434
|
+
return $8tj43$createComponent((0, $8tj43$Show), {
|
|
1435
|
+
get when() {
|
|
1436
|
+
return salePrice.latest;
|
|
1437
|
+
},
|
|
1438
|
+
get children() {
|
|
1439
|
+
return [$8tj43$memo(() => priceFormatting_().pre_), $8tj43$createComponent((0, $60ec7a29849d81db$export$a71e92cfbb498adc), {
|
|
1440
|
+
get price_() {
|
|
1441
|
+
return salePrice();
|
|
1442
|
+
},
|
|
1443
|
+
get price_formatting_() {
|
|
1444
|
+
return priceFormatting_();
|
|
1445
|
+
}
|
|
1446
|
+
}), $8tj43$memo(() => priceFormatting_().post_)];
|
|
1447
|
+
}
|
|
1448
|
+
});
|
|
1449
|
+
}
|
|
1450
|
+
}));
|
|
1419
1451
|
$8tj43$insert(_el$4, $8tj43$createComponent((0, $8tj43$Show), {
|
|
1420
1452
|
get when() {
|
|
1421
1453
|
return isOnSale();
|
|
1422
1454
|
},
|
|
1423
1455
|
get children() {
|
|
1424
1456
|
var _el$7 = $8tj43$getNextElement($0c5b1686f971e5e7$var$_tmpl$2);
|
|
1425
|
-
$8tj43$insert(_el$7, (()
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1457
|
+
$8tj43$insert(_el$7, $8tj43$createComponent((0, $8tj43$Show), {
|
|
1458
|
+
get when() {
|
|
1459
|
+
return variantToUse() && !originalPrice.loading;
|
|
1460
|
+
},
|
|
1461
|
+
get fallback() {
|
|
1462
|
+
return $8tj43$createComponent((0, $ceafb6fb91c6f394$export$89c6019e4baa40b1), {
|
|
1463
|
+
height: "1em",
|
|
1464
|
+
width: "20ch"
|
|
1465
|
+
});
|
|
1466
|
+
},
|
|
1467
|
+
get children() {
|
|
1468
|
+
return $8tj43$createComponent((0, $8tj43$Show), {
|
|
1469
|
+
get when() {
|
|
1470
|
+
return salePrice.latest;
|
|
1471
|
+
},
|
|
1472
|
+
get children() {
|
|
1473
|
+
return [$8tj43$memo(() => priceFormatting_().pre_), $8tj43$createComponent((0, $60ec7a29849d81db$export$a71e92cfbb498adc), {
|
|
1474
|
+
get price_() {
|
|
1475
|
+
return originalPrice();
|
|
1476
|
+
},
|
|
1477
|
+
get price_formatting_() {
|
|
1478
|
+
return priceFormatting_();
|
|
1479
|
+
}
|
|
1480
|
+
}), $8tj43$memo(() => priceFormatting_().post_)];
|
|
1481
|
+
}
|
|
1482
|
+
});
|
|
1483
|
+
}
|
|
1484
|
+
}));
|
|
1432
1485
|
return _el$7;
|
|
1433
1486
|
}
|
|
1434
1487
|
}), _el$9, _co$);
|
|
@@ -1503,10 +1556,12 @@ function $4089a7972a508539$export$ebf0b1d4f90c09ae(_ref) {
|
|
|
1503
1556
|
let {
|
|
1504
1557
|
displays_: displays_,
|
|
1505
1558
|
FavoriteButton_: FavoriteButton_,
|
|
1506
|
-
userWantsExpandedSignal_:
|
|
1559
|
+
userWantsExpandedSignal_: userWantsExpandedSignal_,
|
|
1507
1560
|
containerWidth_: containerWidth_,
|
|
1508
1561
|
animationDuration_: animationDuration_,
|
|
1509
|
-
supportsHover_: supportsHover_
|
|
1562
|
+
supportsHover_: supportsHover_,
|
|
1563
|
+
priceFormatting_: priceFormatting_,
|
|
1564
|
+
pseudoRouter_: pseudoRouter_
|
|
1510
1565
|
} = _ref;
|
|
1511
1566
|
let isAffectedByChromeBug = false;
|
|
1512
1567
|
// If the user requests the drawer to be expanded or not
|
|
@@ -1515,6 +1570,7 @@ function $4089a7972a508539$export$ebf0b1d4f90c09ae(_ref) {
|
|
|
1515
1570
|
// The following three signals just contain the state if the animations are actually running and should only be set by the respective animation code
|
|
1516
1571
|
const textFadeInAnimationRunning = $8tj43$createSignal(false);
|
|
1517
1572
|
const [getSecondPartAnimationRunning] = textFadeInAnimationRunning;
|
|
1573
|
+
const [userWantsExpanded, setUserWantsExpanded] = userWantsExpandedSignal_;
|
|
1518
1574
|
$72017ebd8b9df947$export$7b9a0e99f0aeb2f3().then(is => isAffectedByChromeBug = is);
|
|
1519
1575
|
return $8tj43$createComponent((0, $5441862cd2f5e111$export$e68cff63f76bd15b), {
|
|
1520
1576
|
get children() {
|
|
@@ -1536,7 +1592,7 @@ function $4089a7972a508539$export$ebf0b1d4f90c09ae(_ref) {
|
|
|
1536
1592
|
behavior: "smooth"
|
|
1537
1593
|
});
|
|
1538
1594
|
}), _el$2);
|
|
1539
|
-
$8tj43$spread(_el$2, $8tj43$
|
|
1595
|
+
$8tj43$spread(_el$2, $8tj43$mergeProps1({
|
|
1540
1596
|
get classList() {
|
|
1541
1597
|
return {
|
|
1542
1598
|
expanded: userWantsExpanded(),
|
|
@@ -1560,11 +1616,13 @@ function $4089a7972a508539$export$ebf0b1d4f90c09ae(_ref) {
|
|
|
1560
1616
|
},
|
|
1561
1617
|
children: (display, index) => {
|
|
1562
1618
|
return $8tj43$createComponent((0, $0c5b1686f971e5e7$export$b73ed90f0ee50dc3), {
|
|
1619
|
+
pseudoRouter_: pseudoRouter_,
|
|
1563
1620
|
animationDuration_: animationDuration_,
|
|
1564
1621
|
display_: display,
|
|
1565
1622
|
FavoriteButton_: FavoriteButton_,
|
|
1566
|
-
|
|
1623
|
+
userWantsExpandedSignal_: userWantsExpandedSignal_,
|
|
1567
1624
|
textFadeInAnimationRunning_: textFadeInAnimationRunning,
|
|
1625
|
+
priceFormatting_: priceFormatting_,
|
|
1568
1626
|
outerRef_: el => $8tj43$createEffect(() => {
|
|
1569
1627
|
if (index !== 0) return;
|
|
1570
1628
|
const resizeObserver = new ResizeObserver($8tj43$catchify(records => setLookItemHeight(records.at(-1).contentRect.height)));
|
|
@@ -1608,10 +1666,10 @@ function $697d8713dc82b9ab$export$44809a8a3e867e30(_ref) {
|
|
|
1608
1666
|
expandedLooksSignal_: [expandedLooks_, setExpandedLooks],
|
|
1609
1667
|
FavoriteButton_: FavoriteButton_,
|
|
1610
1668
|
placeholderImageAspectRatio_: placeholderImageAspectRatio_,
|
|
1611
|
-
animationDuration_: animationDuration_
|
|
1669
|
+
animationDuration_: animationDuration_,
|
|
1670
|
+
priceFormatting_: priceFormatting_,
|
|
1671
|
+
pseudoRouter_: pseudoRouter_
|
|
1612
1672
|
} = _ref;
|
|
1613
|
-
// TODO: shopify, run displayTransformers to get dynamic prices
|
|
1614
|
-
// TODO: format prices
|
|
1615
1673
|
const [coverImage] = (display_ === null || display_ === void 0 ? void 0 : display_.image_urls) || [];
|
|
1616
1674
|
const useWantsExpandedSignal_ = $8tj43$createSignal(false);
|
|
1617
1675
|
const [userWantsExpanded, setUserWantsExpanded] = useWantsExpandedSignal_;
|
|
@@ -1657,7 +1715,7 @@ function $697d8713dc82b9ab$export$44809a8a3e867e30(_ref) {
|
|
|
1657
1715
|
when: display_,
|
|
1658
1716
|
get fallback() {
|
|
1659
1717
|
return $8tj43$createComponent((0, $3ab4aa97880fb88d$export$3f37af283f8fb843), {
|
|
1660
|
-
aspectRatio: placeholderImageAspectRatio_
|
|
1718
|
+
aspectRatio: "var(".concat((0, $5eaa00b951637e96$export$8a2234b5b1a5ebd4), ", ").concat(placeholderImageAspectRatio_, ")")
|
|
1661
1719
|
});
|
|
1662
1720
|
},
|
|
1663
1721
|
get children() {
|
|
@@ -1675,11 +1733,137 @@ function $697d8713dc82b9ab$export$44809a8a3e867e30(_ref) {
|
|
|
1675
1733
|
containerWidth_: containerWidth_,
|
|
1676
1734
|
animationDuration_: animationDuration_,
|
|
1677
1735
|
supportsHover_: supportsHover_,
|
|
1678
|
-
FavoriteButton_: FavoriteButton_
|
|
1736
|
+
FavoriteButton_: FavoriteButton_,
|
|
1737
|
+
priceFormatting_: priceFormatting_,
|
|
1738
|
+
pseudoRouter_: pseudoRouter_
|
|
1679
1739
|
})]);
|
|
1680
1740
|
return container;
|
|
1681
1741
|
}
|
|
1682
1742
|
$8tj43$delegateEvents(["click"]);
|
|
1743
|
+
|
|
1744
|
+
/**
|
|
1745
|
+
* This function is used to determine if the user is trying to open a link in a new tab or window, and we therefore should not single page navigate
|
|
1746
|
+
* @param clickEvent The click event that triggered the navigation
|
|
1747
|
+
*/
|
|
1748
|
+
function $9b35d1384e31813a$export$29d28dadc2d6b631(clickEvent) {
|
|
1749
|
+
return (clickEvent === null || clickEvent === void 0 ? void 0 : clickEvent.button) || (clickEvent === null || clickEvent === void 0 ? void 0 : clickEvent.metaKey) || (clickEvent === null || clickEvent === void 0 ? void 0 : clickEvent.ctrlKey) || (clickEvent === null || clickEvent === void 0 ? void 0 : clickEvent.shiftKey // if true, shift button on windows, linux or macOS which opens in a new window
|
|
1750
|
+
);
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1753
|
+
function $ac571292d606f30b$var$_classPrivateMethodInitSpec(obj, privateSet) {
|
|
1754
|
+
$ac571292d606f30b$var$_checkPrivateRedeclaration(obj, privateSet);
|
|
1755
|
+
privateSet.add(obj);
|
|
1756
|
+
}
|
|
1757
|
+
function $ac571292d606f30b$var$_checkPrivateRedeclaration(obj, privateCollection) {
|
|
1758
|
+
if (privateCollection.has(obj)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
1759
|
+
}
|
|
1760
|
+
function $ac571292d606f30b$var$_classPrivateMethodGet(receiver, privateSet, fn) {
|
|
1761
|
+
if (!privateSet.has(receiver)) throw new TypeError("attempted to get private field on non-instance");
|
|
1762
|
+
return fn;
|
|
1763
|
+
}
|
|
1764
|
+
var $ac571292d606f30b$var$_throwing_on_navigation = /*#__PURE__*/new WeakSet();
|
|
1765
|
+
var $ac571292d606f30b$var$_get_navigation_happened_promise = /*#__PURE__*/new WeakSet();
|
|
1766
|
+
class $ac571292d606f30b$export$7e1297a3a19f10d8 {
|
|
1767
|
+
/**
|
|
1768
|
+
* Function that will be called when we want to navigate, or a string saying it's not an SPA. You can change this OTG
|
|
1769
|
+
*/ /**
|
|
1770
|
+
* We store listing_id in history.state and do operate on this both here and in js-ui, this is the key to be used which js-ui provides
|
|
1771
|
+
*/ /**
|
|
1772
|
+
* Vue has async router that needs to be awaited (it navigates after a microtask)
|
|
1773
|
+
* This standardises waiting for all kinds of routers
|
|
1774
|
+
*/
|
|
1775
|
+
constructor(on_navigation, listing_query_state_key) {
|
|
1776
|
+
$ac571292d606f30b$var$_classPrivateMethodInitSpec(this, $ac571292d606f30b$var$_get_navigation_happened_promise);
|
|
1777
|
+
$ac571292d606f30b$var$_classPrivateMethodInitSpec(this, $ac571292d606f30b$var$_throwing_on_navigation);
|
|
1778
|
+
$8tj43$babelruntimehelpersdefineProperty(this, "on_navigation_", void 0);
|
|
1779
|
+
$8tj43$babelruntimehelpersdefineProperty(this, "listing_query_state_key", void 0);
|
|
1780
|
+
$8tj43$babelruntimehelpersdefineProperty(this, "navigate_", {
|
|
1781
|
+
/**
|
|
1782
|
+
* Call this if you *just* want to replace the state object in history.state
|
|
1783
|
+
*/
|
|
1784
|
+
replace_state_: new_state => {
|
|
1785
|
+
var _globalThis$history;
|
|
1786
|
+
// This doesn't break any router, so we just do this directly for now, since many don't expose an interface for changing the state
|
|
1787
|
+
globalThis === null || globalThis === void 0 || (_globalThis$history = globalThis.history) === null || _globalThis$history === void 0 || _globalThis$history.replaceState(new_state, "");
|
|
1788
|
+
},
|
|
1789
|
+
/**
|
|
1790
|
+
* Call this to change the URL
|
|
1791
|
+
* @param new_url_ new URL to go to
|
|
1792
|
+
* @param event_ event if you have this in a click handler, will not do anything on cmd/ctrl or non-left click then
|
|
1793
|
+
* @param force_spa_navigation_ if you want to force SPA navigation even if on_navigation_ is set to "hard_navigation". You should only set this to true for inter-SDK-page navigations
|
|
1794
|
+
* @param is_replace_ if you want to replace the current URL in history instead of pushing a new one
|
|
1795
|
+
* @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
|
|
1796
|
+
*/
|
|
1797
|
+
go_to_: $8tj43$catchify(async _ref => {
|
|
1798
|
+
let {
|
|
1799
|
+
new_url_: raw_new_url,
|
|
1800
|
+
event_: event_,
|
|
1801
|
+
force_spa_navigation_: force_spa_navigation_,
|
|
1802
|
+
is_replace_: is_replace_,
|
|
1803
|
+
listing_query_: listing_query_,
|
|
1804
|
+
scroll = true
|
|
1805
|
+
} = _ref;
|
|
1806
|
+
const new_url_ = raw_new_url instanceof URL ? raw_new_url : new URL(raw_new_url, location.origin);
|
|
1807
|
+
const wants_hard_navigation = this.on_navigation_ === "hard_navigation";
|
|
1808
|
+
if ($9b35d1384e31813a$export$29d28dadc2d6b631(event_)) return;
|
|
1809
|
+
const different_origin = new_url_.origin !== location.origin;
|
|
1810
|
+
if (wants_hard_navigation && (!force_spa_navigation_ || different_origin)) {
|
|
1811
|
+
if (force_spa_navigation_ && different_origin)
|
|
1812
|
+
// If we call history.pushState on a different origin, it will throw an error, so fallback to hard navigations
|
|
1813
|
+
$8tj43$dwarn("Can't single page navigate to", new_url_.href, "due to different origin, this MIGHT mean you should fix the URLs");
|
|
1814
|
+
if (!event_)
|
|
1815
|
+
// If we haven't gotten an event, nothing will happen by not calling prevent default, so we need to change the URL
|
|
1816
|
+
location.assign(new_url_);
|
|
1817
|
+
return;
|
|
1818
|
+
}
|
|
1819
|
+
event_ === null || event_ === void 0 || event_.preventDefault();
|
|
1820
|
+
const promise = $ac571292d606f30b$var$_classPrivateMethodGet(this, $ac571292d606f30b$var$_get_navigation_happened_promise, $ac571292d606f30b$var$_get_navigation_happened_promise2).call(this, true);
|
|
1821
|
+
if (force_spa_navigation_ && wants_hard_navigation) {
|
|
1822
|
+
// Don't allow hard navigation if we're forcing SPA navigation, which we do for things where PageReplacer can be used for performance
|
|
1823
|
+
const new_state = history.state;
|
|
1824
|
+
if (listing_query_) {
|
|
1825
|
+
// In JS-UI we need to know the listing_id of the current category, therefore push it into state
|
|
1826
|
+
if (!this.listing_query_state_key) $8tj43$report(new Error("listing_query_state_key is not set"), "error");
|
|
1827
|
+
new_state[this.listing_query_state_key] = listing_query_;
|
|
1828
|
+
}
|
|
1829
|
+
history[is_replace_ ? "replaceState" : "pushState"](new_state, "", new_url_);
|
|
1830
|
+
} else $ac571292d606f30b$var$_classPrivateMethodGet(this, $ac571292d606f30b$var$_throwing_on_navigation, $ac571292d606f30b$var$_throwing_on_navigation2).call(this, {
|
|
1831
|
+
is_replace: is_replace_,
|
|
1832
|
+
new_url: new_url_ instanceof URL ? new_url_ : new URL(new_url_, location.origin),
|
|
1833
|
+
scroll: scroll
|
|
1834
|
+
});
|
|
1835
|
+
await promise;
|
|
1836
|
+
})
|
|
1837
|
+
});
|
|
1838
|
+
this.listing_query_state_key = listing_query_state_key;
|
|
1839
|
+
this.on_navigation_ = on_navigation;
|
|
1840
|
+
}
|
|
1841
|
+
}
|
|
1842
|
+
function $ac571292d606f30b$var$_throwing_on_navigation2() {
|
|
1843
|
+
const {
|
|
1844
|
+
on_navigation_: on_navigation_
|
|
1845
|
+
} = this;
|
|
1846
|
+
if (typeof on_navigation_ !== "function") throw new Error("on_navigation_ is not a function");
|
|
1847
|
+
// make sure that we don't accidentally catchify if the SDK consumer has fucked up
|
|
1848
|
+
try {
|
|
1849
|
+
return on_navigation_(...arguments);
|
|
1850
|
+
} catch (e) {
|
|
1851
|
+
queueMicrotask(() => {
|
|
1852
|
+
throw e;
|
|
1853
|
+
});
|
|
1854
|
+
}
|
|
1855
|
+
}
|
|
1856
|
+
function $ac571292d606f30b$var$_get_navigation_happened_promise2(is_replace) {
|
|
1857
|
+
return new Promise(resolve => {
|
|
1858
|
+
const handler = what_happened => {
|
|
1859
|
+
if (what_happened === (is_replace ? "replaceState" : "pushState")) {
|
|
1860
|
+
resolve();
|
|
1861
|
+
(0, $8tj43$instant_exec_on_suspect_history_change).delete(handler);
|
|
1862
|
+
}
|
|
1863
|
+
};
|
|
1864
|
+
(0, $8tj43$instant_exec_on_suspect_history_change).add(handler);
|
|
1865
|
+
});
|
|
1866
|
+
}
|
|
1683
1867
|
var $cee56a95f722f55f$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<div class="depict recommendations looks"style=--animation-duration:240ms>`);
|
|
1684
1868
|
let $cee56a95f722f55f$var$expandedLooksSignal_;
|
|
1685
1869
|
function $cee56a95f722f55f$export$1935e6bdfc5ed8ce(props) {
|
|
@@ -1688,6 +1872,7 @@ function $cee56a95f722f55f$export$1935e6bdfc5ed8ce(props) {
|
|
|
1688
1872
|
equals: false
|
|
1689
1873
|
}));
|
|
1690
1874
|
const expandingAnimationDuration = 240;
|
|
1875
|
+
const pseudoRouter = new (0, $ac571292d606f30b$export$7e1297a3a19f10d8)("hard_navigation");
|
|
1691
1876
|
const grid_spacing_override = $8tj43$createMemo(() => {
|
|
1692
1877
|
const {
|
|
1693
1878
|
gridSpacing_: gridSpacing_
|
|
@@ -1715,21 +1900,37 @@ function $cee56a95f722f55f$export$1935e6bdfc5ed8ce(props) {
|
|
|
1715
1900
|
});
|
|
1716
1901
|
const decoded = await (response === null || response === void 0 ? void 0 : (_json = (_ref2 = response).json) === null || _json === void 0 ? void 0 : _json.call(_ref2).catch(() => false));
|
|
1717
1902
|
if (!decoded)
|
|
1718
|
-
// If network fails, make sure to return empty array
|
|
1903
|
+
// If network fails, make sure to return empty array and SolidRecommendationSlider will remove its elements
|
|
1719
1904
|
return [];
|
|
1720
|
-
|
|
1905
|
+
const {
|
|
1906
|
+
listings: listings
|
|
1907
|
+
} = decoded;
|
|
1908
|
+
const baseData = {
|
|
1909
|
+
merchant: merchant,
|
|
1910
|
+
market: market,
|
|
1911
|
+
locale: locale
|
|
1912
|
+
};
|
|
1913
|
+
return $cee56a95f722f55f$var$runDisplayTransformersForLooks(baseData, listings, props.displayTransformers_);
|
|
1914
|
+
});
|
|
1915
|
+
$8tj43$createEffect(() => {
|
|
1916
|
+
const {
|
|
1917
|
+
onNavigation_: onNavigation_
|
|
1918
|
+
} = props;
|
|
1919
|
+
if (onNavigation_) pseudoRouter.on_navigation_ = onNavigation_;
|
|
1721
1920
|
});
|
|
1722
1921
|
return (() => {
|
|
1723
1922
|
var _el$ = $8tj43$getNextElement($cee56a95f722f55f$var$_tmpl$);
|
|
1724
1923
|
$8tj43$insert(_el$, $8tj43$createComponent((0, $5441862cd2f5e111$export$e68cff63f76bd15b), {
|
|
1725
1924
|
get children() {
|
|
1726
1925
|
return $39ddb986053fb759$export$d41d19e89346fa2({
|
|
1727
|
-
product_card_template_:
|
|
1926
|
+
product_card_template_: display => $697d8713dc82b9ab$export$44809a8a3e867e30({
|
|
1728
1927
|
display_: display,
|
|
1729
1928
|
FavoriteButton_: props.FavoriteButton_,
|
|
1730
1929
|
placeholderImageAspectRatio_: props.imagePlaceholderAspectRatio_,
|
|
1731
1930
|
animationDuration_: expandingAnimationDuration,
|
|
1732
|
-
expandedLooksSignal_: $cee56a95f722f55f$var$expandedLooksSignal_
|
|
1931
|
+
expandedLooksSignal_: $cee56a95f722f55f$var$expandedLooksSignal_,
|
|
1932
|
+
priceFormatting_: () => props.priceFormatting_,
|
|
1933
|
+
pseudoRouter_: pseudoRouter
|
|
1733
1934
|
}),
|
|
1734
1935
|
recommendations_resource_: looksResource,
|
|
1735
1936
|
title_: () => props.title_,
|
|
@@ -1744,6 +1945,58 @@ function $cee56a95f722f55f$export$1935e6bdfc5ed8ce(props) {
|
|
|
1744
1945
|
})();
|
|
1745
1946
|
}, "LookSlider failed");
|
|
1746
1947
|
}
|
|
1948
|
+
async function $cee56a95f722f55f$var$runDisplayTransformersForLooks(baseData, listings, displayTransformers) {
|
|
1949
|
+
try {
|
|
1950
|
+
const {
|
|
1951
|
+
products: productTransformer,
|
|
1952
|
+
categories: providedListingTransformer
|
|
1953
|
+
} = displayTransformers || {};
|
|
1954
|
+
if (!productTransformer && !providedListingTransformer) return listings;
|
|
1955
|
+
const listingTransformer = providedListingTransformer || (_ref3 => {
|
|
1956
|
+
let {
|
|
1957
|
+
data: data
|
|
1958
|
+
} = _ref3;
|
|
1959
|
+
return data;
|
|
1960
|
+
});
|
|
1961
|
+
const displaysToTransform = [];
|
|
1962
|
+
const displayIdsPerListingId = {};
|
|
1963
|
+
const transformedListingsPromise = listingTransformer({
|
|
1964
|
+
...baseData,
|
|
1965
|
+
data: listings.map(_ref4 => {
|
|
1966
|
+
let {
|
|
1967
|
+
displays: displays,
|
|
1968
|
+
...listing
|
|
1969
|
+
} = _ref4;
|
|
1970
|
+
// Populate our displays by id and displayIdToListings object in the .map where we add ancestors to the listings, for peak efficiency
|
|
1971
|
+
for (let i = 0; i < displays.length; i++) {
|
|
1972
|
+
var _listing$listing_id;
|
|
1973
|
+
const display = displays[i];
|
|
1974
|
+
const uniqueIdOfDisplay = $6a4c7ed6d005505c$export$548d053aba053d79(display);
|
|
1975
|
+
displaysToTransform.push(display);
|
|
1976
|
+
(displayIdsPerListingId[_listing$listing_id = listing.listing_id] || (displayIdsPerListingId[_listing$listing_id] = [])).push(uniqueIdOfDisplay);
|
|
1977
|
+
}
|
|
1978
|
+
return {
|
|
1979
|
+
...listing,
|
|
1980
|
+
ancestors: []
|
|
1981
|
+
};
|
|
1982
|
+
})
|
|
1983
|
+
});
|
|
1984
|
+
// This allows the person providing the displayTransformer to re-order and remove displays
|
|
1985
|
+
const transformedProducts = productTransformer ? await productTransformer({
|
|
1986
|
+
...baseData,
|
|
1987
|
+
displays: displaysToTransform
|
|
1988
|
+
}) : displaysToTransform;
|
|
1989
|
+
const transformedListings = await transformedListingsPromise;
|
|
1990
|
+
const transformedDisplayById = Object.fromEntries(transformedProducts.map(display => [$6a4c7ed6d005505c$export$548d053aba053d79(display), display]));
|
|
1991
|
+
return transformedListings.map(listing => $8tj43$mergeProps(listing, {
|
|
1992
|
+
// use mergeProps because in preview browser we add getters in this object, that would be called too early otherwise
|
|
1993
|
+
displays: (displayIdsPerListingId[listing.listing_id] || []).map(displayId => transformedDisplayById[displayId]).filter(v => v)
|
|
1994
|
+
}));
|
|
1995
|
+
} catch (e) {
|
|
1996
|
+
$8tj43$dwarn("Displaytransformers threw", e);
|
|
1997
|
+
return [];
|
|
1998
|
+
}
|
|
1999
|
+
}
|
|
1747
2000
|
const $68e6625c8d51f847$export$3064e1e8c6513da3 = new Set();
|
|
1748
2001
|
let $68e6625c8d51f847$var$has_ran = false;
|
|
1749
2002
|
function $68e6625c8d51f847$export$5162a71f252e6122() {
|
|
@@ -1785,15 +2038,6 @@ function $68e6625c8d51f847$var$starts_with_any_prefix(key) {
|
|
|
1785
2038
|
}
|
|
1786
2039
|
}
|
|
1787
2040
|
|
|
1788
|
-
/**
|
|
1789
|
-
* This function is used to determine if the user is trying to open a link in a new tab or window, and we therefore should not single page navigate
|
|
1790
|
-
* @param clickEvent The click event that triggered the navigation
|
|
1791
|
-
*/
|
|
1792
|
-
function $9b35d1384e31813a$export$29d28dadc2d6b631(clickEvent) {
|
|
1793
|
-
return (clickEvent === null || clickEvent === void 0 ? void 0 : clickEvent.button) || (clickEvent === null || clickEvent === void 0 ? void 0 : clickEvent.metaKey) || (clickEvent === null || clickEvent === void 0 ? void 0 : clickEvent.ctrlKey) || (clickEvent === null || clickEvent === void 0 ? void 0 : clickEvent.shiftKey // if true, shift button on windows, linux or macOS which opens in a new window
|
|
1794
|
-
);
|
|
1795
|
-
}
|
|
1796
|
-
|
|
1797
2041
|
/**
|
|
1798
2042
|
* Symbol used to identify the version of a SearchModal function. Values right now: 1 = 1st gen classic modal, 2 = second gen modal
|
|
1799
2043
|
*/
|
|
@@ -1834,12 +2078,6 @@ function $01c33966d9ddb108$export$f50b88e2a00918b5(fn) {
|
|
|
1834
2078
|
}
|
|
1835
2079
|
};
|
|
1836
2080
|
}
|
|
1837
|
-
function $60ec7a29849d81db$export$a71e92cfbb498adc(props) {
|
|
1838
|
-
return $8tj43$createMemo(() => {
|
|
1839
|
-
const price_formatting = props.price_formatting_;
|
|
1840
|
-
return $8tj43$standard_price_format(props.price_, price_formatting.places_after_comma_, price_formatting.decimal_places_delimiter_, price_formatting.thousands_delimiter_);
|
|
1841
|
-
});
|
|
1842
|
-
}
|
|
1843
2081
|
function $d0883254246d3eb6$export$fb40a80c530e5f2b(selectedIndex, groupIndex, indexInGroup) {
|
|
1844
2082
|
const isSelected = $8tj43$createMemo(() => {
|
|
1845
2083
|
const selectedValue = selectedIndex();
|
|
@@ -3277,7 +3515,7 @@ function $584c06c09cf4609d$export$b94867ecbd698f21(_ref) {
|
|
|
3277
3515
|
$8tj43$insert(_el$5, $8tj43$createComponent((0, $9783d437ad61594c$export$3b621d86b1566b2), {}));
|
|
3278
3516
|
var _ref$2 = submit_button_ref_;
|
|
3279
3517
|
typeof _ref$2 === "function" ? $8tj43$use(_ref$2, _el$6) : submit_button_ref_ = _el$6;
|
|
3280
|
-
$8tj43$spread(_el$6, $8tj43$
|
|
3518
|
+
$8tj43$spread(_el$6, $8tj43$mergeProps1({
|
|
3281
3519
|
get onClick() {
|
|
3282
3520
|
return $8tj43$catchify(() => submit_query_());
|
|
3283
3521
|
}
|
|
@@ -3934,7 +4172,7 @@ function $26db6925469636a4$export$67152d26d4f56ee8(_ref) {
|
|
|
3934
4172
|
}); // <- could be made reactive getter created in displayTransformers, read it in memo here since it might create computations (for example in the preview-brower), and there's no owner in the onClick handler
|
|
3935
4173
|
const LinkToListing = props => (() => {
|
|
3936
4174
|
var _el$ = $8tj43$getNextElement($26db6925469636a4$var$_tmpl$);
|
|
3937
|
-
$8tj43$spread(_el$, $8tj43$
|
|
4175
|
+
$8tj43$spread(_el$, $8tj43$mergeProps1(props, {
|
|
3938
4176
|
get href() {
|
|
3939
4177
|
return href();
|
|
3940
4178
|
},
|
|
@@ -4350,7 +4588,7 @@ function $4acc866f8fdfc002$export$af1fb307bbba2417(_ref) {
|
|
|
4350
4588
|
$8tj43$createComputed($8tj43$on(search_field_value_[0], () => !suggestions_updating_blocked() && set_selected_index(undefined), {
|
|
4351
4589
|
defer: true
|
|
4352
4590
|
})); // reset autocomplete position if query changes
|
|
4353
|
-
return [$8tj43$createComponent((0, $5175a47d13b7c228$export$d4994a86c6235f72), $8tj43$
|
|
4591
|
+
return [$8tj43$createComponent((0, $5175a47d13b7c228$export$d4994a86c6235f72), $8tj43$mergeProps1(sharedSuggestionProps, {
|
|
4354
4592
|
get title_() {
|
|
4355
4593
|
return i18n_.popular_;
|
|
4356
4594
|
},
|
|
@@ -4360,7 +4598,7 @@ function $4acc866f8fdfc002$export$af1fb307bbba2417(_ref) {
|
|
|
4360
4598
|
return itemIndexes_.suggestionsIndex_;
|
|
4361
4599
|
},
|
|
4362
4600
|
showPlaceholders_: () => showPlaceholders() || noResults_() && !noResultsPopularSuggestions.latest
|
|
4363
|
-
})), $8tj43$createComponent((0, $5175a47d13b7c228$export$d4994a86c6235f72), $8tj43$
|
|
4601
|
+
})), $8tj43$createComponent((0, $5175a47d13b7c228$export$d4994a86c6235f72), $8tj43$mergeProps1(sharedSuggestionProps, {
|
|
4364
4602
|
get title_() {
|
|
4365
4603
|
return i18n_.previous_;
|
|
4366
4604
|
},
|
|
@@ -4377,7 +4615,7 @@ function $4acc866f8fdfc002$export$af1fb307bbba2417(_ref) {
|
|
|
4377
4615
|
return _el$;
|
|
4378
4616
|
})(),
|
|
4379
4617
|
showPlaceholders_: () => false
|
|
4380
|
-
})), $8tj43$createComponent((0, $5175a47d13b7c228$export$d4994a86c6235f72), $8tj43$
|
|
4618
|
+
})), $8tj43$createComponent((0, $5175a47d13b7c228$export$d4994a86c6235f72), $8tj43$mergeProps1(sharedSuggestionProps, {
|
|
4381
4619
|
get title_() {
|
|
4382
4620
|
return i18n_.content_;
|
|
4383
4621
|
},
|
|
@@ -4913,7 +5151,7 @@ function $6a439680ae7e9ba3$export$b2539bed5023c21c(props) {
|
|
|
4913
5151
|
return $8tj43$createComponent($6a439680ae7e9ba3$var$TabsContext.Provider, {
|
|
4914
5152
|
value: new (0, $8tj43$ListenableSet)(),
|
|
4915
5153
|
get children() {
|
|
4916
|
-
return $8tj43$createComponent($6a439680ae7e9ba3$var$ActualTabs, $8tj43$
|
|
5154
|
+
return $8tj43$createComponent($6a439680ae7e9ba3$var$ActualTabs, $8tj43$mergeProps1(props, {
|
|
4917
5155
|
get children() {
|
|
4918
5156
|
return props.children;
|
|
4919
5157
|
}
|
|
@@ -4943,7 +5181,7 @@ function $6a439680ae7e9ba3$var$ActualTabs(props) {
|
|
|
4943
5181
|
},
|
|
4944
5182
|
children: item => {
|
|
4945
5183
|
const weSelected = $8tj43$createMemo(() => isSelected(item().id));
|
|
4946
|
-
return $8tj43$createComponent((0, $8tj43$Dynamic), $8tj43$
|
|
5184
|
+
return $8tj43$createComponent((0, $8tj43$Dynamic), $8tj43$mergeProps1({
|
|
4947
5185
|
get component() {
|
|
4948
5186
|
return props.AnchorComponent;
|
|
4949
5187
|
},
|
|
@@ -5054,7 +5292,7 @@ function $6a439680ae7e9ba3$export$3e41faf802a29e71(props) {
|
|
|
5054
5292
|
if (!currentTabs) throw new Error("Tab must be a child of Tabs");
|
|
5055
5293
|
const id = $8tj43$createUniqueId();
|
|
5056
5294
|
const ourSet = currentTabs;
|
|
5057
|
-
const extendedProps = $8tj43$
|
|
5295
|
+
const extendedProps = $8tj43$mergeProps({
|
|
5058
5296
|
id: id
|
|
5059
5297
|
}, props);
|
|
5060
5298
|
ourSet.add(extendedProps);
|
|
@@ -5174,120 +5412,6 @@ function $972f6bce0f9d61be$var$history_state_change(signals, entries, state) {
|
|
|
5174
5412
|
}
|
|
5175
5413
|
});
|
|
5176
5414
|
}
|
|
5177
|
-
function $ac571292d606f30b$var$_classPrivateMethodInitSpec(obj, privateSet) {
|
|
5178
|
-
$ac571292d606f30b$var$_checkPrivateRedeclaration(obj, privateSet);
|
|
5179
|
-
privateSet.add(obj);
|
|
5180
|
-
}
|
|
5181
|
-
function $ac571292d606f30b$var$_checkPrivateRedeclaration(obj, privateCollection) {
|
|
5182
|
-
if (privateCollection.has(obj)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
5183
|
-
}
|
|
5184
|
-
function $ac571292d606f30b$var$_classPrivateMethodGet(receiver, privateSet, fn) {
|
|
5185
|
-
if (!privateSet.has(receiver)) throw new TypeError("attempted to get private field on non-instance");
|
|
5186
|
-
return fn;
|
|
5187
|
-
}
|
|
5188
|
-
var $ac571292d606f30b$var$_throwing_on_navigation = /*#__PURE__*/new WeakSet();
|
|
5189
|
-
var $ac571292d606f30b$var$_get_navigation_happened_promise = /*#__PURE__*/new WeakSet();
|
|
5190
|
-
class $ac571292d606f30b$export$7e1297a3a19f10d8 {
|
|
5191
|
-
/**
|
|
5192
|
-
* Function that will be called when we want to navigate, or a string saying it's not an SPA. You can change this OTG
|
|
5193
|
-
*/ /**
|
|
5194
|
-
* We store listing_id in history.state and do operate on this both here and in js-ui, this is the key to be used which js-ui provides
|
|
5195
|
-
*/ /**
|
|
5196
|
-
* Vue has async router that needs to be awaited (it navigates after a microtask)
|
|
5197
|
-
* This standardises waiting for all kinds of routers
|
|
5198
|
-
*/
|
|
5199
|
-
constructor(on_navigation, listing_query_state_key) {
|
|
5200
|
-
$ac571292d606f30b$var$_classPrivateMethodInitSpec(this, $ac571292d606f30b$var$_get_navigation_happened_promise);
|
|
5201
|
-
$ac571292d606f30b$var$_classPrivateMethodInitSpec(this, $ac571292d606f30b$var$_throwing_on_navigation);
|
|
5202
|
-
$8tj43$babelruntimehelpersdefineProperty(this, "on_navigation_", void 0);
|
|
5203
|
-
$8tj43$babelruntimehelpersdefineProperty(this, "listing_query_state_key", void 0);
|
|
5204
|
-
$8tj43$babelruntimehelpersdefineProperty(this, "navigate_", {
|
|
5205
|
-
/**
|
|
5206
|
-
* Call this if you *just* want to replace the state object in history.state
|
|
5207
|
-
*/
|
|
5208
|
-
replace_state_: new_state => {
|
|
5209
|
-
var _globalThis$history;
|
|
5210
|
-
// This doesn't break any router, so we just do this directly for now, since many don't expose an interface for changing the state
|
|
5211
|
-
globalThis === null || globalThis === void 0 || (_globalThis$history = globalThis.history) === null || _globalThis$history === void 0 || _globalThis$history.replaceState(new_state, "");
|
|
5212
|
-
},
|
|
5213
|
-
/**
|
|
5214
|
-
* Call this to change the URL
|
|
5215
|
-
* @param new_url_ new URL to go to
|
|
5216
|
-
* @param event_ event if you have this in a click handler, will not do anything on cmd/ctrl or non-left click then
|
|
5217
|
-
* @param force_spa_navigation_ if you want to force SPA navigation even if on_navigation_ is set to "hard_navigation". You should only set this to true for inter-SDK-page navigations
|
|
5218
|
-
* @param is_replace_ if you want to replace the current URL in history instead of pushing a new one
|
|
5219
|
-
* @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
|
|
5220
|
-
*/
|
|
5221
|
-
go_to_: $8tj43$catchify(async _ref => {
|
|
5222
|
-
let {
|
|
5223
|
-
new_url_: raw_new_url,
|
|
5224
|
-
event_: event_,
|
|
5225
|
-
force_spa_navigation_: force_spa_navigation_,
|
|
5226
|
-
is_replace_: is_replace_,
|
|
5227
|
-
listing_query_: listing_query_,
|
|
5228
|
-
scroll = true
|
|
5229
|
-
} = _ref;
|
|
5230
|
-
const new_url_ = raw_new_url instanceof URL ? raw_new_url : new URL(raw_new_url, location.origin);
|
|
5231
|
-
const wants_hard_navigation = this.on_navigation_ === "hard_navigation";
|
|
5232
|
-
if ($9b35d1384e31813a$export$29d28dadc2d6b631(event_)) return;
|
|
5233
|
-
const different_origin = new_url_.origin !== location.origin;
|
|
5234
|
-
if (wants_hard_navigation && (!force_spa_navigation_ || different_origin)) {
|
|
5235
|
-
if (force_spa_navigation_ && different_origin)
|
|
5236
|
-
// If we call history.pushState on a different origin, it will throw an error, so fallback to hard navigations
|
|
5237
|
-
$8tj43$dwarn("Can't single page navigate to", new_url_.href, "due to different origin, this MIGHT mean you should fix the URLs");
|
|
5238
|
-
if (!event_)
|
|
5239
|
-
// If we haven't gotten an event, nothing will happen by not calling prevent default, so we need to change the URL
|
|
5240
|
-
location.assign(new_url_);
|
|
5241
|
-
return;
|
|
5242
|
-
}
|
|
5243
|
-
event_ === null || event_ === void 0 || event_.preventDefault();
|
|
5244
|
-
const promise = $ac571292d606f30b$var$_classPrivateMethodGet(this, $ac571292d606f30b$var$_get_navigation_happened_promise, $ac571292d606f30b$var$_get_navigation_happened_promise2).call(this, true);
|
|
5245
|
-
if (force_spa_navigation_ && wants_hard_navigation) {
|
|
5246
|
-
// Don't allow hard navigation if we're forcing SPA navigation, which we do for things where PageReplacer can be used for performance
|
|
5247
|
-
const new_state = history.state;
|
|
5248
|
-
if (listing_query_) {
|
|
5249
|
-
// In JS-UI we need to know the listing_id of the current category, therefore push it into state
|
|
5250
|
-
if (!this.listing_query_state_key) $8tj43$report(new Error("listing_query_state_key is not set"), "error");
|
|
5251
|
-
new_state[this.listing_query_state_key] = listing_query_;
|
|
5252
|
-
}
|
|
5253
|
-
history[is_replace_ ? "replaceState" : "pushState"](new_state, "", new_url_);
|
|
5254
|
-
} else $ac571292d606f30b$var$_classPrivateMethodGet(this, $ac571292d606f30b$var$_throwing_on_navigation, $ac571292d606f30b$var$_throwing_on_navigation2).call(this, {
|
|
5255
|
-
is_replace: is_replace_,
|
|
5256
|
-
new_url: new_url_ instanceof URL ? new_url_ : new URL(new_url_, location.origin),
|
|
5257
|
-
scroll: scroll
|
|
5258
|
-
});
|
|
5259
|
-
await promise;
|
|
5260
|
-
})
|
|
5261
|
-
});
|
|
5262
|
-
this.listing_query_state_key = listing_query_state_key;
|
|
5263
|
-
this.on_navigation_ = on_navigation;
|
|
5264
|
-
}
|
|
5265
|
-
}
|
|
5266
|
-
function $ac571292d606f30b$var$_throwing_on_navigation2() {
|
|
5267
|
-
const {
|
|
5268
|
-
on_navigation_: on_navigation_
|
|
5269
|
-
} = this;
|
|
5270
|
-
if (typeof on_navigation_ !== "function") throw new Error("on_navigation_ is not a function");
|
|
5271
|
-
// make sure that we don't accidentally catchify if the SDK consumer has fucked up
|
|
5272
|
-
try {
|
|
5273
|
-
return on_navigation_(...arguments);
|
|
5274
|
-
} catch (e) {
|
|
5275
|
-
queueMicrotask(() => {
|
|
5276
|
-
throw e;
|
|
5277
|
-
});
|
|
5278
|
-
}
|
|
5279
|
-
}
|
|
5280
|
-
function $ac571292d606f30b$var$_get_navigation_happened_promise2(is_replace) {
|
|
5281
|
-
return new Promise(resolve => {
|
|
5282
|
-
const handler = what_happened => {
|
|
5283
|
-
if (what_happened === (is_replace ? "replaceState" : "pushState")) {
|
|
5284
|
-
resolve();
|
|
5285
|
-
(0, $8tj43$instant_exec_on_suspect_history_change).delete(handler);
|
|
5286
|
-
}
|
|
5287
|
-
};
|
|
5288
|
-
(0, $8tj43$instant_exec_on_suspect_history_change).add(handler);
|
|
5289
|
-
});
|
|
5290
|
-
}
|
|
5291
5415
|
var $b652875d5a5139ec$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<div class=image-container>`);
|
|
5292
5416
|
function $b652875d5a5139ec$export$41e1a079d40a0d58(props) {
|
|
5293
5417
|
const [display] = $8tj43$createResource(() => ({
|
|
@@ -5410,7 +5534,7 @@ function $e3efeb558d952696$export$7da560f849543dff(_ref) {
|
|
|
5410
5534
|
_el$5 = _el$4.nextSibling,
|
|
5411
5535
|
[_el$6, _co$2] = $8tj43$getNextMarker(_el$5.nextSibling);
|
|
5412
5536
|
$8tj43$insert(_el$2, (0, $ca55612a53dbbdd2$export$a2cc176055f8f08), _el$4, _co$);
|
|
5413
|
-
$8tj43$insert(_el$2, $8tj43$createComponent((0, $63f1f8dbcd07d3b0$export$d21e32dfedac04be), $8tj43$
|
|
5537
|
+
$8tj43$insert(_el$2, $8tj43$createComponent((0, $63f1f8dbcd07d3b0$export$d21e32dfedac04be), $8tj43$mergeProps1({
|
|
5414
5538
|
get rows() {
|
|
5415
5539
|
return rows_object_();
|
|
5416
5540
|
},
|
|
@@ -5799,7 +5923,7 @@ function $6b0fd8fd20df8ccf$var$ActualShopTheLookButton(props) {
|
|
|
5799
5923
|
const displayStyleValue = $8tj43$createMemo(() => hasAnythingToShow() ? "" : "none");
|
|
5800
5924
|
const button = (() => {
|
|
5801
5925
|
var _el$2 = $8tj43$getNextElement($6b0fd8fd20df8ccf$var$_tmpl$2);
|
|
5802
|
-
$8tj43$spread(_el$2, $8tj43$
|
|
5926
|
+
$8tj43$spread(_el$2, $8tj43$mergeProps1(() => localProps.buttonAttributes), false, true);
|
|
5803
5927
|
$8tj43$insert(_el$2, () => {
|
|
5804
5928
|
var _localProps$buttonAtt;
|
|
5805
5929
|
return (localProps === null || localProps === void 0 ? void 0 : (_localProps$buttonAtt = localProps.buttonAttributes) === null || _localProps$buttonAtt === void 0 ? void 0 : _localProps$buttonAtt.children) || "Shop the look";
|
|
@@ -5809,7 +5933,7 @@ function $6b0fd8fd20df8ccf$var$ActualShopTheLookButton(props) {
|
|
|
5809
5933
|
})();
|
|
5810
5934
|
$8tj43$createEffect(() => button.style.display = displayStyleValue()); // Set our attributes like this, so we allow total control over the button from the outside via buttonAttributes
|
|
5811
5935
|
$8tj43$createEffect(() => !hasAnythingToShow() && closeModal()); // close modal if we ever get into the state of having it open and not having anything to show
|
|
5812
|
-
$6b0fd8fd20df8ccf$var$modalProps = $8tj43$
|
|
5936
|
+
$6b0fd8fd20df8ccf$var$modalProps = $8tj43$mergeProps(partForModal, {
|
|
5813
5937
|
products_to_shop_: products_to_shop_
|
|
5814
5938
|
});
|
|
5815
5939
|
button.addEventListener("click", openModal);
|
|
@@ -6571,7 +6695,7 @@ var $ff3225aef892a467$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<svg><path d="M
|
|
|
6571
6695
|
function $ff3225aef892a467$export$f21ab0717a89c77f(props) {
|
|
6572
6696
|
return (() => {
|
|
6573
6697
|
var _el$ = $8tj43$getNextElement($ff3225aef892a467$var$_tmpl$);
|
|
6574
|
-
$8tj43$spread(_el$, $8tj43$
|
|
6698
|
+
$8tj43$spread(_el$, $8tj43$mergeProps1(props, {
|
|
6575
6699
|
"xmlns": "http://www.w3.org/2000/svg",
|
|
6576
6700
|
"width": "11",
|
|
6577
6701
|
"height": "12"
|
|
@@ -8156,7 +8280,7 @@ const $830ea8efda59884e$export$414f6a19d38e655c = _ref => {
|
|
|
8156
8280
|
[_el$6, _co$] = $8tj43$getNextMarker(_el$5.nextSibling),
|
|
8157
8281
|
_el$7 = _el$6.nextSibling,
|
|
8158
8282
|
[_el$8, _co$2] = $8tj43$getNextMarker(_el$7.nextSibling);
|
|
8159
|
-
$8tj43$spread(_el$2, $8tj43$
|
|
8283
|
+
$8tj43$spread(_el$2, $8tj43$mergeProps1(attributes, {
|
|
8160
8284
|
get disabled() {
|
|
8161
8285
|
return $8tj43$memo(() => !!count_zero())() && !is_selected();
|
|
8162
8286
|
},
|
|
@@ -9793,7 +9917,7 @@ async function $284849364a6ef73a$var$_run_url_creator_for_suggest2(merchant, mar
|
|
|
9793
9917
|
// Filter out our transformed ancestors
|
|
9794
9918
|
const transformedAncestors = Object.fromEntries(transformerResult.filter(item => item.is_suggestion === false).map(item => [item.listing_id, item]));
|
|
9795
9919
|
// Add the now transformed ancestors into the ancestors of the listing suggestions
|
|
9796
|
-
const transformedSuggestions = transformerResult.filter(item => item.is_suggestion !== false).map(item => $8tj43$
|
|
9920
|
+
const transformedSuggestions = transformerResult.filter(item => item.is_suggestion !== false).map(item => $8tj43$mergeProps(item, {
|
|
9797
9921
|
// Use mergeProps instead of spread since page_url and other properties could be a getter that solid components should call
|
|
9798
9922
|
ancestors: item.ancestors.map(ancestor => {
|
|
9799
9923
|
const newAncestor = transformedAncestors[ancestor.listing_id];
|
|
@@ -10329,7 +10453,7 @@ function $8ef6232475d44150$export$7de92c4c2205ebf3(_ref) {
|
|
|
10329
10453
|
[_el$6, _co$2] = $8tj43$getNextMarker(_el$5.nextSibling);
|
|
10330
10454
|
$8tj43$insert(_el$2, () => i18n_.search_recs_title_());
|
|
10331
10455
|
$8tj43$insert(_el$, (0, $ca55612a53dbbdd2$export$a2cc176055f8f08), _el$4, _co$);
|
|
10332
|
-
$8tj43$insert(_el$, $8tj43$createComponent((0, $63f1f8dbcd07d3b0$export$d21e32dfedac04be), $8tj43$
|
|
10456
|
+
$8tj43$insert(_el$, $8tj43$createComponent((0, $63f1f8dbcd07d3b0$export$d21e32dfedac04be), $8tj43$mergeProps1({
|
|
10333
10457
|
rows: rows_object,
|
|
10334
10458
|
layout: "grid",
|
|
10335
10459
|
element_attributes: {
|
|
@@ -11093,7 +11217,7 @@ function $64d94dcaa058dc7b$export$ab6b147eec64fea5(props) {
|
|
|
11093
11217
|
const container_class = "x" + $8tj43$createUniqueId();
|
|
11094
11218
|
const container_element_ = (() => {
|
|
11095
11219
|
var _el$ = $8tj43$getNextElement($64d94dcaa058dc7b$var$_tmpl$);
|
|
11096
|
-
$8tj43$spread(_el$, $8tj43$
|
|
11220
|
+
$8tj43$spread(_el$, $8tj43$mergeProps1(() => props.element_attributes, {
|
|
11097
11221
|
"classList": {
|
|
11098
11222
|
[container_class]: true
|
|
11099
11223
|
}
|
|
@@ -11388,7 +11512,7 @@ function $ff7feae4dddd6073$var$wrap_blocks_in_div(rendered_content_blocks, max_s
|
|
|
11388
11512
|
return _el$;
|
|
11389
11513
|
}
|
|
11390
11514
|
});
|
|
11391
|
-
return $8tj43$
|
|
11515
|
+
return $8tj43$mergeProps(block, {
|
|
11392
11516
|
// Create content divs for the blocks with as much fine-grained diffing as possible?
|
|
11393
11517
|
content: () => {
|
|
11394
11518
|
// Sneaky on-demand rendering, so we don't render more blocks than we can show: we have the rendered value here and don't return a function that renders because if our block would be moved around we'd be guaranteed to re-render
|
|
@@ -11636,7 +11760,7 @@ function $7faea0096f14b59b$export$3925f87b1545cfc6(_ref) {
|
|
|
11636
11760
|
} = slider;
|
|
11637
11761
|
const Layout = props => $63f1f8dbcd07d3b0$export$445d8d3f5f706a40(props, insert_here, true);
|
|
11638
11762
|
// Do like this, so we don't have to call mergeProps ourselves
|
|
11639
|
-
$8tj43$createComponent(Layout, $8tj43$
|
|
11763
|
+
$8tj43$createComponent(Layout, $8tj43$mergeProps1(layout_options_, {
|
|
11640
11764
|
rows: "all",
|
|
11641
11765
|
get cols_at_size() {
|
|
11642
11766
|
return modified_cols_at_size();
|
|
@@ -12165,7 +12289,7 @@ function $082c4ed3e22f8d71$export$9bf11afa910f536e(_ref) {
|
|
|
12165
12289
|
get children() {
|
|
12166
12290
|
return (() => {
|
|
12167
12291
|
var _el$34 = $8tj43$getNextElement($082c4ed3e22f8d71$var$_tmpl$5);
|
|
12168
|
-
$8tj43$insert(_el$34, $8tj43$createComponent((0, $f6b0500577e1b210$export$3f1a388cc0d8fed7), $8tj43$
|
|
12292
|
+
$8tj43$insert(_el$34, $8tj43$createComponent((0, $f6b0500577e1b210$export$3f1a388cc0d8fed7), $8tj43$mergeProps1(args_for_filtering_, {
|
|
12169
12293
|
are_in_modal_: true
|
|
12170
12294
|
})));
|
|
12171
12295
|
return _el$34;
|
|
@@ -12978,7 +13102,7 @@ function $22470de5f42cc35d$export$f631859cab12b342(_ref) {
|
|
|
12978
13102
|
[_el$8, _co$] = $8tj43$getNextMarker(_el$7.nextSibling),
|
|
12979
13103
|
_el$9 = _el$8.nextSibling,
|
|
12980
13104
|
[_el$10, _co$2] = $8tj43$getNextMarker(_el$9.nextSibling);
|
|
12981
|
-
$8tj43$insert(_el$4, $8tj43$createComponent(LinkIfPossible, $8tj43$
|
|
13105
|
+
$8tj43$insert(_el$4, $8tj43$createComponent(LinkIfPossible, $8tj43$mergeProps1(make_link_attributes, {
|
|
12982
13106
|
tabIndex: "-1",
|
|
12983
13107
|
get children() {
|
|
12984
13108
|
return $8tj43$createComponent((0, $3c5e15c6ee4227a9$export$605674723bcc715c), {
|
|
@@ -12987,7 +13111,7 @@ function $22470de5f42cc35d$export$f631859cab12b342(_ref) {
|
|
|
12987
13111
|
});
|
|
12988
13112
|
}
|
|
12989
13113
|
})));
|
|
12990
|
-
$8tj43$insert(_el$5, $8tj43$createComponent(LinkIfPossible, $8tj43$
|
|
13114
|
+
$8tj43$insert(_el$5, $8tj43$createComponent(LinkIfPossible, $8tj43$mergeProps1({
|
|
12991
13115
|
"class": "content-title line-clamp"
|
|
12992
13116
|
}, make_link_attributes, {
|
|
12993
13117
|
get title() {
|
|
@@ -13153,7 +13277,7 @@ function $d53ebed6f63304e4$export$6d0c9c22f6652669(_ref) {
|
|
|
13153
13277
|
},
|
|
13154
13278
|
number_of_results_: num_results
|
|
13155
13279
|
}), _el$3, _co$);
|
|
13156
|
-
$8tj43$insert(_el$, $8tj43$createComponent((0, $63f1f8dbcd07d3b0$export$d21e32dfedac04be), $8tj43$
|
|
13280
|
+
$8tj43$insert(_el$, $8tj43$createComponent((0, $63f1f8dbcd07d3b0$export$d21e32dfedac04be), $8tj43$mergeProps1({
|
|
13157
13281
|
layout: "grid",
|
|
13158
13282
|
element_attributes: {
|
|
13159
13283
|
class: "cards"
|
|
@@ -13564,7 +13688,7 @@ function $da279c5a540c6846$export$a54ec244c8863715(_ref) {
|
|
|
13564
13688
|
var _search_results_4, _search_results_4$con;
|
|
13565
13689
|
return ((_search_results_4 = search_results_()) !== null && _search_results_4 !== void 0 && (_search_results_4$con = _search_results_4.content_search_links) !== null && _search_results_4$con !== void 0 && _search_results_4$con.length ? i18n_.no_products_ : i18n_.no_results_text_)();
|
|
13566
13690
|
});
|
|
13567
|
-
const results_for = $8tj43$createComponent((0, $69602b3d8fd54c38$export$9dd50d35b9d94fdf), $8tj43$
|
|
13691
|
+
const results_for = $8tj43$createComponent((0, $69602b3d8fd54c38$export$9dd50d35b9d94fdf), $8tj43$mergeProps1({
|
|
13568
13692
|
get type() {
|
|
13569
13693
|
return (0, $69602b3d8fd54c38$export$2452208c79fe93ea).products;
|
|
13570
13694
|
},
|
|
@@ -15705,7 +15829,7 @@ function $4b4b262708b516ee$var$add_us_to_crumbs(plp_meta) {
|
|
|
15705
15829
|
var _plp_meta3;
|
|
15706
15830
|
const api_value = (_plp_meta3 = plp_meta()) === null || _plp_meta3 === void 0 ? void 0 : _plp_meta3.breadcrumbs;
|
|
15707
15831
|
if (!api_value) return api_value;
|
|
15708
|
-
return [...api_value, $8tj43$
|
|
15832
|
+
return [...api_value, $8tj43$mergeProps(plp_meta(), {
|
|
15709
15833
|
get page_url() {
|
|
15710
15834
|
return href_accessor();
|
|
15711
15835
|
}
|