@depict-ai/utilishared 1.0.35 → 1.0.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ES10/index.cjs +717 -719
- package/ES10/index.d.ts +1 -1
- package/ES10/index.js +717 -719
- package/latest/index.cjs +589 -589
- package/latest/index.d.ts +1 -1
- package/latest/index.js +589 -589
- package/package.json +2 -2
package/latest/index.cjs
CHANGED
|
@@ -272,7 +272,7 @@ $parcel$export(module.exports, "hex_to_rgb", () => $d73746ee466f09ca$export$ca30
|
|
|
272
272
|
$parcel$export(module.exports, "version", () => $815f67c61b4c0a42$export$83d89fbfd8236492);
|
|
273
273
|
$parcel$export(module.exports, "add_to_version_info", () => $e4a18bf12ad092d9$export$2cefb7e61fcbae00);
|
|
274
274
|
$parcel$export(module.exports, "edit_current_page_meta_tags", () => $8838e3e61b748a8b$export$ef73ea4f975745ba);
|
|
275
|
-
const $815f67c61b4c0a42$export$83d89fbfd8236492 = "1.0.
|
|
275
|
+
const $815f67c61b4c0a42$export$83d89fbfd8236492 = "1.0.37";
|
|
276
276
|
const $7b5e577a60b81e60$export$55fe61489d2c7417 = /*@__PURE__*/(() => process.env.STRIP_DEBUG === "true" ? false : process.env.DEBUG === "true" || process.env.NODE_ENV === "development" || process.env.BUILD_TARGET !== "node" && (globalThis?.document?.currentScript?.dataset?.debug === "true" || globalThis?.localStorage?.getItem?.("debug") === "true"))();
|
|
277
277
|
const $e6c6e7929ea385ae$var$browser_prefix_styling = "color: #fff;";
|
|
278
278
|
let $e6c6e7929ea385ae$var$browser_prefix = "[Depict]";
|
|
@@ -293,7 +293,7 @@ function $e6c6e7929ea385ae$export$997143d41f6a0c9b(...args) {
|
|
|
293
293
|
}
|
|
294
294
|
const $e4a18bf12ad092d9$export$60d1d0e3cfc8b9ed = {};
|
|
295
295
|
function $e4a18bf12ad092d9$export$2cefb7e61fcbae00(package_name, version) {
|
|
296
|
-
|
|
296
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("@depict-ai/" + package_name + " version", version);
|
|
297
297
|
$e4a18bf12ad092d9$export$60d1d0e3cfc8b9ed[package_name] = version;
|
|
298
298
|
}
|
|
299
299
|
function $e4a18bf12ad092d9$export$fe609f0216e4ebef(url) {
|
|
@@ -452,8 +452,8 @@ const $9a42a570de51ea3d$var$compat_layer_to_info = /*@__PURE__*/new WeakMap();
|
|
|
452
452
|
function $9a42a570de51ea3d$export$e806c6c1615a59ae(async_iterator_should_return_state_on_first_call = true, state_obj = new (0, $5a591e8156b1128c$export$e2c811ae0eb35313)()) {
|
|
453
453
|
// @ts-ignore
|
|
454
454
|
$9a42a570de51ea3d$var$on_async_iterator_next_called({}); // work around https://github.com/swc-project/swc/issues/5530
|
|
455
|
-
const ai =
|
|
456
|
-
const [exit, exitable] =
|
|
455
|
+
const ai = $5a591e8156b1128c$export$3e42f5078e3abfc0(state_obj);
|
|
456
|
+
const [exit, exitable] = $bbe52965151ee7f0$export$927664b47117acb0({
|
|
457
457
|
...ai
|
|
458
458
|
});
|
|
459
459
|
const obj = Object.assign(exitable, {
|
|
@@ -490,7 +490,7 @@ function $9a42a570de51ea3d$export$e806c6c1615a59ae(async_iterator_should_return_
|
|
|
490
490
|
yield* $9a42a570de51ea3d$var$on_async_iterator_next_called(exitable_for_async_generator, unblock_state_obj, fn => stock_return_function = fn);
|
|
491
491
|
};
|
|
492
492
|
const iterator = async_generator();
|
|
493
|
-
const [exit_async_generator, exitable_for_async_generator] =
|
|
493
|
+
const [exit_async_generator, exitable_for_async_generator] = $bbe52965151ee7f0$export$927664b47117acb0(orig_iterator);
|
|
494
494
|
// we can't use a normal async generator since it can't be "quit" from the outside (by calling .return on the AsyncIterator) while being awaited apparently
|
|
495
495
|
// therefore we make the async iterable that it's (soon) passing control onto exitable by calling .return() (even if a .next() promise is being currently awaited)
|
|
496
496
|
iterator.return = () => {
|
|
@@ -507,11 +507,11 @@ function $9a42a570de51ea3d$export$e806c6c1615a59ae(async_iterator_should_return_
|
|
|
507
507
|
};
|
|
508
508
|
}
|
|
509
509
|
const callable_obj_with_everything = Object.assign(ai, obj);
|
|
510
|
-
|
|
510
|
+
$3c19296ad7b20394$export$8df876135bad6d96(callable_obj_with_everything, "state", {
|
|
511
511
|
get: () => state_obj.last_processed_value_,
|
|
512
512
|
enumerable: true
|
|
513
513
|
});
|
|
514
|
-
|
|
514
|
+
$3c19296ad7b20394$export$8df876135bad6d96(callable_obj_with_everything, "latest_call_value", {
|
|
515
515
|
get: () => state_obj.queue_[state_obj.queue_.length - 1] ?? callable_obj_with_everything.state,
|
|
516
516
|
enumerable: true
|
|
517
517
|
});
|
|
@@ -557,7 +557,7 @@ function $9a42a570de51ea3d$export$10c3e52ef388b81b(ipns) {
|
|
|
557
557
|
return $9a42a570de51ea3d$export$e806c6c1615a59ae(true, internal_state_obj);
|
|
558
558
|
}
|
|
559
559
|
function $548fd58b14b25a52$export$8048b892d651b310(exception, error_for_stack) {
|
|
560
|
-
|
|
560
|
+
$e6c6e7929ea385ae$export$de56f1198d121036(exception);
|
|
561
561
|
if (0, $7b5e577a60b81e60$export$55fe61489d2c7417) /* eslint-disable no-console */console.trace();
|
|
562
562
|
if (process.env.BUILD_TARGET !== "node") {
|
|
563
563
|
const {
|
|
@@ -580,7 +580,7 @@ async function $e6d67ef355abb2dc$export$2fc1a072736ae2f6(obj, property, ...sub_o
|
|
|
580
580
|
}
|
|
581
581
|
async function $e6d67ef355abb2dc$var$wait_for_variable_in_object(variable, obj) {
|
|
582
582
|
const start = new Date().getTime();
|
|
583
|
-
|
|
583
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("waiting for definition of variable", variable, "in", obj);
|
|
584
584
|
let var_behind_the_scenes;
|
|
585
585
|
let resolve_variable_definition;
|
|
586
586
|
let was_defined = false;
|
|
@@ -608,9 +608,9 @@ async function $e6d67ef355abb2dc$var$wait_for_variable_in_object(variable, obj)
|
|
|
608
608
|
get: get,
|
|
609
609
|
set: set
|
|
610
610
|
});
|
|
611
|
-
|
|
611
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("everything's set up, waiting for promise by setter to resolve");
|
|
612
612
|
const result = await definition_of_var;
|
|
613
|
-
|
|
613
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Promise resolved, ", result, " is here. We waited", new Date().getTime() - start, "ms");
|
|
614
614
|
return result;
|
|
615
615
|
}
|
|
616
616
|
function $e6d67ef355abb2dc$export$d5062f468a0454f3(obj, prop) {
|
|
@@ -618,7 +618,7 @@ function $e6d67ef355abb2dc$export$d5062f468a0454f3(obj, prop) {
|
|
|
618
618
|
if (obj != null) return Object.hasOwnProperty.call(obj, prop) ? Object.getOwnPropertyDescriptor(obj, prop) : $e6d67ef355abb2dc$export$d5062f468a0454f3(Object.getPrototypeOf(obj), prop);
|
|
619
619
|
}
|
|
620
620
|
function $e6d67ef355abb2dc$export$79f910a98828378d(obj, variable, async_iterator_should_return_state_on_first_call) {
|
|
621
|
-
const definition_ipns =
|
|
621
|
+
const definition_ipns = $9a42a570de51ea3d$export$e806c6c1615a59ae(async_iterator_should_return_state_on_first_call);
|
|
622
622
|
let var_behind_the_scenes = obj[variable];
|
|
623
623
|
definition_ipns(var_behind_the_scenes); // resolve with initial value
|
|
624
624
|
const previous_descriptor = $e6d67ef355abb2dc$export$d5062f468a0454f3(obj, variable);
|
|
@@ -749,7 +749,7 @@ async function $0cf2ab65d8901485$var$load_sentry(TENANT, more_options = {}, extr
|
|
|
749
749
|
BrowserClient: BrowserClient,
|
|
750
750
|
Hub: Hub,
|
|
751
751
|
defaultIntegrations: defaultIntegrations
|
|
752
|
-
} = await
|
|
752
|
+
} = await $e6d67ef355abb2dc$export$2fc1a072736ae2f6(window, global_var_name);
|
|
753
753
|
delete window[global_var_name];
|
|
754
754
|
if (process.env.SENTRY_SAMPLE_RATE) {
|
|
755
755
|
const sample_rate = parseFloat(process.env.SENTRY_SAMPLE_RATE);
|
|
@@ -771,7 +771,7 @@ async function $0cf2ab65d8901485$var$load_sentry(TENANT, more_options = {}, extr
|
|
|
771
771
|
// https://github.com/getsentry/sentry-javascript/issues/2541
|
|
772
772
|
return hub;
|
|
773
773
|
}
|
|
774
|
-
const $61a34358bf0d3d8b$export$af2e17a20c2ea3c5 = !(process.env.SENTRY === "true" || process.env.DEPICT_ERROR_REPORTING === "true" || process.env.NEXT_PUBLIC_DEPICT_ERROR_REPORTING === "true") && (process.env.SENTRY === "false" || process.env.DEPICT_ERROR_REPORTING === "false" || process.env.NEXT_PUBLIC_DEPICT_ERROR_REPORTING === "false" || (0, $7b5e577a60b81e60$export$55fe61489d2c7417)) ? /*@__PURE__*/$61a34358bf0d3d8b$var$fakesentry() : /*@__PURE__
|
|
774
|
+
const $61a34358bf0d3d8b$export$af2e17a20c2ea3c5 = !(process.env.SENTRY === "true" || process.env.DEPICT_ERROR_REPORTING === "true" || process.env.NEXT_PUBLIC_DEPICT_ERROR_REPORTING === "true") && (process.env.SENTRY === "false" || process.env.DEPICT_ERROR_REPORTING === "false" || process.env.NEXT_PUBLIC_DEPICT_ERROR_REPORTING === "false" || (0, $7b5e577a60b81e60$export$55fe61489d2c7417)) ? /*@__PURE__*/$61a34358bf0d3d8b$var$fakesentry() : /*@__PURE__*/$0cf2ab65d8901485$export$2e2bcd8739ae039(process.env.TENANT || "unknown", undefined, (0, $e6c6e7929ea385ae$export$de56f1198d121036));
|
|
775
775
|
function $61a34358bf0d3d8b$var$fakesentry() {
|
|
776
776
|
// // source: https://docs.sentry.io/platforms/javascript/troubleshooting/#dealing-with-ad-blockers
|
|
777
777
|
// const handler = {
|
|
@@ -838,13 +838,13 @@ function $3f34dc07544c5857$export$bb0a9c36cf454ea0(min, max) {
|
|
|
838
838
|
function $41f528c04cc8a8da$export$535946eb77c946dd(the_function) {
|
|
839
839
|
let busy = false;
|
|
840
840
|
let current_promise;
|
|
841
|
-
return
|
|
841
|
+
return $268cbd9e4ade92db$export$b3bbfd758f11cfa9(async (...args) => {
|
|
842
842
|
// Double awaits to make sure that if busy is true, it must also be true two ticks later.
|
|
843
843
|
// This is a fix for when a promise that finalizes immediately is passed.
|
|
844
844
|
// For context: https://javascript.info/microtask-queue
|
|
845
845
|
if (!busy || !(await await busy, busy)) {
|
|
846
846
|
busy = true;
|
|
847
|
-
const to_finally =
|
|
847
|
+
const to_finally = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(the_function)(...args);
|
|
848
848
|
current_promise = to_finally.finally(() => busy = false);
|
|
849
849
|
}
|
|
850
850
|
return current_promise;
|
|
@@ -854,13 +854,13 @@ function $41f528c04cc8a8da$export$f241be8e610f5c77(the_function) {
|
|
|
854
854
|
let busy = false;
|
|
855
855
|
let queued;
|
|
856
856
|
let current_promise;
|
|
857
|
-
const wrapped_fn =
|
|
857
|
+
const wrapped_fn = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(async (...args) => {
|
|
858
858
|
// Double awaits to make sure that if busy is true, it must also be true two ticks later.
|
|
859
859
|
// This is a fix for when a promise that finalizes immediately is passed.
|
|
860
860
|
// For context: https://javascript.info/microtask-queue
|
|
861
861
|
if (!busy || !(await await busy, busy)) {
|
|
862
862
|
busy = true;
|
|
863
|
-
const to_finally =
|
|
863
|
+
const to_finally = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(the_function)(...args);
|
|
864
864
|
current_promise = to_finally.finally(() => {
|
|
865
865
|
busy = false;
|
|
866
866
|
if (queued) {
|
|
@@ -879,7 +879,7 @@ class $04a37742898e4bd5$export$32ccf3a614c84258 {
|
|
|
879
879
|
#internal_resolve;
|
|
880
880
|
#previous_promise = Promise.resolve();
|
|
881
881
|
promise = new Promise(r => this.#internal_resolve = r);
|
|
882
|
-
#work_queue_max_once =
|
|
882
|
+
#work_queue_max_once = $41f528c04cc8a8da$export$535946eb77c946dd(this.#work_queue.bind(this));
|
|
883
883
|
resolve = value => {
|
|
884
884
|
this.#values_to_resolve_with.push(value);
|
|
885
885
|
this.#work_queue_max_once();
|
|
@@ -907,7 +907,7 @@ class $d10801050840d92b$export$1b28bc5c68cc4d77 extends EventTarget {
|
|
|
907
907
|
#max_fails = 10;
|
|
908
908
|
#max_backoff_ms = $d10801050840d92b$var$ONE_MINUTE;
|
|
909
909
|
get #initial_reconnect_delay() {
|
|
910
|
-
return
|
|
910
|
+
return $3f34dc07544c5857$export$bb0a9c36cf454ea0(1, 1000);
|
|
911
911
|
}
|
|
912
912
|
#connect() {
|
|
913
913
|
this.current_socket = typeof window === "object" || typeof WebSocket === "function" ? new WebSocket(...this.#ws_constructor_options) : {
|
|
@@ -916,7 +916,7 @@ class $d10801050840d92b$export$1b28bc5c68cc4d77 extends EventTarget {
|
|
|
916
916
|
send: () => {}
|
|
917
917
|
};
|
|
918
918
|
this.#possible_events.forEach(name => {
|
|
919
|
-
this.current_socket.addEventListener(name,
|
|
919
|
+
this.current_socket.addEventListener(name, $268cbd9e4ade92db$export$b3bbfd758f11cfa9(original_event => {
|
|
920
920
|
let fixed_event;
|
|
921
921
|
if (!(original_event instanceof Event)) {
|
|
922
922
|
// 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
|
|
@@ -959,7 +959,7 @@ class $d10801050840d92b$export$1b28bc5c68cc4d77 extends EventTarget {
|
|
|
959
959
|
this.addEventListener(ev, e => {
|
|
960
960
|
// e can be MessageEvent | CloseEvent | ErrorEvent I think
|
|
961
961
|
const on_fn = this.#ons[ev];
|
|
962
|
-
if (typeof on_fn === "function")
|
|
962
|
+
if (typeof on_fn === "function") $268cbd9e4ade92db$export$b3bbfd758f11cfa9(on_fn).call(ev, e);
|
|
963
963
|
});
|
|
964
964
|
}
|
|
965
965
|
}
|
|
@@ -975,10 +975,10 @@ class $d10801050840d92b$export$1b28bc5c68cc4d77 extends EventTarget {
|
|
|
975
975
|
// 4100 means server thinks this is a scraper bot that's ignoring robots.txt
|
|
976
976
|
// @ts-ignore
|
|
977
977
|
if (error?.code === 4100) {
|
|
978
|
-
|
|
978
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Websocket connection rejected by server, won't reconnect", error);
|
|
979
979
|
return;
|
|
980
980
|
}
|
|
981
|
-
|
|
981
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Somehow the websocket died", error, "message:",
|
|
982
982
|
// @ts-ignore
|
|
983
983
|
error?.message, "code:",
|
|
984
984
|
// @ts-ignore
|
|
@@ -987,15 +987,15 @@ class $d10801050840d92b$export$1b28bc5c68cc4d77 extends EventTarget {
|
|
|
987
987
|
error?.reason, "reconnecting in", this.#try_again_in_ms);
|
|
988
988
|
await new Promise(r => {
|
|
989
989
|
// "race" the timeout and getting an https://developer.mozilla.org/en-US/docs/Web/API/Window/online_event by the browser
|
|
990
|
-
const handler =
|
|
990
|
+
const handler = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(ev => {
|
|
991
991
|
r();
|
|
992
|
-
|
|
992
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Retrying due to 'online' event", ev);
|
|
993
993
|
clearTimeout(timeout);
|
|
994
994
|
});
|
|
995
995
|
window.addEventListener("online", handler, {
|
|
996
996
|
once: true
|
|
997
997
|
});
|
|
998
|
-
const timeout = setTimeout(
|
|
998
|
+
const timeout = setTimeout($268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => {
|
|
999
999
|
this.#try_again_in_ms *= 1.5 + Math.random();
|
|
1000
1000
|
if (this.#try_again_in_ms > this.#max_backoff_ms) this.#try_again_in_ms = this.#max_backoff_ms * (1 + Math.random() / 10);
|
|
1001
1001
|
r();
|
|
@@ -1024,9 +1024,9 @@ class $d10801050840d92b$export$1b28bc5c68cc4d77 extends EventTarget {
|
|
|
1024
1024
|
if (max_backoff_ms) this.#max_backoff_ms = max_backoff_ms;
|
|
1025
1025
|
this.#setup_dot_on_event_support();
|
|
1026
1026
|
this.#connect();
|
|
1027
|
-
this.#ensure_connection().catch(e =>
|
|
1028
|
-
this.addEventListener("open",
|
|
1029
|
-
|
|
1027
|
+
this.#ensure_connection().catch(e => $268cbd9e4ade92db$export$f18d5b0af29128b7(e, "error"));
|
|
1028
|
+
this.addEventListener("open", $268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => {
|
|
1029
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Connection opened");
|
|
1030
1030
|
this.#try_again_in_ms = this.#initial_reconnect_delay; // reset exponential backoff
|
|
1031
1031
|
}));
|
|
1032
1032
|
}
|
|
@@ -1047,14 +1047,14 @@ class $d10801050840d92b$export$1d9c6fddbff3441f extends $d10801050840d92b$export
|
|
|
1047
1047
|
});
|
|
1048
1048
|
this.send(msg);
|
|
1049
1049
|
}
|
|
1050
|
-
#start_reconnection_if_offline_process =
|
|
1051
|
-
await new Promise(r => setTimeout(r, this.#reconnect_if_dead_for_ms +
|
|
1050
|
+
#start_reconnection_if_offline_process = $41f528c04cc8a8da$export$535946eb77c946dd(async () => {
|
|
1051
|
+
await new Promise(r => setTimeout(r, this.#reconnect_if_dead_for_ms + $3f34dc07544c5857$export$bb0a9c36cf454ea0(-2, 10)));
|
|
1052
1052
|
// 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
|
|
1053
1053
|
if (this.#messages_queued === 0) return;
|
|
1054
1054
|
const now = +new Date();
|
|
1055
1055
|
if (now - this.#connection_last_active > this.#reconnect_if_dead_for_ms) {
|
|
1056
1056
|
const reason = `No activity in ${this.#reconnect_if_dead_for_ms} ms`;
|
|
1057
|
-
|
|
1057
|
+
$e6c6e7929ea385ae$export$de56f1198d121036(reason, "reconnecting ws");
|
|
1058
1058
|
this.restart_ws(reason);
|
|
1059
1059
|
}
|
|
1060
1060
|
});
|
|
@@ -1074,7 +1074,7 @@ class $d10801050840d92b$export$1d9c6fddbff3441f extends $d10801050840d92b$export
|
|
|
1074
1074
|
// wait the correct delay
|
|
1075
1075
|
const resend_due_to_lost_message_timeout = setTimeout(
|
|
1076
1076
|
// this might actually never be needed and be from when Daniel didn't understand WebSockets as well
|
|
1077
|
-
|
|
1077
|
+
$268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => {
|
|
1078
1078
|
r(true);
|
|
1079
1079
|
this.removeEventListener("open", handler);
|
|
1080
1080
|
}), delay_to_next_send);
|
|
@@ -1092,7 +1092,7 @@ class $d10801050840d92b$export$1d9c6fddbff3441f extends $d10801050840d92b$export
|
|
|
1092
1092
|
this.increase_fails();
|
|
1093
1093
|
}
|
|
1094
1094
|
this.#messages_queued--;
|
|
1095
|
-
})().catch(e =>
|
|
1095
|
+
})().catch(e => $268cbd9e4ade92db$export$f18d5b0af29128b7(e, "error"));
|
|
1096
1096
|
return () => quit = true;
|
|
1097
1097
|
}
|
|
1098
1098
|
async ensure_sent(payload) {
|
|
@@ -1107,8 +1107,8 @@ class $d10801050840d92b$export$1d9c6fddbff3441f extends $d10801050840d92b$export
|
|
|
1107
1107
|
reply = JSON.parse(data);
|
|
1108
1108
|
} catch (e) {
|
|
1109
1109
|
const msg = "Got malformed message (ignoring, might cause memory leak)";
|
|
1110
|
-
|
|
1111
|
-
|
|
1110
|
+
$e6c6e7929ea385ae$export$de56f1198d121036(msg, data, e);
|
|
1111
|
+
$268cbd9e4ade92db$export$f18d5b0af29128b7([e, msg], "error", {
|
|
1112
1112
|
data: data
|
|
1113
1113
|
});
|
|
1114
1114
|
continue;
|
|
@@ -1120,9 +1120,9 @@ class $d10801050840d92b$export$1d9c6fddbff3441f extends $d10801050840d92b$export
|
|
|
1120
1120
|
if (status == "ack") {
|
|
1121
1121
|
stop_sending();
|
|
1122
1122
|
continue;
|
|
1123
|
-
} else if (status == "not-ok")
|
|
1124
|
-
if (process.env.BUILD_TARGET !== "node")
|
|
1125
|
-
} else
|
|
1123
|
+
} else if (status == "not-ok") $e6c6e7929ea385ae$export$c2363754d4758444("Got reply not-ok reply from server for event!", payload, reply);else if (status == "ok") {
|
|
1124
|
+
if (process.env.BUILD_TARGET !== "node") $e6c6e7929ea385ae$export$de56f1198d121036(`Successfully sent ${payload?.event?.type} (WS)`, payload, reply);
|
|
1125
|
+
} else $e6c6e7929ea385ae$export$c2363754d4758444("Strange reply from WSS server to", payload, ":", reply);
|
|
1126
1126
|
stop_sending();
|
|
1127
1127
|
return [reply, data];
|
|
1128
1128
|
}
|
|
@@ -1132,8 +1132,8 @@ class $d10801050840d92b$export$1d9c6fddbff3441f extends $d10801050840d92b$export
|
|
|
1132
1132
|
super(...params);
|
|
1133
1133
|
const option_retry_ms = params[2]?.initial_retry_ms;
|
|
1134
1134
|
if (option_retry_ms) this.#initial_retry_ms = option_retry_ms;
|
|
1135
|
-
this.addEventListener("message",
|
|
1136
|
-
["open", "error", "message"].forEach(event => this.addEventListener(event,
|
|
1135
|
+
this.addEventListener("message", $268cbd9e4ade92db$export$b3bbfd758f11cfa9(this.#msg_ipns.resolve));
|
|
1136
|
+
["open", "error", "message"].forEach(event => this.addEventListener(event, $268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => this.#connection_last_active = +new Date())));
|
|
1137
1137
|
}
|
|
1138
1138
|
}
|
|
1139
1139
|
|
|
@@ -1158,17 +1158,17 @@ const $0c84f8e99aac5765$export$72036d950e1fae95 = /*@__PURE__*/$0c84f8e99aac5765
|
|
|
1158
1158
|
const $0c84f8e99aac5765$export$aa26019042811d4f = /*@__PURE__*/$0c84f8e99aac5765$var$c(async bodies => {
|
|
1159
1159
|
if (process.env.DEPICT === "false") return;
|
|
1160
1160
|
for (let i = 0; i < bodies.length; i++) {
|
|
1161
|
-
const id =
|
|
1161
|
+
const id = $650b64c1b384c895$export$656831b7e9c341c3();
|
|
1162
1162
|
$0c84f8e99aac5765$var$ws_instance?.ensure_sent({
|
|
1163
1163
|
id: id,
|
|
1164
1164
|
event: bodies[i]
|
|
1165
|
-
}).catch(e =>
|
|
1165
|
+
}).catch(e => $268cbd9e4ade92db$export$f18d5b0af29128b7(e, "error"));
|
|
1166
1166
|
}
|
|
1167
1167
|
});
|
|
1168
1168
|
const $0c84f8e99aac5765$export$608478473a3304a0 = /*@__PURE__*/$0c84f8e99aac5765$var$c((payload, use_ws = true) => {
|
|
1169
1169
|
if (process.env.DEPICT === "false") return;
|
|
1170
1170
|
if (use_ws && typeof WebSocket == "function" && typeof $0c84f8e99aac5765$var$ws_instance?.ensure_sent == "function") {
|
|
1171
|
-
|
|
1171
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Sending to depict (ws)", payload);
|
|
1172
1172
|
return $0c84f8e99aac5765$export$aa26019042811d4f(payload);
|
|
1173
1173
|
}
|
|
1174
1174
|
const url = (0, $4c6861fbcd3a0611$export$362abebb4b313340) + "/create-events";
|
|
@@ -1177,19 +1177,19 @@ const $0c84f8e99aac5765$export$608478473a3304a0 = /*@__PURE__*/$0c84f8e99aac5765
|
|
|
1177
1177
|
const $0c84f8e99aac5765$export$cc3b6ddf805f6156 = /*@__PURE__*/$0c84f8e99aac5765$var$c((url, payload) => {
|
|
1178
1178
|
const payload_json = JSON.stringify(payload);
|
|
1179
1179
|
let success = false;
|
|
1180
|
-
|
|
1180
|
+
$e6c6e7929ea385ae$export$de56f1198d121036(`Attempting to send (beacon)`, payload);
|
|
1181
1181
|
try {
|
|
1182
1182
|
success = navigator.sendBeacon(url, new Blob([payload_json], {
|
|
1183
1183
|
type: "application/json"
|
|
1184
1184
|
}));
|
|
1185
1185
|
} catch (first_error) {
|
|
1186
|
-
|
|
1186
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Beacon has failed", first_error, "falling back to sending with wrong mime type which might work");
|
|
1187
1187
|
try {
|
|
1188
1188
|
success = navigator.sendBeacon(url, new Blob([payload_json], {
|
|
1189
1189
|
type: "application/x-www-form-urlencoded"
|
|
1190
1190
|
}));
|
|
1191
1191
|
} catch (e) {
|
|
1192
|
-
|
|
1192
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Beacon fallback has failed", e, "trying fetch");
|
|
1193
1193
|
fetch(url, {
|
|
1194
1194
|
"headers": {
|
|
1195
1195
|
"content-type": "application/json"
|
|
@@ -1198,7 +1198,7 @@ const $0c84f8e99aac5765$export$cc3b6ddf805f6156 = /*@__PURE__*/$0c84f8e99aac5765
|
|
|
1198
1198
|
"method": "POST",
|
|
1199
1199
|
"mode": "cors",
|
|
1200
1200
|
"credentials": "include"
|
|
1201
|
-
}).then(response => response.text()).then(text =>
|
|
1201
|
+
}).then(response => response.text()).then(text => $e6c6e7929ea385ae$export$de56f1198d121036("Beacon fallback fallback transmission result", text)).catch(fetch_error => {
|
|
1202
1202
|
(0, $61a34358bf0d3d8b$export$af2e17a20c2ea3c5).withScope(function (scope) {
|
|
1203
1203
|
scope.setExtra("stack", new Error().stack);
|
|
1204
1204
|
scope.setExtra("url", url);
|
|
@@ -1227,9 +1227,9 @@ let $e0a87646d12cb987$export$6399bdb2291895e0 = () => {
|
|
|
1227
1227
|
let localstorage_error;
|
|
1228
1228
|
let cookie_error;
|
|
1229
1229
|
try {
|
|
1230
|
-
id = localStorage._dep_id ||=
|
|
1230
|
+
id = localStorage._dep_id ||= $650b64c1b384c895$export$656831b7e9c341c3();
|
|
1231
1231
|
} catch (e) {
|
|
1232
|
-
|
|
1232
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Can't use localStorage", e);
|
|
1233
1233
|
localstorage_error = e;
|
|
1234
1234
|
}
|
|
1235
1235
|
if (!id) {
|
|
@@ -1242,11 +1242,11 @@ let $e0a87646d12cb987$export$6399bdb2291895e0 = () => {
|
|
|
1242
1242
|
}, {})._dep_id;
|
|
1243
1243
|
id = get_cookie_id();
|
|
1244
1244
|
if (!id) {
|
|
1245
|
-
document.cookie = `_dep_id=${
|
|
1245
|
+
document.cookie = `_dep_id=${$650b64c1b384c895$export$656831b7e9c341c3()}; expires=Fri, 31 Dec 9999 23:59:59 GMT`;
|
|
1246
1246
|
id = get_cookie_id();
|
|
1247
1247
|
}
|
|
1248
1248
|
} catch (e) {
|
|
1249
|
-
|
|
1249
|
+
$268cbd9e4ade92db$export$f18d5b0af29128b7(e, "warning");
|
|
1250
1250
|
cookie_error = e;
|
|
1251
1251
|
}
|
|
1252
1252
|
(0, $61a34358bf0d3d8b$export$af2e17a20c2ea3c5).withScope(function (scope) {
|
|
@@ -1257,14 +1257,14 @@ let $e0a87646d12cb987$export$6399bdb2291895e0 = () => {
|
|
|
1257
1257
|
this.captureMessage(`${id ? "localStorage" : "cookie and localStorage"} failed to hold a value!`);
|
|
1258
1258
|
});
|
|
1259
1259
|
}
|
|
1260
|
-
if (!id) id =
|
|
1260
|
+
if (!id) id = $650b64c1b384c895$export$656831b7e9c341c3();
|
|
1261
1261
|
return id;
|
|
1262
1262
|
};
|
|
1263
1263
|
let $e0a87646d12cb987$export$adc61a405a4cabed = $e0a87646d12cb987$export$6399bdb2291895e0;
|
|
1264
1264
|
let $e0a87646d12cb987$export$61e7e1f11e96692f = () => undefined;
|
|
1265
|
-
const $e0a87646d12cb987$export$336e7ad40bae0652 = /*@__PURE__
|
|
1266
|
-
const $e0a87646d12cb987$export$8a96793bf9f87d90 = /*@__PURE__
|
|
1267
|
-
const $e0a87646d12cb987$export$93ae15b1ae509334 = /*@__PURE__
|
|
1265
|
+
const $e0a87646d12cb987$export$336e7ad40bae0652 = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(newfn => $e0a87646d12cb987$export$6399bdb2291895e0 = newfn);
|
|
1266
|
+
const $e0a87646d12cb987$export$8a96793bf9f87d90 = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(newfn => $e0a87646d12cb987$export$adc61a405a4cabed = newfn);
|
|
1267
|
+
const $e0a87646d12cb987$export$93ae15b1ae509334 = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(newfn => $e0a87646d12cb987$export$61e7e1f11e96692f = newfn);
|
|
1268
1268
|
const $e0a87646d12cb987$export$8c6f26a5b6921b95 = /*@__PURE__*/() => {
|
|
1269
1269
|
return {
|
|
1270
1270
|
session_id: $e0a87646d12cb987$export$61e7e1f11e96692f(),
|
|
@@ -1275,7 +1275,7 @@ const $e0a87646d12cb987$export$8c6f26a5b6921b95 = /*@__PURE__*/() => {
|
|
|
1275
1275
|
document_referrer: document?.referrer
|
|
1276
1276
|
};
|
|
1277
1277
|
};
|
|
1278
|
-
const $e0a87646d12cb987$export$82badda1f9923310 = /*@__PURE__
|
|
1278
|
+
const $e0a87646d12cb987$export$82badda1f9923310 = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9((vars, use_ws) => {
|
|
1279
1279
|
if (process.env.DEPICT === "false") return;
|
|
1280
1280
|
const payload = [{
|
|
1281
1281
|
...$e0a87646d12cb987$export$8c6f26a5b6921b95(),
|
|
@@ -1285,9 +1285,9 @@ const $e0a87646d12cb987$export$82badda1f9923310 = /*@__PURE__*/(0, $268cbd9e4ade
|
|
|
1285
1285
|
entity_price: vars?.sale_price,
|
|
1286
1286
|
...vars
|
|
1287
1287
|
}];
|
|
1288
|
-
return
|
|
1288
|
+
return $0c84f8e99aac5765$export$28cacbd9b4306ffc(payload, use_ws);
|
|
1289
1289
|
});
|
|
1290
|
-
const $e0a87646d12cb987$export$15f8a0cd5a8c0ebb = /*@__PURE__
|
|
1290
|
+
const $e0a87646d12cb987$export$15f8a0cd5a8c0ebb = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(vars => {
|
|
1291
1291
|
if (process.env.DEPICT === "false") return;
|
|
1292
1292
|
const beacon_retval = $e0a87646d12cb987$export$82badda1f9923310({
|
|
1293
1293
|
...vars,
|
|
@@ -1303,7 +1303,7 @@ const $e0a87646d12cb987$export$15f8a0cd5a8c0ebb = /*@__PURE__*/(0, $268cbd9e4ade
|
|
|
1303
1303
|
|
|
1304
1304
|
return beacon_retval;
|
|
1305
1305
|
});
|
|
1306
|
-
const $e0a87646d12cb987$export$9028351cb994757e = /*@__PURE__
|
|
1306
|
+
const $e0a87646d12cb987$export$9028351cb994757e = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(vars => {
|
|
1307
1307
|
if (process.env.DEPICT === "false") return;
|
|
1308
1308
|
return $e0a87646d12cb987$export$82badda1f9923310({
|
|
1309
1309
|
...vars,
|
|
@@ -1317,7 +1317,7 @@ function $e0a87646d12cb987$export$622991c71a1f52b3(cookie_name) {
|
|
|
1317
1317
|
function $13a446968e3581c0$export$c50e1901e8ed0615(callback) {
|
|
1318
1318
|
// https://stackoverflow.com/a/61574326
|
|
1319
1319
|
const channel = new MessageChannel();
|
|
1320
|
-
channel.port1.onmessage =
|
|
1320
|
+
channel.port1.onmessage = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(callback);
|
|
1321
1321
|
channel.port2.postMessage("");
|
|
1322
1322
|
}
|
|
1323
1323
|
function $dba5a9c0f6fb4324$export$6f051469dd676a8b(tenant, market, type) {
|
|
@@ -1327,11 +1327,11 @@ function $dba5a9c0f6fb4324$export$6f051469dd676a8b(tenant, market, type) {
|
|
|
1327
1327
|
if (!display) return;
|
|
1328
1328
|
info.set_on_index_change(() => {
|
|
1329
1329
|
current_displays.add(display);
|
|
1330
|
-
|
|
1330
|
+
$z0IcO$solidjs.onCleanup(() => current_displays.delete(display));
|
|
1331
1331
|
if (!queued_sending) {
|
|
1332
1332
|
queued_sending = true;
|
|
1333
|
-
|
|
1334
|
-
|
|
1333
|
+
$13a446968e3581c0$export$c50e1901e8ed0615(() => {
|
|
1334
|
+
$e0a87646d12cb987$export$82badda1f9923310({
|
|
1335
1335
|
tenant: tenant,
|
|
1336
1336
|
market: market,
|
|
1337
1337
|
recommendation_type: type,
|
|
@@ -1352,7 +1352,7 @@ function $ee1d22bd1fcdd4e1$export$6e7454c733fa1fb2(fn, ...args) {
|
|
|
1352
1352
|
return fn.apply(this, [...args, ...unimportant_args]);
|
|
1353
1353
|
};
|
|
1354
1354
|
}
|
|
1355
|
-
const $eee5951374097b61$export$8582cf3716962dc2 = /*@__PURE__
|
|
1355
|
+
const $eee5951374097b61$export$8582cf3716962dc2 = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(async ({
|
|
1356
1356
|
recs: recs,
|
|
1357
1357
|
min_recs: min_recs,
|
|
1358
1358
|
market: market,
|
|
@@ -1369,11 +1369,11 @@ const $eee5951374097b61$export$8582cf3716962dc2 = /*@__PURE__*/(0, $268cbd9e4ade
|
|
|
1369
1369
|
if (Array.isArray(recs)) {
|
|
1370
1370
|
if (min_recs == undefined) min_recs = 10;
|
|
1371
1371
|
if (recs.length < min_recs) {
|
|
1372
|
-
|
|
1372
|
+
$e6c6e7929ea385ae$export$c2363754d4758444("Displays provided to check_displays is too short, it contains", recs.length, "displays which is less than", min_recs);
|
|
1373
1373
|
return false;
|
|
1374
1374
|
} else return true;
|
|
1375
|
-
} else
|
|
1376
|
-
} else
|
|
1375
|
+
} else $e6c6e7929ea385ae$export$c2363754d4758444(new Error("neither recs nor recs.displays are an array"));
|
|
1376
|
+
} else $e6c6e7929ea385ae$export$c2363754d4758444(new Error("Non object was passed to check_displays"));
|
|
1377
1377
|
});
|
|
1378
1378
|
const $546052c2e3608435$var$elem_track_id_map = /*@__PURE__*/new WeakMap();
|
|
1379
1379
|
function $546052c2e3608435$export$16d7c76794a38a4(element, event, track_id, func) {
|
|
@@ -1419,7 +1419,7 @@ function $7599647868f98022$var$check_if_querySelectorAll_needs_patching() {
|
|
|
1419
1419
|
}
|
|
1420
1420
|
let $55595fc7bb226f61$var$has_queued_microtask = false;
|
|
1421
1421
|
const $55595fc7bb226f61$var$queued_callbacks = /*@__PURE__*/new Map();
|
|
1422
|
-
const $55595fc7bb226f61$var$catchified_deduplicate_and_dispatch = /*@__PURE__
|
|
1422
|
+
const $55595fc7bb226f61$var$catchified_deduplicate_and_dispatch = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9($55595fc7bb226f61$var$deduplicate_and_dispatch, "error in observer event processing", "error");
|
|
1423
1423
|
function $55595fc7bb226f61$export$2b08e30396270f0b(callback, ev) {
|
|
1424
1424
|
$55595fc7bb226f61$var$queued_callbacks.set(ev, callback);
|
|
1425
1425
|
if (!$55595fc7bb226f61$var$has_queued_microtask) queueMicrotask($55595fc7bb226f61$var$catchified_deduplicate_and_dispatch);
|
|
@@ -1464,7 +1464,7 @@ function $55595fc7bb226f61$var$deduplicate_and_dispatch() {
|
|
|
1464
1464
|
}
|
|
1465
1465
|
}
|
|
1466
1466
|
function $55595fc7bb226f61$var$call_callback(callback, ev) {
|
|
1467
|
-
|
|
1467
|
+
$268cbd9e4ade92db$export$b3bbfd758f11cfa9(callback, "Error in observer callback")(ev);
|
|
1468
1468
|
}
|
|
1469
1469
|
class $e2f46d4f382caff1$export$ea60432919e69303 {
|
|
1470
1470
|
constructor(opts) {
|
|
@@ -1484,7 +1484,7 @@ class $9043c64496e3375f$export$12e07a2a9f87578a {
|
|
|
1484
1484
|
#attribute_attribution_map_object = {};
|
|
1485
1485
|
#territory;
|
|
1486
1486
|
#listeners = ["exists", "creation", "removed", "change"];
|
|
1487
|
-
#weakref_finalization_registry = typeof FinalizationRegistry === "function" && new FinalizationRegistry(
|
|
1487
|
+
#weakref_finalization_registry = typeof FinalizationRegistry === "function" && new FinalizationRegistry($268cbd9e4ade92db$export$b3bbfd758f11cfa9(this.#finalization_registry_callback.bind(this)));
|
|
1488
1488
|
#verbs = {
|
|
1489
1489
|
// add "normal" functions for the class that can be used as i.e. observer.ifexists() here
|
|
1490
1490
|
ifexists: (selector, callback) => {
|
|
@@ -1505,7 +1505,7 @@ class $9043c64496e3375f$export$12e07a2a9f87578a {
|
|
|
1505
1505
|
return;
|
|
1506
1506
|
}
|
|
1507
1507
|
const our_set = this.#attribute_attribution_map_object[selector] ||= new WeakSet();
|
|
1508
|
-
const elements = typeof document === "undefined" ? [] :
|
|
1508
|
+
const elements = typeof document === "undefined" ? [] : $7599647868f98022$export$33f937d741e49339(this.#territory || document, selector);
|
|
1509
1509
|
for (let i = 0; i < elements.length; i++) {
|
|
1510
1510
|
const element = elements[i];
|
|
1511
1511
|
our_set.add(element);
|
|
@@ -1526,7 +1526,7 @@ class $9043c64496e3375f$export$12e07a2a9f87578a {
|
|
|
1526
1526
|
wait_for_listener: (listener, selector, timeout) => {
|
|
1527
1527
|
this.#check_observer_args(listener, () => {}, false);
|
|
1528
1528
|
// console.log("waiting for listener", listener, "selector", selector, "timeout", timeout);
|
|
1529
|
-
return new Promise(
|
|
1529
|
+
return new Promise($268cbd9e4ade92db$export$b3bbfd758f11cfa9(r => {
|
|
1530
1530
|
const stop_observing = this.#self_proxied["on" + listener](selector, ({
|
|
1531
1531
|
element: element,
|
|
1532
1532
|
disconnector: disconnector
|
|
@@ -1689,7 +1689,7 @@ class $9043c64496e3375f$export$12e07a2a9f87578a {
|
|
|
1689
1689
|
if ((addedNodes.length || removedNodes.length) && node.hasChildNodes() &&
|
|
1690
1690
|
// @ts-ignore
|
|
1691
1691
|
node.querySelectorAll /* don't act on i.e. textnodes. Doing the check this way is actually faster than both `in` and instanceof */) {
|
|
1692
|
-
const matching_children =
|
|
1692
|
+
const matching_children = $7599647868f98022$export$33f937d741e49339(node, selector);
|
|
1693
1693
|
for (let m = 0; m < matching_children.length; m++) {
|
|
1694
1694
|
// always use for loops because this can't be slow and forEach takes ages
|
|
1695
1695
|
if (event == "exists") our_set.add(matching_children[m]);
|
|
@@ -1755,7 +1755,7 @@ class $9043c64496e3375f$export$12e07a2a9f87578a {
|
|
|
1755
1755
|
const matching_nodes = [];
|
|
1756
1756
|
// @ts-ignore
|
|
1757
1757
|
if (node?.matches?.(selector)) matching_nodes.push(node);
|
|
1758
|
-
matching_nodes.push(...(
|
|
1758
|
+
matching_nodes.push(...($7599647868f98022$export$33f937d741e49339(node, selector) || []));
|
|
1759
1759
|
for (let v = 0; v < matching_nodes.length; v++) this.#call_callbacks(callbacks, callback => ({
|
|
1760
1760
|
element_: matching_nodes[v],
|
|
1761
1761
|
selector_: selector,
|
|
@@ -1799,14 +1799,14 @@ class $9043c64496e3375f$export$12e07a2a9f87578a {
|
|
|
1799
1799
|
for (let i = 0; i < execute_after_run.length; i++) try {
|
|
1800
1800
|
execute_after_run[i]();
|
|
1801
1801
|
} catch (e) {
|
|
1802
|
-
|
|
1802
|
+
$268cbd9e4ade92db$export$f18d5b0af29128b7([e, "error in observer running queued function"], "error");
|
|
1803
1803
|
}
|
|
1804
1804
|
// Let the garbage collector empty the old array by creating a new one
|
|
1805
1805
|
this.#execute_after_callback_ran = [];
|
|
1806
1806
|
this.#observer_callback_running = false;
|
|
1807
1807
|
}
|
|
1808
1808
|
} catch (e) {
|
|
1809
|
-
|
|
1809
|
+
$268cbd9e4ade92db$export$f18d5b0af29128b7([e, "error in observer"], "error");
|
|
1810
1810
|
}
|
|
1811
1811
|
};
|
|
1812
1812
|
#check_observer_args(selector, callback, allow_nodes) {
|
|
@@ -1821,7 +1821,7 @@ class $9043c64496e3375f$export$12e07a2a9f87578a {
|
|
|
1821
1821
|
// We are probably running on the server where we can't do anything anyway so we might just return
|
|
1822
1822
|
return;
|
|
1823
1823
|
if (!listener || !selector || !callback) {
|
|
1824
|
-
|
|
1824
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("listener, selector or callback is falsey", {
|
|
1825
1825
|
listener: listener,
|
|
1826
1826
|
selector: selector,
|
|
1827
1827
|
callback: callback
|
|
@@ -1910,7 +1910,7 @@ class $9043c64496e3375f$export$12e07a2a9f87578a {
|
|
|
1910
1910
|
}
|
|
1911
1911
|
}
|
|
1912
1912
|
#call_callbacks(callbacks, make_ev_data) {
|
|
1913
|
-
for (const callback of callbacks)
|
|
1913
|
+
for (const callback of callbacks) $55595fc7bb226f61$export$2b08e30396270f0b(callback, new (0, $e2f46d4f382caff1$export$ea60432919e69303)(make_ev_data(callback)));
|
|
1914
1914
|
}
|
|
1915
1915
|
#get(target, verb) {
|
|
1916
1916
|
// @ts-ignore
|
|
@@ -1934,7 +1934,7 @@ function $2a1cbc63a04d4a2d$var$make_default_observer() {
|
|
|
1934
1934
|
try {
|
|
1935
1935
|
return new (0, $9043c64496e3375f$export$12e07a2a9f87578a)();
|
|
1936
1936
|
} catch (error) {
|
|
1937
|
-
|
|
1937
|
+
$268cbd9e4ade92db$export$f18d5b0af29128b7([error, "error starting ElementObserver"], "error");
|
|
1938
1938
|
}
|
|
1939
1939
|
}
|
|
1940
1940
|
function $bf7f12fe044e41b2$export$925772df9b4d16e5(url, param, value) {
|
|
@@ -1960,22 +1960,22 @@ function $bf7f12fe044e41b2$export$d3e2a0560cbf4787(html) {
|
|
|
1960
1960
|
}
|
|
1961
1961
|
function $bf7f12fe044e41b2$export$d4bd03f19260ef1c(url, also_onchange = false, override_dev_url = "demo.depict.ai", stfu = true, also_in_all_shadow_roots = false) {
|
|
1962
1962
|
if (process.env.DEBUG === "true" && location.href.includes(override_dev_url)) {
|
|
1963
|
-
const relativ_callback =
|
|
1963
|
+
const relativ_callback = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(event => {
|
|
1964
1964
|
const anchor = event.element;
|
|
1965
1965
|
if (typeof url === "string") {
|
|
1966
1966
|
if (anchor.href.includes(url)) {
|
|
1967
|
-
if (!stfu)
|
|
1967
|
+
if (!stfu) $e6c6e7929ea385ae$export$de56f1198d121036("RUNNING RELATIVIFY on", event);
|
|
1968
1968
|
anchor.href = anchor.href.replaceAll(url, "/");
|
|
1969
1969
|
}
|
|
1970
1970
|
} else if (url.test(anchor.href)) {
|
|
1971
|
-
if (!stfu)
|
|
1971
|
+
if (!stfu) $e6c6e7929ea385ae$export$de56f1198d121036("RUNNING RELATIVIFY on", event);
|
|
1972
1972
|
anchor.href = anchor.href.replace(url, "/");
|
|
1973
1973
|
}
|
|
1974
1974
|
});
|
|
1975
1975
|
const link_sel = "a[href]";
|
|
1976
1976
|
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onexists(link_sel, relativ_callback);
|
|
1977
1977
|
if (also_onchange) (0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onchange(link_sel, relativ_callback);
|
|
1978
|
-
if (also_in_all_shadow_roots && typeof ShadowRoot == "function") (0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onexists("*",
|
|
1978
|
+
if (also_in_all_shadow_roots && typeof ShadowRoot == "function") (0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onexists("*", $268cbd9e4ade92db$export$b3bbfd758f11cfa9(({
|
|
1979
1979
|
element: element
|
|
1980
1980
|
}) => {
|
|
1981
1981
|
if (element?.shadowRoot instanceof ShadowRoot) {
|
|
@@ -1990,7 +1990,7 @@ function $bf7f12fe044e41b2$export$d4bd03f19260ef1c(url, also_onchange = false, o
|
|
|
1990
1990
|
function $bf7f12fe044e41b2$export$5e63aea0cac01fa0(elements, selector) {
|
|
1991
1991
|
const matches = [];
|
|
1992
1992
|
for (const element of elements) {
|
|
1993
|
-
if ("querySelectorAll" in element) matches.push(
|
|
1993
|
+
if ("querySelectorAll" in element) matches.push(...$7599647868f98022$export$33f937d741e49339(element, selector));
|
|
1994
1994
|
if ("matches" in element && element.matches?.(selector)) matches.push(element);
|
|
1995
1995
|
}
|
|
1996
1996
|
return matches;
|
|
@@ -2000,12 +2000,12 @@ function $bf7f12fe044e41b2$export$cfef5d5c9ac09253(price, places_after_comma = 2
|
|
|
2000
2000
|
if (!price && price !== 0) return "";
|
|
2001
2001
|
if (typeof price === "string") {
|
|
2002
2002
|
if (!isNaN(price)) {
|
|
2003
|
-
|
|
2003
|
+
$268cbd9e4ade92db$export$f18d5b0af29128b7(new Error("standard_price_format did not expect price as a string"), "warning", {
|
|
2004
2004
|
price: price
|
|
2005
2005
|
});
|
|
2006
2006
|
price = parseFloat(price);
|
|
2007
2007
|
} else {
|
|
2008
|
-
|
|
2008
|
+
$268cbd9e4ade92db$export$f18d5b0af29128b7(new Error("standard_price_format cannot handle price string"), "error", {
|
|
2009
2009
|
price: price
|
|
2010
2010
|
});
|
|
2011
2011
|
return "";
|
|
@@ -2044,14 +2044,14 @@ function $2fafbbbf345dcde0$export$947a20746936143d(promises) {
|
|
|
2044
2044
|
async function $44909e19109bf973$export$836f70a28c317905(product_id) {
|
|
2045
2045
|
if (typeof BroadcastChannel != "function") return;
|
|
2046
2046
|
const bc = new BroadcastChannel("right_click_attribution");
|
|
2047
|
-
|
|
2047
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Broadcasting", product_id, "to", bc);
|
|
2048
2048
|
bc.postMessage(product_id);
|
|
2049
2049
|
bc.close();
|
|
2050
2050
|
}
|
|
2051
2051
|
function $44909e19109bf973$export$58c56fe2313fdbe3(elements, display, info, get_event_listener_remover) {
|
|
2052
2052
|
if (typeof BroadcastChannel != "function") return elements;
|
|
2053
2053
|
const disconnectors = [];
|
|
2054
|
-
const handler =
|
|
2054
|
+
const handler = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(e => $44909e19109bf973$export$8f66c4c7fb96eda2(e, ("variant_index" in display ? display.variant_displays[display.variant_index] : display).product_id));
|
|
2055
2055
|
const auxclick_handler = e => e.button === 1 && handler(e);
|
|
2056
2056
|
for (let i = 0; i < elements?.length; i++) {
|
|
2057
2057
|
const element = elements[i];
|
|
@@ -2066,15 +2066,15 @@ function $44909e19109bf973$export$58c56fe2313fdbe3(elements, display, info, get_
|
|
|
2066
2066
|
return elements;
|
|
2067
2067
|
}
|
|
2068
2068
|
async function $44909e19109bf973$export$8f66c4c7fb96eda2(e, product_id) {
|
|
2069
|
-
|
|
2069
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Contextmenu was invoked", e);
|
|
2070
2070
|
const element = e.currentTarget || e.target;
|
|
2071
2071
|
const bc = new BroadcastChannel("right_click_attribution");
|
|
2072
|
-
const got_wanted_event = await
|
|
2073
|
-
bc.addEventListener("message",
|
|
2072
|
+
const got_wanted_event = await $2fafbbbf345dcde0$export$947a20746936143d([new Promise(resolve => {
|
|
2073
|
+
bc.addEventListener("message", $268cbd9e4ade92db$export$b3bbfd758f11cfa9(msg => {
|
|
2074
2074
|
const {
|
|
2075
2075
|
data: data
|
|
2076
2076
|
} = msg;
|
|
2077
|
-
|
|
2077
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Recieved broadcast channel event", data, msg);
|
|
2078
2078
|
if (data == product_id) resolve(true);
|
|
2079
2079
|
}));
|
|
2080
2080
|
}), new Promise(r => setTimeout(r, 60000, false))]);
|
|
@@ -2085,12 +2085,12 @@ async function $44909e19109bf973$export$8f66c4c7fb96eda2(e, product_id) {
|
|
|
2085
2085
|
cancelable: true,
|
|
2086
2086
|
metaKey: true
|
|
2087
2087
|
});
|
|
2088
|
-
|
|
2088
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Someone broadcasted our product_id! Simulating a click event on the element that was contextmenu'd", element, click);
|
|
2089
2089
|
element.addEventListener("click", e => (e.preventDefault(), false), {
|
|
2090
2090
|
once: true
|
|
2091
2091
|
});
|
|
2092
2092
|
element.dispatchEvent(click);
|
|
2093
|
-
} else
|
|
2093
|
+
} else $e6c6e7929ea385ae$export$de56f1198d121036("Our product_id did not get broadcasted, closing channel");
|
|
2094
2094
|
bc.close();
|
|
2095
2095
|
}
|
|
2096
2096
|
|
|
@@ -2125,7 +2125,7 @@ const $72ed530554068e4f$var$unwatch_element = element => {
|
|
|
2125
2125
|
};
|
|
2126
2126
|
const $72ed530554068e4f$export$4c51576248bcdf31 = (element, callback) => {
|
|
2127
2127
|
if ($72ed530554068e4f$var$watched_elements.has(element)) {
|
|
2128
|
-
|
|
2128
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Not watching", element, "as it's already being watched");
|
|
2129
2129
|
return () => {};
|
|
2130
2130
|
}
|
|
2131
2131
|
$72ed530554068e4f$var$intersection_observer?.observe(element);
|
|
@@ -2180,7 +2180,7 @@ const $72ed530554068e4f$var$intersection_observer_callback = entries => {
|
|
|
2180
2180
|
clearTimeout(callback_timeout_);
|
|
2181
2181
|
if (time_elapsed <= (0, $dd025eb6f77f8f8b$export$ca8321ea61dc2544)) $72ed530554068e4f$var$current_intersections.delete(target);else {
|
|
2182
2182
|
// we intersected long enough
|
|
2183
|
-
|
|
2183
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("intersection_observer: setTimeout lagged", time_elapsed, (0, $dd025eb6f77f8f8b$export$ca8321ea61dc2544), "ms", target);
|
|
2184
2184
|
callback(target);
|
|
2185
2185
|
}
|
|
2186
2186
|
}
|
|
@@ -2190,33 +2190,33 @@ const $72ed530554068e4f$var$intersection_observer_callback = entries => {
|
|
|
2190
2190
|
* Global IntersectionObserver used for all impression tracking.
|
|
2191
2191
|
* It's faster to use one observer for all elements than to create a new one for each element.
|
|
2192
2192
|
*/
|
|
2193
|
-
const $72ed530554068e4f$var$intersection_observer = typeof window === "object" ? /*@__PURE__*/new IntersectionObserver( /*@__PURE__
|
|
2194
|
-
threshold: /*@__PURE__
|
|
2193
|
+
const $72ed530554068e4f$var$intersection_observer = typeof window === "object" ? /*@__PURE__*/new IntersectionObserver( /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9($72ed530554068e4f$var$intersection_observer_callback), {
|
|
2194
|
+
threshold: /*@__PURE__*/$0da0cad4f39e8f32$export$f8ea2e7b15b5d129(8)
|
|
2195
2195
|
}) : undefined;
|
|
2196
2196
|
const $11ff7b46c1fb674c$export$d0efd8ed14f5c33 = (items, display, info) => {
|
|
2197
2197
|
if (!items?.length) return items;
|
|
2198
2198
|
const node_array = Array.isArray(items) ? items : [...items]; // if it's a NodeList convert it to an array
|
|
2199
2199
|
const first_watchable_el = node_array.find(el => el instanceof Element);
|
|
2200
2200
|
if (!first_watchable_el) {
|
|
2201
|
-
|
|
2201
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Impression tracking: Can't observe", items, display);
|
|
2202
2202
|
return items;
|
|
2203
2203
|
}
|
|
2204
2204
|
if (!info.t) {
|
|
2205
|
-
|
|
2205
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Impression tracking: No tenant instance, can't track", items, display);
|
|
2206
2206
|
return items;
|
|
2207
2207
|
}
|
|
2208
2208
|
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onexists(first_watchable_el, ({
|
|
2209
2209
|
element: element
|
|
2210
2210
|
}) => {
|
|
2211
|
-
|
|
2211
|
+
$72ed530554068e4f$export$4c51576248bcdf31(element, () => {
|
|
2212
2212
|
const {
|
|
2213
2213
|
recommendation_id: recommendation_id,
|
|
2214
2214
|
search_result_id: search_result_id,
|
|
2215
2215
|
product_listing_result_id: product_listing_result_id,
|
|
2216
2216
|
suggestions_result_id: suggestions_result_id
|
|
2217
2217
|
} = display;
|
|
2218
|
-
|
|
2219
|
-
|
|
2218
|
+
$dd025eb6f77f8f8b$export$4205dc6835bc0d9f({
|
|
2219
|
+
...$e0a87646d12cb987$export$8c6f26a5b6921b95(),
|
|
2220
2220
|
recommendation_type: info.rendering_options.type,
|
|
2221
2221
|
entity_price: display.sale_price,
|
|
2222
2222
|
market: info.t.market,
|
|
@@ -2238,9 +2238,9 @@ const $8e19f8200d357fe7$export$37125ccc5dd98050 = ({
|
|
|
2238
2238
|
}) => {
|
|
2239
2239
|
const disconnectors = [];
|
|
2240
2240
|
const impression_track = () => {
|
|
2241
|
-
const disconnector =
|
|
2242
|
-
|
|
2243
|
-
|
|
2241
|
+
const disconnector = $72ed530554068e4f$export$4c51576248bcdf31(element, () => {
|
|
2242
|
+
$dd025eb6f77f8f8b$export$4205dc6835bc0d9f({
|
|
2243
|
+
...$e0a87646d12cb987$export$8c6f26a5b6921b95(),
|
|
2244
2244
|
...data
|
|
2245
2245
|
});
|
|
2246
2246
|
});
|
|
@@ -2254,7 +2254,7 @@ const $dd025eb6f77f8f8b$export$c543ee4cdb0d0964 = (start, end) => $dd025eb6f77f8
|
|
|
2254
2254
|
const $dd025eb6f77f8f8b$export$ca8321ea61dc2544 = 500;
|
|
2255
2255
|
const $dd025eb6f77f8f8b$export$4205dc6835bc0d9f = data => {
|
|
2256
2256
|
data.type = "element_visible"; // Set the type to element_visible as this is optional to pass here.
|
|
2257
|
-
|
|
2257
|
+
$0c84f8e99aac5765$export$28cacbd9b4306ffc([data], true);
|
|
2258
2258
|
};
|
|
2259
2259
|
function $c8263a2185830bf1$export$82a685f2da2fb027(a_element, product_id, recommendation_id, additional_listener) {
|
|
2260
2260
|
if (!a_element ||
|
|
@@ -2285,9 +2285,9 @@ function $c8263a2185830bf1$export$82a685f2da2fb027(a_element, product_id, recomm
|
|
|
2285
2285
|
async function $c8263a2185830bf1$export$2c34560c3749dc63(button, get_product_id, tracking_fn, unmatching_tracking, event) {
|
|
2286
2286
|
// @ts-ignore
|
|
2287
2287
|
if (!button || button.depict_tracked) return;
|
|
2288
|
-
button.addEventListener(event ? event : "click",
|
|
2288
|
+
button.addEventListener(event ? event : "click", $268cbd9e4ade92db$export$b3bbfd758f11cfa9(async e => {
|
|
2289
2289
|
if (!e.isTrusted) {
|
|
2290
|
-
|
|
2290
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("ignoring event", e, "because it's not user generated");
|
|
2291
2291
|
return;
|
|
2292
2292
|
}
|
|
2293
2293
|
const product_id = await get_product_id(undefined, e);
|
|
@@ -2303,8 +2303,8 @@ async function $c8263a2185830bf1$export$2c34560c3749dc63(button, get_product_id,
|
|
|
2303
2303
|
// @ts-ignore
|
|
2304
2304
|
button.depict_tracked = true;
|
|
2305
2305
|
}
|
|
2306
|
-
const $69f7524c8bdd85b4$export$20e9533e68ee72e7 = /*@__PURE__
|
|
2307
|
-
const $69f7524c8bdd85b4$export$a9d39e43ae273d26 = /*@__PURE__
|
|
2306
|
+
const $69f7524c8bdd85b4$export$20e9533e68ee72e7 = /*@__PURE__*/$9a42a570de51ea3d$export$e806c6c1615a59ae(false);
|
|
2307
|
+
const $69f7524c8bdd85b4$export$a9d39e43ae273d26 = /*@__PURE__*/$9a42a570de51ea3d$export$e806c6c1615a59ae();
|
|
2308
2308
|
const $69f7524c8bdd85b4$export$7500cdfd37aafd43 = /*@__PURE__*/new Set();
|
|
2309
2309
|
let $69f7524c8bdd85b4$var$old_url;
|
|
2310
2310
|
const $69f7524c8bdd85b4$var$maybe_navigation = (what_happened, args) => {
|
|
@@ -2321,9 +2321,9 @@ const $69f7524c8bdd85b4$var$maybe_navigation = (what_happened, args) => {
|
|
|
2321
2321
|
};
|
|
2322
2322
|
$69f7524c8bdd85b4$export$baccefee4a395d8f((args, what_happened) => $69f7524c8bdd85b4$var$maybe_navigation(what_happened, args));
|
|
2323
2323
|
$69f7524c8bdd85b4$var$maybe_navigation();
|
|
2324
|
-
globalThis?.window?.addEventListener("popstate",
|
|
2324
|
+
globalThis?.window?.addEventListener("popstate", $268cbd9e4ade92db$export$b3bbfd758f11cfa9(e => $69f7524c8bdd85b4$var$maybe_navigation("popstate", e)));
|
|
2325
2325
|
async function $69f7524c8bdd85b4$export$1cd22bab0d2c3b0b(callback) {
|
|
2326
|
-
const catchified_callback =
|
|
2326
|
+
const catchified_callback = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(callback);
|
|
2327
2327
|
for await (const href of $69f7524c8bdd85b4$export$20e9533e68ee72e7) {
|
|
2328
2328
|
catchified_callback(href);
|
|
2329
2329
|
break;
|
|
@@ -2344,7 +2344,7 @@ async function $69f7524c8bdd85b4$export$baccefee4a395d8f(after_navigation, repla
|
|
|
2344
2344
|
try {
|
|
2345
2345
|
after_navigation(arguments_list, the_thing);
|
|
2346
2346
|
} catch (e) {
|
|
2347
|
-
|
|
2347
|
+
$548fd58b14b25a52$export$8048b892d651b310(e);
|
|
2348
2348
|
}
|
|
2349
2349
|
return nav_result;
|
|
2350
2350
|
}
|
|
@@ -2367,21 +2367,21 @@ async function $72ee205b59322497$export$eee4c4d924348b05(data) {
|
|
|
2367
2367
|
} = location;
|
|
2368
2368
|
if ($72ee205b59322497$var$last_page_pageview_sent_for !== href) {
|
|
2369
2369
|
$72ee205b59322497$var$last_page_pageview_sent_for = href;
|
|
2370
|
-
|
|
2370
|
+
$e0a87646d12cb987$export$82badda1f9923310({
|
|
2371
2371
|
...data,
|
|
2372
2372
|
type: "page_view"
|
|
2373
2373
|
});
|
|
2374
|
-
if (data.product_id) await
|
|
2374
|
+
if (data.product_id) await $44909e19109bf973$export$836f70a28c317905(data.product_id); // this takes care of right click click attribution - broadcasts the URL of the current page
|
|
2375
2375
|
}
|
|
2376
2376
|
} catch (error) {
|
|
2377
|
-
|
|
2377
|
+
$268cbd9e4ade92db$export$f18d5b0af29128b7([error, "Sending page view failed"], "warning");
|
|
2378
2378
|
}
|
|
2379
2379
|
}
|
|
2380
2380
|
let $72ee205b59322497$var$sending_on_navigation = false;
|
|
2381
2381
|
async function $72ee205b59322497$export$f7cb1bd47199ec38(data) {
|
|
2382
2382
|
if (!$72ee205b59322497$var$sending_on_navigation) {
|
|
2383
2383
|
$72ee205b59322497$var$sending_on_navigation = true;
|
|
2384
|
-
|
|
2384
|
+
$268cbd9e4ade92db$export$b3bbfd758f11cfa9(async () => {
|
|
2385
2385
|
for await (const _href of (0, $69f7524c8bdd85b4$export$a9d39e43ae273d26)) $72ee205b59322497$export$eee4c4d924348b05({
|
|
2386
2386
|
tenant: data.tenant,
|
|
2387
2387
|
market: data.market,
|
|
@@ -2434,7 +2434,7 @@ $parcel$export($28e42b0009d694b2$exports, "cookiebot_get_cookie_ipns", () => $28
|
|
|
2434
2434
|
$parcel$export($28e42b0009d694b2$exports, "init_cookiebot_tracking", () => $28e42b0009d694b2$export$abec7fd9f0b9cc22);
|
|
2435
2435
|
const $28e42b0009d694b2$var$required_consent_level = process.env.DEPICT_TRACKING_CONSENT_LEVEL;
|
|
2436
2436
|
function $28e42b0009d694b2$var$consent_from_cookie() {
|
|
2437
|
-
const cookie =
|
|
2437
|
+
const cookie = $e0a87646d12cb987$export$622991c71a1f52b3("CookieConsent");
|
|
2438
2438
|
if (!cookie) return;
|
|
2439
2439
|
const consent_json = cookie.replace(/%2C/g, ",").replace(/%27/g, "'").replace(/'/g, '"').replace(/([{[,])\s*([\w]+?):/g, '$1"$2":');
|
|
2440
2440
|
try {
|
|
@@ -2442,12 +2442,12 @@ function $28e42b0009d694b2$var$consent_from_cookie() {
|
|
|
2442
2442
|
} catch ({
|
|
2443
2443
|
message: message
|
|
2444
2444
|
}) {
|
|
2445
|
-
|
|
2445
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Error parsing cookie json", consent_json, message);
|
|
2446
2446
|
return;
|
|
2447
2447
|
}
|
|
2448
2448
|
}
|
|
2449
2449
|
let $28e42b0009d694b2$var$cookie_ipns;
|
|
2450
|
-
let $28e42b0009d694b2$var$has_consent = $28e42b0009d694b2$var$required_consent_level ? $28e42b0009d694b2$var$consent_from_cookie()?.[$28e42b0009d694b2$var$required_consent_level] || false : true;
|
|
2450
|
+
let $28e42b0009d694b2$var$has_consent = /*@__PURE__*/(() => $28e42b0009d694b2$var$required_consent_level ? $28e42b0009d694b2$var$consent_from_cookie()?.[$28e42b0009d694b2$var$required_consent_level] || false : true)();
|
|
2451
2451
|
const $28e42b0009d694b2$export$fce59460a1699957 = () => $28e42b0009d694b2$var$has_consent;
|
|
2452
2452
|
async function $28e42b0009d694b2$export$56c2e8be65fb14ae() {
|
|
2453
2453
|
for await (const consent_obj of $28e42b0009d694b2$export$8827362e5e938d26()) return consent_obj[process.env.DEPICT_TRACKING_CONSENT_LEVEL];
|
|
@@ -2456,10 +2456,10 @@ async function $28e42b0009d694b2$export$56c2e8be65fb14ae() {
|
|
|
2456
2456
|
}
|
|
2457
2457
|
function $28e42b0009d694b2$export$8827362e5e938d26() {
|
|
2458
2458
|
if ($28e42b0009d694b2$var$cookie_ipns) return $28e42b0009d694b2$var$cookie_ipns;
|
|
2459
|
-
$28e42b0009d694b2$var$cookie_ipns =
|
|
2459
|
+
$28e42b0009d694b2$var$cookie_ipns = $9a42a570de51ea3d$export$e806c6c1615a59ae();
|
|
2460
2460
|
const existing_consent = $28e42b0009d694b2$var$consent_from_cookie();
|
|
2461
2461
|
if (existing_consent) $28e42b0009d694b2$var$cookie_ipns(existing_consent);
|
|
2462
|
-
const consent_maybe_changed =
|
|
2462
|
+
const consent_maybe_changed = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => {
|
|
2463
2463
|
const {
|
|
2464
2464
|
consent: {
|
|
2465
2465
|
marketing: marketing,
|
|
@@ -2475,25 +2475,25 @@ function $28e42b0009d694b2$export$8827362e5e938d26() {
|
|
|
2475
2475
|
statistics: statistics
|
|
2476
2476
|
};
|
|
2477
2477
|
if (!Object.keys(new_consent_obj).every(k => $28e42b0009d694b2$var$cookie_ipns.latest_call_value?.[k] === new_consent_obj[k])) {
|
|
2478
|
-
|
|
2478
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Consent changed", new_consent_obj);
|
|
2479
2479
|
$28e42b0009d694b2$var$cookie_ipns(new_consent_obj);
|
|
2480
2480
|
}
|
|
2481
2481
|
}, "extracting consent failed");
|
|
2482
|
-
|
|
2482
|
+
$e6d67ef355abb2dc$export$2fc1a072736ae2f6(window, "Cookiebot", "consent").then(consent_maybe_changed);
|
|
2483
2483
|
["CookiebotOnAccept", "CookiebotOnDecline"].forEach(e => window.addEventListener(e, consent_maybe_changed, false));
|
|
2484
2484
|
return $28e42b0009d694b2$var$cookie_ipns;
|
|
2485
2485
|
}
|
|
2486
|
-
const $28e42b0009d694b2$export$abec7fd9f0b9cc22 = /*@__PURE__
|
|
2487
|
-
|
|
2488
|
-
if (!$28e42b0009d694b2$var$required_consent_level) return
|
|
2486
|
+
const $28e42b0009d694b2$export$abec7fd9f0b9cc22 = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(async (anon_id = "anonymous") => {
|
|
2487
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Initializing Cookiebot tracking");
|
|
2488
|
+
if (!$28e42b0009d694b2$var$required_consent_level) return $e6c6e7929ea385ae$export$de56f1198d121036("No consent level set for Depict tracking. Ignoring consent and tracking everything.");
|
|
2489
2489
|
const original_get_depict_id = (0, $e0a87646d12cb987$export$6399bdb2291895e0);
|
|
2490
2490
|
const original_get_user_id = (0, $e0a87646d12cb987$export$adc61a405a4cabed);
|
|
2491
|
-
|
|
2492
|
-
|
|
2491
|
+
$e0a87646d12cb987$export$336e7ad40bae0652(() => $28e42b0009d694b2$var$has_consent ? original_get_depict_id() : anon_id);
|
|
2492
|
+
$e0a87646d12cb987$export$8a96793bf9f87d90(() => $28e42b0009d694b2$var$has_consent ? original_get_user_id() : anon_id);
|
|
2493
2493
|
for await (const consent_obj of $28e42b0009d694b2$export$8827362e5e938d26()) {
|
|
2494
2494
|
// Changing this will change the return value of function given to set_depict_id_fn above
|
|
2495
2495
|
$28e42b0009d694b2$var$has_consent = consent_obj[$28e42b0009d694b2$var$required_consent_level];
|
|
2496
|
-
if (!$28e42b0009d694b2$var$has_consent)
|
|
2496
|
+
if (!$28e42b0009d694b2$var$has_consent) $e6c6e7929ea385ae$export$de56f1198d121036(`dsid/user_id will be set to, "${anon_id}", until Cookiebot has consent for "${$28e42b0009d694b2$var$required_consent_level}"`);else $e6c6e7929ea385ae$export$de56f1198d121036(`Cookiebot obtained consent for "${$28e42b0009d694b2$var$required_consent_level}", will use true dsid/user_id`);
|
|
2497
2497
|
}
|
|
2498
2498
|
});
|
|
2499
2499
|
const $2026711c6c2d6204$var$required_consent_level = process.env.DEPICT_TRACKING_CONSENT_LEVEL;
|
|
@@ -2512,7 +2512,7 @@ const $2026711c6c2d6204$var$required_consent_level = process.env.DEPICT_TRACKING
|
|
|
2512
2512
|
const $2026711c6c2d6204$var$KEY_ORDER = ["necessary", "statistics", "preferences", "marketing"];
|
|
2513
2513
|
const $2026711c6c2d6204$var$OPTANON_TO_COOKIEBOT = Object.fromEntries((process.env.OPTANON_KEYS || "").split(",").filter(k => k).map((k, i) => [k, $2026711c6c2d6204$var$KEY_ORDER[i]]));
|
|
2514
2514
|
function $2026711c6c2d6204$var$consent_from_cookie() {
|
|
2515
|
-
const cookie =
|
|
2515
|
+
const cookie = $e0a87646d12cb987$export$622991c71a1f52b3("OptanonConsent");
|
|
2516
2516
|
if (!cookie) return;
|
|
2517
2517
|
const groups = new URLSearchParams(cookie).get("groups") || "";
|
|
2518
2518
|
const matches = groups.matchAll(/(\w+):(\d)/g);
|
|
@@ -2521,7 +2521,7 @@ function $2026711c6c2d6204$var$consent_from_cookie() {
|
|
|
2521
2521
|
return consent;
|
|
2522
2522
|
}
|
|
2523
2523
|
let $2026711c6c2d6204$var$cookie_ipns;
|
|
2524
|
-
let $2026711c6c2d6204$var$has_consent = $2026711c6c2d6204$var$required_consent_level ?
|
|
2524
|
+
let $2026711c6c2d6204$var$has_consent = /*@__PURE__*/(() => $2026711c6c2d6204$var$required_consent_level ? $2026711c6c2d6204$var$consent_from_cookie()?.[$2026711c6c2d6204$var$required_consent_level] || false : true)();
|
|
2525
2525
|
const $2026711c6c2d6204$export$1dd9ce50e201eff1 = () => $2026711c6c2d6204$var$has_consent;
|
|
2526
2526
|
async function $2026711c6c2d6204$export$7a6d436e0782c6ed() {
|
|
2527
2527
|
for await (const consent_obj of $2026711c6c2d6204$export$7e4427e80d5fc619()) return consent_obj[process.env.DEPICT_TRACKING_CONSENT_LEVEL];
|
|
@@ -2530,12 +2530,12 @@ async function $2026711c6c2d6204$export$7a6d436e0782c6ed() {
|
|
|
2530
2530
|
}
|
|
2531
2531
|
function $2026711c6c2d6204$export$7e4427e80d5fc619() {
|
|
2532
2532
|
if ($2026711c6c2d6204$var$cookie_ipns) return $2026711c6c2d6204$var$cookie_ipns;
|
|
2533
|
-
$2026711c6c2d6204$var$cookie_ipns =
|
|
2533
|
+
$2026711c6c2d6204$var$cookie_ipns = $9a42a570de51ea3d$export$e806c6c1615a59ae();
|
|
2534
2534
|
const existing_consent = $2026711c6c2d6204$var$consent_from_cookie();
|
|
2535
2535
|
if (existing_consent?.necessary)
|
|
2536
2536
|
// If "necessary" isn't set, user hasn't actually given/withold consent yet.
|
|
2537
2537
|
$2026711c6c2d6204$var$cookie_ipns(existing_consent);
|
|
2538
|
-
window.addEventListener("consent.onetrust",
|
|
2538
|
+
window.addEventListener("consent.onetrust", $268cbd9e4ade92db$export$b3bbfd758f11cfa9(evt => {
|
|
2539
2539
|
const c = evt;
|
|
2540
2540
|
// Cast because TS doesn't know about the forEach coming up
|
|
2541
2541
|
const consent_obj = {};
|
|
@@ -2549,34 +2549,34 @@ function $2026711c6c2d6204$export$7e4427e80d5fc619() {
|
|
|
2549
2549
|
}));
|
|
2550
2550
|
return $2026711c6c2d6204$var$cookie_ipns;
|
|
2551
2551
|
}
|
|
2552
|
-
const $2026711c6c2d6204$export$f0f6c846d96fdbec = /*@__PURE__
|
|
2553
|
-
|
|
2554
|
-
if (!$2026711c6c2d6204$var$required_consent_level) return
|
|
2552
|
+
const $2026711c6c2d6204$export$f0f6c846d96fdbec = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(async (anon_id = "anonymous") => {
|
|
2553
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Initializing OptAnon tracking");
|
|
2554
|
+
if (!$2026711c6c2d6204$var$required_consent_level) return $e6c6e7929ea385ae$export$de56f1198d121036("No consent level set for Depict tracking. Ignoring consent and tracking everything.");
|
|
2555
2555
|
const original_get_depict_id = (0, $e0a87646d12cb987$export$6399bdb2291895e0);
|
|
2556
2556
|
const original_get_user_id = (0, $e0a87646d12cb987$export$adc61a405a4cabed);
|
|
2557
|
-
|
|
2558
|
-
|
|
2557
|
+
$e0a87646d12cb987$export$336e7ad40bae0652(() => $2026711c6c2d6204$var$has_consent ? original_get_depict_id() : anon_id);
|
|
2558
|
+
$e0a87646d12cb987$export$8a96793bf9f87d90(() => $2026711c6c2d6204$var$has_consent ? original_get_user_id() : anon_id);
|
|
2559
2559
|
for await (const consent_obj of $2026711c6c2d6204$export$7e4427e80d5fc619()) {
|
|
2560
2560
|
// Changing this will change the return value of function given to set_depict_id_fn above
|
|
2561
2561
|
$2026711c6c2d6204$var$has_consent = consent_obj[$2026711c6c2d6204$var$required_consent_level];
|
|
2562
|
-
if (!$2026711c6c2d6204$var$has_consent)
|
|
2562
|
+
if (!$2026711c6c2d6204$var$has_consent) $e6c6e7929ea385ae$export$de56f1198d121036(`dsid/user_id will be set to, "${anon_id}", until Optanon has consent for "${$2026711c6c2d6204$var$required_consent_level}"`);else $e6c6e7929ea385ae$export$de56f1198d121036(`Optanon obtained consent for "${$2026711c6c2d6204$var$required_consent_level}", will use true dsid/user_id`);
|
|
2563
2563
|
}
|
|
2564
2564
|
});
|
|
2565
2565
|
const $d3d8549954e0318e$var$g = typeof globalThis == "object" && globalThis || window;
|
|
2566
|
-
const $d3d8549954e0318e$export$f3354ec2ce95ebd9 = /*@__PURE__
|
|
2566
|
+
const $d3d8549954e0318e$export$f3354ec2ce95ebd9 = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(async (GA_ID, strict) => {
|
|
2567
2567
|
if (process.env.GTAG === "false") return;
|
|
2568
2568
|
if (!GA_ID) {
|
|
2569
|
-
|
|
2569
|
+
$e6c6e7929ea385ae$export$c2363754d4758444("Couldn't load gtag, GA_ID not specified", GA_ID);
|
|
2570
2570
|
return;
|
|
2571
2571
|
}
|
|
2572
2572
|
const required_consent_level = process.env.GTAG_LOADING_CONSENT_LEVEL;
|
|
2573
2573
|
if (required_consent_level !== undefined) {
|
|
2574
|
-
|
|
2575
|
-
const ipns = process.env.CONSENT_FRAMEWORK == "optanon" ?
|
|
2574
|
+
$e6c6e7929ea385ae$export$de56f1198d121036(`GTag loading waiting for consent level ${required_consent_level}`);
|
|
2575
|
+
const ipns = process.env.CONSENT_FRAMEWORK == "optanon" ? $2026711c6c2d6204$export$7e4427e80d5fc619() : $28e42b0009d694b2$export$8827362e5e938d26();
|
|
2576
2576
|
for await (const consent_status of ipns) {
|
|
2577
2577
|
const status_for_level = consent_status[required_consent_level];
|
|
2578
2578
|
if (status_for_level) {
|
|
2579
|
-
|
|
2579
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("got consent for", required_consent_level, "loading gtag");
|
|
2580
2580
|
break;
|
|
2581
2581
|
}
|
|
2582
2582
|
}
|
|
@@ -2586,13 +2586,13 @@ const $d3d8549954e0318e$export$f3354ec2ce95ebd9 = /*@__PURE__*/(0, $268cbd9e4ade
|
|
|
2586
2586
|
const page_hasnt_loaded = $d3d8549954e0318e$var$g?.performance?.getEntriesByType?.("navigation")?.every?.(e => e?.loadEventEnd) === false;
|
|
2587
2587
|
// Source: comment on https://stackoverflow.com/a/53525488
|
|
2588
2588
|
// don't use readyState, source: personal experience and comment on https://stackoverflow.com/a/28093606
|
|
2589
|
-
|
|
2589
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Loading gtag after " + (page_hasnt_loaded ? "pageload and " : "") + "3s" + (strict ? "" : ", but setting up queues already"));
|
|
2590
2590
|
if (!strict) $d3d8549954e0318e$export$d031e55ccd4c52dc(GA_ID);
|
|
2591
2591
|
if (page_hasnt_loaded) {
|
|
2592
2592
|
const load_event = await new Promise(r => window.addEventListener("load", r, {
|
|
2593
2593
|
once: true
|
|
2594
2594
|
}));
|
|
2595
|
-
|
|
2595
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("page has loaded", load_event);
|
|
2596
2596
|
}
|
|
2597
2597
|
await new Promise(r => setTimeout(r, 3000));
|
|
2598
2598
|
const script = document.createElement("script"),
|
|
@@ -2600,9 +2600,9 @@ const $d3d8549954e0318e$export$f3354ec2ce95ebd9 = /*@__PURE__*/(0, $268cbd9e4ade
|
|
|
2600
2600
|
script.async = true;
|
|
2601
2601
|
script.src = "https://www.googletagmanager.com/gtag/js?id=" + GA_ID;
|
|
2602
2602
|
head.appendChild(script);
|
|
2603
|
-
|
|
2603
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Loading gtag now", script);
|
|
2604
2604
|
});
|
|
2605
|
-
const $d3d8549954e0318e$export$d031e55ccd4c52dc = /*@__PURE__
|
|
2605
|
+
const $d3d8549954e0318e$export$d031e55ccd4c52dc = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(GA_ID => {
|
|
2606
2606
|
if (process.env.GTAG === "false") return;
|
|
2607
2607
|
$d3d8549954e0318e$var$g.dataLayer ||= [];
|
|
2608
2608
|
function gtag() {
|
|
@@ -2613,9 +2613,9 @@ const $d3d8549954e0318e$export$d031e55ccd4c52dc = /*@__PURE__*/(0, $268cbd9e4ade
|
|
|
2613
2613
|
$d3d8549954e0318e$var$g.gtag("config", GA_ID, {
|
|
2614
2614
|
"send_page_view": false
|
|
2615
2615
|
});
|
|
2616
|
-
|
|
2616
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("configuring gtag with", GA_ID);
|
|
2617
2617
|
});
|
|
2618
|
-
const $d3d8549954e0318e$export$7babcd5d4056b2ca = /*@__PURE__
|
|
2618
|
+
const $d3d8549954e0318e$export$7babcd5d4056b2ca = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(async (raw_displays, get_product_id, more) => {
|
|
2619
2619
|
const displays = raw_displays; // gtag tracking is "obsolete" and we don't expect any customers using something else than LegacyDisplay to use it
|
|
2620
2620
|
if (process.env.GTAG === "false") return;
|
|
2621
2621
|
if (process.env.GTAG_VIEW === "false") return;
|
|
@@ -2637,12 +2637,12 @@ const $d3d8549954e0318e$export$7babcd5d4056b2ca = /*@__PURE__*/(0, $268cbd9e4ade
|
|
|
2637
2637
|
const gtag_args = ["event", "view_item_list", {
|
|
2638
2638
|
"items": gtag_items.slice(i, i + max_products_per_request)
|
|
2639
2639
|
}];
|
|
2640
|
-
|
|
2640
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Sending product view to gtag", gtag_args);
|
|
2641
2641
|
$d3d8549954e0318e$var$g.gtag(...gtag_args);
|
|
2642
2642
|
}
|
|
2643
|
-
} else
|
|
2643
|
+
} else $e6c6e7929ea385ae$export$c2363754d4758444("not sending gtag tracking as there is no gtag");
|
|
2644
2644
|
});
|
|
2645
|
-
const $d3d8549954e0318e$export$f522672c9379e339 = /*@__PURE__
|
|
2645
|
+
const $d3d8549954e0318e$export$f522672c9379e339 = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(async (product_id, index, more) => {
|
|
2646
2646
|
if (process.env.GTAG === "false") return;
|
|
2647
2647
|
if (process.env.GTAG_EVENT_CONSENT_LEVEL !== undefined && !(await $d3d8549954e0318e$var$can_send_gtag_events(product_id, index, more))) return;
|
|
2648
2648
|
if (typeof $d3d8549954e0318e$var$g.gtag == "function") {
|
|
@@ -2655,17 +2655,17 @@ const $d3d8549954e0318e$export$f522672c9379e339 = /*@__PURE__*/(0, $268cbd9e4ade
|
|
|
2655
2655
|
...more
|
|
2656
2656
|
}]
|
|
2657
2657
|
}];
|
|
2658
|
-
|
|
2658
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("calling gtag with arguments", gtag_args);
|
|
2659
2659
|
return $d3d8549954e0318e$var$g.gtag(...gtag_args);
|
|
2660
|
-
} else
|
|
2660
|
+
} else $e6c6e7929ea385ae$export$c2363754d4758444("not sending gtag tracking as there is no gtag");
|
|
2661
2661
|
});
|
|
2662
|
-
const $d3d8549954e0318e$export$f75172d2e289cd02 = /*@__PURE__
|
|
2662
|
+
const $d3d8549954e0318e$export$f75172d2e289cd02 = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(action => {
|
|
2663
2663
|
if (process.env.GA === "false") return;
|
|
2664
2664
|
if (typeof $d3d8549954e0318e$var$g.ga != "function") {
|
|
2665
|
-
|
|
2665
|
+
$e6c6e7929ea385ae$export$c2363754d4758444("Not sending to ga as there is no ga");
|
|
2666
2666
|
return;
|
|
2667
2667
|
}
|
|
2668
|
-
|
|
2668
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("sending", action, "to GA");
|
|
2669
2669
|
return $d3d8549954e0318e$var$g.ga("depict.send", {
|
|
2670
2670
|
hitType: "event",
|
|
2671
2671
|
eventCategory: "Depict",
|
|
@@ -2674,35 +2674,35 @@ const $d3d8549954e0318e$export$f75172d2e289cd02 = /*@__PURE__*/(0, $268cbd9e4ade
|
|
|
2674
2674
|
nonInteraction: 1
|
|
2675
2675
|
});
|
|
2676
2676
|
});
|
|
2677
|
-
const $d3d8549954e0318e$export$ac7296527cb52311 = /*@__PURE__
|
|
2677
|
+
const $d3d8549954e0318e$export$ac7296527cb52311 = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(GAID => {
|
|
2678
2678
|
if (process.env.GA === "false") return;
|
|
2679
2679
|
if (!GAID) {
|
|
2680
|
-
|
|
2680
|
+
$e6c6e7929ea385ae$export$c2363754d4758444(new Error("No GAID specified"));
|
|
2681
2681
|
return;
|
|
2682
2682
|
}
|
|
2683
2683
|
if (typeof $d3d8549954e0318e$var$g.ga != "function") {
|
|
2684
|
-
|
|
2685
|
-
|
|
2684
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Creating GA queue");
|
|
2685
|
+
$c18ce8dadd041cdd$export$674d8cd8b6868154();
|
|
2686
2686
|
}
|
|
2687
|
-
|
|
2687
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Creating ga with GA-ID", GAID);
|
|
2688
2688
|
$d3d8549954e0318e$var$g.ga("create", GAID, "auto", "depict");
|
|
2689
2689
|
$d3d8549954e0318e$export$f3354ec2ce95ebd9(GAID, false);
|
|
2690
2690
|
});
|
|
2691
|
-
const $d3d8549954e0318e$export$127751e82111fcf = /*@__PURE__
|
|
2692
|
-
const $d3d8549954e0318e$export$bf205937e5e012cb = /*@__PURE__
|
|
2691
|
+
const $d3d8549954e0318e$export$127751e82111fcf = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => $d3d8549954e0318e$export$f75172d2e289cd02("rec_bar_click"));
|
|
2692
|
+
const $d3d8549954e0318e$export$bf205937e5e012cb = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => $d3d8549954e0318e$export$f75172d2e289cd02("add_to_cart_after_rec_bar_click"));
|
|
2693
2693
|
async function $d3d8549954e0318e$var$can_send_gtag_events(...stuff_to_log) {
|
|
2694
2694
|
const required_consent_level = process.env.GTAG_LOADING_CONSENT_LEVEL;
|
|
2695
2695
|
if (required_consent_level !== undefined) return true; // just in case
|
|
2696
|
-
const ipns = process.env.CONSENT_FRAMEWORK == "optanon" ?
|
|
2696
|
+
const ipns = process.env.CONSENT_FRAMEWORK == "optanon" ? $2026711c6c2d6204$export$7e4427e80d5fc619() : $28e42b0009d694b2$export$8827362e5e938d26();
|
|
2697
2697
|
for await (const consent_obj of ipns) {
|
|
2698
2698
|
const can_send = consent_obj[required_consent_level];
|
|
2699
|
-
if (!can_send)
|
|
2699
|
+
if (!can_send) $e6c6e7929ea385ae$export$de56f1198d121036("Got no consent for", required_consent_level, "not sending gtag event for", ...stuff_to_log);
|
|
2700
2700
|
return can_send;
|
|
2701
2701
|
}
|
|
2702
2702
|
}
|
|
2703
2703
|
let $e4bebbfa0f0b1454$var$existing_style_tag;
|
|
2704
2704
|
let $e4bebbfa0f0b1454$var$reactions_in_last_s = 0;
|
|
2705
|
-
const $e4bebbfa0f0b1454$export$59ba1eb2c083f0cd = /*@__PURE__
|
|
2705
|
+
const $e4bebbfa0f0b1454$export$59ba1eb2c083f0cd = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(async css => {
|
|
2706
2706
|
const style_tag = await ($e4bebbfa0f0b1454$var$existing_style_tag ||= (0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).wait_for_element("head").then(head => {
|
|
2707
2707
|
const tag = document.createElement("style");
|
|
2708
2708
|
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onremoved(
|
|
@@ -2712,16 +2712,16 @@ const $e4bebbfa0f0b1454$export$59ba1eb2c083f0cd = /*@__PURE__*/(0, $268cbd9e4ade
|
|
|
2712
2712
|
// just make sure to not freak out if it's already been added again
|
|
2713
2713
|
return;
|
|
2714
2714
|
if ($e4bebbfa0f0b1454$var$reactions_in_last_s >= 10) {
|
|
2715
|
-
|
|
2715
|
+
$268cbd9e4ade92db$export$f18d5b0af29128b7(new Error("Someone removed our styling but insists on it (10 removals in previous second). Giving up \uD83D\uDE2B"), "error");
|
|
2716
2716
|
return;
|
|
2717
2717
|
}
|
|
2718
|
-
|
|
2718
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Someone removed our styling \uD83D\uDE24, reinserting", eoe);
|
|
2719
2719
|
$e4bebbfa0f0b1454$var$reactions_in_last_s++;
|
|
2720
2720
|
setTimeout(() => $e4bebbfa0f0b1454$var$reactions_in_last_s--, 1000);
|
|
2721
2721
|
document.head.append(tag); // we're sure that head exists now since we inserted it there previously
|
|
2722
2722
|
});
|
|
2723
2723
|
|
|
2724
|
-
|
|
2724
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("inserting", tag, "into", head);
|
|
2725
2725
|
return head.appendChild(tag);
|
|
2726
2726
|
}));
|
|
2727
2727
|
style_tag.append(css);
|
|
@@ -2729,10 +2729,10 @@ const $e4bebbfa0f0b1454$export$59ba1eb2c083f0cd = /*@__PURE__*/(0, $268cbd9e4ade
|
|
|
2729
2729
|
const $e4bebbfa0f0b1454$export$a96c18473f2af463 = (tenant, selector, validator) => {
|
|
2730
2730
|
return (0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onexists(selector, ({
|
|
2731
2731
|
element: element
|
|
2732
|
-
}) =>
|
|
2732
|
+
}) => $c8263a2185830bf1$export$2c34560c3749dc63(element, tenant.get_product_id, (p_id, r_id, was_unmatching, event) => {
|
|
2733
2733
|
if (typeof validator === "function" && !validator(event)) return;
|
|
2734
|
-
if (!was_unmatching)
|
|
2735
|
-
|
|
2734
|
+
if (!was_unmatching) $d3d8549954e0318e$export$bf205937e5e012cb();
|
|
2735
|
+
$e0a87646d12cb987$export$9028351cb994757e({
|
|
2736
2736
|
...tenant,
|
|
2737
2737
|
product_id: p_id,
|
|
2738
2738
|
...(was_unmatching ? {
|
|
@@ -2747,11 +2747,11 @@ const $e4bebbfa0f0b1454$export$a4f97b27a0592e6c = url => (url ? new URL(url, win
|
|
|
2747
2747
|
const $e4bebbfa0f0b1454$export$692b606677218a16 = callback => {
|
|
2748
2748
|
if (document.depictwashere) {
|
|
2749
2749
|
if (process.env.BUILD_TARGET === "dev") {
|
|
2750
|
-
|
|
2750
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("HMR tried to rerun us, reloading page");
|
|
2751
2751
|
/* eslint-disable no-self-assign */
|
|
2752
2752
|
location.href = location.href;
|
|
2753
2753
|
}
|
|
2754
|
-
|
|
2754
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Script has already ran", document.currentScript, "is exiting");
|
|
2755
2755
|
return;
|
|
2756
2756
|
}
|
|
2757
2757
|
if (process.env.BUILD_TARGET === "dev") /* eslint-disable no-console */console.clear = new Proxy(console.clear, {
|
|
@@ -2773,26 +2773,26 @@ function $e4bebbfa0f0b1454$export$328e81c44cddf3c0(callback, get_market, support
|
|
|
2773
2773
|
let localstorage_override;
|
|
2774
2774
|
const query_param_override = new URLSearchParams(location.search).get("depict-override-market");
|
|
2775
2775
|
if (query_param_override !== null) {
|
|
2776
|
-
|
|
2776
|
+
$e6c6e7929ea385ae$export$de56f1198d121036(`Found ?depict-override-market=${query_param_override}. Using that as the market`);
|
|
2777
2777
|
get_market = () => query_param_override;
|
|
2778
2778
|
localStorage.setItem("depict-override-market", query_param_override);
|
|
2779
2779
|
} else if ((localstorage_override = localStorage.getItem("depict-override-market")) !== null) {
|
|
2780
|
-
|
|
2780
|
+
$e6c6e7929ea385ae$export$de56f1198d121036(`Found depict-override-market="${localstorage_override}" in localStorage. Using that as the market`);
|
|
2781
2781
|
get_market = () => localstorage_override;
|
|
2782
2782
|
}
|
|
2783
2783
|
}
|
|
2784
2784
|
const market = await get_market();
|
|
2785
2785
|
if (supported_markets.includes(market)) {
|
|
2786
|
-
|
|
2786
|
+
$e6c6e7929ea385ae$export$de56f1198d121036(`Initializing with market: ${market}`);
|
|
2787
2787
|
return callback(market).catch((0, $548fd58b14b25a52$export$8048b892d651b310));
|
|
2788
2788
|
} else if (unsupported_markets.includes(market)) {
|
|
2789
|
-
|
|
2789
|
+
$e6c6e7929ea385ae$export$de56f1198d121036(`Unsupported market: ${market}. Exiting...`);
|
|
2790
2790
|
return;
|
|
2791
2791
|
} else if (process.env.DEBUG === "true" && location.host.endsWith(".demo.depict.ai") && preferred_demo_market) {
|
|
2792
|
-
|
|
2792
|
+
$e6c6e7929ea385ae$export$de56f1198d121036(`On demosite with default market override. Setting market to ${preferred_demo_market}`);
|
|
2793
2793
|
return callback(preferred_demo_market).catch((0, $548fd58b14b25a52$export$8048b892d651b310));
|
|
2794
2794
|
} else {
|
|
2795
|
-
|
|
2795
|
+
$548fd58b14b25a52$export$8048b892d651b310(new Error(`Unknown market: "${market}". Exiting...`));
|
|
2796
2796
|
return;
|
|
2797
2797
|
}
|
|
2798
2798
|
});
|
|
@@ -2812,9 +2812,9 @@ class $16f3a26cfac77a4c$export$8d42ce4827f43582 {
|
|
|
2812
2812
|
this.TYPE = options.TYPE || "normal";
|
|
2813
2813
|
this.catchify = (0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9);
|
|
2814
2814
|
this.err = (0, $548fd58b14b25a52$export$8048b892d651b310);
|
|
2815
|
-
if (this.GA_ID)
|
|
2815
|
+
if (this.GA_ID) $d3d8549954e0318e$export$ac7296527cb52311(this.GA_ID);
|
|
2816
2816
|
// https://gitlab.com/depict-ai/depict.ai/-/merge_requests/2318#note_927887712
|
|
2817
|
-
this.get_product_id =
|
|
2817
|
+
this.get_product_id = $268cbd9e4ade92db$export$b3bbfd758f11cfa9((...args) => {
|
|
2818
2818
|
const id = options.get_product_id(...args);
|
|
2819
2819
|
if (id instanceof Promise) return id.then(id => id || "");
|
|
2820
2820
|
return id || "";
|
|
@@ -2826,9 +2826,9 @@ class $16f3a26cfac77a4c$export$8d42ce4827f43582 {
|
|
|
2826
2826
|
this.type = this.TYPE;
|
|
2827
2827
|
this.catchify = (0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9);
|
|
2828
2828
|
this.err = (0, $548fd58b14b25a52$export$8048b892d651b310);
|
|
2829
|
-
if (localStorage.getItem("highlight-depict") === "true")
|
|
2829
|
+
if (localStorage.getItem("highlight-depict") === "true") $e4bebbfa0f0b1454$export$59ba1eb2c083f0cd(".depict { background: #f00a !important; }");
|
|
2830
2830
|
if (options.pageview_tracking ?? true) (async () => {
|
|
2831
|
-
|
|
2831
|
+
$72ee205b59322497$export$f7cb1bd47199ec38({
|
|
2832
2832
|
market: this.market,
|
|
2833
2833
|
tenant: this.tenant,
|
|
2834
2834
|
get_product_id: this.get_product_id
|
|
@@ -2843,7 +2843,7 @@ const $fbb09973782881cb$var$default_get_rec_id = elem => elem?.dataset?.depict_r
|
|
|
2843
2843
|
const $fbb09973782881cb$var$default_get_prod_id = elem => elem?.dataset?.depict_product_id || elem?.dataset?.productId;
|
|
2844
2844
|
const $fbb09973782881cb$var$default_get_ga_prod_id = elem => elem?.dataset?.ga_ids;
|
|
2845
2845
|
const $fbb09973782881cb$var$get_index_in_children_of_el = el => [...(el?.parentElement?.children || [])].indexOf(el);
|
|
2846
|
-
const $fbb09973782881cb$export$29a6094e0bd8bc5f = /*@__PURE__
|
|
2846
|
+
const $fbb09973782881cb$export$29a6094e0bd8bc5f = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(async (options, gtag_options) => {
|
|
2847
2847
|
const {
|
|
2848
2848
|
product_selector: product_selector,
|
|
2849
2849
|
a2c_selector: a2c_selector,
|
|
@@ -2875,14 +2875,14 @@ const $fbb09973782881cb$export$29a6094e0bd8bc5f = /*@__PURE__*/(0, $268cbd9e4ade
|
|
|
2875
2875
|
const gtag_view_product_ids = {};
|
|
2876
2876
|
// Page view
|
|
2877
2877
|
if (t instanceof (0, $16f3a26cfac77a4c$export$8d42ce4827f43582)) (async () => {
|
|
2878
|
-
|
|
2878
|
+
$72ee205b59322497$export$eee4c4d924348b05({
|
|
2879
2879
|
tenant: t.tenant,
|
|
2880
2880
|
market: t.market,
|
|
2881
2881
|
product_id: await t.get_product_id()
|
|
2882
2882
|
});
|
|
2883
2883
|
})();
|
|
2884
2884
|
// Product card
|
|
2885
|
-
const add_tracking_to_product_card =
|
|
2885
|
+
const add_tracking_to_product_card = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(async ({
|
|
2886
2886
|
element: elem
|
|
2887
2887
|
}) => {
|
|
2888
2888
|
const index = $fbb09973782881cb$var$get_index_in_children_of_el(elem);
|
|
@@ -2892,7 +2892,7 @@ const $fbb09973782881cb$export$29a6094e0bd8bc5f = /*@__PURE__*/(0, $268cbd9e4ade
|
|
|
2892
2892
|
// Impression tracking
|
|
2893
2893
|
if (impression_tracking && !impression_tracked_els.has(elem)) {
|
|
2894
2894
|
impression_tracked_els.add(elem);
|
|
2895
|
-
|
|
2895
|
+
$8e19f8200d357fe7$export$37125ccc5dd98050({
|
|
2896
2896
|
element: elem,
|
|
2897
2897
|
data: {
|
|
2898
2898
|
recommendation_id: data.recommendation_id,
|
|
@@ -2924,12 +2924,12 @@ const $fbb09973782881cb$export$29a6094e0bd8bc5f = /*@__PURE__*/(0, $268cbd9e4ade
|
|
|
2924
2924
|
index: index
|
|
2925
2925
|
})));
|
|
2926
2926
|
} catch (e) {
|
|
2927
|
-
|
|
2927
|
+
$e6c6e7929ea385ae$export$c2363754d4758444("Something went wrong on a product with multiple ga_ids", e);
|
|
2928
2928
|
}
|
|
2929
2929
|
}
|
|
2930
2930
|
if (typeof BroadcastChannel == "function") {
|
|
2931
2931
|
// right click and mouse wheel click tracking
|
|
2932
|
-
const handler =
|
|
2932
|
+
const handler = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(e => $44909e19109bf973$export$8f66c4c7fb96eda2(e, data.product_id));
|
|
2933
2933
|
elem.addEventListener("contextmenu", handler);
|
|
2934
2934
|
elem.addEventListener("auxclick", e => e.button === 1 && handler(e)); // actual wheel click - some mouses / OS:es also dispatch auxclick on rightclick
|
|
2935
2935
|
}
|
|
@@ -2937,14 +2937,14 @@ const $fbb09973782881cb$export$29a6094e0bd8bc5f = /*@__PURE__*/(0, $268cbd9e4ade
|
|
|
2937
2937
|
click_tracking: {
|
|
2938
2938
|
if (click_tracked_els.has(elem)) break click_tracking;
|
|
2939
2939
|
click_tracked_els.add(elem);
|
|
2940
|
-
elem.addEventListener("click",
|
|
2940
|
+
elem.addEventListener("click", $268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => {
|
|
2941
2941
|
const product_id = data.product_id || "DNT";
|
|
2942
2942
|
const recommendation_id = data.recommendation_id || "not_depict";
|
|
2943
2943
|
localStorage.setItem(`depict_attribution_${product_id}`, recommendation_id);
|
|
2944
2944
|
const index = $fbb09973782881cb$var$get_index_in_children_of_el(elem);
|
|
2945
2945
|
const click_location = prefix + (index + 1);
|
|
2946
|
-
|
|
2947
|
-
|
|
2946
|
+
$d3d8549954e0318e$export$127751e82111fcf();
|
|
2947
|
+
$e0a87646d12cb987$export$15f8a0cd5a8c0ebb({
|
|
2948
2948
|
...(options.t || {}),
|
|
2949
2949
|
...options,
|
|
2950
2950
|
...data,
|
|
@@ -2958,15 +2958,15 @@ const $fbb09973782881cb$export$29a6094e0bd8bc5f = /*@__PURE__*/(0, $268cbd9e4ade
|
|
|
2958
2958
|
list_name: gtag_list_name,
|
|
2959
2959
|
...gtag_options
|
|
2960
2960
|
};
|
|
2961
|
-
|
|
2961
|
+
$d3d8549954e0318e$export$f522672c9379e339(data.product_id, index, gtag_options_with_click_location);
|
|
2962
2962
|
try {
|
|
2963
2963
|
const to_iterate = [];
|
|
2964
2964
|
if (data.ga_product_id) to_iterate.push(...(data.ga_product_id.toString?.().split(",") ?? []));
|
|
2965
2965
|
to_iterate.push(...(data.ga_product_ids || []));
|
|
2966
|
-
to_iterate.forEach(id =>
|
|
2966
|
+
to_iterate.forEach(id => $d3d8549954e0318e$export$f522672c9379e339(id, index, gtag_options_with_click_location));
|
|
2967
2967
|
} catch (e) {
|
|
2968
|
-
|
|
2969
|
-
|
|
2968
|
+
$e6c6e7929ea385ae$export$c2363754d4758444("Something went wrong when sending gtag click tracking on a product with multiple ga_ids");
|
|
2969
|
+
$268cbd9e4ade92db$export$f18d5b0af29128b7(e, "error");
|
|
2970
2970
|
}
|
|
2971
2971
|
}
|
|
2972
2972
|
}), {
|
|
@@ -2996,8 +2996,8 @@ const $fbb09973782881cb$export$29a6094e0bd8bc5f = /*@__PURE__*/(0, $268cbd9e4ade
|
|
|
2996
2996
|
});
|
|
2997
2997
|
element.dispatchEvent(click);
|
|
2998
2998
|
}
|
|
2999
|
-
|
|
3000
|
-
|
|
2999
|
+
$d3d8549954e0318e$export$bf205937e5e012cb();
|
|
3000
|
+
$e0a87646d12cb987$export$9028351cb994757e({
|
|
3001
3001
|
...(options.t || {}),
|
|
3002
3002
|
...options,
|
|
3003
3003
|
...data
|
|
@@ -3010,11 +3010,11 @@ const $fbb09973782881cb$export$29a6094e0bd8bc5f = /*@__PURE__*/(0, $268cbd9e4ade
|
|
|
3010
3010
|
if (options.shade) $fbb09973782881cb$export$6ebd242c09192cec(elem);
|
|
3011
3011
|
if (options.attempt_gtag_view_tracking && Object.keys(gtag_view_product_ids)?.length)
|
|
3012
3012
|
// setTimeout to batch the requests / put it all into one gtag view event
|
|
3013
|
-
setTimeout(
|
|
3013
|
+
setTimeout($268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => {
|
|
3014
3014
|
for (const key in gtag_view_product_ids) {
|
|
3015
3015
|
const product_ids = gtag_view_product_ids[key];
|
|
3016
3016
|
if (product_ids?.length) {
|
|
3017
|
-
|
|
3017
|
+
$d3d8549954e0318e$export$7babcd5d4056b2ca(product_ids, () => "", {
|
|
3018
3018
|
list_name: key,
|
|
3019
3019
|
...gtag_options
|
|
3020
3020
|
});
|
|
@@ -3025,14 +3025,14 @@ const $fbb09973782881cb$export$29a6094e0bd8bc5f = /*@__PURE__*/(0, $268cbd9e4ade
|
|
|
3025
3025
|
});
|
|
3026
3026
|
if (typeof product_selector == "string") (0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onexists(product_selector, add_tracking_to_product_card);else if (product_elements && typeof product_elements?.[Symbol.iterator] == "function") for (const element of product_elements) add_tracking_to_product_card({
|
|
3027
3027
|
element: element
|
|
3028
|
-
});else
|
|
3028
|
+
});else $e6c6e7929ea385ae$export$c2363754d4758444(new Error("AIO can't find elements, try adding a selector or els")); // don't throw so that a2c tracking keeps working
|
|
3029
3029
|
// Page A2C button tracking
|
|
3030
3030
|
const a2c_handler = ({
|
|
3031
3031
|
element: element
|
|
3032
3032
|
}) => {
|
|
3033
|
-
|
|
3034
|
-
if (!was_unmatching)
|
|
3035
|
-
|
|
3033
|
+
$c8263a2185830bf1$export$2c34560c3749dc63(element, get_product_id, (product_id, recommendation_id, was_unmatching) => {
|
|
3034
|
+
if (!was_unmatching) $d3d8549954e0318e$export$bf205937e5e012cb();
|
|
3035
|
+
$e0a87646d12cb987$export$9028351cb994757e({
|
|
3036
3036
|
...(options.t || {}),
|
|
3037
3037
|
...options,
|
|
3038
3038
|
product_id: product_id,
|
|
@@ -3047,7 +3047,7 @@ const $fbb09973782881cb$export$29a6094e0bd8bc5f = /*@__PURE__*/(0, $268cbd9e4ade
|
|
|
3047
3047
|
};
|
|
3048
3048
|
if (typeof a2c_selector == "string") (0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onexists(a2c_selector, a2c_handler);else if (a2c_elements && typeof a2c_elements?.[Symbol.iterator] == "function") for (const element of a2c_elements) a2c_handler({
|
|
3049
3049
|
element: element
|
|
3050
|
-
});else
|
|
3050
|
+
});else $e6c6e7929ea385ae$export$c2363754d4758444(new Error("Can't find a2c button, try adding a selector or els"));
|
|
3051
3051
|
return {
|
|
3052
3052
|
add_a2c_element: element => a2c_handler({
|
|
3053
3053
|
element: element
|
|
@@ -3057,7 +3057,7 @@ const $fbb09973782881cb$export$29a6094e0bd8bc5f = /*@__PURE__*/(0, $268cbd9e4ade
|
|
|
3057
3057
|
})
|
|
3058
3058
|
};
|
|
3059
3059
|
});
|
|
3060
|
-
const $fbb09973782881cb$export$6ebd242c09192cec = /*@__PURE__
|
|
3060
|
+
const $fbb09973782881cb$export$6ebd242c09192cec = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(element => {
|
|
3061
3061
|
element.style.boxShadow = "rgba(255,0,0,0.5) 10px 10px 30px 40px";
|
|
3062
3062
|
element.style.background = "rgba(255,0,0,0.5)";
|
|
3063
3063
|
element.style.color = "white";
|
|
@@ -3102,18 +3102,18 @@ async function $d2fc3fb450961938$export$bcd70d5ed1cf6313(url, options, max_retri
|
|
|
3102
3102
|
const response = await fetch(url, options);
|
|
3103
3103
|
if (!response || !response.ok || response.status !== 200) {
|
|
3104
3104
|
if (response.status === 422) {
|
|
3105
|
-
|
|
3105
|
+
$268cbd9e4ade92db$export$b3bbfd758f11cfa9($d2fc3fb450961938$var$send_sentry_422)(response, options?.body || {}, stack);
|
|
3106
3106
|
has_succeeded = true;
|
|
3107
3107
|
} else if (response.status === 404) has_succeeded = true;
|
|
3108
|
-
|
|
3108
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Response not ok", response);
|
|
3109
3109
|
} else has_succeeded = true;
|
|
3110
3110
|
result = response;
|
|
3111
3111
|
} catch (error) {
|
|
3112
|
-
|
|
3112
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Error while fetching: ", error, url, options);
|
|
3113
3113
|
// Don't retry CORS
|
|
3114
3114
|
if (error.message.includes("CORS") && error.name.includes("CORS")) has_succeeded = true;
|
|
3115
3115
|
} finally {
|
|
3116
|
-
if (!has_succeeded) await
|
|
3116
|
+
if (!has_succeeded) await $55769f63ea4d8da4$export$5c069c93d2b7493f(try_again_in_ms);
|
|
3117
3117
|
try_again_in_ms = calculate_retry(try_again_in_ms);
|
|
3118
3118
|
max_retries -= 1;
|
|
3119
3119
|
}
|
|
@@ -3122,12 +3122,12 @@ async function $d2fc3fb450961938$export$bcd70d5ed1cf6313(url, options, max_retri
|
|
|
3122
3122
|
async function $d2fc3fb450961938$var$send_sentry_422(response, body, stack) {
|
|
3123
3123
|
const msg = `Validation error: got 422 from API`;
|
|
3124
3124
|
const text = await response.clone().text();
|
|
3125
|
-
|
|
3125
|
+
$e6c6e7929ea385ae$export$de56f1198d121036(msg, "body", body, "response", response, "text", text, "stack", stack);
|
|
3126
3126
|
(0, $61a34358bf0d3d8b$export$af2e17a20c2ea3c5).withScope(function (scope) {
|
|
3127
3127
|
scope.setExtra("stack", stack);
|
|
3128
3128
|
scope.setExtra("request_body", body);
|
|
3129
3129
|
scope.setExtra("response", response);
|
|
3130
|
-
scope.setExtra("serialized_response",
|
|
3130
|
+
scope.setExtra("serialized_response", $45e05ec4fd7f1ee7$export$39d526a1194b6499(response));
|
|
3131
3131
|
scope.setExtra("response_text", text);
|
|
3132
3132
|
scope.setLevel("error");
|
|
3133
3133
|
this.captureException(new Error(msg));
|
|
@@ -3138,8 +3138,8 @@ async function $94edfb6d9c42a288$export$1bc0df10745d5412(t, options, headers, ge
|
|
|
3138
3138
|
return res?.displays || [];
|
|
3139
3139
|
}
|
|
3140
3140
|
async function $94edfb6d9c42a288$export$d40679eb4cf32f09(t, options, headers, get_url = $94edfb6d9c42a288$var$default_get_fetch_url) {
|
|
3141
|
-
const dsid =
|
|
3142
|
-
const session_id = options.session_id ||
|
|
3141
|
+
const dsid = $e0a87646d12cb987$export$6399bdb2291895e0();
|
|
3142
|
+
const session_id = options.session_id || $e0a87646d12cb987$export$61e7e1f11e96692f();
|
|
3143
3143
|
const user_id = options.user_id || dsid;
|
|
3144
3144
|
const body = {
|
|
3145
3145
|
tenant: t.tenant,
|
|
@@ -3151,17 +3151,17 @@ async function $94edfb6d9c42a288$export$d40679eb4cf32f09(t, options, headers, ge
|
|
|
3151
3151
|
...options
|
|
3152
3152
|
};
|
|
3153
3153
|
const endpoint = $94edfb6d9c42a288$var$get_fetch_endpoint_from_options(options);
|
|
3154
|
-
return await
|
|
3154
|
+
return await $d2fc3fb450961938$export$bcd70d5ed1cf6313(get_url(endpoint), {
|
|
3155
3155
|
body: JSON.stringify(body),
|
|
3156
3156
|
...(headers ? {
|
|
3157
3157
|
headers: headers
|
|
3158
3158
|
} : {}),
|
|
3159
3159
|
method: "POST"
|
|
3160
3160
|
}) // @ts-ignore
|
|
3161
|
-
.then(r => r.json()).catch(e =>
|
|
3161
|
+
.then(r => r.json()).catch(e => $e6c6e7929ea385ae$export$de56f1198d121036("fetch_retry threw", e));
|
|
3162
3162
|
}
|
|
3163
3163
|
function $94edfb6d9c42a288$var$default_get_fetch_url(type) {
|
|
3164
|
-
return
|
|
3164
|
+
return $e4a18bf12ad092d9$export$fe609f0216e4ebef(`${(0, $4c6861fbcd3a0611$export$362abebb4b313340)}/v2/recommend/products/${type}`);
|
|
3165
3165
|
}
|
|
3166
3166
|
function $94edfb6d9c42a288$var$get_fetch_endpoint_from_options(options) {
|
|
3167
3167
|
if (options["category_id"] !== undefined) return "category";else if (options["product_id"] !== undefined) return "product";else if (options["product_ids"] !== undefined) return "products";
|
|
@@ -3175,7 +3175,7 @@ async function $558ccd2de887e6d9$export$a9fc160c5ed83bd7(t, rendering_options) {
|
|
|
3175
3175
|
} = rendering_options;
|
|
3176
3176
|
const displays = await $558ccd2de887e6d9$var$make_sure_we_have_displays(t, rendering_options);
|
|
3177
3177
|
if (!displays?.length) {
|
|
3178
|
-
|
|
3178
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("RR: Got no displays for type " + type + ", can't recover.", t, rendering_options);
|
|
3179
3179
|
return {};
|
|
3180
3180
|
}
|
|
3181
3181
|
// return if too few displays
|
|
@@ -3186,19 +3186,19 @@ async function $558ccd2de887e6d9$export$a9fc160c5ed83bd7(t, rendering_options) {
|
|
|
3186
3186
|
if (!good_displays) return {};
|
|
3187
3187
|
const processed_displays = await $558ccd2de887e6d9$export$c22e610107c5a15a(t, rendering_options, displays);
|
|
3188
3188
|
if (!processed_displays.length) {
|
|
3189
|
-
|
|
3189
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("RR: No displays left after preprocessing");
|
|
3190
3190
|
return {};
|
|
3191
3191
|
}
|
|
3192
3192
|
const {
|
|
3193
3193
|
template: template,
|
|
3194
3194
|
post_processors = []
|
|
3195
3195
|
} = rendering_options;
|
|
3196
|
-
const caught_post_processing_functions = post_processors.map(post_pro =>
|
|
3196
|
+
const caught_post_processing_functions = post_processors.map(post_pro => $268cbd9e4ade92db$export$b3bbfd758f11cfa9(post_pro));
|
|
3197
3197
|
let a;
|
|
3198
|
-
const caught_html2elems =
|
|
3198
|
+
const caught_html2elems = $268cbd9e4ade92db$export$b3bbfd758f11cfa9((0, $bf7f12fe044e41b2$export$44951404cb8d0583));
|
|
3199
3199
|
let output_elements;
|
|
3200
3200
|
if (typeof template === "function") {
|
|
3201
|
-
const caught_template =
|
|
3201
|
+
const caught_template = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(template);
|
|
3202
3202
|
output_elements = (await Promise.allSettled(processed_displays.map(async (display, index) => {
|
|
3203
3203
|
const event_listeners = [];
|
|
3204
3204
|
let keep = true;
|
|
@@ -3219,7 +3219,7 @@ async function $558ccd2de887e6d9$export$a9fc160c5ed83bd7(t, rendering_options) {
|
|
|
3219
3219
|
return Array.from(post_processed_elements);
|
|
3220
3220
|
}))).flat();
|
|
3221
3221
|
if (!output_elements.length) {
|
|
3222
|
-
|
|
3222
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("RR: No displays left after postprocessing/rendering");
|
|
3223
3223
|
return {};
|
|
3224
3224
|
}
|
|
3225
3225
|
return {
|
|
@@ -3281,7 +3281,7 @@ async function $558ccd2de887e6d9$export$c22e610107c5a15a(t, rendering_options, d
|
|
|
3281
3281
|
max_items: max_items,
|
|
3282
3282
|
pre_processors = []
|
|
3283
3283
|
} = rendering_options;
|
|
3284
|
-
const caught_pre_processors = pre_processors.map(pre_pro =>
|
|
3284
|
+
const caught_pre_processors = pre_processors.map(pre_pro => $268cbd9e4ade92db$export$b3bbfd758f11cfa9(pre_pro));
|
|
3285
3285
|
const processed_displays = [];
|
|
3286
3286
|
for (let i = 0; i < displays.length; i++) {
|
|
3287
3287
|
// classic for loop is both fast and can be stopped with break
|
|
@@ -3316,7 +3316,7 @@ class $558ccd2de887e6d9$export$da854280fb61cd32 {
|
|
|
3316
3316
|
async function $558ccd2de887e6d9$var$check_displays(displays, min_items_to_run) {
|
|
3317
3317
|
// don't run if too few recs
|
|
3318
3318
|
if (min_items_to_run && displays.length < min_items_to_run) {
|
|
3319
|
-
|
|
3319
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("RR: Got too few displays, exiting");
|
|
3320
3320
|
return false;
|
|
3321
3321
|
}
|
|
3322
3322
|
return true;
|
|
@@ -3333,7 +3333,7 @@ async function $558ccd2de887e6d9$var$make_sure_we_have_displays(t, rendering_opt
|
|
|
3333
3333
|
...(rendering_options.extra_api_options || {})
|
|
3334
3334
|
};
|
|
3335
3335
|
for (const key of ["product_ids", "category_id", "product_id"]) if (key in rendering_options) get_displays_options[key] = rendering_options[key];
|
|
3336
|
-
return await
|
|
3336
|
+
return await $94edfb6d9c42a288$export$1bc0df10745d5412(t, get_displays_options, rendering_options.headers || {}).catch(t.err);
|
|
3337
3337
|
}
|
|
3338
3338
|
async function $e5479d0db39d328b$export$c83d8da642b5104a(t, options, GWVM_opts) {
|
|
3339
3339
|
const {
|
|
@@ -3353,8 +3353,8 @@ async function $e5479d0db39d328b$export$c83d8da642b5104a(t, options, GWVM_opts)
|
|
|
3353
3353
|
only_full_rows = false,
|
|
3354
3354
|
should_preload = true
|
|
3355
3355
|
} = GWVM_opts;
|
|
3356
|
-
const outer_els = typeof container_template === "string" ? [
|
|
3357
|
-
const [root] =
|
|
3356
|
+
const outer_els = typeof container_template === "string" ? [...$bf7f12fe044e41b2$export$44951404cb8d0583(container_template)] : container_template;
|
|
3357
|
+
const [root] = $bf7f12fe044e41b2$export$5e63aea0cac01fa0(outer_els, container_selector);
|
|
3358
3358
|
const cut_off_promise_obj = /*@__PURE__*/new (0, $04a37742898e4bd5$export$32ccf3a614c84258)();
|
|
3359
3359
|
const i_observer = new IntersectionObserver(catchify($e5479d0db39d328b$var$observer_callback));
|
|
3360
3360
|
let cut_off_point = 0;
|
|
@@ -3394,8 +3394,8 @@ async function $e5479d0db39d328b$export$c83d8da642b5104a(t, options, GWVM_opts)
|
|
|
3394
3394
|
return rendering_results;
|
|
3395
3395
|
}
|
|
3396
3396
|
root.append(...rendered_elements);
|
|
3397
|
-
const load_more_cont =
|
|
3398
|
-
const button_element = button instanceof Element ? button :
|
|
3397
|
+
const load_more_cont = $bf7f12fe044e41b2$export$d3e2a0560cbf4787(`<div class="load-more-container"></div>`);
|
|
3398
|
+
const button_element = button instanceof Element ? button : $bf7f12fe044e41b2$export$d3e2a0560cbf4787(`<button class="load_more">${button || "Visa mer"}</button>`);
|
|
3399
3399
|
button_element.addEventListener("click", load_more);
|
|
3400
3400
|
load_more_cont.append(button_element);
|
|
3401
3401
|
root.after(load_more_cont);
|
|
@@ -3416,7 +3416,7 @@ async function $e5479d0db39d328b$export$c83d8da642b5104a(t, options, GWVM_opts)
|
|
|
3416
3416
|
load_more_observer.observe(load_more_cont);
|
|
3417
3417
|
}
|
|
3418
3418
|
if (title) {
|
|
3419
|
-
const [title_el] =
|
|
3419
|
+
const [title_el] = $bf7f12fe044e41b2$export$5e63aea0cac01fa0(outer_els, title_selector || "h1.title");
|
|
3420
3420
|
if (title_el) {
|
|
3421
3421
|
if (title instanceof Element) title_el.replaceWith(title);else title_el.innerText = title;
|
|
3422
3422
|
} else if (is_debug) {
|
|
@@ -3456,7 +3456,7 @@ info, cut_off_point, i_observer, cut_off_promise_obj, load_more) {
|
|
|
3456
3456
|
const extras = info.extras ||= {};
|
|
3457
3457
|
extras.load_more ||= load_more;
|
|
3458
3458
|
extras.load_more_ipo ||= cut_off_promise_obj;
|
|
3459
|
-
|
|
3459
|
+
$bf7f12fe044e41b2$export$5e63aea0cac01fa0(elements_arr, "img:not(.filler):not(.ngl):not(.nolazy)").forEach(image => {
|
|
3460
3460
|
// "img" also selects "image" in IE11 which can be an SVG element which doesn't have a src property, therefore optional chaining
|
|
3461
3461
|
if ((image?.src?.length || image?.dataset?.src) && image?.src?.substr?.(0, 6) != "data:") {
|
|
3462
3462
|
if (is_initially_hidden && !image?.dataset.src) {
|
|
@@ -3517,7 +3517,7 @@ async function $d1ef5fbddf08305d$export$41de2959a8dd405d(t, options, GWVM_opts,
|
|
|
3517
3517
|
} = rec;
|
|
3518
3518
|
if (!parentElement) {
|
|
3519
3519
|
// first rec was removed
|
|
3520
|
-
[rec] =
|
|
3520
|
+
[rec] = $bf7f12fe044e41b2$export$5e63aea0cac01fa0(result?.elements || [], rec_selector);
|
|
3521
3521
|
parentElement = rec?.parentElement;
|
|
3522
3522
|
if (!parentElement) throw new Error("Could not find element matching " + rec_selector + "to calculate width");
|
|
3523
3523
|
}
|
|
@@ -3553,7 +3553,7 @@ async function $d1ef5fbddf08305d$export$41de2959a8dd405d(t, options, GWVM_opts,
|
|
|
3553
3553
|
}
|
|
3554
3554
|
};
|
|
3555
3555
|
// @ts-ignore
|
|
3556
|
-
result = await
|
|
3556
|
+
result = await $e5479d0db39d328b$export$c83d8da642b5104a(t, options, modified_GWVM_opts);
|
|
3557
3557
|
if (!result?.elements)
|
|
3558
3558
|
// no chance in finding any elements, API didn't return recs
|
|
3559
3559
|
return result;
|
|
@@ -3615,28 +3615,28 @@ async function $55dae85e9309db86$export$c0a4d29bc45a38c6(t, options, GWVM_opts,
|
|
|
3615
3615
|
$55dae85e9309db86$var$observe_first_el_after_dominsertion(all_rendered_elements, elements, info.extras.load_more);
|
|
3616
3616
|
return elements;
|
|
3617
3617
|
}];
|
|
3618
|
-
return await
|
|
3618
|
+
return await $d1ef5fbddf08305d$export$41de2959a8dd405d(t, options, options_for_auto_gwvm, {
|
|
3619
3619
|
rec_selector: rec_selector
|
|
3620
3620
|
});
|
|
3621
3621
|
}
|
|
3622
3622
|
function $55dae85e9309db86$var$observe_first_el_after_dominsertion(all_rendered_elements, elements, load_more) {
|
|
3623
3623
|
const element = $55dae85e9309db86$var$find_html_element(elements);
|
|
3624
3624
|
if (!element) {
|
|
3625
|
-
|
|
3625
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Infinite scroll won't work, couldn't find element to observe", elements);
|
|
3626
3626
|
return;
|
|
3627
3627
|
}
|
|
3628
|
-
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).wait_for_element(element).then(
|
|
3628
|
+
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).wait_for_element(element).then($268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => {
|
|
3629
3629
|
$55dae85e9309db86$var$find_last_el_and_observe(all_rendered_elements, load_more);
|
|
3630
3630
|
}));
|
|
3631
3631
|
}
|
|
3632
3632
|
function $55dae85e9309db86$var$find_last_el_and_observe(all_rendered_elements, load_more) {
|
|
3633
3633
|
const last_visible_el = $55dae85e9309db86$var$find_last_visible(all_rendered_elements);
|
|
3634
3634
|
if (!last_visible_el) return;
|
|
3635
|
-
const i_o = new IntersectionObserver(
|
|
3635
|
+
const i_o = new IntersectionObserver($268cbd9e4ade92db$export$b3bbfd758f11cfa9(records => {
|
|
3636
3636
|
for (const record of records) if (record.isIntersecting) {
|
|
3637
|
-
|
|
3637
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("loading more because of", record);
|
|
3638
3638
|
load_more();
|
|
3639
|
-
setTimeout(
|
|
3639
|
+
setTimeout($268cbd9e4ade92db$export$b3bbfd758f11cfa9($55dae85e9309db86$var$find_last_el_and_observe), 0, all_rendered_elements, load_more);
|
|
3640
3640
|
i_o.disconnect();
|
|
3641
3641
|
}
|
|
3642
3642
|
}));
|
|
@@ -3654,26 +3654,26 @@ function $55dae85e9309db86$var$find_last_visible(bunch_of_elements) {
|
|
|
3654
3654
|
for (let i = 0; i < considered_elements.length; i++) {
|
|
3655
3655
|
const respected_element = considered_elements[i];
|
|
3656
3656
|
if (!respected_element) {
|
|
3657
|
-
|
|
3657
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Infinite scroll error: couldn't find last visible element", bunch_of_elements);
|
|
3658
3658
|
return;
|
|
3659
3659
|
}
|
|
3660
3660
|
if (respected_element.offsetParent === null) {
|
|
3661
3661
|
if (!i) {
|
|
3662
3662
|
// if index is 0 and we are not visible don't return the element at index -1 from the array - shit will hit the fan. Return the first one and everything should work out fine
|
|
3663
|
-
|
|
3663
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Inf scroll: No elements visible, ", considered_elements, "will attach to first el", respected_element);
|
|
3664
3664
|
return considered_elements[i];
|
|
3665
3665
|
}
|
|
3666
3666
|
return considered_elements[i - 1];
|
|
3667
3667
|
}
|
|
3668
3668
|
}
|
|
3669
|
-
|
|
3669
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Seems like all elements are loaded");
|
|
3670
3670
|
}
|
|
3671
3671
|
async function $8686e45614d71607$export$9eae832ae57fbf(t, css, extra_html) {
|
|
3672
3672
|
const head = await (0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).wait_for_element("head"),
|
|
3673
3673
|
{
|
|
3674
3674
|
dlog: dlog
|
|
3675
3675
|
} = t,
|
|
3676
|
-
elems =
|
|
3676
|
+
elems = $bf7f12fe044e41b2$export$44951404cb8d0583(`<style type="text/css">${css}</style>` + (extra_html ? extra_html : ""));
|
|
3677
3677
|
dlog("inserting", ...elems, "into", head);
|
|
3678
3678
|
head.append(...elems);
|
|
3679
3679
|
}
|
|
@@ -3707,7 +3707,7 @@ async function $807b852d8decb547$var$placeholder_worker(placeholder_elements, fi
|
|
|
3707
3707
|
}
|
|
3708
3708
|
} else {
|
|
3709
3709
|
await sanit_el_if_needed();
|
|
3710
|
-
placeholder_elements[0].addEventListener("placeholder_switch",
|
|
3710
|
+
placeholder_elements[0].addEventListener("placeholder_switch", $41f528c04cc8a8da$export$535946eb77c946dd(async e => {
|
|
3711
3711
|
const new_state = e.detail.state;
|
|
3712
3712
|
if (state != new_state) {
|
|
3713
3713
|
await sanit_el_if_needed();
|
|
@@ -3727,7 +3727,7 @@ async function $807b852d8decb547$var$decide_direction_and_switch(placeholder_ele
|
|
|
3727
3727
|
if (switch_to_final) $807b852d8decb547$var$switch_elements(placeholder_elements, final_elements);else $807b852d8decb547$var$switch_elements(final_elements, placeholder_elements);
|
|
3728
3728
|
}
|
|
3729
3729
|
function $807b852d8decb547$var$switch_elements(from, to) {
|
|
3730
|
-
if (!from.length || !to.length)
|
|
3730
|
+
if (!from.length || !to.length) $e6c6e7929ea385ae$export$c2363754d4758444("Cannot switch elements as from or to is empty", from, to);
|
|
3731
3731
|
from[0].replaceWith(...to);
|
|
3732
3732
|
for (let i = 1; i < from.length; i++) from[i].remove();
|
|
3733
3733
|
}
|
|
@@ -3747,14 +3747,14 @@ class $1da560af170fb839$export$3be7054c61590ee3 {
|
|
|
3747
3747
|
}
|
|
3748
3748
|
}
|
|
3749
3749
|
},
|
|
3750
|
-
load:
|
|
3750
|
+
load: $268cbd9e4ade92db$export$b3bbfd758f11cfa9(async image => {
|
|
3751
3751
|
for (const element of [...$1da560af170fb839$export$e4741190ccada479(image, "source"), image]) {
|
|
3752
3752
|
if ("loaded" in element) {
|
|
3753
|
-
if (class_this.#verbose)
|
|
3753
|
+
if (class_this.#verbose) $e6c6e7929ea385ae$export$de56f1198d121036(element, "is already loading, not loading again");
|
|
3754
3754
|
continue;
|
|
3755
3755
|
}
|
|
3756
3756
|
if (document?.body?.contains?.(image) === false) {
|
|
3757
|
-
if (class_this.#verbose)
|
|
3757
|
+
if (class_this.#verbose) $e6c6e7929ea385ae$export$de56f1198d121036(element, "has been removed from the DOM, can't load");
|
|
3758
3758
|
const {
|
|
3759
3759
|
elements: elements
|
|
3760
3760
|
} = class_this.lazyfinder;
|
|
@@ -3765,13 +3765,13 @@ class $1da560af170fb839$export$3be7054c61590ee3 {
|
|
|
3765
3765
|
const has_src = element.dataset?.src?.length;
|
|
3766
3766
|
const has_srcset = element.dataset?.srcset?.length;
|
|
3767
3767
|
if (has_src || has_srcset) {
|
|
3768
|
-
if (class_this.#verbose)
|
|
3768
|
+
if (class_this.#verbose) $e6c6e7929ea385ae$export$de56f1198d121036("Loading", element);
|
|
3769
3769
|
element.loaded = false;
|
|
3770
3770
|
// here it's of importance that we give the browser the srcset first, otherwise it (safari) might start loading the fallback src at first
|
|
3771
3771
|
if (has_srcset) {
|
|
3772
3772
|
// in Safari for some reason sometimes the .sizes attribute isn't set yet, like in https://www.notion.so/depictai/Pictures-in-recommendations-are-not-displayed-88e30e0f98de421e94b9eb273aea21dc. In that case, wait up to one event loop execution for it
|
|
3773
3773
|
if (!element.sizes) await new Promise(resolve => {
|
|
3774
|
-
const mo = new MutationObserver(
|
|
3774
|
+
const mo = new MutationObserver($268cbd9e4ade92db$export$b3bbfd758f11cfa9(_records => {
|
|
3775
3775
|
if (element.sizes) {
|
|
3776
3776
|
resolve();
|
|
3777
3777
|
mo.disconnect();
|
|
@@ -3781,7 +3781,7 @@ class $1da560af170fb839$export$3be7054c61590ee3 {
|
|
|
3781
3781
|
attributes: true,
|
|
3782
3782
|
attributeFilter: ["sizes"]
|
|
3783
3783
|
});
|
|
3784
|
-
setTimeout(
|
|
3784
|
+
setTimeout($268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => {
|
|
3785
3785
|
resolve(); // in case ResizeObserver doesn't set .sizes or something
|
|
3786
3786
|
mo.disconnect();
|
|
3787
3787
|
}));
|
|
@@ -3797,7 +3797,7 @@ class $1da560af170fb839$export$3be7054c61590ee3 {
|
|
|
3797
3797
|
} else {
|
|
3798
3798
|
if (element.src?.startsWith?.("data:")) continue;
|
|
3799
3799
|
// This happens quite often for reasons unknown. One day we will figure out why, or replace this lazyloader with a new one/native.
|
|
3800
|
-
if (class_this.#verbose)
|
|
3800
|
+
if (class_this.#verbose) $e6c6e7929ea385ae$export$de56f1198d121036("Cannot load", element, "as it doesn't have a data-src or data-srcset attribute");
|
|
3801
3801
|
}
|
|
3802
3802
|
}
|
|
3803
3803
|
}),
|
|
@@ -3815,10 +3815,10 @@ class $1da560af170fb839$export$3be7054c61590ee3 {
|
|
|
3815
3815
|
})();
|
|
3816
3816
|
#initiate_new_image(image) {
|
|
3817
3817
|
if (image.loaded === true || image.loaded === false) {
|
|
3818
|
-
if (this.#verbose)
|
|
3818
|
+
if (this.#verbose) $e6c6e7929ea385ae$export$de56f1198d121036("Not lazyloading", image, "because it was loaded before or is loading");
|
|
3819
3819
|
return;
|
|
3820
3820
|
}
|
|
3821
|
-
|
|
3821
|
+
$268cbd9e4ade92db$export$b3bbfd758f11cfa9(this.lazyfinder.unload)(image);
|
|
3822
3822
|
this.#add_load_event_listener(image);
|
|
3823
3823
|
this.intersection_observer?.observe?.(image); // observe if observer already exists, otherwise it won't and start_observer will do it
|
|
3824
3824
|
}
|
|
@@ -3828,11 +3828,11 @@ class $1da560af170fb839$export$3be7054c61590ee3 {
|
|
|
3828
3828
|
// it allows us to just add elements to the observed container and have them added to the elements array if they or their children match the selector
|
|
3829
3829
|
if (!this.container && !override_container) return;
|
|
3830
3830
|
const container = override_container ?? this.container;
|
|
3831
|
-
const mutation_observer = new MutationObserver(
|
|
3831
|
+
const mutation_observer = new MutationObserver($268cbd9e4ade92db$export$b3bbfd758f11cfa9(mutations => {
|
|
3832
3832
|
for (let i = 0; i < mutations.length; i++) {
|
|
3833
|
-
const matching_added_els =
|
|
3833
|
+
const matching_added_els = $bf7f12fe044e41b2$export$5e63aea0cac01fa0(mutations[i].addedNodes, this.selector);
|
|
3834
3834
|
if (matching_added_els.length) {
|
|
3835
|
-
if (this.#verbose)
|
|
3835
|
+
if (this.#verbose) $e6c6e7929ea385ae$export$de56f1198d121036("New elements", matching_added_els, " matching selector", this.selector, "were aded to", container, "lazyloading…");
|
|
3836
3836
|
this.lazyfinder.elements.push(...matching_added_els);
|
|
3837
3837
|
matching_added_els.forEach(this.#initiate_new_image.bind(this));
|
|
3838
3838
|
}
|
|
@@ -3856,14 +3856,14 @@ class $1da560af170fb839$export$3be7054c61590ee3 {
|
|
|
3856
3856
|
});
|
|
3857
3857
|
}
|
|
3858
3858
|
#add_load_event_listener(element) {
|
|
3859
|
-
const handler =
|
|
3859
|
+
const handler = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(e => {
|
|
3860
3860
|
// cookiebot triggers random "load" events on all elements which make the images load before the intersection observer has started
|
|
3861
3861
|
if (!element.src.length) {
|
|
3862
|
-
|
|
3862
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("ignoring load event", e, "because image doesn't have a src");
|
|
3863
3863
|
return;
|
|
3864
3864
|
}
|
|
3865
3865
|
if (this.ignore_data_urls && element.src.startsWith("data:")) {
|
|
3866
|
-
if (this.#verbose)
|
|
3866
|
+
if (this.#verbose) $e6c6e7929ea385ae$export$de56f1198d121036("Ignoring load event", e, "because ignore_data_urls is truthy");
|
|
3867
3867
|
return;
|
|
3868
3868
|
}
|
|
3869
3869
|
element.removeEventListener("load", handler);
|
|
@@ -3877,7 +3877,7 @@ class $1da560af170fb839$export$3be7054c61590ee3 {
|
|
|
3877
3877
|
elements: elements,
|
|
3878
3878
|
unload: unload
|
|
3879
3879
|
} = this.lazyfinder;
|
|
3880
|
-
const caught_unload =
|
|
3880
|
+
const caught_unload = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(unload);
|
|
3881
3881
|
for (let i = 0; i < elements.length; i++) {
|
|
3882
3882
|
caught_unload(elements[i]);
|
|
3883
3883
|
this.#add_load_event_listener(elements[i]);
|
|
@@ -3886,7 +3886,7 @@ class $1da560af170fb839$export$3be7054c61590ee3 {
|
|
|
3886
3886
|
#start_observer() {
|
|
3887
3887
|
let observers_first_call = true;
|
|
3888
3888
|
if (!this.intersection_observer) {
|
|
3889
|
-
this.intersection_observer = new IntersectionObserver(
|
|
3889
|
+
this.intersection_observer = new IntersectionObserver($268cbd9e4ade92db$export$b3bbfd758f11cfa9(entries => {
|
|
3890
3890
|
let any_intersected = false;
|
|
3891
3891
|
for (let i = 0; i < entries.length; i++) {
|
|
3892
3892
|
const entry = entries[i];
|
|
@@ -3902,7 +3902,7 @@ class $1da560af170fb839$export$3be7054c61590ee3 {
|
|
|
3902
3902
|
if (any_intersected) observers_first_call = false;
|
|
3903
3903
|
}), {
|
|
3904
3904
|
root: this.container,
|
|
3905
|
-
threshold:
|
|
3905
|
+
threshold: $0da0cad4f39e8f32$export$f8ea2e7b15b5d129(3)
|
|
3906
3906
|
});
|
|
3907
3907
|
const {
|
|
3908
3908
|
elements: elements
|
|
@@ -3918,7 +3918,7 @@ class $1da560af170fb839$export$3be7054c61590ee3 {
|
|
|
3918
3918
|
} = this.lazyfinder;
|
|
3919
3919
|
for (let i = 0; i < (elements?.length ?? 0); i++) if (elements[i].loaded === true) loaded_images.push(elements[i]);else not_loaded_or_loading.push(elements[i]);
|
|
3920
3920
|
if (this.#images_on_first_page.length >= loaded_images.length) {
|
|
3921
|
-
const caught_loading_fin =
|
|
3921
|
+
const caught_loading_fin = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(this.lazyfinder.load);
|
|
3922
3922
|
for (let i = 0; i < not_loaded_or_loading.length; i++) caught_loading_fin(not_loaded_or_loading[i]);
|
|
3923
3923
|
}
|
|
3924
3924
|
}
|
|
@@ -3945,10 +3945,10 @@ class $1da560af170fb839$export$3be7054c61590ee3 {
|
|
|
3945
3945
|
this.#unload_images_and_add_load_listeners();
|
|
3946
3946
|
// check if we need to branch off to an async function and wait for the elements being in the DOM
|
|
3947
3947
|
if (wait_for_dominsertion) {
|
|
3948
|
-
const caught_start_obs =
|
|
3948
|
+
const caught_start_obs = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(this.#start_observer).bind(this);
|
|
3949
3949
|
if (wait_for_dominsertion instanceof Promise) wait_for_dominsertion.then(caught_start_obs);else {
|
|
3950
3950
|
const el_to_listen_on = container || lazyfinder?.elements?.[0];
|
|
3951
|
-
if (el_to_listen_on instanceof Node) (0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).wait_for_element(el_to_listen_on).then(caught_start_obs);else
|
|
3951
|
+
if (el_to_listen_on instanceof Node) (0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).wait_for_element(el_to_listen_on).then(caught_start_obs);else $e6c6e7929ea385ae$export$de56f1198d121036("Could not find element to attach event listener to", () => {}); // right click function in inspector and select "jump to definition" to get here
|
|
3952
3952
|
}
|
|
3953
3953
|
} else this.#start_observer();
|
|
3954
3954
|
}
|
|
@@ -3973,9 +3973,9 @@ function $1da560af170fb839$export$e4741190ccada479(element, selector) {
|
|
|
3973
3973
|
}
|
|
3974
3974
|
return result;
|
|
3975
3975
|
}
|
|
3976
|
-
const $90e0b983530610e7$export$eb0b9ed911409b57 = (callback, element) => (
|
|
3976
|
+
const $90e0b983530610e7$export$eb0b9ed911409b57 = (callback, element) => ($268cbd9e4ade92db$export$b3bbfd758f11cfa9(callback)(element), element);
|
|
3977
3977
|
function $90e0b983530610e7$export$f63fcc839cb0f734(event, handler, element) {
|
|
3978
|
-
element.addEventListener(event,
|
|
3978
|
+
element.addEventListener(event, $268cbd9e4ade92db$export$b3bbfd758f11cfa9(handler));
|
|
3979
3979
|
return element;
|
|
3980
3980
|
}
|
|
3981
3981
|
const $90e0b983530610e7$export$22a65337c1b43b1f = /* @PURE */classes => classes.filter(c => c !== undefined).join(" ");
|
|
@@ -4007,7 +4007,7 @@ const $107a74aa4ea5902d$export$34b9dba7ce09269b = (tag, {
|
|
|
4007
4007
|
const element = is_svg ? document.createElementNS(namespace, tag) : document.createElement(tag);
|
|
4008
4008
|
for (const key in props) {
|
|
4009
4009
|
const value = props[key];
|
|
4010
|
-
if (key === "onClick") element.addEventListener("click",
|
|
4010
|
+
if (key === "onClick") element.addEventListener("click", $268cbd9e4ade92db$export$b3bbfd758f11cfa9(value));else if (key.startsWith("xlink:"))
|
|
4011
4011
|
// https://stackoverflow.com/a/23142447
|
|
4012
4012
|
// https://developer.mozilla.org/en-US/docs/Web/SVG/Namespaces_Crash_Course
|
|
4013
4013
|
element.setAttributeNS("http://www.w3.org/1999/xlink", key, value);else if (key == "xmlns" || key.startsWith("xmlns:")) element.setAttributeNS("http://www.w3.org/2000/xmlns/", key, value);else if (key.startsWith("xml:")) element.setAttributeNS("http://www.w3.org/XML/1998/namespace", key, value);else element.setAttribute(key, props[key]);
|
|
@@ -4026,19 +4026,19 @@ const $107a74aa4ea5902d$export$ffb0004e005737fa = ({
|
|
|
4026
4026
|
};
|
|
4027
4027
|
class $1683d0164abd7c1d$export$692b27c28639e5b9 {
|
|
4028
4028
|
// this is just here because it's often needed together with the slider
|
|
4029
|
-
container =
|
|
4029
|
+
container = $107a74aa4ea5902d$export$34b9dba7ce09269b("div", {
|
|
4030
4030
|
class: "depict-slider depict"
|
|
4031
4031
|
});
|
|
4032
4032
|
#elements = {
|
|
4033
|
-
sliding_el_:
|
|
4033
|
+
sliding_el_: $107a74aa4ea5902d$export$34b9dba7ce09269b("div", {
|
|
4034
4034
|
class: "sliding"
|
|
4035
4035
|
}),
|
|
4036
|
-
left_:
|
|
4036
|
+
left_: $107a74aa4ea5902d$export$34b9dba7ce09269b("button", {
|
|
4037
4037
|
"aria-label": "Scroll left",
|
|
4038
4038
|
class: "left d-navbutton",
|
|
4039
4039
|
type: "button"
|
|
4040
4040
|
}),
|
|
4041
|
-
right_:
|
|
4041
|
+
right_: $107a74aa4ea5902d$export$34b9dba7ce09269b("button", {
|
|
4042
4042
|
"aria-label": "Scroll right",
|
|
4043
4043
|
class: "right d-navbutton",
|
|
4044
4044
|
type: "button"
|
|
@@ -4081,15 +4081,15 @@ class $1683d0164abd7c1d$export$692b27c28639e5b9 {
|
|
|
4081
4081
|
const rec_idx = this.get_index_of_element(target);
|
|
4082
4082
|
if (entry.intersectionRatio <= 0) {
|
|
4083
4083
|
for (const key in intersecting_items) if (intersecting_items[key].target === target) delete intersecting_items[key];
|
|
4084
|
-
} else if (rec_idx != null) intersecting_items[rec_idx] = entry;else
|
|
4084
|
+
} else if (rec_idx != null) intersecting_items[rec_idx] = entry;else $e6c6e7929ea385ae$export$de56f1198d121036("Could not find index of", target, "ignoring observer record");
|
|
4085
4085
|
}
|
|
4086
|
-
|
|
4086
|
+
$268cbd9e4ade92db$export$b3bbfd758f11cfa9(this.#hide_buttons_if_needed).call(this);
|
|
4087
4087
|
const mutation_plugins = this.#mutation_plugins;
|
|
4088
|
-
for (let i = 0; i < mutation_plugins.length; i++)
|
|
4088
|
+
for (let i = 0; i < mutation_plugins.length; i++) $268cbd9e4ade92db$export$b3bbfd758f11cfa9(mutation_plugins[i]).call(this, entries, intersecting_items);
|
|
4089
4089
|
}
|
|
4090
4090
|
observer = new IntersectionObserver(this.#observer_callback.bind(this), {
|
|
4091
4091
|
root: this.#elements.sliding_el_,
|
|
4092
|
-
threshold:
|
|
4092
|
+
threshold: $0da0cad4f39e8f32$export$f8ea2e7b15b5d129(100)
|
|
4093
4093
|
});
|
|
4094
4094
|
observe = this.observer.observe.bind(this.observer);
|
|
4095
4095
|
get_index_of_element(target) {
|
|
@@ -4160,7 +4160,7 @@ class $1683d0164abd7c1d$export$692b27c28639e5b9 {
|
|
|
4160
4160
|
}
|
|
4161
4161
|
#distance_to(offset, is_absolute = false) {
|
|
4162
4162
|
const intersecting_items = this.intersecting_items_object; // the privateFieldGet babel polyfill isn't very fast so for extra snappyness I won't get it multiple times
|
|
4163
|
-
|
|
4163
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("intersecting_items", intersecting_items);
|
|
4164
4164
|
// I know I could have made this.intersecting_items_object a simple array instead, but maybe someone needs the boundingrect information in it some day. Also I thought I could use it, but it isn't always up to date due to the intersection observer not triggering on every scrolling move.
|
|
4165
4165
|
// Now, some months later: the triggering frequency can easily be adjusted, the problem is that the observer doesn't trigger on hidden elements, meaning when scrolling left we don't have information about the hidden element's position from the observer
|
|
4166
4166
|
let target; // absolute index to focus on
|
|
@@ -4170,7 +4170,7 @@ class $1683d0164abd7c1d$export$692b27c28639e5b9 {
|
|
|
4170
4170
|
} = this;
|
|
4171
4171
|
if (currently_selected == null) {
|
|
4172
4172
|
// if for whatever reason we don't find a card, don't do anything
|
|
4173
|
-
|
|
4173
|
+
$268cbd9e4ade92db$export$f18d5b0af29128b7(new Error("can't find card in center"), "error");
|
|
4174
4174
|
return 0;
|
|
4175
4175
|
}
|
|
4176
4176
|
target = currently_selected + offset;
|
|
@@ -4185,32 +4185,32 @@ class $1683d0164abd7c1d$export$692b27c28639e5b9 {
|
|
|
4185
4185
|
}
|
|
4186
4186
|
target = Math.floor(target);
|
|
4187
4187
|
let dist;
|
|
4188
|
-
|
|
4188
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("trying to focus target", target);
|
|
4189
4189
|
let target_element = this.element_by_index(target);
|
|
4190
4190
|
if (!target_element) {
|
|
4191
4191
|
if (this.correct_bs_targets) {
|
|
4192
4192
|
if (isNaN(target)) {
|
|
4193
|
-
|
|
4193
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("target is not a number", target, "can't correct");
|
|
4194
4194
|
return 0;
|
|
4195
4195
|
} else if (target < 0) {
|
|
4196
|
-
|
|
4196
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Target", target, "is < 0, correcting to 0 because correct_bs_targets is enabled");
|
|
4197
4197
|
target = 0;
|
|
4198
4198
|
target_element = this.element_by_index(target);
|
|
4199
4199
|
if (!target_element) {
|
|
4200
|
-
|
|
4200
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("can't find element 0");
|
|
4201
4201
|
return 0;
|
|
4202
4202
|
}
|
|
4203
4203
|
} else {
|
|
4204
|
-
|
|
4204
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("target", target, "does not exist, correcting to last sliding element \uD83E\uDD2D");
|
|
4205
4205
|
target = this.index_of_last_element;
|
|
4206
4206
|
target_element = this.element_by_index(target);
|
|
4207
4207
|
if (!target_element) {
|
|
4208
|
-
|
|
4208
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("last element", target, "could not be found");
|
|
4209
4209
|
return 0;
|
|
4210
4210
|
}
|
|
4211
4211
|
}
|
|
4212
4212
|
} else {
|
|
4213
|
-
|
|
4213
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("target is bs, can't find", target, "by either data-index attribute or as child of", this.#elements.sliding_el_);
|
|
4214
4214
|
return 0;
|
|
4215
4215
|
}
|
|
4216
4216
|
}
|
|
@@ -4236,7 +4236,7 @@ class $1683d0164abd7c1d$export$692b27c28639e5b9 {
|
|
|
4236
4236
|
dist += biggest_card * num_cards_off_target;
|
|
4237
4237
|
}
|
|
4238
4238
|
} catch (e) {
|
|
4239
|
-
|
|
4239
|
+
$548fd58b14b25a52$export$8048b892d651b310(e);
|
|
4240
4240
|
}
|
|
4241
4241
|
return dist;
|
|
4242
4242
|
}
|
|
@@ -4283,7 +4283,7 @@ class $1683d0164abd7c1d$export$692b27c28639e5b9 {
|
|
|
4283
4283
|
}
|
|
4284
4284
|
this.#cached_visible_sizes = visible_sizes;
|
|
4285
4285
|
// let's assume we can cache this for a tick since the slider scrolls smoothly so there's no point in reading it instantly again and assuming a different value
|
|
4286
|
-
queueMicrotask(
|
|
4286
|
+
queueMicrotask($268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => this.#cached_visible_sizes = undefined));
|
|
4287
4287
|
return visible_sizes;
|
|
4288
4288
|
}
|
|
4289
4289
|
get cards_fitting_in_viewport() {
|
|
@@ -4326,8 +4326,8 @@ class $1683d0164abd7c1d$export$692b27c28639e5b9 {
|
|
|
4326
4326
|
if (should_be_visible && ishidden) element.classList.remove("hidden");else if (!should_be_visible && !ishidden) element.classList.add("hidden");
|
|
4327
4327
|
}
|
|
4328
4328
|
#setup_buttons() {
|
|
4329
|
-
const goleft =
|
|
4330
|
-
const goright =
|
|
4329
|
+
const goleft = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => this.#scroll_to(-this.stepstoslide, false, -510));
|
|
4330
|
+
const goright = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => this.#scroll_to(this.stepstoslide, false, 510));
|
|
4331
4331
|
const {
|
|
4332
4332
|
right_: right_,
|
|
4333
4333
|
left_: left_
|
|
@@ -4344,7 +4344,7 @@ class $1683d0164abd7c1d$export$692b27c28639e5b9 {
|
|
|
4344
4344
|
this.container.append(es.left_, es.right_);
|
|
4345
4345
|
this.container.append(es.sliding_el_);
|
|
4346
4346
|
if (autoinvalidate) {
|
|
4347
|
-
const cache_mo = new MutationObserver(
|
|
4347
|
+
const cache_mo = new MutationObserver($268cbd9e4ade92db$export$b3bbfd758f11cfa9(records => {
|
|
4348
4348
|
this.invalidate_cache();
|
|
4349
4349
|
for (const extra_fn of this.on_elements_changed) extra_fn.call(this, records);
|
|
4350
4350
|
}));
|
|
@@ -4371,13 +4371,13 @@ class $1683d0164abd7c1d$export$692b27c28639e5b9 {
|
|
|
4371
4371
|
this.#index_cache.last_el_ = undefined;
|
|
4372
4372
|
}
|
|
4373
4373
|
#scroll_to(offset, is_absolute = false, fallback_scroll_distance = 500, harsh = false) {
|
|
4374
|
-
const left =
|
|
4374
|
+
const left = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(this.#distance_to).call(this, offset, is_absolute);
|
|
4375
4375
|
const distance_after_fallback_applied = Math.round(left ?? fallback_scroll_distance);
|
|
4376
4376
|
if (getComputedStyle(this.#elements.sliding_el_).scrollSnapType !== "none" && Math.abs(distance_after_fallback_applied) < 10) {
|
|
4377
|
-
|
|
4377
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Not scrolling because snapping is enabled and distance not over threshold", distance_after_fallback_applied);
|
|
4378
4378
|
return;
|
|
4379
4379
|
}
|
|
4380
|
-
|
|
4380
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Trying to scroll by", left, "px", "before fallback,", distance_after_fallback_applied, "after");
|
|
4381
4381
|
this.#elements.sliding_el_.scrollBy({
|
|
4382
4382
|
left: distance_after_fallback_applied,
|
|
4383
4383
|
top: 0,
|
|
@@ -4414,13 +4414,13 @@ class $1683d0164abd7c1d$export$692b27c28639e5b9 {
|
|
|
4414
4414
|
}
|
|
4415
4415
|
if (button_contents?.right) this.#elements.right_.append(...button_contents.right);
|
|
4416
4416
|
if (button_contents?.left) this.#elements.left_.append(...button_contents.left);
|
|
4417
|
-
|
|
4417
|
+
$268cbd9e4ade92db$export$b3bbfd758f11cfa9(this.#create_element_structure).call(this, autoinvalidate_cache);
|
|
4418
4418
|
// @ts-ignore
|
|
4419
4419
|
this.#elements.sliding_el_.slider = this; // dunno if this is dumb? So far nordicagolf/kondomvaruhuset depend on it
|
|
4420
4420
|
// plugin functionality i.e. for dots
|
|
4421
4421
|
const constructor_args = arguments;
|
|
4422
4422
|
constructor_plugins?.forEach?.(mplugin => {
|
|
4423
|
-
|
|
4423
|
+
$268cbd9e4ade92db$export$b3bbfd758f11cfa9(mplugin).call(this, constructor_args);
|
|
4424
4424
|
});
|
|
4425
4425
|
}
|
|
4426
4426
|
}
|
|
@@ -4432,7 +4432,7 @@ class $a69a5236b5814082$export$68babfc5be0de5da extends (0, $1683d0164abd7c1d$ex
|
|
|
4432
4432
|
element: element,
|
|
4433
4433
|
disconnector: disconnector
|
|
4434
4434
|
}) => {
|
|
4435
|
-
const i_o = new IntersectionObserver(
|
|
4435
|
+
const i_o = new IntersectionObserver($268cbd9e4ade92db$export$b3bbfd758f11cfa9(records => {
|
|
4436
4436
|
for (const record of records) if (record.intersectionRatio > 0) {
|
|
4437
4437
|
r(true);
|
|
4438
4438
|
i_o.disconnect();
|
|
@@ -4442,7 +4442,7 @@ class $a69a5236b5814082$export$68babfc5be0de5da extends (0, $1683d0164abd7c1d$ex
|
|
|
4442
4442
|
}),
|
|
4443
4443
|
// Fixes https://gitlab.com/depict-ai/depict.ai/-/merge_requests/5816/diffs, don't understand why
|
|
4444
4444
|
{
|
|
4445
|
-
threshold:
|
|
4445
|
+
threshold: $0da0cad4f39e8f32$export$f8ea2e7b15b5d129(10)
|
|
4446
4446
|
});
|
|
4447
4447
|
i_o.observe(element);
|
|
4448
4448
|
});
|
|
@@ -4462,7 +4462,7 @@ function $04d2f7d9126af667$export$fb9afe9f540ae069(elements, _display, info) {
|
|
|
4462
4462
|
if (!elements?.length) return elements;
|
|
4463
4463
|
if (!info.t) return elements;
|
|
4464
4464
|
const elements_as_array = [...elements];
|
|
4465
|
-
const handler =
|
|
4465
|
+
const handler = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(async () => {
|
|
4466
4466
|
const {
|
|
4467
4467
|
rendering_options: rendering_options,
|
|
4468
4468
|
t: t
|
|
@@ -4470,7 +4470,7 @@ function $04d2f7d9126af667$export$fb9afe9f540ae069(elements, _display, info) {
|
|
|
4470
4470
|
if (!$04d2f7d9126af667$export$4b50a4de9c6bbe09.has(rendering_options) && elements_as_array.some(e => document.documentElement.contains(e)) // check, just in case
|
|
4471
4471
|
) {
|
|
4472
4472
|
$04d2f7d9126af667$export$4b50a4de9c6bbe09.add(rendering_options);
|
|
4473
|
-
|
|
4473
|
+
$e0a87646d12cb987$export$82badda1f9923310({
|
|
4474
4474
|
...t,
|
|
4475
4475
|
product_id: await t.get_product_id(),
|
|
4476
4476
|
recommendation_type: info.rendering_options.type,
|
|
@@ -4492,7 +4492,7 @@ function $04d2f7d9126af667$export$1bffac19f9f0d6fc(elements, _display, info) {
|
|
|
4492
4492
|
// GTAG tracking is deprecated, if we're doing no-tenant recommendation rendering it's SDK anyway.
|
|
4493
4493
|
return elements;
|
|
4494
4494
|
const [first_element] = elements;
|
|
4495
|
-
const handler =
|
|
4495
|
+
const handler = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => {
|
|
4496
4496
|
const {
|
|
4497
4497
|
rendering_options: rendering_options,
|
|
4498
4498
|
displays: displays
|
|
@@ -4505,7 +4505,7 @@ function $04d2f7d9126af667$export$1bffac19f9f0d6fc(elements, _display, info) {
|
|
|
4505
4505
|
const {
|
|
4506
4506
|
type: type
|
|
4507
4507
|
} = rendering_options;
|
|
4508
|
-
|
|
4508
|
+
$d3d8549954e0318e$export$7babcd5d4056b2ca(displays, get_product_id /* yes this might create errors if there's no page_url in the display but don't have time to fix, sorry */, {
|
|
4509
4509
|
list_name: "depict_" + type
|
|
4510
4510
|
});
|
|
4511
4511
|
}
|
|
@@ -4520,7 +4520,7 @@ function $04d2f7d9126af667$export$9e1caada6901f552(elements, _display, info) {
|
|
|
4520
4520
|
} = info;
|
|
4521
4521
|
if (!t) return elements;
|
|
4522
4522
|
(async () => {
|
|
4523
|
-
|
|
4523
|
+
$72ee205b59322497$export$eee4c4d924348b05({
|
|
4524
4524
|
tenant: t.tenant,
|
|
4525
4525
|
market: t.market,
|
|
4526
4526
|
product_id: await t.get_product_id()
|
|
@@ -4535,9 +4535,9 @@ function $04d2f7d9126af667$export$8d72437623fef90c(elements, display, info) {
|
|
|
4535
4535
|
ga_product_id: ga_product_id,
|
|
4536
4536
|
product_id: product_id
|
|
4537
4537
|
} = display;
|
|
4538
|
-
if (Array.isArray(ga_product_ids)) for (let i = 0; i < ga_product_ids.length; i++)
|
|
4538
|
+
if (Array.isArray(ga_product_ids)) for (let i = 0; i < ga_product_ids.length; i++) $d3d8549954e0318e$export$f522672c9379e339(ga_product_ids[i], info.index, {
|
|
4539
4539
|
list_name: "depict_" + info.rendering_options.type
|
|
4540
|
-
});else
|
|
4540
|
+
});else $d3d8549954e0318e$export$f522672c9379e339(ga_product_id || product_id, info.index, {
|
|
4541
4541
|
list_name: "depict_" + info.rendering_options.type
|
|
4542
4542
|
});
|
|
4543
4543
|
};
|
|
@@ -4554,7 +4554,7 @@ function $04d2f7d9126af667$export$e9106d6e723510d2(elements, display, info) {
|
|
|
4554
4554
|
index: index,
|
|
4555
4555
|
rendering_options: rendering_options
|
|
4556
4556
|
} = info;
|
|
4557
|
-
return
|
|
4557
|
+
return $e0a87646d12cb987$export$15f8a0cd5a8c0ebb({
|
|
4558
4558
|
...t,
|
|
4559
4559
|
...rendering_options,
|
|
4560
4560
|
...display,
|
|
@@ -4579,14 +4579,14 @@ function $04d2f7d9126af667$export$32eb5dd18e963410(elements, display, info) {
|
|
|
4579
4579
|
} = "variant_index" in display ? display.variant_displays[display.variant_index] : display;
|
|
4580
4580
|
if (!elements?.length) return elements;
|
|
4581
4581
|
for (const element of elements) {
|
|
4582
|
-
const handler =
|
|
4582
|
+
const handler = $c8263a2185830bf1$export$82a685f2da2fb027(element, product_id, recommendation_id || search_result_id);
|
|
4583
4583
|
if (handler) $04d2f7d9126af667$var$push_function($04d2f7d9126af667$export$32eb5dd18e963410, handler);
|
|
4584
4584
|
}
|
|
4585
4585
|
return elements;
|
|
4586
4586
|
}
|
|
4587
4587
|
function $04d2f7d9126af667$export$dd32cb565eae0a1f(elements, display, info) {
|
|
4588
4588
|
const handler = () => {
|
|
4589
|
-
|
|
4589
|
+
$d3d8549954e0318e$export$127751e82111fcf();
|
|
4590
4590
|
};
|
|
4591
4591
|
$04d2f7d9126af667$var$push_function($04d2f7d9126af667$export$dd32cb565eae0a1f, handler);
|
|
4592
4592
|
info.register_event_listener("click", handler, {
|
|
@@ -4632,7 +4632,7 @@ async function $92bde32714bb1e07$export$50ce83ace0cdd87e(t, rendering_options) {
|
|
|
4632
4632
|
view_tracking: view_tracking,
|
|
4633
4633
|
click_tracking: click_tracking
|
|
4634
4634
|
} = rendering_options;
|
|
4635
|
-
return await
|
|
4635
|
+
return await $558ccd2de887e6d9$export$a9fc160c5ed83bd7(t, {
|
|
4636
4636
|
...rendering_options,
|
|
4637
4637
|
headers: {
|
|
4638
4638
|
...((0, $f3f05d97149aec76$export$deca40f48c0569f8) ? {
|
|
@@ -4655,7 +4655,7 @@ async function $3cb558cec98ba1a7$export$cab8bc58c64c2013(t, rendering_options, o
|
|
|
4655
4655
|
let {
|
|
4656
4656
|
container: container
|
|
4657
4657
|
} = options_for_us;
|
|
4658
|
-
if (typeof container == "string") container = [
|
|
4658
|
+
if (typeof container == "string") container = [...$bf7f12fe044e41b2$export$44951404cb8d0583(container)];
|
|
4659
4659
|
if (container && !Array.isArray(container)) container = [...container];
|
|
4660
4660
|
const slider = new (0, $a69a5236b5814082$export$68babfc5be0de5da)({
|
|
4661
4661
|
dist_to_hide_left: 10,
|
|
@@ -4665,17 +4665,17 @@ async function $3cb558cec98ba1a7$export$cab8bc58c64c2013(t, rendering_options, o
|
|
|
4665
4665
|
const recs = await local_rr(t, {
|
|
4666
4666
|
...rendering_options,
|
|
4667
4667
|
post_processors: [(elements, display) => {
|
|
4668
|
-
|
|
4668
|
+
$bf7f12fe044e41b2$export$5e63aea0cac01fa0(elements, ".rec_outer").forEach(ro => ro.classList.add("noautospacing"));
|
|
4669
4669
|
return elements;
|
|
4670
4670
|
}, ...(rendering_options.post_processors || [])]
|
|
4671
4671
|
});
|
|
4672
4672
|
if (!recs.elements) {
|
|
4673
|
-
|
|
4673
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Pro_Slider says bye bye cuz no recs");
|
|
4674
4674
|
return {};
|
|
4675
4675
|
}
|
|
4676
4676
|
slider.insert_here.append(...recs.elements);
|
|
4677
4677
|
if (container) {
|
|
4678
|
-
const [root] =
|
|
4678
|
+
const [root] = $bf7f12fe044e41b2$export$5e63aea0cac01fa0(container, root_selector || ".grid");
|
|
4679
4679
|
root[insertion_verb](slider.container);
|
|
4680
4680
|
}
|
|
4681
4681
|
return {
|
|
@@ -4706,7 +4706,7 @@ class $0b6a8303b64cced1$export$1a8782481a9af507 {
|
|
|
4706
4706
|
type: type,
|
|
4707
4707
|
market: market
|
|
4708
4708
|
} = this.settings;
|
|
4709
|
-
|
|
4709
|
+
$94edfb6d9c42a288$export$1bc0df10745d5412(
|
|
4710
4710
|
// @ts-ignore - Quick workaround, as we don't have a tenant object here
|
|
4711
4711
|
{
|
|
4712
4712
|
tenant: tenant,
|
|
@@ -4716,7 +4716,7 @@ class $0b6a8303b64cced1$export$1a8782481a9af507 {
|
|
|
4716
4716
|
product_id: product_id()
|
|
4717
4717
|
}).then(recs => {
|
|
4718
4718
|
this.data = recs;
|
|
4719
|
-
|
|
4719
|
+
$eee5951374097b61$export$8582cf3716962dc2({
|
|
4720
4720
|
...this.settings,
|
|
4721
4721
|
recs: this.data,
|
|
4722
4722
|
min_recs: this.settings.min_items || this.settings.max_items
|
|
@@ -4733,14 +4733,14 @@ class $0b6a8303b64cced1$export$1a8782481a9af507 {
|
|
|
4733
4733
|
}
|
|
4734
4734
|
if (!action || action instanceof Event) action = "rec_bar_click";
|
|
4735
4735
|
if (action == "rec_bar_click" && typeof index != "undefined" && product_id) {
|
|
4736
|
-
if (Array.isArray(ga_product_ids)) for (const id of ga_product_ids)
|
|
4736
|
+
if (Array.isArray(ga_product_ids)) for (const id of ga_product_ids) $d3d8549954e0318e$export$f522672c9379e339(id, index, {
|
|
4737
4737
|
list_name: "depict_" + this.settings.type
|
|
4738
|
-
});else
|
|
4738
|
+
});else $d3d8549954e0318e$export$f522672c9379e339(product_id, index, {
|
|
4739
4739
|
list_name: "depict_" + this.settings.type
|
|
4740
4740
|
});
|
|
4741
4741
|
}
|
|
4742
4742
|
if (this.tracker === undefined) this.tracker = ga("create", this.settings.gaid, "auto", "depict");
|
|
4743
|
-
|
|
4743
|
+
$d3d8549954e0318e$export$f75172d2e289cd02(action);
|
|
4744
4744
|
}
|
|
4745
4745
|
trackPageView() {
|
|
4746
4746
|
if ($0b6a8303b64cced1$var$pageview_sent) {
|
|
@@ -4751,12 +4751,12 @@ class $0b6a8303b64cced1$export$1a8782481a9af507 {
|
|
|
4751
4751
|
const {
|
|
4752
4752
|
product_id: product_id
|
|
4753
4753
|
} = this.settings;
|
|
4754
|
-
|
|
4754
|
+
$72ee205b59322497$export$eee4c4d924348b05(typeof product_id === "function" ? product_id() : product_id);
|
|
4755
4755
|
}
|
|
4756
4756
|
trackClick(index) {
|
|
4757
4757
|
const item = this.data[index];
|
|
4758
4758
|
if (item === undefined) return;
|
|
4759
|
-
return
|
|
4759
|
+
return $e0a87646d12cb987$export$15f8a0cd5a8c0ebb({
|
|
4760
4760
|
...this.settings,
|
|
4761
4761
|
...item,
|
|
4762
4762
|
click_location: `${this.settings.type}_${index + 1}`,
|
|
@@ -4764,7 +4764,7 @@ class $0b6a8303b64cced1$export$1a8782481a9af507 {
|
|
|
4764
4764
|
});
|
|
4765
4765
|
}
|
|
4766
4766
|
trackAddToCart(pId) {
|
|
4767
|
-
return
|
|
4767
|
+
return $e0a87646d12cb987$export$9028351cb994757e({
|
|
4768
4768
|
...this.settings,
|
|
4769
4769
|
product_id: pId && !(pId instanceof Event) ? pId : this.settings.product_id()
|
|
4770
4770
|
});
|
|
@@ -4845,7 +4845,7 @@ class $0b6a8303b64cced1$export$1a8782481a9af507 {
|
|
|
4845
4845
|
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).oncreation(element, () => {
|
|
4846
4846
|
if (!this.#dispatched_recs_inserted) {
|
|
4847
4847
|
this.#dispatched_recs_inserted = true;
|
|
4848
|
-
|
|
4848
|
+
$e0a87646d12cb987$export$82badda1f9923310({
|
|
4849
4849
|
...this.settings,
|
|
4850
4850
|
product_id: product_id_at_rendering,
|
|
4851
4851
|
recommendation_type: this.settings.type,
|
|
@@ -4858,8 +4858,8 @@ class $0b6a8303b64cced1$export$1a8782481a9af507 {
|
|
|
4858
4858
|
this.trackGAEvent("rec_bar_click", rec_index, item.ga_product_id || item.product_id || this.settings.product_id(item.page_url), item.ga_product_ids);
|
|
4859
4859
|
};
|
|
4860
4860
|
element.addEventListener("click", listener);
|
|
4861
|
-
|
|
4862
|
-
if (this.settings.shade)
|
|
4861
|
+
$c8263a2185830bf1$export$82a685f2da2fb027(element, item.product_id, item.recommendation_id);
|
|
4862
|
+
if (this.settings.shade) $fbb09973782881cb$export$6ebd242c09192cec(element);
|
|
4863
4863
|
// @ts-ignore
|
|
4864
4864
|
if (!element.depict_event_listeners)
|
|
4865
4865
|
// @ts-ignore
|
|
@@ -4871,7 +4871,7 @@ class $0b6a8303b64cced1$export$1a8782481a9af507 {
|
|
|
4871
4871
|
resultingElements.push(...elements);
|
|
4872
4872
|
});
|
|
4873
4873
|
this.data = recsArray;
|
|
4874
|
-
if (!this.settings.DNT)
|
|
4874
|
+
if (!this.settings.DNT) $d3d8549954e0318e$export$7babcd5d4056b2ca(recsArray, this.settings.product_id, {
|
|
4875
4875
|
list_name: "depict_" + this.settings.type
|
|
4876
4876
|
});
|
|
4877
4877
|
return resultingElements;
|
|
@@ -4944,7 +4944,7 @@ class $e090b20cef3f0516$export$4d41c6499d53639c extends (0, $a69a5236b5814082$ex
|
|
|
4944
4944
|
super(options, {
|
|
4945
4945
|
lazyfinder: {
|
|
4946
4946
|
unload(image) {
|
|
4947
|
-
|
|
4947
|
+
$268cbd9e4ade92db$export$b3bbfd758f11cfa9(async () => {
|
|
4948
4948
|
if (!image?.dataset?.src?.length) {
|
|
4949
4949
|
image.dataset.src = image.src;
|
|
4950
4950
|
image.removeAttribute("src");
|
|
@@ -4976,7 +4976,7 @@ async function $7af744346f17bf99$export$cd12721587f4f16d(t, rendering_options, o
|
|
|
4976
4976
|
let {
|
|
4977
4977
|
container: container
|
|
4978
4978
|
} = options_for_us;
|
|
4979
|
-
if (typeof container == "string") container = [
|
|
4979
|
+
if (typeof container == "string") container = [...$bf7f12fe044e41b2$export$44951404cb8d0583(container)];
|
|
4980
4980
|
if (container && !Array.isArray(container)) container = [...container];
|
|
4981
4981
|
const slider = new (0, $e090b20cef3f0516$export$4d41c6499d53639c)({
|
|
4982
4982
|
dlog: dlog,
|
|
@@ -4988,7 +4988,7 @@ async function $7af744346f17bf99$export$cd12721587f4f16d(t, rendering_options, o
|
|
|
4988
4988
|
const recs = await local_rr(t, {
|
|
4989
4989
|
...rendering_options,
|
|
4990
4990
|
post_processors: [(elements, display) => {
|
|
4991
|
-
|
|
4991
|
+
$bf7f12fe044e41b2$export$5e63aea0cac01fa0(elements, "a.rec_outer").forEach(ro => ro.classList.add("noautospacing"));
|
|
4992
4992
|
return elements;
|
|
4993
4993
|
}, ...(rendering_options.post_processors || [])]
|
|
4994
4994
|
});
|
|
@@ -4998,7 +4998,7 @@ async function $7af744346f17bf99$export$cd12721587f4f16d(t, rendering_options, o
|
|
|
4998
4998
|
}
|
|
4999
4999
|
slider.insert_here.append(...recs.elements);
|
|
5000
5000
|
if (container) {
|
|
5001
|
-
const [root] =
|
|
5001
|
+
const [root] = $bf7f12fe044e41b2$export$5e63aea0cac01fa0(container, root_selector || ".grid");
|
|
5002
5002
|
root[insertion_verb](slider.container);
|
|
5003
5003
|
}
|
|
5004
5004
|
return {
|
|
@@ -5030,8 +5030,8 @@ async function $765ddca135d7ab33$export$30933c637c977eef({
|
|
|
5030
5030
|
catchify: catchify,
|
|
5031
5031
|
dlog: dlog
|
|
5032
5032
|
} = t,
|
|
5033
|
-
container = [
|
|
5034
|
-
root =
|
|
5033
|
+
container = [...$bf7f12fe044e41b2$export$44951404cb8d0583(container_template)],
|
|
5034
|
+
root = $bf7f12fe044e41b2$export$5e63aea0cac01fa0(container, ".grid")[0],
|
|
5035
5035
|
internal_pre_processors = [...pre_processors],
|
|
5036
5036
|
// copy arrays so we don't unintentionally modify an array of a script calling us when doing auto postprocessor for slider if insertion_promise is defined
|
|
5037
5037
|
internal_post_processors = [...post_processors];
|
|
@@ -5044,7 +5044,7 @@ async function $765ddca135d7ab33$export$30933c637c977eef({
|
|
|
5044
5044
|
root.replaceWith(slider.container);
|
|
5045
5045
|
if (insertion_promise) internal_post_processors.push((t, items, d) => {
|
|
5046
5046
|
for (const item of items) insertion_promise.then(() => {
|
|
5047
|
-
|
|
5047
|
+
$8e19f8200d357fe7$export$37125ccc5dd98050({
|
|
5048
5048
|
element: item,
|
|
5049
5049
|
data: {
|
|
5050
5050
|
tenant: t.tenant,
|
|
@@ -5061,7 +5061,7 @@ async function $765ddca135d7ab33$export$30933c637c977eef({
|
|
|
5061
5061
|
});
|
|
5062
5062
|
}
|
|
5063
5063
|
if (!slider || !insertion_promise) internal_post_processors.push((t, items, d) => {
|
|
5064
|
-
for (const item of items)
|
|
5064
|
+
for (const item of items) $8e19f8200d357fe7$export$37125ccc5dd98050({
|
|
5065
5065
|
element: item,
|
|
5066
5066
|
data: {
|
|
5067
5067
|
tenant: t.tenant,
|
|
@@ -5075,7 +5075,7 @@ async function $765ddca135d7ab33$export$30933c637c977eef({
|
|
|
5075
5075
|
});
|
|
5076
5076
|
return items;
|
|
5077
5077
|
});
|
|
5078
|
-
const template_tool = await
|
|
5078
|
+
const template_tool = await $52d3be7ce5146924$export$2e2bcd8739ae039({
|
|
5079
5079
|
options: {
|
|
5080
5080
|
...t,
|
|
5081
5081
|
...(template_tool_options || {})
|
|
@@ -5099,7 +5099,7 @@ async function $765ddca135d7ab33$export$30933c637c977eef({
|
|
|
5099
5099
|
if (with_loadmore) catchify($765ddca135d7ab33$var$setup_load_more)(t, root, chunk_size_for_load_more);
|
|
5100
5100
|
if (infinite_scroll) catchify($765ddca135d7ab33$var$setup_infinite_scroll)(t, root);
|
|
5101
5101
|
if (title) {
|
|
5102
|
-
const [title_element] =
|
|
5102
|
+
const [title_element] = $bf7f12fe044e41b2$export$5e63aea0cac01fa0(container, "h1.title, h2.title, h3.title, h4.title, h5.title, h6.title");
|
|
5103
5103
|
if (title_element) {
|
|
5104
5104
|
if (typeof title == "string") title_element.innerText = title;else title_element.replaceWith(...title);
|
|
5105
5105
|
}
|
|
@@ -5144,8 +5144,8 @@ function $765ddca135d7ab33$var$setup_load_more(t, root, chunk_size) {
|
|
|
5144
5144
|
const {
|
|
5145
5145
|
catchify: catchify
|
|
5146
5146
|
} = t,
|
|
5147
|
-
load_more_cont =
|
|
5148
|
-
load_button = load_more_cont.appendChild(
|
|
5147
|
+
load_more_cont = $bf7f12fe044e41b2$export$d3e2a0560cbf4787(`<div class="load-more-container"></div>`),
|
|
5148
|
+
load_button = load_more_cont.appendChild($bf7f12fe044e41b2$export$d3e2a0560cbf4787(`<button class="load_more">Visa mer</button>`));
|
|
5149
5149
|
load_button.addEventListener("click", catchify(load_more_recs_and_hide_button_if_needed));
|
|
5150
5150
|
root.after(load_more_cont);
|
|
5151
5151
|
load_more_recs_and_hide_button_if_needed();
|
|
@@ -5214,7 +5214,7 @@ $c413c7798924612a$export$2e2bcd8739ae039 = (dlog, error_log) => {
|
|
|
5214
5214
|
} : {})
|
|
5215
5215
|
}).then(async response => {
|
|
5216
5216
|
if (!response || !response.ok || response.status !== 200) {
|
|
5217
|
-
if (response.status === 422)
|
|
5217
|
+
if (response.status === 422) $268cbd9e4ade92db$export$b3bbfd758f11cfa9($c413c7798924612a$var$send_sentry_422)(response, body, stack);
|
|
5218
5218
|
elog("Response not ok", response);
|
|
5219
5219
|
return false;
|
|
5220
5220
|
} else return await response[decode_json ? "json" : "text"]().catch(e => elog("error while decoding json", e));
|
|
@@ -5229,32 +5229,32 @@ $c413c7798924612a$export$2e2bcd8739ae039 = (dlog, error_log) => {
|
|
|
5229
5229
|
async function $c413c7798924612a$var$send_sentry_422(response, body, stack) {
|
|
5230
5230
|
const msg = `Validation error: got 422 from API`;
|
|
5231
5231
|
const text = await response.text();
|
|
5232
|
-
|
|
5232
|
+
$e6c6e7929ea385ae$export$de56f1198d121036(msg, "body", body, "response", response, "text", text, "stack", stack);
|
|
5233
5233
|
(0, $61a34358bf0d3d8b$export$af2e17a20c2ea3c5).withScope(function (scope) {
|
|
5234
5234
|
scope.setExtra("stack", stack);
|
|
5235
5235
|
scope.setExtra("request_body", body);
|
|
5236
5236
|
scope.setExtra("response", response);
|
|
5237
|
-
scope.setExtra("serialized_response",
|
|
5237
|
+
scope.setExtra("serialized_response", $45e05ec4fd7f1ee7$export$39d526a1194b6499(response));
|
|
5238
5238
|
scope.setExtra("response_text", text);
|
|
5239
5239
|
scope.setLevel("error");
|
|
5240
5240
|
this.captureException(new Error(msg));
|
|
5241
5241
|
});
|
|
5242
5242
|
}
|
|
5243
|
-
const $c3af1bfb402a8820$export$dc84183312f0c201 = /*@__PURE__*/(() =>
|
|
5243
|
+
const $c3af1bfb402a8820$export$dc84183312f0c201 = /*@__PURE__*/(() => $107a74aa4ea5902d$export$25062201e9e25d76("svg", {
|
|
5244
5244
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5245
5245
|
viewBox: "0 0 320 512",
|
|
5246
|
-
children: [
|
|
5246
|
+
children: [$107a74aa4ea5902d$export$34b9dba7ce09269b("desc", {
|
|
5247
5247
|
children: "Right arrow"
|
|
5248
|
-
}),
|
|
5248
|
+
}), $107a74aa4ea5902d$export$34b9dba7ce09269b("path", {
|
|
5249
5249
|
d: "M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"
|
|
5250
5250
|
})]
|
|
5251
5251
|
}))();
|
|
5252
|
-
const $c3af1bfb402a8820$export$6038895ac52bd044 = /*@__PURE__*/(() =>
|
|
5252
|
+
const $c3af1bfb402a8820$export$6038895ac52bd044 = /*@__PURE__*/(() => $107a74aa4ea5902d$export$25062201e9e25d76("svg", {
|
|
5253
5253
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5254
5254
|
viewBox: "0 0 320 512",
|
|
5255
|
-
children: [
|
|
5255
|
+
children: [$107a74aa4ea5902d$export$34b9dba7ce09269b("desc", {
|
|
5256
5256
|
children: "Left arrow"
|
|
5257
|
-
}),
|
|
5257
|
+
}), $107a74aa4ea5902d$export$34b9dba7ce09269b("path", {
|
|
5258
5258
|
d: "M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z"
|
|
5259
5259
|
})]
|
|
5260
5260
|
}))();
|
|
@@ -5271,7 +5271,7 @@ const $febdc40c8da5c25e$export$68c017fd93791405 = ({
|
|
|
5271
5271
|
container.append(content);
|
|
5272
5272
|
const expand = () => {
|
|
5273
5273
|
container.style.height = content.clientHeight + "px";
|
|
5274
|
-
setTimeout(
|
|
5274
|
+
setTimeout($268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => {
|
|
5275
5275
|
container.style.overflow = "unset";
|
|
5276
5276
|
container.style.height = "auto";
|
|
5277
5277
|
}), duration);
|
|
@@ -5283,14 +5283,14 @@ const $febdc40c8da5c25e$export$68c017fd93791405 = ({
|
|
|
5283
5283
|
};
|
|
5284
5284
|
};
|
|
5285
5285
|
function $ef237c2bba47492f$export$f8913c8a18f7ca21(iterables) {
|
|
5286
|
-
const ourselves =
|
|
5286
|
+
const ourselves = $9a42a570de51ea3d$export$e806c6c1615a59ae();
|
|
5287
5287
|
const values = new Array(iterables.length);
|
|
5288
|
-
Promise.all(iterables.map(
|
|
5288
|
+
Promise.all(iterables.map($268cbd9e4ade92db$export$b3bbfd758f11cfa9(async (iterable, index) => {
|
|
5289
5289
|
for await (const value of iterable) {
|
|
5290
5290
|
values[index] = value;
|
|
5291
5291
|
ourselves([...values]);
|
|
5292
5292
|
}
|
|
5293
|
-
}))).then(
|
|
5293
|
+
}))).then($268cbd9e4ade92db$export$b3bbfd758f11cfa9(ourselves.exit));
|
|
5294
5294
|
return ourselves;
|
|
5295
5295
|
}
|
|
5296
5296
|
const $1cc2444a0f1b992e$export$717f13d9ba00ca19 = (min, max) => `@media ${min ? `(min-width:${min})` : ``}${min && max ? ` and ` : ``}${max ? `(max-width:${max})` : ``}`;
|
|
@@ -5313,16 +5313,16 @@ async function $1cc2444a0f1b992e$export$c84671f46d6a1ca({
|
|
|
5313
5313
|
ipns: ipns
|
|
5314
5314
|
} = rows_or_empty_object;
|
|
5315
5315
|
const is_static = !ipns && !button;
|
|
5316
|
-
const our_style_el =
|
|
5316
|
+
const our_style_el = $107a74aa4ea5902d$export$34b9dba7ce09269b("style", {
|
|
5317
5317
|
type: "text/css"
|
|
5318
5318
|
});
|
|
5319
|
-
const container_class =
|
|
5319
|
+
const container_class = $650b64c1b384c895$export$a6db784f019668ba();
|
|
5320
5320
|
const selector_beginning = `.depict .${container_class}>`;
|
|
5321
|
-
const el_count_ipns =
|
|
5321
|
+
const el_count_ipns = $9a42a570de51ea3d$export$e806c6c1615a59ae();
|
|
5322
5322
|
const set_length = () => el_count_ipns(container_element.children.length);
|
|
5323
5323
|
const col_styling = $1cc2444a0f1b992e$export$17c3166a7ebd4688(selector_beginning, grid_spacing, cols_at_size, layout, override_vertical_spacing);
|
|
5324
5324
|
let button_class;
|
|
5325
|
-
ipns ||=
|
|
5325
|
+
ipns ||= $9a42a570de51ea3d$export$e806c6c1615a59ae();
|
|
5326
5326
|
container_element.after(our_style_el);
|
|
5327
5327
|
container_element.classList.add(container_class);
|
|
5328
5328
|
if (rows === "all") {
|
|
@@ -5332,7 +5332,7 @@ async function $1cc2444a0f1b992e$export$c84671f46d6a1ca({
|
|
|
5332
5332
|
}
|
|
5333
5333
|
ipns(start_rows);
|
|
5334
5334
|
set_length();
|
|
5335
|
-
const mutation_observer = new MutationObserver(
|
|
5335
|
+
const mutation_observer = new MutationObserver($268cbd9e4ade92db$export$b3bbfd758f11cfa9(set_length));
|
|
5336
5336
|
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).oncreation(container_element, ({
|
|
5337
5337
|
element: element
|
|
5338
5338
|
}) => {
|
|
@@ -5351,15 +5351,15 @@ async function $1cc2444a0f1b992e$export$c84671f46d6a1ca({
|
|
|
5351
5351
|
ipns.exit();
|
|
5352
5352
|
});
|
|
5353
5353
|
if (button) {
|
|
5354
|
-
button_class =
|
|
5355
|
-
const button_container =
|
|
5354
|
+
button_class = $650b64c1b384c895$export$a6db784f019668ba();
|
|
5355
|
+
const button_container = $107a74aa4ea5902d$export$34b9dba7ce09269b("div", {
|
|
5356
5356
|
class: "load-more-container " + button_class,
|
|
5357
|
-
children:
|
|
5357
|
+
children: $90e0b983530610e7$export$f63fcc839cb0f734("click", () => ipns(ipns.state + (rows_or_empty_object.rows_per_click ?? 1)), button)
|
|
5358
5358
|
});
|
|
5359
5359
|
container_element.after(button_container);
|
|
5360
5360
|
}
|
|
5361
5361
|
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).oncreation(container_element, async () => {
|
|
5362
|
-
for await (const [currently_showing_rows, number_of_els] of
|
|
5362
|
+
for await (const [currently_showing_rows, number_of_els] of $ef237c2bba47492f$export$f8913c8a18f7ca21([
|
|
5363
5363
|
// start for await loop when the container element gets inserted into the DOM
|
|
5364
5364
|
// the loop is broken by an observer.onremoved above calling .exit on the IPNS this depends on
|
|
5365
5365
|
// @ts-ignore
|
|
@@ -5527,7 +5527,7 @@ async function $a7315720bf2a1638$export$b0a773486c1c2312(t, recommendation_rende
|
|
|
5527
5527
|
eager_images: eager_images,
|
|
5528
5528
|
...options_for_grid
|
|
5529
5529
|
}) {
|
|
5530
|
-
const [insertion_point] =
|
|
5530
|
+
const [insertion_point] = $bf7f12fe044e41b2$export$5e63aea0cac01fa0(container_elements, container_selector || ".grid");
|
|
5531
5531
|
const rendering_result = await (override_rec_renderer || (0, $92bde32714bb1e07$export$2e2bcd8739ae039))(t, recommendation_renderer_options);
|
|
5532
5532
|
const {
|
|
5533
5533
|
elements: elements
|
|
@@ -5538,7 +5538,7 @@ async function $a7315720bf2a1638$export$b0a773486c1c2312(t, recommendation_rende
|
|
|
5538
5538
|
// when the elements are in the DOM starts IntersectionObserver on whole grid
|
|
5539
5539
|
// when grid intersects starts Lazyfier
|
|
5540
5540
|
// this is because Lazyfier is fucking stupid
|
|
5541
|
-
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).wait_for_element(insertion_point).then(
|
|
5541
|
+
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).wait_for_element(insertion_point).then($268cbd9e4ade92db$export$b3bbfd758f11cfa9(element => {
|
|
5542
5542
|
let start_lazy_loading;
|
|
5543
5543
|
const lazy_loading_promise = new Promise(r => start_lazy_loading = r);
|
|
5544
5544
|
const lf = new (0, $1da560af170fb839$export$3be7054c61590ee3)({
|
|
@@ -5547,7 +5547,7 @@ async function $a7315720bf2a1638$export$b0a773486c1c2312(t, recommendation_rende
|
|
|
5547
5547
|
...lazyfier_options
|
|
5548
5548
|
});
|
|
5549
5549
|
lf.start_observing_for_new_children_(element);
|
|
5550
|
-
const i_o = new IntersectionObserver(
|
|
5550
|
+
const i_o = new IntersectionObserver($268cbd9e4ade92db$export$b3bbfd758f11cfa9(records => {
|
|
5551
5551
|
for (const record of records) if (record.intersectionRatio > 0) {
|
|
5552
5552
|
start_lazy_loading();
|
|
5553
5553
|
i_o.disconnect();
|
|
@@ -5557,7 +5557,7 @@ async function $a7315720bf2a1638$export$b0a773486c1c2312(t, recommendation_rende
|
|
|
5557
5557
|
i_o.observe(insertion_point);
|
|
5558
5558
|
}));
|
|
5559
5559
|
insertion_point.append(...elements);
|
|
5560
|
-
|
|
5560
|
+
$1cc2444a0f1b992e$export$c84671f46d6a1ca({
|
|
5561
5561
|
...options_for_grid,
|
|
5562
5562
|
container_element: insertion_point,
|
|
5563
5563
|
layout: "grid"
|
|
@@ -5584,7 +5584,7 @@ async function $79804e8d76404ae4$export$82cfdc85a4d15688(t, recommendation_rende
|
|
|
5584
5584
|
rows = "all",
|
|
5585
5585
|
...slider_options
|
|
5586
5586
|
}) {
|
|
5587
|
-
const [insertion_point] =
|
|
5587
|
+
const [insertion_point] = $bf7f12fe044e41b2$export$5e63aea0cac01fa0(container_elements, container_selector || ".grid");
|
|
5588
5588
|
const slider = eager_images ? new (0, $1683d0164abd7c1d$export$692b27c28639e5b9)(slider_options) : new (0, $a69a5236b5814082$export$68babfc5be0de5da)(slider_options, lazyfier_options);
|
|
5589
5589
|
const rendering_result = await (override_rec_renderer || (0, $92bde32714bb1e07$export$2e2bcd8739ae039))(t, recommendation_renderer_options);
|
|
5590
5590
|
const {
|
|
@@ -5593,18 +5593,18 @@ async function $79804e8d76404ae4$export$82cfdc85a4d15688(t, recommendation_rende
|
|
|
5593
5593
|
if (!elements) return rendering_result;
|
|
5594
5594
|
if (!$79804e8d76404ae4$var$slider_styling_was_inserted) {
|
|
5595
5595
|
$79804e8d76404ae4$var$slider_styling_was_inserted = true;
|
|
5596
|
-
|
|
5596
|
+
$e4bebbfa0f0b1454$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($6f9658642611ab01$exports)));
|
|
5597
5597
|
}
|
|
5598
5598
|
insertion_point.replaceWith(slider.container);
|
|
5599
5599
|
slider.insert_here.append(...elements);
|
|
5600
|
-
|
|
5600
|
+
$1cc2444a0f1b992e$export$c84671f46d6a1ca({
|
|
5601
5601
|
grid_spacing: grid_spacing,
|
|
5602
5602
|
cols_at_size: cols_at_size,
|
|
5603
5603
|
container_element: slider.insert_here,
|
|
5604
5604
|
rows: rows,
|
|
5605
5605
|
layout: "slider",
|
|
5606
5606
|
override_vertical_spacing: override_vertical_spacing
|
|
5607
|
-
}).catch(e =>
|
|
5607
|
+
}).catch(e => $268cbd9e4ade92db$export$f18d5b0af29128b7([e, "Grid had an error"], "warning"));
|
|
5608
5608
|
return {
|
|
5609
5609
|
...rendering_result,
|
|
5610
5610
|
slider: slider,
|
|
@@ -5628,11 +5628,11 @@ function $535c6ee2337e2717$export$8cbd8aa1c70f9a13(interval = 5000) {
|
|
|
5628
5628
|
return {
|
|
5629
5629
|
constructor_plugin() {
|
|
5630
5630
|
const set_scroll_int = interval_scroll.bind(this);
|
|
5631
|
-
this.container.addEventListener("click",
|
|
5631
|
+
this.container.addEventListener("click", $268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => {
|
|
5632
5632
|
clearInterval(timer);
|
|
5633
5633
|
set_scroll_int();
|
|
5634
5634
|
}));
|
|
5635
|
-
this.container.addEventListener("mousedown",
|
|
5635
|
+
this.container.addEventListener("mousedown", $268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => {
|
|
5636
5636
|
clearInterval(timer);
|
|
5637
5637
|
}));
|
|
5638
5638
|
set_scroll_int();
|
|
@@ -5649,7 +5649,7 @@ function $a8a0385b88626561$export$80039a49055269fb() {
|
|
|
5649
5649
|
return Object.fromEntries(["left", "right"].map(side => [side, [new_arrowimage()]]));
|
|
5650
5650
|
}
|
|
5651
5651
|
function $edc9fe0b09e00df6$export$af88b4929c2dc86() {
|
|
5652
|
-
const img =
|
|
5652
|
+
const img = $107a74aa4ea5902d$export$34b9dba7ce09269b("img", {
|
|
5653
5653
|
src: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHN0eWxlPSJkaXNwbGF5OiBpbmxpbmUtYmxvY2s7IHZlcnRpY2FsLWFsaWduOiBtaWRkbGU7IiB3aWR0aD0iMTZweCIgaGVpZ2h0PSIxNnB4IiB2aWV3Qm94PSIwIDAgOCAxNSI+PHBhdGggc3R5bGU9ImZpbGw6IHJnYigwLCAwLCAwKTsiIGQ9Ik0uNjI5LjAwMWMuMTUuMDA4LjI5My4wNzIuMzk4LjE4bDYuNzkyIDYuODlhLjYwMS42MDEgMCAwIDEgMCAuODZsLTYuNzkyIDYuODg4YS41ODYuNTg2IDAgMCAxLS44NDYgMCAuNjAxLjYwMSAwIDAgMSAwLS44Nkw2LjU1NCA3LjUuMjExIDEuMDAxYS42MDEuNjAxIDAgMCAxIDAtLjg2Yy4xMTUtLjEuMjY2LS4xNS40MTgtLjE0Ij48L3BhdGg+PC9zdmc+"
|
|
5654
5654
|
});
|
|
5655
5655
|
return {
|
|
@@ -5744,12 +5744,12 @@ function $158313c0231e6555$export$1d17a045bcc711b1({
|
|
|
5744
5744
|
};
|
|
5745
5745
|
}
|
|
5746
5746
|
function $158313c0231e6555$export$a09282b33e69b43f(unique_name) {
|
|
5747
|
-
return
|
|
5747
|
+
return $107a74aa4ea5902d$export$25062201e9e25d76("label", {
|
|
5748
5748
|
class: "checkbox_container",
|
|
5749
|
-
children: [
|
|
5749
|
+
children: [$107a74aa4ea5902d$export$34b9dba7ce09269b("input", {
|
|
5750
5750
|
type: "radio",
|
|
5751
5751
|
name: `radio-${unique_name}`
|
|
5752
|
-
}),
|
|
5752
|
+
}), $107a74aa4ea5902d$export$34b9dba7ce09269b("span", {
|
|
5753
5753
|
class: "checkmark"
|
|
5754
5754
|
})]
|
|
5755
5755
|
});
|
|
@@ -5833,7 +5833,7 @@ function $98ef92db220106f3$export$411b0f20794697ce(t) {
|
|
|
5833
5833
|
}
|
|
5834
5834
|
function mutation_plugin(intersections, intersecting_mutations) {}
|
|
5835
5835
|
function instant_post_pro(items) {
|
|
5836
|
-
|
|
5836
|
+
$bf7f12fe044e41b2$export$5e63aea0cac01fa0(items, "a, img, canvas").forEach(el => {
|
|
5837
5837
|
// @ts-ignore
|
|
5838
5838
|
el.draggable = false;
|
|
5839
5839
|
el.addEventListener("dragstart", e => {
|
|
@@ -5895,10 +5895,10 @@ function $91f7baba008bce7d$export$5723caf9a8335aa6(_t, fraction = 1, max_steps,
|
|
|
5895
5895
|
configurable: true,
|
|
5896
5896
|
enumerable: true,
|
|
5897
5897
|
set(v) {
|
|
5898
|
-
|
|
5898
|
+
$548fd58b14b25a52$export$8048b892d651b310(new Error("Cannot set steps to slide manually when using fractional scroll"));
|
|
5899
5899
|
return v;
|
|
5900
5900
|
},
|
|
5901
|
-
get:
|
|
5901
|
+
get: $268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => {
|
|
5902
5902
|
const sliding_width = sliding.getBoundingClientRect().width;
|
|
5903
5903
|
const first_rec = sliding.firstElementChild;
|
|
5904
5904
|
if (!first_rec)
|
|
@@ -5910,7 +5910,7 @@ function $91f7baba008bce7d$export$5723caf9a8335aa6(_t, fraction = 1, max_steps,
|
|
|
5910
5910
|
const stepsize_limited_up = max_steps && calculated_stepsize > max_steps ? max_steps : calculated_stepsize;
|
|
5911
5911
|
const stepsize_limited_up_and_down = min_steps && stepsize_limited_up < min_steps ? min_steps : stepsize_limited_up;
|
|
5912
5912
|
const stepby = stepsize_limited_up_and_down || fallback_stepsize;
|
|
5913
|
-
if (stepby != calculated_stepsize)
|
|
5913
|
+
if (stepby != calculated_stepsize) $e6c6e7929ea385ae$export$de56f1198d121036("going by", stepby, "because of max_steps or invalid stepsize");
|
|
5914
5914
|
return stepby;
|
|
5915
5915
|
})
|
|
5916
5916
|
});
|
|
@@ -5923,10 +5923,10 @@ function $91f7baba008bce7d$export$5723caf9a8335aa6(_t, fraction = 1, max_steps,
|
|
|
5923
5923
|
}
|
|
5924
5924
|
function $1942530ef27e571b$export$93223e488e7ee078(options) {
|
|
5925
5925
|
function constructor_plugin(_slider_options) {
|
|
5926
|
-
const scroll_bar =
|
|
5926
|
+
const scroll_bar = $107a74aa4ea5902d$export$34b9dba7ce09269b("div", {
|
|
5927
5927
|
class: "depict_slider_scroll_bar"
|
|
5928
5928
|
});
|
|
5929
|
-
const scroll_container =
|
|
5929
|
+
const scroll_container = $107a74aa4ea5902d$export$34b9dba7ce09269b("div", {
|
|
5930
5930
|
class: "depict_slider_scroll_container"
|
|
5931
5931
|
});
|
|
5932
5932
|
if (options.scroll_bar_classes?.length) scroll_bar.classList.add(...options.scroll_bar_classes);
|
|
@@ -5961,14 +5961,14 @@ function $6af20338fcad1911$export$b36d2489a5a16728(_t, {
|
|
|
5961
5961
|
} = {}) {
|
|
5962
5962
|
function constructor_plugin(_slider_options) {
|
|
5963
5963
|
const slider_this = this;
|
|
5964
|
-
const random_classname = "x" +
|
|
5964
|
+
const random_classname = "x" + $650b64c1b384c895$export$656831b7e9c341c3().replaceAll(".", "");
|
|
5965
5965
|
slider_this.insert_here.classList.add(random_classname);
|
|
5966
5966
|
const style = document.createElement("style");
|
|
5967
5967
|
style.append(`.depict .${random_classname}{scroll-snap-type:x mandatory}.depict .${random_classname}>*:nth-child(${snapEvery ?? 1}n + 1){scroll-snap-align:${align || "start"}}`);
|
|
5968
5968
|
slider_this.snap_style = slider_this.container.appendChild(style);
|
|
5969
5969
|
$6af20338fcad1911$export$49b950309ab787ad().then(we_can => {
|
|
5970
5970
|
if (!we_can) {
|
|
5971
|
-
|
|
5971
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Disabling slider snapping due browser where it's impossible to have working buttons and css snapping");
|
|
5972
5972
|
style.remove();
|
|
5973
5973
|
delete slider_this["snap_style"];
|
|
5974
5974
|
}
|
|
@@ -5984,9 +5984,9 @@ function $6af20338fcad1911$export$b36d2489a5a16728(_t, {
|
|
|
5984
5984
|
}
|
|
5985
5985
|
async function $6af20338fcad1911$export$49b950309ab787ad() {
|
|
5986
5986
|
if ("scrollBehavior" in document.documentElement.style) return true;
|
|
5987
|
-
const test_div =
|
|
5987
|
+
const test_div = $107a74aa4ea5902d$export$34b9dba7ce09269b("div", {
|
|
5988
5988
|
style: "position: absolute; width: 1em; overflow: scroll; scroll-snap-type: x mandatory;",
|
|
5989
|
-
children:
|
|
5989
|
+
children: $107a74aa4ea5902d$export$34b9dba7ce09269b("div", {
|
|
5990
5990
|
style: "scroll-snap-align: start; color: transparent;",
|
|
5991
5991
|
children: "test"
|
|
5992
5992
|
})
|
|
@@ -6021,14 +6021,14 @@ function $379066823f8eeb0b$export$dac64fd35a4805a4(options = {}) {
|
|
|
6021
6021
|
insert_here: sliding
|
|
6022
6022
|
} = this;
|
|
6023
6023
|
const scroll_abs_no_negative = target => this.scroll_to_abs(target < 0 ? 0 : target); // the slider ignores everything < 0 but we want it to move to the first card
|
|
6024
|
-
sliding.addEventListener("mousedown",
|
|
6024
|
+
sliding.addEventListener("mousedown", $268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => {
|
|
6025
6025
|
lock_on_element.lock_active = true;
|
|
6026
6026
|
const starting_ratio_left = ratio_left.ratio;
|
|
6027
6027
|
lock_on_element.left = ratio_left.element;
|
|
6028
6028
|
const starting_ratio_right = ratio_right.ratio;
|
|
6029
6029
|
lock_on_element.right = ratio_right.element;
|
|
6030
6030
|
const scroll_left_start = sliding.scrollLeft;
|
|
6031
|
-
const mouseup_listener =
|
|
6031
|
+
const mouseup_listener = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(e => {
|
|
6032
6032
|
lock_on_element.lock_active = false;
|
|
6033
6033
|
const delta_left = Math.abs(ratio_left.ratio - starting_ratio_left);
|
|
6034
6034
|
const delta_right = Math.abs(ratio_right.ratio - starting_ratio_right);
|
|
@@ -6040,7 +6040,7 @@ function $379066823f8eeb0b$export$dac64fd35a4805a4(options = {}) {
|
|
|
6040
6040
|
try {
|
|
6041
6041
|
currently_visible = Math.floor(this.insert_here.getBoundingClientRect().width / this.insert_here.firstElementChild.getBoundingClientRect().width);
|
|
6042
6042
|
} catch (e) {
|
|
6043
|
-
|
|
6043
|
+
$268cbd9e4ade92db$export$f18d5b0af29128b7(e, "warning");
|
|
6044
6044
|
}
|
|
6045
6045
|
const stepsize = options.stepsize || currently_visible || 4;
|
|
6046
6046
|
if (scrolled_right) scroll_abs_no_negative(+currently_left + stepsize);else scroll_abs_no_negative(+currently_left - stepsize);
|
|
@@ -6084,8 +6084,8 @@ function $379066823f8eeb0b$export$dac64fd35a4805a4(options = {}) {
|
|
|
6084
6084
|
}
|
|
6085
6085
|
}
|
|
6086
6086
|
return {
|
|
6087
|
-
constructor_plugin:
|
|
6088
|
-
mutation_plugin:
|
|
6087
|
+
constructor_plugin: $268cbd9e4ade92db$export$b3bbfd758f11cfa9(constructor_plugin),
|
|
6088
|
+
mutation_plugin: $268cbd9e4ade92db$export$b3bbfd758f11cfa9(mutation_plugin)
|
|
6089
6089
|
};
|
|
6090
6090
|
}
|
|
6091
6091
|
function $3d8df0a23b9bebac$export$53306504b987cbf7({
|
|
@@ -6107,7 +6107,7 @@ function $3d8df0a23b9bebac$export$53306504b987cbf7({
|
|
|
6107
6107
|
let are_far_right = false;
|
|
6108
6108
|
let inactive_checker_timeout;
|
|
6109
6109
|
// let elgreen;
|
|
6110
|
-
const check_if_we_inactive =
|
|
6110
|
+
const check_if_we_inactive = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(function () {
|
|
6111
6111
|
// const { insert_here: sliding } = this;
|
|
6112
6112
|
const now = window?.performance?.now?.() || +new Date();
|
|
6113
6113
|
const time_since_ran = now - last_move;
|
|
@@ -6118,7 +6118,7 @@ function $3d8df0a23b9bebac$export$53306504b987cbf7({
|
|
|
6118
6118
|
// sliding.style.background = "green";
|
|
6119
6119
|
// elgreen = true;
|
|
6120
6120
|
// }
|
|
6121
|
-
|
|
6121
|
+
$268cbd9e4ade92db$export$b3bbfd758f11cfa9($3d8df0a23b9bebac$var$scroll_idle)(this, originally_rendered_elements.length, clones_per_side);
|
|
6122
6122
|
inactive_checker_running = false;
|
|
6123
6123
|
} else {
|
|
6124
6124
|
// if (elgreen !== false) {
|
|
@@ -6132,10 +6132,10 @@ function $3d8df0a23b9bebac$export$53306504b987cbf7({
|
|
|
6132
6132
|
function constructor_plugin() {
|
|
6133
6133
|
window.addEventListener("touchstart", () => touches++);
|
|
6134
6134
|
window.addEventListener("touchend", () => touches--);
|
|
6135
|
-
this.insert_here.addEventListener("scroll",
|
|
6135
|
+
this.insert_here.addEventListener("scroll", $268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => {
|
|
6136
6136
|
last_move = window?.performance?.now?.() || +new Date();
|
|
6137
6137
|
}));
|
|
6138
|
-
const mo = new MutationObserver(
|
|
6138
|
+
const mo = new MutationObserver($268cbd9e4ade92db$export$b3bbfd758f11cfa9(records => {
|
|
6139
6139
|
for (const record of records) for (const node of record.removedNodes) {
|
|
6140
6140
|
if (removed_by_us.has(node)) {
|
|
6141
6141
|
removed_by_us.delete(node);
|
|
@@ -6144,7 +6144,7 @@ function $3d8df0a23b9bebac$export$53306504b987cbf7({
|
|
|
6144
6144
|
for (const a_set of sets_of_els) {
|
|
6145
6145
|
const index_in_el_set = a_set.indexOf(node);
|
|
6146
6146
|
if (index_in_el_set >= 0) {
|
|
6147
|
-
|
|
6147
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Removing", node, "from el set", a_set);
|
|
6148
6148
|
a_set.splice(index_in_el_set, 1);
|
|
6149
6149
|
}
|
|
6150
6150
|
}
|
|
@@ -6173,7 +6173,7 @@ function $3d8df0a23b9bebac$export$53306504b987cbf7({
|
|
|
6173
6173
|
// calculate how many cards including margin the slider fits
|
|
6174
6174
|
const first_rect = first_element.getBoundingClientRect();
|
|
6175
6175
|
if (!first_rect.width) {
|
|
6176
|
-
|
|
6176
|
+
$e6c6e7929ea385ae$export$de56f1198d121036(first_rect);
|
|
6177
6177
|
throw new Error("First rect doesn't have width");
|
|
6178
6178
|
}
|
|
6179
6179
|
const second_rect = second_element.getBoundingClientRect();
|
|
@@ -6191,7 +6191,7 @@ function $3d8df0a23b9bebac$export$53306504b987cbf7({
|
|
|
6191
6191
|
}
|
|
6192
6192
|
if (dont_wraparound) {
|
|
6193
6193
|
if (surplus_in_body) {
|
|
6194
|
-
|
|
6194
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Removing surplus of els. Total els: ", sets_of_els);
|
|
6195
6195
|
// @ts-ignore
|
|
6196
6196
|
for (let i = (sets_of_els.length || 1) - 1; i--;) for (let j = 0; j < sets_of_els[i].length; j++) {
|
|
6197
6197
|
const el = sets_of_els[i][j];
|
|
@@ -6207,7 +6207,7 @@ function $3d8df0a23b9bebac$export$53306504b987cbf7({
|
|
|
6207
6207
|
return;
|
|
6208
6208
|
}
|
|
6209
6209
|
if (!surplus_in_body) {
|
|
6210
|
-
|
|
6210
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Adding surplus of els");
|
|
6211
6211
|
this.insert_here.append(...sets_of_els.slice(0, -1).flat());
|
|
6212
6212
|
this.invalidate_cache();
|
|
6213
6213
|
surplus_in_body = true;
|
|
@@ -6245,11 +6245,11 @@ function $3d8df0a23b9bebac$export$53306504b987cbf7({
|
|
|
6245
6245
|
if (our_index >= 0) post_processors.splice(our_index, 1);else {
|
|
6246
6246
|
const msg = "Couldn't find ourselves in post processors, infinite loop might ensue. Exiting. Wraparound will be broken.";
|
|
6247
6247
|
(0, $61a34358bf0d3d8b$export$af2e17a20c2ea3c5).captureException(new Error(msg));
|
|
6248
|
-
|
|
6248
|
+
$e6c6e7929ea385ae$export$de56f1198d121036(msg, () => {});
|
|
6249
6249
|
return elements;
|
|
6250
6250
|
}
|
|
6251
6251
|
for (let i = 0; i < clones_per_side * 2; i++) {
|
|
6252
|
-
const additional_render = await
|
|
6252
|
+
const additional_render = await $558ccd2de887e6d9$export$a9fc160c5ed83bd7(info.t, {
|
|
6253
6253
|
...rendering_options,
|
|
6254
6254
|
post_processors: post_processors,
|
|
6255
6255
|
pre_processors: [],
|
|
@@ -6363,7 +6363,7 @@ function $3721a5ccba25c247$export$3d04c40e7acc1a32(initial_value) {
|
|
|
6363
6363
|
function $93c499898a1702c7$export$515c3ea4d599b05a(
|
|
6364
6364
|
// inspired by code in houdinisportswear modify script
|
|
6365
6365
|
query, handler, initial_call = true) {
|
|
6366
|
-
const catchified_handler =
|
|
6366
|
+
const catchified_handler = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(handler, "Error in media query listener callback");
|
|
6367
6367
|
if (typeof window !== "object") {
|
|
6368
6368
|
// on server call the handler in case nothing is rendered if it isn't called, then do nothing
|
|
6369
6369
|
catchified_handler({
|
|
@@ -6391,9 +6391,9 @@ async function $bf76a92ec2055e1a$export$417ef0ab13d8b984({
|
|
|
6391
6391
|
let resolve_success_promise;
|
|
6392
6392
|
const success_promise = new Promise(r => resolve_success_promise = r);
|
|
6393
6393
|
const cache = new Map();
|
|
6394
|
-
const [template_els, _get, set_els] =
|
|
6395
|
-
const catchified_switch_to_surface =
|
|
6396
|
-
|
|
6394
|
+
const [template_els, _get, set_els] = $3721a5ccba25c247$export$3d04c40e7acc1a32();
|
|
6395
|
+
const catchified_switch_to_surface = $268cbd9e4ade92db$export$b3bbfd758f11cfa9($bf76a92ec2055e1a$var$switch_to_surface);
|
|
6396
|
+
$268cbd9e4ade92db$export$b3bbfd758f11cfa9(async () => {
|
|
6397
6397
|
for await (const surface of current_surface_) {
|
|
6398
6398
|
const rendering_function = surface_rendering_functions_[surface];
|
|
6399
6399
|
catchified_switch_to_surface(surface, rendering_function, current_surface_, cache, set_els, resolve_success_promise);
|
|
@@ -6411,9 +6411,9 @@ async function $bf76a92ec2055e1a$var$switch_to_surface(surface_index, rendering_
|
|
|
6411
6411
|
const {
|
|
6412
6412
|
cache_until_: cache_until_,
|
|
6413
6413
|
surface_: surface_
|
|
6414
|
-
} = await rendering_function().catch(e => (
|
|
6414
|
+
} = await rendering_function().catch(e => ($268cbd9e4ade92db$export$f18d5b0af29128b7([e, "error in rendering"], "warning"), {}));
|
|
6415
6415
|
if (!surface_ || !surface_?.elements?.length) {
|
|
6416
|
-
|
|
6416
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Got no/empty surface, not switching");
|
|
6417
6417
|
// also tell insert_surface that we didn't get recs so it can revert, dunno if we want this
|
|
6418
6418
|
resolve_success_promise(false);
|
|
6419
6419
|
return;
|
|
@@ -6421,17 +6421,17 @@ async function $bf76a92ec2055e1a$var$switch_to_surface(surface_index, rendering_
|
|
|
6421
6421
|
rendered_surface = surface_;
|
|
6422
6422
|
if (cache_until_ instanceof Promise) {
|
|
6423
6423
|
cache.set(surface_index, surface_);
|
|
6424
|
-
cache_until_.then(
|
|
6424
|
+
cache_until_.then($268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => cache.delete(surface_index)));
|
|
6425
6425
|
}
|
|
6426
6426
|
}
|
|
6427
6427
|
if (current_surface_ipns.state !== surface_index) {
|
|
6428
|
-
|
|
6428
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Surface switched to", current_surface_ipns.state, "while rendering surface", surface_index, "discarding results");
|
|
6429
6429
|
return;
|
|
6430
6430
|
}
|
|
6431
6431
|
set_els(rendered_surface.elements);
|
|
6432
6432
|
if (rendered_surface.should_stay_inserted instanceof Promise)
|
|
6433
6433
|
// if there is promise that says if surface succeeded or not, use that
|
|
6434
|
-
rendered_surface.should_stay_inserted.then(
|
|
6434
|
+
rendered_surface.should_stay_inserted.then($268cbd9e4ade92db$export$b3bbfd758f11cfa9(success => {
|
|
6435
6435
|
resolve_success_promise(success);
|
|
6436
6436
|
}));else
|
|
6437
6437
|
// otherwise let's just assume it suceeded since there are elements
|
|
@@ -6439,12 +6439,12 @@ async function $bf76a92ec2055e1a$var$switch_to_surface(surface_index, rendering_
|
|
|
6439
6439
|
}
|
|
6440
6440
|
function $bf76a92ec2055e1a$export$419f84efad7d9fe(surface_per_size, cleanup_promise) {
|
|
6441
6441
|
let microtask_queued = false;
|
|
6442
|
-
const ipns =
|
|
6442
|
+
const ipns = $9a42a570de51ea3d$export$e806c6c1615a59ae();
|
|
6443
6443
|
const target_indexes = new Set();
|
|
6444
|
-
const dedupe_overlapping_queries =
|
|
6444
|
+
const dedupe_overlapping_queries = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => {
|
|
6445
6445
|
microtask_queued = false;
|
|
6446
6446
|
const first_value = target_indexes[Symbol.iterator]().next().value;
|
|
6447
|
-
if (first_value === ipns.latest_call_value)
|
|
6447
|
+
if (first_value === ipns.latest_call_value) $e6c6e7929ea385ae$export$de56f1198d121036("surface", first_value, "is already selected");else ipns(first_value);
|
|
6448
6448
|
if (target_indexes.size > 1) {
|
|
6449
6449
|
const error_string = "Multiple matching media queries detected, used first one: " + JSON.stringify(surface_per_size.filter(([index]) => target_indexes.has(index)));
|
|
6450
6450
|
target_indexes.clear();
|
|
@@ -6453,10 +6453,10 @@ function $bf76a92ec2055e1a$export$419f84efad7d9fe(surface_per_size, cleanup_prom
|
|
|
6453
6453
|
target_indexes.clear();
|
|
6454
6454
|
});
|
|
6455
6455
|
surface_per_size.forEach(([surface_index, min, max]) => {
|
|
6456
|
-
const media_query =
|
|
6456
|
+
const media_query = $1cc2444a0f1b992e$export$717f13d9ba00ca19(min, max).split("@media ").pop();
|
|
6457
6457
|
const {
|
|
6458
6458
|
remove: remove
|
|
6459
|
-
} =
|
|
6459
|
+
} = $93c499898a1702c7$export$515c3ea4d599b05a(media_query, ({
|
|
6460
6460
|
matches: matches
|
|
6461
6461
|
}) => {
|
|
6462
6462
|
if (!matches) return;
|
|
@@ -6466,21 +6466,21 @@ function $bf76a92ec2055e1a$export$419f84efad7d9fe(surface_per_size, cleanup_prom
|
|
|
6466
6466
|
microtask_queued = true;
|
|
6467
6467
|
}
|
|
6468
6468
|
});
|
|
6469
|
-
if (cleanup_promise instanceof Promise) cleanup_promise.then(remove);else
|
|
6469
|
+
if (cleanup_promise instanceof Promise) cleanup_promise.then(remove);else $69f7524c8bdd85b4$export$1cd22bab0d2c3b0b(remove);
|
|
6470
6470
|
});
|
|
6471
6471
|
return ipns;
|
|
6472
6472
|
}
|
|
6473
6473
|
function $bf76a92ec2055e1a$export$be95cb0e8cfd099e() {
|
|
6474
|
-
return new Promise(r =>
|
|
6474
|
+
return new Promise(r => $69f7524c8bdd85b4$export$1cd22bab0d2c3b0b(r));
|
|
6475
6475
|
}
|
|
6476
6476
|
function $0c9d834f187cc4ff$export$3ebd86018b39d9d2(t, selector, filter) {
|
|
6477
6477
|
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onexists(selector, eoe => {
|
|
6478
|
-
|
|
6478
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Order confirmation element showed up!", eoe);
|
|
6479
6479
|
const {
|
|
6480
6480
|
element: element
|
|
6481
6481
|
} = eoe;
|
|
6482
6482
|
const the_id = element.innerText;
|
|
6483
|
-
$0c9d834f187cc4ff$export$1ac466d53a6636ac(t, the_id,
|
|
6483
|
+
$0c9d834f187cc4ff$export$1ac466d53a6636ac(t, the_id, $e0a87646d12cb987$export$6399bdb2291895e0(), filter);
|
|
6484
6484
|
});
|
|
6485
6485
|
}
|
|
6486
6486
|
function $0c9d834f187cc4ff$export$b11248fa13a8a86c(tenant, id_extractor) {
|
|
@@ -6498,7 +6498,7 @@ function $0c9d834f187cc4ff$export$b11248fa13a8a86c(tenant, id_extractor) {
|
|
|
6498
6498
|
try {
|
|
6499
6499
|
maybe_send_entries(args_list);
|
|
6500
6500
|
} catch (e) {
|
|
6501
|
-
|
|
6501
|
+
$268cbd9e4ade92db$export$f18d5b0af29128b7([e, "Extracting and sending transaction IDs from dataLayer failed"], "warning");
|
|
6502
6502
|
}
|
|
6503
6503
|
return target.apply(this_arg, args_list);
|
|
6504
6504
|
}
|
|
@@ -6510,15 +6510,15 @@ function $0c9d834f187cc4ff$export$ff8673d5dea82bd4(tenant, id_extractor) {
|
|
|
6510
6510
|
const order_id = id_extractor(new URL(href));
|
|
6511
6511
|
if (order_id && typeof order_id === "string") $0c9d834f187cc4ff$export$1ac466d53a6636ac(tenant, order_id);
|
|
6512
6512
|
}
|
|
6513
|
-
})().catch(e =>
|
|
6513
|
+
})().catch(e => $268cbd9e4ade92db$export$f18d5b0af29128b7([e, "Extracting and sending transaction IDs from URL failed"], "warning"));
|
|
6514
6514
|
}
|
|
6515
|
-
function $0c9d834f187cc4ff$export$1ac466d53a6636ac(t, input_id, dsid =
|
|
6515
|
+
function $0c9d834f187cc4ff$export$1ac466d53a6636ac(t, input_id, dsid = $e0a87646d12cb987$export$6399bdb2291895e0(), filter) {
|
|
6516
6516
|
const transaction_id = typeof filter == "function" ? filter(input_id) : input_id;
|
|
6517
6517
|
if (!transaction_id) {
|
|
6518
|
-
|
|
6518
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Not sending", transaction_id, "because it didn't pass filter");
|
|
6519
6519
|
return;
|
|
6520
6520
|
}
|
|
6521
|
-
|
|
6521
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Sending this order id:", transaction_id, "(before filtering it was", input_id, ")");
|
|
6522
6522
|
const payload = {
|
|
6523
6523
|
"tenant": t.tenant,
|
|
6524
6524
|
"market": t.market,
|
|
@@ -6528,36 +6528,36 @@ function $0c9d834f187cc4ff$export$1ac466d53a6636ac(t, input_id, dsid = (0, $e0a8
|
|
|
6528
6528
|
dsid: dsid
|
|
6529
6529
|
}]
|
|
6530
6530
|
};
|
|
6531
|
-
|
|
6531
|
+
$0c84f8e99aac5765$export$cc3b6ddf805f6156((0, $4c6861fbcd3a0611$export$362abebb4b313340) + "/v2/track", payload);
|
|
6532
6532
|
}
|
|
6533
6533
|
function $5a44db2d2c8361b9$export$1ff14fec60ed5697(t, filter) {
|
|
6534
6534
|
try {
|
|
6535
|
-
|
|
6536
|
-
ga(
|
|
6535
|
+
$c18ce8dadd041cdd$export$674d8cd8b6868154();
|
|
6536
|
+
ga($268cbd9e4ade92db$export$b3bbfd758f11cfa9(async function (tracker) {
|
|
6537
6537
|
let get_all_function = window?.ga?.getAll; // https://sentry.io/organizations/depictai-0o/issues/3621911835/?project=5476183&referrer=slack
|
|
6538
|
-
if (typeof get_all_function !== "function") get_all_function = await
|
|
6538
|
+
if (typeof get_all_function !== "function") get_all_function = await $e6d67ef355abb2dc$export$2fc1a072736ae2f6(window, "ga", "getAll");
|
|
6539
6539
|
const all_trackers = get_all_function.call(ga);
|
|
6540
|
-
|
|
6540
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("we have trackers", all_trackers);
|
|
6541
6541
|
// @ts-ignore
|
|
6542
6542
|
const {
|
|
6543
6543
|
P: P
|
|
6544
6544
|
} = ga;
|
|
6545
|
-
|
|
6545
|
+
$268cbd9e4ade92db$export$b3bbfd758f11cfa9(modify_trackers_of_iterable)(all_trackers);
|
|
6546
6546
|
if (typeof P?.push === "function")
|
|
6547
6547
|
// this check is just so we don't fail if this doesn't exist for some reason, but it always should
|
|
6548
6548
|
P.push = new Proxy(P.push, {
|
|
6549
6549
|
apply(target, this_arg, args_list) {
|
|
6550
6550
|
const retval = target.apply(this_arg, args_list);
|
|
6551
|
-
|
|
6551
|
+
$268cbd9e4ade92db$export$b3bbfd758f11cfa9(modify_trackers_of_iterable)(args_list);
|
|
6552
6552
|
return retval;
|
|
6553
6553
|
}
|
|
6554
6554
|
});
|
|
6555
6555
|
function modify_trackers_of_iterable(array) {
|
|
6556
|
-
for (const tracker of array)
|
|
6556
|
+
for (const tracker of array) $268cbd9e4ade92db$export$b3bbfd758f11cfa9($5a44db2d2c8361b9$var$make_tracker_send_to_depict)(tracker, t, filter);
|
|
6557
6557
|
}
|
|
6558
6558
|
}));
|
|
6559
6559
|
} catch (error) {
|
|
6560
|
-
|
|
6560
|
+
$268cbd9e4ade92db$export$f18d5b0af29128b7(error, "error");
|
|
6561
6561
|
}
|
|
6562
6562
|
}
|
|
6563
6563
|
function $5a44db2d2c8361b9$var$make_tracker_send_to_depict(ga_tracker, t, filter) {
|
|
@@ -6569,22 +6569,22 @@ function $5a44db2d2c8361b9$var$make_tracker_send_to_depict(ga_tracker, t, filter
|
|
|
6569
6569
|
originalSendHitTask(model);
|
|
6570
6570
|
// console.log('Sent original hit, now sending to depict');
|
|
6571
6571
|
try {
|
|
6572
|
-
const dsid =
|
|
6572
|
+
const dsid = $e0a87646d12cb987$export$6399bdb2291895e0();
|
|
6573
6573
|
const payload = model.get("hitPayload");
|
|
6574
6574
|
const sp = new URLSearchParams(payload);
|
|
6575
6575
|
const id = sp.get("ti");
|
|
6576
6576
|
if (id) {
|
|
6577
|
-
|
|
6578
|
-
|
|
6577
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Got interesting analytics request", payload, id);
|
|
6578
|
+
$0c9d834f187cc4ff$export$1ac466d53a6636ac(t, id, dsid, filter);
|
|
6579
6579
|
}
|
|
6580
6580
|
} catch (e) {
|
|
6581
|
-
|
|
6581
|
+
$268cbd9e4ade92db$export$f18d5b0af29128b7(e, "error");
|
|
6582
6582
|
}
|
|
6583
6583
|
});
|
|
6584
6584
|
}
|
|
6585
6585
|
async function $8594d423459ba80c$export$d63b08f4f29ddba5(t, unavailability_type) {
|
|
6586
6586
|
const product_id = await t.get_product_id();
|
|
6587
|
-
|
|
6587
|
+
$e6c6e7929ea385ae$export$de56f1198d121036(`Notifying Depict that product id: ${product_id} is ${unavailability_type}`);
|
|
6588
6588
|
const payload = {
|
|
6589
6589
|
"tenant": t.tenant,
|
|
6590
6590
|
"market": t.market,
|
|
@@ -6592,11 +6592,11 @@ async function $8594d423459ba80c$export$d63b08f4f29ddba5(t, unavailability_type)
|
|
|
6592
6592
|
event_type: "product_unavailable",
|
|
6593
6593
|
product_id: product_id,
|
|
6594
6594
|
unavailability_type: unavailability_type,
|
|
6595
|
-
user_id:
|
|
6596
|
-
dsid:
|
|
6595
|
+
user_id: $e0a87646d12cb987$export$adc61a405a4cabed(),
|
|
6596
|
+
dsid: $e0a87646d12cb987$export$6399bdb2291895e0()
|
|
6597
6597
|
}]
|
|
6598
6598
|
};
|
|
6599
|
-
|
|
6599
|
+
$0c84f8e99aac5765$export$cc3b6ddf805f6156((0, $4c6861fbcd3a0611$export$362abebb4b313340) + "/v2/track", payload);
|
|
6600
6600
|
}
|
|
6601
6601
|
|
|
6602
6602
|
/**
|
|
@@ -6656,11 +6656,11 @@ const $194791b6959e932d$export$6b75200e58bc97d0 = (arr1, arr2, compareFunc) => {
|
|
|
6656
6656
|
const $194791b6959e932d$export$9426572bd5645bc1 = (arr1, arr2) => $194791b6959e932d$export$6b75200e58bc97d0(arr1, arr2 || [], (i1, i2) => i1.product_id === i2.product_id);
|
|
6657
6657
|
function $1e9d51e365c02476$export$82539d9817116aff(e, url) {
|
|
6658
6658
|
if (e.button) {
|
|
6659
|
-
|
|
6659
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Not single page navigating because button is not 0", e);
|
|
6660
6660
|
return;
|
|
6661
6661
|
}
|
|
6662
6662
|
if (e.metaKey || e.ctrlKey) {
|
|
6663
|
-
|
|
6663
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Someone command-clicked a link, not single page navigating");
|
|
6664
6664
|
return;
|
|
6665
6665
|
}
|
|
6666
6666
|
// single page navigate
|
|
@@ -6721,7 +6721,7 @@ class $7ccebf01cfe4f824$export$f8da66bc4f1d059e extends Response {
|
|
|
6721
6721
|
}
|
|
6722
6722
|
}
|
|
6723
6723
|
function $23d6393391c08860$export$ab0f802c05dd969b(on_request) {
|
|
6724
|
-
|
|
6724
|
+
$7ccebf01cfe4f824$export$85be83e1935d93c2(async (target, this_arg, argument_list) => {
|
|
6725
6725
|
const response_promise = target.apply(this_arg, argument_list);
|
|
6726
6726
|
try {
|
|
6727
6727
|
const input = argument_list[0];
|
|
@@ -6757,7 +6757,7 @@ function $23d6393391c08860$export$ab0f802c05dd969b(on_request) {
|
|
|
6757
6757
|
break;
|
|
6758
6758
|
}
|
|
6759
6759
|
} catch (e) {
|
|
6760
|
-
|
|
6760
|
+
$268cbd9e4ade92db$export$f18d5b0af29128b7([e, "error in shopify interception logic"], "warning");
|
|
6761
6761
|
}
|
|
6762
6762
|
return await response_promise;
|
|
6763
6763
|
}, true);
|
|
@@ -6789,8 +6789,8 @@ async function $23d6393391c08860$export$337197b94b3bd680() {
|
|
|
6789
6789
|
const json = await response.json();
|
|
6790
6790
|
if (Array.isArray(json.items)) return json.items;else if (typeof json.status === "number") return json;else throw new Error(`Shopify ${url} did not respond as expected`);
|
|
6791
6791
|
}
|
|
6792
|
-
const $23d6393391c08860$export$783ef16647773b3d = /*@__PURE__
|
|
6793
|
-
const meta = await
|
|
6792
|
+
const $23d6393391c08860$export$783ef16647773b3d = /*@__PURE__*/$41f528c04cc8a8da$export$535946eb77c946dd( /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(async () => {
|
|
6793
|
+
const meta = await $e6d67ef355abb2dc$export$2fc1a072736ae2f6(window, "ShopifyAnalytics", "meta");
|
|
6794
6794
|
return meta?.product;
|
|
6795
6795
|
}));
|
|
6796
6796
|
async function $40f3ad8d5c440ce9$export$b404e20f3c4a490e({
|
|
@@ -6804,7 +6804,7 @@ async function $40f3ad8d5c440ce9$export$b404e20f3c4a490e({
|
|
|
6804
6804
|
Sentry: Sentry
|
|
6805
6805
|
} = t,
|
|
6806
6806
|
start = new Date().getTime(),
|
|
6807
|
-
optimize = await
|
|
6807
|
+
optimize = await $e6d67ef355abb2dc$export$2fc1a072736ae2f6(window, "google_optimize"),
|
|
6808
6808
|
end = new Date().getTime();
|
|
6809
6809
|
dlog("Waited for google_optimize for", end - start, "ms");
|
|
6810
6810
|
// if (!optimize.get) {
|
|
@@ -6830,19 +6830,19 @@ async function $40f3ad8d5c440ce9$export$b404e20f3c4a490e({
|
|
|
6830
6830
|
}
|
|
6831
6831
|
function $b6542de877d46468$export$2c2f50b30b7b2576(el, attribute_name, async_iterable, quit_after_navigation = true) {
|
|
6832
6832
|
(async () => {
|
|
6833
|
-
const [exit, exitable_iterable] =
|
|
6834
|
-
if (quit_after_navigation)
|
|
6833
|
+
const [exit, exitable_iterable] = $bbe52965151ee7f0$export$927664b47117acb0(async_iterable);
|
|
6834
|
+
if (quit_after_navigation) $69f7524c8bdd85b4$export$1cd22bab0d2c3b0b(exit);
|
|
6835
6835
|
for await (const new_value of exitable_iterable) el.setAttribute(attribute_name, new_value);
|
|
6836
|
-
})().catch(e =>
|
|
6836
|
+
})().catch(e => $268cbd9e4ade92db$export$f18d5b0af29128b7([e, "Failed to set attribute"], "error"));
|
|
6837
6837
|
return el;
|
|
6838
6838
|
}
|
|
6839
6839
|
function $374ca311b64f260b$export$7c081fdbc65b6a2a(async_iterable, quit_after_navigation = true) {
|
|
6840
|
-
const [template_els, _get, set] =
|
|
6840
|
+
const [template_els, _get, set] = $3721a5ccba25c247$export$3d04c40e7acc1a32();
|
|
6841
6841
|
(async () => {
|
|
6842
|
-
const [exit, exitable_iterable] =
|
|
6843
|
-
if (quit_after_navigation)
|
|
6842
|
+
const [exit, exitable_iterable] = $bbe52965151ee7f0$export$927664b47117acb0(async_iterable);
|
|
6843
|
+
if (quit_after_navigation) $69f7524c8bdd85b4$export$1cd22bab0d2c3b0b(exit);
|
|
6844
6844
|
for await (const els of exitable_iterable) set(els);
|
|
6845
|
-
})().catch(e =>
|
|
6845
|
+
})().catch(e => $268cbd9e4ade92db$export$f18d5b0af29128b7([e, "Failed to convert AsyncIterable to elements"], "error"));
|
|
6846
6846
|
return template_els;
|
|
6847
6847
|
}
|
|
6848
6848
|
let $c693a2d89c78efe6$var$context_counter = 0; // last context that was created (unless 0), to make sure we don't have two of the same
|
|
@@ -6898,23 +6898,23 @@ function $c693a2d89c78efe6$export$f811d2ce0aa6019b({
|
|
|
6898
6898
|
disconnect_reinsertion_observers?.(); // Not sure if necessary? But if we re-insert in the same container and don't disconnect preserve_elements observers before it might lead to two observers acting on one element
|
|
6899
6899
|
disconnect_reinsertion_observers = $c693a2d89c78efe6$var$actual_insertion(element, verb, surfaces, try_forever, href, context, remove_after_navigation, preserve_elements);
|
|
6900
6900
|
});
|
|
6901
|
-
if (!try_forever)
|
|
6901
|
+
if (!try_forever) $69f7524c8bdd85b4$export$1cd22bab0d2c3b0b(disconnect_observer);
|
|
6902
6902
|
} else {
|
|
6903
6903
|
if (!context && verb !== "replaceChildren") throw new Error("insert_surface, provided an element, may not be called without a context." + (process.env.DEBUG === "true" ? " Please wrap the function calling it into prevent_infinite_loop(). If you have already done that, make sure that there's no `await` before the calling of insert_surface" : ""));
|
|
6904
|
-
|
|
6904
|
+
$268cbd9e4ade92db$export$b3bbfd758f11cfa9($c693a2d89c78efe6$var$actual_insertion)(target, verb, surfaces, try_forever, href, context, remove_after_navigation, preserve_elements);
|
|
6905
6905
|
}
|
|
6906
6906
|
return surfaces.map(({
|
|
6907
6907
|
promise_: promise_
|
|
6908
6908
|
}) => promise_);
|
|
6909
6909
|
}
|
|
6910
|
-
const $c693a2d89c78efe6$export$e3f70ef7e3d00501 = /*@__PURE__
|
|
6910
|
+
const $c693a2d89c78efe6$export$e3f70ef7e3d00501 = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(async (target, should_stay_inserted) => {
|
|
6911
6911
|
const per_el_fn = (el, disconnect_observer) => {
|
|
6912
6912
|
const comment_node = document.createComment("Old recs were here // Depict");
|
|
6913
|
-
|
|
6913
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Replacing", el, "with", comment_node);
|
|
6914
6914
|
el.replaceWith(comment_node);
|
|
6915
6915
|
should_stay_inserted.then(keep => {
|
|
6916
6916
|
if (!keep) {
|
|
6917
|
-
|
|
6917
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Reverting", comment_node, "to", el);
|
|
6918
6918
|
comment_node.replaceWith(el);
|
|
6919
6919
|
disconnect_observer?.();
|
|
6920
6920
|
}
|
|
@@ -6925,7 +6925,7 @@ const $c693a2d89c78efe6$export$e3f70ef7e3d00501 = /*@__PURE__*/(0, $268cbd9e4ade
|
|
|
6925
6925
|
element: element,
|
|
6926
6926
|
disconnector: disconnector
|
|
6927
6927
|
}) => per_el_fn(element, disconnector));
|
|
6928
|
-
|
|
6928
|
+
$69f7524c8bdd85b4$export$1cd22bab0d2c3b0b(disconnect_observer);
|
|
6929
6929
|
} else {
|
|
6930
6930
|
let did_already_fail = false;
|
|
6931
6931
|
should_stay_inserted.then(should_stay_inserted => {
|
|
@@ -6933,7 +6933,7 @@ const $c693a2d89c78efe6$export$e3f70ef7e3d00501 = /*@__PURE__*/(0, $268cbd9e4ade
|
|
|
6933
6933
|
});
|
|
6934
6934
|
await 0;
|
|
6935
6935
|
if (did_already_fail) {
|
|
6936
|
-
|
|
6936
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Not removing", target, should_stay_inserted, "is already resolved to false");
|
|
6937
6937
|
return;
|
|
6938
6938
|
}
|
|
6939
6939
|
if (Array.isArray(target)) for (let i = 0; i < target.length; i++) per_el_fn(target[i]);else per_el_fn(target);
|
|
@@ -6948,7 +6948,7 @@ function $c693a2d89c78efe6$var$actual_insertion(target, verb, surfaces, try_fore
|
|
|
6948
6948
|
const disconnect_all_observers = () => disconnectors.forEach(disconnector => disconnector());
|
|
6949
6949
|
const check_if_revert_whole = () => {
|
|
6950
6950
|
if (failed_surfaces !== surfaces.length) return; // we didn't fail
|
|
6951
|
-
|
|
6951
|
+
$e6c6e7929ea385ae$export$de56f1198d121036(`All surfaces`, surfaces, `failed. ${was_replaced ? "Reverting to old els" : "removing els"}`);
|
|
6952
6952
|
$c693a2d89c78efe6$var$failed_contexts.add(context);
|
|
6953
6953
|
disconnect_all_observers();
|
|
6954
6954
|
const flat_tnodes = template_nodes.flat();
|
|
@@ -6961,29 +6961,29 @@ function $c693a2d89c78efe6$var$actual_insertion(target, verb, surfaces, try_fore
|
|
|
6961
6961
|
surface_: surface_,
|
|
6962
6962
|
resolve_promise_: resolve_promise_
|
|
6963
6963
|
}) => {
|
|
6964
|
-
const [template_els, _get, set] =
|
|
6964
|
+
const [template_els, _get, set] = $3721a5ccba25c247$export$3d04c40e7acc1a32();
|
|
6965
6965
|
(async () => {
|
|
6966
6966
|
let surface;
|
|
6967
6967
|
try {
|
|
6968
6968
|
surface = await surface_;
|
|
6969
6969
|
} catch (e) {
|
|
6970
|
-
|
|
6970
|
+
$268cbd9e4ade92db$export$f18d5b0af29128b7([e, "A surface promise rejected" + (process.env.DEBUG === "true" ? " please catch this earlier" : "")], "warning");
|
|
6971
6971
|
}
|
|
6972
6972
|
if (!try_forever && location.href !== starting_href)
|
|
6973
6973
|
// navigated away
|
|
6974
6974
|
return;
|
|
6975
6975
|
// @ts-ignore
|
|
6976
6976
|
if (surface?.elements) {
|
|
6977
|
-
|
|
6977
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("insert_surface:", target, "." + verb, surface);
|
|
6978
6978
|
set(surface.elements);
|
|
6979
|
-
if (surface.should_stay_inserted instanceof Promise) surface.should_stay_inserted.then(
|
|
6979
|
+
if (surface.should_stay_inserted instanceof Promise) surface.should_stay_inserted.then($268cbd9e4ade92db$export$b3bbfd758f11cfa9(keep => {
|
|
6980
6980
|
if (keep)
|
|
6981
6981
|
// @ts-ignore
|
|
6982
6982
|
resolve_promise_({
|
|
6983
6983
|
surface: surface,
|
|
6984
6984
|
succeeded: true
|
|
6985
6985
|
});else {
|
|
6986
|
-
|
|
6986
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Removing surface", surface, "because it failed");
|
|
6987
6987
|
set("");
|
|
6988
6988
|
// @ts-ignore
|
|
6989
6989
|
resolve_promise_({
|
|
@@ -7006,7 +7006,7 @@ function $c693a2d89c78efe6$var$actual_insertion(target, verb, surfaces, try_fore
|
|
|
7006
7006
|
failed_surfaces++;
|
|
7007
7007
|
check_if_revert_whole();
|
|
7008
7008
|
}
|
|
7009
|
-
})().catch(e =>
|
|
7009
|
+
})().catch(e => $268cbd9e4ade92db$export$f18d5b0af29128b7([e, "insert_surface failed due to technical errors"], "error"));
|
|
7010
7010
|
return template_els;
|
|
7011
7011
|
});
|
|
7012
7012
|
target[verb](...template_nodes.flat());
|
|
@@ -7015,10 +7015,10 @@ function $c693a2d89c78efe6$var$actual_insertion(target, verb, surfaces, try_fore
|
|
|
7015
7015
|
const already_observing_nodes = new WeakSet();
|
|
7016
7016
|
$c693a2d89c78efe6$var$deal_w_removal_of_node_array(node_array, disconnectors.push.bind(disconnectors), already_observing_nodes);
|
|
7017
7017
|
}
|
|
7018
|
-
if (remove_after_navigation)
|
|
7018
|
+
if (remove_after_navigation) $69f7524c8bdd85b4$export$1cd22bab0d2c3b0b(() => {
|
|
7019
7019
|
disconnect_all_observers();
|
|
7020
7020
|
template_nodes.flat().forEach(tn => tn.remove());
|
|
7021
|
-
|
|
7021
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Removed", template_nodes, "due to navigation");
|
|
7022
7022
|
});
|
|
7023
7023
|
return disconnect_all_observers;
|
|
7024
7024
|
}
|
|
@@ -7042,7 +7042,7 @@ function $c693a2d89c78efe6$var$deal_w_removal_of_node_array(node_array, push_dis
|
|
|
7042
7042
|
target: target
|
|
7043
7043
|
} = mutation_record;
|
|
7044
7044
|
if (previous_parent !== target) {
|
|
7045
|
-
|
|
7045
|
+
$e6c6e7929ea385ae$export$de56f1198d121036(element, "was removed", eoe, "but because a parent got removed we're keeping it that way");
|
|
7046
7046
|
return;
|
|
7047
7047
|
}
|
|
7048
7048
|
if (node_array.every(node => target.contains(node))) {
|
|
@@ -7050,18 +7050,18 @@ function $c693a2d89c78efe6$var$deal_w_removal_of_node_array(node_array, push_dis
|
|
|
7050
7050
|
// node_array is a reference to an updating array
|
|
7051
7051
|
// it has always updated once this callback is ran, so we can just check if the new value are currently in the DOM
|
|
7052
7052
|
// here we don't check the order but I don't think it's going to be an issue?
|
|
7053
|
-
|
|
7053
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Ignoring removal of", element, eoe, "because it seems to come from reactive_template change");
|
|
7054
7054
|
// protect future nodes
|
|
7055
7055
|
$c693a2d89c78efe6$var$deal_w_removal_of_node_array(node_array, push_disconnector, already_observing_nodes);
|
|
7056
7056
|
} else if (!target.contains(element)) {
|
|
7057
7057
|
// it's possible that the element already was re-inserted at the same time (this callback is executed a tick late), we obv. don't want to attempt to reinsert then
|
|
7058
7058
|
if (removals_in_last_s > 10) {
|
|
7059
|
-
|
|
7059
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("More than 10 reinsertions in last second, ignoring");
|
|
7060
7060
|
return;
|
|
7061
7061
|
}
|
|
7062
7062
|
removals_in_last_s++;
|
|
7063
7063
|
setTimeout(() => removals_in_last_s--, 1000);
|
|
7064
|
-
|
|
7064
|
+
$e6c6e7929ea385ae$export$de56f1198d121036(element, "was removed from DOM,", eoe, "reinserting");
|
|
7065
7065
|
const {
|
|
7066
7066
|
documentElement: documentElement
|
|
7067
7067
|
} = document;
|
|
@@ -7074,7 +7074,7 @@ function $c693a2d89c78efe6$var$deal_w_removal_of_node_array(node_array, push_dis
|
|
|
7074
7074
|
push_disconnector(disconnect_observer);
|
|
7075
7075
|
}
|
|
7076
7076
|
}
|
|
7077
|
-
const $fac9c96b6bbe43cd$export$3b75288f46cadd96 = () => new Array(
|
|
7077
|
+
const $fac9c96b6bbe43cd$export$3b75288f46cadd96 = () => new Array($3f34dc07544c5857$export$bb0a9c36cf454ea0(3, 8)).fill("⬜").join("");
|
|
7078
7078
|
const $fac9c96b6bbe43cd$var$make_sel = (image_url, attribute) => `[${attribute}=${JSON.stringify(image_url)}]`;
|
|
7079
7079
|
const $fac9c96b6bbe43cd$export$a4eccf92efefa04d = (image_width, image_height, color = "#f6f7f8") => `data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='${image_width}' height='${image_height}' xmlns:v='https://vecta.io/nano'%3e%3cpath d='M0 0h${image_width}.016v${image_height}.01H0' fill='${encodeURIComponent(color)}'/%3e%3c/svg%3e`;
|
|
7080
7080
|
async function $fac9c96b6bbe43cd$export$2dd69958012e3e49({
|
|
@@ -7111,9 +7111,9 @@ async function $fac9c96b6bbe43cd$export$2dd69958012e3e49({
|
|
|
7111
7111
|
for (const elem of elems) {
|
|
7112
7112
|
if (elem instanceof HTMLElement) elem.style.cursor = "default";
|
|
7113
7113
|
elem?.classList?.add?.("placeholder");
|
|
7114
|
-
elem.addEventListener("click", e => (
|
|
7114
|
+
elem.addEventListener("click", e => ($e6c6e7929ea385ae$export$de56f1198d121036("Supressing placeholder click", e), e.preventDefault(), e.stopPropagation(), false), true);
|
|
7115
7115
|
}
|
|
7116
|
-
for (const img of
|
|
7116
|
+
for (const img of $bf7f12fe044e41b2$export$5e63aea0cac01fa0(elems, ["src", "srcset", "data-src", "data-srcset"].map(attribute => $fac9c96b6bbe43cd$var$make_sel(image_url, attribute)).join(", "))) img.classList.add("nolazy"); // this gets ignored by all lazyloaders
|
|
7117
7117
|
return elems;
|
|
7118
7118
|
}]
|
|
7119
7119
|
};
|
|
@@ -7122,9 +7122,9 @@ async function $fac9c96b6bbe43cd$export$2dd69958012e3e49({
|
|
|
7122
7122
|
let set_should_stay_inserted;
|
|
7123
7123
|
const should_stay_inserted = new Promise(r => set_should_stay_inserted = r);
|
|
7124
7124
|
if (placeholder_rendering?.elements) {
|
|
7125
|
-
const [template_els, _get_state, set_state] =
|
|
7125
|
+
const [template_els, _get_state, set_state] = $3721a5ccba25c247$export$3d04c40e7acc1a32(placeholder_rendering.elements);
|
|
7126
7126
|
actual_rendering.then(async rendering_result => {
|
|
7127
|
-
if (typeof post_rendering == "function") await
|
|
7127
|
+
if (typeof post_rendering == "function") await $268cbd9e4ade92db$export$b3bbfd758f11cfa9(post_rendering)(rendering_result);
|
|
7128
7128
|
const {
|
|
7129
7129
|
elements: elements
|
|
7130
7130
|
} = rendering_result || {};
|
|
@@ -7144,7 +7144,7 @@ async function $fac9c96b6bbe43cd$export$2dd69958012e3e49({
|
|
|
7144
7144
|
should_stay_inserted: should_stay_inserted
|
|
7145
7145
|
};
|
|
7146
7146
|
} else {
|
|
7147
|
-
|
|
7147
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Placeholder rendering went wrong, this is bad! Ditching placeholders");
|
|
7148
7148
|
return (await actual_rendering) || {};
|
|
7149
7149
|
}
|
|
7150
7150
|
};
|
|
@@ -7158,7 +7158,7 @@ function $d91a08ea384e6cd4$export$8ec5c86406f333ff() {
|
|
|
7158
7158
|
try {
|
|
7159
7159
|
return target.apply(this_arg, arguments_list);
|
|
7160
7160
|
} catch (e) {
|
|
7161
|
-
|
|
7161
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Swallowing error of removal of node that we have removed or created", e, el);
|
|
7162
7162
|
}
|
|
7163
7163
|
return el;
|
|
7164
7164
|
}
|
|
@@ -7194,7 +7194,7 @@ function $6d0c26cd36f5eeff$export$38e89c688f9d553a() {
|
|
|
7194
7194
|
const w = window;
|
|
7195
7195
|
let da_promise = w[$6d0c26cd36f5eeff$var$promise_as_string];
|
|
7196
7196
|
let iframe_promise;
|
|
7197
|
-
if ((typeof da_promise.allSettled !== "function" || typeof da_promise?.prototype?.finally !== "function") &&
|
|
7197
|
+
if ((typeof da_promise.allSettled !== "function" || typeof da_promise?.prototype?.finally !== "function") && !$bd274a272f8400ec$export$4fbbab6c30e664d5(da_promise) && (iframe_promise = $6d0c26cd36f5eeff$export$e647444ed9403635())) da_promise = iframe_promise;
|
|
7198
7198
|
if (da_promise) {
|
|
7199
7199
|
if (Object.getOwnPropertyDescriptor(w, $6d0c26cd36f5eeff$var$promise_as_string)?.configurable !== false) Object.defineProperty(w, $6d0c26cd36f5eeff$var$promise_as_string, {
|
|
7200
7200
|
configurable: false,
|
|
@@ -7205,10 +7205,10 @@ function $6d0c26cd36f5eeff$export$38e89c688f9d553a() {
|
|
|
7205
7205
|
set(value) {
|
|
7206
7206
|
return value;
|
|
7207
7207
|
}
|
|
7208
|
-
});else
|
|
7208
|
+
});else $e6c6e7929ea385ae$export$de56f1198d121036("Unable to redefine " + $6d0c26cd36f5eeff$var$promise_as_string + ", it's already nonconfigurable");
|
|
7209
7209
|
}
|
|
7210
7210
|
} catch (e) {
|
|
7211
|
-
|
|
7211
|
+
$548fd58b14b25a52$export$8048b892d651b310(e);
|
|
7212
7212
|
}
|
|
7213
7213
|
}
|
|
7214
7214
|
function $6d0c26cd36f5eeff$export$e647444ed9403635() {
|
|
@@ -7218,7 +7218,7 @@ function $6d0c26cd36f5eeff$export$e647444ed9403635() {
|
|
|
7218
7218
|
return iframe?.contentWindow?.[$6d0c26cd36f5eeff$var$promise_as_string];
|
|
7219
7219
|
}
|
|
7220
7220
|
function $61201159f98f0375$export$33d1643df63073a8(fetch_handler) {
|
|
7221
|
-
fetch_handler =
|
|
7221
|
+
fetch_handler = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(fetch_handler);
|
|
7222
7222
|
const {
|
|
7223
7223
|
prototype: prototype
|
|
7224
7224
|
} = XMLHttpRequest;
|
|
@@ -7227,17 +7227,17 @@ function $61201159f98f0375$export$33d1643df63073a8(fetch_handler) {
|
|
|
7227
7227
|
if (Array.isArray(arg_array)) {
|
|
7228
7228
|
const request = this_arg;
|
|
7229
7229
|
const [method, url] = arg_array;
|
|
7230
|
-
|
|
7230
|
+
$268cbd9e4ade92db$export$b3bbfd758f11cfa9(fetch_handler)(request, method, url, arg_array);
|
|
7231
7231
|
}
|
|
7232
7232
|
return target.apply(this_arg, arg_array);
|
|
7233
7233
|
}
|
|
7234
7234
|
});
|
|
7235
7235
|
}
|
|
7236
7236
|
function $61201159f98f0375$export$f314addd5f976083(handler) {
|
|
7237
|
-
$61201159f98f0375$export$33d1643df63073a8((req, method, url) => req.addEventListener("load",
|
|
7237
|
+
$61201159f98f0375$export$33d1643df63073a8((req, method, url) => req.addEventListener("load", $268cbd9e4ade92db$export$b3bbfd758f11cfa9(event => handler(req, method, url, event))));
|
|
7238
7238
|
}
|
|
7239
7239
|
async function $61201159f98f0375$export$c74578d2cd47a84a(send_callback) {
|
|
7240
|
-
const catchified_callback =
|
|
7240
|
+
const catchified_callback = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(send_callback);
|
|
7241
7241
|
const requests = new WeakMap();
|
|
7242
7242
|
$61201159f98f0375$export$33d1643df63073a8((request, _method, _url, arg_array) => {
|
|
7243
7243
|
requests.set(request, arg_array);
|
|
@@ -7250,14 +7250,14 @@ async function $61201159f98f0375$export$c74578d2cd47a84a(send_callback) {
|
|
|
7250
7250
|
try {
|
|
7251
7251
|
if (requests.has(this_request)) catchified_callback(this_request, requests.get(this_request), arg_list);
|
|
7252
7252
|
} catch (e) {
|
|
7253
|
-
|
|
7253
|
+
$548fd58b14b25a52$export$8048b892d651b310(e);
|
|
7254
7254
|
}
|
|
7255
7255
|
return target.apply(this_request, arg_list);
|
|
7256
7256
|
}
|
|
7257
7257
|
});
|
|
7258
7258
|
}
|
|
7259
7259
|
async function $61201159f98f0375$export$8e16c51fd2b6507(read_callback) {
|
|
7260
|
-
const catchified_read_callback =
|
|
7260
|
+
const catchified_read_callback = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(read_callback);
|
|
7261
7261
|
const open_send_arg_map = new WeakMap();
|
|
7262
7262
|
const {
|
|
7263
7263
|
prototype: prototype
|
|
@@ -7278,7 +7278,7 @@ async function $61201159f98f0375$export$8e16c51fd2b6507(read_callback) {
|
|
|
7278
7278
|
return catchified_read_callback(this_arg, open_args, send_args, default_value, n) || default_value;
|
|
7279
7279
|
} catch (e) {
|
|
7280
7280
|
// in case the weakmaps fail for some reason
|
|
7281
|
-
|
|
7281
|
+
$548fd58b14b25a52$export$8048b892d651b310(e);
|
|
7282
7282
|
return default_value;
|
|
7283
7283
|
}
|
|
7284
7284
|
}
|
|
@@ -7295,11 +7295,11 @@ async function $2780129735dc272e$export$83ec13b10b391f13(orig_url = process.env.
|
|
|
7295
7295
|
const orig_url_with_trailing_slash = o_u_u_o.protocol + "//" + o_u_u_o.host + "/";
|
|
7296
7296
|
if (orig_url) {
|
|
7297
7297
|
// change links
|
|
7298
|
-
|
|
7298
|
+
$bf7f12fe044e41b2$export$d4bd03f19260ef1c(orig_url_with_trailing_slash, false, location.hostname);
|
|
7299
7299
|
$2780129735dc272e$export$2a1cc61cffa1f36f(orig_url_with_trailing_slash);
|
|
7300
7300
|
$2780129735dc272e$export$2a38b176ce969e2c(orig_url_with_trailing_slash);
|
|
7301
7301
|
$2780129735dc272e$export$f14a775632a826c4(orig_url_with_trailing_slash);
|
|
7302
|
-
} else
|
|
7302
|
+
} else $e6c6e7929ea385ae$export$de56f1198d121036(new Error("No ORIG_URL env var was set, demo fixes not gonna work."));
|
|
7303
7303
|
}
|
|
7304
7304
|
function $2780129735dc272e$export$f14a775632a826c4(orig_url_with_trailing_slash) {
|
|
7305
7305
|
// rewrite history.pushState and history.replaceState so that it works if someone calls it with absolute URLs
|
|
@@ -7316,21 +7316,21 @@ function $2780129735dc272e$export$f14a775632a826c4(orig_url_with_trailing_slash)
|
|
|
7316
7316
|
}
|
|
7317
7317
|
function $2780129735dc272e$export$2a1cc61cffa1f36f(orig_url_with_trailing_slash) {
|
|
7318
7318
|
// rewrite fetch requests just in case, maybe we should also rewrite responses
|
|
7319
|
-
|
|
7319
|
+
$7ccebf01cfe4f824$export$85be83e1935d93c2(async (target, this_arg, arg_list) => {
|
|
7320
7320
|
try {
|
|
7321
7321
|
const [url] = arg_list;
|
|
7322
7322
|
if (typeof url == "string") arg_list[0] = url.replaceAll(orig_url_with_trailing_slash, "/");else if (url instanceof Request) {
|
|
7323
7323
|
if (url.url.includes(orig_url_with_trailing_slash)) arg_list[0] = new Request(url.url.replaceAll(orig_url_with_trailing_slash, "/"), url);
|
|
7324
7324
|
}
|
|
7325
7325
|
} catch (e) {
|
|
7326
|
-
|
|
7326
|
+
$548fd58b14b25a52$export$8048b892d651b310(e);
|
|
7327
7327
|
}
|
|
7328
7328
|
return target.apply(this_arg, arg_list);
|
|
7329
7329
|
});
|
|
7330
7330
|
}
|
|
7331
7331
|
function $2780129735dc272e$export$2a38b176ce969e2c(orig_url_with_trailing_slash) {
|
|
7332
7332
|
// rewrite xhr requests just in case
|
|
7333
|
-
|
|
7333
|
+
$61201159f98f0375$export$33d1643df63073a8((request, method, url, arg_array) => {
|
|
7334
7334
|
if (url instanceof URL) url.href = url.href.replaceAll(orig_url_with_trailing_slash, "/");else if (typeof url == "string") arg_array[1] = url.replaceAll(orig_url_with_trailing_slash, "");
|
|
7335
7335
|
});
|
|
7336
7336
|
}
|
|
@@ -7406,11 +7406,11 @@ function $02a3425594231893$export$a422d714c8cb1a5d(allowed_markets, url, tenant
|
|
|
7406
7406
|
return "se";
|
|
7407
7407
|
}
|
|
7408
7408
|
function $05802e6cb0fdbdcd$export$3427ec8268623f1(listener) {
|
|
7409
|
-
if (
|
|
7410
|
-
|
|
7409
|
+
if (!$1da560af170fb839$export$b87d7e0da8b5cbe3()) {
|
|
7410
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Not hooking localStorage as it would freeze it due to lacking Proxy support");
|
|
7411
7411
|
return;
|
|
7412
7412
|
}
|
|
7413
|
-
const caught_listener =
|
|
7413
|
+
const caught_listener = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(listener);
|
|
7414
7414
|
let changed_instance;
|
|
7415
7415
|
const update_changed_instance = () => changed_instance = Storage.prototype.setItem !== localStorage.setItem;
|
|
7416
7416
|
update_changed_instance();
|
|
@@ -7478,7 +7478,7 @@ function $05802e6cb0fdbdcd$export$3427ec8268623f1(listener) {
|
|
|
7478
7478
|
changed_this_args.add(fn_with_changed_this_arg);
|
|
7479
7479
|
}
|
|
7480
7480
|
} catch (e) {
|
|
7481
|
-
if (key !== "length")
|
|
7481
|
+
if (key !== "length") $e6c6e7929ea385ae$export$de56f1198d121036(e);
|
|
7482
7482
|
}
|
|
7483
7483
|
}
|
|
7484
7484
|
|
|
@@ -7492,16 +7492,16 @@ function $9ed7c4b0fbf9ccd8$export$cd1adfb8059b5fcd(promise, ms) {
|
|
|
7492
7492
|
}
|
|
7493
7493
|
const $5185cc9bd668b8f9$var$get_voyado_id = () => {
|
|
7494
7494
|
const va = /\b_vaI=([^;]+)/.exec(document.cookie)?.[1];
|
|
7495
|
-
return va ||
|
|
7495
|
+
return va || $e0a87646d12cb987$export$6399bdb2291895e0();
|
|
7496
7496
|
};
|
|
7497
|
-
const $5185cc9bd668b8f9$export$a739d9a07da7f9ce = /*@__PURE__
|
|
7498
|
-
|
|
7497
|
+
const $5185cc9bd668b8f9$export$a739d9a07da7f9ce = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => {
|
|
7498
|
+
$e0a87646d12cb987$export$336e7ad40bae0652($5185cc9bd668b8f9$var$get_voyado_id);
|
|
7499
7499
|
});
|
|
7500
7500
|
function $dba3e72fb3e5c53d$export$4a3043e508dd72f0({
|
|
7501
7501
|
children: children,
|
|
7502
7502
|
...attributes
|
|
7503
7503
|
}) {
|
|
7504
|
-
const button =
|
|
7504
|
+
const button = $107a74aa4ea5902d$export$34b9dba7ce09269b("button", {
|
|
7505
7505
|
...attributes,
|
|
7506
7506
|
type: "button",
|
|
7507
7507
|
children: children
|
|
@@ -7518,30 +7518,30 @@ async function $a7550e9f97f84465$export$8a0e4d6f6abf7e90({
|
|
|
7518
7518
|
let close_;
|
|
7519
7519
|
const open_promise = new Promise(r => close_ = r);
|
|
7520
7520
|
const body = await (0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).wait_for_element("body");
|
|
7521
|
-
const backdrop =
|
|
7521
|
+
const backdrop = $107a74aa4ea5902d$export$34b9dba7ce09269b("div", {
|
|
7522
7522
|
class: "slidein-backdrop",
|
|
7523
7523
|
onClick: close_
|
|
7524
7524
|
});
|
|
7525
|
-
const [exit_title_iterator, exitable_title_iterator] =
|
|
7525
|
+
const [exit_title_iterator, exitable_title_iterator] = $bbe52965151ee7f0$export$927664b47117acb0(title_);
|
|
7526
7526
|
const closing_handlers = [exit_title_iterator];
|
|
7527
|
-
const slidein =
|
|
7527
|
+
const slidein = $107a74aa4ea5902d$export$25062201e9e25d76("div", {
|
|
7528
7528
|
class: "slidein",
|
|
7529
|
-
children: [
|
|
7529
|
+
children: [$107a74aa4ea5902d$export$25062201e9e25d76("div", {
|
|
7530
7530
|
class: "header",
|
|
7531
|
-
children: [
|
|
7531
|
+
children: [$107a74aa4ea5902d$export$34b9dba7ce09269b("span", {
|
|
7532
7532
|
class: "title",
|
|
7533
|
-
children:
|
|
7534
|
-
}),
|
|
7533
|
+
children: $374ca311b64f260b$export$7c081fdbc65b6a2a(exitable_title_iterator, false)
|
|
7534
|
+
}), $107a74aa4ea5902d$export$34b9dba7ce09269b("button", {
|
|
7535
7535
|
class: "close",
|
|
7536
7536
|
onClick: close_,
|
|
7537
7537
|
children: CloseIcon()
|
|
7538
7538
|
})]
|
|
7539
|
-
}),
|
|
7539
|
+
}), $107a74aa4ea5902d$export$34b9dba7ce09269b("div", {
|
|
7540
7540
|
class: "body",
|
|
7541
7541
|
children: children
|
|
7542
7542
|
})]
|
|
7543
7543
|
});
|
|
7544
|
-
const elements_in_container =
|
|
7544
|
+
const elements_in_container = $107a74aa4ea5902d$export$25062201e9e25d76("div", {
|
|
7545
7545
|
class: "depict",
|
|
7546
7546
|
children: [backdrop, slidein]
|
|
7547
7547
|
});
|
|
@@ -7559,7 +7559,7 @@ async function $a7550e9f97f84465$export$8a0e4d6f6abf7e90({
|
|
|
7559
7559
|
easing: "ease-in",
|
|
7560
7560
|
duration: 220
|
|
7561
7561
|
});
|
|
7562
|
-
const handler =
|
|
7562
|
+
const handler = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(({
|
|
7563
7563
|
key: key
|
|
7564
7564
|
}) => {
|
|
7565
7565
|
if (key === "Escape")
|
|
@@ -7567,7 +7567,7 @@ async function $a7550e9f97f84465$export$8a0e4d6f6abf7e90({
|
|
|
7567
7567
|
close_();
|
|
7568
7568
|
});
|
|
7569
7569
|
window.addEventListener("keydown", handler);
|
|
7570
|
-
open_promise.then(
|
|
7570
|
+
open_promise.then($268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => {
|
|
7571
7571
|
window.removeEventListener("keydown", handler);
|
|
7572
7572
|
backdrop.animate({
|
|
7573
7573
|
opacity: [1, 0]
|
|
@@ -7582,7 +7582,7 @@ async function $a7550e9f97f84465$export$8a0e4d6f6abf7e90({
|
|
|
7582
7582
|
}, {
|
|
7583
7583
|
easing: "ease-out",
|
|
7584
7584
|
duration: 220
|
|
7585
|
-
}).addEventListener("finish",
|
|
7585
|
+
}).addEventListener("finish", $268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => {
|
|
7586
7586
|
elements_in_container.remove();
|
|
7587
7587
|
closing_handlers.forEach(handler => handler());
|
|
7588
7588
|
}));
|
|
@@ -7598,35 +7598,35 @@ async function $bd0fccdac6624b01$export$c068ad5361be7646({
|
|
|
7598
7598
|
out_of_stock_text_: out_of_stock_text_,
|
|
7599
7599
|
CloseIcon: CloseIcon
|
|
7600
7600
|
}) {
|
|
7601
|
-
const [exit_oos_iterator, exitable_oos_iterator] =
|
|
7601
|
+
const [exit_oos_iterator, exitable_oos_iterator] = $bbe52965151ee7f0$export$927664b47117acb0(out_of_stock_text_);
|
|
7602
7602
|
// eslint-disable-line no-async-promise-executor
|
|
7603
|
-
return new Promise(
|
|
7603
|
+
return new Promise($268cbd9e4ade92db$export$b3bbfd758f11cfa9(async size_selected => {
|
|
7604
7604
|
const {
|
|
7605
7605
|
close_: close_,
|
|
7606
7606
|
on_close_: on_close_
|
|
7607
|
-
} = await
|
|
7607
|
+
} = await $a7550e9f97f84465$export$8a0e4d6f6abf7e90({
|
|
7608
7608
|
CloseIcon: CloseIcon,
|
|
7609
7609
|
title_: title_,
|
|
7610
|
-
children: [
|
|
7610
|
+
children: [$107a74aa4ea5902d$export$34b9dba7ce09269b("div", {
|
|
7611
7611
|
class: "option-list",
|
|
7612
7612
|
children: items_.map(({
|
|
7613
7613
|
size_name_: size_name_,
|
|
7614
7614
|
is_available_: is_available_,
|
|
7615
7615
|
id_: id_
|
|
7616
7616
|
}) => {
|
|
7617
|
-
const button =
|
|
7617
|
+
const button = $107a74aa4ea5902d$export$25062201e9e25d76("button", {
|
|
7618
7618
|
type: "button",
|
|
7619
7619
|
class: "option" + (is_available_ ? " available" : ""),
|
|
7620
7620
|
onClick: () => {
|
|
7621
7621
|
size_selected(id_);
|
|
7622
7622
|
close_();
|
|
7623
7623
|
},
|
|
7624
|
-
children: [
|
|
7624
|
+
children: [$107a74aa4ea5902d$export$34b9dba7ce09269b("span", {
|
|
7625
7625
|
class: "size",
|
|
7626
7626
|
children: size_name_
|
|
7627
|
-
}), !is_available_ &&
|
|
7627
|
+
}), !is_available_ && $107a74aa4ea5902d$export$34b9dba7ce09269b("span", {
|
|
7628
7628
|
class: "sold-out",
|
|
7629
|
-
children:
|
|
7629
|
+
children: $374ca311b64f260b$export$7c081fdbc65b6a2a(exitable_oos_iterator)
|
|
7630
7630
|
})]
|
|
7631
7631
|
});
|
|
7632
7632
|
if (!is_available_) button.disabled = true;
|
|
@@ -7650,12 +7650,12 @@ const $e587cb3b31b82f43$export$84712d0562a614b8 = ({
|
|
|
7650
7650
|
}) => {
|
|
7651
7651
|
if (!$e587cb3b31b82f43$var$inserted) {
|
|
7652
7652
|
// Insert styling on first import
|
|
7653
|
-
|
|
7653
|
+
$e4bebbfa0f0b1454$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($05427557ffc98539$exports)));
|
|
7654
7654
|
$e587cb3b31b82f43$var$inserted = true;
|
|
7655
7655
|
}
|
|
7656
7656
|
return (
|
|
7657
7657
|
// @ts-ignore
|
|
7658
|
-
|
|
7658
|
+
$107a74aa4ea5902d$export$34b9dba7ce09269b("div", {
|
|
7659
7659
|
class: `depict-placeholder${extra_classes ? " " + extra_classes : ""}`,
|
|
7660
7660
|
style: style ? style : `width:${width};height:${height};`,
|
|
7661
7661
|
...attributes
|
|
@@ -7666,33 +7666,33 @@ const $e587cb3b31b82f43$export$d613f5b6d0a331a8 = ({
|
|
|
7666
7666
|
aspect_ratio: aspect_ratio,
|
|
7667
7667
|
...attributes
|
|
7668
7668
|
}) => {
|
|
7669
|
-
return
|
|
7669
|
+
return $107a74aa4ea5902d$export$34b9dba7ce09269b($e587cb3b31b82f43$export$84712d0562a614b8, {
|
|
7670
7670
|
style: `position:relative;width:100%;padding-bottom:${1 / aspect_ratio * 100}%`,
|
|
7671
7671
|
...attributes
|
|
7672
7672
|
});
|
|
7673
7673
|
};
|
|
7674
|
-
const $b9c0746e4d18273a$export$97f31f44c68c1d5 = (title, surface_classes = []) =>
|
|
7674
|
+
const $b9c0746e4d18273a$export$97f31f44c68c1d5 = (title, surface_classes = []) => $90e0b983530610e7$export$eb0b9ed911409b57(e => e.classList.add(...surface_classes), $107a74aa4ea5902d$export$25062201e9e25d76("div", {
|
|
7675
7675
|
class: "depict recommendation_container",
|
|
7676
|
-
children: [title && typeof title === "string" ?
|
|
7676
|
+
children: [title && typeof title === "string" ? $107a74aa4ea5902d$export$34b9dba7ce09269b("h4", {
|
|
7677
7677
|
class: "recs_header",
|
|
7678
7678
|
children: title
|
|
7679
|
-
}) : title,
|
|
7679
|
+
}) : title, $107a74aa4ea5902d$export$34b9dba7ce09269b("div", {
|
|
7680
7680
|
class: "grid"
|
|
7681
7681
|
})]
|
|
7682
7682
|
}));
|
|
7683
|
-
const $69accc27bcbd6972$export$32a55d57d151bc5a = () =>
|
|
7683
|
+
const $69accc27bcbd6972$export$32a55d57d151bc5a = () => $107a74aa4ea5902d$export$25062201e9e25d76("svg", {
|
|
7684
7684
|
viewBox: "0 0 320 512",
|
|
7685
|
-
children: [
|
|
7685
|
+
children: [$107a74aa4ea5902d$export$34b9dba7ce09269b("desc", {
|
|
7686
7686
|
children: "Right arrow"
|
|
7687
|
-
}),
|
|
7687
|
+
}), $107a74aa4ea5902d$export$34b9dba7ce09269b("path", {
|
|
7688
7688
|
d: "M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"
|
|
7689
7689
|
})]
|
|
7690
7690
|
});
|
|
7691
|
-
const $69accc27bcbd6972$export$ddd70fdae1b350e6 = () =>
|
|
7691
|
+
const $69accc27bcbd6972$export$ddd70fdae1b350e6 = () => $107a74aa4ea5902d$export$25062201e9e25d76("svg", {
|
|
7692
7692
|
viewBox: "0 0 320 512",
|
|
7693
|
-
children: [
|
|
7693
|
+
children: [$107a74aa4ea5902d$export$34b9dba7ce09269b("desc", {
|
|
7694
7694
|
children: "Left arrow"
|
|
7695
|
-
}),
|
|
7695
|
+
}), $107a74aa4ea5902d$export$34b9dba7ce09269b("path", {
|
|
7696
7696
|
d: "M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z"
|
|
7697
7697
|
})]
|
|
7698
7698
|
});
|
|
@@ -7706,21 +7706,21 @@ function $af92e61c7dfccf01$var$ColorCircle({
|
|
|
7706
7706
|
onClick: onClick,
|
|
7707
7707
|
onHoverUpdate: onHoverUpdate
|
|
7708
7708
|
}) {
|
|
7709
|
-
const button =
|
|
7709
|
+
const button = $107a74aa4ea5902d$export$34b9dba7ce09269b("button", {
|
|
7710
7710
|
class: "color-circle-container",
|
|
7711
7711
|
onClick: e => onClick(e.currentTarget, color),
|
|
7712
7712
|
title: color.label || "",
|
|
7713
|
-
children:
|
|
7713
|
+
children: $107a74aa4ea5902d$export$34b9dba7ce09269b("div", {
|
|
7714
7714
|
class: "outer-circle",
|
|
7715
7715
|
style: `border-color: ${color.value};`,
|
|
7716
|
-
children:
|
|
7716
|
+
children: $107a74aa4ea5902d$export$34b9dba7ce09269b("div", {
|
|
7717
7717
|
class: "inner-circle",
|
|
7718
7718
|
style: `background-color: ${color.value};`
|
|
7719
7719
|
})
|
|
7720
7720
|
})
|
|
7721
7721
|
});
|
|
7722
|
-
button.addEventListener("mouseenter",
|
|
7723
|
-
button.addEventListener("mouseleave",
|
|
7722
|
+
button.addEventListener("mouseenter", $268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => onHoverUpdate(button, color, true)));
|
|
7723
|
+
button.addEventListener("mouseleave", $268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => onHoverUpdate(button, color, false)));
|
|
7724
7724
|
return button;
|
|
7725
7725
|
}
|
|
7726
7726
|
function $af92e61c7dfccf01$export$590326cc34f49e2d({
|
|
@@ -7773,7 +7773,7 @@ function $af92e61c7dfccf01$export$590326cc34f49e2d({
|
|
|
7773
7773
|
if (selectOnHover) handleSelectOnHover(hovered, color, hovering);
|
|
7774
7774
|
};
|
|
7775
7775
|
// Create the color circles
|
|
7776
|
-
const circles = colors.map(color =>
|
|
7776
|
+
const circles = colors.map(color => $107a74aa4ea5902d$export$34b9dba7ce09269b($af92e61c7dfccf01$var$ColorCircle, {
|
|
7777
7777
|
color: color,
|
|
7778
7778
|
onClick: handleClick,
|
|
7779
7779
|
onHoverUpdate: handleHoverUpdate
|
|
@@ -7784,7 +7784,7 @@ function $af92e61c7dfccf01$export$590326cc34f49e2d({
|
|
|
7784
7784
|
const initial_index = initialColor == undefined ? -1 : colors.findIndex(c => typeof initialColor === "string" ? c.value === initialColor : c.value === initialColor.value && c.label === initialColor.label);
|
|
7785
7785
|
if (initial_index > -1) setActiveIndex(initial_index);
|
|
7786
7786
|
if (onlyCircles) return circles;
|
|
7787
|
-
return
|
|
7787
|
+
return $107a74aa4ea5902d$export$34b9dba7ce09269b("div", {
|
|
7788
7788
|
class: "color-picker",
|
|
7789
7789
|
role: "form",
|
|
7790
7790
|
"aria-label": "Color picker",
|
|
@@ -7816,17 +7816,17 @@ const $b25f388f0fe2f1b3$export$237455ad7e59d4e5 = ({
|
|
|
7816
7816
|
children: children
|
|
7817
7817
|
}) => {
|
|
7818
7818
|
if (Array.isArray(children) && children.length === 1) children = children[0];
|
|
7819
|
-
innerRef =
|
|
7819
|
+
innerRef = $107a74aa4ea5902d$export$34b9dba7ce09269b("div", {
|
|
7820
7820
|
children: children
|
|
7821
7821
|
});
|
|
7822
|
-
outerRef =
|
|
7822
|
+
outerRef = $107a74aa4ea5902d$export$34b9dba7ce09269b("div", {
|
|
7823
7823
|
style: `overflow:hidden;height:0px;visibility:hidden`,
|
|
7824
7824
|
"aria-hidden": "true",
|
|
7825
7825
|
children: innerRef
|
|
7826
7826
|
});
|
|
7827
7827
|
return outerRef;
|
|
7828
7828
|
};
|
|
7829
|
-
const expand =
|
|
7829
|
+
const expand = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(async (expanding_delay = delay, time_to_expand = duration) => {
|
|
7830
7830
|
const start = get_current_height_possibly_during_transition(); // need to read this before cancelling the old animation
|
|
7831
7831
|
outerRef.style.visibility = "";
|
|
7832
7832
|
outerRef.removeAttribute("aria-hidden");
|
|
@@ -7839,14 +7839,14 @@ const $b25f388f0fe2f1b3$export$237455ad7e59d4e5 = ({
|
|
|
7839
7839
|
easing: "ease-in"
|
|
7840
7840
|
});
|
|
7841
7841
|
current_animation = animation;
|
|
7842
|
-
animation.addEventListener("finish",
|
|
7842
|
+
animation.addEventListener("finish", $268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => {
|
|
7843
7843
|
current_animation = undefined;
|
|
7844
7844
|
outerRef.style.overflow = "";
|
|
7845
7845
|
outerRef.style.height = "auto";
|
|
7846
7846
|
}));
|
|
7847
7847
|
return animation;
|
|
7848
7848
|
});
|
|
7849
|
-
const collapse =
|
|
7849
|
+
const collapse = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(async (collapsing_delay = delay, time_to_collapse = duration) => {
|
|
7850
7850
|
const start = get_current_height_possibly_during_transition();
|
|
7851
7851
|
current_animation?.cancel?.();
|
|
7852
7852
|
outerRef.style.overflow = "hidden";
|
|
@@ -7859,7 +7859,7 @@ const $b25f388f0fe2f1b3$export$237455ad7e59d4e5 = ({
|
|
|
7859
7859
|
easing: "ease-out"
|
|
7860
7860
|
});
|
|
7861
7861
|
current_animation = animation;
|
|
7862
|
-
animation.addEventListener("finish",
|
|
7862
|
+
animation.addEventListener("finish", $268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => {
|
|
7863
7863
|
current_animation = undefined;
|
|
7864
7864
|
outerRef.style.height = "0";
|
|
7865
7865
|
outerRef.style.visibility = "hidden";
|
|
@@ -7876,9 +7876,9 @@ var $278195e5c6164616$exports = {};
|
|
|
7876
7876
|
$278195e5c6164616$exports = ".depict-img-cont {\n width: 100%;\n height: 100%;\n position: absolute;\n}\n\n.depict-img-filler {\n width: 100%;\n height: auto;\n display: inline-block;\n}\n\n.depict-img-comp {\n width: auto;\n height: auto;\n max-width: 100%;\n max-height: 100%;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n\n.depict-img-mod {\n width: 100%;\n height: 100%;\n object-fit: contain;\n position: absolute;\n inset: 0;\n}\n\n";
|
|
7877
7877
|
const $ff973b2032639b5f$export$3d13beba9b52c947 = "https://img.depict.ai/ResizeImage" + (process.env.TENANT ? "/" + process.env.TENANT : "");
|
|
7878
7878
|
const $ff973b2032639b5f$export$a98fc8a2c818d3d8 = /*@__PURE__*/(() => typeof navigator === "undefined" ? false : /^((?!chrome|android).)*safari/i.test(navigator.userAgent))(); // https://stackoverflow.com/a/23522755
|
|
7879
|
-
function $ff973b2032639b5f$export$f39a7d0667e924a(what_to_watch, sizes_communicator =
|
|
7879
|
+
function $ff973b2032639b5f$export$f39a7d0667e924a(what_to_watch, sizes_communicator = $9a42a570de51ea3d$export$e806c6c1615a59ae(), resolution_factor = 1) {
|
|
7880
7880
|
let currently_live = false;
|
|
7881
|
-
const ro = new ResizeObserver(
|
|
7881
|
+
const ro = new ResizeObserver($268cbd9e4ade92db$export$b3bbfd758f11cfa9(records => {
|
|
7882
7882
|
for (let j = 0; j < records.length; j++) {
|
|
7883
7883
|
const {
|
|
7884
7884
|
width: width
|
|
@@ -7949,9 +7949,9 @@ function $ff973b2032639b5f$export$a62825542f1bfcf5({
|
|
|
7949
7949
|
const raw_src = image_options?.src || image_options?.["data-src"]; // get wanted src
|
|
7950
7950
|
const src = new URL(raw_src, location.origin).href;
|
|
7951
7951
|
if (!src) {
|
|
7952
|
-
|
|
7953
|
-
|
|
7954
|
-
return
|
|
7952
|
+
$e6c6e7929ea385ae$export$de56f1198d121036(image_options, () => {}); // noop function is to allow to get here quickly by "jump to function definition"
|
|
7953
|
+
$548fd58b14b25a52$export$8048b892d651b310(new Error("no image src provided: " + src));
|
|
7954
|
+
return $107a74aa4ea5902d$export$34b9dba7ce09269b("img", {
|
|
7955
7955
|
...image_options
|
|
7956
7956
|
}); // we don't want everything to fail if someone misused this component
|
|
7957
7957
|
}
|
|
@@ -7964,7 +7964,7 @@ function $ff973b2032639b5f$export$a62825542f1bfcf5({
|
|
|
7964
7964
|
const srcset = $ff973b2032639b5f$var$make_srcset(src, format, resolutions);
|
|
7965
7965
|
sources.push(
|
|
7966
7966
|
// 0px important because chrome will load the biggest size otherwise until sizes attribute is set to the correct value
|
|
7967
|
-
|
|
7967
|
+
$107a74aa4ea5902d$export$34b9dba7ce09269b("source", {
|
|
7968
7968
|
sizes: "0px",
|
|
7969
7969
|
type: `image/${format}`,
|
|
7970
7970
|
...(set_dataset ? {
|
|
@@ -7979,7 +7979,7 @@ function $ff973b2032639b5f$export$a62825542f1bfcf5({
|
|
|
7979
7979
|
}; // Prevents the image from instantly loading the original source
|
|
7980
7980
|
delete opts_without_src["src"];
|
|
7981
7981
|
delete opts_without_src["srcset"];
|
|
7982
|
-
const the_image =
|
|
7982
|
+
const the_image = $107a74aa4ea5902d$export$34b9dba7ce09269b("img", {
|
|
7983
7983
|
...opts_without_src
|
|
7984
7984
|
}); // create image
|
|
7985
7985
|
sources.push(the_image); // chrome seems to be the dumbest piece of cake that has ever existed and just load the first source?????
|
|
@@ -7988,7 +7988,7 @@ function $ff973b2032639b5f$export$a62825542f1bfcf5({
|
|
|
7988
7988
|
// start a sizes_setter for every source (including fallback image)
|
|
7989
7989
|
for (let i = 0; i < sources.length; i++) sizes_setter_(sources[i]).catch((0, $548fd58b14b25a52$export$8048b892d651b310));
|
|
7990
7990
|
// embed all sources into a <picture> so that the browser understands they're "together"
|
|
7991
|
-
const picture =
|
|
7991
|
+
const picture = $107a74aa4ea5902d$export$34b9dba7ce09269b("picture", {
|
|
7992
7992
|
children: sources
|
|
7993
7993
|
});
|
|
7994
7994
|
// Create src and srcset for fallback image and set it.
|
|
@@ -8029,13 +8029,13 @@ const $a312bccd722ac9e4$export$788756b42446dc2d = ({
|
|
|
8029
8029
|
}) => {
|
|
8030
8030
|
if (!$a312bccd722ac9e4$var$inserted) {
|
|
8031
8031
|
// Insert styling on first import
|
|
8032
|
-
|
|
8032
|
+
$e4bebbfa0f0b1454$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($278195e5c6164616$exports)));
|
|
8033
8033
|
$a312bccd722ac9e4$var$inserted = true;
|
|
8034
8034
|
}
|
|
8035
8035
|
const img = process.env.BUILD_TARGET === "modern" || process.env.BUILD_TARGET === "dev" ? $a312bccd722ac9e4$var$Image(options) : $a312bccd722ac9e4$var$CompatibleImage(options);
|
|
8036
8036
|
if (init_with_placeholder)
|
|
8037
8037
|
// 10000 is a magic value, that is just supposed to be bigger than the size of the actual image.
|
|
8038
|
-
img.querySelectorAll("img").forEach(i => i.src =
|
|
8038
|
+
img.querySelectorAll("img").forEach(i => i.src = $fac9c96b6bbe43cd$export$a4eccf92efefa04d(10000 * options.aspect_ratio, 10000));
|
|
8039
8039
|
return img;
|
|
8040
8040
|
};
|
|
8041
8041
|
function $a312bccd722ac9e4$var$Image({
|
|
@@ -8047,20 +8047,20 @@ function $a312bccd722ac9e4$var$Image({
|
|
|
8047
8047
|
init_with_placeholder: _,
|
|
8048
8048
|
...image_options
|
|
8049
8049
|
}) {
|
|
8050
|
-
const div =
|
|
8050
|
+
const div = $107a74aa4ea5902d$export$34b9dba7ce09269b("div", {
|
|
8051
8051
|
style: `position:relative;width:100%;padding-bottom:${1 / aspect_ratio * 100}%`
|
|
8052
8052
|
});
|
|
8053
8053
|
const sourceset_component = $a312bccd722ac9e4$var$srcset_comp_from_map_or_new(rendering_options, srcset_opts, div);
|
|
8054
8054
|
const IMG_tag = image_options.src?.startsWith("data:") || !sourceset_component ? "img" : sourceset_component;
|
|
8055
8055
|
div.append(
|
|
8056
8056
|
// @ts-ignore
|
|
8057
|
-
|
|
8057
|
+
$107a74aa4ea5902d$export$34b9dba7ce09269b(IMG_tag, {
|
|
8058
8058
|
alt: alt,
|
|
8059
8059
|
...(remove_on_error ? {
|
|
8060
8060
|
onerror: "this.remove()"
|
|
8061
8061
|
} : {}),
|
|
8062
8062
|
...image_options,
|
|
8063
|
-
class:
|
|
8063
|
+
class: $90e0b983530610e7$export$22a65337c1b43b1f(["depict-img-mod ", image_options.class, $a312bccd722ac9e4$var$add_nolazy_to_placeholder(rendering_options?.type)])
|
|
8064
8064
|
}));
|
|
8065
8065
|
return div;
|
|
8066
8066
|
}
|
|
@@ -8072,24 +8072,24 @@ function $a312bccd722ac9e4$var$CompatibleImage({
|
|
|
8072
8072
|
srcset_opts: srcset_opts,
|
|
8073
8073
|
...image_options
|
|
8074
8074
|
}) {
|
|
8075
|
-
const canvas =
|
|
8075
|
+
const canvas = $107a74aa4ea5902d$export$34b9dba7ce09269b("canvas", {
|
|
8076
8076
|
class: "depict-img-filler",
|
|
8077
8077
|
width: 3000 * aspect_ratio,
|
|
8078
8078
|
height: 3000
|
|
8079
8079
|
});
|
|
8080
8080
|
const sourceset_component = $a312bccd722ac9e4$var$srcset_comp_from_map_or_new(rendering_options, srcset_opts, canvas);
|
|
8081
8081
|
const IMG_tag = image_options.src?.startsWith("data:") || !sourceset_component ? "img" : sourceset_component;
|
|
8082
|
-
return
|
|
8082
|
+
return $107a74aa4ea5902d$export$25062201e9e25d76("div", {
|
|
8083
8083
|
style: "position:relative",
|
|
8084
|
-
children: [
|
|
8084
|
+
children: [$107a74aa4ea5902d$export$34b9dba7ce09269b("div", {
|
|
8085
8085
|
class: "depict-img-cont",
|
|
8086
|
-
children:
|
|
8086
|
+
children: $107a74aa4ea5902d$export$34b9dba7ce09269b(IMG_tag, {
|
|
8087
8087
|
alt: alt,
|
|
8088
8088
|
...(remove_on_error ? {
|
|
8089
8089
|
onerror: "this.remove()"
|
|
8090
8090
|
} : {}),
|
|
8091
8091
|
...image_options,
|
|
8092
|
-
class:
|
|
8092
|
+
class: $90e0b983530610e7$export$22a65337c1b43b1f(["depict-img-comp", image_options.class, $a312bccd722ac9e4$var$add_nolazy_to_placeholder(rendering_options?.type)])
|
|
8093
8093
|
})
|
|
8094
8094
|
}), canvas]
|
|
8095
8095
|
});
|
|
@@ -8103,7 +8103,7 @@ function $a312bccd722ac9e4$var$srcset_comp_from_map_or_new(rendering_options, sr
|
|
|
8103
8103
|
...srcset_opts
|
|
8104
8104
|
};
|
|
8105
8105
|
cloned_opts.what_to_watch = canvas;
|
|
8106
|
-
sourceset_component =
|
|
8106
|
+
sourceset_component = $ff973b2032639b5f$export$a62825542f1bfcf5(cloned_opts);
|
|
8107
8107
|
$a312bccd722ac9e4$var$rendering_options_to_sourceset_component.set(rendering_options, new WeakRef(sourceset_component));
|
|
8108
8108
|
}
|
|
8109
8109
|
}
|
|
@@ -8140,7 +8140,7 @@ function $a656daa2fa8c279a$var$register_element_for_touch_hover(el, navigation_m
|
|
|
8140
8140
|
}
|
|
8141
8141
|
function $a656daa2fa8c279a$var$start_checking_for_touch_hover() {
|
|
8142
8142
|
const currently_hovering = new Map();
|
|
8143
|
-
const handle_touch_start =
|
|
8143
|
+
const handle_touch_start = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(evt => {
|
|
8144
8144
|
const touch = evt?.changedTouches?.[0];
|
|
8145
8145
|
if (!touch) return; // Eytys dispatches fake touch events without changedTouches
|
|
8146
8146
|
const id = touch.identifier;
|
|
@@ -8163,7 +8163,7 @@ function $a656daa2fa8c279a$var$start_checking_for_touch_hover() {
|
|
|
8163
8163
|
}
|
|
8164
8164
|
});
|
|
8165
8165
|
let last_collision_check = +new Date();
|
|
8166
|
-
const handle_touch_move =
|
|
8166
|
+
const handle_touch_move = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(evt => {
|
|
8167
8167
|
const first_touch = evt?.changedTouches?.[0];
|
|
8168
8168
|
if (!first_touch) return;
|
|
8169
8169
|
const {
|
|
@@ -8179,7 +8179,7 @@ function $a656daa2fa8c279a$var$start_checking_for_touch_hover() {
|
|
|
8179
8179
|
if (get_hover_element_from_coords(clientX, clientY) !== our_touch_data.element_) clear_hover(identifier, our_touch_data, clientX, clientY);
|
|
8180
8180
|
}
|
|
8181
8181
|
});
|
|
8182
|
-
const handle_touch_cancel =
|
|
8182
|
+
const handle_touch_cancel = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(evt => {
|
|
8183
8183
|
const touch = evt?.changedTouches?.[0];
|
|
8184
8184
|
if (!touch) return;
|
|
8185
8185
|
const id = touch.identifier;
|
|
@@ -8191,7 +8191,7 @@ function $a656daa2fa8c279a$var$start_checking_for_touch_hover() {
|
|
|
8191
8191
|
const hover_element = elements[$a656daa2fa8c279a$var$HOVER_IMAGE_DEPTH - 1];
|
|
8192
8192
|
return hover_element && $a656daa2fa8c279a$var$touch_hover_elements.has(hover_element) ? hover_element : null;
|
|
8193
8193
|
};
|
|
8194
|
-
const clear_hover =
|
|
8194
|
+
const clear_hover = $268cbd9e4ade92db$export$b3bbfd758f11cfa9((id, info_about_touch, now_x, now_y) => {
|
|
8195
8195
|
const {
|
|
8196
8196
|
element_: element_,
|
|
8197
8197
|
start_y_: start_y_,
|
|
@@ -8238,25 +8238,25 @@ const $a656daa2fa8c279a$export$2369f6fc1c911576 = ({
|
|
|
8238
8238
|
...options
|
|
8239
8239
|
}) => {
|
|
8240
8240
|
if (!$a656daa2fa8c279a$var$styling_inserted) {
|
|
8241
|
-
|
|
8241
|
+
$e4bebbfa0f0b1454$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($63f2002626a07875$exports)));
|
|
8242
8242
|
$a656daa2fa8c279a$var$styling_inserted = true;
|
|
8243
8243
|
}
|
|
8244
|
-
const main_image =
|
|
8244
|
+
const main_image = $a312bccd722ac9e4$export$788756b42446dc2d({
|
|
8245
8245
|
...options
|
|
8246
8246
|
});
|
|
8247
|
-
const second_image =
|
|
8247
|
+
const second_image = $a312bccd722ac9e4$export$788756b42446dc2d({
|
|
8248
8248
|
...options,
|
|
8249
8249
|
[second_srcset_opts?.set_dataset === false ? "src" : "data-src"]: second_src || "",
|
|
8250
8250
|
[second_srcset_opts?.set_dataset === false ? "srcset" : "data-srcset"]: second_srcset || "",
|
|
8251
8251
|
srcset_opts: second_srcset_opts || {}
|
|
8252
8252
|
});
|
|
8253
8253
|
const no_second_img = !second_src && !second_srcset && !second_srcset_opts;
|
|
8254
|
-
const images_container =
|
|
8254
|
+
const images_container = $107a74aa4ea5902d$export$25062201e9e25d76("div", {
|
|
8255
8255
|
class: "images-container",
|
|
8256
|
-
children: [!no_second_img &&
|
|
8256
|
+
children: [!no_second_img && $107a74aa4ea5902d$export$34b9dba7ce09269b("div", {
|
|
8257
8257
|
class: "second-image-container",
|
|
8258
8258
|
children: second_image
|
|
8259
|
-
}),
|
|
8259
|
+
}), $107a74aa4ea5902d$export$34b9dba7ce09269b("div", {
|
|
8260
8260
|
class: "main-image-container",
|
|
8261
8261
|
children: main_image
|
|
8262
8262
|
})]
|
|
@@ -8399,11 +8399,11 @@ let $8838e3e61b748a8b$var$running_writers = 0;
|
|
|
8399
8399
|
function $8838e3e61b748a8b$export$ef73ea4f975745ba(meta_data) {
|
|
8400
8400
|
if ($8838e3e61b748a8b$var$running_writers >= 1) return;
|
|
8401
8401
|
$8838e3e61b748a8b$var$running_writers++;
|
|
8402
|
-
|
|
8402
|
+
$z0IcO$solidjs.onCleanup(() => $8838e3e61b748a8b$var$running_writers--);
|
|
8403
8403
|
const disconnectors = [];
|
|
8404
|
-
|
|
8404
|
+
$z0IcO$solidjs.createEffect($268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => {
|
|
8405
8405
|
if (!meta_data()) return;
|
|
8406
|
-
|
|
8406
|
+
$z0IcO$solidjs.onCleanup(() => {
|
|
8407
8407
|
disconnectors.forEach(d => d());
|
|
8408
8408
|
});
|
|
8409
8409
|
for (const [type, content] of Object.entries(meta_data())) for (const opts of $8838e3e61b748a8b$var$tags[type]) {
|
|
@@ -8414,7 +8414,7 @@ function $8838e3e61b748a8b$export$ef73ea4f975745ba(meta_data) {
|
|
|
8414
8414
|
* It's preferred not to kill any conflicting meta tags because frameworks might go apeshit.
|
|
8415
8415
|
* Things seem to work when only changing the meta values though */
|
|
8416
8416
|
const sync_elements_to_head = () => {
|
|
8417
|
-
if (retries++ > $8838e3e61b748a8b$var$MAX_SYNC_RETRIES) return
|
|
8417
|
+
if (retries++ > $8838e3e61b748a8b$var$MAX_SYNC_RETRIES) return $e6c6e7929ea385ae$export$de56f1198d121036("Failed to sync meta tag to head. Hit max retries.", opts.selector, content);
|
|
8418
8418
|
const existing_elements = document.head.querySelectorAll(opts.selector);
|
|
8419
8419
|
const elements = existing_elements.length ? existing_elements : [opts.create()];
|
|
8420
8420
|
elements.forEach(el => {
|
|
@@ -8437,5 +8437,5 @@ function $8838e3e61b748a8b$export$ef73ea4f975745ba(meta_data) {
|
|
|
8437
8437
|
}
|
|
8438
8438
|
}, "Meta tag writing crashed"));
|
|
8439
8439
|
}
|
|
8440
|
-
|
|
8440
|
+
$e4a18bf12ad092d9$export$2cefb7e61fcbae00("utilishared", (0, $815f67c61b4c0a42$export$83d89fbfd8236492));
|
|
8441
8441
|
$parcel$exportWildcard(module.exports, $28e42b0009d694b2$exports);
|