@depict-ai/utilishared 0.0.72 → 0.0.74

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/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference path="../jsx.d.ts" />
2
2
  import { EUnavailabilityType } from "@depict-ai/types/api/TrackV2Request";
3
- export const version = "0.0.72";
3
+ export const version = "0.0.74";
4
4
  export const is_debug: boolean;
5
5
  /**
6
6
  * Sets the prefix of dlog, dwarn, and derror messages in the browser console. Defaults to `[Depict]`.
@@ -1087,12 +1087,14 @@ export interface LegacyDisplay {
1087
1087
  ga_product_ids?: string[];
1088
1088
  /** The variation IDs */
1089
1089
  variant_ids?: string[];
1090
- /** The recommendation ID */
1091
- recommendation_id: string;
1090
+ /** Unique search result ID used by Depict */
1091
+ search_result_id?: string;
1092
+ /** Unique product listing result ID used by Depict */
1093
+ product_listing_result_id?: string;
1094
+ /** Unique recommendation result ID used by Depict */
1095
+ recommendation_id?: string;
1092
1096
  /** The title */
1093
1097
  title: string;
1094
- /** The search result ID */
1095
- search_result_id?: string;
1096
1098
  [key: string]: any;
1097
1099
  }
1098
1100
  interface ModernDisplay {
@@ -1109,16 +1111,22 @@ interface ModernDisplay {
1109
1111
  /** Product of the different variants */
1110
1112
  variant_product_ids: string[];
1111
1113
  /** Unique search result ID used by Depict */
1112
- search_result_id: string;
1114
+ search_result_id?: string;
1115
+ /** Unique product listing result ID used by Depict */
1116
+ product_listing_result_id?: string;
1117
+ /** Unique recommendation result ID used by Depict */
1118
+ recommendation_id?: string;
1113
1119
  /** Recommendation type logic used by Depict */
1114
1120
  logic?: string;
1115
1121
  }
1116
1122
  interface BasicDisplay {
1117
1123
  product_id: string;
1118
- /** Unique recommendation ID used by Depict */
1119
- recommendation_id?: string;
1120
1124
  /** Unique search result ID used by Depict */
1121
1125
  search_result_id?: string;
1126
+ /** Unique product listing result ID used by Depict */
1127
+ product_listing_result_id?: string;
1128
+ /** Unique recommendation result ID used by Depict */
1129
+ recommendation_id?: string;
1122
1130
  /** Recommendation type logic used by Depict */
1123
1131
  logic?: string;
1124
1132
  [key: string]: any;
package/dist/main.js CHANGED
@@ -274,7 +274,7 @@ $parcel$export(module.exports, "hsl_to_rgb", () => $d73746ee466f09ca$export$e4fd
274
274
  $parcel$export(module.exports, "relative_luminance_from_rgb", () => $d73746ee466f09ca$export$98c2b3491e76c1f);
275
275
  $parcel$export(module.exports, "version", () => $815f67c61b4c0a42$export$83d89fbfd8236492);
276
276
  $parcel$export(module.exports, "add_to_version_info", () => $e4a18bf12ad092d9$export$2cefb7e61fcbae00);
277
- const $815f67c61b4c0a42$export$83d89fbfd8236492 = "0.0.72";
277
+ const $815f67c61b4c0a42$export$83d89fbfd8236492 = "0.0.74";
278
278
 
279
279
 
280
280
  const $7b5e577a60b81e60$export$55fe61489d2c7417 = /*@__PURE__*/ (()=>process.env.STRIP_DEBUG === "true" ? false : process.env.DEBUG === "true" || process.env.NODE_ENV === "development" || process.env.BUILD_TARGET !== "node" && (document.currentScript?.dataset?.debug === "true" || localStorage.getItem("debug") === "true"))();
@@ -998,7 +998,7 @@ class $04a37742898e4bd5$export$32ccf3a614c84258 {
998
998
  }
999
999
 
1000
1000
 
1001
- const $7599647868f98022$var$needs_patching = typeof window === "object" ? /*@__PURE__*/ $7599647868f98022$var$check_if_querySelectorAll_needs_patching() : false;
1001
+ const $7599647868f98022$var$needs_patching = /*@__PURE__*/ $7599647868f98022$var$check_if_querySelectorAll_needs_patching();
1002
1002
  function $7599647868f98022$export$33f937d741e49339(element, selector) {
1003
1003
  if (!(element instanceof Element) || !$7599647868f98022$var$needs_patching || !selector.includes("#") || !selector.includes("+")) // covers most cases, we don't need patching or don't hit the bug
1004
1004
  return element?.querySelectorAll?.(selector);
@@ -1099,7 +1099,7 @@ class $9043c64496e3375f$export$12e07a2a9f87578a {
1099
1099
  #observer_callback_running = false;
1100
1100
  #execute_after_callback_ran = [];
1101
1101
  #attribute_attribution_map_object = {};
1102
- #territory;
1102
+ #territory = document;
1103
1103
  #listeners = [
1104
1104
  "exists",
1105
1105
  "creation",
@@ -1112,7 +1112,7 @@ class $9043c64496e3375f$export$12e07a2a9f87578a {
1112
1112
  ifexists: (selector, callback)=>{
1113
1113
  this.#check_observer_args(selector, callback, true);
1114
1114
  if (selector instanceof Node) {
1115
- if (typeof document === "object" && document.documentElement.contains(selector)) // When the selector is a node the selector and the element are the same, dunno how we could reflect that in the typing though
1115
+ if (document.documentElement.contains(selector)) // When the selector is a node the selector and the element are the same, dunno how we could reflect that in the typing though
1116
1116
  this.#call_callbacks([
1117
1117
  callback
1118
1118
  ], (callback_)=>({
@@ -1128,7 +1128,7 @@ class $9043c64496e3375f$export$12e07a2a9f87578a {
1128
1128
  return;
1129
1129
  }
1130
1130
  const our_set = this.#attribute_attribution_map_object[selector] ||= new WeakSet();
1131
- const elements = typeof document === "undefined" ? [] : (0, $7599647868f98022$export$33f937d741e49339)(this.#territory || document, selector);
1131
+ const elements = (0, $7599647868f98022$export$33f937d741e49339)(this.#territory, selector);
1132
1132
  for(let i = 0; i < elements.length; i++){
1133
1133
  const element = elements[i];
1134
1134
  our_set.add(element);
@@ -1165,9 +1165,8 @@ class $9043c64496e3375f$export$12e07a2a9f87578a {
1165
1165
  }
1166
1166
  };
1167
1167
  #kickstart_observer() {
1168
- if (typeof document === "undefined") return;
1169
1168
  this.#the_mutation_observer = new MutationObserver(this.#observer_callback);
1170
- this.#the_mutation_observer.observe(this.#territory || document, {
1169
+ this.#the_mutation_observer.observe(this.#territory, {
1171
1170
  attributes: true,
1172
1171
  childList: true,
1173
1172
  subtree: true,
@@ -1705,11 +1704,7 @@ class $d10801050840d92b$export$1b28bc5c68cc4d77 extends EventTarget {
1705
1704
  return (0, $3f34dc07544c5857$export$bb0a9c36cf454ea0)(1, 1000);
1706
1705
  }
1707
1706
  #connect() {
1708
- this.current_socket = typeof window === "object" || typeof WebSocket === "function" ? new WebSocket(...this.#ws_constructor_options) : {
1709
- readyState: 0,
1710
- addEventListener: ()=>{},
1711
- send: ()=>{}
1712
- };
1707
+ this.current_socket = new WebSocket(...this.#ws_constructor_options);
1713
1708
  this.#possible_events.forEach((name)=>{
1714
1709
  this.current_socket.addEventListener(name, (0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)((original_event)=>{
1715
1710
  let fixed_event;
@@ -2246,7 +2241,7 @@ async function $44909e19109bf973$export$8f66c4c7fb96eda2(e, product_id) {
2246
2241
  * Currently watched elements by the intersection observer with their respective callback
2247
2242
  * */ const $72ed530554068e4f$var$watched_elements = /*@__PURE__*/ new WeakMap();
2248
2243
  const $72ed530554068e4f$var$unwatch_element = (element)=>{
2249
- $72ed530554068e4f$var$intersection_observer?.unobserve(element);
2244
+ $72ed530554068e4f$var$intersection_observer.unobserve(element);
2250
2245
  $72ed530554068e4f$var$watched_elements.delete(element);
2251
2246
  $72ed530554068e4f$var$current_intersections.delete(element);
2252
2247
  };
@@ -2255,7 +2250,7 @@ const $72ed530554068e4f$export$4c51576248bcdf31 = (element, callback)=>{
2255
2250
  (0, $e6c6e7929ea385ae$export$de56f1198d121036)("Not watching", element, "as it's already being watched");
2256
2251
  return ()=>{};
2257
2252
  }
2258
- $72ed530554068e4f$var$intersection_observer?.observe(element);
2253
+ $72ed530554068e4f$var$intersection_observer.observe(element);
2259
2254
  /** Calls the given callback and makes sure to stop watching the element */ const wrapped_callback = (element)=>{
2260
2255
  callback(element);
2261
2256
  $72ed530554068e4f$var$unwatch_element(element);
@@ -2278,7 +2273,7 @@ const $72ed530554068e4f$var$intersection_observer_callback = (entries)=>{
2278
2273
  const callback = $72ed530554068e4f$var$watched_elements.get(target);
2279
2274
  // Skip the element if it's no longer being watched.
2280
2275
  if (!callback) {
2281
- $72ed530554068e4f$var$intersection_observer?.unobserve(target);
2276
+ $72ed530554068e4f$var$intersection_observer.unobserve(target);
2282
2277
  continue;
2283
2278
  }
2284
2279
  const currently_intersecting = $72ed530554068e4f$var$current_intersections.has(target);
@@ -2311,9 +2306,9 @@ const $72ed530554068e4f$var$intersection_observer_callback = (entries)=>{
2311
2306
  /**
2312
2307
  * Global IntersectionObserver used for all impression tracking.
2313
2308
  * It's faster to use one observer for all elements than to create a new one for each element.
2314
- */ const $72ed530554068e4f$var$intersection_observer = typeof window === "object" ? /*@__PURE__*/ new IntersectionObserver((0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)($72ed530554068e4f$var$intersection_observer_callback), {
2309
+ */ const $72ed530554068e4f$var$intersection_observer = /*@__PURE__*/ new IntersectionObserver((0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)($72ed530554068e4f$var$intersection_observer_callback), {
2315
2310
  threshold: /*@__PURE__*/ (0, /*@__PURE__*/$0da0cad4f39e8f32$export$f8ea2e7b15b5d129)(8)
2316
- }) : undefined;
2311
+ });
2317
2312
 
2318
2313
 
2319
2314
 
@@ -2448,7 +2443,6 @@ const $69f7524c8bdd85b4$export$a9d39e43ae273d26 = /*@__PURE__*/ (0, /*@__PURE__*
2448
2443
  const $69f7524c8bdd85b4$export$446840cab57eeedb = /*@__PURE__*/ new Set();
2449
2444
  let $69f7524c8bdd85b4$var$old_url;
2450
2445
  const $69f7524c8bdd85b4$var$maybe_navigation = ()=>{
2451
- if (typeof location === "undefined") return;
2452
2446
  const new_url = location.href;
2453
2447
  if ($69f7524c8bdd85b4$var$old_url !== new_url) {
2454
2448
  $69f7524c8bdd85b4$export$a9d39e43ae273d26(new_url);
@@ -2459,7 +2453,7 @@ const $69f7524c8bdd85b4$var$maybe_navigation = ()=>{
2459
2453
  };
2460
2454
  $69f7524c8bdd85b4$export$baccefee4a395d8f($69f7524c8bdd85b4$var$maybe_navigation);
2461
2455
  $69f7524c8bdd85b4$var$maybe_navigation();
2462
- globalThis?.window?.addEventListener("popstate", (0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)((e)=>{
2456
+ window.addEventListener("popstate", (0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)((e)=>{
2463
2457
  for (const fn of $69f7524c8bdd85b4$export$446840cab57eeedb)(0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)(fn)(e);
2464
2458
  $69f7524c8bdd85b4$var$maybe_navigation();
2465
2459
  }));
@@ -2471,7 +2465,6 @@ async function $69f7524c8bdd85b4$export$1cd22bab0d2c3b0b(callback) {
2471
2465
  }
2472
2466
  }
2473
2467
  async function $69f7524c8bdd85b4$export$baccefee4a395d8f(after_navigation, replace_replaceState = true) {
2474
- if (typeof History === "undefined") return;
2475
2468
  const { prototype: prototype } = History;
2476
2469
  const instance = history;
2477
2470
  const polyfill_dance = (the_thing)=>{
@@ -4314,7 +4307,6 @@ const $107a74aa4ea5902d$export$34b9dba7ce09269b = (tag, { children: children , .
4314
4307
  // Exhaustive list (I think) for these checks should be ["svg","animate","animateMotion","animateTransform","circle","clipPath","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","mask","metadata","path","pattern","polygon","polyline","radialGradient","rect","stop","switch","symbol","text","textPath","tspan","use","view"]
4315
4308
  const is_svg = props?.xmlns || tag == "defs" || tag == "filter" || tag == "fecolormatrix" || tag == "g" || tag == "circle" || tag == "circle" || tag == "svg" || tag == "path" || tag == "polygon";
4316
4309
  if (is_svg) var namespace = props?.xmlns || "http://www.w3.org/2000/svg";
4317
- if (typeof document === "undefined") return {};
4318
4310
  const element = is_svg ? document.createElementNS(namespace, tag) : document.createElement(tag);
4319
4311
  for(const key in props){
4320
4312
  const value = props[key];
@@ -4331,7 +4323,6 @@ const $107a74aa4ea5902d$export$34b9dba7ce09269b = (tag, { children: children , .
4331
4323
  };
4332
4324
  const $107a74aa4ea5902d$export$25062201e9e25d76 = $107a74aa4ea5902d$export$34b9dba7ce09269b;
4333
4325
  const $107a74aa4ea5902d$export$ffb0004e005737fa = ({ children: children }, _unknown)=>{
4334
- if (typeof document === "undefined") return {};
4335
4326
  const df = document.createDocumentFragment();
4336
4327
  $107a74aa4ea5902d$var$appendChild(df, children);
4337
4328
  return df;
@@ -4894,7 +4885,7 @@ function $04d2f7d9126af667$var$push_function(fn1, handler) {
4894
4885
 
4895
4886
 
4896
4887
 
4897
- const $f3f05d97149aec76$export$deca40f48c0569f8 = typeof window === "undefined" ? false : /*@__PURE__*/ localStorage.getItem("colorize-logics") === "true";
4888
+ const $f3f05d97149aec76$export$deca40f48c0569f8 = /*@__PURE__*/ localStorage.getItem("colorize-logics") === "true";
4898
4889
  function $f3f05d97149aec76$export$16501883f477737a(elements, display) {
4899
4890
  elements.forEach((elem)=>{
4900
4891
  if (elem.nodeType !== Node.TEXT_NODE) {
@@ -7662,14 +7653,14 @@ function $bd274a272f8400ec$export$4fbbab6c30e664d5(value) {
7662
7653
 
7663
7654
 
7664
7655
  const $6d0c26cd36f5eeff$var$promise_as_string = "Promise";
7656
+ const $6d0c26cd36f5eeff$var$w = window;
7665
7657
  function $6d0c26cd36f5eeff$export$38e89c688f9d553a() {
7666
7658
  try {
7667
- const w = window;
7668
- let da_promise = w[$6d0c26cd36f5eeff$var$promise_as_string];
7659
+ let da_promise = $6d0c26cd36f5eeff$var$w[$6d0c26cd36f5eeff$var$promise_as_string];
7669
7660
  let iframe_promise;
7670
7661
  if ((typeof da_promise.allSettled !== "function" || typeof da_promise?.prototype?.finally !== "function") && !(0, $bd274a272f8400ec$export$4fbbab6c30e664d5)(da_promise) && (iframe_promise = $6d0c26cd36f5eeff$export$e647444ed9403635())) da_promise = iframe_promise;
7671
7662
  if (da_promise) {
7672
- if (Object.getOwnPropertyDescriptor(w, $6d0c26cd36f5eeff$var$promise_as_string)?.configurable !== false) Object.defineProperty(w, $6d0c26cd36f5eeff$var$promise_as_string, {
7663
+ if (Object.getOwnPropertyDescriptor($6d0c26cd36f5eeff$var$w, $6d0c26cd36f5eeff$var$promise_as_string)?.configurable !== false) Object.defineProperty($6d0c26cd36f5eeff$var$w, $6d0c26cd36f5eeff$var$promise_as_string, {
7673
7664
  configurable: false,
7674
7665
  enumerable: true,
7675
7666
  get () {
@@ -8431,7 +8422,7 @@ $80ae37b75f3a6ec8$exports = ".depict-img-cont {\n width: 100%;\n height: 100%;
8431
8422
 
8432
8423
 
8433
8424
  const $ff973b2032639b5f$export$3d13beba9b52c947 = "https://img.depict.ai/ResizeImage" + (process.env.TENANT ? "/" + process.env.TENANT : "");
8434
- const $ff973b2032639b5f$export$a98fc8a2c818d3d8 = /*@__PURE__*/ (()=>typeof navigator === "undefined" ? false : /^((?!chrome|android).)*safari/i.test(navigator.userAgent))(); // https://stackoverflow.com/a/23522755
8425
+ const $ff973b2032639b5f$export$a98fc8a2c818d3d8 = /*@__PURE__*/ (()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent))(); // https://stackoverflow.com/a/23522755
8435
8426
  function $ff973b2032639b5f$export$f39a7d0667e924a(what_to_watch, sizes_communicator = (0, $9a42a570de51ea3d$export$e806c6c1615a59ae)(), resolution_factor = 1) {
8436
8427
  let currently_live = false;
8437
8428
  const ro = new ResizeObserver((0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)((records)=>{
package/dist/module.js CHANGED
@@ -4,7 +4,7 @@ function $parcel$export(e, n, v, s) {
4
4
  function $parcel$interopDefault(a) {
5
5
  return a && a.__esModule ? a.default : a;
6
6
  }
7
- const $0766c85d387a9765$export$83d89fbfd8236492 = "0.0.72";
7
+ const $0766c85d387a9765$export$83d89fbfd8236492 = "0.0.74";
8
8
 
9
9
 
10
10
  const $571bce04eb920cd8$export$55fe61489d2c7417 = /*@__PURE__*/ (()=>process.env.STRIP_DEBUG === "true" ? false : process.env.DEBUG === "true" || process.env.NODE_ENV === "development" || process.env.BUILD_TARGET !== "node" && (document.currentScript?.dataset?.debug === "true" || localStorage.getItem("debug") === "true"))();
@@ -728,7 +728,7 @@ class $09ff985c7c424fb3$export$32ccf3a614c84258 {
728
728
  }
729
729
 
730
730
 
731
- const $39ef887981612535$var$needs_patching = typeof window === "object" ? /*@__PURE__*/ $39ef887981612535$var$check_if_querySelectorAll_needs_patching() : false;
731
+ const $39ef887981612535$var$needs_patching = /*@__PURE__*/ $39ef887981612535$var$check_if_querySelectorAll_needs_patching();
732
732
  function $39ef887981612535$export$33f937d741e49339(element, selector) {
733
733
  if (!(element instanceof Element) || !$39ef887981612535$var$needs_patching || !selector.includes("#") || !selector.includes("+")) // covers most cases, we don't need patching or don't hit the bug
734
734
  return element?.querySelectorAll?.(selector);
@@ -829,7 +829,7 @@ class $cdca9fea6eb103e5$export$12e07a2a9f87578a {
829
829
  #observer_callback_running = false;
830
830
  #execute_after_callback_ran = [];
831
831
  #attribute_attribution_map_object = {};
832
- #territory;
832
+ #territory = document;
833
833
  #listeners = [
834
834
  "exists",
835
835
  "creation",
@@ -842,7 +842,7 @@ class $cdca9fea6eb103e5$export$12e07a2a9f87578a {
842
842
  ifexists: (selector, callback)=>{
843
843
  this.#check_observer_args(selector, callback, true);
844
844
  if (selector instanceof Node) {
845
- if (typeof document === "object" && document.documentElement.contains(selector)) // When the selector is a node the selector and the element are the same, dunno how we could reflect that in the typing though
845
+ if (document.documentElement.contains(selector)) // When the selector is a node the selector and the element are the same, dunno how we could reflect that in the typing though
846
846
  this.#call_callbacks([
847
847
  callback
848
848
  ], (callback_)=>({
@@ -858,7 +858,7 @@ class $cdca9fea6eb103e5$export$12e07a2a9f87578a {
858
858
  return;
859
859
  }
860
860
  const our_set = this.#attribute_attribution_map_object[selector] ||= new WeakSet();
861
- const elements = typeof document === "undefined" ? [] : (0, $39ef887981612535$export$33f937d741e49339)(this.#territory || document, selector);
861
+ const elements = (0, $39ef887981612535$export$33f937d741e49339)(this.#territory, selector);
862
862
  for(let i = 0; i < elements.length; i++){
863
863
  const element = elements[i];
864
864
  our_set.add(element);
@@ -895,9 +895,8 @@ class $cdca9fea6eb103e5$export$12e07a2a9f87578a {
895
895
  }
896
896
  };
897
897
  #kickstart_observer() {
898
- if (typeof document === "undefined") return;
899
898
  this.#the_mutation_observer = new MutationObserver(this.#observer_callback);
900
- this.#the_mutation_observer.observe(this.#territory || document, {
899
+ this.#the_mutation_observer.observe(this.#territory, {
901
900
  attributes: true,
902
901
  childList: true,
903
902
  subtree: true,
@@ -1435,11 +1434,7 @@ class $4ce764ddfee055ef$export$1b28bc5c68cc4d77 extends EventTarget {
1435
1434
  return (0, $d89638655e64f324$export$bb0a9c36cf454ea0)(1, 1000);
1436
1435
  }
1437
1436
  #connect() {
1438
- this.current_socket = typeof window === "object" || typeof WebSocket === "function" ? new WebSocket(...this.#ws_constructor_options) : {
1439
- readyState: 0,
1440
- addEventListener: ()=>{},
1441
- send: ()=>{}
1442
- };
1437
+ this.current_socket = new WebSocket(...this.#ws_constructor_options);
1443
1438
  this.#possible_events.forEach((name)=>{
1444
1439
  this.current_socket.addEventListener(name, (0, $b04e44fad5ea42c7$export$b3bbfd758f11cfa9)((original_event)=>{
1445
1440
  let fixed_event;
@@ -1976,7 +1971,7 @@ async function $61b3c9e5f2cf8171$export$8f66c4c7fb96eda2(e, product_id) {
1976
1971
  * Currently watched elements by the intersection observer with their respective callback
1977
1972
  * */ const $f24c14db771b471d$var$watched_elements = /*@__PURE__*/ new WeakMap();
1978
1973
  const $f24c14db771b471d$var$unwatch_element = (element)=>{
1979
- $f24c14db771b471d$var$intersection_observer?.unobserve(element);
1974
+ $f24c14db771b471d$var$intersection_observer.unobserve(element);
1980
1975
  $f24c14db771b471d$var$watched_elements.delete(element);
1981
1976
  $f24c14db771b471d$var$current_intersections.delete(element);
1982
1977
  };
@@ -1985,7 +1980,7 @@ const $f24c14db771b471d$export$4c51576248bcdf31 = (element, callback)=>{
1985
1980
  (0, $649f456f663da9fc$export$de56f1198d121036)("Not watching", element, "as it's already being watched");
1986
1981
  return ()=>{};
1987
1982
  }
1988
- $f24c14db771b471d$var$intersection_observer?.observe(element);
1983
+ $f24c14db771b471d$var$intersection_observer.observe(element);
1989
1984
  /** Calls the given callback and makes sure to stop watching the element */ const wrapped_callback = (element)=>{
1990
1985
  callback(element);
1991
1986
  $f24c14db771b471d$var$unwatch_element(element);
@@ -2008,7 +2003,7 @@ const $f24c14db771b471d$var$intersection_observer_callback = (entries)=>{
2008
2003
  const callback = $f24c14db771b471d$var$watched_elements.get(target);
2009
2004
  // Skip the element if it's no longer being watched.
2010
2005
  if (!callback) {
2011
- $f24c14db771b471d$var$intersection_observer?.unobserve(target);
2006
+ $f24c14db771b471d$var$intersection_observer.unobserve(target);
2012
2007
  continue;
2013
2008
  }
2014
2009
  const currently_intersecting = $f24c14db771b471d$var$current_intersections.has(target);
@@ -2041,9 +2036,9 @@ const $f24c14db771b471d$var$intersection_observer_callback = (entries)=>{
2041
2036
  /**
2042
2037
  * Global IntersectionObserver used for all impression tracking.
2043
2038
  * It's faster to use one observer for all elements than to create a new one for each element.
2044
- */ const $f24c14db771b471d$var$intersection_observer = typeof window === "object" ? /*@__PURE__*/ new IntersectionObserver((0, $b04e44fad5ea42c7$export$b3bbfd758f11cfa9)($f24c14db771b471d$var$intersection_observer_callback), {
2039
+ */ const $f24c14db771b471d$var$intersection_observer = /*@__PURE__*/ new IntersectionObserver((0, $b04e44fad5ea42c7$export$b3bbfd758f11cfa9)($f24c14db771b471d$var$intersection_observer_callback), {
2045
2040
  threshold: /*@__PURE__*/ (0, /*@__PURE__*/$9ab9ecb74920f343$export$f8ea2e7b15b5d129)(8)
2046
- }) : undefined;
2041
+ });
2047
2042
 
2048
2043
 
2049
2044
 
@@ -2178,7 +2173,6 @@ const $0d2acf276472ebf7$export$a9d39e43ae273d26 = /*@__PURE__*/ (0, /*@__PURE__*
2178
2173
  const $0d2acf276472ebf7$export$446840cab57eeedb = /*@__PURE__*/ new Set();
2179
2174
  let $0d2acf276472ebf7$var$old_url;
2180
2175
  const $0d2acf276472ebf7$var$maybe_navigation = ()=>{
2181
- if (typeof location === "undefined") return;
2182
2176
  const new_url = location.href;
2183
2177
  if ($0d2acf276472ebf7$var$old_url !== new_url) {
2184
2178
  $0d2acf276472ebf7$export$a9d39e43ae273d26(new_url);
@@ -2189,7 +2183,7 @@ const $0d2acf276472ebf7$var$maybe_navigation = ()=>{
2189
2183
  };
2190
2184
  $0d2acf276472ebf7$export$baccefee4a395d8f($0d2acf276472ebf7$var$maybe_navigation);
2191
2185
  $0d2acf276472ebf7$var$maybe_navigation();
2192
- globalThis?.window?.addEventListener("popstate", (0, $b04e44fad5ea42c7$export$b3bbfd758f11cfa9)((e)=>{
2186
+ window.addEventListener("popstate", (0, $b04e44fad5ea42c7$export$b3bbfd758f11cfa9)((e)=>{
2193
2187
  for (const fn of $0d2acf276472ebf7$export$446840cab57eeedb)(0, $b04e44fad5ea42c7$export$b3bbfd758f11cfa9)(fn)(e);
2194
2188
  $0d2acf276472ebf7$var$maybe_navigation();
2195
2189
  }));
@@ -2201,7 +2195,6 @@ async function $0d2acf276472ebf7$export$1cd22bab0d2c3b0b(callback) {
2201
2195
  }
2202
2196
  }
2203
2197
  async function $0d2acf276472ebf7$export$baccefee4a395d8f(after_navigation, replace_replaceState = true) {
2204
- if (typeof History === "undefined") return;
2205
2198
  const { prototype: prototype } = History;
2206
2199
  const instance = history;
2207
2200
  const polyfill_dance = (the_thing)=>{
@@ -4044,7 +4037,6 @@ const $63cbb5de51d11596$export$34b9dba7ce09269b = (tag, { children: children , .
4044
4037
  // Exhaustive list (I think) for these checks should be ["svg","animate","animateMotion","animateTransform","circle","clipPath","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","mask","metadata","path","pattern","polygon","polyline","radialGradient","rect","stop","switch","symbol","text","textPath","tspan","use","view"]
4045
4038
  const is_svg = props?.xmlns || tag == "defs" || tag == "filter" || tag == "fecolormatrix" || tag == "g" || tag == "circle" || tag == "circle" || tag == "svg" || tag == "path" || tag == "polygon";
4046
4039
  if (is_svg) var namespace = props?.xmlns || "http://www.w3.org/2000/svg";
4047
- if (typeof document === "undefined") return {};
4048
4040
  const element = is_svg ? document.createElementNS(namespace, tag) : document.createElement(tag);
4049
4041
  for(const key in props){
4050
4042
  const value = props[key];
@@ -4061,7 +4053,6 @@ const $63cbb5de51d11596$export$34b9dba7ce09269b = (tag, { children: children , .
4061
4053
  };
4062
4054
  const $63cbb5de51d11596$export$25062201e9e25d76 = $63cbb5de51d11596$export$34b9dba7ce09269b;
4063
4055
  const $63cbb5de51d11596$export$ffb0004e005737fa = ({ children: children }, _unknown)=>{
4064
- if (typeof document === "undefined") return {};
4065
4056
  const df = document.createDocumentFragment();
4066
4057
  $63cbb5de51d11596$var$appendChild(df, children);
4067
4058
  return df;
@@ -4624,7 +4615,7 @@ function $c1503704e45e6a15$var$push_function(fn1, handler) {
4624
4615
 
4625
4616
 
4626
4617
 
4627
- const $893f9af5dbae6bc8$export$deca40f48c0569f8 = typeof window === "undefined" ? false : /*@__PURE__*/ localStorage.getItem("colorize-logics") === "true";
4618
+ const $893f9af5dbae6bc8$export$deca40f48c0569f8 = /*@__PURE__*/ localStorage.getItem("colorize-logics") === "true";
4628
4619
  function $893f9af5dbae6bc8$export$16501883f477737a(elements, display) {
4629
4620
  elements.forEach((elem)=>{
4630
4621
  if (elem.nodeType !== Node.TEXT_NODE) {
@@ -7392,14 +7383,14 @@ function $67acdcc7df099ae4$export$4fbbab6c30e664d5(value) {
7392
7383
 
7393
7384
 
7394
7385
  const $1dd4146ad893cfb2$var$promise_as_string = "Promise";
7386
+ const $1dd4146ad893cfb2$var$w = window;
7395
7387
  function $1dd4146ad893cfb2$export$38e89c688f9d553a() {
7396
7388
  try {
7397
- const w = window;
7398
- let da_promise = w[$1dd4146ad893cfb2$var$promise_as_string];
7389
+ let da_promise = $1dd4146ad893cfb2$var$w[$1dd4146ad893cfb2$var$promise_as_string];
7399
7390
  let iframe_promise;
7400
7391
  if ((typeof da_promise.allSettled !== "function" || typeof da_promise?.prototype?.finally !== "function") && !(0, $67acdcc7df099ae4$export$4fbbab6c30e664d5)(da_promise) && (iframe_promise = $1dd4146ad893cfb2$export$e647444ed9403635())) da_promise = iframe_promise;
7401
7392
  if (da_promise) {
7402
- if (Object.getOwnPropertyDescriptor(w, $1dd4146ad893cfb2$var$promise_as_string)?.configurable !== false) Object.defineProperty(w, $1dd4146ad893cfb2$var$promise_as_string, {
7393
+ if (Object.getOwnPropertyDescriptor($1dd4146ad893cfb2$var$w, $1dd4146ad893cfb2$var$promise_as_string)?.configurable !== false) Object.defineProperty($1dd4146ad893cfb2$var$w, $1dd4146ad893cfb2$var$promise_as_string, {
7403
7394
  configurable: false,
7404
7395
  enumerable: true,
7405
7396
  get () {
@@ -8161,7 +8152,7 @@ $0643fffeaad31076$exports = ".depict-img-cont {\n width: 100%;\n height: 100%;
8161
8152
 
8162
8153
 
8163
8154
  const $45af9e834781a9bc$export$3d13beba9b52c947 = "https://img.depict.ai/ResizeImage" + (process.env.TENANT ? "/" + process.env.TENANT : "");
8164
- const $45af9e834781a9bc$export$a98fc8a2c818d3d8 = /*@__PURE__*/ (()=>typeof navigator === "undefined" ? false : /^((?!chrome|android).)*safari/i.test(navigator.userAgent))(); // https://stackoverflow.com/a/23522755
8155
+ const $45af9e834781a9bc$export$a98fc8a2c818d3d8 = /*@__PURE__*/ (()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent))(); // https://stackoverflow.com/a/23522755
8165
8156
  function $45af9e834781a9bc$export$f39a7d0667e924a(what_to_watch, sizes_communicator = (0, $607fc90221d440a6$export$e806c6c1615a59ae)(), resolution_factor = 1) {
8166
8157
  let currently_live = false;
8167
8158
  const ro = new ResizeObserver((0, $b04e44fad5ea42c7$export$b3bbfd758f11cfa9)((records)=>{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/utilishared",
3
- "version": "0.0.72",
3
+ "version": "0.0.74",
4
4
  "packageManager": "yarn@3.2.2",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/main.js",
@@ -43,7 +43,7 @@
43
43
  "@babel/core": "latest",
44
44
  "@babel/runtime": "latest",
45
45
  "@babel/runtime-corejs3": "latest",
46
- "@depict-ai/types": "^0.0.19",
46
+ "@depict-ai/types": "^0.0.22",
47
47
  "@parcel/resolver-default": "^2.8.0",
48
48
  "@sentry/cli": "latest",
49
49
  "@sentry/types": "^7.13.0",