@depict-ai/ui 4.3.1 → 4.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/latest/index.js CHANGED
@@ -1,13 +1,13 @@
1
- import { add_to_version_info as $9HbP8$add_to_version_info, fetch_retry as $9HbP8$fetch_retry, base_url as $9HbP8$base_url, slider_fractional_factory as $9HbP8$slider_fractional_factory, dlog as $9HbP8$dlog, camelCasifyObject as $9HbP8$camelCasifyObject, make_random_classname as $9HbP8$make_random_classname, n_col_styling_with_dist as $9HbP8$n_col_styling_with_dist, catchify as $9HbP8$catchify, layout_get_visible_recs_without_partial_rows as $9HbP8$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $9HbP8$layout_get_total_rec_amount_for_row, layout_media_query_header as $9HbP8$layout_media_query_header, report as $9HbP8$report, slider_fading_factory as $9HbP8$slider_fading_factory, Amazing_Slider as $9HbP8$Amazing_Slider, slider_snap_css as $9HbP8$slider_snap_css, observer as $9HbP8$observer, javascript_media_query as $9HbP8$javascript_media_query, queueMacroTask as $9HbP8$queueMacroTask, findMostFrequentItem as $9HbP8$findMostFrequentItem, dwarn as $9HbP8$dwarn, deparallelize_no_drop as $9HbP8$deparallelize_no_drop, ContainedImage as $9HbP8$ContainedImage, standard_price_format as $9HbP8$standard_price_format, buildThresholdList as $9HbP8$buildThresholdList, make_asyncIterable_exiter as $9HbP8$make_asyncIterable_exiter, href_change_ipns as $9HbP8$href_change_ipns, base64_encode_unicode as $9HbP8$base64_encode_unicode, base64_decode_unicode as $9HbP8$base64_decode_unicode, use_href_accessor as $9HbP8$use_href_accessor, get_session_id as $9HbP8$get_session_id, add_version_query_params as $9HbP8$add_version_query_params, instant_exec_on_suspect_history_change as $9HbP8$instant_exec_on_suspect_history_change, useExpandingContainer as $9HbP8$useExpandingContainer, hex_to_rgb as $9HbP8$hex_to_rgb, relative_luminance_from_rgb as $9HbP8$relative_luminance_from_rgb, snakeCasifyObject as $9HbP8$snakeCasifyObject, sort_obj as $9HbP8$sort_obj, make_url_with_query_params as $9HbP8$make_url_with_query_params, ListenableSet as $9HbP8$ListenableSet1, insert_surfaces as $9HbP8$insert_surfaces, is_debug as $9HbP8$is_debug } from "@depict-ai/utilishared/latest";
2
- import { template as $9HbP8$template, getNextElement as $9HbP8$getNextElement, insert as $9HbP8$insert, createComponent as $9HbP8$createComponent, mergeProps as $9HbP8$mergeProps, isServer as $9HbP8$isServer, spread as $9HbP8$spread, runHydrationEvents as $9HbP8$runHydrationEvents, addEventListener as $9HbP8$addEventListener, className as $9HbP8$className, memo as $9HbP8$memo, delegateEvents as $9HbP8$delegateEvents, getNextMarker as $9HbP8$getNextMarker, effect as $9HbP8$effect, classList as $9HbP8$classList, setAttribute as $9HbP8$setAttribute, style as $9HbP8$style, use as $9HbP8$use, setProperty as $9HbP8$setProperty, Dynamic as $9HbP8$Dynamic } from "solid-js/web";
3
- import { createSignal as $9HbP8$createSignal, createMemo as $9HbP8$createMemo, createResource as $9HbP8$createResource, Show as $9HbP8$Show, Suspense as $9HbP8$Suspense, untrack as $9HbP8$untrack, createRenderEffect as $9HbP8$createRenderEffect, Index as $9HbP8$Index, createRoot as $9HbP8$createRoot, onCleanup as $9HbP8$onCleanup, For as $9HbP8$For, getOwner as $9HbP8$getOwner, runWithOwner as $9HbP8$runWithOwner, createEffect as $9HbP8$createEffect, createContext as $9HbP8$createContext, useContext as $9HbP8$useContext, createUniqueId as $9HbP8$createUniqueId, createComputed as $9HbP8$createComputed, ErrorBoundary as $9HbP8$ErrorBoundary, splitProps as $9HbP8$splitProps, mergeProps as $9HbP8$mergeProps1, on as $9HbP8$on, batch as $9HbP8$batch, createSelector as $9HbP8$createSelector, children as $9HbP8$children, createReaction as $9HbP8$createReaction, mapArray as $9HbP8$mapArray } from "solid-js";
1
+ import { add_to_version_info as $9HbP8$add_to_version_info, fetch_retry as $9HbP8$fetch_retry, base_url as $9HbP8$base_url, dwarn as $9HbP8$dwarn, slider_fractional_factory as $9HbP8$slider_fractional_factory, dlog as $9HbP8$dlog, camelCasifyObject as $9HbP8$camelCasifyObject, make_random_classname as $9HbP8$make_random_classname, n_col_styling_with_dist as $9HbP8$n_col_styling_with_dist, catchify as $9HbP8$catchify, layout_get_visible_recs_without_partial_rows as $9HbP8$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $9HbP8$layout_get_total_rec_amount_for_row, layout_media_query_header as $9HbP8$layout_media_query_header, report as $9HbP8$report, slider_fading_factory as $9HbP8$slider_fading_factory, Amazing_Slider as $9HbP8$Amazing_Slider, slider_snap_css as $9HbP8$slider_snap_css, observer as $9HbP8$observer, javascript_media_query as $9HbP8$javascript_media_query, queueMacroTask as $9HbP8$queueMacroTask, findMostFrequentItem as $9HbP8$findMostFrequentItem, standard_price_format as $9HbP8$standard_price_format, instant_exec_on_suspect_history_change as $9HbP8$instant_exec_on_suspect_history_change, deparallelize_no_drop as $9HbP8$deparallelize_no_drop, ContainedImage as $9HbP8$ContainedImage, buildThresholdList as $9HbP8$buildThresholdList, make_asyncIterable_exiter as $9HbP8$make_asyncIterable_exiter, href_change_ipns as $9HbP8$href_change_ipns, base64_encode_unicode as $9HbP8$base64_encode_unicode, base64_decode_unicode as $9HbP8$base64_decode_unicode, use_href_accessor as $9HbP8$use_href_accessor, get_session_id as $9HbP8$get_session_id, add_version_query_params as $9HbP8$add_version_query_params, useExpandingContainer as $9HbP8$useExpandingContainer, hex_to_rgb as $9HbP8$hex_to_rgb, relative_luminance_from_rgb as $9HbP8$relative_luminance_from_rgb, snakeCasifyObject as $9HbP8$snakeCasifyObject, sort_obj as $9HbP8$sort_obj, make_url_with_query_params as $9HbP8$make_url_with_query_params, ListenableSet as $9HbP8$ListenableSet1, insert_surfaces as $9HbP8$insert_surfaces, is_debug as $9HbP8$is_debug } from "@depict-ai/utilishared/latest";
2
+ import { template as $9HbP8$template, getNextElement as $9HbP8$getNextElement, insert as $9HbP8$insert, createComponent as $9HbP8$createComponent, mergeProps as $9HbP8$mergeProps1, isServer as $9HbP8$isServer, spread as $9HbP8$spread, runHydrationEvents as $9HbP8$runHydrationEvents, addEventListener as $9HbP8$addEventListener, className as $9HbP8$className, memo as $9HbP8$memo, delegateEvents as $9HbP8$delegateEvents, getNextMarker as $9HbP8$getNextMarker, effect as $9HbP8$effect, classList as $9HbP8$classList, setAttribute as $9HbP8$setAttribute, style as $9HbP8$style, use as $9HbP8$use, setProperty as $9HbP8$setProperty, Dynamic as $9HbP8$Dynamic } from "solid-js/web";
3
+ import { createSignal as $9HbP8$createSignal, createMemo as $9HbP8$createMemo, createResource as $9HbP8$createResource, createEffect as $9HbP8$createEffect, mergeProps as $9HbP8$mergeProps, Show as $9HbP8$Show, Suspense as $9HbP8$Suspense, untrack as $9HbP8$untrack, createRenderEffect as $9HbP8$createRenderEffect, Index as $9HbP8$Index, createRoot as $9HbP8$createRoot, onCleanup as $9HbP8$onCleanup, For as $9HbP8$For, getOwner as $9HbP8$getOwner, runWithOwner as $9HbP8$runWithOwner, createContext as $9HbP8$createContext, useContext as $9HbP8$useContext, createUniqueId as $9HbP8$createUniqueId, createComputed as $9HbP8$createComputed, ErrorBoundary as $9HbP8$ErrorBoundary, splitProps as $9HbP8$splitProps, on as $9HbP8$on, batch as $9HbP8$batch, createSelector as $9HbP8$createSelector, children as $9HbP8$children, createReaction as $9HbP8$createReaction, mapArray as $9HbP8$mapArray } from "solid-js";
4
4
  import { ListenableSet as $9HbP8$ListenableSet, catchify as $9HbP8$catchify1, use_href_accessor as $9HbP8$use_href_accessor1, report as $9HbP8$report1 } from "@depict-ai/utilishared/latest";
