@depict-ai/ui 3.0.4 → 3.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ES10/index.cjs CHANGED
@@ -83,7 +83,7 @@ $parcel$export(module.exports, "defaultColsAtSize", () => $33eed84f447aa0c0$expo
83
83
  $parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $33eed84f447aa0c0$export$7bf543b9d9be2c22);
84
84
  $parcel$export(module.exports, "version", () => $aa1938dec50d6c12$export$83d89fbfd8236492);
85
85
  /*! Depict.ai search and product listing SDK */
86
- const $aa1938dec50d6c12$export$83d89fbfd8236492 = "3.0.4";
86
+ const $aa1938dec50d6c12$export$83d89fbfd8236492 = "3.0.6";
87
87
  const $9d19451330d04c3c$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 14 26"><path d="M2 24.656c-.078 0-.156-.016-.234-.047s-.133-.066-.187-.129c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422l10.371-10.371L1.578 2.883c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422.258-.176.422-.176.305.059.422.176l10.805 10.793a.59.59 0 0 1 .176.434c0 .172-.059.305-.176.422L2.422 24.48a.42.42 0 0 1-.199.129.54.54 0 0 1-.223.047zm0 0"fill=#0f0f0f>`);
88
88
  function $9d19451330d04c3c$export$8be2714ec7f169ee() {
89
89
  let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -1039,27 +1039,31 @@ function $76012c4468a53d1f$export$43f0fb951fcb0c54(_ref) {
1039
1039
  });
1040
1040
  }
1041
1041
  // source: https://medium.com/@pancemarko/deep-equality-in-javascript-determining-if-two-objects-are-equal-bf98cf47e934
1042
+ // deeply diffs two objects
1043
+ // Modified by chatGPT to not be recursive, since stiga was getting a stack overflow just due to the size of their data
1044
+ // Modified futher to bias towards saying objects are equal non-primitive objects differ
1042
1045
  function $76012c4468a53d1f$var$deep_equal(obj1, obj2) {
1043
- if (obj1 === obj2) return true;
1044
- if (Array.isArray(obj1) && Array.isArray(obj2)) {
1045
- if (obj1.length !== obj2.length) return false;
1046
- return obj1.every((elem, index) => {
1047
- return $76012c4468a53d1f$var$deep_equal(elem, obj2[index]);
1048
- });
1049
- }
1050
- if (typeof obj1 === "object" && typeof obj2 === "object" && obj1 !== null && obj2 !== null) {
1051
- if (Array.isArray(obj1) || Array.isArray(obj2)) return false;
1052
- const keys1 = Object.keys(obj1);
1053
- const keys2 = Object.keys(obj2);
1054
- if (keys1.length !== keys2.length || !keys1.every(key => keys2.includes(key))) return false;
1055
- for (const key in obj1) {
1056
- if ($76012c4468a53d1f$var$result_ids.includes(key)) continue; // ignore keys changing with every request
1057
- const isEqual = $76012c4468a53d1f$var$deep_equal(obj1[key], obj2[key]);
1058
- if (!isEqual) return false;
1059
- }
1060
- return true;
1046
+ const stack = [[obj1, obj2]];
1047
+ while (stack.length > 0) {
1048
+ const [currentObj1, currentObj2] = stack.pop();
1049
+ if (currentObj1 === currentObj2) continue;
1050
+ if (Array.isArray(currentObj1) && Array.isArray(currentObj2)) {
1051
+ if (currentObj1.length !== currentObj2.length) return false;
1052
+ for (let i = 0; i < currentObj1.length; i++) stack.push([currentObj1[i], currentObj2[i]]);
1053
+ } else if (typeof currentObj1 === "object" && typeof currentObj2 === "object" && currentObj1 !== null && currentObj2 !== null) {
1054
+ if (Array.isArray(currentObj1) || Array.isArray(currentObj2)) return false;
1055
+ const keys1 = Object.keys(currentObj1);
1056
+ const keys2 = Object.keys(currentObj2);
1057
+ if (keys1.length !== keys2.length || !keys1.every(key => keys2.includes(key))) return false;
1058
+ for (let key in currentObj1) {
1059
+ if ($76012c4468a53d1f$var$result_ids.includes(key)) continue; // ignore comparing values for keys we know are changing with every request
1060
+ stack.push([currentObj1[key], currentObj2[key]]);
1061
+ }
1062
+ } else if (typeof currentObj1 !== "function" && typeof currentObj2 !== "function")
1063
+ // Claim that all functions are equal, since the only way a function ends up here is because someone added it in the displayTransformer and that shouldn't force us to re-render, right?
1064
+ return false;
1061
1065
  }
1062
- return false;
1066
+ return true;
1063
1067
  }
1064
1068
  const $6c2c739b113a8ddf$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<div>`),
1065
1069
  $6c2c739b113a8ddf$var$_tmpl$2 = /*#__PURE__*/$52FdA$solidjsweb.template(`<style type=text/css>`);
@@ -5830,6 +5834,9 @@ function $b3dc12c672c9df24$export$967e966fca9515e(api_response) {
5830
5834
  }
5831
5835
  return api_response;
5832
5836
  }
5837
+
5838
+ // Minifiable and tree-shakable enum
5839
+ // Why not use const enum? See https://gitlab.com/depict-ai/depict.ai/-/merge_requests/9223#note_1675965260
5833
5840
  const $c3739e86187f2054$export$74ee7529ce0f8a00 = "listingId";
5834
5841
  const $c3739e86187f2054$export$5aae649db1b959fc = "externalId";
5835
5842
  function $e270e9f953fcbc58$var$_classPrivateMethodInitSpec(obj, privateSet) {
@@ -8663,7 +8670,7 @@ function $8b366fdb0c76194d$var$clear_if_opened_new_tab_with_sideways_url_params_
8663
8670
  });
8664
8671
  tracking_function_for_plp_results(plp_results_);
8665
8672
  }
8666
- const $c3a7faae6f2b93c9$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class=statement style=white-space:pre-wrap>No listingId specified, this is probably unintentional. Make sure to create (and insert) the CategoryPage *after* you have specified a listingId/externalId.`),
8673
+ const $c3a7faae6f2b93c9$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class=statement style=white-space:pre-wrap>No \`id\` specified in \`listingQuery\`, this is probably unintentional. Make sure to create (and insert) the CategoryPage *after* you have specified a listingQuery.`),
8667
8674
  $c3a7faae6f2b93c9$var$_tmpl$2 = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class=buttons><button class="ok major">`);
8668
8675
  function $c3a7faae6f2b93c9$export$7af06a63c5a976c9(el, listing_id, i18n_) {
8669
8676
  if (!(0, $52FdA$depictaiutilishared.is_debug)) return; // Just to make sure we don't show this in production
@@ -8675,7 +8682,7 @@ function $c3a7faae6f2b93c9$export$7af06a63c5a976c9(el, listing_id, i18n_) {
8675
8682
  return $52FdA$solidjs.runWithOwner(owner, () => $52FdA$solidjs.createEffect(() => {
8676
8683
  if (!document.documentElement.contains(element)) return;
8677
8684
  if (!listing_id()) {
8678
- const warning = "No listingId specified, this is probably unintentional. Make sure to create (and insert) the CategoryPage *after* you have specified a listingId/externalId.";
8685
+ const warning = "No `id` specified in `listingQuery`, this is probably unintentional. Make sure to create (and insert) the CategoryPage *after* you have specified a listingQuery.";
8679
8686
  $52FdA$depictaiutilishared.dwarn(warning);
8680
8687
  const {
8681
8688
  close_toast_: close_toast_
@@ -9514,7 +9521,7 @@ function $9cbefc32b9dab36d$export$e2bf8ce7779e827e(props) {
9514
9521
  category_title: category_title
9515
9522
  } = props;
9516
9523
  const shared_properties = $9cbefc32b9dab36d$var$get_shared_properties(depict_category);
9517
- const diffableListingQuery = $52FdA$solidjs.createMemo(() => Object.values(depict_category.listing_query).join(""));
9524
+ const diffableListingQuery = $52FdA$solidjs.createMemo(() => Object.values(depict_category.listing_query || {}).join(""));
9518
9525
  return $d05611ff6b8c8357$export$23fca46f3143581f(() => {
9519
9526
  $52FdA$solidjs.createEffect(prev => {
9520
9527
  // this is here (and not on DepictCategory) so that people also know when PageReplacer removes the page, it's intended to help people replace their own content when a depict page is navigated, see https://depictaiworkspace.slack.com/archives/C04M8MGCF3K/p1691670636155369
@@ -9565,7 +9572,10 @@ function $9cbefc32b9dab36d$export$e2bf8ce7779e827e(props) {
9565
9572
  min_products_to_fetch_: $9cbefc32b9dab36d$var$min_products_to_fetch_,
9566
9573
  local_filter_cache_: local_filter_cache_,
9567
9574
  id_to_query_for_: $52FdA$solidjs.createMemo(() => !depict_category.disable_override_listing_id && override_listing_id_accessor_() || depict_category.listing_query.id),
9568
- id_type_: $52FdA$solidjs.createMemo(() => !depict_category.disable_override_listing_id && override_listing_id_accessor_() ? $c3739e86187f2054$export$74ee7529ce0f8a00 : depict_category.listing_query.type),
9575
+ id_type_: $52FdA$solidjs.createMemo(() => {
9576
+ if (!depict_category.disable_override_listing_id && override_listing_id_accessor_()) return $c3739e86187f2054$export$74ee7529ce0f8a00;
9577
+ return depict_category.listing_query.type;
9578
+ }),
9569
9579
  i18n_: i18n_,
9570
9580
  show_quicklinks_: $52FdA$solidjs.createMemo(() => {
9571
9581
  var _props$show_quicklink;
package/ES10/index.d.ts CHANGED
@@ -10,7 +10,7 @@ import { ProductListingRequestV3 } from "@depict-ai/types/api/ProductListingRequ
10
10
  import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
11
11
  import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
12
12
  import { SearchFilter as _SearchFilter2 } from "@depict-ai/types/api/SearchRequestV2";
13
- export const version = "3.0.4";
13
+ export const version = "3.0.6";
14
14
  export type SDKColsAtSize = [number, number?][];
15
15
  /**
16
16
  * Transform SDK ColsAtSize into valid Layout ColsAtSize
package/ES10/index.js CHANGED
@@ -10,7 +10,7 @@ import { createStore as $8tj43$createStore, reconcile as $8tj43$reconcile } from
10
10
  /*! Depict.ai search and product listing SDK */
11
11
  import { register_es_version } from "../multi_import_deduplicator.mjs";
12
12
  register_es_version("ui", "ES10");
13
- const $8db9a15135765c11$export$83d89fbfd8236492 = "3.0.4";
13
+ const $8db9a15135765c11$export$83d89fbfd8236492 = "3.0.6";
14
14
  const $ca6ab5f08bd28bca$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 14 26"><path d="M2 24.656c-.078 0-.156-.016-.234-.047s-.133-.066-.187-.129c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422l10.371-10.371L1.578 2.883c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422.258-.176.422-.176.305.059.422.176l10.805 10.793a.59.59 0 0 1 .176.434c0 .172-.059.305-.176.422L2.422 24.48a.42.42 0 0 1-.199.129.54.54 0 0 1-.223.047zm0 0"fill=#0f0f0f>`);
