@depict-ai/utilishared 1.0.26 → 1.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +6 -1
- package/dist/main.cjs +217 -218
- package/dist/module.js +217 -219
- package/package.json +2 -2
package/dist/main.cjs
CHANGED
|
@@ -269,9 +269,10 @@ $parcel$export(module.exports, "rgb_to_hsl", () => $d73746ee466f09ca$export$499e
|
|
|
269
269
|
$parcel$export(module.exports, "hsl_to_rgb", () => $d73746ee466f09ca$export$e4fd3b61e79357a7);
|
|
270
270
|
$parcel$export(module.exports, "relative_luminance_from_rgb", () => $d73746ee466f09ca$export$98c2b3491e76c1f);
|
|
271
271
|
$parcel$export(module.exports, "hsb_to_rgb", () => $d73746ee466f09ca$export$486b165479b9284f);
|
|
272
|
+
$parcel$export(module.exports, "hex_to_rgb", () => $d73746ee466f09ca$export$ca305c142c6fc3cf);
|
|
272
273
|
$parcel$export(module.exports, "version", () => $815f67c61b4c0a42$export$83d89fbfd8236492);
|
|
273
274
|
$parcel$export(module.exports, "add_to_version_info", () => $e4a18bf12ad092d9$export$2cefb7e61fcbae00);
|
|
274
|
-
const $815f67c61b4c0a42$export$83d89fbfd8236492 = "1.0.
|
|
275
|
+
const $815f67c61b4c0a42$export$83d89fbfd8236492 = "1.0.28";
|
|
275
276
|
|
|
276
277
|
|
|
277
278
|
const $7b5e577a60b81e60$export$55fe61489d2c7417 = /*@__PURE__*/ (()=>process.env.STRIP_DEBUG === "true" ? false : process.env.DEBUG === "true" || process.env.NODE_ENV === "development" || process.env.BUILD_TARGET !== "node" && (globalThis?.document?.currentScript?.dataset?.debug === "true" || globalThis?.localStorage?.getItem?.("debug") === "true"))();
|
|
@@ -541,7 +542,7 @@ function $9a42a570de51ea3d$var$on_async_iterator_next_called(async_iterable, bef
|
|
|
541
542
|
return new Proxy(target[property], {
|
|
542
543
|
apply (target, this_arg, arg_list) {
|
|
543
544
|
const iterator = target.apply(this_arg, arg_list);
|
|
544
|
-
const { return: return_fn
|
|
545
|
+
const { return: return_fn } = iterator;
|
|
545
546
|
if (return_fn) set_stock_return_function?.(return_fn);
|
|
546
547
|
return new Proxy(iterator, {
|
|
547
548
|
get (inner_target, inner_property) {
|
|
@@ -580,7 +581,7 @@ function $548fd58b14b25a52$export$8048b892d651b310(exception, error_for_stack) {
|
|
|
580
581
|
(0, $e6c6e7929ea385ae$export$de56f1198d121036)(exception);
|
|
581
582
|
if (0, $7b5e577a60b81e60$export$55fe61489d2c7417) /* eslint-disable no-console */ console.trace();
|
|
582
583
|
if (process.env.BUILD_TARGET !== "node") {
|
|
583
|
-
const { stack: stack
|
|
584
|
+
const { stack: stack } = error_for_stack instanceof Error ? error_for_stack : new Error();
|
|
584
585
|
const msg_is_error = exception instanceof Error;
|
|
585
586
|
(0, $61a34358bf0d3d8b$export$af2e17a20c2ea3c5).withScope(function(scope) {
|
|
586
587
|
if (msg_is_error) scope.setExtra("primary_stack", exception.stack);
|
|
@@ -773,7 +774,7 @@ function $0cf2ab65d8901485$export$2e2bcd8739ae039(TENANT, more_options, dlog, ex
|
|
|
773
774
|
for(const fn in function_backlog){
|
|
774
775
|
const backlog_for_fn = function_backlog[fn];
|
|
775
776
|
backlog_for_fn.forEach((backlog_obj, index)=>{
|
|
776
|
-
const { args: args
|
|
777
|
+
const { args: args, resolve: resolve } = backlog_obj;
|
|
777
778
|
try {
|
|
778
779
|
sentry.run((current_hub)=>{
|
|
779
780
|
if (typeof current_hub[fn] == "function") {
|
|
@@ -809,7 +810,7 @@ async function $0cf2ab65d8901485$var$load_sentry(TENANT, more_options = {}, extr
|
|
|
809
810
|
script.src = extra_sentry_url || "https://cdn.depict.ai/lazy_sentry/depict-ai.js";
|
|
810
811
|
document.head.appendChild(script);
|
|
811
812
|
const global_var_name = "_depict_ai_sentry";
|
|
812
|
-
const { BrowserClient: BrowserClient
|
|
813
|
+
const { BrowserClient: BrowserClient, Hub: Hub, defaultIntegrations: defaultIntegrations } = await (0, $e6d67ef355abb2dc$export$2fc1a072736ae2f6)(window, global_var_name);
|
|
813
814
|
delete window[global_var_name];
|
|
814
815
|
if (process.env.SENTRY_SAMPLE_RATE) {
|
|
815
816
|
const sample_rate = parseFloat(process.env.SENTRY_SAMPLE_RATE);
|
|
@@ -1102,7 +1103,7 @@ class $d10801050840d92b$export$1b28bc5c68cc4d77 extends EventTarget {
|
|
|
1102
1103
|
url,
|
|
1103
1104
|
protocols
|
|
1104
1105
|
];
|
|
1105
|
-
const { max_backoff_ms: max_backoff_ms
|
|
1106
|
+
const { max_backoff_ms: max_backoff_ms } = options;
|
|
1106
1107
|
if (max_backoff_ms) this.#max_backoff_ms = max_backoff_ms;
|
|
1107
1108
|
this.#setup_dot_on_event_support();
|
|
1108
1109
|
this.#connect();
|
|
@@ -1139,14 +1140,14 @@ class $d10801050840d92b$export$1d9c6fddbff3441f extends $d10801050840d92b$export
|
|
|
1139
1140
|
this.restart_ws(reason);
|
|
1140
1141
|
}
|
|
1141
1142
|
});
|
|
1142
|
-
#periodic_send(
|
|
1143
|
+
#periodic_send(msg) {
|
|
1143
1144
|
let delay_to_next_send = this.#initial_retry_ms;
|
|
1144
1145
|
let quit = false;
|
|
1145
1146
|
this.#messages_queued++;
|
|
1146
1147
|
(async ()=>{
|
|
1147
1148
|
while(!quit){
|
|
1148
1149
|
this.#start_reconnection_if_offline_process();
|
|
1149
|
-
await this.#wait_for_open_and_send(
|
|
1150
|
+
await this.#wait_for_open_and_send(msg);
|
|
1150
1151
|
const waited = await new Promise((r)=>{
|
|
1151
1152
|
const handler = ()=>{
|
|
1152
1153
|
r(false);
|
|
@@ -1178,7 +1179,7 @@ class $d10801050840d92b$export$1d9c6fddbff3441f extends $d10801050840d92b$export
|
|
|
1178
1179
|
const json_payload = JSON.stringify(payload);
|
|
1179
1180
|
const stop_sending = this.#periodic_send(json_payload);
|
|
1180
1181
|
while(true){
|
|
1181
|
-
const { data: data
|
|
1182
|
+
const { data: data } = await this.#msg_ipns.promise;
|
|
1182
1183
|
let reply;
|
|
1183
1184
|
try {
|
|
1184
1185
|
reply = JSON.parse(data);
|
|
@@ -1194,7 +1195,7 @@ class $d10801050840d92b$export$1d9c6fddbff3441f extends $d10801050840d92b$export
|
|
|
1194
1195
|
continue;
|
|
1195
1196
|
}
|
|
1196
1197
|
if (reply.id == payload.id) {
|
|
1197
|
-
const { status: status
|
|
1198
|
+
const { status: status } = reply;
|
|
1198
1199
|
if (status == "ack") {
|
|
1199
1200
|
stop_sending();
|
|
1200
1201
|
continue;
|
|
@@ -1347,6 +1348,7 @@ const $0c84f8e99aac5765$export$28cacbd9b4306ffc = /*@__PURE__*/ $0c84f8e99aac576
|
|
|
1347
1348
|
|
|
1348
1349
|
|
|
1349
1350
|
|
|
1351
|
+
|
|
1350
1352
|
let $e0a87646d12cb987$export$6399bdb2291895e0 = ()=>{
|
|
1351
1353
|
if (typeof document === "undefined") return "server";
|
|
1352
1354
|
let id = "";
|
|
@@ -1355,7 +1357,7 @@ let $e0a87646d12cb987$export$6399bdb2291895e0 = ()=>{
|
|
|
1355
1357
|
try {
|
|
1356
1358
|
id = localStorage._dep_id ||= (0, $650b64c1b384c895$export$656831b7e9c341c3)();
|
|
1357
1359
|
} catch (e) {
|
|
1358
|
-
(0, $
|
|
1360
|
+
(0, $e6c6e7929ea385ae$export$de56f1198d121036)("Can't use localStorage", e);
|
|
1359
1361
|
localstorage_error = e;
|
|
1360
1362
|
}
|
|
1361
1363
|
if (!id) {
|
|
@@ -1477,7 +1479,6 @@ function $dba5a9c0f6fb4324$export$6f051469dd676a8b(tenant, market, type) {
|
|
|
1477
1479
|
}
|
|
1478
1480
|
|
|
1479
1481
|
|
|
1480
|
-
|
|
1481
1482
|
/**
|
|
1482
1483
|
* @deprecated this was a stupid idea, it's much easier to read if one just does a quick arrow function that provides the wanted arguments
|
|
1483
1484
|
*/ function $ee1d22bd1fcdd4e1$export$6e7454c733fa1fb2(fn, ...args) {
|
|
@@ -1492,7 +1493,7 @@ function $dba5a9c0f6fb4324$export$6f051469dd676a8b(tenant, market, type) {
|
|
|
1492
1493
|
|
|
1493
1494
|
|
|
1494
1495
|
|
|
1495
|
-
const $eee5951374097b61$export$8582cf3716962dc2 = /*@__PURE__*/ (0, /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9)(async ({ recs: recs
|
|
1496
|
+
const $eee5951374097b61$export$8582cf3716962dc2 = /*@__PURE__*/ (0, /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9)(async ({ recs: recs, min_recs: min_recs, market: market, type: type, product_id: product_id, tenant: tenant })=>{
|
|
1496
1497
|
if (type == "placeholder") return;
|
|
1497
1498
|
if (typeof product_id === "function") product_id = product_id();
|
|
1498
1499
|
product_id = await product_id;
|
|
@@ -1573,7 +1574,7 @@ function $55595fc7bb226f61$var$deduplicate_and_dispatch() {
|
|
|
1573
1574
|
for (const [eoe, callback] of $55595fc7bb226f61$var$queued_callbacks){
|
|
1574
1575
|
// put events into structure of maps and sets where they can only exist once
|
|
1575
1576
|
$55595fc7bb226f61$var$queued_callbacks.delete(eoe);
|
|
1576
|
-
const { event: event_name
|
|
1577
|
+
const { event: event_name, selector: selector, element: element } = eoe;
|
|
1577
1578
|
if (!event_name) {
|
|
1578
1579
|
// it's an ifexists callback, doesnt' need deduplication
|
|
1579
1580
|
$55595fc7bb226f61$var$call_callback(callback, eoe);
|
|
@@ -1680,7 +1681,7 @@ class $9043c64496e3375f$export$12e07a2a9f87578a {
|
|
|
1680
1681
|
this.#check_observer_args(listener, ()=>{}, false);
|
|
1681
1682
|
// console.log("waiting for listener", listener, "selector", selector, "timeout", timeout);
|
|
1682
1683
|
return new Promise((0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)((r)=>{
|
|
1683
|
-
const stop_observing = this.#self_proxied["on" + listener](selector, ({ element: element
|
|
1684
|
+
const stop_observing = this.#self_proxied["on" + listener](selector, ({ element: element, disconnector: disconnector })=>{
|
|
1684
1685
|
r(element);
|
|
1685
1686
|
disconnector();
|
|
1686
1687
|
if (timeout) clearTimeout(obs_timeout);
|
|
@@ -1704,7 +1705,7 @@ class $9043c64496e3375f$export$12e07a2a9f87578a {
|
|
|
1704
1705
|
characterDataOldValue: true
|
|
1705
1706
|
});
|
|
1706
1707
|
}
|
|
1707
|
-
#disconnect_fn({ event_: event_
|
|
1708
|
+
#disconnect_fn({ event_: event_, selector_: selector_, callback_: callback_ }) {
|
|
1708
1709
|
return ()=>{
|
|
1709
1710
|
const fn = ()=>{
|
|
1710
1711
|
const observing = this.#observing;
|
|
@@ -1734,7 +1735,7 @@ class $9043c64496e3375f$export$12e07a2a9f87578a {
|
|
|
1734
1735
|
const attribute_attribution_map_object = this.#attribute_attribution_map_object;
|
|
1735
1736
|
for(let j = 0; j < records.length; j++){
|
|
1736
1737
|
const record = records[j];
|
|
1737
|
-
const { addedNodes: addedNodes
|
|
1738
|
+
const { addedNodes: addedNodes, removedNodes: removedNodes, target: target } = record;
|
|
1738
1739
|
const events_for_discovery = [];
|
|
1739
1740
|
let nodes_to_check;
|
|
1740
1741
|
// code for handling a record containing wanted elements in addedNodes or the children of added nodes and attribute changes that make an existing node match a selector, mainly for oncreation and onexists, but it will fire onchange if someone is listening if an attribute change makes an element match a selector
|
|
@@ -2044,20 +2045,20 @@ class $9043c64496e3375f$export$12e07a2a9f87578a {
|
|
|
2044
2045
|
};
|
|
2045
2046
|
return function_for_listener;
|
|
2046
2047
|
}
|
|
2047
|
-
#cleanup_weakref_when_refd_el_gcd(
|
|
2048
|
+
#cleanup_weakref_when_refd_el_gcd(listener, weakref, element) {
|
|
2048
2049
|
// we don't want to keep references to elements used as "selectors" in oncreation and onremoved
|
|
2049
2050
|
if (!this.#weakref_finalization_registry) return;
|
|
2050
2051
|
this.#weakref_finalization_registry.register(element, [
|
|
2051
|
-
|
|
2052
|
+
listener,
|
|
2052
2053
|
weakref
|
|
2053
2054
|
]);
|
|
2054
2055
|
}
|
|
2055
|
-
#finalization_registry_callback([
|
|
2056
|
+
#finalization_registry_callback([listener, weak_ref]) {
|
|
2056
2057
|
// element was GCd and the callbacks can never be called, remove them
|
|
2057
2058
|
const observing = this.#observing;
|
|
2058
|
-
observing[
|
|
2059
|
-
observing[
|
|
2060
|
-
if (observing[
|
|
2059
|
+
observing[listener]?.get(weak_ref)?.clear(); // just in case something still has a reference to this set and does something with it, clear it
|
|
2060
|
+
observing[listener]?.delete(weak_ref);
|
|
2061
|
+
if (observing[listener]?.size === 0) delete observing[listener];
|
|
2061
2062
|
if (Object.keys(observing).length === 0) {
|
|
2062
2063
|
this.#the_mutation_observer?.disconnect();
|
|
2063
2064
|
this.#the_mutation_observer = undefined;
|
|
@@ -2088,7 +2089,6 @@ class $9043c64496e3375f$export$12e07a2a9f87578a {
|
|
|
2088
2089
|
|
|
2089
2090
|
|
|
2090
2091
|
|
|
2091
|
-
|
|
2092
2092
|
const $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149 = /*@__PURE__*/ $2a1cbc63a04d4a2d$var$make_default_observer();
|
|
2093
2093
|
function $2a1cbc63a04d4a2d$var$make_default_observer() {
|
|
2094
2094
|
try {
|
|
@@ -2141,7 +2141,7 @@ function $bf7f12fe044e41b2$export$d4bd03f19260ef1c(url, also_onchange = false, o
|
|
|
2141
2141
|
const link_sel = "a[href]";
|
|
2142
2142
|
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onexists(link_sel, relativ_callback);
|
|
2143
2143
|
if (also_onchange) (0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onchange(link_sel, relativ_callback);
|
|
2144
|
-
if (also_in_all_shadow_roots && typeof ShadowRoot == "function") (0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onexists("*", (0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)(({ element: element
|
|
2144
|
+
if (also_in_all_shadow_roots && typeof ShadowRoot == "function") (0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onexists("*", (0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)(({ element: element })=>{
|
|
2145
2145
|
if (element?.shadowRoot instanceof ShadowRoot) {
|
|
2146
2146
|
const local_observer = new (0, $9043c64496e3375f$export$12e07a2a9f87578a)({
|
|
2147
2147
|
territory: element.shadowRoot
|
|
@@ -2245,7 +2245,7 @@ async function $44909e19109bf973$export$8f66c4c7fb96eda2(e, product_id) {
|
|
|
2245
2245
|
const got_wanted_event = await (0, $2fafbbbf345dcde0$export$947a20746936143d)([
|
|
2246
2246
|
new Promise((resolve)=>{
|
|
2247
2247
|
bc.addEventListener("message", (0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)((msg)=>{
|
|
2248
|
-
const { data: data
|
|
2248
|
+
const { data: data } = msg;
|
|
2249
2249
|
(0, $e6c6e7929ea385ae$export$de56f1198d121036)("Recieved broadcast channel event", data, msg);
|
|
2250
2250
|
if (data == product_id) resolve(true);
|
|
2251
2251
|
}));
|
|
@@ -2325,7 +2325,7 @@ const $72ed530554068e4f$export$4c51576248bcdf31 = (element, callback)=>{
|
|
|
2325
2325
|
};
|
|
2326
2326
|
const $72ed530554068e4f$var$intersection_observer_callback = (entries)=>{
|
|
2327
2327
|
for (const record of entries){
|
|
2328
|
-
const { target: target
|
|
2328
|
+
const { target: target } = record;
|
|
2329
2329
|
const callback = $72ed530554068e4f$var$watched_elements.get(target);
|
|
2330
2330
|
// Skip the element if it's no longer being watched.
|
|
2331
2331
|
if (!callback) {
|
|
@@ -2344,7 +2344,7 @@ const $72ed530554068e4f$var$intersection_observer_callback = (entries)=>{
|
|
|
2344
2344
|
});
|
|
2345
2345
|
} else if (currently_intersecting && record.intersectionRatio < (0, $dd025eb6f77f8f8b$export$135da44d0ba958bc)[1]) {
|
|
2346
2346
|
// we are in the process of "measuring" and went below the threshold
|
|
2347
|
-
const { started_intersecting_at_: started_intersecting_at_
|
|
2347
|
+
const { started_intersecting_at_: started_intersecting_at_, callback_timeout_: callback_timeout_ } = $72ed530554068e4f$var$current_intersections.get(target);
|
|
2348
2348
|
const time_elapsed = +new Date() - started_intersecting_at_;
|
|
2349
2349
|
// If we stopped intersecting too early we want to abort our timeout.
|
|
2350
2350
|
// if we did not we also want to abort the timeout since it's been lagging and just instantly send the event
|
|
@@ -2385,9 +2385,9 @@ const $11ff7b46c1fb674c$export$d0efd8ed14f5c33 = (items, display, info)=>{
|
|
|
2385
2385
|
(0, $e6c6e7929ea385ae$export$de56f1198d121036)("Impression tracking: No tenant instance, can't track", items, display);
|
|
2386
2386
|
return items;
|
|
2387
2387
|
}
|
|
2388
|
-
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onexists(first_watchable_el, ({ element: element
|
|
2388
|
+
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onexists(first_watchable_el, ({ element: element })=>{
|
|
2389
2389
|
(0, $72ed530554068e4f$export$4c51576248bcdf31)(element, ()=>{
|
|
2390
|
-
const { recommendation_id: recommendation_id
|
|
2390
|
+
const { recommendation_id: recommendation_id, search_result_id: search_result_id, product_listing_result_id: product_listing_result_id, suggestions_result_id: suggestions_result_id } = display;
|
|
2391
2391
|
(0, $dd025eb6f77f8f8b$export$4205dc6835bc0d9f)({
|
|
2392
2392
|
...(0, $e0a87646d12cb987$export$8c6f26a5b6921b95)(),
|
|
2393
2393
|
recommendation_type: info.rendering_options.type,
|
|
@@ -2410,7 +2410,7 @@ const $11ff7b46c1fb674c$export$d0efd8ed14f5c33 = (items, display, info)=>{
|
|
|
2410
2410
|
|
|
2411
2411
|
|
|
2412
2412
|
|
|
2413
|
-
const $8e19f8200d357fe7$export$37125ccc5dd98050 = ({ element: element
|
|
2413
|
+
const $8e19f8200d357fe7$export$37125ccc5dd98050 = ({ element: element, data: data, wait_for_dom_insertion: wait_for_dom_insertion = true })=>{
|
|
2414
2414
|
const disconnectors = [];
|
|
2415
2415
|
const impression_track = ()=>{
|
|
2416
2416
|
const disconnector = (0, $72ed530554068e4f$export$4c51576248bcdf31)(element, ()=>{
|
|
@@ -2525,7 +2525,7 @@ async function $69f7524c8bdd85b4$export$1cd22bab0d2c3b0b(callback) {
|
|
|
2525
2525
|
}
|
|
2526
2526
|
async function $69f7524c8bdd85b4$export$baccefee4a395d8f(after_navigation, replace_replaceState = true) {
|
|
2527
2527
|
if (typeof History === "undefined") return;
|
|
2528
|
-
const { prototype: prototype
|
|
2528
|
+
const { prototype: prototype } = History;
|
|
2529
2529
|
const instance = history;
|
|
2530
2530
|
const polyfill_dance = (the_thing)=>{
|
|
2531
2531
|
const proxy_the_thing = (obj)=>{
|
|
@@ -2555,7 +2555,7 @@ let $72ee205b59322497$var$last_page_pageview_sent_for;
|
|
|
2555
2555
|
async function $72ee205b59322497$export$eee4c4d924348b05(data) {
|
|
2556
2556
|
// Send page view to depict if needed
|
|
2557
2557
|
try {
|
|
2558
|
-
const { href: href
|
|
2558
|
+
const { href: href } = location;
|
|
2559
2559
|
if ($72ee205b59322497$var$last_page_pageview_sent_for !== href) {
|
|
2560
2560
|
$72ee205b59322497$var$last_page_pageview_sent_for = href;
|
|
2561
2561
|
(0, $e0a87646d12cb987$export$82badda1f9923310)({
|
|
@@ -2646,7 +2646,7 @@ function $28e42b0009d694b2$var$consent_from_cookie() {
|
|
|
2646
2646
|
const consent_json = cookie.replace(/%2C/g, ",").replace(/%27/g, "'").replace(/'/g, '"').replace(/([{[,])\s*([\w]+?):/g, '$1"$2":');
|
|
2647
2647
|
try {
|
|
2648
2648
|
return JSON.parse(consent_json);
|
|
2649
|
-
} catch ({ message: message
|
|
2649
|
+
} catch ({ message: message }) {
|
|
2650
2650
|
(0, $e6c6e7929ea385ae$export$de56f1198d121036)("Error parsing cookie json", consent_json, message);
|
|
2651
2651
|
return;
|
|
2652
2652
|
}
|
|
@@ -2665,7 +2665,7 @@ function $28e42b0009d694b2$export$8827362e5e938d26() {
|
|
|
2665
2665
|
const existing_consent = $28e42b0009d694b2$var$consent_from_cookie();
|
|
2666
2666
|
if (existing_consent) $28e42b0009d694b2$var$cookie_ipns(existing_consent);
|
|
2667
2667
|
const consent_maybe_changed = (0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)(()=>{
|
|
2668
|
-
const { consent: { marketing: marketing
|
|
2668
|
+
const { consent: { marketing: marketing, necessary: necessary, preferences: preferences, statistics: statistics } } = window.Cookiebot;
|
|
2669
2669
|
const new_consent_obj = {
|
|
2670
2670
|
marketing: marketing,
|
|
2671
2671
|
necessary: necessary,
|
|
@@ -2965,7 +2965,7 @@ const $e4bebbfa0f0b1454$export$59ba1eb2c083f0cd = /*@__PURE__*/ (0, /*@__PURE__*
|
|
|
2965
2965
|
style_tag.append(css);
|
|
2966
2966
|
});
|
|
2967
2967
|
const $e4bebbfa0f0b1454$export$a96c18473f2af463 = (tenant, selector, validator)=>{
|
|
2968
|
-
return (0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onexists(selector, ({ element: element
|
|
2968
|
+
return (0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onexists(selector, ({ element: element })=>(0, $c8263a2185830bf1$export$2c34560c3749dc63)(element, tenant.get_product_id, (p_id, r_id, was_unmatching, event)=>{
|
|
2969
2969
|
if (typeof validator === "function" && !validator(event)) return;
|
|
2970
2970
|
if (!was_unmatching) (0, $d3d8549954e0318e$export$bf205937e5e012cb)();
|
|
2971
2971
|
(0, $e0a87646d12cb987$export$9028351cb994757e)({
|
|
@@ -3088,7 +3088,7 @@ const $fbb09973782881cb$var$get_index_in_children_of_el = (el)=>[
|
|
|
3088
3088
|
...el?.parentElement?.children || []
|
|
3089
3089
|
].indexOf(el);
|
|
3090
3090
|
const $fbb09973782881cb$export$29a6094e0bd8bc5f = /*@__PURE__*/ (0, /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9)(async (options, gtag_options)=>{
|
|
3091
|
-
const { product_selector: product_selector
|
|
3091
|
+
const { product_selector: product_selector, a2c_selector: a2c_selector, rec_a2c_selector: rec_a2c_selector, rec_a2c_unbubbled: rec_a2c_unbubbled, get_product_id: get_product_id = options.t?.get_product_id, get_rec_id: get_rec_id = $fbb09973782881cb$var$default_get_rec_id, get_prod_id: get_prod_id = $fbb09973782881cb$var$default_get_prod_id, get_ga_prod_id: get_ga_prod_id = $fbb09973782881cb$var$default_get_ga_prod_id, get_display: get_display, impression_tracking: impression_tracking, a2c_elements: a2c_elements, product_elements: product_elements, t: t, click_location_prefix: click_location_prefix = (elem)=>elem?.parentElement?.dataset?.type + "_" } = options;
|
|
3092
3092
|
const get_display_data = async (elem)=>{
|
|
3093
3093
|
const data = {};
|
|
3094
3094
|
if (get_prod_id) data.product_id = await get_prod_id(elem) || (get_product_id ? await get_product_id(elem.querySelector("a")?.href || elem?.href) : undefined);
|
|
@@ -3111,7 +3111,7 @@ const $fbb09973782881cb$export$29a6094e0bd8bc5f = /*@__PURE__*/ (0, /*@__PURE__*
|
|
|
3111
3111
|
});
|
|
3112
3112
|
})();
|
|
3113
3113
|
// Product card
|
|
3114
|
-
const add_tracking_to_product_card = (0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)(async ({ element: elem
|
|
3114
|
+
const add_tracking_to_product_card = (0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)(async ({ element: elem })=>{
|
|
3115
3115
|
const index = $fbb09973782881cb$var$get_index_in_children_of_el(elem);
|
|
3116
3116
|
const data = await get_display_data(elem);
|
|
3117
3117
|
const prefix = typeof click_location_prefix === "function" && click_location_prefix(elem) || "depict_";
|
|
@@ -3254,7 +3254,7 @@ const $fbb09973782881cb$export$29a6094e0bd8bc5f = /*@__PURE__*/ (0, /*@__PURE__*
|
|
|
3254
3254
|
});
|
|
3255
3255
|
else (0, $e6c6e7929ea385ae$export$c2363754d4758444)(new Error("AIO can't find elements, try adding a selector or els")); // don't throw so that a2c tracking keeps working
|
|
3256
3256
|
// Page A2C button tracking
|
|
3257
|
-
const a2c_handler = ({ element: element
|
|
3257
|
+
const a2c_handler = ({ element: element })=>{
|
|
3258
3258
|
(0, $c8263a2185830bf1$export$2c34560c3749dc63)(element, get_product_id, (product_id, recommendation_id, was_unmatching)=>{
|
|
3259
3259
|
if (!was_unmatching) (0, $d3d8549954e0318e$export$bf205937e5e012cb)();
|
|
3260
3260
|
(0, $e0a87646d12cb987$export$9028351cb994757e)({
|
|
@@ -3297,8 +3297,6 @@ const $fbb09973782881cb$export$6ebd242c09192cec = /*@__PURE__*/ (0, /*@__PURE__*
|
|
|
3297
3297
|
|
|
3298
3298
|
|
|
3299
3299
|
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
3300
|
// not ideal but can help when debugging via sentry
|
|
3303
3301
|
/**
|
|
3304
3302
|
* A function that attempts to "serialize" an object to a text representation that helps with debugging when using sentry
|
|
@@ -3332,7 +3330,7 @@ const $55769f63ea4d8da4$export$5c069c93d2b7493f = (delay)=>new Promise((resolve)
|
|
|
3332
3330
|
async function $d2fc3fb450961938$export$bcd70d5ed1cf6313(url, options, max_retries = 10) {
|
|
3333
3331
|
const ONE_MINUTE = 60000;
|
|
3334
3332
|
const max_backoff_ms = ONE_MINUTE;
|
|
3335
|
-
const { stack: stack
|
|
3333
|
+
const { stack: stack } = new Error();
|
|
3336
3334
|
const calculate_retry = (delay)=>{
|
|
3337
3335
|
delay *= 2 + Math.random();
|
|
3338
3336
|
if (delay > max_backoff_ms) delay = max_backoff_ms * (1 + Math.random() / 10);
|
|
@@ -3424,14 +3422,14 @@ function $94edfb6d9c42a288$var$get_fetch_endpoint_from_options(options) {
|
|
|
3424
3422
|
async function $558ccd2de887e6d9$export$a9fc160c5ed83bd7(t, rendering_options) {
|
|
3425
3423
|
// clone options to prevent nasty bugs where changes of options change the options somewhere else too
|
|
3426
3424
|
rendering_options = $558ccd2de887e6d9$export$c42139a43c877ecd(rendering_options);
|
|
3427
|
-
const { type: type
|
|
3425
|
+
const { type: type } = rendering_options;
|
|
3428
3426
|
const displays = await $558ccd2de887e6d9$var$make_sure_we_have_displays(t, rendering_options);
|
|
3429
3427
|
if (!displays?.length) {
|
|
3430
3428
|
(0, $e6c6e7929ea385ae$export$de56f1198d121036)("RR: Got no displays for type " + type + ", can't recover.", t, rendering_options);
|
|
3431
3429
|
return {};
|
|
3432
3430
|
}
|
|
3433
3431
|
// return if too few displays
|
|
3434
|
-
const { min_items_to_run: min_items_to_run
|
|
3432
|
+
const { min_items_to_run: min_items_to_run } = rendering_options;
|
|
3435
3433
|
const good_displays = await $558ccd2de887e6d9$var$check_displays(displays, min_items_to_run).catch((0, $548fd58b14b25a52$export$8048b892d651b310));
|
|
3436
3434
|
if (!good_displays) return {};
|
|
3437
3435
|
const processed_displays = await $558ccd2de887e6d9$export$c22e610107c5a15a(t, rendering_options, displays);
|
|
@@ -3439,7 +3437,7 @@ async function $558ccd2de887e6d9$export$a9fc160c5ed83bd7(t, rendering_options) {
|
|
|
3439
3437
|
(0, $e6c6e7929ea385ae$export$de56f1198d121036)("RR: No displays left after preprocessing");
|
|
3440
3438
|
return {};
|
|
3441
3439
|
}
|
|
3442
|
-
const { template: template
|
|
3440
|
+
const { template: template, post_processors: post_processors = [] } = rendering_options;
|
|
3443
3441
|
const caught_post_processing_functions = post_processors.map((post_pro)=>(0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)(post_pro));
|
|
3444
3442
|
let a;
|
|
3445
3443
|
const caught_html2elems = (0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)((0, $bf7f12fe044e41b2$export$44951404cb8d0583));
|
|
@@ -3477,8 +3475,8 @@ async function $558ccd2de887e6d9$export$a9fc160c5ed83bd7(t, rendering_options) {
|
|
|
3477
3475
|
function $558ccd2de887e6d9$export$e0009e7da572f99b(template, display = {}) {
|
|
3478
3476
|
const discount_matcher = /{DISCOUNT{([\s\S]+?)}}/g;
|
|
3479
3477
|
const no_discount_matcher = /{NODISCOUNT{([\s\S]+?)}}/g;
|
|
3480
|
-
if ("variant_index" in display
|
|
3481
|
-
const { sale_price: sale_price
|
|
3478
|
+
if ("variant_index" in display) throw new Error("Modern display in ancient templating");
|
|
3479
|
+
const { sale_price: sale_price, original_price: original_price } = display;
|
|
3482
3480
|
if (sale_price !== original_price) template = template.replaceAll(discount_matcher, "$1").replaceAll(no_discount_matcher, "");
|
|
3483
3481
|
else template = template.replaceAll(discount_matcher, "").replaceAll(no_discount_matcher, "$1");
|
|
3484
3482
|
// Conditional statements
|
|
@@ -3520,7 +3518,7 @@ async function $558ccd2de887e6d9$export$cf7cbc6b76039101(t, rendering_options, d
|
|
|
3520
3518
|
return keep ? elements : [];
|
|
3521
3519
|
}
|
|
3522
3520
|
async function $558ccd2de887e6d9$export$c22e610107c5a15a(t, rendering_options, displays) {
|
|
3523
|
-
const { max_items: max_items
|
|
3521
|
+
const { max_items: max_items, pre_processors: pre_processors = [] } = rendering_options;
|
|
3524
3522
|
const caught_pre_processors = pre_processors.map((pre_pro)=>(0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)(pre_pro));
|
|
3525
3523
|
const processed_displays = [];
|
|
3526
3524
|
for(let i = 0; i < displays.length; i++){
|
|
@@ -3581,8 +3579,8 @@ async function $558ccd2de887e6d9$var$make_sure_we_have_displays(t, rendering_opt
|
|
|
3581
3579
|
|
|
3582
3580
|
|
|
3583
3581
|
async function $e5479d0db39d328b$export$c83d8da642b5104a(t, options, GWVM_opts) {
|
|
3584
|
-
const { catchify: catchify
|
|
3585
|
-
const { container_selector: container_selector = ".grid"
|
|
3582
|
+
const { catchify: catchify, dlog: dlog, is_debug: is_debug } = t;
|
|
3583
|
+
const { container_selector: container_selector = ".grid", container_template: container_template, start_rows: start_rows = 1, rows_per_click: rows_per_click = 1, override_rec_renderer: override_rec_renderer, button: button, title: title, title_selector: title_selector, only_full_rows: only_full_rows = false, should_preload: should_preload = true } = GWVM_opts;
|
|
3586
3584
|
const outer_els = typeof container_template === "string" ? [
|
|
3587
3585
|
...(0, $bf7f12fe044e41b2$export$44951404cb8d0583)(container_template)
|
|
3588
3586
|
] : container_template;
|
|
@@ -3620,7 +3618,7 @@ async function $e5479d0db39d328b$export$c83d8da642b5104a(t, options, GWVM_opts)
|
|
|
3620
3618
|
...options.post_processors || []
|
|
3621
3619
|
]
|
|
3622
3620
|
});
|
|
3623
|
-
const { elements: rendered_elements
|
|
3621
|
+
const { elements: rendered_elements, displays: displays } = rendering_results;
|
|
3624
3622
|
if (!rendered_elements) {
|
|
3625
3623
|
dlog("Grid with view more is stopping because it got no elements");
|
|
3626
3624
|
return rendering_results;
|
|
@@ -3673,8 +3671,8 @@ function $e5479d0db39d328b$var$observer_callback(entries) {
|
|
|
3673
3671
|
}
|
|
3674
3672
|
function $e5479d0db39d328b$var$post_processor(elements, _, //display: display,
|
|
3675
3673
|
info, cut_off_point, i_observer, cut_off_promise_obj, load_more) {
|
|
3676
|
-
const { catchify: catchify
|
|
3677
|
-
const { index: index
|
|
3674
|
+
const { catchify: catchify, err: err, dlog: dlog } = info.t;
|
|
3675
|
+
const { index: index } = info;
|
|
3678
3676
|
const elements_arr = [
|
|
3679
3677
|
...elements
|
|
3680
3678
|
];
|
|
@@ -3699,7 +3697,7 @@ info, cut_off_point, i_observer, cut_off_promise_obj, load_more) {
|
|
|
3699
3697
|
(async function() {
|
|
3700
3698
|
if (is_initially_hidden) for(let i = 0; i < elements_arr.length; i++){
|
|
3701
3699
|
// HTMLElement is a lie, but TS is too dumb to understand that we check for it being a Node the line below this
|
|
3702
|
-
const { style: style
|
|
3700
|
+
const { style: style } = elements_arr[i];
|
|
3703
3701
|
if (style) style.display = "none";
|
|
3704
3702
|
}
|
|
3705
3703
|
while(true){
|
|
@@ -3707,7 +3705,7 @@ info, cut_off_point, i_observer, cut_off_promise_obj, load_more) {
|
|
|
3707
3705
|
extras.load_more_currently_showing = cut_off_point;
|
|
3708
3706
|
if (index + 1 <= cut_off_point) {
|
|
3709
3707
|
for(let i = 0; i < elements_arr.length; i++){
|
|
3710
|
-
const { style: style
|
|
3708
|
+
const { style: style } = elements_arr[i];
|
|
3711
3709
|
if (style) style.display = "";
|
|
3712
3710
|
}
|
|
3713
3711
|
break;
|
|
@@ -3720,9 +3718,9 @@ info, cut_off_point, i_observer, cut_off_promise_obj, load_more) {
|
|
|
3720
3718
|
|
|
3721
3719
|
|
|
3722
3720
|
|
|
3723
|
-
async function $d1ef5fbddf08305d$export$41de2959a8dd405d(t, options, GWVM_opts, { rec_selector: rec_selector = ".rec_outer"
|
|
3724
|
-
const { start_rows: wished_start_rows = 1
|
|
3725
|
-
const { dlog: dlog
|
|
3721
|
+
async function $d1ef5fbddf08305d$export$41de2959a8dd405d(t, options, GWVM_opts, { rec_selector: rec_selector = ".rec_outer" } = {}) {
|
|
3722
|
+
const { start_rows: wished_start_rows = 1 } = GWVM_opts;
|
|
3723
|
+
const { dlog: dlog, err: err, catchify: catchify } = t;
|
|
3726
3724
|
let result;
|
|
3727
3725
|
let rec;
|
|
3728
3726
|
let first = true;
|
|
@@ -3732,7 +3730,7 @@ async function $d1ef5fbddf08305d$export$41de2959a8dd405d(t, options, GWVM_opts,
|
|
|
3732
3730
|
recs_per_row (num) {
|
|
3733
3731
|
try {
|
|
3734
3732
|
if (result?.elements && rec) {
|
|
3735
|
-
let { parentElement: parentElement
|
|
3733
|
+
let { parentElement: parentElement } = rec;
|
|
3736
3734
|
if (!parentElement) {
|
|
3737
3735
|
// first rec was removed
|
|
3738
3736
|
[rec] = (0, $bf7f12fe044e41b2$export$5e63aea0cac01fa0)(result?.elements || [], rec_selector);
|
|
@@ -3743,7 +3741,7 @@ async function $d1ef5fbddf08305d$export$41de2959a8dd405d(t, options, GWVM_opts,
|
|
|
3743
3741
|
// this is not entirely accurate because of margins but seems to work 100% of the time for our use case
|
|
3744
3742
|
if (recs_fitting_in_row != Infinity) {
|
|
3745
3743
|
dlog("We think there are currently", recs_fitting_in_row, "columns");
|
|
3746
|
-
const { children: children
|
|
3744
|
+
const { children: children } = parentElement;
|
|
3747
3745
|
const last_visible = $d1ef5fbddf08305d$var$find_last_visible(children);
|
|
3748
3746
|
if (!last_visible) {
|
|
3749
3747
|
dlog("It seems like no elements are visible, not loading any");
|
|
@@ -3818,7 +3816,7 @@ function $d1ef5fbddf08305d$var$find_last_visible(items) {
|
|
|
3818
3816
|
|
|
3819
3817
|
|
|
3820
3818
|
|
|
3821
|
-
async function $55dae85e9309db86$export$c0a4d29bc45a38c6(t, options, GWVM_opts, { rec_selector: rec_selector = ".rec_outer"
|
|
3819
|
+
async function $55dae85e9309db86$export$c0a4d29bc45a38c6(t, options, GWVM_opts, { rec_selector: rec_selector = ".rec_outer" } = {}) {
|
|
3822
3820
|
const options_for_auto_gwvm = {
|
|
3823
3821
|
...GWVM_opts,
|
|
3824
3822
|
start_rows: 1
|
|
@@ -3895,7 +3893,7 @@ function $55dae85e9309db86$var$find_last_visible(bunch_of_elements) {
|
|
|
3895
3893
|
|
|
3896
3894
|
|
|
3897
3895
|
async function $8686e45614d71607$export$9eae832ae57fbf(t, css, extra_html) {
|
|
3898
|
-
const head = await (0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).wait_for_element("head"), { dlog: dlog
|
|
3896
|
+
const head = await (0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).wait_for_element("head"), { dlog: dlog } = t, elems = (0, $bf7f12fe044e41b2$export$44951404cb8d0583)(`<style type="text/css">${css}</style>` + (extra_html ? extra_html : ""));
|
|
3899
3897
|
dlog("inserting", ...elems, "into", head);
|
|
3900
3898
|
head.append(...elems);
|
|
3901
3899
|
}
|
|
@@ -4129,7 +4127,7 @@ class $1da560af170fb839$export$3be7054c61590ee3 {
|
|
|
4129
4127
|
}
|
|
4130
4128
|
if (document?.body?.contains?.(image) === false) {
|
|
4131
4129
|
if (class_this.#verbose) (0, $e6c6e7929ea385ae$export$de56f1198d121036)(element, "has been removed from the DOM, can't load");
|
|
4132
|
-
const { elements: elements
|
|
4130
|
+
const { elements: elements } = class_this.lazyfinder;
|
|
4133
4131
|
const index = elements.indexOf(image);
|
|
4134
4132
|
if (index >= 0) elements.splice(index, 1);
|
|
4135
4133
|
continue;
|
|
@@ -4211,7 +4209,7 @@ class $1da560af170fb839$export$3be7054c61590ee3 {
|
|
|
4211
4209
|
}
|
|
4212
4210
|
}
|
|
4213
4211
|
}));
|
|
4214
|
-
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onexists(container, ({ element: element
|
|
4212
|
+
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onexists(container, ({ element: element })=>{
|
|
4215
4213
|
const new_els = element?.querySelectorAll?.(this.selector) || [];
|
|
4216
4214
|
this.lazyfinder.elements.push(...new_els);
|
|
4217
4215
|
new_els.forEach(this.#initiate_new_image.bind(this));
|
|
@@ -4220,7 +4218,7 @@ class $1da560af170fb839$export$3be7054c61590ee3 {
|
|
|
4220
4218
|
childList: true
|
|
4221
4219
|
});
|
|
4222
4220
|
});
|
|
4223
|
-
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onremoved(container, ({ element: element
|
|
4221
|
+
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onremoved(container, ({ element: element })=>{
|
|
4224
4222
|
if (!document.documentElement.contains(element)) mutation_observer.disconnect();
|
|
4225
4223
|
});
|
|
4226
4224
|
}
|
|
@@ -4242,7 +4240,7 @@ class $1da560af170fb839$export$3be7054c61590ee3 {
|
|
|
4242
4240
|
element.addEventListener("load", handler);
|
|
4243
4241
|
}
|
|
4244
4242
|
#unload_images_and_add_load_listeners() {
|
|
4245
|
-
const { elements: elements
|
|
4243
|
+
const { elements: elements, unload: unload } = this.lazyfinder;
|
|
4246
4244
|
const caught_unload = (0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)(unload);
|
|
4247
4245
|
for(let i = 0; i < elements.length; i++){
|
|
4248
4246
|
caught_unload(elements[i]);
|
|
@@ -4269,14 +4267,14 @@ class $1da560af170fb839$export$3be7054c61590ee3 {
|
|
|
4269
4267
|
root: this.container,
|
|
4270
4268
|
threshold: (0, $0da0cad4f39e8f32$export$f8ea2e7b15b5d129)(3)
|
|
4271
4269
|
});
|
|
4272
|
-
const { elements: elements
|
|
4270
|
+
const { elements: elements } = this.lazyfinder;
|
|
4273
4271
|
for(let i = 0; i < elements.length; i++)this.intersection_observer.observe(elements[i]);
|
|
4274
4272
|
}
|
|
4275
4273
|
}
|
|
4276
4274
|
#check_if_first_page_has_loaded() {
|
|
4277
4275
|
const loaded_images = [];
|
|
4278
4276
|
const not_loaded_or_loading = [];
|
|
4279
|
-
const { elements: elements
|
|
4277
|
+
const { elements: elements } = this.lazyfinder;
|
|
4280
4278
|
for(let i = 0; i < (elements?.length ?? 0); i++)if (elements[i].loaded === true) loaded_images.push(elements[i]);
|
|
4281
4279
|
else not_loaded_or_loading.push(elements[i]);
|
|
4282
4280
|
if (this.#images_on_first_page.length >= loaded_images.length) {
|
|
@@ -4284,10 +4282,10 @@ class $1da560af170fb839$export$3be7054c61590ee3 {
|
|
|
4284
4282
|
for(let i = 0; i < not_loaded_or_loading.length; i++)caught_loading_fin(not_loaded_or_loading[i]);
|
|
4285
4283
|
}
|
|
4286
4284
|
}
|
|
4287
|
-
constructor({ container: container
|
|
4285
|
+
constructor({ container: container, lazyfinder: lazyfinder, selector: selector = [
|
|
4288
4286
|
`img`,
|
|
4289
4287
|
`source`
|
|
4290
|
-
].map((t)=>`:not(.d-navbutton) > ${t}:not(.filler):not(.nolazy)`).join(", ")
|
|
4288
|
+
].map((t)=>`:not(.d-navbutton) > ${t}:not(.filler):not(.nolazy)`).join(", "), wait_for_dominsertion: wait_for_dominsertion = true, only_load_intersecting: only_load_intersecting = false, ignore_data_urls: ignore_data_urls = false, verbose: verbose }){
|
|
4291
4289
|
// store options in class so class instances can be looked at and their options are transparent
|
|
4292
4290
|
this.container = container;
|
|
4293
4291
|
this.selector = selector;
|
|
@@ -4360,7 +4358,7 @@ const $107a74aa4ea5902d$var$appendChild = (parent, child)=>{
|
|
|
4360
4358
|
}
|
|
4361
4359
|
parent.append(child);
|
|
4362
4360
|
};
|
|
4363
|
-
const $107a74aa4ea5902d$export$34b9dba7ce09269b = (tag, { children: children
|
|
4361
|
+
const $107a74aa4ea5902d$export$34b9dba7ce09269b = (tag, { children: children, ...props }, _unknown)=>{
|
|
4364
4362
|
if (typeof tag === "function") return tag({
|
|
4365
4363
|
children: children,
|
|
4366
4364
|
...props
|
|
@@ -4385,7 +4383,7 @@ const $107a74aa4ea5902d$export$34b9dba7ce09269b = (tag, { children: children , .
|
|
|
4385
4383
|
return element;
|
|
4386
4384
|
};
|
|
4387
4385
|
const $107a74aa4ea5902d$export$25062201e9e25d76 = $107a74aa4ea5902d$export$34b9dba7ce09269b;
|
|
4388
|
-
const $107a74aa4ea5902d$export$ffb0004e005737fa = ({ children: children
|
|
4386
|
+
const $107a74aa4ea5902d$export$ffb0004e005737fa = ({ children: children }, _unknown)=>{
|
|
4389
4387
|
if (typeof document === "undefined") return {};
|
|
4390
4388
|
const df = document.createDocumentFragment();
|
|
4391
4389
|
$107a74aa4ea5902d$var$appendChild(df, children);
|
|
@@ -4431,8 +4429,8 @@ class $1683d0164abd7c1d$export$692b27c28639e5b9 {
|
|
|
4431
4429
|
};
|
|
4432
4430
|
#cached_visible_sizes;
|
|
4433
4431
|
#observe_element(records) {
|
|
4434
|
-
const { observer: observer
|
|
4435
|
-
const { sliding_el_: sliding_el_
|
|
4432
|
+
const { observer: observer } = this;
|
|
4433
|
+
const { sliding_el_: sliding_el_ } = this.#elements;
|
|
4436
4434
|
for (const record of records){
|
|
4437
4435
|
for (const node of record.addedNodes)if (node instanceof Element && node.parentElement === sliding_el_) observer.observe(node);
|
|
4438
4436
|
for (const node of record.removedNodes)if (node instanceof Element && node.parentElement === sliding_el_) observer.unobserve(node);
|
|
@@ -4442,7 +4440,7 @@ class $1683d0164abd7c1d$export$692b27c28639e5b9 {
|
|
|
4442
4440
|
const intersecting_items = this.intersecting_items_object;
|
|
4443
4441
|
for(let i = 0; i < entries.length; i++){
|
|
4444
4442
|
const entry = entries[i];
|
|
4445
|
-
const { target: target
|
|
4443
|
+
const { target: target } = entry;
|
|
4446
4444
|
const rec_idx = this.get_index_of_element(target);
|
|
4447
4445
|
if (entry.intersectionRatio <= 0) {
|
|
4448
4446
|
for(const key in intersecting_items)if (intersecting_items[key].target === target) delete intersecting_items[key];
|
|
@@ -4459,7 +4457,7 @@ class $1683d0164abd7c1d$export$692b27c28639e5b9 {
|
|
|
4459
4457
|
});
|
|
4460
4458
|
observe = this.observer.observe.bind(this.observer);
|
|
4461
4459
|
get_index_of_element(target) {
|
|
4462
|
-
const { el_to_number_: el_to_number_
|
|
4460
|
+
const { el_to_number_: el_to_number_ } = this.#index_cache;
|
|
4463
4461
|
const value_from_cache = el_to_number_.get(target);
|
|
4464
4462
|
if (value_from_cache) return value_from_cache;
|
|
4465
4463
|
const children = target?.parentElement?.children;
|
|
@@ -4506,7 +4504,7 @@ class $1683d0164abd7c1d$export$692b27c28639e5b9 {
|
|
|
4506
4504
|
// this tries to be what distance_to assumes is the current card when converting a relative offset into an absolute one, available for plugins
|
|
4507
4505
|
if (this.center_target) {
|
|
4508
4506
|
// try to find index of card under container center
|
|
4509
|
-
const { visible_sizes: visible_sizes
|
|
4507
|
+
const { visible_sizes: visible_sizes } = this;
|
|
4510
4508
|
let left_offset = 0;
|
|
4511
4509
|
const rectangle_of_container = this.#elements.sliding_el_.getBoundingClientRect();
|
|
4512
4510
|
const middle_of_container = rectangle_of_container.width / 2;
|
|
@@ -4525,7 +4523,7 @@ class $1683d0164abd7c1d$export$692b27c28639e5b9 {
|
|
|
4525
4523
|
let target; // absolute index to focus on
|
|
4526
4524
|
if (is_absolute) target = offset;
|
|
4527
4525
|
else if (this.center_target) {
|
|
4528
|
-
const { currently_selected: currently_selected
|
|
4526
|
+
const { currently_selected: currently_selected } = this;
|
|
4529
4527
|
if (currently_selected == null) {
|
|
4530
4528
|
// if for whatever reason we don't find a card, don't do anything
|
|
4531
4529
|
(0, $268cbd9e4ade92db$export$f18d5b0af29128b7)(new Error("can't find card in center"), "error");
|
|
@@ -4578,7 +4576,7 @@ class $1683d0164abd7c1d$export$692b27c28639e5b9 {
|
|
|
4578
4576
|
const distance_of_container = rectangle_of_container.left;
|
|
4579
4577
|
dist = distance_of_li - distance_of_container;
|
|
4580
4578
|
if (this.center_target) try {
|
|
4581
|
-
const { visible_sizes: visible_sizes
|
|
4579
|
+
const { visible_sizes: visible_sizes } = this;
|
|
4582
4580
|
const keys = [
|
|
4583
4581
|
...visible_sizes.keys()
|
|
4584
4582
|
];
|
|
@@ -4678,7 +4676,7 @@ class $1683d0164abd7c1d$export$692b27c28639e5b9 {
|
|
|
4678
4676
|
element_by_index(index) {
|
|
4679
4677
|
const from_cache = this.#index_cache.number_to_el_.get(index);
|
|
4680
4678
|
if (from_cache) return from_cache;
|
|
4681
|
-
const { sliding_el_: sliding_el_
|
|
4679
|
+
const { sliding_el_: sliding_el_ } = this.#elements;
|
|
4682
4680
|
let maybe_el = [
|
|
4683
4681
|
...sliding_el_?.children || []
|
|
4684
4682
|
]?.[index];
|
|
@@ -4697,7 +4695,7 @@ class $1683d0164abd7c1d$export$692b27c28639e5b9 {
|
|
|
4697
4695
|
#setup_buttons() {
|
|
4698
4696
|
const goleft = (0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)(()=>this.#scroll_to(-this.stepstoslide, false, -510));
|
|
4699
4697
|
const goright = (0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)(()=>this.#scroll_to(this.stepstoslide, false, 510));
|
|
4700
|
-
const { right_: right_
|
|
4698
|
+
const { right_: right_, left_: left_ } = this.#elements;
|
|
4701
4699
|
left_.addEventListener("click", goleft);
|
|
4702
4700
|
right_.addEventListener("click", goright);
|
|
4703
4701
|
[
|
|
@@ -4717,7 +4715,7 @@ class $1683d0164abd7c1d$export$692b27c28639e5b9 {
|
|
|
4717
4715
|
this.invalidate_cache();
|
|
4718
4716
|
for (const extra_fn of this.on_elements_changed)extra_fn.call(this, records);
|
|
4719
4717
|
}));
|
|
4720
|
-
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onexists(es.sliding_el_, ({ element: element
|
|
4718
|
+
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onexists(es.sliding_el_, ({ element: element })=>{
|
|
4721
4719
|
this.invalidate_cache();
|
|
4722
4720
|
cache_mo.observe(element, {
|
|
4723
4721
|
childList: true,
|
|
@@ -4734,8 +4732,8 @@ class $1683d0164abd7c1d$export$692b27c28639e5b9 {
|
|
|
4734
4732
|
this.#index_cache.el_to_number_.clear();
|
|
4735
4733
|
this.#index_cache.last_el_ = undefined;
|
|
4736
4734
|
}
|
|
4737
|
-
#scroll_to(
|
|
4738
|
-
const left = (0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)(this.#distance_to).call(this,
|
|
4735
|
+
#scroll_to(offset, is_absolute = false, fallback_scroll_distance = 500, harsh = false) {
|
|
4736
|
+
const left = (0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)(this.#distance_to).call(this, offset, is_absolute);
|
|
4739
4737
|
const distance_after_fallback_applied = Math.round(left ?? fallback_scroll_distance);
|
|
4740
4738
|
if (getComputedStyle(this.#elements.sliding_el_).scrollSnapType !== "none" && Math.abs(distance_after_fallback_applied) < 10) {
|
|
4741
4739
|
(0, $e6c6e7929ea385ae$export$de56f1198d121036)("Not scrolling because snapping is enabled and distance not over threshold", distance_after_fallback_applied);
|
|
@@ -4754,7 +4752,7 @@ class $1683d0164abd7c1d$export$692b27c28639e5b9 {
|
|
|
4754
4752
|
scroll_to_abs(offset, harsh = false) {
|
|
4755
4753
|
this.#scroll_to(offset, true, undefined, harsh);
|
|
4756
4754
|
}
|
|
4757
|
-
constructor({ dist_to_hide_left: dist_to_hide_left
|
|
4755
|
+
constructor({ dist_to_hide_left: dist_to_hide_left, dist_to_hide_right: dist_to_hide_right, stepstoslide: stepstoslide, center_target: center_target, mutation_plugins: mutation_plugins, constructor_plugins: constructor_plugins, correct_bs_targets: correct_bs_targets, button_contents: button_contents, button_elems: button_elems, autoinvalidate_cache: autoinvalidate_cache }){
|
|
4758
4756
|
dist_to_hide_left && (this.dist_to_hide_left = dist_to_hide_left);
|
|
4759
4757
|
dist_to_hide_right && (this.dist_to_hide_right = dist_to_hide_right);
|
|
4760
4758
|
stepstoslide && (this.stepstoslide = stepstoslide);
|
|
@@ -4786,7 +4784,7 @@ class $a69a5236b5814082$export$68babfc5be0de5da extends (0, $1683d0164abd7c1d$ex
|
|
|
4786
4784
|
constructor(options, lazyfier_options){
|
|
4787
4785
|
super(options);
|
|
4788
4786
|
const lazy_promise = new Promise((r)=>{
|
|
4789
|
-
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onexists(this.insert_here, ({ element: element
|
|
4787
|
+
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onexists(this.insert_here, ({ element: element, disconnector: disconnector })=>{
|
|
4790
4788
|
const i_o = new IntersectionObserver((0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)((records)=>{
|
|
4791
4789
|
for (const record of records)if (record.intersectionRatio > 0) {
|
|
4792
4790
|
r(true);
|
|
@@ -4840,7 +4838,7 @@ function $04d2f7d9126af667$export$fb9afe9f540ae069(elements, _display, info) {
|
|
|
4840
4838
|
...elements
|
|
4841
4839
|
];
|
|
4842
4840
|
const handler = (0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)(async ()=>{
|
|
4843
|
-
const { rendering_options: rendering_options
|
|
4841
|
+
const { rendering_options: rendering_options, t: t } = info;
|
|
4844
4842
|
if (!$04d2f7d9126af667$export$4b50a4de9c6bbe09.has(rendering_options) && elements_as_array.some((e)=>document.documentElement.contains(e)) // check, just in case
|
|
4845
4843
|
) {
|
|
4846
4844
|
$04d2f7d9126af667$export$4b50a4de9c6bbe09.add(rendering_options);
|
|
@@ -4865,11 +4863,11 @@ function $04d2f7d9126af667$export$1bffac19f9f0d6fc(elements, _display, info) {
|
|
|
4865
4863
|
return elements;
|
|
4866
4864
|
const [first_element] = elements;
|
|
4867
4865
|
const handler = (0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)(()=>{
|
|
4868
|
-
const { rendering_options: rendering_options
|
|
4866
|
+
const { rendering_options: rendering_options, displays: displays } = info;
|
|
4869
4867
|
if (!$04d2f7d9126af667$export$3777a14dd8c2363d.has(displays)) {
|
|
4870
4868
|
$04d2f7d9126af667$export$3777a14dd8c2363d.add(displays);
|
|
4871
|
-
const { get_product_id: get_product_id
|
|
4872
|
-
const { type: type
|
|
4869
|
+
const { get_product_id: get_product_id } = info.t;
|
|
4870
|
+
const { type: type } = rendering_options;
|
|
4873
4871
|
(0, $d3d8549954e0318e$export$7babcd5d4056b2ca)(displays, get_product_id /* yes this might create errors if there's no page_url in the display but don't have time to fix, sorry */ , {
|
|
4874
4872
|
list_name: "depict_" + type
|
|
4875
4873
|
});
|
|
@@ -4880,7 +4878,7 @@ function $04d2f7d9126af667$export$1bffac19f9f0d6fc(elements, _display, info) {
|
|
|
4880
4878
|
return elements;
|
|
4881
4879
|
}
|
|
4882
4880
|
function $04d2f7d9126af667$export$9e1caada6901f552(elements, _display, info) {
|
|
4883
|
-
const { t: t
|
|
4881
|
+
const { t: t } = info;
|
|
4884
4882
|
if (!t) return elements;
|
|
4885
4883
|
(async ()=>{
|
|
4886
4884
|
(0, $72ee205b59322497$export$eee4c4d924348b05)({
|
|
@@ -4893,7 +4891,7 @@ function $04d2f7d9126af667$export$9e1caada6901f552(elements, _display, info) {
|
|
|
4893
4891
|
}
|
|
4894
4892
|
function $04d2f7d9126af667$export$8d72437623fef90c(elements, display, info) {
|
|
4895
4893
|
const handler = ()=>{
|
|
4896
|
-
const { ga_product_ids: ga_product_ids
|
|
4894
|
+
const { ga_product_ids: ga_product_ids, ga_product_id: ga_product_id, product_id: product_id } = display;
|
|
4897
4895
|
if (Array.isArray(ga_product_ids)) for(let i = 0; i < ga_product_ids.length; i++)(0, $d3d8549954e0318e$export$f522672c9379e339)(ga_product_ids[i], info.index, {
|
|
4898
4896
|
list_name: "depict_" + info.rendering_options.type
|
|
4899
4897
|
});
|
|
@@ -4909,7 +4907,7 @@ function $04d2f7d9126af667$export$8d72437623fef90c(elements, display, info) {
|
|
|
4909
4907
|
}
|
|
4910
4908
|
function $04d2f7d9126af667$export$e9106d6e723510d2(elements, display, info) {
|
|
4911
4909
|
const handler = ()=>{
|
|
4912
|
-
const { t: t
|
|
4910
|
+
const { t: t, index: index, rendering_options: rendering_options } = info;
|
|
4913
4911
|
return (0, $e0a87646d12cb987$export$15f8a0cd5a8c0ebb)({
|
|
4914
4912
|
...t,
|
|
4915
4913
|
...rendering_options,
|
|
@@ -4926,8 +4924,8 @@ function $04d2f7d9126af667$export$e9106d6e723510d2(elements, display, info) {
|
|
|
4926
4924
|
return elements;
|
|
4927
4925
|
}
|
|
4928
4926
|
function $04d2f7d9126af667$export$32eb5dd18e963410(elements, display, info) {
|
|
4929
|
-
const { search_result_id: search_result_id
|
|
4930
|
-
const { product_id: product_id
|
|
4927
|
+
const { search_result_id: search_result_id } = display;
|
|
4928
|
+
const { product_id: product_id, recommendation_id: recommendation_id } = "variant_index" in display ? display.variant_displays[display.variant_index] : display;
|
|
4931
4929
|
if (!elements?.length) return elements;
|
|
4932
4930
|
for (const element of elements){
|
|
4933
4931
|
const handler = (0, $c8263a2185830bf1$export$82a685f2da2fb027)(element, product_id, recommendation_id || search_result_id);
|
|
@@ -4984,7 +4982,7 @@ function $f3f05d97149aec76$export$16501883f477737a(elements, display) {
|
|
|
4984
4982
|
|
|
4985
4983
|
var $92bde32714bb1e07$export$2e2bcd8739ae039 = $92bde32714bb1e07$export$50ce83ace0cdd87e;
|
|
4986
4984
|
async function $92bde32714bb1e07$export$50ce83ace0cdd87e(t, rendering_options) {
|
|
4987
|
-
const { view_tracking: view_tracking
|
|
4985
|
+
const { view_tracking: view_tracking, click_tracking: click_tracking } = rendering_options;
|
|
4988
4986
|
return await (0, $558ccd2de887e6d9$export$a9fc160c5ed83bd7)(t, {
|
|
4989
4987
|
...rendering_options,
|
|
4990
4988
|
headers: {
|
|
@@ -5011,8 +5009,8 @@ async function $92bde32714bb1e07$export$50ce83ace0cdd87e(t, rendering_options) {
|
|
|
5011
5009
|
|
|
5012
5010
|
async function $3cb558cec98ba1a7$export$cab8bc58c64c2013(t, rendering_options, options_for_us, slider_options) {
|
|
5013
5011
|
options_for_us ||= {};
|
|
5014
|
-
const { root_selector: root_selector
|
|
5015
|
-
let { container: container
|
|
5012
|
+
const { root_selector: root_selector, override_rec_renderer: local_rr = (0, $92bde32714bb1e07$export$2e2bcd8739ae039), insertion_verb: insertion_verb = "replaceWith", lazyfier_options: lazyfier_options } = options_for_us;
|
|
5013
|
+
let { container: container } = options_for_us;
|
|
5016
5014
|
if (typeof container == "string") container = [
|
|
5017
5015
|
...(0, $bf7f12fe044e41b2$export$44951404cb8d0583)(container)
|
|
5018
5016
|
];
|
|
@@ -5074,7 +5072,7 @@ class $0b6a8303b64cced1$export$1a8782481a9af507 {
|
|
|
5074
5072
|
}
|
|
5075
5073
|
}
|
|
5076
5074
|
loadRecommendations(callback) {
|
|
5077
|
-
const { tenant: tenant
|
|
5075
|
+
const { tenant: tenant, product_id: product_id, type: type, market: market } = this.settings;
|
|
5078
5076
|
(0, $94edfb6d9c42a288$export$1bc0df10745d5412)(// @ts-ignore - Quick workaround, as we don't have a tenant object here
|
|
5079
5077
|
{
|
|
5080
5078
|
tenant: tenant,
|
|
@@ -5117,7 +5115,7 @@ class $0b6a8303b64cced1$export$1a8782481a9af507 {
|
|
|
5117
5115
|
return;
|
|
5118
5116
|
}
|
|
5119
5117
|
$0b6a8303b64cced1$var$pageview_sent = true;
|
|
5120
|
-
const { product_id: product_id
|
|
5118
|
+
const { product_id: product_id } = this.settings;
|
|
5121
5119
|
(0, $72ee205b59322497$export$eee4c4d924348b05)(typeof product_id === "function" ? product_id() : product_id);
|
|
5122
5120
|
}
|
|
5123
5121
|
trackClick(index) {
|
|
@@ -5148,7 +5146,7 @@ class $0b6a8303b64cced1$export$1a8782481a9af507 {
|
|
|
5148
5146
|
for (const el of elements)root.prepend(el);
|
|
5149
5147
|
} else for (const el of elements)root.appendChild(el);
|
|
5150
5148
|
}
|
|
5151
|
-
renderTemplate({ prep: prep
|
|
5149
|
+
renderTemplate({ prep: prep, root: root, template: template, itemPreprocessor: itemPreprocessor, itemPostprocessor: itemPostprocessor } = this.settings) {
|
|
5152
5150
|
if (document._depict_modify !== true) {
|
|
5153
5151
|
if (this.settings.debug) console.warn("Template-tool: not running because document._depict_modify is false!", this);
|
|
5154
5152
|
return;
|
|
@@ -5286,8 +5284,8 @@ var /**
|
|
|
5286
5284
|
|
|
5287
5285
|
|
|
5288
5286
|
// @ts-ignore
|
|
5289
|
-
var $
|
|
5290
|
-
$
|
|
5287
|
+
var $1259ff510e3d4a71$exports = {};
|
|
5288
|
+
$1259ff510e3d4a71$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";
|
|
5291
5289
|
|
|
5292
5290
|
|
|
5293
5291
|
|
|
@@ -5330,7 +5328,7 @@ class $e090b20cef3f0516$export$4d41c6499d53639c extends (0, $a69a5236b5814082$ex
|
|
|
5330
5328
|
function $e090b20cef3f0516$export$f1b8b9fd75ddcab1(slider) {
|
|
5331
5329
|
const style_elem = document.createElement("style");
|
|
5332
5330
|
style_elem.type = "text/css";
|
|
5333
|
-
style_elem.append((0, (/*@__PURE__*/$parcel$interopDefault($
|
|
5331
|
+
style_elem.append((0, (/*@__PURE__*/$parcel$interopDefault($1259ff510e3d4a71$exports))));
|
|
5334
5332
|
slider.container.appendChild(style_elem);
|
|
5335
5333
|
}
|
|
5336
5334
|
|
|
@@ -5340,9 +5338,9 @@ function $e090b20cef3f0516$export$f1b8b9fd75ddcab1(slider) {
|
|
|
5340
5338
|
|
|
5341
5339
|
async function $7af744346f17bf99$export$cd12721587f4f16d(t, rendering_options, options_for_us, slider_options, override_lazyfier_options) {
|
|
5342
5340
|
options_for_us ||= {};
|
|
5343
|
-
const { dlog: dlog
|
|
5344
|
-
const { root_selector: root_selector
|
|
5345
|
-
let { container: container
|
|
5341
|
+
const { dlog: dlog, catchify: catchify } = t;
|
|
5342
|
+
const { root_selector: root_selector, Rec_Renderer: local_rr = (0, $92bde32714bb1e07$export$2e2bcd8739ae039), insertion_verb: insertion_verb = "replaceWith" } = options_for_us;
|
|
5343
|
+
let { container: container } = options_for_us;
|
|
5346
5344
|
if (typeof container == "string") container = [
|
|
5347
5345
|
...(0, $bf7f12fe044e41b2$export$44951404cb8d0583)(container)
|
|
5348
5346
|
];
|
|
@@ -5390,10 +5388,10 @@ async function $7af744346f17bf99$export$cd12721587f4f16d(t, rendering_options, o
|
|
|
5390
5388
|
|
|
5391
5389
|
|
|
5392
5390
|
|
|
5393
|
-
async function $765ddca135d7ab33$export$30933c637c977eef({ t: t
|
|
5394
|
-
template
|
|
5395
|
-
chunk_size_for_load_more = 4
|
|
5396
|
-
const { catchify: catchify
|
|
5391
|
+
async function $765ddca135d7ab33$export$30933c637c977eef({ t: t, recs: recs, title: title, infinite_scroll: infinite_scroll = false, with_slider: with_slider = false, with_loadmore: with_loadmore = false, template_tool_options: template_tool_options, slider_options: slider_options = {}, pre_processors: pre_processors = [], post_processors: post_processors = [], container_template: container_template, template: // container template
|
|
5392
|
+
template, chunk_size_for_load_more: // recommendation template
|
|
5393
|
+
chunk_size_for_load_more = 4, insertion_promise: insertion_promise }) {
|
|
5394
|
+
const { catchify: catchify, dlog: dlog } = t, container = [
|
|
5397
5395
|
...(0, $bf7f12fe044e41b2$export$44951404cb8d0583)(container_template)
|
|
5398
5396
|
], root = (0, $bf7f12fe044e41b2$export$5e63aea0cac01fa0)(container, ".grid")[0], internal_pre_processors = [
|
|
5399
5397
|
...pre_processors
|
|
@@ -5475,7 +5473,7 @@ chunk_size_for_load_more = 4 , insertion_promise: insertion_promise }) {
|
|
|
5475
5473
|
else dlog("Didn't get recs from API", template_tool);
|
|
5476
5474
|
}
|
|
5477
5475
|
function $765ddca135d7ab33$var$setup_infinite_scroll(t, root) {
|
|
5478
|
-
const { dlog: dlog
|
|
5476
|
+
const { dlog: dlog, catchify: catchify } = t, get_last_visible_el = ()=>[
|
|
5479
5477
|
...root.querySelectorAll("a.rec_outer:not(.not_visible)")
|
|
5480
5478
|
].slice(-1)[0], last_visible_el = get_last_visible_el();
|
|
5481
5479
|
if (!last_visible_el) {
|
|
@@ -5506,7 +5504,7 @@ function $765ddca135d7ab33$var$load_more_elements(root, chunk_size = 4) {
|
|
|
5506
5504
|
return has_more;
|
|
5507
5505
|
}
|
|
5508
5506
|
function $765ddca135d7ab33$var$setup_load_more(t, root, chunk_size) {
|
|
5509
|
-
const { catchify: catchify
|
|
5507
|
+
const { catchify: catchify } = t, load_more_cont = (0, $bf7f12fe044e41b2$export$d3e2a0560cbf4787)(`<div class="load-more-container"></div>`), load_button = load_more_cont.appendChild((0, $bf7f12fe044e41b2$export$d3e2a0560cbf4787)(`<button class="load_more">Visa mer</button>`));
|
|
5510
5508
|
load_button.addEventListener("click", catchify(load_more_recs_and_hide_button_if_needed));
|
|
5511
5509
|
root.after(load_more_cont);
|
|
5512
5510
|
load_more_recs_and_hide_button_if_needed();
|
|
@@ -5525,7 +5523,7 @@ function $765ddca135d7ab33$export$4f39078bdc72ecd0(_t, d, i, with_loadmore, with
|
|
|
5525
5523
|
}
|
|
5526
5524
|
function $765ddca135d7ab33$export$c410ce1205e5118a(_t, itms, d, slider) {
|
|
5527
5525
|
for (const item of itms){
|
|
5528
|
-
const { image_url: image_url
|
|
5526
|
+
const { image_url: image_url } = d, img = item.querySelector("img.image"), load_image = ()=>{
|
|
5529
5527
|
img.src = image_url;
|
|
5530
5528
|
slider?.observe?.(img);
|
|
5531
5529
|
};
|
|
@@ -5556,7 +5554,7 @@ var /**
|
|
|
5556
5554
|
const windows_proof_fetch = async function(url, body, headers, decode_json, fetch_options, attempt) {
|
|
5557
5555
|
attempt ||= 1;
|
|
5558
5556
|
decode_json ??= true;
|
|
5559
|
-
const { stack: stack
|
|
5557
|
+
const { stack: stack } = new Error();
|
|
5560
5558
|
const elog = (...args)=>{
|
|
5561
5559
|
if (Array.isArray(error_log)) error_log.push(args);
|
|
5562
5560
|
return dlog(...args);
|
|
@@ -5606,7 +5604,6 @@ async function $c413c7798924612a$var$send_sentry_422(response, body, stack) {
|
|
|
5606
5604
|
|
|
5607
5605
|
|
|
5608
5606
|
|
|
5609
|
-
|
|
5610
5607
|
const $c3af1bfb402a8820$export$dc84183312f0c201 = /*@__PURE__*/ (()=>(0, $107a74aa4ea5902d$export$25062201e9e25d76)("svg", {
|
|
5611
5608
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5612
5609
|
viewBox: "0 0 320 512",
|
|
@@ -5634,7 +5631,7 @@ const $c3af1bfb402a8820$export$6038895ac52bd044 = /*@__PURE__*/ (()=>(0, $107a74
|
|
|
5634
5631
|
|
|
5635
5632
|
|
|
5636
5633
|
|
|
5637
|
-
const $febdc40c8da5c25e$export$68c017fd93791405 = ({ duration: duration = 500
|
|
5634
|
+
const $febdc40c8da5c25e$export$68c017fd93791405 = ({ duration: duration = 500 } = {
|
|
5638
5635
|
duration: 500
|
|
5639
5636
|
})=>{
|
|
5640
5637
|
const container = document.createElement("div");
|
|
@@ -5688,10 +5685,10 @@ function $ef237c2bba47492f$export$f8913c8a18f7ca21(iterables) {
|
|
|
5688
5685
|
|
|
5689
5686
|
|
|
5690
5687
|
const $1cc2444a0f1b992e$export$717f13d9ba00ca19 = (min, max)=>`@media ${min ? `(min-width:${min})` : ``}${min && max ? ` and ` : ``}${max ? `(max-width:${max})` : ``}`;
|
|
5691
|
-
async function $1cc2444a0f1b992e$export$c84671f46d6a1ca({ rows: rows
|
|
5688
|
+
async function $1cc2444a0f1b992e$export$c84671f46d6a1ca({ rows: rows, container_element: container_element, cols_at_size: cols_at_size, grid_spacing: grid_spacing, layout: layout, disable_partial_rows: disable_partial_rows, override_vertical_spacing: override_vertical_spacing }) {
|
|
5692
5689
|
const rows_or_empty_object = typeof rows == "object" ? rows : {}; // this is to satisfy typescript
|
|
5693
|
-
const { start_rows: start_rows = 1
|
|
5694
|
-
let { ipns: ipns
|
|
5690
|
+
const { start_rows: start_rows = 1, button: button, max_rows: max_rows = -1 } = rows_or_empty_object;
|
|
5691
|
+
let { ipns: ipns } = rows_or_empty_object;
|
|
5695
5692
|
const is_static = !ipns && !button;
|
|
5696
5693
|
const our_style_el = (0, $107a74aa4ea5902d$export$34b9dba7ce09269b)("style", {
|
|
5697
5694
|
type: "text/css"
|
|
@@ -5713,13 +5710,13 @@ async function $1cc2444a0f1b992e$export$c84671f46d6a1ca({ rows: rows , container
|
|
|
5713
5710
|
ipns(start_rows);
|
|
5714
5711
|
set_length();
|
|
5715
5712
|
const mutation_observer = new MutationObserver((0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)(set_length));
|
|
5716
|
-
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).oncreation(container_element, ({ element: element
|
|
5713
|
+
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).oncreation(container_element, ({ element: element })=>{
|
|
5717
5714
|
mutation_observer.observe(element, {
|
|
5718
5715
|
childList: true
|
|
5719
5716
|
});
|
|
5720
5717
|
set_length(); // might have changed while we weren't in the DOM but no need to observe and update when we aren't
|
|
5721
5718
|
});
|
|
5722
|
-
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onremoved(container_element, ({ element: element
|
|
5719
|
+
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onremoved(container_element, ({ element: element })=>{
|
|
5723
5720
|
if (document.documentElement.contains(element)) return;
|
|
5724
5721
|
mutation_observer.disconnect();
|
|
5725
5722
|
el_count_ipns.exit();
|
|
@@ -5906,10 +5903,10 @@ class $1cc2444a0f1b992e$var$CSSMeasurement {
|
|
|
5906
5903
|
|
|
5907
5904
|
|
|
5908
5905
|
|
|
5909
|
-
async function $a7315720bf2a1638$export$b0a773486c1c2312(t, recommendation_renderer_options, { container_elements: container_elements
|
|
5906
|
+
async function $a7315720bf2a1638$export$b0a773486c1c2312(t, recommendation_renderer_options, { container_elements: container_elements, container_selector: container_selector, override_rec_renderer: override_rec_renderer, lazyfier_options: lazyfier_options = {}, eager_images: eager_images, ...options_for_grid }) {
|
|
5910
5907
|
const [insertion_point] = (0, $bf7f12fe044e41b2$export$5e63aea0cac01fa0)(container_elements, container_selector || ".grid");
|
|
5911
5908
|
const rendering_result = await (override_rec_renderer || (0, $92bde32714bb1e07$export$2e2bcd8739ae039))(t, recommendation_renderer_options);
|
|
5912
|
-
const { elements: elements
|
|
5909
|
+
const { elements: elements } = rendering_result;
|
|
5913
5910
|
if (!elements) return rendering_result;
|
|
5914
5911
|
if (!eager_images) // convoluted lazy loading that
|
|
5915
5912
|
// when the elements are in the DOM starts IntersectionObserver on whole grid
|
|
@@ -5947,8 +5944,8 @@ async function $a7315720bf2a1638$export$b0a773486c1c2312(t, recommendation_rende
|
|
|
5947
5944
|
|
|
5948
5945
|
|
|
5949
5946
|
// @ts-ignore
|
|
5950
|
-
var $
|
|
5951
|
-
$
|
|
5947
|
+
var $7b8e569839dd1ea3$exports = {};
|
|
5948
|
+
$7b8e569839dd1ea3$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";
|
|
5952
5949
|
|
|
5953
5950
|
|
|
5954
5951
|
|
|
@@ -5959,15 +5956,15 @@ $77397c24d914a374$exports = ".depict-slider {\n width: 100%;\n position: relat
|
|
|
5959
5956
|
|
|
5960
5957
|
|
|
5961
5958
|
let $79804e8d76404ae4$var$slider_styling_was_inserted = false;
|
|
5962
|
-
async function $79804e8d76404ae4$export$82cfdc85a4d15688(t, recommendation_renderer_options, { container_elements: container_elements
|
|
5959
|
+
async function $79804e8d76404ae4$export$82cfdc85a4d15688(t, recommendation_renderer_options, { container_elements: container_elements, container_selector: container_selector, override_rec_renderer: override_rec_renderer, lazyfier_options: lazyfier_options = {}, eager_images: eager_images, grid_spacing: grid_spacing, cols_at_size: cols_at_size, override_vertical_spacing: override_vertical_spacing, rows: rows = "all", ...slider_options }) {
|
|
5963
5960
|
const [insertion_point] = (0, $bf7f12fe044e41b2$export$5e63aea0cac01fa0)(container_elements, container_selector || ".grid");
|
|
5964
5961
|
const slider = eager_images ? new (0, $1683d0164abd7c1d$export$692b27c28639e5b9)(slider_options) : new (0, $a69a5236b5814082$export$68babfc5be0de5da)(slider_options, lazyfier_options);
|
|
5965
5962
|
const rendering_result = await (override_rec_renderer || (0, $92bde32714bb1e07$export$2e2bcd8739ae039))(t, recommendation_renderer_options);
|
|
5966
|
-
const { elements: elements
|
|
5963
|
+
const { elements: elements } = rendering_result;
|
|
5967
5964
|
if (!elements) return rendering_result;
|
|
5968
5965
|
if (!$79804e8d76404ae4$var$slider_styling_was_inserted) {
|
|
5969
5966
|
$79804e8d76404ae4$var$slider_styling_was_inserted = true;
|
|
5970
|
-
(0, $e4bebbfa0f0b1454$export$59ba1eb2c083f0cd)((0, (/*@__PURE__*/$parcel$interopDefault($
|
|
5967
|
+
(0, $e4bebbfa0f0b1454$export$59ba1eb2c083f0cd)((0, (/*@__PURE__*/$parcel$interopDefault($7b8e569839dd1ea3$exports))));
|
|
5971
5968
|
}
|
|
5972
5969
|
insertion_point.replaceWith(slider.container);
|
|
5973
5970
|
slider.insert_here.append(...elements);
|
|
@@ -6059,9 +6056,8 @@ function $edc9fe0b09e00df6$export$af88b4929c2dc86() {
|
|
|
6059
6056
|
|
|
6060
6057
|
|
|
6061
6058
|
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
const { dlog: dlog , catchify: catchify } = t;
|
|
6059
|
+
function $158313c0231e6555$export$1d17a045bcc711b1({ t: t, navcont_insertion_fn: navcont_insertion_fn, navdot: navdot, dontshowonedot: dontshowonedot = false, bitesize: bitesize }) {
|
|
6060
|
+
const { dlog: dlog, catchify: catchify } = t;
|
|
6065
6061
|
const button_states = [];
|
|
6066
6062
|
const unique_name = Math.round(Math.random() * 1000000);
|
|
6067
6063
|
function constructor_plugin() {
|
|
@@ -6071,7 +6067,7 @@ function $158313c0231e6555$export$1d17a045bcc711b1({ t: t , navcont_insertion_fn
|
|
|
6071
6067
|
this.navcont = navcont;
|
|
6072
6068
|
if (navcont_insertion_fn) navcont_insertion_fn(this, navcont);
|
|
6073
6069
|
else {
|
|
6074
|
-
const { container: container
|
|
6070
|
+
const { container: container } = this;
|
|
6075
6071
|
container.append(navcont);
|
|
6076
6072
|
}
|
|
6077
6073
|
}
|
|
@@ -6080,8 +6076,8 @@ function $158313c0231e6555$export$1d17a045bcc711b1({ t: t , navcont_insertion_fn
|
|
|
6080
6076
|
const only_visible_children = (children)=>[
|
|
6081
6077
|
...children
|
|
6082
6078
|
].filter((el)=>el.offsetParent !== null);
|
|
6083
|
-
const { insert_here: sliding
|
|
6084
|
-
const { children: children
|
|
6079
|
+
const { insert_here: sliding, navcont: navcont } = this;
|
|
6080
|
+
const { children: children, offsetWidth: width_of_container } = sliding;
|
|
6085
6081
|
const [first_child] = children;
|
|
6086
6082
|
const amount_of_elements = only_visible_children(children).length;
|
|
6087
6083
|
const width_of_one_element = first_child.getBoundingClientRect().width;
|
|
@@ -6159,15 +6155,15 @@ function $158313c0231e6555$export$a09282b33e69b43f(unique_name) {
|
|
|
6159
6155
|
// });
|
|
6160
6156
|
|
|
6161
6157
|
function $98ef92db220106f3$export$411b0f20794697ce(t) {
|
|
6162
|
-
const { dlog: dlog
|
|
6158
|
+
const { dlog: dlog, catchify: catchify, err: err } = t;
|
|
6163
6159
|
function constructor_plugin(slider_options) {
|
|
6164
|
-
const { insert_here: sliding
|
|
6160
|
+
const { insert_here: sliding } = this;
|
|
6165
6161
|
let last_mouse_position = 0;
|
|
6166
6162
|
let starting_position = 0;
|
|
6167
6163
|
let block_anchor_clicks = false;
|
|
6168
6164
|
sliding.addEventListener("mousedown", catchify((e)=>{
|
|
6169
6165
|
sliding.classList.remove("slider_snap");
|
|
6170
|
-
const { snap_style: snap_style
|
|
6166
|
+
const { snap_style: snap_style } = this;
|
|
6171
6167
|
if (snap_style) snap_style.remove();
|
|
6172
6168
|
sliding.classList.add("grabbing");
|
|
6173
6169
|
last_mouse_position = starting_position = e.clientX;
|
|
@@ -6179,7 +6175,7 @@ function $98ef92db220106f3$export$411b0f20794697ce(t) {
|
|
|
6179
6175
|
sliding.classList.add("slider_snap");
|
|
6180
6176
|
sliding.removeEventListener("mousemove", scroll_on_mousemove);
|
|
6181
6177
|
// readd snap css if needed
|
|
6182
|
-
const { snap_style: snap_style
|
|
6178
|
+
const { snap_style: snap_style } = this;
|
|
6183
6179
|
if (snap_style) {
|
|
6184
6180
|
this.container.append(snap_style);
|
|
6185
6181
|
// make a scroll so the browser snaps
|
|
@@ -6201,7 +6197,7 @@ function $98ef92db220106f3$export$411b0f20794697ce(t) {
|
|
|
6201
6197
|
}));
|
|
6202
6198
|
function scroll_on_mousemove(e) {
|
|
6203
6199
|
try {
|
|
6204
|
-
const { clientX: clientX
|
|
6200
|
+
const { clientX: clientX } = e;
|
|
6205
6201
|
if (Math.abs(clientX - starting_position) > 10) block_anchor_clicks = true;
|
|
6206
6202
|
sliding.scrollBy({
|
|
6207
6203
|
left: last_mouse_position - clientX
|
|
@@ -6233,12 +6229,12 @@ function $98ef92db220106f3$export$411b0f20794697ce(t) {
|
|
|
6233
6229
|
}
|
|
6234
6230
|
|
|
6235
6231
|
|
|
6236
|
-
function $f70ff79e6e286cc2$export$5129719c04a52f8c({ fade_in_duration_: fade_in_duration_ = 0
|
|
6232
|
+
function $f70ff79e6e286cc2$export$5129719c04a52f8c({ fade_in_duration_: fade_in_duration_ = 0, fade_out_duration_: fade_out_duration_ = 0, visible_opacity_: visible_opacity_ = 1, faded_opacity_: faded_opacity_ = 0.5, easing_: easing_ = "linear", threshold_: threshold_ = 0.5 } = {}) {
|
|
6237
6233
|
const faded_els = /*@__PURE__*/ new WeakSet();
|
|
6238
6234
|
function mutation_plugin_(entries, _intersecting_mutations) {
|
|
6239
6235
|
for(let i = 0; i < entries.length; i++){
|
|
6240
6236
|
const entry = entries[i];
|
|
6241
|
-
const { target: target
|
|
6237
|
+
const { target: target } = entry;
|
|
6242
6238
|
const should_be_faded = entry.intersectionRatio <= threshold_;
|
|
6243
6239
|
if (should_be_faded !== faded_els.has(target)) {
|
|
6244
6240
|
faded_els[should_be_faded ? "add" : "delete"](target);
|
|
@@ -6268,7 +6264,7 @@ function $f70ff79e6e286cc2$export$5129719c04a52f8c({ fade_in_duration_: fade_in_
|
|
|
6268
6264
|
function $91f7baba008bce7d$export$5723caf9a8335aa6(_t, fraction = 1, max_steps, dont_enable_correct_bs_targets, min_steps) {
|
|
6269
6265
|
function constructor_plugin(slider_options) {
|
|
6270
6266
|
const fallback_stepsize = slider_options.stepstoslide || 2;
|
|
6271
|
-
const { insert_here: sliding
|
|
6267
|
+
const { insert_here: sliding } = this;
|
|
6272
6268
|
if (!dont_enable_correct_bs_targets) this.correct_bs_targets = true;
|
|
6273
6269
|
Object.defineProperty(this, "stepstoslide", {
|
|
6274
6270
|
configurable: true,
|
|
@@ -6324,7 +6320,7 @@ function $1942530ef27e571b$export$93223e488e7ee078(options) {
|
|
|
6324
6320
|
this.scroll_bar = scroll_bar;
|
|
6325
6321
|
}
|
|
6326
6322
|
function mutation_plugin(_intersections, _intersecting_mutations) {
|
|
6327
|
-
const { insert_here: slider
|
|
6323
|
+
const { insert_here: slider } = this;
|
|
6328
6324
|
const scrolled = slider.scrollLeft / slider.scrollWidth * 100;
|
|
6329
6325
|
this.scroll_bar.style.width = `${Math.round(slider.offsetWidth / slider.scrollWidth * 100)}%`;
|
|
6330
6326
|
this.scroll_bar.style.left = `${scrolled}%`;
|
|
@@ -6341,7 +6337,7 @@ function $1942530ef27e571b$export$93223e488e7ee078(options) {
|
|
|
6341
6337
|
|
|
6342
6338
|
|
|
6343
6339
|
|
|
6344
|
-
function $6af20338fcad1911$export$b36d2489a5a16728(_t, { snapEvery: snapEvery
|
|
6340
|
+
function $6af20338fcad1911$export$b36d2489a5a16728(_t, { snapEvery: snapEvery, align: align } = {}) {
|
|
6345
6341
|
function constructor_plugin(_slider_options) {
|
|
6346
6342
|
const slider_this = this;
|
|
6347
6343
|
const random_classname = "x" + (0, $650b64c1b384c895$export$656831b7e9c341c3)().replaceAll(".", "");
|
|
@@ -6401,7 +6397,7 @@ function $379066823f8eeb0b$export$dac64fd35a4805a4(options = {}) {
|
|
|
6401
6397
|
};
|
|
6402
6398
|
let currently_left = "0";
|
|
6403
6399
|
function constructor_plugin(slider_options) {
|
|
6404
|
-
const { insert_here: sliding
|
|
6400
|
+
const { insert_here: sliding } = this;
|
|
6405
6401
|
const scroll_abs_no_negative = (target)=>this.scroll_to_abs(target < 0 ? 0 : target); // the slider ignores everything < 0 but we want it to move to the first card
|
|
6406
6402
|
sliding.addEventListener("mousedown", (0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)(()=>{
|
|
6407
6403
|
lock_on_element.lock_active = true;
|
|
@@ -6476,7 +6472,7 @@ function $379066823f8eeb0b$export$dac64fd35a4805a4(options = {}) {
|
|
|
6476
6472
|
|
|
6477
6473
|
|
|
6478
6474
|
|
|
6479
|
-
function $3d8df0a23b9bebac$export$53306504b987cbf7({ clones_per_side: clones_per_side = 8
|
|
6475
|
+
function $3d8df0a23b9bebac$export$53306504b987cbf7({ clones_per_side: clones_per_side = 8 } = {}) {
|
|
6480
6476
|
// YOU NEED TO USE slider_snap_css FOR THIS TO WORK
|
|
6481
6477
|
// only for usage with recommendation_renderer which you need to pass post_processor as LAST post processor
|
|
6482
6478
|
const time_of_no_events_to_count_as_scroll_idle = 150;
|
|
@@ -6545,7 +6541,7 @@ function $3d8df0a23b9bebac$export$53306504b987cbf7({ clones_per_side: clones_per
|
|
|
6545
6541
|
}
|
|
6546
6542
|
function mutation_plugin(intersections, intersecting_mutations) {
|
|
6547
6543
|
for(let i = 0; i < intersections.length; i++){
|
|
6548
|
-
const { intersectionRatio: intersectionRatio
|
|
6544
|
+
const { intersectionRatio: intersectionRatio } = intersections[i];
|
|
6549
6545
|
const target_large = intersectionRatio * 0.95;
|
|
6550
6546
|
const target_small = intersectionRatio * 1.05;
|
|
6551
6547
|
if (target_large > largest_seen_interection_ratio && target_large < 0.999) largest_seen_interection_ratio = target_large;
|
|
@@ -6613,10 +6609,10 @@ function $3d8df0a23b9bebac$export$53306504b987cbf7({ clones_per_side: clones_per
|
|
|
6613
6609
|
mutation_busy = false;
|
|
6614
6610
|
}
|
|
6615
6611
|
async function post_processor(elements, _display, info) {
|
|
6616
|
-
const { index: index
|
|
6612
|
+
const { index: index, rendering_options: rendering_options } = info;
|
|
6617
6613
|
originally_rendered_elements.push(...elements);
|
|
6618
6614
|
if (index === 0) {
|
|
6619
|
-
const { event_listeners: event_listeners
|
|
6615
|
+
const { event_listeners: event_listeners } = info; // so we don't want event listeners to be added twice. We will return our actual index 0 elements and all elements of all indexes. Tracking needs to be right per element per index. That's why we will now add our event listeners to our elements and then prevent RR from doing it for us on all returned elements, on which each RR run will get to add the correct individual ones
|
|
6620
6616
|
while(event_listeners?.length){
|
|
6621
6617
|
// order shouldn't matter, this is fast
|
|
6622
6618
|
const event_listener = event_listeners.pop();
|
|
@@ -6664,7 +6660,7 @@ function $3d8df0a23b9bebac$export$53306504b987cbf7({ clones_per_side: clones_per
|
|
|
6664
6660
|
};
|
|
6665
6661
|
}
|
|
6666
6662
|
function $3d8df0a23b9bebac$var$scroll_idle(slider, chunk_size, clones_per_side) {
|
|
6667
|
-
const { insert_here: sliding
|
|
6663
|
+
const { insert_here: sliding } = slider;
|
|
6668
6664
|
const slider_box = sliding.getBoundingClientRect();
|
|
6669
6665
|
const leftmost_rect = slider.element_by_index(0).getBoundingClientRect();
|
|
6670
6666
|
const rightmost_rect = slider.element_by_index(slider.index_of_last_element).getBoundingClientRect();
|
|
@@ -6673,7 +6669,7 @@ function $3d8df0a23b9bebac$var$scroll_idle(slider, chunk_size, clones_per_side)
|
|
|
6673
6669
|
const children = [
|
|
6674
6670
|
...sliding.children
|
|
6675
6671
|
];
|
|
6676
|
-
const { intersecting_items_object: intersecting_items_object
|
|
6672
|
+
const { intersecting_items_object: intersecting_items_object } = slider;
|
|
6677
6673
|
const index_of_first_intersecting = slider.first_intersecting_index();
|
|
6678
6674
|
const index_of_last_intersecting = Math.max(...Object.keys(intersecting_items_object).map((v)=>+v));
|
|
6679
6675
|
const post_move = (direction)=>{
|
|
@@ -6796,7 +6792,7 @@ query, handler, initial_call = true) {
|
|
|
6796
6792
|
}
|
|
6797
6793
|
|
|
6798
6794
|
|
|
6799
|
-
async function $bf76a92ec2055e1a$export$417ef0ab13d8b984({ surface_rendering_functions_: surface_rendering_functions_
|
|
6795
|
+
async function $bf76a92ec2055e1a$export$417ef0ab13d8b984({ surface_rendering_functions_: surface_rendering_functions_, current_surface_: current_surface_ }) {
|
|
6800
6796
|
let resolve_success_promise;
|
|
6801
6797
|
const success_promise = new Promise((r)=>resolve_success_promise = r);
|
|
6802
6798
|
const cache = new Map();
|
|
@@ -6817,7 +6813,7 @@ async function $bf76a92ec2055e1a$export$417ef0ab13d8b984({ surface_rendering_fun
|
|
|
6817
6813
|
async function $bf76a92ec2055e1a$var$switch_to_surface(surface_index, rendering_function, current_surface_ipns, cache, set_els, resolve_success_promise) {
|
|
6818
6814
|
let rendered_surface = cache.get(surface_index);
|
|
6819
6815
|
if (!rendered_surface) {
|
|
6820
|
-
const { cache_until_: cache_until_
|
|
6816
|
+
const { cache_until_: cache_until_, surface_: surface_ } = await rendering_function().catch((e)=>((0, $268cbd9e4ade92db$export$f18d5b0af29128b7)([
|
|
6821
6817
|
e,
|
|
6822
6818
|
"error in rendering"
|
|
6823
6819
|
], "warning"), {}));
|
|
@@ -6863,7 +6859,7 @@ function $bf76a92ec2055e1a$export$419f84efad7d9fe(surface_per_size, cleanup_prom
|
|
|
6863
6859
|
});
|
|
6864
6860
|
surface_per_size.forEach(([surface_index, min, max])=>{
|
|
6865
6861
|
const media_query = (0, $1cc2444a0f1b992e$export$717f13d9ba00ca19)(min, max).split("@media ").pop();
|
|
6866
|
-
const { remove: remove
|
|
6862
|
+
const { remove: remove } = (0, $93c499898a1702c7$export$515c3ea4d599b05a)(media_query, ({ matches: matches })=>{
|
|
6867
6863
|
if (!matches) return;
|
|
6868
6864
|
target_indexes.add(surface_index);
|
|
6869
6865
|
if (!microtask_queued) {
|
|
@@ -6899,7 +6895,7 @@ function $bf76a92ec2055e1a$export$be95cb0e8cfd099e() {
|
|
|
6899
6895
|
function $0c9d834f187cc4ff$export$3ebd86018b39d9d2(t, selector, filter) {
|
|
6900
6896
|
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onexists(selector, (eoe)=>{
|
|
6901
6897
|
(0, $e6c6e7929ea385ae$export$de56f1198d121036)("Order confirmation element showed up!", eoe);
|
|
6902
|
-
const { element: element
|
|
6898
|
+
const { element: element } = eoe;
|
|
6903
6899
|
const the_id = element.innerText;
|
|
6904
6900
|
$0c9d834f187cc4ff$export$1ac466d53a6636ac(t, the_id, (0, $e0a87646d12cb987$export$6399bdb2291895e0)(), filter);
|
|
6905
6901
|
});
|
|
@@ -6973,7 +6969,7 @@ function $5a44db2d2c8361b9$export$1ff14fec60ed5697(t, filter) {
|
|
|
6973
6969
|
const all_trackers = get_all_function.call(ga);
|
|
6974
6970
|
(0, $e6c6e7929ea385ae$export$de56f1198d121036)("we have trackers", all_trackers);
|
|
6975
6971
|
// @ts-ignore
|
|
6976
|
-
const { P: P
|
|
6972
|
+
const { P: P } = ga;
|
|
6977
6973
|
(0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)(modify_trackers_of_iterable)(all_trackers);
|
|
6978
6974
|
if (typeof P?.push === "function") // this check is just so we don't fail if this doesn't exist for some reason, but it always should
|
|
6979
6975
|
P.push = new Proxy(P.push, {
|
|
@@ -7290,8 +7286,8 @@ const $23d6393391c08860$export$783ef16647773b3d = (0, $41f528c04cc8a8da$export$5
|
|
|
7290
7286
|
|
|
7291
7287
|
|
|
7292
7288
|
|
|
7293
|
-
async function $40f3ad8d5c440ce9$export$b404e20f3c4a490e({ t: t
|
|
7294
|
-
const { dlog: dlog
|
|
7289
|
+
async function $40f3ad8d5c440ce9$export$b404e20f3c4a490e({ t: t, experiment_id: experiment_id, functions_to_variants: functions_to_variants }) {
|
|
7290
|
+
const { dlog: dlog, err: err, Sentry: Sentry } = t, start = new Date().getTime(), optimize = await (0, $e6d67ef355abb2dc$export$2fc1a072736ae2f6)(window, "google_optimize"), end = new Date().getTime();
|
|
7295
7291
|
dlog("Waited for google_optimize for", end - start, "ms");
|
|
7296
7292
|
// if (!optimize.get) {
|
|
7297
7293
|
// debugger;
|
|
@@ -7378,7 +7374,7 @@ const $c693a2d89c78efe6$export$b8d1e1d07a3f3776 = (cb)=>{
|
|
|
7378
7374
|
return retval;
|
|
7379
7375
|
};
|
|
7380
7376
|
};
|
|
7381
|
-
function $c693a2d89c78efe6$export$f811d2ce0aa6019b({ surfaces: input_surfaces
|
|
7377
|
+
function $c693a2d89c78efe6$export$f811d2ce0aa6019b({ surfaces: input_surfaces, verb: verb, target: target, remove_after_navigation: remove_after_navigation = true, try_forever: try_forever = false, preserve_elements: preserve_elements = false }) {
|
|
7382
7378
|
const surfaces = input_surfaces.map((s)=>{
|
|
7383
7379
|
let resolve;
|
|
7384
7380
|
const promise = new Promise((r)=>resolve = r);
|
|
@@ -7388,12 +7384,12 @@ function $c693a2d89c78efe6$export$f811d2ce0aa6019b({ surfaces: input_surfaces ,
|
|
|
7388
7384
|
promise_: promise
|
|
7389
7385
|
};
|
|
7390
7386
|
});
|
|
7391
|
-
const { href: href
|
|
7387
|
+
const { href: href } = location;
|
|
7392
7388
|
let context = $c693a2d89c78efe6$var$current_context;
|
|
7393
7389
|
if (typeof target === "string") {
|
|
7394
7390
|
context ??= ++$c693a2d89c78efe6$var$context_counter; // assign a context so that we don't add `undefined` or `null` to failed_contexts
|
|
7395
7391
|
let disconnect_reinsertion_observers;
|
|
7396
|
-
const disconnect_observer = (0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onexists(target, ({ element: element
|
|
7392
|
+
const disconnect_observer = (0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onexists(target, ({ element: element, disconnector: disconnector })=>{
|
|
7397
7393
|
if ($c693a2d89c78efe6$var$failed_contexts.has(context)) {
|
|
7398
7394
|
disconnector(); // prevent infinite loop
|
|
7399
7395
|
return;
|
|
@@ -7406,7 +7402,7 @@ function $c693a2d89c78efe6$export$f811d2ce0aa6019b({ surfaces: input_surfaces ,
|
|
|
7406
7402
|
if (!context && verb !== "replaceChildren") throw new Error("insert_surface, provided an element, may not be called without a context." + (process.env.DEBUG === "true" ? " Please wrap the function calling it into prevent_infinite_loop(). If you have already done that, make sure that there's no `await` before the calling of insert_surface" : ""));
|
|
7407
7403
|
(0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)($c693a2d89c78efe6$var$actual_insertion)(target, verb, surfaces, try_forever, href, context, remove_after_navigation, preserve_elements);
|
|
7408
7404
|
}
|
|
7409
|
-
return surfaces.map(({ promise_: promise_
|
|
7405
|
+
return surfaces.map(({ promise_: promise_ })=>promise_);
|
|
7410
7406
|
}
|
|
7411
7407
|
const $c693a2d89c78efe6$export$e3f70ef7e3d00501 = /*@__PURE__*/ (0, /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9)(async (target, should_stay_inserted)=>{
|
|
7412
7408
|
const per_el_fn = (el, disconnect_observer)=>{
|
|
@@ -7422,7 +7418,7 @@ const $c693a2d89c78efe6$export$e3f70ef7e3d00501 = /*@__PURE__*/ (0, /*@__PURE__*
|
|
|
7422
7418
|
});
|
|
7423
7419
|
};
|
|
7424
7420
|
if (typeof target == "string") {
|
|
7425
|
-
const disconnect_observer = (0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onexists(target, ({ element: element
|
|
7421
|
+
const disconnect_observer = (0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onexists(target, ({ element: element, disconnector: disconnector })=>per_el_fn(element, disconnector));
|
|
7426
7422
|
(0, $69f7524c8bdd85b4$export$1cd22bab0d2c3b0b)(disconnect_observer);
|
|
7427
7423
|
} else {
|
|
7428
7424
|
let did_already_fail = false;
|
|
@@ -7459,7 +7455,7 @@ function $c693a2d89c78efe6$var$actual_insertion(target, verb, surfaces, try_fore
|
|
|
7459
7455
|
} else if (old_children) target.replaceChildren(...old_children);
|
|
7460
7456
|
else flat_tnodes.forEach((n)=>n.remove());
|
|
7461
7457
|
};
|
|
7462
|
-
const template_nodes = surfaces.map(({ surface_: surface_
|
|
7458
|
+
const template_nodes = surfaces.map(({ surface_: surface_, resolve_promise_: resolve_promise_ })=>{
|
|
7463
7459
|
const [template_els, _get, set] = (0, $3721a5ccba25c247$export$3d04c40e7acc1a32)();
|
|
7464
7460
|
(async ()=>{
|
|
7465
7461
|
let surface;
|
|
@@ -7539,8 +7535,8 @@ function $c693a2d89c78efe6$var$deal_w_removal_of_node_array(node_array, push_dis
|
|
|
7539
7535
|
else already_observing_nodes.add(node_to_observe);
|
|
7540
7536
|
const disconnect_observer = (0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onremoved(node_to_observe, (eoe)=>{
|
|
7541
7537
|
const mutation_record = eoe.mutation_record; // .onremoved always has a mutation_record
|
|
7542
|
-
const { element: element
|
|
7543
|
-
const { nextSibling: nextSibling
|
|
7538
|
+
const { element: element } = eoe;
|
|
7539
|
+
const { nextSibling: nextSibling, previousSibling: previousSibling, target: target } = mutation_record;
|
|
7544
7540
|
if (previous_parent !== target) {
|
|
7545
7541
|
(0, $e6c6e7929ea385ae$export$de56f1198d121036)(element, "was removed", eoe, "but because a parent got removed we're keeping it that way");
|
|
7546
7542
|
return;
|
|
@@ -7562,7 +7558,7 @@ function $c693a2d89c78efe6$var$deal_w_removal_of_node_array(node_array, push_dis
|
|
|
7562
7558
|
removals_in_last_s++;
|
|
7563
7559
|
setTimeout(()=>removals_in_last_s--, 1000);
|
|
7564
7560
|
(0, $e6c6e7929ea385ae$export$de56f1198d121036)(element, "was removed from DOM,", eoe, "reinserting");
|
|
7565
|
-
const { documentElement: documentElement
|
|
7561
|
+
const { documentElement: documentElement } = document;
|
|
7566
7562
|
// try to get right place, didn't test this
|
|
7567
7563
|
if (nextSibling && documentElement.contains(nextSibling)) nextSibling.before(element);
|
|
7568
7564
|
else if (previousSibling && documentElement.contains(previousSibling)) previousSibling.after(element);
|
|
@@ -7589,7 +7585,7 @@ function $c693a2d89c78efe6$var$deal_w_removal_of_node_array(node_array, push_dis
|
|
|
7589
7585
|
const $fac9c96b6bbe43cd$export$3b75288f46cadd96 = ()=>new Array((0, $3f34dc07544c5857$export$bb0a9c36cf454ea0)(3, 8)).fill("⬜").join("");
|
|
7590
7586
|
const $fac9c96b6bbe43cd$var$make_sel = (image_url, attribute)=>`[${attribute}=${JSON.stringify(image_url)}]`;
|
|
7591
7587
|
const $fac9c96b6bbe43cd$export$a4eccf92efefa04d = (image_width, image_height, color = "#f6f7f8")=>`data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='${image_width}' height='${image_height}' xmlns:v='https://vecta.io/nano'%3e%3cpath d='M0 0h${image_width}.016v${image_height}.01H0' fill='${encodeURIComponent(color)}'/%3e%3c/svg%3e`;
|
|
7592
|
-
async function $fac9c96b6bbe43cd$export$2dd69958012e3e49({ override_rec_renderer: override_rec_renderer = (0, $92bde32714bb1e07$export$50ce83ace0cdd87e)
|
|
7588
|
+
async function $fac9c96b6bbe43cd$export$2dd69958012e3e49({ override_rec_renderer: override_rec_renderer = (0, $92bde32714bb1e07$export$50ce83ace0cdd87e), image_width: image_width = 2000, image_height: image_height = 2000, num_items: num_items = 10, color: color = "#d9d9d9", on_no_rendering_result: on_no_rendering_result, post_rendering: post_rendering } = {}) {
|
|
7593
7589
|
const image_url = $fac9c96b6bbe43cd$export$a4eccf92efefa04d(image_width, image_height, color);
|
|
7594
7590
|
return async (t, rendering_options)=>{
|
|
7595
7591
|
// @ts-ignore FIXME: this is a hack to make the type checker happy
|
|
@@ -7636,7 +7632,7 @@ async function $fac9c96b6bbe43cd$export$2dd69958012e3e49({ override_rec_renderer
|
|
|
7636
7632
|
const [template_els, _get_state, set_state] = (0, $3721a5ccba25c247$export$3d04c40e7acc1a32)(placeholder_rendering.elements);
|
|
7637
7633
|
actual_rendering.then(async (rendering_result)=>{
|
|
7638
7634
|
if (typeof post_rendering == "function") await (0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)(post_rendering)(rendering_result);
|
|
7639
|
-
const { elements: elements
|
|
7635
|
+
const { elements: elements } = rendering_result || {};
|
|
7640
7636
|
await (0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).wait_for_element(placeholder_rendering.elements[0]);
|
|
7641
7637
|
// await new Promise(r => window.addEventListener("contextmenu", r, { once: true }));
|
|
7642
7638
|
// 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
|
|
@@ -7747,7 +7743,7 @@ function $6d0c26cd36f5eeff$export$e647444ed9403635() {
|
|
|
7747
7743
|
|
|
7748
7744
|
function $61201159f98f0375$export$33d1643df63073a8(fetch_handler) {
|
|
7749
7745
|
fetch_handler = (0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)(fetch_handler);
|
|
7750
|
-
const { prototype: prototype
|
|
7746
|
+
const { prototype: prototype } = XMLHttpRequest;
|
|
7751
7747
|
prototype.open = new Proxy(prototype.open, {
|
|
7752
7748
|
apply (target, this_arg, arg_array) {
|
|
7753
7749
|
if (Array.isArray(arg_array)) {
|
|
@@ -7768,7 +7764,7 @@ async function $61201159f98f0375$export$c74578d2cd47a84a(send_callback) {
|
|
|
7768
7764
|
$61201159f98f0375$export$33d1643df63073a8((request, _method, _url, arg_array)=>{
|
|
7769
7765
|
requests.set(request, arg_array);
|
|
7770
7766
|
});
|
|
7771
|
-
const { prototype: prototype
|
|
7767
|
+
const { prototype: prototype } = XMLHttpRequest;
|
|
7772
7768
|
prototype.send = new Proxy(prototype.send, {
|
|
7773
7769
|
apply (target, this_request, arg_list) {
|
|
7774
7770
|
try {
|
|
@@ -7783,7 +7779,7 @@ async function $61201159f98f0375$export$c74578d2cd47a84a(send_callback) {
|
|
|
7783
7779
|
async function $61201159f98f0375$export$8e16c51fd2b6507(read_callback) {
|
|
7784
7780
|
const catchified_read_callback = (0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)(read_callback);
|
|
7785
7781
|
const open_send_arg_map = new WeakMap();
|
|
7786
|
-
const { prototype: prototype
|
|
7782
|
+
const { prototype: prototype } = XMLHttpRequest;
|
|
7787
7783
|
const proxy_response = (n)=>{
|
|
7788
7784
|
const prev_desc = Object.getOwnPropertyDescriptor(prototype, n);
|
|
7789
7785
|
const new_desc = {
|
|
@@ -7905,7 +7901,7 @@ function $2780129735dc272e$export$2a38b176ce969e2c(orig_url_with_trailing_slash)
|
|
|
7905
7901
|
* @returns If a market specified in `allowed_markets`was found that is returned, `undefined` otherwise
|
|
7906
7902
|
*/ function $02a3425594231893$export$a422d714c8cb1a5d(allowed_markets, url, tenant = process.env.TENANT) {
|
|
7907
7903
|
const u_o = url ? new URL(url) : location;
|
|
7908
|
-
const { hostname: hostname
|
|
7904
|
+
const { hostname: hostname } = u_o;
|
|
7909
7905
|
const is_demosite = process.env.DEBUG === "true" && hostname.endsWith("demo.depict.ai");
|
|
7910
7906
|
// strategy 0: demo sites
|
|
7911
7907
|
if (is_demosite) {
|
|
@@ -7913,7 +7909,7 @@ function $2780129735dc272e$export$2a38b176ce969e2c(orig_url_with_trailing_slash)
|
|
|
7913
7909
|
if (allowed_markets.includes(last_in_orig_site)) return last_in_orig_site;
|
|
7914
7910
|
}
|
|
7915
7911
|
// strategy 1 pathname startsWith
|
|
7916
|
-
const { pathname: pathname
|
|
7912
|
+
const { pathname: pathname } = u_o;
|
|
7917
7913
|
const market = allowed_markets.find((v)=>pathname.startsWith("/" + v + "/") || pathname === "/" + v);
|
|
7918
7914
|
if (market) return market;
|
|
7919
7915
|
// strategy 2 <tenant><divider><market>
|
|
@@ -8047,7 +8043,7 @@ const $5185cc9bd668b8f9$export$a739d9a07da7f9ce = (0, $268cbd9e4ade92db$export$b
|
|
|
8047
8043
|
|
|
8048
8044
|
|
|
8049
8045
|
|
|
8050
|
-
function $dba3e72fb3e5c53d$export$4a3043e508dd72f0({ children: children
|
|
8046
|
+
function $dba3e72fb3e5c53d$export$4a3043e508dd72f0({ children: children, ...attributes }) {
|
|
8051
8047
|
const button = (0, $107a74aa4ea5902d$export$34b9dba7ce09269b)("button", {
|
|
8052
8048
|
...attributes,
|
|
8053
8049
|
type: "button",
|
|
@@ -8063,8 +8059,7 @@ function $dba3e72fb3e5c53d$export$4a3043e508dd72f0({ children: children , ...att
|
|
|
8063
8059
|
|
|
8064
8060
|
|
|
8065
8061
|
|
|
8066
|
-
|
|
8067
|
-
async function $a7550e9f97f84465$export$8a0e4d6f6abf7e90({ title_: title_ , children: children , CloseIcon: CloseIcon }) {
|
|
8062
|
+
async function $a7550e9f97f84465$export$8a0e4d6f6abf7e90({ title_: title_, children: children, CloseIcon: CloseIcon }) {
|
|
8068
8063
|
// TODO: make so once can't accidentally have multiple at once
|
|
8069
8064
|
let close_;
|
|
8070
8065
|
const open_promise = new Promise((r)=>close_ = r);
|
|
@@ -8130,7 +8125,7 @@ async function $a7550e9f97f84465$export$8a0e4d6f6abf7e90({ title_: title_ , chil
|
|
|
8130
8125
|
easing: "ease-in",
|
|
8131
8126
|
duration: 220
|
|
8132
8127
|
});
|
|
8133
|
-
const handler = (0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)(({ key: key
|
|
8128
|
+
const handler = (0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)(({ key: key })=>{
|
|
8134
8129
|
if (key === "Escape") // make pressing escape close the slidein
|
|
8135
8130
|
close_();
|
|
8136
8131
|
});
|
|
@@ -8176,18 +8171,17 @@ async function $a7550e9f97f84465$export$8a0e4d6f6abf7e90({ title_: title_ , chil
|
|
|
8176
8171
|
|
|
8177
8172
|
|
|
8178
8173
|
|
|
8179
|
-
|
|
8180
|
-
async function $bd0fccdac6624b01$export$c068ad5361be7646({ title_: title_ , items_: items_ , out_of_stock_text_: out_of_stock_text_ , CloseIcon: CloseIcon }) {
|
|
8174
|
+
async function $bd0fccdac6624b01$export$c068ad5361be7646({ title_: title_, items_: items_, out_of_stock_text_: out_of_stock_text_, CloseIcon: CloseIcon }) {
|
|
8181
8175
|
const [exit_oos_iterator, exitable_oos_iterator] = (0, $bbe52965151ee7f0$export$927664b47117acb0)(out_of_stock_text_);
|
|
8182
8176
|
// eslint-disable-line no-async-promise-executor
|
|
8183
8177
|
return new Promise((0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)(async (size_selected)=>{
|
|
8184
|
-
const { close_: close_
|
|
8178
|
+
const { close_: close_, on_close_: on_close_ } = await (0, $a7550e9f97f84465$export$8a0e4d6f6abf7e90)({
|
|
8185
8179
|
CloseIcon: CloseIcon,
|
|
8186
8180
|
title_: title_,
|
|
8187
8181
|
children: [
|
|
8188
8182
|
(0, $107a74aa4ea5902d$export$34b9dba7ce09269b)("div", {
|
|
8189
8183
|
class: "option-list",
|
|
8190
|
-
children: items_.map(({ size_name_: size_name_
|
|
8184
|
+
children: items_.map(({ size_name_: size_name_, is_available_: is_available_, id_: id_ })=>{
|
|
8191
8185
|
const button = (0, $107a74aa4ea5902d$export$25062201e9e25d76)("button", {
|
|
8192
8186
|
type: "button",
|
|
8193
8187
|
class: "option" + (is_available_ ? " available" : ""),
|
|
@@ -8218,17 +8212,17 @@ async function $bd0fccdac6624b01$export$c068ad5361be7646({ title_: title_ , item
|
|
|
8218
8212
|
}
|
|
8219
8213
|
|
|
8220
8214
|
|
|
8221
|
-
var $
|
|
8222
|
-
$
|
|
8215
|
+
var $286ce77d5f6728db$exports = {};
|
|
8216
|
+
$286ce77d5f6728db$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";
|
|
8223
8217
|
|
|
8224
8218
|
|
|
8225
8219
|
|
|
8226
8220
|
|
|
8227
8221
|
let $e587cb3b31b82f43$var$inserted = false;
|
|
8228
|
-
const $e587cb3b31b82f43$export$84712d0562a614b8 = ({ width: width
|
|
8222
|
+
const $e587cb3b31b82f43$export$84712d0562a614b8 = ({ width: width, height: height = "1em", class: extra_classes, style: style = "", ...attributes })=>{
|
|
8229
8223
|
if (!$e587cb3b31b82f43$var$inserted) {
|
|
8230
8224
|
// Insert styling on first import
|
|
8231
|
-
(0, $e4bebbfa0f0b1454$export$59ba1eb2c083f0cd)((0, (/*@__PURE__*/$parcel$interopDefault($
|
|
8225
|
+
(0, $e4bebbfa0f0b1454$export$59ba1eb2c083f0cd)((0, (/*@__PURE__*/$parcel$interopDefault($286ce77d5f6728db$exports))));
|
|
8232
8226
|
$e587cb3b31b82f43$var$inserted = true;
|
|
8233
8227
|
}
|
|
8234
8228
|
return(// @ts-ignore
|
|
@@ -8238,7 +8232,7 @@ const $e587cb3b31b82f43$export$84712d0562a614b8 = ({ width: width , height: heig
|
|
|
8238
8232
|
...attributes
|
|
8239
8233
|
}));
|
|
8240
8234
|
};
|
|
8241
|
-
const $e587cb3b31b82f43$export$d613f5b6d0a331a8 = ({ aspect_ratio: aspect_ratio
|
|
8235
|
+
const $e587cb3b31b82f43$export$d613f5b6d0a331a8 = ({ aspect_ratio: aspect_ratio, ...attributes })=>{
|
|
8242
8236
|
return (0, $107a74aa4ea5902d$export$34b9dba7ce09269b)($e587cb3b31b82f43$export$84712d0562a614b8, {
|
|
8243
8237
|
style: `position:relative;width:100%;padding-bottom:${1 / aspect_ratio * 100}%`,
|
|
8244
8238
|
...attributes
|
|
@@ -8248,7 +8242,6 @@ const $e587cb3b31b82f43$export$d613f5b6d0a331a8 = ({ aspect_ratio: aspect_ratio
|
|
|
8248
8242
|
|
|
8249
8243
|
|
|
8250
8244
|
|
|
8251
|
-
|
|
8252
8245
|
const $b9c0746e4d18273a$export$97f31f44c68c1d5 = (title, surface_classes = [])=>(0, $90e0b983530610e7$export$eb0b9ed911409b57)((e)=>e.classList.add(...surface_classes), (0, $107a74aa4ea5902d$export$25062201e9e25d76)("div", {
|
|
8253
8246
|
class: "depict recommendation_container",
|
|
8254
8247
|
children: [
|
|
@@ -8264,7 +8257,6 @@ const $b9c0746e4d18273a$export$97f31f44c68c1d5 = (title, surface_classes = [])=>
|
|
|
8264
8257
|
|
|
8265
8258
|
|
|
8266
8259
|
|
|
8267
|
-
|
|
8268
8260
|
const $69accc27bcbd6972$export$32a55d57d151bc5a = ()=>(0, $107a74aa4ea5902d$export$25062201e9e25d76)("svg", {
|
|
8269
8261
|
viewBox: "0 0 320 512",
|
|
8270
8262
|
children: [
|
|
@@ -8294,7 +8286,7 @@ const $69accc27bcbd6972$export$ddd70fdae1b350e6 = ()=>(0, $107a74aa4ea5902d$expo
|
|
|
8294
8286
|
/**
|
|
8295
8287
|
* Internal color circle used in ColorPicker
|
|
8296
8288
|
* @see {createColorPicker}
|
|
8297
|
-
*/ function $af92e61c7dfccf01$var$ColorCircle({ color: color
|
|
8289
|
+
*/ function $af92e61c7dfccf01$var$ColorCircle({ color: color, onClick: onClick, onHoverUpdate: onHoverUpdate }) {
|
|
8298
8290
|
const button = (0, $107a74aa4ea5902d$export$34b9dba7ce09269b)("button", {
|
|
8299
8291
|
class: "color-circle-container",
|
|
8300
8292
|
onClick: (e)=>onClick(e.currentTarget, color),
|
|
@@ -8312,7 +8304,7 @@ const $69accc27bcbd6972$export$ddd70fdae1b350e6 = ()=>(0, $107a74aa4ea5902d$expo
|
|
|
8312
8304
|
button.addEventListener("mouseleave", (0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)(()=>onHoverUpdate(button, color, false)));
|
|
8313
8305
|
return button;
|
|
8314
8306
|
}
|
|
8315
|
-
function $af92e61c7dfccf01$export$590326cc34f49e2d({ colors: colors
|
|
8307
|
+
function $af92e61c7dfccf01$export$590326cc34f49e2d({ colors: colors, initialColor: initialColor, onSelect: onSelect, selectOnHover: selectOnHover = false, onHoverUpdate: onHoverUpdate, dontSetActiveOnClick: dontSetActiveOnClick, onlyCircles: onlyCircles }) {
|
|
8316
8308
|
let setActiveIndex;
|
|
8317
8309
|
// Don't actually construct anything if the component we return isn't used
|
|
8318
8310
|
return {
|
|
@@ -8374,7 +8366,7 @@ function $af92e61c7dfccf01$export$590326cc34f49e2d({ colors: colors , initialCol
|
|
|
8374
8366
|
|
|
8375
8367
|
|
|
8376
8368
|
|
|
8377
|
-
const $b25f388f0fe2f1b3$export$237455ad7e59d4e5 = ({ duration: duration = 500
|
|
8369
|
+
const $b25f388f0fe2f1b3$export$237455ad7e59d4e5 = ({ duration: duration = 500, delay: delay = 0 } = {
|
|
8378
8370
|
duration: 500,
|
|
8379
8371
|
delay: 0
|
|
8380
8372
|
})=>{
|
|
@@ -8390,7 +8382,7 @@ const $b25f388f0fe2f1b3$export$237455ad7e59d4e5 = ({ duration: duration = 500 ,
|
|
|
8390
8382
|
const get_height = ()=>(child_computed_style() ? parseInt(child_computed_style().marginTop) + parseInt(child_computed_style().marginBottom) + parseInt(child_computed_style().height) : innerRef.clientHeight) + "px";
|
|
8391
8383
|
const get_current_height_possibly_during_transition = ()=>(child_computed_style() && outerRef.style.overflow !== "hidden" ? parseInt(child_computed_style().marginBottom) + parseInt(child_computed_style().marginTop) // don't ask me why we need to do this 😭 but I'm sure it works
|
|
8392
8384
|
: 0) + outerRef.clientHeight + "px";
|
|
8393
|
-
const ExpandingContainer = ({ children: children
|
|
8385
|
+
const ExpandingContainer = ({ children: children })=>{
|
|
8394
8386
|
if (Array.isArray(children) && children.length === 1) children = children[0];
|
|
8395
8387
|
innerRef = (0, $107a74aa4ea5902d$export$34b9dba7ce09269b)("div", {
|
|
8396
8388
|
children: children
|
|
@@ -8456,8 +8448,8 @@ const $b25f388f0fe2f1b3$export$237455ad7e59d4e5 = ({ duration: duration = 500 ,
|
|
|
8456
8448
|
};
|
|
8457
8449
|
|
|
8458
8450
|
|
|
8459
|
-
var $
|
|
8460
|
-
$
|
|
8451
|
+
var $bdb3d8c0ba0e9ccc$exports = {};
|
|
8452
|
+
$bdb3d8c0ba0e9ccc$exports = ".depict-img-cont {\n width: 100%;\n height: 100%;\n position: absolute;\n}\n\n.depict-img-filler {\n width: 100%;\n height: auto;\n display: inline-block;\n}\n\n.depict-img-comp {\n width: auto;\n height: auto;\n max-width: 100%;\n max-height: 100%;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n\n.depict-img-mod {\n width: 100%;\n height: 100%;\n object-fit: contain;\n position: absolute;\n inset: 0;\n}\n\n";
|
|
8461
8453
|
|
|
8462
8454
|
|
|
8463
8455
|
|
|
@@ -8472,7 +8464,7 @@ function $ff973b2032639b5f$export$f39a7d0667e924a(what_to_watch, sizes_communica
|
|
|
8472
8464
|
let currently_live = false;
|
|
8473
8465
|
const ro = new ResizeObserver((0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)((records)=>{
|
|
8474
8466
|
for(let j = 0; j < records.length; j++){
|
|
8475
|
-
const { width: width
|
|
8467
|
+
const { width: width } = records[j].contentRect;
|
|
8476
8468
|
if (!width) continue;
|
|
8477
8469
|
// add extra 5% just in case. + safari is (in some cases) acting a bit questionable and needs a third extra to fill the set width
|
|
8478
8470
|
const new_size = width * 1.05 * ($ff973b2032639b5f$export$a98fc8a2c818d3d8 ? 4 / 3 : 1) * resolution_factor;
|
|
@@ -8480,7 +8472,7 @@ function $ff973b2032639b5f$export$f39a7d0667e924a(what_to_watch, sizes_communica
|
|
|
8480
8472
|
}
|
|
8481
8473
|
}));
|
|
8482
8474
|
// start and stop ResizeObserver to make sure we're not hindering GC
|
|
8483
|
-
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).oncreation(what_to_watch, ({ element: element
|
|
8475
|
+
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).oncreation(what_to_watch, ({ element: element })=>{
|
|
8484
8476
|
ro.observe(element);
|
|
8485
8477
|
currently_live = true;
|
|
8486
8478
|
});
|
|
@@ -8503,7 +8495,7 @@ function $ff973b2032639b5f$export$f39a7d0667e924a(what_to_watch, sizes_communica
|
|
|
8503
8495
|
const weakrefd_el_to_resize = new WeakRef(el_to_resize);
|
|
8504
8496
|
// if the watched el exits it will run .exit on the IPNS and exit the iterators.
|
|
8505
8497
|
// then if it's recreated, the observer below will restart the iterators.
|
|
8506
|
-
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).oncreation(what_to_watch, async ({ disconnector: disconnector
|
|
8498
|
+
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).oncreation(what_to_watch, async ({ disconnector: disconnector })=>{
|
|
8507
8499
|
const el_to_update = weakrefd_el_to_resize.deref();
|
|
8508
8500
|
if (!el_to_update) {
|
|
8509
8501
|
disconnector(); // we're useless, el got GCd
|
|
@@ -8515,10 +8507,10 @@ function $ff973b2032639b5f$export$f39a7d0667e924a(what_to_watch, sizes_communica
|
|
|
8515
8507
|
// FYI: this will still hold strong references to the els that get their sizes attribute set until the watched el is removed from the DOM and GC'd. I wrote a version before where that's not the case which you can find here: https://gitlab.com/depict-ai/depict.ai/-/merge_requests/1901/diffs?commit_id=111d72c0f58777786dfcc00cc18d76cb0ac96c7c and I didn't end up using because I think it's wasting too many CPU cycles
|
|
8516
8508
|
};
|
|
8517
8509
|
}
|
|
8518
|
-
function $ff973b2032639b5f$export$a62825542f1bfcf5({ what_to_watch: what_to_watch
|
|
8510
|
+
function $ff973b2032639b5f$export$a62825542f1bfcf5({ what_to_watch: what_to_watch, set_dataset: set_dataset = true, formats: formats = [
|
|
8519
8511
|
"webp",
|
|
8520
8512
|
"jpeg"
|
|
8521
|
-
]
|
|
8513
|
+
], resolutions: resolutions = [
|
|
8522
8514
|
64,
|
|
8523
8515
|
128,
|
|
8524
8516
|
256,
|
|
@@ -8528,7 +8520,7 @@ function $ff973b2032639b5f$export$a62825542f1bfcf5({ what_to_watch: what_to_watc
|
|
|
8528
8520
|
1024,
|
|
8529
8521
|
2048,
|
|
8530
8522
|
4096
|
|
8531
|
-
]
|
|
8523
|
+
], sizes_communicator: sizes_communicator, resolution_factor: resolution_factor, market_: market_, sizes_setter_: sizes_setter_ } = {}) {
|
|
8532
8524
|
/**
|
|
8533
8525
|
* We support what_to_watch being optional, meaning we will take the first image we get.
|
|
8534
8526
|
* For that we need to have created the image before being able to create the sizes setter.
|
|
@@ -8612,15 +8604,14 @@ function $ff973b2032639b5f$var$optimized_img_url_generator(format, url, width) {
|
|
|
8612
8604
|
|
|
8613
8605
|
|
|
8614
8606
|
|
|
8615
|
-
|
|
8616
8607
|
const $a312bccd722ac9e4$var$rendering_options_to_sourceset_component = /*@__PURE__*/ new WeakMap();
|
|
8617
8608
|
// Add nolazy to placeholders to avoid errors with the stupid lazyfier
|
|
8618
8609
|
const $a312bccd722ac9e4$var$add_nolazy_to_placeholder = (type)=>type === "placeholder" ? "nolazy" : "";
|
|
8619
8610
|
let $a312bccd722ac9e4$var$inserted = false;
|
|
8620
|
-
const $a312bccd722ac9e4$export$788756b42446dc2d = ({ init_with_placeholder: init_with_placeholder
|
|
8611
|
+
const $a312bccd722ac9e4$export$788756b42446dc2d = ({ init_with_placeholder: init_with_placeholder, ...options })=>{
|
|
8621
8612
|
if (!$a312bccd722ac9e4$var$inserted) {
|
|
8622
8613
|
// Insert styling on first import
|
|
8623
|
-
(0, $e4bebbfa0f0b1454$export$59ba1eb2c083f0cd)((0, (/*@__PURE__*/$parcel$interopDefault($
|
|
8614
|
+
(0, $e4bebbfa0f0b1454$export$59ba1eb2c083f0cd)((0, (/*@__PURE__*/$parcel$interopDefault($bdb3d8c0ba0e9ccc$exports))));
|
|
8624
8615
|
$a312bccd722ac9e4$var$inserted = true;
|
|
8625
8616
|
}
|
|
8626
8617
|
const img = process.env.BUILD_TARGET === "modern" || process.env.BUILD_TARGET === "dev" ? $a312bccd722ac9e4$var$Image(options) : $a312bccd722ac9e4$var$CompatibleImage(options);
|
|
@@ -8628,7 +8619,7 @@ const $a312bccd722ac9e4$export$788756b42446dc2d = ({ init_with_placeholder: init
|
|
|
8628
8619
|
img.querySelectorAll("img").forEach((i)=>i.src = (0, $fac9c96b6bbe43cd$export$a4eccf92efefa04d)(10000 * options.aspect_ratio, 10000));
|
|
8629
8620
|
return img;
|
|
8630
8621
|
};
|
|
8631
|
-
function $a312bccd722ac9e4$var$Image({ aspect_ratio: aspect_ratio
|
|
8622
|
+
function $a312bccd722ac9e4$var$Image({ aspect_ratio: aspect_ratio, alt: alt, remove_on_error: remove_on_error, rendering_options: rendering_options, srcset_opts: srcset_opts, init_with_placeholder: _, ...image_options }) {
|
|
8632
8623
|
const div = (0, $107a74aa4ea5902d$export$34b9dba7ce09269b)("div", {
|
|
8633
8624
|
style: `position:relative;width:100%;padding-bottom:${1 / aspect_ratio * 100}%`
|
|
8634
8625
|
});
|
|
@@ -8649,7 +8640,7 @@ function $a312bccd722ac9e4$var$Image({ aspect_ratio: aspect_ratio , alt: alt , r
|
|
|
8649
8640
|
}));
|
|
8650
8641
|
return div;
|
|
8651
8642
|
}
|
|
8652
|
-
function $a312bccd722ac9e4$var$CompatibleImage({ aspect_ratio: aspect_ratio
|
|
8643
|
+
function $a312bccd722ac9e4$var$CompatibleImage({ aspect_ratio: aspect_ratio, alt: alt, remove_on_error: remove_on_error, rendering_options: rendering_options, srcset_opts: srcset_opts, ...image_options }) {
|
|
8653
8644
|
const canvas = (0, $107a74aa4ea5902d$export$34b9dba7ce09269b)("canvas", {
|
|
8654
8645
|
class: "depict-img-filler",
|
|
8655
8646
|
width: 3000 * aspect_ratio,
|
|
@@ -8696,9 +8687,8 @@ function $a312bccd722ac9e4$var$srcset_comp_from_map_or_new(rendering_options, sr
|
|
|
8696
8687
|
}
|
|
8697
8688
|
|
|
8698
8689
|
|
|
8699
|
-
var $
|
|
8700
|
-
$
|
|
8701
|
-
|
|
8690
|
+
var $a5803966f4ce1570$exports = {};
|
|
8691
|
+
$a5803966f4ce1570$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";
|
|
8702
8692
|
|
|
8703
8693
|
|
|
8704
8694
|
|
|
@@ -8732,9 +8722,10 @@ function $a656daa2fa8c279a$var$register_element_for_touch_hover(el, navigation_m
|
|
|
8732
8722
|
function $a656daa2fa8c279a$var$start_checking_for_touch_hover() {
|
|
8733
8723
|
const currently_hovering = new Map();
|
|
8734
8724
|
const handle_touch_start = (0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)((evt)=>{
|
|
8735
|
-
const touch = evt
|
|
8725
|
+
const touch = evt?.changedTouches?.[0];
|
|
8726
|
+
if (!touch) return; // Eytys dispatches fake touch events without changedTouches
|
|
8736
8727
|
const id = touch.identifier;
|
|
8737
|
-
const { clientX: clientX
|
|
8728
|
+
const { clientX: clientX, clientY: clientY } = touch;
|
|
8738
8729
|
const hover_element = get_hover_element_from_coords(clientX, clientY);
|
|
8739
8730
|
if (hover_element && $a656daa2fa8c279a$var$touch_hover_elements.has(hover_element)) {
|
|
8740
8731
|
hover_element.classList.add($a656daa2fa8c279a$var$HOVER_CLASS);
|
|
@@ -8751,7 +8742,9 @@ function $a656daa2fa8c279a$var$start_checking_for_touch_hover() {
|
|
|
8751
8742
|
});
|
|
8752
8743
|
let last_collision_check = +new Date();
|
|
8753
8744
|
const handle_touch_move = (0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)((evt)=>{
|
|
8754
|
-
const
|
|
8745
|
+
const first_touch = evt?.changedTouches?.[0];
|
|
8746
|
+
if (!first_touch) return;
|
|
8747
|
+
const { identifier: identifier, clientY: clientY, clientX: clientX } = first_touch;
|
|
8755
8748
|
const our_touch_data = currently_hovering.get(identifier);
|
|
8756
8749
|
if (!our_touch_data) return;
|
|
8757
8750
|
if (+new Date() - last_collision_check > $a656daa2fa8c279a$var$MAX_COLLISION_DETECTION_RATE) {
|
|
@@ -8761,7 +8754,8 @@ function $a656daa2fa8c279a$var$start_checking_for_touch_hover() {
|
|
|
8761
8754
|
}
|
|
8762
8755
|
});
|
|
8763
8756
|
const handle_touch_cancel = (0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)((evt)=>{
|
|
8764
|
-
const touch = evt
|
|
8757
|
+
const touch = evt?.changedTouches?.[0];
|
|
8758
|
+
if (!touch) return;
|
|
8765
8759
|
const id = touch.identifier;
|
|
8766
8760
|
const info = currently_hovering.get(id);
|
|
8767
8761
|
if (info) clear_hover(id, info, touch.clientX, touch.clientY);
|
|
@@ -8772,7 +8766,7 @@ function $a656daa2fa8c279a$var$start_checking_for_touch_hover() {
|
|
|
8772
8766
|
return hover_element && $a656daa2fa8c279a$var$touch_hover_elements.has(hover_element) ? hover_element : null;
|
|
8773
8767
|
};
|
|
8774
8768
|
const clear_hover = (0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)((id, info_about_touch, now_x, now_y)=>{
|
|
8775
|
-
const { element_: element_
|
|
8769
|
+
const { element_: element_, start_y_: start_y_, start_x_: start_x_, start_time_: start_time_ } = info_about_touch;
|
|
8776
8770
|
const info = $a656daa2fa8c279a$var$touch_hover_elements.get(element_);
|
|
8777
8771
|
const now = +new Date();
|
|
8778
8772
|
remove_hover_class: {
|
|
@@ -8802,9 +8796,9 @@ function $a656daa2fa8c279a$var$start_checking_for_touch_hover() {
|
|
|
8802
8796
|
window.addEventListener($a656daa2fa8c279a$var$TOUCHCANCEL, handle_touch_cancel);
|
|
8803
8797
|
}
|
|
8804
8798
|
let $a656daa2fa8c279a$var$styling_inserted = false;
|
|
8805
|
-
const $a656daa2fa8c279a$export$2369f6fc1c911576 = ({ second_src: second_src
|
|
8799
|
+
const $a656daa2fa8c279a$export$2369f6fc1c911576 = ({ second_src: second_src, second_srcset: second_srcset, second_srcset_opts: second_srcset_opts, fade_length_seconds: fade_length_seconds, mobile_touch_hover: mobile_touch_hover, navigation_minimum_ms: navigation_minimum_ms = 100, ...options })=>{
|
|
8806
8800
|
if (!$a656daa2fa8c279a$var$styling_inserted) {
|
|
8807
|
-
(0, $e4bebbfa0f0b1454$export$59ba1eb2c083f0cd)((0, (/*@__PURE__*/$parcel$interopDefault($
|
|
8801
|
+
(0, $e4bebbfa0f0b1454$export$59ba1eb2c083f0cd)((0, (/*@__PURE__*/$parcel$interopDefault($a5803966f4ce1570$exports))));
|
|
8808
8802
|
$a656daa2fa8c279a$var$styling_inserted = true;
|
|
8809
8803
|
}
|
|
8810
8804
|
const main_image = (0, $a312bccd722ac9e4$export$788756b42446dc2d)({
|
|
@@ -8832,7 +8826,7 @@ const $a656daa2fa8c279a$export$2369f6fc1c911576 = ({ second_src: second_src , se
|
|
|
8832
8826
|
});
|
|
8833
8827
|
if (no_second_img) return images_container;
|
|
8834
8828
|
const hover_element = images_container;
|
|
8835
|
-
const event_handler_mouse = ({ type: type
|
|
8829
|
+
const event_handler_mouse = ({ type: type })=>{
|
|
8836
8830
|
if (type == $a656daa2fa8c279a$var$MOUSEOVER) {
|
|
8837
8831
|
images_container.classList.add($a656daa2fa8c279a$var$HOVER_CLASS);
|
|
8838
8832
|
hover_element.addEventListener($a656daa2fa8c279a$var$MOUSELEAVE, event_handler_mouse, {
|
|
@@ -8923,6 +8917,11 @@ function $d73746ee466f09ca$export$98c2b3491e76c1f(R8bit, G8bit, B8bit) {
|
|
|
8923
8917
|
const L = 0.2126 * R + 0.7152 * G + 0.0722 * B;
|
|
8924
8918
|
return L;
|
|
8925
8919
|
}
|
|
8920
|
+
function $d73746ee466f09ca$export$ca305c142c6fc3cf(hex) {
|
|
8921
|
+
const rgb = hex.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, (m, r, g, b)=>"#" + r + r + g + g + b + b)?.substring(1)?.match(/.{2}/g)?.map((x)=>parseInt(x, 16));
|
|
8922
|
+
if (!(rgb?.length === 3 && rgb.every((x)=>typeof x === "number" && x >= 0 && x <= 255))) return null;
|
|
8923
|
+
return rgb;
|
|
8924
|
+
}
|
|
8926
8925
|
|
|
8927
8926
|
|
|
8928
8927
|
(0, $e4a18bf12ad092d9$export$2cefb7e61fcbae00)("utilishared", (0, $815f67c61b4c0a42$export$83d89fbfd8236492));
|