5
5
  import { createStore as $9HbP8$createStore, reconcile as $9HbP8$reconcile } from "solid-js/store";
6
6
 
7
7
  /*! Depict.ai search and product listing SDK */
8
8
  import { register_es_version } from "../multi_import_deduplicator.mjs";
9
9
  register_es_version("ui", "latest");
10
- const $ec291e0010116877$export$83d89fbfd8236492 = "4.3.1";
10
+ const $ec291e0010116877$export$83d89fbfd8236492 = "4.3.2";
11
11
  const $b5cccc8ee7d24677$var$transform_elements = sorted_cols_at_size => {
12
12
  const cols_at_size = [];
13
13
  for (let i = 0; i < sorted_cols_at_size.length; i++) {
@@ -426,7 +426,7 @@ function $c8d5ff4524619fcd$export$d21e32dfedac04be(props) {
426
426
  const container_class = "x" + $9HbP8$createUniqueId();
427
427
  const container_element_ = (() => {
428
428
  var _el$ = $9HbP8$getNextElement($c8d5ff4524619fcd$var$_tmpl$);
429
- $9HbP8$spread(_el$, $9HbP8$mergeProps(() => props.element_attributes, {
429
+ $9HbP8$spread(_el$, $9HbP8$mergeProps1(() => props.element_attributes, {
430
430
  "classList": {
431
431
  [container_class]: true
432
432
  }
@@ -669,7 +669,7 @@ function $c4492d24952ed731$export$d41d19e89346fa2({
669
669
  } = slider;
670
670
  const Layout = props => $c8d5ff4524619fcd$export$445d8d3f5f706a40(props, insert_here, true);
671
671
  // Do like this, so we don't have to call mergeProps ourselves
672
- $9HbP8$createComponent(Layout, $9HbP8$mergeProps({
672
+ $9HbP8$createComponent(Layout, $9HbP8$mergeProps1({
673
673
  rows: "all",
674
674
  layout: "slider"
675
675
  }, layout_options_));
@@ -974,7 +974,7 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
974
974
  });
975
975
  // Work around https://github.com/solidjs/solid/issues/1828
976
976
  const img = new Image(); // Need to use new Image or browser might not start loading image before it's in the DOM
977
- const [, otherAttributes] = $9HbP8$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 <-
977
+ const [, otherAttributes] = $9HbP8$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 <-
978
978
  ]);
979
979
 
980
980
  const [hasSetSize, setHasSetSize] = $9HbP8$createSignal(false);
@@ -990,7 +990,7 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
990
990
  if (loading === "force-lazy") return true;
991
991
  return loading === "lazy" && !isPrioritisedImage();
992
992
  });
993
- const modifiedOtherAttributes = $9HbP8$mergeProps1(otherAttributes, {
993
+ const modifiedOtherAttributes = $9HbP8$mergeProps(otherAttributes, {
994
994
  get loading() {
995
995
  return shouldActuallyEnableLazyLoading() ? "lazy" : undefined;
996
996
  }
@@ -1030,13 +1030,18 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
1030
1030
  let hasDecodedFastPath = false;
1031
1031
  let timeoutSet = false;
1032
1032
  let gotCleanedUp = false;
1033
+ let srcJustChanged = true;
1033
1034
  img.classList.add("s-responsive-image");
1034
1035
  if (listingContext) {
1035
1036
  let prevValue;
1036
1037
  const aspectRatios = listingContext[$e8ffe11ed01df0fe$export$f8945274f08a3105] ||= new Set();
1037
1038
  const [, setMostPrevalentAspectRatio] = listingContext[$e8ffe11ed01df0fe$export$6066eb417ed2e9f7] ||= $9HbP8$createSignal();
1038
1039
  img.addEventListener("load", $9HbP8$catchify(() => {
1039
- // Save our aspect ratio whenever it changes, so that we can base the containers on the most dominant aspect ratio, used in SearchModalV2
1040
+ if (props.keyRatioUpdating) {
1041
+ if (!srcJustChanged) return;
1042
+ srcJustChanged = false;
1043
+ }
1044
+ // 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
1040
1045
  const aspectRatio_ = img.naturalWidth / img.naturalHeight;
1041
1046
  if (prevValue) aspectRatios.delete(prevValue);
1042
1047
  const newValue = !isNaN(aspectRatio_) ? {
@@ -1054,7 +1059,11 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
1054
1059
  $9HbP8$onCleanup(() => prevValue && aspectRatios.delete(prevValue));
1055
1060
  }
1056
1061
  $9HbP8$onCleanup(() => gotCleanedUp = true);
1057
- $9HbP8$spread(img, $9HbP8$mergeProps1(modifiedOtherAttributes), false, true);
1062
+ $9HbP8$spread(img, $9HbP8$mergeProps(modifiedOtherAttributes), false, true);
1063
+ $9HbP8$createRenderEffect(() => {
1064
+ props.src;
1065
+ srcJustChanged = true;
1066
+ });
1058
1067
  $9HbP8$createEffect(() => {
1059
1068
  if (!props.size()) return; // wait until we have a size, run every time the size changes
1060
1069
  if (timeoutSet) return;
@@ -1124,48 +1133,22 @@ function $660070e2a394b3c3$export$e4b984597b71e989(props) {
1124
1133
  const [mostPrevalentAspectRatio] = context ?
1125
1134
  // If the context exists we have to create the signal here as getting it here would be too late when it's created by ShopifyResponsiveImg below
1126
1135
  context[(0, $e8ffe11ed01df0fe$export$6066eb417ed2e9f7)] ||= $9HbP8$createSignal() : [];
1127
- const [aspectRatio, setAspectRatio] = $9HbP8$createSignal($9HbP8$untrack(() => props.aspectRatio));
1128
1136
  const container = $f18d425032111270$export$94026ee33dbabc26({
1129
1137
  // Write getters manually instead of using JSX, so we can do more complex logic in the aspectRatio getter without increasing bundle size
1130
1138
  get class() {
1131
1139
  return props.class;
1132
1140
  },
1133
1141
  get aspectRatio() {
1134
- return aspectRatio();
1142
+ if (props.autoAdjustAspectRatio) {
1143
+ const targetRatio = mostPrevalentAspectRatio?.();
1144
+ if (targetRatio != undefined) return `var(${(0, $bb15dfb548a7666e$export$8a2234b5b1a5ebd4)}, ${targetRatio})`;
1145
+ }
1146
+ return props.aspectRatio;
1135
1147
  }
1136
1148
  });
1137
1149
  const owner = $9HbP8$getOwner();
1138
1150
  let createdSizeAccessor = false;
1139
1151
  let wasCleanedUp = false;
1140
- let timeout;
1141
- $9HbP8$createEffect(() => {
1142
- const {
1143
- autoAdjustAspectRatio: autoAdjustAspectRatio
1144
- } = props;
1145
- if (autoAdjustAspectRatio) {
1146
- const targetRatio = mostPrevalentAspectRatio?.();
1147
- if (targetRatio != undefined) {
1148
- const targetValue = `var(${(0, $bb15dfb548a7666e$export$8a2234b5b1a5ebd4)}, ${targetRatio})`;
1149
- const updateAspectRatio = $9HbP8$catchify(() => setAspectRatio(targetValue));
1150
- if (autoAdjustAspectRatio === "smoothed") {
1151
- if (!timeout)
1152
- // 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).
1153
- updateAspectRatio();
1154
- clearTimeout(timeout);
1155
- timeout = setTimeout(() => {
1156
- timeout = undefined;
1157
- updateAspectRatio();
1158
- }, 500);
1159
- return;
1160
- }
1161
- return updateAspectRatio();
1162
- }
1163
- } else {
1164
- clearTimeout(timeout);
1165
- timeout = undefined;
1166
- }
1167
- setAspectRatio(props.aspectRatio);
1168
- });
1169
1152
  $9HbP8$createEffect(() => {
1170
1153
  if (currentImageSize() || wasCleanedUp) return; // We get into the effect when onCleanup is called if we don't have wasCleanedUp
1171
1154
  // ensure we always have a size accessor
@@ -1179,7 +1162,7 @@ function $660070e2a394b3c3$export$e4b984597b71e989(props) {
1179
1162
  $9HbP8$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
1180
1163
  });
1181
1164
 
1182
- $9HbP8$insert(container, $9HbP8$createComponent((0, $e8ffe11ed01df0fe$export$6e5611bc7e57e477), $9HbP8$mergeProps({
1165
+ $9HbP8$insert(container, $9HbP8$createComponent((0, $e8ffe11ed01df0fe$export$6e5611bc7e57e477), $9HbP8$mergeProps1({
1183
1166
  get size() {
1184
1167
  return $9HbP8$createMemo(() => currentImageSize()?.() || 0);
1185
1168
  },
@@ -1194,7 +1177,7 @@ function $660070e2a394b3c3$export$e4b984597b71e989(props) {
1194
1177
  return container;
1195
1178
  }
1196
1179
  function $70bb27cc6be01fc7$export$9d4a4b669b1929ab(props) {
1197
- return $9HbP8$createComponent((0, $660070e2a394b3c3$export$e4b984597b71e989), $9HbP8$mergeProps(props, {
1180
+ return $9HbP8$createComponent((0, $660070e2a394b3c3$export$e4b984597b71e989), $9HbP8$mergeProps1(props, {
1198
1181
  get imgProps() {
1199
1182
  return {
1200
1183
  ...props.imgProps,
@@ -1211,6 +1194,12 @@ function $70bb27cc6be01fc7$export$9d4a4b669b1929ab(props) {
1211
1194
  }
1212
1195
  }));
1213
1196
  }
1197
+ function $8c0f86cb3e266eeb$export$a71e92cfbb498adc(props) {
1198
+ return $9HbP8$createMemo(() => {
1199
+ const price_formatting = props.price_formatting_;
1200
+ return $9HbP8$standard_price_format(props.price_, price_formatting.places_after_comma_, price_formatting.decimal_places_delimiter_, price_formatting.thousands_delimiter_);
1201
+ });
1202
+ }
1214
1203
  var $5a6c386e1bde5665$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<div class=img-wrapper>`),
1215
1204
  $5a6c386e1bde5665$var$_tmpl$2 = /*#__PURE__*/$9HbP8$template(`<span class="d-price original">`),
1216
1205
  $5a6c386e1bde5665$var$_tmpl$3 = /*#__PURE__*/$9HbP8$template(`<div class=right-part><div class=text-container><span class="d-title line-clamp"></span><span class=d-price></span><!$><!/></div><!$><!/>`),
@@ -1221,7 +1210,9 @@ function $5a6c386e1bde5665$export$b73ed90f0ee50dc3({
1221
1210
  isExpanded_: isExpanded_,
1222
1211
  textFadeInAnimationRunning_: textFadeInAnimationRunning_,
1223
1212
  outerRef_: outerRef_,
1224
- animationDuration_: animationDuration_
1213
+ animationDuration_: animationDuration_,
1214
+ priceFormatting_: priceFormatting_,
1215
+ pseudoRouter_: pseudoRouter_
1225
1216
  }) {
1226
1217
  const variantToUse = $9HbP8$createMemo(() => {
1227
1218
  const display = display_();
@@ -1233,7 +1224,9 @@ function $5a6c386e1bde5665$export$b73ed90f0ee50dc3({
1233
1224
  const [animationEffectExists, setAnimationEffectExists] = $9HbP8$createSignal(false);
1234
1225
  const [salePrice] = $9HbP8$createResource(() => variantToUse()?.sale_price);
1235
1226
  const [originalPrice] = $9HbP8$createResource(() => variantToUse()?.original_price);
1236
- const isOnSale = $9HbP8$createMemo(() => salePrice.latest !== originalPrice.latest); // .latest doesn't trigger suspense
1227
+ const isOnSale = $9HbP8$createMemo(() => !salePrice.loading && !originalPrice.loading && salePrice.latest !== originalPrice.latest); // .latest doesn't trigger suspense after the initial load
1228
+ const enableLink = $9HbP8$createMemo(() => isExpanded_() && !animationIsRunning());
1229
+ const href = $9HbP8$createMemo(() => variantToUse()?.page_url);
1237
1230
  const FavoriteButton = FavoriteButton_; // Just to get rid of the type error - TS doesn't understand <Show>
1238
1231
  return (() => {
1239
1232
  var _el$ = $9HbP8$getNextElement($5a6c386e1bde5665$var$_tmpl$4),
@@ -1243,9 +1236,17 @@ function $5a6c386e1bde5665$export$b73ed90f0ee50dc3({
1243
1236
  [_el$15, _co$4] = $9HbP8$getNextMarker(_el$14.nextSibling);
1244
1237
  var _ref$ = outerRef_;
1245
1238
  typeof _ref$ === "function" ? $9HbP8$use(_ref$, _el$) : outerRef_ = _el$;
1246
- $9HbP8$spread(_el$, $9HbP8$mergeProps(() => isExpanded_() && !animationIsRunning() ? {
1247
- href: variantToUse()?.page_url
1248
- } : {}), false, true);
1239
+ $9HbP8$spread(_el$, $9HbP8$mergeProps1(() => enableLink() ? {
1240
+ href: href()
1241
+ } : {}, {
1242
+ get onClick() {
1243
+ return $9HbP8$catchify(event_ => enableLink() && pseudoRouter_.navigate_.go_to_({
1244
+ new_url_: href(),
1245
+ is_replace_: false,
1246
+ event_: event_
1247
+ }));
1248
+ }
1249
+ }), false, true);
1249
1250
  $9HbP8$insert(_el$, $9HbP8$createComponent((0, $9HbP8$Show), {
1250
1251
  when: imageUrl,
1251
1252
  get fallback() {
@@ -1273,7 +1274,10 @@ function $5a6c386e1bde5665$export$b73ed90f0ee50dc3({
1273
1274
  return isExpanded_() ? 0.75 : 1;
1274
1275
  },
1275
1276
  get autoAdjustAspectRatio() {
1276
- return isExpanded_() ? "smoothed" : false;
1277
+ return isExpanded_();
1278
+ },
1279
+ imgProps: {
1280
+ keyRatioUpdating: true
1277
1281
  }
1278
1282
  });
1279
1283
  }
@@ -1330,26 +1334,68 @@ function $5a6c386e1bde5665$export$b73ed90f0ee50dc3({
1330
1334
  height: "1em",
1331
1335
  width: "20ch"
1332
1336
  }));
1333
- $9HbP8$insert(_el$6, (() => {
1334
- var _c$ = $9HbP8$memo(() => !!(!variantToUse() || salePrice.loading));
1335
- return () => _c$() ? $9HbP8$createComponent((0, $d134eae24341b4a1$export$89c6019e4baa40b1), {
1336
- height: "1em",
1337
- width: "20ch"
1338
- }) : salePrice();
1339
- })());
1337
+ $9HbP8$insert(_el$6, $9HbP8$createComponent((0, $9HbP8$Show), {
1338
+ get when() {
1339
+ return variantToUse() && !salePrice.loading;
1340
+ },
1341
+ get fallback() {
1342
+ return $9HbP8$createComponent((0, $d134eae24341b4a1$export$89c6019e4baa40b1), {
1343
+ height: "1em",
1344
+ width: "20ch"
1345
+ });
1346
+ },
1347
+ get children() {
1348
+ return $9HbP8$createComponent((0, $9HbP8$Show), {
1349
+ get when() {
1350
+ return salePrice.latest;
1351
+ },
1352
+ get children() {
1353
+ return [$9HbP8$memo(() => priceFormatting_().pre_), $9HbP8$createComponent((0, $8c0f86cb3e266eeb$export$a71e92cfbb498adc), {
1354
+ get price_() {
1355
+ return salePrice();
1356
+ },
1357
+ get price_formatting_() {
1358
+ return priceFormatting_();
1359
+ }
1360
+ }), $9HbP8$memo(() => priceFormatting_().post_)];
1361
+ }
1362
+ });
1363
+ }
1364
+ }));
1340
1365
  $9HbP8$insert(_el$4, $9HbP8$createComponent((0, $9HbP8$Show), {
1341
1366
  get when() {
1342
1367
  return isOnSale();
1343
1368
  },
1344
1369
  get children() {
1345
1370
  var _el$7 = $9HbP8$getNextElement($5a6c386e1bde5665$var$_tmpl$2);
1346
- $9HbP8$insert(_el$7, (() => {
1347
- var _c$2 = $9HbP8$memo(() => !!(!variantToUse() || originalPrice.loading));
1348
- return () => _c$2() ? $9HbP8$createComponent((0, $d134eae24341b4a1$export$89c6019e4baa40b1), {
1349
- height: "1em",
1350
- width: "20ch"
1351
- }) : originalPrice();
1352
- })());
1371
+ $9HbP8$insert(_el$7, $9HbP8$createComponent((0, $9HbP8$Show), {
1372
+ get when() {
1373
+ return variantToUse() && !originalPrice.loading;
1374
+ },
1375
+ get fallback() {
1376
+ return $9HbP8$createComponent((0, $d134eae24341b4a1$export$89c6019e4baa40b1), {
1377
+ height: "1em",
1378
+ width: "20ch"
1379
+ });
1380
+ },
1381
+ get children() {
1382
+ return $9HbP8$createComponent((0, $9HbP8$Show), {
1383
+ get when() {
1384
+ return salePrice.latest;
1385
+ },
1386
+ get children() {
1387
+ return [$9HbP8$memo(() => priceFormatting_().pre_), $9HbP8$createComponent((0, $8c0f86cb3e266eeb$export$a71e92cfbb498adc), {
1388
+ get price_() {
1389
+ return originalPrice();
1390
+ },
1391
+ get price_formatting_() {
1392
+ return priceFormatting_();
1393
+ }
1394
+ }), $9HbP8$memo(() => priceFormatting_().post_)];
1395
+ }
1396
+ });
1397
+ }
1398
+ }));
1353
1399
  return _el$7;
1354
1400
  }
1355
1401
  }), _el$9, _co$);
@@ -1426,7 +1472,9 @@ function $7555dcad3b8a4632$export$ebf0b1d4f90c09ae({
1426
1472
  userWantsExpandedSignal_: [userWantsExpanded, setUserWantsExpanded],
1427
1473
  containerWidth_: containerWidth_,
1428
1474
  animationDuration_: animationDuration_,
1429
- supportsHover_: supportsHover_
1475
+ supportsHover_: supportsHover_,
1476
+ priceFormatting_: priceFormatting_,
1477
+ pseudoRouter_: pseudoRouter_
1430
1478
  }) {
1431
1479
  let isAffectedByChromeBug = false;
1432
1480
  // If the user requests the drawer to be expanded or not
@@ -1456,7 +1504,7 @@ function $7555dcad3b8a4632$export$ebf0b1d4f90c09ae({
1456
1504
  behavior: "smooth"
1457
1505
  });
1458
1506
  }), _el$2);
1459
- $9HbP8$spread(_el$2, $9HbP8$mergeProps({
1507
+ $9HbP8$spread(_el$2, $9HbP8$mergeProps1({
1460
1508
  get classList() {
1461
1509
  return {
1462
1510
  expanded: userWantsExpanded(),
@@ -1480,11 +1528,13 @@ function $7555dcad3b8a4632$export$ebf0b1d4f90c09ae({
1480
1528
  },
1481
1529
  children: (display, index) => {
1482
1530
  return $9HbP8$createComponent((0, $5a6c386e1bde5665$export$b73ed90f0ee50dc3), {
1531
+ pseudoRouter_: pseudoRouter_,
1483
1532
  animationDuration_: animationDuration_,
1484
1533
  display_: display,
1485
1534
  FavoriteButton_: FavoriteButton_,
1486
1535
  isExpanded_: userWantsExpanded,
1487
1536
  textFadeInAnimationRunning_: textFadeInAnimationRunning,
1537
+ priceFormatting_: priceFormatting_,
1488
1538
  outerRef_: el => $9HbP8$createEffect(() => {
1489
1539
  if (index !== 0) return;
1490
1540
  const resizeObserver = new ResizeObserver($9HbP8$catchify(records => setLookItemHeight(records.at(-1).contentRect.height)));
@@ -1527,10 +1577,10 @@ function $28ee4f7db3cc44b8$export$44809a8a3e867e30({
1527
1577
  expandedLooksSignal_: [expandedLooks_, setExpandedLooks],
1528
1578
  FavoriteButton_: FavoriteButton_,
1529
1579
  placeholderImageAspectRatio_: placeholderImageAspectRatio_,
1530
- animationDuration_: animationDuration_
1580
+ animationDuration_: animationDuration_,
1581
+ priceFormatting_: priceFormatting_,
1582
+ pseudoRouter_: pseudoRouter_
1531
1583
  }) {
1532
- // TODO: shopify, run displayTransformers to get dynamic prices
1533
- // TODO: format prices
1534
1584
  const [coverImage] = display_?.image_urls || [];
1535
1585
  const useWantsExpandedSignal_ = $9HbP8$createSignal(false);
1536
1586
  const [userWantsExpanded, setUserWantsExpanded] = useWantsExpandedSignal_;
@@ -1574,7 +1624,7 @@ function $28ee4f7db3cc44b8$export$44809a8a3e867e30({
1574
1624
  when: display_,
1575
1625
  get fallback() {
1576
1626
  return $9HbP8$createComponent((0, $7f60f09116a3fe61$export$3f37af283f8fb843), {
1577
- aspectRatio: placeholderImageAspectRatio_
1627
+ aspectRatio: `var(${(0, $bb15dfb548a7666e$export$8a2234b5b1a5ebd4)}, ${placeholderImageAspectRatio_})`
1578
1628
  });
1579
1629
  },
1580
1630
  get children() {
@@ -1592,11 +1642,125 @@ function $28ee4f7db3cc44b8$export$44809a8a3e867e30({
1592
1642
  containerWidth_: containerWidth_,
1593
1643
  animationDuration_: animationDuration_,
1594
1644
  supportsHover_: supportsHover_,
1595
- FavoriteButton_: FavoriteButton_
1645
+ FavoriteButton_: FavoriteButton_,
1646
+ priceFormatting_: priceFormatting_,
1647
+ pseudoRouter_: pseudoRouter_
1596
1648
  })]);
1597
1649
  return container;
1598
1650
  }
1599
1651
  $9HbP8$delegateEvents(["click"]);
1652
+
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 $a281666e5c15c2ec$export$29d28dadc2d6b631(clickEvent) {
1658
+ return clickEvent?.button ||
1659
+ // if not zero it's a wheel click which opens in new tab
1660
+ clickEvent?.metaKey ||
1661
+ // if true, cmd button on macOS which opens in new tab
1662
+ clickEvent?.ctrlKey ||
1663
+ // if true, ctrl button on windows or linux which opens in new tab
1664
+ clickEvent?.shiftKey // if true, shift button on windows, linux or macOS which opens in a new window
1665
+ ;
1666
+ }
1667
+
1668
+ class $4fd2ba03703a7d92$export$7e1297a3a19f10d8 {
1669
+ /**
1670
+ * Function that will be called when we want to navigate, or a string saying it's not an SPA. You can change this OTG
1671
+ */ /**
1672
+ * 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
1673
+ */
1674
+ #throwing_on_navigation(...args) {
1675
+ const {
1676
+ on_navigation_: on_navigation_
1677
+ } = this;
1678
+ if (typeof on_navigation_ !== "function") throw new Error("on_navigation_ is not a function");
1679
+ // make sure that we don't accidentally catchify if the SDK consumer has fucked up
1680
+ try {
1681
+ return on_navigation_(...args);
1682
+ } catch (e) {
1683
+ queueMicrotask(() => {
1684
+ throw e;
1685
+ });
1686
+ }
1687
+ }
1688
+ /**
1689
+ * Vue has async router that needs to be awaited (it navigates after a microtask)
1690
+ * This standardises waiting for all kinds of routers
1691
+ */
1692
+ #get_navigation_happened_promise(is_replace) {
1693
+ return new Promise(resolve => {
1694
+ const handler = what_happened => {
1695
+ if (what_happened === (is_replace ? "replaceState" : "pushState")) {
1696
+ resolve();
1697
+ (0, $9HbP8$instant_exec_on_suspect_history_change).delete(handler);
1698
+ }
1699
+ };
1700
+ (0, $9HbP8$instant_exec_on_suspect_history_change).add(handler);
1701
+ });
1702
+ }
1703
+ navigate_ = {
1704
+ /**
1705
+ * Call this if you *just* want to replace the state object in history.state
1706
+ */
1707
+ replace_state_: new_state => {
1708
+ // 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
1709
+ globalThis?.history?.replaceState(new_state, "");
1710
+ },
1711
+ /**
1712
+ * Call this to change the URL
1713
+ * @param new_url_ new URL to go to
1714
+ * @param event_ event if you have this in a click handler, will not do anything on cmd/ctrl or non-left click then
1715
+ * @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
1716
+ * @param is_replace_ if you want to replace the current URL in history instead of pushing a new one
1717
+ * @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
1718
+ */
1719
+ go_to_: $9HbP8$catchify(async ({
1720
+ new_url_: raw_new_url,
1721
+ event_: event_,
1722
+ force_spa_navigation_: force_spa_navigation_,
1723
+ is_replace_: is_replace_,
1724
+ listing_query_: listing_query_,
1725
+ scroll = true
1726
+ }) => {
1727
+ const new_url_ = raw_new_url instanceof URL ? raw_new_url : new URL(raw_new_url, location.origin);
1728
+ const wants_hard_navigation = this.on_navigation_ === "hard_navigation";
1729
+ if ($a281666e5c15c2ec$export$29d28dadc2d6b631(event_)) return;
1730
+ const different_origin = new_url_.origin !== location.origin;
1731
+ if (wants_hard_navigation && (!force_spa_navigation_ || different_origin)) {
1732
+ if (force_spa_navigation_ && different_origin)
1733
+ // If we call history.pushState on a different origin, it will throw an error, so fallback to hard navigations
1734
+ $9HbP8$dwarn("Can't single page navigate to", new_url_.href, "due to different origin, this MIGHT mean you should fix the URLs");
1735
+ if (!event_)
1736
+ // If we haven't gotten an event, nothing will happen by not calling prevent default, so we need to change the URL
1737
+ location.assign(new_url_);
1738
+ return;
1739
+ }
1740
+ event_?.preventDefault();
1741
+ const promise = this.#get_navigation_happened_promise(true);
1742
+ if (force_spa_navigation_ && wants_hard_navigation) {
1743
+ // Don't allow hard navigation if we're forcing SPA navigation, which we do for things where PageReplacer can be used for performance
1744
+ const new_state = history.state;
1745
+ if (listing_query_) {
1746
+ // In JS-UI we need to know the listing_id of the current category, therefore push it into state
1747
+ if (!this.listing_query_state_key) $9HbP8$report(new Error("listing_query_state_key is not set"), "error");
1748
+ new_state[this.listing_query_state_key] = listing_query_;
1749
+ }
1750
+ history[is_replace_ ? "replaceState" : "pushState"](new_state, "", new_url_);
1751
+ } else this.#throwing_on_navigation.call(this, {
1752
+ is_replace: is_replace_,
1753
+ new_url: new_url_ instanceof URL ? new_url_ : new URL(new_url_, location.origin),
1754
+ scroll: scroll
1755
+ });
1756
+ await promise;
1757
+ })
1758
+ };
1759
+ constructor(on_navigation, listing_query_state_key) {
1760
+ this.listing_query_state_key = listing_query_state_key;
1761
+ this.on_navigation_ = on_navigation;
1762
+ }
1763
+ }
1600
1764
  var $f577edfe2240eec1$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<div class="depict recommendations looks"style=--animation-duration:240ms>`);
1601
1765
  let $f577edfe2240eec1$var$expandedLooksSignal_;
1602
1766
  function $f577edfe2240eec1$export$1935e6bdfc5ed8ce(props) {
@@ -1605,6 +1769,7 @@ function $f577edfe2240eec1$export$1935e6bdfc5ed8ce(props) {
1605
1769
  equals: false
1606
1770
  });
1607
1771
  const expandingAnimationDuration = 240;
1772
+ const pseudoRouter = new (0, $4fd2ba03703a7d92$export$7e1297a3a19f10d8)("hard_navigation");
1608
1773
  const grid_spacing_override = $9HbP8$createMemo(() => {
1609
1774
  const {
1610
1775
  gridSpacing_: gridSpacing_
@@ -1630,21 +1795,37 @@ function $f577edfe2240eec1$export$1935e6bdfc5ed8ce(props) {
1630
1795
  });
1631
1796
  const decoded = await response?.json?.().catch(() => false);
1632
1797
  if (!decoded)
1633
- // If network fails, make sure to return empty array adn SolidRecommendationSlider will remove its elements
1798
+ // If network fails, make sure to return empty array and SolidRecommendationSlider will remove its elements
1634
1799
  return [];
1635
- return decoded.listings;
1800
+ const {
1801
+ listings: listings
1802
+ } = decoded;
1803
+ const baseData = {
1804
+ merchant: merchant,
1805
+ market: market,
1806
+ locale: locale
1807
+ };
1808
+ return $f577edfe2240eec1$var$runDisplayTransformersForLooks(baseData, listings, props.displayTransformers_);
1809
+ });
1810
+ $9HbP8$createEffect(() => {
1811
+ const {
1812
+ onNavigation_: onNavigation_
1813
+ } = props;
1814
+ if (onNavigation_) pseudoRouter.on_navigation_ = onNavigation_;
1636
1815
  });
1637
1816
  return (() => {
1638
1817
  var _el$ = $9HbP8$getNextElement($f577edfe2240eec1$var$_tmpl$);
1639
1818
  $9HbP8$insert(_el$, $9HbP8$createComponent((0, $011607bdf658f807$export$e68cff63f76bd15b), {
1640
1819
  get children() {
1641
1820
  return $c4492d24952ed731$export$d41d19e89346fa2({
1642
- product_card_template_: (display, info) => $28ee4f7db3cc44b8$export$44809a8a3e867e30({
1821
+ product_card_template_: display => $28ee4f7db3cc44b8$export$44809a8a3e867e30({
1643
1822
  display_: display,
1644
1823
  FavoriteButton_: props.FavoriteButton_,
1645
1824
  placeholderImageAspectRatio_: props.imagePlaceholderAspectRatio_,
1646
1825
  animationDuration_: expandingAnimationDuration,
1647
- expandedLooksSignal_: $f577edfe2240eec1$var$expandedLooksSignal_
1826
+ expandedLooksSignal_: $f577edfe2240eec1$var$expandedLooksSignal_,
1827
+ priceFormatting_: () => props.priceFormatting_,
1828
+ pseudoRouter_: pseudoRouter
1648
1829
  }),
1649
1830
  recommendations_resource_: looksResource,
1650
1831
  title_: () => props.title_,
@@ -1659,6 +1840,53 @@ function $f577edfe2240eec1$export$1935e6bdfc5ed8ce(props) {
1659
1840
  })();
1660
1841
  }, "LookSlider failed");
1661
1842
  }
1843
+ async function $f577edfe2240eec1$var$runDisplayTransformersForLooks(baseData, listings, displayTransformers) {
1844
+ try {
1845
+ const {
1846
+ products: productTransformer,
1847
+ categories: providedListingTransformer
1848
+ } = displayTransformers || {};
1849
+ if (!productTransformer && !providedListingTransformer) return listings;
1850
+ const listingTransformer = providedListingTransformer || (({
1851
+ data: data
1852
+ }) => data);
1853
+ const displaysToTransform = [];
1854
+ const displayIdsPerListingId = {};
1855
+ const transformedListingsPromise = listingTransformer({
1856
+ ...baseData,
1857
+ data: listings.map(({
1858
+ displays: displays,
1859
+ ...listing
1860
+ }) => {
1861
+ // Populate our displays by id and displayIdToListings object in the .map where we add ancestors to the listings, for peak efficiency
1862
+ for (let i = 0; i < displays.length; i++) {
1863
+ const display = displays[i];
1864
+ const uniqueIdOfDisplay = $16351e4c87b90b3d$export$548d053aba053d79(display);
1865
+ displaysToTransform.push(display);
1866
+ (displayIdsPerListingId[listing.listing_id] ||= []).push(uniqueIdOfDisplay);
1867
+ }
1868
+ return {
1869
+ ...listing,
1870
+ ancestors: []
1871
+ };
1872
+ })
1873
+ });
1874
+ // This allows the person providing the displayTransformer to re-order and remove displays
1875
+ const transformedProducts = productTransformer ? await productTransformer({
1876
+ ...baseData,
1877
+ displays: displaysToTransform
1878
+ }) : displaysToTransform;
1879
+ const transformedListings = await transformedListingsPromise;
1880
+ const transformedDisplayById = Object.fromEntries(transformedProducts.map(display => [$16351e4c87b90b3d$export$548d053aba053d79(display), display]));
1881
+ return transformedListings.map(listing => $9HbP8$mergeProps(listing, {
1882
+ // use mergeProps because in preview browser we add getters in this object, that would be called too early otherwise
1883
+ displays: (displayIdsPerListingId[listing.listing_id] || []).map(displayId => transformedDisplayById[displayId]).filter(v => v)
1884
+ }));
1885
+ } catch (e) {
1886
+ $9HbP8$dwarn("Displaytransformers threw", e);
1887
+ return [];
1888
+ }
1889
+ }
1662
1890
  const $90980bd87c9960f9$export$3064e1e8c6513da3 = new Set();
1663
1891
  let $90980bd87c9960f9$var$has_ran = false;
1664
1892
  function $90980bd87c9960f9$export$5162a71f252e6122() {
@@ -1699,21 +1927,6 @@ function $90980bd87c9960f9$var$starts_with_any_prefix(key) {
1699
1927
  }
1700
1928
  }
1701
1929
 
1702
- /**
1703
- * 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
1704
- * @param clickEvent The click event that triggered the navigation
1705
- */
1706
- function $a281666e5c15c2ec$export$29d28dadc2d6b631(clickEvent) {
1707
- return clickEvent?.button ||
1708
- // if not zero it's a wheel click which opens in new tab
1709
- clickEvent?.metaKey ||
1710
- // if true, cmd button on macOS which opens in new tab
1711
- clickEvent?.ctrlKey ||
1712
- // if true, ctrl button on windows or linux which opens in new tab
1713
- clickEvent?.shiftKey // if true, shift button on windows, linux or macOS which opens in a new window
1714
- ;
1715
- }
1716
-
1717
1930
  /**
1718
1931
  * Symbol used to identify the version of a SearchModal function. Values right now: 1 = 1st gen classic modal, 2 = second gen modal
1719
1932
  */
@@ -1753,12 +1966,6 @@ function $d8dbf52fea1773e2$export$f50b88e2a00918b5(fn) {
1753
1966
  }
1754
1967
  };
1755
1968
  }
1756
- function $8c0f86cb3e266eeb$export$a71e92cfbb498adc(props) {
1757
- return $9HbP8$createMemo(() => {
1758
- const price_formatting = props.price_formatting_;
1759
- return $9HbP8$standard_price_format(props.price_, price_formatting.places_after_comma_, price_formatting.decimal_places_delimiter_, price_formatting.thousands_delimiter_);
1760
- });
1761
- }
1762
1969
  function $f4125ce4984deee6$export$fb40a80c530e5f2b(selectedIndex, groupIndex, indexInGroup) {
1763
1970
  const isSelected = $9HbP8$createMemo(() => {
1764
1971
  const selectedValue = selectedIndex();
@@ -3125,7 +3332,7 @@ function $5285d2814d0fac0c$export$b94867ecbd698f21({
3125
3332
  $9HbP8$insert(_el$5, $9HbP8$createComponent((0, $19976a74d273070d$export$3b621d86b1566b2), {}));
3126
3333
  var _ref$2 = submit_button_ref_;
3127
3334
  typeof _ref$2 === "function" ? $9HbP8$use(_ref$2, _el$6) : submit_button_ref_ = _el$6;
3128
- $9HbP8$spread(_el$6, $9HbP8$mergeProps({
3335
+ $9HbP8$spread(_el$6, $9HbP8$mergeProps1({
3129
3336
  get onClick() {
3130
3337
  return $9HbP8$catchify(() => submit_query_());
3131
3338
  }
@@ -3762,7 +3969,7 @@ function $4ce5b8892775b62d$export$67152d26d4f56ee8({
3762
3969
  const href = $9HbP8$createMemo(() => listing_()?.page_url); // <- 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
3763
3970
  const LinkToListing = props => (() => {
3764
3971
  var _el$ = $9HbP8$getNextElement($4ce5b8892775b62d$var$_tmpl$);
3765
- $9HbP8$spread(_el$, $9HbP8$mergeProps(props, {
3972
+ $9HbP8$spread(_el$, $9HbP8$mergeProps1(props, {
3766
3973
  get href() {
3767
3974
  return href();
3768
3975
  },
@@ -4156,7 +4363,7 @@ function $2f3171b02c8f4a5d$export$af1fb307bbba2417({
4156
4363
  $9HbP8$createComputed($9HbP8$on(search_field_value_[0], () => !suggestions_updating_blocked() && set_selected_index(undefined), {
4157
4364
  defer: true
4158
4365
  })); // reset autocomplete position if query changes
4159
- return [$9HbP8$createComponent((0, $903297121898e5ff$export$d4994a86c6235f72), $9HbP8$mergeProps(sharedSuggestionProps, {
4366
+ return [$9HbP8$createComponent((0, $903297121898e5ff$export$d4994a86c6235f72), $9HbP8$mergeProps1(sharedSuggestionProps, {
4160
4367
  get title_() {
4161
4368
  return i18n_.popular_;
4162
4369
  },
@@ -4166,7 +4373,7 @@ function $2f3171b02c8f4a5d$export$af1fb307bbba2417({
4166
4373
  return itemIndexes_.suggestionsIndex_;
4167
4374
  },
4168
4375
  showPlaceholders_: () => showPlaceholders() || noResults_() && !noResultsPopularSuggestions.latest
4169
- })), $9HbP8$createComponent((0, $903297121898e5ff$export$d4994a86c6235f72), $9HbP8$mergeProps(sharedSuggestionProps, {
4376
+ })), $9HbP8$createComponent((0, $903297121898e5ff$export$d4994a86c6235f72), $9HbP8$mergeProps1(sharedSuggestionProps, {
4170
4377
  get title_() {
4171
4378
  return i18n_.previous_;
4172
4379
  },
@@ -4183,7 +4390,7 @@ function $2f3171b02c8f4a5d$export$af1fb307bbba2417({
4183
4390
  return _el$;
4184
4391
  })(),
4185
4392
  showPlaceholders_: () => false
4186
- })), $9HbP8$createComponent((0, $903297121898e5ff$export$d4994a86c6235f72), $9HbP8$mergeProps(sharedSuggestionProps, {
4393
+ })), $9HbP8$createComponent((0, $903297121898e5ff$export$d4994a86c6235f72), $9HbP8$mergeProps1(sharedSuggestionProps, {
4187
4394
  get title_() {
4188
4395
  return i18n_.content_;
4189
4396
  },
@@ -4705,7 +4912,7 @@ function $024fbc0a2d796fad$export$b2539bed5023c21c(props) {
4705
4912
  return $9HbP8$createComponent($024fbc0a2d796fad$var$TabsContext.Provider, {
4706
4913
  value: new (0, $9HbP8$ListenableSet)(),
4707
4914
  get children() {
4708
- return $9HbP8$createComponent($024fbc0a2d796fad$var$ActualTabs, $9HbP8$mergeProps(props, {
4915
+ return $9HbP8$createComponent($024fbc0a2d796fad$var$ActualTabs, $9HbP8$mergeProps1(props, {
4709
4916
  get children() {
4710
4917
  return props.children;
4711
4918
  }
@@ -4735,7 +4942,7 @@ function $024fbc0a2d796fad$var$ActualTabs(props) {
4735
4942
  },
4736
4943
  children: item => {
4737
4944
  const weSelected = $9HbP8$createMemo(() => isSelected(item().id));
4738
- return $9HbP8$createComponent((0, $9HbP8$Dynamic), $9HbP8$mergeProps({
4945
+ return $9HbP8$createComponent((0, $9HbP8$Dynamic), $9HbP8$mergeProps1({
4739
4946
  get component() {
4740
4947
  return props.AnchorComponent;
4741
4948
  },
@@ -4842,7 +5049,7 @@ function $024fbc0a2d796fad$export$3e41faf802a29e71(props) {
4842
5049
  if (!currentTabs) throw new Error("Tab must be a child of Tabs");
4843
5050
  const id = $9HbP8$createUniqueId();
4844
5051
  const ourSet = currentTabs;
4845
- const extendedProps = $9HbP8$mergeProps1({
5052
+ const extendedProps = $9HbP8$mergeProps({
4846
5053
  id: id
4847
5054
  }, props);
4848
5055
  ourSet.add(extendedProps);
@@ -4956,102 +5163,6 @@ function $ca6f574bd8772184$var$history_state_change(signals, entries, state) {
4956
5163
  }
4957
5164
  });
4958
5165
  }
4959
- class $4fd2ba03703a7d92$export$7e1297a3a19f10d8 {
4960
- /**
4961
- * Function that will be called when we want to navigate, or a string saying it's not an SPA. You can change this OTG
4962
- */ /**
4963
- * 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
4964
- */
4965
- #throwing_on_navigation(...args) {
4966
- const {
4967
- on_navigation_: on_navigation_
4968
- } = this;
4969
- if (typeof on_navigation_ !== "function") throw new Error("on_navigation_ is not a function");
4970
- // make sure that we don't accidentally catchify if the SDK consumer has fucked up
4971
- try {
4972
- return on_navigation_(...args);
4973
- } catch (e) {
4974
- queueMicrotask(() => {
4975
- throw e;
4976
- });
4977
- }
4978
- }
4979
- /**
4980
- * Vue has async router that needs to be awaited (it navigates after a microtask)
4981
- * This standardises waiting for all kinds of routers
4982
- */
4983
- #get_navigation_happened_promise(is_replace) {
4984
- return new Promise(resolve => {
4985
- const handler = what_happened => {
4986
- if (what_happened === (is_replace ? "replaceState" : "pushState")) {
4987
- resolve();
4988
- (0, $9HbP8$instant_exec_on_suspect_history_change).delete(handler);
4989
- }
4990
- };
4991
- (0, $9HbP8$instant_exec_on_suspect_history_change).add(handler);
4992
- });
4993
- }
4994
- navigate_ = {
4995
- /**
4996
- * Call this if you *just* want to replace the state object in history.state
4997
- */
4998
- replace_state_: new_state => {
4999
- // 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
5000
- globalThis?.history?.replaceState(new_state, "");
5001
- },
5002
- /**
5003
- * Call this to change the URL
5004
- * @param new_url_ new URL to go to
5005
- * @param event_ event if you have this in a click handler, will not do anything on cmd/ctrl or non-left click then
5006
- * @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
5007
- * @param is_replace_ if you want to replace the current URL in history instead of pushing a new one
5008
- * @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
5009
- */
5010
- go_to_: $9HbP8$catchify(async ({
5011
- new_url_: raw_new_url,
5012
- event_: event_,
5013
- force_spa_navigation_: force_spa_navigation_,
5014
- is_replace_: is_replace_,
5015
- listing_query_: listing_query_,
5016
- scroll = true
5017
- }) => {
5018
- const new_url_ = raw_new_url instanceof URL ? raw_new_url : new URL(raw_new_url, location.origin);
5019
- const wants_hard_navigation = this.on_navigation_ === "hard_navigation";
5020
- if ($a281666e5c15c2ec$export$29d28dadc2d6b631(event_)) return;
5021
- const different_origin = new_url_.origin !== location.origin;
5022
- if (wants_hard_navigation && (!force_spa_navigation_ || different_origin)) {
5023
- if (force_spa_navigation_ && different_origin)
5024
- // If we call history.pushState on a different origin, it will throw an error, so fallback to hard navigations
5025
- $9HbP8$dwarn("Can't single page navigate to", new_url_.href, "due to different origin, this MIGHT mean you should fix the URLs");
5026
- if (!event_)
5027
- // If we haven't gotten an event, nothing will happen by not calling prevent default, so we need to change the URL
5028
- location.assign(new_url_);
5029
- return;
5030
- }
5031
- event_?.preventDefault();
5032
- const promise = this.#get_navigation_happened_promise(true);
5033
- if (force_spa_navigation_ && wants_hard_navigation) {
5034
- // Don't allow hard navigation if we're forcing SPA navigation, which we do for things where PageReplacer can be used for performance
5035
- const new_state = history.state;
5036
- if (listing_query_) {
5037
- // In JS-UI we need to know the listing_id of the current category, therefore push it into state
5038
- if (!this.listing_query_state_key) $9HbP8$report(new Error("listing_query_state_key is not set"), "error");
5039
- new_state[this.listing_query_state_key] = listing_query_;
5040
- }
5041
- history[is_replace_ ? "replaceState" : "pushState"](new_state, "", new_url_);
5042
- } else this.#throwing_on_navigation.call(this, {
5043
- is_replace: is_replace_,
5044
- new_url: new_url_ instanceof URL ? new_url_ : new URL(new_url_, location.origin),
5045
- scroll: scroll
5046
- });
5047
- await promise;
5048
- })
5049
- };
5050
- constructor(on_navigation, listing_query_state_key) {
5051
- this.listing_query_state_key = listing_query_state_key;
5052
- this.on_navigation_ = on_navigation;
5053
- }
5054
- }
5055
5166
  var $2a26c8ff1ef1fe75$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<div class=image-container>`);
5056
5167
  function $2a26c8ff1ef1fe75$export$41e1a079d40a0d58(props) {
5057
5168
  const [display] = $9HbP8$createResource(() => ({
@@ -5168,7 +5279,7 @@ function $3da8afe3ed57cf34$export$7da560f849543dff({
5168
5279
  _el$5 = _el$4.nextSibling,
5169
5280
  [_el$6, _co$2] = $9HbP8$getNextMarker(_el$5.nextSibling);
5170
5281
  $9HbP8$insert(_el$2, (0, $a458486f22b22f63$export$a2cc176055f8f08), _el$4, _co$);
5171
- $9HbP8$insert(_el$2, $9HbP8$createComponent((0, $c8d5ff4524619fcd$export$d21e32dfedac04be), $9HbP8$mergeProps({
5282
+ $9HbP8$insert(_el$2, $9HbP8$createComponent((0, $c8d5ff4524619fcd$export$d21e32dfedac04be), $9HbP8$mergeProps1({
5172
5283
  get rows() {
5173
5284
  return rows_object_();
5174
5285
  },
@@ -5544,14 +5655,14 @@ function $8560c919ff763930$var$ActualShopTheLookButton(props) {
5544
5655
  const displayStyleValue = $9HbP8$createMemo(() => hasAnythingToShow() ? "" : "none");
5545
5656
  const button = (() => {
5546
5657
  var _el$2 = $9HbP8$getNextElement($8560c919ff763930$var$_tmpl$2);
5547
- $9HbP8$spread(_el$2, $9HbP8$mergeProps(() => localProps.buttonAttributes), false, true);
5658
+ $9HbP8$spread(_el$2, $9HbP8$mergeProps1(() => localProps.buttonAttributes), false, true);
5548
5659
  $9HbP8$insert(_el$2, () => localProps?.buttonAttributes?.children || "Shop the look");
5549
5660
  $9HbP8$runHydrationEvents();
5550
5661
  return _el$2;
5551
5662
  })();
5552
5663
  $9HbP8$createEffect(() => button.style.display = displayStyleValue()); // Set our attributes like this, so we allow total control over the button from the outside via buttonAttributes
5553
5664
  $9HbP8$createEffect(() => !hasAnythingToShow() && closeModal()); // close modal if we ever get into the state of having it open and not having anything to show
5554
- $8560c919ff763930$var$modalProps = $9HbP8$mergeProps1(partForModal, {
5665
+ $8560c919ff763930$var$modalProps = $9HbP8$mergeProps(partForModal, {
5555
5666
  products_to_shop_: products_to_shop_
5556
5667
  });
5557
5668
  button.addEventListener("click", openModal);
@@ -6287,7 +6398,7 @@ var $f8a56ba74eedd0c6$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<svg><path d="M
6287
6398
  function $f8a56ba74eedd0c6$export$f21ab0717a89c77f(props) {
6288
6399
  return (() => {
6289
6400
  var _el$ = $9HbP8$getNextElement($f8a56ba74eedd0c6$var$_tmpl$);
6290
- $9HbP8$spread(_el$, $9HbP8$mergeProps(props, {
6401
+ $9HbP8$spread(_el$, $9HbP8$mergeProps1(props, {
6291
6402
  "xmlns": "http://www.w3.org/2000/svg",
6292
6403
  "width": "11",
6293
6404
  "height": "12"
@@ -7762,7 +7873,7 @@ const $93716a9ad0dea854$export$414f6a19d38e655c = ({
7762
7873
  [_el$6, _co$] = $9HbP8$getNextMarker(_el$5.nextSibling),
7763
7874
  _el$7 = _el$6.nextSibling,
7764
7875
  [_el$8, _co$2] = $9HbP8$getNextMarker(_el$7.nextSibling);
7765
- $9HbP8$spread(_el$2, $9HbP8$mergeProps(attributes, {
7876
+ $9HbP8$spread(_el$2, $9HbP8$mergeProps1(attributes, {
7766
7877
  get disabled() {
7767
7878
  return $9HbP8$memo(() => !!count_zero())() && !is_selected();
7768
7879
  },
@@ -9160,7 +9271,7 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
9160
9271
  // Filter out our transformed ancestors
9161
9272
  const transformedAncestors = Object.fromEntries(transformerResult.filter(item => item.is_suggestion === false).map(item => [item.listing_id, item]));
9162
9273
  // Add the now transformed ancestors into the ancestors of the listing suggestions
9163
- const transformedSuggestions = transformerResult.filter(item => item.is_suggestion !== false).map(item => $9HbP8$mergeProps1(item, {
9274
+ const transformedSuggestions = transformerResult.filter(item => item.is_suggestion !== false).map(item => $9HbP8$mergeProps(item, {
9164
9275
  // Use mergeProps instead of spread since page_url and other properties could be a getter that solid components should call
9165
9276
  ancestors: item.ancestors.map(ancestor => {
9166
9277
  const newAncestor = transformedAncestors[ancestor.listing_id];
@@ -9720,7 +9831,7 @@ function $172e1b898d457050$export$7de92c4c2205ebf3({
9720
9831
  [_el$6, _co$2] = $9HbP8$getNextMarker(_el$5.nextSibling);
9721
9832
  $9HbP8$insert(_el$2, () => i18n_.search_recs_title_());
9722
9833
  $9HbP8$insert(_el$, (0, $a458486f22b22f63$export$a2cc176055f8f08), _el$4, _co$);
9723
- $9HbP8$insert(_el$, $9HbP8$createComponent((0, $c8d5ff4524619fcd$export$d21e32dfedac04be), $9HbP8$mergeProps({
9834
+ $9HbP8$insert(_el$, $9HbP8$createComponent((0, $c8d5ff4524619fcd$export$d21e32dfedac04be), $9HbP8$mergeProps1({
9724
9835
  rows: rows_object,
9725
9836
  layout: "grid",
9726
9837
  element_attributes: {
@@ -10449,7 +10560,7 @@ function $6dee9211e57ac31a$export$ab6b147eec64fea5(props) {
10449
10560
  const container_class = "x" + $9HbP8$createUniqueId();
10450
10561
  const container_element_ = (() => {
10451
10562
  var _el$ = $9HbP8$getNextElement($6dee9211e57ac31a$var$_tmpl$);
10452
- $9HbP8$spread(_el$, $9HbP8$mergeProps(() => props.element_attributes, {
10563
+ $9HbP8$spread(_el$, $9HbP8$mergeProps1(() => props.element_attributes, {
10453
10564
  "classList": {
10454
10565
  [container_class]: true
10455
10566
  }
@@ -10724,7 +10835,7 @@ function $e7a7eb102ddc0c79$var$wrap_blocks_in_div(rendered_content_blocks, max_s
10724
10835
  return _el$;
10725
10836
  }
10726
10837
  });
10727
- return $9HbP8$mergeProps1(block, {
10838
+ return $9HbP8$mergeProps(block, {
10728
10839
  // Create content divs for the blocks with as much fine-grained diffing as possible?
10729
10840
  content: () => {
10730
10841
  // 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
@@ -10965,7 +11076,7 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({
10965
11076
  } = slider;
10966
11077
  const Layout = props => $c8d5ff4524619fcd$export$445d8d3f5f706a40(props, insert_here, true);
10967
11078
  // Do like this, so we don't have to call mergeProps ourselves
10968
- $9HbP8$createComponent(Layout, $9HbP8$mergeProps(layout_options_, {
11079
+ $9HbP8$createComponent(Layout, $9HbP8$mergeProps1(layout_options_, {
10969
11080
  rows: "all",
10970
11081
  get cols_at_size() {
10971
11082
  return modified_cols_at_size();
@@ -11470,7 +11581,7 @@ function $757dac7f7c6c5241$export$9bf11afa910f536e({
11470
11581
  get children() {
11471
11582
  return (() => {
11472
11583
  var _el$34 = $9HbP8$getNextElement($757dac7f7c6c5241$var$_tmpl$5);
11473
- $9HbP8$insert(_el$34, $9HbP8$createComponent((0, $fab07f52c9861732$export$3f1a388cc0d8fed7), $9HbP8$mergeProps(args_for_filtering_, {
11584
+ $9HbP8$insert(_el$34, $9HbP8$createComponent((0, $fab07f52c9861732$export$3f1a388cc0d8fed7), $9HbP8$mergeProps1(args_for_filtering_, {
11474
11585
  are_in_modal_: true
11475
11586
  })));
11476
11587
  return _el$34;
@@ -12236,7 +12347,7 @@ function $b2bf2cdcff8142d8$export$f631859cab12b342({
12236
12347
  [_el$8, _co$] = $9HbP8$getNextMarker(_el$7.nextSibling),
12237
12348
  _el$9 = _el$8.nextSibling,
12238
12349
  [_el$10, _co$2] = $9HbP8$getNextMarker(_el$9.nextSibling);
12239
- $9HbP8$insert(_el$4, $9HbP8$createComponent(LinkIfPossible, $9HbP8$mergeProps(make_link_attributes, {
12350
+ $9HbP8$insert(_el$4, $9HbP8$createComponent(LinkIfPossible, $9HbP8$mergeProps1(make_link_attributes, {
12240
12351
  tabIndex: "-1",
12241
12352
  get children() {
12242
12353
  return $9HbP8$createComponent((0, $190927650b4840eb$export$605674723bcc715c), {
@@ -12245,7 +12356,7 @@ function $b2bf2cdcff8142d8$export$f631859cab12b342({
12245
12356
  });
12246
12357
  }
12247
12358
  })));
12248
- $9HbP8$insert(_el$5, $9HbP8$createComponent(LinkIfPossible, $9HbP8$mergeProps({
12359
+ $9HbP8$insert(_el$5, $9HbP8$createComponent(LinkIfPossible, $9HbP8$mergeProps1({
12249
12360
  "class": "content-title line-clamp"
12250
12361
  }, make_link_attributes, {
12251
12362
  get title() {
@@ -12392,7 +12503,7 @@ function $49de9d31aeea1b5e$export$6d0c9c22f6652669({
12392
12503
  },
12393
12504
  number_of_results_: num_results
12394
12505
  }), _el$3, _co$);
12395
- $9HbP8$insert(_el$, $9HbP8$createComponent((0, $c8d5ff4524619fcd$export$d21e32dfedac04be), $9HbP8$mergeProps({
12506
+ $9HbP8$insert(_el$, $9HbP8$createComponent((0, $c8d5ff4524619fcd$export$d21e32dfedac04be), $9HbP8$mergeProps1({
12396
12507
  layout: "grid",
12397
12508
  element_attributes: {
12398
12509
  class: "cards"
@@ -12779,7 +12890,7 @@ function $7097477c78a89208$export$a54ec244c8863715({
12779
12890
  });
12780
12891
  const [sort_and_filter_element_, set_sort_and_filter_element_] = $9HbP8$createSignal();
12781
12892
  const no_results_text_ = $9HbP8$createMemo(() => (search_results_()?.content_search_links?.length ? i18n_.no_products_ : i18n_.no_results_text_)());
12782
- const results_for = $9HbP8$createComponent((0, $f8c929beb82c512b$export$9dd50d35b9d94fdf), $9HbP8$mergeProps({
12893
+ const results_for = $9HbP8$createComponent((0, $f8c929beb82c512b$export$9dd50d35b9d94fdf), $9HbP8$mergeProps1({
12783
12894
  get type() {
12784
12895
  return (0, $f8c929beb82c512b$export$2452208c79fe93ea).products;
12785
12896
  },
@@ -14672,7 +14783,7 @@ function $df5d81d0fe61ff21$var$add_us_to_crumbs(plp_meta) {
14672
14783
  return $9HbP8$createMemo(() => {
14673
14784
  const api_value = plp_meta()?.breadcrumbs;
14674
14785
  if (!api_value) return api_value;
14675
- return [...api_value, $9HbP8$mergeProps1(plp_meta(), {
14786
+ return [...api_value, $9HbP8$mergeProps(plp_meta(), {
14676
14787
  get page_url() {
14677
14788
  return href_accessor();
14678
14789
  }