15
15
  function $ca6ab5f08bd28bca$export$8be2714ec7f169ee() {
16
16
  let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -966,27 +966,31 @@ function $2d7bad8684bc7f44$export$43f0fb951fcb0c54(_ref) {
966
966
  });
967
967
  }
968
968
  // source: https://medium.com/@pancemarko/deep-equality-in-javascript-determining-if-two-objects-are-equal-bf98cf47e934
969
+ // deeply diffs two objects
970
+ // Modified by chatGPT to not be recursive, since stiga was getting a stack overflow just due to the size of their data
971
+ // Modified futher to bias towards saying objects are equal non-primitive objects differ
969
972
  function $2d7bad8684bc7f44$var$deep_equal(obj1, obj2) {
970
- if (obj1 === obj2) return true;
971
- if (Array.isArray(obj1) && Array.isArray(obj2)) {
972
- if (obj1.length !== obj2.length) return false;
973
- return obj1.every((elem, index) => {
974
- return $2d7bad8684bc7f44$var$deep_equal(elem, obj2[index]);
975
- });
976
- }
977
- if (typeof obj1 === "object" && typeof obj2 === "object" && obj1 !== null && obj2 !== null) {
978
- if (Array.isArray(obj1) || Array.isArray(obj2)) return false;
979
- const keys1 = Object.keys(obj1);
980
- const keys2 = Object.keys(obj2);
981
- if (keys1.length !== keys2.length || !keys1.every(key => keys2.includes(key))) return false;
982
- for (const key in obj1) {
983
- if ($2d7bad8684bc7f44$var$result_ids.includes(key)) continue; // ignore keys changing with every request
984
- const isEqual = $2d7bad8684bc7f44$var$deep_equal(obj1[key], obj2[key]);
985
- if (!isEqual) return false;
986
- }
987
- return true;
973
+ const stack = [[obj1, obj2]];
974
+ while (stack.length > 0) {
975
+ const [currentObj1, currentObj2] = stack.pop();
976
+ if (currentObj1 === currentObj2) continue;
977
+ if (Array.isArray(currentObj1) && Array.isArray(currentObj2)) {
978
+ if (currentObj1.length !== currentObj2.length) return false;
979
+ for (let i = 0; i < currentObj1.length; i++) stack.push([currentObj1[i], currentObj2[i]]);
980
+ } else if (typeof currentObj1 === "object" && typeof currentObj2 === "object" && currentObj1 !== null && currentObj2 !== null) {
981
+ if (Array.isArray(currentObj1) || Array.isArray(currentObj2)) return false;
982
+ const keys1 = Object.keys(currentObj1);
983
+ const keys2 = Object.keys(currentObj2);
984
+ if (keys1.length !== keys2.length || !keys1.every(key => keys2.includes(key))) return false;
985
+ for (let key in currentObj1) {
986
+ if ($2d7bad8684bc7f44$var$result_ids.includes(key)) continue; // ignore comparing values for keys we know are changing with every request
987
+ stack.push([currentObj1[key], currentObj2[key]]);
988
+ }
989
+ } else if (typeof currentObj1 !== "function" && typeof currentObj2 !== "function")
990
+ // Claim that all functions are equal, since the only way a function ends up here is because someone added it in the displayTransformer and that shouldn't force us to re-render, right?
991
+ return false;
988
992
  }
989
- return false;
993
+ return true;
990
994
  }
991
995
  const $63f1f8dbcd07d3b0$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<div>`),
992
996
  $63f1f8dbcd07d3b0$var$_tmpl$2 = /*#__PURE__*/$8tj43$template(`<style type=text/css>`);
@@ -5757,6 +5761,9 @@ function $ed0fefda39a0f15d$export$967e966fca9515e(api_response) {
5757
5761
  }
5758
5762
  return api_response;
5759
5763
  }
5764
+
5765
+ // Minifiable and tree-shakable enum
5766
+ // Why not use const enum? See https://gitlab.com/depict-ai/depict.ai/-/merge_requests/9223#note_1675965260
5760
5767
  const $397620a4d7958ed1$export$74ee7529ce0f8a00 = "listingId";
5761
5768
  const $397620a4d7958ed1$export$5aae649db1b959fc = "externalId";
5762
5769
  function $284849364a6ef73a$var$_classPrivateMethodInitSpec(obj, privateSet) {
@@ -8590,7 +8597,7 @@ function $a4777acaffa35a82$var$clear_if_opened_new_tab_with_sideways_url_params_
8590
8597
  });
8591
8598
  tracking_function_for_plp_results(plp_results_);
8592
8599
  }
8593
- const $1145661fd3ca5519$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<div class=statement style=white-space:pre-wrap>No listingId specified, this is probably unintentional. Make sure to create (and insert) the CategoryPage *after* you have specified a listingId/externalId.`),
8600
+ const $1145661fd3ca5519$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<div class=statement style=white-space:pre-wrap>No \`id\` specified in \`listingQuery\`, this is probably unintentional. Make sure to create (and insert) the CategoryPage *after* you have specified a listingQuery.`),
8594
8601
  $1145661fd3ca5519$var$_tmpl$2 = /*#__PURE__*/$8tj43$template(`<div class=buttons><button class="ok major">`);
