@depict-ai/utilishared 2.2.0 → 2.3.1
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 +774 -3236
- package/ES10/index.d.ts +340 -1116
- package/ES10/index.js +775 -3175
- package/latest/index.cjs +817 -3180
- package/latest/index.d.ts +340 -1116
- package/latest/index.js +818 -3119
- package/package.json +2 -2
- package/server/ES10/index.cjs +775 -3233
- package/server/ES10/index.d.ts +340 -1116
- package/server/ES10/index.js +776 -3172
- package/server/latest/index.cjs +818 -3177
- package/server/latest/index.d.ts +340 -1116
- package/server/latest/index.js +819 -3116
package/ES10/index.js
CHANGED
|
@@ -2,21 +2,13 @@ import $76EG6$babelruntimehelpersdefineProperty from "@babel/runtime/helpers/def
|
|
|
2
2
|
import { onCleanup as $76EG6$onCleanup, createEffect as $76EG6$createEffect, createSignal as $76EG6$createSignal } from "solid-js";
|
|
3
3
|
import $76EG6$babelruntimehelpersclassPrivateFieldSet from "@babel/runtime/helpers/classPrivateFieldSet";
|
|
4
4
|
import $76EG6$babelruntimehelpersclassPrivateFieldGet from "@babel/runtime/helpers/classPrivateFieldGet";
|
|
5
|
-
import { template as $76EG6$template, getNextElement as $76EG6$getNextElement,
|
|
5
|
+
import { template as $76EG6$template, getNextElement as $76EG6$getNextElement, className as $76EG6$className, insert as $76EG6$insert, setAttribute as $76EG6$setAttribute, spread as $76EG6$spread, mergeProps as $76EG6$mergeProps, runHydrationEvents as $76EG6$runHydrationEvents, addEventListener as $76EG6$addEventListener, getNextMarker as $76EG6$getNextMarker, delegateEvents as $76EG6$delegateEvents, effect as $76EG6$effect, style as $76EG6$style, createComponent as $76EG6$createComponent } from "solid-js/web";
|
|
6
6
|
import { register_es_version } from "../multi_import_deduplicator.mjs";
|
|
7
7
|
register_es_version("utilishared", "ES10");
|
|
8
|
-
function $parcel$export(e, n, v, s) {
|
|
9
|
-
Object.defineProperty(e, n, {
|
|
10
|
-
get: v,
|
|
11
|
-
set: s,
|
|
12
|
-
enumerable: true,
|
|
13
|
-
configurable: true
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
8
|
function $parcel$interopDefault(a) {
|
|
17
9
|
return a && a.__esModule ? a.default : a;
|
|
18
10
|
}
|
|
19
|
-
const $b9e07ce3c67aa344$export$83d89fbfd8236492 = "2.
|
|
11
|
+
const $b9e07ce3c67aa344$export$83d89fbfd8236492 = "2.3.1";
|
|
20
12
|
const $a5a2bdb4ae93374b$export$55fe61489d2c7417 = /*@__PURE__*/((_globalThis$document, _globalThis$document$, _globalThis$document$2, _globalThis$localStor, _globalThis$localStor2) => process.env.STRIP_DEBUG === "true" ? false : process.env.DEBUG === "true" || process.env.NODE_ENV === "development" || process.env.BUILD_TARGET !== "node" && ((globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : (_globalThis$document$ = _globalThis$document.currentScript) === null || _globalThis$document$ === void 0 ? void 0 : (_globalThis$document$2 = _globalThis$document$.dataset) === null || _globalThis$document$2 === void 0 ? void 0 : _globalThis$document$2.debug) === "true" || (globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$localStor = globalThis.localStorage) === null || _globalThis$localStor === void 0 ? void 0 : (_globalThis$localStor2 = _globalThis$localStor.getItem) === null || _globalThis$localStor2 === void 0 ? void 0 : _globalThis$localStor2.call(_globalThis$localStor, "debug")) === "true"))();
|
|
21
13
|
const $241f2f02cc612a49$var$browser_prefix_styling = "color: #fff;";
|
|
22
14
|
let $241f2f02cc612a49$var$browser_prefix = "[Depict]";
|
|
@@ -1299,41 +1291,85 @@ function $a01cf8e3169d2af1$export$16d7c76794a38a4(element, event, track_id, func
|
|
|
1299
1291
|
}
|
|
1300
1292
|
}
|
|
1301
1293
|
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
function $
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
return result;
|
|
1294
|
+
/**
|
|
1295
|
+
* @deprecated use async_iterable_ipns instead. This can skip values which yields unexpected results.
|
|
1296
|
+
*/
|
|
1297
|
+
function $6a44fa3f1acf7693$export$55621c1ce3cd536b() {
|
|
1298
|
+
// the idea is to have a new promise available immediately before one resolves, so to say an infinite promise
|
|
1299
|
+
let internal_resolve; // copy and pasted from iconbeauty
|
|
1300
|
+
const cart_promise_object = {
|
|
1301
|
+
// I feel like Anton is not going to like this extremely awesome approach
|
|
1302
|
+
promise: new Promise(r => internal_resolve = r),
|
|
1303
|
+
// which is why I'm reluctant with making it a library
|
|
1304
|
+
internal_resolve: internal_resolve,
|
|
1305
|
+
// Edit from later on: I have realised that this is actually very useful, it just has a steep learning curve.
|
|
1306
|
+
resolve: argument => {
|
|
1307
|
+
// it allows both not having to call functions in a loop and instead just awaiting the promise from multiple places
|
|
1308
|
+
const oldresolve = cart_promise_object.internal_resolve; // and to effortlessly ensure a process is never running twice with 100% reliability
|
|
1309
|
+
cart_promise_object.promise = new Promise(r => cart_promise_object.internal_resolve = r); // it could be made a class, but I already know this works, so I'll leave it as is
|
|
1310
|
+
oldresolve(argument);
|
|
1311
|
+
}
|
|
1312
|
+
};
|
|
1313
|
+
return cart_promise_object;
|
|
1323
1314
|
}
|
|
1324
|
-
function $
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1315
|
+
function $e64690bc3a7de2b1$export$c7187bbd1a7a9244() {
|
|
1316
|
+
$e64690bc3a7de2b1$var$placeholder_worker(...arguments).catch((0, $b000f5ef6ce456d9$export$8048b892d651b310));
|
|
1317
|
+
return arguments.length <= 0 ? undefined : arguments[0];
|
|
1318
|
+
}
|
|
1319
|
+
async function $e64690bc3a7de2b1$var$placeholder_worker(placeholder_elements, final_elements, switching_trigger) {
|
|
1320
|
+
let state = false;
|
|
1321
|
+
let has_sanitized_elements = false;
|
|
1322
|
+
const sanit_el_if_needed = async () => {
|
|
1323
|
+
if (!has_sanitized_elements) {
|
|
1324
|
+
has_sanitized_elements = true;
|
|
1325
|
+
placeholder_elements = await $e64690bc3a7de2b1$var$convert_to_node_array(placeholder_elements);
|
|
1326
|
+
final_elements = await $e64690bc3a7de2b1$var$convert_to_node_array(final_elements);
|
|
1327
|
+
}
|
|
1328
|
+
};
|
|
1329
|
+
if (switching_trigger instanceof (0, $4c6e595091defcd9$export$32ccf3a614c84258)) while (true) {
|
|
1330
|
+
const new_state = await switching_trigger.promise;
|
|
1331
|
+
if (new_state != state) {
|
|
1332
|
+
await sanit_el_if_needed();
|
|
1333
|
+
await $e64690bc3a7de2b1$var$decide_direction_and_switch(placeholder_elements, final_elements, new_state);
|
|
1334
|
+
state = new_state;
|
|
1335
|
+
}
|
|
1336
|
+
} else if (switching_trigger instanceof Promise) {
|
|
1337
|
+
const new_state = await switching_trigger;
|
|
1338
|
+
if (state != new_state) {
|
|
1339
|
+
await sanit_el_if_needed();
|
|
1340
|
+
await $e64690bc3a7de2b1$var$decide_direction_and_switch(placeholder_elements, final_elements, new_state);
|
|
1341
|
+
state = new_state;
|
|
1342
|
+
}
|
|
1343
|
+
} else {
|
|
1344
|
+
await sanit_el_if_needed();
|
|
1345
|
+
placeholder_elements[0].addEventListener("placeholder_switch", $9c44a7238815fa47$export$535946eb77c946dd(async e => {
|
|
1346
|
+
const new_state = e.detail.state;
|
|
1347
|
+
if (state != new_state) {
|
|
1348
|
+
await sanit_el_if_needed();
|
|
1349
|
+
await $e64690bc3a7de2b1$var$decide_direction_and_switch(placeholder_elements, final_elements, new_state);
|
|
1350
|
+
state = new_state;
|
|
1351
|
+
}
|
|
1352
|
+
}));
|
|
1335
1353
|
}
|
|
1336
1354
|
}
|
|
1355
|
+
async function $e64690bc3a7de2b1$var$convert_to_node_array(elements) {
|
|
1356
|
+
if (typeof elements == "function") elements = elements();
|
|
1357
|
+
elements = await elements;
|
|
1358
|
+
if (typeof elements[Symbol.iterator] != "function") elements = [elements];
|
|
1359
|
+
return elements;
|
|
1360
|
+
}
|
|
1361
|
+
async function $e64690bc3a7de2b1$var$decide_direction_and_switch(placeholder_elements, final_elements, switch_to_final) {
|
|
1362
|
+
if (switch_to_final) $e64690bc3a7de2b1$var$switch_elements(placeholder_elements, final_elements);else $e64690bc3a7de2b1$var$switch_elements(final_elements, placeholder_elements);
|
|
1363
|
+
}
|
|
1364
|
+
function $e64690bc3a7de2b1$var$switch_elements(from, to) {
|
|
1365
|
+
if (!from.length || !to.length) $241f2f02cc612a49$export$c2363754d4758444("Cannot switch elements as from or to is empty", from, to);
|
|
1366
|
+
from[0].replaceWith(...to);
|
|
1367
|
+
for (let i = 1; i < from.length; i++) from[i].remove();
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
// @ts-ignore
|
|
1371
|
+
var $bb2bb8f189a68651$exports = {};
|
|
1372
|
+
$bb2bb8f189a68651$exports = ".depict .rec_outer.noautospacing {\n width: 6cm;\n max-width: 46vw;\n margin-left: 1%;\n margin-right: 1%;\n}\n\n.depict .rec_outer.noautospacing:nth-child(1) {\n margin-left: 0;\n}\n\n.depict .rec_outer.noautospacing:nth-last-child(1) {\n margin-right: 0;\n}\n\n.depict-slider .slider_snap {\n scroll-snap-type: x mandatory;\n}\n\n.depict-slider {\n width: 100%;\n position: relative;\n}\n\n.depict-slider .sliding::-webkit-scrollbar {\n display: none;\n}\n\n.depict-slider .sliding {\n scroll-behavior: smooth;\n -ms-overflow-style: none;\n scrollbar-width: none;\n flex-flow: row;\n margin-top: -1%;\n margin-bottom: -2%;\n padding-top: 1%;\n padding-bottom: 2%;\n display: flex;\n overflow-x: scroll;\n}\n\n.depict-slider .sliding > * {\n box-sizing: border-box;\n flex: none;\n}\n\n.depict-slider button.right {\n right: 0;\n}\n\n.depict-slider button.left, .depict-slider button.right {\n z-index: 2;\n touch-action: manipulation;\n width: 1cm;\n height: 1cm;\n cursor: pointer;\n background: #fff;\n border: none;\n padding: .5%;\n transition-duration: .2s;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n}\n\n.depict-slider button.left.hidden, .depict-slider button.right.hidden {\n opacity: 0;\n cursor: default;\n}\n\n.depict-slider button.left {\n left: 0;\n transform: translateY(-50%)rotate(180deg);\n}\n\n.depict-slider button.left img, .depict-slider button.right img {\n width: 100%;\n height: 100%;\n}\n\n.depict-slider .rec_outer {\n margin-top: 0 !important;\n}\n\n";
|
|
1337
1373
|
let $2c3b8e0102339cd6$var$has_queued_microtask = false;
|
|
1338
1374
|
const $2c3b8e0102339cd6$var$queued_callbacks = /*@__PURE__*/new Map();
|
|
1339
1375
|
const $2c3b8e0102339cd6$var$catchified_deduplicate_and_dispatch = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9($2c3b8e0102339cd6$var$deduplicate_and_dispatch, "error in observer event processing", "error");
|
|
@@ -1392,6 +1428,39 @@ class $4f10cdcba0efac85$export$ea60432919e69303 {
|
|
|
1392
1428
|
opts.event_ && (this.event = opts.event_);
|
|
1393
1429
|
}
|
|
1394
1430
|
}
|
|
1431
|
+
const $914c6f35222c820d$var$needs_patching = typeof window === "object" ? /*@__PURE__*/$914c6f35222c820d$var$check_if_querySelectorAll_needs_patching() : false;
|
|
1432
|
+
function $914c6f35222c820d$export$33f937d741e49339(element, selector) {
|
|
1433
|
+
if (!(element instanceof Element) || !$914c6f35222c820d$var$needs_patching || !selector.includes("#") || !selector.includes("+")) {
|
|
1434
|
+
var _element$querySelecto;
|
|
1435
|
+
// covers most cases, we don't need patching or don't hit the bug
|
|
1436
|
+
return element === null || element === void 0 ? void 0 : (_element$querySelecto = element.querySelectorAll) === null || _element$querySelecto === void 0 ? void 0 : _element$querySelecto.call(element, selector);
|
|
1437
|
+
}
|
|
1438
|
+
const result = [];
|
|
1439
|
+
const elements_to_check = [];
|
|
1440
|
+
// intentionally not recursive since it's possible to have deeper nested elements than max stack size
|
|
1441
|
+
for (let i = element.children.length; i--;) elements_to_check.push(element.children[i]);
|
|
1442
|
+
while (elements_to_check.length) {
|
|
1443
|
+
const child_element = elements_to_check.pop();
|
|
1444
|
+
if (child_element.matches(selector)) result.push(child_element);
|
|
1445
|
+
for (let i = child_element.children.length; i--;)
|
|
1446
|
+
// kudos to Karl for algorithm help
|
|
1447
|
+
elements_to_check.push(child_element.children[i]);
|
|
1448
|
+
}
|
|
1449
|
+
return result;
|
|
1450
|
+
}
|
|
1451
|
+
function $914c6f35222c820d$var$check_if_querySelectorAll_needs_patching() {
|
|
1452
|
+
const id_div = document.createElement("div");
|
|
1453
|
+
const element = document.createElement("section");
|
|
1454
|
+
const selector = "#a+*";
|
|
1455
|
+
id_div.id = "a";
|
|
1456
|
+
document.documentElement.append(id_div, element);
|
|
1457
|
+
try {
|
|
1458
|
+
return element === element.querySelectorAll(selector)[0];
|
|
1459
|
+
} finally {
|
|
1460
|
+
id_div.remove();
|
|
1461
|
+
element.remove();
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1395
1464
|
function $7d82513db34b5d27$var$_classPrivateMethodInitSpec(obj, privateSet) {
|
|
1396
1465
|
$7d82513db34b5d27$var$_checkPrivateRedeclaration(obj, privateSet);
|
|
1397
1466
|
privateSet.add(obj);
|
|
@@ -1979,6 +2048,21 @@ function $90fa633a9564f115$var$make_default_observer() {
|
|
|
1979
2048
|
$5e1f45affc1d7def$export$f18d5b0af29128b7([error, "error starting ElementObserver"], "error");
|
|
1980
2049
|
}
|
|
1981
2050
|
}
|
|
2051
|
+
|
|
2052
|
+
/**
|
|
2053
|
+
* Useful for the `thresholds` option of IntersectionObserver - if you want to be notified at a 10% change, call this and set num_steps to 10. Pls see https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/thresholds
|
|
2054
|
+
* @param numSteps How many steps (notifications) there should be between 0 and 100% intersection
|
|
2055
|
+
* @return Stuff to give to IntersectionObserver
|
|
2056
|
+
*/
|
|
2057
|
+
function $ab9c3dbf2bb2fbf7$export$f8ea2e7b15b5d129(numSteps) {
|
|
2058
|
+
const thresholds = [];
|
|
2059
|
+
for (let i = 1.0; i <= numSteps; i++) {
|
|
2060
|
+
const ratio = i / numSteps;
|
|
2061
|
+
thresholds.push(ratio);
|
|
2062
|
+
}
|
|
2063
|
+
thresholds.push(0);
|
|
2064
|
+
return thresholds;
|
|
2065
|
+
}
|
|
1982
2066
|
function $652300c6621d5500$export$925772df9b4d16e5(url, param, value) {
|
|
1983
2067
|
const url_object = new URL(url),
|
|
1984
2068
|
search_params = new URLSearchParams(url_object.search);
|
|
@@ -2091,1835 +2175,57 @@ function $652300c6621d5500$export$9590700a594aef08(obj, step1) {
|
|
|
2091
2175
|
for (var _len = arguments.length, path = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) path[_key - 2] = arguments[_key];
|
|
2092
2176
|
if (path.length) return $652300c6621d5500$export$9590700a594aef08(obj[step1], ...path);else return obj[step1];
|
|
2093
2177
|
}
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
return new Promise((res, rej) => promise.then(rej, res));
|
|
2178
|
+
function $5f31622ffb78bc10$var$_classPrivateMethodInitSpec(obj, privateSet) {
|
|
2179
|
+
$5f31622ffb78bc10$var$_checkPrivateRedeclaration(obj, privateSet);
|
|
2180
|
+
privateSet.add(obj);
|
|
2098
2181
|
}
|
|
2099
|
-
function $
|
|
2100
|
-
var
|
|
2101
|
-
|
|
2182
|
+
function $5f31622ffb78bc10$var$_classPrivateFieldInitSpec(obj, privateMap, value) {
|
|
2183
|
+
$5f31622ffb78bc10$var$_checkPrivateRedeclaration(obj, privateMap);
|
|
2184
|
+
privateMap.set(obj, value);
|
|
2102
2185
|
}
|
|
2103
|
-
|
|
2104
|
-
if (
|
|
2105
|
-
const bc = new BroadcastChannel("right_click_attribution");
|
|
2106
|
-
$241f2f02cc612a49$export$de56f1198d121036("Broadcasting", product_id, "to", bc);
|
|
2107
|
-
bc.postMessage(product_id);
|
|
2108
|
-
bc.close();
|
|
2186
|
+
function $5f31622ffb78bc10$var$_checkPrivateRedeclaration(obj, privateCollection) {
|
|
2187
|
+
if (privateCollection.has(obj)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
2109
2188
|
}
|
|
2110
|
-
function $
|
|
2111
|
-
if (
|
|
2112
|
-
|
|
2113
|
-
const handler = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(e => $df87ac5a30f7baac$export$8f66c4c7fb96eda2(e, ("variant_index" in display ? display.variant_displays[display.variant_index] : display).product_id));
|
|
2114
|
-
const auxclick_handler = e => e.button === 1 && handler(e);
|
|
2115
|
-
for (let i = 0; i < (elements === null || elements === void 0 ? void 0 : elements.length); i++) {
|
|
2116
|
-
const element = elements[i];
|
|
2117
|
-
element.addEventListener("contextmenu", handler);
|
|
2118
|
-
element.addEventListener("auxclick", auxclick_handler); // actual wheel click - some mouses / OS:es also dispatch auxclick on rightclick
|
|
2119
|
-
if (get_event_listener_remover) disconnectors.push(() => {
|
|
2120
|
-
element.removeEventListener("contextmenu", handler);
|
|
2121
|
-
element.removeEventListener("auxclick", auxclick_handler);
|
|
2122
|
-
});
|
|
2123
|
-
}
|
|
2124
|
-
get_event_listener_remover === null || get_event_listener_remover === void 0 || get_event_listener_remover(() => disconnectors.forEach(disconnector => disconnector()));
|
|
2125
|
-
return elements;
|
|
2189
|
+
function $5f31622ffb78bc10$var$_classPrivateMethodGet(receiver, privateSet, fn) {
|
|
2190
|
+
if (!privateSet.has(receiver)) throw new TypeError("attempted to get private field on non-instance");
|
|
2191
|
+
return fn;
|
|
2126
2192
|
}
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2193
|
+
var $5f31622ffb78bc10$var$_verbose = /*#__PURE__*/new WeakMap();
|
|
2194
|
+
var $5f31622ffb78bc10$var$_images_on_first_page = /*#__PURE__*/new WeakMap();
|
|
2195
|
+
var $5f31622ffb78bc10$var$_default_lazyfinder = /*#__PURE__*/new WeakMap();
|
|
2196
|
+
var $5f31622ffb78bc10$var$_initiate_new_image = /*#__PURE__*/new WeakSet();
|
|
2197
|
+
var $5f31622ffb78bc10$var$_add_load_event_listener = /*#__PURE__*/new WeakSet();
|
|
2198
|
+
var $5f31622ffb78bc10$var$_unload_images_and_add_load_listeners = /*#__PURE__*/new WeakSet();
|
|
2199
|
+
var $5f31622ffb78bc10$var$_start_observer = /*#__PURE__*/new WeakSet();
|
|
2200
|
+
var $5f31622ffb78bc10$var$_check_if_first_page_has_loaded = /*#__PURE__*/new WeakSet();
|
|
2201
|
+
class $5f31622ffb78bc10$export$3be7054c61590ee3 {
|
|
2202
|
+
start_observing_for_new_children_(override_container) {
|
|
2203
|
+
// should ONLY run on our "stock" elements array and is therefore called if "elements" is get in it - which means it's being used
|
|
2204
|
+
// 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
|
|
2205
|
+
if (!this.container && !override_container) return;
|
|
2206
|
+
const container = override_container !== null && override_container !== void 0 ? override_container : this.container;
|
|
2207
|
+
const mutation_observer = new MutationObserver($5e1f45affc1d7def$export$b3bbfd758f11cfa9(mutations => {
|
|
2208
|
+
for (let i = 0; i < mutations.length; i++) {
|
|
2209
|
+
const matching_added_els = $652300c6621d5500$export$5e63aea0cac01fa0(mutations[i].addedNodes, this.selector);
|
|
2210
|
+
if (matching_added_els.length) {
|
|
2211
|
+
if ($76EG6$babelruntimehelpersclassPrivateFieldGet(this, $5f31622ffb78bc10$var$_verbose)) $241f2f02cc612a49$export$de56f1198d121036("New elements", matching_added_els, " matching selector", this.selector, "were aded to", container, "lazyloading\u2026");
|
|
2212
|
+
this.lazyfinder.elements.push(...matching_added_els);
|
|
2213
|
+
matching_added_els.forEach($5f31622ffb78bc10$var$_classPrivateMethodGet(this, $5f31622ffb78bc10$var$_initiate_new_image, $5f31622ffb78bc10$var$_initiate_new_image2).bind(this));
|
|
2214
|
+
}
|
|
2215
|
+
}
|
|
2138
2216
|
}));
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
element.dispatchEvent(click);
|
|
2152
|
-
} else $241f2f02cc612a49$export$de56f1198d121036("Our product_id did not get broadcasted, closing channel");
|
|
2153
|
-
bc.close();
|
|
2154
|
-
}
|
|
2155
|
-
|
|
2156
|
-
/**
|
|
2157
|
-
* Useful for the `thresholds` option of IntersectionObserver - if you want to be notified at a 10% change, call this and set num_steps to 10. Pls see https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/thresholds
|
|
2158
|
-
* @param numSteps How many steps (notifications) there should be between 0 and 100% intersection
|
|
2159
|
-
* @return Stuff to give to IntersectionObserver
|
|
2160
|
-
*/
|
|
2161
|
-
function $ab9c3dbf2bb2fbf7$export$f8ea2e7b15b5d129(numSteps) {
|
|
2162
|
-
const thresholds = [];
|
|
2163
|
-
for (let i = 1.0; i <= numSteps; i++) {
|
|
2164
|
-
const ratio = i / numSteps;
|
|
2165
|
-
thresholds.push(ratio);
|
|
2166
|
-
}
|
|
2167
|
-
thresholds.push(0);
|
|
2168
|
-
return thresholds;
|
|
2169
|
-
}
|
|
2170
|
-
|
|
2171
|
-
/**
|
|
2172
|
-
* Elements currently intersecting with the viewport.
|
|
2173
|
-
* If they are intersecting for the `has_to_be_intersecting_for` duration, we count it as an impression, and call the callback.
|
|
2174
|
-
*/
|
|
2175
|
-
const $20f21bee300687ff$var$current_intersections = /*@__PURE__*/new WeakMap();
|
|
2176
|
-
/**
|
|
2177
|
-
* Currently watched elements by the intersection observer with their respective callback
|
|
2178
|
-
* */
|
|
2179
|
-
const $20f21bee300687ff$var$watched_elements = /*@__PURE__*/new WeakMap();
|
|
2180
|
-
const $20f21bee300687ff$var$unwatch_element = element => {
|
|
2181
|
-
$20f21bee300687ff$var$intersection_observer === null || $20f21bee300687ff$var$intersection_observer === void 0 || $20f21bee300687ff$var$intersection_observer.unobserve(element);
|
|
2182
|
-
$20f21bee300687ff$var$watched_elements.delete(element);
|
|
2183
|
-
$20f21bee300687ff$var$current_intersections.delete(element);
|
|
2184
|
-
};
|
|
2185
|
-
const $20f21bee300687ff$export$4c51576248bcdf31 = (element, callback) => {
|
|
2186
|
-
if ($20f21bee300687ff$var$watched_elements.has(element)) {
|
|
2187
|
-
$241f2f02cc612a49$export$de56f1198d121036("Not watching", element, "as it's already being watched");
|
|
2188
|
-
return () => {};
|
|
2189
|
-
}
|
|
2190
|
-
$20f21bee300687ff$var$intersection_observer === null || $20f21bee300687ff$var$intersection_observer === void 0 || $20f21bee300687ff$var$intersection_observer.observe(element);
|
|
2191
|
-
/** Calls the given callback and makes sure to stop watching the element */
|
|
2192
|
-
const wrapped_callback = element => {
|
|
2193
|
-
callback(element);
|
|
2194
|
-
$20f21bee300687ff$var$unwatch_element(element);
|
|
2195
|
-
};
|
|
2196
|
-
$20f21bee300687ff$var$watched_elements.set(element, wrapped_callback);
|
|
2197
|
-
const disconnect_observer = (0, $90fa633a9564f115$export$b6ae1bc530f4c149).onremoved(element, () => {
|
|
2198
|
-
// Sometimes it has already rapidly been reinserted. The observer events lag by one tick.
|
|
2199
|
-
// For that case, make sure we're really out of the DOM
|
|
2200
|
-
if (document.documentElement.contains(element)) return;
|
|
2201
|
-
$20f21bee300687ff$var$unwatch_element(element);
|
|
2202
|
-
});
|
|
2203
|
-
return () => {
|
|
2204
|
-
disconnect_observer();
|
|
2205
|
-
$20f21bee300687ff$var$unwatch_element(element);
|
|
2206
|
-
};
|
|
2207
|
-
};
|
|
2208
|
-
const $20f21bee300687ff$var$intersection_observer_callback = entries => {
|
|
2209
|
-
for (const record of entries) {
|
|
2210
|
-
const {
|
|
2211
|
-
target: target
|
|
2212
|
-
} = record;
|
|
2213
|
-
const callback = $20f21bee300687ff$var$watched_elements.get(target);
|
|
2214
|
-
// Skip the element if it's no longer being watched.
|
|
2215
|
-
if (!callback) {
|
|
2216
|
-
$20f21bee300687ff$var$intersection_observer === null || $20f21bee300687ff$var$intersection_observer === void 0 || $20f21bee300687ff$var$intersection_observer.unobserve(target);
|
|
2217
|
-
continue;
|
|
2218
|
-
}
|
|
2219
|
-
const currently_intersecting = $20f21bee300687ff$var$current_intersections.has(target);
|
|
2220
|
-
if (!currently_intersecting && record.intersectionRatio >= (0, $d6c3e2ba045accda$export$135da44d0ba958bc)[0]) {
|
|
2221
|
-
// we're intersecting enough and not already in the process of "measuring"
|
|
2222
|
-
const started_intersecting_at_ = +new Date(); // save start time
|
|
2223
|
-
// Schedule the callback function to be called after the element has been intersecting for the required duration
|
|
2224
|
-
const callback_timeout_ = setTimeout(callback, (0, $d6c3e2ba045accda$export$ca8321ea61dc2544), target);
|
|
2225
|
-
$20f21bee300687ff$var$current_intersections.set(target, {
|
|
2226
|
-
started_intersecting_at_: started_intersecting_at_,
|
|
2227
|
-
callback_timeout_: callback_timeout_
|
|
2228
|
-
});
|
|
2229
|
-
} else if (currently_intersecting && record.intersectionRatio < (0, $d6c3e2ba045accda$export$135da44d0ba958bc)[1]) {
|
|
2230
|
-
// we are in the process of "measuring" and went below the threshold
|
|
2231
|
-
const {
|
|
2232
|
-
started_intersecting_at_: started_intersecting_at_,
|
|
2233
|
-
callback_timeout_: callback_timeout_
|
|
2234
|
-
} = $20f21bee300687ff$var$current_intersections.get(target);
|
|
2235
|
-
const time_elapsed = +new Date() - started_intersecting_at_;
|
|
2236
|
-
// If we stopped intersecting too early we want to abort our timeout.
|
|
2237
|
-
// if we did not we also want to abort the timeout since it's been lagging and just instantly send the event
|
|
2238
|
-
// (the browser can delay setTimeout timers)
|
|
2239
|
-
clearTimeout(callback_timeout_);
|
|
2240
|
-
if (time_elapsed <= (0, $d6c3e2ba045accda$export$ca8321ea61dc2544)) $20f21bee300687ff$var$current_intersections.delete(target);else {
|
|
2241
|
-
// we intersected long enough
|
|
2242
|
-
$241f2f02cc612a49$export$de56f1198d121036("intersection_observer: setTimeout lagged", time_elapsed, (0, $d6c3e2ba045accda$export$ca8321ea61dc2544), "ms", target);
|
|
2243
|
-
callback(target);
|
|
2244
|
-
}
|
|
2245
|
-
}
|
|
2246
|
-
}
|
|
2247
|
-
};
|
|
2248
|
-
/**
|
|
2249
|
-
* Global IntersectionObserver used for all impression tracking.
|
|
2250
|
-
* It's faster to use one observer for all elements than to create a new one for each element.
|
|
2251
|
-
*/
|
|
2252
|
-
const $20f21bee300687ff$var$intersection_observer = typeof window === "object" ? /*@__PURE__*/new IntersectionObserver( /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9($20f21bee300687ff$var$intersection_observer_callback), {
|
|
2253
|
-
threshold: /*@__PURE__*/$ab9c3dbf2bb2fbf7$export$f8ea2e7b15b5d129(8)
|
|
2254
|
-
}) : undefined;
|
|
2255
|
-
const $c633189b7b69d048$export$d0efd8ed14f5c33 = (items, display, info) => {
|
|
2256
|
-
if (!(items !== null && items !== void 0 && items.length)) return items;
|
|
2257
|
-
const node_array = Array.isArray(items) ? items : [...items]; // if it's a NodeList convert it to an array
|
|
2258
|
-
const first_watchable_el = node_array.find(el => el instanceof Element);
|
|
2259
|
-
if (!first_watchable_el) {
|
|
2260
|
-
$241f2f02cc612a49$export$de56f1198d121036("Impression tracking: Can't observe", items, display);
|
|
2261
|
-
return items;
|
|
2262
|
-
}
|
|
2263
|
-
if (!info.t) {
|
|
2264
|
-
$241f2f02cc612a49$export$de56f1198d121036("Impression tracking: No tenant instance, can't track", items, display);
|
|
2265
|
-
return items;
|
|
2266
|
-
}
|
|
2267
|
-
(0, $90fa633a9564f115$export$b6ae1bc530f4c149).onexists(first_watchable_el, _ref => {
|
|
2268
|
-
let {
|
|
2269
|
-
element: element
|
|
2270
|
-
} = _ref;
|
|
2271
|
-
$20f21bee300687ff$export$4c51576248bcdf31(element, () => {
|
|
2272
|
-
const {
|
|
2273
|
-
recommendation_id: recommendation_id,
|
|
2274
|
-
search_result_id: search_result_id,
|
|
2275
|
-
product_listing_result_id: product_listing_result_id,
|
|
2276
|
-
suggestions_result_id: suggestions_result_id
|
|
2277
|
-
} = display;
|
|
2278
|
-
$d6c3e2ba045accda$export$4205dc6835bc0d9f({
|
|
2279
|
-
...$d5f7352b58e0d737$export$8c6f26a5b6921b95(),
|
|
2280
|
-
recommendation_type: info.rendering_options.type,
|
|
2281
|
-
entity_price: display.sale_price,
|
|
2282
|
-
market: info.t.market,
|
|
2283
|
-
tenant: info.t.tenant,
|
|
2284
|
-
product_id: display.product_id,
|
|
2285
|
-
recommendation_id: recommendation_id,
|
|
2286
|
-
search_result_id: search_result_id,
|
|
2287
|
-
product_listing_result_id: product_listing_result_id,
|
|
2288
|
-
suggestions_result_id: suggestions_result_id
|
|
2289
|
-
});
|
|
2290
|
-
});
|
|
2291
|
-
});
|
|
2292
|
-
return items;
|
|
2293
|
-
};
|
|
2294
|
-
const $e89a1d249db21af0$export$37125ccc5dd98050 = _ref => {
|
|
2295
|
-
let {
|
|
2296
|
-
element: element,
|
|
2297
|
-
data: data,
|
|
2298
|
-
wait_for_dom_insertion = true
|
|
2299
|
-
} = _ref;
|
|
2300
|
-
const disconnectors = [];
|
|
2301
|
-
const impression_track = () => {
|
|
2302
|
-
const disconnector = $20f21bee300687ff$export$4c51576248bcdf31(element, () => {
|
|
2303
|
-
$d6c3e2ba045accda$export$4205dc6835bc0d9f({
|
|
2304
|
-
...$d5f7352b58e0d737$export$8c6f26a5b6921b95(),
|
|
2305
|
-
...data
|
|
2306
|
-
});
|
|
2307
|
-
});
|
|
2308
|
-
disconnectors.push(disconnector);
|
|
2309
|
-
};
|
|
2310
|
-
if (wait_for_dom_insertion) disconnectors.push((0, $90fa633a9564f115$export$b6ae1bc530f4c149).onexists(element, impression_track));else impression_track();
|
|
2311
|
-
return () => disconnectors.forEach(disconnector => disconnector());
|
|
2312
|
-
};
|
|
2313
|
-
let $d6c3e2ba045accda$export$135da44d0ba958bc = [0.6, 0.5];
|
|
2314
|
-
const $d6c3e2ba045accda$export$c543ee4cdb0d0964 = (start, end) => $d6c3e2ba045accda$export$135da44d0ba958bc = [start, end];
|
|
2315
|
-
const $d6c3e2ba045accda$export$ca8321ea61dc2544 = 500;
|
|
2316
|
-
const $d6c3e2ba045accda$export$4205dc6835bc0d9f = data => {
|
|
2317
|
-
data.type = "element_visible"; // Set the type to element_visible as this is optional to pass here.
|
|
2318
|
-
$814c3bf8e175fa59$export$28cacbd9b4306ffc([data], true);
|
|
2319
|
-
};
|
|
2320
|
-
function $bd7c9f254946941d$export$82a685f2da2fb027(a_element, product_id, recommendation_id, additional_listener) {
|
|
2321
|
-
var _a_element$depict_tra, _a_element$depict_tra2;
|
|
2322
|
-
if (!a_element ||
|
|
2323
|
-
// @ts-ignore
|
|
2324
|
-
!a_element.depict_tracked ||
|
|
2325
|
-
// @ts-ignore
|
|
2326
|
-
(a_element === null || a_element === void 0 ? void 0 : (_a_element$depict_tra = a_element.depict_tracked) === null || _a_element$depict_tra === void 0 ? void 0 : _a_element$depict_tra.recommendation_id) != recommendation_id ||
|
|
2327
|
-
// @ts-ignore
|
|
2328
|
-
(a_element === null || a_element === void 0 ? void 0 : (_a_element$depict_tra2 = a_element.depict_tracked) === null || _a_element$depict_tra2 === void 0 ? void 0 : _a_element$depict_tra2.product_id) != product_id) {
|
|
2329
|
-
const listener = e => {
|
|
2330
|
-
localStorage.setItem("depict_attribution_".concat(product_id), recommendation_id);
|
|
2331
|
-
if (additional_listener) additional_listener(e, product_id, recommendation_id);
|
|
2332
|
-
};
|
|
2333
|
-
// @ts-ignore
|
|
2334
|
-
if (a_element.depict_tracked) {
|
|
2335
|
-
var _a_element$depict_tra3;
|
|
2336
|
-
// @ts-ignore
|
|
2337
|
-
a_element.removeEventListener("click", (_a_element$depict_tra3 = a_element.depict_tracked) === null || _a_element$depict_tra3 === void 0 ? void 0 : _a_element$depict_tra3.listener);
|
|
2338
|
-
}
|
|
2339
|
-
// @ts-ignore
|
|
2340
|
-
a_element.depict_tracked = {
|
|
2341
|
-
product_id: product_id,
|
|
2342
|
-
recommendation_id: recommendation_id,
|
|
2343
|
-
listener: listener
|
|
2344
|
-
};
|
|
2345
|
-
a_element.addEventListener("click", listener);
|
|
2346
|
-
return listener;
|
|
2347
|
-
}
|
|
2348
|
-
}
|
|
2349
|
-
async function $bd7c9f254946941d$export$2c34560c3749dc63(button, get_product_id, tracking_fn, unmatching_tracking, event) {
|
|
2350
|
-
// @ts-ignore
|
|
2351
|
-
if (!button || button.depict_tracked) return;
|
|
2352
|
-
button.addEventListener(event ? event : "click", $5e1f45affc1d7def$export$b3bbfd758f11cfa9(async e => {
|
|
2353
|
-
if (!e.isTrusted) {
|
|
2354
|
-
$241f2f02cc612a49$export$de56f1198d121036("ignoring event", e, "because it's not user generated");
|
|
2355
|
-
return;
|
|
2356
|
-
}
|
|
2357
|
-
const product_id = await get_product_id(undefined, e);
|
|
2358
|
-
if (product_id) {
|
|
2359
|
-
const item_name = "depict_attribution_".concat(product_id);
|
|
2360
|
-
const recommendation_id = localStorage.getItem(item_name);
|
|
2361
|
-
if (recommendation_id) {
|
|
2362
|
-
localStorage.removeItem(item_name);
|
|
2363
|
-
tracking_fn(product_id, recommendation_id, false, e);
|
|
2364
|
-
} else if (unmatching_tracking) tracking_fn(product_id, recommendation_id, true, e);
|
|
2365
|
-
}
|
|
2366
|
-
}));
|
|
2367
|
-
// @ts-ignore
|
|
2368
|
-
button.depict_tracked = true;
|
|
2369
|
-
}
|
|
2370
|
-
var $ad1dbddac6af350d$var$_globalThis$window;
|
|
2371
|
-
const $ad1dbddac6af350d$export$20e9533e68ee72e7 = /*@__PURE__*/$7ca6fdc721083788$export$e806c6c1615a59ae(false);
|
|
2372
|
-
const $ad1dbddac6af350d$export$a9d39e43ae273d26 = /*@__PURE__*/$7ca6fdc721083788$export$e806c6c1615a59ae();
|
|
2373
|
-
const $ad1dbddac6af350d$export$7500cdfd37aafd43 = /*@__PURE__*/new Set();
|
|
2374
|
-
let $ad1dbddac6af350d$var$old_url;
|
|
2375
|
-
const $ad1dbddac6af350d$var$maybe_navigation = (what_happened, args) => {
|
|
2376
|
-
if (typeof location === "undefined") return;
|
|
2377
|
-
const new_url = location.href;
|
|
2378
|
-
if ($ad1dbddac6af350d$var$old_url !== new_url) {
|
|
2379
|
-
$ad1dbddac6af350d$export$a9d39e43ae273d26(new_url);
|
|
2380
|
-
if ($ad1dbddac6af350d$var$old_url !== undefined)
|
|
2381
|
-
// don't resolve stateless href change ipns with the initial value - it's not a navigation
|
|
2382
|
-
$ad1dbddac6af350d$export$20e9533e68ee72e7(new_url);
|
|
2383
|
-
$ad1dbddac6af350d$var$old_url = new_url;
|
|
2384
|
-
}
|
|
2385
|
-
for (const fn of $ad1dbddac6af350d$export$7500cdfd37aafd43) fn(what_happened, args);
|
|
2386
|
-
};
|
|
2387
|
-
$ad1dbddac6af350d$export$baccefee4a395d8f((args, what_happened) => $ad1dbddac6af350d$var$maybe_navigation(what_happened, args));
|
|
2388
|
-
$ad1dbddac6af350d$var$maybe_navigation();
|
|
2389
|
-
globalThis === null || globalThis === void 0 || ($ad1dbddac6af350d$var$_globalThis$window = globalThis.window) === null || $ad1dbddac6af350d$var$_globalThis$window === void 0 || $ad1dbddac6af350d$var$_globalThis$window.addEventListener("popstate", $5e1f45affc1d7def$export$b3bbfd758f11cfa9(e => $ad1dbddac6af350d$var$maybe_navigation("popstate", e)));
|
|
2390
|
-
async function $ad1dbddac6af350d$export$1cd22bab0d2c3b0b(callback) {
|
|
2391
|
-
const catchified_callback = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(callback);
|
|
2392
|
-
for await (const href of $ad1dbddac6af350d$export$20e9533e68ee72e7) {
|
|
2393
|
-
catchified_callback(href);
|
|
2394
|
-
break;
|
|
2395
|
-
}
|
|
2396
|
-
}
|
|
2397
|
-
async function $ad1dbddac6af350d$export$baccefee4a395d8f(after_navigation) {
|
|
2398
|
-
let replace_replaceState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
2399
|
-
if (typeof History === "undefined") return;
|
|
2400
|
-
const {
|
|
2401
|
-
prototype: prototype
|
|
2402
|
-
} = History;
|
|
2403
|
-
const instance = history;
|
|
2404
|
-
const polyfill_dance = the_thing => {
|
|
2405
|
-
const proxy_the_thing = obj => {
|
|
2406
|
-
const orig_pushState = obj[the_thing];
|
|
2407
|
-
obj[the_thing] = new Proxy(orig_pushState, {
|
|
2408
|
-
apply: (target, this_arg, arguments_list) => {
|
|
2409
|
-
const nav_result = Reflect.apply(target, this_arg, arguments_list);
|
|
2410
|
-
try {
|
|
2411
|
-
after_navigation(arguments_list, the_thing);
|
|
2412
|
-
} catch (e) {
|
|
2413
|
-
$b000f5ef6ce456d9$export$8048b892d651b310(e);
|
|
2414
|
-
}
|
|
2415
|
-
return nav_result;
|
|
2416
|
-
}
|
|
2417
|
-
});
|
|
2418
|
-
};
|
|
2419
|
-
proxy_the_thing(prototype);
|
|
2420
|
-
if (Object.getOwnPropertyNames(instance).includes(the_thing))
|
|
2421
|
-
// we don't want to just change the instance because that's not the way to do it, but we don't want to not work because someone else did it wrong
|
|
2422
|
-
proxy_the_thing(instance);
|
|
2423
|
-
};
|
|
2424
|
-
polyfill_dance("pushState");
|
|
2425
|
-
if (replace_replaceState) polyfill_dance("replaceState");
|
|
2426
|
-
}
|
|
2427
|
-
let $0897f35c3b3fbbc4$var$last_page_pageview_sent_for;
|
|
2428
|
-
async function $0897f35c3b3fbbc4$export$eee4c4d924348b05(data) {
|
|
2429
|
-
// Send page view to depict if needed
|
|
2430
|
-
try {
|
|
2431
|
-
const {
|
|
2432
|
-
href: href
|
|
2433
|
-
} = location;
|
|
2434
|
-
if ($0897f35c3b3fbbc4$var$last_page_pageview_sent_for !== href) {
|
|
2435
|
-
$0897f35c3b3fbbc4$var$last_page_pageview_sent_for = href;
|
|
2436
|
-
$d5f7352b58e0d737$export$82badda1f9923310({
|
|
2437
|
-
...data,
|
|
2438
|
-
type: "page_view"
|
|
2439
|
-
});
|
|
2440
|
-
if (data.product_id) await $df87ac5a30f7baac$export$836f70a28c317905(data.product_id); // this takes care of right click click attribution - broadcasts the URL of the current page
|
|
2441
|
-
}
|
|
2442
|
-
} catch (error) {
|
|
2443
|
-
$5e1f45affc1d7def$export$f18d5b0af29128b7([error, "Sending page view failed"], "warning");
|
|
2444
|
-
}
|
|
2445
|
-
}
|
|
2446
|
-
let $0897f35c3b3fbbc4$var$sending_on_navigation = false;
|
|
2447
|
-
async function $0897f35c3b3fbbc4$export$f7cb1bd47199ec38(data) {
|
|
2448
|
-
if (!$0897f35c3b3fbbc4$var$sending_on_navigation) {
|
|
2449
|
-
$0897f35c3b3fbbc4$var$sending_on_navigation = true;
|
|
2450
|
-
$5e1f45affc1d7def$export$b3bbfd758f11cfa9(async () => {
|
|
2451
|
-
for await (const _href of (0, $ad1dbddac6af350d$export$a9d39e43ae273d26)) $0897f35c3b3fbbc4$export$eee4c4d924348b05({
|
|
2452
|
-
tenant: data.tenant,
|
|
2453
|
-
market: data.market,
|
|
2454
|
-
product_id: await data.get_product_id(_href)
|
|
2455
|
-
});
|
|
2456
|
-
})();
|
|
2457
|
-
}
|
|
2458
|
-
}
|
|
2459
|
-
function $799496226e956169$export$edfedd0557ca5a2d(ga_tracker, append_to_url) {
|
|
2460
|
-
if (!ga_tracker) return;
|
|
2461
|
-
// Docs for analytics.js Tasks:
|
|
2462
|
-
// https://developers.google.com/analytics/devguides/collection/analyticsjs/tasks
|
|
2463
|
-
const sendHitTask = "sendHitTask";
|
|
2464
|
-
const originalSendHitTask = ga_tracker.get(sendHitTask);
|
|
2465
|
-
ga_tracker.set(sendHitTask, model => {
|
|
2466
|
-
originalSendHitTask(model);
|
|
2467
|
-
// console.log('Sent original hit, now sending to depict');
|
|
2468
|
-
try {
|
|
2469
|
-
const payLoad = model.get("hitPayload");
|
|
2470
|
-
const path = (0, $9e4bee2e3b4b5753$export$362abebb4b313340) + "/collect-ga";
|
|
2471
|
-
let url = path + "?" + payLoad;
|
|
2472
|
-
if (append_to_url) url += append_to_url;
|
|
2473
|
-
const n = navigator;
|
|
2474
|
-
const sb = "sendBeacon";
|
|
2475
|
-
if (n[sb])
|
|
2476
|
-
// this is actually smaller, I tested
|
|
2477
|
-
n[sb](url);else {
|
|
2478
|
-
const xhttp = new XMLHttpRequest();
|
|
2479
|
-
xhttp.open("GET", url);
|
|
2480
|
-
xhttp.send();
|
|
2481
|
-
}
|
|
2482
|
-
} catch (e) {
|
|
2483
|
-
// console.log('Could not send beacon to /collect-ga', e);
|
|
2484
|
-
}
|
|
2485
|
-
});
|
|
2486
|
-
}
|
|
2487
|
-
function $799496226e956169$export$674d8cd8b6868154() {
|
|
2488
|
-
// Snippet to load GA async
|
|
2489
|
-
const w = window;
|
|
2490
|
-
// @ts-ignore
|
|
2491
|
-
w.ga || (w.ga = function () {
|
|
2492
|
-
var _w$ga;
|
|
2493
|
-
((_w$ga = w.ga).q || (_w$ga.q = [])).push(arguments);
|
|
2494
|
-
});
|
|
2495
|
-
w.ga.l = +new Date();
|
|
2496
|
-
}
|
|
2497
|
-
var $be5f485da4e3f813$exports = {};
|
|
2498
|
-
/*@__PURE__*/$parcel$export($be5f485da4e3f813$exports, "cookiebot_get_consent", () => $be5f485da4e3f813$export$fce59460a1699957);
|
|
2499
|
-
/*@__PURE__*/$parcel$export($be5f485da4e3f813$exports, "cookiebot_wait_for_consent", () => $be5f485da4e3f813$export$56c2e8be65fb14ae);
|
|
2500
|
-
/*@__PURE__*/$parcel$export($be5f485da4e3f813$exports, "cookiebot_get_cookie_ipns", () => $be5f485da4e3f813$export$8827362e5e938d26);
|
|
2501
|
-
/*@__PURE__*/$parcel$export($be5f485da4e3f813$exports, "init_cookiebot_tracking", () => $be5f485da4e3f813$export$abec7fd9f0b9cc22);
|
|
2502
|
-
const $be5f485da4e3f813$var$required_consent_level = process.env.DEPICT_TRACKING_CONSENT_LEVEL;
|
|
2503
|
-
function $be5f485da4e3f813$var$consent_from_cookie() {
|
|
2504
|
-
const cookie = $d5f7352b58e0d737$export$622991c71a1f52b3("CookieConsent");
|
|
2505
|
-
if (!cookie) return;
|
|
2506
|
-
const consent_json = cookie.replace(/%2C/g, ",").replace(/%27/g, "'").replace(/'/g, '"').replace(/([{[,])\s*([\w]+?):/g, '$1"$2":');
|
|
2507
|
-
try {
|
|
2508
|
-
return JSON.parse(consent_json);
|
|
2509
|
-
} catch ({
|
|
2510
|
-
message: message
|
|
2511
|
-
}) {
|
|
2512
|
-
$241f2f02cc612a49$export$de56f1198d121036("Error parsing cookie json", consent_json, message);
|
|
2513
|
-
return;
|
|
2514
|
-
}
|
|
2515
|
-
}
|
|
2516
|
-
let $be5f485da4e3f813$var$cookie_ipns;
|
|
2517
|
-
let $be5f485da4e3f813$var$has_consent = /*@__PURE__*/(_consent_from_cookie => $be5f485da4e3f813$var$required_consent_level ? ((_consent_from_cookie = $be5f485da4e3f813$var$consent_from_cookie()) === null || _consent_from_cookie === void 0 ? void 0 : _consent_from_cookie[$be5f485da4e3f813$var$required_consent_level]) || false : true)();
|
|
2518
|
-
const $be5f485da4e3f813$export$fce59460a1699957 = () => $be5f485da4e3f813$var$has_consent;
|
|
2519
|
-
async function $be5f485da4e3f813$export$56c2e8be65fb14ae() {
|
|
2520
|
-
for await (const consent_obj of $be5f485da4e3f813$export$8827362e5e938d26()) return consent_obj[process.env.DEPICT_TRACKING_CONSENT_LEVEL];
|
|
2521
|
-
// Impossible
|
|
2522
|
-
return false;
|
|
2523
|
-
}
|
|
2524
|
-
function $be5f485da4e3f813$export$8827362e5e938d26() {
|
|
2525
|
-
if ($be5f485da4e3f813$var$cookie_ipns) return $be5f485da4e3f813$var$cookie_ipns;
|
|
2526
|
-
$be5f485da4e3f813$var$cookie_ipns = $7ca6fdc721083788$export$e806c6c1615a59ae();
|
|
2527
|
-
const existing_consent = $be5f485da4e3f813$var$consent_from_cookie();
|
|
2528
|
-
if (existing_consent) $be5f485da4e3f813$var$cookie_ipns(existing_consent);
|
|
2529
|
-
const consent_maybe_changed = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => {
|
|
2530
|
-
const {
|
|
2531
|
-
consent: {
|
|
2532
|
-
marketing: marketing,
|
|
2533
|
-
necessary: necessary,
|
|
2534
|
-
preferences: preferences,
|
|
2535
|
-
statistics: statistics
|
|
2536
|
-
}
|
|
2537
|
-
} = window.Cookiebot;
|
|
2538
|
-
const new_consent_obj = {
|
|
2539
|
-
marketing: marketing,
|
|
2540
|
-
necessary: necessary,
|
|
2541
|
-
preferences: preferences,
|
|
2542
|
-
statistics: statistics
|
|
2543
|
-
};
|
|
2544
|
-
if (!Object.keys(new_consent_obj).every(k => {
|
|
2545
|
-
var _cookie_ipns$latest_c;
|
|
2546
|
-
return ((_cookie_ipns$latest_c = $be5f485da4e3f813$var$cookie_ipns.latest_call_value) === null || _cookie_ipns$latest_c === void 0 ? void 0 : _cookie_ipns$latest_c[k]) === new_consent_obj[k];
|
|
2547
|
-
})) {
|
|
2548
|
-
$241f2f02cc612a49$export$de56f1198d121036("Consent changed", new_consent_obj);
|
|
2549
|
-
$be5f485da4e3f813$var$cookie_ipns(new_consent_obj);
|
|
2550
|
-
}
|
|
2551
|
-
}, "extracting consent failed");
|
|
2552
|
-
$2da62df28669a48a$export$2fc1a072736ae2f6(window, "Cookiebot", "consent").then(consent_maybe_changed);
|
|
2553
|
-
["CookiebotOnAccept", "CookiebotOnDecline"].forEach(e => window.addEventListener(e, consent_maybe_changed, false));
|
|
2554
|
-
return $be5f485da4e3f813$var$cookie_ipns;
|
|
2555
|
-
}
|
|
2556
|
-
const $be5f485da4e3f813$export$abec7fd9f0b9cc22 = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9(async function () {
|
|
2557
|
-
let anon_id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "anonymous";
|
|
2558
|
-
$241f2f02cc612a49$export$de56f1198d121036("Initializing Cookiebot tracking");
|
|
2559
|
-
if (!$be5f485da4e3f813$var$required_consent_level) return $241f2f02cc612a49$export$de56f1198d121036("No consent level set for Depict tracking. Ignoring consent and tracking everything.");
|
|
2560
|
-
const original_get_session_id = (0, $d5f7352b58e0d737$export$61e7e1f11e96692f);
|
|
2561
|
-
$d5f7352b58e0d737$export$93ae15b1ae509334(() => $be5f485da4e3f813$var$has_consent ? original_get_session_id() : anon_id);
|
|
2562
|
-
for await (const consent_obj of $be5f485da4e3f813$export$8827362e5e938d26()) {
|
|
2563
|
-
// Changing this will change the return value of function given to set_depict_id_fn above
|
|
2564
|
-
$be5f485da4e3f813$var$has_consent = consent_obj[$be5f485da4e3f813$var$required_consent_level];
|
|
2565
|
-
if (!$be5f485da4e3f813$var$has_consent) $241f2f02cc612a49$export$de56f1198d121036('dsid will be set to, "'.concat(anon_id, '", until Cookiebot has consent for "').concat($be5f485da4e3f813$var$required_consent_level, '"'));else $241f2f02cc612a49$export$de56f1198d121036('Cookiebot obtained consent for "'.concat($be5f485da4e3f813$var$required_consent_level, '", will use true dsid/session_id'));
|
|
2566
|
-
}
|
|
2567
|
-
});
|
|
2568
|
-
const $d4217f56717a3207$var$required_consent_level = process.env.DEPICT_TRACKING_CONSENT_LEVEL;
|
|
2569
|
-
/*
|
|
2570
|
-
The Optanon cookie format can vary slightly between integrations. To figure out the key values used for a particular customer,
|
|
2571
|
-
visit their web, finish the consent dialog, then run
|
|
2572
|
-
new URLSearchParams(document.cookie.match("(^|;)\\s*OptanonConsent\\s*=\\s*([^;]+)")?.pop()).get("groups")
|
|
2573
|
-
in the console. You should see something like
|
|
2574
|
-
'NECES:1,ANALY:1,PERON:1,MARKE:1'
|
|
2575
|
-
Which tells you what the key values for each consent level is. Enter them in the correct order, comma separated,
|
|
2576
|
-
as OPTANON_KEYS in the tenants .env file. For the cookie output above, the .env entry would be
|
|
2577
|
-
OPTANON_KEYS="NECES,ANALY,PERON,MARKE"
|
|
2578
|
-
If it's not obvious which consent level each key represents, open the consent dialog again and start de-selecting consent options,
|
|
2579
|
-
then check the cookie value again.
|
|
2580
|
-
*/
|
|
2581
|
-
const $d4217f56717a3207$var$KEY_ORDER = ["necessary", "statistics", "preferences", "marketing"];
|
|
2582
|
-
const $d4217f56717a3207$var$OPTANON_TO_COOKIEBOT = Object.fromEntries((process.env.OPTANON_KEYS || "").split(",").filter(k => k).map((k, i) => [k, $d4217f56717a3207$var$KEY_ORDER[i]]));
|
|
2583
|
-
function $d4217f56717a3207$var$consent_from_cookie() {
|
|
2584
|
-
const cookie = $d5f7352b58e0d737$export$622991c71a1f52b3("OptanonConsent");
|
|
2585
|
-
if (!cookie) return;
|
|
2586
|
-
const groups = new URLSearchParams(cookie).get("groups") || "";
|
|
2587
|
-
const matches = groups.matchAll(/(\w+):(\d)/g);
|
|
2588
|
-
const consent = {};
|
|
2589
|
-
for (const match of matches) consent[$d4217f56717a3207$var$OPTANON_TO_COOKIEBOT[match[1]]] = match[2] == "1";
|
|
2590
|
-
return consent;
|
|
2591
|
-
}
|
|
2592
|
-
let $d4217f56717a3207$var$cookie_ipns;
|
|
2593
|
-
let $d4217f56717a3207$var$has_consent = /*@__PURE__*/(_consent_from_cookie => $d4217f56717a3207$var$required_consent_level ? ((_consent_from_cookie = $d4217f56717a3207$var$consent_from_cookie()) === null || _consent_from_cookie === void 0 ? void 0 : _consent_from_cookie[$d4217f56717a3207$var$required_consent_level]) || false : true)();
|
|
2594
|
-
const $d4217f56717a3207$export$1dd9ce50e201eff1 = () => $d4217f56717a3207$var$has_consent;
|
|
2595
|
-
async function $d4217f56717a3207$export$7a6d436e0782c6ed() {
|
|
2596
|
-
for await (const consent_obj of $d4217f56717a3207$export$7e4427e80d5fc619()) return consent_obj[process.env.DEPICT_TRACKING_CONSENT_LEVEL];
|
|
2597
|
-
// Impossible
|
|
2598
|
-
return false;
|
|
2599
|
-
}
|
|
2600
|
-
function $d4217f56717a3207$export$7e4427e80d5fc619() {
|
|
2601
|
-
if ($d4217f56717a3207$var$cookie_ipns) return $d4217f56717a3207$var$cookie_ipns;
|
|
2602
|
-
$d4217f56717a3207$var$cookie_ipns = $7ca6fdc721083788$export$e806c6c1615a59ae();
|
|
2603
|
-
const existing_consent = $d4217f56717a3207$var$consent_from_cookie();
|
|
2604
|
-
if (existing_consent !== null && existing_consent !== void 0 && existing_consent.necessary)
|
|
2605
|
-
// If "necessary" isn't set, user hasn't actually given/withold consent yet.
|
|
2606
|
-
$d4217f56717a3207$var$cookie_ipns(existing_consent);
|
|
2607
|
-
window.addEventListener("consent.onetrust", $5e1f45affc1d7def$export$b3bbfd758f11cfa9(evt => {
|
|
2608
|
-
const c = evt;
|
|
2609
|
-
// Cast because TS doesn't know about the forEach coming up
|
|
2610
|
-
const consent_obj = {};
|
|
2611
|
-
Object.keys($d4217f56717a3207$var$OPTANON_TO_COOKIEBOT).forEach(k => {
|
|
2612
|
-
consent_obj[$d4217f56717a3207$var$OPTANON_TO_COOKIEBOT[k]] = c.detail.includes(k);
|
|
2613
|
-
});
|
|
2614
|
-
if (!consent_obj.necessary)
|
|
2615
|
-
// If "necessary" isn't set, user hasn't actually given/withold consent yet.
|
|
2616
|
-
return;
|
|
2617
|
-
if (!Object.keys(consent_obj).every(k => {
|
|
2618
|
-
var _cookie_ipns$latest_c;
|
|
2619
|
-
return ((_cookie_ipns$latest_c = $d4217f56717a3207$var$cookie_ipns.latest_call_value) === null || _cookie_ipns$latest_c === void 0 ? void 0 : _cookie_ipns$latest_c[k]) === consent_obj[k];
|
|
2620
|
-
})) $d4217f56717a3207$var$cookie_ipns(consent_obj);
|
|
2621
|
-
}));
|
|
2622
|
-
return $d4217f56717a3207$var$cookie_ipns;
|
|
2623
|
-
}
|
|
2624
|
-
const $d4217f56717a3207$export$f0f6c846d96fdbec = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9(async function () {
|
|
2625
|
-
let anon_id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "anonymous";
|
|
2626
|
-
$241f2f02cc612a49$export$de56f1198d121036("Initializing OptAnon tracking");
|
|
2627
|
-
if (!$d4217f56717a3207$var$required_consent_level) return $241f2f02cc612a49$export$de56f1198d121036("No consent level set for Depict tracking. Ignoring consent and tracking everything.");
|
|
2628
|
-
const original_get_session_id = (0, $d5f7352b58e0d737$export$61e7e1f11e96692f);
|
|
2629
|
-
$d5f7352b58e0d737$export$93ae15b1ae509334(() => $d4217f56717a3207$var$has_consent ? original_get_session_id() : anon_id);
|
|
2630
|
-
for await (const consent_obj of $d4217f56717a3207$export$7e4427e80d5fc619()) {
|
|
2631
|
-
// Changing this will change the return value of function given to set_depict_id_fn above
|
|
2632
|
-
$d4217f56717a3207$var$has_consent = consent_obj[$d4217f56717a3207$var$required_consent_level];
|
|
2633
|
-
if (!$d4217f56717a3207$var$has_consent) $241f2f02cc612a49$export$de56f1198d121036('dsid/session_id will be set to, "'.concat(anon_id, '", until Optanon has consent for "').concat($d4217f56717a3207$var$required_consent_level, '"'));else $241f2f02cc612a49$export$de56f1198d121036('Optanon obtained consent for "'.concat($d4217f56717a3207$var$required_consent_level, '", will use true dsid/session_id'));
|
|
2634
|
-
}
|
|
2635
|
-
});
|
|
2636
|
-
const $3674b9afc9a63520$var$g = typeof globalThis == "object" && globalThis || window;
|
|
2637
|
-
const $3674b9afc9a63520$export$f3354ec2ce95ebd9 = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9(async (GA_ID, strict) => {
|
|
2638
|
-
var _g$performance, _g$performance$getEnt, _g$performance$getEnt2, _g$performance$getEnt3;
|
|
2639
|
-
if (process.env.GTAG === "false") return;
|
|
2640
|
-
if (!GA_ID) {
|
|
2641
|
-
$241f2f02cc612a49$export$c2363754d4758444("Couldn't load gtag, GA_ID not specified", GA_ID);
|
|
2642
|
-
return;
|
|
2643
|
-
}
|
|
2644
|
-
const required_consent_level = process.env.GTAG_LOADING_CONSENT_LEVEL;
|
|
2645
|
-
if (required_consent_level !== undefined) {
|
|
2646
|
-
$241f2f02cc612a49$export$de56f1198d121036("GTag loading waiting for consent level ".concat(required_consent_level));
|
|
2647
|
-
const ipns = process.env.CONSENT_FRAMEWORK == "optanon" ? $d4217f56717a3207$export$7e4427e80d5fc619() : $be5f485da4e3f813$export$8827362e5e938d26();
|
|
2648
|
-
for await (const consent_status of ipns) {
|
|
2649
|
-
const status_for_level = consent_status[required_consent_level];
|
|
2650
|
-
if (status_for_level) {
|
|
2651
|
-
$241f2f02cc612a49$export$de56f1198d121036("got consent for", required_consent_level, "loading gtag");
|
|
2652
|
-
break;
|
|
2653
|
-
}
|
|
2654
|
-
}
|
|
2655
|
-
}
|
|
2656
|
-
// delay loading of script because it's huge and slow according to nordiska galleriet
|
|
2657
|
-
// @ts-ignore
|
|
2658
|
-
const page_hasnt_loaded = ($3674b9afc9a63520$var$g === null || $3674b9afc9a63520$var$g === void 0 ? void 0 : (_g$performance = $3674b9afc9a63520$var$g.performance) === null || _g$performance === void 0 ? void 0 : (_g$performance$getEnt = _g$performance.getEntriesByType) === null || _g$performance$getEnt === void 0 ? void 0 : (_g$performance$getEnt2 = _g$performance$getEnt.call(_g$performance, "navigation")) === null || _g$performance$getEnt2 === void 0 ? void 0 : (_g$performance$getEnt3 = _g$performance$getEnt2.every) === null || _g$performance$getEnt3 === void 0 ? void 0 : _g$performance$getEnt3.call(_g$performance$getEnt2, e => e === null || e === void 0 ? void 0 : e.loadEventEnd)) === false;
|
|
2659
|
-
// Source: comment on https://stackoverflow.com/a/53525488
|
|
2660
|
-
// don't use readyState, source: personal experience and comment on https://stackoverflow.com/a/28093606
|
|
2661
|
-
$241f2f02cc612a49$export$de56f1198d121036("Loading gtag after " + (page_hasnt_loaded ? "pageload and " : "") + "3s" + (strict ? "" : ", but setting up queues already"));
|
|
2662
|
-
if (!strict) $3674b9afc9a63520$export$d031e55ccd4c52dc(GA_ID);
|
|
2663
|
-
if (page_hasnt_loaded) {
|
|
2664
|
-
const load_event = await new Promise(r => window.addEventListener("load", r, {
|
|
2665
|
-
once: true
|
|
2666
|
-
}));
|
|
2667
|
-
$241f2f02cc612a49$export$de56f1198d121036("page has loaded", load_event);
|
|
2668
|
-
}
|
|
2669
|
-
await new Promise(r => setTimeout(r, 3000));
|
|
2670
|
-
const script = document.createElement("script"),
|
|
2671
|
-
head = document.head;
|
|
2672
|
-
script.async = true;
|
|
2673
|
-
script.src = "https://www.googletagmanager.com/gtag/js?id=" + GA_ID;
|
|
2674
|
-
head.appendChild(script);
|
|
2675
|
-
$241f2f02cc612a49$export$de56f1198d121036("Loading gtag now", script);
|
|
2676
|
-
});
|
|
2677
|
-
const $3674b9afc9a63520$export$d031e55ccd4c52dc = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9(GA_ID => {
|
|
2678
|
-
if (process.env.GTAG === "false") return;
|
|
2679
|
-
$3674b9afc9a63520$var$g.dataLayer || ($3674b9afc9a63520$var$g.dataLayer = []);
|
|
2680
|
-
function gtag() {
|
|
2681
|
-
$3674b9afc9a63520$var$g.dataLayer.push(arguments);
|
|
2682
|
-
}
|
|
2683
|
-
$3674b9afc9a63520$var$g.gtag = gtag;
|
|
2684
|
-
$3674b9afc9a63520$var$g.gtag("js", new Date());
|
|
2685
|
-
$3674b9afc9a63520$var$g.gtag("config", GA_ID, {
|
|
2686
|
-
"send_page_view": false
|
|
2687
|
-
});
|
|
2688
|
-
$241f2f02cc612a49$export$de56f1198d121036("configuring gtag with", GA_ID);
|
|
2689
|
-
});
|
|
2690
|
-
const $3674b9afc9a63520$export$7babcd5d4056b2ca = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9(async (raw_displays, get_product_id, more) => {
|
|
2691
|
-
const displays = raw_displays; // gtag tracking is "obsolete" and we don't expect any customers using something else than LegacyDisplay to use it
|
|
2692
|
-
if (process.env.GTAG === "false") return;
|
|
2693
|
-
if (process.env.GTAG_VIEW === "false") return;
|
|
2694
|
-
if (process.env.GTAG_EVENT_CONSENT_LEVEL !== undefined && !(await $3674b9afc9a63520$var$can_send_gtag_events(displays, get_product_id, more))) return;
|
|
2695
|
-
if (typeof $3674b9afc9a63520$var$g.gtag == "function") {
|
|
2696
|
-
const make_item = (display, index, id) => ({
|
|
2697
|
-
id: id,
|
|
2698
|
-
"list_name": "depict",
|
|
2699
|
-
"list_position": (display === null || display === void 0 ? void 0 : display.index) || index + 1,
|
|
2700
|
-
...(typeof more === "function" ? more(display) : more)
|
|
2701
|
-
});
|
|
2702
|
-
const gtag_items = [
|
|
2703
|
-
// spread works around safari 11 bug where Array returned by Promise.all is not an instance of the global Array
|
|
2704
|
-
// https://sentry.io/organizations/depictai-0o/issues/2794688692/?project=5476183
|
|
2705
|
-
...(await Promise.all(displays.map(async (display, index) => display.ga_product_ids ? display.ga_product_ids.map(id => make_item(display, index, id)) : make_item(display, index, display.ga_product_id || display.product_id || (await get_product_id(display.page_url)) || (await get_product_id(display)) // the last statement is this row allows for special product_id getter functions that not only use the page_url. They need to check the typeof their argument tho and ignore the first calls
|
|
2706
|
-
))))].flat();
|
|
2707
|
-
const max_products_per_request = 100;
|
|
2708
|
-
for (let i = 0; i < gtag_items.length; i += max_products_per_request) {
|
|
2709
|
-
const gtag_args = ["event", "view_item_list", {
|
|
2710
|
-
"items": gtag_items.slice(i, i + max_products_per_request)
|
|
2711
|
-
}];
|
|
2712
|
-
$241f2f02cc612a49$export$de56f1198d121036("Sending product view to gtag", gtag_args);
|
|
2713
|
-
$3674b9afc9a63520$var$g.gtag(...gtag_args);
|
|
2714
|
-
}
|
|
2715
|
-
} else $241f2f02cc612a49$export$c2363754d4758444("not sending gtag tracking as there is no gtag");
|
|
2716
|
-
});
|
|
2717
|
-
const $3674b9afc9a63520$export$f522672c9379e339 = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9(async (product_id, index, more) => {
|
|
2718
|
-
if (process.env.GTAG === "false") return;
|
|
2719
|
-
if (process.env.GTAG_EVENT_CONSENT_LEVEL !== undefined && !(await $3674b9afc9a63520$var$can_send_gtag_events(product_id, index, more))) return;
|
|
2720
|
-
if (typeof $3674b9afc9a63520$var$g.gtag == "function") {
|
|
2721
|
-
const gtag_args = ["event", "select_content", {
|
|
2722
|
-
"content_type": "product",
|
|
2723
|
-
"items": [{
|
|
2724
|
-
"id": product_id,
|
|
2725
|
-
"list_name": "depict",
|
|
2726
|
-
"list_position": index + 1,
|
|
2727
|
-
...more
|
|
2728
|
-
}]
|
|
2729
|
-
}];
|
|
2730
|
-
$241f2f02cc612a49$export$de56f1198d121036("calling gtag with arguments", gtag_args);
|
|
2731
|
-
return $3674b9afc9a63520$var$g.gtag(...gtag_args);
|
|
2732
|
-
} else $241f2f02cc612a49$export$c2363754d4758444("not sending gtag tracking as there is no gtag");
|
|
2733
|
-
});
|
|
2734
|
-
const $3674b9afc9a63520$export$f75172d2e289cd02 = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9(action => {
|
|
2735
|
-
if (process.env.GA === "false") return;
|
|
2736
|
-
if (typeof $3674b9afc9a63520$var$g.ga != "function") {
|
|
2737
|
-
$241f2f02cc612a49$export$c2363754d4758444("Not sending to ga as there is no ga");
|
|
2738
|
-
return;
|
|
2739
|
-
}
|
|
2740
|
-
$241f2f02cc612a49$export$de56f1198d121036("sending", action, "to GA");
|
|
2741
|
-
return $3674b9afc9a63520$var$g.ga("depict.send", {
|
|
2742
|
-
hitType: "event",
|
|
2743
|
-
eventCategory: "Depict",
|
|
2744
|
-
eventAction: action,
|
|
2745
|
-
eventLabel: "rec-bar-tracking",
|
|
2746
|
-
nonInteraction: 1
|
|
2747
|
-
});
|
|
2748
|
-
});
|
|
2749
|
-
const $3674b9afc9a63520$export$ac7296527cb52311 = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9(GAID => {
|
|
2750
|
-
if (process.env.GA === "false") return;
|
|
2751
|
-
if (!GAID) {
|
|
2752
|
-
$241f2f02cc612a49$export$c2363754d4758444(new Error("No GAID specified"));
|
|
2753
|
-
return;
|
|
2754
|
-
}
|
|
2755
|
-
if (typeof $3674b9afc9a63520$var$g.ga != "function") {
|
|
2756
|
-
$241f2f02cc612a49$export$de56f1198d121036("Creating GA queue");
|
|
2757
|
-
$799496226e956169$export$674d8cd8b6868154();
|
|
2758
|
-
}
|
|
2759
|
-
$241f2f02cc612a49$export$de56f1198d121036("Creating ga with GA-ID", GAID);
|
|
2760
|
-
$3674b9afc9a63520$var$g.ga("create", GAID, "auto", "depict");
|
|
2761
|
-
$3674b9afc9a63520$export$f3354ec2ce95ebd9(GAID, false);
|
|
2762
|
-
});
|
|
2763
|
-
const $3674b9afc9a63520$export$127751e82111fcf = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => $3674b9afc9a63520$export$f75172d2e289cd02("rec_bar_click"));
|
|
2764
|
-
const $3674b9afc9a63520$export$bf205937e5e012cb = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => $3674b9afc9a63520$export$f75172d2e289cd02("add_to_cart_after_rec_bar_click"));
|
|
2765
|
-
async function $3674b9afc9a63520$var$can_send_gtag_events() {
|
|
2766
|
-
const required_consent_level = process.env.GTAG_LOADING_CONSENT_LEVEL;
|
|
2767
|
-
if (required_consent_level !== undefined) return true; // just in case
|
|
2768
|
-
const ipns = process.env.CONSENT_FRAMEWORK == "optanon" ? $d4217f56717a3207$export$7e4427e80d5fc619() : $be5f485da4e3f813$export$8827362e5e938d26();
|
|
2769
|
-
for (var _len = arguments.length, stuff_to_log = new Array(_len), _key = 0; _key < _len; _key++) stuff_to_log[_key] = arguments[_key];
|
|
2770
|
-
for await (const consent_obj of ipns) {
|
|
2771
|
-
const can_send = consent_obj[required_consent_level];
|
|
2772
|
-
if (!can_send) $241f2f02cc612a49$export$de56f1198d121036("Got no consent for", required_consent_level, "not sending gtag event for", ...stuff_to_log);
|
|
2773
|
-
return can_send;
|
|
2774
|
-
}
|
|
2775
|
-
}
|
|
2776
|
-
let $1013f2e568f87406$var$existing_style_tag;
|
|
2777
|
-
let $1013f2e568f87406$var$reactions_in_last_s = 0;
|
|
2778
|
-
const $1013f2e568f87406$export$59ba1eb2c083f0cd = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9(async css => {
|
|
2779
|
-
const style_tag = await ($1013f2e568f87406$var$existing_style_tag || ($1013f2e568f87406$var$existing_style_tag = (0, $90fa633a9564f115$export$b6ae1bc530f4c149).wait_for_element("head").then(head => {
|
|
2780
|
-
const tag = document.createElement("style");
|
|
2781
|
-
(0, $90fa633a9564f115$export$b6ae1bc530f4c149).onremoved(
|
|
2782
|
-
// reinsertion for next.js's "portable" <head>
|
|
2783
|
-
tag, eoe => {
|
|
2784
|
-
if (document.head.contains(tag))
|
|
2785
|
-
// just make sure to not freak out if it's already been added again
|
|
2786
|
-
return;
|
|
2787
|
-
if ($1013f2e568f87406$var$reactions_in_last_s >= 10) {
|
|
2788
|
-
$5e1f45affc1d7def$export$f18d5b0af29128b7(new Error("Someone removed our styling but insists on it (10 removals in previous second). Giving up \uD83D\uDE2B"), "error");
|
|
2789
|
-
return;
|
|
2790
|
-
}
|
|
2791
|
-
$241f2f02cc612a49$export$de56f1198d121036("Someone removed our styling \uD83D\uDE24, reinserting", eoe);
|
|
2792
|
-
$1013f2e568f87406$var$reactions_in_last_s++;
|
|
2793
|
-
setTimeout(() => $1013f2e568f87406$var$reactions_in_last_s--, 1000);
|
|
2794
|
-
document.head.append(tag); // we're sure that head exists now since we inserted it there previously
|
|
2795
|
-
});
|
|
2796
|
-
|
|
2797
|
-
$241f2f02cc612a49$export$de56f1198d121036("inserting", tag, "into", head);
|
|
2798
|
-
return head.appendChild(tag);
|
|
2799
|
-
})));
|
|
2800
|
-
style_tag.append(css);
|
|
2801
|
-
});
|
|
2802
|
-
const $1013f2e568f87406$export$a96c18473f2af463 = (tenant, selector, validator) => {
|
|
2803
|
-
return (0, $90fa633a9564f115$export$b6ae1bc530f4c149).onexists(selector, _ref => {
|
|
2804
|
-
let {
|
|
2805
|
-
element: element
|
|
2806
|
-
} = _ref;
|
|
2807
|
-
return $bd7c9f254946941d$export$2c34560c3749dc63(element, tenant.get_product_id, (p_id, r_id, was_unmatching, event) => {
|
|
2808
|
-
if (typeof validator === "function" && !validator(event)) return;
|
|
2809
|
-
if (!was_unmatching) $3674b9afc9a63520$export$bf205937e5e012cb();
|
|
2810
|
-
$d5f7352b58e0d737$export$9028351cb994757e({
|
|
2811
|
-
...tenant,
|
|
2812
|
-
product_id: p_id,
|
|
2813
|
-
...(was_unmatching ? {
|
|
2814
|
-
attribution_id: "recommendation"
|
|
2815
|
-
} : {
|
|
2816
|
-
recommendation_id: r_id
|
|
2817
|
-
})
|
|
2818
|
-
});
|
|
2819
|
-
}, true);
|
|
2820
|
-
});
|
|
2821
|
-
};
|
|
2822
|
-
const $1013f2e568f87406$export$a4f97b27a0592e6c = url => {
|
|
2823
|
-
var _pathname$split$filte;
|
|
2824
|
-
return ((_pathname$split$filte = (url ? new URL(url, window.location.origin) : window.location).pathname.split("/").filter(a => a).pop()) === null || _pathname$split$filte === void 0 ? void 0 : _pathname$split$filte.replace(/\.html?$/i, "")) || "";
|
|
2825
|
-
};
|
|
2826
|
-
const $1013f2e568f87406$export$692b606677218a16 = callback => {
|
|
2827
|
-
if (document.depictwashere) {
|
|
2828
|
-
if (process.env.BUILD_TARGET === "dev") {
|
|
2829
|
-
$241f2f02cc612a49$export$de56f1198d121036("HMR tried to rerun us, reloading page");
|
|
2830
|
-
/* eslint-disable no-self-assign */
|
|
2831
|
-
location.href = location.href;
|
|
2832
|
-
}
|
|
2833
|
-
$241f2f02cc612a49$export$de56f1198d121036("Script has already ran", document.currentScript, "is exiting");
|
|
2834
|
-
return;
|
|
2835
|
-
}
|
|
2836
|
-
if (process.env.BUILD_TARGET === "dev") /* eslint-disable no-console */console.clear = new Proxy(console.clear, {
|
|
2837
|
-
apply(target, this_arg, arg_list) {
|
|
2838
|
-
var _Error$stack;
|
|
2839
|
-
if ((_Error$stack = new Error().stack) !== null && _Error$stack !== void 0 && _Error$stack.split("\n").filter(Boolean).some(s => s.includes("http://localhost:1234/depict-ai.js"))) {
|
|
2840
|
-
/* eslint-disable no-console */console.log("CSS change detected through hack, reloading");
|
|
2841
|
-
location.reload();
|
|
2842
|
-
}
|
|
2843
|
-
return target.apply(this_arg, arg_list);
|
|
2844
|
-
}
|
|
2845
|
-
});
|
|
2846
|
-
document.depictwashere = true;
|
|
2847
|
-
callback().catch((0, $b000f5ef6ce456d9$export$8048b892d651b310));
|
|
2848
|
-
};
|
|
2849
|
-
function $1013f2e568f87406$export$328e81c44cddf3c0(callback, get_market, supported_markets, unsupported_markets, preferred_demo_market) {
|
|
2850
|
-
$1013f2e568f87406$export$692b606677218a16(async () => {
|
|
2851
|
-
// Handle override for debug scripts (could be used on demo pages too)
|
|
2852
|
-
if (process.env.DEBUG === "true") {
|
|
2853
|
-
let localstorage_override;
|
|
2854
|
-
const query_param_override = new URLSearchParams(location.search).get("depict-override-market");
|
|
2855
|
-
if (query_param_override !== null) {
|
|
2856
|
-
$241f2f02cc612a49$export$de56f1198d121036("Found ?depict-override-market=".concat(query_param_override, ". Using that as the market"));
|
|
2857
|
-
get_market = () => query_param_override;
|
|
2858
|
-
localStorage.setItem("depict-override-market", query_param_override);
|
|
2859
|
-
} else if ((localstorage_override = localStorage.getItem("depict-override-market")) !== null) {
|
|
2860
|
-
$241f2f02cc612a49$export$de56f1198d121036('Found depict-override-market="'.concat(localstorage_override, '" in localStorage. Using that as the market'));
|
|
2861
|
-
get_market = () => localstorage_override;
|
|
2862
|
-
}
|
|
2863
|
-
}
|
|
2864
|
-
const market = await get_market();
|
|
2865
|
-
if (supported_markets.includes(market)) {
|
|
2866
|
-
$241f2f02cc612a49$export$de56f1198d121036("Initializing with market: ".concat(market));
|
|
2867
|
-
return callback(market).catch((0, $b000f5ef6ce456d9$export$8048b892d651b310));
|
|
2868
|
-
} else if (unsupported_markets.includes(market)) {
|
|
2869
|
-
$241f2f02cc612a49$export$de56f1198d121036("Unsupported market: ".concat(market, ". Exiting..."));
|
|
2870
|
-
return;
|
|
2871
|
-
} else if (process.env.DEBUG === "true" && location.host.endsWith(".demo.depict.ai") && preferred_demo_market) {
|
|
2872
|
-
$241f2f02cc612a49$export$de56f1198d121036("On demosite with default market override. Setting market to ".concat(preferred_demo_market));
|
|
2873
|
-
return callback(preferred_demo_market).catch((0, $b000f5ef6ce456d9$export$8048b892d651b310));
|
|
2874
|
-
} else {
|
|
2875
|
-
$b000f5ef6ce456d9$export$8048b892d651b310(new Error('Unknown market: "'.concat(market, '". Exiting...')));
|
|
2876
|
-
return;
|
|
2877
|
-
}
|
|
2878
|
-
});
|
|
2879
|
-
}
|
|
2880
|
-
class $095a7d035ba7d7a7$export$8d42ce4827f43582 {
|
|
2881
|
-
constructor(options) {
|
|
2882
|
-
var _options$GA_ID, _options$pageview_tra;
|
|
2883
|
-
this.dataset = {
|
|
2884
|
-
...((options.current_script_override || document.currentScript || {}).dataset || {})
|
|
2885
|
-
};
|
|
2886
|
-
this.modify = this.dataset.modify === "true";
|
|
2887
|
-
this.is_debug = (0, $a5a2bdb4ae93374b$export$55fe61489d2c7417);
|
|
2888
|
-
this.dlog = (0, $241f2f02cc612a49$export$de56f1198d121036);
|
|
2889
|
-
this.TENANT = options.TENANT || process.env.TENANT || "sandbox";
|
|
2890
|
-
this.MARKET = options.MARKET;
|
|
2891
|
-
this.Sentry = (0, $17bb552dedcd526c$export$af2e17a20c2ea3c5);
|
|
2892
|
-
this.GA_ID = (_options$GA_ID = options.GA_ID) !== null && _options$GA_ID !== void 0 ? _options$GA_ID : "";
|
|
2893
|
-
this.TYPE = options.TYPE || "normal";
|
|
2894
|
-
this.catchify = (0, $5e1f45affc1d7def$export$b3bbfd758f11cfa9);
|
|
2895
|
-
this.err = (0, $b000f5ef6ce456d9$export$8048b892d651b310);
|
|
2896
|
-
if (this.GA_ID) $3674b9afc9a63520$export$ac7296527cb52311(this.GA_ID);
|
|
2897
|
-
// https://gitlab.com/depict-ai/depict.ai/-/merge_requests/2318#note_927887712
|
|
2898
|
-
this.get_product_id = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(function () {
|
|
2899
|
-
const id = options.get_product_id(...arguments);
|
|
2900
|
-
if (id instanceof Promise) return id.then(id => id || "");
|
|
2901
|
-
return id || "";
|
|
2902
|
-
});
|
|
2903
|
-
this.product_id = this.get_product_id; // template tool compatible alias
|
|
2904
|
-
this.tenant = this.TENANT;
|
|
2905
|
-
this.market = this.MARKET;
|
|
2906
|
-
this.gaid = this.GA_ID; // template tool compatible alias
|
|
2907
|
-
this.type = this.TYPE;
|
|
2908
|
-
this.catchify = (0, $5e1f45affc1d7def$export$b3bbfd758f11cfa9);
|
|
2909
|
-
this.err = (0, $b000f5ef6ce456d9$export$8048b892d651b310);
|
|
2910
|
-
if (localStorage.getItem("highlight-depict") === "true") $1013f2e568f87406$export$59ba1eb2c083f0cd(".depict { background: #f00a !important; }");
|
|
2911
|
-
if ((_options$pageview_tra = options.pageview_tracking) !== null && _options$pageview_tra !== void 0 ? _options$pageview_tra : true) (async () => {
|
|
2912
|
-
$0897f35c3b3fbbc4$export$f7cb1bd47199ec38({
|
|
2913
|
-
market: this.market,
|
|
2914
|
-
tenant: this.tenant,
|
|
2915
|
-
get_product_id: this.get_product_id
|
|
2916
|
-
});
|
|
2917
|
-
})();
|
|
2918
|
-
}
|
|
2919
|
-
} /**
|
|
2920
|
-
* This is a list of alpha-2 country codes plus some two letter combinations commonly used to describe markets
|
|
2921
|
-
*/ // albania
|
|
2922
|
-
|
|
2923
|
-
const $f2fce07b3a330e05$var$default_get_rec_id = elem => {
|
|
2924
|
-
var _elem$dataset, _elem$dataset2;
|
|
2925
|
-
return (elem === null || elem === void 0 ? void 0 : (_elem$dataset = elem.dataset) === null || _elem$dataset === void 0 ? void 0 : _elem$dataset.depict_recommendation_id) || (elem === null || elem === void 0 ? void 0 : (_elem$dataset2 = elem.dataset) === null || _elem$dataset2 === void 0 ? void 0 : _elem$dataset2.recommendationId);
|
|
2926
|
-
};
|
|
2927
|
-
const $f2fce07b3a330e05$var$default_get_prod_id = elem => {
|
|
2928
|
-
var _elem$dataset3, _elem$dataset4;
|
|
2929
|
-
return (elem === null || elem === void 0 ? void 0 : (_elem$dataset3 = elem.dataset) === null || _elem$dataset3 === void 0 ? void 0 : _elem$dataset3.depict_product_id) || (elem === null || elem === void 0 ? void 0 : (_elem$dataset4 = elem.dataset) === null || _elem$dataset4 === void 0 ? void 0 : _elem$dataset4.productId);
|
|
2930
|
-
};
|
|
2931
|
-
const $f2fce07b3a330e05$var$default_get_ga_prod_id = elem => {
|
|
2932
|
-
var _elem$dataset5;
|
|
2933
|
-
return elem === null || elem === void 0 ? void 0 : (_elem$dataset5 = elem.dataset) === null || _elem$dataset5 === void 0 ? void 0 : _elem$dataset5.ga_ids;
|
|
2934
|
-
};
|
|
2935
|
-
const $f2fce07b3a330e05$var$get_index_in_children_of_el = el => {
|
|
2936
|
-
var _el$parentElement;
|
|
2937
|
-
return [...((el === null || el === void 0 ? void 0 : (_el$parentElement = el.parentElement) === null || _el$parentElement === void 0 ? void 0 : _el$parentElement.children) || [])].indexOf(el);
|
|
2938
|
-
};
|
|
2939
|
-
const $f2fce07b3a330e05$export$29a6094e0bd8bc5f = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9(async (options, gtag_options) => {
|
|
2940
|
-
var _options$t;
|
|
2941
|
-
const {
|
|
2942
|
-
product_selector: product_selector,
|
|
2943
|
-
a2c_selector: a2c_selector,
|
|
2944
|
-
rec_a2c_selector: rec_a2c_selector,
|
|
2945
|
-
rec_a2c_unbubbled: rec_a2c_unbubbled,
|
|
2946
|
-
get_product_id = (_options$t = options.t) === null || _options$t === void 0 ? void 0 : _options$t.get_product_id,
|
|
2947
|
-
get_rec_id = $f2fce07b3a330e05$var$default_get_rec_id,
|
|
2948
|
-
get_prod_id = $f2fce07b3a330e05$var$default_get_prod_id,
|
|
2949
|
-
get_ga_prod_id = $f2fce07b3a330e05$var$default_get_ga_prod_id,
|
|
2950
|
-
get_display: get_display,
|
|
2951
|
-
impression_tracking: impression_tracking,
|
|
2952
|
-
a2c_elements: a2c_elements,
|
|
2953
|
-
product_elements: product_elements,
|
|
2954
|
-
t: t,
|
|
2955
|
-
click_location_prefix = elem => {
|
|
2956
|
-
var _elem$parentElement, _elem$parentElement$d;
|
|
2957
|
-
return (elem === null || elem === void 0 ? void 0 : (_elem$parentElement = elem.parentElement) === null || _elem$parentElement === void 0 ? void 0 : (_elem$parentElement$d = _elem$parentElement.dataset) === null || _elem$parentElement$d === void 0 ? void 0 : _elem$parentElement$d.type) + "_";
|
|
2958
|
-
}
|
|
2959
|
-
} = options;
|
|
2960
|
-
const get_display_data = async elem => {
|
|
2961
|
-
var _elem$querySelector;
|
|
2962
|
-
const data = {};
|
|
2963
|
-
if (get_prod_id) data.product_id = (await get_prod_id(elem)) || (get_product_id ? await get_product_id(((_elem$querySelector = elem.querySelector("a")) === null || _elem$querySelector === void 0 ? void 0 : _elem$querySelector.href) || (elem === null || elem === void 0 ? void 0 : elem.href)) : undefined);
|
|
2964
|
-
if (get_ga_prod_id) data.ga_product_id = await get_ga_prod_id(elem);
|
|
2965
|
-
if (get_rec_id) data.recommendation_id = get_rec_id(elem);
|
|
2966
|
-
if (get_display) Object.assign(data, get_display(elem));
|
|
2967
|
-
return data;
|
|
2968
|
-
};
|
|
2969
|
-
const impression_tracked_els = new WeakSet();
|
|
2970
|
-
const view_tracked_els = new WeakSet();
|
|
2971
|
-
const a2c_tracked_els = new WeakSet();
|
|
2972
|
-
const click_tracked_els = new WeakSet();
|
|
2973
|
-
const gtag_view_product_ids = {};
|
|
2974
|
-
// Page view
|
|
2975
|
-
if (t instanceof (0, $095a7d035ba7d7a7$export$8d42ce4827f43582)) (async () => {
|
|
2976
|
-
$0897f35c3b3fbbc4$export$eee4c4d924348b05({
|
|
2977
|
-
tenant: t.tenant,
|
|
2978
|
-
market: t.market,
|
|
2979
|
-
product_id: await t.get_product_id()
|
|
2980
|
-
});
|
|
2981
|
-
})();
|
|
2982
|
-
// Product card
|
|
2983
|
-
const add_tracking_to_product_card = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(async _ref => {
|
|
2984
|
-
var _Object$keys;
|
|
2985
|
-
let {
|
|
2986
|
-
element: elem
|
|
2987
|
-
} = _ref;
|
|
2988
|
-
const index = $f2fce07b3a330e05$var$get_index_in_children_of_el(elem);
|
|
2989
|
-
const data = await get_display_data(elem);
|
|
2990
|
-
const prefix = typeof click_location_prefix === "function" && click_location_prefix(elem) || "depict_";
|
|
2991
|
-
const gtag_list_name = "depict_" + (prefix[prefix.length - 1] == "_" ? prefix.substr(0, prefix.length - 1) : prefix);
|
|
2992
|
-
// Impression tracking
|
|
2993
|
-
if (impression_tracking && !impression_tracked_els.has(elem)) {
|
|
2994
|
-
impression_tracked_els.add(elem);
|
|
2995
|
-
$e89a1d249db21af0$export$37125ccc5dd98050({
|
|
2996
|
-
element: elem,
|
|
2997
|
-
data: {
|
|
2998
|
-
recommendation_id: data.recommendation_id,
|
|
2999
|
-
product_id: data.product_id,
|
|
3000
|
-
tenant: t.tenant,
|
|
3001
|
-
recommendation_type: prefix.slice(-1) === "_" ? prefix.slice(0, -1) : prefix,
|
|
3002
|
-
entity_price: data.entity_price,
|
|
3003
|
-
market: t.market
|
|
3004
|
-
},
|
|
3005
|
-
wait_for_dom_insertion: false
|
|
3006
|
-
});
|
|
3007
|
-
}
|
|
3008
|
-
// Gtag view tracking
|
|
3009
|
-
if (data.product_id && options.attempt_gtag_view_tracking && !view_tracked_els.has(elem)) {
|
|
3010
|
-
view_tracked_els.add(elem);
|
|
3011
|
-
const gtag_view_product_ids_for_product = gtag_view_product_ids[gtag_list_name] || (gtag_view_product_ids[gtag_list_name] = []);
|
|
3012
|
-
gtag_view_product_ids_for_product.push({
|
|
3013
|
-
product_id: data.ga_product_id || data.product_id,
|
|
3014
|
-
index: index
|
|
3015
|
-
});
|
|
3016
|
-
if (data.ga_product_ids) gtag_view_product_ids_for_product.push(...data.ga_product_ids.map(product_id => ({
|
|
3017
|
-
product_id: product_id,
|
|
3018
|
-
index: index
|
|
3019
|
-
})));
|
|
3020
|
-
try {
|
|
3021
|
-
var _elem$dataset6;
|
|
3022
|
-
const ga_ids = elem === null || elem === void 0 ? void 0 : (_elem$dataset6 = elem.dataset) === null || _elem$dataset6 === void 0 ? void 0 : _elem$dataset6.ga_ids;
|
|
3023
|
-
if (ga_ids) gtag_view_product_ids_for_product.push(...ga_ids.split(",").map(id => ({
|
|
3024
|
-
product_id: id,
|
|
3025
|
-
index: index
|
|
3026
|
-
})));
|
|
3027
|
-
} catch (e) {
|
|
3028
|
-
$241f2f02cc612a49$export$c2363754d4758444("Something went wrong on a product with multiple ga_ids", e);
|
|
3029
|
-
}
|
|
3030
|
-
}
|
|
3031
|
-
if (typeof BroadcastChannel == "function") {
|
|
3032
|
-
// right click and mouse wheel click tracking
|
|
3033
|
-
const handler = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(e => $df87ac5a30f7baac$export$8f66c4c7fb96eda2(e, data.product_id));
|
|
3034
|
-
elem.addEventListener("contextmenu", handler);
|
|
3035
|
-
elem.addEventListener("auxclick", e => e.button === 1 && handler(e)); // actual wheel click - some mouses / OS:es also dispatch auxclick on rightclick
|
|
3036
|
-
}
|
|
3037
|
-
|
|
3038
|
-
click_tracking: {
|
|
3039
|
-
if (click_tracked_els.has(elem)) break click_tracking;
|
|
3040
|
-
click_tracked_els.add(elem);
|
|
3041
|
-
elem.addEventListener("click", $5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => {
|
|
3042
|
-
const product_id = data.product_id || "DNT";
|
|
3043
|
-
const recommendation_id = data.recommendation_id || "not_depict";
|
|
3044
|
-
localStorage.setItem("depict_attribution_".concat(product_id), recommendation_id);
|
|
3045
|
-
const index = $f2fce07b3a330e05$var$get_index_in_children_of_el(elem);
|
|
3046
|
-
const click_location = prefix + (index + 1);
|
|
3047
|
-
$3674b9afc9a63520$export$127751e82111fcf();
|
|
3048
|
-
$d5f7352b58e0d737$export$15f8a0cd5a8c0ebb({
|
|
3049
|
-
...(options.t || {}),
|
|
3050
|
-
...options,
|
|
3051
|
-
...data,
|
|
3052
|
-
...(data.recommendation_id ? {} : {
|
|
3053
|
-
attribution_id: "recommendation"
|
|
3054
|
-
}),
|
|
3055
|
-
click_location: click_location
|
|
3056
|
-
});
|
|
3057
|
-
if (!options.no_gtag) {
|
|
3058
|
-
const gtag_options_with_click_location = {
|
|
3059
|
-
list_name: gtag_list_name,
|
|
3060
|
-
...gtag_options
|
|
3061
|
-
};
|
|
3062
|
-
$3674b9afc9a63520$export$f522672c9379e339(data.product_id, index, gtag_options_with_click_location);
|
|
3063
|
-
try {
|
|
3064
|
-
const to_iterate = [];
|
|
3065
|
-
if (data.ga_product_id) {
|
|
3066
|
-
var _data$ga_product_id$t, _data$ga_product_id$t2, _data$ga_product_id;
|
|
3067
|
-
to_iterate.push(...((_data$ga_product_id$t = (_data$ga_product_id$t2 = (_data$ga_product_id = data.ga_product_id).toString) === null || _data$ga_product_id$t2 === void 0 ? void 0 : _data$ga_product_id$t2.call(_data$ga_product_id).split(",")) !== null && _data$ga_product_id$t !== void 0 ? _data$ga_product_id$t : []));
|
|
3068
|
-
}
|
|
3069
|
-
to_iterate.push(...(data.ga_product_ids || []));
|
|
3070
|
-
to_iterate.forEach(id => $3674b9afc9a63520$export$f522672c9379e339(id, index, gtag_options_with_click_location));
|
|
3071
|
-
} catch (e) {
|
|
3072
|
-
$241f2f02cc612a49$export$c2363754d4758444("Something went wrong when sending gtag click tracking on a product with multiple ga_ids");
|
|
3073
|
-
$5e1f45affc1d7def$export$f18d5b0af29128b7(e, "error");
|
|
3074
|
-
}
|
|
3075
|
-
}
|
|
3076
|
-
}), {
|
|
3077
|
-
once: true
|
|
3078
|
-
});
|
|
3079
|
-
}
|
|
3080
|
-
// Product card A2C button tracking
|
|
3081
|
-
if (rec_a2c_selector && !a2c_tracked_els.has(elem)) {
|
|
3082
|
-
const track_rec_a2c = async element => {
|
|
3083
|
-
const rec_a2c_button = element.querySelector(rec_a2c_selector);
|
|
3084
|
-
if (!rec_a2c_button) return;
|
|
3085
|
-
const data = await get_display_data(element);
|
|
3086
|
-
rec_a2c_button.addEventListener("click", () => {
|
|
3087
|
-
if (rec_a2c_unbubbled) {
|
|
3088
|
-
// If their script cancels the event before it reaches the rec card,
|
|
3089
|
-
// we will only attribute an a2c but not a click. This is inconsistent with what we usually do.
|
|
3090
|
-
// Create a fake click event on the main rec card,
|
|
3091
|
-
// so our click_tracking above can send tracking for a click as well.
|
|
3092
|
-
const click = new MouseEvent("click", {
|
|
3093
|
-
view: window,
|
|
3094
|
-
bubbles: true,
|
|
3095
|
-
cancelable: true,
|
|
3096
|
-
metaKey: true
|
|
3097
|
-
});
|
|
3098
|
-
element.addEventListener("click", e => (e.preventDefault(), false), {
|
|
3099
|
-
once: true
|
|
3100
|
-
});
|
|
3101
|
-
element.dispatchEvent(click);
|
|
3102
|
-
}
|
|
3103
|
-
$3674b9afc9a63520$export$bf205937e5e012cb();
|
|
3104
|
-
$d5f7352b58e0d737$export$9028351cb994757e({
|
|
3105
|
-
...(options.t || {}),
|
|
3106
|
-
...options,
|
|
3107
|
-
...data
|
|
3108
|
-
});
|
|
3109
|
-
});
|
|
3110
|
-
a2c_tracked_els.add(elem);
|
|
3111
|
-
};
|
|
3112
|
-
track_rec_a2c(elem);
|
|
3113
|
-
}
|
|
3114
|
-
if (options.shade) $f2fce07b3a330e05$export$6ebd242c09192cec(elem);
|
|
3115
|
-
if (options.attempt_gtag_view_tracking && (_Object$keys = Object.keys(gtag_view_product_ids)) !== null && _Object$keys !== void 0 && _Object$keys.length)
|
|
3116
|
-
// setTimeout to batch the requests / put it all into one gtag view event
|
|
3117
|
-
setTimeout($5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => {
|
|
3118
|
-
for (const key in gtag_view_product_ids) {
|
|
3119
|
-
const product_ids = gtag_view_product_ids[key];
|
|
3120
|
-
if (product_ids !== null && product_ids !== void 0 && product_ids.length) {
|
|
3121
|
-
$3674b9afc9a63520$export$7babcd5d4056b2ca(product_ids, () => "", {
|
|
3122
|
-
list_name: key,
|
|
3123
|
-
...gtag_options
|
|
3124
|
-
});
|
|
3125
|
-
delete gtag_view_product_ids[key];
|
|
3126
|
-
}
|
|
3127
|
-
}
|
|
3128
|
-
}));
|
|
3129
|
-
});
|
|
3130
|
-
if (typeof product_selector == "string") (0, $90fa633a9564f115$export$b6ae1bc530f4c149).onexists(product_selector, add_tracking_to_product_card);else if (product_elements && typeof (product_elements === null || product_elements === void 0 ? void 0 : product_elements[Symbol.iterator]) == "function") for (const element of product_elements) add_tracking_to_product_card({
|
|
3131
|
-
element: element
|
|
3132
|
-
});else $241f2f02cc612a49$export$c2363754d4758444(new Error("AIO can't find elements, try adding a selector or els")); // don't throw so that a2c tracking keeps working
|
|
3133
|
-
// Page A2C button tracking
|
|
3134
|
-
const a2c_handler = _ref2 => {
|
|
3135
|
-
let {
|
|
3136
|
-
element: element
|
|
3137
|
-
} = _ref2;
|
|
3138
|
-
$bd7c9f254946941d$export$2c34560c3749dc63(element, get_product_id, (product_id, recommendation_id, was_unmatching) => {
|
|
3139
|
-
if (!was_unmatching) $3674b9afc9a63520$export$bf205937e5e012cb();
|
|
3140
|
-
$d5f7352b58e0d737$export$9028351cb994757e({
|
|
3141
|
-
...(options.t || {}),
|
|
3142
|
-
...options,
|
|
3143
|
-
product_id: product_id,
|
|
3144
|
-
...(recommendation_id == "not_depict" || was_unmatching ? {
|
|
3145
|
-
attribution_id: "recommendation"
|
|
3146
|
-
} : {
|
|
3147
|
-
recommendation_id: recommendation_id
|
|
3148
|
-
})
|
|
3149
|
-
});
|
|
3150
|
-
}, options.always_track_a2c);
|
|
3151
|
-
if (options.shade) $f2fce07b3a330e05$export$6ebd242c09192cec(element);
|
|
3152
|
-
};
|
|
3153
|
-
if (typeof a2c_selector == "string") (0, $90fa633a9564f115$export$b6ae1bc530f4c149).onexists(a2c_selector, a2c_handler);else if (a2c_elements && typeof (a2c_elements === null || a2c_elements === void 0 ? void 0 : a2c_elements[Symbol.iterator]) == "function") for (const element of a2c_elements) a2c_handler({
|
|
3154
|
-
element: element
|
|
3155
|
-
});else $241f2f02cc612a49$export$c2363754d4758444(new Error("Can't find a2c button, try adding a selector or els"));
|
|
3156
|
-
return {
|
|
3157
|
-
add_a2c_element: element => a2c_handler({
|
|
3158
|
-
element: element
|
|
3159
|
-
}),
|
|
3160
|
-
add_product_element: element => add_tracking_to_product_card({
|
|
3161
|
-
element: element
|
|
3162
|
-
})
|
|
3163
|
-
};
|
|
3164
|
-
});
|
|
3165
|
-
const $f2fce07b3a330e05$export$6ebd242c09192cec = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9(element => {
|
|
3166
|
-
element.style.boxShadow = "rgba(255,0,0,0.5) 10px 10px 30px 40px";
|
|
3167
|
-
element.style.background = "rgba(255,0,0,0.5)";
|
|
3168
|
-
element.style.color = "white";
|
|
3169
|
-
});
|
|
3170
|
-
|
|
3171
|
-
// not ideal but can help when debugging via sentry
|
|
3172
|
-
/**
|
|
3173
|
-
* A function that attempts to "serialize" an object to a text representation that helps with debugging when using sentry
|
|
3174
|
-
* @param anything Something to try to serialize - this function is crappy and your mileage may vary
|
|
3175
|
-
* @param depth How deep to go when recursing
|
|
3176
|
-
* @return An object that is somehow closer to text (better serializable by sentry) or text
|
|
3177
|
-
*/
|
|
3178
|
-
function $d9aec442b12a1134$export$39d526a1194b6499(anything, depth) {
|
|
3179
|
-
var _depth;
|
|
3180
|
-
(_depth = depth) !== null && _depth !== void 0 ? _depth : depth = 0;
|
|
3181
|
-
depth++;
|
|
3182
|
-
if (depth > 30) return anything;
|
|
3183
|
-
const output = {};
|
|
3184
|
-
for (const key in anything) {
|
|
3185
|
-
const value = anything[key];
|
|
3186
|
-
let serialized_value;
|
|
3187
|
-
if (value instanceof Element) serialized_value = value.cloneNode(false).outerHTML;else if (value instanceof Headers) serialized_value = Object.fromEntries(value.entries());else if (typeof value == "object" && value != null && (typeof value[Symbol.iterator] === "function" || value instanceof Response)) serialized_value = $d9aec442b12a1134$export$39d526a1194b6499(value, depth);else {
|
|
3188
|
-
var _value$toString;
|
|
3189
|
-
serialized_value = value === null || value === void 0 ? void 0 : (_value$toString = value.toString) === null || _value$toString === void 0 ? void 0 : _value$toString.call(value);
|
|
3190
|
-
}
|
|
3191
|
-
output[key] = serialized_value;
|
|
3192
|
-
}
|
|
3193
|
-
return output;
|
|
3194
|
-
}
|
|
3195
|
-
const $57642e3bf93ac1e7$export$5c069c93d2b7493f = delay => new Promise(resolve => setTimeout(resolve, delay));
|
|
3196
|
-
async function $c95f8181bad32e8d$export$bcd70d5ed1cf6313(url, options) {
|
|
3197
|
-
let max_retries = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10;
|
|
3198
|
-
let useFetch = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : fetch;
|
|
3199
|
-
const ONE_MINUTE = 60000;
|
|
3200
|
-
const max_backoff_ms = ONE_MINUTE;
|
|
3201
|
-
const {
|
|
3202
|
-
stack: stack
|
|
3203
|
-
} = new Error();
|
|
3204
|
-
const calculate_retry = delay => {
|
|
3205
|
-
delay *= 2 + Math.random();
|
|
3206
|
-
if (delay > max_backoff_ms) delay = max_backoff_ms * (1 + Math.random() / 10);
|
|
3207
|
-
return delay;
|
|
3208
|
-
};
|
|
3209
|
-
let try_again_in_ms = 100;
|
|
3210
|
-
let has_succeeded = false;
|
|
3211
|
-
let result = false;
|
|
3212
|
-
while (max_retries && !has_succeeded) try {
|
|
3213
|
-
const response = await useFetch(url, options);
|
|
3214
|
-
const {
|
|
3215
|
-
status: status,
|
|
3216
|
-
ok: ok
|
|
3217
|
-
} = response;
|
|
3218
|
-
if (!response || !ok || status !== 200) {
|
|
3219
|
-
if (status >= 400 && status < 500) {
|
|
3220
|
-
$5e1f45affc1d7def$export$b3bbfd758f11cfa9($c95f8181bad32e8d$var$send_sentry_4xx)(response, (options === null || options === void 0 ? void 0 : options.body) || {}, stack);
|
|
3221
|
-
has_succeeded = true;
|
|
3222
|
-
} else if (status === 404) has_succeeded = true;
|
|
3223
|
-
$241f2f02cc612a49$export$de56f1198d121036("Response not ok", response);
|
|
3224
|
-
} else has_succeeded = true;
|
|
3225
|
-
result = response;
|
|
3226
|
-
} catch (error) {
|
|
3227
|
-
$241f2f02cc612a49$export$de56f1198d121036("Error while fetching: ", error, url, options);
|
|
3228
|
-
// Don't retry CORS
|
|
3229
|
-
if (error.message.includes("CORS") && error.name.includes("CORS")) has_succeeded = true;
|
|
3230
|
-
} finally {
|
|
3231
|
-
if (!has_succeeded) await $57642e3bf93ac1e7$export$5c069c93d2b7493f(try_again_in_ms);
|
|
3232
|
-
try_again_in_ms = calculate_retry(try_again_in_ms);
|
|
3233
|
-
max_retries -= 1;
|
|
3234
|
-
}
|
|
3235
|
-
return result;
|
|
3236
|
-
}
|
|
3237
|
-
async function $c95f8181bad32e8d$var$send_sentry_4xx(response, body, stack) {
|
|
3238
|
-
if (process.env.TENANT === "shopify-config" && response.status === 403)
|
|
3239
|
-
// Don't send requests in the shopify admin that say we need to re-authorize to sentry
|
|
3240
|
-
return;
|
|
3241
|
-
const msg = "Validation error: got 4XX from API";
|
|
3242
|
-
const text = await response.clone().text();
|
|
3243
|
-
$241f2f02cc612a49$export$de56f1198d121036(msg, "body", body, "response", response, "text", text, "stack", stack);
|
|
3244
|
-
(0, $17bb552dedcd526c$export$af2e17a20c2ea3c5).withScope(function (scope) {
|
|
3245
|
-
scope.setExtra("stack", stack);
|
|
3246
|
-
scope.setExtra("request_body", body);
|
|
3247
|
-
scope.setExtra("response", response);
|
|
3248
|
-
scope.setExtra("serialized_response", $d9aec442b12a1134$export$39d526a1194b6499(response));
|
|
3249
|
-
scope.setExtra("response_text", text);
|
|
3250
|
-
scope.setLevel("error");
|
|
3251
|
-
this.captureException(new Error(msg));
|
|
3252
|
-
});
|
|
3253
|
-
}
|
|
3254
|
-
async function $51dfcecbe05cc4e5$export$1bc0df10745d5412(t, options, headers) {
|
|
3255
|
-
let get_url = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : $51dfcecbe05cc4e5$var$default_get_fetch_url;
|
|
3256
|
-
const res = await $51dfcecbe05cc4e5$export$d40679eb4cf32f09(t, options, headers, get_url);
|
|
3257
|
-
return (res === null || res === void 0 ? void 0 : res.displays) || [];
|
|
3258
|
-
}
|
|
3259
|
-
async function $51dfcecbe05cc4e5$export$d40679eb4cf32f09(t, options, headers) {
|
|
3260
|
-
let get_url = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : $51dfcecbe05cc4e5$var$default_get_fetch_url;
|
|
3261
|
-
const session_id = options.session_id || $d5f7352b58e0d737$export$61e7e1f11e96692f();
|
|
3262
|
-
const body = {
|
|
3263
|
-
tenant: t.tenant,
|
|
3264
|
-
market: t.market,
|
|
3265
|
-
session_id: session_id,
|
|
3266
|
-
document_referrer: document.referrer,
|
|
3267
|
-
...options
|
|
3268
|
-
};
|
|
3269
|
-
const endpoint = $51dfcecbe05cc4e5$var$get_fetch_endpoint_from_options(options);
|
|
3270
|
-
return await $c95f8181bad32e8d$export$bcd70d5ed1cf6313(get_url(endpoint), {
|
|
3271
|
-
body: JSON.stringify(body),
|
|
3272
|
-
...(headers ? {
|
|
3273
|
-
headers: headers
|
|
3274
|
-
} : {}),
|
|
3275
|
-
method: "POST"
|
|
3276
|
-
}) // @ts-ignore
|
|
3277
|
-
.then(r => r.json()).catch(e => $241f2f02cc612a49$export$de56f1198d121036("fetch_retry threw", e));
|
|
3278
|
-
}
|
|
3279
|
-
function $51dfcecbe05cc4e5$var$default_get_fetch_url(type) {
|
|
3280
|
-
return $ea5707b8e7b350cf$export$fe609f0216e4ebef("".concat((0, $9e4bee2e3b4b5753$export$362abebb4b313340), "/v2/recommend/products/").concat(type));
|
|
3281
|
-
}
|
|
3282
|
-
function $51dfcecbe05cc4e5$var$get_fetch_endpoint_from_options(options) {
|
|
3283
|
-
if (options["category_id"] !== undefined) return "category";else if (options["product_id"] !== undefined) return "product";else if (options["product_ids"] !== undefined) return "products";
|
|
3284
|
-
return "general";
|
|
3285
|
-
}
|
|
3286
|
-
async function $378c98788ab52b9c$export$a9fc160c5ed83bd7(t, rendering_options) {
|
|
3287
|
-
// clone options to prevent nasty bugs where changes of options change the options somewhere else too
|
|
3288
|
-
rendering_options = $378c98788ab52b9c$export$c42139a43c877ecd(rendering_options);
|
|
3289
|
-
const {
|
|
3290
|
-
type: type
|
|
3291
|
-
} = rendering_options;
|
|
3292
|
-
const displays = await $378c98788ab52b9c$var$make_sure_we_have_displays(t, rendering_options);
|
|
3293
|
-
if (!(displays !== null && displays !== void 0 && displays.length)) {
|
|
3294
|
-
$241f2f02cc612a49$export$de56f1198d121036("RR: Got no displays for type " + type + ", can't recover.", t, rendering_options);
|
|
3295
|
-
return {};
|
|
3296
|
-
}
|
|
3297
|
-
// return if too few displays
|
|
3298
|
-
const {
|
|
3299
|
-
min_items_to_run: min_items_to_run
|
|
3300
|
-
} = rendering_options;
|
|
3301
|
-
const good_displays = await $378c98788ab52b9c$var$check_displays(displays, min_items_to_run).catch((0, $b000f5ef6ce456d9$export$8048b892d651b310));
|
|
3302
|
-
if (!good_displays) return {};
|
|
3303
|
-
const processed_displays = await $378c98788ab52b9c$export$c22e610107c5a15a(t, rendering_options, displays);
|
|
3304
|
-
if (!processed_displays.length) {
|
|
3305
|
-
$241f2f02cc612a49$export$de56f1198d121036("RR: No displays left after preprocessing");
|
|
3306
|
-
return {};
|
|
3307
|
-
}
|
|
3308
|
-
const {
|
|
3309
|
-
template: template,
|
|
3310
|
-
post_processors = []
|
|
3311
|
-
} = rendering_options;
|
|
3312
|
-
const caught_post_processing_functions = post_processors.map(post_pro => $5e1f45affc1d7def$export$b3bbfd758f11cfa9(post_pro));
|
|
3313
|
-
let a;
|
|
3314
|
-
const caught_html2elems = $5e1f45affc1d7def$export$b3bbfd758f11cfa9((0, $652300c6621d5500$export$44951404cb8d0583));
|
|
3315
|
-
let output_elements;
|
|
3316
|
-
if (typeof template === "function") {
|
|
3317
|
-
const caught_template = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(template);
|
|
3318
|
-
output_elements = (await Promise.allSettled(processed_displays.map(async (display, index) => {
|
|
3319
|
-
const event_listeners = [];
|
|
3320
|
-
let keep = true;
|
|
3321
|
-
const info = new $378c98788ab52b9c$export$da854280fb61cd32(t, rendering_options, displays, index, () => keep = false, event_listeners);
|
|
3322
|
-
const template_result = await caught_template(display, info);
|
|
3323
|
-
if (!keep) throw keep;
|
|
3324
|
-
const elements = (typeof template_result == "string" ? caught_html2elems(template_result) : template_result) || [];
|
|
3325
|
-
const post_processed_elements = await $378c98788ab52b9c$export$cf7cbc6b76039101(t, rendering_options, processed_displays, index, caught_post_processing_functions, elements, event_listeners);
|
|
3326
|
-
return Array.from(post_processed_elements);
|
|
3327
|
-
}))).filter(p => p.status === "fulfilled").map(p => p.value).flat();
|
|
3328
|
-
// I don't want to use anything using spread since spread is a nice form of apply and
|
|
3329
|
-
// there's a - browser engine dependant - limit of arguments that can be applied to a function
|
|
3330
|
-
// we don't know how this will be used and want it to be robust
|
|
3331
|
-
} else output_elements = (await Promise.all(processed_displays.map(async (display, index) => {
|
|
3332
|
-
const html = $378c98788ab52b9c$export$e0009e7da572f99b(template, display);
|
|
3333
|
-
const elements = caught_html2elems(html) || [];
|
|
3334
|
-
const post_processed_elements = await $378c98788ab52b9c$export$cf7cbc6b76039101(t, rendering_options, processed_displays, index, caught_post_processing_functions, elements);
|
|
3335
|
-
return Array.from(post_processed_elements);
|
|
3336
|
-
}))).flat();
|
|
3337
|
-
if (!output_elements.length) {
|
|
3338
|
-
$241f2f02cc612a49$export$de56f1198d121036("RR: No displays left after postprocessing/rendering");
|
|
3339
|
-
return {};
|
|
3340
|
-
}
|
|
3341
|
-
return {
|
|
3342
|
-
elements: output_elements,
|
|
3343
|
-
displays: processed_displays
|
|
3344
|
-
};
|
|
3345
|
-
}
|
|
3346
|
-
function $378c98788ab52b9c$export$e0009e7da572f99b(template) {
|
|
3347
|
-
let display = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
3348
|
-
const discount_matcher = /{DISCOUNT{([\s\S]+?)}}/g;
|
|
3349
|
-
const no_discount_matcher = /{NODISCOUNT{([\s\S]+?)}}/g;
|
|
3350
|
-
if ("variant_index" in display) throw new Error("Modern display in ancient templating");
|
|
3351
|
-
const {
|
|
3352
|
-
sale_price: sale_price,
|
|
3353
|
-
original_price: original_price
|
|
3354
|
-
} = display;
|
|
3355
|
-
if (sale_price !== original_price) template = template.replaceAll(discount_matcher, "$1").replaceAll(no_discount_matcher, "");else template = template.replaceAll(discount_matcher, "").replaceAll(no_discount_matcher, "$1");
|
|
3356
|
-
// Conditional statements
|
|
3357
|
-
// {if VAR_NAME}
|
|
3358
|
-
// print this if true
|
|
3359
|
-
// {else}
|
|
3360
|
-
// print this if false
|
|
3361
|
-
// {end}
|
|
3362
|
-
// Note: these can't be nested. Else statement is optional
|
|
3363
|
-
template = template.replace(/{if\s+(.+?)}([\S\s]*?)(?:{else}([\S\s]*?))?{end}/g, (_, variable, if_yes, if_no) => {
|
|
3364
|
-
if (typeof if_no !== "string")
|
|
3365
|
-
// if_no is a number if there's no {else} statement
|
|
3366
|
-
if_no = "";
|
|
3367
|
-
return display[variable] ? if_yes : if_no;
|
|
3368
|
-
});
|
|
3369
|
-
return template.replace(/\${(.*?)}/g, (_, g) => {
|
|
3370
|
-
var _display$g;
|
|
3371
|
-
return (_display$g = display[g]) !== null && _display$g !== void 0 ? _display$g : "";
|
|
3372
|
-
});
|
|
3373
|
-
// this is copied from here, I hope I'm not breaking any licenses. Need it to transpile for IE11 compatiblity:
|
|
3374
|
-
// https://github.com/mikemaccana/dynamic-template/blob/master/index.js
|
|
3375
|
-
}
|
|
3376
|
-
|
|
3377
|
-
function $378c98788ab52b9c$export$c42139a43c877ecd(obj) {
|
|
3378
|
-
if (obj && typeof obj === "object" && !(obj instanceof Promise)) {
|
|
3379
|
-
// @ts-ignore (I don't know how to type this)
|
|
3380
|
-
const new_obj = Object.assign(new obj.constructor(), obj);
|
|
3381
|
-
for (const key in new_obj) if (typeof new_obj[key] === "object") new_obj[key] = $378c98788ab52b9c$export$c42139a43c877ecd(new_obj[key]);
|
|
3382
|
-
return new_obj;
|
|
3383
|
-
}
|
|
3384
|
-
return obj;
|
|
3385
|
-
}
|
|
3386
|
-
async function $378c98788ab52b9c$export$cf7cbc6b76039101(t, rendering_options, displays, index, functions, elements) {
|
|
3387
|
-
let event_listeners = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : [];
|
|
3388
|
-
let keep = true;
|
|
3389
|
-
const info = new $378c98788ab52b9c$export$da854280fb61cd32(t, rendering_options, displays, index, () => keep = false, event_listeners);
|
|
3390
|
-
for (let i = 0; i < functions.length; i++) {
|
|
3391
|
-
const result = await functions[i](elements, displays[index], info);
|
|
3392
|
-
if (result) elements = result;
|
|
3393
|
-
if (!keep) break;
|
|
3394
|
-
}
|
|
3395
|
-
if (keep) {
|
|
3396
|
-
for (let i = 0; i < event_listeners.length; i++) for (let j = 0; j < elements.length; j++) elements[j].addEventListener(...event_listeners[i]);
|
|
3397
|
-
}
|
|
3398
|
-
return keep ? elements : [];
|
|
3399
|
-
}
|
|
3400
|
-
async function $378c98788ab52b9c$export$c22e610107c5a15a(t, rendering_options, displays) {
|
|
3401
|
-
const {
|
|
3402
|
-
max_items: max_items,
|
|
3403
|
-
pre_processors = []
|
|
3404
|
-
} = rendering_options;
|
|
3405
|
-
const caught_pre_processors = pre_processors.map(pre_pro => $5e1f45affc1d7def$export$b3bbfd758f11cfa9(pre_pro));
|
|
3406
|
-
const processed_displays = [];
|
|
3407
|
-
for (let i = 0; i < displays.length; i++) {
|
|
3408
|
-
// classic for loop is both fast and can be stopped with break
|
|
3409
|
-
let keep = true;
|
|
3410
|
-
const info_for_pre_pro = new $378c98788ab52b9c$export$da854280fb61cd32(t, rendering_options, displays, i, () => keep = false);
|
|
3411
|
-
let display = displays[i];
|
|
3412
|
-
for (let j = 0; j < caught_pre_processors.length; j++) {
|
|
3413
|
-
const pre_processor = caught_pre_processors[j];
|
|
3414
|
-
const result = await pre_processor(display, info_for_pre_pro);
|
|
3415
|
-
if (result) display = result; // Don't understand why this cast is needed
|
|
3416
|
-
if (!keep) break;
|
|
3417
|
-
}
|
|
3418
|
-
if (keep) processed_displays.push(display);
|
|
3419
|
-
if (processed_displays.length >= max_items) break;
|
|
3420
|
-
}
|
|
3421
|
-
return processed_displays;
|
|
3422
|
-
}
|
|
3423
|
-
class $378c98788ab52b9c$export$da854280fb61cd32 {
|
|
3424
|
-
constructor(t, rendering_options, displays, index, remove_display, event_listeners) {
|
|
3425
|
-
var _this = this;
|
|
3426
|
-
// @ts-ignore Support for no-tenant recommendation rendering for js-ui/react-ui
|
|
3427
|
-
this.t = t;
|
|
3428
|
-
this.rendering_options = rendering_options;
|
|
3429
|
-
this.displays = displays;
|
|
3430
|
-
if (index != null) this.index = index;
|
|
3431
|
-
if (remove_display) this.remove_display = remove_display;
|
|
3432
|
-
if (event_listeners) {
|
|
3433
|
-
this.event_listeners = event_listeners;
|
|
3434
|
-
this.register_event_listener = function () {
|
|
3435
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
|
|
3436
|
-
return _this.event_listeners.push(args);
|
|
3437
|
-
};
|
|
3438
|
-
}
|
|
3439
|
-
}
|
|
3440
|
-
}
|
|
3441
|
-
async function $378c98788ab52b9c$var$check_displays(displays, min_items_to_run) {
|
|
3442
|
-
// don't run if too few recs
|
|
3443
|
-
if (min_items_to_run && displays.length < min_items_to_run) {
|
|
3444
|
-
$241f2f02cc612a49$export$de56f1198d121036("RR: Got too few displays, exiting");
|
|
3445
|
-
return false;
|
|
3446
|
-
}
|
|
3447
|
-
return true;
|
|
3448
|
-
}
|
|
3449
|
-
async function $378c98788ab52b9c$var$make_sure_we_have_displays(t, rendering_options) {
|
|
3450
|
-
const recs = await rendering_options.recs;
|
|
3451
|
-
if (Array.isArray(recs)) return $378c98788ab52b9c$export$c42139a43c877ecd(recs);
|
|
3452
|
-
if (!t)
|
|
3453
|
-
// No recs and no tenant, so we can't get any. Should never happen.
|
|
3454
|
-
return [];
|
|
3455
|
-
// get displays with get_displays if none are provided
|
|
3456
|
-
const get_displays_options = {
|
|
3457
|
-
type: rendering_options.type,
|
|
3458
|
-
...(rendering_options.extra_api_options || {})
|
|
3459
|
-
};
|
|
3460
|
-
for (const key of ["product_ids", "category_id", "product_id"]) if (key in rendering_options) get_displays_options[key] = rendering_options[key];
|
|
3461
|
-
return await $51dfcecbe05cc4e5$export$1bc0df10745d5412(t, get_displays_options, rendering_options.headers || {}).catch(t.err);
|
|
3462
|
-
}
|
|
3463
|
-
async function $ddeca43328b507f6$export$c83d8da642b5104a(t, options, GWVM_opts) {
|
|
3464
|
-
const {
|
|
3465
|
-
catchify: catchify,
|
|
3466
|
-
dlog: dlog,
|
|
3467
|
-
is_debug: is_debug
|
|
3468
|
-
} = t;
|
|
3469
|
-
const {
|
|
3470
|
-
container_selector = ".grid",
|
|
3471
|
-
container_template: container_template,
|
|
3472
|
-
start_rows = 1,
|
|
3473
|
-
rows_per_click = 1,
|
|
3474
|
-
override_rec_renderer: override_rec_renderer,
|
|
3475
|
-
button: button,
|
|
3476
|
-
title: title,
|
|
3477
|
-
title_selector: title_selector,
|
|
3478
|
-
only_full_rows = false,
|
|
3479
|
-
should_preload = true
|
|
3480
|
-
} = GWVM_opts;
|
|
3481
|
-
const outer_els = typeof container_template === "string" ? [...$652300c6621d5500$export$44951404cb8d0583(container_template)] : container_template;
|
|
3482
|
-
const [root] = $652300c6621d5500$export$5e63aea0cac01fa0(outer_els, container_selector);
|
|
3483
|
-
const cut_off_promise_obj = /*@__PURE__*/new (0, $4c6e595091defcd9$export$32ccf3a614c84258)();
|
|
3484
|
-
const i_observer = new IntersectionObserver(catchify($ddeca43328b507f6$var$observer_callback));
|
|
3485
|
-
let cut_off_point = 0;
|
|
3486
|
-
const recs_per_row = () => {
|
|
3487
|
-
var _GWVM_opts$recs_per_r;
|
|
3488
|
-
return typeof GWVM_opts.recs_per_row === "function" ? GWVM_opts.recs_per_row(cut_off_point) : (_GWVM_opts$recs_per_r = GWVM_opts.recs_per_row) !== null && _GWVM_opts$recs_per_r !== void 0 ? _GWVM_opts$recs_per_r : 6;
|
|
3489
|
-
};
|
|
3490
|
-
cut_off_point = recs_per_row() * start_rows;
|
|
3491
|
-
const get_show_next_num = () => recs_per_row() * rows_per_click;
|
|
3492
|
-
const preload_next_row = catchify(() => {
|
|
3493
|
-
const preload_these = [...rendering_results.displays].slice(cut_off_point, cut_off_point + get_show_next_num());
|
|
3494
|
-
for (const elem of preload_these) {
|
|
3495
|
-
const img = new Image();
|
|
3496
|
-
img.src = elem.image_url;
|
|
3497
|
-
// Element should be garbage collected, and the image source put in cache
|
|
3498
|
-
// https://stackoverflow.com/questions/3646036/preloading-images-with-javascript
|
|
3499
|
-
}
|
|
3500
|
-
});
|
|
3501
|
-
|
|
3502
|
-
const load_more = catchify(num => {
|
|
3503
|
-
const adds = typeof num == "number" ? num : get_show_next_num();
|
|
3504
|
-
cut_off_point += adds;
|
|
3505
|
-
cut_off_promise_obj.resolve(cut_off_point);
|
|
3506
|
-
if ((only_full_rows ? cut_off_point + adds : cut_off_point) >= displays.length)
|
|
3507
|
-
// TODO: make it remove/add back the button depending on viewport
|
|
3508
|
-
load_more_cont.remove();
|
|
3509
|
-
if (adds > 0 && should_preload) preload_next_row();
|
|
3510
|
-
});
|
|
3511
|
-
const our_post_pro = (elements, display, info) => $ddeca43328b507f6$var$post_processor(elements, display, info, cut_off_point, i_observer, cut_off_promise_obj, load_more);
|
|
3512
|
-
const rendering_results = await (override_rec_renderer || (0, $378c98788ab52b9c$export$a9fc160c5ed83bd7))(t, {
|
|
3513
|
-
...options,
|
|
3514
|
-
post_processors: [our_post_pro, ...(options.post_processors || [])]
|
|
3515
|
-
});
|
|
3516
|
-
const {
|
|
3517
|
-
elements: rendered_elements,
|
|
3518
|
-
displays: displays
|
|
3519
|
-
} = rendering_results;
|
|
3520
|
-
if (!rendered_elements) {
|
|
3521
|
-
dlog("Grid with view more is stopping because it got no elements");
|
|
3522
|
-
return rendering_results;
|
|
3523
|
-
}
|
|
3524
|
-
root.append(...rendered_elements);
|
|
3525
|
-
const load_more_cont = $652300c6621d5500$export$d3e2a0560cbf4787('<div class="load-more-container"></div>');
|
|
3526
|
-
const button_element = button instanceof Element ? button : $652300c6621d5500$export$d3e2a0560cbf4787('<button class="load_more">'.concat(button || "Visa mer", "</button>"));
|
|
3527
|
-
button_element.addEventListener("click", load_more);
|
|
3528
|
-
load_more_cont.append(button_element);
|
|
3529
|
-
root.after(load_more_cont);
|
|
3530
|
-
if (should_preload) {
|
|
3531
|
-
const load_more_intersection = async (entries, intersection_observer) => {
|
|
3532
|
-
// Multiple observe calls could potentially (?) be batched into one fn call, so check everything
|
|
3533
|
-
let intersected = false;
|
|
3534
|
-
for (let i = 0; i < entries.length; i++) if (entries[i].isIntersecting) {
|
|
3535
|
-
intersected = true;
|
|
3536
|
-
break;
|
|
3537
|
-
}
|
|
3538
|
-
if (!intersected) return;
|
|
3539
|
-
preload_next_row();
|
|
3540
|
-
intersection_observer.disconnect(); // The load_more button has its own preload call, so this only needs to happen the first time.
|
|
3541
|
-
};
|
|
3542
|
-
|
|
3543
|
-
const load_more_observer = new IntersectionObserver(catchify(load_more_intersection));
|
|
3544
|
-
load_more_observer.observe(load_more_cont);
|
|
3545
|
-
}
|
|
3546
|
-
if (title) {
|
|
3547
|
-
const [title_el] = $652300c6621d5500$export$5e63aea0cac01fa0(outer_els, title_selector || "h1.title");
|
|
3548
|
-
if (title_el) {
|
|
3549
|
-
if (title instanceof Element) title_el.replaceWith(title);else title_el.innerText = title;
|
|
3550
|
-
} else if (is_debug) {
|
|
3551
|
-
console.error("GWVM: Title set but couldn't find title element. Please specify title_selector", () => {});
|
|
3552
|
-
console.trace();
|
|
3553
|
-
}
|
|
3554
|
-
}
|
|
3555
|
-
return {
|
|
3556
|
-
...rendering_results,
|
|
3557
|
-
elements: outer_els,
|
|
3558
|
-
load_more: load_more
|
|
3559
|
-
};
|
|
3560
|
-
}
|
|
3561
|
-
function $ddeca43328b507f6$var$observer_callback(entries) {
|
|
3562
|
-
for (let i = 0; i < entries.length; i++) if (entries[i].isIntersecting) {
|
|
3563
|
-
var _target$src, _target$dataset, _target$dataset$src;
|
|
3564
|
-
const target = entries[i].target;
|
|
3565
|
-
if (!((_target$src = target.src) !== null && _target$src !== void 0 && _target$src.length) && (_target$dataset = target.dataset) !== null && _target$dataset !== void 0 && (_target$dataset$src = _target$dataset.src) !== null && _target$dataset$src !== void 0 && _target$dataset$src.length) {
|
|
3566
|
-
target.src = target.dataset.src;
|
|
3567
|
-
target.removeAttribute("data-src");
|
|
3568
|
-
}
|
|
3569
|
-
}
|
|
3570
|
-
}
|
|
3571
|
-
function $ddeca43328b507f6$var$post_processor(elements, _,
|
|
3572
|
-
//display: display,
|
|
3573
|
-
info, cut_off_point, i_observer, cut_off_promise_obj, load_more) {
|
|
3574
|
-
const {
|
|
3575
|
-
catchify: catchify,
|
|
3576
|
-
err: err,
|
|
3577
|
-
dlog: dlog
|
|
3578
|
-
} = info.t;
|
|
3579
|
-
const {
|
|
3580
|
-
index: index
|
|
3581
|
-
} = info;
|
|
3582
|
-
const elements_arr = [...elements];
|
|
3583
|
-
const [an_element_node] = elements_arr.filter(node => node.nodeType == Node.ELEMENT_NODE);
|
|
3584
|
-
const is_initially_hidden = index + 1 > cut_off_point;
|
|
3585
|
-
const extras = info.extras || (info.extras = {});
|
|
3586
|
-
extras.load_more || (extras.load_more = load_more);
|
|
3587
|
-
extras.load_more_ipo || (extras.load_more_ipo = cut_off_promise_obj);
|
|
3588
|
-
$652300c6621d5500$export$5e63aea0cac01fa0(elements_arr, "img:not(.filler):not(.ngl):not(.nolazy)").forEach(image => {
|
|
3589
|
-
var _image$src, _image$dataset, _image$src2, _image$src2$substr;
|
|
3590
|
-
// "img" also selects "image" in IE11 which can be an SVG element which doesn't have a src property, therefore optional chaining
|
|
3591
|
-
if ((image !== null && image !== void 0 && (_image$src = image.src) !== null && _image$src !== void 0 && _image$src.length || image !== null && image !== void 0 && (_image$dataset = image.dataset) !== null && _image$dataset !== void 0 && _image$dataset.src) && (image === null || image === void 0 ? void 0 : (_image$src2 = image.src) === null || _image$src2 === void 0 ? void 0 : (_image$src2$substr = _image$src2.substr) === null || _image$src2$substr === void 0 ? void 0 : _image$src2$substr.call(_image$src2, 0, 6)) != "data:") {
|
|
3592
|
-
if (is_initially_hidden && !(image !== null && image !== void 0 && image.dataset.src)) {
|
|
3593
|
-
image.dataset.src = image.src;
|
|
3594
|
-
image.removeAttribute("src");
|
|
3595
|
-
}
|
|
3596
|
-
(0, $90fa633a9564f115$export$b6ae1bc530f4c149).wait_for_element(an_element_node).then(catchify(el => {
|
|
3597
|
-
if ((el === null || el === void 0 ? void 0 : el.offsetParent) !== null) image.src || (image.src = image.dataset.src);else i_observer.observe(image);
|
|
3598
|
-
}));
|
|
3599
|
-
}
|
|
3600
|
-
});
|
|
3601
|
-
(async function () {
|
|
3602
|
-
if (is_initially_hidden) for (let i = 0; i < elements_arr.length; i++) {
|
|
3603
|
-
// HTMLElement is a lie, but TS is too dumb to understand that we check for it being a Node the line below this
|
|
3604
|
-
const {
|
|
3605
|
-
style: style
|
|
3606
|
-
} = elements_arr[i];
|
|
3607
|
-
if (style) style.display = "none";
|
|
3608
|
-
}
|
|
3609
|
-
while (true) {
|
|
3610
|
-
cut_off_point = await cut_off_promise_obj.promise;
|
|
3611
|
-
extras.load_more_currently_showing = cut_off_point;
|
|
3612
|
-
if (index + 1 <= cut_off_point) {
|
|
3613
|
-
for (let i = 0; i < elements_arr.length; i++) {
|
|
3614
|
-
const {
|
|
3615
|
-
style: style
|
|
3616
|
-
} = elements_arr[i];
|
|
3617
|
-
if (style) style.display = "";
|
|
3618
|
-
}
|
|
3619
|
-
break;
|
|
3620
|
-
}
|
|
3621
|
-
}
|
|
3622
|
-
})().catch(err);
|
|
3623
|
-
return elements;
|
|
3624
|
-
}
|
|
3625
|
-
async function $a496a9038b9c02cf$export$41de2959a8dd405d(t, options, GWVM_opts) {
|
|
3626
|
-
var _result4, _result5;
|
|
3627
|
-
let {
|
|
3628
|
-
rec_selector = ".rec_outer"
|
|
3629
|
-
} = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
3630
|
-
const {
|
|
3631
|
-
start_rows: wished_start_rows = 1
|
|
3632
|
-
} = GWVM_opts;
|
|
3633
|
-
const {
|
|
3634
|
-
dlog: dlog,
|
|
3635
|
-
err: err,
|
|
3636
|
-
catchify: catchify
|
|
3637
|
-
} = t;
|
|
3638
|
-
let result;
|
|
3639
|
-
let rec;
|
|
3640
|
-
let first = true;
|
|
3641
|
-
const modified_GWVM_opts = {
|
|
3642
|
-
...GWVM_opts,
|
|
3643
|
-
start_rows: 1 / 6,
|
|
3644
|
-
recs_per_row(num) {
|
|
3645
|
-
try {
|
|
3646
|
-
var _result;
|
|
3647
|
-
if ((_result = result) !== null && _result !== void 0 && _result.elements && rec) {
|
|
3648
|
-
let {
|
|
3649
|
-
parentElement: parentElement
|
|
3650
|
-
} = rec;
|
|
3651
|
-
if (!parentElement) {
|
|
3652
|
-
var _result2, _rec;
|
|
3653
|
-
// first rec was removed
|
|
3654
|
-
[rec] = $652300c6621d5500$export$5e63aea0cac01fa0(((_result2 = result) === null || _result2 === void 0 ? void 0 : _result2.elements) || [], rec_selector);
|
|
3655
|
-
parentElement = (_rec = rec) === null || _rec === void 0 ? void 0 : _rec.parentElement;
|
|
3656
|
-
if (!parentElement) throw new Error("Could not find element matching " + rec_selector + "to calculate width");
|
|
3657
|
-
}
|
|
3658
|
-
const recs_fitting_in_row = Math.floor(parentElement.getBoundingClientRect().width / Math.floor(rec.getBoundingClientRect().width));
|
|
3659
|
-
// this is not entirely accurate because of margins but seems to work 100% of the time for our use case
|
|
3660
|
-
if (recs_fitting_in_row != Infinity) {
|
|
3661
|
-
dlog("We think there are currently", recs_fitting_in_row, "columns");
|
|
3662
|
-
const {
|
|
3663
|
-
children: children
|
|
3664
|
-
} = parentElement;
|
|
3665
|
-
const last_visible = $a496a9038b9c02cf$var$find_last_visible(children);
|
|
3666
|
-
if (!last_visible) {
|
|
3667
|
-
dlog("It seems like no elements are visible, not loading any");
|
|
3668
|
-
return 0;
|
|
3669
|
-
}
|
|
3670
|
-
if (num % recs_fitting_in_row !== 0) {
|
|
3671
|
-
var _result$load_more, _result3;
|
|
3672
|
-
// X % 0 is NaN, prevent this from happening
|
|
3673
|
-
const fill_last_row = recs_fitting_in_row === 0 ? 0 : recs_fitting_in_row - num % recs_fitting_in_row;
|
|
3674
|
-
(_result$load_more = (_result3 = result).load_more) === null || _result$load_more === void 0 || _result$load_more.call(_result3, fill_last_row + recs_fitting_in_row * (wished_start_rows - 1));
|
|
3675
|
-
}
|
|
3676
|
-
// Special case for when it's the first "load more" (which is automatically triggered)
|
|
3677
|
-
if (num === 1 && first) {
|
|
3678
|
-
first = false;
|
|
3679
|
-
return 0;
|
|
3680
|
-
}
|
|
3681
|
-
return recs_fitting_in_row;
|
|
3682
|
-
}
|
|
3683
|
-
}
|
|
3684
|
-
} catch (e) {
|
|
3685
|
-
err(e);
|
|
3686
|
-
}
|
|
3687
|
-
return 6;
|
|
3688
|
-
}
|
|
3689
|
-
};
|
|
3690
|
-
// @ts-ignore
|
|
3691
|
-
result = await $ddeca43328b507f6$export$c83d8da642b5104a(t, options, modified_GWVM_opts);
|
|
3692
|
-
if (!((_result4 = result) !== null && _result4 !== void 0 && _result4.elements))
|
|
3693
|
-
// no chance in finding any elements, API didn't return recs
|
|
3694
|
-
return result;
|
|
3695
|
-
if (typeof ((_result5 = result) === null || _result5 === void 0 ? void 0 : _result5.load_more) == "function") (0, $90fa633a9564f115$export$b6ae1bc530f4c149).wait_for_element(rec_selector).then(() => {
|
|
3696
|
-
var _result$load_more2, _result6;
|
|
3697
|
-
// we load 1 card to be able to determine the width
|
|
3698
|
-
// in this situation recs_per_row will not return actual recs per row but recs_to_complete_row, so we add one card to get actual recs per row
|
|
3699
|
-
// then we remove the one card again from total calculation
|
|
3700
|
-
(_result$load_more2 = (_result6 = result).load_more) === null || _result$load_more2 === void 0 || _result$load_more2.call(_result6);
|
|
3701
|
-
});else err("Could not find recommendation to calculate recs per row. rec_selector: " + rec_selector);
|
|
3702
|
-
return result;
|
|
3703
|
-
}
|
|
3704
|
-
function $a496a9038b9c02cf$var$find_last_visible(items) {
|
|
3705
|
-
for (let i = items.length - 1; i > -1; i--) {
|
|
3706
|
-
var _items$i;
|
|
3707
|
-
// @ts-ignore
|
|
3708
|
-
if (((_items$i = items[i]) === null || _items$i === void 0 ? void 0 : _items$i.offsetParent) !== null) return items[i];
|
|
3709
|
-
}
|
|
3710
|
-
}
|
|
3711
|
-
|
|
3712
|
-
/**
|
|
3713
|
-
* @deprecated use async_iterable_ipns instead. This can skip values which yields unexpected results.
|
|
3714
|
-
*/
|
|
3715
|
-
function $6a44fa3f1acf7693$export$55621c1ce3cd536b() {
|
|
3716
|
-
// the idea is to have a new promise available immediately before one resolves, so to say an infinite promise
|
|
3717
|
-
let internal_resolve; // copy and pasted from iconbeauty
|
|
3718
|
-
const cart_promise_object = {
|
|
3719
|
-
// I feel like Anton is not going to like this extremely awesome approach
|
|
3720
|
-
promise: new Promise(r => internal_resolve = r),
|
|
3721
|
-
// which is why I'm reluctant with making it a library
|
|
3722
|
-
internal_resolve: internal_resolve,
|
|
3723
|
-
// Edit from later on: I have realised that this is actually very useful, it just has a steep learning curve.
|
|
3724
|
-
resolve: argument => {
|
|
3725
|
-
// it allows both not having to call functions in a loop and instead just awaiting the promise from multiple places
|
|
3726
|
-
const oldresolve = cart_promise_object.internal_resolve; // and to effortlessly ensure a process is never running twice with 100% reliability
|
|
3727
|
-
cart_promise_object.promise = new Promise(r => cart_promise_object.internal_resolve = r); // it could be made a class, but I already know this works, so I'll leave it as is
|
|
3728
|
-
oldresolve(argument);
|
|
3729
|
-
}
|
|
3730
|
-
};
|
|
3731
|
-
return cart_promise_object;
|
|
3732
|
-
}
|
|
3733
|
-
|
|
3734
|
-
// import { buildThresholdList } from "../../helpers/build_threshold_list";
|
|
3735
|
-
|
|
3736
|
-
async function $d3b90d5099bf2925$export$c0a4d29bc45a38c6(t, options, GWVM_opts) {
|
|
3737
|
-
let {
|
|
3738
|
-
rec_selector = ".rec_outer"
|
|
3739
|
-
} = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
3740
|
-
const options_for_auto_gwvm = {
|
|
3741
|
-
...GWVM_opts,
|
|
3742
|
-
start_rows: 1
|
|
3743
|
-
};
|
|
3744
|
-
let all_rendered_elements = [];
|
|
3745
|
-
options.post_processors = [...(options.post_processors || []), (elements, display, info) => {
|
|
3746
|
-
all_rendered_elements.push(elements);
|
|
3747
|
-
if (!info.index)
|
|
3748
|
-
// the plan:
|
|
3749
|
-
// observe first element - after dom insertion, count the visible elements and observe the last one thereof
|
|
3750
|
-
// once it enters the view port, unobserve it
|
|
3751
|
-
// once new elements have been loaded, count the visible elements - only once tho, in response of the first one being visible
|
|
3752
|
-
// then attach to last element again and repeat
|
|
3753
|
-
$d3b90d5099bf2925$var$observe_first_el_after_dominsertion(all_rendered_elements, elements, info.extras.load_more);
|
|
3754
|
-
return elements;
|
|
3755
|
-
}];
|
|
3756
|
-
return await $a496a9038b9c02cf$export$41de2959a8dd405d(t, options, options_for_auto_gwvm, {
|
|
3757
|
-
rec_selector: rec_selector
|
|
3758
|
-
});
|
|
3759
|
-
}
|
|
3760
|
-
function $d3b90d5099bf2925$var$observe_first_el_after_dominsertion(all_rendered_elements, elements, load_more) {
|
|
3761
|
-
const element = $d3b90d5099bf2925$var$find_html_element(elements);
|
|
3762
|
-
if (!element) {
|
|
3763
|
-
$241f2f02cc612a49$export$de56f1198d121036("Infinite scroll won't work, couldn't find element to observe", elements);
|
|
3764
|
-
return;
|
|
3765
|
-
}
|
|
3766
|
-
(0, $90fa633a9564f115$export$b6ae1bc530f4c149).wait_for_element(element).then($5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => {
|
|
3767
|
-
$d3b90d5099bf2925$var$find_last_el_and_observe(all_rendered_elements, load_more);
|
|
3768
|
-
}));
|
|
3769
|
-
}
|
|
3770
|
-
function $d3b90d5099bf2925$var$find_last_el_and_observe(all_rendered_elements, load_more) {
|
|
3771
|
-
const last_visible_el = $d3b90d5099bf2925$var$find_last_visible(all_rendered_elements);
|
|
3772
|
-
if (!last_visible_el) return;
|
|
3773
|
-
const i_o = new IntersectionObserver($5e1f45affc1d7def$export$b3bbfd758f11cfa9(records => {
|
|
3774
|
-
for (const record of records) if (record.isIntersecting) {
|
|
3775
|
-
$241f2f02cc612a49$export$de56f1198d121036("loading more because of", record);
|
|
3776
|
-
load_more();
|
|
3777
|
-
setTimeout($5e1f45affc1d7def$export$b3bbfd758f11cfa9($d3b90d5099bf2925$var$find_last_el_and_observe), 0, all_rendered_elements, load_more);
|
|
3778
|
-
i_o.disconnect();
|
|
3779
|
-
}
|
|
3780
|
-
}));
|
|
3781
|
-
i_o.observe(last_visible_el);
|
|
3782
|
-
}
|
|
3783
|
-
function $d3b90d5099bf2925$var$find_html_element(elements) {
|
|
3784
|
-
// intersection observers don't work on text nodes
|
|
3785
|
-
let element;
|
|
3786
|
-
for (let i = 0; !((element = elements[i++]) instanceof HTMLElement) && element;);
|
|
3787
|
-
return element;
|
|
3788
|
-
}
|
|
3789
|
-
function $d3b90d5099bf2925$var$find_last_visible(bunch_of_elements) {
|
|
3790
|
-
const considered_elements = bunch_of_elements.map(els => $d3b90d5099bf2925$var$find_html_element(els));
|
|
3791
|
-
// this is a potentially dangerous assumption - that the visibility status of the first element is the same as all other elements, but it should be true 100% of the time right now since GWVM sets display: none uniformally and why tf would you want it differently?
|
|
3792
|
-
for (let i = 0; i < considered_elements.length; i++) {
|
|
3793
|
-
const respected_element = considered_elements[i];
|
|
3794
|
-
if (!respected_element) {
|
|
3795
|
-
$241f2f02cc612a49$export$de56f1198d121036("Infinite scroll error: couldn't find last visible element", bunch_of_elements);
|
|
3796
|
-
return;
|
|
3797
|
-
}
|
|
3798
|
-
if (respected_element.offsetParent === null) {
|
|
3799
|
-
if (!i) {
|
|
3800
|
-
// 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
|
|
3801
|
-
$241f2f02cc612a49$export$de56f1198d121036("Inf scroll: No elements visible, ", considered_elements, "will attach to first el", respected_element);
|
|
3802
|
-
return considered_elements[i];
|
|
3803
|
-
}
|
|
3804
|
-
return considered_elements[i - 1];
|
|
3805
|
-
}
|
|
3806
|
-
}
|
|
3807
|
-
$241f2f02cc612a49$export$de56f1198d121036("Seems like all elements are loaded");
|
|
3808
|
-
}
|
|
3809
|
-
async function $3ee6c00e6df1008f$export$9eae832ae57fbf(t, css, extra_html) {
|
|
3810
|
-
const head = await (0, $90fa633a9564f115$export$b6ae1bc530f4c149).wait_for_element("head"),
|
|
3811
|
-
{
|
|
3812
|
-
dlog: dlog
|
|
3813
|
-
} = t,
|
|
3814
|
-
elems = $652300c6621d5500$export$44951404cb8d0583('<style type="text/css">'.concat(css, "</style>") + (extra_html ? extra_html : ""));
|
|
3815
|
-
dlog("inserting", ...elems, "into", head);
|
|
3816
|
-
head.append(...elems);
|
|
3817
|
-
}
|
|
3818
|
-
function $e64690bc3a7de2b1$export$c7187bbd1a7a9244() {
|
|
3819
|
-
$e64690bc3a7de2b1$var$placeholder_worker(...arguments).catch((0, $b000f5ef6ce456d9$export$8048b892d651b310));
|
|
3820
|
-
return arguments.length <= 0 ? undefined : arguments[0];
|
|
3821
|
-
}
|
|
3822
|
-
async function $e64690bc3a7de2b1$var$placeholder_worker(placeholder_elements, final_elements, switching_trigger) {
|
|
3823
|
-
let state = false;
|
|
3824
|
-
let has_sanitized_elements = false;
|
|
3825
|
-
const sanit_el_if_needed = async () => {
|
|
3826
|
-
if (!has_sanitized_elements) {
|
|
3827
|
-
has_sanitized_elements = true;
|
|
3828
|
-
placeholder_elements = await $e64690bc3a7de2b1$var$convert_to_node_array(placeholder_elements);
|
|
3829
|
-
final_elements = await $e64690bc3a7de2b1$var$convert_to_node_array(final_elements);
|
|
3830
|
-
}
|
|
3831
|
-
};
|
|
3832
|
-
if (switching_trigger instanceof (0, $4c6e595091defcd9$export$32ccf3a614c84258)) while (true) {
|
|
3833
|
-
const new_state = await switching_trigger.promise;
|
|
3834
|
-
if (new_state != state) {
|
|
3835
|
-
await sanit_el_if_needed();
|
|
3836
|
-
await $e64690bc3a7de2b1$var$decide_direction_and_switch(placeholder_elements, final_elements, new_state);
|
|
3837
|
-
state = new_state;
|
|
3838
|
-
}
|
|
3839
|
-
} else if (switching_trigger instanceof Promise) {
|
|
3840
|
-
const new_state = await switching_trigger;
|
|
3841
|
-
if (state != new_state) {
|
|
3842
|
-
await sanit_el_if_needed();
|
|
3843
|
-
await $e64690bc3a7de2b1$var$decide_direction_and_switch(placeholder_elements, final_elements, new_state);
|
|
3844
|
-
state = new_state;
|
|
3845
|
-
}
|
|
3846
|
-
} else {
|
|
3847
|
-
await sanit_el_if_needed();
|
|
3848
|
-
placeholder_elements[0].addEventListener("placeholder_switch", $9c44a7238815fa47$export$535946eb77c946dd(async e => {
|
|
3849
|
-
const new_state = e.detail.state;
|
|
3850
|
-
if (state != new_state) {
|
|
3851
|
-
await sanit_el_if_needed();
|
|
3852
|
-
await $e64690bc3a7de2b1$var$decide_direction_and_switch(placeholder_elements, final_elements, new_state);
|
|
3853
|
-
state = new_state;
|
|
3854
|
-
}
|
|
3855
|
-
}));
|
|
3856
|
-
}
|
|
3857
|
-
}
|
|
3858
|
-
async function $e64690bc3a7de2b1$var$convert_to_node_array(elements) {
|
|
3859
|
-
if (typeof elements == "function") elements = elements();
|
|
3860
|
-
elements = await elements;
|
|
3861
|
-
if (typeof elements[Symbol.iterator] != "function") elements = [elements];
|
|
3862
|
-
return elements;
|
|
3863
|
-
}
|
|
3864
|
-
async function $e64690bc3a7de2b1$var$decide_direction_and_switch(placeholder_elements, final_elements, switch_to_final) {
|
|
3865
|
-
if (switch_to_final) $e64690bc3a7de2b1$var$switch_elements(placeholder_elements, final_elements);else $e64690bc3a7de2b1$var$switch_elements(final_elements, placeholder_elements);
|
|
3866
|
-
}
|
|
3867
|
-
function $e64690bc3a7de2b1$var$switch_elements(from, to) {
|
|
3868
|
-
if (!from.length || !to.length) $241f2f02cc612a49$export$c2363754d4758444("Cannot switch elements as from or to is empty", from, to);
|
|
3869
|
-
from[0].replaceWith(...to);
|
|
3870
|
-
for (let i = 1; i < from.length; i++) from[i].remove();
|
|
3871
|
-
}
|
|
3872
|
-
function $5f31622ffb78bc10$var$_classPrivateMethodInitSpec(obj, privateSet) {
|
|
3873
|
-
$5f31622ffb78bc10$var$_checkPrivateRedeclaration(obj, privateSet);
|
|
3874
|
-
privateSet.add(obj);
|
|
3875
|
-
}
|
|
3876
|
-
function $5f31622ffb78bc10$var$_classPrivateFieldInitSpec(obj, privateMap, value) {
|
|
3877
|
-
$5f31622ffb78bc10$var$_checkPrivateRedeclaration(obj, privateMap);
|
|
3878
|
-
privateMap.set(obj, value);
|
|
3879
|
-
}
|
|
3880
|
-
function $5f31622ffb78bc10$var$_checkPrivateRedeclaration(obj, privateCollection) {
|
|
3881
|
-
if (privateCollection.has(obj)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
3882
|
-
}
|
|
3883
|
-
function $5f31622ffb78bc10$var$_classPrivateMethodGet(receiver, privateSet, fn) {
|
|
3884
|
-
if (!privateSet.has(receiver)) throw new TypeError("attempted to get private field on non-instance");
|
|
3885
|
-
return fn;
|
|
3886
|
-
}
|
|
3887
|
-
var $5f31622ffb78bc10$var$_verbose = /*#__PURE__*/new WeakMap();
|
|
3888
|
-
var $5f31622ffb78bc10$var$_images_on_first_page = /*#__PURE__*/new WeakMap();
|
|
3889
|
-
var $5f31622ffb78bc10$var$_default_lazyfinder = /*#__PURE__*/new WeakMap();
|
|
3890
|
-
var $5f31622ffb78bc10$var$_initiate_new_image = /*#__PURE__*/new WeakSet();
|
|
3891
|
-
var $5f31622ffb78bc10$var$_add_load_event_listener = /*#__PURE__*/new WeakSet();
|
|
3892
|
-
var $5f31622ffb78bc10$var$_unload_images_and_add_load_listeners = /*#__PURE__*/new WeakSet();
|
|
3893
|
-
var $5f31622ffb78bc10$var$_start_observer = /*#__PURE__*/new WeakSet();
|
|
3894
|
-
var $5f31622ffb78bc10$var$_check_if_first_page_has_loaded = /*#__PURE__*/new WeakSet();
|
|
3895
|
-
class $5f31622ffb78bc10$export$3be7054c61590ee3 {
|
|
3896
|
-
start_observing_for_new_children_(override_container) {
|
|
3897
|
-
// should ONLY run on our "stock" elements array and is therefore called if "elements" is get in it - which means it's being used
|
|
3898
|
-
// 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
|
|
3899
|
-
if (!this.container && !override_container) return;
|
|
3900
|
-
const container = override_container !== null && override_container !== void 0 ? override_container : this.container;
|
|
3901
|
-
const mutation_observer = new MutationObserver($5e1f45affc1d7def$export$b3bbfd758f11cfa9(mutations => {
|
|
3902
|
-
for (let i = 0; i < mutations.length; i++) {
|
|
3903
|
-
const matching_added_els = $652300c6621d5500$export$5e63aea0cac01fa0(mutations[i].addedNodes, this.selector);
|
|
3904
|
-
if (matching_added_els.length) {
|
|
3905
|
-
if ($76EG6$babelruntimehelpersclassPrivateFieldGet(this, $5f31622ffb78bc10$var$_verbose)) $241f2f02cc612a49$export$de56f1198d121036("New elements", matching_added_els, " matching selector", this.selector, "were aded to", container, "lazyloading\u2026");
|
|
3906
|
-
this.lazyfinder.elements.push(...matching_added_els);
|
|
3907
|
-
matching_added_els.forEach($5f31622ffb78bc10$var$_classPrivateMethodGet(this, $5f31622ffb78bc10$var$_initiate_new_image, $5f31622ffb78bc10$var$_initiate_new_image2).bind(this));
|
|
3908
|
-
}
|
|
3909
|
-
}
|
|
3910
|
-
}));
|
|
3911
|
-
(0, $90fa633a9564f115$export$b6ae1bc530f4c149).onexists(container, _ref => {
|
|
3912
|
-
var _element$querySelecto;
|
|
3913
|
-
let {
|
|
3914
|
-
element: element
|
|
3915
|
-
} = _ref;
|
|
3916
|
-
const new_els = (element === null || element === void 0 ? void 0 : (_element$querySelecto = element.querySelectorAll) === null || _element$querySelecto === void 0 ? void 0 : _element$querySelecto.call(element, this.selector)) || [];
|
|
3917
|
-
this.lazyfinder.elements.push(...new_els);
|
|
3918
|
-
new_els.forEach($5f31622ffb78bc10$var$_classPrivateMethodGet(this, $5f31622ffb78bc10$var$_initiate_new_image, $5f31622ffb78bc10$var$_initiate_new_image2).bind(this));
|
|
3919
|
-
mutation_observer.observe(element, {
|
|
3920
|
-
subtree: true,
|
|
3921
|
-
childList: true
|
|
3922
|
-
});
|
|
2217
|
+
(0, $90fa633a9564f115$export$b6ae1bc530f4c149).onexists(container, _ref => {
|
|
2218
|
+
var _element$querySelecto;
|
|
2219
|
+
let {
|
|
2220
|
+
element: element
|
|
2221
|
+
} = _ref;
|
|
2222
|
+
const new_els = (element === null || element === void 0 ? void 0 : (_element$querySelecto = element.querySelectorAll) === null || _element$querySelecto === void 0 ? void 0 : _element$querySelecto.call(element, this.selector)) || [];
|
|
2223
|
+
this.lazyfinder.elements.push(...new_els);
|
|
2224
|
+
new_els.forEach($5f31622ffb78bc10$var$_classPrivateMethodGet(this, $5f31622ffb78bc10$var$_initiate_new_image, $5f31622ffb78bc10$var$_initiate_new_image2).bind(this));
|
|
2225
|
+
mutation_observer.observe(element, {
|
|
2226
|
+
subtree: true,
|
|
2227
|
+
childList: true
|
|
2228
|
+
});
|
|
3923
2229
|
});
|
|
3924
2230
|
(0, $90fa633a9564f115$export$b6ae1bc530f4c149).onremoved(container, _ref2 => {
|
|
3925
2231
|
let {
|
|
@@ -4620,535 +2926,36 @@ function $be288a83d9eabf2a$var$_scroll_to2(offset) {
|
|
|
4620
2926
|
});
|
|
4621
2927
|
}
|
|
4622
2928
|
class $f340c415f2e1d03a$export$68babfc5be0de5da extends (0, $be288a83d9eabf2a$export$692b27c28639e5b9) {
|
|
4623
|
-
constructor(options, lazyfier_options) {
|
|
4624
|
-
super(options);
|
|
4625
|
-
const lazy_promise = new Promise(r => {
|
|
4626
|
-
(0, $90fa633a9564f115$export$b6ae1bc530f4c149).onexists(this.insert_here, _ref => {
|
|
4627
|
-
let {
|
|
4628
|
-
element: element,
|
|
4629
|
-
disconnector: disconnector
|
|
4630
|
-
} = _ref;
|
|
4631
|
-
const i_o = new IntersectionObserver($5e1f45affc1d7def$export$b3bbfd758f11cfa9(records => {
|
|
4632
|
-
for (const record of records) if (record.intersectionRatio > 0) {
|
|
4633
|
-
r(true);
|
|
4634
|
-
i_o.disconnect();
|
|
4635
|
-
disconnector();
|
|
4636
|
-
return;
|
|
4637
|
-
}
|
|
4638
|
-
}),
|
|
4639
|
-
// Fixes https://gitlab.com/depict-ai/depict.ai/-/merge_requests/5816/diffs, don't understand why
|
|
4640
|
-
{
|
|
4641
|
-
threshold: $ab9c3dbf2bb2fbf7$export$f8ea2e7b15b5d129(10)
|
|
4642
|
-
});
|
|
4643
|
-
i_o.observe(element);
|
|
4644
|
-
});
|
|
4645
|
-
});
|
|
4646
|
-
this.lazyfier = new (0, $5f31622ffb78bc10$export$3be7054c61590ee3)({
|
|
4647
|
-
container: this.insert_here,
|
|
4648
|
-
wait_for_dominsertion: lazy_promise,
|
|
4649
|
-
...(lazyfier_options || {})
|
|
4650
|
-
});
|
|
4651
|
-
}
|
|
4652
|
-
}
|
|
4653
|
-
const $943514d07f57df12$export$f37c58ab3d3e3b75 = [$943514d07f57df12$export$9e1caada6901f552, (0, $c633189b7b69d048$export$d0efd8ed14f5c33), $943514d07f57df12$export$fb9afe9f540ae069, ...(process.env.GTAG_VIEW === "true" ? [$943514d07f57df12$export$1bffac19f9f0d6fc] : [])];
|
|
4654
|
-
const $943514d07f57df12$export$6830ae1fbe21e589 = [$943514d07f57df12$export$e9106d6e723510d2, $943514d07f57df12$export$32eb5dd18e963410, (0, $df87ac5a30f7baac$export$58c56fe2313fdbe3), ...(process.env.GTAG === "true" ? [$943514d07f57df12$export$8d72437623fef90c] : [])];
|
|
4655
|
-
const $943514d07f57df12$export$ed8a68dacd075983 = /*@__PURE__*/new Map();
|
|
4656
|
-
const $943514d07f57df12$export$4b50a4de9c6bbe09 = /*@__PURE__*/new WeakSet();
|
|
4657
|
-
function $943514d07f57df12$export$fb9afe9f540ae069(elements, _display, info) {
|
|
4658
|
-
if (!(elements !== null && elements !== void 0 && elements.length)) return elements;
|
|
4659
|
-
if (!info.t) return elements;
|
|
4660
|
-
const elements_as_array = [...elements];
|
|
4661
|
-
const handler = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(async () => {
|
|
4662
|
-
const {
|
|
4663
|
-
rendering_options: rendering_options,
|
|
4664
|
-
t: t
|
|
4665
|
-
} = info;
|
|
4666
|
-
if (!$943514d07f57df12$export$4b50a4de9c6bbe09.has(rendering_options) && elements_as_array.some(e => document.documentElement.contains(e)) // check, just in case
|
|
4667
|
-
) {
|
|
4668
|
-
$943514d07f57df12$export$4b50a4de9c6bbe09.add(rendering_options);
|
|
4669
|
-
$d5f7352b58e0d737$export$82badda1f9923310({
|
|
4670
|
-
...t,
|
|
4671
|
-
product_id: await t.get_product_id(),
|
|
4672
|
-
recommendation_type: info.rendering_options.type,
|
|
4673
|
-
type: "recommendations_inserted"
|
|
4674
|
-
});
|
|
4675
|
-
}
|
|
4676
|
-
});
|
|
4677
|
-
$943514d07f57df12$var$push_function($943514d07f57df12$export$fb9afe9f540ae069, handler);
|
|
4678
|
-
const first_el = elements_as_array === null || elements_as_array === void 0 ? void 0 : elements_as_array[0];
|
|
4679
|
-
if (first_el instanceof Node) (0, $90fa633a9564f115$export$b6ae1bc530f4c149).wait_for_element(first_el).then(handler);
|
|
4680
|
-
return elements;
|
|
4681
|
-
}
|
|
4682
|
-
const $943514d07f57df12$export$3777a14dd8c2363d = /*@__PURE__*/new WeakSet();
|
|
4683
|
-
function $943514d07f57df12$export$1bffac19f9f0d6fc(elements, _display, info) {
|
|
4684
|
-
if (!(elements !== null && elements !== void 0 && elements.length))
|
|
4685
|
-
// don't make it hurt even more that rendering failed
|
|
4686
|
-
return elements;
|
|
4687
|
-
if (!info.t)
|
|
4688
|
-
// GTAG tracking is deprecated, if we're doing no-tenant recommendation rendering it's SDK anyway.
|
|
4689
|
-
return elements;
|
|
4690
|
-
const [first_element] = elements;
|
|
4691
|
-
const handler = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => {
|
|
4692
|
-
const {
|
|
4693
|
-
rendering_options: rendering_options,
|
|
4694
|
-
displays: displays
|
|
4695
|
-
} = info;
|
|
4696
|
-
if (!$943514d07f57df12$export$3777a14dd8c2363d.has(displays)) {
|
|
4697
|
-
$943514d07f57df12$export$3777a14dd8c2363d.add(displays);
|
|
4698
|
-
const {
|
|
4699
|
-
get_product_id: get_product_id
|
|
4700
|
-
} = info.t;
|
|
4701
|
-
const {
|
|
4702
|
-
type: type
|
|
4703
|
-
} = rendering_options;
|
|
4704
|
-
$3674b9afc9a63520$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 */, {
|
|
4705
|
-
list_name: "depict_" + type
|
|
4706
|
-
});
|
|
4707
|
-
}
|
|
4708
|
-
});
|
|
4709
|
-
$943514d07f57df12$var$push_function($943514d07f57df12$export$1bffac19f9f0d6fc, handler);
|
|
4710
|
-
(0, $90fa633a9564f115$export$b6ae1bc530f4c149).onexists(first_element, handler);
|
|
4711
|
-
return elements;
|
|
4712
|
-
}
|
|
4713
|
-
function $943514d07f57df12$export$9e1caada6901f552(elements, _display, info) {
|
|
4714
|
-
const {
|
|
4715
|
-
t: t
|
|
4716
|
-
} = info;
|
|
4717
|
-
if (!t) return elements;
|
|
4718
|
-
(async () => {
|
|
4719
|
-
$0897f35c3b3fbbc4$export$eee4c4d924348b05({
|
|
4720
|
-
tenant: t.tenant,
|
|
4721
|
-
market: t.market,
|
|
4722
|
-
product_id: await t.get_product_id()
|
|
4723
|
-
}).catch((0, $b000f5ef6ce456d9$export$8048b892d651b310));
|
|
4724
|
-
})();
|
|
4725
|
-
return elements;
|
|
4726
|
-
}
|
|
4727
|
-
function $943514d07f57df12$export$8d72437623fef90c(elements, display, info) {
|
|
4728
|
-
const handler = () => {
|
|
4729
|
-
const {
|
|
4730
|
-
ga_product_ids: ga_product_ids,
|
|
4731
|
-
ga_product_id: ga_product_id,
|
|
4732
|
-
product_id: product_id
|
|
4733
|
-
} = display;
|
|
4734
|
-
if (Array.isArray(ga_product_ids)) for (let i = 0; i < ga_product_ids.length; i++) $3674b9afc9a63520$export$f522672c9379e339(ga_product_ids[i], info.index, {
|
|
4735
|
-
list_name: "depict_" + info.rendering_options.type
|
|
4736
|
-
});else $3674b9afc9a63520$export$f522672c9379e339(ga_product_id || product_id, info.index, {
|
|
4737
|
-
list_name: "depict_" + info.rendering_options.type
|
|
4738
|
-
});
|
|
4739
|
-
};
|
|
4740
|
-
$943514d07f57df12$var$push_function($943514d07f57df12$export$8d72437623fef90c, handler);
|
|
4741
|
-
info.register_event_listener("click", handler, {
|
|
4742
|
-
once: true
|
|
4743
|
-
});
|
|
4744
|
-
return elements;
|
|
4745
|
-
}
|
|
4746
|
-
function $943514d07f57df12$export$e9106d6e723510d2(elements, display, info) {
|
|
4747
|
-
const handler = () => {
|
|
4748
|
-
const {
|
|
4749
|
-
t: t,
|
|
4750
|
-
index: index,
|
|
4751
|
-
rendering_options: rendering_options
|
|
4752
|
-
} = info;
|
|
4753
|
-
return $d5f7352b58e0d737$export$15f8a0cd5a8c0ebb({
|
|
4754
|
-
...t,
|
|
4755
|
-
...rendering_options,
|
|
4756
|
-
...display,
|
|
4757
|
-
click_location: rendering_options.type + "_" + (index + 1),
|
|
4758
|
-
recommendation_type: rendering_options.type,
|
|
4759
|
-
product_id: "variant_index" in display ? display.variant_displays[display.variant_index].product_id : display.product_id
|
|
4760
|
-
});
|
|
4761
|
-
};
|
|
4762
|
-
$943514d07f57df12$var$push_function($943514d07f57df12$export$e9106d6e723510d2, handler);
|
|
4763
|
-
info.register_event_listener("click", handler, {
|
|
4764
|
-
once: true
|
|
4765
|
-
});
|
|
4766
|
-
return elements;
|
|
4767
|
-
}
|
|
4768
|
-
function $943514d07f57df12$export$32eb5dd18e963410(elements, display, info) {
|
|
4769
|
-
const {
|
|
4770
|
-
search_result_id: search_result_id
|
|
4771
|
-
} = display;
|
|
4772
|
-
const {
|
|
4773
|
-
product_id: product_id,
|
|
4774
|
-
recommendation_id: recommendation_id
|
|
4775
|
-
} = "variant_index" in display ? display.variant_displays[display.variant_index] : display;
|
|
4776
|
-
if (!(elements !== null && elements !== void 0 && elements.length)) return elements;
|
|
4777
|
-
for (const element of elements) {
|
|
4778
|
-
const handler = $bd7c9f254946941d$export$82a685f2da2fb027(element, product_id, recommendation_id || search_result_id);
|
|
4779
|
-
if (handler) $943514d07f57df12$var$push_function($943514d07f57df12$export$32eb5dd18e963410, handler);
|
|
4780
|
-
}
|
|
4781
|
-
return elements;
|
|
4782
|
-
}
|
|
4783
|
-
function $943514d07f57df12$export$dd32cb565eae0a1f(elements, display, info) {
|
|
4784
|
-
const handler = () => {
|
|
4785
|
-
$3674b9afc9a63520$export$127751e82111fcf();
|
|
4786
|
-
};
|
|
4787
|
-
$943514d07f57df12$var$push_function($943514d07f57df12$export$dd32cb565eae0a1f, handler);
|
|
4788
|
-
info.register_event_listener("click", handler, {
|
|
4789
|
-
once: true
|
|
4790
|
-
});
|
|
4791
|
-
return elements;
|
|
4792
|
-
}
|
|
4793
|
-
function $943514d07f57df12$var$push_function(fn1, handler) {
|
|
4794
|
-
const fn_array = $943514d07f57df12$export$ed8a68dacd075983.get(fn1) || [];
|
|
4795
|
-
fn_array.push(new WeakRef(handler));
|
|
4796
|
-
$943514d07f57df12$export$ed8a68dacd075983.set(fn1, fn_array);
|
|
4797
|
-
}
|
|
4798
|
-
const $20fe9624210ef635$export$deca40f48c0569f8 = typeof window === "undefined" ? false : /*@__PURE__*/localStorage.getItem("colorize-logics") === "true";
|
|
4799
|
-
function $20fe9624210ef635$export$16501883f477737a(elements, display) {
|
|
4800
|
-
elements.forEach(elem => {
|
|
4801
|
-
if (elem.nodeType !== Node.TEXT_NODE) {
|
|
4802
|
-
var _elem$setAttribute, _elem$setAttribute2;
|
|
4803
|
-
// calc a hash for given string
|
|
4804
|
-
const hc = function () {
|
|
4805
|
-
let str = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
4806
|
-
let hash = 0;
|
|
4807
|
-
if (str.length === 0) return hash;
|
|
4808
|
-
for (let i = 0; i < str.length; i++) {
|
|
4809
|
-
const chr = str.charCodeAt(i);
|
|
4810
|
-
hash = (hash << 5) - hash + chr;
|
|
4811
|
-
hash |= 0;
|
|
4812
|
-
}
|
|
4813
|
-
return hash;
|
|
4814
|
-
};
|
|
4815
|
-
const hash = hc(display.logic);
|
|
4816
|
-
// Change hue based on hash
|
|
4817
|
-
const color = "hsl(" + hash % 360 + ",100%,75%)";
|
|
4818
|
-
if ("style" in elem) elem.style.background = color;
|
|
4819
|
-
// @ts-ignore
|
|
4820
|
-
elem === null || elem === void 0 || (_elem$setAttribute = elem.setAttribute) === null || _elem$setAttribute === void 0 || _elem$setAttribute.call(elem, "data-logic", display.logic);
|
|
4821
|
-
// @ts-ignore
|
|
4822
|
-
elem === null || elem === void 0 || (_elem$setAttribute2 = elem.setAttribute) === null || _elem$setAttribute2 === void 0 || _elem$setAttribute2.call(elem, "title", "Logic: " + display.logic);
|
|
4823
|
-
}
|
|
4824
|
-
});
|
|
4825
|
-
return elements;
|
|
4826
|
-
}
|
|
4827
|
-
var $70017d06e57dffa8$export$2e2bcd8739ae039 = $70017d06e57dffa8$export$50ce83ace0cdd87e;
|
|
4828
|
-
async function $70017d06e57dffa8$export$50ce83ace0cdd87e(t, rendering_options) {
|
|
4829
|
-
const {
|
|
4830
|
-
view_tracking: view_tracking,
|
|
4831
|
-
click_tracking: click_tracking
|
|
4832
|
-
} = rendering_options;
|
|
4833
|
-
return await $378c98788ab52b9c$export$a9fc160c5ed83bd7(t, {
|
|
4834
|
-
...rendering_options,
|
|
4835
|
-
headers: {
|
|
4836
|
-
...((0, $20fe9624210ef635$export$deca40f48c0569f8) ? {
|
|
4837
|
-
"x-debug": "true"
|
|
4838
|
-
} : {}),
|
|
4839
|
-
...(rendering_options.headers || {})
|
|
4840
|
-
},
|
|
4841
|
-
pre_processors: [...(rendering_options.pre_processors || [])],
|
|
4842
|
-
post_processors: [...(Array.isArray(view_tracking) ? view_tracking : (0, $943514d07f57df12$export$f37c58ab3d3e3b75)), ...(Array.isArray(click_tracking) ? click_tracking : (0, $943514d07f57df12$export$6830ae1fbe21e589)), ...((0, $20fe9624210ef635$export$deca40f48c0569f8) ? [(0, $20fe9624210ef635$export$16501883f477737a)] : []), ...(rendering_options.post_processors || [])]
|
|
4843
|
-
});
|
|
4844
|
-
}
|
|
4845
|
-
async function $d4f914b34cc77d0c$export$cab8bc58c64c2013(t, rendering_options, options_for_us, slider_options) {
|
|
4846
|
-
options_for_us || (options_for_us = {});
|
|
4847
|
-
const {
|
|
4848
|
-
root_selector: root_selector,
|
|
4849
|
-
override_rec_renderer: local_rr = (0, $70017d06e57dffa8$export$2e2bcd8739ae039),
|
|
4850
|
-
insertion_verb = "replaceWith",
|
|
4851
|
-
lazyfier_options: lazyfier_options
|
|
4852
|
-
} = options_for_us;
|
|
4853
|
-
let {
|
|
4854
|
-
container: container
|
|
4855
|
-
} = options_for_us;
|
|
4856
|
-
if (typeof container == "string") container = [...$652300c6621d5500$export$44951404cb8d0583(container)];
|
|
4857
|
-
if (container && !Array.isArray(container)) container = [...container];
|
|
4858
|
-
const slider = new (0, $f340c415f2e1d03a$export$68babfc5be0de5da)({
|
|
4859
|
-
dist_to_hide_left: 10,
|
|
4860
|
-
dist_to_hide_right: 10,
|
|
4861
|
-
...slider_options
|
|
4862
|
-
}, lazyfier_options);
|
|
4863
|
-
const recs = await local_rr(t, {
|
|
4864
|
-
...rendering_options,
|
|
4865
|
-
post_processors: [(elements, display) => {
|
|
4866
|
-
$652300c6621d5500$export$5e63aea0cac01fa0(elements, ".rec_outer").forEach(ro => ro.classList.add("noautospacing"));
|
|
4867
|
-
return elements;
|
|
4868
|
-
}, ...(rendering_options.post_processors || [])]
|
|
4869
|
-
});
|
|
4870
|
-
if (!recs.elements) {
|
|
4871
|
-
$241f2f02cc612a49$export$de56f1198d121036("Pro_Slider says bye bye cuz no recs");
|
|
4872
|
-
return {};
|
|
4873
|
-
}
|
|
4874
|
-
slider.insert_here.append(...recs.elements);
|
|
4875
|
-
if (container) {
|
|
4876
|
-
const [root] = $652300c6621d5500$export$5e63aea0cac01fa0(container, root_selector || ".grid");
|
|
4877
|
-
root[insertion_verb](slider.container);
|
|
4878
|
-
}
|
|
4879
|
-
return {
|
|
4880
|
-
...recs,
|
|
4881
|
-
displays: recs.displays,
|
|
4882
|
-
elements: container ? container : [slider.container]
|
|
4883
|
-
};
|
|
4884
|
-
}
|
|
4885
|
-
function $eb252431088a7c2b$var$_classPrivateFieldInitSpec(obj, privateMap, value) {
|
|
4886
|
-
$eb252431088a7c2b$var$_checkPrivateRedeclaration(obj, privateMap);
|
|
4887
|
-
privateMap.set(obj, value);
|
|
4888
|
-
}
|
|
4889
|
-
function $eb252431088a7c2b$var$_checkPrivateRedeclaration(obj, privateCollection) {
|
|
4890
|
-
if (privateCollection.has(obj)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
4891
|
-
}
|
|
4892
|
-
const $eb252431088a7c2b$var$discountMatcher = /{DISCOUNT{([\s\S]+?)}}/g;
|
|
4893
|
-
const $eb252431088a7c2b$var$noDiscountMatcher = /{NODISCOUNT{([\s\S]+?)}}/g;
|
|
4894
|
-
let $eb252431088a7c2b$var$pageview_sent = false;
|
|
4895
|
-
/**
|
|
4896
|
-
* @deprecated Please use recommendation renderer instead
|
|
4897
|
-
*/
|
|
4898
|
-
var $eb252431088a7c2b$var$_dispatched_recs_inserted = /*#__PURE__*/new WeakMap();
|
|
4899
|
-
class $eb252431088a7c2b$export$1a8782481a9af507 {
|
|
4900
|
-
constructor(settings) {
|
|
4901
|
-
$76EG6$babelruntimehelpersdefineProperty(this, "settings", void 0);
|
|
4902
|
-
$76EG6$babelruntimehelpersdefineProperty(this, "data", void 0);
|
|
4903
|
-
$76EG6$babelruntimehelpersdefineProperty(this, "tracker", void 0);
|
|
4904
|
-
$eb252431088a7c2b$var$_classPrivateFieldInitSpec(this, $eb252431088a7c2b$var$_dispatched_recs_inserted, {
|
|
4905
|
-
writable: true,
|
|
4906
|
-
value: false
|
|
4907
|
-
});
|
|
4908
|
-
this.settings = settings;
|
|
4909
|
-
}
|
|
4910
|
-
init(callback, existingDisplays) {
|
|
4911
|
-
if (!this.settings.DNT) this.trackPageView();
|
|
4912
|
-
if (!existingDisplays) this.loadRecommendations(callback);else {
|
|
4913
|
-
this.data = existingDisplays;
|
|
4914
|
-
callback();
|
|
4915
|
-
}
|
|
4916
|
-
}
|
|
4917
|
-
loadRecommendations(callback) {
|
|
4918
|
-
const {
|
|
4919
|
-
tenant: tenant,
|
|
4920
|
-
product_id: product_id,
|
|
4921
|
-
type: type,
|
|
4922
|
-
market: market
|
|
4923
|
-
} = this.settings;
|
|
4924
|
-
$51dfcecbe05cc4e5$export$1bc0df10745d5412(
|
|
4925
|
-
// @ts-ignore - Quick workaround, as we don't have a tenant object here
|
|
4926
|
-
{
|
|
4927
|
-
tenant: tenant,
|
|
4928
|
-
market: market
|
|
4929
|
-
}, {
|
|
4930
|
-
type: type,
|
|
4931
|
-
product_id: product_id()
|
|
4932
|
-
}).then(recs => {
|
|
4933
|
-
this.data = recs;
|
|
4934
|
-
$bcc7b73f8b96a6f0$export$8582cf3716962dc2({
|
|
4935
|
-
...this.settings,
|
|
4936
|
-
recs: this.data,
|
|
4937
|
-
min_recs: this.settings.min_items || this.settings.max_items
|
|
4938
|
-
});
|
|
4939
|
-
}).catch(e => {
|
|
4940
|
-
if (this.settings.debug) console.warn("template-tool: error fetching: ", e);
|
|
4941
|
-
}).finally(() => callback());
|
|
4942
|
-
}
|
|
4943
|
-
trackGAEvent(action, index, product_id, ga_product_ids) {
|
|
4944
|
-
if (this.settings.sendGa === false) return;
|
|
4945
|
-
// @ts-ignore
|
|
4946
|
-
if (typeof ga !== "function") {
|
|
4947
|
-
console.log("Could not send", action, "to GA. analytics.js not loaded.");
|
|
4948
|
-
return;
|
|
4949
|
-
}
|
|
4950
|
-
if (!action || action instanceof Event) action = "rec_bar_click";
|
|
4951
|
-
if (action == "rec_bar_click" && typeof index != "undefined" && product_id) {
|
|
4952
|
-
if (Array.isArray(ga_product_ids)) for (const id of ga_product_ids) $3674b9afc9a63520$export$f522672c9379e339(id, index, {
|
|
4953
|
-
list_name: "depict_" + this.settings.type
|
|
4954
|
-
});else $3674b9afc9a63520$export$f522672c9379e339(product_id, index, {
|
|
4955
|
-
list_name: "depict_" + this.settings.type
|
|
4956
|
-
});
|
|
4957
|
-
}
|
|
4958
|
-
if (this.tracker === undefined)
|
|
4959
|
-
// @ts-ignore
|
|
4960
|
-
this.tracker = ga("create", this.settings.gaid, "auto", "depict");
|
|
4961
|
-
$3674b9afc9a63520$export$f75172d2e289cd02(action);
|
|
4962
|
-
}
|
|
4963
|
-
trackPageView() {
|
|
4964
|
-
if ($eb252431088a7c2b$var$pageview_sent) {
|
|
4965
|
-
if (this.settings.debug) console.log("template-tool: not sending page view tracking to depict as it has already been sent");
|
|
4966
|
-
return;
|
|
4967
|
-
}
|
|
4968
|
-
$eb252431088a7c2b$var$pageview_sent = true;
|
|
4969
|
-
const {
|
|
4970
|
-
product_id: product_id
|
|
4971
|
-
} = this.settings;
|
|
4972
|
-
$0897f35c3b3fbbc4$export$eee4c4d924348b05(typeof product_id === "function" ? product_id() : product_id);
|
|
4973
|
-
}
|
|
4974
|
-
trackClick(index) {
|
|
4975
|
-
const item = this.data[index];
|
|
4976
|
-
if (item === undefined) return;
|
|
4977
|
-
return $d5f7352b58e0d737$export$15f8a0cd5a8c0ebb({
|
|
4978
|
-
...this.settings,
|
|
4979
|
-
...item,
|
|
4980
|
-
click_location: "".concat(this.settings.type, "_").concat(index + 1),
|
|
4981
|
-
product_id: item.product_id || this.settings.product_id(item.page_url)
|
|
4982
|
-
});
|
|
4983
|
-
}
|
|
4984
|
-
trackAddToCart(pId) {
|
|
4985
|
-
return $d5f7352b58e0d737$export$9028351cb994757e({
|
|
4986
|
-
...this.settings,
|
|
4987
|
-
product_id: pId && !(pId instanceof Event) ? pId : this.settings.product_id()
|
|
4988
|
-
});
|
|
4989
|
-
}
|
|
4990
|
-
createContainer(root, container) {
|
|
4991
|
-
let prepend = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
4992
|
-
function htmlToElements(html) {
|
|
4993
|
-
const template = document.createElement("template");
|
|
4994
|
-
template.innerHTML = html;
|
|
4995
|
-
return template.content.childNodes;
|
|
4996
|
-
}
|
|
4997
|
-
const elements = Array.from(htmlToElements(container));
|
|
4998
|
-
if (prepend) {
|
|
4999
|
-
elements.reverse();
|
|
5000
|
-
for (const el of elements) root.prepend(el);
|
|
5001
|
-
} else for (const el of elements) root.appendChild(el);
|
|
5002
|
-
}
|
|
5003
|
-
renderTemplate() {
|
|
5004
|
-
let {
|
|
5005
|
-
prep: prep,
|
|
5006
|
-
root: root,
|
|
5007
|
-
template: template,
|
|
5008
|
-
itemPreprocessor: itemPreprocessor,
|
|
5009
|
-
itemPostprocessor: itemPostprocessor
|
|
5010
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.settings;
|
|
5011
|
-
if (document._depict_modify !== true) {
|
|
5012
|
-
if (this.settings.debug) console.warn("Template-tool: not running because document._depict_modify is false!", this);
|
|
5013
|
-
return;
|
|
5014
|
-
}
|
|
5015
|
-
if (!this.data) return;
|
|
5016
|
-
const product_id_at_rendering = this.settings.product_id();
|
|
5017
|
-
if (typeof prep === "function") prep();
|
|
5018
|
-
const interpolator = t => {
|
|
5019
|
-
return function (item) {
|
|
5020
|
-
// Conditional statements
|
|
5021
|
-
// {if VAR_NAME}
|
|
5022
|
-
// print this if true
|
|
5023
|
-
// {else}
|
|
5024
|
-
// print this if false
|
|
5025
|
-
// {end}
|
|
5026
|
-
// Note: these can't be nested
|
|
5027
|
-
t = t.replace(/{if\s+(.+?)}([\S\s]*?)(?:{else}([\S\s]*?))?{end}/g, (_, variable, if_yes, if_no) => {
|
|
5028
|
-
if (typeof if_no !== "string")
|
|
5029
|
-
// if_no is a number if there's no {else} statement
|
|
5030
|
-
if_no = "";
|
|
5031
|
-
return item[variable] ? if_yes : if_no;
|
|
5032
|
-
});
|
|
5033
|
-
return t.replace(/\${(.*?)}/g, (_, g) => item[g]); // this is copied from here, I hope I'm not breaking any licenses. Need it to transpile for IE11 compatiblity: https://github.com/mikemaccana/dynamic-template/blob/master/index.js
|
|
5034
|
-
// if you need variables that go over multiple lines:
|
|
5035
|
-
// const matcher = /\${([^}]+)}/g;
|
|
5036
|
-
};
|
|
5037
|
-
};
|
|
5038
|
-
|
|
5039
|
-
const elementsFromHTML = html => new DOMParser().parseFromString(html, "text/html").body.children;
|
|
5040
|
-
const getContent = () => {
|
|
5041
|
-
const recsArray = [];
|
|
5042
|
-
const resultingElements = [];
|
|
5043
|
-
this.data.forEach((item, rec_index) => {
|
|
5044
|
-
if (typeof itemPreprocessor === "function") {
|
|
5045
|
-
item = itemPreprocessor(item, rec_index);
|
|
5046
|
-
if (!Object.keys(item).length) {
|
|
5047
|
-
if (this.settings.debug) console.info("template-tool: discarding display", item, "because it is empty");
|
|
2929
|
+
constructor(options, lazyfier_options) {
|
|
2930
|
+
super(options);
|
|
2931
|
+
const lazy_promise = new Promise(r => {
|
|
2932
|
+
(0, $90fa633a9564f115$export$b6ae1bc530f4c149).onexists(this.insert_here, _ref => {
|
|
2933
|
+
let {
|
|
2934
|
+
element: element,
|
|
2935
|
+
disconnector: disconnector
|
|
2936
|
+
} = _ref;
|
|
2937
|
+
const i_o = new IntersectionObserver($5e1f45affc1d7def$export$b3bbfd758f11cfa9(records => {
|
|
2938
|
+
for (const record of records) if (record.intersectionRatio > 0) {
|
|
2939
|
+
r(true);
|
|
2940
|
+
i_o.disconnect();
|
|
2941
|
+
disconnector();
|
|
5048
2942
|
return;
|
|
5049
2943
|
}
|
|
5050
|
-
}
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
item.discount = "\u2013".concat(Math.round(100 * (1 - item.sale_price / item.original_price)), "%");
|
|
5057
|
-
} else {
|
|
5058
|
-
itemTemplate = template.replaceAll($eb252431088a7c2b$var$discountMatcher, "").replaceAll($eb252431088a7c2b$var$noDiscountMatcher, "$1");
|
|
5059
|
-
item.discount = "";
|
|
5060
|
-
}
|
|
5061
|
-
const resultHTML = interpolator(itemTemplate)(item);
|
|
5062
|
-
let elements = elementsFromHTML(resultHTML);
|
|
5063
|
-
if (!this.settings.DNT) for (const element of elements) {
|
|
5064
|
-
// recommendations_inserted event
|
|
5065
|
-
(0, $90fa633a9564f115$export$b6ae1bc530f4c149).oncreation(element, () => {
|
|
5066
|
-
if (!$76EG6$babelruntimehelpersclassPrivateFieldGet(this, $eb252431088a7c2b$var$_dispatched_recs_inserted)) {
|
|
5067
|
-
$76EG6$babelruntimehelpersclassPrivateFieldSet(this, $eb252431088a7c2b$var$_dispatched_recs_inserted, true);
|
|
5068
|
-
$d5f7352b58e0d737$export$82badda1f9923310({
|
|
5069
|
-
...this.settings,
|
|
5070
|
-
product_id: product_id_at_rendering,
|
|
5071
|
-
recommendation_type: this.settings.type,
|
|
5072
|
-
type: "recommendations_inserted"
|
|
5073
|
-
});
|
|
5074
|
-
}
|
|
5075
|
-
});
|
|
5076
|
-
const listener = e => {
|
|
5077
|
-
this.trackClick(rec_index);
|
|
5078
|
-
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);
|
|
5079
|
-
};
|
|
5080
|
-
element.addEventListener("click", listener);
|
|
5081
|
-
$bd7c9f254946941d$export$82a685f2da2fb027(element, item.product_id, item.recommendation_id);
|
|
5082
|
-
if (this.settings.shade) $f2fce07b3a330e05$export$6ebd242c09192cec(element);
|
|
5083
|
-
// @ts-ignore
|
|
5084
|
-
if (!element.depict_event_listeners)
|
|
5085
|
-
// @ts-ignore
|
|
5086
|
-
element.depict_event_listeners = [];
|
|
5087
|
-
// @ts-ignore
|
|
5088
|
-
element.depict_event_listeners.push(listener);
|
|
5089
|
-
}
|
|
5090
|
-
if (typeof itemPostprocessor === "function") elements = itemPostprocessor(elements, item);
|
|
5091
|
-
resultingElements.push(...elements);
|
|
5092
|
-
});
|
|
5093
|
-
this.data = recsArray;
|
|
5094
|
-
if (!this.settings.DNT) $3674b9afc9a63520$export$7babcd5d4056b2ca(recsArray, this.settings.product_id, {
|
|
5095
|
-
list_name: "depict_" + this.settings.type
|
|
2944
|
+
}),
|
|
2945
|
+
// Fixes https://gitlab.com/depict-ai/depict.ai/-/merge_requests/5816/diffs, don't understand why
|
|
2946
|
+
{
|
|
2947
|
+
threshold: $ab9c3dbf2bb2fbf7$export$f8ea2e7b15b5d129(10)
|
|
2948
|
+
});
|
|
2949
|
+
i_o.observe(element);
|
|
5096
2950
|
});
|
|
5097
|
-
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
|
|
5103
|
-
let MAX_RETRY = Math.round(10000 / SLEEP_TIME_MS);
|
|
5104
|
-
const tick = setInterval(() => {
|
|
5105
|
-
const r = root();
|
|
5106
|
-
if (MAX_RETRY === 0) clearInterval(tick);
|
|
5107
|
-
MAX_RETRY--;
|
|
5108
|
-
if (r !== null) {
|
|
5109
|
-
r.append(...renderedContent);
|
|
5110
|
-
clearInterval(tick);
|
|
5111
|
-
}
|
|
5112
|
-
}, SLEEP_TIME_MS);
|
|
5113
|
-
} else if (document.readyState === "loading") document.addEventListener("DOMContentLoaded", () => {
|
|
5114
|
-
const r = root();
|
|
5115
|
-
r.append(...renderedContent);
|
|
5116
|
-
}, {
|
|
5117
|
-
once: true
|
|
5118
|
-
});else {
|
|
5119
|
-
const r = root();
|
|
5120
|
-
r.append(...renderedContent);
|
|
5121
|
-
}
|
|
5122
|
-
return;
|
|
5123
|
-
}
|
|
5124
|
-
root.append(...renderedContent);
|
|
2951
|
+
});
|
|
2952
|
+
this.lazyfier = new (0, $5f31622ffb78bc10$export$3be7054c61590ee3)({
|
|
2953
|
+
container: this.insert_here,
|
|
2954
|
+
wait_for_dominsertion: lazy_promise,
|
|
2955
|
+
...(lazyfier_options || {})
|
|
2956
|
+
});
|
|
5125
2957
|
}
|
|
5126
2958
|
}
|
|
5127
|
-
var
|
|
5128
|
-
/**
|
|
5129
|
-
* @deprecated Please use RecommendationRenderer instead
|
|
5130
|
-
*/
|
|
5131
|
-
$48b0f027b215b8ad$export$2e2bcd8739ae039 = async options => {
|
|
5132
|
-
const depict = new (0, $eb252431088a7c2b$export$1a8782481a9af507)(options.options),
|
|
5133
|
-
done = new Promise(itsdone => {
|
|
5134
|
-
document._depict_modify = true;
|
|
5135
|
-
depict.init(() => {
|
|
5136
|
-
depict.renderTemplate({
|
|
5137
|
-
itemPostprocessor: options.postProcessor,
|
|
5138
|
-
itemPreprocessor: options.preProcessor,
|
|
5139
|
-
root: options.root,
|
|
5140
|
-
template: options.template
|
|
5141
|
-
});
|
|
5142
|
-
itsdone();
|
|
5143
|
-
}, options.recs);
|
|
5144
|
-
});
|
|
5145
|
-
await done;
|
|
5146
|
-
return depict;
|
|
5147
|
-
};
|
|
5148
|
-
|
|
5149
|
-
// @ts-ignore
|
|
5150
|
-
var $d58f55a8abd5e8fe$exports = {};
|
|
5151
|
-
$d58f55a8abd5e8fe$exports = ".depict .rec_outer.noautospacing {\n width: 6cm;\n max-width: 46vw;\n margin-left: 1%;\n margin-right: 1%;\n}\n\n.depict .rec_outer.noautospacing:nth-child(1) {\n margin-left: 0;\n}\n\n.depict .rec_outer.noautospacing:nth-last-child(1) {\n margin-right: 0;\n}\n\n.depict-slider .slider_snap {\n scroll-snap-type: x mandatory;\n}\n\n.depict-slider {\n width: 100%;\n position: relative;\n}\n\n.depict-slider .sliding::-webkit-scrollbar {\n display: none;\n}\n\n.depict-slider .sliding {\n scroll-behavior: smooth;\n -ms-overflow-style: none;\n scrollbar-width: none;\n flex-flow: row;\n margin-top: -1%;\n margin-bottom: -2%;\n padding-top: 1%;\n padding-bottom: 2%;\n display: flex;\n overflow-x: scroll;\n}\n\n.depict-slider .sliding > * {\n box-sizing: border-box;\n flex: none;\n}\n\n.depict-slider button.right {\n right: 0;\n}\n\n.depict-slider button.left, .depict-slider button.right {\n z-index: 2;\n touch-action: manipulation;\n width: 1cm;\n height: 1cm;\n cursor: pointer;\n background: #fff;\n border: none;\n padding: .5%;\n transition-duration: .2s;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n}\n\n.depict-slider button.left.hidden, .depict-slider button.right.hidden {\n opacity: 0;\n cursor: default;\n}\n\n.depict-slider button.left {\n left: 0;\n transform: translateY(-50%)rotate(180deg);\n}\n\n.depict-slider button.left img, .depict-slider button.right img {\n width: 100%;\n height: 100%;\n}\n\n.depict-slider .rec_outer {\n margin-top: 0 !important;\n}\n\n";
|
|
5152
2959
|
const $0342f59060b8a196$var$default_image_src = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjYsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiDQoJIHZpZXdCb3g9IjAgMCAxNiAxNiIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMTYgMTY7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxwb2x5Z29uIHBvaW50cz0iOSwyLjYgOC4zLDMuNCAxMi40LDcuNSAxLjYsNy41IDEuNiw4LjUgMTIuNCw4LjUgOC4zLDEyLjYgOSwxMy40IDE0LjQsOCAiLz4NCjwvc3ZnPg0K";
|
|
5153
2960
|
class $0342f59060b8a196$export$4d41c6499d53639c extends (0, $f340c415f2e1d03a$export$68babfc5be0de5da) {
|
|
5154
2961
|
constructor(static_options, override_lazyfier_options) {
|
|
@@ -5180,237 +2987,33 @@ class $0342f59060b8a196$export$4d41c6499d53639c extends (0, $f340c415f2e1d03a$ex
|
|
|
5180
2987
|
function $0342f59060b8a196$export$f1b8b9fd75ddcab1(slider) {
|
|
5181
2988
|
const style_elem = document.createElement("style");
|
|
5182
2989
|
style_elem.type = "text/css";
|
|
5183
|
-
style_elem.append((0, /*@__PURE__*/$parcel$interopDefault($
|
|
2990
|
+
style_elem.append((0, /*@__PURE__*/$parcel$interopDefault($bb2bb8f189a68651$exports)));
|
|
5184
2991
|
slider.container.appendChild(style_elem);
|
|
5185
2992
|
}
|
|
5186
|
-
|
|
5187
|
-
|
|
5188
|
-
|
|
5189
|
-
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
|
|
5196
|
-
|
|
5197
|
-
|
|
5198
|
-
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
|
|
5205
|
-
|
|
5206
|
-
dist_to_hide_right: 6,
|
|
5207
|
-
...slider_options
|
|
5208
|
-
}, override_lazyfier_options);
|
|
5209
|
-
const recs = await local_rr(t, {
|
|
5210
|
-
...rendering_options,
|
|
5211
|
-
post_processors: [(elements, display) => {
|
|
5212
|
-
$652300c6621d5500$export$5e63aea0cac01fa0(elements, "a.rec_outer").forEach(ro => ro.classList.add("noautospacing"));
|
|
5213
|
-
return elements;
|
|
5214
|
-
}, ...(rendering_options.post_processors || [])]
|
|
5215
|
-
});
|
|
5216
|
-
if (!recs.elements) {
|
|
5217
|
-
dlog("RR_Slider says bye bye cuz no recs");
|
|
5218
|
-
return {};
|
|
5219
|
-
}
|
|
5220
|
-
slider.insert_here.append(...recs.elements);
|
|
5221
|
-
if (container) {
|
|
5222
|
-
const [root] = $652300c6621d5500$export$5e63aea0cac01fa0(container, root_selector || ".grid");
|
|
5223
|
-
root[insertion_verb](slider.container);
|
|
5224
|
-
}
|
|
5225
|
-
return {
|
|
5226
|
-
...recs,
|
|
5227
|
-
displays: recs.displays,
|
|
5228
|
-
elements: container ? container : [slider.container]
|
|
5229
|
-
};
|
|
5230
|
-
}
|
|
5231
|
-
var $193ee64f5599f8a8$var$_tmpl$ = /*#__PURE__*/$76EG6$template(`<button class=load_more>`);
|
|
5232
|
-
async function $193ee64f5599f8a8$export$30933c637c977eef(_ref) {
|
|
5233
|
-
var _template_tool$data;
|
|
5234
|
-
let {
|
|
5235
|
-
t: t,
|
|
5236
|
-
recs: recs,
|
|
5237
|
-
title: title,
|
|
5238
|
-
infinite_scroll = false,
|
|
5239
|
-
with_slider = false,
|
|
5240
|
-
with_loadmore = false,
|
|
5241
|
-
template_tool_options: template_tool_options,
|
|
5242
|
-
slider_options = {},
|
|
5243
|
-
pre_processors = [],
|
|
5244
|
-
post_processors = [],
|
|
5245
|
-
container_template: container_template,
|
|
5246
|
-
template:
|
|
5247
|
-
// container template
|
|
5248
|
-
template,
|
|
5249
|
-
// recommendation template
|
|
5250
|
-
chunk_size_for_load_more = 4,
|
|
5251
|
-
insertion_promise: insertion_promise,
|
|
5252
|
-
view_more_text: view_more_text
|
|
5253
|
-
} = _ref;
|
|
5254
|
-
const {
|
|
5255
|
-
catchify: catchify,
|
|
5256
|
-
dlog: dlog
|
|
5257
|
-
} = t,
|
|
5258
|
-
container = [...$652300c6621d5500$export$44951404cb8d0583(container_template)],
|
|
5259
|
-
root = $652300c6621d5500$export$5e63aea0cac01fa0(container, ".grid")[0],
|
|
5260
|
-
internal_pre_processors = [...pre_processors],
|
|
5261
|
-
// 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
|
|
5262
|
-
internal_post_processors = [...post_processors];
|
|
5263
|
-
if (with_slider) var slider = catchify(() => new (0, $0342f59060b8a196$export$4d41c6499d53639c)({
|
|
5264
|
-
...t,
|
|
5265
|
-
arrow_image: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHN0eWxlPSJkaXNwbGF5OiBpbmxpbmUtYmxvY2s7IHZlcnRpY2FsLWFsaWduOiBtaWRkbGU7IiB3aWR0aD0iMTZweCIgaGVpZ2h0PSIxNnB4IiB2aWV3Qm94PSIwIDAgOCAxNSI+PHBhdGggc3R5bGU9ImZpbGw6IHJnYigwLCAwLCAwKTsiIGQ9Ik0uNjI5LjAwMWMuMTUuMDA4LjI5My4wNzIuMzk4LjE4bDYuNzkyIDYuODlhLjYwMS42MDEgMCAwIDEgMCAuODZsLTYuNzkyIDYuODg4YS41ODYuNTg2IDAgMCAxLS44NDYgMCAuNjAxLjYwMSAwIDAgMSAwLS44Nkw2LjU1NCA3LjUuMjExIDEuMDAxYS42MDEuNjAxIDAgMCAxIDAtLjg2Yy4xMTUtLjEuMjY2LS4xNS40MTgtLjE0Ij48L3BhdGg+PC9zdmc+",
|
|
5266
|
-
...slider_options
|
|
5267
|
-
}))();
|
|
5268
|
-
if (slider) {
|
|
5269
|
-
root.replaceWith(slider.container);
|
|
5270
|
-
if (insertion_promise) internal_post_processors.push((t, items, d) => {
|
|
5271
|
-
for (const item of items) insertion_promise.then(() => {
|
|
5272
|
-
$e89a1d249db21af0$export$37125ccc5dd98050({
|
|
5273
|
-
element: item,
|
|
5274
|
-
data: {
|
|
5275
|
-
tenant: t.tenant,
|
|
5276
|
-
entity_price: d.entity_price,
|
|
5277
|
-
recommendation_id: d.recommendation_id,
|
|
5278
|
-
market: t.market,
|
|
5279
|
-
product_id: d.product_id,
|
|
5280
|
-
recommendation_type: d.recommendation_type
|
|
5281
|
-
},
|
|
5282
|
-
wait_for_dom_insertion: false
|
|
5283
|
-
});
|
|
5284
|
-
});
|
|
5285
|
-
return items;
|
|
5286
|
-
});
|
|
5287
|
-
}
|
|
5288
|
-
if (!slider || !insertion_promise) internal_post_processors.push((t, items, d) => {
|
|
5289
|
-
for (const item of items) $e89a1d249db21af0$export$37125ccc5dd98050({
|
|
5290
|
-
element: item,
|
|
5291
|
-
data: {
|
|
5292
|
-
tenant: t.tenant,
|
|
5293
|
-
entity_price: d.entity_price,
|
|
5294
|
-
recommendation_id: d.recommendation_id,
|
|
5295
|
-
market: t.market,
|
|
5296
|
-
product_id: d.product_id,
|
|
5297
|
-
recommendation_type: d.recommendation_type
|
|
5298
|
-
},
|
|
5299
|
-
wait_for_dom_insertion: false
|
|
5300
|
-
});
|
|
5301
|
-
return items;
|
|
5302
|
-
});
|
|
5303
|
-
const template_tool = await $48b0f027b215b8ad$export$2e2bcd8739ae039({
|
|
5304
|
-
options: {
|
|
5305
|
-
...t,
|
|
5306
|
-
...(template_tool_options || {})
|
|
5307
|
-
},
|
|
5308
|
-
root: slider ? slider.insert_here : root,
|
|
5309
|
-
recs: recs,
|
|
5310
|
-
template: template,
|
|
5311
|
-
preProcessor: (d, i) => {
|
|
5312
|
-
return internal_pre_processors.reduce((accumulator, currentValue) => {
|
|
5313
|
-
// basic pre processor pipeline
|
|
5314
|
-
return catchify(currentValue)(t, accumulator, i, with_loadmore, with_slider, infinite_scroll) || accumulator;
|
|
5315
|
-
}, d);
|
|
5316
|
-
},
|
|
5317
|
-
postProcessor: (items, d) => {
|
|
5318
|
-
return internal_post_processors.reduce((accumulator, currentValue) => {
|
|
5319
|
-
// basic post processor pipeline
|
|
5320
|
-
return catchify(currentValue)(t, accumulator, d, slider) || accumulator;
|
|
5321
|
-
}, items);
|
|
5322
|
-
}
|
|
5323
|
-
});
|
|
5324
|
-
if (with_loadmore) catchify($193ee64f5599f8a8$var$setup_load_more)(t, root, chunk_size_for_load_more, view_more_text);
|
|
5325
|
-
if (infinite_scroll) catchify($193ee64f5599f8a8$var$setup_infinite_scroll)(t, root);
|
|
5326
|
-
if (title) {
|
|
5327
|
-
const [title_element] = $652300c6621d5500$export$5e63aea0cac01fa0(container, "h1.title, h2.title, h3.title, h4.title, h5.title, h6.title");
|
|
5328
|
-
if (title_element) {
|
|
5329
|
-
if (typeof title == "string") title_element.innerText = title;else title_element.replaceWith(...title);
|
|
2993
|
+
|
|
2994
|
+
// not ideal but can help when debugging via sentry
|
|
2995
|
+
/**
|
|
2996
|
+
* A function that attempts to "serialize" an object to a text representation that helps with debugging when using sentry
|
|
2997
|
+
* @param anything Something to try to serialize - this function is crappy and your mileage may vary
|
|
2998
|
+
* @param depth How deep to go when recursing
|
|
2999
|
+
* @return An object that is somehow closer to text (better serializable by sentry) or text
|
|
3000
|
+
*/
|
|
3001
|
+
function $d9aec442b12a1134$export$39d526a1194b6499(anything, depth) {
|
|
3002
|
+
var _depth;
|
|
3003
|
+
(_depth = depth) !== null && _depth !== void 0 ? _depth : depth = 0;
|
|
3004
|
+
depth++;
|
|
3005
|
+
if (depth > 30) return anything;
|
|
3006
|
+
const output = {};
|
|
3007
|
+
for (const key in anything) {
|
|
3008
|
+
const value = anything[key];
|
|
3009
|
+
let serialized_value;
|
|
3010
|
+
if (value instanceof Element) serialized_value = value.cloneNode(false).outerHTML;else if (value instanceof Headers) serialized_value = Object.fromEntries(value.entries());else if (typeof value == "object" && value != null && (typeof value[Symbol.iterator] === "function" || value instanceof Response)) serialized_value = $d9aec442b12a1134$export$39d526a1194b6499(value, depth);else {
|
|
3011
|
+
var _value$toString;
|
|
3012
|
+
serialized_value = value === null || value === void 0 ? void 0 : (_value$toString = value.toString) === null || _value$toString === void 0 ? void 0 : _value$toString.call(value);
|
|
5330
3013
|
}
|
|
3014
|
+
output[key] = serialized_value;
|
|
5331
3015
|
}
|
|
5332
|
-
|
|
5333
|
-
}
|
|
5334
|
-
function $193ee64f5599f8a8$var$setup_infinite_scroll(t, root) {
|
|
5335
|
-
const {
|
|
5336
|
-
dlog: dlog,
|
|
5337
|
-
catchify: catchify
|
|
5338
|
-
} = t,
|
|
5339
|
-
get_last_visible_el = () => [...root.querySelectorAll("a.rec_outer:not(.not_visible)")].slice(-1)[0],
|
|
5340
|
-
last_visible_el = get_last_visible_el();
|
|
5341
|
-
if (!last_visible_el) {
|
|
5342
|
-
dlog("not setting up infinite scroll as there are no elements");
|
|
5343
|
-
return;
|
|
5344
|
-
}
|
|
5345
|
-
const intersection_observer = new IntersectionObserver(catchify(records => {
|
|
5346
|
-
dlog("Intersection observer for", last_visible_el, "has records", records);
|
|
5347
|
-
records.forEach(record => {
|
|
5348
|
-
if (record.isIntersecting && record.target == get_last_visible_el()) {
|
|
5349
|
-
dlog("Loading more recs because of", record);
|
|
5350
|
-
if ($193ee64f5599f8a8$var$load_more_elements(root)) $193ee64f5599f8a8$var$setup_infinite_scroll(t, root);
|
|
5351
|
-
}
|
|
5352
|
-
});
|
|
5353
|
-
}));
|
|
5354
|
-
dlog("starting to intersection observe", last_visible_el, "for infinite scroll");
|
|
5355
|
-
intersection_observer.observe(last_visible_el);
|
|
5356
|
-
}
|
|
5357
|
-
function $193ee64f5599f8a8$var$load_more_elements(root) {
|
|
5358
|
-
let chunk_size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 4;
|
|
5359
|
-
const hidden_elements = root.querySelectorAll("a.rec_outer.not_visible");
|
|
5360
|
-
let i = 0;
|
|
5361
|
-
for (; i < Math.min(hidden_elements.length, chunk_size); i++) {
|
|
5362
|
-
// @ts-ignore
|
|
5363
|
-
hidden_elements[i].load_image();
|
|
5364
|
-
hidden_elements[i].classList.remove("not_visible");
|
|
5365
|
-
}
|
|
5366
|
-
const has_more = i >= chunk_size && hidden_elements.length > chunk_size;
|
|
5367
|
-
return has_more;
|
|
5368
|
-
}
|
|
5369
|
-
function $193ee64f5599f8a8$var$setup_load_more(t, root, chunk_size) {
|
|
5370
|
-
let view_more_text = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "Visa mer";
|
|
5371
|
-
const {
|
|
5372
|
-
catchify: catchify
|
|
5373
|
-
} = t,
|
|
5374
|
-
load_more_cont = $652300c6621d5500$export$d3e2a0560cbf4787('<div class="load-more-container"></div>'),
|
|
5375
|
-
load_button = load_more_cont.appendChild((() => {
|
|
5376
|
-
var _el$ = $76EG6$getNextElement($193ee64f5599f8a8$var$_tmpl$);
|
|
5377
|
-
$76EG6$insert(_el$, view_more_text);
|
|
5378
|
-
return _el$;
|
|
5379
|
-
})());
|
|
5380
|
-
load_button.addEventListener("click", catchify(load_more_recs_and_hide_button_if_needed));
|
|
5381
|
-
root.after(load_more_cont);
|
|
5382
|
-
load_more_recs_and_hide_button_if_needed();
|
|
5383
|
-
function load_more_recs_and_hide_button_if_needed() {
|
|
5384
|
-
if (!$193ee64f5599f8a8$var$load_more_elements(root, chunk_size))
|
|
5385
|
-
// there aren't any recs left to display
|
|
5386
|
-
load_button.classList.add("not_visible");
|
|
5387
|
-
}
|
|
5388
|
-
}
|
|
5389
|
-
function $193ee64f5599f8a8$export$4f39078bdc72ecd0(_t, d, i, with_loadmore, with_slider, infinite_scroll) {
|
|
5390
|
-
d.class || (d.class = "");
|
|
5391
|
-
if (infinite_scroll) d.class = i >= 4 ? "not_visible" : ""; // this will make it hold image loading until .load_image is called on .rec_outer
|
|
5392
|
-
if (with_loadmore) d.class = "not_visible";
|
|
5393
|
-
d.percentage_off = Math.round(100 - d.sale_price / d.original_price * 100);
|
|
5394
|
-
if (!d.percentage_off || d.percentage_off < 10) d.percentage_off = "";
|
|
5395
|
-
return d;
|
|
5396
|
-
}
|
|
5397
|
-
function $193ee64f5599f8a8$export$c410ce1205e5118a(_t, itms, d, slider) {
|
|
5398
|
-
for (const item of itms) {
|
|
5399
|
-
const {
|
|
5400
|
-
image_url: image_url
|
|
5401
|
-
} = d,
|
|
5402
|
-
img = item.querySelector("img.image"),
|
|
5403
|
-
load_image = () => {
|
|
5404
|
-
var _slider$observe;
|
|
5405
|
-
img.src = image_url;
|
|
5406
|
-
slider === null || slider === void 0 || (_slider$observe = slider.observe) === null || _slider$observe === void 0 || _slider$observe.call(slider, img);
|
|
5407
|
-
};
|
|
5408
|
-
if (item.classList.contains("not_visible") || slider)
|
|
5409
|
-
// @ts-ignore
|
|
5410
|
-
item.load_image = load_image;else load_image();
|
|
5411
|
-
if (slider) item.classList.add("noautospacing");
|
|
5412
|
-
}
|
|
5413
|
-
return itms;
|
|
3016
|
+
return output;
|
|
5414
3017
|
}
|
|
5415
3018
|
var
|
|
5416
3019
|
/**
|
|
@@ -5556,6 +3159,35 @@ const $0fe3923936d40f55$export$68c017fd93791405 = function () {
|
|
|
5556
3159
|
container: container
|
|
5557
3160
|
};
|
|
5558
3161
|
};
|
|
3162
|
+
const $20fe9624210ef635$export$deca40f48c0569f8 = typeof window === "undefined" ? false : /*@__PURE__*/localStorage.getItem("colorize-logics") === "true";
|
|
3163
|
+
function $20fe9624210ef635$export$16501883f477737a(elements, display) {
|
|
3164
|
+
elements.forEach(elem => {
|
|
3165
|
+
if (elem.nodeType !== Node.TEXT_NODE) {
|
|
3166
|
+
var _elem$setAttribute, _elem$setAttribute2;
|
|
3167
|
+
// calc a hash for given string
|
|
3168
|
+
const hc = function () {
|
|
3169
|
+
let str = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
3170
|
+
let hash = 0;
|
|
3171
|
+
if (str.length === 0) return hash;
|
|
3172
|
+
for (let i = 0; i < str.length; i++) {
|
|
3173
|
+
const chr = str.charCodeAt(i);
|
|
3174
|
+
hash = (hash << 5) - hash + chr;
|
|
3175
|
+
hash |= 0;
|
|
3176
|
+
}
|
|
3177
|
+
return hash;
|
|
3178
|
+
};
|
|
3179
|
+
const hash = hc(display.logic);
|
|
3180
|
+
// Change hue based on hash
|
|
3181
|
+
const color = "hsl(" + hash % 360 + ",100%,75%)";
|
|
3182
|
+
if ("style" in elem) elem.style.background = color;
|
|
3183
|
+
// @ts-ignore
|
|
3184
|
+
elem === null || elem === void 0 || (_elem$setAttribute = elem.setAttribute) === null || _elem$setAttribute === void 0 || _elem$setAttribute.call(elem, "data-logic", display.logic);
|
|
3185
|
+
// @ts-ignore
|
|
3186
|
+
elem === null || elem === void 0 || (_elem$setAttribute2 = elem.setAttribute) === null || _elem$setAttribute2 === void 0 || _elem$setAttribute2.call(elem, "title", "Logic: " + display.logic);
|
|
3187
|
+
}
|
|
3188
|
+
});
|
|
3189
|
+
return elements;
|
|
3190
|
+
}
|
|
5559
3191
|
function $07beada135e5f5e8$export$f8913c8a18f7ca21(iterables) {
|
|
5560
3192
|
const ourselves = $7ca6fdc721083788$export$e806c6c1615a59ae();
|
|
5561
3193
|
const values = new Array(iterables.length);
|
|
@@ -5807,100 +3439,6 @@ class $df6d080cba513381$var$CSSMeasurement {
|
|
|
5807
3439
|
this.u = unit;
|
|
5808
3440
|
}
|
|
5809
3441
|
}
|
|
5810
|
-
async function $297a08bac2d81fab$export$b0a773486c1c2312(t, recommendation_renderer_options, _ref) {
|
|
5811
|
-
let {
|
|
5812
|
-
container_elements: container_elements,
|
|
5813
|
-
container_selector: container_selector,
|
|
5814
|
-
override_rec_renderer: override_rec_renderer,
|
|
5815
|
-
lazyfier_options = {},
|
|
5816
|
-
eager_images: eager_images,
|
|
5817
|
-
...options_for_grid
|
|
5818
|
-
} = _ref;
|
|
5819
|
-
const [insertion_point] = $652300c6621d5500$export$5e63aea0cac01fa0(container_elements, container_selector || ".grid");
|
|
5820
|
-
const rendering_result = await (override_rec_renderer || (0, $70017d06e57dffa8$export$2e2bcd8739ae039))(t, recommendation_renderer_options);
|
|
5821
|
-
const {
|
|
5822
|
-
elements: elements
|
|
5823
|
-
} = rendering_result;
|
|
5824
|
-
if (!elements) return rendering_result;
|
|
5825
|
-
if (!eager_images)
|
|
5826
|
-
// convoluted lazy loading that
|
|
5827
|
-
// when the elements are in the DOM starts IntersectionObserver on whole grid
|
|
5828
|
-
// when grid intersects starts Lazyfier
|
|
5829
|
-
// this is because Lazyfier is fucking stupid
|
|
5830
|
-
(0, $90fa633a9564f115$export$b6ae1bc530f4c149).wait_for_element(insertion_point).then($5e1f45affc1d7def$export$b3bbfd758f11cfa9(element => {
|
|
5831
|
-
let start_lazy_loading;
|
|
5832
|
-
const lazy_loading_promise = new Promise(r => start_lazy_loading = r);
|
|
5833
|
-
const lf = new (0, $5f31622ffb78bc10$export$3be7054c61590ee3)({
|
|
5834
|
-
only_load_intersecting: true,
|
|
5835
|
-
wait_for_dominsertion: lazy_loading_promise,
|
|
5836
|
-
...lazyfier_options
|
|
5837
|
-
});
|
|
5838
|
-
lf.start_observing_for_new_children_(element);
|
|
5839
|
-
const i_o = new IntersectionObserver($5e1f45affc1d7def$export$b3bbfd758f11cfa9(records => {
|
|
5840
|
-
for (const record of records) if (record.intersectionRatio > 0) {
|
|
5841
|
-
start_lazy_loading();
|
|
5842
|
-
i_o.disconnect();
|
|
5843
|
-
return;
|
|
5844
|
-
}
|
|
5845
|
-
}));
|
|
5846
|
-
i_o.observe(insertion_point);
|
|
5847
|
-
}));
|
|
5848
|
-
insertion_point.append(...elements);
|
|
5849
|
-
$df6d080cba513381$export$c84671f46d6a1ca({
|
|
5850
|
-
...options_for_grid,
|
|
5851
|
-
container_element: insertion_point,
|
|
5852
|
-
layout: "grid"
|
|
5853
|
-
}).catch((0, $b000f5ef6ce456d9$export$8048b892d651b310));
|
|
5854
|
-
return {
|
|
5855
|
-
...rendering_result,
|
|
5856
|
-
elements: container_elements
|
|
5857
|
-
};
|
|
5858
|
-
}
|
|
5859
|
-
|
|
5860
|
-
// @ts-ignore
|
|
5861
|
-
var $f10bc4dab5f8ea7b$exports = {};
|
|
5862
|
-
$f10bc4dab5f8ea7b$exports = ".depict-slider {\n width: 100%;\n position: relative;\n}\n\n.depict-slider .sliding {\n scroll-behavior: smooth;\n -ms-overflow-style: none;\n scrollbar-width: none;\n flex-flow: row;\n display: flex;\n overflow-x: scroll;\n}\n\n.depict-slider .sliding::-webkit-scrollbar {\n display: none;\n}\n\n.depict-slider .sliding > * {\n box-sizing: border-box;\n flex: none;\n}\n\n";
|
|
5863
|
-
let $d89e3aaeb9270095$var$slider_styling_was_inserted = false;
|
|
5864
|
-
async function $d89e3aaeb9270095$export$82cfdc85a4d15688(t, recommendation_renderer_options, _ref) {
|
|
5865
|
-
let {
|
|
5866
|
-
container_elements: container_elements,
|
|
5867
|
-
container_selector: container_selector,
|
|
5868
|
-
override_rec_renderer: override_rec_renderer,
|
|
5869
|
-
lazyfier_options = {},
|
|
5870
|
-
eager_images: eager_images,
|
|
5871
|
-
grid_spacing: grid_spacing,
|
|
5872
|
-
cols_at_size: cols_at_size,
|
|
5873
|
-
override_vertical_spacing: override_vertical_spacing,
|
|
5874
|
-
rows = "all",
|
|
5875
|
-
...slider_options
|
|
5876
|
-
} = _ref;
|
|
5877
|
-
const [insertion_point] = $652300c6621d5500$export$5e63aea0cac01fa0(container_elements, container_selector || ".grid");
|
|
5878
|
-
const slider = eager_images ? new (0, $be288a83d9eabf2a$export$692b27c28639e5b9)(slider_options) : new (0, $f340c415f2e1d03a$export$68babfc5be0de5da)(slider_options, lazyfier_options);
|
|
5879
|
-
const rendering_result = await (override_rec_renderer || (0, $70017d06e57dffa8$export$2e2bcd8739ae039))(t, recommendation_renderer_options);
|
|
5880
|
-
const {
|
|
5881
|
-
elements: elements
|
|
5882
|
-
} = rendering_result;
|
|
5883
|
-
if (!elements) return rendering_result;
|
|
5884
|
-
if (!$d89e3aaeb9270095$var$slider_styling_was_inserted) {
|
|
5885
|
-
$d89e3aaeb9270095$var$slider_styling_was_inserted = true;
|
|
5886
|
-
$1013f2e568f87406$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($f10bc4dab5f8ea7b$exports)));
|
|
5887
|
-
}
|
|
5888
|
-
insertion_point.replaceWith(slider.container);
|
|
5889
|
-
slider.insert_here.append(...elements);
|
|
5890
|
-
$df6d080cba513381$export$c84671f46d6a1ca({
|
|
5891
|
-
grid_spacing: grid_spacing,
|
|
5892
|
-
cols_at_size: cols_at_size,
|
|
5893
|
-
container_element: slider.insert_here,
|
|
5894
|
-
rows: rows,
|
|
5895
|
-
layout: "slider",
|
|
5896
|
-
override_vertical_spacing: override_vertical_spacing
|
|
5897
|
-
}).catch(e => $5e1f45affc1d7def$export$f18d5b0af29128b7([e, "Grid had an error"], "warning"));
|
|
5898
|
-
return {
|
|
5899
|
-
...rendering_result,
|
|
5900
|
-
slider: slider,
|
|
5901
|
-
elements: container_elements
|
|
5902
|
-
};
|
|
5903
|
-
}
|
|
5904
3442
|
function $b109421811582f8c$export$8cbd8aa1c70f9a13() {
|
|
5905
3443
|
let interval = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 5000;
|
|
5906
3444
|
let timer;
|
|
@@ -5950,16 +3488,11 @@ function $66c5b496f7887c00$export$af88b4929c2dc86() {
|
|
|
5950
3488
|
var $d3c54fdf1bfb087a$var$_tmpl$ = /*#__PURE__*/$76EG6$template(`<label class=checkbox_container><input type=radio><span class=checkmark>`);
|
|
5951
3489
|
function $d3c54fdf1bfb087a$export$1d17a045bcc711b1(_ref) {
|
|
5952
3490
|
let {
|
|
5953
|
-
t: t,
|
|
5954
3491
|
navcont_insertion_fn: navcont_insertion_fn,
|
|
5955
3492
|
navdot: navdot,
|
|
5956
3493
|
dontshowonedot = false,
|
|
5957
3494
|
bitesize: bitesize
|
|
5958
3495
|
} = _ref;
|
|
5959
|
-
const {
|
|
5960
|
-
dlog: dlog,
|
|
5961
|
-
catchify: catchify
|
|
5962
|
-
} = t;
|
|
5963
3496
|
const button_states = [];
|
|
5964
3497
|
const unique_name = Math.round(Math.random() * 1000000);
|
|
5965
3498
|
function constructor_plugin() {
|
|
@@ -6000,14 +3533,14 @@ function $d3c54fdf1bfb087a$export$1d17a045bcc711b1(_ref) {
|
|
|
6000
3533
|
const position = Math.round(first_shown_element / amount_of_elements * number_of_slides);
|
|
6001
3534
|
const get_inputs = () => navcont.querySelectorAll("input");
|
|
6002
3535
|
if (number_of_radio_buttons != number_of_slides) {
|
|
6003
|
-
|
|
3536
|
+
$241f2f02cc612a49$export$de56f1198d121036("Number of buttons doesn't match number of slides, rerendering buttons", button_states);
|
|
6004
3537
|
navcont.innerHTML = "";
|
|
6005
3538
|
if (number_of_slides === 1 && dontshowonedot) {
|
|
6006
|
-
|
|
3539
|
+
$241f2f02cc612a49$export$de56f1198d121036("dontshowonedot is on, not rendering any dots");
|
|
6007
3540
|
return;
|
|
6008
3541
|
}
|
|
6009
3542
|
if (number_of_slides == Infinity) {
|
|
6010
|
-
|
|
3543
|
+
$241f2f02cc612a49$export$de56f1198d121036("Infinite number of slides, wtf", number_of_slides);
|
|
6011
3544
|
return;
|
|
6012
3545
|
}
|
|
6013
3546
|
for (let i = 0; i < number_of_slides; i++) {
|
|
@@ -6015,10 +3548,10 @@ function $d3c54fdf1bfb087a$export$1d17a045bcc711b1(_ref) {
|
|
|
6015
3548
|
const input = a_navdot.querySelector("input");
|
|
6016
3549
|
if (process.env.DEBUG === "true" && !input) throw new Error("You need to provide a navdot that contains an <input> element to slider_dots");
|
|
6017
3550
|
input.checked = button_states[i];
|
|
6018
|
-
input.addEventListener("click",
|
|
3551
|
+
input.addEventListener("click", $5e1f45affc1d7def$export$b3bbfd758f11cfa9(e => {
|
|
6019
3552
|
e.preventDefault();
|
|
6020
3553
|
e.stopPropagation();
|
|
6021
|
-
|
|
3554
|
+
$241f2f02cc612a49$export$de56f1198d121036("Someone checked a box", e);
|
|
6022
3555
|
this.scroll_to_abs(Math.round(amount_of_visible_elements * i));
|
|
6023
3556
|
return false;
|
|
6024
3557
|
}));
|
|
@@ -6058,12 +3591,7 @@ function $d3c54fdf1bfb087a$export$a09282b33e69b43f(unique_name) {
|
|
|
6058
3591
|
// });
|
|
6059
3592
|
// });
|
|
6060
3593
|
|
|
6061
|
-
function $3ad897e1659ee6d7$export$411b0f20794697ce(
|
|
6062
|
-
const {
|
|
6063
|
-
dlog: dlog,
|
|
6064
|
-
catchify: catchify,
|
|
6065
|
-
err: err
|
|
6066
|
-
} = t;
|
|
3594
|
+
function $3ad897e1659ee6d7$export$411b0f20794697ce() {
|
|
6067
3595
|
function constructor_plugin(slider_options) {
|
|
6068
3596
|
const {
|
|
6069
3597
|
insert_here: sliding
|
|
@@ -6071,7 +3599,7 @@ function $3ad897e1659ee6d7$export$411b0f20794697ce(t) {
|
|
|
6071
3599
|
let last_mouse_position = 0;
|
|
6072
3600
|
let starting_position = 0;
|
|
6073
3601
|
let block_anchor_clicks = false;
|
|
6074
|
-
sliding.addEventListener("mousedown",
|
|
3602
|
+
sliding.addEventListener("mousedown", $5e1f45affc1d7def$export$b3bbfd758f11cfa9(e => {
|
|
6075
3603
|
sliding.classList.remove("slider_snap");
|
|
6076
3604
|
const {
|
|
6077
3605
|
snap_style: snap_style
|
|
@@ -6081,7 +3609,7 @@ function $3ad897e1659ee6d7$export$411b0f20794697ce(t) {
|
|
|
6081
3609
|
last_mouse_position = starting_position = e.clientX;
|
|
6082
3610
|
sliding.addEventListener("mousemove", scroll_on_mousemove);
|
|
6083
3611
|
}));
|
|
6084
|
-
window.addEventListener("mouseup",
|
|
3612
|
+
window.addEventListener("mouseup", $5e1f45affc1d7def$export$b3bbfd758f11cfa9(e => {
|
|
6085
3613
|
// use window to prevent dragging from getting stuck
|
|
6086
3614
|
sliding.classList.remove("grabbing");
|
|
6087
3615
|
sliding.classList.add("slider_snap");
|
|
@@ -6101,9 +3629,9 @@ function $3ad897e1659ee6d7$export$411b0f20794697ce(t) {
|
|
|
6101
3629
|
});
|
|
6102
3630
|
}
|
|
6103
3631
|
}));
|
|
6104
|
-
sliding.addEventListener("click",
|
|
3632
|
+
sliding.addEventListener("click", $5e1f45affc1d7def$export$b3bbfd758f11cfa9(e => {
|
|
6105
3633
|
if (block_anchor_clicks) {
|
|
6106
|
-
|
|
3634
|
+
$241f2f02cc612a49$export$de56f1198d121036("Block anchor clicks is true, blocking click", e);
|
|
6107
3635
|
block_anchor_clicks = false;
|
|
6108
3636
|
e.preventDefault();
|
|
6109
3637
|
return false;
|
|
@@ -6120,7 +3648,7 @@ function $3ad897e1659ee6d7$export$411b0f20794697ce(t) {
|
|
|
6120
3648
|
});
|
|
6121
3649
|
last_mouse_position = clientX;
|
|
6122
3650
|
} catch (e) {
|
|
6123
|
-
|
|
3651
|
+
$b000f5ef6ce456d9$export$8048b892d651b310(e);
|
|
6124
3652
|
}
|
|
6125
3653
|
}
|
|
6126
3654
|
}
|
|
@@ -6404,233 +3932,63 @@ function $e1af55c2112926b7$export$dac64fd35a4805a4() {
|
|
|
6404
3932
|
mutation_plugin: $5e1f45affc1d7def$export$b3bbfd758f11cfa9(mutation_plugin)
|
|
6405
3933
|
};
|
|
6406
3934
|
}
|
|
6407
|
-
|
|
6408
|
-
|
|
6409
|
-
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
|
|
6413
|
-
|
|
6414
|
-
const
|
|
6415
|
-
|
|
6416
|
-
|
|
6417
|
-
|
|
6418
|
-
|
|
6419
|
-
|
|
6420
|
-
|
|
6421
|
-
let touches = 0;
|
|
6422
|
-
let inactive_checker_running = false;
|
|
6423
|
-
let smallest_seen_intersection_ratio = 0.1;
|
|
6424
|
-
let largest_seen_interection_ratio = 0.9;
|
|
6425
|
-
let are_far_right = false;
|
|
6426
|
-
let inactive_checker_timeout;
|
|
6427
|
-
// let elgreen;
|
|
6428
|
-
const check_if_we_inactive = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(function () {
|
|
6429
|
-
var _window2, _window2$performance, _window2$performance$;
|
|
6430
|
-
// const { insert_here: sliding } = this;
|
|
6431
|
-
const now = ((_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$performance = _window2.performance) === null || _window2$performance === void 0 ? void 0 : (_window2$performance$ = _window2$performance.now) === null || _window2$performance$ === void 0 ? void 0 : _window2$performance$.call(_window2$performance)) || +new Date();
|
|
6432
|
-
const time_since_ran = now - last_move;
|
|
6433
|
-
const last_left_intersection = this.first_intersecting;
|
|
6434
|
-
// dlog(last_left_intersection.intersectionRatio, smallest_seen_intersection_ratio, largest_seen_interection_ratio);
|
|
6435
|
-
if (time_since_ran > time_of_no_events_to_count_as_scroll_idle && !touches && last_left_intersection && (last_left_intersection.intersectionRatio <= smallest_seen_intersection_ratio || last_left_intersection.intersectionRatio >= largest_seen_interection_ratio || are_far_right)) {
|
|
6436
|
-
// if (!elgreen) {
|
|
6437
|
-
// sliding.style.background = "green";
|
|
6438
|
-
// elgreen = true;
|
|
6439
|
-
// }
|
|
6440
|
-
$5e1f45affc1d7def$export$b3bbfd758f11cfa9($c7030fdb9bcc361f$var$scroll_idle)(this, originally_rendered_elements.length, clones_per_side);
|
|
6441
|
-
inactive_checker_running = false;
|
|
6442
|
-
} else {
|
|
6443
|
-
// if (elgreen !== false) {
|
|
6444
|
-
// sliding.style.background = "red";
|
|
6445
|
-
// elgreen = false;
|
|
6446
|
-
// }
|
|
6447
|
-
const timeleft = time_of_no_events_to_count_as_scroll_idle - time_since_ran;
|
|
6448
|
-
if (timeleft < 1) requestAnimationFrame(check_if_we_inactive.bind(this));else setTimeout(check_if_we_inactive.bind(this), timeleft);
|
|
6449
|
-
}
|
|
6450
|
-
});
|
|
6451
|
-
function constructor_plugin() {
|
|
6452
|
-
window.addEventListener("touchstart", () => touches++);
|
|
6453
|
-
window.addEventListener("touchend", () => touches--);
|
|
6454
|
-
this.insert_here.addEventListener("scroll", $5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => {
|
|
6455
|
-
var _window3, _window3$performance, _window3$performance$;
|
|
6456
|
-
last_move = ((_window3 = window) === null || _window3 === void 0 ? void 0 : (_window3$performance = _window3.performance) === null || _window3$performance === void 0 ? void 0 : (_window3$performance$ = _window3$performance.now) === null || _window3$performance$ === void 0 ? void 0 : _window3$performance$.call(_window3$performance)) || +new Date();
|
|
6457
|
-
}));
|
|
6458
|
-
const mo = new MutationObserver($5e1f45affc1d7def$export$b3bbfd758f11cfa9(records => {
|
|
6459
|
-
for (const record of records) for (const node of record.removedNodes) {
|
|
6460
|
-
if (removed_by_us.has(node)) {
|
|
6461
|
-
removed_by_us.delete(node);
|
|
6462
|
-
continue;
|
|
6463
|
-
}
|
|
6464
|
-
for (const a_set of sets_of_els) {
|
|
6465
|
-
const index_in_el_set = a_set.indexOf(node);
|
|
6466
|
-
if (index_in_el_set >= 0) {
|
|
6467
|
-
$241f2f02cc612a49$export$de56f1198d121036("Removing", node, "from el set", a_set);
|
|
6468
|
-
a_set.splice(index_in_el_set, 1);
|
|
6469
|
-
}
|
|
6470
|
-
}
|
|
6471
|
-
}
|
|
6472
|
-
}));
|
|
6473
|
-
mo.observe(this.insert_here, {
|
|
6474
|
-
childList: true
|
|
6475
|
-
});
|
|
6476
|
-
}
|
|
6477
|
-
function mutation_plugin(intersections, intersecting_mutations) {
|
|
6478
|
-
var _window4, _window4$performance, _window4$performance$, _intersecting_mutatio;
|
|
6479
|
-
for (let i = 0; i < intersections.length; i++) {
|
|
6480
|
-
const {
|
|
6481
|
-
intersectionRatio: intersectionRatio
|
|
6482
|
-
} = intersections[i];
|
|
6483
|
-
const target_large = intersectionRatio * 0.95;
|
|
6484
|
-
const target_small = intersectionRatio * 1.05;
|
|
6485
|
-
if (target_large > largest_seen_interection_ratio && target_large < 0.999) largest_seen_interection_ratio = target_large;else if (intersectionRatio && target_small < smallest_seen_intersection_ratio && target_small > 0.0001) smallest_seen_intersection_ratio = target_small;
|
|
6486
|
-
}
|
|
6487
|
-
if (mutation_busy) return;
|
|
6488
|
-
mutation_busy = true;
|
|
6489
|
-
last_move = ((_window4 = window) === null || _window4 === void 0 ? void 0 : (_window4$performance = _window4.performance) === null || _window4$performance === void 0 ? void 0 : (_window4$performance$ = _window4$performance.now) === null || _window4$performance$ === void 0 ? void 0 : _window4$performance$.call(_window4$performance)) || +new Date();
|
|
6490
|
-
const first_element = this.element_by_index(0);
|
|
6491
|
-
const second_element = this.element_by_index(1);
|
|
6492
|
-
let dont_wraparound = false;
|
|
6493
|
-
if (!first_element || !second_element) dont_wraparound = true;else {
|
|
6494
|
-
// calculate how many cards including margin the slider fits
|
|
6495
|
-
const first_rect = first_element.getBoundingClientRect();
|
|
6496
|
-
if (!first_rect.width) {
|
|
6497
|
-
$241f2f02cc612a49$export$de56f1198d121036(first_rect);
|
|
6498
|
-
throw new Error("First rect doesn't have width");
|
|
6499
|
-
}
|
|
6500
|
-
const second_rect = second_element.getBoundingClientRect();
|
|
6501
|
-
const container_rect = this.insert_here.getBoundingClientRect();
|
|
6502
|
-
const margin = second_rect.left - first_rect.right;
|
|
6503
|
-
let width = 0;
|
|
6504
|
-
let amount = 0;
|
|
6505
|
-
while (width < container_rect.width) {
|
|
6506
|
-
if (width < 0) throw new Error("width can't be < 0");
|
|
6507
|
-
width += first_rect.width + margin;
|
|
6508
|
-
amount++;
|
|
6509
|
-
}
|
|
6510
|
-
// dlog(originally_rendered_elements.length, amount);
|
|
6511
|
-
if (originally_rendered_elements.length <= amount) dont_wraparound = true;
|
|
6512
|
-
}
|
|
6513
|
-
if (dont_wraparound) {
|
|
6514
|
-
if (surplus_in_body) {
|
|
6515
|
-
$241f2f02cc612a49$export$de56f1198d121036("Removing surplus of els. Total els: ", sets_of_els);
|
|
6516
|
-
// @ts-ignore
|
|
6517
|
-
for (let i = (sets_of_els.length || 1) - 1; i--;) for (let j = 0; j < sets_of_els[i].length; j++) {
|
|
6518
|
-
const el = sets_of_els[i][j];
|
|
6519
|
-
if ("remove" in el) {
|
|
6520
|
-
removed_by_us.add(el);
|
|
6521
|
-
el.remove();
|
|
6522
|
-
}
|
|
6523
|
-
}
|
|
6524
|
-
this.invalidate_cache();
|
|
6525
|
-
surplus_in_body = false;
|
|
6526
|
-
}
|
|
6527
|
-
mutation_busy = false;
|
|
6528
|
-
return;
|
|
6529
|
-
}
|
|
6530
|
-
if (!surplus_in_body) {
|
|
6531
|
-
$241f2f02cc612a49$export$de56f1198d121036("Adding surplus of els");
|
|
6532
|
-
this.insert_here.append(...sets_of_els.slice(0, -1).flat());
|
|
6533
|
-
this.invalidate_cache();
|
|
6534
|
-
surplus_in_body = true;
|
|
6535
|
-
}
|
|
6536
|
-
are_far_right = ((_intersecting_mutatio = intersecting_mutations[this.index_of_last_element]) === null || _intersecting_mutatio === void 0 ? void 0 : _intersecting_mutatio.intersectionRatio) >= largest_seen_interection_ratio;
|
|
6537
|
-
clearTimeout(inactive_checker_timeout);
|
|
6538
|
-
inactive_checker_timeout = setTimeout(function () {
|
|
6539
|
-
if (!inactive_checker_running) {
|
|
6540
|
-
inactive_checker_running = true;
|
|
6541
|
-
check_if_we_inactive.call(this);
|
|
6542
|
-
}
|
|
6543
|
-
}.bind(this), time_of_no_events_to_count_as_scroll_idle * 0.8 // schedule a bit earlier so we hit our target
|
|
6544
|
-
);
|
|
6545
|
-
|
|
6546
|
-
mutation_busy = false;
|
|
3935
|
+
var $ad1dbddac6af350d$var$_globalThis$window;
|
|
3936
|
+
const $ad1dbddac6af350d$export$20e9533e68ee72e7 = /*@__PURE__*/$7ca6fdc721083788$export$e806c6c1615a59ae(false);
|
|
3937
|
+
const $ad1dbddac6af350d$export$a9d39e43ae273d26 = /*@__PURE__*/$7ca6fdc721083788$export$e806c6c1615a59ae();
|
|
3938
|
+
const $ad1dbddac6af350d$export$7500cdfd37aafd43 = /*@__PURE__*/new Set();
|
|
3939
|
+
let $ad1dbddac6af350d$var$old_url;
|
|
3940
|
+
const $ad1dbddac6af350d$var$maybe_navigation = (what_happened, args) => {
|
|
3941
|
+
if (typeof location === "undefined") return;
|
|
3942
|
+
const new_url = location.href;
|
|
3943
|
+
if ($ad1dbddac6af350d$var$old_url !== new_url) {
|
|
3944
|
+
$ad1dbddac6af350d$export$a9d39e43ae273d26(new_url);
|
|
3945
|
+
if ($ad1dbddac6af350d$var$old_url !== undefined)
|
|
3946
|
+
// don't resolve stateless href change ipns with the initial value - it's not a navigation
|
|
3947
|
+
$ad1dbddac6af350d$export$20e9533e68ee72e7(new_url);
|
|
3948
|
+
$ad1dbddac6af350d$var$old_url = new_url;
|
|
6547
3949
|
}
|
|
6548
|
-
|
|
6549
|
-
|
|
6550
|
-
|
|
6551
|
-
|
|
6552
|
-
|
|
6553
|
-
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
while (event_listeners !== null && event_listeners !== void 0 && event_listeners.length) {
|
|
6559
|
-
// order shouldn't matter, this is fast
|
|
6560
|
-
const event_listener = event_listeners.pop();
|
|
6561
|
-
for (let i = 0; i < elements.length; i++) elements[i].addEventListener(...event_listener);
|
|
6562
|
-
}
|
|
6563
|
-
// render all elements again four times and adds them to the beginning
|
|
6564
|
-
const post_processors = [...(rendering_options.post_processors || [])];
|
|
6565
|
-
const our_index = post_processors.indexOf(post_processor);
|
|
6566
|
-
if (our_index >= 0) post_processors.splice(our_index, 1);else {
|
|
6567
|
-
const msg = "Couldn't find ourselves in post processors, infinite loop might ensue. Exiting. Wraparound will be broken.";
|
|
6568
|
-
(0, $17bb552dedcd526c$export$af2e17a20c2ea3c5).captureException(new Error(msg));
|
|
6569
|
-
$241f2f02cc612a49$export$de56f1198d121036(msg, () => {});
|
|
6570
|
-
return elements;
|
|
6571
|
-
}
|
|
6572
|
-
for (let i = 0; i < clones_per_side * 2; i++) {
|
|
6573
|
-
const additional_render = await $378c98788ab52b9c$export$a9fc160c5ed83bd7(info.t, {
|
|
6574
|
-
...rendering_options,
|
|
6575
|
-
post_processors: post_processors,
|
|
6576
|
-
pre_processors: [],
|
|
6577
|
-
// don't need to execute pre processors again, displays are already pre-processed
|
|
6578
|
-
recs: info.displays
|
|
6579
|
-
});
|
|
6580
|
-
sets_of_els.push([...additional_render.elements]);
|
|
6581
|
-
}
|
|
6582
|
-
sets_of_els.reverse(); // here sets_of_els gets modified and reversed
|
|
6583
|
-
const sets_of_els_without_items_1_plus_n_from_first_render = [...sets_of_els];
|
|
6584
|
-
const index_of_first_render = sets_of_els_without_items_1_plus_n_from_first_render.indexOf(originally_rendered_elements);
|
|
6585
|
-
if (index_of_first_render < 0) throw new Error("Something's weird, pls check");
|
|
6586
|
-
sets_of_els_without_items_1_plus_n_from_first_render[index_of_first_render] = elements;
|
|
6587
|
-
// we cannot return the array that _might_ contain the elements from the other rendering passes that run asynchronously, this might lead to duplicated event listeners
|
|
6588
|
-
return sets_of_els_without_items_1_plus_n_from_first_render.flat();
|
|
6589
|
-
} else return elements;
|
|
3950
|
+
for (const fn of $ad1dbddac6af350d$export$7500cdfd37aafd43) fn(what_happened, args);
|
|
3951
|
+
};
|
|
3952
|
+
$ad1dbddac6af350d$export$baccefee4a395d8f((args, what_happened) => $ad1dbddac6af350d$var$maybe_navigation(what_happened, args));
|
|
3953
|
+
$ad1dbddac6af350d$var$maybe_navigation();
|
|
3954
|
+
globalThis === null || globalThis === void 0 || ($ad1dbddac6af350d$var$_globalThis$window = globalThis.window) === null || $ad1dbddac6af350d$var$_globalThis$window === void 0 || $ad1dbddac6af350d$var$_globalThis$window.addEventListener("popstate", $5e1f45affc1d7def$export$b3bbfd758f11cfa9(e => $ad1dbddac6af350d$var$maybe_navigation("popstate", e)));
|
|
3955
|
+
async function $ad1dbddac6af350d$export$1cd22bab0d2c3b0b(callback) {
|
|
3956
|
+
const catchified_callback = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(callback);
|
|
3957
|
+
for await (const href of $ad1dbddac6af350d$export$20e9533e68ee72e7) {
|
|
3958
|
+
catchified_callback(href);
|
|
3959
|
+
break;
|
|
6590
3960
|
}
|
|
6591
|
-
return {
|
|
6592
|
-
constructor_plugin: constructor_plugin,
|
|
6593
|
-
mutation_plugin: mutation_plugin,
|
|
6594
|
-
post_processor: post_processor
|
|
6595
|
-
};
|
|
6596
3961
|
}
|
|
6597
|
-
function $
|
|
6598
|
-
|
|
6599
|
-
|
|
6600
|
-
} = slider;
|
|
6601
|
-
const slider_box = sliding.getBoundingClientRect();
|
|
6602
|
-
const leftmost_rect = slider.element_by_index(0).getBoundingClientRect();
|
|
6603
|
-
const rightmost_rect = slider.element_by_index(slider.index_of_last_element).getBoundingClientRect();
|
|
6604
|
-
const leftmost_card_to_left_viewport_edge = slider_box.left - leftmost_rect.left;
|
|
6605
|
-
const rightmost_card_to_right_viewport_edge = rightmost_rect.right - slider_box.right;
|
|
6606
|
-
const children = [...sliding.children];
|
|
3962
|
+
async function $ad1dbddac6af350d$export$baccefee4a395d8f(after_navigation) {
|
|
3963
|
+
let replace_replaceState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
3964
|
+
if (typeof History === "undefined") return;
|
|
6607
3965
|
const {
|
|
6608
|
-
|
|
6609
|
-
} =
|
|
6610
|
-
const
|
|
6611
|
-
const
|
|
6612
|
-
|
|
6613
|
-
|
|
6614
|
-
|
|
6615
|
-
|
|
6616
|
-
|
|
6617
|
-
|
|
6618
|
-
|
|
6619
|
-
|
|
3966
|
+
prototype: prototype
|
|
3967
|
+
} = History;
|
|
3968
|
+
const instance = history;
|
|
3969
|
+
const polyfill_dance = the_thing => {
|
|
3970
|
+
const proxy_the_thing = obj => {
|
|
3971
|
+
const orig_pushState = obj[the_thing];
|
|
3972
|
+
obj[the_thing] = new Proxy(orig_pushState, {
|
|
3973
|
+
apply: (target, this_arg, arguments_list) => {
|
|
3974
|
+
const nav_result = Reflect.apply(target, this_arg, arguments_list);
|
|
3975
|
+
try {
|
|
3976
|
+
after_navigation(arguments_list, the_thing);
|
|
3977
|
+
} catch (e) {
|
|
3978
|
+
$b000f5ef6ce456d9$export$8048b892d651b310(e);
|
|
3979
|
+
}
|
|
3980
|
+
return nav_result;
|
|
3981
|
+
}
|
|
3982
|
+
});
|
|
3983
|
+
};
|
|
3984
|
+
proxy_the_thing(prototype);
|
|
3985
|
+
if (Object.getOwnPropertyNames(instance).includes(the_thing))
|
|
3986
|
+
// we don't want to just change the instance because that's not the way to do it, but we don't want to not work because someone else did it wrong
|
|
3987
|
+
proxy_the_thing(instance);
|
|
6620
3988
|
};
|
|
6621
|
-
|
|
6622
|
-
if (
|
|
6623
|
-
if (leftmost_card_to_left_viewport_edge > rightmost_card_to_right_viewport_edge * 1.1 /* add 10% margin */)
|
|
6624
|
-
// dlog("Moving", chunk_size, "to the right");
|
|
6625
|
-
// sliding.append(...children.slice(0, chunk_size));
|
|
6626
|
-
post_move(1);else if (rightmost_card_to_right_viewport_edge > leftmost_card_to_left_viewport_edge * 1.1)
|
|
6627
|
-
// dlog("Moving", chunk_size, "to the left");
|
|
6628
|
-
// sliding.prepend(...children.slice(-chunk_size));
|
|
6629
|
-
post_move(-1);
|
|
6630
|
-
}
|
|
6631
|
-
// dlog("Scroll idle", leftmost_card_to_left_viewport_edge, rightmost_card_to_right_viewport_edge);
|
|
3989
|
+
polyfill_dance("pushState");
|
|
3990
|
+
if (replace_replaceState) polyfill_dance("replaceState");
|
|
6632
3991
|
}
|
|
6633
|
-
|
|
6634
3992
|
const $2b6304d4ce419ed5$var$connection_map = /*@__PURE__*/new WeakMap();
|
|
6635
3993
|
function $2b6304d4ce419ed5$export$3d04c40e7acc1a32(initial_value) {
|
|
6636
3994
|
let subscribed = false;
|
|
@@ -6803,125 +4161,336 @@ function $aadc6d9eeb8e8a56$export$419f84efad7d9fe(surface_per_size, cleanup_prom
|
|
|
6803
4161
|
function $aadc6d9eeb8e8a56$export$be95cb0e8cfd099e() {
|
|
6804
4162
|
return new Promise(r => $ad1dbddac6af350d$export$1cd22bab0d2c3b0b(r));
|
|
6805
4163
|
}
|
|
6806
|
-
function $
|
|
6807
|
-
|
|
6808
|
-
|
|
6809
|
-
|
|
6810
|
-
|
|
6811
|
-
|
|
6812
|
-
|
|
6813
|
-
|
|
4164
|
+
function $bd7c9f254946941d$export$82a685f2da2fb027(a_element, product_id, recommendation_id, additional_listener) {
|
|
4165
|
+
var _a_element$depict_tra, _a_element$depict_tra2;
|
|
4166
|
+
if (!a_element ||
|
|
4167
|
+
// @ts-ignore
|
|
4168
|
+
!a_element.depict_tracked ||
|
|
4169
|
+
// @ts-ignore
|
|
4170
|
+
(a_element === null || a_element === void 0 ? void 0 : (_a_element$depict_tra = a_element.depict_tracked) === null || _a_element$depict_tra === void 0 ? void 0 : _a_element$depict_tra.recommendation_id) != recommendation_id ||
|
|
4171
|
+
// @ts-ignore
|
|
4172
|
+
(a_element === null || a_element === void 0 ? void 0 : (_a_element$depict_tra2 = a_element.depict_tracked) === null || _a_element$depict_tra2 === void 0 ? void 0 : _a_element$depict_tra2.product_id) != product_id) {
|
|
4173
|
+
const listener = e => {
|
|
4174
|
+
localStorage.setItem("depict_attribution_".concat(product_id), recommendation_id);
|
|
4175
|
+
if (additional_listener) additional_listener(e, product_id, recommendation_id);
|
|
4176
|
+
};
|
|
4177
|
+
// @ts-ignore
|
|
4178
|
+
if (a_element.depict_tracked) {
|
|
4179
|
+
var _a_element$depict_tra3;
|
|
4180
|
+
// @ts-ignore
|
|
4181
|
+
a_element.removeEventListener("click", (_a_element$depict_tra3 = a_element.depict_tracked) === null || _a_element$depict_tra3 === void 0 ? void 0 : _a_element$depict_tra3.listener);
|
|
4182
|
+
}
|
|
4183
|
+
// @ts-ignore
|
|
4184
|
+
a_element.depict_tracked = {
|
|
4185
|
+
product_id: product_id,
|
|
4186
|
+
recommendation_id: recommendation_id,
|
|
4187
|
+
listener: listener
|
|
4188
|
+
};
|
|
4189
|
+
a_element.addEventListener("click", listener);
|
|
4190
|
+
return listener;
|
|
4191
|
+
}
|
|
4192
|
+
}
|
|
4193
|
+
async function $bd7c9f254946941d$export$2c34560c3749dc63(button, get_product_id, tracking_fn, unmatching_tracking, event) {
|
|
4194
|
+
// @ts-ignore
|
|
4195
|
+
if (!button || button.depict_tracked) return;
|
|
4196
|
+
button.addEventListener(event ? event : "click", $5e1f45affc1d7def$export$b3bbfd758f11cfa9(async e => {
|
|
4197
|
+
if (!e.isTrusted) {
|
|
4198
|
+
$241f2f02cc612a49$export$de56f1198d121036("ignoring event", e, "because it's not user generated");
|
|
4199
|
+
return;
|
|
4200
|
+
}
|
|
4201
|
+
const product_id = await get_product_id(undefined, e);
|
|
4202
|
+
if (product_id) {
|
|
4203
|
+
const item_name = "depict_attribution_".concat(product_id);
|
|
4204
|
+
const recommendation_id = localStorage.getItem(item_name);
|
|
4205
|
+
if (recommendation_id) {
|
|
4206
|
+
localStorage.removeItem(item_name);
|
|
4207
|
+
tracking_fn(product_id, recommendation_id, false, e);
|
|
4208
|
+
} else if (unmatching_tracking) tracking_fn(product_id, recommendation_id, true, e);
|
|
4209
|
+
}
|
|
4210
|
+
}));
|
|
4211
|
+
// @ts-ignore
|
|
4212
|
+
button.depict_tracked = true;
|
|
4213
|
+
}
|
|
4214
|
+
function $799496226e956169$export$edfedd0557ca5a2d(ga_tracker, append_to_url) {
|
|
4215
|
+
if (!ga_tracker) return;
|
|
4216
|
+
// Docs for analytics.js Tasks:
|
|
4217
|
+
// https://developers.google.com/analytics/devguides/collection/analyticsjs/tasks
|
|
4218
|
+
const sendHitTask = "sendHitTask";
|
|
4219
|
+
const originalSendHitTask = ga_tracker.get(sendHitTask);
|
|
4220
|
+
ga_tracker.set(sendHitTask, model => {
|
|
4221
|
+
originalSendHitTask(model);
|
|
4222
|
+
// console.log('Sent original hit, now sending to depict');
|
|
4223
|
+
try {
|
|
4224
|
+
const payLoad = model.get("hitPayload");
|
|
4225
|
+
const path = (0, $9e4bee2e3b4b5753$export$362abebb4b313340) + "/collect-ga";
|
|
4226
|
+
let url = path + "?" + payLoad;
|
|
4227
|
+
if (append_to_url) url += append_to_url;
|
|
4228
|
+
const n = navigator;
|
|
4229
|
+
const sb = "sendBeacon";
|
|
4230
|
+
if (n[sb])
|
|
4231
|
+
// this is actually smaller, I tested
|
|
4232
|
+
n[sb](url);else {
|
|
4233
|
+
const xhttp = new XMLHttpRequest();
|
|
4234
|
+
xhttp.open("GET", url);
|
|
4235
|
+
xhttp.send();
|
|
4236
|
+
}
|
|
4237
|
+
} catch (e) {
|
|
4238
|
+
// console.log('Could not send beacon to /collect-ga', e);
|
|
4239
|
+
}
|
|
6814
4240
|
});
|
|
6815
4241
|
}
|
|
6816
|
-
function $
|
|
6817
|
-
//
|
|
6818
|
-
|
|
6819
|
-
|
|
6820
|
-
|
|
6821
|
-
|
|
4242
|
+
function $799496226e956169$export$674d8cd8b6868154() {
|
|
4243
|
+
// Snippet to load GA async
|
|
4244
|
+
const w = window;
|
|
4245
|
+
// @ts-ignore
|
|
4246
|
+
w.ga || (w.ga = function () {
|
|
4247
|
+
var _w$ga;
|
|
4248
|
+
((_w$ga = w.ga).q || (_w$ga.q = [])).push(arguments);
|
|
6822
4249
|
});
|
|
4250
|
+
w.ga.l = +new Date();
|
|
6823
4251
|
}
|
|
6824
|
-
|
|
6825
|
-
|
|
6826
|
-
|
|
6827
|
-
|
|
6828
|
-
|
|
6829
|
-
|
|
6830
|
-
|
|
6831
|
-
|
|
6832
|
-
|
|
6833
|
-
|
|
6834
|
-
|
|
6835
|
-
|
|
4252
|
+
|
|
4253
|
+
/**
|
|
4254
|
+
* Elements currently intersecting with the viewport.
|
|
4255
|
+
* If they are intersecting for the `has_to_be_intersecting_for` duration, we count it as an impression, and call the callback.
|
|
4256
|
+
*/
|
|
4257
|
+
const $20f21bee300687ff$var$current_intersections = /*@__PURE__*/new WeakMap();
|
|
4258
|
+
/**
|
|
4259
|
+
* Currently watched elements by the intersection observer with their respective callback
|
|
4260
|
+
* */
|
|
4261
|
+
const $20f21bee300687ff$var$watched_elements = /*@__PURE__*/new WeakMap();
|
|
4262
|
+
const $20f21bee300687ff$var$unwatch_element = element => {
|
|
4263
|
+
$20f21bee300687ff$var$intersection_observer === null || $20f21bee300687ff$var$intersection_observer === void 0 || $20f21bee300687ff$var$intersection_observer.unobserve(element);
|
|
4264
|
+
$20f21bee300687ff$var$watched_elements.delete(element);
|
|
4265
|
+
$20f21bee300687ff$var$current_intersections.delete(element);
|
|
4266
|
+
};
|
|
4267
|
+
const $20f21bee300687ff$export$4c51576248bcdf31 = (element, callback) => {
|
|
4268
|
+
if ($20f21bee300687ff$var$watched_elements.has(element)) {
|
|
4269
|
+
$241f2f02cc612a49$export$de56f1198d121036("Not watching", element, "as it's already being watched");
|
|
4270
|
+
return () => {};
|
|
4271
|
+
}
|
|
4272
|
+
$20f21bee300687ff$var$intersection_observer === null || $20f21bee300687ff$var$intersection_observer === void 0 || $20f21bee300687ff$var$intersection_observer.observe(element);
|
|
4273
|
+
/** Calls the given callback and makes sure to stop watching the element */
|
|
4274
|
+
const wrapped_callback = element => {
|
|
4275
|
+
callback(element);
|
|
4276
|
+
$20f21bee300687ff$var$unwatch_element(element);
|
|
4277
|
+
};
|
|
4278
|
+
$20f21bee300687ff$var$watched_elements.set(element, wrapped_callback);
|
|
4279
|
+
const disconnect_observer = (0, $90fa633a9564f115$export$b6ae1bc530f4c149).onremoved(element, () => {
|
|
4280
|
+
// Sometimes it has already rapidly been reinserted. The observer events lag by one tick.
|
|
4281
|
+
// For that case, make sure we're really out of the DOM
|
|
4282
|
+
if (document.documentElement.contains(element)) return;
|
|
4283
|
+
$20f21bee300687ff$var$unwatch_element(element);
|
|
4284
|
+
});
|
|
4285
|
+
return () => {
|
|
4286
|
+
disconnect_observer();
|
|
4287
|
+
$20f21bee300687ff$var$unwatch_element(element);
|
|
4288
|
+
};
|
|
4289
|
+
};
|
|
4290
|
+
const $20f21bee300687ff$var$intersection_observer_callback = entries => {
|
|
4291
|
+
for (const record of entries) {
|
|
4292
|
+
const {
|
|
4293
|
+
target: target
|
|
4294
|
+
} = record;
|
|
4295
|
+
const callback = $20f21bee300687ff$var$watched_elements.get(target);
|
|
4296
|
+
// Skip the element if it's no longer being watched.
|
|
4297
|
+
if (!callback) {
|
|
4298
|
+
$20f21bee300687ff$var$intersection_observer === null || $20f21bee300687ff$var$intersection_observer === void 0 || $20f21bee300687ff$var$intersection_observer.unobserve(target);
|
|
4299
|
+
continue;
|
|
4300
|
+
}
|
|
4301
|
+
const currently_intersecting = $20f21bee300687ff$var$current_intersections.has(target);
|
|
4302
|
+
if (!currently_intersecting && record.intersectionRatio >= (0, $d6c3e2ba045accda$export$135da44d0ba958bc)[0]) {
|
|
4303
|
+
// we're intersecting enough and not already in the process of "measuring"
|
|
4304
|
+
const started_intersecting_at_ = +new Date(); // save start time
|
|
4305
|
+
// Schedule the callback function to be called after the element has been intersecting for the required duration
|
|
4306
|
+
const callback_timeout_ = setTimeout(callback, (0, $d6c3e2ba045accda$export$ca8321ea61dc2544), target);
|
|
4307
|
+
$20f21bee300687ff$var$current_intersections.set(target, {
|
|
4308
|
+
started_intersecting_at_: started_intersecting_at_,
|
|
4309
|
+
callback_timeout_: callback_timeout_
|
|
4310
|
+
});
|
|
4311
|
+
} else if (currently_intersecting && record.intersectionRatio < (0, $d6c3e2ba045accda$export$135da44d0ba958bc)[1]) {
|
|
4312
|
+
// we are in the process of "measuring" and went below the threshold
|
|
4313
|
+
const {
|
|
4314
|
+
started_intersecting_at_: started_intersecting_at_,
|
|
4315
|
+
callback_timeout_: callback_timeout_
|
|
4316
|
+
} = $20f21bee300687ff$var$current_intersections.get(target);
|
|
4317
|
+
const time_elapsed = +new Date() - started_intersecting_at_;
|
|
4318
|
+
// If we stopped intersecting too early we want to abort our timeout.
|
|
4319
|
+
// if we did not we also want to abort the timeout since it's been lagging and just instantly send the event
|
|
4320
|
+
// (the browser can delay setTimeout timers)
|
|
4321
|
+
clearTimeout(callback_timeout_);
|
|
4322
|
+
if (time_elapsed <= (0, $d6c3e2ba045accda$export$ca8321ea61dc2544)) $20f21bee300687ff$var$current_intersections.delete(target);else {
|
|
4323
|
+
// we intersected long enough
|
|
4324
|
+
$241f2f02cc612a49$export$de56f1198d121036("intersection_observer: setTimeout lagged", time_elapsed, (0, $d6c3e2ba045accda$export$ca8321ea61dc2544), "ms", target);
|
|
4325
|
+
callback(target);
|
|
6836
4326
|
}
|
|
6837
|
-
return target.apply(this_arg, args_list);
|
|
6838
4327
|
}
|
|
4328
|
+
}
|
|
4329
|
+
};
|
|
4330
|
+
/**
|
|
4331
|
+
* Global IntersectionObserver used for all impression tracking.
|
|
4332
|
+
* It's faster to use one observer for all elements than to create a new one for each element.
|
|
4333
|
+
*/
|
|
4334
|
+
const $20f21bee300687ff$var$intersection_observer = typeof window === "object" ? /*@__PURE__*/new IntersectionObserver( /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9($20f21bee300687ff$var$intersection_observer_callback), {
|
|
4335
|
+
threshold: /*@__PURE__*/$ab9c3dbf2bb2fbf7$export$f8ea2e7b15b5d129(8)
|
|
4336
|
+
}) : undefined;
|
|
4337
|
+
const $c633189b7b69d048$export$d0efd8ed14f5c33 = (items, display, info) => {
|
|
4338
|
+
if (!(items !== null && items !== void 0 && items.length)) return items;
|
|
4339
|
+
const node_array = Array.isArray(items) ? items : [...items]; // if it's a NodeList convert it to an array
|
|
4340
|
+
const first_watchable_el = node_array.find(el => el instanceof Element);
|
|
4341
|
+
if (!first_watchable_el) {
|
|
4342
|
+
$241f2f02cc612a49$export$de56f1198d121036("Impression tracking: Can't observe", items, display);
|
|
4343
|
+
return items;
|
|
4344
|
+
}
|
|
4345
|
+
if (!info.t) {
|
|
4346
|
+
$241f2f02cc612a49$export$de56f1198d121036("Impression tracking: No tenant instance, can't track", items, display);
|
|
4347
|
+
return items;
|
|
4348
|
+
}
|
|
4349
|
+
(0, $90fa633a9564f115$export$b6ae1bc530f4c149).onexists(first_watchable_el, _ref => {
|
|
4350
|
+
let {
|
|
4351
|
+
element: element
|
|
4352
|
+
} = _ref;
|
|
4353
|
+
$20f21bee300687ff$export$4c51576248bcdf31(element, () => {
|
|
4354
|
+
const {
|
|
4355
|
+
recommendation_id: recommendation_id,
|
|
4356
|
+
search_result_id: search_result_id,
|
|
4357
|
+
product_listing_result_id: product_listing_result_id,
|
|
4358
|
+
suggestions_result_id: suggestions_result_id
|
|
4359
|
+
} = display;
|
|
4360
|
+
$d6c3e2ba045accda$export$4205dc6835bc0d9f({
|
|
4361
|
+
...$d5f7352b58e0d737$export$8c6f26a5b6921b95(),
|
|
4362
|
+
recommendation_type: info.rendering_options.type,
|
|
4363
|
+
entity_price: display.sale_price,
|
|
4364
|
+
market: info.t.market,
|
|
4365
|
+
tenant: info.t.tenant,
|
|
4366
|
+
product_id: display.product_id,
|
|
4367
|
+
recommendation_id: recommendation_id,
|
|
4368
|
+
search_result_id: search_result_id,
|
|
4369
|
+
product_listing_result_id: product_listing_result_id,
|
|
4370
|
+
suggestions_result_id: suggestions_result_id
|
|
4371
|
+
});
|
|
4372
|
+
});
|
|
6839
4373
|
});
|
|
4374
|
+
return items;
|
|
4375
|
+
};
|
|
4376
|
+
const $e89a1d249db21af0$export$37125ccc5dd98050 = _ref => {
|
|
4377
|
+
let {
|
|
4378
|
+
element: element,
|
|
4379
|
+
data: data,
|
|
4380
|
+
wait_for_dom_insertion = true
|
|
4381
|
+
} = _ref;
|
|
4382
|
+
const disconnectors = [];
|
|
4383
|
+
const impression_track = () => {
|
|
4384
|
+
const disconnector = $20f21bee300687ff$export$4c51576248bcdf31(element, () => {
|
|
4385
|
+
$d6c3e2ba045accda$export$4205dc6835bc0d9f({
|
|
4386
|
+
...$d5f7352b58e0d737$export$8c6f26a5b6921b95(),
|
|
4387
|
+
...data
|
|
4388
|
+
});
|
|
4389
|
+
});
|
|
4390
|
+
disconnectors.push(disconnector);
|
|
4391
|
+
};
|
|
4392
|
+
if (wait_for_dom_insertion) disconnectors.push((0, $90fa633a9564f115$export$b6ae1bc530f4c149).onexists(element, impression_track));else impression_track();
|
|
4393
|
+
return () => disconnectors.forEach(disconnector => disconnector());
|
|
4394
|
+
};
|
|
4395
|
+
let $d6c3e2ba045accda$export$135da44d0ba958bc = [0.6, 0.5];
|
|
4396
|
+
const $d6c3e2ba045accda$export$c543ee4cdb0d0964 = (start, end) => $d6c3e2ba045accda$export$135da44d0ba958bc = [start, end];
|
|
4397
|
+
const $d6c3e2ba045accda$export$ca8321ea61dc2544 = 500;
|
|
4398
|
+
const $d6c3e2ba045accda$export$4205dc6835bc0d9f = data => {
|
|
4399
|
+
data.type = "element_visible"; // Set the type to element_visible as this is optional to pass here.
|
|
4400
|
+
$814c3bf8e175fa59$export$28cacbd9b4306ffc([data], true);
|
|
4401
|
+
};
|
|
4402
|
+
|
|
4403
|
+
// https://stackoverflow.com/a/39941616
|
|
4404
|
+
function $6c8c963618d41bb2$var$invert_promise(promise) {
|
|
4405
|
+
return new Promise((res, rej) => promise.then(rej, res));
|
|
4406
|
+
}
|
|
4407
|
+
function $6c8c963618d41bb2$export$947a20746936143d(promises) {
|
|
4408
|
+
var _Promise$any, _Promise$any2;
|
|
4409
|
+
return (_Promise$any = Promise === null || Promise === void 0 ? void 0 : (_Promise$any2 = Promise.any) === null || _Promise$any2 === void 0 ? void 0 : _Promise$any2.call(Promise, promises)) !== null && _Promise$any !== void 0 ? _Promise$any : $6c8c963618d41bb2$var$invert_promise(Promise.all([...promises].map($6c8c963618d41bb2$var$invert_promise)));
|
|
6840
4410
|
}
|
|
6841
|
-
function $
|
|
6842
|
-
(
|
|
6843
|
-
|
|
6844
|
-
|
|
6845
|
-
|
|
6846
|
-
|
|
6847
|
-
|
|
6848
|
-
|
|
6849
|
-
|
|
6850
|
-
|
|
6851
|
-
|
|
6852
|
-
const
|
|
6853
|
-
|
|
6854
|
-
|
|
6855
|
-
|
|
4411
|
+
async function $df87ac5a30f7baac$export$836f70a28c317905(product_id) {
|
|
4412
|
+
if (typeof BroadcastChannel != "function") return;
|
|
4413
|
+
const bc = new BroadcastChannel("right_click_attribution");
|
|
4414
|
+
$241f2f02cc612a49$export$de56f1198d121036("Broadcasting", product_id, "to", bc);
|
|
4415
|
+
bc.postMessage(product_id);
|
|
4416
|
+
bc.close();
|
|
4417
|
+
}
|
|
4418
|
+
function $df87ac5a30f7baac$export$58c56fe2313fdbe3(elements, display, info, get_event_listener_remover) {
|
|
4419
|
+
if (typeof BroadcastChannel != "function") return elements;
|
|
4420
|
+
const disconnectors = [];
|
|
4421
|
+
const handler = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(e => $df87ac5a30f7baac$export$8f66c4c7fb96eda2(e, ("variant_index" in display ? display.variant_displays[display.variant_index] : display).product_id));
|
|
4422
|
+
const auxclick_handler = e => e.button === 1 && handler(e);
|
|
4423
|
+
for (let i = 0; i < (elements === null || elements === void 0 ? void 0 : elements.length); i++) {
|
|
4424
|
+
const element = elements[i];
|
|
4425
|
+
element.addEventListener("contextmenu", handler);
|
|
4426
|
+
element.addEventListener("auxclick", auxclick_handler); // actual wheel click - some mouses / OS:es also dispatch auxclick on rightclick
|
|
4427
|
+
if (get_event_listener_remover) disconnectors.push(() => {
|
|
4428
|
+
element.removeEventListener("contextmenu", handler);
|
|
4429
|
+
element.removeEventListener("auxclick", auxclick_handler);
|
|
4430
|
+
});
|
|
6856
4431
|
}
|
|
6857
|
-
|
|
6858
|
-
|
|
6859
|
-
tenant: t.tenant,
|
|
6860
|
-
market: t.market,
|
|
6861
|
-
events: [{
|
|
6862
|
-
event_type: "transaction_mapping",
|
|
6863
|
-
transaction_id: transaction_id,
|
|
6864
|
-
session_id: session_id
|
|
6865
|
-
}]
|
|
6866
|
-
};
|
|
6867
|
-
$814c3bf8e175fa59$export$cc3b6ddf805f6156((0, $9e4bee2e3b4b5753$export$362abebb4b313340) + "/v2/track", payload);
|
|
4432
|
+
get_event_listener_remover === null || get_event_listener_remover === void 0 || get_event_listener_remover(() => disconnectors.forEach(disconnector => disconnector()));
|
|
4433
|
+
return elements;
|
|
6868
4434
|
}
|
|
6869
|
-
function $
|
|
6870
|
-
|
|
6871
|
-
|
|
6872
|
-
|
|
6873
|
-
|
|
6874
|
-
|
|
6875
|
-
let get_all_function = (_window = window) === null || _window === void 0 ? void 0 : (_window$ga = _window.ga) === null || _window$ga === void 0 ? void 0 : _window$ga.getAll; // https://sentry.io/organizations/depictai-0o/issues/3621911835/?project=5476183&referrer=slack
|
|
6876
|
-
if (typeof get_all_function !== "function") get_all_function = await $2da62df28669a48a$export$2fc1a072736ae2f6(window, "ga", "getAll");
|
|
6877
|
-
// @ts-ignore
|
|
6878
|
-
const all_trackers = get_all_function.call(ga);
|
|
6879
|
-
$241f2f02cc612a49$export$de56f1198d121036("we have trackers", all_trackers);
|
|
6880
|
-
// @ts-ignore
|
|
4435
|
+
async function $df87ac5a30f7baac$export$8f66c4c7fb96eda2(e, product_id) {
|
|
4436
|
+
$241f2f02cc612a49$export$de56f1198d121036("Contextmenu was invoked", e);
|
|
4437
|
+
const element = e.currentTarget || e.target;
|
|
4438
|
+
const bc = new BroadcastChannel("right_click_attribution");
|
|
4439
|
+
const got_wanted_event = await $6c8c963618d41bb2$export$947a20746936143d([new Promise(resolve => {
|
|
4440
|
+
bc.addEventListener("message", $5e1f45affc1d7def$export$b3bbfd758f11cfa9(msg => {
|
|
6881
4441
|
const {
|
|
6882
|
-
|
|
6883
|
-
} =
|
|
6884
|
-
$
|
|
6885
|
-
if (
|
|
6886
|
-
// this check is just so we don't fail if this doesn't exist for some reason, but it always should
|
|
6887
|
-
P.push = new Proxy(P.push, {
|
|
6888
|
-
apply(target, this_arg, args_list) {
|
|
6889
|
-
const retval = target.apply(this_arg, args_list);
|
|
6890
|
-
$5e1f45affc1d7def$export$b3bbfd758f11cfa9(modify_trackers_of_iterable)(args_list);
|
|
6891
|
-
return retval;
|
|
6892
|
-
}
|
|
6893
|
-
});
|
|
6894
|
-
function modify_trackers_of_iterable(array) {
|
|
6895
|
-
for (const tracker of array) $5e1f45affc1d7def$export$b3bbfd758f11cfa9($ed8073ecbced6e7e$var$make_tracker_send_to_depict)(tracker, t, filter);
|
|
6896
|
-
}
|
|
4442
|
+
data: data
|
|
4443
|
+
} = msg;
|
|
4444
|
+
$241f2f02cc612a49$export$de56f1198d121036("Recieved broadcast channel event", data, msg);
|
|
4445
|
+
if (data == product_id) resolve(true);
|
|
6897
4446
|
}));
|
|
4447
|
+
}), new Promise(r => setTimeout(r, 60000, false))]);
|
|
4448
|
+
if (got_wanted_event) {
|
|
4449
|
+
const click = new MouseEvent("click", {
|
|
4450
|
+
view: window,
|
|
4451
|
+
bubbles: true,
|
|
4452
|
+
cancelable: true,
|
|
4453
|
+
metaKey: true
|
|
4454
|
+
});
|
|
4455
|
+
$241f2f02cc612a49$export$de56f1198d121036("Someone broadcasted our product_id! Simulating a click event on the element that was contextmenu'd", element, click);
|
|
4456
|
+
element.addEventListener("click", e => (e.preventDefault(), false), {
|
|
4457
|
+
once: true
|
|
4458
|
+
});
|
|
4459
|
+
element.dispatchEvent(click);
|
|
4460
|
+
} else $241f2f02cc612a49$export$de56f1198d121036("Our product_id did not get broadcasted, closing channel");
|
|
4461
|
+
bc.close();
|
|
4462
|
+
}
|
|
4463
|
+
let $0897f35c3b3fbbc4$var$last_page_pageview_sent_for;
|
|
4464
|
+
async function $0897f35c3b3fbbc4$export$eee4c4d924348b05(data) {
|
|
4465
|
+
// Send page view to depict if needed
|
|
4466
|
+
try {
|
|
4467
|
+
const {
|
|
4468
|
+
href: href
|
|
4469
|
+
} = location;
|
|
4470
|
+
if ($0897f35c3b3fbbc4$var$last_page_pageview_sent_for !== href) {
|
|
4471
|
+
$0897f35c3b3fbbc4$var$last_page_pageview_sent_for = href;
|
|
4472
|
+
$d5f7352b58e0d737$export$82badda1f9923310({
|
|
4473
|
+
...data,
|
|
4474
|
+
type: "page_view"
|
|
4475
|
+
});
|
|
4476
|
+
if (data.product_id) await $df87ac5a30f7baac$export$836f70a28c317905(data.product_id); // this takes care of right click click attribution - broadcasts the URL of the current page
|
|
4477
|
+
}
|
|
6898
4478
|
} catch (error) {
|
|
6899
|
-
$5e1f45affc1d7def$export$f18d5b0af29128b7(error, "
|
|
4479
|
+
$5e1f45affc1d7def$export$f18d5b0af29128b7([error, "Sending page view failed"], "warning");
|
|
6900
4480
|
}
|
|
6901
4481
|
}
|
|
6902
|
-
|
|
6903
|
-
|
|
6904
|
-
|
|
6905
|
-
|
|
6906
|
-
|
|
6907
|
-
|
|
6908
|
-
|
|
6909
|
-
|
|
6910
|
-
|
|
6911
|
-
|
|
6912
|
-
|
|
6913
|
-
|
|
6914
|
-
const payload = model.get("hitPayload");
|
|
6915
|
-
const sp = new URLSearchParams(payload);
|
|
6916
|
-
const id = sp.get("ti");
|
|
6917
|
-
if (id) {
|
|
6918
|
-
$241f2f02cc612a49$export$de56f1198d121036("Got interesting analytics request", payload, id);
|
|
6919
|
-
$f991aad8d6175c9b$export$1ac466d53a6636ac(t, id, dsid, filter);
|
|
6920
|
-
}
|
|
6921
|
-
} catch (e) {
|
|
6922
|
-
$5e1f45affc1d7def$export$f18d5b0af29128b7(e, "error");
|
|
6923
|
-
}
|
|
6924
|
-
});
|
|
4482
|
+
let $0897f35c3b3fbbc4$var$sending_on_navigation = false;
|
|
4483
|
+
async function $0897f35c3b3fbbc4$export$f7cb1bd47199ec38(data) {
|
|
4484
|
+
if (!$0897f35c3b3fbbc4$var$sending_on_navigation) {
|
|
4485
|
+
$0897f35c3b3fbbc4$var$sending_on_navigation = true;
|
|
4486
|
+
$5e1f45affc1d7def$export$b3bbfd758f11cfa9(async () => {
|
|
4487
|
+
for await (const _href of (0, $ad1dbddac6af350d$export$a9d39e43ae273d26)) $0897f35c3b3fbbc4$export$eee4c4d924348b05({
|
|
4488
|
+
tenant: data.tenant,
|
|
4489
|
+
market: data.market,
|
|
4490
|
+
product_id: await data.get_product_id(_href)
|
|
4491
|
+
});
|
|
4492
|
+
})();
|
|
4493
|
+
}
|
|
6925
4494
|
}
|
|
6926
4495
|
function $429b4383ef3d586f$var$_classPrivateFieldInitSpec(obj, privateMap, value) {
|
|
6927
4496
|
$429b4383ef3d586f$var$_checkPrivateRedeclaration(obj, privateMap);
|
|
@@ -7137,41 +4706,64 @@ const $f69445e469425bcb$export$783ef16647773b3d = /*@__PURE__*/$9c44a7238815fa47
|
|
|
7137
4706
|
const meta = await $2da62df28669a48a$export$2fc1a072736ae2f6(window, "ShopifyAnalytics", "meta");
|
|
7138
4707
|
return meta === null || meta === void 0 ? void 0 : meta.product;
|
|
7139
4708
|
}));
|
|
7140
|
-
|
|
7141
|
-
|
|
7142
|
-
|
|
7143
|
-
|
|
7144
|
-
|
|
7145
|
-
|
|
4709
|
+
const $57642e3bf93ac1e7$export$5c069c93d2b7493f = delay => new Promise(resolve => setTimeout(resolve, delay));
|
|
4710
|
+
async function $c95f8181bad32e8d$export$bcd70d5ed1cf6313(url, options) {
|
|
4711
|
+
let max_retries = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10;
|
|
4712
|
+
let useFetch = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : fetch;
|
|
4713
|
+
const ONE_MINUTE = 60000;
|
|
4714
|
+
const max_backoff_ms = ONE_MINUTE;
|
|
7146
4715
|
const {
|
|
7147
|
-
|
|
7148
|
-
|
|
7149
|
-
|
|
7150
|
-
|
|
7151
|
-
|
|
7152
|
-
|
|
7153
|
-
|
|
7154
|
-
|
|
7155
|
-
|
|
7156
|
-
|
|
7157
|
-
|
|
7158
|
-
|
|
7159
|
-
|
|
7160
|
-
|
|
7161
|
-
|
|
7162
|
-
|
|
4716
|
+
stack: stack
|
|
4717
|
+
} = new Error();
|
|
4718
|
+
const calculate_retry = delay => {
|
|
4719
|
+
delay *= 2 + Math.random();
|
|
4720
|
+
if (delay > max_backoff_ms) delay = max_backoff_ms * (1 + Math.random() / 10);
|
|
4721
|
+
return delay;
|
|
4722
|
+
};
|
|
4723
|
+
let try_again_in_ms = 100;
|
|
4724
|
+
let has_succeeded = false;
|
|
4725
|
+
let result = false;
|
|
4726
|
+
while (max_retries && !has_succeeded) try {
|
|
4727
|
+
const response = await useFetch(url, options);
|
|
4728
|
+
const {
|
|
4729
|
+
status: status,
|
|
4730
|
+
ok: ok
|
|
4731
|
+
} = response;
|
|
4732
|
+
if (!response || !ok || status !== 200) {
|
|
4733
|
+
if (status >= 400 && status < 500) {
|
|
4734
|
+
$5e1f45affc1d7def$export$b3bbfd758f11cfa9($c95f8181bad32e8d$var$send_sentry_4xx)(response, (options === null || options === void 0 ? void 0 : options.body) || {}, stack);
|
|
4735
|
+
has_succeeded = true;
|
|
4736
|
+
} else if (status === 404) has_succeeded = true;
|
|
4737
|
+
$241f2f02cc612a49$export$de56f1198d121036("Response not ok", response);
|
|
4738
|
+
} else has_succeeded = true;
|
|
4739
|
+
result = response;
|
|
4740
|
+
} catch (error) {
|
|
4741
|
+
$241f2f02cc612a49$export$de56f1198d121036("Error while fetching: ", error, url, options);
|
|
4742
|
+
// Don't retry CORS
|
|
4743
|
+
if (error.message.includes("CORS") && error.name.includes("CORS")) has_succeeded = true;
|
|
4744
|
+
} finally {
|
|
4745
|
+
if (!has_succeeded) await $57642e3bf93ac1e7$export$5c069c93d2b7493f(try_again_in_ms);
|
|
4746
|
+
try_again_in_ms = calculate_retry(try_again_in_ms);
|
|
4747
|
+
max_retries -= 1;
|
|
7163
4748
|
}
|
|
7164
|
-
|
|
7165
|
-
|
|
7166
|
-
|
|
4749
|
+
return result;
|
|
4750
|
+
}
|
|
4751
|
+
async function $c95f8181bad32e8d$var$send_sentry_4xx(response, body, stack) {
|
|
4752
|
+
if (process.env.TENANT === "shopify-config" && response.status === 403)
|
|
4753
|
+
// Don't send requests in the shopify admin that say we need to re-authorize to sentry
|
|
7167
4754
|
return;
|
|
7168
|
-
|
|
7169
|
-
|
|
7170
|
-
|
|
7171
|
-
function
|
|
7172
|
-
|
|
7173
|
-
|
|
7174
|
-
|
|
4755
|
+
const msg = "Validation error: got 4XX from API";
|
|
4756
|
+
const text = await response.clone().text();
|
|
4757
|
+
$241f2f02cc612a49$export$de56f1198d121036(msg, "body", body, "response", response, "text", text, "stack", stack);
|
|
4758
|
+
(0, $17bb552dedcd526c$export$af2e17a20c2ea3c5).withScope(function (scope) {
|
|
4759
|
+
scope.setExtra("stack", stack);
|
|
4760
|
+
scope.setExtra("request_body", body);
|
|
4761
|
+
scope.setExtra("response", response);
|
|
4762
|
+
scope.setExtra("serialized_response", $d9aec442b12a1134$export$39d526a1194b6499(response));
|
|
4763
|
+
scope.setExtra("response_text", text);
|
|
4764
|
+
scope.setLevel("error");
|
|
4765
|
+
this.captureException(new Error(msg));
|
|
4766
|
+
});
|
|
7175
4767
|
}
|
|
7176
4768
|
function $c1590f86e0eca625$export$2c2f50b30b7b2576(el, attribute_name, async_iterable) {
|
|
7177
4769
|
let quit_after_navigation = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
@@ -7433,85 +5025,89 @@ function $2c22b027931240e6$var$deal_w_removal_of_node_array(node_array, push_dis
|
|
|
7433
5025
|
push_disconnector(disconnect_observer);
|
|
7434
5026
|
}
|
|
7435
5027
|
}
|
|
7436
|
-
|
|
7437
|
-
|
|
7438
|
-
const $
|
|
7439
|
-
|
|
7440
|
-
|
|
5028
|
+
let $1013f2e568f87406$var$existing_style_tag;
|
|
5029
|
+
let $1013f2e568f87406$var$reactions_in_last_s = 0;
|
|
5030
|
+
const $1013f2e568f87406$export$59ba1eb2c083f0cd = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9(async css => {
|
|
5031
|
+
const style_tag = await ($1013f2e568f87406$var$existing_style_tag || ($1013f2e568f87406$var$existing_style_tag = (0, $90fa633a9564f115$export$b6ae1bc530f4c149).wait_for_element("head").then(head => {
|
|
5032
|
+
const tag = document.createElement("style");
|
|
5033
|
+
(0, $90fa633a9564f115$export$b6ae1bc530f4c149).onremoved(
|
|
5034
|
+
// reinsertion for next.js's "portable" <head>
|
|
5035
|
+
tag, eoe => {
|
|
5036
|
+
if (document.head.contains(tag))
|
|
5037
|
+
// just make sure to not freak out if it's already been added again
|
|
5038
|
+
return;
|
|
5039
|
+
if ($1013f2e568f87406$var$reactions_in_last_s >= 10) {
|
|
5040
|
+
$5e1f45affc1d7def$export$f18d5b0af29128b7(new Error("Someone removed our styling but insists on it (10 removals in previous second). Giving up \uD83D\uDE2B"), "error");
|
|
5041
|
+
return;
|
|
5042
|
+
}
|
|
5043
|
+
$241f2f02cc612a49$export$de56f1198d121036("Someone removed our styling \uD83D\uDE24, reinserting", eoe);
|
|
5044
|
+
$1013f2e568f87406$var$reactions_in_last_s++;
|
|
5045
|
+
setTimeout(() => $1013f2e568f87406$var$reactions_in_last_s--, 1000);
|
|
5046
|
+
document.head.append(tag); // we're sure that head exists now since we inserted it there previously
|
|
5047
|
+
});
|
|
5048
|
+
|
|
5049
|
+
$241f2f02cc612a49$export$de56f1198d121036("inserting", tag, "into", head);
|
|
5050
|
+
return head.appendChild(tag);
|
|
5051
|
+
})));
|
|
5052
|
+
style_tag.append(css);
|
|
5053
|
+
});
|
|
5054
|
+
const $1013f2e568f87406$export$a4f97b27a0592e6c = url => {
|
|
5055
|
+
var _pathname$split$filte;
|
|
5056
|
+
return ((_pathname$split$filte = (url ? new URL(url, window.location.origin) : window.location).pathname.split("/").filter(a => a).pop()) === null || _pathname$split$filte === void 0 ? void 0 : _pathname$split$filte.replace(/\.html?$/i, "")) || "";
|
|
7441
5057
|
};
|
|
7442
|
-
|
|
7443
|
-
|
|
7444
|
-
|
|
7445
|
-
|
|
7446
|
-
|
|
7447
|
-
|
|
7448
|
-
|
|
7449
|
-
|
|
7450
|
-
|
|
7451
|
-
}
|
|
7452
|
-
|
|
7453
|
-
|
|
7454
|
-
|
|
7455
|
-
|
|
7456
|
-
|
|
7457
|
-
|
|
7458
|
-
type: "placeholder",
|
|
7459
|
-
recs: Array(num_items).fill(1).map(_ => ({
|
|
7460
|
-
sale_price: NaN,
|
|
7461
|
-
page_url: "#",
|
|
7462
|
-
image_url: image_url,
|
|
7463
|
-
original_price: NaN,
|
|
7464
|
-
product_id: "placeholder",
|
|
7465
|
-
recommendation_id: "placeholder",
|
|
7466
|
-
title: $07ddf7dfff112d01$export$3b75288f46cadd96(),
|
|
7467
|
-
brand: $07ddf7dfff112d01$export$3b75288f46cadd96()
|
|
7468
|
-
})),
|
|
7469
|
-
view_tracking: [],
|
|
7470
|
-
click_tracking: [],
|
|
7471
|
-
pre_processors: [],
|
|
7472
|
-
post_processors: [elems => {
|
|
7473
|
-
if (!(elems !== null && elems !== void 0 && elems.length)) return elems;
|
|
7474
|
-
for (const elem of elems) {
|
|
7475
|
-
var _classList, _classList$add, _classList2;
|
|
7476
|
-
if (elem instanceof HTMLElement) elem.style.cursor = "default";
|
|
7477
|
-
elem === null || elem === void 0 || (_classList = elem.classList) === null || _classList === void 0 || (_classList$add = (_classList2 = _classList).add) === null || _classList$add === void 0 || _classList$add.call(_classList2, "placeholder");
|
|
7478
|
-
elem.addEventListener("click", e => ($241f2f02cc612a49$export$de56f1198d121036("Supressing placeholder click", e), e.preventDefault(), e.stopPropagation(), false), true);
|
|
7479
|
-
}
|
|
7480
|
-
for (const img of $652300c6621d5500$export$5e63aea0cac01fa0(elems, ["src", "srcset", "data-src", "data-srcset"].map(attribute => $07ddf7dfff112d01$var$make_sel(image_url, attribute)).join(", "))) img.classList.add("nolazy"); // this gets ignored by all lazyloaders
|
|
7481
|
-
return elems;
|
|
7482
|
-
}]
|
|
7483
|
-
};
|
|
7484
|
-
// @ts-ignore FIXME: this is a hack to make the type checker happy
|
|
7485
|
-
const placeholder_rendering = await override_rec_renderer(t, placeholder_opts).catch((0, $b000f5ef6ce456d9$export$8048b892d651b310));
|
|
7486
|
-
let set_should_stay_inserted;
|
|
7487
|
-
const should_stay_inserted = new Promise(r => set_should_stay_inserted = r);
|
|
7488
|
-
if (placeholder_rendering !== null && placeholder_rendering !== void 0 && placeholder_rendering.elements) {
|
|
7489
|
-
const [template_els, _get_state, set_state] = $2b6304d4ce419ed5$export$3d04c40e7acc1a32(placeholder_rendering.elements);
|
|
7490
|
-
actual_rendering.then(async rendering_result => {
|
|
7491
|
-
if (typeof post_rendering == "function") await $5e1f45affc1d7def$export$b3bbfd758f11cfa9(post_rendering)(rendering_result);
|
|
7492
|
-
const {
|
|
7493
|
-
elements: elements
|
|
7494
|
-
} = rendering_result || {};
|
|
7495
|
-
await (0, $90fa633a9564f115$export$b6ae1bc530f4c149).wait_for_element(placeholder_rendering.elements[0]);
|
|
7496
|
-
// await new Promise(r => window.addEventListener("contextmenu", r, { once: true }));
|
|
7497
|
-
// it's possible that something after this ruins the array reference (aka [...elements]) and therefore it's not safe to call set_state again before the elements are sure to have a parentElement aka being in the DOM
|
|
7498
|
-
set_state(elements !== null && elements !== void 0 ? elements : "");
|
|
7499
|
-
if (!elements) {
|
|
7500
|
-
on_no_rendering_result === null || on_no_rendering_result === void 0 || on_no_rendering_result(rendering_result);
|
|
7501
|
-
set_should_stay_inserted(false);
|
|
5058
|
+
const $1013f2e568f87406$export$692b606677218a16 = callback => {
|
|
5059
|
+
if (document.depictwashere) {
|
|
5060
|
+
if (process.env.BUILD_TARGET === "dev") {
|
|
5061
|
+
$241f2f02cc612a49$export$de56f1198d121036("HMR tried to rerun us, reloading page");
|
|
5062
|
+
/* eslint-disable no-self-assign */
|
|
5063
|
+
location.href = location.href;
|
|
5064
|
+
}
|
|
5065
|
+
$241f2f02cc612a49$export$de56f1198d121036("Script has already ran", document.currentScript, "is exiting");
|
|
5066
|
+
return;
|
|
5067
|
+
}
|
|
5068
|
+
if (process.env.BUILD_TARGET === "dev") /* eslint-disable no-console */console.clear = new Proxy(console.clear, {
|
|
5069
|
+
apply(target, this_arg, arg_list) {
|
|
5070
|
+
var _Error$stack;
|
|
5071
|
+
if ((_Error$stack = new Error().stack) !== null && _Error$stack !== void 0 && _Error$stack.split("\n").filter(Boolean).some(s => s.includes("http://localhost:1234/depict-ai.js"))) {
|
|
5072
|
+
/* eslint-disable no-console */console.log("CSS change detected through hack, reloading");
|
|
5073
|
+
location.reload();
|
|
7502
5074
|
}
|
|
7503
|
-
|
|
7504
|
-
}
|
|
7505
|
-
|
|
7506
|
-
|
|
7507
|
-
|
|
7508
|
-
|
|
7509
|
-
|
|
5075
|
+
return target.apply(this_arg, arg_list);
|
|
5076
|
+
}
|
|
5077
|
+
});
|
|
5078
|
+
document.depictwashere = true;
|
|
5079
|
+
callback().catch((0, $b000f5ef6ce456d9$export$8048b892d651b310));
|
|
5080
|
+
};
|
|
5081
|
+
function $1013f2e568f87406$export$328e81c44cddf3c0(callback, get_market, supported_markets, unsupported_markets, preferred_demo_market) {
|
|
5082
|
+
$1013f2e568f87406$export$692b606677218a16(async () => {
|
|
5083
|
+
// Handle override for debug scripts (could be used on demo pages too)
|
|
5084
|
+
if (process.env.DEBUG === "true") {
|
|
5085
|
+
let localstorage_override;
|
|
5086
|
+
const query_param_override = new URLSearchParams(location.search).get("depict-override-market");
|
|
5087
|
+
if (query_param_override !== null) {
|
|
5088
|
+
$241f2f02cc612a49$export$de56f1198d121036("Found ?depict-override-market=".concat(query_param_override, ". Using that as the market"));
|
|
5089
|
+
get_market = () => query_param_override;
|
|
5090
|
+
localStorage.setItem("depict-override-market", query_param_override);
|
|
5091
|
+
} else if ((localstorage_override = localStorage.getItem("depict-override-market")) !== null) {
|
|
5092
|
+
$241f2f02cc612a49$export$de56f1198d121036('Found depict-override-market="'.concat(localstorage_override, '" in localStorage. Using that as the market'));
|
|
5093
|
+
get_market = () => localstorage_override;
|
|
5094
|
+
}
|
|
5095
|
+
}
|
|
5096
|
+
const market = await get_market();
|
|
5097
|
+
if (supported_markets.includes(market)) {
|
|
5098
|
+
$241f2f02cc612a49$export$de56f1198d121036("Initializing with market: ".concat(market));
|
|
5099
|
+
return callback(market).catch((0, $b000f5ef6ce456d9$export$8048b892d651b310));
|
|
5100
|
+
} else if (unsupported_markets.includes(market)) {
|
|
5101
|
+
$241f2f02cc612a49$export$de56f1198d121036("Unsupported market: ".concat(market, ". Exiting..."));
|
|
5102
|
+
return;
|
|
5103
|
+
} else if (process.env.DEBUG === "true" && location.host.endsWith(".demo.depict.ai") && preferred_demo_market) {
|
|
5104
|
+
$241f2f02cc612a49$export$de56f1198d121036("On demosite with default market override. Setting market to ".concat(preferred_demo_market));
|
|
5105
|
+
return callback(preferred_demo_market).catch((0, $b000f5ef6ce456d9$export$8048b892d651b310));
|
|
7510
5106
|
} else {
|
|
7511
|
-
$
|
|
7512
|
-
return
|
|
5107
|
+
$b000f5ef6ce456d9$export$8048b892d651b310(new Error('Unknown market: "'.concat(market, '". Exiting...')));
|
|
5108
|
+
return;
|
|
7513
5109
|
}
|
|
7514
|
-
};
|
|
5110
|
+
});
|
|
7515
5111
|
}
|
|
7516
5112
|
function $243da8b4990520aa$export$8ec5c86406f333ff() {
|
|
7517
5113
|
const element_weak_set = new WeakSet();
|
|
@@ -8038,8 +5634,8 @@ async function $24f3fd73864991c0$export$c068ad5361be7646(_ref) {
|
|
|
8038
5634
|
}));
|
|
8039
5635
|
}
|
|
8040
5636
|
$76EG6$delegateEvents(["click"]);
|
|
8041
|
-
var $
|
|
8042
|
-
$
|
|
5637
|
+
var $5304b1a97f5cc360$exports = {};
|
|
5638
|
+
$5304b1a97f5cc360$exports = ".depict-placeholder {\n will-change: mask, -webkit-mask;\n mask-position-x: 125%;\n mask-position-y: center;\n background: #ddd;\n animation: 1.5s linear infinite depict-placeholder;\n display: inline-block;\n position: relative;\n overflow: hidden;\n -webkit-mask: linear-gradient(-60deg, #000 30%, #0005, #000 70%) 125% / 300% 100%;\n -webkit-mask-image: ;\n mask-image: ;\n -webkit-mask-size: ;\n mask-size: ;\n}\n\n@keyframes depict-placeholder {\n 0% {\n mask-position-x: 125%;\n -webkit-mask-position-x: 125%;\n }\n\n 10% {\n mask-position-x: 125%;\n -webkit-mask-position-x: 125%;\n }\n\n 90% {\n mask-position-x: -25%;\n -webkit-mask-position-x: -25%;\n }\n\n 100% {\n mask-position-x: -25%;\n -webkit-mask-position-x: -25%;\n }\n}\n\n";
|
|
8043
5639
|
var $adc0bb548fdb574f$var$_tmpl$ = /*#__PURE__*/$76EG6$template(`<div>`);
|
|
8044
5640
|
let $adc0bb548fdb574f$var$inserted = false;
|
|
8045
5641
|
const $adc0bb548fdb574f$export$84712d0562a614b8 = _ref => {
|
|
@@ -8052,7 +5648,7 @@ const $adc0bb548fdb574f$export$84712d0562a614b8 = _ref => {
|
|
|
8052
5648
|
} = _ref;
|
|
8053
5649
|
if (!$adc0bb548fdb574f$var$inserted) {
|
|
8054
5650
|
// Insert styling on first import
|
|
8055
|
-
$1013f2e568f87406$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($
|
|
5651
|
+
$1013f2e568f87406$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($5304b1a97f5cc360$exports)));
|
|
8056
5652
|
$adc0bb548fdb574f$var$inserted = true;
|
|
8057
5653
|
}
|
|
8058
5654
|
return (() => {
|
|
@@ -8296,8 +5892,8 @@ const $0f55c2bc0a7b363b$export$237455ad7e59d4e5 = function () {
|
|
|
8296
5892
|
collapse: collapse
|
|
8297
5893
|
};
|
|
8298
5894
|
};
|
|
8299
|
-
var $
|
|
8300
|
-
$
|
|
5895
|
+
var $3acba1df0fdbf811$exports = {};
|
|
5896
|
+
$3acba1df0fdbf811$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 top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n\n";
|
|
8301
5897
|
var $9ef5ce4804a3b61b$var$_tmpl$ = /*#__PURE__*/$76EG6$template(`<img>`),
|
|
8302
5898
|
$9ef5ce4804a3b61b$var$_tmpl$2 = /*#__PURE__*/$76EG6$template(`<source sizes=0px>`),
|
|
8303
5899
|
$9ef5ce4804a3b61b$var$_tmpl$3 = /*#__PURE__*/$76EG6$template(`<picture>`);
|
|
@@ -8466,6 +6062,10 @@ var $c987460cedc0d7ec$var$_tmpl$ = /*#__PURE__*/$76EG6$template(`<div>`),
|
|
|
8466
6062
|
const $c987460cedc0d7ec$var$rendering_options_to_sourceset_component = /*@__PURE__*/new WeakMap();
|
|
8467
6063
|
// Add nolazy to placeholders to avoid errors with the stupid lazyfier
|
|
8468
6064
|
const $c987460cedc0d7ec$var$add_nolazy_to_placeholder = type => type === "placeholder" ? "nolazy" : "";
|
|
6065
|
+
const $c987460cedc0d7ec$export$a4eccf92efefa04d = function (image_width, image_height) {
|
|
6066
|
+
let color = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "#f6f7f8";
|
|
6067
|
+
return "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='".concat(image_width, "' height='").concat(image_height, "' xmlns:v='https://vecta.io/nano'%3e%3cpath d='M0 0h").concat(image_width, ".016v").concat(image_height, ".01H0' fill='").concat(encodeURIComponent(color), "'/%3e%3c/svg%3e");
|
|
6068
|
+
};
|
|
8469
6069
|
let $c987460cedc0d7ec$var$inserted = false;
|
|
8470
6070
|
const $c987460cedc0d7ec$export$788756b42446dc2d = _ref => {
|
|
8471
6071
|
let {
|
|
@@ -8474,13 +6074,13 @@ const $c987460cedc0d7ec$export$788756b42446dc2d = _ref => {
|
|
|
8474
6074
|
} = _ref;
|
|
8475
6075
|
if (!$c987460cedc0d7ec$var$inserted) {
|
|
8476
6076
|
// Insert styling on first import
|
|
8477
|
-
$1013f2e568f87406$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($
|
|
6077
|
+
$1013f2e568f87406$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($3acba1df0fdbf811$exports)));
|
|
8478
6078
|
$c987460cedc0d7ec$var$inserted = true;
|
|
8479
6079
|
}
|
|
8480
6080
|
const img = process.env.BUILD_TARGET === "modern" || process.env.BUILD_TARGET === "dev" ? $c987460cedc0d7ec$var$Image(options) : $c987460cedc0d7ec$var$CompatibleImage(options);
|
|
8481
6081
|
if (init_with_placeholder)
|
|
8482
6082
|
// 10000 is a magic value, that is just supposed to be bigger than the size of the actual image.
|
|
8483
|
-
img.querySelectorAll("img").forEach(i => i.src = $
|
|
6083
|
+
img.querySelectorAll("img").forEach(i => i.src = $c987460cedc0d7ec$export$a4eccf92efefa04d(10000 * options.aspect_ratio, 10000));
|
|
8484
6084
|
return img;
|
|
8485
6085
|
};
|
|
8486
6086
|
function $c987460cedc0d7ec$var$Image(_ref2) {
|
|
@@ -8565,8 +6165,8 @@ function $c987460cedc0d7ec$var$srcset_comp_from_map_or_new(rendering_options) {
|
|
|
8565
6165
|
}
|
|
8566
6166
|
return sourceset_component;
|
|
8567
6167
|
}
|
|
8568
|
-
var $
|
|
8569
|
-
$
|
|
6168
|
+
var $2dbcf35ce5cd16e6$exports = {};
|
|
6169
|
+
$2dbcf35ce5cd16e6$exports = ".depict .images-container {\n position: relative;\n}\n\n.depict .second-image-container {\n width: 100%;\n opacity: 0;\n position: absolute;\n top: 0;\n}\n\n.depict .hovering .main-image-container {\n opacity: 0;\n}\n\n.depict .hovering .second-image-container {\n opacity: 1;\n}\n\n";
|
|
8570
6170
|
var $73f0a7e385687d5d$var$_tmpl$ = /*#__PURE__*/$76EG6$template(`<div class=images-container><!$><!/><div class=main-image-container>`),
|
|
8571
6171
|
$73f0a7e385687d5d$var$_tmpl$2 = /*#__PURE__*/$76EG6$template(`<div class=second-image-container>`);
|
|
8572
6172
|
// Saving bytez
|
|
@@ -8701,7 +6301,7 @@ const $73f0a7e385687d5d$export$2369f6fc1c911576 = _ref => {
|
|
|
8701
6301
|
...options
|
|
8702
6302
|
} = _ref;
|
|
8703
6303
|
if (!$73f0a7e385687d5d$var$styling_inserted) {
|
|
8704
|
-
$1013f2e568f87406$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($
|
|
6304
|
+
$1013f2e568f87406$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($2dbcf35ce5cd16e6$exports)));
|
|
8705
6305
|
$73f0a7e385687d5d$var$styling_inserted = true;
|
|
8706
6306
|
}
|
|
8707
6307
|
const main_image = $c987460cedc0d7ec$export$788756b42446dc2d({
|
|
@@ -8849,4 +6449,4 @@ function $34eb7e26a9a798f2$export$e35115e6d0715f77() {
|
|
|
8849
6449
|
return href;
|
|
8850
6450
|
}
|
|
8851
6451
|
$ea5707b8e7b350cf$export$2cefb7e61fcbae00("utilishared", (0, $b9e07ce3c67aa344$export$83d89fbfd8236492));
|
|
8852
|
-
export { $e5da8b4d1e6c12b3$export$a13bb02a27aaa5e6 as setOverrideSentryEnvironment, $c9b2d210d5bbc418$export$2d9dc2897d88588 as findMostFrequentItem, $5c580d87c093cc47$export$a7e53ec3b3fdd030 as base64_decode_unicode, $5c580d87c093cc47$export$a1893782a2a6be0d as base64_encode_unicode, $5f4e0abe3139380e$export$6f051469dd676a8b as make_plp_recommendations_inserted_handler, $ea5707b8e7b350cf$export$60d1d0e3cfc8b9ed as version_info, $ea5707b8e7b350cf$export$fe609f0216e4ebef as add_version_query_params, $cdf4691608b4019f$export$6e7454c733fa1fb2 as cache_args, $bcc7b73f8b96a6f0$export$8582cf3716962dc2 as check_displays, $b000f5ef6ce456d9$export$8048b892d651b310 as err, $a01cf8e3169d2af1$export$16d7c76794a38a4 as require_event_listener, $a496a9038b9c02cf$export$41de2959a8dd405d as Auto_GWVM, $ddeca43328b507f6$export$c83d8da642b5104a as GWVM_Renderer, $6a44fa3f1acf7693$export$55621c1ce3cd536b as infinite_promise_creator, $4c6e595091defcd9$export$32ccf3a614c84258 as infinite_promise_no_skip, $d3b90d5099bf2925$export$c0a4d29bc45a38c6 as infinite_renderer, $3ee6c00e6df1008f$export$9eae832ae57fbf as deprecated_insert_styling, $e64690bc3a7de2b1$export$c7187bbd1a7a9244 as placeholder, $d4f914b34cc77d0c$export$cab8bc58c64c2013 as Pro_Slider, $48b0f027b215b8ad$export$2e2bcd8739ae039 as simplified_template_tool, $0342f59060b8a196$export$f1b8b9fd75ddcab1 as insert_styling_into_slider, $b7b39b38d6e695e9$export$cd12721587f4f16d as RR_Slider, $eb252431088a7c2b$export$1a8782481a9af507 as Depict, $193ee64f5599f8a8$export$30933c637c977eef as get_recs_with_template, $193ee64f5599f8a8$export$c410ce1205e5118a as default_post_processor, $193ee64f5599f8a8$export$4f39078bdc72ecd0 as default_pre_processor, $03021b39f80fac4b$export$2e2bcd8739ae039 as wpff, $7d82513db34b5d27$export$12e07a2a9f87578a as ElementObserver, $90fa633a9564f115$export$b6ae1bc530f4c149 as observer, $0f650018c3cbc373$export$34b9dba7ce09269b as jsx, $0f650018c3cbc373$export$25062201e9e25d76 as jsxs, $a285401a927e4306$export$eb0b9ed911409b57 as use_element, $a285401a927e4306$export$f63fcc839cb0f734 as use_listener, $a285401a927e4306$export$22a65337c1b43b1f as classlist, $0f650018c3cbc373$export$ffb0004e005737fa as Fragment, $241f2f02cc612a49$export$de56f1198d121036 as dlog, $241f2f02cc612a49$export$997143d41f6a0c9b as derror, $241f2f02cc612a49$export$c2363754d4758444 as dwarn, $241f2f02cc612a49$export$2dd75a6b038dc8cb as set_browser_prefix, $5e1f45affc1d7def$export$b3bbfd758f11cfa9 as catchify, $5e1f45affc1d7def$export$f18d5b0af29128b7 as report, $a5a2bdb4ae93374b$export$55fe61489d2c7417 as is_debug, $c755e2b0d4b18501$export$6038895ac52bd044 as chevronLeft, $c755e2b0d4b18501$export$dc84183312f0c201 as chevronRight, $0fe3923936d40f55$export$68c017fd93791405 as expandingContainer, $5f31622ffb78bc10$export$3be7054c61590ee3 as Lazyfier, $5f31622ffb78bc10$export$b87d7e0da8b5cbe3 as test_array_proxy_support, $be288a83d9eabf2a$export$692b27c28639e5b9 as Amazing_Slider, $20fe9624210ef635$export$16501883f477737a as colorize_elements, $20fe9624210ef635$export$deca40f48c0569f8 as should_colorizeLogics, $70017d06e57dffa8$export$50ce83ace0cdd87e as default_rr, $51dfcecbe05cc4e5$export$1bc0df10745d5412 as fetch_recs, $51dfcecbe05cc4e5$export$d40679eb4cf32f09 as fetch_recs_whole_response, $378c98788ab52b9c$export$c42139a43c877ecd as clone_deep, $378c98788ab52b9c$export$e0009e7da572f99b as regex_templating, $378c98788ab52b9c$export$a9fc160c5ed83bd7 as Rec_Renderer, $df6d080cba513381$export$17c3166a7ebd4688 as n_col_styling_with_dist, $df6d080cba513381$export$c84671f46d6a1ca as Layout, $df6d080cba513381$export$483bdd1f1186de13 as layout_get_visible_recs_without_partial_rows, $df6d080cba513381$export$3dc5e2383c924ebf as layout_get_total_rec_amount_for_row, $df6d080cba513381$export$717f13d9ba00ca19 as layout_media_query_header, $297a08bac2d81fab$export$b0a773486c1c2312 as RecommendationGrid, $d89e3aaeb9270095$export$82cfdc85a4d15688 as RecommendationSlider, $943514d07f57df12$export$6830ae1fbe21e589 as default_click_tracking, $943514d07f57df12$export$f37c58ab3d3e3b75 as default_view_tracking, $943514d07f57df12$export$dd32cb565eae0a1f as ga_click, $943514d07f57df12$export$8d72437623fef90c as gtag_click_post_processor, $943514d07f57df12$export$1bffac19f9f0d6fc as gtag_view_post_processor, $943514d07f57df12$export$e9106d6e723510d2 as depict_click_tracking_post_processor, $943514d07f57df12$export$fb9afe9f540ae069 as recs_inserted_tracking, $943514d07f57df12$export$32eb5dd18e963410 as add_to_localstorage, $943514d07f57df12$export$9e1caada6901f552 as depict_page_view, $b109421811582f8c$export$8cbd8aa1c70f9a13 as slider_autoscroll_factory, $090af64928922937$export$80039a49055269fb as make_button1, $66c5b496f7887c00$export$af88b4929c2dc86 as make_button2, $d3c54fdf1bfb087a$export$1d17a045bcc711b1 as slider_dots_factory, $d3c54fdf1bfb087a$export$a09282b33e69b43f as navdot, $3ad897e1659ee6d7$export$411b0f20794697ce as slider_draggable_factory, $21afac8db3f98820$export$5129719c04a52f8c as slider_fading_factory, $0cbf24ae3e670238$export$5723caf9a8335aa6 as slider_fractional_factory, $4837ebe61ecec421$export$93223e488e7ee078 as slider_show_scroll, $ff905d87817a07f4$export$b36d2489a5a16728 as slider_snap_css, $ff905d87817a07f4$export$49b950309ab787ad as can_use_snapping_and_still_scroll, $e1af55c2112926b7$export$dac64fd35a4805a4 as slider_snapping_factory, $f340c415f2e1d03a$export$68babfc5be0de5da as Amazing_Lazy_Slider, $c7030fdb9bcc361f$export$53306504b987cbf7 as slider_wraparound_factory, $aadc6d9eeb8e8a56$export$419f84efad7d9fe as sizes_to_surface, $aadc6d9eeb8e8a56$export$417ef0ab13d8b984 as surface_mixer, $aadc6d9eeb8e8a56$export$be95cb0e8cfd099e as promise_until_next_navigation, $f2fce07b3a330e05$export$29a6094e0bd8bc5f as AIO, $f2fce07b3a330e05$export$6ebd242c09192cec as paint_red, $bd7c9f254946941d$export$2c34560c3749dc63 as bind_to_a2c_button, $bd7c9f254946941d$export$82a685f2da2fb027 as bind_tracking_to_link, $d5f7352b58e0d737$export$15f8a0cd5a8c0ebb as depict_click, $d5f7352b58e0d737$export$82badda1f9923310 as depict_prefilled, $d5f7352b58e0d737$export$9028351cb994757e as depict_add_to_cart, $d5f7352b58e0d737$export$93ae15b1ae509334 as set_session_id_fn, $d5f7352b58e0d737$export$61e7e1f11e96692f as get_session_id, $d5f7352b58e0d737$export$622991c71a1f52b3 as get_cookie, $d5f7352b58e0d737$export$8c6f26a5b6921b95 as get_tracking_event_context_data, $814c3bf8e175fa59$export$72036d950e1fae95 as filter_depict_payload, $814c3bf8e175fa59$export$28cacbd9b4306ffc as send_depict, $814c3bf8e175fa59$export$cc3b6ddf805f6156 as foolproof_send_beacon, $814c3bf8e175fa59$export$608478473a3304a0 as send_depict_unfiltered, $814c3bf8e175fa59$export$aa26019042811d4f as send_websocket, $799496226e956169$export$674d8cd8b6868154 as create_ga_queue, $799496226e956169$export$edfedd0557ca5a2d as make_tracker_send_to_depict, $ed8073ecbced6e7e$export$1ff14fec60ed5697 as ga_to_transaction_api, $3674b9afc9a63520$export$f75172d2e289cd02 as send_ga, $3674b9afc9a63520$export$ac7296527cb52311 as setup_ga, $3674b9afc9a63520$export$d031e55ccd4c52dc as setup_gtag, $3674b9afc9a63520$export$f522672c9379e339 as gtag_click, $3674b9afc9a63520$export$bf205937e5e012cb as ga_purchase_click, $3674b9afc9a63520$export$127751e82111fcf as ga_rec_click, $3674b9afc9a63520$export$7babcd5d4056b2ca as gtag_view, $3674b9afc9a63520$export$f3354ec2ce95ebd9 as load_gtag, $d6c3e2ba045accda$export$4205dc6835bc0d9f as send_impression_event, $e89a1d249db21af0$export$37125ccc5dd98050 as impression_track_element, $c633189b7b69d048$export$d0efd8ed14f5c33 as impression_tracking_post_processor, $d6c3e2ba045accda$export$c543ee4cdb0d0964 as set_impression_threshold, $d6c3e2ba045accda$export$135da44d0ba958bc as impression_threshold, $d6c3e2ba045accda$export$ca8321ea61dc2544 as has_to_be_intersecting_for, $df87ac5a30f7baac$export$58c56fe2313fdbe3 as add_new_tab_listener, $df87ac5a30f7baac$export$836f70a28c317905 as broadcast_product_id, $df87ac5a30f7baac$export$8f66c4c7fb96eda2 as contextmenu_callback, $d4217f56717a3207$export$7e4427e80d5fc619 as optanon_get_cookie_ipns, $d4217f56717a3207$export$f0f6c846d96fdbec as init_optanon_tracking, $d4217f56717a3207$export$1dd9ce50e201eff1 as optanon_get_consent, $d4217f56717a3207$export$7a6d436e0782c6ed as optanon_wait_for_consent, $f991aad8d6175c9b$export$1ac466d53a6636ac as send_transaction_id_to_depict, $f991aad8d6175c9b$export$9ed4fbc47d558f94 as datalayer_interceptor, $f991aad8d6175c9b$export$b11248fa13a8a86c as datalayer_transaction_id_extractor, $f991aad8d6175c9b$export$3ebd86018b39d9d2 as orderpage_transaction_id_extractor, $f991aad8d6175c9b$export$ff8673d5dea82bd4 as url_transaction_id_extractor, $0897f35c3b3fbbc4$export$eee4c4d924348b05 as send_page_view_if_needed, $0897f35c3b3fbbc4$export$f7cb1bd47199ec38 as send_page_view_on_navigation, $f5a4b8e233f0e1cd$export$1d9c6fddbff3441f as DepictAPIWS, $429b4383ef3d586f$export$74108888f38788f3 as ListenableSet, $9c44a7238815fa47$export$535946eb77c946dd as deparallelize, $9c44a7238815fa47$export$f241be8e610f5c77 as deparallelize_no_drop, $ab9c3dbf2bb2fbf7$export$f8ea2e7b15b5d129 as buildThresholdList, $85906d121f53bacd$export$d9fdc6ce2907f95b as chaotic_closest, $652300c6621d5500$export$cfef5d5c9ac09253 as standard_price_format, $652300c6621d5500$export$9590700a594aef08 as ensure_object_path, $652300c6621d5500$export$925772df9b4d16e5 as ensure_parameter_in_url, $652300c6621d5500$export$44951404cb8d0583 as html2elems, $652300c6621d5500$export$d3e2a0560cbf4787 as html2elem, $652300c6621d5500$export$5e63aea0cac01fa0 as querySelectorAllElements, $652300c6621d5500$export$785f04709990c4ec as querySelectorUpwards, $652300c6621d5500$export$f124e3ee16e6b45d as intl_number_format_with_fallback, $652300c6621d5500$export$d4bd03f19260ef1c as relativify, $45d268baa2df1ba1$export$6b75200e58bc97d0 as deduplicate, $45d268baa2df1ba1$export$9426572bd5645bc1 as dedup_products, $8183c177c3bdf94d$export$82539d9817116aff as navigate_with_next_router, $f69445e469425bcb$export$774bc87373c4fc6c as add_item, $f69445e469425bcb$export$337197b94b3bd680 as get_items_in_cart, $f69445e469425bcb$export$783ef16647773b3d as get_shopify_analytics_meta_product, $f69445e469425bcb$export$ab0f802c05dd969b as intercept, $201e455525e1fa49$export$85be83e1935d93c2 as fetch_replacer, $201e455525e1fa49$export$f8da66bc4f1d059e as FakeResponse, $c95f8181bad32e8d$export$bcd70d5ed1cf6313 as fetch_retry, $073645eedb3f65a8$export$b404e20f3c4a490e as get_optimize_variant, $ad1dbddac6af350d$export$20e9533e68ee72e7 as stateless_href_change_ipns, $ad1dbddac6af350d$export$a9d39e43ae273d26 as href_change_ipns, $ad1dbddac6af350d$export$baccefee4a395d8f as history_replacer, $ad1dbddac6af350d$export$1cd22bab0d2c3b0b as on_next_navigation, $ad1dbddac6af350d$export$7500cdfd37aafd43 as instant_exec_on_suspect_history_change, $7ca6fdc721083788$export$e806c6c1615a59ae as async_iterable_ipns, $7ca6fdc721083788$export$10c3e52ef388b81b as make_ipns_stateful, $7ca6fdc721083788$export$90740b5bc9c2b3b7 as make_ipns_stateless, $449d6683cecfa078$export$3e42f5078e3abfc0 as make_simple_async_iterable, $449d6683cecfa078$export$e2c811ae0eb35313 as RawObservableInformation, $c1590f86e0eca625$export$2c2f50b30b7b2576 as iterable_to_attribute, $332ef338faf216a4$export$7c081fdbc65b6a2a as iterable_to_elems, $fee212025270d5b9$export$927664b47117acb0 as make_asyncIterable_exiter, $07beada135e5f5e8$export$f8913c8a18f7ca21 as zip_async_iterables, $2c22b027931240e6$export$f811d2ce0aa6019b as insert_surfaces, $2c22b027931240e6$export$b8d1e1d07a3f3776 as prevent_infinite_loop, $2c22b027931240e6$export$e3f70ef7e3d00501 as revertable_remove, $1013f2e568f87406$export$59ba1eb2c083f0cd as insert_styling, $1013f2e568f87406$export$692b606677218a16 as depict_init, $1013f2e568f87406$export$328e81c44cddf3c0 as depict_init_with_market_logic, $1013f2e568f87406$export$a4f97b27a0592e6c as normal_get_product_id, $1013f2e568f87406$export$a96c18473f2af463 as track_a2c, $26dbd7db7fd1bc2c$export$515c3ea4d599b05a as javascript_media_query, $914c6f35222c820d$export$33f937d741e49339 as patched_querySelectorAll, $07ddf7dfff112d01$export$a4eccf92efefa04d as placeholder_svg, $07ddf7dfff112d01$export$2dd69958012e3e49 as make_placeholder_rr, $07ddf7dfff112d01$export$3b75288f46cadd96 as random_text_placeholder, $6c8c963618d41bb2$export$947a20746936143d as Promise_Any, $3a96de5a459d34f9$export$c50e1901e8ed0615 as queueMacroTask, $1cd1e96fe31c935d$export$bb0a9c36cf454ea0 as rand, $6cb4d83127e468ea$export$656831b7e9c341c3 as random_string, $6cb4d83127e468ea$export$a6db784f019668ba as make_random_classname, $2b6304d4ce419ed5$export$3d04c40e7acc1a32 as reactive_template, $243da8b4990520aa$export$8ec5c86406f333ff as removeChild_error_swallowing_factory, $9c0a16930ae6750f$export$38e89c688f9d553a as replace_promise_with_native_if_exists_and_enforce, $9c0a16930ae6750f$export$e647444ed9403635 as get_iframe_promise, $f82333cd2ffc1582$export$2a1cc61cffa1f36f as rp_relativify_fetch, $f82333cd2ffc1582$export$f14a775632a826c4 as rp_relativify_history, $f82333cd2ffc1582$export$2a38b176ce969e2c as rp_relativify_xhr, $f82333cd2ffc1582$export$83ec13b10b391f13 as default_rp_fixes, $d9aec442b12a1134$export$39d526a1194b6499 as serialize_object, $b2c9f99c083a1182$export$12b4c6cbc6b8b4e4 as sort_obj, $95b71532fa7f905c$export$a422d714c8cb1a5d as standard_get_market, $cb3a51d87cbe5eff$export$3427ec8268623f1 as listenToLocalStorage, $095a7d035ba7d7a7$export$8d42ce4827f43582 as Tenant, $26145caeb41f1f7b$export$cd1adfb8059b5fcd as timeout_promise, $2da62df28669a48a$export$79f910a98828378d as variable_setter_to_ipns, $2da62df28669a48a$export$d5062f468a0454f3 as find_descriptor, $2da62df28669a48a$export$2fc1a072736ae2f6 as is_available_in, $8a812fa4638e2832$export$a739d9a07da7f9ce as use_voyado_id, $57642e3bf93ac1e7$export$5c069c93d2b7493f as wait, $24528b2f119d82fb$export$f314addd5f976083 as xhr_load, $24528b2f119d82fb$export$8e16c51fd2b6507 as xhr_read_interceptor, $24528b2f119d82fb$export$c74578d2cd47a84a as xhr_send_interceptor, $24528b2f119d82fb$export$33d1643df63073a8 as xhr_replace, $c40fc6dc2c22b3c4$export$4a3043e508dd72f0 as DefaultViewMoreButton, $a59cde169150d10b$export$8a0e4d6f6abf7e90 as GeneralSideSlidein, $24f3fd73864991c0$export$c068ad5361be7646 as GeneralSizeSelector, $adc0bb548fdb574f$export$84712d0562a614b8 as Placeholder, $adc0bb548fdb574f$export$d613f5b6d0a331a8 as ContainedPlaceholderImage, $2e6ca552eb0e0b2b$export$97f31f44c68c1d5 as RecommendationContainer, $ad0b2591dac160be$export$ddd70fdae1b350e6 as LeftChevron, $ad0b2591dac160be$export$32a55d57d151bc5a as RightChevron, $9a74c17d1ef21fdf$export$590326cc34f49e2d as createColorPicker, $0f55c2bc0a7b363b$export$237455ad7e59d4e5 as useExpandingContainer, $73f0a7e385687d5d$export$2369f6fc1c911576 as ContainedHoverImage, $c987460cedc0d7ec$export$788756b42446dc2d as ContainedImage, $9ef5ce4804a3b61b$export$f39a7d0667e924a as make_sizes_setter, $9ef5ce4804a3b61b$export$a62825542f1bfcf5 as make_sourceset_component, $9ef5ce4804a3b61b$export$a98fc8a2c818d3d8 as is_safari, $9ef5ce4804a3b61b$export$f7c915448031deac as make_url_with_query_params, $9ef5ce4804a3b61b$export$3d13beba9b52c947 as resize_base_url, $9e4bee2e3b4b5753$export$362abebb4b313340 as base_url, $17bb552dedcd526c$export$af2e17a20c2ea3c5 as Sentry, $c07f1f2ffdcaec61$export$9dc8f3a0aa3efc85 as camelCasifyObject, $c07f1f2ffdcaec61$export$b481488de1caa85 as snakeCasifyObject, $40a5a98adc907fe0$export$499ef00a6a3417f8 as rgb_to_hsl, $40a5a98adc907fe0$export$e4fd3b61e79357a7 as hsl_to_rgb, $40a5a98adc907fe0$export$98c2b3491e76c1f as relative_luminance_from_rgb, $40a5a98adc907fe0$export$486b165479b9284f as hsb_to_rgb, $40a5a98adc907fe0$export$ca305c142c6fc3cf as hex_to_rgb, $b9e07ce3c67aa344$export$83d89fbfd8236492 as version, $ea5707b8e7b350cf$export$2cefb7e61fcbae00 as add_to_version_info, $5ea81d00eec57744$export$c3f56a35e076f139 as sync_el_content_with_accessor, $34eb7e26a9a798f2$export$e35115e6d0715f77 as use_href_accessor, $be5f485da4e3f813$export$fce59460a1699957 as cookiebot_get_consent, $be5f485da4e3f813$export$56c2e8be65fb14ae as cookiebot_wait_for_consent, $be5f485da4e3f813$export$8827362e5e938d26 as cookiebot_get_cookie_ipns, $be5f485da4e3f813$export$abec7fd9f0b9cc22 as init_cookiebot_tracking };
|
|
6452
|
+
export { $e5da8b4d1e6c12b3$export$a13bb02a27aaa5e6 as setOverrideSentryEnvironment, $c9b2d210d5bbc418$export$2d9dc2897d88588 as findMostFrequentItem, $5c580d87c093cc47$export$a7e53ec3b3fdd030 as base64_decode_unicode, $5c580d87c093cc47$export$a1893782a2a6be0d as base64_encode_unicode, $5f4e0abe3139380e$export$6f051469dd676a8b as make_plp_recommendations_inserted_handler, $ea5707b8e7b350cf$export$60d1d0e3cfc8b9ed as version_info, $ea5707b8e7b350cf$export$fe609f0216e4ebef as add_version_query_params, $cdf4691608b4019f$export$6e7454c733fa1fb2 as cache_args, $bcc7b73f8b96a6f0$export$8582cf3716962dc2 as check_displays, $b000f5ef6ce456d9$export$8048b892d651b310 as err, $a01cf8e3169d2af1$export$16d7c76794a38a4 as require_event_listener, $6a44fa3f1acf7693$export$55621c1ce3cd536b as infinite_promise_creator, $4c6e595091defcd9$export$32ccf3a614c84258 as infinite_promise_no_skip, $e64690bc3a7de2b1$export$c7187bbd1a7a9244 as placeholder, $0342f59060b8a196$export$f1b8b9fd75ddcab1 as insert_styling_into_slider, $03021b39f80fac4b$export$2e2bcd8739ae039 as wpff, $7d82513db34b5d27$export$12e07a2a9f87578a as ElementObserver, $90fa633a9564f115$export$b6ae1bc530f4c149 as observer, $0f650018c3cbc373$export$34b9dba7ce09269b as jsx, $0f650018c3cbc373$export$25062201e9e25d76 as jsxs, $a285401a927e4306$export$eb0b9ed911409b57 as use_element, $a285401a927e4306$export$f63fcc839cb0f734 as use_listener, $a285401a927e4306$export$22a65337c1b43b1f as classlist, $0f650018c3cbc373$export$ffb0004e005737fa as Fragment, $241f2f02cc612a49$export$de56f1198d121036 as dlog, $241f2f02cc612a49$export$997143d41f6a0c9b as derror, $241f2f02cc612a49$export$c2363754d4758444 as dwarn, $241f2f02cc612a49$export$2dd75a6b038dc8cb as set_browser_prefix, $5e1f45affc1d7def$export$b3bbfd758f11cfa9 as catchify, $5e1f45affc1d7def$export$f18d5b0af29128b7 as report, $a5a2bdb4ae93374b$export$55fe61489d2c7417 as is_debug, $c755e2b0d4b18501$export$6038895ac52bd044 as chevronLeft, $c755e2b0d4b18501$export$dc84183312f0c201 as chevronRight, $0fe3923936d40f55$export$68c017fd93791405 as expandingContainer, $5f31622ffb78bc10$export$3be7054c61590ee3 as Lazyfier, $5f31622ffb78bc10$export$b87d7e0da8b5cbe3 as test_array_proxy_support, $be288a83d9eabf2a$export$692b27c28639e5b9 as Amazing_Slider, $20fe9624210ef635$export$16501883f477737a as colorize_elements, $20fe9624210ef635$export$deca40f48c0569f8 as should_colorizeLogics, $df6d080cba513381$export$17c3166a7ebd4688 as n_col_styling_with_dist, $df6d080cba513381$export$c84671f46d6a1ca as Layout, $df6d080cba513381$export$483bdd1f1186de13 as layout_get_visible_recs_without_partial_rows, $df6d080cba513381$export$3dc5e2383c924ebf as layout_get_total_rec_amount_for_row, $df6d080cba513381$export$717f13d9ba00ca19 as layout_media_query_header, $b109421811582f8c$export$8cbd8aa1c70f9a13 as slider_autoscroll_factory, $090af64928922937$export$80039a49055269fb as make_button1, $66c5b496f7887c00$export$af88b4929c2dc86 as make_button2, $d3c54fdf1bfb087a$export$1d17a045bcc711b1 as slider_dots_factory, $d3c54fdf1bfb087a$export$a09282b33e69b43f as navdot, $3ad897e1659ee6d7$export$411b0f20794697ce as slider_draggable_factory, $21afac8db3f98820$export$5129719c04a52f8c as slider_fading_factory, $0cbf24ae3e670238$export$5723caf9a8335aa6 as slider_fractional_factory, $4837ebe61ecec421$export$93223e488e7ee078 as slider_show_scroll, $ff905d87817a07f4$export$b36d2489a5a16728 as slider_snap_css, $ff905d87817a07f4$export$49b950309ab787ad as can_use_snapping_and_still_scroll, $e1af55c2112926b7$export$dac64fd35a4805a4 as slider_snapping_factory, $f340c415f2e1d03a$export$68babfc5be0de5da as Amazing_Lazy_Slider, $aadc6d9eeb8e8a56$export$419f84efad7d9fe as sizes_to_surface, $aadc6d9eeb8e8a56$export$417ef0ab13d8b984 as surface_mixer, $aadc6d9eeb8e8a56$export$be95cb0e8cfd099e as promise_until_next_navigation, $bd7c9f254946941d$export$2c34560c3749dc63 as bind_to_a2c_button, $bd7c9f254946941d$export$82a685f2da2fb027 as bind_tracking_to_link, $d5f7352b58e0d737$export$15f8a0cd5a8c0ebb as depict_click, $d5f7352b58e0d737$export$82badda1f9923310 as depict_prefilled, $d5f7352b58e0d737$export$9028351cb994757e as depict_add_to_cart, $d5f7352b58e0d737$export$93ae15b1ae509334 as set_session_id_fn, $d5f7352b58e0d737$export$61e7e1f11e96692f as get_session_id, $d5f7352b58e0d737$export$622991c71a1f52b3 as get_cookie, $d5f7352b58e0d737$export$8c6f26a5b6921b95 as get_tracking_event_context_data, $814c3bf8e175fa59$export$72036d950e1fae95 as filter_depict_payload, $814c3bf8e175fa59$export$28cacbd9b4306ffc as send_depict, $814c3bf8e175fa59$export$cc3b6ddf805f6156 as foolproof_send_beacon, $814c3bf8e175fa59$export$608478473a3304a0 as send_depict_unfiltered, $814c3bf8e175fa59$export$aa26019042811d4f as send_websocket, $799496226e956169$export$674d8cd8b6868154 as create_ga_queue, $799496226e956169$export$edfedd0557ca5a2d as make_tracker_send_to_depict, $d6c3e2ba045accda$export$4205dc6835bc0d9f as send_impression_event, $e89a1d249db21af0$export$37125ccc5dd98050 as impression_track_element, $c633189b7b69d048$export$d0efd8ed14f5c33 as impression_tracking_post_processor, $d6c3e2ba045accda$export$c543ee4cdb0d0964 as set_impression_threshold, $d6c3e2ba045accda$export$135da44d0ba958bc as impression_threshold, $d6c3e2ba045accda$export$ca8321ea61dc2544 as has_to_be_intersecting_for, $df87ac5a30f7baac$export$58c56fe2313fdbe3 as add_new_tab_listener, $df87ac5a30f7baac$export$836f70a28c317905 as broadcast_product_id, $df87ac5a30f7baac$export$8f66c4c7fb96eda2 as contextmenu_callback, $0897f35c3b3fbbc4$export$eee4c4d924348b05 as send_page_view_if_needed, $0897f35c3b3fbbc4$export$f7cb1bd47199ec38 as send_page_view_on_navigation, $f5a4b8e233f0e1cd$export$1d9c6fddbff3441f as DepictAPIWS, $429b4383ef3d586f$export$74108888f38788f3 as ListenableSet, $9c44a7238815fa47$export$535946eb77c946dd as deparallelize, $9c44a7238815fa47$export$f241be8e610f5c77 as deparallelize_no_drop, $ab9c3dbf2bb2fbf7$export$f8ea2e7b15b5d129 as buildThresholdList, $85906d121f53bacd$export$d9fdc6ce2907f95b as chaotic_closest, $652300c6621d5500$export$cfef5d5c9ac09253 as standard_price_format, $652300c6621d5500$export$9590700a594aef08 as ensure_object_path, $652300c6621d5500$export$925772df9b4d16e5 as ensure_parameter_in_url, $652300c6621d5500$export$44951404cb8d0583 as html2elems, $652300c6621d5500$export$d3e2a0560cbf4787 as html2elem, $652300c6621d5500$export$5e63aea0cac01fa0 as querySelectorAllElements, $652300c6621d5500$export$785f04709990c4ec as querySelectorUpwards, $652300c6621d5500$export$f124e3ee16e6b45d as intl_number_format_with_fallback, $652300c6621d5500$export$d4bd03f19260ef1c as relativify, $45d268baa2df1ba1$export$6b75200e58bc97d0 as deduplicate, $45d268baa2df1ba1$export$9426572bd5645bc1 as dedup_products, $8183c177c3bdf94d$export$82539d9817116aff as navigate_with_next_router, $f69445e469425bcb$export$774bc87373c4fc6c as add_item, $f69445e469425bcb$export$337197b94b3bd680 as get_items_in_cart, $f69445e469425bcb$export$783ef16647773b3d as get_shopify_analytics_meta_product, $f69445e469425bcb$export$ab0f802c05dd969b as intercept, $201e455525e1fa49$export$85be83e1935d93c2 as fetch_replacer, $201e455525e1fa49$export$f8da66bc4f1d059e as FakeResponse, $c95f8181bad32e8d$export$bcd70d5ed1cf6313 as fetch_retry, $ad1dbddac6af350d$export$20e9533e68ee72e7 as stateless_href_change_ipns, $ad1dbddac6af350d$export$a9d39e43ae273d26 as href_change_ipns, $ad1dbddac6af350d$export$baccefee4a395d8f as history_replacer, $ad1dbddac6af350d$export$1cd22bab0d2c3b0b as on_next_navigation, $ad1dbddac6af350d$export$7500cdfd37aafd43 as instant_exec_on_suspect_history_change, $7ca6fdc721083788$export$e806c6c1615a59ae as async_iterable_ipns, $7ca6fdc721083788$export$10c3e52ef388b81b as make_ipns_stateful, $7ca6fdc721083788$export$90740b5bc9c2b3b7 as make_ipns_stateless, $449d6683cecfa078$export$3e42f5078e3abfc0 as make_simple_async_iterable, $449d6683cecfa078$export$e2c811ae0eb35313 as RawObservableInformation, $c1590f86e0eca625$export$2c2f50b30b7b2576 as iterable_to_attribute, $332ef338faf216a4$export$7c081fdbc65b6a2a as iterable_to_elems, $fee212025270d5b9$export$927664b47117acb0 as make_asyncIterable_exiter, $07beada135e5f5e8$export$f8913c8a18f7ca21 as zip_async_iterables, $2c22b027931240e6$export$f811d2ce0aa6019b as insert_surfaces, $2c22b027931240e6$export$b8d1e1d07a3f3776 as prevent_infinite_loop, $2c22b027931240e6$export$e3f70ef7e3d00501 as revertable_remove, $1013f2e568f87406$export$59ba1eb2c083f0cd as insert_styling, $1013f2e568f87406$export$692b606677218a16 as depict_init, $1013f2e568f87406$export$328e81c44cddf3c0 as depict_init_with_market_logic, $1013f2e568f87406$export$a4f97b27a0592e6c as normal_get_product_id, $26dbd7db7fd1bc2c$export$515c3ea4d599b05a as javascript_media_query, $914c6f35222c820d$export$33f937d741e49339 as patched_querySelectorAll, $6c8c963618d41bb2$export$947a20746936143d as Promise_Any, $3a96de5a459d34f9$export$c50e1901e8ed0615 as queueMacroTask, $1cd1e96fe31c935d$export$bb0a9c36cf454ea0 as rand, $6cb4d83127e468ea$export$656831b7e9c341c3 as random_string, $6cb4d83127e468ea$export$a6db784f019668ba as make_random_classname, $2b6304d4ce419ed5$export$3d04c40e7acc1a32 as reactive_template, $243da8b4990520aa$export$8ec5c86406f333ff as removeChild_error_swallowing_factory, $9c0a16930ae6750f$export$38e89c688f9d553a as replace_promise_with_native_if_exists_and_enforce, $9c0a16930ae6750f$export$e647444ed9403635 as get_iframe_promise, $f82333cd2ffc1582$export$2a1cc61cffa1f36f as rp_relativify_fetch, $f82333cd2ffc1582$export$f14a775632a826c4 as rp_relativify_history, $f82333cd2ffc1582$export$2a38b176ce969e2c as rp_relativify_xhr, $f82333cd2ffc1582$export$83ec13b10b391f13 as default_rp_fixes, $d9aec442b12a1134$export$39d526a1194b6499 as serialize_object, $b2c9f99c083a1182$export$12b4c6cbc6b8b4e4 as sort_obj, $95b71532fa7f905c$export$a422d714c8cb1a5d as standard_get_market, $cb3a51d87cbe5eff$export$3427ec8268623f1 as listenToLocalStorage, $26145caeb41f1f7b$export$cd1adfb8059b5fcd as timeout_promise, $2da62df28669a48a$export$79f910a98828378d as variable_setter_to_ipns, $2da62df28669a48a$export$d5062f468a0454f3 as find_descriptor, $2da62df28669a48a$export$2fc1a072736ae2f6 as is_available_in, $8a812fa4638e2832$export$a739d9a07da7f9ce as use_voyado_id, $57642e3bf93ac1e7$export$5c069c93d2b7493f as wait, $24528b2f119d82fb$export$f314addd5f976083 as xhr_load, $24528b2f119d82fb$export$8e16c51fd2b6507 as xhr_read_interceptor, $24528b2f119d82fb$export$c74578d2cd47a84a as xhr_send_interceptor, $24528b2f119d82fb$export$33d1643df63073a8 as xhr_replace, $c40fc6dc2c22b3c4$export$4a3043e508dd72f0 as DefaultViewMoreButton, $a59cde169150d10b$export$8a0e4d6f6abf7e90 as GeneralSideSlidein, $24f3fd73864991c0$export$c068ad5361be7646 as GeneralSizeSelector, $adc0bb548fdb574f$export$84712d0562a614b8 as Placeholder, $adc0bb548fdb574f$export$d613f5b6d0a331a8 as ContainedPlaceholderImage, $2e6ca552eb0e0b2b$export$97f31f44c68c1d5 as RecommendationContainer, $ad0b2591dac160be$export$ddd70fdae1b350e6 as LeftChevron, $ad0b2591dac160be$export$32a55d57d151bc5a as RightChevron, $9a74c17d1ef21fdf$export$590326cc34f49e2d as createColorPicker, $0f55c2bc0a7b363b$export$237455ad7e59d4e5 as useExpandingContainer, $73f0a7e385687d5d$export$2369f6fc1c911576 as ContainedHoverImage, $c987460cedc0d7ec$export$788756b42446dc2d as ContainedImage, $9ef5ce4804a3b61b$export$f39a7d0667e924a as make_sizes_setter, $9ef5ce4804a3b61b$export$a62825542f1bfcf5 as make_sourceset_component, $9ef5ce4804a3b61b$export$a98fc8a2c818d3d8 as is_safari, $9ef5ce4804a3b61b$export$f7c915448031deac as make_url_with_query_params, $9ef5ce4804a3b61b$export$3d13beba9b52c947 as resize_base_url, $9e4bee2e3b4b5753$export$362abebb4b313340 as base_url, $17bb552dedcd526c$export$af2e17a20c2ea3c5 as Sentry, $c07f1f2ffdcaec61$export$9dc8f3a0aa3efc85 as camelCasifyObject, $c07f1f2ffdcaec61$export$b481488de1caa85 as snakeCasifyObject, $40a5a98adc907fe0$export$499ef00a6a3417f8 as rgb_to_hsl, $40a5a98adc907fe0$export$e4fd3b61e79357a7 as hsl_to_rgb, $40a5a98adc907fe0$export$98c2b3491e76c1f as relative_luminance_from_rgb, $40a5a98adc907fe0$export$486b165479b9284f as hsb_to_rgb, $40a5a98adc907fe0$export$ca305c142c6fc3cf as hex_to_rgb, $b9e07ce3c67aa344$export$83d89fbfd8236492 as version, $ea5707b8e7b350cf$export$2cefb7e61fcbae00 as add_to_version_info, $5ea81d00eec57744$export$c3f56a35e076f139 as sync_el_content_with_accessor, $34eb7e26a9a798f2$export$e35115e6d0715f77 as use_href_accessor };
|