@depict-ai/utilishared 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +27 -9
- package/dist/main.js +1171 -1123
- package/dist/module.js +1169 -1124
- package/package.json +4 -3
package/dist/module.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import {onCleanup as $fF3HH$onCleanup} from "solid-js";
|
|
2
|
+
|
|
1
3
|
function $parcel$export(e, n, v, s) {
|
|
2
4
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
3
5
|
}
|
|
4
6
|
function $parcel$interopDefault(a) {
|
|
5
7
|
return a && a.__esModule ? a.default : a;
|
|
6
8
|
}
|
|
7
|
-
const $0766c85d387a9765$export$83d89fbfd8236492 = "1.0.
|
|
9
|
+
const $0766c85d387a9765$export$83d89fbfd8236492 = "1.0.2";
|
|
8
10
|
|
|
9
11
|
|
|
10
12
|
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" && (globalThis?.document?.currentScript?.dataset?.debug === "true" || globalThis?.localStorage?.getItem?.("debug") === "true"))();
|
|
@@ -47,18 +49,19 @@ function $f564adbc4675ceaf$export$fe609f0216e4ebef(url) {
|
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
|
|
50
|
-
|
|
52
|
+
// Source: https://stackoverflow.com/a/30106551
|
|
51
53
|
/**
|
|
52
|
-
*
|
|
53
|
-
*/ function $
|
|
54
|
-
return function(
|
|
55
|
-
return
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
* Encoding UTF8 ⇢ base64
|
|
55
|
+
*/ function $5ea3131c5e08d52e$export$a1893782a2a6be0d(str) {
|
|
56
|
+
return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function(match, p1) {
|
|
57
|
+
return String.fromCharCode(parseInt(p1, 16));
|
|
58
|
+
}));
|
|
59
|
+
}
|
|
60
|
+
function $5ea3131c5e08d52e$export$a7e53ec3b3fdd030(str) {
|
|
61
|
+
return decodeURIComponent(Array.prototype.map.call(atob(str), function(c) {
|
|
62
|
+
return "%" + ("00" + c.charCodeAt(0).toString(16)).slice(-2);
|
|
63
|
+
}).join(""));
|
|
60
64
|
}
|
|
61
|
-
|
|
62
65
|
|
|
63
66
|
|
|
64
67
|
|
|
@@ -629,39 +632,17 @@ function $b04e44fad5ea42c7$export$f18d5b0af29128b7(msg, severity, input_data = {
|
|
|
629
632
|
}
|
|
630
633
|
|
|
631
634
|
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
if (Array.isArray(recs)) {
|
|
640
|
-
if (min_recs == undefined) min_recs = 10;
|
|
641
|
-
if (recs.length < min_recs) {
|
|
642
|
-
(0, $649f456f663da9fc$export$c2363754d4758444)("Displays provided to check_displays is too short, it contains", recs.length, "displays which is less than", min_recs);
|
|
643
|
-
return false;
|
|
644
|
-
} else return true;
|
|
645
|
-
} else (0, $649f456f663da9fc$export$c2363754d4758444)(new Error("neither recs nor recs.displays are an array"));
|
|
646
|
-
} else (0, $649f456f663da9fc$export$c2363754d4758444)(new Error("Non object was passed to check_displays"));
|
|
647
|
-
});
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
const $b55a70757989faf4$var$elem_track_id_map = /*@__PURE__*/ new WeakMap();
|
|
652
|
-
function $b55a70757989faf4$export$16d7c76794a38a4(element, event, track_id, func) {
|
|
653
|
-
const set_for_el = $b55a70757989faf4$var$elem_track_id_map.get(element);
|
|
654
|
-
if (!set_for_el?.has?.(track_id)) {
|
|
655
|
-
if (!(set_for_el instanceof Set)) $b55a70757989faf4$var$elem_track_id_map.set(element, new Set([
|
|
656
|
-
track_id
|
|
657
|
-
]));
|
|
658
|
-
else set_for_el.add(track_id);
|
|
659
|
-
element.addEventListener(event, func, true);
|
|
660
|
-
}
|
|
635
|
+
/**
|
|
636
|
+
* Gives a random number between min and max (potentially including min and max).
|
|
637
|
+
* @param min The minimum number.
|
|
638
|
+
* @param max The maximum number.
|
|
639
|
+
* @returns a random number
|
|
640
|
+
*/ function $d89638655e64f324$export$bb0a9c36cf454ea0(min, max) {
|
|
641
|
+
return Math.floor(Math.random() * (max - min + 1)) + min;
|
|
661
642
|
}
|
|
662
643
|
|
|
663
644
|
|
|
664
|
-
|
|
645
|
+
|
|
665
646
|
|
|
666
647
|
function $511123bb28a7b6f7$export$535946eb77c946dd(the_function) {
|
|
667
648
|
let busy = false;
|
|
@@ -728,1161 +709,1233 @@ class $09ff985c7c424fb3$export$32ccf3a614c84258 {
|
|
|
728
709
|
}
|
|
729
710
|
|
|
730
711
|
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
712
|
+
|
|
713
|
+
const $4ce764ddfee055ef$var$ONE_MINUTE = 60000;
|
|
714
|
+
class $4ce764ddfee055ef$export$1b28bc5c68cc4d77 extends EventTarget {
|
|
715
|
+
// WHEN MAKING CHANGES, PLEASE KEEP IN MIND THAT THIS CLASS IS ALSO USED ON THE FRONTEND
|
|
716
|
+
#ws_constructor_options;
|
|
717
|
+
#possible_events = [
|
|
718
|
+
"close",
|
|
719
|
+
"error",
|
|
720
|
+
"message",
|
|
721
|
+
"open"
|
|
722
|
+
];
|
|
723
|
+
#ons = {};
|
|
724
|
+
#try_again_in_ms = this.#initial_reconnect_delay;
|
|
725
|
+
#fails = 0;
|
|
726
|
+
#max_fails = 10;
|
|
727
|
+
#max_backoff_ms = $4ce764ddfee055ef$var$ONE_MINUTE;
|
|
728
|
+
get #initial_reconnect_delay() {
|
|
729
|
+
return (0, $d89638655e64f324$export$bb0a9c36cf454ea0)(1, 1000);
|
|
744
730
|
}
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
731
|
+
#connect() {
|
|
732
|
+
this.current_socket = typeof window === "object" || typeof WebSocket === "function" ? new WebSocket(...this.#ws_constructor_options) : {
|
|
733
|
+
readyState: 0,
|
|
734
|
+
addEventListener: ()=>{},
|
|
735
|
+
send: ()=>{}
|
|
736
|
+
};
|
|
737
|
+
this.#possible_events.forEach((name)=>{
|
|
738
|
+
this.current_socket.addEventListener(name, (0, $b04e44fad5ea42c7$export$b3bbfd758f11cfa9)((original_event)=>{
|
|
739
|
+
let fixed_event;
|
|
740
|
+
if (!(original_event instanceof Event)) {
|
|
741
|
+
// Node - the WS class uses a predecessor of EventTarget and doesn't fire actual events, which we need for dispatchEvent since we're an EventTarget
|
|
742
|
+
fixed_event = new Event(name);
|
|
743
|
+
delete original_event["target"];
|
|
744
|
+
delete original_event["type"];
|
|
745
|
+
Object.assign(fixed_event, original_event);
|
|
746
|
+
// @ts-ignore
|
|
747
|
+
fixed_event.data ||= original_event.data;
|
|
748
|
+
// original_event can either be an event from the 'ws' npm package which is some custom made event for something that extends EventEmitter or an actual Event
|
|
749
|
+
// the event will only have `.data` if it's a message or close event, but wdgaf because setting undefined = undefined is still undefined
|
|
750
|
+
// ts-ignore because it would be very hard to teach typescript the situation
|
|
751
|
+
} else try {
|
|
752
|
+
// @ts-ignore
|
|
753
|
+
fixed_event = new original_event.constructor(original_event.type, original_event); // modern browsers - clones an event as well as possible
|
|
754
|
+
} catch (e) {
|
|
755
|
+
// IE11 and the likes
|
|
756
|
+
// dlog("Can't reconstruct event", e, original_event, "trying to make a CustomEvent instead");
|
|
757
|
+
fixed_event = new CustomEvent(original_event.type, original_event);
|
|
758
|
+
const intermediate = {};
|
|
759
|
+
for(const key in original_event)intermediate[key] = original_event[key]; // for some reason Object.assign doesn't work because things like MessageEvent.data are not enumarable
|
|
760
|
+
delete intermediate["target"];
|
|
761
|
+
Object.assign(fixed_event, intermediate);
|
|
762
|
+
}
|
|
763
|
+
this.dispatchEvent(fixed_event);
|
|
764
|
+
}));
|
|
765
|
+
});
|
|
758
766
|
}
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
for (const [eoe, callback] of $8be08add28592faf$var$queued_callbacks){
|
|
776
|
-
// put events into structure of maps and sets where they can only exist once
|
|
777
|
-
$8be08add28592faf$var$queued_callbacks.delete(eoe);
|
|
778
|
-
const { event: event_name , selector: selector , element: element } = eoe;
|
|
779
|
-
if (!event_name) {
|
|
780
|
-
// it's an ifexists callback, doesnt' need deduplication
|
|
781
|
-
$8be08add28592faf$var$call_callback(callback, eoe);
|
|
782
|
-
continue;
|
|
783
|
-
}
|
|
784
|
-
let l2_map = deduplication_map.get(event_name);
|
|
785
|
-
if (!l2_map) {
|
|
786
|
-
l2_map = new Map();
|
|
787
|
-
deduplication_map.set(event_name, l2_map);
|
|
767
|
+
#setup_dot_on_event_support() {
|
|
768
|
+
// the idea is to make AutoReconnectingWS usable just like a normal WebSocket
|
|
769
|
+
// so that you can do .onmessage or .addEventListener("message", handler) on an AutoReconnectingWS. It basically abstracts away connections that can close and die to one big EventTarget where you don't need to care about the underlying connection
|
|
770
|
+
// this is how we add .onmessage, .onclose, .onopen and .onerror support to our EventTarget (this class)
|
|
771
|
+
for (const ev of this.#possible_events){
|
|
772
|
+
Object.defineProperty(this, "on" + ev, {
|
|
773
|
+
configurable: false,
|
|
774
|
+
enumerable: true,
|
|
775
|
+
get: ()=>this.#ons[ev],
|
|
776
|
+
set: (v)=>this.#ons[ev] = v
|
|
777
|
+
});
|
|
778
|
+
this.addEventListener(ev, (e)=>{
|
|
779
|
+
// e can be MessageEvent | CloseEvent | ErrorEvent I think
|
|
780
|
+
const on_fn = this.#ons[ev];
|
|
781
|
+
if (typeof on_fn === "function") (0, $b04e44fad5ea42c7$export$b3bbfd758f11cfa9)(on_fn).call(ev, e);
|
|
782
|
+
});
|
|
788
783
|
}
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
784
|
+
}
|
|
785
|
+
async #ensure_connection() {
|
|
786
|
+
while(true){
|
|
787
|
+
const error = await new Promise((resolve)=>{
|
|
788
|
+
this.addEventListener("close", resolve);
|
|
789
|
+
this.addEventListener("error", resolve);
|
|
790
|
+
this.restart_ws = resolve;
|
|
791
|
+
});
|
|
792
|
+
this.removeEventListener("close", this.restart_ws);
|
|
793
|
+
this.removeEventListener("error", this.restart_ws);
|
|
794
|
+
// 4100 means server thinks this is a scraper bot that's ignoring robots.txt
|
|
795
|
+
// @ts-ignore
|
|
796
|
+
if (error?.code === 4100) {
|
|
797
|
+
(0, $649f456f663da9fc$export$de56f1198d121036)("Websocket connection rejected by server, won't reconnect", error);
|
|
798
|
+
return;
|
|
799
|
+
}
|
|
800
|
+
(0, $649f456f663da9fc$export$de56f1198d121036)("Somehow the websocket died", error, "message:", // @ts-ignore
|
|
801
|
+
error?.message, "code:", // @ts-ignore
|
|
802
|
+
error?.code, "reason:", // @ts-ignore
|
|
803
|
+
error?.reason, "reconnecting in", this.#try_again_in_ms);
|
|
804
|
+
await new Promise((r)=>{
|
|
805
|
+
// "race" the timeout and getting an https://developer.mozilla.org/en-US/docs/Web/API/Window/online_event by the browser
|
|
806
|
+
const handler = (0, $b04e44fad5ea42c7$export$b3bbfd758f11cfa9)((ev)=>{
|
|
807
|
+
r();
|
|
808
|
+
(0, $649f456f663da9fc$export$de56f1198d121036)("Retrying due to 'online' event", ev);
|
|
809
|
+
clearTimeout(timeout);
|
|
810
|
+
});
|
|
811
|
+
window.addEventListener("online", handler, {
|
|
812
|
+
once: true
|
|
813
|
+
});
|
|
814
|
+
const timeout = setTimeout((0, $b04e44fad5ea42c7$export$b3bbfd758f11cfa9)(()=>{
|
|
815
|
+
this.#try_again_in_ms *= 1.5 + Math.random();
|
|
816
|
+
if (this.#try_again_in_ms > this.#max_backoff_ms) this.#try_again_in_ms = this.#max_backoff_ms * (1 + Math.random() / 10);
|
|
817
|
+
r();
|
|
818
|
+
window.removeEventListener("online", handler);
|
|
819
|
+
}), this.#try_again_in_ms);
|
|
820
|
+
});
|
|
821
|
+
this.#connect();
|
|
793
822
|
}
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
823
|
+
}
|
|
824
|
+
increase_fails() {
|
|
825
|
+
this.#fails++;
|
|
826
|
+
if (this.#fails > this.#max_fails) {
|
|
827
|
+
this.restart_ws();
|
|
828
|
+
this.#fails = 0;
|
|
798
829
|
}
|
|
799
|
-
l4_map.set(callback, eoe);
|
|
800
830
|
}
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
831
|
+
async send(...args) {
|
|
832
|
+
this.current_socket.send(...args);
|
|
833
|
+
}
|
|
834
|
+
constructor(url, protocols, options = {}){
|
|
835
|
+
super();
|
|
836
|
+
this.#ws_constructor_options = [
|
|
837
|
+
url,
|
|
838
|
+
protocols
|
|
839
|
+
];
|
|
840
|
+
const { max_backoff_ms: max_backoff_ms } = options;
|
|
841
|
+
if (max_backoff_ms) this.#max_backoff_ms = max_backoff_ms;
|
|
842
|
+
this.#setup_dot_on_event_support();
|
|
843
|
+
this.#connect();
|
|
844
|
+
this.#ensure_connection().catch((e)=>(0, $b04e44fad5ea42c7$export$f18d5b0af29128b7)(e, "error"));
|
|
845
|
+
this.addEventListener("open", (0, $b04e44fad5ea42c7$export$b3bbfd758f11cfa9)(()=>{
|
|
846
|
+
(0, $649f456f663da9fc$export$de56f1198d121036)("Connection opened");
|
|
847
|
+
this.#try_again_in_ms = this.#initial_reconnect_delay; // reset exponential backoff
|
|
848
|
+
}));
|
|
804
849
|
}
|
|
805
850
|
}
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
this.
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
851
|
+
class $4ce764ddfee055ef$export$1d9c6fddbff3441f extends $4ce764ddfee055ef$export$1b28bc5c68cc4d77 {
|
|
852
|
+
// WHEN MAKING CHANGES, PLEASE KEEP IN MIND THAT THIS CLASS IS ALSO USED ON THE FRONTEND
|
|
853
|
+
#msg_ipns = new (0, $09ff985c7c424fb3$export$32ccf3a614c84258)();
|
|
854
|
+
#initial_retry_ms = 5000;
|
|
855
|
+
#connection_last_active = 0;
|
|
856
|
+
#reconnect_if_dead_for_ms = 20000;
|
|
857
|
+
#messages_queued = 0;
|
|
858
|
+
async #wait_for_open_and_send(msg) {
|
|
859
|
+
while(this.current_socket.readyState !== 1)await new Promise((resolve)=>{
|
|
860
|
+
this.addEventListener("open", resolve, {
|
|
861
|
+
once: true
|
|
862
|
+
});
|
|
863
|
+
});
|
|
864
|
+
this.send(msg);
|
|
865
|
+
}
|
|
866
|
+
#start_reconnection_if_offline_process = (0, $511123bb28a7b6f7$export$535946eb77c946dd)(async ()=>{
|
|
867
|
+
await new Promise((r)=>setTimeout(r, this.#reconnect_if_dead_for_ms + (0, $d89638655e64f324$export$bb0a9c36cf454ea0)(-2, 10)));
|
|
868
|
+
// so if we are trying to send something and there's no activity ("error" which could mean the server is down or message or reconnection) we can safely assume that the internet connection is down. In that case we skip the exponential backoff since we want to know when we're connected again ASAP and just retry every like 20s
|
|
869
|
+
if (this.#messages_queued === 0) return;
|
|
870
|
+
const now = +new Date();
|
|
871
|
+
if (now - this.#connection_last_active > this.#reconnect_if_dead_for_ms) {
|
|
872
|
+
const reason = `No activity in ${this.#reconnect_if_dead_for_ms} ms`;
|
|
873
|
+
(0, $649f456f663da9fc$export$de56f1198d121036)(reason, "reconnecting ws");
|
|
874
|
+
this.restart_ws(reason);
|
|
875
|
+
}
|
|
876
|
+
});
|
|
877
|
+
#periodic_send(msg1) {
|
|
878
|
+
let delay_to_next_send = this.#initial_retry_ms;
|
|
879
|
+
let quit = false;
|
|
880
|
+
this.#messages_queued++;
|
|
881
|
+
(async ()=>{
|
|
882
|
+
while(!quit){
|
|
883
|
+
this.#start_reconnection_if_offline_process();
|
|
884
|
+
await this.#wait_for_open_and_send(msg1);
|
|
885
|
+
const waited = await new Promise((r)=>{
|
|
886
|
+
const handler = ()=>{
|
|
887
|
+
r(false);
|
|
888
|
+
clearTimeout(resend_due_to_lost_message_timeout);
|
|
889
|
+
};
|
|
890
|
+
// wait the correct delay
|
|
891
|
+
const resend_due_to_lost_message_timeout = setTimeout(// this might actually never be needed and be from when Daniel didn't understand WebSockets as well
|
|
892
|
+
(0, $b04e44fad5ea42c7$export$b3bbfd758f11cfa9)(()=>{
|
|
893
|
+
r(true);
|
|
894
|
+
this.removeEventListener("open", handler);
|
|
895
|
+
}), delay_to_next_send);
|
|
896
|
+
// BUT if we new websocket opens (which means the internet connection works) try again immediately (shortcut the delay)
|
|
897
|
+
this.addEventListener("open", handler, {
|
|
898
|
+
once: true
|
|
899
|
+
});
|
|
900
|
+
});
|
|
901
|
+
if (quit) break;
|
|
902
|
+
delay_to_next_send *= 1.5 + Math.random();
|
|
903
|
+
if (delay_to_next_send > $4ce764ddfee055ef$var$ONE_MINUTE) delay_to_next_send = $4ce764ddfee055ef$var$ONE_MINUTE * (Math.random() + 1);
|
|
904
|
+
if (waited) // don't count the fail as fail if we're trying again due to a reconnect since that could make us kill the connection if many messages suddenly retry which we don't want
|
|
905
|
+
// this is not a proven theory and might be wrong
|
|
906
|
+
this.increase_fails();
|
|
907
|
+
}
|
|
908
|
+
this.#messages_queued--;
|
|
909
|
+
})().catch((e)=>(0, $b04e44fad5ea42c7$export$f18d5b0af29128b7)(e, "error"));
|
|
910
|
+
return ()=>quit = true;
|
|
911
|
+
}
|
|
912
|
+
async ensure_sent(payload) {
|
|
913
|
+
const json_payload = JSON.stringify(payload);
|
|
914
|
+
const stop_sending = this.#periodic_send(json_payload);
|
|
915
|
+
while(true){
|
|
916
|
+
const { data: data } = await this.#msg_ipns.promise;
|
|
917
|
+
let reply;
|
|
918
|
+
try {
|
|
919
|
+
reply = JSON.parse(data);
|
|
920
|
+
} catch (e) {
|
|
921
|
+
const msg = "Got malformed message (ignoring, might cause memory leak)";
|
|
922
|
+
(0, $649f456f663da9fc$export$de56f1198d121036)(msg, data, e);
|
|
923
|
+
(0, $b04e44fad5ea42c7$export$f18d5b0af29128b7)([
|
|
924
|
+
e,
|
|
925
|
+
msg
|
|
926
|
+
], "error", {
|
|
927
|
+
data: data
|
|
928
|
+
});
|
|
929
|
+
continue;
|
|
930
|
+
}
|
|
931
|
+
if (reply.id == payload.id) {
|
|
932
|
+
const { status: status } = reply;
|
|
933
|
+
if (status == "ack") {
|
|
934
|
+
stop_sending();
|
|
935
|
+
continue;
|
|
936
|
+
} else if (status == "not-ok") (0, $649f456f663da9fc$export$c2363754d4758444)("Got reply not-ok reply from server for event!", payload, reply);
|
|
937
|
+
else if (status == "ok") {
|
|
938
|
+
if (process.env.BUILD_TARGET !== "node") (0, $649f456f663da9fc$export$de56f1198d121036)(`Successfully sent ${payload?.event?.type} (WS)`, payload, reply);
|
|
939
|
+
} else (0, $649f456f663da9fc$export$c2363754d4758444)("Strange reply from WSS server to", payload, ":", reply);
|
|
940
|
+
stop_sending();
|
|
941
|
+
return [
|
|
942
|
+
reply,
|
|
943
|
+
data
|
|
944
|
+
];
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
constructor(...params){
|
|
949
|
+
super(...params);
|
|
950
|
+
const option_retry_ms = params[2]?.initial_retry_ms;
|
|
951
|
+
if (option_retry_ms) this.#initial_retry_ms = option_retry_ms;
|
|
952
|
+
this.addEventListener("message", (0, $b04e44fad5ea42c7$export$b3bbfd758f11cfa9)(this.#msg_ipns.resolve));
|
|
953
|
+
[
|
|
954
|
+
"open",
|
|
955
|
+
"error",
|
|
956
|
+
"message"
|
|
957
|
+
].forEach((event)=>this.addEventListener(event, (0, $b04e44fad5ea42c7$export$b3bbfd758f11cfa9)(()=>this.#connection_last_active = +new Date())));
|
|
818
958
|
}
|
|
819
959
|
}
|
|
820
960
|
|
|
821
961
|
|
|
962
|
+
/**
|
|
963
|
+
* Returns a random string
|
|
964
|
+
* @return A random string, containing a-z, 0-9 and occasionally a dot (`.`)
|
|
965
|
+
*/ function $460df8550f9d084d$export$656831b7e9c341c3() {
|
|
966
|
+
return (Math.random() * 2e17).toString(36);
|
|
967
|
+
}
|
|
968
|
+
function $460df8550f9d084d$export$a6db784f019668ba() {
|
|
969
|
+
return "x" + $460df8550f9d084d$export$656831b7e9c341c3().replaceAll(".", "");
|
|
970
|
+
}
|
|
822
971
|
|
|
823
972
|
|
|
824
973
|
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
disconnector_: this.#disconnect_fn({
|
|
871
|
-
event_: "exists",
|
|
872
|
-
selector_: selector,
|
|
873
|
-
callback_: callback_
|
|
874
|
-
})
|
|
875
|
-
}));
|
|
876
|
-
}
|
|
877
|
-
},
|
|
878
|
-
wait_for_element: (selector, timeout)=>{
|
|
879
|
-
return this.#self_proxied.wait_for_listener("exists", selector, timeout);
|
|
880
|
-
},
|
|
881
|
-
wait_for_listener: (listener, selector, timeout)=>{
|
|
882
|
-
this.#check_observer_args(listener, ()=>{}, false);
|
|
883
|
-
// console.log("waiting for listener", listener, "selector", selector, "timeout", timeout);
|
|
884
|
-
return new Promise((0, $b04e44fad5ea42c7$export$b3bbfd758f11cfa9)((r)=>{
|
|
885
|
-
const stop_observing = this.#self_proxied["on" + listener](selector, ({ element: element , disconnector: disconnector })=>{
|
|
886
|
-
r(element);
|
|
887
|
-
disconnector();
|
|
888
|
-
if (timeout) clearTimeout(obs_timeout);
|
|
889
|
-
});
|
|
890
|
-
if (timeout) var obs_timeout = setTimeout(()=>{
|
|
891
|
-
stop_observing();
|
|
892
|
-
r(undefined);
|
|
893
|
-
}, timeout);
|
|
894
|
-
}));
|
|
895
|
-
}
|
|
896
|
-
};
|
|
897
|
-
#kickstart_observer() {
|
|
898
|
-
if (typeof document === "undefined") return;
|
|
899
|
-
this.#the_mutation_observer = new MutationObserver(this.#observer_callback);
|
|
900
|
-
this.#the_mutation_observer.observe(this.#territory || document, {
|
|
901
|
-
attributes: true,
|
|
902
|
-
childList: true,
|
|
903
|
-
subtree: true,
|
|
904
|
-
attributeOldValue: true,
|
|
905
|
-
characterData: true,
|
|
906
|
-
characterDataOldValue: true
|
|
907
|
-
});
|
|
974
|
+
|
|
975
|
+
|
|
976
|
+
const $6c2b49f3f564b0d1$export$362abebb4b313340 = process.env.BASE_URL || "https://api.depict.ai";
|
|
977
|
+
|
|
978
|
+
|
|
979
|
+
const $cafa1ff1049985c2$var$c = (0, $b04e44fad5ea42c7$export$b3bbfd758f11cfa9);
|
|
980
|
+
const $cafa1ff1049985c2$var$ws_instance = /*@__PURE__*/ $cafa1ff1049985c2$var$c(()=>new (0, $4ce764ddfee055ef$export$1d9c6fddbff3441f)("wss://ws.depict.ai/ws/create-events"))();
|
|
981
|
+
const $cafa1ff1049985c2$var$allowed_keys = [
|
|
982
|
+
"tenant",
|
|
983
|
+
"market",
|
|
984
|
+
"type",
|
|
985
|
+
"user_id",
|
|
986
|
+
"session_id",
|
|
987
|
+
"product_id",
|
|
988
|
+
"entity_identifiers",
|
|
989
|
+
"url",
|
|
990
|
+
"entity_price",
|
|
991
|
+
"currency",
|
|
992
|
+
"document_referrer",
|
|
993
|
+
"document_width",
|
|
994
|
+
"attribution_id",
|
|
995
|
+
"recommendation_id",
|
|
996
|
+
"click_location",
|
|
997
|
+
"ab_test_group",
|
|
998
|
+
"variant_ids",
|
|
999
|
+
"dsid",
|
|
1000
|
+
"transaction_id",
|
|
1001
|
+
"error_type",
|
|
1002
|
+
"detail",
|
|
1003
|
+
"recommendation_type",
|
|
1004
|
+
"search_result_id",
|
|
1005
|
+
"product_listing_result_id"
|
|
1006
|
+
];
|
|
1007
|
+
const $cafa1ff1049985c2$export$72036d950e1fae95 = /*@__PURE__*/ $cafa1ff1049985c2$var$c((payload)=>{
|
|
1008
|
+
if (process.env.DEPICT === "false") return;
|
|
1009
|
+
return payload.map((body)=>Object.fromEntries(Object.entries(body).filter(([key, value])=>$cafa1ff1049985c2$var$allowed_keys.includes(key) && value != null)));
|
|
1010
|
+
});
|
|
1011
|
+
const $cafa1ff1049985c2$export$aa26019042811d4f = /*@__PURE__*/ $cafa1ff1049985c2$var$c(async (bodies)=>{
|
|
1012
|
+
if (process.env.DEPICT === "false") return;
|
|
1013
|
+
for(let i = 0; i < bodies.length; i++){
|
|
1014
|
+
const id = (0, $460df8550f9d084d$export$656831b7e9c341c3)();
|
|
1015
|
+
$cafa1ff1049985c2$var$ws_instance?.ensure_sent({
|
|
1016
|
+
id: id,
|
|
1017
|
+
event: bodies[i]
|
|
1018
|
+
}).catch((e)=>(0, $b04e44fad5ea42c7$export$f18d5b0af29128b7)(e, "error"));
|
|
908
1019
|
}
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
const callbacks = selector_to_callback_array_map.get(selector_);
|
|
916
|
-
callbacks?.delete(callback_);
|
|
917
|
-
if (callbacks?.size === 0) selector_to_callback_array_map.delete(selector_);
|
|
918
|
-
if (selector_to_callback_array_map.size === 0) delete observing[event_];
|
|
919
|
-
if (!Object.keys(observing).length) {
|
|
920
|
-
this.#the_mutation_observer?.disconnect();
|
|
921
|
-
this.#the_mutation_observer = undefined;
|
|
922
|
-
}
|
|
923
|
-
};
|
|
924
|
-
// If the observer callback is running, we need to queue every function that mutates this.#observing since we can't clone it for performance reasons
|
|
925
|
-
if (this.#observer_callback_running) this.#execute_after_callback_ran.push(fn);
|
|
926
|
-
else fn();
|
|
927
|
-
};
|
|
1020
|
+
});
|
|
1021
|
+
const $cafa1ff1049985c2$export$608478473a3304a0 = /*@__PURE__*/ $cafa1ff1049985c2$var$c((payload, use_ws = true)=>{
|
|
1022
|
+
if (process.env.DEPICT === "false") return;
|
|
1023
|
+
if (use_ws && typeof WebSocket == "function" && typeof $cafa1ff1049985c2$var$ws_instance?.ensure_sent == "function") {
|
|
1024
|
+
(0, $649f456f663da9fc$export$de56f1198d121036)("Sending to depict (ws)", payload);
|
|
1025
|
+
return $cafa1ff1049985c2$export$aa26019042811d4f(payload);
|
|
928
1026
|
}
|
|
929
|
-
|
|
930
|
-
|
|
1027
|
+
const url = (0, $6c2b49f3f564b0d1$export$362abebb4b313340) + "/create-events";
|
|
1028
|
+
return $cafa1ff1049985c2$export$cc3b6ddf805f6156(url, payload);
|
|
1029
|
+
});
|
|
1030
|
+
const $cafa1ff1049985c2$export$cc3b6ddf805f6156 = /*@__PURE__*/ $cafa1ff1049985c2$var$c((url, payload)=>{
|
|
1031
|
+
const payload_json = JSON.stringify(payload);
|
|
1032
|
+
let success = false;
|
|
1033
|
+
(0, $649f456f663da9fc$export$de56f1198d121036)(`Attempting to send (beacon)`, payload);
|
|
1034
|
+
try {
|
|
1035
|
+
success = navigator.sendBeacon(url, new Blob([
|
|
1036
|
+
payload_json
|
|
1037
|
+
], {
|
|
1038
|
+
type: "application/json"
|
|
1039
|
+
}));
|
|
1040
|
+
} catch (first_error) {
|
|
1041
|
+
(0, $649f456f663da9fc$export$de56f1198d121036)("Beacon has failed", first_error, "falling back to sending with wrong mime type which might work");
|
|
931
1042
|
try {
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
for(let j = 0; j < records.length; j++){
|
|
938
|
-
const record = records[j];
|
|
939
|
-
const { addedNodes: addedNodes , removedNodes: removedNodes , target: target } = record;
|
|
940
|
-
const events_for_discovery = [];
|
|
941
|
-
let nodes_to_check;
|
|
942
|
-
// code for handling a record containing wanted elements in addedNodes or the children of added nodes and attribute changes that make an existing node match a selector, mainly for oncreation and onexists, but it will fire onchange if someone is listening if an attribute change makes an element match a selector
|
|
943
|
-
if (!addedNodes.length && !removedNodes.length) nodes_to_check = [
|
|
944
|
-
target
|
|
945
|
-
];
|
|
946
|
-
else {
|
|
947
|
-
nodes_to_check = addedNodes;
|
|
948
|
-
if (observing["creation"]) events_for_discovery.push("creation");
|
|
949
|
-
}
|
|
950
|
-
if (observing["exists"]) events_for_discovery.push("exists");
|
|
951
|
-
if (observing["change"]) events_for_discovery.push("change");
|
|
952
|
-
for(let n = 0; n < events_for_discovery.length; n++){
|
|
953
|
-
const event = events_for_discovery[n];
|
|
954
|
-
const event_is_creation_or_exists_with_tree_change = event === "creation" || event === "exists" && addedNodes.length;
|
|
955
|
-
const selector_map = observing[event];
|
|
956
|
-
const selectors = [
|
|
957
|
-
...selector_map.keys()
|
|
958
|
-
]; // we can only iterate over a MapIterator once, so we need to spread it
|
|
959
|
-
if (event === "change" && (addedNodes.length || removedNodes.length)) {
|
|
960
|
-
// we check the selectors first because I'm DUMB and already have come so far
|
|
961
|
-
for(let selectors_i = 0; selectors_i < selectors.length; selectors_i++){
|
|
962
|
-
const selector = selectors[selectors_i];
|
|
963
|
-
// @ts-ignore
|
|
964
|
-
if (target?.matches?.(selector)) {
|
|
965
|
-
// we WANT change event and there are children to an element that interests us - act on it
|
|
966
|
-
const callbacks = selector_map.get(selector);
|
|
967
|
-
this.#call_callbacks(callbacks, (callback)=>({
|
|
968
|
-
element_: target,
|
|
969
|
-
// it has to be an *Element* since it has
|
|
970
|
-
// the selector is a string since the event is change
|
|
971
|
-
// @ts-ignore
|
|
972
|
-
selector_: selector,
|
|
973
|
-
event_: event,
|
|
974
|
-
mutation_record_: record,
|
|
975
|
-
disconnector_: this.#disconnect_fn({
|
|
976
|
-
event_: event,
|
|
977
|
-
selector_: selector,
|
|
978
|
-
callback_: callback
|
|
979
|
-
})
|
|
980
|
-
}));
|
|
981
|
-
selector_map.delete(selector);
|
|
982
|
-
steps_to_restore_observing_cache.push(()=>selector_map.set(selector, callbacks));
|
|
983
|
-
}
|
|
984
|
-
}
|
|
985
|
-
break;
|
|
986
|
-
}
|
|
987
|
-
for(let i = 0; i < nodes_to_check.length; i++){
|
|
988
|
-
const node = nodes_to_check[i];
|
|
989
|
-
for(let selectors_i = 0; selectors_i < selectors.length; selectors_i++){
|
|
990
|
-
const selector = selectors[selectors_i];
|
|
991
|
-
const callbacks = selector_map.get(selector) || new Set();
|
|
992
|
-
if (typeof selector !== "string") {
|
|
993
|
-
// oncreation or onexists with node-selector
|
|
994
|
-
if (event_is_creation_or_exists_with_tree_change) {
|
|
995
|
-
const derefed_el = selector.deref();
|
|
996
|
-
if (!derefed_el) {
|
|
997
|
-
selector_map.delete(selector);
|
|
998
|
-
continue;
|
|
999
|
-
}
|
|
1000
|
-
if (node === derefed_el || node.contains(derefed_el)) // node is node or node is child of added node
|
|
1001
|
-
this.#call_callbacks(callbacks, (callback)=>({
|
|
1002
|
-
element_: derefed_el,
|
|
1003
|
-
selector_: derefed_el,
|
|
1004
|
-
event_: event,
|
|
1005
|
-
mutation_record_: record,
|
|
1006
|
-
disconnector_: this.#disconnect_fn({
|
|
1007
|
-
event_: event,
|
|
1008
|
-
selector_: selector,
|
|
1009
|
-
callback_: callback
|
|
1010
|
-
})
|
|
1011
|
-
}));
|
|
1012
|
-
}
|
|
1013
|
-
continue;
|
|
1014
|
-
}
|
|
1015
|
-
// @ts-ignore
|
|
1016
|
-
const matches_now = node?.matches?.(selector);
|
|
1017
|
-
let our_set;
|
|
1018
|
-
if (event == "exists") {
|
|
1019
|
-
// we want the change event to trigger to any change (exists only if it makes an element match a selector that didn't previously match)
|
|
1020
|
-
our_set = attribute_attribution_map_object[selector] ||= new WeakSet();
|
|
1021
|
-
if (record.type === "attributes" && matches_now != null) {
|
|
1022
|
-
const matched_last = our_set.has(node);
|
|
1023
|
-
if (matched_last && matches_now) continue;
|
|
1024
|
-
}
|
|
1025
|
-
if (matches_now) our_set.add(node);
|
|
1026
|
-
else our_set.delete(node);
|
|
1027
|
-
}
|
|
1028
|
-
if (matches_now) this.#call_callbacks(callbacks, (callback)=>({
|
|
1029
|
-
element_: node,
|
|
1030
|
-
selector_: selector,
|
|
1031
|
-
event_: event,
|
|
1032
|
-
mutation_record_: record,
|
|
1033
|
-
disconnector_: this.#disconnect_fn({
|
|
1034
|
-
event_: event,
|
|
1035
|
-
selector_: selector,
|
|
1036
|
-
callback_: callback
|
|
1037
|
-
})
|
|
1038
|
-
}));
|
|
1039
|
-
if ((addedNodes.length || removedNodes.length) && node.hasChildNodes() && // @ts-ignore
|
|
1040
|
-
node.querySelectorAll /* don't act on i.e. textnodes. Doing the check this way is actually faster than both `in` and instanceof */ ) {
|
|
1041
|
-
const matching_children = (0, $39ef887981612535$export$33f937d741e49339)(node, selector);
|
|
1042
|
-
for(let m = 0; m < matching_children.length; m++){
|
|
1043
|
-
// always use for loops because this can't be slow and forEach takes ages
|
|
1044
|
-
if (event == "exists") our_set.add(matching_children[m]);
|
|
1045
|
-
this.#call_callbacks(callbacks, (callback)=>({
|
|
1046
|
-
element_: matching_children[m],
|
|
1047
|
-
selector_: selector,
|
|
1048
|
-
event_: event,
|
|
1049
|
-
mutation_record_: record,
|
|
1050
|
-
disconnector_: this.#disconnect_fn({
|
|
1051
|
-
event_: event,
|
|
1052
|
-
selector_: selector,
|
|
1053
|
-
callback_: callback
|
|
1054
|
-
})
|
|
1055
|
-
}));
|
|
1056
|
-
}
|
|
1057
|
-
}
|
|
1058
|
-
}
|
|
1059
|
-
}
|
|
1060
|
-
}
|
|
1061
|
-
// code for handling changes to children of an observed element
|
|
1062
|
-
{
|
|
1063
|
-
const event = "change";
|
|
1064
|
-
const selector_map = observing[event];
|
|
1065
|
-
if (selector_map) {
|
|
1066
|
-
let target_el = target;
|
|
1067
|
-
while(target_el = target_el?.parentNode)// @ts-ignore
|
|
1068
|
-
if (target_el?.matches) {
|
|
1069
|
-
for (const selector of selector_map.keys())// selector is string because event is change
|
|
1070
|
-
// @ts-ignore
|
|
1071
|
-
if (target_el.matches?.(selector)) {
|
|
1072
|
-
const callbacks = selector_map.get(selector);
|
|
1073
|
-
this.#call_callbacks(callbacks, (callback)=>({
|
|
1074
|
-
element_: target_el,
|
|
1075
|
-
// @ts-ignore
|
|
1076
|
-
selector_: selector,
|
|
1077
|
-
event_: event,
|
|
1078
|
-
mutation_record_: record,
|
|
1079
|
-
disconnector_: this.#disconnect_fn({
|
|
1080
|
-
event_: event,
|
|
1081
|
-
selector_: selector,
|
|
1082
|
-
callback_: callback
|
|
1083
|
-
})
|
|
1084
|
-
}));
|
|
1085
|
-
// Since we now deduplicate
|
|
1086
|
-
steps_to_restore_observing_cache.push(()=>selector_map.set(selector, callbacks));
|
|
1087
|
-
}
|
|
1088
|
-
}
|
|
1089
|
-
}
|
|
1090
|
-
}
|
|
1091
|
-
// code for observing observed elements disappearing
|
|
1092
|
-
{
|
|
1093
|
-
const event = "removed";
|
|
1094
|
-
const removed_map = observing[event];
|
|
1095
|
-
if (removed_map && removedNodes?.length) {
|
|
1096
|
-
const selectors = [
|
|
1097
|
-
...removed_map.keys()
|
|
1098
|
-
];
|
|
1099
|
-
for(let t = 0; t < removedNodes.length; t++)for(let u = 0; u < selectors.length; u++){
|
|
1100
|
-
const selector = selectors[u];
|
|
1101
|
-
const callbacks = removed_map.get(selector) || new Set();
|
|
1102
|
-
const node = removedNodes[t];
|
|
1103
|
-
if (typeof selector === "string") {
|
|
1104
|
-
const matching_nodes = [];
|
|
1105
|
-
// @ts-ignore
|
|
1106
|
-
if (node?.matches?.(selector)) matching_nodes.push(node);
|
|
1107
|
-
matching_nodes.push(...(0, $39ef887981612535$export$33f937d741e49339)(node, selector) || []);
|
|
1108
|
-
for(let v = 0; v < matching_nodes.length; v++)this.#call_callbacks(callbacks, (callback)=>({
|
|
1109
|
-
element_: matching_nodes[v],
|
|
1110
|
-
selector_: selector,
|
|
1111
|
-
event_: event,
|
|
1112
|
-
mutation_record_: record,
|
|
1113
|
-
disconnector_: this.#disconnect_fn({
|
|
1114
|
-
event_: "removed",
|
|
1115
|
-
selector_: selector,
|
|
1116
|
-
callback_: callback
|
|
1117
|
-
})
|
|
1118
|
-
}));
|
|
1119
|
-
} else {
|
|
1120
|
-
const derefed_el = selector.deref();
|
|
1121
|
-
if (derefed_el) {
|
|
1122
|
-
if (node === derefed_el || node.contains(derefed_el)) this.#call_callbacks(callbacks, (callback)=>({
|
|
1123
|
-
element_: derefed_el,
|
|
1124
|
-
mutation_record_: record,
|
|
1125
|
-
selector_: derefed_el,
|
|
1126
|
-
event_: event,
|
|
1127
|
-
disconnector_: this.#disconnect_fn({
|
|
1128
|
-
event_: event,
|
|
1129
|
-
selector_: selector,
|
|
1130
|
-
callback_: callback
|
|
1131
|
-
})
|
|
1132
|
-
}));
|
|
1133
|
-
} else // here it's also ok to mutate #observing since the WeakRef is empty
|
|
1134
|
-
removed_map.delete(selector);
|
|
1135
|
-
}
|
|
1136
|
-
}
|
|
1137
|
-
}
|
|
1138
|
-
}
|
|
1139
|
-
}
|
|
1140
|
-
// const end = new Date().getTime();
|
|
1141
|
-
// console.log("procesed",records.length,"in", end-start, this.#observing);
|
|
1142
|
-
} finally{
|
|
1143
|
-
// ensure that we don't leave this.#observing in a broken state if we throw
|
|
1144
|
-
while(steps_to_restore_observing_cache.length)steps_to_restore_observing_cache.pop()();
|
|
1145
|
-
const execute_after_run = this.#execute_after_callback_ran;
|
|
1146
|
-
// We need to execute these in order they were added because I'm afraid that things might rely on it
|
|
1147
|
-
for(let i = 0; i < execute_after_run.length; i++)try {
|
|
1148
|
-
execute_after_run[i]();
|
|
1149
|
-
} catch (e) {
|
|
1150
|
-
(0, $b04e44fad5ea42c7$export$f18d5b0af29128b7)([
|
|
1151
|
-
e,
|
|
1152
|
-
"error in observer running queued function"
|
|
1153
|
-
], "error");
|
|
1154
|
-
}
|
|
1155
|
-
// Let the garbage collector empty the old array by creating a new one
|
|
1156
|
-
this.#execute_after_callback_ran = [];
|
|
1157
|
-
this.#observer_callback_running = false;
|
|
1158
|
-
}
|
|
1043
|
+
success = navigator.sendBeacon(url, new Blob([
|
|
1044
|
+
payload_json
|
|
1045
|
+
], {
|
|
1046
|
+
type: "application/x-www-form-urlencoded"
|
|
1047
|
+
}));
|
|
1159
1048
|
} catch (e) {
|
|
1160
|
-
(0, $
|
|
1161
|
-
|
|
1162
|
-
"
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
return;
|
|
1181
|
-
}
|
|
1182
|
-
the_class.#check_observer_args(selector, callback, listener != "change");
|
|
1183
|
-
if (the_class.#observer_callback_running) {
|
|
1184
|
-
// Can't mutate #observing right now, queue it for when we can
|
|
1185
|
-
the_class.#execute_after_callback_ran.push(()=>function_for_listener(selector, callback));
|
|
1186
|
-
return;
|
|
1187
|
-
}
|
|
1188
|
-
const observing = the_class.#observing;
|
|
1189
|
-
observing[listener] ||= new Map();
|
|
1190
|
-
// create map for each listener, this is because the selectors can be objects for .onremoved, .oncreation and .onexists to take explicit nodes
|
|
1191
|
-
const selector_map = observing[listener];
|
|
1192
|
-
let disconnector;
|
|
1193
|
-
if (listener === "exists") the_class.#verbs.ifexists(selector, callback);
|
|
1194
|
-
if (typeof selector === "string") {
|
|
1195
|
-
// simple code for string selectors
|
|
1196
|
-
let callback_set = selector_map.get(selector);
|
|
1197
|
-
if (!callback_set) {
|
|
1198
|
-
callback_set = new Set();
|
|
1199
|
-
selector_map.set(selector, callback_set);
|
|
1200
|
-
}
|
|
1201
|
-
callback_set.add(callback); // we make this a set since you're not supposed to be able to have the same function as listener twice, like you can't with addEventListener
|
|
1202
|
-
disconnector = the_class.#disconnect_fn({
|
|
1203
|
-
event_: listener,
|
|
1204
|
-
selector_: selector,
|
|
1205
|
-
callback_: callback
|
|
1049
|
+
(0, $649f456f663da9fc$export$de56f1198d121036)("Beacon fallback has failed", e, "trying fetch");
|
|
1050
|
+
fetch(url, {
|
|
1051
|
+
"headers": {
|
|
1052
|
+
"content-type": "application/json"
|
|
1053
|
+
},
|
|
1054
|
+
"body": payload_json,
|
|
1055
|
+
"method": "POST",
|
|
1056
|
+
"mode": "cors",
|
|
1057
|
+
"credentials": "include"
|
|
1058
|
+
}).then((response)=>response.text()).then((text)=>(0, $649f456f663da9fc$export$de56f1198d121036)("Beacon fallback fallback transmission result", text)).catch((fetch_error)=>{
|
|
1059
|
+
(0, $eba382943196079c$export$af2e17a20c2ea3c5).withScope(function(scope) {
|
|
1060
|
+
scope.setExtra("stack", new Error().stack);
|
|
1061
|
+
scope.setExtra("url", url);
|
|
1062
|
+
scope.setExtra("payload", payload_json);
|
|
1063
|
+
scope.setExtra("first_error", first_error);
|
|
1064
|
+
scope.setExtra("second_error", e);
|
|
1065
|
+
scope.setTag("feature", "beacon");
|
|
1066
|
+
scope.setTag("approach", "fetch_fallback");
|
|
1067
|
+
scope.setLevel("error");
|
|
1068
|
+
this.captureMessage(fetch_error); // we can now do this - it's depict lazy sentry specific. `this` will refer to the actual hub with breadcrumbs and the scope activated
|
|
1206
1069
|
});
|
|
1207
|
-
}
|
|
1208
|
-
// for an element "selector" we don't want to keep strong references to the nodes as that would prevent them from being garbage collected
|
|
1209
|
-
let callback_set_to_add_to;
|
|
1210
|
-
for (const [stored_selector, existing_callback_set] of selector_map){
|
|
1211
|
-
// try finding an existing array of callbacks
|
|
1212
|
-
if (typeof stored_selector === "string") continue;
|
|
1213
|
-
const ref_contents = stored_selector.deref();
|
|
1214
|
-
if (!ref_contents) {
|
|
1215
|
-
// clean up listeners for selectors that have already been GC'd
|
|
1216
|
-
selector_map.delete(stored_selector);
|
|
1217
|
-
continue;
|
|
1218
|
-
}
|
|
1219
|
-
if (ref_contents === selector) {
|
|
1220
|
-
callback_set_to_add_to = existing_callback_set;
|
|
1221
|
-
disconnector = the_class.#disconnect_fn({
|
|
1222
|
-
event_: listener,
|
|
1223
|
-
selector_: stored_selector,
|
|
1224
|
-
callback_: callback
|
|
1225
|
-
});
|
|
1226
|
-
break;
|
|
1227
|
-
}
|
|
1228
|
-
}
|
|
1229
|
-
if (!callback_set_to_add_to) {
|
|
1230
|
-
callback_set_to_add_to = new Set();
|
|
1231
|
-
const weakref = new WeakRef(selector);
|
|
1232
|
-
the_class.#cleanup_weakref_when_refd_el_gcd(listener, weakref, selector);
|
|
1233
|
-
selector_map.set(weakref, callback_set_to_add_to);
|
|
1234
|
-
disconnector = the_class.#disconnect_fn({
|
|
1235
|
-
event_: listener,
|
|
1236
|
-
selector_: weakref,
|
|
1237
|
-
callback_: callback
|
|
1238
|
-
});
|
|
1239
|
-
}
|
|
1240
|
-
callback_set_to_add_to.add(callback);
|
|
1241
|
-
}
|
|
1242
|
-
if (!the_class.#the_mutation_observer) the_class.#kickstart_observer();
|
|
1243
|
-
return disconnector;
|
|
1244
|
-
};
|
|
1245
|
-
return function_for_listener;
|
|
1246
|
-
}
|
|
1247
|
-
#cleanup_weakref_when_refd_el_gcd(listener1, weakref, element) {
|
|
1248
|
-
// we don't want to keep references to elements used as "selectors" in oncreation and onremoved
|
|
1249
|
-
if (!this.#weakref_finalization_registry) return;
|
|
1250
|
-
this.#weakref_finalization_registry.register(element, [
|
|
1251
|
-
listener1,
|
|
1252
|
-
weakref
|
|
1253
|
-
]);
|
|
1254
|
-
}
|
|
1255
|
-
#finalization_registry_callback([listener2, weak_ref]) {
|
|
1256
|
-
// element was GCd and the callbacks can never be called, remove them
|
|
1257
|
-
const observing = this.#observing;
|
|
1258
|
-
observing[listener2]?.get(weak_ref)?.clear(); // just in case something still has a reference to this set and does something with it, clear it
|
|
1259
|
-
observing[listener2]?.delete(weak_ref);
|
|
1260
|
-
if (observing[listener2]?.size === 0) delete observing[listener2];
|
|
1261
|
-
if (Object.keys(observing).length === 0) {
|
|
1262
|
-
this.#the_mutation_observer?.disconnect();
|
|
1263
|
-
this.#the_mutation_observer = undefined;
|
|
1264
|
-
}
|
|
1265
|
-
}
|
|
1266
|
-
#call_callbacks(callbacks, make_ev_data) {
|
|
1267
|
-
for (const callback of callbacks)(0, $8be08add28592faf$export$2b08e30396270f0b)(callback, new (0, $cb50cd7a49e824ee$export$ea60432919e69303)(make_ev_data(callback)));
|
|
1268
|
-
}
|
|
1269
|
-
#get(target, verb) {
|
|
1270
|
-
// @ts-ignore
|
|
1271
|
-
const is_listener = target.#listeners.includes(verb.slice(2));
|
|
1272
|
-
const is_verb = Object.keys(target.#verbs).includes(verb);
|
|
1273
|
-
if (is_verb) return target.#verbs[verb];
|
|
1274
|
-
else if (is_listener) return target.#add_listener(verb.slice(2));
|
|
1275
|
-
else throw new Error("Property " + verb + " is not valid. Valid listeners: " + target.#listeners.join(", ") + "; valid verbs: " + Object.keys(target.#verbs).join(", "));
|
|
1276
|
-
}
|
|
1277
|
-
constructor(options = {}){
|
|
1278
|
-
if (process.env.BUILD_TARGET !== "modern" && Proxy.toString().indexOf("[native code]") === -1) {
|
|
1279
|
-
this.#listeners.forEach((listener)=>this["on" + listener] = ()=>{}); // define listeners, needed for IE11 proxy polyfill
|
|
1280
|
-
Object.keys(this.#verbs).forEach((listener)=>this[listener] = ()=>{});
|
|
1070
|
+
});
|
|
1281
1071
|
}
|
|
1282
|
-
if (options.territory) this.#territory = options.territory;
|
|
1283
|
-
return this.#self_proxied = new Proxy(this, {
|
|
1284
|
-
get: this.#get
|
|
1285
|
-
});
|
|
1286
1072
|
}
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1073
|
+
return success;
|
|
1074
|
+
});
|
|
1075
|
+
const $cafa1ff1049985c2$export$28cacbd9b4306ffc = /*@__PURE__*/ $cafa1ff1049985c2$var$c((payload, use_ws)=>{
|
|
1076
|
+
if (process.env.DEPICT === "false") return;
|
|
1077
|
+
// filter_depict_payload will only return undefined if process.env.DEPICT === "false"
|
|
1078
|
+
return $cafa1ff1049985c2$export$608478473a3304a0($cafa1ff1049985c2$export$72036d950e1fae95(payload), use_ws);
|
|
1079
|
+
});
|
|
1291
1080
|
|
|
1292
|
-
const $0b48ba2f40ce6067$export$b6ae1bc530f4c149 = /*@__PURE__*/ $0b48ba2f40ce6067$var$make_default_observer();
|
|
1293
|
-
function $0b48ba2f40ce6067$var$make_default_observer() {
|
|
1294
|
-
try {
|
|
1295
|
-
return new (0, $cdca9fea6eb103e5$export$12e07a2a9f87578a)();
|
|
1296
|
-
} catch (error) {
|
|
1297
|
-
(0, $b04e44fad5ea42c7$export$f18d5b0af29128b7)([
|
|
1298
|
-
error,
|
|
1299
|
-
"error starting ElementObserver"
|
|
1300
|
-
], "error");
|
|
1301
|
-
}
|
|
1302
|
-
}
|
|
1303
1081
|
|
|
1304
1082
|
|
|
1305
1083
|
|
|
1306
1084
|
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1085
|
+
let $43683b1103edab15$export$6399bdb2291895e0 = ()=>{
|
|
1086
|
+
if (typeof document === "undefined") return "server";
|
|
1087
|
+
let id = "";
|
|
1088
|
+
let localstorage_error;
|
|
1089
|
+
let cookie_error;
|
|
1090
|
+
try {
|
|
1091
|
+
id = localStorage._dep_id ||= (0, $460df8550f9d084d$export$656831b7e9c341c3)();
|
|
1092
|
+
} catch (e) {
|
|
1093
|
+
(0, $b04e44fad5ea42c7$export$f18d5b0af29128b7)(e, "warning");
|
|
1094
|
+
localstorage_error = e;
|
|
1317
1095
|
}
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
const anchor = event.element;
|
|
1331
|
-
if (typeof url === "string") {
|
|
1332
|
-
if (anchor.href.includes(url)) {
|
|
1333
|
-
if (!stfu) (0, $649f456f663da9fc$export$de56f1198d121036)("RUNNING RELATIVIFY on", event);
|
|
1334
|
-
anchor.href = anchor.href.replaceAll(url, "/");
|
|
1335
|
-
}
|
|
1336
|
-
} else if (url.test(anchor.href)) {
|
|
1337
|
-
if (!stfu) (0, $649f456f663da9fc$export$de56f1198d121036)("RUNNING RELATIVIFY on", event);
|
|
1338
|
-
anchor.href = anchor.href.replace(url, "/");
|
|
1096
|
+
if (!id) {
|
|
1097
|
+
try {
|
|
1098
|
+
const get_cookie_id = ()=>document.cookie.split(";").reduce((res, c)=>{
|
|
1099
|
+
const [key, val] = c.trim().split("=").map(decodeURIComponent);
|
|
1100
|
+
return Object.assign(res, {
|
|
1101
|
+
[key]: val
|
|
1102
|
+
});
|
|
1103
|
+
}, {})._dep_id;
|
|
1104
|
+
id = get_cookie_id();
|
|
1105
|
+
if (!id) {
|
|
1106
|
+
document.cookie = `_dep_id=${(0, $460df8550f9d084d$export$656831b7e9c341c3)()}; expires=Fri, 31 Dec 9999 23:59:59 GMT`;
|
|
1107
|
+
id = get_cookie_id();
|
|
1339
1108
|
}
|
|
1109
|
+
} catch (e) {
|
|
1110
|
+
(0, $b04e44fad5ea42c7$export$f18d5b0af29128b7)(e, "warning");
|
|
1111
|
+
cookie_error = e;
|
|
1112
|
+
}
|
|
1113
|
+
(0, $eba382943196079c$export$af2e17a20c2ea3c5).withScope(function(scope) {
|
|
1114
|
+
scope.setExtra("id", id);
|
|
1115
|
+
scope.setExtra("ls_error", localstorage_error);
|
|
1116
|
+
scope.setExtra("cookie_error", cookie_error);
|
|
1117
|
+
scope.setLevel("error");
|
|
1118
|
+
this.captureMessage(`${id ? "localStorage" : "cookie and localStorage"} failed to hold a value!`);
|
|
1340
1119
|
});
|
|
1341
|
-
const link_sel = "a[href]";
|
|
1342
|
-
(0, $0b48ba2f40ce6067$export$b6ae1bc530f4c149).onexists(link_sel, relativ_callback);
|
|
1343
|
-
if (also_onchange) (0, $0b48ba2f40ce6067$export$b6ae1bc530f4c149).onchange(link_sel, relativ_callback);
|
|
1344
|
-
if (also_in_all_shadow_roots && typeof ShadowRoot == "function") (0, $0b48ba2f40ce6067$export$b6ae1bc530f4c149).onexists("*", (0, $b04e44fad5ea42c7$export$b3bbfd758f11cfa9)(({ element: element })=>{
|
|
1345
|
-
if (element?.shadowRoot instanceof ShadowRoot) {
|
|
1346
|
-
const local_observer = new (0, $cdca9fea6eb103e5$export$12e07a2a9f87578a)({
|
|
1347
|
-
territory: element.shadowRoot
|
|
1348
|
-
});
|
|
1349
|
-
local_observer.onexists(link_sel, relativ_callback);
|
|
1350
|
-
}
|
|
1351
|
-
}));
|
|
1352
1120
|
}
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
)
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1121
|
+
if (!id) id = (0, $460df8550f9d084d$export$656831b7e9c341c3)();
|
|
1122
|
+
return id;
|
|
1123
|
+
};
|
|
1124
|
+
let $43683b1103edab15$export$adc61a405a4cabed = $43683b1103edab15$export$6399bdb2291895e0;
|
|
1125
|
+
let $43683b1103edab15$export$61e7e1f11e96692f = ()=>undefined;
|
|
1126
|
+
const $43683b1103edab15$export$336e7ad40bae0652 = /*@__PURE__*/ (0, /*@__PURE__*/$b04e44fad5ea42c7$export$b3bbfd758f11cfa9)((newfn)=>$43683b1103edab15$export$6399bdb2291895e0 = newfn);
|
|
1127
|
+
const $43683b1103edab15$export$8a96793bf9f87d90 = /*@__PURE__*/ (0, /*@__PURE__*/$b04e44fad5ea42c7$export$b3bbfd758f11cfa9)((newfn)=>$43683b1103edab15$export$adc61a405a4cabed = newfn);
|
|
1128
|
+
const $43683b1103edab15$export$93ae15b1ae509334 = /*@__PURE__*/ (0, /*@__PURE__*/$b04e44fad5ea42c7$export$b3bbfd758f11cfa9)((newfn)=>$43683b1103edab15$export$61e7e1f11e96692f = newfn);
|
|
1129
|
+
const $43683b1103edab15$export$8c6f26a5b6921b95 = /*@__PURE__*/ ()=>{
|
|
1130
|
+
return {
|
|
1131
|
+
session_id: $43683b1103edab15$export$61e7e1f11e96692f(),
|
|
1132
|
+
user_id: $43683b1103edab15$export$adc61a405a4cabed(),
|
|
1133
|
+
dsid: $43683b1103edab15$export$6399bdb2291895e0(),
|
|
1134
|
+
url: document.location.href,
|
|
1135
|
+
document_width: window.innerWidth,
|
|
1136
|
+
document_referrer: document?.referrer
|
|
1137
|
+
};
|
|
1138
|
+
};
|
|
1139
|
+
const $43683b1103edab15$export$82badda1f9923310 = /*@__PURE__*/ (0, /*@__PURE__*/$b04e44fad5ea42c7$export$b3bbfd758f11cfa9)((vars, use_ws)=>{
|
|
1140
|
+
if (process.env.DEPICT === "false") return;
|
|
1141
|
+
const payload = [
|
|
1142
|
+
{
|
|
1143
|
+
...$43683b1103edab15$export$8c6f26a5b6921b95(),
|
|
1144
|
+
// Compatability mapping - TODO: refactor & remove
|
|
1145
|
+
tenant: vars?.TENANT,
|
|
1146
|
+
market: vars?.MARKET,
|
|
1147
|
+
entity_price: vars?.sale_price,
|
|
1148
|
+
...vars
|
|
1376
1149
|
}
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
if (
|
|
1396
|
-
|
|
1150
|
+
];
|
|
1151
|
+
return (0, $cafa1ff1049985c2$export$28cacbd9b4306ffc)(payload, use_ws);
|
|
1152
|
+
});
|
|
1153
|
+
const $43683b1103edab15$export$15f8a0cd5a8c0ebb = /*@__PURE__*/ (0, /*@__PURE__*/$b04e44fad5ea42c7$export$b3bbfd758f11cfa9)((vars)=>{
|
|
1154
|
+
if (process.env.DEPICT === "false") return;
|
|
1155
|
+
const beacon_retval = $43683b1103edab15$export$82badda1f9923310({
|
|
1156
|
+
...vars,
|
|
1157
|
+
type: "click"
|
|
1158
|
+
}, false // don't send clicks over websockets because the page might unload
|
|
1159
|
+
);
|
|
1160
|
+
$43683b1103edab15$export$82badda1f9923310({
|
|
1161
|
+
...vars,
|
|
1162
|
+
type: "ws_click"
|
|
1163
|
+
}, true // explicitly send `ws-click` over websockets, this is an experiment to test the hypothesis of above - does unloading the page affect if this gets sent?
|
|
1164
|
+
);
|
|
1165
|
+
return beacon_retval;
|
|
1166
|
+
});
|
|
1167
|
+
const $43683b1103edab15$export$9028351cb994757e = /*@__PURE__*/ (0, /*@__PURE__*/$b04e44fad5ea42c7$export$b3bbfd758f11cfa9)((vars)=>{
|
|
1168
|
+
if (process.env.DEPICT === "false") return;
|
|
1169
|
+
return $43683b1103edab15$export$82badda1f9923310({
|
|
1170
|
+
...vars,
|
|
1171
|
+
type: "add_to_cart"
|
|
1172
|
+
});
|
|
1173
|
+
});
|
|
1174
|
+
function $43683b1103edab15$export$622991c71a1f52b3(cookie_name) {
|
|
1175
|
+
// https://stackoverflow.com/a/25490531
|
|
1176
|
+
return document.cookie.match("(^|;)\\s*" + cookie_name + "\\s*=\\s*([^;]+)")?.pop() || "";
|
|
1397
1177
|
}
|
|
1398
1178
|
|
|
1399
1179
|
|
|
1400
1180
|
|
|
1401
|
-
|
|
1181
|
+
function $9e268c1aeeb86b34$export$c50e1901e8ed0615(callback) {
|
|
1182
|
+
// https://stackoverflow.com/a/61574326
|
|
1183
|
+
const channel = new MessageChannel();
|
|
1184
|
+
channel.port1.onmessage = (0, $b04e44fad5ea42c7$export$b3bbfd758f11cfa9)(callback);
|
|
1185
|
+
channel.port2.postMessage("");
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1402
1188
|
|
|
1403
1189
|
|
|
1190
|
+
function $f809bc98a1cb5f92$export$6f051469dd676a8b(tenant, market, type) {
|
|
1191
|
+
let queued_sending = false;
|
|
1192
|
+
const current_displays = new Set();
|
|
1193
|
+
return function(display, info) {
|
|
1194
|
+
if (!display) return;
|
|
1195
|
+
info.set_on_index_change(()=>{
|
|
1196
|
+
current_displays.add(display);
|
|
1197
|
+
(0, $fF3HH$onCleanup)(()=>current_displays.delete(display));
|
|
1198
|
+
if (!queued_sending) {
|
|
1199
|
+
queued_sending = true;
|
|
1200
|
+
(0, $9e268c1aeeb86b34$export$c50e1901e8ed0615)(()=>{
|
|
1201
|
+
(0, $43683b1103edab15$export$82badda1f9923310)({
|
|
1202
|
+
tenant: tenant,
|
|
1203
|
+
market: market,
|
|
1204
|
+
recommendation_type: type,
|
|
1205
|
+
type: "recommendations_inserted"
|
|
1206
|
+
});
|
|
1207
|
+
queued_sending = false;
|
|
1208
|
+
});
|
|
1209
|
+
}
|
|
1210
|
+
});
|
|
1211
|
+
};
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1404
1214
|
|
|
1405
1215
|
|
|
1406
1216
|
/**
|
|
1407
|
-
*
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1217
|
+
* @deprecated this was a stupid idea, it's much easier to read if one just does a quick arrow function that provides the wanted arguments
|
|
1218
|
+
*/ function $a1c80794e6bf4cc2$export$6e7454c733fa1fb2(fn, ...args) {
|
|
1219
|
+
return function(...unimportant_args) {
|
|
1220
|
+
return fn.apply(this, [
|
|
1221
|
+
...args,
|
|
1222
|
+
...unimportant_args
|
|
1223
|
+
]);
|
|
1224
|
+
};
|
|
1413
1225
|
}
|
|
1414
1226
|
|
|
1415
1227
|
|
|
1416
1228
|
|
|
1417
1229
|
|
|
1230
|
+
const $66b898e9bfcef532$export$8582cf3716962dc2 = /*@__PURE__*/ (0, /*@__PURE__*/$b04e44fad5ea42c7$export$b3bbfd758f11cfa9)(async ({ recs: recs , min_recs: min_recs , market: market , type: type , product_id: product_id , tenant: tenant })=>{
|
|
1231
|
+
if (type == "placeholder") return;
|
|
1232
|
+
if (typeof product_id === "function") product_id = product_id();
|
|
1233
|
+
product_id = await product_id;
|
|
1234
|
+
recs = await recs;
|
|
1235
|
+
if (typeof recs === "object") {
|
|
1236
|
+
if (!Array.isArray(recs)) recs = recs?.displays;
|
|
1237
|
+
if (Array.isArray(recs)) {
|
|
1238
|
+
if (min_recs == undefined) min_recs = 10;
|
|
1239
|
+
if (recs.length < min_recs) {
|
|
1240
|
+
(0, $649f456f663da9fc$export$c2363754d4758444)("Displays provided to check_displays is too short, it contains", recs.length, "displays which is less than", min_recs);
|
|
1241
|
+
return false;
|
|
1242
|
+
} else return true;
|
|
1243
|
+
} else (0, $649f456f663da9fc$export$c2363754d4758444)(new Error("neither recs nor recs.displays are an array"));
|
|
1244
|
+
} else (0, $649f456f663da9fc$export$c2363754d4758444)(new Error("Non object was passed to check_displays"));
|
|
1245
|
+
});
|
|
1246
|
+
|
|
1247
|
+
|
|
1418
1248
|
|
|
1419
|
-
const $
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
];
|
|
1429
|
-
#ons = {};
|
|
1430
|
-
#try_again_in_ms = this.#initial_reconnect_delay;
|
|
1431
|
-
#fails = 0;
|
|
1432
|
-
#max_fails = 10;
|
|
1433
|
-
#max_backoff_ms = $4ce764ddfee055ef$var$ONE_MINUTE;
|
|
1434
|
-
get #initial_reconnect_delay() {
|
|
1435
|
-
return (0, $d89638655e64f324$export$bb0a9c36cf454ea0)(1, 1000);
|
|
1249
|
+
const $b55a70757989faf4$var$elem_track_id_map = /*@__PURE__*/ new WeakMap();
|
|
1250
|
+
function $b55a70757989faf4$export$16d7c76794a38a4(element, event, track_id, func) {
|
|
1251
|
+
const set_for_el = $b55a70757989faf4$var$elem_track_id_map.get(element);
|
|
1252
|
+
if (!set_for_el?.has?.(track_id)) {
|
|
1253
|
+
if (!(set_for_el instanceof Set)) $b55a70757989faf4$var$elem_track_id_map.set(element, new Set([
|
|
1254
|
+
track_id
|
|
1255
|
+
]));
|
|
1256
|
+
else set_for_el.add(track_id);
|
|
1257
|
+
element.addEventListener(event, func, true);
|
|
1436
1258
|
}
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
// the event will only have `.data` if it's a message or close event, but wdgaf because setting undefined = undefined is still undefined
|
|
1456
|
-
// ts-ignore because it would be very hard to teach typescript the situation
|
|
1457
|
-
} else try {
|
|
1458
|
-
// @ts-ignore
|
|
1459
|
-
fixed_event = new original_event.constructor(original_event.type, original_event); // modern browsers - clones an event as well as possible
|
|
1460
|
-
} catch (e) {
|
|
1461
|
-
// IE11 and the likes
|
|
1462
|
-
// dlog("Can't reconstruct event", e, original_event, "trying to make a CustomEvent instead");
|
|
1463
|
-
fixed_event = new CustomEvent(original_event.type, original_event);
|
|
1464
|
-
const intermediate = {};
|
|
1465
|
-
for(const key in original_event)intermediate[key] = original_event[key]; // for some reason Object.assign doesn't work because things like MessageEvent.data are not enumarable
|
|
1466
|
-
delete intermediate["target"];
|
|
1467
|
-
Object.assign(fixed_event, intermediate);
|
|
1468
|
-
}
|
|
1469
|
-
this.dispatchEvent(fixed_event);
|
|
1470
|
-
}));
|
|
1471
|
-
});
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
|
|
1262
|
+
// @ts-nocheck
|
|
1263
|
+
|
|
1264
|
+
const $39ef887981612535$var$needs_patching = typeof window === "object" ? /*@__PURE__*/ $39ef887981612535$var$check_if_querySelectorAll_needs_patching() : false;
|
|
1265
|
+
function $39ef887981612535$export$33f937d741e49339(element, selector) {
|
|
1266
|
+
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
|
|
1267
|
+
return element?.querySelectorAll?.(selector);
|
|
1268
|
+
const result = [];
|
|
1269
|
+
const elements_to_check = [];
|
|
1270
|
+
// intentionally not recursive since it's possible to have deeper nested elements than max stack size
|
|
1271
|
+
for(let i = element.children.length; i--;)elements_to_check.push(element.children[i]);
|
|
1272
|
+
while(elements_to_check.length){
|
|
1273
|
+
const child_element = elements_to_check.pop();
|
|
1274
|
+
if (child_element.matches(selector)) result.push(child_element);
|
|
1275
|
+
for(let i = child_element.children.length; i--;)// kudos to Karl for algorithm help
|
|
1276
|
+
elements_to_check.push(child_element.children[i]);
|
|
1472
1277
|
}
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
const on_fn = this.#ons[ev];
|
|
1487
|
-
if (typeof on_fn === "function") (0, $b04e44fad5ea42c7$export$b3bbfd758f11cfa9)(on_fn).call(ev, e);
|
|
1488
|
-
});
|
|
1489
|
-
}
|
|
1278
|
+
return result;
|
|
1279
|
+
}
|
|
1280
|
+
function $39ef887981612535$var$check_if_querySelectorAll_needs_patching() {
|
|
1281
|
+
const id_div = document.createElement("div");
|
|
1282
|
+
const element = document.createElement("section");
|
|
1283
|
+
const selector = "#a+*";
|
|
1284
|
+
id_div.id = "a";
|
|
1285
|
+
document.documentElement.append(id_div, element);
|
|
1286
|
+
try {
|
|
1287
|
+
return element === element.querySelectorAll(selector)[0];
|
|
1288
|
+
} finally{
|
|
1289
|
+
id_div.remove();
|
|
1290
|
+
element.remove();
|
|
1490
1291
|
}
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
clearTimeout(timeout);
|
|
1516
|
-
});
|
|
1517
|
-
window.addEventListener("online", handler, {
|
|
1518
|
-
once: true
|
|
1519
|
-
});
|
|
1520
|
-
const timeout = setTimeout((0, $b04e44fad5ea42c7$export$b3bbfd758f11cfa9)(()=>{
|
|
1521
|
-
this.#try_again_in_ms *= 1.5 + Math.random();
|
|
1522
|
-
if (this.#try_again_in_ms > this.#max_backoff_ms) this.#try_again_in_ms = this.#max_backoff_ms * (1 + Math.random() / 10);
|
|
1523
|
-
r();
|
|
1524
|
-
window.removeEventListener("online", handler);
|
|
1525
|
-
}), this.#try_again_in_ms);
|
|
1526
|
-
});
|
|
1527
|
-
this.#connect();
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
|
|
1295
|
+
|
|
1296
|
+
|
|
1297
|
+
let $8be08add28592faf$var$has_queued_microtask = false;
|
|
1298
|
+
const $8be08add28592faf$var$queued_callbacks = /*@__PURE__*/ new Map();
|
|
1299
|
+
const $8be08add28592faf$var$catchified_deduplicate_and_dispatch = /*@__PURE__*/ (0, /*@__PURE__*/$b04e44fad5ea42c7$export$b3bbfd758f11cfa9)($8be08add28592faf$var$deduplicate_and_dispatch, "error in observer event processing", "error");
|
|
1300
|
+
function $8be08add28592faf$export$2b08e30396270f0b(callback, ev) {
|
|
1301
|
+
$8be08add28592faf$var$queued_callbacks.set(ev, callback);
|
|
1302
|
+
if (!$8be08add28592faf$var$has_queued_microtask) queueMicrotask($8be08add28592faf$var$catchified_deduplicate_and_dispatch);
|
|
1303
|
+
}
|
|
1304
|
+
function $8be08add28592faf$var$deduplicate_and_dispatch() {
|
|
1305
|
+
$8be08add28592faf$var$has_queued_microtask = false;
|
|
1306
|
+
const deduplication_map = new Map();
|
|
1307
|
+
// event_name -> [selector -> [element -> [function, eoe]]]
|
|
1308
|
+
for (const [eoe, callback] of $8be08add28592faf$var$queued_callbacks){
|
|
1309
|
+
// put events into structure of maps and sets where they can only exist once
|
|
1310
|
+
$8be08add28592faf$var$queued_callbacks.delete(eoe);
|
|
1311
|
+
const { event: event_name , selector: selector , element: element } = eoe;
|
|
1312
|
+
if (!event_name) {
|
|
1313
|
+
// it's an ifexists callback, doesnt' need deduplication
|
|
1314
|
+
$8be08add28592faf$var$call_callback(callback, eoe);
|
|
1315
|
+
continue;
|
|
1528
1316
|
}
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1317
|
+
let l2_map = deduplication_map.get(event_name);
|
|
1318
|
+
if (!l2_map) {
|
|
1319
|
+
l2_map = new Map();
|
|
1320
|
+
deduplication_map.set(event_name, l2_map);
|
|
1321
|
+
}
|
|
1322
|
+
let l3_map = l2_map.get(selector);
|
|
1323
|
+
if (!l3_map) {
|
|
1324
|
+
l3_map = new Map();
|
|
1325
|
+
l2_map.set(selector, l3_map);
|
|
1326
|
+
}
|
|
1327
|
+
let l4_map = l3_map.get(element);
|
|
1328
|
+
if (!l4_map) {
|
|
1329
|
+
l4_map = new Map();
|
|
1330
|
+
l3_map.set(element, l4_map);
|
|
1535
1331
|
}
|
|
1332
|
+
l4_map.set(callback, eoe);
|
|
1536
1333
|
}
|
|
1537
|
-
|
|
1538
|
-
|
|
1334
|
+
// go through structure and call callbacks that are left
|
|
1335
|
+
for (const [_event_name, l2_map] of deduplication_map)for (const [_selector, l3_map] of l2_map){
|
|
1336
|
+
for (const [_element, callback_set] of l3_map)for (const [callback, eoe] of callback_set)$8be08add28592faf$var$call_callback(callback, eoe);
|
|
1539
1337
|
}
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
this
|
|
1549
|
-
this
|
|
1550
|
-
this
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
this.#try_again_in_ms = this.#initial_reconnect_delay; // reset exponential backoff
|
|
1554
|
-
}));
|
|
1338
|
+
}
|
|
1339
|
+
function $8be08add28592faf$var$call_callback(callback, ev) {
|
|
1340
|
+
(0, $b04e44fad5ea42c7$export$b3bbfd758f11cfa9)(callback, "Error in observer callback")(ev);
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
|
|
1344
|
+
class $cb50cd7a49e824ee$export$ea60432919e69303 {
|
|
1345
|
+
constructor(opts){
|
|
1346
|
+
this.element = opts.element_;
|
|
1347
|
+
this.selector = opts.selector_;
|
|
1348
|
+
this.disconnector = opts.disconnector_;
|
|
1349
|
+
opts.mutation_record_ && (this.mutation_record = opts.mutation_record_);
|
|
1350
|
+
opts.event_ && (this.event = opts.event_);
|
|
1555
1351
|
}
|
|
1556
1352
|
}
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
#
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1353
|
+
|
|
1354
|
+
|
|
1355
|
+
|
|
1356
|
+
|
|
1357
|
+
|
|
1358
|
+
class $cdca9fea6eb103e5$export$12e07a2a9f87578a {
|
|
1359
|
+
#the_mutation_observer;
|
|
1360
|
+
#observing = {};
|
|
1361
|
+
#self_proxied;
|
|
1362
|
+
#observer_callback_running = false;
|
|
1363
|
+
#execute_after_callback_ran = [];
|
|
1364
|
+
#attribute_attribution_map_object = {};
|
|
1365
|
+
#territory;
|
|
1366
|
+
#listeners = [
|
|
1367
|
+
"exists",
|
|
1368
|
+
"creation",
|
|
1369
|
+
"removed",
|
|
1370
|
+
"change"
|
|
1371
|
+
];
|
|
1372
|
+
#weakref_finalization_registry = typeof FinalizationRegistry === "function" && new FinalizationRegistry((0, $b04e44fad5ea42c7$export$b3bbfd758f11cfa9)(this.#finalization_registry_callback.bind(this)));
|
|
1373
|
+
#verbs = {
|
|
1374
|
+
// add "normal" functions for the class that can be used as i.e. observer.ifexists() here
|
|
1375
|
+
ifexists: (selector, callback)=>{
|
|
1376
|
+
this.#check_observer_args(selector, callback, true);
|
|
1377
|
+
if (selector instanceof Node) {
|
|
1378
|
+
if (typeof document === "object" && (this.#territory || 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
|
|
1379
|
+
this.#call_callbacks([
|
|
1380
|
+
callback
|
|
1381
|
+
], (callback_)=>({
|
|
1382
|
+
element_: selector,
|
|
1383
|
+
selector_: selector,
|
|
1384
|
+
// ts is being stupid here because it doesn't understand that everything in string | Text | Element | Comment that's a node is Text | Element | Comment
|
|
1385
|
+
disconnector_: this.#disconnect_fn({
|
|
1386
|
+
event_: "exists",
|
|
1387
|
+
selector_: new WeakRef(selector),
|
|
1388
|
+
callback_: callback_
|
|
1389
|
+
})
|
|
1390
|
+
}));
|
|
1391
|
+
return;
|
|
1392
|
+
}
|
|
1393
|
+
const our_set = this.#attribute_attribution_map_object[selector] ||= new WeakSet();
|
|
1394
|
+
const elements = typeof document === "undefined" ? [] : (0, $39ef887981612535$export$33f937d741e49339)(this.#territory || document, selector);
|
|
1395
|
+
for(let i = 0; i < elements.length; i++){
|
|
1396
|
+
const element = elements[i];
|
|
1397
|
+
our_set.add(element);
|
|
1398
|
+
this.#call_callbacks([
|
|
1399
|
+
callback
|
|
1400
|
+
], (callback_)=>({
|
|
1401
|
+
element_: element,
|
|
1402
|
+
selector_: selector,
|
|
1403
|
+
disconnector_: this.#disconnect_fn({
|
|
1404
|
+
event_: "exists",
|
|
1405
|
+
selector_: selector,
|
|
1406
|
+
callback_: callback_
|
|
1407
|
+
})
|
|
1408
|
+
}));
|
|
1409
|
+
}
|
|
1410
|
+
},
|
|
1411
|
+
wait_for_element: (selector, timeout)=>{
|
|
1412
|
+
return this.#self_proxied.wait_for_listener("exists", selector, timeout);
|
|
1413
|
+
},
|
|
1414
|
+
wait_for_listener: (listener, selector, timeout)=>{
|
|
1415
|
+
this.#check_observer_args(listener, ()=>{}, false);
|
|
1416
|
+
// console.log("waiting for listener", listener, "selector", selector, "timeout", timeout);
|
|
1417
|
+
return new Promise((0, $b04e44fad5ea42c7$export$b3bbfd758f11cfa9)((r)=>{
|
|
1418
|
+
const stop_observing = this.#self_proxied["on" + listener](selector, ({ element: element , disconnector: disconnector })=>{
|
|
1419
|
+
r(element);
|
|
1420
|
+
disconnector();
|
|
1421
|
+
if (timeout) clearTimeout(obs_timeout);
|
|
1422
|
+
});
|
|
1423
|
+
if (timeout) var obs_timeout = setTimeout(()=>{
|
|
1424
|
+
stop_observing();
|
|
1425
|
+
r(undefined);
|
|
1426
|
+
}, timeout);
|
|
1427
|
+
}));
|
|
1428
|
+
}
|
|
1429
|
+
};
|
|
1430
|
+
#kickstart_observer() {
|
|
1431
|
+
if (typeof document === "undefined") return;
|
|
1432
|
+
this.#the_mutation_observer = new MutationObserver(this.#observer_callback);
|
|
1433
|
+
this.#the_mutation_observer.observe(this.#territory || document, {
|
|
1434
|
+
attributes: true,
|
|
1435
|
+
childList: true,
|
|
1436
|
+
subtree: true,
|
|
1437
|
+
attributeOldValue: true,
|
|
1438
|
+
characterData: true,
|
|
1439
|
+
characterDataOldValue: true
|
|
1569
1440
|
});
|
|
1570
|
-
this.send(msg);
|
|
1571
1441
|
}
|
|
1572
|
-
#
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1442
|
+
#disconnect_fn({ event_: event_ , selector_: selector_ , callback_: callback_ }) {
|
|
1443
|
+
return ()=>{
|
|
1444
|
+
const fn = ()=>{
|
|
1445
|
+
const observing = this.#observing;
|
|
1446
|
+
const selector_to_callback_array_map = observing[event_];
|
|
1447
|
+
if (!selector_to_callback_array_map) return;
|
|
1448
|
+
const callbacks = selector_to_callback_array_map.get(selector_);
|
|
1449
|
+
callbacks?.delete(callback_);
|
|
1450
|
+
if (callbacks?.size === 0) selector_to_callback_array_map.delete(selector_);
|
|
1451
|
+
if (selector_to_callback_array_map.size === 0) delete observing[event_];
|
|
1452
|
+
if (!Object.keys(observing).length) {
|
|
1453
|
+
this.#the_mutation_observer?.disconnect();
|
|
1454
|
+
this.#the_mutation_observer = undefined;
|
|
1455
|
+
}
|
|
1456
|
+
};
|
|
1457
|
+
// If the observer callback is running, we need to queue every function that mutates this.#observing since we can't clone it for performance reasons
|
|
1458
|
+
if (this.#observer_callback_running) this.#execute_after_callback_ran.push(fn);
|
|
1459
|
+
else fn();
|
|
1460
|
+
};
|
|
1461
|
+
}
|
|
1462
|
+
#observer_callback = (records)=>{
|
|
1463
|
+
// this is the function which needs to be as fast as possible because it is called on EVERY mutation in the DOM
|
|
1464
|
+
try {
|
|
1465
|
+
this.#observer_callback_running = true;
|
|
1466
|
+
const steps_to_restore_observing_cache = [];
|
|
1467
|
+
try {
|
|
1468
|
+
const observing = this.#observing; // Currently observing elements. Please make sure they don't get mutated by anything except this function during the running of this function (use observer_callback_running and #execute_after_callback_ran to check for and schedule your mutations for after the run of this function). We previously cloned these on every run but that's super slow.
|
|
1469
|
+
const attribute_attribution_map_object = this.#attribute_attribution_map_object;
|
|
1470
|
+
for(let j = 0; j < records.length; j++){
|
|
1471
|
+
const record = records[j];
|
|
1472
|
+
const { addedNodes: addedNodes , removedNodes: removedNodes , target: target } = record;
|
|
1473
|
+
const events_for_discovery = [];
|
|
1474
|
+
let nodes_to_check;
|
|
1475
|
+
// code for handling a record containing wanted elements in addedNodes or the children of added nodes and attribute changes that make an existing node match a selector, mainly for oncreation and onexists, but it will fire onchange if someone is listening if an attribute change makes an element match a selector
|
|
1476
|
+
if (!addedNodes.length && !removedNodes.length) nodes_to_check = [
|
|
1477
|
+
target
|
|
1478
|
+
];
|
|
1479
|
+
else {
|
|
1480
|
+
nodes_to_check = addedNodes;
|
|
1481
|
+
if (observing["creation"]) events_for_discovery.push("creation");
|
|
1482
|
+
}
|
|
1483
|
+
if (observing["exists"]) events_for_discovery.push("exists");
|
|
1484
|
+
if (observing["change"]) events_for_discovery.push("change");
|
|
1485
|
+
for(let n = 0; n < events_for_discovery.length; n++){
|
|
1486
|
+
const event = events_for_discovery[n];
|
|
1487
|
+
const event_is_creation_or_exists_with_tree_change = event === "creation" || event === "exists" && addedNodes.length;
|
|
1488
|
+
const selector_map = observing[event];
|
|
1489
|
+
const selectors = [
|
|
1490
|
+
...selector_map.keys()
|
|
1491
|
+
]; // we can only iterate over a MapIterator once, so we need to spread it
|
|
1492
|
+
if (event === "change" && (addedNodes.length || removedNodes.length)) {
|
|
1493
|
+
// we check the selectors first because I'm DUMB and already have come so far
|
|
1494
|
+
for(let selectors_i = 0; selectors_i < selectors.length; selectors_i++){
|
|
1495
|
+
const selector = selectors[selectors_i];
|
|
1496
|
+
// @ts-ignore
|
|
1497
|
+
if (target?.matches?.(selector)) {
|
|
1498
|
+
// we WANT change event and there are children to an element that interests us - act on it
|
|
1499
|
+
const callbacks = selector_map.get(selector);
|
|
1500
|
+
this.#call_callbacks(callbacks, (callback)=>({
|
|
1501
|
+
element_: target,
|
|
1502
|
+
// it has to be an *Element* since it has
|
|
1503
|
+
// the selector is a string since the event is change
|
|
1504
|
+
// @ts-ignore
|
|
1505
|
+
selector_: selector,
|
|
1506
|
+
event_: event,
|
|
1507
|
+
mutation_record_: record,
|
|
1508
|
+
disconnector_: this.#disconnect_fn({
|
|
1509
|
+
event_: event,
|
|
1510
|
+
selector_: selector,
|
|
1511
|
+
callback_: callback
|
|
1512
|
+
})
|
|
1513
|
+
}));
|
|
1514
|
+
selector_map.delete(selector);
|
|
1515
|
+
steps_to_restore_observing_cache.push(()=>selector_map.set(selector, callbacks));
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
break;
|
|
1519
|
+
}
|
|
1520
|
+
for(let i = 0; i < nodes_to_check.length; i++){
|
|
1521
|
+
const node = nodes_to_check[i];
|
|
1522
|
+
for(let selectors_i = 0; selectors_i < selectors.length; selectors_i++){
|
|
1523
|
+
const selector = selectors[selectors_i];
|
|
1524
|
+
const callbacks = selector_map.get(selector) || new Set();
|
|
1525
|
+
if (typeof selector !== "string") {
|
|
1526
|
+
// oncreation or onexists with node-selector
|
|
1527
|
+
if (event_is_creation_or_exists_with_tree_change) {
|
|
1528
|
+
const derefed_el = selector.deref();
|
|
1529
|
+
if (!derefed_el) {
|
|
1530
|
+
selector_map.delete(selector);
|
|
1531
|
+
continue;
|
|
1532
|
+
}
|
|
1533
|
+
if (node === derefed_el || node.contains(derefed_el)) // node is node or node is child of added node
|
|
1534
|
+
this.#call_callbacks(callbacks, (callback)=>({
|
|
1535
|
+
element_: derefed_el,
|
|
1536
|
+
selector_: derefed_el,
|
|
1537
|
+
event_: event,
|
|
1538
|
+
mutation_record_: record,
|
|
1539
|
+
disconnector_: this.#disconnect_fn({
|
|
1540
|
+
event_: event,
|
|
1541
|
+
selector_: selector,
|
|
1542
|
+
callback_: callback
|
|
1543
|
+
})
|
|
1544
|
+
}));
|
|
1545
|
+
}
|
|
1546
|
+
continue;
|
|
1547
|
+
}
|
|
1548
|
+
// @ts-ignore
|
|
1549
|
+
const matches_now = node?.matches?.(selector);
|
|
1550
|
+
let our_set;
|
|
1551
|
+
if (event == "exists") {
|
|
1552
|
+
// we want the change event to trigger to any change (exists only if it makes an element match a selector that didn't previously match)
|
|
1553
|
+
our_set = attribute_attribution_map_object[selector] ||= new WeakSet();
|
|
1554
|
+
if (record.type === "attributes" && matches_now != null) {
|
|
1555
|
+
const matched_last = our_set.has(node);
|
|
1556
|
+
if (matched_last && matches_now) continue;
|
|
1557
|
+
}
|
|
1558
|
+
if (matches_now) our_set.add(node);
|
|
1559
|
+
else our_set.delete(node);
|
|
1560
|
+
}
|
|
1561
|
+
if (matches_now) this.#call_callbacks(callbacks, (callback)=>({
|
|
1562
|
+
element_: node,
|
|
1563
|
+
selector_: selector,
|
|
1564
|
+
event_: event,
|
|
1565
|
+
mutation_record_: record,
|
|
1566
|
+
disconnector_: this.#disconnect_fn({
|
|
1567
|
+
event_: event,
|
|
1568
|
+
selector_: selector,
|
|
1569
|
+
callback_: callback
|
|
1570
|
+
})
|
|
1571
|
+
}));
|
|
1572
|
+
if ((addedNodes.length || removedNodes.length) && node.hasChildNodes() && // @ts-ignore
|
|
1573
|
+
node.querySelectorAll /* don't act on i.e. textnodes. Doing the check this way is actually faster than both `in` and instanceof */ ) {
|
|
1574
|
+
const matching_children = (0, $39ef887981612535$export$33f937d741e49339)(node, selector);
|
|
1575
|
+
for(let m = 0; m < matching_children.length; m++){
|
|
1576
|
+
// always use for loops because this can't be slow and forEach takes ages
|
|
1577
|
+
if (event == "exists") our_set.add(matching_children[m]);
|
|
1578
|
+
this.#call_callbacks(callbacks, (callback)=>({
|
|
1579
|
+
element_: matching_children[m],
|
|
1580
|
+
selector_: selector,
|
|
1581
|
+
event_: event,
|
|
1582
|
+
mutation_record_: record,
|
|
1583
|
+
disconnector_: this.#disconnect_fn({
|
|
1584
|
+
event_: event,
|
|
1585
|
+
selector_: selector,
|
|
1586
|
+
callback_: callback
|
|
1587
|
+
})
|
|
1588
|
+
}));
|
|
1589
|
+
}
|
|
1590
|
+
}
|
|
1591
|
+
}
|
|
1592
|
+
}
|
|
1593
|
+
}
|
|
1594
|
+
// code for handling changes to children of an observed element
|
|
1595
|
+
{
|
|
1596
|
+
const event = "change";
|
|
1597
|
+
const selector_map = observing[event];
|
|
1598
|
+
if (selector_map) {
|
|
1599
|
+
let target_el = target;
|
|
1600
|
+
while(target_el = target_el?.parentNode)// @ts-ignore
|
|
1601
|
+
if (target_el?.matches) {
|
|
1602
|
+
for (const selector of selector_map.keys())// selector is string because event is change
|
|
1603
|
+
// @ts-ignore
|
|
1604
|
+
if (target_el.matches?.(selector)) {
|
|
1605
|
+
const callbacks = selector_map.get(selector);
|
|
1606
|
+
this.#call_callbacks(callbacks, (callback)=>({
|
|
1607
|
+
element_: target_el,
|
|
1608
|
+
// @ts-ignore
|
|
1609
|
+
selector_: selector,
|
|
1610
|
+
event_: event,
|
|
1611
|
+
mutation_record_: record,
|
|
1612
|
+
disconnector_: this.#disconnect_fn({
|
|
1613
|
+
event_: event,
|
|
1614
|
+
selector_: selector,
|
|
1615
|
+
callback_: callback
|
|
1616
|
+
})
|
|
1617
|
+
}));
|
|
1618
|
+
// Since we now deduplicate
|
|
1619
|
+
steps_to_restore_observing_cache.push(()=>selector_map.set(selector, callbacks));
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
}
|
|
1624
|
+
// code for observing observed elements disappearing
|
|
1625
|
+
{
|
|
1626
|
+
const event = "removed";
|
|
1627
|
+
const removed_map = observing[event];
|
|
1628
|
+
if (removed_map && removedNodes?.length) {
|
|
1629
|
+
const selectors = [
|
|
1630
|
+
...removed_map.keys()
|
|
1631
|
+
];
|
|
1632
|
+
for(let t = 0; t < removedNodes.length; t++)for(let u = 0; u < selectors.length; u++){
|
|
1633
|
+
const selector = selectors[u];
|
|
1634
|
+
const callbacks = removed_map.get(selector) || new Set();
|
|
1635
|
+
const node = removedNodes[t];
|
|
1636
|
+
if (typeof selector === "string") {
|
|
1637
|
+
const matching_nodes = [];
|
|
1638
|
+
// @ts-ignore
|
|
1639
|
+
if (node?.matches?.(selector)) matching_nodes.push(node);
|
|
1640
|
+
matching_nodes.push(...(0, $39ef887981612535$export$33f937d741e49339)(node, selector) || []);
|
|
1641
|
+
for(let v = 0; v < matching_nodes.length; v++)this.#call_callbacks(callbacks, (callback)=>({
|
|
1642
|
+
element_: matching_nodes[v],
|
|
1643
|
+
selector_: selector,
|
|
1644
|
+
event_: event,
|
|
1645
|
+
mutation_record_: record,
|
|
1646
|
+
disconnector_: this.#disconnect_fn({
|
|
1647
|
+
event_: "removed",
|
|
1648
|
+
selector_: selector,
|
|
1649
|
+
callback_: callback
|
|
1650
|
+
})
|
|
1651
|
+
}));
|
|
1652
|
+
} else {
|
|
1653
|
+
const derefed_el = selector.deref();
|
|
1654
|
+
if (derefed_el) {
|
|
1655
|
+
if (node === derefed_el || node.contains(derefed_el)) this.#call_callbacks(callbacks, (callback)=>({
|
|
1656
|
+
element_: derefed_el,
|
|
1657
|
+
mutation_record_: record,
|
|
1658
|
+
selector_: derefed_el,
|
|
1659
|
+
event_: event,
|
|
1660
|
+
disconnector_: this.#disconnect_fn({
|
|
1661
|
+
event_: event,
|
|
1662
|
+
selector_: selector,
|
|
1663
|
+
callback_: callback
|
|
1664
|
+
})
|
|
1665
|
+
}));
|
|
1666
|
+
} else // here it's also ok to mutate #observing since the WeakRef is empty
|
|
1667
|
+
removed_map.delete(selector);
|
|
1668
|
+
}
|
|
1669
|
+
}
|
|
1670
|
+
}
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
// const end = new Date().getTime();
|
|
1674
|
+
// console.log("procesed",records.length,"in", end-start, this.#observing);
|
|
1675
|
+
} finally{
|
|
1676
|
+
// ensure that we don't leave this.#observing in a broken state if we throw
|
|
1677
|
+
while(steps_to_restore_observing_cache.length)steps_to_restore_observing_cache.pop()();
|
|
1678
|
+
const execute_after_run = this.#execute_after_callback_ran;
|
|
1679
|
+
// We need to execute these in order they were added because I'm afraid that things might rely on it
|
|
1680
|
+
for(let i = 0; i < execute_after_run.length; i++)try {
|
|
1681
|
+
execute_after_run[i]();
|
|
1682
|
+
} catch (e) {
|
|
1683
|
+
(0, $b04e44fad5ea42c7$export$f18d5b0af29128b7)([
|
|
1684
|
+
e,
|
|
1685
|
+
"error in observer running queued function"
|
|
1686
|
+
], "error");
|
|
1687
|
+
}
|
|
1688
|
+
// Let the garbage collector empty the old array by creating a new one
|
|
1689
|
+
this.#execute_after_callback_ran = [];
|
|
1690
|
+
this.#observer_callback_running = false;
|
|
1613
1691
|
}
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1692
|
+
} catch (e) {
|
|
1693
|
+
(0, $b04e44fad5ea42c7$export$f18d5b0af29128b7)([
|
|
1694
|
+
e,
|
|
1695
|
+
"error in observer"
|
|
1696
|
+
], "error");
|
|
1697
|
+
}
|
|
1698
|
+
};
|
|
1699
|
+
#check_observer_args(selector, callback, allow_nodes) {
|
|
1700
|
+
if (!allow_nodes && typeof selector !== "string" || allow_nodes && !(selector instanceof Node) && typeof selector !== "string") throw new Error("no or invalid selector specified");
|
|
1701
|
+
if (typeof callback !== "function") throw new Error("no callback specified");
|
|
1617
1702
|
}
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
const
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
const msg = "Got malformed message (ignoring, might cause memory leak)";
|
|
1628
|
-
(0, $649f456f663da9fc$export$de56f1198d121036)(msg, data, e);
|
|
1629
|
-
(0, $b04e44fad5ea42c7$export$f18d5b0af29128b7)([
|
|
1630
|
-
e,
|
|
1631
|
-
msg
|
|
1632
|
-
], "error", {
|
|
1633
|
-
data: data
|
|
1703
|
+
#add_listener(listener) {
|
|
1704
|
+
// called when observer.onsomethinglistener() is called, somethinglistener being something in this.#listeners
|
|
1705
|
+
const the_class = this;
|
|
1706
|
+
const function_for_listener = (selector, callback)=>{
|
|
1707
|
+
if (!listener || !selector || !callback) {
|
|
1708
|
+
(0, $649f456f663da9fc$export$de56f1198d121036)("listener, selector or callback is falsey", {
|
|
1709
|
+
listener: listener,
|
|
1710
|
+
selector: selector,
|
|
1711
|
+
callback: callback
|
|
1634
1712
|
});
|
|
1635
|
-
|
|
1713
|
+
return;
|
|
1636
1714
|
}
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
} else if (status == "not-ok") (0, $649f456f663da9fc$export$c2363754d4758444)("Got reply not-ok reply from server for event!", payload, reply);
|
|
1643
|
-
else if (status == "ok") {
|
|
1644
|
-
if (process.env.BUILD_TARGET !== "node") (0, $649f456f663da9fc$export$de56f1198d121036)(`Successfully sent ${payload?.event?.type} (WS)`, payload, reply);
|
|
1645
|
-
} else (0, $649f456f663da9fc$export$c2363754d4758444)("Strange reply from WSS server to", payload, ":", reply);
|
|
1646
|
-
stop_sending();
|
|
1647
|
-
return [
|
|
1648
|
-
reply,
|
|
1649
|
-
data
|
|
1650
|
-
];
|
|
1715
|
+
the_class.#check_observer_args(selector, callback, listener != "change");
|
|
1716
|
+
if (the_class.#observer_callback_running) {
|
|
1717
|
+
// Can't mutate #observing right now, queue it for when we can
|
|
1718
|
+
the_class.#execute_after_callback_ran.push(()=>function_for_listener(selector, callback));
|
|
1719
|
+
return;
|
|
1651
1720
|
}
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
* @return A random string, containing a-z, 0-9 and occasionally a dot (`.`)
|
|
1671
|
-
*/ function $460df8550f9d084d$export$656831b7e9c341c3() {
|
|
1672
|
-
return (Math.random() * 2e17).toString(36);
|
|
1673
|
-
}
|
|
1674
|
-
function $460df8550f9d084d$export$a6db784f019668ba() {
|
|
1675
|
-
return "x" + $460df8550f9d084d$export$656831b7e9c341c3().replaceAll(".", "");
|
|
1676
|
-
}
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
const $cafa1ff1049985c2$var$c = (0, $b04e44fad5ea42c7$export$b3bbfd758f11cfa9);
|
|
1684
|
-
const $cafa1ff1049985c2$var$ws_instance = /*@__PURE__*/ $cafa1ff1049985c2$var$c(()=>new (0, $4ce764ddfee055ef$export$1d9c6fddbff3441f)("wss://ws.depict.ai/ws/create-events"))();
|
|
1685
|
-
const $cafa1ff1049985c2$var$allowed_keys = [
|
|
1686
|
-
"tenant",
|
|
1687
|
-
"market",
|
|
1688
|
-
"type",
|
|
1689
|
-
"user_id",
|
|
1690
|
-
"session_id",
|
|
1691
|
-
"product_id",
|
|
1692
|
-
"entity_identifiers",
|
|
1693
|
-
"url",
|
|
1694
|
-
"entity_price",
|
|
1695
|
-
"currency",
|
|
1696
|
-
"document_referrer",
|
|
1697
|
-
"document_width",
|
|
1698
|
-
"attribution_id",
|
|
1699
|
-
"recommendation_id",
|
|
1700
|
-
"click_location",
|
|
1701
|
-
"ab_test_group",
|
|
1702
|
-
"variant_ids",
|
|
1703
|
-
"dsid",
|
|
1704
|
-
"transaction_id",
|
|
1705
|
-
"error_type",
|
|
1706
|
-
"detail",
|
|
1707
|
-
"recommendation_type",
|
|
1708
|
-
"search_result_id",
|
|
1709
|
-
"product_listing_result_id"
|
|
1710
|
-
];
|
|
1711
|
-
const $cafa1ff1049985c2$export$72036d950e1fae95 = /*@__PURE__*/ $cafa1ff1049985c2$var$c((payload)=>{
|
|
1712
|
-
if (process.env.DEPICT === "false") return;
|
|
1713
|
-
return payload.map((body)=>Object.fromEntries(Object.entries(body).filter(([key, value])=>$cafa1ff1049985c2$var$allowed_keys.includes(key) && value != null)));
|
|
1714
|
-
});
|
|
1715
|
-
const $cafa1ff1049985c2$export$aa26019042811d4f = /*@__PURE__*/ $cafa1ff1049985c2$var$c(async (bodies)=>{
|
|
1716
|
-
if (process.env.DEPICT === "false") return;
|
|
1717
|
-
for(let i = 0; i < bodies.length; i++){
|
|
1718
|
-
const id = (0, $460df8550f9d084d$export$656831b7e9c341c3)();
|
|
1719
|
-
$cafa1ff1049985c2$var$ws_instance?.ensure_sent({
|
|
1720
|
-
id: id,
|
|
1721
|
-
event: bodies[i]
|
|
1722
|
-
}).catch((e)=>(0, $b04e44fad5ea42c7$export$f18d5b0af29128b7)(e, "error"));
|
|
1723
|
-
}
|
|
1724
|
-
});
|
|
1725
|
-
const $cafa1ff1049985c2$export$608478473a3304a0 = /*@__PURE__*/ $cafa1ff1049985c2$var$c((payload, use_ws = true)=>{
|
|
1726
|
-
if (process.env.DEPICT === "false") return;
|
|
1727
|
-
if (use_ws && typeof WebSocket == "function" && typeof $cafa1ff1049985c2$var$ws_instance?.ensure_sent == "function") {
|
|
1728
|
-
(0, $649f456f663da9fc$export$de56f1198d121036)("Sending to depict (ws)", payload);
|
|
1729
|
-
return $cafa1ff1049985c2$export$aa26019042811d4f(payload);
|
|
1730
|
-
}
|
|
1731
|
-
const url = (0, $6c2b49f3f564b0d1$export$362abebb4b313340) + "/create-events";
|
|
1732
|
-
return $cafa1ff1049985c2$export$cc3b6ddf805f6156(url, payload);
|
|
1733
|
-
});
|
|
1734
|
-
const $cafa1ff1049985c2$export$cc3b6ddf805f6156 = /*@__PURE__*/ $cafa1ff1049985c2$var$c((url, payload)=>{
|
|
1735
|
-
const payload_json = JSON.stringify(payload);
|
|
1736
|
-
let success = false;
|
|
1737
|
-
(0, $649f456f663da9fc$export$de56f1198d121036)(`Attempting to send (beacon)`, payload);
|
|
1738
|
-
try {
|
|
1739
|
-
success = navigator.sendBeacon(url, new Blob([
|
|
1740
|
-
payload_json
|
|
1741
|
-
], {
|
|
1742
|
-
type: "application/json"
|
|
1743
|
-
}));
|
|
1744
|
-
} catch (first_error) {
|
|
1745
|
-
(0, $649f456f663da9fc$export$de56f1198d121036)("Beacon has failed", first_error, "falling back to sending with wrong mime type which might work");
|
|
1746
|
-
try {
|
|
1747
|
-
success = navigator.sendBeacon(url, new Blob([
|
|
1748
|
-
payload_json
|
|
1749
|
-
], {
|
|
1750
|
-
type: "application/x-www-form-urlencoded"
|
|
1751
|
-
}));
|
|
1752
|
-
} catch (e) {
|
|
1753
|
-
(0, $649f456f663da9fc$export$de56f1198d121036)("Beacon fallback has failed", e, "trying fetch");
|
|
1754
|
-
fetch(url, {
|
|
1755
|
-
"headers": {
|
|
1756
|
-
"content-type": "application/json"
|
|
1757
|
-
},
|
|
1758
|
-
"body": payload_json,
|
|
1759
|
-
"method": "POST",
|
|
1760
|
-
"mode": "cors",
|
|
1761
|
-
"credentials": "include"
|
|
1762
|
-
}).then((response)=>response.text()).then((text)=>(0, $649f456f663da9fc$export$de56f1198d121036)("Beacon fallback fallback transmission result", text)).catch((fetch_error)=>{
|
|
1763
|
-
(0, $eba382943196079c$export$af2e17a20c2ea3c5).withScope(function(scope) {
|
|
1764
|
-
scope.setExtra("stack", new Error().stack);
|
|
1765
|
-
scope.setExtra("url", url);
|
|
1766
|
-
scope.setExtra("payload", payload_json);
|
|
1767
|
-
scope.setExtra("first_error", first_error);
|
|
1768
|
-
scope.setExtra("second_error", e);
|
|
1769
|
-
scope.setTag("feature", "beacon");
|
|
1770
|
-
scope.setTag("approach", "fetch_fallback");
|
|
1771
|
-
scope.setLevel("error");
|
|
1772
|
-
this.captureMessage(fetch_error); // we can now do this - it's depict lazy sentry specific. `this` will refer to the actual hub with breadcrumbs and the scope activated
|
|
1721
|
+
const observing = the_class.#observing;
|
|
1722
|
+
observing[listener] ||= new Map();
|
|
1723
|
+
// create map for each listener, this is because the selectors can be objects for .onremoved, .oncreation and .onexists to take explicit nodes
|
|
1724
|
+
const selector_map = observing[listener];
|
|
1725
|
+
let disconnector;
|
|
1726
|
+
if (listener === "exists") the_class.#verbs.ifexists(selector, callback);
|
|
1727
|
+
if (typeof selector === "string") {
|
|
1728
|
+
// simple code for string selectors
|
|
1729
|
+
let callback_set = selector_map.get(selector);
|
|
1730
|
+
if (!callback_set) {
|
|
1731
|
+
callback_set = new Set();
|
|
1732
|
+
selector_map.set(selector, callback_set);
|
|
1733
|
+
}
|
|
1734
|
+
callback_set.add(callback); // we make this a set since you're not supposed to be able to have the same function as listener twice, like you can't with addEventListener
|
|
1735
|
+
disconnector = the_class.#disconnect_fn({
|
|
1736
|
+
event_: listener,
|
|
1737
|
+
selector_: selector,
|
|
1738
|
+
callback_: callback
|
|
1773
1739
|
});
|
|
1774
|
-
}
|
|
1740
|
+
} else {
|
|
1741
|
+
// for an element "selector" we don't want to keep strong references to the nodes as that would prevent them from being garbage collected
|
|
1742
|
+
let callback_set_to_add_to;
|
|
1743
|
+
for (const [stored_selector, existing_callback_set] of selector_map){
|
|
1744
|
+
// try finding an existing array of callbacks
|
|
1745
|
+
if (typeof stored_selector === "string") continue;
|
|
1746
|
+
const ref_contents = stored_selector.deref();
|
|
1747
|
+
if (!ref_contents) {
|
|
1748
|
+
// clean up listeners for selectors that have already been GC'd
|
|
1749
|
+
selector_map.delete(stored_selector);
|
|
1750
|
+
continue;
|
|
1751
|
+
}
|
|
1752
|
+
if (ref_contents === selector) {
|
|
1753
|
+
callback_set_to_add_to = existing_callback_set;
|
|
1754
|
+
disconnector = the_class.#disconnect_fn({
|
|
1755
|
+
event_: listener,
|
|
1756
|
+
selector_: stored_selector,
|
|
1757
|
+
callback_: callback
|
|
1758
|
+
});
|
|
1759
|
+
break;
|
|
1760
|
+
}
|
|
1761
|
+
}
|
|
1762
|
+
if (!callback_set_to_add_to) {
|
|
1763
|
+
callback_set_to_add_to = new Set();
|
|
1764
|
+
const weakref = new WeakRef(selector);
|
|
1765
|
+
the_class.#cleanup_weakref_when_refd_el_gcd(listener, weakref, selector);
|
|
1766
|
+
selector_map.set(weakref, callback_set_to_add_to);
|
|
1767
|
+
disconnector = the_class.#disconnect_fn({
|
|
1768
|
+
event_: listener,
|
|
1769
|
+
selector_: weakref,
|
|
1770
|
+
callback_: callback
|
|
1771
|
+
});
|
|
1772
|
+
}
|
|
1773
|
+
callback_set_to_add_to.add(callback);
|
|
1774
|
+
}
|
|
1775
|
+
if (!the_class.#the_mutation_observer) the_class.#kickstart_observer();
|
|
1776
|
+
return disconnector;
|
|
1777
|
+
};
|
|
1778
|
+
return function_for_listener;
|
|
1779
|
+
}
|
|
1780
|
+
#cleanup_weakref_when_refd_el_gcd(listener1, weakref, element) {
|
|
1781
|
+
// we don't want to keep references to elements used as "selectors" in oncreation and onremoved
|
|
1782
|
+
if (!this.#weakref_finalization_registry) return;
|
|
1783
|
+
this.#weakref_finalization_registry.register(element, [
|
|
1784
|
+
listener1,
|
|
1785
|
+
weakref
|
|
1786
|
+
]);
|
|
1787
|
+
}
|
|
1788
|
+
#finalization_registry_callback([listener2, weak_ref]) {
|
|
1789
|
+
// element was GCd and the callbacks can never be called, remove them
|
|
1790
|
+
const observing = this.#observing;
|
|
1791
|
+
observing[listener2]?.get(weak_ref)?.clear(); // just in case something still has a reference to this set and does something with it, clear it
|
|
1792
|
+
observing[listener2]?.delete(weak_ref);
|
|
1793
|
+
if (observing[listener2]?.size === 0) delete observing[listener2];
|
|
1794
|
+
if (Object.keys(observing).length === 0) {
|
|
1795
|
+
this.#the_mutation_observer?.disconnect();
|
|
1796
|
+
this.#the_mutation_observer = undefined;
|
|
1775
1797
|
}
|
|
1776
1798
|
}
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1799
|
+
#call_callbacks(callbacks, make_ev_data) {
|
|
1800
|
+
for (const callback of callbacks)(0, $8be08add28592faf$export$2b08e30396270f0b)(callback, new (0, $cb50cd7a49e824ee$export$ea60432919e69303)(make_ev_data(callback)));
|
|
1801
|
+
}
|
|
1802
|
+
#get(target, verb) {
|
|
1803
|
+
// @ts-ignore
|
|
1804
|
+
const is_listener = target.#listeners.includes(verb.slice(2));
|
|
1805
|
+
const is_verb = Object.keys(target.#verbs).includes(verb);
|
|
1806
|
+
if (is_verb) return target.#verbs[verb];
|
|
1807
|
+
else if (is_listener) return target.#add_listener(verb.slice(2));
|
|
1808
|
+
else throw new Error("Property " + verb + " is not valid. Valid listeners: " + target.#listeners.join(", ") + "; valid verbs: " + Object.keys(target.#verbs).join(", "));
|
|
1809
|
+
}
|
|
1810
|
+
constructor(options = {}){
|
|
1811
|
+
if (process.env.BUILD_TARGET !== "modern" && Proxy.toString().indexOf("[native code]") === -1) {
|
|
1812
|
+
this.#listeners.forEach((listener)=>this["on" + listener] = ()=>{}); // define listeners, needed for IE11 proxy polyfill
|
|
1813
|
+
Object.keys(this.#verbs).forEach((listener)=>this[listener] = ()=>{});
|
|
1814
|
+
}
|
|
1815
|
+
if (options.territory) this.#territory = options.territory;
|
|
1816
|
+
return this.#self_proxied = new Proxy(this, {
|
|
1817
|
+
get: this.#get
|
|
1818
|
+
});
|
|
1819
|
+
}
|
|
1820
|
+
}
|
|
1785
1821
|
|
|
1786
1822
|
|
|
1787
1823
|
|
|
1788
1824
|
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
let id = "";
|
|
1792
|
-
let localstorage_error;
|
|
1793
|
-
let cookie_error;
|
|
1825
|
+
const $0b48ba2f40ce6067$export$b6ae1bc530f4c149 = /*@__PURE__*/ $0b48ba2f40ce6067$var$make_default_observer();
|
|
1826
|
+
function $0b48ba2f40ce6067$var$make_default_observer() {
|
|
1794
1827
|
try {
|
|
1795
|
-
|
|
1796
|
-
} catch (
|
|
1797
|
-
(0, $b04e44fad5ea42c7$export$f18d5b0af29128b7)(
|
|
1798
|
-
|
|
1828
|
+
return new (0, $cdca9fea6eb103e5$export$12e07a2a9f87578a)();
|
|
1829
|
+
} catch (error) {
|
|
1830
|
+
(0, $b04e44fad5ea42c7$export$f18d5b0af29128b7)([
|
|
1831
|
+
error,
|
|
1832
|
+
"error starting ElementObserver"
|
|
1833
|
+
], "error");
|
|
1799
1834
|
}
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1835
|
+
}
|
|
1836
|
+
|
|
1837
|
+
|
|
1838
|
+
|
|
1839
|
+
|
|
1840
|
+
function $0bdb8dbcf1bc7f34$export$925772df9b4d16e5(url, param, value) {
|
|
1841
|
+
const url_object = new URL(url), search_params = new URLSearchParams(url_object.search);
|
|
1842
|
+
search_params.set(param, value);
|
|
1843
|
+
return url_object.origin + url_object.pathname + "?" + search_params.toString();
|
|
1844
|
+
}
|
|
1845
|
+
function $0bdb8dbcf1bc7f34$export$785f04709990c4ec(element, selector) {
|
|
1846
|
+
let result = null;
|
|
1847
|
+
while(!result && element){
|
|
1848
|
+
element = element?.parentNode;
|
|
1849
|
+
result = element?.querySelector(selector) || (element?.matches ? element.matches(selector) ? element : null : null);
|
|
1850
|
+
}
|
|
1851
|
+
return result;
|
|
1852
|
+
}
|
|
1853
|
+
function $0bdb8dbcf1bc7f34$export$44951404cb8d0583(html) {
|
|
1854
|
+
// need to wrap the HTML into a <body> tag because the browser otherwise automatically puts <style> into head and we can't return it
|
|
1855
|
+
return new DOMParser().parseFromString(`<body>${html}</body>`, "text/html")?.body?.childNodes;
|
|
1856
|
+
}
|
|
1857
|
+
function $0bdb8dbcf1bc7f34$export$d3e2a0560cbf4787(html) {
|
|
1858
|
+
return new DOMParser().parseFromString(`<body>${html}</body>`, "text/html")?.body?.firstElementChild;
|
|
1859
|
+
}
|
|
1860
|
+
function $0bdb8dbcf1bc7f34$export$d4bd03f19260ef1c(url, also_onchange = false, override_dev_url = "demo.depict.ai", stfu = true, also_in_all_shadow_roots = false) {
|
|
1861
|
+
if (process.env.DEBUG === "true" && location.href.includes(override_dev_url)) {
|
|
1862
|
+
const relativ_callback = (0, $b04e44fad5ea42c7$export$b3bbfd758f11cfa9)((event)=>{
|
|
1863
|
+
const anchor = event.element;
|
|
1864
|
+
if (typeof url === "string") {
|
|
1865
|
+
if (anchor.href.includes(url)) {
|
|
1866
|
+
if (!stfu) (0, $649f456f663da9fc$export$de56f1198d121036)("RUNNING RELATIVIFY on", event);
|
|
1867
|
+
anchor.href = anchor.href.replaceAll(url, "/");
|
|
1868
|
+
}
|
|
1869
|
+
} else if (url.test(anchor.href)) {
|
|
1870
|
+
if (!stfu) (0, $649f456f663da9fc$export$de56f1198d121036)("RUNNING RELATIVIFY on", event);
|
|
1871
|
+
anchor.href = anchor.href.replace(url, "/");
|
|
1812
1872
|
}
|
|
1813
|
-
} catch (e) {
|
|
1814
|
-
(0, $b04e44fad5ea42c7$export$f18d5b0af29128b7)(e, "warning");
|
|
1815
|
-
cookie_error = e;
|
|
1816
|
-
}
|
|
1817
|
-
(0, $eba382943196079c$export$af2e17a20c2ea3c5).withScope(function(scope) {
|
|
1818
|
-
scope.setExtra("id", id);
|
|
1819
|
-
scope.setExtra("ls_error", localstorage_error);
|
|
1820
|
-
scope.setExtra("cookie_error", cookie_error);
|
|
1821
|
-
scope.setLevel("error");
|
|
1822
|
-
this.captureMessage(`${id ? "localStorage" : "cookie and localStorage"} failed to hold a value!`);
|
|
1823
1873
|
});
|
|
1874
|
+
const link_sel = "a[href]";
|
|
1875
|
+
(0, $0b48ba2f40ce6067$export$b6ae1bc530f4c149).onexists(link_sel, relativ_callback);
|
|
1876
|
+
if (also_onchange) (0, $0b48ba2f40ce6067$export$b6ae1bc530f4c149).onchange(link_sel, relativ_callback);
|
|
1877
|
+
if (also_in_all_shadow_roots && typeof ShadowRoot == "function") (0, $0b48ba2f40ce6067$export$b6ae1bc530f4c149).onexists("*", (0, $b04e44fad5ea42c7$export$b3bbfd758f11cfa9)(({ element: element })=>{
|
|
1878
|
+
if (element?.shadowRoot instanceof ShadowRoot) {
|
|
1879
|
+
const local_observer = new (0, $cdca9fea6eb103e5$export$12e07a2a9f87578a)({
|
|
1880
|
+
territory: element.shadowRoot
|
|
1881
|
+
});
|
|
1882
|
+
local_observer.onexists(link_sel, relativ_callback);
|
|
1883
|
+
}
|
|
1884
|
+
}));
|
|
1824
1885
|
}
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
// Compatability mapping - TODO: refactor & remove
|
|
1849
|
-
tenant: vars?.TENANT,
|
|
1850
|
-
market: vars?.MARKET,
|
|
1851
|
-
entity_price: vars?.sale_price,
|
|
1852
|
-
...vars
|
|
1886
|
+
}
|
|
1887
|
+
function $0bdb8dbcf1bc7f34$export$5e63aea0cac01fa0(elements, selector) {
|
|
1888
|
+
const matches = [];
|
|
1889
|
+
for (const element of elements){
|
|
1890
|
+
if ("querySelectorAll" in element) matches.push(...(0, $39ef887981612535$export$33f937d741e49339)(element, selector));
|
|
1891
|
+
if ("matches" in element && element.matches?.(selector)) matches.push(element);
|
|
1892
|
+
}
|
|
1893
|
+
return matches;
|
|
1894
|
+
}
|
|
1895
|
+
function $0bdb8dbcf1bc7f34$export$cfef5d5c9ac09253(price, places_after_comma = 2, decimal_delimiter = ",", thousands_delimiter = String.fromCharCode(160) // Non-breaking space ( )
|
|
1896
|
+
) {
|
|
1897
|
+
if (!price && price !== 0) return "";
|
|
1898
|
+
if (typeof price === "string") {
|
|
1899
|
+
if (!isNaN(price)) {
|
|
1900
|
+
(0, $b04e44fad5ea42c7$export$f18d5b0af29128b7)(new Error("standard_price_format did not expect price as a string"), "warning", {
|
|
1901
|
+
price: price
|
|
1902
|
+
});
|
|
1903
|
+
price = parseFloat(price);
|
|
1904
|
+
} else {
|
|
1905
|
+
(0, $b04e44fad5ea42c7$export$f18d5b0af29128b7)(new Error("standard_price_format cannot handle price string"), "error", {
|
|
1906
|
+
price: price
|
|
1907
|
+
});
|
|
1908
|
+
return "";
|
|
1853
1909
|
}
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
if (
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
);
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
);
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
if (
|
|
1873
|
-
return
|
|
1874
|
-
...vars,
|
|
1875
|
-
type: "add_to_cart"
|
|
1876
|
-
});
|
|
1877
|
-
});
|
|
1878
|
-
function $43683b1103edab15$export$622991c71a1f52b3(cookie_name) {
|
|
1879
|
-
// https://stackoverflow.com/a/25490531
|
|
1880
|
-
return document.cookie.match("(^|;)\\s*" + cookie_name + "\\s*=\\s*([^;]+)")?.pop() || "";
|
|
1910
|
+
}
|
|
1911
|
+
if (places_after_comma == "auto") places_after_comma = price % 1 ? 2 : 0;
|
|
1912
|
+
const fixed = places_after_comma < 0 ? price.toString().split(".") : price.toFixed(places_after_comma).split("."), [...chars] = fixed[0], reversed = chars.reverse();
|
|
1913
|
+
let j, reversed_formatted = [];
|
|
1914
|
+
for(let i = 0; i < reversed.length; i++)if (!(i % 3)) j = reversed_formatted.push([
|
|
1915
|
+
reversed[i]
|
|
1916
|
+
]) - 1;
|
|
1917
|
+
else reversed_formatted[j].push(reversed[i]);
|
|
1918
|
+
fixed[0] = reversed_formatted.map((v)=>v.reverse().join("")).reverse().join(thousands_delimiter);
|
|
1919
|
+
return fixed.join(decimal_delimiter);
|
|
1920
|
+
}
|
|
1921
|
+
function $0bdb8dbcf1bc7f34$export$f124e3ee16e6b45d(bcp47_country_code, number, numberformat_options) {
|
|
1922
|
+
const numfmt = window?.Intl?.NumberFormat;
|
|
1923
|
+
if (numfmt) return new numfmt(bcp47_country_code, numberformat_options)?.format?.(number);
|
|
1924
|
+
return $0bdb8dbcf1bc7f34$export$cfef5d5c9ac09253(number, "auto");
|
|
1925
|
+
}
|
|
1926
|
+
function $0bdb8dbcf1bc7f34$export$9590700a594aef08(obj, step1, ...path) {
|
|
1927
|
+
if (typeof obj[step1] === "undefined") obj[step1] = {};
|
|
1928
|
+
if (path.length) return $0bdb8dbcf1bc7f34$export$9590700a594aef08(obj[step1], ...path);
|
|
1929
|
+
else return obj[step1];
|
|
1881
1930
|
}
|
|
1882
1931
|
|
|
1883
1932
|
|
|
1884
1933
|
|
|
1885
1934
|
|
|
1935
|
+
|
|
1936
|
+
|
|
1937
|
+
|
|
1938
|
+
|
|
1886
1939
|
// https://stackoverflow.com/a/39941616
|
|
1887
1940
|
function $bb3252f70898acd6$var$invert_promise(promise) {
|
|
1888
1941
|
return new Promise((res, rej)=>promise.then(rej, res));
|
|
@@ -7345,14 +7398,6 @@ async function $78270f2ea7ca229f$export$2dd69958012e3e49({ override_rec_renderer
|
|
|
7345
7398
|
|
|
7346
7399
|
|
|
7347
7400
|
|
|
7348
|
-
function $9e268c1aeeb86b34$export$c50e1901e8ed0615(callback) {
|
|
7349
|
-
// https://stackoverflow.com/a/61574326
|
|
7350
|
-
const channel = new MessageChannel();
|
|
7351
|
-
channel.port1.onmessage = (0, $b04e44fad5ea42c7$export$b3bbfd758f11cfa9)(callback);
|
|
7352
|
-
channel.port2.postMessage("");
|
|
7353
|
-
}
|
|
7354
|
-
|
|
7355
|
-
|
|
7356
7401
|
|
|
7357
7402
|
|
|
7358
7403
|
|
|
@@ -8783,4 +8828,4 @@ function $b828952b0fe1df8f$export$98c2b3491e76c1f(R8bit, G8bit, B8bit) {
|
|
|
8783
8828
|
(0, $f564adbc4675ceaf$export$2cefb7e61fcbae00)("utilishared", (0, $0766c85d387a9765$export$83d89fbfd8236492));
|
|
8784
8829
|
|
|
8785
8830
|
|
|
8786
|
-
export {$f564adbc4675ceaf$export$60d1d0e3cfc8b9ed as version_info, $f564adbc4675ceaf$export$fe609f0216e4ebef as add_version_query_params, $a1c80794e6bf4cc2$export$6e7454c733fa1fb2 as cache_args, $66b898e9bfcef532$export$8582cf3716962dc2 as check_displays, $7547e32486a3abc0$export$8048b892d651b310 as err, $b55a70757989faf4$export$16d7c76794a38a4 as require_event_listener, $ea554f5a28904975$export$41de2959a8dd405d as Auto_GWVM, $f1396aa84761fbe5$export$c83d8da642b5104a as GWVM_Renderer, $92b7ea2cf75c4aec$export$55621c1ce3cd536b as infinite_promise_creator, $09ff985c7c424fb3$export$32ccf3a614c84258 as infinite_promise_no_skip, $075589a94064cf2e$export$c0a4d29bc45a38c6 as infinite_renderer, $efda45906c6cbac7$export$9eae832ae57fbf as deprecated_insert_styling, $a40013fcba50c9ee$export$47340c0b196bc0f8 as get_market_locale, $a40013fcba50c9ee$export$c5b68ecd5c37aa6c as get_market_currency, $a40013fcba50c9ee$export$6eea148df5c7117c as MARKET_MAP, $e867e2f1fb3bcc09$export$c7187bbd1a7a9244 as placeholder, $7e2d59b061c2c528$export$cab8bc58c64c2013 as Pro_Slider, $51bbc74e39f5e5c6$export$2e2bcd8739ae039 as simplified_template_tool, $762a881271a51d1b$export$f1b8b9fd75ddcab1 as insert_styling_into_slider, $e61f371a9bcdeb2f$export$cd12721587f4f16d as RR_Slider, $366fff12da348e66$export$1a8782481a9af507 as Depict, $f494377581cfb2b4$export$30933c637c977eef as get_recs_with_template, $f494377581cfb2b4$export$c410ce1205e5118a as default_post_processor, $f494377581cfb2b4$export$4f39078bdc72ecd0 as default_pre_processor, $acf11540344875ed$export$2e2bcd8739ae039 as wpff, $cdca9fea6eb103e5$export$12e07a2a9f87578a as ElementObserver, $0b48ba2f40ce6067$export$b6ae1bc530f4c149 as observer, $63cbb5de51d11596$export$34b9dba7ce09269b as jsx, $63cbb5de51d11596$export$25062201e9e25d76 as jsxs, $b9b0dba897847b2a$export$eb0b9ed911409b57 as use_element, $b9b0dba897847b2a$export$f63fcc839cb0f734 as use_listener, $b9b0dba897847b2a$export$22a65337c1b43b1f as classlist, $649f456f663da9fc$export$de56f1198d121036 as dlog, $649f456f663da9fc$export$997143d41f6a0c9b as derror, $649f456f663da9fc$export$c2363754d4758444 as dwarn, $649f456f663da9fc$export$2dd75a6b038dc8cb as set_browser_prefix, $b04e44fad5ea42c7$export$b3bbfd758f11cfa9 as catchify, $b04e44fad5ea42c7$export$f18d5b0af29128b7 as report, $571bce04eb920cd8$export$55fe61489d2c7417 as is_debug, $ca66c9553e84df02$export$6038895ac52bd044 as chevronLeft, $ca66c9553e84df02$export$dc84183312f0c201 as chevronRight, $9a744f57ab06c32e$export$68c017fd93791405 as expandingContainer, $b83068cbd26dcc41$export$3be7054c61590ee3 as Lazyfier, $b83068cbd26dcc41$export$b87d7e0da8b5cbe3 as test_array_proxy_support, $ef9394fafebd5eab$export$692b27c28639e5b9 as Amazing_Slider, $893f9af5dbae6bc8$export$16501883f477737a as colorize_elements, $893f9af5dbae6bc8$export$deca40f48c0569f8 as should_colorizeLogics, $6be99244fa573db5$export$50ce83ace0cdd87e as default_rr, $2d47b009af5bc0a4$export$1bc0df10745d5412 as fetch_recs, $2d47b009af5bc0a4$export$d40679eb4cf32f09 as fetch_recs_whole_response, $5cbe24d064a033ed$export$c42139a43c877ecd as clone_deep, $5cbe24d064a033ed$export$e0009e7da572f99b as regex_templating, $5cbe24d064a033ed$export$a9fc160c5ed83bd7 as Rec_Renderer, $30e801eaa3dc319e$export$17c3166a7ebd4688 as n_col_styling_with_dist, $30e801eaa3dc319e$export$c84671f46d6a1ca as Layout, $090b8182afa1b2a6$export$b0a773486c1c2312 as RecommendationGrid, $30f78542ed78cd31$export$82cfdc85a4d15688 as RecommendationSlider, $c1503704e45e6a15$export$6830ae1fbe21e589 as default_click_tracking, $c1503704e45e6a15$export$f37c58ab3d3e3b75 as default_view_tracking, $c1503704e45e6a15$export$dd32cb565eae0a1f as ga_click, $c1503704e45e6a15$export$8d72437623fef90c as gtag_click_post_processor, $c1503704e45e6a15$export$1bffac19f9f0d6fc as gtag_view_post_processor, $c1503704e45e6a15$export$e9106d6e723510d2 as depict_click_tracking_post_processor, $c1503704e45e6a15$export$fb9afe9f540ae069 as recs_inserted_tracking, $c1503704e45e6a15$export$32eb5dd18e963410 as add_to_localstorage, $c1503704e45e6a15$export$9e1caada6901f552 as depict_page_view, $be40b7bf11a47cc4$export$8cbd8aa1c70f9a13 as slider_autoscroll_factory, $d31b48b85102c1ec$export$80039a49055269fb as make_button1, $a75adf1478c4522f$export$af88b4929c2dc86 as make_button2, $2436f68ea927d4a8$export$1d17a045bcc711b1 as slider_dots_factory, $2436f68ea927d4a8$export$a09282b33e69b43f as navdot, $9bb2400c4e2e9335$export$411b0f20794697ce as slider_draggable_factory, $1ce2ae6f640f393f$export$5129719c04a52f8c as slider_fading_factory, $52292921bc0fc31f$export$5723caf9a8335aa6 as slider_fractional_factory, $f78bc6a06402a6cf$export$93223e488e7ee078 as slider_show_scroll, $06fe260f91efff62$export$b36d2489a5a16728 as slider_snap_css, $06fe260f91efff62$export$49b950309ab787ad as can_use_snapping_and_still_scroll, $40bfd400d76a6ec1$export$dac64fd35a4805a4 as slider_snapping_factory, $c33c6faf8acc7442$export$68babfc5be0de5da as Amazing_Lazy_Slider, $556d9c321900f1d4$export$53306504b987cbf7 as slider_wraparound_factory, $159237486410355f$export$419f84efad7d9fe as sizes_to_surface, $159237486410355f$export$417ef0ab13d8b984 as surface_mixer, $159237486410355f$export$be95cb0e8cfd099e as promise_until_next_navigation, $d4ffde0b9fca0369$export$29a6094e0bd8bc5f as AIO, $d4ffde0b9fca0369$export$6ebd242c09192cec as paint_red, $91b2e49f92ed636c$export$2c34560c3749dc63 as bind_to_a2c_button, $91b2e49f92ed636c$export$82a685f2da2fb027 as bind_tracking_to_link, $43683b1103edab15$export$336e7ad40bae0652 as set_depict_id_fn, $43683b1103edab15$export$8a96793bf9f87d90 as set_user_id_fn, $43683b1103edab15$export$6399bdb2291895e0 as get_depict_id, $43683b1103edab15$export$adc61a405a4cabed as get_user_id, $43683b1103edab15$export$15f8a0cd5a8c0ebb as depict_click, $43683b1103edab15$export$82badda1f9923310 as depict_prefilled, $43683b1103edab15$export$9028351cb994757e as depict_add_to_cart, $43683b1103edab15$export$93ae15b1ae509334 as set_session_id_fn, $43683b1103edab15$export$61e7e1f11e96692f as get_session_id, $43683b1103edab15$export$622991c71a1f52b3 as get_cookie, $43683b1103edab15$export$8c6f26a5b6921b95 as get_tracking_event_context_data, $cafa1ff1049985c2$export$72036d950e1fae95 as filter_depict_payload, $cafa1ff1049985c2$export$28cacbd9b4306ffc as send_depict, $cafa1ff1049985c2$export$cc3b6ddf805f6156 as foolproof_send_beacon, $cafa1ff1049985c2$export$608478473a3304a0 as send_depict_unfiltered, $cafa1ff1049985c2$export$aa26019042811d4f as send_websocket, $42bbbba8196bd057$export$674d8cd8b6868154 as create_ga_queue, $42bbbba8196bd057$export$edfedd0557ca5a2d as make_tracker_send_to_depict, $3abef00489070e23$export$1ff14fec60ed5697 as ga_to_transaction_api, $c749fe63b72056ef$export$f75172d2e289cd02 as send_ga, $c749fe63b72056ef$export$ac7296527cb52311 as setup_ga, $c749fe63b72056ef$export$d031e55ccd4c52dc as setup_gtag, $c749fe63b72056ef$export$f522672c9379e339 as gtag_click, $c749fe63b72056ef$export$bf205937e5e012cb as ga_purchase_click, $c749fe63b72056ef$export$127751e82111fcf as ga_rec_click, $c749fe63b72056ef$export$7babcd5d4056b2ca as gtag_view, $c749fe63b72056ef$export$f3354ec2ce95ebd9 as load_gtag, $ccf918da074d7243$export$4205dc6835bc0d9f as send_impression_event, $21285393646b9849$export$37125ccc5dd98050 as impression_track_element, $405969d60b37fdac$export$d0efd8ed14f5c33 as impression_tracking_post_processor, $ccf918da074d7243$export$c543ee4cdb0d0964 as set_impression_threshold, $ccf918da074d7243$export$135da44d0ba958bc as impression_threshold, $ccf918da074d7243$export$ca8321ea61dc2544 as has_to_be_intersecting_for, $61b3c9e5f2cf8171$export$58c56fe2313fdbe3 as add_new_tab_listener, $61b3c9e5f2cf8171$export$836f70a28c317905 as broadcast_product_id, $61b3c9e5f2cf8171$export$8f66c4c7fb96eda2 as contextmenu_callback, $5dbacdc6a3feeb15$export$7e4427e80d5fc619 as optanon_get_cookie_ipns, $5dbacdc6a3feeb15$export$f0f6c846d96fdbec as init_optanon_tracking, $5dbacdc6a3feeb15$export$1dd9ce50e201eff1 as optanon_get_consent, $5dbacdc6a3feeb15$export$7a6d436e0782c6ed as optanon_wait_for_consent, $847e4a06ea6767c0$export$1ac466d53a6636ac as send_transaction_id_to_depict, $847e4a06ea6767c0$export$b11248fa13a8a86c as datalayer_transaction_id_extractor, $847e4a06ea6767c0$export$3ebd86018b39d9d2 as orderpage_transaction_id_extractor, $847e4a06ea6767c0$export$ff8673d5dea82bd4 as url_transaction_id_extractor, $54793663e06a1437$export$d63b08f4f29ddba5 as send_product_unavailable_to_depict, $aa0140679dc70b7a$export$eee4c4d924348b05 as send_page_view_if_needed, $aa0140679dc70b7a$export$f7cb1bd47199ec38 as send_page_view_on_navigation, $4ce764ddfee055ef$export$1d9c6fddbff3441f as DepictAPIWS, $2030306bed68a8c7$export$74108888f38788f3 as ListenableSet, $511123bb28a7b6f7$export$535946eb77c946dd as deparallelize, $511123bb28a7b6f7$export$f241be8e610f5c77 as deparallelize_no_drop, $9ab9ecb74920f343$export$f8ea2e7b15b5d129 as buildThresholdList, $1ce9aeebfbcb93f9$export$d9fdc6ce2907f95b as chaotic_closest, $0bdb8dbcf1bc7f34$export$cfef5d5c9ac09253 as standard_price_format, $0bdb8dbcf1bc7f34$export$9590700a594aef08 as ensure_object_path, $0bdb8dbcf1bc7f34$export$925772df9b4d16e5 as ensure_parameter_in_url, $0bdb8dbcf1bc7f34$export$44951404cb8d0583 as html2elems, $0bdb8dbcf1bc7f34$export$d3e2a0560cbf4787 as html2elem, $0bdb8dbcf1bc7f34$export$5e63aea0cac01fa0 as querySelectorAllElements, $0bdb8dbcf1bc7f34$export$785f04709990c4ec as querySelectorUpwards, $0bdb8dbcf1bc7f34$export$f124e3ee16e6b45d as intl_number_format_with_fallback, $0bdb8dbcf1bc7f34$export$d4bd03f19260ef1c as relativify, $d832040ef2097a0e$export$6b75200e58bc97d0 as deduplicate, $d832040ef2097a0e$export$9426572bd5645bc1 as dedup_products, $ead1f6ae93c69da9$export$82539d9817116aff as navigate_with_next_router, $802201ed0a316c43$export$774bc87373c4fc6c as add_item, $802201ed0a316c43$export$337197b94b3bd680 as get_items_in_cart, $802201ed0a316c43$export$783ef16647773b3d as get_shopify_analytics_meta_product, $802201ed0a316c43$export$ab0f802c05dd969b as intercept, $b6f5b218b1a73900$export$85be83e1935d93c2 as fetch_replacer, $b6f5b218b1a73900$export$f8da66bc4f1d059e as FakeResponse, $2d1ffbfaa1c2d9e3$export$bcd70d5ed1cf6313 as fetch_retry, $1813f33dd0fc7e1d$export$b404e20f3c4a490e as get_optimize_variant, $0d2acf276472ebf7$export$20e9533e68ee72e7 as stateless_href_change_ipns, $0d2acf276472ebf7$export$a9d39e43ae273d26 as href_change_ipns, $0d2acf276472ebf7$export$baccefee4a395d8f as history_replacer, $0d2acf276472ebf7$export$1cd22bab0d2c3b0b as on_next_navigation, $0d2acf276472ebf7$export$7500cdfd37aafd43 as instant_exec_on_suspect_history_change, $607fc90221d440a6$export$e806c6c1615a59ae as async_iterable_ipns, $607fc90221d440a6$export$10c3e52ef388b81b as make_ipns_stateful, $607fc90221d440a6$export$90740b5bc9c2b3b7 as make_ipns_stateless, $ec58be30798d6e95$export$3e42f5078e3abfc0 as make_simple_async_iterable, $ec58be30798d6e95$export$e2c811ae0eb35313 as RawObservableInformation, $4f24151f2cddad7b$export$2c2f50b30b7b2576 as iterable_to_attribute, $8c97019b5f7b0d0e$export$7c081fdbc65b6a2a as iterable_to_elems, $b8270fcf290bb3af$export$927664b47117acb0 as make_asyncIterable_exiter, $693e2a1517bef984$export$f8913c8a18f7ca21 as zip_async_iterables, $8bed543774ca0dd4$export$f811d2ce0aa6019b as insert_surfaces, $8bed543774ca0dd4$export$b8d1e1d07a3f3776 as prevent_infinite_loop, $8bed543774ca0dd4$export$e3f70ef7e3d00501 as revertable_remove, $0a581f1dfa083522$export$59ba1eb2c083f0cd as insert_styling, $0a581f1dfa083522$export$692b606677218a16 as depict_init, $0a581f1dfa083522$export$328e81c44cddf3c0 as depict_init_with_market_logic, $0a581f1dfa083522$export$a4f97b27a0592e6c as normal_get_product_id, $0a581f1dfa083522$export$a96c18473f2af463 as track_a2c, $29407d8301dc2f23$export$515c3ea4d599b05a as javascript_media_query, $39ef887981612535$export$33f937d741e49339 as patched_querySelectorAll, $78270f2ea7ca229f$export$a4eccf92efefa04d as placeholder_svg, $78270f2ea7ca229f$export$2dd69958012e3e49 as make_placeholder_rr, $78270f2ea7ca229f$export$3b75288f46cadd96 as random_text_placeholder, $bb3252f70898acd6$export$947a20746936143d as Promise_Any, $9e268c1aeeb86b34$export$c50e1901e8ed0615 as queueMacroTask, $d89638655e64f324$export$bb0a9c36cf454ea0 as rand, $460df8550f9d084d$export$656831b7e9c341c3 as random_string, $460df8550f9d084d$export$a6db784f019668ba as make_random_classname, $49c4fa2e27e642fa$export$3d04c40e7acc1a32 as reactive_template, $a79c7168700020ff$export$8ec5c86406f333ff as removeChild_error_swallowing_factory, $1dd4146ad893cfb2$export$38e89c688f9d553a as replace_promise_with_native_if_exists_and_enforce, $1dd4146ad893cfb2$export$e647444ed9403635 as get_iframe_promise, $bbb9f33eb5feb86a$export$2a1cc61cffa1f36f as rp_relativify_fetch, $bbb9f33eb5feb86a$export$f14a775632a826c4 as rp_relativify_history, $bbb9f33eb5feb86a$export$2a38b176ce969e2c as rp_relativify_xhr, $bbb9f33eb5feb86a$export$83ec13b10b391f13 as default_rp_fixes, $5c4afc453f904a1f$export$39d526a1194b6499 as serialize_object, $8d4dfadc5e12c7fb$export$12b4c6cbc6b8b4e4 as sort_obj, $eda086e0899e75b0$export$a422d714c8cb1a5d as standard_get_market, $e72f2f1d48dc3a53$export$3427ec8268623f1 as listenToLocalStorage, $26eaaddf434c84f1$export$8d42ce4827f43582 as Tenant, $55698e6e298abcb0$export$cd1adfb8059b5fcd as timeout_promise, $d0e7629fb3179e02$export$79f910a98828378d as variable_setter_to_ipns, $d0e7629fb3179e02$export$d5062f468a0454f3 as find_descriptor, $d0e7629fb3179e02$export$2fc1a072736ae2f6 as is_available_in, $690d8897acf7a743$export$a739d9a07da7f9ce as use_voyado_id, $2cbe7e0ca2ce5438$export$5c069c93d2b7493f as wait, $4a6ab5f7377729b1$export$f314addd5f976083 as xhr_load, $4a6ab5f7377729b1$export$8e16c51fd2b6507 as xhr_read_interceptor, $4a6ab5f7377729b1$export$c74578d2cd47a84a as xhr_send_interceptor, $4a6ab5f7377729b1$export$33d1643df63073a8 as xhr_replace, $769ce417b39aa7d3$export$4a3043e508dd72f0 as DefaultViewMoreButton, $cf7ca80454d7b4c0$export$8a0e4d6f6abf7e90 as GeneralSideSlidein, $72d170fd5c7cb3fe$export$c068ad5361be7646 as GeneralSizeSelector, $ad592d9ddbcffe72$export$84712d0562a614b8 as Placeholder, $ad592d9ddbcffe72$export$d613f5b6d0a331a8 as ContainedPlaceholderImage, $fbe64cf2cf408e4f$export$97f31f44c68c1d5 as RecommendationContainer, $7693290d077384da$export$ddd70fdae1b350e6 as LeftChevron, $7693290d077384da$export$32a55d57d151bc5a as RightChevron, $6f1582c15e13f2f0$export$590326cc34f49e2d as createColorPicker, $7f57d546b5d5b3d6$export$237455ad7e59d4e5 as useExpandingContainer, $8483d1d9fcee52ec$export$2369f6fc1c911576 as ContainedHoverImage, $914971fb43986a16$export$788756b42446dc2d as ContainedImage, $45af9e834781a9bc$export$f39a7d0667e924a as make_sizes_setter, $45af9e834781a9bc$export$a62825542f1bfcf5 as make_sourceset_component, $45af9e834781a9bc$export$a98fc8a2c818d3d8 as is_safari, $45af9e834781a9bc$export$f7c915448031deac as make_url_with_query_params, $45af9e834781a9bc$export$3d13beba9b52c947 as resize_base_url, $ec750a6d2c6eaa57$export$2624c5890f1bbcf7 as ArrowUp, $7ef13b49cbcd4a08$export$1c641004b5485fed as BackIcon, $ec770301d57afdae$export$3b621d86b1566b2 as CrossIcon, $655593feacb9828c$export$28f6150e232898de as FilterIcon, $62fd1a9c2195af77$export$8be2714ec7f169ee as GenericSliderArrowButton, $e29993023c5b77a4$export$cb808a3c41736d8e as MinusIcon, $7f7db0445af6c4b0$export$f21ab0717a89c77f as PlusIcon, $bac8989b3f4c29b2$export$5d2caaa6b530761c as PreviousSearchIcon, $26bcec40c802fcbf$export$82eafebb825fc23f as SearchIcon, $84b9f4594b6e2b53$export$da32f7add8a22e86 as SortIconAsc, $d2fe3fd446d52b45$export$d10e63059ddb9fd4 as SortIconDesc, $f5ca01afd4680bdd$export$f2ca6fc699ca1fb4 as TickIcon, $6c2b49f3f564b0d1$export$362abebb4b313340 as base_url, $eba382943196079c$export$af2e17a20c2ea3c5 as Sentry, $4d49697a7a9a77a6$export$9dc8f3a0aa3efc85 as camelCasifyObject, $4d49697a7a9a77a6$export$b481488de1caa85 as snakeCasifyObject, $b828952b0fe1df8f$export$499ef00a6a3417f8 as rgb_to_hsl, $b828952b0fe1df8f$export$e4fd3b61e79357a7 as hsl_to_rgb, $b828952b0fe1df8f$export$98c2b3491e76c1f as relative_luminance_from_rgb, $0766c85d387a9765$export$83d89fbfd8236492 as version, $f564adbc4675ceaf$export$2cefb7e61fcbae00 as add_to_version_info, $155540b3b8aca771$export$fce59460a1699957 as cookiebot_get_consent, $155540b3b8aca771$export$56c2e8be65fb14ae as cookiebot_wait_for_consent, $155540b3b8aca771$export$8827362e5e938d26 as cookiebot_get_cookie_ipns, $155540b3b8aca771$export$abec7fd9f0b9cc22 as init_cookiebot_tracking};
|
|
8831
|
+
export {$5ea3131c5e08d52e$export$a7e53ec3b3fdd030 as base64_decode_unicode, $5ea3131c5e08d52e$export$a1893782a2a6be0d as base64_encode_unicode, $f809bc98a1cb5f92$export$6f051469dd676a8b as make_plp_recommendations_inserted_handler, $f564adbc4675ceaf$export$60d1d0e3cfc8b9ed as version_info, $f564adbc4675ceaf$export$fe609f0216e4ebef as add_version_query_params, $a1c80794e6bf4cc2$export$6e7454c733fa1fb2 as cache_args, $66b898e9bfcef532$export$8582cf3716962dc2 as check_displays, $7547e32486a3abc0$export$8048b892d651b310 as err, $b55a70757989faf4$export$16d7c76794a38a4 as require_event_listener, $ea554f5a28904975$export$41de2959a8dd405d as Auto_GWVM, $f1396aa84761fbe5$export$c83d8da642b5104a as GWVM_Renderer, $92b7ea2cf75c4aec$export$55621c1ce3cd536b as infinite_promise_creator, $09ff985c7c424fb3$export$32ccf3a614c84258 as infinite_promise_no_skip, $075589a94064cf2e$export$c0a4d29bc45a38c6 as infinite_renderer, $efda45906c6cbac7$export$9eae832ae57fbf as deprecated_insert_styling, $a40013fcba50c9ee$export$47340c0b196bc0f8 as get_market_locale, $a40013fcba50c9ee$export$c5b68ecd5c37aa6c as get_market_currency, $a40013fcba50c9ee$export$6eea148df5c7117c as MARKET_MAP, $e867e2f1fb3bcc09$export$c7187bbd1a7a9244 as placeholder, $7e2d59b061c2c528$export$cab8bc58c64c2013 as Pro_Slider, $51bbc74e39f5e5c6$export$2e2bcd8739ae039 as simplified_template_tool, $762a881271a51d1b$export$f1b8b9fd75ddcab1 as insert_styling_into_slider, $e61f371a9bcdeb2f$export$cd12721587f4f16d as RR_Slider, $366fff12da348e66$export$1a8782481a9af507 as Depict, $f494377581cfb2b4$export$30933c637c977eef as get_recs_with_template, $f494377581cfb2b4$export$c410ce1205e5118a as default_post_processor, $f494377581cfb2b4$export$4f39078bdc72ecd0 as default_pre_processor, $acf11540344875ed$export$2e2bcd8739ae039 as wpff, $cdca9fea6eb103e5$export$12e07a2a9f87578a as ElementObserver, $0b48ba2f40ce6067$export$b6ae1bc530f4c149 as observer, $63cbb5de51d11596$export$34b9dba7ce09269b as jsx, $63cbb5de51d11596$export$25062201e9e25d76 as jsxs, $b9b0dba897847b2a$export$eb0b9ed911409b57 as use_element, $b9b0dba897847b2a$export$f63fcc839cb0f734 as use_listener, $b9b0dba897847b2a$export$22a65337c1b43b1f as classlist, $649f456f663da9fc$export$de56f1198d121036 as dlog, $649f456f663da9fc$export$997143d41f6a0c9b as derror, $649f456f663da9fc$export$c2363754d4758444 as dwarn, $649f456f663da9fc$export$2dd75a6b038dc8cb as set_browser_prefix, $b04e44fad5ea42c7$export$b3bbfd758f11cfa9 as catchify, $b04e44fad5ea42c7$export$f18d5b0af29128b7 as report, $571bce04eb920cd8$export$55fe61489d2c7417 as is_debug, $ca66c9553e84df02$export$6038895ac52bd044 as chevronLeft, $ca66c9553e84df02$export$dc84183312f0c201 as chevronRight, $9a744f57ab06c32e$export$68c017fd93791405 as expandingContainer, $b83068cbd26dcc41$export$3be7054c61590ee3 as Lazyfier, $b83068cbd26dcc41$export$b87d7e0da8b5cbe3 as test_array_proxy_support, $ef9394fafebd5eab$export$692b27c28639e5b9 as Amazing_Slider, $893f9af5dbae6bc8$export$16501883f477737a as colorize_elements, $893f9af5dbae6bc8$export$deca40f48c0569f8 as should_colorizeLogics, $6be99244fa573db5$export$50ce83ace0cdd87e as default_rr, $2d47b009af5bc0a4$export$1bc0df10745d5412 as fetch_recs, $2d47b009af5bc0a4$export$d40679eb4cf32f09 as fetch_recs_whole_response, $5cbe24d064a033ed$export$c42139a43c877ecd as clone_deep, $5cbe24d064a033ed$export$e0009e7da572f99b as regex_templating, $5cbe24d064a033ed$export$a9fc160c5ed83bd7 as Rec_Renderer, $30e801eaa3dc319e$export$17c3166a7ebd4688 as n_col_styling_with_dist, $30e801eaa3dc319e$export$c84671f46d6a1ca as Layout, $090b8182afa1b2a6$export$b0a773486c1c2312 as RecommendationGrid, $30f78542ed78cd31$export$82cfdc85a4d15688 as RecommendationSlider, $c1503704e45e6a15$export$6830ae1fbe21e589 as default_click_tracking, $c1503704e45e6a15$export$f37c58ab3d3e3b75 as default_view_tracking, $c1503704e45e6a15$export$dd32cb565eae0a1f as ga_click, $c1503704e45e6a15$export$8d72437623fef90c as gtag_click_post_processor, $c1503704e45e6a15$export$1bffac19f9f0d6fc as gtag_view_post_processor, $c1503704e45e6a15$export$e9106d6e723510d2 as depict_click_tracking_post_processor, $c1503704e45e6a15$export$fb9afe9f540ae069 as recs_inserted_tracking, $c1503704e45e6a15$export$32eb5dd18e963410 as add_to_localstorage, $c1503704e45e6a15$export$9e1caada6901f552 as depict_page_view, $be40b7bf11a47cc4$export$8cbd8aa1c70f9a13 as slider_autoscroll_factory, $d31b48b85102c1ec$export$80039a49055269fb as make_button1, $a75adf1478c4522f$export$af88b4929c2dc86 as make_button2, $2436f68ea927d4a8$export$1d17a045bcc711b1 as slider_dots_factory, $2436f68ea927d4a8$export$a09282b33e69b43f as navdot, $9bb2400c4e2e9335$export$411b0f20794697ce as slider_draggable_factory, $1ce2ae6f640f393f$export$5129719c04a52f8c as slider_fading_factory, $52292921bc0fc31f$export$5723caf9a8335aa6 as slider_fractional_factory, $f78bc6a06402a6cf$export$93223e488e7ee078 as slider_show_scroll, $06fe260f91efff62$export$b36d2489a5a16728 as slider_snap_css, $06fe260f91efff62$export$49b950309ab787ad as can_use_snapping_and_still_scroll, $40bfd400d76a6ec1$export$dac64fd35a4805a4 as slider_snapping_factory, $c33c6faf8acc7442$export$68babfc5be0de5da as Amazing_Lazy_Slider, $556d9c321900f1d4$export$53306504b987cbf7 as slider_wraparound_factory, $159237486410355f$export$419f84efad7d9fe as sizes_to_surface, $159237486410355f$export$417ef0ab13d8b984 as surface_mixer, $159237486410355f$export$be95cb0e8cfd099e as promise_until_next_navigation, $d4ffde0b9fca0369$export$29a6094e0bd8bc5f as AIO, $d4ffde0b9fca0369$export$6ebd242c09192cec as paint_red, $91b2e49f92ed636c$export$2c34560c3749dc63 as bind_to_a2c_button, $91b2e49f92ed636c$export$82a685f2da2fb027 as bind_tracking_to_link, $43683b1103edab15$export$336e7ad40bae0652 as set_depict_id_fn, $43683b1103edab15$export$8a96793bf9f87d90 as set_user_id_fn, $43683b1103edab15$export$6399bdb2291895e0 as get_depict_id, $43683b1103edab15$export$adc61a405a4cabed as get_user_id, $43683b1103edab15$export$15f8a0cd5a8c0ebb as depict_click, $43683b1103edab15$export$82badda1f9923310 as depict_prefilled, $43683b1103edab15$export$9028351cb994757e as depict_add_to_cart, $43683b1103edab15$export$93ae15b1ae509334 as set_session_id_fn, $43683b1103edab15$export$61e7e1f11e96692f as get_session_id, $43683b1103edab15$export$622991c71a1f52b3 as get_cookie, $43683b1103edab15$export$8c6f26a5b6921b95 as get_tracking_event_context_data, $cafa1ff1049985c2$export$72036d950e1fae95 as filter_depict_payload, $cafa1ff1049985c2$export$28cacbd9b4306ffc as send_depict, $cafa1ff1049985c2$export$cc3b6ddf805f6156 as foolproof_send_beacon, $cafa1ff1049985c2$export$608478473a3304a0 as send_depict_unfiltered, $cafa1ff1049985c2$export$aa26019042811d4f as send_websocket, $42bbbba8196bd057$export$674d8cd8b6868154 as create_ga_queue, $42bbbba8196bd057$export$edfedd0557ca5a2d as make_tracker_send_to_depict, $3abef00489070e23$export$1ff14fec60ed5697 as ga_to_transaction_api, $c749fe63b72056ef$export$f75172d2e289cd02 as send_ga, $c749fe63b72056ef$export$ac7296527cb52311 as setup_ga, $c749fe63b72056ef$export$d031e55ccd4c52dc as setup_gtag, $c749fe63b72056ef$export$f522672c9379e339 as gtag_click, $c749fe63b72056ef$export$bf205937e5e012cb as ga_purchase_click, $c749fe63b72056ef$export$127751e82111fcf as ga_rec_click, $c749fe63b72056ef$export$7babcd5d4056b2ca as gtag_view, $c749fe63b72056ef$export$f3354ec2ce95ebd9 as load_gtag, $ccf918da074d7243$export$4205dc6835bc0d9f as send_impression_event, $21285393646b9849$export$37125ccc5dd98050 as impression_track_element, $405969d60b37fdac$export$d0efd8ed14f5c33 as impression_tracking_post_processor, $ccf918da074d7243$export$c543ee4cdb0d0964 as set_impression_threshold, $ccf918da074d7243$export$135da44d0ba958bc as impression_threshold, $ccf918da074d7243$export$ca8321ea61dc2544 as has_to_be_intersecting_for, $61b3c9e5f2cf8171$export$58c56fe2313fdbe3 as add_new_tab_listener, $61b3c9e5f2cf8171$export$836f70a28c317905 as broadcast_product_id, $61b3c9e5f2cf8171$export$8f66c4c7fb96eda2 as contextmenu_callback, $5dbacdc6a3feeb15$export$7e4427e80d5fc619 as optanon_get_cookie_ipns, $5dbacdc6a3feeb15$export$f0f6c846d96fdbec as init_optanon_tracking, $5dbacdc6a3feeb15$export$1dd9ce50e201eff1 as optanon_get_consent, $5dbacdc6a3feeb15$export$7a6d436e0782c6ed as optanon_wait_for_consent, $847e4a06ea6767c0$export$1ac466d53a6636ac as send_transaction_id_to_depict, $847e4a06ea6767c0$export$b11248fa13a8a86c as datalayer_transaction_id_extractor, $847e4a06ea6767c0$export$3ebd86018b39d9d2 as orderpage_transaction_id_extractor, $847e4a06ea6767c0$export$ff8673d5dea82bd4 as url_transaction_id_extractor, $54793663e06a1437$export$d63b08f4f29ddba5 as send_product_unavailable_to_depict, $aa0140679dc70b7a$export$eee4c4d924348b05 as send_page_view_if_needed, $aa0140679dc70b7a$export$f7cb1bd47199ec38 as send_page_view_on_navigation, $4ce764ddfee055ef$export$1d9c6fddbff3441f as DepictAPIWS, $2030306bed68a8c7$export$74108888f38788f3 as ListenableSet, $511123bb28a7b6f7$export$535946eb77c946dd as deparallelize, $511123bb28a7b6f7$export$f241be8e610f5c77 as deparallelize_no_drop, $9ab9ecb74920f343$export$f8ea2e7b15b5d129 as buildThresholdList, $1ce9aeebfbcb93f9$export$d9fdc6ce2907f95b as chaotic_closest, $0bdb8dbcf1bc7f34$export$cfef5d5c9ac09253 as standard_price_format, $0bdb8dbcf1bc7f34$export$9590700a594aef08 as ensure_object_path, $0bdb8dbcf1bc7f34$export$925772df9b4d16e5 as ensure_parameter_in_url, $0bdb8dbcf1bc7f34$export$44951404cb8d0583 as html2elems, $0bdb8dbcf1bc7f34$export$d3e2a0560cbf4787 as html2elem, $0bdb8dbcf1bc7f34$export$5e63aea0cac01fa0 as querySelectorAllElements, $0bdb8dbcf1bc7f34$export$785f04709990c4ec as querySelectorUpwards, $0bdb8dbcf1bc7f34$export$f124e3ee16e6b45d as intl_number_format_with_fallback, $0bdb8dbcf1bc7f34$export$d4bd03f19260ef1c as relativify, $d832040ef2097a0e$export$6b75200e58bc97d0 as deduplicate, $d832040ef2097a0e$export$9426572bd5645bc1 as dedup_products, $ead1f6ae93c69da9$export$82539d9817116aff as navigate_with_next_router, $802201ed0a316c43$export$774bc87373c4fc6c as add_item, $802201ed0a316c43$export$337197b94b3bd680 as get_items_in_cart, $802201ed0a316c43$export$783ef16647773b3d as get_shopify_analytics_meta_product, $802201ed0a316c43$export$ab0f802c05dd969b as intercept, $b6f5b218b1a73900$export$85be83e1935d93c2 as fetch_replacer, $b6f5b218b1a73900$export$f8da66bc4f1d059e as FakeResponse, $2d1ffbfaa1c2d9e3$export$bcd70d5ed1cf6313 as fetch_retry, $1813f33dd0fc7e1d$export$b404e20f3c4a490e as get_optimize_variant, $0d2acf276472ebf7$export$20e9533e68ee72e7 as stateless_href_change_ipns, $0d2acf276472ebf7$export$a9d39e43ae273d26 as href_change_ipns, $0d2acf276472ebf7$export$baccefee4a395d8f as history_replacer, $0d2acf276472ebf7$export$1cd22bab0d2c3b0b as on_next_navigation, $0d2acf276472ebf7$export$7500cdfd37aafd43 as instant_exec_on_suspect_history_change, $607fc90221d440a6$export$e806c6c1615a59ae as async_iterable_ipns, $607fc90221d440a6$export$10c3e52ef388b81b as make_ipns_stateful, $607fc90221d440a6$export$90740b5bc9c2b3b7 as make_ipns_stateless, $ec58be30798d6e95$export$3e42f5078e3abfc0 as make_simple_async_iterable, $ec58be30798d6e95$export$e2c811ae0eb35313 as RawObservableInformation, $4f24151f2cddad7b$export$2c2f50b30b7b2576 as iterable_to_attribute, $8c97019b5f7b0d0e$export$7c081fdbc65b6a2a as iterable_to_elems, $b8270fcf290bb3af$export$927664b47117acb0 as make_asyncIterable_exiter, $693e2a1517bef984$export$f8913c8a18f7ca21 as zip_async_iterables, $8bed543774ca0dd4$export$f811d2ce0aa6019b as insert_surfaces, $8bed543774ca0dd4$export$b8d1e1d07a3f3776 as prevent_infinite_loop, $8bed543774ca0dd4$export$e3f70ef7e3d00501 as revertable_remove, $0a581f1dfa083522$export$59ba1eb2c083f0cd as insert_styling, $0a581f1dfa083522$export$692b606677218a16 as depict_init, $0a581f1dfa083522$export$328e81c44cddf3c0 as depict_init_with_market_logic, $0a581f1dfa083522$export$a4f97b27a0592e6c as normal_get_product_id, $0a581f1dfa083522$export$a96c18473f2af463 as track_a2c, $29407d8301dc2f23$export$515c3ea4d599b05a as javascript_media_query, $39ef887981612535$export$33f937d741e49339 as patched_querySelectorAll, $78270f2ea7ca229f$export$a4eccf92efefa04d as placeholder_svg, $78270f2ea7ca229f$export$2dd69958012e3e49 as make_placeholder_rr, $78270f2ea7ca229f$export$3b75288f46cadd96 as random_text_placeholder, $bb3252f70898acd6$export$947a20746936143d as Promise_Any, $9e268c1aeeb86b34$export$c50e1901e8ed0615 as queueMacroTask, $d89638655e64f324$export$bb0a9c36cf454ea0 as rand, $460df8550f9d084d$export$656831b7e9c341c3 as random_string, $460df8550f9d084d$export$a6db784f019668ba as make_random_classname, $49c4fa2e27e642fa$export$3d04c40e7acc1a32 as reactive_template, $a79c7168700020ff$export$8ec5c86406f333ff as removeChild_error_swallowing_factory, $1dd4146ad893cfb2$export$38e89c688f9d553a as replace_promise_with_native_if_exists_and_enforce, $1dd4146ad893cfb2$export$e647444ed9403635 as get_iframe_promise, $bbb9f33eb5feb86a$export$2a1cc61cffa1f36f as rp_relativify_fetch, $bbb9f33eb5feb86a$export$f14a775632a826c4 as rp_relativify_history, $bbb9f33eb5feb86a$export$2a38b176ce969e2c as rp_relativify_xhr, $bbb9f33eb5feb86a$export$83ec13b10b391f13 as default_rp_fixes, $5c4afc453f904a1f$export$39d526a1194b6499 as serialize_object, $8d4dfadc5e12c7fb$export$12b4c6cbc6b8b4e4 as sort_obj, $eda086e0899e75b0$export$a422d714c8cb1a5d as standard_get_market, $e72f2f1d48dc3a53$export$3427ec8268623f1 as listenToLocalStorage, $26eaaddf434c84f1$export$8d42ce4827f43582 as Tenant, $55698e6e298abcb0$export$cd1adfb8059b5fcd as timeout_promise, $d0e7629fb3179e02$export$79f910a98828378d as variable_setter_to_ipns, $d0e7629fb3179e02$export$d5062f468a0454f3 as find_descriptor, $d0e7629fb3179e02$export$2fc1a072736ae2f6 as is_available_in, $690d8897acf7a743$export$a739d9a07da7f9ce as use_voyado_id, $2cbe7e0ca2ce5438$export$5c069c93d2b7493f as wait, $4a6ab5f7377729b1$export$f314addd5f976083 as xhr_load, $4a6ab5f7377729b1$export$8e16c51fd2b6507 as xhr_read_interceptor, $4a6ab5f7377729b1$export$c74578d2cd47a84a as xhr_send_interceptor, $4a6ab5f7377729b1$export$33d1643df63073a8 as xhr_replace, $769ce417b39aa7d3$export$4a3043e508dd72f0 as DefaultViewMoreButton, $cf7ca80454d7b4c0$export$8a0e4d6f6abf7e90 as GeneralSideSlidein, $72d170fd5c7cb3fe$export$c068ad5361be7646 as GeneralSizeSelector, $ad592d9ddbcffe72$export$84712d0562a614b8 as Placeholder, $ad592d9ddbcffe72$export$d613f5b6d0a331a8 as ContainedPlaceholderImage, $fbe64cf2cf408e4f$export$97f31f44c68c1d5 as RecommendationContainer, $7693290d077384da$export$ddd70fdae1b350e6 as LeftChevron, $7693290d077384da$export$32a55d57d151bc5a as RightChevron, $6f1582c15e13f2f0$export$590326cc34f49e2d as createColorPicker, $7f57d546b5d5b3d6$export$237455ad7e59d4e5 as useExpandingContainer, $8483d1d9fcee52ec$export$2369f6fc1c911576 as ContainedHoverImage, $914971fb43986a16$export$788756b42446dc2d as ContainedImage, $45af9e834781a9bc$export$f39a7d0667e924a as make_sizes_setter, $45af9e834781a9bc$export$a62825542f1bfcf5 as make_sourceset_component, $45af9e834781a9bc$export$a98fc8a2c818d3d8 as is_safari, $45af9e834781a9bc$export$f7c915448031deac as make_url_with_query_params, $45af9e834781a9bc$export$3d13beba9b52c947 as resize_base_url, $ec750a6d2c6eaa57$export$2624c5890f1bbcf7 as ArrowUp, $7ef13b49cbcd4a08$export$1c641004b5485fed as BackIcon, $ec770301d57afdae$export$3b621d86b1566b2 as CrossIcon, $655593feacb9828c$export$28f6150e232898de as FilterIcon, $62fd1a9c2195af77$export$8be2714ec7f169ee as GenericSliderArrowButton, $e29993023c5b77a4$export$cb808a3c41736d8e as MinusIcon, $7f7db0445af6c4b0$export$f21ab0717a89c77f as PlusIcon, $bac8989b3f4c29b2$export$5d2caaa6b530761c as PreviousSearchIcon, $26bcec40c802fcbf$export$82eafebb825fc23f as SearchIcon, $84b9f4594b6e2b53$export$da32f7add8a22e86 as SortIconAsc, $d2fe3fd446d52b45$export$d10e63059ddb9fd4 as SortIconDesc, $f5ca01afd4680bdd$export$f2ca6fc699ca1fb4 as TickIcon, $6c2b49f3f564b0d1$export$362abebb4b313340 as base_url, $eba382943196079c$export$af2e17a20c2ea3c5 as Sentry, $4d49697a7a9a77a6$export$9dc8f3a0aa3efc85 as camelCasifyObject, $4d49697a7a9a77a6$export$b481488de1caa85 as snakeCasifyObject, $b828952b0fe1df8f$export$499ef00a6a3417f8 as rgb_to_hsl, $b828952b0fe1df8f$export$e4fd3b61e79357a7 as hsl_to_rgb, $b828952b0fe1df8f$export$98c2b3491e76c1f as relative_luminance_from_rgb, $0766c85d387a9765$export$83d89fbfd8236492 as version, $f564adbc4675ceaf$export$2cefb7e61fcbae00 as add_to_version_info, $155540b3b8aca771$export$fce59460a1699957 as cookiebot_get_consent, $155540b3b8aca771$export$56c2e8be65fb14ae as cookiebot_wait_for_consent, $155540b3b8aca771$export$8827362e5e938d26 as cookiebot_get_cookie_ipns, $155540b3b8aca771$export$abec7fd9f0b9cc22 as init_cookiebot_tracking};
|