8595
8602
  function $1145661fd3ca5519$export$7af06a63c5a976c9(el, listing_id, i18n_) {
8596
8603
  if (!(0, $8tj43$is_debug)) return; // Just to make sure we don't show this in production
@@ -8602,7 +8609,7 @@ function $1145661fd3ca5519$export$7af06a63c5a976c9(el, listing_id, i18n_) {
8602
8609
  return $8tj43$runWithOwner(owner, () => $8tj43$createEffect(() => {
8603
8610
  if (!document.documentElement.contains(element)) return;
8604
8611
  if (!listing_id()) {
8605
- const warning = "No listingId specified, this is probably unintentional. Make sure to create (and insert) the CategoryPage *after* you have specified a listingId/externalId.";
8612
+ const warning = "No `id` specified in `listingQuery`, this is probably unintentional. Make sure to create (and insert) the CategoryPage *after* you have specified a listingQuery.";
8606
8613
  $8tj43$dwarn(warning);
8607
8614
  const {
8608
8615
  close_toast_: close_toast_
@@ -9441,7 +9448,7 @@ function $f5f54892fd0c7d9f$export$e2bf8ce7779e827e(props) {
9441
9448
  category_title: category_title
9442
9449
  } = props;
9443
9450
  const shared_properties = $f5f54892fd0c7d9f$var$get_shared_properties(depict_category);
9444
- const diffableListingQuery = $8tj43$createMemo(() => Object.values(depict_category.listing_query).join(""));
9451
+ const diffableListingQuery = $8tj43$createMemo(() => Object.values(depict_category.listing_query || {}).join(""));
9445
9452
  return $83e8cf2c0b87a58a$export$23fca46f3143581f(() => {
9446
9453
  $8tj43$createEffect(prev => {
9447
9454
  // this is here (and not on DepictCategory) so that people also know when PageReplacer removes the page, it's intended to help people replace their own content when a depict page is navigated, see https://depictaiworkspace.slack.com/archives/C04M8MGCF3K/p1691670636155369
@@ -9492,7 +9499,10 @@ function $f5f54892fd0c7d9f$export$e2bf8ce7779e827e(props) {
9492
9499
  min_products_to_fetch_: $f5f54892fd0c7d9f$var$min_products_to_fetch_,
9493
9500
  local_filter_cache_: local_filter_cache_,
9494
9501
  id_to_query_for_: $8tj43$createMemo(() => !depict_category.disable_override_listing_id && override_listing_id_accessor_() || depict_category.listing_query.id),
9495
- id_type_: $8tj43$createMemo(() => !depict_category.disable_override_listing_id && override_listing_id_accessor_() ? $397620a4d7958ed1$export$74ee7529ce0f8a00 : depict_category.listing_query.type),
9502
+ id_type_: $8tj43$createMemo(() => {
9503
+ if (!depict_category.disable_override_listing_id && override_listing_id_accessor_()) return $397620a4d7958ed1$export$74ee7529ce0f8a00;
9504
+ return depict_category.listing_query.type;
9505
+ }),
9496
9506
  i18n_: i18n_,
9497
9507
  show_quicklinks_: $8tj43$createMemo(() => {
9498
9508
  var _props$show_quicklink;
package/latest/index.cjs CHANGED
@@ -77,7 +77,7 @@ $parcel$export(module.exports, "defaultColsAtSize", () => $a3280f0aad997933$expo
77
77
  $parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $a3280f0aad997933$export$7bf543b9d9be2c22);
78
78
  $parcel$export(module.exports, "version", () => $b757f75811f3261f$export$83d89fbfd8236492);
79
79
  /*! Depict.ai search and product listing SDK */
80
- const $b757f75811f3261f$export$83d89fbfd8236492 = "3.0.4";
80
+ const $b757f75811f3261f$export$83d89fbfd8236492 = "3.0.6";
81
81
  const $0f313083912e447a$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 14 26"><path d="M2 24.656c-.078 0-.156-.016-.234-.047s-.133-.066-.187-.129c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422l10.371-10.371L1.578 2.883c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422.258-.176.422-.176.305.059.422.176l10.805 10.793a.59.59 0 0 1 .176.434c0 .172-.059.305-.176.422L2.422 24.48a.42.42 0 0 1-.199.129.54.54 0 0 1-.223.047zm0 0"fill=#0f0f0f>`);
82
82
  function $0f313083912e447a$export$8be2714ec7f169ee(props = {}) {
83
83
  return (() => {
@@ -980,27 +980,31 @@ function $a73063cc642f3e5f$export$43f0fb951fcb0c54({
980
980
  });
981
981
  }
982
982
  // source: https://medium.com/@pancemarko/deep-equality-in-javascript-determining-if-two-objects-are-equal-bf98cf47e934
983
+ // deeply diffs two objects
984
+ // Modified by chatGPT to not be recursive, since stiga was getting a stack overflow just due to the size of their data
985
+ // Modified futher to bias towards saying objects are equal non-primitive objects differ
983
986
  function $a73063cc642f3e5f$var$deep_equal(obj1, obj2) {
984
- if (obj1 === obj2) return true;
985
- if (Array.isArray(obj1) && Array.isArray(obj2)) {
986
- if (obj1.length !== obj2.length) return false;
987
- return obj1.every((elem, index) => {
988
- return $a73063cc642f3e5f$var$deep_equal(elem, obj2[index]);
989
- });
990
- }
991
- if (typeof obj1 === "object" && typeof obj2 === "object" && obj1 !== null && obj2 !== null) {
992
- if (Array.isArray(obj1) || Array.isArray(obj2)) return false;
993
- const keys1 = Object.keys(obj1);
994
- const keys2 = Object.keys(obj2);
995
- if (keys1.length !== keys2.length || !keys1.every(key => keys2.includes(key))) return false;
996
- for (const key in obj1) {
997
- if ($a73063cc642f3e5f$var$result_ids.includes(key)) continue; // ignore keys changing with every request
998
- const isEqual = $a73063cc642f3e5f$var$deep_equal(obj1[key], obj2[key]);
999
- if (!isEqual) return false;
1000
- }
1001
- return true;
987
+ const stack = [[obj1, obj2]];
988
+ while (stack.length > 0) {
989
+ const [currentObj1, currentObj2] = stack.pop();
990
+ if (currentObj1 === currentObj2) continue;
991
+ if (Array.isArray(currentObj1) && Array.isArray(currentObj2)) {
992
+ if (currentObj1.length !== currentObj2.length) return false;
993
+ for (let i = 0; i < currentObj1.length; i++) stack.push([currentObj1[i], currentObj2[i]]);
994
+ } else if (typeof currentObj1 === "object" && typeof currentObj2 === "object" && currentObj1 !== null && currentObj2 !== null) {
995
+ if (Array.isArray(currentObj1) || Array.isArray(currentObj2)) return false;
996
+ const keys1 = Object.keys(currentObj1);
997
+ const keys2 = Object.keys(currentObj2);
998
+ if (keys1.length !== keys2.length || !keys1.every(key => keys2.includes(key))) return false;
999
+ for (let key in currentObj1) {
1000
+ if ($a73063cc642f3e5f$var$result_ids.includes(key)) continue; // ignore comparing values for keys we know are changing with every request
1001
+ stack.push([currentObj1[key], currentObj2[key]]);
1002
+ }
1003
+ } else if (typeof currentObj1 !== "function" && typeof currentObj2 !== "function")
1004
+ // Claim that all functions are equal, since the only way a function ends up here is because someone added it in the displayTransformer and that shouldn't force us to re-render, right?
1005
+ return false;
1002
1006
  }
1003
- return false;
1007
+ return true;
1004
1008
  }
1005
1009
  const $f48d0fbb00835aaa$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div>`),
1006
1010
  $f48d0fbb00835aaa$var$_tmpl$2 = /*#__PURE__*/$gVhhF$solidjsweb.template(`<style type=text/css>`);
@@ -5492,6 +5496,9 @@ function $67dc366d96177e70$export$967e966fca9515e(api_response) {
5492
5496
  }
5493
5497
  return api_response;
5494
5498
  }
5499
+
5500
+ // Minifiable and tree-shakable enum
5501
+ // Why not use const enum? See https://gitlab.com/depict-ai/depict.ai/-/merge_requests/9223#note_1675965260
5495
5502
  const $779741d0f266ea8c$export$74ee7529ce0f8a00 = "listingId";
5496
5503
  const $779741d0f266ea8c$export$5aae649db1b959fc = "externalId";
5497
5504
  const $e1d6c0f3d89d531c$var$v3_base_url = (0, $gVhhF$depictaiutilishared.base_url) + "/v3/";
@@ -8133,7 +8140,7 @@ function $ef972f5c10b1c5b4$var$clear_if_opened_new_tab_with_sideways_url_params_
8133
8140
  });
8134
8141
  tracking_function_for_plp_results(plp_results_);
8135
8142
  }
8136
- const $bb9760b7a8acdc18$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div class=statement style=white-space:pre-wrap>No listingId specified, this is probably unintentional. Make sure to create (and insert) the CategoryPage *after* you have specified a listingId/externalId.`),
8143
+ const $bb9760b7a8acdc18$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div class=statement style=white-space:pre-wrap>No \`id\` specified in \`listingQuery\`, this is probably unintentional. Make sure to create (and insert) the CategoryPage *after* you have specified a listingQuery.`),
8137
8144
  $bb9760b7a8acdc18$var$_tmpl$2 = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div class=buttons><button class="ok major">`);
8138
8145
  function $bb9760b7a8acdc18$export$7af06a63c5a976c9(el, listing_id, i18n_) {
8139
8146
  if (!(0, $gVhhF$depictaiutilishared.is_debug)) return; // Just to make sure we don't show this in production
@@ -8143,7 +8150,7 @@ function $bb9760b7a8acdc18$export$7af06a63c5a976c9(el, listing_id, i18n_) {
8143
8150
  }) => $gVhhF$solidjs.runWithOwner(owner, () => $gVhhF$solidjs.createEffect(() => {
8144
8151
  if (!document.documentElement.contains(element)) return;
8145
8152
  if (!listing_id()) {
8146
- const warning = "No listingId specified, this is probably unintentional. Make sure to create (and insert) the CategoryPage *after* you have specified a listingId/externalId.";
8153
+ const warning = "No `id` specified in `listingQuery`, this is probably unintentional. Make sure to create (and insert) the CategoryPage *after* you have specified a listingQuery.";
8147
8154
  $gVhhF$depictaiutilishared.dwarn(warning);
8148
8155
  const {
8149
8156
  close_toast_: close_toast_
@@ -8881,7 +8888,7 @@ function $48567ac5b39bac56$export$e2bf8ce7779e827e(props) {
8881
8888
  category_title: category_title
8882
8889
  } = props;
8883
8890
  const shared_properties = $48567ac5b39bac56$var$get_shared_properties(depict_category);
8884
- const diffableListingQuery = $gVhhF$solidjs.createMemo(() => Object.values(depict_category.listing_query).join(""));
8891
+ const diffableListingQuery = $gVhhF$solidjs.createMemo(() => Object.values(depict_category.listing_query || {}).join(""));
8885
8892
  return $95837413165cc2df$export$23fca46f3143581f(() => {
8886
8893
  $gVhhF$solidjs.createEffect(prev => {
8887
8894
  // this is here (and not on DepictCategory) so that people also know when PageReplacer removes the page, it's intended to help people replace their own content when a depict page is navigated, see https://depictaiworkspace.slack.com/archives/C04M8MGCF3K/p1691670636155369
@@ -8932,7 +8939,10 @@ function $48567ac5b39bac56$export$e2bf8ce7779e827e(props) {
8932
8939
  min_products_to_fetch_: $48567ac5b39bac56$var$min_products_to_fetch_,
8933
8940
  local_filter_cache_: local_filter_cache_,
8934
8941
  id_to_query_for_: $gVhhF$solidjs.createMemo(() => !depict_category.disable_override_listing_id && override_listing_id_accessor_() || depict_category.listing_query.id),
8935
- id_type_: $gVhhF$solidjs.createMemo(() => !depict_category.disable_override_listing_id && override_listing_id_accessor_() ? $779741d0f266ea8c$export$74ee7529ce0f8a00 : depict_category.listing_query.type),
8942
+ id_type_: $gVhhF$solidjs.createMemo(() => {
8943
+ if (!depict_category.disable_override_listing_id && override_listing_id_accessor_()) return $779741d0f266ea8c$export$74ee7529ce0f8a00;
8944
+ return depict_category.listing_query.type;
8945
+ }),
8936
8946
  i18n_: i18n_,
8937
8947
  show_quicklinks_: $gVhhF$solidjs.createMemo(() => props.show_quicklinks ?? true),
8938
8948
  category_title_: category_title,
package/latest/index.d.ts CHANGED
@@ -10,7 +10,7 @@ import { ProductListingRequestV3 } from "@depict-ai/types/api/ProductListingRequ
10
10
  import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
11
11
  import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
12
12
  import { SearchFilter as _SearchFilter2 } from "@depict-ai/types/api/SearchRequestV2";
13
- export const version = "3.0.4";
13
+ export const version = "3.0.6";
14
14
  export type SDKColsAtSize = [number, number?][];
15
15
  /**
16
16
  * Transform SDK ColsAtSize into valid Layout ColsAtSize
package/latest/index.js CHANGED
@@ -7,7 +7,7 @@ import { createStore as $9HbP8$createStore, reconcile as $9HbP8$reconcile } from
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 = "3.0.4";
10
+ const $ec291e0010116877$export$83d89fbfd8236492 = "3.0.6";
11
11
  const $fbbadcb080ad1d4a$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 14 26"><path d="M2 24.656c-.078 0-.156-.016-.234-.047s-.133-.066-.187-.129c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422l10.371-10.371L1.578 2.883c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422.258-.176.422-.176.305.059.422.176l10.805 10.793a.59.59 0 0 1 .176.434c0 .172-.059.305-.176.422L2.422 24.48a.42.42 0 0 1-.199.129.54.54 0 0 1-.223.047zm0 0"fill=#0f0f0f>`);
12
12
  function $fbbadcb080ad1d4a$export$8be2714ec7f169ee(props = {}) {
13
13
  return (() => {
@@ -910,27 +910,31 @@ function $29ec7cddbe1d3484$export$43f0fb951fcb0c54({
910
910
  });
911
911
  }
912
912
  // source: https://medium.com/@pancemarko/deep-equality-in-javascript-determining-if-two-objects-are-equal-bf98cf47e934
913
+ // deeply diffs two objects
914
+ // Modified by chatGPT to not be recursive, since stiga was getting a stack overflow just due to the size of their data
915
+ // Modified futher to bias towards saying objects are equal non-primitive objects differ
913
916
  function $29ec7cddbe1d3484$var$deep_equal(obj1, obj2) {
914
- if (obj1 === obj2) return true;
915
- if (Array.isArray(obj1) && Array.isArray(obj2)) {
916
- if (obj1.length !== obj2.length) return false;
917
- return obj1.every((elem, index) => {
918
- return $29ec7cddbe1d3484$var$deep_equal(elem, obj2[index]);
919
- });
920
- }
921
- if (typeof obj1 === "object" && typeof obj2 === "object" && obj1 !== null && obj2 !== null) {
922
- if (Array.isArray(obj1) || Array.isArray(obj2)) return false;
923
- const keys1 = Object.keys(obj1);
924
- const keys2 = Object.keys(obj2);
925
- if (keys1.length !== keys2.length || !keys1.every(key => keys2.includes(key))) return false;
926
- for (const key in obj1) {
927
- if ($29ec7cddbe1d3484$var$result_ids.includes(key)) continue; // ignore keys changing with every request
928
- const isEqual = $29ec7cddbe1d3484$var$deep_equal(obj1[key], obj2[key]);
929
- if (!isEqual) return false;
930
- }
931
- return true;
917
+ const stack = [[obj1, obj2]];
918
+ while (stack.length > 0) {
919
+ const [currentObj1, currentObj2] = stack.pop();
920
+ if (currentObj1 === currentObj2) continue;
921
+ if (Array.isArray(currentObj1) && Array.isArray(currentObj2)) {
922
+ if (currentObj1.length !== currentObj2.length) return false;
923
+ for (let i = 0; i < currentObj1.length; i++) stack.push([currentObj1[i], currentObj2[i]]);
924
+ } else if (typeof currentObj1 === "object" && typeof currentObj2 === "object" && currentObj1 !== null && currentObj2 !== null) {
925
+ if (Array.isArray(currentObj1) || Array.isArray(currentObj2)) return false;
926
+ const keys1 = Object.keys(currentObj1);
927
+ const keys2 = Object.keys(currentObj2);
928
+ if (keys1.length !== keys2.length || !keys1.every(key => keys2.includes(key))) return false;
929
+ for (let key in currentObj1) {
930
+ if ($29ec7cddbe1d3484$var$result_ids.includes(key)) continue; // ignore comparing values for keys we know are changing with every request
931
+ stack.push([currentObj1[key], currentObj2[key]]);
932
+ }
933
+ } else if (typeof currentObj1 !== "function" && typeof currentObj2 !== "function")
934
+ // Claim that all functions are equal, since the only way a function ends up here is because someone added it in the displayTransformer and that shouldn't force us to re-render, right?
935
+ return false;
932
936
  }
933
- return false;
937
+ return true;
934
938
  }
935
939
  const $c8d5ff4524619fcd$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<div>`),
936
940
  $c8d5ff4524619fcd$var$_tmpl$2 = /*#__PURE__*/$9HbP8$template(`<style type=text/css>`);
@@ -5422,6 +5426,9 @@ function $e5014ccd0b76d9f4$export$967e966fca9515e(api_response) {
5422
5426
  }
5423
5427
  return api_response;
5424
5428
  }
5429
+
5430
+ // Minifiable and tree-shakable enum
5431
+ // Why not use const enum? See https://gitlab.com/depict-ai/depict.ai/-/merge_requests/9223#note_1675965260
5425
5432
  const $c20599a0d81d953a$export$74ee7529ce0f8a00 = "listingId";
5426
5433
  const $c20599a0d81d953a$export$5aae649db1b959fc = "externalId";
5427
5434
  const $7fa23e2a0079eca4$var$v3_base_url = (0, $9HbP8$base_url) + "/v3/";
@@ -8063,7 +8070,7 @@ function $e7fce80abe608e01$var$clear_if_opened_new_tab_with_sideways_url_params_
8063
8070
  });
8064
8071
  tracking_function_for_plp_results(plp_results_);
8065
8072
  }
8066
- const $cc6f5b69378cd164$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<div class=statement style=white-space:pre-wrap>No listingId specified, this is probably unintentional. Make sure to create (and insert) the CategoryPage *after* you have specified a listingId/externalId.`),
8073
+ const $cc6f5b69378cd164$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<div class=statement style=white-space:pre-wrap>No \`id\` specified in \`listingQuery\`, this is probably unintentional. Make sure to create (and insert) the CategoryPage *after* you have specified a listingQuery.`),
8067
8074
  $cc6f5b69378cd164$var$_tmpl$2 = /*#__PURE__*/$9HbP8$template(`<div class=buttons><button class="ok major">`);
8068
8075
  function $cc6f5b69378cd164$export$7af06a63c5a976c9(el, listing_id, i18n_) {
8069
8076
  if (!(0, $9HbP8$is_debug)) return; // Just to make sure we don't show this in production
@@ -8073,7 +8080,7 @@ function $cc6f5b69378cd164$export$7af06a63c5a976c9(el, listing_id, i18n_) {
8073
8080
  }) => $9HbP8$runWithOwner(owner, () => $9HbP8$createEffect(() => {
8074
8081
  if (!document.documentElement.contains(element)) return;
8075
8082
  if (!listing_id()) {
8076
- const warning = "No listingId specified, this is probably unintentional. Make sure to create (and insert) the CategoryPage *after* you have specified a listingId/externalId.";
8083
+ const warning = "No `id` specified in `listingQuery`, this is probably unintentional. Make sure to create (and insert) the CategoryPage *after* you have specified a listingQuery.";
8077
8084
  $9HbP8$dwarn(warning);
8078
8085
  const {
8079
8086
  close_toast_: close_toast_
@@ -8811,7 +8818,7 @@ function $961b5c64bef4662f$export$e2bf8ce7779e827e(props) {
8811
8818
  category_title: category_title
8812
8819
  } = props;
8813
8820
  const shared_properties = $961b5c64bef4662f$var$get_shared_properties(depict_category);
8814
- const diffableListingQuery = $9HbP8$createMemo(() => Object.values(depict_category.listing_query).join(""));
8821
+ const diffableListingQuery = $9HbP8$createMemo(() => Object.values(depict_category.listing_query || {}).join(""));
8815
8822
  return $16b52438165aafe2$export$23fca46f3143581f(() => {
8816
8823
  $9HbP8$createEffect(prev => {
8817
8824
  // this is here (and not on DepictCategory) so that people also know when PageReplacer removes the page, it's intended to help people replace their own content when a depict page is navigated, see https://depictaiworkspace.slack.com/archives/C04M8MGCF3K/p1691670636155369
@@ -8862,7 +8869,10 @@ function $961b5c64bef4662f$export$e2bf8ce7779e827e(props) {
8862
8869
  min_products_to_fetch_: $961b5c64bef4662f$var$min_products_to_fetch_,
8863
8870
  local_filter_cache_: local_filter_cache_,
8864
8871
  id_to_query_for_: $9HbP8$createMemo(() => !depict_category.disable_override_listing_id && override_listing_id_accessor_() || depict_category.listing_query.id),
8865
- id_type_: $9HbP8$createMemo(() => !depict_category.disable_override_listing_id && override_listing_id_accessor_() ? $c20599a0d81d953a$export$74ee7529ce0f8a00 : depict_category.listing_query.type),
8872
+ id_type_: $9HbP8$createMemo(() => {
8873
+ if (!depict_category.disable_override_listing_id && override_listing_id_accessor_()) return $c20599a0d81d953a$export$74ee7529ce0f8a00;
8874
+ return depict_category.listing_query.type;
8875
+ }),
8866
8876
  i18n_: i18n_,
8867
8877
  show_quicklinks_: $9HbP8$createMemo(() => props.show_quicklinks ?? true),
8868
8878
  category_title_: category_title,
@@ -985,33 +985,33 @@ const $50cd633c714251ff$export$84584c2a98eb6753 = {
985
985
  backend_locale_: "en"
986
986
  };
987
987
  const $50cd633c714251ff$export$c8af9ccf06a8b16a = {
988
- ...(0, $7a49ed48f9a44684$export$f1905e1353ecf78e),
989
- ...(0, $7a49ed48f9a44684$export$b43a5e72c07b4d2a),
988
+ ...(0, $37232ce8fd20bb15$export$61b15fe6451cdba0),
989
+ ...(0, $37232ce8fd20bb15$export$434b5d2e9cbbcde1),
990
990
  backend_locale_: "en_AU"
991
991
  };
992
992
  const $50cd633c714251ff$export$a2bced10ed717c1f = {
993
- ...(0, $7a49ed48f9a44684$export$f1905e1353ecf78e),
994
- ...(0, $7a49ed48f9a44684$export$b43a5e72c07b4d2a),
993
+ ...(0, $37232ce8fd20bb15$export$61b15fe6451cdba0),
994
+ ...(0, $37232ce8fd20bb15$export$434b5d2e9cbbcde1),
995
995
  backend_locale_: "en_CA"
996
996
  };
997
997
  const $50cd633c714251ff$export$6ac7ea553f9cecc6 = {
998
- ...(0, $7a49ed48f9a44684$export$f1905e1353ecf78e),
999
- ...(0, $7a49ed48f9a44684$export$b43a5e72c07b4d2a),
998
+ ...(0, $37232ce8fd20bb15$export$61b15fe6451cdba0),
999
+ ...(0, $37232ce8fd20bb15$export$434b5d2e9cbbcde1),
1000
1000
  backend_locale_: "en_EU"
1001
1001
  };
1002
1002
  const $50cd633c714251ff$export$b76508d27899e649 = {
1003
- ...(0, $7a49ed48f9a44684$export$f1905e1353ecf78e),
1004
- ...(0, $7a49ed48f9a44684$export$b43a5e72c07b4d2a),
1003
+ ...(0, $37232ce8fd20bb15$export$61b15fe6451cdba0),
1004
+ ...(0, $37232ce8fd20bb15$export$434b5d2e9cbbcde1),
1005
1005
  backend_locale_: "en_GB"
1006
1006
  };
1007
1007
  const $50cd633c714251ff$export$df031397bb44d506 = {
1008
- ...(0, $7a49ed48f9a44684$export$f1905e1353ecf78e),
1009
- ...(0, $7a49ed48f9a44684$export$b43a5e72c07b4d2a),
1008
+ ...(0, $37232ce8fd20bb15$export$61b15fe6451cdba0),
1009
+ ...(0, $37232ce8fd20bb15$export$434b5d2e9cbbcde1),
1010
1010
  backend_locale_: "en_IE"
1011
1011
  };
1012
1012
  const $50cd633c714251ff$export$25dc44e90bc68e13 = {
1013
- ...(0, $7a49ed48f9a44684$export$f1905e1353ecf78e),
1014
- ...(0, $7a49ed48f9a44684$export$b43a5e72c07b4d2a),
1013
+ ...(0, $37232ce8fd20bb15$export$61b15fe6451cdba0),
1014
+ ...(0, $37232ce8fd20bb15$export$434b5d2e9cbbcde1),
1015
1015
  backend_locale_: "en_US"
1016
1016
  };
1017
1017
  const $50cd633c714251ff$export$ed5179c818622fb = {
@@ -944,33 +944,33 @@ const $72b32e7f8dfbdf34$export$84584c2a98eb6753 = {
944
944
  backend_locale_: "en"
945
945
  };
946
946
  const $72b32e7f8dfbdf34$export$c8af9ccf06a8b16a = {
947
- ...(0, $c81467eae166ae22$export$f1905e1353ecf78e),
948
- ...(0, $c81467eae166ae22$export$b43a5e72c07b4d2a),
947
+ ...(0, $3ae9d5d3dda72bac$export$61b15fe6451cdba0),
948
+ ...(0, $3ae9d5d3dda72bac$export$434b5d2e9cbbcde1),
949
949
  backend_locale_: "en_AU"
950
950
  };
951
951
  const $72b32e7f8dfbdf34$export$a2bced10ed717c1f = {
952
- ...(0, $c81467eae166ae22$export$f1905e1353ecf78e),
953
- ...(0, $c81467eae166ae22$export$b43a5e72c07b4d2a),
952
+ ...(0, $3ae9d5d3dda72bac$export$61b15fe6451cdba0),
953
+ ...(0, $3ae9d5d3dda72bac$export$434b5d2e9cbbcde1),
954
954
  backend_locale_: "en_CA"
955
955
  };
956
956
  const $72b32e7f8dfbdf34$export$6ac7ea553f9cecc6 = {
957
- ...(0, $c81467eae166ae22$export$f1905e1353ecf78e),
958
- ...(0, $c81467eae166ae22$export$b43a5e72c07b4d2a),
957
+ ...(0, $3ae9d5d3dda72bac$export$61b15fe6451cdba0),
958
+ ...(0, $3ae9d5d3dda72bac$export$434b5d2e9cbbcde1),
959
959
  backend_locale_: "en_EU"
960
960
  };
961
961
  const $72b32e7f8dfbdf34$export$b76508d27899e649 = {
962
- ...(0, $c81467eae166ae22$export$f1905e1353ecf78e),
963
- ...(0, $c81467eae166ae22$export$b43a5e72c07b4d2a),
962
+ ...(0, $3ae9d5d3dda72bac$export$61b15fe6451cdba0),
963
+ ...(0, $3ae9d5d3dda72bac$export$434b5d2e9cbbcde1),
964
964
  backend_locale_: "en_GB"
965
965
  };
966
966
  const $72b32e7f8dfbdf34$export$df031397bb44d506 = {
967
- ...(0, $c81467eae166ae22$export$f1905e1353ecf78e),
968
- ...(0, $c81467eae166ae22$export$b43a5e72c07b4d2a),
967
+ ...(0, $3ae9d5d3dda72bac$export$61b15fe6451cdba0),
968
+ ...(0, $3ae9d5d3dda72bac$export$434b5d2e9cbbcde1),
969
969
  backend_locale_: "en_IE"
970
970
  };
971
971
  const $72b32e7f8dfbdf34$export$25dc44e90bc68e13 = {
972
- ...(0, $c81467eae166ae22$export$f1905e1353ecf78e),
973
- ...(0, $c81467eae166ae22$export$b43a5e72c07b4d2a),
972
+ ...(0, $3ae9d5d3dda72bac$export$61b15fe6451cdba0),
973
+ ...(0, $3ae9d5d3dda72bac$export$434b5d2e9cbbcde1),
974
974
  backend_locale_: "en_US"
975
975
  };
976
976
  const $72b32e7f8dfbdf34$export$ed5179c818622fb = {
@@ -985,33 +985,33 @@ const $2d187e768d780a64$export$84584c2a98eb6753 = {
985
985
  backend_locale_: "en"
986
986
  };
987
987
  const $2d187e768d780a64$export$c8af9ccf06a8b16a = {
988
- ...(0, $fe31f8ec160a842b$export$f1905e1353ecf78e),
989
- ...(0, $fe31f8ec160a842b$export$b43a5e72c07b4d2a),
988
+ ...(0, $f1b6d8431ecd6285$export$61b15fe6451cdba0),
989
+ ...(0, $f1b6d8431ecd6285$export$434b5d2e9cbbcde1),
990
990
  backend_locale_: "en_AU"
991
991
  };
992
992
  const $2d187e768d780a64$export$a2bced10ed717c1f = {
993
- ...(0, $fe31f8ec160a842b$export$f1905e1353ecf78e),
994
- ...(0, $fe31f8ec160a842b$export$b43a5e72c07b4d2a),
993
+ ...(0, $f1b6d8431ecd6285$export$61b15fe6451cdba0),
994
+ ...(0, $f1b6d8431ecd6285$export$434b5d2e9cbbcde1),
995
995
  backend_locale_: "en_CA"
996
996
  };
997
997
  const $2d187e768d780a64$export$6ac7ea553f9cecc6 = {
998
- ...(0, $fe31f8ec160a842b$export$f1905e1353ecf78e),
999
- ...(0, $fe31f8ec160a842b$export$b43a5e72c07b4d2a),
998
+ ...(0, $f1b6d8431ecd6285$export$61b15fe6451cdba0),
999
+ ...(0, $f1b6d8431ecd6285$export$434b5d2e9cbbcde1),
1000
1000
  backend_locale_: "en_EU"
1001
1001
  };
1002
1002
  const $2d187e768d780a64$export$b76508d27899e649 = {
1003
- ...(0, $fe31f8ec160a842b$export$f1905e1353ecf78e),
1004
- ...(0, $fe31f8ec160a842b$export$b43a5e72c07b4d2a),
1003
+ ...(0, $f1b6d8431ecd6285$export$61b15fe6451cdba0),
1004
+ ...(0, $f1b6d8431ecd6285$export$434b5d2e9cbbcde1),
1005
1005
  backend_locale_: "en_GB"
1006
1006
  };
1007
1007
  const $2d187e768d780a64$export$df031397bb44d506 = {
1008
- ...(0, $fe31f8ec160a842b$export$f1905e1353ecf78e),
1009
- ...(0, $fe31f8ec160a842b$export$b43a5e72c07b4d2a),
1008
+ ...(0, $f1b6d8431ecd6285$export$61b15fe6451cdba0),
1009
+ ...(0, $f1b6d8431ecd6285$export$434b5d2e9cbbcde1),
1010
1010
  backend_locale_: "en_IE"
1011
1011
  };
1012
1012
  const $2d187e768d780a64$export$25dc44e90bc68e13 = {
1013
- ...(0, $fe31f8ec160a842b$export$f1905e1353ecf78e),
1014
- ...(0, $fe31f8ec160a842b$export$b43a5e72c07b4d2a),
1013
+ ...(0, $f1b6d8431ecd6285$export$61b15fe6451cdba0),
1014
+ ...(0, $f1b6d8431ecd6285$export$434b5d2e9cbbcde1),
1015
1015
  backend_locale_: "en_US"
1016
1016
  };
1017
1017
  const $2d187e768d780a64$export$ed5179c818622fb = {
@@ -944,33 +944,33 @@ const $70cb39a790dd4f65$export$84584c2a98eb6753 = {
944
944
  backend_locale_: "en"
945
945
  };
946
946
  const $70cb39a790dd4f65$export$c8af9ccf06a8b16a = {
947
- ...(0, $dc8b0b929b2d7ddb$export$f1905e1353ecf78e),
948
- ...(0, $dc8b0b929b2d7ddb$export$b43a5e72c07b4d2a),
947
+ ...(0, $0f11d1c8c78bac40$export$61b15fe6451cdba0),
948
+ ...(0, $0f11d1c8c78bac40$export$434b5d2e9cbbcde1),
949
949
  backend_locale_: "en_AU"
950
950
  };
951
951
  const $70cb39a790dd4f65$export$a2bced10ed717c1f = {
952
- ...(0, $dc8b0b929b2d7ddb$export$f1905e1353ecf78e),
953
- ...(0, $dc8b0b929b2d7ddb$export$b43a5e72c07b4d2a),
952
+ ...(0, $0f11d1c8c78bac40$export$61b15fe6451cdba0),
953
+ ...(0, $0f11d1c8c78bac40$export$434b5d2e9cbbcde1),
954
954
  backend_locale_: "en_CA"
955
955
  };
956
956
  const $70cb39a790dd4f65$export$6ac7ea553f9cecc6 = {
957
- ...(0, $dc8b0b929b2d7ddb$export$f1905e1353ecf78e),
958
- ...(0, $dc8b0b929b2d7ddb$export$b43a5e72c07b4d2a),
957
+ ...(0, $0f11d1c8c78bac40$export$61b15fe6451cdba0),
958
+ ...(0, $0f11d1c8c78bac40$export$434b5d2e9cbbcde1),
959
959
  backend_locale_: "en_EU"
960
960
  };
961
961
  const $70cb39a790dd4f65$export$b76508d27899e649 = {
962
- ...(0, $dc8b0b929b2d7ddb$export$f1905e1353ecf78e),
963
- ...(0, $dc8b0b929b2d7ddb$export$b43a5e72c07b4d2a),
962
+ ...(0, $0f11d1c8c78bac40$export$61b15fe6451cdba0),
963
+ ...(0, $0f11d1c8c78bac40$export$434b5d2e9cbbcde1),
964
964
  backend_locale_: "en_GB"
965
965
  };
966
966
  const $70cb39a790dd4f65$export$df031397bb44d506 = {
967
- ...(0, $dc8b0b929b2d7ddb$export$f1905e1353ecf78e),
968
- ...(0, $dc8b0b929b2d7ddb$export$b43a5e72c07b4d2a),
967
+ ...(0, $0f11d1c8c78bac40$export$61b15fe6451cdba0),
968
+ ...(0, $0f11d1c8c78bac40$export$434b5d2e9cbbcde1),
969
969
  backend_locale_: "en_IE"
970
970
  };
971
971
  const $70cb39a790dd4f65$export$25dc44e90bc68e13 = {
972
- ...(0, $dc8b0b929b2d7ddb$export$f1905e1353ecf78e),
973
- ...(0, $dc8b0b929b2d7ddb$export$b43a5e72c07b4d2a),
972
+ ...(0, $0f11d1c8c78bac40$export$61b15fe6451cdba0),
973
+ ...(0, $0f11d1c8c78bac40$export$434b5d2e9cbbcde1),
974
974
  backend_locale_: "en_US"
975
975
  };
976
976
  const $70cb39a790dd4f65$export$ed5179c818622fb = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/ui",
3
- "version": "3.0.4",
3
+ "version": "3.0.6",
4
4
  "description": "Base package containing the actual UI of Depict UI along with translations, with a not-simplified API. We recommend using @depict-ai/js-ui or @depict-ai/react-ui instead.",
5
5
  "packageManager": "yarn@3.2.2",
6
6
  "sass": "styles.scss",
@@ -83,7 +83,7 @@ $parcel$export(module.exports, "defaultColsAtSize", () => $33eed84f447aa0c0$expo
83
83
  $parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $33eed84f447aa0c0$export$7bf543b9d9be2c22);
84
84
  $parcel$export(module.exports, "version", () => $aa1938dec50d6c12$export$83d89fbfd8236492);
85
85
  /*! Depict.ai search and product listing SDK */
86
- const $aa1938dec50d6c12$export$83d89fbfd8236492 = "3.0.4";
86
+ const $aa1938dec50d6c12$export$83d89fbfd8236492 = "3.0.6";
87
87
  const $9d19451330d04c3c$var$_tmpl$ = ["<svg", ' xmlns="http://www.w3.org/2000/svg"', ' viewBox="0 0 14 26"><path d="M2 24.656c-.078 0-.156-.016-.234-.047s-.133-.066-.187-.129c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422l10.371-10.371L1.578 2.883c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422.258-.176.422-.176.305.059.422.176l10.805 10.793a.59.59 0 0 1 .176.434c0 .172-.059.305-.176.422L2.422 24.48a.42.42 0 0 1-.199.129.54.54 0 0 1-.223.047zm0 0" fill="#0f0f0f"></path></svg>'];
88
88
  function $9d19451330d04c3c$export$8be2714ec7f169ee() {
89
89
  var _$escape2, _$escape3;
@@ -948,27 +948,31 @@ function $76012c4468a53d1f$export$43f0fb951fcb0c54(_ref) {
948
948
  });
949
949
  }
950
950
  // source: https://medium.com/@pancemarko/deep-equality-in-javascript-determining-if-two-objects-are-equal-bf98cf47e934
951
+ // deeply diffs two objects
952
+ // Modified by chatGPT to not be recursive, since stiga was getting a stack overflow just due to the size of their data
953
+ // Modified futher to bias towards saying objects are equal non-primitive objects differ
951
954
  function $76012c4468a53d1f$var$deep_equal(obj1, obj2) {
952
- if (obj1 === obj2) return true;
953
- if (Array.isArray(obj1) && Array.isArray(obj2)) {
954
- if (obj1.length !== obj2.length) return false;
955
- return obj1.every((elem, index) => {
956
- return $76012c4468a53d1f$var$deep_equal(elem, obj2[index]);
957
- });
958
- }
959
- if (typeof obj1 === "object" && typeof obj2 === "object" && obj1 !== null && obj2 !== null) {
960
- if (Array.isArray(obj1) || Array.isArray(obj2)) return false;
961
- const keys1 = Object.keys(obj1);
962
- const keys2 = Object.keys(obj2);
963
- if (keys1.length !== keys2.length || !keys1.every(key => keys2.includes(key))) return false;
964
- for (const key in obj1) {
965
- if ($76012c4468a53d1f$var$result_ids.includes(key)) continue; // ignore keys changing with every request
966
- const isEqual = $76012c4468a53d1f$var$deep_equal(obj1[key], obj2[key]);
967
- if (!isEqual) return false;
968
- }
969
- return true;
955
+ const stack = [[obj1, obj2]];
956
+ while (stack.length > 0) {
957
+ const [currentObj1, currentObj2] = stack.pop();
958
+ if (currentObj1 === currentObj2) continue;
959
+ if (Array.isArray(currentObj1) && Array.isArray(currentObj2)) {
960
+ if (currentObj1.length !== currentObj2.length) return false;
961
+ for (let i = 0; i < currentObj1.length; i++) stack.push([currentObj1[i], currentObj2[i]]);
962
+ } else if (typeof currentObj1 === "object" && typeof currentObj2 === "object" && currentObj1 !== null && currentObj2 !== null) {
963
+ if (Array.isArray(currentObj1) || Array.isArray(currentObj2)) return false;
964
+ const keys1 = Object.keys(currentObj1);
965
+ const keys2 = Object.keys(currentObj2);
966
+ if (keys1.length !== keys2.length || !keys1.every(key => keys2.includes(key))) return false;
967
+ for (let key in currentObj1) {
968
+ if ($76012c4468a53d1f$var$result_ids.includes(key)) continue; // ignore comparing values for keys we know are changing with every request
969
+ stack.push([currentObj1[key], currentObj2[key]]);
970
+ }
971
+ } else if (typeof currentObj1 !== "function" && typeof currentObj2 !== "function")
972
+ // Claim that all functions are equal, since the only way a function ends up here is because someone added it in the displayTransformer and that shouldn't force us to re-render, right?
973
+ return false;
970
974
  }
971
- return false;
975
+ return true;
972
976
  }
973
977
  const $6c2c739b113a8ddf$var$_tmpl$ = ["<div", ' class="', '">', "</div>"],
974
978
  $6c2c739b113a8ddf$var$_tmpl$2 = ["<style", ' type="text/css">', "</style>"];
@@ -4745,6 +4749,9 @@ function $b3dc12c672c9df24$export$967e966fca9515e(api_response) {
4745
4749
  }
4746
4750
  return api_response;
4747
4751
  }
4752
+
4753
+ // Minifiable and tree-shakable enum
4754
+ // Why not use const enum? See https://gitlab.com/depict-ai/depict.ai/-/merge_requests/9223#note_1675965260
4748
4755
  const $c3739e86187f2054$export$74ee7529ce0f8a00 = "listingId";
4749
4756
  const $c3739e86187f2054$export$5aae649db1b959fc = "externalId";
4750
4757
  function $e270e9f953fcbc58$var$_classPrivateMethodInitSpec(obj, privateSet) {
@@ -7930,7 +7937,7 @@ function $9cbefc32b9dab36d$export$e2bf8ce7779e827e(props) {
7930
7937
  category_title: category_title
7931
7938
  } = props;
7932
7939
  const shared_properties = $9cbefc32b9dab36d$var$get_shared_properties(depict_category);
7933
- const diffableListingQuery = $3hooq$solidjs.createMemo(() => Object.values(depict_category.listing_query).join(""));
7940
+ const diffableListingQuery = $3hooq$solidjs.createMemo(() => Object.values(depict_category.listing_query || {}).join(""));
7934
7941
  return $d05611ff6b8c8357$export$23fca46f3143581f(() => {
7935
7942
  $3hooq$solidjs.createEffect(prev => {
7936
7943
  // this is here (and not on DepictCategory) so that people also know when PageReplacer removes the page, it's intended to help people replace their own content when a depict page is navigated, see https://depictaiworkspace.slack.com/archives/C04M8MGCF3K/p1691670636155369
@@ -7981,7 +7988,10 @@ function $9cbefc32b9dab36d$export$e2bf8ce7779e827e(props) {
7981
7988
  min_products_to_fetch_: $9cbefc32b9dab36d$var$min_products_to_fetch_,
7982
7989
  local_filter_cache_: local_filter_cache_,
7983
7990
  id_to_query_for_: $3hooq$solidjs.createMemo(() => !depict_category.disable_override_listing_id && override_listing_id_accessor_() || depict_category.listing_query.id),
7984
- id_type_: $3hooq$solidjs.createMemo(() => !depict_category.disable_override_listing_id && override_listing_id_accessor_() ? $c3739e86187f2054$export$74ee7529ce0f8a00 : depict_category.listing_query.type),
7991
+ id_type_: $3hooq$solidjs.createMemo(() => {
7992
+ if (!depict_category.disable_override_listing_id && override_listing_id_accessor_()) return $c3739e86187f2054$export$74ee7529ce0f8a00;
7993
+ return depict_category.listing_query.type;
7994
+ }),
7985
7995
  i18n_: i18n_,
7986
7996
  show_quicklinks_: $3hooq$solidjs.createMemo(() => {
7987
7997
  var _props$show_quicklink;
@@ -10,7 +10,7 @@ import { ProductListingRequestV3 } from "@depict-ai/types/api/ProductListingRequ
10
10
  import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
11
11
  import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
12
12
  import { SearchFilter as _SearchFilter2 } from "@depict-ai/types/api/SearchRequestV2";
13
- export const version = "3.0.4";
13
+ export const version = "3.0.6";
14
14
  export type SDKColsAtSize = [number, number?][];
15
15
  /**
16
16
  * Transform SDK ColsAtSize into valid Layout ColsAtSize
@@ -10,7 +10,7 @@ import { createStore as $b8hua$createStore, reconcile as $b8hua$reconcile } from
10
10
  /*! Depict.ai search and product listing SDK */
11
11
  import { register_es_version } from "../../multi_import_deduplicator.mjs";
12
12
  register_es_version("ui", "ES10");
13
- const $8db9a15135765c11$export$83d89fbfd8236492 = "3.0.4";
13
+ const $8db9a15135765c11$export$83d89fbfd8236492 = "3.0.6";
14
14
  const $ca6ab5f08bd28bca$var$_tmpl$ = ["<svg", ' xmlns="http://www.w3.org/2000/svg"', ' viewBox="0 0 14 26"><path d="M2 24.656c-.078 0-.156-.016-.234-.047s-.133-.066-.187-.129c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422l10.371-10.371L1.578 2.883c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422.258-.176.422-.176.305.059.422.176l10.805 10.793a.59.59 0 0 1 .176.434c0 .172-.059.305-.176.422L2.422 24.48a.42.42 0 0 1-.199.129.54.54 0 0 1-.223.047zm0 0" fill="#0f0f0f"></path></svg>'];
15
15
  function $ca6ab5f08bd28bca$export$8be2714ec7f169ee() {
16
16
  var _$escape2, _$escape3;
@@ -875,27 +875,31 @@ function $2d7bad8684bc7f44$export$43f0fb951fcb0c54(_ref) {
875
875
  });
876
876
  }
877
877
  // source: https://medium.com/@pancemarko/deep-equality-in-javascript-determining-if-two-objects-are-equal-bf98cf47e934
878
+ // deeply diffs two objects
879
+ // Modified by chatGPT to not be recursive, since stiga was getting a stack overflow just due to the size of their data
880
+ // Modified futher to bias towards saying objects are equal non-primitive objects differ
878
881
  function $2d7bad8684bc7f44$var$deep_equal(obj1, obj2) {
879
- if (obj1 === obj2) return true;
880
- if (Array.isArray(obj1) && Array.isArray(obj2)) {
881
- if (obj1.length !== obj2.length) return false;
882
- return obj1.every((elem, index) => {
883
- return $2d7bad8684bc7f44$var$deep_equal(elem, obj2[index]);
884
- });
885
- }
886
- if (typeof obj1 === "object" && typeof obj2 === "object" && obj1 !== null && obj2 !== null) {
887
- if (Array.isArray(obj1) || Array.isArray(obj2)) return false;
888
- const keys1 = Object.keys(obj1);
889
- const keys2 = Object.keys(obj2);
890
- if (keys1.length !== keys2.length || !keys1.every(key => keys2.includes(key))) return false;
891
- for (const key in obj1) {
892
- if ($2d7bad8684bc7f44$var$result_ids.includes(key)) continue; // ignore keys changing with every request
893
- const isEqual = $2d7bad8684bc7f44$var$deep_equal(obj1[key], obj2[key]);
894
- if (!isEqual) return false;
895
- }
896
- return true;
882
+ const stack = [[obj1, obj2]];
883
+ while (stack.length > 0) {
884
+ const [currentObj1, currentObj2] = stack.pop();
885
+ if (currentObj1 === currentObj2) continue;
886
+ if (Array.isArray(currentObj1) && Array.isArray(currentObj2)) {
887
+ if (currentObj1.length !== currentObj2.length) return false;
888
+ for (let i = 0; i < currentObj1.length; i++) stack.push([currentObj1[i], currentObj2[i]]);
889
+ } else if (typeof currentObj1 === "object" && typeof currentObj2 === "object" && currentObj1 !== null && currentObj2 !== null) {
890
+ if (Array.isArray(currentObj1) || Array.isArray(currentObj2)) return false;
891
+ const keys1 = Object.keys(currentObj1);
892
+ const keys2 = Object.keys(currentObj2);
893
+ if (keys1.length !== keys2.length || !keys1.every(key => keys2.includes(key))) return false;
894
+ for (let key in currentObj1) {
895
+ if ($2d7bad8684bc7f44$var$result_ids.includes(key)) continue; // ignore comparing values for keys we know are changing with every request
896
+ stack.push([currentObj1[key], currentObj2[key]]);
897
+ }
898
+ } else if (typeof currentObj1 !== "function" && typeof currentObj2 !== "function")
899
+ // Claim that all functions are equal, since the only way a function ends up here is because someone added it in the displayTransformer and that shouldn't force us to re-render, right?
900
+ return false;
897
901
  }
898
- return false;
902
+ return true;
899
903
  }
900
904
  const $63f1f8dbcd07d3b0$var$_tmpl$ = ["<div", ' class="', '">', "</div>"],
901
905
  $63f1f8dbcd07d3b0$var$_tmpl$2 = ["<style", ' type="text/css">', "</style>"];
@@ -4672,6 +4676,9 @@ function $ed0fefda39a0f15d$export$967e966fca9515e(api_response) {
4672
4676
  }
4673
4677
  return api_response;
4674
4678
  }
4679
+
4680
+ // Minifiable and tree-shakable enum
4681
+ // Why not use const enum? See https://gitlab.com/depict-ai/depict.ai/-/merge_requests/9223#note_1675965260
4675
4682
  const $397620a4d7958ed1$export$74ee7529ce0f8a00 = "listingId";
4676
4683
  const $397620a4d7958ed1$export$5aae649db1b959fc = "externalId";
4677
4684
  function $284849364a6ef73a$var$_classPrivateMethodInitSpec(obj, privateSet) {
@@ -7857,7 +7864,7 @@ function $f5f54892fd0c7d9f$export$e2bf8ce7779e827e(props) {
7857
7864
  category_title: category_title
7858
7865
  } = props;
7859
7866
  const shared_properties = $f5f54892fd0c7d9f$var$get_shared_properties(depict_category);
7860
- const diffableListingQuery = $b8hua$createMemo(() => Object.values(depict_category.listing_query).join(""));
7867
+ const diffableListingQuery = $b8hua$createMemo(() => Object.values(depict_category.listing_query || {}).join(""));
7861
7868
  return $83e8cf2c0b87a58a$export$23fca46f3143581f(() => {
7862
7869
  $b8hua$createEffect(prev => {
7863
7870
  // this is here (and not on DepictCategory) so that people also know when PageReplacer removes the page, it's intended to help people replace their own content when a depict page is navigated, see https://depictaiworkspace.slack.com/archives/C04M8MGCF3K/p1691670636155369
@@ -7908,7 +7915,10 @@ function $f5f54892fd0c7d9f$export$e2bf8ce7779e827e(props) {
7908
7915
  min_products_to_fetch_: $f5f54892fd0c7d9f$var$min_products_to_fetch_,
7909
7916
  local_filter_cache_: local_filter_cache_,
7910
7917
  id_to_query_for_: $b8hua$createMemo(() => !depict_category.disable_override_listing_id && override_listing_id_accessor_() || depict_category.listing_query.id),
7911
- id_type_: $b8hua$createMemo(() => !depict_category.disable_override_listing_id && override_listing_id_accessor_() ? $397620a4d7958ed1$export$74ee7529ce0f8a00 : depict_category.listing_query.type),
7918
+ id_type_: $b8hua$createMemo(() => {
7919
+ if (!depict_category.disable_override_listing_id && override_listing_id_accessor_()) return $397620a4d7958ed1$export$74ee7529ce0f8a00;
7920
+ return depict_category.listing_query.type;
7921
+ }),
7912
7922
  i18n_: i18n_,
7913
7923
  show_quicklinks_: $b8hua$createMemo(() => {
7914
7924
  var _props$show_quicklink;
@@ -77,7 +77,7 @@ $parcel$export(module.exports, "defaultColsAtSize", () => $a3280f0aad997933$expo
77
77
  $parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $a3280f0aad997933$export$7bf543b9d9be2c22);
78
78
  $parcel$export(module.exports, "version", () => $b757f75811f3261f$export$83d89fbfd8236492);
79
79
  /*! Depict.ai search and product listing SDK */
80
- const $b757f75811f3261f$export$83d89fbfd8236492 = "3.0.4";
80
+ const $b757f75811f3261f$export$83d89fbfd8236492 = "3.0.6";
81
81
  const $0f313083912e447a$var$_tmpl$ = ["<svg", ' xmlns="http://www.w3.org/2000/svg"', ' viewBox="0 0 14 26"><path d="M2 24.656c-.078 0-.156-.016-.234-.047s-.133-.066-.187-.129c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422l10.371-10.371L1.578 2.883c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422.258-.176.422-.176.305.059.422.176l10.805 10.793a.59.59 0 0 1 .176.434c0 .172-.059.305-.176.422L2.422 24.48a.42.42 0 0 1-.199.129.54.54 0 0 1-.223.047zm0 0" fill="#0f0f0f"></path></svg>'];
82
82
  function $0f313083912e447a$export$8be2714ec7f169ee(props = {}) {
83
83
  return $5vyXB$solidjsweb.ssr($0f313083912e447a$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.ssrAttribute("width", $5vyXB$solidjsweb.escape(props.width_, true) ?? 14, false) + $5vyXB$solidjsweb.ssrAttribute("height", $5vyXB$solidjsweb.escape(props.height_, true) ?? 26, false));
@@ -894,27 +894,31 @@ function $a73063cc642f3e5f$export$43f0fb951fcb0c54({
894
894
  });
895
895
  }
896
896
  // source: https://medium.com/@pancemarko/deep-equality-in-javascript-determining-if-two-objects-are-equal-bf98cf47e934
897
+ // deeply diffs two objects
898
+ // Modified by chatGPT to not be recursive, since stiga was getting a stack overflow just due to the size of their data
899
+ // Modified futher to bias towards saying objects are equal non-primitive objects differ
897
900
  function $a73063cc642f3e5f$var$deep_equal(obj1, obj2) {
898
- if (obj1 === obj2) return true;
899
- if (Array.isArray(obj1) && Array.isArray(obj2)) {
900
- if (obj1.length !== obj2.length) return false;
901
- return obj1.every((elem, index) => {
902
- return $a73063cc642f3e5f$var$deep_equal(elem, obj2[index]);
903
- });
904
- }
905
- if (typeof obj1 === "object" && typeof obj2 === "object" && obj1 !== null && obj2 !== null) {
906
- if (Array.isArray(obj1) || Array.isArray(obj2)) return false;
907
- const keys1 = Object.keys(obj1);
908
- const keys2 = Object.keys(obj2);
909
- if (keys1.length !== keys2.length || !keys1.every(key => keys2.includes(key))) return false;
910
- for (const key in obj1) {
911
- if ($a73063cc642f3e5f$var$result_ids.includes(key)) continue; // ignore keys changing with every request
912
- const isEqual = $a73063cc642f3e5f$var$deep_equal(obj1[key], obj2[key]);
913
- if (!isEqual) return false;
914
- }
915
- return true;
901
+ const stack = [[obj1, obj2]];
902
+ while (stack.length > 0) {
903
+ const [currentObj1, currentObj2] = stack.pop();
904
+ if (currentObj1 === currentObj2) continue;
905
+ if (Array.isArray(currentObj1) && Array.isArray(currentObj2)) {
906
+ if (currentObj1.length !== currentObj2.length) return false;
907
+ for (let i = 0; i < currentObj1.length; i++) stack.push([currentObj1[i], currentObj2[i]]);
908
+ } else if (typeof currentObj1 === "object" && typeof currentObj2 === "object" && currentObj1 !== null && currentObj2 !== null) {
909
+ if (Array.isArray(currentObj1) || Array.isArray(currentObj2)) return false;
910
+ const keys1 = Object.keys(currentObj1);
911
+ const keys2 = Object.keys(currentObj2);
912
+ if (keys1.length !== keys2.length || !keys1.every(key => keys2.includes(key))) return false;
913
+ for (let key in currentObj1) {
914
+ if ($a73063cc642f3e5f$var$result_ids.includes(key)) continue; // ignore comparing values for keys we know are changing with every request
915
+ stack.push([currentObj1[key], currentObj2[key]]);
916
+ }
917
+ } else if (typeof currentObj1 !== "function" && typeof currentObj2 !== "function")
918
+ // Claim that all functions are equal, since the only way a function ends up here is because someone added it in the displayTransformer and that shouldn't force us to re-render, right?
919
+ return false;
916
920
  }
917
- return false;
921
+ return true;
918
922
  }
919
923
  const $f48d0fbb00835aaa$var$_tmpl$ = ["<div", ' class="', '">', "</div>"],
920
924
  $f48d0fbb00835aaa$var$_tmpl$2 = ["<style", ' type="text/css">', "</style>"];
@@ -4450,6 +4454,9 @@ function $67dc366d96177e70$export$967e966fca9515e(api_response) {
4450
4454
  }
4451
4455
  return api_response;
4452
4456
  }
4457
+
4458
+ // Minifiable and tree-shakable enum
4459
+ // Why not use const enum? See https://gitlab.com/depict-ai/depict.ai/-/merge_requests/9223#note_1675965260
4453
4460
  const $779741d0f266ea8c$export$74ee7529ce0f8a00 = "listingId";
4454
4461
  const $779741d0f266ea8c$export$5aae649db1b959fc = "externalId";
4455
4462
  const $e1d6c0f3d89d531c$var$v3_base_url = (0, $5vyXB$depictaiutilishared.base_url) + "/v3/";
@@ -7355,7 +7362,7 @@ function $48567ac5b39bac56$export$e2bf8ce7779e827e(props) {
7355
7362
  category_title: category_title
7356
7363
  } = props;
7357
7364
  const shared_properties = $48567ac5b39bac56$var$get_shared_properties(depict_category);
7358
- const diffableListingQuery = $5vyXB$solidjs.createMemo(() => Object.values(depict_category.listing_query).join(""));
7365
+ const diffableListingQuery = $5vyXB$solidjs.createMemo(() => Object.values(depict_category.listing_query || {}).join(""));
7359
7366
  return $95837413165cc2df$export$23fca46f3143581f(() => {
7360
7367
  $5vyXB$solidjs.createEffect(prev => {
7361
7368
  // this is here (and not on DepictCategory) so that people also know when PageReplacer removes the page, it's intended to help people replace their own content when a depict page is navigated, see https://depictaiworkspace.slack.com/archives/C04M8MGCF3K/p1691670636155369
@@ -7406,7 +7413,10 @@ function $48567ac5b39bac56$export$e2bf8ce7779e827e(props) {
7406
7413
  min_products_to_fetch_: $48567ac5b39bac56$var$min_products_to_fetch_,
7407
7414
  local_filter_cache_: local_filter_cache_,
7408
7415
  id_to_query_for_: $5vyXB$solidjs.createMemo(() => !depict_category.disable_override_listing_id && override_listing_id_accessor_() || depict_category.listing_query.id),
7409
- id_type_: $5vyXB$solidjs.createMemo(() => !depict_category.disable_override_listing_id && override_listing_id_accessor_() ? $779741d0f266ea8c$export$74ee7529ce0f8a00 : depict_category.listing_query.type),
7416
+ id_type_: $5vyXB$solidjs.createMemo(() => {
7417
+ if (!depict_category.disable_override_listing_id && override_listing_id_accessor_()) return $779741d0f266ea8c$export$74ee7529ce0f8a00;
7418
+ return depict_category.listing_query.type;
7419
+ }),
7410
7420
  i18n_: i18n_,
7411
7421
  show_quicklinks_: $5vyXB$solidjs.createMemo(() => props.show_quicklinks ?? true),
7412
7422
  category_title_: category_title,
@@ -10,7 +10,7 @@ import { ProductListingRequestV3 } from "@depict-ai/types/api/ProductListingRequ
10
10
  import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
11
11
  import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
12
12
  import { SearchFilter as _SearchFilter2 } from "@depict-ai/types/api/SearchRequestV2";
13
- export const version = "3.0.4";
13
+ export const version = "3.0.6";
14
14
  export type SDKColsAtSize = [number, number?][];
15
15
  /**
16
16
  * Transform SDK ColsAtSize into valid Layout ColsAtSize
@@ -7,7 +7,7 @@ import { createStore as $i7OB2$createStore, reconcile as $i7OB2$reconcile } from
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 = "3.0.4";
10
+ const $ec291e0010116877$export$83d89fbfd8236492 = "3.0.6";
11
11
  const $fbbadcb080ad1d4a$var$_tmpl$ = ["<svg", ' xmlns="http://www.w3.org/2000/svg"', ' viewBox="0 0 14 26"><path d="M2 24.656c-.078 0-.156-.016-.234-.047s-.133-.066-.187-.129c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422l10.371-10.371L1.578 2.883c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422.258-.176.422-.176.305.059.422.176l10.805 10.793a.59.59 0 0 1 .176.434c0 .172-.059.305-.176.422L2.422 24.48a.42.42 0 0 1-.199.129.54.54 0 0 1-.223.047zm0 0" fill="#0f0f0f"></path></svg>'];
12
12
  function $fbbadcb080ad1d4a$export$8be2714ec7f169ee(props = {}) {
13
13
  return $i7OB2$ssr($fbbadcb080ad1d4a$var$_tmpl$, $i7OB2$ssrHydrationKey(), $i7OB2$ssrAttribute("width", $i7OB2$escape(props.width_, true) ?? 14, false) + $i7OB2$ssrAttribute("height", $i7OB2$escape(props.height_, true) ?? 26, false));
@@ -824,27 +824,31 @@ function $29ec7cddbe1d3484$export$43f0fb951fcb0c54({
824
824
  });
825
825
  }
826
826
  // source: https://medium.com/@pancemarko/deep-equality-in-javascript-determining-if-two-objects-are-equal-bf98cf47e934
827
+ // deeply diffs two objects
828
+ // Modified by chatGPT to not be recursive, since stiga was getting a stack overflow just due to the size of their data
829
+ // Modified futher to bias towards saying objects are equal non-primitive objects differ
827
830
  function $29ec7cddbe1d3484$var$deep_equal(obj1, obj2) {
828
- if (obj1 === obj2) return true;
829
- if (Array.isArray(obj1) && Array.isArray(obj2)) {
830
- if (obj1.length !== obj2.length) return false;
831
- return obj1.every((elem, index) => {
832
- return $29ec7cddbe1d3484$var$deep_equal(elem, obj2[index]);
833
- });
834
- }
835
- if (typeof obj1 === "object" && typeof obj2 === "object" && obj1 !== null && obj2 !== null) {
836
- if (Array.isArray(obj1) || Array.isArray(obj2)) return false;
837
- const keys1 = Object.keys(obj1);
838
- const keys2 = Object.keys(obj2);
839
- if (keys1.length !== keys2.length || !keys1.every(key => keys2.includes(key))) return false;
840
- for (const key in obj1) {
841
- if ($29ec7cddbe1d3484$var$result_ids.includes(key)) continue; // ignore keys changing with every request
842
- const isEqual = $29ec7cddbe1d3484$var$deep_equal(obj1[key], obj2[key]);
843
- if (!isEqual) return false;
844
- }
845
- return true;
831
+ const stack = [[obj1, obj2]];
832
+ while (stack.length > 0) {
833
+ const [currentObj1, currentObj2] = stack.pop();
834
+ if (currentObj1 === currentObj2) continue;
835
+ if (Array.isArray(currentObj1) && Array.isArray(currentObj2)) {
836
+ if (currentObj1.length !== currentObj2.length) return false;
837
+ for (let i = 0; i < currentObj1.length; i++) stack.push([currentObj1[i], currentObj2[i]]);
838
+ } else if (typeof currentObj1 === "object" && typeof currentObj2 === "object" && currentObj1 !== null && currentObj2 !== null) {
839
+ if (Array.isArray(currentObj1) || Array.isArray(currentObj2)) return false;
840
+ const keys1 = Object.keys(currentObj1);
841
+ const keys2 = Object.keys(currentObj2);
842
+ if (keys1.length !== keys2.length || !keys1.every(key => keys2.includes(key))) return false;
843
+ for (let key in currentObj1) {
844
+ if ($29ec7cddbe1d3484$var$result_ids.includes(key)) continue; // ignore comparing values for keys we know are changing with every request
845
+ stack.push([currentObj1[key], currentObj2[key]]);
846
+ }
847
+ } else if (typeof currentObj1 !== "function" && typeof currentObj2 !== "function")
848
+ // Claim that all functions are equal, since the only way a function ends up here is because someone added it in the displayTransformer and that shouldn't force us to re-render, right?
849
+ return false;
846
850
  }
847
- return false;
851
+ return true;
848
852
  }
849
853
  const $c8d5ff4524619fcd$var$_tmpl$ = ["<div", ' class="', '">', "</div>"],
850
854
  $c8d5ff4524619fcd$var$_tmpl$2 = ["<style", ' type="text/css">', "</style>"];
@@ -4380,6 +4384,9 @@ function $e5014ccd0b76d9f4$export$967e966fca9515e(api_response) {
4380
4384
  }
4381
4385
  return api_response;
4382
4386
  }
4387
+
4388
+ // Minifiable and tree-shakable enum
4389
+ // Why not use const enum? See https://gitlab.com/depict-ai/depict.ai/-/merge_requests/9223#note_1675965260
4383
4390
  const $c20599a0d81d953a$export$74ee7529ce0f8a00 = "listingId";
4384
4391
  const $c20599a0d81d953a$export$5aae649db1b959fc = "externalId";
4385
4392
  const $7fa23e2a0079eca4$var$v3_base_url = (0, $i7OB2$base_url) + "/v3/";
@@ -7285,7 +7292,7 @@ function $961b5c64bef4662f$export$e2bf8ce7779e827e(props) {
7285
7292
  category_title: category_title
7286
7293
  } = props;
7287
7294
  const shared_properties = $961b5c64bef4662f$var$get_shared_properties(depict_category);
7288
- const diffableListingQuery = $i7OB2$createMemo(() => Object.values(depict_category.listing_query).join(""));
7295
+ const diffableListingQuery = $i7OB2$createMemo(() => Object.values(depict_category.listing_query || {}).join(""));
7289
7296
  return $16b52438165aafe2$export$23fca46f3143581f(() => {
7290
7297
  $i7OB2$createEffect(prev => {
7291
7298
  // this is here (and not on DepictCategory) so that people also know when PageReplacer removes the page, it's intended to help people replace their own content when a depict page is navigated, see https://depictaiworkspace.slack.com/archives/C04M8MGCF3K/p1691670636155369
@@ -7336,7 +7343,10 @@ function $961b5c64bef4662f$export$e2bf8ce7779e827e(props) {
7336
7343
  min_products_to_fetch_: $961b5c64bef4662f$var$min_products_to_fetch_,
7337
7344
  local_filter_cache_: local_filter_cache_,
7338
7345
  id_to_query_for_: $i7OB2$createMemo(() => !depict_category.disable_override_listing_id && override_listing_id_accessor_() || depict_category.listing_query.id),
7339
- id_type_: $i7OB2$createMemo(() => !depict_category.disable_override_listing_id && override_listing_id_accessor_() ? $c20599a0d81d953a$export$74ee7529ce0f8a00 : depict_category.listing_query.type),
7346
+ id_type_: $i7OB2$createMemo(() => {
7347
+ if (!depict_category.disable_override_listing_id && override_listing_id_accessor_()) return $c20599a0d81d953a$export$74ee7529ce0f8a00;
7348
+ return depict_category.listing_query.type;
7349
+ }),
7340
7350
  i18n_: i18n_,
7341
7351
  show_quicklinks_: $i7OB2$createMemo(() => props.show_quicklinks ?? true),
7342
7352
  category_title_: category_title,