@depict-ai/utilishared 0.0.66 → 0.0.67
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 +1 -1
- package/dist/main.js +15 -11
- package/dist/module.js +15 -11
- package/package.json +1 -1
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.
|
|
3
|
+
export const version = "0.0.67";
|
|
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]`.
|
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.
|
|
277
|
+
const $815f67c61b4c0a42$export$83d89fbfd8236492 = "0.0.67";
|
|
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"))();
|
|
@@ -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;
|
|
1103
1103
|
#listeners = [
|
|
1104
1104
|
"exists",
|
|
1105
1105
|
"creation",
|
|
@@ -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 = (0, $7599647868f98022$export$33f937d741e49339)(this.#territory, selector);
|
|
1131
|
+
const elements = typeof document === "undefined" ? [] : (0, $7599647868f98022$export$33f937d741e49339)(this.#territory || document, 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,9 @@ class $9043c64496e3375f$export$12e07a2a9f87578a {
|
|
|
1165
1165
|
}
|
|
1166
1166
|
};
|
|
1167
1167
|
#kickstart_observer() {
|
|
1168
|
-
if (typeof
|
|
1168
|
+
if (typeof document === "undefined") return;
|
|
1169
1169
|
this.#the_mutation_observer = new MutationObserver(this.#observer_callback);
|
|
1170
|
-
this.#the_mutation_observer.observe(this.#territory, {
|
|
1170
|
+
this.#the_mutation_observer.observe(this.#territory || document, {
|
|
1171
1171
|
attributes: true,
|
|
1172
1172
|
childList: true,
|
|
1173
1173
|
subtree: true,
|
|
@@ -1705,7 +1705,11 @@ class $d10801050840d92b$export$1b28bc5c68cc4d77 extends EventTarget {
|
|
|
1705
1705
|
return (0, $3f34dc07544c5857$export$bb0a9c36cf454ea0)(1, 1000);
|
|
1706
1706
|
}
|
|
1707
1707
|
#connect() {
|
|
1708
|
-
this.current_socket = new WebSocket(...this.#ws_constructor_options)
|
|
1708
|
+
this.current_socket = typeof window === "object" || typeof WebSocket === "function" ? new WebSocket(...this.#ws_constructor_options) : {
|
|
1709
|
+
readyState: 0,
|
|
1710
|
+
addEventListener: ()=>{},
|
|
1711
|
+
send: ()=>{}
|
|
1712
|
+
};
|
|
1709
1713
|
this.#possible_events.forEach((name)=>{
|
|
1710
1714
|
this.current_socket.addEventListener(name, (0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)((original_event)=>{
|
|
1711
1715
|
let fixed_event;
|
|
@@ -2242,7 +2246,7 @@ async function $44909e19109bf973$export$8f66c4c7fb96eda2(e, product_id) {
|
|
|
2242
2246
|
* Currently watched elements by the intersection observer with their respective callback
|
|
2243
2247
|
* */ const $72ed530554068e4f$var$watched_elements = /*@__PURE__*/ new WeakMap();
|
|
2244
2248
|
const $72ed530554068e4f$var$unwatch_element = (element)=>{
|
|
2245
|
-
$72ed530554068e4f$var$intersection_observer
|
|
2249
|
+
$72ed530554068e4f$var$intersection_observer?.unobserve(element);
|
|
2246
2250
|
$72ed530554068e4f$var$watched_elements.delete(element);
|
|
2247
2251
|
$72ed530554068e4f$var$current_intersections.delete(element);
|
|
2248
2252
|
};
|
|
@@ -2251,7 +2255,7 @@ const $72ed530554068e4f$export$4c51576248bcdf31 = (element, callback)=>{
|
|
|
2251
2255
|
(0, $e6c6e7929ea385ae$export$de56f1198d121036)("Not watching", element, "as it's already being watched");
|
|
2252
2256
|
return ()=>{};
|
|
2253
2257
|
}
|
|
2254
|
-
$72ed530554068e4f$var$intersection_observer
|
|
2258
|
+
$72ed530554068e4f$var$intersection_observer?.observe(element);
|
|
2255
2259
|
/** Calls the given callback and makes sure to stop watching the element */ const wrapped_callback = (element)=>{
|
|
2256
2260
|
callback(element);
|
|
2257
2261
|
$72ed530554068e4f$var$unwatch_element(element);
|
|
@@ -2274,7 +2278,7 @@ const $72ed530554068e4f$var$intersection_observer_callback = (entries)=>{
|
|
|
2274
2278
|
const callback = $72ed530554068e4f$var$watched_elements.get(target);
|
|
2275
2279
|
// Skip the element if it's no longer being watched.
|
|
2276
2280
|
if (!callback) {
|
|
2277
|
-
$72ed530554068e4f$var$intersection_observer
|
|
2281
|
+
$72ed530554068e4f$var$intersection_observer?.unobserve(target);
|
|
2278
2282
|
continue;
|
|
2279
2283
|
}
|
|
2280
2284
|
const currently_intersecting = $72ed530554068e4f$var$current_intersections.has(target);
|
|
@@ -2307,9 +2311,9 @@ const $72ed530554068e4f$var$intersection_observer_callback = (entries)=>{
|
|
|
2307
2311
|
/**
|
|
2308
2312
|
* Global IntersectionObserver used for all impression tracking.
|
|
2309
2313
|
* It's faster to use one observer for all elements than to create a new one for each element.
|
|
2310
|
-
*/ const $72ed530554068e4f$var$intersection_observer = /*@__PURE__*/ new IntersectionObserver((0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)($72ed530554068e4f$var$intersection_observer_callback), {
|
|
2314
|
+
*/ const $72ed530554068e4f$var$intersection_observer = typeof window === "object" ? /*@__PURE__*/ new IntersectionObserver((0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)($72ed530554068e4f$var$intersection_observer_callback), {
|
|
2311
2315
|
threshold: /*@__PURE__*/ (0, /*@__PURE__*/$0da0cad4f39e8f32$export$f8ea2e7b15b5d129)(8)
|
|
2312
|
-
});
|
|
2316
|
+
}) : undefined;
|
|
2313
2317
|
|
|
2314
2318
|
|
|
2315
2319
|
|
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.
|
|
7
|
+
const $0766c85d387a9765$export$83d89fbfd8236492 = "0.0.67";
|
|
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"))();
|
|
@@ -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;
|
|
833
833
|
#listeners = [
|
|
834
834
|
"exists",
|
|
835
835
|
"creation",
|
|
@@ -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 = (0, $39ef887981612535$export$33f937d741e49339)(this.#territory, selector);
|
|
861
|
+
const elements = typeof document === "undefined" ? [] : (0, $39ef887981612535$export$33f937d741e49339)(this.#territory || document, 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,9 @@ class $cdca9fea6eb103e5$export$12e07a2a9f87578a {
|
|
|
895
895
|
}
|
|
896
896
|
};
|
|
897
897
|
#kickstart_observer() {
|
|
898
|
-
if (typeof
|
|
898
|
+
if (typeof document === "undefined") return;
|
|
899
899
|
this.#the_mutation_observer = new MutationObserver(this.#observer_callback);
|
|
900
|
-
this.#the_mutation_observer.observe(this.#territory, {
|
|
900
|
+
this.#the_mutation_observer.observe(this.#territory || document, {
|
|
901
901
|
attributes: true,
|
|
902
902
|
childList: true,
|
|
903
903
|
subtree: true,
|
|
@@ -1435,7 +1435,11 @@ class $4ce764ddfee055ef$export$1b28bc5c68cc4d77 extends EventTarget {
|
|
|
1435
1435
|
return (0, $d89638655e64f324$export$bb0a9c36cf454ea0)(1, 1000);
|
|
1436
1436
|
}
|
|
1437
1437
|
#connect() {
|
|
1438
|
-
this.current_socket = new WebSocket(...this.#ws_constructor_options)
|
|
1438
|
+
this.current_socket = typeof window === "object" || typeof WebSocket === "function" ? new WebSocket(...this.#ws_constructor_options) : {
|
|
1439
|
+
readyState: 0,
|
|
1440
|
+
addEventListener: ()=>{},
|
|
1441
|
+
send: ()=>{}
|
|
1442
|
+
};
|
|
1439
1443
|
this.#possible_events.forEach((name)=>{
|
|
1440
1444
|
this.current_socket.addEventListener(name, (0, $b04e44fad5ea42c7$export$b3bbfd758f11cfa9)((original_event)=>{
|
|
1441
1445
|
let fixed_event;
|
|
@@ -1972,7 +1976,7 @@ async function $61b3c9e5f2cf8171$export$8f66c4c7fb96eda2(e, product_id) {
|
|
|
1972
1976
|
* Currently watched elements by the intersection observer with their respective callback
|
|
1973
1977
|
* */ const $f24c14db771b471d$var$watched_elements = /*@__PURE__*/ new WeakMap();
|
|
1974
1978
|
const $f24c14db771b471d$var$unwatch_element = (element)=>{
|
|
1975
|
-
$f24c14db771b471d$var$intersection_observer
|
|
1979
|
+
$f24c14db771b471d$var$intersection_observer?.unobserve(element);
|
|
1976
1980
|
$f24c14db771b471d$var$watched_elements.delete(element);
|
|
1977
1981
|
$f24c14db771b471d$var$current_intersections.delete(element);
|
|
1978
1982
|
};
|
|
@@ -1981,7 +1985,7 @@ const $f24c14db771b471d$export$4c51576248bcdf31 = (element, callback)=>{
|
|
|
1981
1985
|
(0, $649f456f663da9fc$export$de56f1198d121036)("Not watching", element, "as it's already being watched");
|
|
1982
1986
|
return ()=>{};
|
|
1983
1987
|
}
|
|
1984
|
-
$f24c14db771b471d$var$intersection_observer
|
|
1988
|
+
$f24c14db771b471d$var$intersection_observer?.observe(element);
|
|
1985
1989
|
/** Calls the given callback and makes sure to stop watching the element */ const wrapped_callback = (element)=>{
|
|
1986
1990
|
callback(element);
|
|
1987
1991
|
$f24c14db771b471d$var$unwatch_element(element);
|
|
@@ -2004,7 +2008,7 @@ const $f24c14db771b471d$var$intersection_observer_callback = (entries)=>{
|
|
|
2004
2008
|
const callback = $f24c14db771b471d$var$watched_elements.get(target);
|
|
2005
2009
|
// Skip the element if it's no longer being watched.
|
|
2006
2010
|
if (!callback) {
|
|
2007
|
-
$f24c14db771b471d$var$intersection_observer
|
|
2011
|
+
$f24c14db771b471d$var$intersection_observer?.unobserve(target);
|
|
2008
2012
|
continue;
|
|
2009
2013
|
}
|
|
2010
2014
|
const currently_intersecting = $f24c14db771b471d$var$current_intersections.has(target);
|
|
@@ -2037,9 +2041,9 @@ const $f24c14db771b471d$var$intersection_observer_callback = (entries)=>{
|
|
|
2037
2041
|
/**
|
|
2038
2042
|
* Global IntersectionObserver used for all impression tracking.
|
|
2039
2043
|
* It's faster to use one observer for all elements than to create a new one for each element.
|
|
2040
|
-
*/ const $f24c14db771b471d$var$intersection_observer = /*@__PURE__*/ new IntersectionObserver((0, $b04e44fad5ea42c7$export$b3bbfd758f11cfa9)($f24c14db771b471d$var$intersection_observer_callback), {
|
|
2044
|
+
*/ const $f24c14db771b471d$var$intersection_observer = typeof window === "object" ? /*@__PURE__*/ new IntersectionObserver((0, $b04e44fad5ea42c7$export$b3bbfd758f11cfa9)($f24c14db771b471d$var$intersection_observer_callback), {
|
|
2041
2045
|
threshold: /*@__PURE__*/ (0, /*@__PURE__*/$9ab9ecb74920f343$export$f8ea2e7b15b5d129)(8)
|
|
2042
|
-
});
|
|
2046
|
+
}) : undefined;
|
|
2043
2047
|
|
|
2044
2048
|
|
|
2045
2049
|
|