@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/server/ES10/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var $3hooq$depictaiutilishared = require("@depict-ai/utilishared/ES10");
|
|
2
2
|
var $3hooq$solidjsweb = require("solid-js/web");
|
|
3
3
|
var $3hooq$solidjs = require("solid-js");
|
|
4
|
-
var $3hooq$depictaiutilisharedlatest = require("@depict-ai/utilishared/ES10");
|
|
5
4
|
var $3hooq$babelruntimehelpersdefineProperty = require("@babel/runtime/helpers/defineProperty");
|
|
5
|
+
var $3hooq$depictaiutilisharedlatest = require("@depict-ai/utilishared/ES10");
|
|
6
6
|
var $3hooq$babelruntimehelpersclassPrivateFieldSet = require("@babel/runtime/helpers/classPrivateFieldSet");
|
|
7
7
|
var $3hooq$babelruntimehelpersclassPrivateFieldGet = require("@babel/runtime/helpers/classPrivateFieldGet");
|
|
8
8
|
var $3hooq$solidjsstore = require("solid-js/store");
|
|
@@ -100,7 +100,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $335c02c1241a9ca8$export$5b7
|
|
|
100
100
|
$parcel$export(module.exports, "QuickLinks", () => $335c02c1241a9ca8$export$de035477d6fef996);
|
|
101
101
|
$parcel$export(module.exports, "CategoryPage", () => $c10e33c4681f8c9b$export$e2bf8ce7779e827e);
|
|
102
102
|
/*! Depict.ai search and product listing SDK */
|
|
103
|
-
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.3.
|
|
103
|
+
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.3.3";
|
|
104
104
|
const $5401a6698b0c0658$var$transform_elements = sorted_cols_at_size => {
|
|
105
105
|
const cols_at_size = [];
|
|
106
106
|
for (let i = 0; i < sorted_cols_at_size.length; i++) {
|
|
@@ -1009,7 +1009,7 @@ function $858fdcf73148519f$export$6e5611bc7e57e477(props) {
|
|
|
1009
1009
|
});
|
|
1010
1010
|
// Work around https://github.com/solidjs/solid/issues/1828
|
|
1011
1011
|
const img = new Image(); // Need to use new Image or browser might not start loading image before it's in the DOM
|
|
1012
|
-
const [, otherAttributes] = $3hooq$solidjs.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 <-
|
|
1012
|
+
const [, otherAttributes] = $3hooq$solidjs.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 <-
|
|
1013
1013
|
]);
|
|
1014
1014
|
|
|
1015
1015
|
const [hasSetSize, setHasSetSize] = $3hooq$solidjs.createSignal(false);
|
|
@@ -1065,13 +1065,18 @@ function $858fdcf73148519f$export$6e5611bc7e57e477(props) {
|
|
|
1065
1065
|
let hasDecodedFastPath = false;
|
|
1066
1066
|
let timeoutSet = false;
|
|
1067
1067
|
let gotCleanedUp = false;
|
|
1068
|
+
let srcJustChanged = true;
|
|
1068
1069
|
img.classList.add("s-responsive-image");
|
|
1069
1070
|
if (listingContext) {
|
|
1070
1071
|
let prevValue;
|
|
1071
1072
|
const aspectRatios = listingContext[$858fdcf73148519f$export$f8945274f08a3105] || (listingContext[$858fdcf73148519f$export$f8945274f08a3105] = new Set());
|
|
1072
1073
|
const [, setMostPrevalentAspectRatio] = listingContext[$858fdcf73148519f$export$6066eb417ed2e9f7] || (listingContext[$858fdcf73148519f$export$6066eb417ed2e9f7] = $3hooq$solidjs.createSignal());
|
|
1073
1074
|
img.addEventListener("load", $3hooq$depictaiutilishared.catchify(() => {
|
|
1074
|
-
|
|
1075
|
+
if (props.keyRatioUpdating) {
|
|
1076
|
+
if (!srcJustChanged) return;
|
|
1077
|
+
srcJustChanged = false;
|
|
1078
|
+
}
|
|
1079
|
+
// 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
|
|
1075
1080
|
const aspectRatio_ = img.naturalWidth / img.naturalHeight;
|
|
1076
1081
|
if (prevValue) aspectRatios.delete(prevValue);
|
|
1077
1082
|
const newValue = !isNaN(aspectRatio_) ? {
|
|
@@ -1093,6 +1098,10 @@ function $858fdcf73148519f$export$6e5611bc7e57e477(props) {
|
|
|
1093
1098
|
}
|
|
1094
1099
|
$3hooq$solidjs.onCleanup(() => gotCleanedUp = true);
|
|
1095
1100
|
$3hooq$solidjsweb.spread(img, $3hooq$solidjs.mergeProps(modifiedOtherAttributes), false, true);
|
|
1101
|
+
$3hooq$solidjs.createRenderEffect(() => {
|
|
1102
|
+
props.src;
|
|
1103
|
+
srcJustChanged = true;
|
|
1104
|
+
});
|
|
1096
1105
|
$3hooq$solidjs.createEffect(() => {
|
|
1097
1106
|
if (!props.size()) return; // wait until we have a size, run every time the size changes
|
|
1098
1107
|
if (timeoutSet) return;
|
|
@@ -1160,48 +1169,22 @@ function $28535bb7671c63d1$export$e4b984597b71e989(props) {
|
|
|
1160
1169
|
context[$28535bb7671c63d1$export$d7b7ab832c20e2f4] = $3hooq$solidjs.createSignal();
|
|
1161
1170
|
const [currentImageSize, setCurrentImageSize] = (context === null || context === void 0 ? void 0 : context[$28535bb7671c63d1$export$d7b7ab832c20e2f4]) || $28535bb7671c63d1$var$backupSizeSignal; // use global fallback signal (might lead to blurry images) if no context is available
|
|
1162
1171
|
const [mostPrevalentAspectRatio] = context ? context[(0, $858fdcf73148519f$export$6066eb417ed2e9f7)] || (context[(0, $858fdcf73148519f$export$6066eb417ed2e9f7)] = $3hooq$solidjs.createSignal()) : [];
|
|
1163
|
-
const [aspectRatio, setAspectRatio] = $3hooq$solidjs.createSignal($3hooq$solidjs.untrack(() => props.aspectRatio));
|
|
1164
1172
|
const container = $ce467edb5343cfcd$export$94026ee33dbabc26({
|
|
1165
1173
|
// Write getters manually instead of using JSX, so we can do more complex logic in the aspectRatio getter without increasing bundle size
|
|
1166
1174
|
get class() {
|
|
1167
1175
|
return props.class;
|
|
1168
1176
|
},
|
|
1169
1177
|
get aspectRatio() {
|
|
1170
|
-
|
|
1178
|
+
if (props.autoAdjustAspectRatio) {
|
|
1179
|
+
const targetRatio = mostPrevalentAspectRatio === null || mostPrevalentAspectRatio === void 0 ? void 0 : mostPrevalentAspectRatio();
|
|
1180
|
+
if (targetRatio != undefined) return "var(".concat((0, $c0cf6af094336798$export$8a2234b5b1a5ebd4), ", ").concat(targetRatio, ")");
|
|
1181
|
+
}
|
|
1182
|
+
return props.aspectRatio;
|
|
1171
1183
|
}
|
|
1172
1184
|
});
|
|
1173
1185
|
const owner = $3hooq$solidjs.getOwner();
|
|
1174
1186
|
let createdSizeAccessor = false;
|
|
1175
1187
|
let wasCleanedUp = false;
|
|
1176
|
-
let timeout;
|
|
1177
|
-
$3hooq$solidjs.createEffect(() => {
|
|
1178
|
-
const {
|
|
1179
|
-
autoAdjustAspectRatio: autoAdjustAspectRatio
|
|
1180
|
-
} = props;
|
|
1181
|
-
if (autoAdjustAspectRatio) {
|
|
1182
|
-
const targetRatio = mostPrevalentAspectRatio === null || mostPrevalentAspectRatio === void 0 ? void 0 : mostPrevalentAspectRatio();
|
|
1183
|
-
if (targetRatio != undefined) {
|
|
1184
|
-
const targetValue = "var(".concat((0, $c0cf6af094336798$export$8a2234b5b1a5ebd4), ", ").concat(targetRatio, ")");
|
|
1185
|
-
const updateAspectRatio = $3hooq$depictaiutilishared.catchify(() => setAspectRatio(targetValue));
|
|
1186
|
-
if (autoAdjustAspectRatio === "smoothed") {
|
|
1187
|
-
if (!timeout)
|
|
1188
|
-
// 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).
|
|
1189
|
-
updateAspectRatio();
|
|
1190
|
-
clearTimeout(timeout);
|
|
1191
|
-
timeout = setTimeout(() => {
|
|
1192
|
-
timeout = undefined;
|
|
1193
|
-
updateAspectRatio();
|
|
1194
|
-
}, 500);
|
|
1195
|
-
return;
|
|
1196
|
-
}
|
|
1197
|
-
return updateAspectRatio();
|
|
1198
|
-
}
|
|
1199
|
-
} else {
|
|
1200
|
-
clearTimeout(timeout);
|
|
1201
|
-
timeout = undefined;
|
|
1202
|
-
}
|
|
1203
|
-
setAspectRatio(props.aspectRatio);
|
|
1204
|
-
});
|
|
1205
1188
|
$3hooq$solidjs.createEffect(() => {
|
|
1206
1189
|
if (currentImageSize() || wasCleanedUp) return; // We get into the effect when onCleanup is called if we don't have wasCleanedUp
|
|
1207
1190
|
// ensure we always have a size accessor
|
|
@@ -1251,6 +1234,12 @@ function $f3db423dc84bc35d$export$9d4a4b669b1929ab(props) {
|
|
|
1251
1234
|
}
|
|
1252
1235
|
}));
|
|
1253
1236
|
}
|
|
1237
|
+
function $f38f2e64ebe2da86$export$a71e92cfbb498adc(props) {
|
|
1238
|
+
return $3hooq$solidjs.createMemo(() => {
|
|
1239
|
+
const price_formatting = props.price_formatting_;
|
|
1240
|
+
return $3hooq$depictaiutilishared.standard_price_format(props.price_, price_formatting.places_after_comma_, price_formatting.decimal_places_delimiter_, price_formatting.thousands_delimiter_);
|
|
1241
|
+
});
|
|
1242
|
+
}
|
|
1254
1243
|
var $d66c35b5a6d6d926$var$_tmpl$ = ["<div", ' class="img-wrapper">', "</div>"],
|
|
1255
1244
|
$d66c35b5a6d6d926$var$_tmpl$2 = ["<span", ' class="d-price original">', "</span>"],
|
|
1256
1245
|
$d66c35b5a6d6d926$var$_tmpl$3 = ["<div", ' class="right-part"><div class="text-container"><span class="d-title line-clamp">', '</span><span class="', '">', "</span><!--$-->", "<!--/--></div><!--$-->", "<!--/--></div>"];
|
|
@@ -1258,10 +1247,12 @@ function $d66c35b5a6d6d926$export$b73ed90f0ee50dc3(_ref) {
|
|
|
1258
1247
|
let {
|
|
1259
1248
|
display_: display_,
|
|
1260
1249
|
FavoriteButton_: FavoriteButton_,
|
|
1261
|
-
|
|
1250
|
+
userWantsExpandedSignal_: [userWantsExpanded, setUserWantsExpanded],
|
|
1262
1251
|
textFadeInAnimationRunning_: textFadeInAnimationRunning_,
|
|
1263
1252
|
outerRef_: outerRef_,
|
|
1264
|
-
animationDuration_: animationDuration_
|
|
1253
|
+
animationDuration_: animationDuration_,
|
|
1254
|
+
priceFormatting_: priceFormatting_,
|
|
1255
|
+
pseudoRouter_: pseudoRouter_
|
|
1265
1256
|
} = _ref;
|
|
1266
1257
|
const variantToUse = $3hooq$solidjs.createMemo(() => {
|
|
1267
1258
|
const display = display_();
|
|
@@ -1272,7 +1263,7 @@ function $d66c35b5a6d6d926$export$b73ed90f0ee50dc3(_ref) {
|
|
|
1272
1263
|
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];
|
|
1273
1264
|
});
|
|
1274
1265
|
const [animationIsRunning, setAnimationIsRunning] = textFadeInAnimationRunning_;
|
|
1275
|
-
const [isExpandedThrottledByOurEffectRun, setIsExpandedThrottledByOurEffectRun] = $3hooq$solidjs.createSignal($3hooq$solidjs.untrack(
|
|
1266
|
+
const [isExpandedThrottledByOurEffectRun, setIsExpandedThrottledByOurEffectRun] = $3hooq$solidjs.createSignal($3hooq$solidjs.untrack(userWantsExpanded));
|
|
1276
1267
|
const [animationEffectExists, setAnimationEffectExists] = $3hooq$solidjs.createSignal(false);
|
|
1277
1268
|
const [salePrice] = $3hooq$solidjs.createResource(() => {
|
|
1278
1269
|
var _variantToUse2;
|
|
@@ -1282,16 +1273,18 @@ function $d66c35b5a6d6d926$export$b73ed90f0ee50dc3(_ref) {
|
|
|
1282
1273
|
var _variantToUse3;
|
|
1283
1274
|
return (_variantToUse3 = variantToUse()) === null || _variantToUse3 === void 0 ? void 0 : _variantToUse3.original_price;
|
|
1284
1275
|
});
|
|
1285
|
-
const isOnSale = $3hooq$solidjs.createMemo(() => salePrice.latest !== originalPrice.latest); // .latest doesn't trigger suspense
|
|
1276
|
+
const isOnSale = $3hooq$solidjs.createMemo(() => !salePrice.loading && !originalPrice.loading && salePrice.latest !== originalPrice.latest); // .latest doesn't trigger suspense after the initial load
|
|
1277
|
+
const enableLink = $3hooq$solidjs.createMemo(() => userWantsExpanded() && !animationIsRunning());
|
|
1278
|
+
const href = $3hooq$solidjs.createMemo(() => {
|
|
1279
|
+
var _variantToUse4;
|
|
1280
|
+
return (_variantToUse4 = variantToUse()) === null || _variantToUse4 === void 0 ? void 0 : _variantToUse4.page_url;
|
|
1281
|
+
});
|
|
1286
1282
|
const FavoriteButton = FavoriteButton_; // Just to get rid of the type error - TS doesn't understand <Show>
|
|
1287
1283
|
return $3hooq$solidjsweb.ssrElement("a", $3hooq$solidjsweb.mergeProps({
|
|
1288
1284
|
"class": "look-item"
|
|
1289
|
-
}, () => {
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
href: (_variantToUse4 = variantToUse()) === null || _variantToUse4 === void 0 ? void 0 : _variantToUse4.page_url
|
|
1293
|
-
} : {};
|
|
1294
|
-
}), () => ["<!--$-->", $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
|
|
1285
|
+
}, () => enableLink() ? {
|
|
1286
|
+
href: href()
|
|
1287
|
+
} : {}), () => ["<!--$-->", $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
|
|
1295
1288
|
when: imageUrl,
|
|
1296
1289
|
get fallback() {
|
|
1297
1290
|
return $3hooq$solidjsweb.createComponent((0, $b8a8d61b3ec5f5ac$export$3f37af283f8fb843), {
|
|
@@ -1314,10 +1307,13 @@ function $d66c35b5a6d6d926$export$b73ed90f0ee50dc3(_ref) {
|
|
|
1314
1307
|
return imageUrl();
|
|
1315
1308
|
},
|
|
1316
1309
|
get aspectRatio() {
|
|
1317
|
-
return
|
|
1310
|
+
return userWantsExpanded() ? 0.75 : 1;
|
|
1318
1311
|
},
|
|
1319
1312
|
get autoAdjustAspectRatio() {
|
|
1320
|
-
return
|
|
1313
|
+
return userWantsExpanded();
|
|
1314
|
+
},
|
|
1315
|
+
imgProps: {
|
|
1316
|
+
keyRatioUpdating: true
|
|
1321
1317
|
}
|
|
1322
1318
|
});
|
|
1323
1319
|
}
|
|
@@ -1325,25 +1321,73 @@ function $d66c35b5a6d6d926$export$b73ed90f0ee50dc3(_ref) {
|
|
|
1325
1321
|
}
|
|
1326
1322
|
})), "<!--/-->", "<!--$-->", $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
|
|
1327
1323
|
get when() {
|
|
1328
|
-
return (animationEffectExists() ? isExpandedThrottledByOurEffectRun() :
|
|
1324
|
+
return (animationEffectExists() ? isExpandedThrottledByOurEffectRun() : userWantsExpanded()) || animationIsRunning();
|
|
1329
1325
|
},
|
|
1330
1326
|
get children() {
|
|
1331
1327
|
var _$escape2, _variantToUse5;
|
|
1332
1328
|
return $3hooq$solidjsweb.ssr($d66c35b5a6d6d926$var$_tmpl$3, $3hooq$solidjsweb.ssrHydrationKey(), (_$escape2 = $3hooq$solidjsweb.escape((_variantToUse5 = variantToUse()) === null || _variantToUse5 === void 0 ? void 0 : _variantToUse5.title)) !== null && _$escape2 !== void 0 ? _$escape2 : $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $a7f7d416e6f61504$export$89c6019e4baa40b1), {
|
|
1333
1329
|
height: "1em",
|
|
1334
1330
|
width: "20ch"
|
|
1335
|
-
})), "d-price ".concat(isOnSale() ? "sale" : ""),
|
|
1336
|
-
height: "1em",
|
|
1337
|
-
width: "20ch"
|
|
1338
|
-
})) : $3hooq$solidjsweb.escape(salePrice()), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
|
|
1331
|
+
})), "d-price ".concat(isOnSale() ? "sale" : ""), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
|
|
1339
1332
|
get when() {
|
|
1340
|
-
return
|
|
1333
|
+
return variantToUse() && !salePrice.loading;
|
|
1341
1334
|
},
|
|
1342
|
-
get
|
|
1343
|
-
return $3hooq$solidjsweb.
|
|
1335
|
+
get fallback() {
|
|
1336
|
+
return $3hooq$solidjsweb.createComponent((0, $a7f7d416e6f61504$export$89c6019e4baa40b1), {
|
|
1344
1337
|
height: "1em",
|
|
1345
1338
|
width: "20ch"
|
|
1346
|
-
})
|
|
1339
|
+
});
|
|
1340
|
+
},
|
|
1341
|
+
get children() {
|
|
1342
|
+
return $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
|
|
1343
|
+
get when() {
|
|
1344
|
+
return salePrice.latest;
|
|
1345
|
+
},
|
|
1346
|
+
get children() {
|
|
1347
|
+
return [priceFormatting_().pre_, $3hooq$solidjsweb.createComponent((0, $f38f2e64ebe2da86$export$a71e92cfbb498adc), {
|
|
1348
|
+
get price_() {
|
|
1349
|
+
return salePrice();
|
|
1350
|
+
},
|
|
1351
|
+
get price_formatting_() {
|
|
1352
|
+
return priceFormatting_();
|
|
1353
|
+
}
|
|
1354
|
+
}), priceFormatting_().post_];
|
|
1355
|
+
}
|
|
1356
|
+
});
|
|
1357
|
+
}
|
|
1358
|
+
})), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
|
|
1359
|
+
get when() {
|
|
1360
|
+
return isOnSale();
|
|
1361
|
+
},
|
|
1362
|
+
get children() {
|
|
1363
|
+
return $3hooq$solidjsweb.ssr($d66c35b5a6d6d926$var$_tmpl$2, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
|
|
1364
|
+
get when() {
|
|
1365
|
+
return variantToUse() && !originalPrice.loading;
|
|
1366
|
+
},
|
|
1367
|
+
get fallback() {
|
|
1368
|
+
return $3hooq$solidjsweb.createComponent((0, $a7f7d416e6f61504$export$89c6019e4baa40b1), {
|
|
1369
|
+
height: "1em",
|
|
1370
|
+
width: "20ch"
|
|
1371
|
+
});
|
|
1372
|
+
},
|
|
1373
|
+
get children() {
|
|
1374
|
+
return $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
|
|
1375
|
+
get when() {
|
|
1376
|
+
return salePrice.latest;
|
|
1377
|
+
},
|
|
1378
|
+
get children() {
|
|
1379
|
+
return [priceFormatting_().pre_, $3hooq$solidjsweb.createComponent((0, $f38f2e64ebe2da86$export$a71e92cfbb498adc), {
|
|
1380
|
+
get price_() {
|
|
1381
|
+
return originalPrice();
|
|
1382
|
+
},
|
|
1383
|
+
get price_formatting_() {
|
|
1384
|
+
return priceFormatting_();
|
|
1385
|
+
}
|
|
1386
|
+
}), priceFormatting_().post_];
|
|
1387
|
+
}
|
|
1388
|
+
});
|
|
1389
|
+
}
|
|
1390
|
+
})));
|
|
1347
1391
|
}
|
|
1348
1392
|
})), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
|
|
1349
1393
|
when: FavoriteButton_,
|
|
@@ -1411,10 +1455,12 @@ function $e0b3f1f332b6863b$export$ebf0b1d4f90c09ae(_ref) {
|
|
|
1411
1455
|
let {
|
|
1412
1456
|
displays_: displays_,
|
|
1413
1457
|
FavoriteButton_: FavoriteButton_,
|
|
1414
|
-
userWantsExpandedSignal_:
|
|
1458
|
+
userWantsExpandedSignal_: userWantsExpandedSignal_,
|
|
1415
1459
|
containerWidth_: containerWidth_,
|
|
1416
1460
|
animationDuration_: animationDuration_,
|
|
1417
|
-
supportsHover_: supportsHover_
|
|
1461
|
+
supportsHover_: supportsHover_,
|
|
1462
|
+
priceFormatting_: priceFormatting_,
|
|
1463
|
+
pseudoRouter_: pseudoRouter_
|
|
1418
1464
|
} = _ref;
|
|
1419
1465
|
let isAffectedByChromeBug = false;
|
|
1420
1466
|
// If the user requests the drawer to be expanded or not
|
|
@@ -1423,6 +1469,7 @@ function $e0b3f1f332b6863b$export$ebf0b1d4f90c09ae(_ref) {
|
|
|
1423
1469
|
// The following three signals just contain the state if the animations are actually running and should only be set by the respective animation code
|
|
1424
1470
|
const textFadeInAnimationRunning = $3hooq$solidjs.createSignal(false);
|
|
1425
1471
|
const [getSecondPartAnimationRunning] = textFadeInAnimationRunning;
|
|
1472
|
+
const [userWantsExpanded, setUserWantsExpanded] = userWantsExpandedSignal_;
|
|
1426
1473
|
$dfa95866b27a2a53$export$7b9a0e99f0aeb2f3().then(is => isAffectedByChromeBug = is);
|
|
1427
1474
|
return $3hooq$solidjsweb.createComponent((0, $d067f3a30f047b41$export$e68cff63f76bd15b), {
|
|
1428
1475
|
get children() {
|
|
@@ -1445,11 +1492,13 @@ function $e0b3f1f332b6863b$export$ebf0b1d4f90c09ae(_ref) {
|
|
|
1445
1492
|
},
|
|
1446
1493
|
children: (display, index) => {
|
|
1447
1494
|
return $3hooq$solidjsweb.createComponent((0, $d66c35b5a6d6d926$export$b73ed90f0ee50dc3), {
|
|
1495
|
+
pseudoRouter_: pseudoRouter_,
|
|
1448
1496
|
animationDuration_: animationDuration_,
|
|
1449
1497
|
display_: display,
|
|
1450
1498
|
FavoriteButton_: FavoriteButton_,
|
|
1451
|
-
|
|
1499
|
+
userWantsExpandedSignal_: userWantsExpandedSignal_,
|
|
1452
1500
|
textFadeInAnimationRunning_: textFadeInAnimationRunning,
|
|
1501
|
+
priceFormatting_: priceFormatting_,
|
|
1453
1502
|
outerRef_: el => $3hooq$solidjs.createEffect(() => {
|
|
1454
1503
|
if (index !== 0) return;
|
|
1455
1504
|
const resizeObserver = new ResizeObserver($3hooq$depictaiutilishared.catchify(records => setLookItemHeight(records.at(-1).contentRect.height)));
|
|
@@ -1491,10 +1540,10 @@ function $47e3c3102c78121b$export$44809a8a3e867e30(_ref) {
|
|
|
1491
1540
|
expandedLooksSignal_: [expandedLooks_, setExpandedLooks],
|
|
1492
1541
|
FavoriteButton_: FavoriteButton_,
|
|
1493
1542
|
placeholderImageAspectRatio_: placeholderImageAspectRatio_,
|
|
1494
|
-
animationDuration_: animationDuration_
|
|
1543
|
+
animationDuration_: animationDuration_,
|
|
1544
|
+
priceFormatting_: priceFormatting_,
|
|
1545
|
+
pseudoRouter_: pseudoRouter_
|
|
1495
1546
|
} = _ref;
|
|
1496
|
-
// TODO: shopify, run displayTransformers to get dynamic prices
|
|
1497
|
-
// TODO: format prices
|
|
1498
1547
|
const [coverImage] = (display_ === null || display_ === void 0 ? void 0 : display_.image_urls) || [];
|
|
1499
1548
|
const useWantsExpandedSignal_ = $3hooq$solidjs.createSignal(false);
|
|
1500
1549
|
const [userWantsExpanded, setUserWantsExpanded] = useWantsExpandedSignal_;
|
|
@@ -1527,7 +1576,7 @@ function $47e3c3102c78121b$export$44809a8a3e867e30(_ref) {
|
|
|
1527
1576
|
when: display_,
|
|
1528
1577
|
get fallback() {
|
|
1529
1578
|
return $3hooq$solidjsweb.createComponent((0, $b8a8d61b3ec5f5ac$export$3f37af283f8fb843), {
|
|
1530
|
-
aspectRatio: placeholderImageAspectRatio_
|
|
1579
|
+
aspectRatio: "var(".concat((0, $c0cf6af094336798$export$8a2234b5b1a5ebd4), ", ").concat(placeholderImageAspectRatio_, ")")
|
|
1531
1580
|
});
|
|
1532
1581
|
},
|
|
1533
1582
|
get children() {
|
|
@@ -1545,10 +1594,136 @@ function $47e3c3102c78121b$export$44809a8a3e867e30(_ref) {
|
|
|
1545
1594
|
containerWidth_: containerWidth_,
|
|
1546
1595
|
animationDuration_: animationDuration_,
|
|
1547
1596
|
supportsHover_: supportsHover_,
|
|
1548
|
-
FavoriteButton_: FavoriteButton_
|
|
1597
|
+
FavoriteButton_: FavoriteButton_,
|
|
1598
|
+
priceFormatting_: priceFormatting_,
|
|
1599
|
+
pseudoRouter_: pseudoRouter_
|
|
1549
1600
|
})]);
|
|
1550
1601
|
return container;
|
|
1551
1602
|
}
|
|
1603
|
+
|
|
1604
|
+
/**
|
|
1605
|
+
* 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
|
|
1606
|
+
* @param clickEvent The click event that triggered the navigation
|
|
1607
|
+
*/
|
|
1608
|
+
function $9ca08bcacbc598ce$export$29d28dadc2d6b631(clickEvent) {
|
|
1609
|
+
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
|
|
1610
|
+
);
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1613
|
+
function $73014ff36186a4dd$var$_classPrivateMethodInitSpec(obj, privateSet) {
|
|
1614
|
+
$73014ff36186a4dd$var$_checkPrivateRedeclaration(obj, privateSet);
|
|
1615
|
+
privateSet.add(obj);
|
|
1616
|
+
}
|
|
1617
|
+
function $73014ff36186a4dd$var$_checkPrivateRedeclaration(obj, privateCollection) {
|
|
1618
|
+
if (privateCollection.has(obj)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
1619
|
+
}
|
|
1620
|
+
function $73014ff36186a4dd$var$_classPrivateMethodGet(receiver, privateSet, fn) {
|
|
1621
|
+
if (!privateSet.has(receiver)) throw new TypeError("attempted to get private field on non-instance");
|
|
1622
|
+
return fn;
|
|
1623
|
+
}
|
|
1624
|
+
var $73014ff36186a4dd$var$_throwing_on_navigation = /*#__PURE__*/new WeakSet();
|
|
1625
|
+
var $73014ff36186a4dd$var$_get_navigation_happened_promise = /*#__PURE__*/new WeakSet();
|
|
1626
|
+
class $73014ff36186a4dd$export$7e1297a3a19f10d8 {
|
|
1627
|
+
/**
|
|
1628
|
+
* Function that will be called when we want to navigate, or a string saying it's not an SPA. You can change this OTG
|
|
1629
|
+
*/ /**
|
|
1630
|
+
* 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
|
|
1631
|
+
*/ /**
|
|
1632
|
+
* Vue has async router that needs to be awaited (it navigates after a microtask)
|
|
1633
|
+
* This standardises waiting for all kinds of routers
|
|
1634
|
+
*/
|
|
1635
|
+
constructor(on_navigation, listing_query_state_key) {
|
|
1636
|
+
$73014ff36186a4dd$var$_classPrivateMethodInitSpec(this, $73014ff36186a4dd$var$_get_navigation_happened_promise);
|
|
1637
|
+
$73014ff36186a4dd$var$_classPrivateMethodInitSpec(this, $73014ff36186a4dd$var$_throwing_on_navigation);
|
|
1638
|
+
$parcel$interopDefault($3hooq$babelruntimehelpersdefineProperty)(this, "on_navigation_", void 0);
|
|
1639
|
+
$parcel$interopDefault($3hooq$babelruntimehelpersdefineProperty)(this, "listing_query_state_key", void 0);
|
|
1640
|
+
$parcel$interopDefault($3hooq$babelruntimehelpersdefineProperty)(this, "navigate_", {
|
|
1641
|
+
/**
|
|
1642
|
+
* Call this if you *just* want to replace the state object in history.state
|
|
1643
|
+
*/
|
|
1644
|
+
replace_state_: new_state => {
|
|
1645
|
+
var _globalThis$history;
|
|
1646
|
+
// 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
|
|
1647
|
+
globalThis === null || globalThis === void 0 || (_globalThis$history = globalThis.history) === null || _globalThis$history === void 0 || _globalThis$history.replaceState(new_state, "");
|
|
1648
|
+
},
|
|
1649
|
+
/**
|
|
1650
|
+
* Call this to change the URL
|
|
1651
|
+
* @param new_url_ new URL to go to
|
|
1652
|
+
* @param event_ event if you have this in a click handler, will not do anything on cmd/ctrl or non-left click then
|
|
1653
|
+
* @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
|
|
1654
|
+
* @param is_replace_ if you want to replace the current URL in history instead of pushing a new one
|
|
1655
|
+
* @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
|
|
1656
|
+
*/
|
|
1657
|
+
go_to_: $3hooq$depictaiutilishared.catchify(async _ref => {
|
|
1658
|
+
let {
|
|
1659
|
+
new_url_: raw_new_url,
|
|
1660
|
+
event_: event_,
|
|
1661
|
+
force_spa_navigation_: force_spa_navigation_,
|
|
1662
|
+
is_replace_: is_replace_,
|
|
1663
|
+
listing_query_: listing_query_,
|
|
1664
|
+
scroll = true
|
|
1665
|
+
} = _ref;
|
|
1666
|
+
const new_url_ = raw_new_url instanceof URL ? raw_new_url : new URL(raw_new_url, location.origin);
|
|
1667
|
+
const wants_hard_navigation = this.on_navigation_ === "hard_navigation";
|
|
1668
|
+
if ($9ca08bcacbc598ce$export$29d28dadc2d6b631(event_)) return;
|
|
1669
|
+
const different_origin = new_url_.origin !== location.origin;
|
|
1670
|
+
if (wants_hard_navigation && (!force_spa_navigation_ || different_origin)) {
|
|
1671
|
+
if (force_spa_navigation_ && different_origin)
|
|
1672
|
+
// If we call history.pushState on a different origin, it will throw an error, so fallback to hard navigations
|
|
1673
|
+
$3hooq$depictaiutilishared.dwarn("Can't single page navigate to", new_url_.href, "due to different origin, this MIGHT mean you should fix the URLs");
|
|
1674
|
+
if (!event_)
|
|
1675
|
+
// If we haven't gotten an event, nothing will happen by not calling prevent default, so we need to change the URL
|
|
1676
|
+
location.assign(new_url_);
|
|
1677
|
+
return;
|
|
1678
|
+
}
|
|
1679
|
+
event_ === null || event_ === void 0 || event_.preventDefault();
|
|
1680
|
+
const promise = $73014ff36186a4dd$var$_classPrivateMethodGet(this, $73014ff36186a4dd$var$_get_navigation_happened_promise, $73014ff36186a4dd$var$_get_navigation_happened_promise2).call(this, true);
|
|
1681
|
+
if (force_spa_navigation_ && wants_hard_navigation) {
|
|
1682
|
+
// Don't allow hard navigation if we're forcing SPA navigation, which we do for things where PageReplacer can be used for performance
|
|
1683
|
+
const new_state = history.state;
|
|
1684
|
+
if (listing_query_) {
|
|
1685
|
+
// In JS-UI we need to know the listing_id of the current category, therefore push it into state
|
|
1686
|
+
if (!this.listing_query_state_key) $3hooq$depictaiutilishared.report(new Error("listing_query_state_key is not set"), "error");
|
|
1687
|
+
new_state[this.listing_query_state_key] = listing_query_;
|
|
1688
|
+
}
|
|
1689
|
+
history[is_replace_ ? "replaceState" : "pushState"](new_state, "", new_url_);
|
|
1690
|
+
} else $73014ff36186a4dd$var$_classPrivateMethodGet(this, $73014ff36186a4dd$var$_throwing_on_navigation, $73014ff36186a4dd$var$_throwing_on_navigation2).call(this, {
|
|
1691
|
+
is_replace: is_replace_,
|
|
1692
|
+
new_url: new_url_ instanceof URL ? new_url_ : new URL(new_url_, location.origin),
|
|
1693
|
+
scroll: scroll
|
|
1694
|
+
});
|
|
1695
|
+
await promise;
|
|
1696
|
+
})
|
|
1697
|
+
});
|
|
1698
|
+
this.listing_query_state_key = listing_query_state_key;
|
|
1699
|
+
this.on_navigation_ = on_navigation;
|
|
1700
|
+
}
|
|
1701
|
+
}
|
|
1702
|
+
function $73014ff36186a4dd$var$_throwing_on_navigation2() {
|
|
1703
|
+
const {
|
|
1704
|
+
on_navigation_: on_navigation_
|
|
1705
|
+
} = this;
|
|
1706
|
+
if (typeof on_navigation_ !== "function") throw new Error("on_navigation_ is not a function");
|
|
1707
|
+
// make sure that we don't accidentally catchify if the SDK consumer has fucked up
|
|
1708
|
+
try {
|
|
1709
|
+
return on_navigation_(...arguments);
|
|
1710
|
+
} catch (e) {
|
|
1711
|
+
queueMicrotask(() => {
|
|
1712
|
+
throw e;
|
|
1713
|
+
});
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
function $73014ff36186a4dd$var$_get_navigation_happened_promise2(is_replace) {
|
|
1717
|
+
return new Promise(resolve => {
|
|
1718
|
+
const handler = what_happened => {
|
|
1719
|
+
if (what_happened === (is_replace ? "replaceState" : "pushState")) {
|
|
1720
|
+
resolve();
|
|
1721
|
+
(0, $3hooq$depictaiutilishared.instant_exec_on_suspect_history_change).delete(handler);
|
|
1722
|
+
}
|
|
1723
|
+
};
|
|
1724
|
+
(0, $3hooq$depictaiutilishared.instant_exec_on_suspect_history_change).add(handler);
|
|
1725
|
+
});
|
|
1726
|
+
}
|
|
1552
1727
|
var $8446f782881fa12e$var$_tmpl$ = ["<div", ' class="depict recommendations looks" style="', '">', "</div>"];
|
|
1553
1728
|
let $8446f782881fa12e$var$expandedLooksSignal_;
|
|
1554
1729
|
function $8446f782881fa12e$export$1935e6bdfc5ed8ce(props) {
|
|
@@ -1557,6 +1732,7 @@ function $8446f782881fa12e$export$1935e6bdfc5ed8ce(props) {
|
|
|
1557
1732
|
equals: false
|
|
1558
1733
|
}));
|
|
1559
1734
|
const expandingAnimationDuration = 240;
|
|
1735
|
+
const pseudoRouter = new (0, $73014ff36186a4dd$export$7e1297a3a19f10d8)("hard_navigation");
|
|
1560
1736
|
const grid_spacing_override = $3hooq$solidjs.createMemo(() => {
|
|
1561
1737
|
const {
|
|
1562
1738
|
gridSpacing_: gridSpacing_
|
|
@@ -1584,19 +1760,35 @@ function $8446f782881fa12e$export$1935e6bdfc5ed8ce(props) {
|
|
|
1584
1760
|
});
|
|
1585
1761
|
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));
|
|
1586
1762
|
if (!decoded)
|
|
1587
|
-
// If network fails, make sure to return empty array
|
|
1763
|
+
// If network fails, make sure to return empty array and SolidRecommendationSlider will remove its elements
|
|
1588
1764
|
return [];
|
|
1589
|
-
|
|
1765
|
+
const {
|
|
1766
|
+
listings: listings
|
|
1767
|
+
} = decoded;
|
|
1768
|
+
const baseData = {
|
|
1769
|
+
merchant: merchant,
|
|
1770
|
+
market: market,
|
|
1771
|
+
locale: locale
|
|
1772
|
+
};
|
|
1773
|
+
return $8446f782881fa12e$var$runDisplayTransformersForLooks(baseData, listings, props.displayTransformers_);
|
|
1774
|
+
});
|
|
1775
|
+
$3hooq$solidjs.createEffect(() => {
|
|
1776
|
+
const {
|
|
1777
|
+
onNavigation_: onNavigation_
|
|
1778
|
+
} = props;
|
|
1779
|
+
if (onNavigation_) pseudoRouter.on_navigation_ = onNavigation_;
|
|
1590
1780
|
});
|
|
1591
1781
|
return $3hooq$solidjsweb.ssr($8446f782881fa12e$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.ssrStyle("--animation-duration: ".concat(expandingAnimationDuration, "ms")), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $d067f3a30f047b41$export$e68cff63f76bd15b), {
|
|
1592
1782
|
get children() {
|
|
1593
1783
|
return $236a257ee52e5414$export$d41d19e89346fa2({
|
|
1594
|
-
product_card_template_:
|
|
1784
|
+
product_card_template_: display => $47e3c3102c78121b$export$44809a8a3e867e30({
|
|
1595
1785
|
display_: display,
|
|
1596
1786
|
FavoriteButton_: props.FavoriteButton_,
|
|
1597
1787
|
placeholderImageAspectRatio_: props.imagePlaceholderAspectRatio_,
|
|
1598
1788
|
animationDuration_: expandingAnimationDuration,
|
|
1599
|
-
expandedLooksSignal_: $8446f782881fa12e$var$expandedLooksSignal_
|
|
1789
|
+
expandedLooksSignal_: $8446f782881fa12e$var$expandedLooksSignal_,
|
|
1790
|
+
priceFormatting_: () => props.priceFormatting_,
|
|
1791
|
+
pseudoRouter_: pseudoRouter
|
|
1600
1792
|
}),
|
|
1601
1793
|
recommendations_resource_: looksResource,
|
|
1602
1794
|
title_: () => props.title_,
|
|
@@ -1609,6 +1801,58 @@ function $8446f782881fa12e$export$1935e6bdfc5ed8ce(props) {
|
|
|
1609
1801
|
})));
|
|
1610
1802
|
}, "LookSlider failed");
|
|
1611
1803
|
}
|
|
1804
|
+
async function $8446f782881fa12e$var$runDisplayTransformersForLooks(baseData, listings, displayTransformers) {
|
|
1805
|
+
try {
|
|
1806
|
+
const {
|
|
1807
|
+
products: productTransformer,
|
|
1808
|
+
categories: providedListingTransformer
|
|
1809
|
+
} = displayTransformers || {};
|
|
1810
|
+
if (!productTransformer && !providedListingTransformer) return listings;
|
|
1811
|
+
const listingTransformer = providedListingTransformer || (_ref3 => {
|
|
1812
|
+
let {
|
|
1813
|
+
data: data
|
|
1814
|
+
} = _ref3;
|
|
1815
|
+
return data;
|
|
1816
|
+
});
|
|
1817
|
+
const displaysToTransform = [];
|
|
1818
|
+
const displayIdsPerListingId = {};
|
|
1819
|
+
const transformedListingsPromise = listingTransformer({
|
|
1820
|
+
...baseData,
|
|
1821
|
+
data: listings.map(_ref4 => {
|
|
1822
|
+
let {
|
|
1823
|
+
displays: displays,
|
|
1824
|
+
...listing
|
|
1825
|
+
} = _ref4;
|
|
1826
|
+
// Populate our displays by id and displayIdToListings object in the .map where we add ancestors to the listings, for peak efficiency
|
|
1827
|
+
for (let i = 0; i < displays.length; i++) {
|
|
1828
|
+
var _listing$listing_id;
|
|
1829
|
+
const display = displays[i];
|
|
1830
|
+
const uniqueIdOfDisplay = $b85edfec41cd3989$export$548d053aba053d79(display);
|
|
1831
|
+
displaysToTransform.push(display);
|
|
1832
|
+
(displayIdsPerListingId[_listing$listing_id = listing.listing_id] || (displayIdsPerListingId[_listing$listing_id] = [])).push(uniqueIdOfDisplay);
|
|
1833
|
+
}
|
|
1834
|
+
return {
|
|
1835
|
+
...listing,
|
|
1836
|
+
ancestors: []
|
|
1837
|
+
};
|
|
1838
|
+
})
|
|
1839
|
+
});
|
|
1840
|
+
// This allows the person providing the displayTransformer to re-order and remove displays
|
|
1841
|
+
const transformedProducts = productTransformer ? await productTransformer({
|
|
1842
|
+
...baseData,
|
|
1843
|
+
displays: displaysToTransform
|
|
1844
|
+
}) : displaysToTransform;
|
|
1845
|
+
const transformedListings = await transformedListingsPromise;
|
|
1846
|
+
const transformedDisplayById = Object.fromEntries(transformedProducts.map(display => [$b85edfec41cd3989$export$548d053aba053d79(display), display]));
|
|
1847
|
+
return transformedListings.map(listing => $3hooq$solidjs.mergeProps(listing, {
|
|
1848
|
+
// use mergeProps because in preview browser we add getters in this object, that would be called too early otherwise
|
|
1849
|
+
displays: (displayIdsPerListingId[listing.listing_id] || []).map(displayId => transformedDisplayById[displayId]).filter(v => v)
|
|
1850
|
+
}));
|
|
1851
|
+
} catch (e) {
|
|
1852
|
+
$3hooq$depictaiutilishared.dwarn("Displaytransformers threw", e);
|
|
1853
|
+
return [];
|
|
1854
|
+
}
|
|
1855
|
+
}
|
|
1612
1856
|
const $cfcd56242923775d$export$3064e1e8c6513da3 = new Set();
|
|
1613
1857
|
let $cfcd56242923775d$var$has_ran = false;
|
|
1614
1858
|
function $cfcd56242923775d$export$5162a71f252e6122() {
|
|
@@ -1650,15 +1894,6 @@ function $cfcd56242923775d$var$starts_with_any_prefix(key) {
|
|
|
1650
1894
|
}
|
|
1651
1895
|
}
|
|
1652
1896
|
|
|
1653
|
-
/**
|
|
1654
|
-
* 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
|
|
1655
|
-
* @param clickEvent The click event that triggered the navigation
|
|
1656
|
-
*/
|
|
1657
|
-
function $9ca08bcacbc598ce$export$29d28dadc2d6b631(clickEvent) {
|
|
1658
|
-
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
|
|
1659
|
-
);
|
|
1660
|
-
}
|
|
1661
|
-
|
|
1662
1897
|
/**
|
|
1663
1898
|
* Symbol used to identify the version of a SearchModal function. Values right now: 1 = 1st gen classic modal, 2 = second gen modal
|
|
1664
1899
|
*/
|
|
@@ -1699,12 +1934,6 @@ function $bdea39a75c454f4f$export$f50b88e2a00918b5(fn) {
|
|
|
1699
1934
|
}
|
|
1700
1935
|
};
|
|
1701
1936
|
}
|
|
1702
|
-
function $f38f2e64ebe2da86$export$a71e92cfbb498adc(props) {
|
|
1703
|
-
return $3hooq$solidjs.createMemo(() => {
|
|
1704
|
-
const price_formatting = props.price_formatting_;
|
|
1705
|
-
return $3hooq$depictaiutilishared.standard_price_format(props.price_, price_formatting.places_after_comma_, price_formatting.decimal_places_delimiter_, price_formatting.thousands_delimiter_);
|
|
1706
|
-
});
|
|
1707
|
-
}
|
|
1708
1937
|
function $b0f8d9f49e018db9$export$fb40a80c530e5f2b(selectedIndex, groupIndex, indexInGroup) {
|
|
1709
1938
|
const isSelected = $3hooq$solidjs.createMemo(() => {
|
|
1710
1939
|
const selectedValue = selectedIndex();
|
|
@@ -4254,120 +4483,6 @@ function $367b536a2a94d24e$var$history_state_change(signals, entries, state) {
|
|
|
4254
4483
|
}
|
|
4255
4484
|
});
|
|
4256
4485
|
}
|
|
4257
|
-
function $73014ff36186a4dd$var$_classPrivateMethodInitSpec(obj, privateSet) {
|
|
4258
|
-
$73014ff36186a4dd$var$_checkPrivateRedeclaration(obj, privateSet);
|
|
4259
|
-
privateSet.add(obj);
|
|
4260
|
-
}
|
|
4261
|
-
function $73014ff36186a4dd$var$_checkPrivateRedeclaration(obj, privateCollection) {
|
|
4262
|
-
if (privateCollection.has(obj)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
4263
|
-
}
|
|
4264
|
-
function $73014ff36186a4dd$var$_classPrivateMethodGet(receiver, privateSet, fn) {
|
|
4265
|
-
if (!privateSet.has(receiver)) throw new TypeError("attempted to get private field on non-instance");
|
|
4266
|
-
return fn;
|
|
4267
|
-
}
|
|
4268
|
-
var $73014ff36186a4dd$var$_throwing_on_navigation = /*#__PURE__*/new WeakSet();
|
|
4269
|
-
var $73014ff36186a4dd$var$_get_navigation_happened_promise = /*#__PURE__*/new WeakSet();
|
|
4270
|
-
class $73014ff36186a4dd$export$7e1297a3a19f10d8 {
|
|
4271
|
-
/**
|
|
4272
|
-
* Function that will be called when we want to navigate, or a string saying it's not an SPA. You can change this OTG
|
|
4273
|
-
*/ /**
|
|
4274
|
-
* 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
|
|
4275
|
-
*/ /**
|
|
4276
|
-
* Vue has async router that needs to be awaited (it navigates after a microtask)
|
|
4277
|
-
* This standardises waiting for all kinds of routers
|
|
4278
|
-
*/
|
|
4279
|
-
constructor(on_navigation, listing_query_state_key) {
|
|
4280
|
-
$73014ff36186a4dd$var$_classPrivateMethodInitSpec(this, $73014ff36186a4dd$var$_get_navigation_happened_promise);
|
|
4281
|
-
$73014ff36186a4dd$var$_classPrivateMethodInitSpec(this, $73014ff36186a4dd$var$_throwing_on_navigation);
|
|
4282
|
-
$parcel$interopDefault($3hooq$babelruntimehelpersdefineProperty)(this, "on_navigation_", void 0);
|
|
4283
|
-
$parcel$interopDefault($3hooq$babelruntimehelpersdefineProperty)(this, "listing_query_state_key", void 0);
|
|
4284
|
-
$parcel$interopDefault($3hooq$babelruntimehelpersdefineProperty)(this, "navigate_", {
|
|
4285
|
-
/**
|
|
4286
|
-
* Call this if you *just* want to replace the state object in history.state
|
|
4287
|
-
*/
|
|
4288
|
-
replace_state_: new_state => {
|
|
4289
|
-
var _globalThis$history;
|
|
4290
|
-
// 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
|
|
4291
|
-
globalThis === null || globalThis === void 0 || (_globalThis$history = globalThis.history) === null || _globalThis$history === void 0 || _globalThis$history.replaceState(new_state, "");
|
|
4292
|
-
},
|
|
4293
|
-
/**
|
|
4294
|
-
* Call this to change the URL
|
|
4295
|
-
* @param new_url_ new URL to go to
|
|
4296
|
-
* @param event_ event if you have this in a click handler, will not do anything on cmd/ctrl or non-left click then
|
|
4297
|
-
* @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
|
|
4298
|
-
* @param is_replace_ if you want to replace the current URL in history instead of pushing a new one
|
|
4299
|
-
* @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
|
|
4300
|
-
*/
|
|
4301
|
-
go_to_: $3hooq$depictaiutilishared.catchify(async _ref => {
|
|
4302
|
-
let {
|
|
4303
|
-
new_url_: raw_new_url,
|
|
4304
|
-
event_: event_,
|
|
4305
|
-
force_spa_navigation_: force_spa_navigation_,
|
|
4306
|
-
is_replace_: is_replace_,
|
|
4307
|
-
listing_query_: listing_query_,
|
|
4308
|
-
scroll = true
|
|
4309
|
-
} = _ref;
|
|
4310
|
-
const new_url_ = raw_new_url instanceof URL ? raw_new_url : new URL(raw_new_url, location.origin);
|
|
4311
|
-
const wants_hard_navigation = this.on_navigation_ === "hard_navigation";
|
|
4312
|
-
if ($9ca08bcacbc598ce$export$29d28dadc2d6b631(event_)) return;
|
|
4313
|
-
const different_origin = new_url_.origin !== location.origin;
|
|
4314
|
-
if (wants_hard_navigation && (!force_spa_navigation_ || different_origin)) {
|
|
4315
|
-
if (force_spa_navigation_ && different_origin)
|
|
4316
|
-
// If we call history.pushState on a different origin, it will throw an error, so fallback to hard navigations
|
|
4317
|
-
$3hooq$depictaiutilishared.dwarn("Can't single page navigate to", new_url_.href, "due to different origin, this MIGHT mean you should fix the URLs");
|
|
4318
|
-
if (!event_)
|
|
4319
|
-
// If we haven't gotten an event, nothing will happen by not calling prevent default, so we need to change the URL
|
|
4320
|
-
location.assign(new_url_);
|
|
4321
|
-
return;
|
|
4322
|
-
}
|
|
4323
|
-
event_ === null || event_ === void 0 || event_.preventDefault();
|
|
4324
|
-
const promise = $73014ff36186a4dd$var$_classPrivateMethodGet(this, $73014ff36186a4dd$var$_get_navigation_happened_promise, $73014ff36186a4dd$var$_get_navigation_happened_promise2).call(this, true);
|
|
4325
|
-
if (force_spa_navigation_ && wants_hard_navigation) {
|
|
4326
|
-
// Don't allow hard navigation if we're forcing SPA navigation, which we do for things where PageReplacer can be used for performance
|
|
4327
|
-
const new_state = history.state;
|
|
4328
|
-
if (listing_query_) {
|
|
4329
|
-
// In JS-UI we need to know the listing_id of the current category, therefore push it into state
|
|
4330
|
-
if (!this.listing_query_state_key) $3hooq$depictaiutilishared.report(new Error("listing_query_state_key is not set"), "error");
|
|
4331
|
-
new_state[this.listing_query_state_key] = listing_query_;
|
|
4332
|
-
}
|
|
4333
|
-
history[is_replace_ ? "replaceState" : "pushState"](new_state, "", new_url_);
|
|
4334
|
-
} else $73014ff36186a4dd$var$_classPrivateMethodGet(this, $73014ff36186a4dd$var$_throwing_on_navigation, $73014ff36186a4dd$var$_throwing_on_navigation2).call(this, {
|
|
4335
|
-
is_replace: is_replace_,
|
|
4336
|
-
new_url: new_url_ instanceof URL ? new_url_ : new URL(new_url_, location.origin),
|
|
4337
|
-
scroll: scroll
|
|
4338
|
-
});
|
|
4339
|
-
await promise;
|
|
4340
|
-
})
|
|
4341
|
-
});
|
|
4342
|
-
this.listing_query_state_key = listing_query_state_key;
|
|
4343
|
-
this.on_navigation_ = on_navigation;
|
|
4344
|
-
}
|
|
4345
|
-
}
|
|
4346
|
-
function $73014ff36186a4dd$var$_throwing_on_navigation2() {
|
|
4347
|
-
const {
|
|
4348
|
-
on_navigation_: on_navigation_
|
|
4349
|
-
} = this;
|
|
4350
|
-
if (typeof on_navigation_ !== "function") throw new Error("on_navigation_ is not a function");
|
|
4351
|
-
// make sure that we don't accidentally catchify if the SDK consumer has fucked up
|
|
4352
|
-
try {
|
|
4353
|
-
return on_navigation_(...arguments);
|
|
4354
|
-
} catch (e) {
|
|
4355
|
-
queueMicrotask(() => {
|
|
4356
|
-
throw e;
|
|
4357
|
-
});
|
|
4358
|
-
}
|
|
4359
|
-
}
|
|
4360
|
-
function $73014ff36186a4dd$var$_get_navigation_happened_promise2(is_replace) {
|
|
4361
|
-
return new Promise(resolve => {
|
|
4362
|
-
const handler = what_happened => {
|
|
4363
|
-
if (what_happened === (is_replace ? "replaceState" : "pushState")) {
|
|
4364
|
-
resolve();
|
|
4365
|
-
(0, $3hooq$depictaiutilishared.instant_exec_on_suspect_history_change).delete(handler);
|
|
4366
|
-
}
|
|
4367
|
-
};
|
|
4368
|
-
(0, $3hooq$depictaiutilishared.instant_exec_on_suspect_history_change).add(handler);
|
|
4369
|
-
});
|
|
4370
|
-
}
|
|
4371
4486
|
var $c8e3c11062d8380b$var$_tmpl$ = ["<div", ' class="image-container">', "</div>"];
|
|
4372
4487
|
function $c8e3c11062d8380b$export$41e1a079d40a0d58(props) {
|
|
4373
4488
|
const [display] = $3hooq$solidjs.createResource(() => ({
|