@depict-ai/utilishared 2.2.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ES10/index.cjs +774 -3236
- package/ES10/index.d.ts +340 -1116
- package/ES10/index.js +775 -3175
- package/latest/index.cjs +817 -3180
- package/latest/index.d.ts +340 -1116
- package/latest/index.js +818 -3119
- package/package.json +2 -2
- package/server/ES10/index.cjs +775 -3233
- package/server/ES10/index.d.ts +340 -1116
- package/server/ES10/index.js +776 -3172
- package/server/latest/index.cjs +818 -3177
- package/server/latest/index.d.ts +340 -1116
- package/server/latest/index.js +819 -3116
package/server/latest/index.cjs
CHANGED
|
@@ -1,20 +1,6 @@
|
|
|
1
1
|
var $jVDDb$solidjs = require("solid-js");
|
|
2
2
|
var $jVDDb$solidjsweb = require("solid-js/web");
|
|
3
3
|
require("../../multi_import_deduplicator.cjs").register_es_version("utilishared", "latest");
|
|
4
|
-
function $parcel$exportWildcard(dest, source) {
|
|
5
|
-
Object.keys(source).forEach(function (key) {
|
|
6
|
-
if (key === 'default' || key === '__esModule' || Object.prototype.hasOwnProperty.call(dest, key)) {
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
Object.defineProperty(dest, key, {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: function get() {
|
|
12
|
-
return source[key];
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
return dest;
|
|
17
|
-
}
|
|
18
4
|
function $parcel$export(e, n, v, s) {
|
|
19
5
|
Object.defineProperty(e, n, {
|
|
20
6
|
get: v,
|
|
@@ -37,21 +23,10 @@ $parcel$export(module.exports, "cache_args", () => $ee1d22bd1fcdd4e1$export$6e74
|
|
|
37
23
|
$parcel$export(module.exports, "check_displays", () => $eee5951374097b61$export$8582cf3716962dc2);
|
|
38
24
|
$parcel$export(module.exports, "err", () => $548fd58b14b25a52$export$8048b892d651b310);
|
|
39
25
|
$parcel$export(module.exports, "require_event_listener", () => $546052c2e3608435$export$16d7c76794a38a4);
|
|
40
|
-
$parcel$export(module.exports, "Auto_GWVM", () => $d1ef5fbddf08305d$export$41de2959a8dd405d);
|
|
41
|
-
$parcel$export(module.exports, "GWVM_Renderer", () => $e5479d0db39d328b$export$c83d8da642b5104a);
|
|
42
26
|
$parcel$export(module.exports, "infinite_promise_creator", () => $7198207999c01453$export$55621c1ce3cd536b);
|
|
43
27
|
$parcel$export(module.exports, "infinite_promise_no_skip", () => $04a37742898e4bd5$export$32ccf3a614c84258);
|
|
44
|
-
$parcel$export(module.exports, "infinite_renderer", () => $55dae85e9309db86$export$c0a4d29bc45a38c6);
|
|
45
|
-
$parcel$export(module.exports, "deprecated_insert_styling", () => $8686e45614d71607$export$9eae832ae57fbf);
|
|
46
28
|
$parcel$export(module.exports, "placeholder", () => $807b852d8decb547$export$c7187bbd1a7a9244);
|
|
47
|
-
$parcel$export(module.exports, "Pro_Slider", () => $3cb558cec98ba1a7$export$cab8bc58c64c2013);
|
|
48
|
-
$parcel$export(module.exports, "simplified_template_tool", () => $52d3be7ce5146924$export$2e2bcd8739ae039);
|
|
49
29
|
$parcel$export(module.exports, "insert_styling_into_slider", () => $e090b20cef3f0516$export$f1b8b9fd75ddcab1);
|
|
50
|
-
$parcel$export(module.exports, "RR_Slider", () => $7af744346f17bf99$export$cd12721587f4f16d);
|
|
51
|
-
$parcel$export(module.exports, "Depict", () => $0b6a8303b64cced1$export$1a8782481a9af507);
|
|
52
|
-
$parcel$export(module.exports, "get_recs_with_template", () => $66a2a93dfa520bc6$export$30933c637c977eef);
|
|
53
|
-
$parcel$export(module.exports, "default_post_processor", () => $66a2a93dfa520bc6$export$c410ce1205e5118a);
|
|
54
|
-
$parcel$export(module.exports, "default_pre_processor", () => $66a2a93dfa520bc6$export$4f39078bdc72ecd0);
|
|
55
30
|
$parcel$export(module.exports, "wpff", () => $c413c7798924612a$export$2e2bcd8739ae039);
|
|
56
31
|
$parcel$export(module.exports, "ElementObserver", () => $9043c64496e3375f$export$12e07a2a9f87578a);
|
|
57
32
|
$parcel$export(module.exports, "observer", () => $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149);
|
|
@@ -76,28 +51,11 @@ $parcel$export(module.exports, "test_array_proxy_support", () => $1da560af170fb8
|
|
|
76
51
|
$parcel$export(module.exports, "Amazing_Slider", () => $1683d0164abd7c1d$export$692b27c28639e5b9);
|
|
77
52
|
$parcel$export(module.exports, "colorize_elements", () => $f3f05d97149aec76$export$16501883f477737a);
|
|
78
53
|
$parcel$export(module.exports, "should_colorizeLogics", () => $f3f05d97149aec76$export$deca40f48c0569f8);
|
|
79
|
-
$parcel$export(module.exports, "default_rr", () => $92bde32714bb1e07$export$50ce83ace0cdd87e);
|
|
80
|
-
$parcel$export(module.exports, "fetch_recs", () => $94edfb6d9c42a288$export$1bc0df10745d5412);
|
|
81
|
-
$parcel$export(module.exports, "fetch_recs_whole_response", () => $94edfb6d9c42a288$export$d40679eb4cf32f09);
|
|
82
|
-
$parcel$export(module.exports, "clone_deep", () => $558ccd2de887e6d9$export$c42139a43c877ecd);
|
|
83
|
-
$parcel$export(module.exports, "regex_templating", () => $558ccd2de887e6d9$export$e0009e7da572f99b);
|
|
84
|
-
$parcel$export(module.exports, "Rec_Renderer", () => $558ccd2de887e6d9$export$a9fc160c5ed83bd7);
|
|
85
54
|
$parcel$export(module.exports, "n_col_styling_with_dist", () => $1cc2444a0f1b992e$export$17c3166a7ebd4688);
|
|
86
55
|
$parcel$export(module.exports, "Layout", () => $1cc2444a0f1b992e$export$c84671f46d6a1ca);
|
|
87
56
|
$parcel$export(module.exports, "layout_get_visible_recs_without_partial_rows", () => $1cc2444a0f1b992e$export$483bdd1f1186de13);
|
|
88
57
|
$parcel$export(module.exports, "layout_get_total_rec_amount_for_row", () => $1cc2444a0f1b992e$export$3dc5e2383c924ebf);
|
|
89
58
|
$parcel$export(module.exports, "layout_media_query_header", () => $1cc2444a0f1b992e$export$717f13d9ba00ca19);
|
|
90
|
-
$parcel$export(module.exports, "RecommendationGrid", () => $a7315720bf2a1638$export$b0a773486c1c2312);
|
|
91
|
-
$parcel$export(module.exports, "RecommendationSlider", () => $79804e8d76404ae4$export$82cfdc85a4d15688);
|
|
92
|
-
$parcel$export(module.exports, "default_click_tracking", () => $04d2f7d9126af667$export$6830ae1fbe21e589);
|
|
93
|
-
$parcel$export(module.exports, "default_view_tracking", () => $04d2f7d9126af667$export$f37c58ab3d3e3b75);
|
|
94
|
-
$parcel$export(module.exports, "ga_click", () => $04d2f7d9126af667$export$dd32cb565eae0a1f);
|
|
95
|
-
$parcel$export(module.exports, "gtag_click_post_processor", () => $04d2f7d9126af667$export$8d72437623fef90c);
|
|
96
|
-
$parcel$export(module.exports, "gtag_view_post_processor", () => $04d2f7d9126af667$export$1bffac19f9f0d6fc);
|
|
97
|
-
$parcel$export(module.exports, "depict_click_tracking_post_processor", () => $04d2f7d9126af667$export$e9106d6e723510d2);
|
|
98
|
-
$parcel$export(module.exports, "recs_inserted_tracking", () => $04d2f7d9126af667$export$fb9afe9f540ae069);
|
|
99
|
-
$parcel$export(module.exports, "add_to_localstorage", () => $04d2f7d9126af667$export$32eb5dd18e963410);
|
|
100
|
-
$parcel$export(module.exports, "depict_page_view", () => $04d2f7d9126af667$export$9e1caada6901f552);
|
|
101
59
|
$parcel$export(module.exports, "slider_autoscroll_factory", () => $535c6ee2337e2717$export$8cbd8aa1c70f9a13);
|
|
102
60
|
$parcel$export(module.exports, "make_button1", () => $a8a0385b88626561$export$80039a49055269fb);
|
|
103
61
|
$parcel$export(module.exports, "make_button2", () => $edc9fe0b09e00df6$export$af88b4929c2dc86);
|
|
@@ -111,12 +69,9 @@ $parcel$export(module.exports, "slider_snap_css", () => $6af20338fcad1911$export
|
|
|
111
69
|
$parcel$export(module.exports, "can_use_snapping_and_still_scroll", () => $6af20338fcad1911$export$49b950309ab787ad);
|
|
112
70
|
$parcel$export(module.exports, "slider_snapping_factory", () => $379066823f8eeb0b$export$dac64fd35a4805a4);
|
|
113
71
|
$parcel$export(module.exports, "Amazing_Lazy_Slider", () => $a69a5236b5814082$export$68babfc5be0de5da);
|
|
114
|
-
$parcel$export(module.exports, "slider_wraparound_factory", () => $3d8df0a23b9bebac$export$53306504b987cbf7);
|
|
115
72
|
$parcel$export(module.exports, "sizes_to_surface", () => $bf76a92ec2055e1a$export$419f84efad7d9fe);
|
|
116
73
|
$parcel$export(module.exports, "surface_mixer", () => $bf76a92ec2055e1a$export$417ef0ab13d8b984);
|
|
117
74
|
$parcel$export(module.exports, "promise_until_next_navigation", () => $bf76a92ec2055e1a$export$be95cb0e8cfd099e);
|
|
118
|
-
$parcel$export(module.exports, "AIO", () => $fbb09973782881cb$export$29a6094e0bd8bc5f);
|
|
119
|
-
$parcel$export(module.exports, "paint_red", () => $fbb09973782881cb$export$6ebd242c09192cec);
|
|
120
75
|
$parcel$export(module.exports, "bind_to_a2c_button", () => $c8263a2185830bf1$export$2c34560c3749dc63);
|
|
121
76
|
$parcel$export(module.exports, "bind_tracking_to_link", () => $c8263a2185830bf1$export$82a685f2da2fb027);
|
|
122
77
|
$parcel$export(module.exports, "depict_click", () => $e0a87646d12cb987$export$15f8a0cd5a8c0ebb);
|
|
@@ -133,15 +88,6 @@ $parcel$export(module.exports, "send_depict_unfiltered", () => $0c84f8e99aac5765
|
|
|
133
88
|
$parcel$export(module.exports, "send_websocket", () => $0c84f8e99aac5765$export$aa26019042811d4f);
|
|
134
89
|
$parcel$export(module.exports, "create_ga_queue", () => $c18ce8dadd041cdd$export$674d8cd8b6868154);
|
|
135
90
|
$parcel$export(module.exports, "make_tracker_send_to_depict", () => $c18ce8dadd041cdd$export$edfedd0557ca5a2d);
|
|
136
|
-
$parcel$export(module.exports, "ga_to_transaction_api", () => $5a44db2d2c8361b9$export$1ff14fec60ed5697);
|
|
137
|
-
$parcel$export(module.exports, "send_ga", () => $d3d8549954e0318e$export$f75172d2e289cd02);
|
|
138
|
-
$parcel$export(module.exports, "setup_ga", () => $d3d8549954e0318e$export$ac7296527cb52311);
|
|
139
|
-
$parcel$export(module.exports, "setup_gtag", () => $d3d8549954e0318e$export$d031e55ccd4c52dc);
|
|
140
|
-
$parcel$export(module.exports, "gtag_click", () => $d3d8549954e0318e$export$f522672c9379e339);
|
|
141
|
-
$parcel$export(module.exports, "ga_purchase_click", () => $d3d8549954e0318e$export$bf205937e5e012cb);
|
|
142
|
-
$parcel$export(module.exports, "ga_rec_click", () => $d3d8549954e0318e$export$127751e82111fcf);
|
|
143
|
-
$parcel$export(module.exports, "gtag_view", () => $d3d8549954e0318e$export$7babcd5d4056b2ca);
|
|
144
|
-
$parcel$export(module.exports, "load_gtag", () => $d3d8549954e0318e$export$f3354ec2ce95ebd9);
|
|
145
91
|
$parcel$export(module.exports, "send_impression_event", () => $dd025eb6f77f8f8b$export$4205dc6835bc0d9f);
|
|
146
92
|
$parcel$export(module.exports, "impression_track_element", () => $8e19f8200d357fe7$export$37125ccc5dd98050);
|
|
147
93
|
$parcel$export(module.exports, "impression_tracking_post_processor", () => $11ff7b46c1fb674c$export$d0efd8ed14f5c33);
|
|
@@ -151,15 +97,6 @@ $parcel$export(module.exports, "has_to_be_intersecting_for", () => $dd025eb6f77f
|
|
|
151
97
|
$parcel$export(module.exports, "add_new_tab_listener", () => $44909e19109bf973$export$58c56fe2313fdbe3);
|
|
152
98
|
$parcel$export(module.exports, "broadcast_product_id", () => $44909e19109bf973$export$836f70a28c317905);
|
|
153
99
|
$parcel$export(module.exports, "contextmenu_callback", () => $44909e19109bf973$export$8f66c4c7fb96eda2);
|
|
154
|
-
$parcel$export(module.exports, "optanon_get_cookie_ipns", () => $2026711c6c2d6204$export$7e4427e80d5fc619);
|
|
155
|
-
$parcel$export(module.exports, "init_optanon_tracking", () => $2026711c6c2d6204$export$f0f6c846d96fdbec);
|
|
156
|
-
$parcel$export(module.exports, "optanon_get_consent", () => $2026711c6c2d6204$export$1dd9ce50e201eff1);
|
|
157
|
-
$parcel$export(module.exports, "optanon_wait_for_consent", () => $2026711c6c2d6204$export$7a6d436e0782c6ed);
|
|
158
|
-
$parcel$export(module.exports, "send_transaction_id_to_depict", () => $0c9d834f187cc4ff$export$1ac466d53a6636ac);
|
|
159
|
-
$parcel$export(module.exports, "datalayer_interceptor", () => $0c9d834f187cc4ff$export$9ed4fbc47d558f94);
|
|
160
|
-
$parcel$export(module.exports, "datalayer_transaction_id_extractor", () => $0c9d834f187cc4ff$export$b11248fa13a8a86c);
|
|
161
|
-
$parcel$export(module.exports, "orderpage_transaction_id_extractor", () => $0c9d834f187cc4ff$export$3ebd86018b39d9d2);
|
|
162
|
-
$parcel$export(module.exports, "url_transaction_id_extractor", () => $0c9d834f187cc4ff$export$ff8673d5dea82bd4);
|
|
163
100
|
$parcel$export(module.exports, "send_page_view_if_needed", () => $72ee205b59322497$export$eee4c4d924348b05);
|
|
164
101
|
$parcel$export(module.exports, "send_page_view_on_navigation", () => $72ee205b59322497$export$f7cb1bd47199ec38);
|
|
165
102
|
$parcel$export(module.exports, "DepictAPIWS", () => $d10801050840d92b$export$1d9c6fddbff3441f);
|
|
@@ -187,7 +124,6 @@ $parcel$export(module.exports, "intercept", () => $23d6393391c08860$export$ab0f8
|
|
|
187
124
|
$parcel$export(module.exports, "fetch_replacer", () => $7ccebf01cfe4f824$export$85be83e1935d93c2);
|
|
188
125
|
$parcel$export(module.exports, "FakeResponse", () => $7ccebf01cfe4f824$export$f8da66bc4f1d059e);
|
|
189
126
|
$parcel$export(module.exports, "fetch_retry", () => $d2fc3fb450961938$export$bcd70d5ed1cf6313);
|
|
190
|
-
$parcel$export(module.exports, "get_optimize_variant", () => $40f3ad8d5c440ce9$export$b404e20f3c4a490e);
|
|
191
127
|
$parcel$export(module.exports, "stateless_href_change_ipns", () => $69f7524c8bdd85b4$export$20e9533e68ee72e7);
|
|
192
128
|
$parcel$export(module.exports, "href_change_ipns", () => $69f7524c8bdd85b4$export$a9d39e43ae273d26);
|
|
193
129
|
$parcel$export(module.exports, "history_replacer", () => $69f7524c8bdd85b4$export$baccefee4a395d8f);
|
|
@@ -209,12 +145,8 @@ $parcel$export(module.exports, "insert_styling", () => $e4bebbfa0f0b1454$export$
|
|
|
209
145
|
$parcel$export(module.exports, "depict_init", () => $e4bebbfa0f0b1454$export$692b606677218a16);
|
|
210
146
|
$parcel$export(module.exports, "depict_init_with_market_logic", () => $e4bebbfa0f0b1454$export$328e81c44cddf3c0);
|
|
211
147
|
$parcel$export(module.exports, "normal_get_product_id", () => $e4bebbfa0f0b1454$export$a4f97b27a0592e6c);
|
|
212
|
-
$parcel$export(module.exports, "track_a2c", () => $e4bebbfa0f0b1454$export$a96c18473f2af463);
|
|
213
148
|
$parcel$export(module.exports, "javascript_media_query", () => $93c499898a1702c7$export$515c3ea4d599b05a);
|
|
214
149
|
$parcel$export(module.exports, "patched_querySelectorAll", () => $7599647868f98022$export$33f937d741e49339);
|
|
215
|
-
$parcel$export(module.exports, "placeholder_svg", () => $fac9c96b6bbe43cd$export$a4eccf92efefa04d);
|
|
216
|
-
$parcel$export(module.exports, "make_placeholder_rr", () => $fac9c96b6bbe43cd$export$2dd69958012e3e49);
|
|
217
|
-
$parcel$export(module.exports, "random_text_placeholder", () => $fac9c96b6bbe43cd$export$3b75288f46cadd96);
|
|
218
150
|
$parcel$export(module.exports, "Promise_Any", () => $2fafbbbf345dcde0$export$947a20746936143d);
|
|
219
151
|
$parcel$export(module.exports, "queueMacroTask", () => $13a446968e3581c0$export$c50e1901e8ed0615);
|
|
220
152
|
$parcel$export(module.exports, "rand", () => $3f34dc07544c5857$export$bb0a9c36cf454ea0);
|
|
@@ -232,7 +164,6 @@ $parcel$export(module.exports, "serialize_object", () => $45e05ec4fd7f1ee7$expor
|
|
|
232
164
|
$parcel$export(module.exports, "sort_obj", () => $24daf6f6e6529b9f$export$12b4c6cbc6b8b4e4);
|
|
233
165
|
$parcel$export(module.exports, "standard_get_market", () => $02a3425594231893$export$a422d714c8cb1a5d);
|
|
234
166
|
$parcel$export(module.exports, "listenToLocalStorage", () => $05802e6cb0fdbdcd$export$3427ec8268623f1);
|
|
235
|
-
$parcel$export(module.exports, "Tenant", () => $16f3a26cfac77a4c$export$8d42ce4827f43582);
|
|
236
167
|
$parcel$export(module.exports, "timeout_promise", () => $9ed7c4b0fbf9ccd8$export$cd1adfb8059b5fcd);
|
|
237
168
|
$parcel$export(module.exports, "variable_setter_to_ipns", () => $e6d67ef355abb2dc$export$79f910a98828378d);
|
|
238
169
|
$parcel$export(module.exports, "find_descriptor", () => $e6d67ef355abb2dc$export$d5062f468a0454f3);
|
|
@@ -273,7 +204,7 @@ $parcel$export(module.exports, "version", () => $815f67c61b4c0a42$export$83d89fb
|
|
|
273
204
|
$parcel$export(module.exports, "add_to_version_info", () => $e4a18bf12ad092d9$export$2cefb7e61fcbae00);
|
|
274
205
|
$parcel$export(module.exports, "sync_el_content_with_accessor", () => $35303d72263038db$export$c3f56a35e076f139);
|
|
275
206
|
$parcel$export(module.exports, "use_href_accessor", () => $da35c7e27be2a442$export$e35115e6d0715f77);
|
|
276
|
-
const $815f67c61b4c0a42$export$83d89fbfd8236492 = "2.
|
|
207
|
+
const $815f67c61b4c0a42$export$83d89fbfd8236492 = "2.3.1";
|
|
277
208
|
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"))();
|
|
278
209
|
const $e6c6e7929ea385ae$var$browser_prefix_styling = "color: #fff;";
|
|
279
210
|
let $e6c6e7929ea385ae$var$browser_prefix = "[Depict]";
|
|
@@ -1394,39 +1325,85 @@ function $546052c2e3608435$export$16d7c76794a38a4(element, event, track_id, func
|
|
|
1394
1325
|
}
|
|
1395
1326
|
}
|
|
1396
1327
|
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
function $
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1328
|
+
/**
|
|
1329
|
+
* @deprecated use async_iterable_ipns instead. This can skip values which yields unexpected results.
|
|
1330
|
+
*/
|
|
1331
|
+
function $7198207999c01453$export$55621c1ce3cd536b() {
|
|
1332
|
+
// the idea is to have a new promise available immediately before one resolves, so to say an infinite promise
|
|
1333
|
+
let internal_resolve; // copy and pasted from iconbeauty
|
|
1334
|
+
const cart_promise_object = {
|
|
1335
|
+
// I feel like Anton is not going to like this extremely awesome approach
|
|
1336
|
+
promise: new Promise(r => internal_resolve = r),
|
|
1337
|
+
// which is why I'm reluctant with making it a library
|
|
1338
|
+
internal_resolve: internal_resolve,
|
|
1339
|
+
// Edit from later on: I have realised that this is actually very useful, it just has a steep learning curve.
|
|
1340
|
+
resolve: argument => {
|
|
1341
|
+
// it allows both not having to call functions in a loop and instead just awaiting the promise from multiple places
|
|
1342
|
+
const oldresolve = cart_promise_object.internal_resolve; // and to effortlessly ensure a process is never running twice with 100% reliability
|
|
1343
|
+
cart_promise_object.promise = new Promise(r => cart_promise_object.internal_resolve = r); // it could be made a class, but I already know this works, so I'll leave it as is
|
|
1344
|
+
oldresolve(argument);
|
|
1345
|
+
}
|
|
1346
|
+
};
|
|
1347
|
+
return cart_promise_object;
|
|
1416
1348
|
}
|
|
1417
|
-
function $
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1349
|
+
function $807b852d8decb547$export$c7187bbd1a7a9244(...args) {
|
|
1350
|
+
$807b852d8decb547$var$placeholder_worker(...args).catch((0, $548fd58b14b25a52$export$8048b892d651b310));
|
|
1351
|
+
return args[0];
|
|
1352
|
+
}
|
|
1353
|
+
async function $807b852d8decb547$var$placeholder_worker(placeholder_elements, final_elements, switching_trigger) {
|
|
1354
|
+
let state = false;
|
|
1355
|
+
let has_sanitized_elements = false;
|
|
1356
|
+
const sanit_el_if_needed = async () => {
|
|
1357
|
+
if (!has_sanitized_elements) {
|
|
1358
|
+
has_sanitized_elements = true;
|
|
1359
|
+
placeholder_elements = await $807b852d8decb547$var$convert_to_node_array(placeholder_elements);
|
|
1360
|
+
final_elements = await $807b852d8decb547$var$convert_to_node_array(final_elements);
|
|
1361
|
+
}
|
|
1362
|
+
};
|
|
1363
|
+
if (switching_trigger instanceof (0, $04a37742898e4bd5$export$32ccf3a614c84258)) while (true) {
|
|
1364
|
+
const new_state = await switching_trigger.promise;
|
|
1365
|
+
if (new_state != state) {
|
|
1366
|
+
await sanit_el_if_needed();
|
|
1367
|
+
await $807b852d8decb547$var$decide_direction_and_switch(placeholder_elements, final_elements, new_state);
|
|
1368
|
+
state = new_state;
|
|
1369
|
+
}
|
|
1370
|
+
} else if (switching_trigger instanceof Promise) {
|
|
1371
|
+
const new_state = await switching_trigger;
|
|
1372
|
+
if (state != new_state) {
|
|
1373
|
+
await sanit_el_if_needed();
|
|
1374
|
+
await $807b852d8decb547$var$decide_direction_and_switch(placeholder_elements, final_elements, new_state);
|
|
1375
|
+
state = new_state;
|
|
1376
|
+
}
|
|
1377
|
+
} else {
|
|
1378
|
+
await sanit_el_if_needed();
|
|
1379
|
+
placeholder_elements[0].addEventListener("placeholder_switch", $41f528c04cc8a8da$export$535946eb77c946dd(async e => {
|
|
1380
|
+
const new_state = e.detail.state;
|
|
1381
|
+
if (state != new_state) {
|
|
1382
|
+
await sanit_el_if_needed();
|
|
1383
|
+
await $807b852d8decb547$var$decide_direction_and_switch(placeholder_elements, final_elements, new_state);
|
|
1384
|
+
state = new_state;
|
|
1385
|
+
}
|
|
1386
|
+
}));
|
|
1428
1387
|
}
|
|
1429
1388
|
}
|
|
1389
|
+
async function $807b852d8decb547$var$convert_to_node_array(elements) {
|
|
1390
|
+
if (typeof elements == "function") elements = elements();
|
|
1391
|
+
elements = await elements;
|
|
1392
|
+
if (typeof elements[Symbol.iterator] != "function") elements = [elements];
|
|
1393
|
+
return elements;
|
|
1394
|
+
}
|
|
1395
|
+
async function $807b852d8decb547$var$decide_direction_and_switch(placeholder_elements, final_elements, switch_to_final) {
|
|
1396
|
+
if (switch_to_final) $807b852d8decb547$var$switch_elements(placeholder_elements, final_elements);else $807b852d8decb547$var$switch_elements(final_elements, placeholder_elements);
|
|
1397
|
+
}
|
|
1398
|
+
function $807b852d8decb547$var$switch_elements(from, to) {
|
|
1399
|
+
if (!from.length || !to.length) $e6c6e7929ea385ae$export$c2363754d4758444("Cannot switch elements as from or to is empty", from, to);
|
|
1400
|
+
from[0].replaceWith(...to);
|
|
1401
|
+
for (let i = 1; i < from.length; i++) from[i].remove();
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
// @ts-ignore
|
|
1405
|
+
var $1286e6ce2079bdeb$exports = {};
|
|
1406
|
+
$1286e6ce2079bdeb$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";
|
|
1430
1407
|
let $55595fc7bb226f61$var$has_queued_microtask = false;
|
|
1431
1408
|
const $55595fc7bb226f61$var$queued_callbacks = /*@__PURE__*/new Map();
|
|
1432
1409
|
const $55595fc7bb226f61$var$catchified_deduplicate_and_dispatch = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9($55595fc7bb226f61$var$deduplicate_and_dispatch, "error in observer event processing", "error");
|
|
@@ -1485,6 +1462,37 @@ class $e2f46d4f382caff1$export$ea60432919e69303 {
|
|
|
1485
1462
|
opts.event_ && (this.event = opts.event_);
|
|
1486
1463
|
}
|
|
1487
1464
|
}
|
|
1465
|
+
const $7599647868f98022$var$needs_patching = typeof window === "object" ? /*@__PURE__*/$7599647868f98022$var$check_if_querySelectorAll_needs_patching() : false;
|
|
1466
|
+
function $7599647868f98022$export$33f937d741e49339(element, selector) {
|
|
1467
|
+
if (!(element instanceof Element) || !$7599647868f98022$var$needs_patching || !selector.includes("#") || !selector.includes("+"))
|
|
1468
|
+
// covers most cases, we don't need patching or don't hit the bug
|
|
1469
|
+
return element?.querySelectorAll?.(selector);
|
|
1470
|
+
const result = [];
|
|
1471
|
+
const elements_to_check = [];
|
|
1472
|
+
// intentionally not recursive since it's possible to have deeper nested elements than max stack size
|
|
1473
|
+
for (let i = element.children.length; i--;) elements_to_check.push(element.children[i]);
|
|
1474
|
+
while (elements_to_check.length) {
|
|
1475
|
+
const child_element = elements_to_check.pop();
|
|
1476
|
+
if (child_element.matches(selector)) result.push(child_element);
|
|
1477
|
+
for (let i = child_element.children.length; i--;)
|
|
1478
|
+
// kudos to Karl for algorithm help
|
|
1479
|
+
elements_to_check.push(child_element.children[i]);
|
|
1480
|
+
}
|
|
1481
|
+
return result;
|
|
1482
|
+
}
|
|
1483
|
+
function $7599647868f98022$var$check_if_querySelectorAll_needs_patching() {
|
|
1484
|
+
const id_div = document.createElement("div");
|
|
1485
|
+
const element = document.createElement("section");
|
|
1486
|
+
const selector = "#a+*";
|
|
1487
|
+
id_div.id = "a";
|
|
1488
|
+
document.documentElement.append(id_div, element);
|
|
1489
|
+
try {
|
|
1490
|
+
return element === element.querySelectorAll(selector)[0];
|
|
1491
|
+
} finally {
|
|
1492
|
+
id_div.remove();
|
|
1493
|
+
element.remove();
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1488
1496
|
class $9043c64496e3375f$export$12e07a2a9f87578a {
|
|
1489
1497
|
#the_mutation_observer;
|
|
1490
1498
|
#observing = {};
|
|
@@ -1982,6 +1990,21 @@ function $2a1cbc63a04d4a2d$var$make_default_observer() {
|
|
|
1982
1990
|
$268cbd9e4ade92db$export$f18d5b0af29128b7([error, "error starting ElementObserver"], "error");
|
|
1983
1991
|
}
|
|
1984
1992
|
}
|
|
1993
|
+
|
|
1994
|
+
/**
|
|
1995
|
+
* Useful for the `thresholds` option of IntersectionObserver - if you want to be notified at a 10% change, call this and set num_steps to 10. Pls see https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/thresholds
|
|
1996
|
+
* @param numSteps How many steps (notifications) there should be between 0 and 100% intersection
|
|
1997
|
+
* @return Stuff to give to IntersectionObserver
|
|
1998
|
+
*/
|
|
1999
|
+
function $0da0cad4f39e8f32$export$f8ea2e7b15b5d129(numSteps) {
|
|
2000
|
+
const thresholds = [];
|
|
2001
|
+
for (let i = 1.0; i <= numSteps; i++) {
|
|
2002
|
+
const ratio = i / numSteps;
|
|
2003
|
+
thresholds.push(ratio);
|
|
2004
|
+
}
|
|
2005
|
+
thresholds.push(0);
|
|
2006
|
+
return thresholds;
|
|
2007
|
+
}
|
|
1985
2008
|
function $bf7f12fe044e41b2$export$925772df9b4d16e5(url, param, value) {
|
|
1986
2009
|
const url_object = new URL(url),
|
|
1987
2010
|
search_params = new URLSearchParams(url_object.search);
|
|
@@ -2078,1794 +2101,97 @@ function $bf7f12fe044e41b2$export$9590700a594aef08(obj, step1, ...path) {
|
|
|
2078
2101
|
if (typeof obj[step1] === "undefined") obj[step1] = {};
|
|
2079
2102
|
if (path.length) return $bf7f12fe044e41b2$export$9590700a594aef08(obj[step1], ...path);else return obj[step1];
|
|
2080
2103
|
}
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
}
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
if ($72ed530554068e4f$var$watched_elements.has(element)) {
|
|
2173
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("Not watching", element, "as it's already being watched");
|
|
2174
|
-
return () => {};
|
|
2175
|
-
}
|
|
2176
|
-
$72ed530554068e4f$var$intersection_observer?.observe(element);
|
|
2177
|
-
/** Calls the given callback and makes sure to stop watching the element */
|
|
2178
|
-
const wrapped_callback = element => {
|
|
2179
|
-
callback(element);
|
|
2180
|
-
$72ed530554068e4f$var$unwatch_element(element);
|
|
2181
|
-
};
|
|
2182
|
-
$72ed530554068e4f$var$watched_elements.set(element, wrapped_callback);
|
|
2183
|
-
const disconnect_observer = (0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onremoved(element, () => {
|
|
2184
|
-
// Sometimes it has already rapidly been reinserted. The observer events lag by one tick.
|
|
2185
|
-
// For that case, make sure we're really out of the DOM
|
|
2186
|
-
if (document.documentElement.contains(element)) return;
|
|
2187
|
-
$72ed530554068e4f$var$unwatch_element(element);
|
|
2188
|
-
});
|
|
2189
|
-
return () => {
|
|
2190
|
-
disconnect_observer();
|
|
2191
|
-
$72ed530554068e4f$var$unwatch_element(element);
|
|
2192
|
-
};
|
|
2193
|
-
};
|
|
2194
|
-
const $72ed530554068e4f$var$intersection_observer_callback = entries => {
|
|
2195
|
-
for (const record of entries) {
|
|
2196
|
-
const {
|
|
2197
|
-
target: target
|
|
2198
|
-
} = record;
|
|
2199
|
-
const callback = $72ed530554068e4f$var$watched_elements.get(target);
|
|
2200
|
-
// Skip the element if it's no longer being watched.
|
|
2201
|
-
if (!callback) {
|
|
2202
|
-
$72ed530554068e4f$var$intersection_observer?.unobserve(target);
|
|
2203
|
-
continue;
|
|
2204
|
-
}
|
|
2205
|
-
const currently_intersecting = $72ed530554068e4f$var$current_intersections.has(target);
|
|
2206
|
-
if (!currently_intersecting && record.intersectionRatio >= (0, $dd025eb6f77f8f8b$export$135da44d0ba958bc)[0]) {
|
|
2207
|
-
// we're intersecting enough and not already in the process of "measuring"
|
|
2208
|
-
const started_intersecting_at_ = +new Date(); // save start time
|
|
2209
|
-
// Schedule the callback function to be called after the element has been intersecting for the required duration
|
|
2210
|
-
const callback_timeout_ = setTimeout(callback, (0, $dd025eb6f77f8f8b$export$ca8321ea61dc2544), target);
|
|
2211
|
-
$72ed530554068e4f$var$current_intersections.set(target, {
|
|
2212
|
-
started_intersecting_at_: started_intersecting_at_,
|
|
2213
|
-
callback_timeout_: callback_timeout_
|
|
2214
|
-
});
|
|
2215
|
-
} else if (currently_intersecting && record.intersectionRatio < (0, $dd025eb6f77f8f8b$export$135da44d0ba958bc)[1]) {
|
|
2216
|
-
// we are in the process of "measuring" and went below the threshold
|
|
2217
|
-
const {
|
|
2218
|
-
started_intersecting_at_: started_intersecting_at_,
|
|
2219
|
-
callback_timeout_: callback_timeout_
|
|
2220
|
-
} = $72ed530554068e4f$var$current_intersections.get(target);
|
|
2221
|
-
const time_elapsed = +new Date() - started_intersecting_at_;
|
|
2222
|
-
// If we stopped intersecting too early we want to abort our timeout.
|
|
2223
|
-
// if we did not we also want to abort the timeout since it's been lagging and just instantly send the event
|
|
2224
|
-
// (the browser can delay setTimeout timers)
|
|
2225
|
-
clearTimeout(callback_timeout_);
|
|
2226
|
-
if (time_elapsed <= (0, $dd025eb6f77f8f8b$export$ca8321ea61dc2544)) $72ed530554068e4f$var$current_intersections.delete(target);else {
|
|
2227
|
-
// we intersected long enough
|
|
2228
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("intersection_observer: setTimeout lagged", time_elapsed, (0, $dd025eb6f77f8f8b$export$ca8321ea61dc2544), "ms", target);
|
|
2229
|
-
callback(target);
|
|
2230
|
-
}
|
|
2231
|
-
}
|
|
2232
|
-
}
|
|
2233
|
-
};
|
|
2234
|
-
/**
|
|
2235
|
-
* Global IntersectionObserver used for all impression tracking.
|
|
2236
|
-
* It's faster to use one observer for all elements than to create a new one for each element.
|
|
2237
|
-
*/
|
|
2238
|
-
const $72ed530554068e4f$var$intersection_observer = typeof window === "object" ? /*@__PURE__*/new IntersectionObserver( /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9($72ed530554068e4f$var$intersection_observer_callback), {
|
|
2239
|
-
threshold: /*@__PURE__*/$0da0cad4f39e8f32$export$f8ea2e7b15b5d129(8)
|
|
2240
|
-
}) : undefined;
|
|
2241
|
-
const $11ff7b46c1fb674c$export$d0efd8ed14f5c33 = (items, display, info) => {
|
|
2242
|
-
if (!items?.length) return items;
|
|
2243
|
-
const node_array = Array.isArray(items) ? items : [...items]; // if it's a NodeList convert it to an array
|
|
2244
|
-
const first_watchable_el = node_array.find(el => el instanceof Element);
|
|
2245
|
-
if (!first_watchable_el) {
|
|
2246
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("Impression tracking: Can't observe", items, display);
|
|
2247
|
-
return items;
|
|
2248
|
-
}
|
|
2249
|
-
if (!info.t) {
|
|
2250
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("Impression tracking: No tenant instance, can't track", items, display);
|
|
2251
|
-
return items;
|
|
2252
|
-
}
|
|
2253
|
-
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onexists(first_watchable_el, ({
|
|
2254
|
-
element: element
|
|
2255
|
-
}) => {
|
|
2256
|
-
$72ed530554068e4f$export$4c51576248bcdf31(element, () => {
|
|
2257
|
-
const {
|
|
2258
|
-
recommendation_id: recommendation_id,
|
|
2259
|
-
search_result_id: search_result_id,
|
|
2260
|
-
product_listing_result_id: product_listing_result_id,
|
|
2261
|
-
suggestions_result_id: suggestions_result_id
|
|
2262
|
-
} = display;
|
|
2263
|
-
$dd025eb6f77f8f8b$export$4205dc6835bc0d9f({
|
|
2264
|
-
...$e0a87646d12cb987$export$8c6f26a5b6921b95(),
|
|
2265
|
-
recommendation_type: info.rendering_options.type,
|
|
2266
|
-
entity_price: display.sale_price,
|
|
2267
|
-
market: info.t.market,
|
|
2268
|
-
tenant: info.t.tenant,
|
|
2269
|
-
product_id: display.product_id,
|
|
2270
|
-
recommendation_id: recommendation_id,
|
|
2271
|
-
search_result_id: search_result_id,
|
|
2272
|
-
product_listing_result_id: product_listing_result_id,
|
|
2273
|
-
suggestions_result_id: suggestions_result_id
|
|
2274
|
-
});
|
|
2275
|
-
});
|
|
2276
|
-
});
|
|
2277
|
-
return items;
|
|
2278
|
-
};
|
|
2279
|
-
const $8e19f8200d357fe7$export$37125ccc5dd98050 = ({
|
|
2280
|
-
element: element,
|
|
2281
|
-
data: data,
|
|
2282
|
-
wait_for_dom_insertion = true
|
|
2283
|
-
}) => {
|
|
2284
|
-
const disconnectors = [];
|
|
2285
|
-
const impression_track = () => {
|
|
2286
|
-
const disconnector = $72ed530554068e4f$export$4c51576248bcdf31(element, () => {
|
|
2287
|
-
$dd025eb6f77f8f8b$export$4205dc6835bc0d9f({
|
|
2288
|
-
...$e0a87646d12cb987$export$8c6f26a5b6921b95(),
|
|
2289
|
-
...data
|
|
2290
|
-
});
|
|
2291
|
-
});
|
|
2292
|
-
disconnectors.push(disconnector);
|
|
2293
|
-
};
|
|
2294
|
-
if (wait_for_dom_insertion) disconnectors.push((0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onexists(element, impression_track));else impression_track();
|
|
2295
|
-
return () => disconnectors.forEach(disconnector => disconnector());
|
|
2296
|
-
};
|
|
2297
|
-
let $dd025eb6f77f8f8b$export$135da44d0ba958bc = [0.6, 0.5];
|
|
2298
|
-
const $dd025eb6f77f8f8b$export$c543ee4cdb0d0964 = (start, end) => $dd025eb6f77f8f8b$export$135da44d0ba958bc = [start, end];
|
|
2299
|
-
const $dd025eb6f77f8f8b$export$ca8321ea61dc2544 = 500;
|
|
2300
|
-
const $dd025eb6f77f8f8b$export$4205dc6835bc0d9f = data => {
|
|
2301
|
-
data.type = "element_visible"; // Set the type to element_visible as this is optional to pass here.
|
|
2302
|
-
$0c84f8e99aac5765$export$28cacbd9b4306ffc([data], true);
|
|
2303
|
-
};
|
|
2304
|
-
function $c8263a2185830bf1$export$82a685f2da2fb027(a_element, product_id, recommendation_id, additional_listener) {
|
|
2305
|
-
if (!a_element ||
|
|
2306
|
-
// @ts-ignore
|
|
2307
|
-
!a_element.depict_tracked ||
|
|
2308
|
-
// @ts-ignore
|
|
2309
|
-
a_element?.depict_tracked?.recommendation_id != recommendation_id ||
|
|
2310
|
-
// @ts-ignore
|
|
2311
|
-
a_element?.depict_tracked?.product_id != product_id) {
|
|
2312
|
-
const listener = e => {
|
|
2313
|
-
localStorage.setItem(`depict_attribution_${product_id}`, recommendation_id);
|
|
2314
|
-
if (additional_listener) additional_listener(e, product_id, recommendation_id);
|
|
2315
|
-
};
|
|
2316
|
-
// @ts-ignore
|
|
2317
|
-
if (a_element.depict_tracked)
|
|
2318
|
-
// @ts-ignore
|
|
2319
|
-
a_element.removeEventListener("click", a_element.depict_tracked?.listener);
|
|
2320
|
-
// @ts-ignore
|
|
2321
|
-
a_element.depict_tracked = {
|
|
2322
|
-
product_id: product_id,
|
|
2323
|
-
recommendation_id: recommendation_id,
|
|
2324
|
-
listener: listener
|
|
2325
|
-
};
|
|
2326
|
-
a_element.addEventListener("click", listener);
|
|
2327
|
-
return listener;
|
|
2328
|
-
}
|
|
2329
|
-
}
|
|
2330
|
-
async function $c8263a2185830bf1$export$2c34560c3749dc63(button, get_product_id, tracking_fn, unmatching_tracking, event) {
|
|
2331
|
-
// @ts-ignore
|
|
2332
|
-
if (!button || button.depict_tracked) return;
|
|
2333
|
-
button.addEventListener(event ? event : "click", $268cbd9e4ade92db$export$b3bbfd758f11cfa9(async e => {
|
|
2334
|
-
if (!e.isTrusted) {
|
|
2335
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("ignoring event", e, "because it's not user generated");
|
|
2336
|
-
return;
|
|
2337
|
-
}
|
|
2338
|
-
const product_id = await get_product_id(undefined, e);
|
|
2339
|
-
if (product_id) {
|
|
2340
|
-
const item_name = `depict_attribution_${product_id}`;
|
|
2341
|
-
const recommendation_id = localStorage.getItem(item_name);
|
|
2342
|
-
if (recommendation_id) {
|
|
2343
|
-
localStorage.removeItem(item_name);
|
|
2344
|
-
tracking_fn(product_id, recommendation_id, false, e);
|
|
2345
|
-
} else if (unmatching_tracking) tracking_fn(product_id, recommendation_id, true, e);
|
|
2346
|
-
}
|
|
2347
|
-
}));
|
|
2348
|
-
// @ts-ignore
|
|
2349
|
-
button.depict_tracked = true;
|
|
2350
|
-
}
|
|
2351
|
-
const $69f7524c8bdd85b4$export$20e9533e68ee72e7 = /*@__PURE__*/$9a42a570de51ea3d$export$e806c6c1615a59ae(false);
|
|
2352
|
-
const $69f7524c8bdd85b4$export$a9d39e43ae273d26 = /*@__PURE__*/$9a42a570de51ea3d$export$e806c6c1615a59ae();
|
|
2353
|
-
const $69f7524c8bdd85b4$export$7500cdfd37aafd43 = /*@__PURE__*/new Set();
|
|
2354
|
-
let $69f7524c8bdd85b4$var$old_url;
|
|
2355
|
-
const $69f7524c8bdd85b4$var$maybe_navigation = (what_happened, args) => {
|
|
2356
|
-
if (typeof location === "undefined") return;
|
|
2357
|
-
const new_url = location.href;
|
|
2358
|
-
if ($69f7524c8bdd85b4$var$old_url !== new_url) {
|
|
2359
|
-
$69f7524c8bdd85b4$export$a9d39e43ae273d26(new_url);
|
|
2360
|
-
if ($69f7524c8bdd85b4$var$old_url !== undefined)
|
|
2361
|
-
// don't resolve stateless href change ipns with the initial value - it's not a navigation
|
|
2362
|
-
$69f7524c8bdd85b4$export$20e9533e68ee72e7(new_url);
|
|
2363
|
-
$69f7524c8bdd85b4$var$old_url = new_url;
|
|
2364
|
-
}
|
|
2365
|
-
for (const fn of $69f7524c8bdd85b4$export$7500cdfd37aafd43) fn(what_happened, args);
|
|
2366
|
-
};
|
|
2367
|
-
$69f7524c8bdd85b4$export$baccefee4a395d8f((args, what_happened) => $69f7524c8bdd85b4$var$maybe_navigation(what_happened, args));
|
|
2368
|
-
$69f7524c8bdd85b4$var$maybe_navigation();
|
|
2369
|
-
globalThis?.window?.addEventListener("popstate", $268cbd9e4ade92db$export$b3bbfd758f11cfa9(e => $69f7524c8bdd85b4$var$maybe_navigation("popstate", e)));
|
|
2370
|
-
async function $69f7524c8bdd85b4$export$1cd22bab0d2c3b0b(callback) {
|
|
2371
|
-
const catchified_callback = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(callback);
|
|
2372
|
-
for await (const href of $69f7524c8bdd85b4$export$20e9533e68ee72e7) {
|
|
2373
|
-
catchified_callback(href);
|
|
2374
|
-
break;
|
|
2375
|
-
}
|
|
2376
|
-
}
|
|
2377
|
-
async function $69f7524c8bdd85b4$export$baccefee4a395d8f(after_navigation, replace_replaceState = true) {
|
|
2378
|
-
if (typeof History === "undefined") return;
|
|
2379
|
-
const {
|
|
2380
|
-
prototype: prototype
|
|
2381
|
-
} = History;
|
|
2382
|
-
const instance = history;
|
|
2383
|
-
const polyfill_dance = the_thing => {
|
|
2384
|
-
const proxy_the_thing = obj => {
|
|
2385
|
-
const orig_pushState = obj[the_thing];
|
|
2386
|
-
obj[the_thing] = new Proxy(orig_pushState, {
|
|
2387
|
-
apply: (target, this_arg, arguments_list) => {
|
|
2388
|
-
const nav_result = Reflect.apply(target, this_arg, arguments_list);
|
|
2389
|
-
try {
|
|
2390
|
-
after_navigation(arguments_list, the_thing);
|
|
2391
|
-
} catch (e) {
|
|
2392
|
-
$548fd58b14b25a52$export$8048b892d651b310(e);
|
|
2393
|
-
}
|
|
2394
|
-
return nav_result;
|
|
2395
|
-
}
|
|
2396
|
-
});
|
|
2397
|
-
};
|
|
2398
|
-
proxy_the_thing(prototype);
|
|
2399
|
-
if (Object.getOwnPropertyNames(instance).includes(the_thing))
|
|
2400
|
-
// we don't want to just change the instance because that's not the way to do it, but we don't want to not work because someone else did it wrong
|
|
2401
|
-
proxy_the_thing(instance);
|
|
2402
|
-
};
|
|
2403
|
-
polyfill_dance("pushState");
|
|
2404
|
-
if (replace_replaceState) polyfill_dance("replaceState");
|
|
2405
|
-
}
|
|
2406
|
-
let $72ee205b59322497$var$last_page_pageview_sent_for;
|
|
2407
|
-
async function $72ee205b59322497$export$eee4c4d924348b05(data) {
|
|
2408
|
-
// Send page view to depict if needed
|
|
2409
|
-
try {
|
|
2410
|
-
const {
|
|
2411
|
-
href: href
|
|
2412
|
-
} = location;
|
|
2413
|
-
if ($72ee205b59322497$var$last_page_pageview_sent_for !== href) {
|
|
2414
|
-
$72ee205b59322497$var$last_page_pageview_sent_for = href;
|
|
2415
|
-
$e0a87646d12cb987$export$82badda1f9923310({
|
|
2416
|
-
...data,
|
|
2417
|
-
type: "page_view"
|
|
2418
|
-
});
|
|
2419
|
-
if (data.product_id) await $44909e19109bf973$export$836f70a28c317905(data.product_id); // this takes care of right click click attribution - broadcasts the URL of the current page
|
|
2420
|
-
}
|
|
2421
|
-
} catch (error) {
|
|
2422
|
-
$268cbd9e4ade92db$export$f18d5b0af29128b7([error, "Sending page view failed"], "warning");
|
|
2423
|
-
}
|
|
2424
|
-
}
|
|
2425
|
-
let $72ee205b59322497$var$sending_on_navigation = false;
|
|
2426
|
-
async function $72ee205b59322497$export$f7cb1bd47199ec38(data) {
|
|
2427
|
-
if (!$72ee205b59322497$var$sending_on_navigation) {
|
|
2428
|
-
$72ee205b59322497$var$sending_on_navigation = true;
|
|
2429
|
-
$268cbd9e4ade92db$export$b3bbfd758f11cfa9(async () => {
|
|
2430
|
-
for await (const _href of (0, $69f7524c8bdd85b4$export$a9d39e43ae273d26)) $72ee205b59322497$export$eee4c4d924348b05({
|
|
2431
|
-
tenant: data.tenant,
|
|
2432
|
-
market: data.market,
|
|
2433
|
-
product_id: await data.get_product_id(_href)
|
|
2434
|
-
});
|
|
2435
|
-
})();
|
|
2436
|
-
}
|
|
2437
|
-
}
|
|
2438
|
-
function $c18ce8dadd041cdd$export$edfedd0557ca5a2d(ga_tracker, append_to_url) {
|
|
2439
|
-
if (!ga_tracker) return;
|
|
2440
|
-
// Docs for analytics.js Tasks:
|
|
2441
|
-
// https://developers.google.com/analytics/devguides/collection/analyticsjs/tasks
|
|
2442
|
-
const sendHitTask = "sendHitTask";
|
|
2443
|
-
const originalSendHitTask = ga_tracker.get(sendHitTask);
|
|
2444
|
-
ga_tracker.set(sendHitTask, model => {
|
|
2445
|
-
originalSendHitTask(model);
|
|
2446
|
-
// console.log('Sent original hit, now sending to depict');
|
|
2447
|
-
try {
|
|
2448
|
-
const payLoad = model.get("hitPayload");
|
|
2449
|
-
const path = (0, $4c6861fbcd3a0611$export$362abebb4b313340) + "/collect-ga";
|
|
2450
|
-
let url = path + "?" + payLoad;
|
|
2451
|
-
if (append_to_url) url += append_to_url;
|
|
2452
|
-
const n = navigator;
|
|
2453
|
-
const sb = "sendBeacon";
|
|
2454
|
-
if (n[sb])
|
|
2455
|
-
// this is actually smaller, I tested
|
|
2456
|
-
n[sb](url);else {
|
|
2457
|
-
const xhttp = new XMLHttpRequest();
|
|
2458
|
-
xhttp.open("GET", url);
|
|
2459
|
-
xhttp.send();
|
|
2460
|
-
}
|
|
2461
|
-
} catch (e) {
|
|
2462
|
-
// console.log('Could not send beacon to /collect-ga', e);
|
|
2463
|
-
}
|
|
2464
|
-
});
|
|
2465
|
-
}
|
|
2466
|
-
function $c18ce8dadd041cdd$export$674d8cd8b6868154() {
|
|
2467
|
-
// Snippet to load GA async
|
|
2468
|
-
const w = window;
|
|
2469
|
-
// @ts-ignore
|
|
2470
|
-
w.ga ||= function () {
|
|
2471
|
-
(w.ga.q ||= []).push(arguments);
|
|
2472
|
-
};
|
|
2473
|
-
w.ga.l = +new Date();
|
|
2474
|
-
}
|
|
2475
|
-
var $28e42b0009d694b2$exports = {};
|
|
2476
|
-
$parcel$export($28e42b0009d694b2$exports, "cookiebot_get_consent", () => $28e42b0009d694b2$export$fce59460a1699957);
|
|
2477
|
-
$parcel$export($28e42b0009d694b2$exports, "cookiebot_wait_for_consent", () => $28e42b0009d694b2$export$56c2e8be65fb14ae);
|
|
2478
|
-
$parcel$export($28e42b0009d694b2$exports, "cookiebot_get_cookie_ipns", () => $28e42b0009d694b2$export$8827362e5e938d26);
|
|
2479
|
-
$parcel$export($28e42b0009d694b2$exports, "init_cookiebot_tracking", () => $28e42b0009d694b2$export$abec7fd9f0b9cc22);
|
|
2480
|
-
const $28e42b0009d694b2$var$required_consent_level = process.env.DEPICT_TRACKING_CONSENT_LEVEL;
|
|
2481
|
-
function $28e42b0009d694b2$var$consent_from_cookie() {
|
|
2482
|
-
const cookie = $e0a87646d12cb987$export$622991c71a1f52b3("CookieConsent");
|
|
2483
|
-
if (!cookie) return;
|
|
2484
|
-
const consent_json = cookie.replace(/%2C/g, ",").replace(/%27/g, "'").replace(/'/g, '"').replace(/([{[,])\s*([\w]+?):/g, '$1"$2":');
|
|
2485
|
-
try {
|
|
2486
|
-
return JSON.parse(consent_json);
|
|
2487
|
-
} catch ({
|
|
2488
|
-
message: message
|
|
2489
|
-
}) {
|
|
2490
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("Error parsing cookie json", consent_json, message);
|
|
2491
|
-
return;
|
|
2492
|
-
}
|
|
2493
|
-
}
|
|
2494
|
-
let $28e42b0009d694b2$var$cookie_ipns;
|
|
2495
|
-
let $28e42b0009d694b2$var$has_consent = /*@__PURE__*/(() => $28e42b0009d694b2$var$required_consent_level ? $28e42b0009d694b2$var$consent_from_cookie()?.[$28e42b0009d694b2$var$required_consent_level] || false : true)();
|
|
2496
|
-
const $28e42b0009d694b2$export$fce59460a1699957 = () => $28e42b0009d694b2$var$has_consent;
|
|
2497
|
-
async function $28e42b0009d694b2$export$56c2e8be65fb14ae() {
|
|
2498
|
-
for await (const consent_obj of $28e42b0009d694b2$export$8827362e5e938d26()) return consent_obj[process.env.DEPICT_TRACKING_CONSENT_LEVEL];
|
|
2499
|
-
// Impossible
|
|
2500
|
-
return false;
|
|
2501
|
-
}
|
|
2502
|
-
function $28e42b0009d694b2$export$8827362e5e938d26() {
|
|
2503
|
-
if ($28e42b0009d694b2$var$cookie_ipns) return $28e42b0009d694b2$var$cookie_ipns;
|
|
2504
|
-
$28e42b0009d694b2$var$cookie_ipns = $9a42a570de51ea3d$export$e806c6c1615a59ae();
|
|
2505
|
-
const existing_consent = $28e42b0009d694b2$var$consent_from_cookie();
|
|
2506
|
-
if (existing_consent) $28e42b0009d694b2$var$cookie_ipns(existing_consent);
|
|
2507
|
-
const consent_maybe_changed = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => {
|
|
2508
|
-
const {
|
|
2509
|
-
consent: {
|
|
2510
|
-
marketing: marketing,
|
|
2511
|
-
necessary: necessary,
|
|
2512
|
-
preferences: preferences,
|
|
2513
|
-
statistics: statistics
|
|
2514
|
-
}
|
|
2515
|
-
} = window.Cookiebot;
|
|
2516
|
-
const new_consent_obj = {
|
|
2517
|
-
marketing: marketing,
|
|
2518
|
-
necessary: necessary,
|
|
2519
|
-
preferences: preferences,
|
|
2520
|
-
statistics: statistics
|
|
2521
|
-
};
|
|
2522
|
-
if (!Object.keys(new_consent_obj).every(k => $28e42b0009d694b2$var$cookie_ipns.latest_call_value?.[k] === new_consent_obj[k])) {
|
|
2523
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("Consent changed", new_consent_obj);
|
|
2524
|
-
$28e42b0009d694b2$var$cookie_ipns(new_consent_obj);
|
|
2525
|
-
}
|
|
2526
|
-
}, "extracting consent failed");
|
|
2527
|
-
$e6d67ef355abb2dc$export$2fc1a072736ae2f6(window, "Cookiebot", "consent").then(consent_maybe_changed);
|
|
2528
|
-
["CookiebotOnAccept", "CookiebotOnDecline"].forEach(e => window.addEventListener(e, consent_maybe_changed, false));
|
|
2529
|
-
return $28e42b0009d694b2$var$cookie_ipns;
|
|
2530
|
-
}
|
|
2531
|
-
const $28e42b0009d694b2$export$abec7fd9f0b9cc22 = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(async (anon_id = "anonymous") => {
|
|
2532
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("Initializing Cookiebot tracking");
|
|
2533
|
-
if (!$28e42b0009d694b2$var$required_consent_level) return $e6c6e7929ea385ae$export$de56f1198d121036("No consent level set for Depict tracking. Ignoring consent and tracking everything.");
|
|
2534
|
-
const original_get_session_id = (0, $e0a87646d12cb987$export$61e7e1f11e96692f);
|
|
2535
|
-
$e0a87646d12cb987$export$93ae15b1ae509334(() => $28e42b0009d694b2$var$has_consent ? original_get_session_id() : anon_id);
|
|
2536
|
-
for await (const consent_obj of $28e42b0009d694b2$export$8827362e5e938d26()) {
|
|
2537
|
-
// Changing this will change the return value of function given to set_depict_id_fn above
|
|
2538
|
-
$28e42b0009d694b2$var$has_consent = consent_obj[$28e42b0009d694b2$var$required_consent_level];
|
|
2539
|
-
if (!$28e42b0009d694b2$var$has_consent) $e6c6e7929ea385ae$export$de56f1198d121036(`dsid will be set to, "${anon_id}", until Cookiebot has consent for "${$28e42b0009d694b2$var$required_consent_level}"`);else $e6c6e7929ea385ae$export$de56f1198d121036(`Cookiebot obtained consent for "${$28e42b0009d694b2$var$required_consent_level}", will use true dsid/session_id`);
|
|
2540
|
-
}
|
|
2541
|
-
});
|
|
2542
|
-
const $2026711c6c2d6204$var$required_consent_level = process.env.DEPICT_TRACKING_CONSENT_LEVEL;
|
|
2543
|
-
/*
|
|
2544
|
-
The Optanon cookie format can vary slightly between integrations. To figure out the key values used for a particular customer,
|
|
2545
|
-
visit their web, finish the consent dialog, then run
|
|
2546
|
-
new URLSearchParams(document.cookie.match("(^|;)\\s*OptanonConsent\\s*=\\s*([^;]+)")?.pop()).get("groups")
|
|
2547
|
-
in the console. You should see something like
|
|
2548
|
-
'NECES:1,ANALY:1,PERON:1,MARKE:1'
|
|
2549
|
-
Which tells you what the key values for each consent level is. Enter them in the correct order, comma separated,
|
|
2550
|
-
as OPTANON_KEYS in the tenants .env file. For the cookie output above, the .env entry would be
|
|
2551
|
-
OPTANON_KEYS="NECES,ANALY,PERON,MARKE"
|
|
2552
|
-
If it's not obvious which consent level each key represents, open the consent dialog again and start de-selecting consent options,
|
|
2553
|
-
then check the cookie value again.
|
|
2554
|
-
*/
|
|
2555
|
-
const $2026711c6c2d6204$var$KEY_ORDER = ["necessary", "statistics", "preferences", "marketing"];
|
|
2556
|
-
const $2026711c6c2d6204$var$OPTANON_TO_COOKIEBOT = Object.fromEntries((process.env.OPTANON_KEYS || "").split(",").filter(k => k).map((k, i) => [k, $2026711c6c2d6204$var$KEY_ORDER[i]]));
|
|
2557
|
-
function $2026711c6c2d6204$var$consent_from_cookie() {
|
|
2558
|
-
const cookie = $e0a87646d12cb987$export$622991c71a1f52b3("OptanonConsent");
|
|
2559
|
-
if (!cookie) return;
|
|
2560
|
-
const groups = new URLSearchParams(cookie).get("groups") || "";
|
|
2561
|
-
const matches = groups.matchAll(/(\w+):(\d)/g);
|
|
2562
|
-
const consent = {};
|
|
2563
|
-
for (const match of matches) consent[$2026711c6c2d6204$var$OPTANON_TO_COOKIEBOT[match[1]]] = match[2] == "1";
|
|
2564
|
-
return consent;
|
|
2565
|
-
}
|
|
2566
|
-
let $2026711c6c2d6204$var$cookie_ipns;
|
|
2567
|
-
let $2026711c6c2d6204$var$has_consent = /*@__PURE__*/(() => $2026711c6c2d6204$var$required_consent_level ? $2026711c6c2d6204$var$consent_from_cookie()?.[$2026711c6c2d6204$var$required_consent_level] || false : true)();
|
|
2568
|
-
const $2026711c6c2d6204$export$1dd9ce50e201eff1 = () => $2026711c6c2d6204$var$has_consent;
|
|
2569
|
-
async function $2026711c6c2d6204$export$7a6d436e0782c6ed() {
|
|
2570
|
-
for await (const consent_obj of $2026711c6c2d6204$export$7e4427e80d5fc619()) return consent_obj[process.env.DEPICT_TRACKING_CONSENT_LEVEL];
|
|
2571
|
-
// Impossible
|
|
2572
|
-
return false;
|
|
2573
|
-
}
|
|
2574
|
-
function $2026711c6c2d6204$export$7e4427e80d5fc619() {
|
|
2575
|
-
if ($2026711c6c2d6204$var$cookie_ipns) return $2026711c6c2d6204$var$cookie_ipns;
|
|
2576
|
-
$2026711c6c2d6204$var$cookie_ipns = $9a42a570de51ea3d$export$e806c6c1615a59ae();
|
|
2577
|
-
const existing_consent = $2026711c6c2d6204$var$consent_from_cookie();
|
|
2578
|
-
if (existing_consent?.necessary)
|
|
2579
|
-
// If "necessary" isn't set, user hasn't actually given/withold consent yet.
|
|
2580
|
-
$2026711c6c2d6204$var$cookie_ipns(existing_consent);
|
|
2581
|
-
window.addEventListener("consent.onetrust", $268cbd9e4ade92db$export$b3bbfd758f11cfa9(evt => {
|
|
2582
|
-
const c = evt;
|
|
2583
|
-
// Cast because TS doesn't know about the forEach coming up
|
|
2584
|
-
const consent_obj = {};
|
|
2585
|
-
Object.keys($2026711c6c2d6204$var$OPTANON_TO_COOKIEBOT).forEach(k => {
|
|
2586
|
-
consent_obj[$2026711c6c2d6204$var$OPTANON_TO_COOKIEBOT[k]] = c.detail.includes(k);
|
|
2587
|
-
});
|
|
2588
|
-
if (!consent_obj.necessary)
|
|
2589
|
-
// If "necessary" isn't set, user hasn't actually given/withold consent yet.
|
|
2590
|
-
return;
|
|
2591
|
-
if (!Object.keys(consent_obj).every(k => $2026711c6c2d6204$var$cookie_ipns.latest_call_value?.[k] === consent_obj[k])) $2026711c6c2d6204$var$cookie_ipns(consent_obj);
|
|
2592
|
-
}));
|
|
2593
|
-
return $2026711c6c2d6204$var$cookie_ipns;
|
|
2594
|
-
}
|
|
2595
|
-
const $2026711c6c2d6204$export$f0f6c846d96fdbec = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(async (anon_id = "anonymous") => {
|
|
2596
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("Initializing OptAnon tracking");
|
|
2597
|
-
if (!$2026711c6c2d6204$var$required_consent_level) return $e6c6e7929ea385ae$export$de56f1198d121036("No consent level set for Depict tracking. Ignoring consent and tracking everything.");
|
|
2598
|
-
const original_get_session_id = (0, $e0a87646d12cb987$export$61e7e1f11e96692f);
|
|
2599
|
-
$e0a87646d12cb987$export$93ae15b1ae509334(() => $2026711c6c2d6204$var$has_consent ? original_get_session_id() : anon_id);
|
|
2600
|
-
for await (const consent_obj of $2026711c6c2d6204$export$7e4427e80d5fc619()) {
|
|
2601
|
-
// Changing this will change the return value of function given to set_depict_id_fn above
|
|
2602
|
-
$2026711c6c2d6204$var$has_consent = consent_obj[$2026711c6c2d6204$var$required_consent_level];
|
|
2603
|
-
if (!$2026711c6c2d6204$var$has_consent) $e6c6e7929ea385ae$export$de56f1198d121036(`dsid/session_id will be set to, "${anon_id}", until Optanon has consent for "${$2026711c6c2d6204$var$required_consent_level}"`);else $e6c6e7929ea385ae$export$de56f1198d121036(`Optanon obtained consent for "${$2026711c6c2d6204$var$required_consent_level}", will use true dsid/session_id`);
|
|
2604
|
-
}
|
|
2605
|
-
});
|
|
2606
|
-
const $d3d8549954e0318e$var$g = typeof globalThis == "object" && globalThis || window;
|
|
2607
|
-
const $d3d8549954e0318e$export$f3354ec2ce95ebd9 = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(async (GA_ID, strict) => {
|
|
2608
|
-
if (process.env.GTAG === "false") return;
|
|
2609
|
-
if (!GA_ID) {
|
|
2610
|
-
$e6c6e7929ea385ae$export$c2363754d4758444("Couldn't load gtag, GA_ID not specified", GA_ID);
|
|
2611
|
-
return;
|
|
2612
|
-
}
|
|
2613
|
-
const required_consent_level = process.env.GTAG_LOADING_CONSENT_LEVEL;
|
|
2614
|
-
if (required_consent_level !== undefined) {
|
|
2615
|
-
$e6c6e7929ea385ae$export$de56f1198d121036(`GTag loading waiting for consent level ${required_consent_level}`);
|
|
2616
|
-
const ipns = process.env.CONSENT_FRAMEWORK == "optanon" ? $2026711c6c2d6204$export$7e4427e80d5fc619() : $28e42b0009d694b2$export$8827362e5e938d26();
|
|
2617
|
-
for await (const consent_status of ipns) {
|
|
2618
|
-
const status_for_level = consent_status[required_consent_level];
|
|
2619
|
-
if (status_for_level) {
|
|
2620
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("got consent for", required_consent_level, "loading gtag");
|
|
2621
|
-
break;
|
|
2622
|
-
}
|
|
2623
|
-
}
|
|
2624
|
-
}
|
|
2625
|
-
// delay loading of script because it's huge and slow according to nordiska galleriet
|
|
2626
|
-
// @ts-ignore
|
|
2627
|
-
const page_hasnt_loaded = $d3d8549954e0318e$var$g?.performance?.getEntriesByType?.("navigation")?.every?.(e => e?.loadEventEnd) === false;
|
|
2628
|
-
// Source: comment on https://stackoverflow.com/a/53525488
|
|
2629
|
-
// don't use readyState, source: personal experience and comment on https://stackoverflow.com/a/28093606
|
|
2630
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("Loading gtag after " + (page_hasnt_loaded ? "pageload and " : "") + "3s" + (strict ? "" : ", but setting up queues already"));
|
|
2631
|
-
if (!strict) $d3d8549954e0318e$export$d031e55ccd4c52dc(GA_ID);
|
|
2632
|
-
if (page_hasnt_loaded) {
|
|
2633
|
-
const load_event = await new Promise(r => window.addEventListener("load", r, {
|
|
2634
|
-
once: true
|
|
2635
|
-
}));
|
|
2636
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("page has loaded", load_event);
|
|
2637
|
-
}
|
|
2638
|
-
await new Promise(r => setTimeout(r, 3000));
|
|
2639
|
-
const script = document.createElement("script"),
|
|
2640
|
-
head = document.head;
|
|
2641
|
-
script.async = true;
|
|
2642
|
-
script.src = "https://www.googletagmanager.com/gtag/js?id=" + GA_ID;
|
|
2643
|
-
head.appendChild(script);
|
|
2644
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("Loading gtag now", script);
|
|
2645
|
-
});
|
|
2646
|
-
const $d3d8549954e0318e$export$d031e55ccd4c52dc = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(GA_ID => {
|
|
2647
|
-
if (process.env.GTAG === "false") return;
|
|
2648
|
-
$d3d8549954e0318e$var$g.dataLayer ||= [];
|
|
2649
|
-
function gtag() {
|
|
2650
|
-
$d3d8549954e0318e$var$g.dataLayer.push(arguments);
|
|
2651
|
-
}
|
|
2652
|
-
$d3d8549954e0318e$var$g.gtag = gtag;
|
|
2653
|
-
$d3d8549954e0318e$var$g.gtag("js", new Date());
|
|
2654
|
-
$d3d8549954e0318e$var$g.gtag("config", GA_ID, {
|
|
2655
|
-
"send_page_view": false
|
|
2656
|
-
});
|
|
2657
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("configuring gtag with", GA_ID);
|
|
2658
|
-
});
|
|
2659
|
-
const $d3d8549954e0318e$export$7babcd5d4056b2ca = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(async (raw_displays, get_product_id, more) => {
|
|
2660
|
-
const displays = raw_displays; // gtag tracking is "obsolete" and we don't expect any customers using something else than LegacyDisplay to use it
|
|
2661
|
-
if (process.env.GTAG === "false") return;
|
|
2662
|
-
if (process.env.GTAG_VIEW === "false") return;
|
|
2663
|
-
if (process.env.GTAG_EVENT_CONSENT_LEVEL !== undefined && !(await $d3d8549954e0318e$var$can_send_gtag_events(displays, get_product_id, more))) return;
|
|
2664
|
-
if (typeof $d3d8549954e0318e$var$g.gtag == "function") {
|
|
2665
|
-
const make_item = (display, index, id) => ({
|
|
2666
|
-
id: id,
|
|
2667
|
-
"list_name": "depict",
|
|
2668
|
-
"list_position": display?.index || index + 1,
|
|
2669
|
-
...(typeof more === "function" ? more(display) : more)
|
|
2670
|
-
});
|
|
2671
|
-
const gtag_items = [
|
|
2672
|
-
// spread works around safari 11 bug where Array returned by Promise.all is not an instance of the global Array
|
|
2673
|
-
// https://sentry.io/organizations/depictai-0o/issues/2794688692/?project=5476183
|
|
2674
|
-
...(await Promise.all(displays.map(async (display, index) => display.ga_product_ids ? display.ga_product_ids.map(id => make_item(display, index, id)) : make_item(display, index, display.ga_product_id || display.product_id || (await get_product_id(display.page_url)) || (await get_product_id(display)) // the last statement is this row allows for special product_id getter functions that not only use the page_url. They need to check the typeof their argument tho and ignore the first calls
|
|
2675
|
-
))))].flat();
|
|
2676
|
-
const max_products_per_request = 100;
|
|
2677
|
-
for (let i = 0; i < gtag_items.length; i += max_products_per_request) {
|
|
2678
|
-
const gtag_args = ["event", "view_item_list", {
|
|
2679
|
-
"items": gtag_items.slice(i, i + max_products_per_request)
|
|
2680
|
-
}];
|
|
2681
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("Sending product view to gtag", gtag_args);
|
|
2682
|
-
$d3d8549954e0318e$var$g.gtag(...gtag_args);
|
|
2683
|
-
}
|
|
2684
|
-
} else $e6c6e7929ea385ae$export$c2363754d4758444("not sending gtag tracking as there is no gtag");
|
|
2685
|
-
});
|
|
2686
|
-
const $d3d8549954e0318e$export$f522672c9379e339 = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(async (product_id, index, more) => {
|
|
2687
|
-
if (process.env.GTAG === "false") return;
|
|
2688
|
-
if (process.env.GTAG_EVENT_CONSENT_LEVEL !== undefined && !(await $d3d8549954e0318e$var$can_send_gtag_events(product_id, index, more))) return;
|
|
2689
|
-
if (typeof $d3d8549954e0318e$var$g.gtag == "function") {
|
|
2690
|
-
const gtag_args = ["event", "select_content", {
|
|
2691
|
-
"content_type": "product",
|
|
2692
|
-
"items": [{
|
|
2693
|
-
"id": product_id,
|
|
2694
|
-
"list_name": "depict",
|
|
2695
|
-
"list_position": index + 1,
|
|
2696
|
-
...more
|
|
2697
|
-
}]
|
|
2698
|
-
}];
|
|
2699
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("calling gtag with arguments", gtag_args);
|
|
2700
|
-
return $d3d8549954e0318e$var$g.gtag(...gtag_args);
|
|
2701
|
-
} else $e6c6e7929ea385ae$export$c2363754d4758444("not sending gtag tracking as there is no gtag");
|
|
2702
|
-
});
|
|
2703
|
-
const $d3d8549954e0318e$export$f75172d2e289cd02 = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(action => {
|
|
2704
|
-
if (process.env.GA === "false") return;
|
|
2705
|
-
if (typeof $d3d8549954e0318e$var$g.ga != "function") {
|
|
2706
|
-
$e6c6e7929ea385ae$export$c2363754d4758444("Not sending to ga as there is no ga");
|
|
2707
|
-
return;
|
|
2708
|
-
}
|
|
2709
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("sending", action, "to GA");
|
|
2710
|
-
return $d3d8549954e0318e$var$g.ga("depict.send", {
|
|
2711
|
-
hitType: "event",
|
|
2712
|
-
eventCategory: "Depict",
|
|
2713
|
-
eventAction: action,
|
|
2714
|
-
eventLabel: "rec-bar-tracking",
|
|
2715
|
-
nonInteraction: 1
|
|
2716
|
-
});
|
|
2717
|
-
});
|
|
2718
|
-
const $d3d8549954e0318e$export$ac7296527cb52311 = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(GAID => {
|
|
2719
|
-
if (process.env.GA === "false") return;
|
|
2720
|
-
if (!GAID) {
|
|
2721
|
-
$e6c6e7929ea385ae$export$c2363754d4758444(new Error("No GAID specified"));
|
|
2722
|
-
return;
|
|
2723
|
-
}
|
|
2724
|
-
if (typeof $d3d8549954e0318e$var$g.ga != "function") {
|
|
2725
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("Creating GA queue");
|
|
2726
|
-
$c18ce8dadd041cdd$export$674d8cd8b6868154();
|
|
2727
|
-
}
|
|
2728
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("Creating ga with GA-ID", GAID);
|
|
2729
|
-
$d3d8549954e0318e$var$g.ga("create", GAID, "auto", "depict");
|
|
2730
|
-
$d3d8549954e0318e$export$f3354ec2ce95ebd9(GAID, false);
|
|
2731
|
-
});
|
|
2732
|
-
const $d3d8549954e0318e$export$127751e82111fcf = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => $d3d8549954e0318e$export$f75172d2e289cd02("rec_bar_click"));
|
|
2733
|
-
const $d3d8549954e0318e$export$bf205937e5e012cb = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => $d3d8549954e0318e$export$f75172d2e289cd02("add_to_cart_after_rec_bar_click"));
|
|
2734
|
-
async function $d3d8549954e0318e$var$can_send_gtag_events(...stuff_to_log) {
|
|
2735
|
-
const required_consent_level = process.env.GTAG_LOADING_CONSENT_LEVEL;
|
|
2736
|
-
if (required_consent_level !== undefined) return true; // just in case
|
|
2737
|
-
const ipns = process.env.CONSENT_FRAMEWORK == "optanon" ? $2026711c6c2d6204$export$7e4427e80d5fc619() : $28e42b0009d694b2$export$8827362e5e938d26();
|
|
2738
|
-
for await (const consent_obj of ipns) {
|
|
2739
|
-
const can_send = consent_obj[required_consent_level];
|
|
2740
|
-
if (!can_send) $e6c6e7929ea385ae$export$de56f1198d121036("Got no consent for", required_consent_level, "not sending gtag event for", ...stuff_to_log);
|
|
2741
|
-
return can_send;
|
|
2742
|
-
}
|
|
2743
|
-
}
|
|
2744
|
-
let $e4bebbfa0f0b1454$var$existing_style_tag;
|
|
2745
|
-
let $e4bebbfa0f0b1454$var$reactions_in_last_s = 0;
|
|
2746
|
-
const $e4bebbfa0f0b1454$export$59ba1eb2c083f0cd = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(async css => {
|
|
2747
|
-
const style_tag = await ($e4bebbfa0f0b1454$var$existing_style_tag ||= (0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).wait_for_element("head").then(head => {
|
|
2748
|
-
const tag = document.createElement("style");
|
|
2749
|
-
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onremoved(
|
|
2750
|
-
// reinsertion for next.js's "portable" <head>
|
|
2751
|
-
tag, eoe => {
|
|
2752
|
-
if (document.head.contains(tag))
|
|
2753
|
-
// just make sure to not freak out if it's already been added again
|
|
2754
|
-
return;
|
|
2755
|
-
if ($e4bebbfa0f0b1454$var$reactions_in_last_s >= 10) {
|
|
2756
|
-
$268cbd9e4ade92db$export$f18d5b0af29128b7(new Error("Someone removed our styling but insists on it (10 removals in previous second). Giving up \uD83D\uDE2B"), "error");
|
|
2757
|
-
return;
|
|
2758
|
-
}
|
|
2759
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("Someone removed our styling \uD83D\uDE24, reinserting", eoe);
|
|
2760
|
-
$e4bebbfa0f0b1454$var$reactions_in_last_s++;
|
|
2761
|
-
setTimeout(() => $e4bebbfa0f0b1454$var$reactions_in_last_s--, 1000);
|
|
2762
|
-
document.head.append(tag); // we're sure that head exists now since we inserted it there previously
|
|
2763
|
-
});
|
|
2764
|
-
|
|
2765
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("inserting", tag, "into", head);
|
|
2766
|
-
return head.appendChild(tag);
|
|
2767
|
-
}));
|
|
2768
|
-
style_tag.append(css);
|
|
2769
|
-
});
|
|
2770
|
-
const $e4bebbfa0f0b1454$export$a96c18473f2af463 = (tenant, selector, validator) => {
|
|
2771
|
-
return (0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onexists(selector, ({
|
|
2772
|
-
element: element
|
|
2773
|
-
}) => $c8263a2185830bf1$export$2c34560c3749dc63(element, tenant.get_product_id, (p_id, r_id, was_unmatching, event) => {
|
|
2774
|
-
if (typeof validator === "function" && !validator(event)) return;
|
|
2775
|
-
if (!was_unmatching) $d3d8549954e0318e$export$bf205937e5e012cb();
|
|
2776
|
-
$e0a87646d12cb987$export$9028351cb994757e({
|
|
2777
|
-
...tenant,
|
|
2778
|
-
product_id: p_id,
|
|
2779
|
-
...(was_unmatching ? {
|
|
2780
|
-
attribution_id: "recommendation"
|
|
2781
|
-
} : {
|
|
2782
|
-
recommendation_id: r_id
|
|
2783
|
-
})
|
|
2784
|
-
});
|
|
2785
|
-
}, true));
|
|
2786
|
-
};
|
|
2787
|
-
const $e4bebbfa0f0b1454$export$a4f97b27a0592e6c = url => (url ? new URL(url, window.location.origin) : window.location).pathname.split("/").filter(a => a).pop()?.replace(/\.html?$/i, "") || "";
|
|
2788
|
-
const $e4bebbfa0f0b1454$export$692b606677218a16 = callback => {
|
|
2789
|
-
if (document.depictwashere) {
|
|
2790
|
-
if (process.env.BUILD_TARGET === "dev") {
|
|
2791
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("HMR tried to rerun us, reloading page");
|
|
2792
|
-
/* eslint-disable no-self-assign */
|
|
2793
|
-
location.href = location.href;
|
|
2794
|
-
}
|
|
2795
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("Script has already ran", document.currentScript, "is exiting");
|
|
2796
|
-
return;
|
|
2797
|
-
}
|
|
2798
|
-
if (process.env.BUILD_TARGET === "dev") /* eslint-disable no-console */console.clear = new Proxy(console.clear, {
|
|
2799
|
-
apply(target, this_arg, arg_list) {
|
|
2800
|
-
if (new Error().stack?.split("\n").filter(Boolean).some(s => s.includes("http://localhost:1234/depict-ai.js"))) {
|
|
2801
|
-
/* eslint-disable no-console */console.log("CSS change detected through hack, reloading");
|
|
2802
|
-
location.reload();
|
|
2803
|
-
}
|
|
2804
|
-
return target.apply(this_arg, arg_list);
|
|
2805
|
-
}
|
|
2806
|
-
});
|
|
2807
|
-
document.depictwashere = true;
|
|
2808
|
-
callback().catch((0, $548fd58b14b25a52$export$8048b892d651b310));
|
|
2809
|
-
};
|
|
2810
|
-
function $e4bebbfa0f0b1454$export$328e81c44cddf3c0(callback, get_market, supported_markets, unsupported_markets, preferred_demo_market) {
|
|
2811
|
-
$e4bebbfa0f0b1454$export$692b606677218a16(async () => {
|
|
2812
|
-
// Handle override for debug scripts (could be used on demo pages too)
|
|
2813
|
-
if (process.env.DEBUG === "true") {
|
|
2814
|
-
let localstorage_override;
|
|
2815
|
-
const query_param_override = new URLSearchParams(location.search).get("depict-override-market");
|
|
2816
|
-
if (query_param_override !== null) {
|
|
2817
|
-
$e6c6e7929ea385ae$export$de56f1198d121036(`Found ?depict-override-market=${query_param_override}. Using that as the market`);
|
|
2818
|
-
get_market = () => query_param_override;
|
|
2819
|
-
localStorage.setItem("depict-override-market", query_param_override);
|
|
2820
|
-
} else if ((localstorage_override = localStorage.getItem("depict-override-market")) !== null) {
|
|
2821
|
-
$e6c6e7929ea385ae$export$de56f1198d121036(`Found depict-override-market="${localstorage_override}" in localStorage. Using that as the market`);
|
|
2822
|
-
get_market = () => localstorage_override;
|
|
2823
|
-
}
|
|
2824
|
-
}
|
|
2825
|
-
const market = await get_market();
|
|
2826
|
-
if (supported_markets.includes(market)) {
|
|
2827
|
-
$e6c6e7929ea385ae$export$de56f1198d121036(`Initializing with market: ${market}`);
|
|
2828
|
-
return callback(market).catch((0, $548fd58b14b25a52$export$8048b892d651b310));
|
|
2829
|
-
} else if (unsupported_markets.includes(market)) {
|
|
2830
|
-
$e6c6e7929ea385ae$export$de56f1198d121036(`Unsupported market: ${market}. Exiting...`);
|
|
2831
|
-
return;
|
|
2832
|
-
} else if (process.env.DEBUG === "true" && location.host.endsWith(".demo.depict.ai") && preferred_demo_market) {
|
|
2833
|
-
$e6c6e7929ea385ae$export$de56f1198d121036(`On demosite with default market override. Setting market to ${preferred_demo_market}`);
|
|
2834
|
-
return callback(preferred_demo_market).catch((0, $548fd58b14b25a52$export$8048b892d651b310));
|
|
2835
|
-
} else {
|
|
2836
|
-
$548fd58b14b25a52$export$8048b892d651b310(new Error(`Unknown market: "${market}". Exiting...`));
|
|
2837
|
-
return;
|
|
2838
|
-
}
|
|
2839
|
-
});
|
|
2840
|
-
}
|
|
2841
|
-
class $16f3a26cfac77a4c$export$8d42ce4827f43582 {
|
|
2842
|
-
constructor(options) {
|
|
2843
|
-
this.dataset = {
|
|
2844
|
-
...((options.current_script_override || document.currentScript || {}).dataset || {})
|
|
2845
|
-
};
|
|
2846
|
-
this.modify = this.dataset.modify === "true";
|
|
2847
|
-
this.is_debug = (0, $7b5e577a60b81e60$export$55fe61489d2c7417);
|
|
2848
|
-
this.dlog = (0, $e6c6e7929ea385ae$export$de56f1198d121036);
|
|
2849
|
-
this.TENANT = options.TENANT || process.env.TENANT || "sandbox";
|
|
2850
|
-
this.MARKET = options.MARKET;
|
|
2851
|
-
this.Sentry = (0, $61a34358bf0d3d8b$export$af2e17a20c2ea3c5);
|
|
2852
|
-
this.GA_ID = options.GA_ID ?? "";
|
|
2853
|
-
this.TYPE = options.TYPE || "normal";
|
|
2854
|
-
this.catchify = (0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9);
|
|
2855
|
-
this.err = (0, $548fd58b14b25a52$export$8048b892d651b310);
|
|
2856
|
-
if (this.GA_ID) $d3d8549954e0318e$export$ac7296527cb52311(this.GA_ID);
|
|
2857
|
-
// https://gitlab.com/depict-ai/depict.ai/-/merge_requests/2318#note_927887712
|
|
2858
|
-
this.get_product_id = $268cbd9e4ade92db$export$b3bbfd758f11cfa9((...args) => {
|
|
2859
|
-
const id = options.get_product_id(...args);
|
|
2860
|
-
if (id instanceof Promise) return id.then(id => id || "");
|
|
2861
|
-
return id || "";
|
|
2862
|
-
});
|
|
2863
|
-
this.product_id = this.get_product_id; // template tool compatible alias
|
|
2864
|
-
this.tenant = this.TENANT;
|
|
2865
|
-
this.market = this.MARKET;
|
|
2866
|
-
this.gaid = this.GA_ID; // template tool compatible alias
|
|
2867
|
-
this.type = this.TYPE;
|
|
2868
|
-
this.catchify = (0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9);
|
|
2869
|
-
this.err = (0, $548fd58b14b25a52$export$8048b892d651b310);
|
|
2870
|
-
if (localStorage.getItem("highlight-depict") === "true") $e4bebbfa0f0b1454$export$59ba1eb2c083f0cd(".depict { background: #f00a !important; }");
|
|
2871
|
-
if (options.pageview_tracking ?? true) (async () => {
|
|
2872
|
-
$72ee205b59322497$export$f7cb1bd47199ec38({
|
|
2873
|
-
market: this.market,
|
|
2874
|
-
tenant: this.tenant,
|
|
2875
|
-
get_product_id: this.get_product_id
|
|
2876
|
-
});
|
|
2877
|
-
})();
|
|
2878
|
-
}
|
|
2879
|
-
} /**
|
|
2880
|
-
* This is a list of alpha-2 country codes plus some two letter combinations commonly used to describe markets
|
|
2881
|
-
*/ // albania
|
|
2882
|
-
|
|
2883
|
-
const $fbb09973782881cb$var$default_get_rec_id = elem => elem?.dataset?.depict_recommendation_id || elem?.dataset?.recommendationId;
|
|
2884
|
-
const $fbb09973782881cb$var$default_get_prod_id = elem => elem?.dataset?.depict_product_id || elem?.dataset?.productId;
|
|
2885
|
-
const $fbb09973782881cb$var$default_get_ga_prod_id = elem => elem?.dataset?.ga_ids;
|
|
2886
|
-
const $fbb09973782881cb$var$get_index_in_children_of_el = el => [...(el?.parentElement?.children || [])].indexOf(el);
|
|
2887
|
-
const $fbb09973782881cb$export$29a6094e0bd8bc5f = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(async (options, gtag_options) => {
|
|
2888
|
-
const {
|
|
2889
|
-
product_selector: product_selector,
|
|
2890
|
-
a2c_selector: a2c_selector,
|
|
2891
|
-
rec_a2c_selector: rec_a2c_selector,
|
|
2892
|
-
rec_a2c_unbubbled: rec_a2c_unbubbled,
|
|
2893
|
-
get_product_id = options.t?.get_product_id,
|
|
2894
|
-
get_rec_id = $fbb09973782881cb$var$default_get_rec_id,
|
|
2895
|
-
get_prod_id = $fbb09973782881cb$var$default_get_prod_id,
|
|
2896
|
-
get_ga_prod_id = $fbb09973782881cb$var$default_get_ga_prod_id,
|
|
2897
|
-
get_display: get_display,
|
|
2898
|
-
impression_tracking: impression_tracking,
|
|
2899
|
-
a2c_elements: a2c_elements,
|
|
2900
|
-
product_elements: product_elements,
|
|
2901
|
-
t: t,
|
|
2902
|
-
click_location_prefix = elem => elem?.parentElement?.dataset?.type + "_"
|
|
2903
|
-
} = options;
|
|
2904
|
-
const get_display_data = async elem => {
|
|
2905
|
-
const data = {};
|
|
2906
|
-
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);
|
|
2907
|
-
if (get_ga_prod_id) data.ga_product_id = await get_ga_prod_id(elem);
|
|
2908
|
-
if (get_rec_id) data.recommendation_id = get_rec_id(elem);
|
|
2909
|
-
if (get_display) Object.assign(data, get_display(elem));
|
|
2910
|
-
return data;
|
|
2911
|
-
};
|
|
2912
|
-
const impression_tracked_els = new WeakSet();
|
|
2913
|
-
const view_tracked_els = new WeakSet();
|
|
2914
|
-
const a2c_tracked_els = new WeakSet();
|
|
2915
|
-
const click_tracked_els = new WeakSet();
|
|
2916
|
-
const gtag_view_product_ids = {};
|
|
2917
|
-
// Page view
|
|
2918
|
-
if (t instanceof (0, $16f3a26cfac77a4c$export$8d42ce4827f43582)) (async () => {
|
|
2919
|
-
$72ee205b59322497$export$eee4c4d924348b05({
|
|
2920
|
-
tenant: t.tenant,
|
|
2921
|
-
market: t.market,
|
|
2922
|
-
product_id: await t.get_product_id()
|
|
2923
|
-
});
|
|
2924
|
-
})();
|
|
2925
|
-
// Product card
|
|
2926
|
-
const add_tracking_to_product_card = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(async ({
|
|
2927
|
-
element: elem
|
|
2928
|
-
}) => {
|
|
2929
|
-
const index = $fbb09973782881cb$var$get_index_in_children_of_el(elem);
|
|
2930
|
-
const data = await get_display_data(elem);
|
|
2931
|
-
const prefix = typeof click_location_prefix === "function" && click_location_prefix(elem) || "depict_";
|
|
2932
|
-
const gtag_list_name = "depict_" + (prefix[prefix.length - 1] == "_" ? prefix.substr(0, prefix.length - 1) : prefix);
|
|
2933
|
-
// Impression tracking
|
|
2934
|
-
if (impression_tracking && !impression_tracked_els.has(elem)) {
|
|
2935
|
-
impression_tracked_els.add(elem);
|
|
2936
|
-
$8e19f8200d357fe7$export$37125ccc5dd98050({
|
|
2937
|
-
element: elem,
|
|
2938
|
-
data: {
|
|
2939
|
-
recommendation_id: data.recommendation_id,
|
|
2940
|
-
product_id: data.product_id,
|
|
2941
|
-
tenant: t.tenant,
|
|
2942
|
-
recommendation_type: prefix.slice(-1) === "_" ? prefix.slice(0, -1) : prefix,
|
|
2943
|
-
entity_price: data.entity_price,
|
|
2944
|
-
market: t.market
|
|
2945
|
-
},
|
|
2946
|
-
wait_for_dom_insertion: false
|
|
2947
|
-
});
|
|
2948
|
-
}
|
|
2949
|
-
// Gtag view tracking
|
|
2950
|
-
if (data.product_id && options.attempt_gtag_view_tracking && !view_tracked_els.has(elem)) {
|
|
2951
|
-
view_tracked_els.add(elem);
|
|
2952
|
-
const gtag_view_product_ids_for_product = gtag_view_product_ids[gtag_list_name] ||= [];
|
|
2953
|
-
gtag_view_product_ids_for_product.push({
|
|
2954
|
-
product_id: data.ga_product_id || data.product_id,
|
|
2955
|
-
index: index
|
|
2956
|
-
});
|
|
2957
|
-
if (data.ga_product_ids) gtag_view_product_ids_for_product.push(...data.ga_product_ids.map(product_id => ({
|
|
2958
|
-
product_id: product_id,
|
|
2959
|
-
index: index
|
|
2960
|
-
})));
|
|
2961
|
-
try {
|
|
2962
|
-
const ga_ids = elem?.dataset?.ga_ids;
|
|
2963
|
-
if (ga_ids) gtag_view_product_ids_for_product.push(...ga_ids.split(",").map(id => ({
|
|
2964
|
-
product_id: id,
|
|
2965
|
-
index: index
|
|
2966
|
-
})));
|
|
2967
|
-
} catch (e) {
|
|
2968
|
-
$e6c6e7929ea385ae$export$c2363754d4758444("Something went wrong on a product with multiple ga_ids", e);
|
|
2969
|
-
}
|
|
2970
|
-
}
|
|
2971
|
-
if (typeof BroadcastChannel == "function") {
|
|
2972
|
-
// right click and mouse wheel click tracking
|
|
2973
|
-
const handler = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(e => $44909e19109bf973$export$8f66c4c7fb96eda2(e, data.product_id));
|
|
2974
|
-
elem.addEventListener("contextmenu", handler);
|
|
2975
|
-
elem.addEventListener("auxclick", e => e.button === 1 && handler(e)); // actual wheel click - some mouses / OS:es also dispatch auxclick on rightclick
|
|
2976
|
-
}
|
|
2977
|
-
|
|
2978
|
-
click_tracking: {
|
|
2979
|
-
if (click_tracked_els.has(elem)) break click_tracking;
|
|
2980
|
-
click_tracked_els.add(elem);
|
|
2981
|
-
elem.addEventListener("click", $268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => {
|
|
2982
|
-
const product_id = data.product_id || "DNT";
|
|
2983
|
-
const recommendation_id = data.recommendation_id || "not_depict";
|
|
2984
|
-
localStorage.setItem(`depict_attribution_${product_id}`, recommendation_id);
|
|
2985
|
-
const index = $fbb09973782881cb$var$get_index_in_children_of_el(elem);
|
|
2986
|
-
const click_location = prefix + (index + 1);
|
|
2987
|
-
$d3d8549954e0318e$export$127751e82111fcf();
|
|
2988
|
-
$e0a87646d12cb987$export$15f8a0cd5a8c0ebb({
|
|
2989
|
-
...(options.t || {}),
|
|
2990
|
-
...options,
|
|
2991
|
-
...data,
|
|
2992
|
-
...(data.recommendation_id ? {} : {
|
|
2993
|
-
attribution_id: "recommendation"
|
|
2994
|
-
}),
|
|
2995
|
-
click_location: click_location
|
|
2996
|
-
});
|
|
2997
|
-
if (!options.no_gtag) {
|
|
2998
|
-
const gtag_options_with_click_location = {
|
|
2999
|
-
list_name: gtag_list_name,
|
|
3000
|
-
...gtag_options
|
|
3001
|
-
};
|
|
3002
|
-
$d3d8549954e0318e$export$f522672c9379e339(data.product_id, index, gtag_options_with_click_location);
|
|
3003
|
-
try {
|
|
3004
|
-
const to_iterate = [];
|
|
3005
|
-
if (data.ga_product_id) to_iterate.push(...(data.ga_product_id.toString?.().split(",") ?? []));
|
|
3006
|
-
to_iterate.push(...(data.ga_product_ids || []));
|
|
3007
|
-
to_iterate.forEach(id => $d3d8549954e0318e$export$f522672c9379e339(id, index, gtag_options_with_click_location));
|
|
3008
|
-
} catch (e) {
|
|
3009
|
-
$e6c6e7929ea385ae$export$c2363754d4758444("Something went wrong when sending gtag click tracking on a product with multiple ga_ids");
|
|
3010
|
-
$268cbd9e4ade92db$export$f18d5b0af29128b7(e, "error");
|
|
3011
|
-
}
|
|
3012
|
-
}
|
|
3013
|
-
}), {
|
|
3014
|
-
once: true
|
|
3015
|
-
});
|
|
3016
|
-
}
|
|
3017
|
-
// Product card A2C button tracking
|
|
3018
|
-
if (rec_a2c_selector && !a2c_tracked_els.has(elem)) {
|
|
3019
|
-
const track_rec_a2c = async element => {
|
|
3020
|
-
const rec_a2c_button = element.querySelector(rec_a2c_selector);
|
|
3021
|
-
if (!rec_a2c_button) return;
|
|
3022
|
-
const data = await get_display_data(element);
|
|
3023
|
-
rec_a2c_button.addEventListener("click", () => {
|
|
3024
|
-
if (rec_a2c_unbubbled) {
|
|
3025
|
-
// If their script cancels the event before it reaches the rec card,
|
|
3026
|
-
// we will only attribute an a2c but not a click. This is inconsistent with what we usually do.
|
|
3027
|
-
// Create a fake click event on the main rec card,
|
|
3028
|
-
// so our click_tracking above can send tracking for a click as well.
|
|
3029
|
-
const click = new MouseEvent("click", {
|
|
3030
|
-
view: window,
|
|
3031
|
-
bubbles: true,
|
|
3032
|
-
cancelable: true,
|
|
3033
|
-
metaKey: true
|
|
3034
|
-
});
|
|
3035
|
-
element.addEventListener("click", e => (e.preventDefault(), false), {
|
|
3036
|
-
once: true
|
|
3037
|
-
});
|
|
3038
|
-
element.dispatchEvent(click);
|
|
3039
|
-
}
|
|
3040
|
-
$d3d8549954e0318e$export$bf205937e5e012cb();
|
|
3041
|
-
$e0a87646d12cb987$export$9028351cb994757e({
|
|
3042
|
-
...(options.t || {}),
|
|
3043
|
-
...options,
|
|
3044
|
-
...data
|
|
3045
|
-
});
|
|
3046
|
-
});
|
|
3047
|
-
a2c_tracked_els.add(elem);
|
|
3048
|
-
};
|
|
3049
|
-
track_rec_a2c(elem);
|
|
3050
|
-
}
|
|
3051
|
-
if (options.shade) $fbb09973782881cb$export$6ebd242c09192cec(elem);
|
|
3052
|
-
if (options.attempt_gtag_view_tracking && Object.keys(gtag_view_product_ids)?.length)
|
|
3053
|
-
// setTimeout to batch the requests / put it all into one gtag view event
|
|
3054
|
-
setTimeout($268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => {
|
|
3055
|
-
for (const key in gtag_view_product_ids) {
|
|
3056
|
-
const product_ids = gtag_view_product_ids[key];
|
|
3057
|
-
if (product_ids?.length) {
|
|
3058
|
-
$d3d8549954e0318e$export$7babcd5d4056b2ca(product_ids, () => "", {
|
|
3059
|
-
list_name: key,
|
|
3060
|
-
...gtag_options
|
|
3061
|
-
});
|
|
3062
|
-
delete gtag_view_product_ids[key];
|
|
3063
|
-
}
|
|
3064
|
-
}
|
|
3065
|
-
}));
|
|
3066
|
-
});
|
|
3067
|
-
if (typeof product_selector == "string") (0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onexists(product_selector, add_tracking_to_product_card);else if (product_elements && typeof product_elements?.[Symbol.iterator] == "function") for (const element of product_elements) add_tracking_to_product_card({
|
|
3068
|
-
element: element
|
|
3069
|
-
});else $e6c6e7929ea385ae$export$c2363754d4758444(new Error("AIO can't find elements, try adding a selector or els")); // don't throw so that a2c tracking keeps working
|
|
3070
|
-
// Page A2C button tracking
|
|
3071
|
-
const a2c_handler = ({
|
|
3072
|
-
element: element
|
|
3073
|
-
}) => {
|
|
3074
|
-
$c8263a2185830bf1$export$2c34560c3749dc63(element, get_product_id, (product_id, recommendation_id, was_unmatching) => {
|
|
3075
|
-
if (!was_unmatching) $d3d8549954e0318e$export$bf205937e5e012cb();
|
|
3076
|
-
$e0a87646d12cb987$export$9028351cb994757e({
|
|
3077
|
-
...(options.t || {}),
|
|
3078
|
-
...options,
|
|
3079
|
-
product_id: product_id,
|
|
3080
|
-
...(recommendation_id == "not_depict" || was_unmatching ? {
|
|
3081
|
-
attribution_id: "recommendation"
|
|
3082
|
-
} : {
|
|
3083
|
-
recommendation_id: recommendation_id
|
|
3084
|
-
})
|
|
3085
|
-
});
|
|
3086
|
-
}, options.always_track_a2c);
|
|
3087
|
-
if (options.shade) $fbb09973782881cb$export$6ebd242c09192cec(element);
|
|
3088
|
-
};
|
|
3089
|
-
if (typeof a2c_selector == "string") (0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onexists(a2c_selector, a2c_handler);else if (a2c_elements && typeof a2c_elements?.[Symbol.iterator] == "function") for (const element of a2c_elements) a2c_handler({
|
|
3090
|
-
element: element
|
|
3091
|
-
});else $e6c6e7929ea385ae$export$c2363754d4758444(new Error("Can't find a2c button, try adding a selector or els"));
|
|
3092
|
-
return {
|
|
3093
|
-
add_a2c_element: element => a2c_handler({
|
|
3094
|
-
element: element
|
|
3095
|
-
}),
|
|
3096
|
-
add_product_element: element => add_tracking_to_product_card({
|
|
3097
|
-
element: element
|
|
3098
|
-
})
|
|
3099
|
-
};
|
|
3100
|
-
});
|
|
3101
|
-
const $fbb09973782881cb$export$6ebd242c09192cec = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(element => {
|
|
3102
|
-
element.style.boxShadow = "rgba(255,0,0,0.5) 10px 10px 30px 40px";
|
|
3103
|
-
element.style.background = "rgba(255,0,0,0.5)";
|
|
3104
|
-
element.style.color = "white";
|
|
3105
|
-
});
|
|
3106
|
-
|
|
3107
|
-
// not ideal but can help when debugging via sentry
|
|
3108
|
-
/**
|
|
3109
|
-
* A function that attempts to "serialize" an object to a text representation that helps with debugging when using sentry
|
|
3110
|
-
* @param anything Something to try to serialize - this function is crappy and your mileage may vary
|
|
3111
|
-
* @param depth How deep to go when recursing
|
|
3112
|
-
* @return An object that is somehow closer to text (better serializable by sentry) or text
|
|
3113
|
-
*/
|
|
3114
|
-
function $45e05ec4fd7f1ee7$export$39d526a1194b6499(anything, depth) {
|
|
3115
|
-
depth ??= 0;
|
|
3116
|
-
depth++;
|
|
3117
|
-
if (depth > 30) return anything;
|
|
3118
|
-
const output = {};
|
|
3119
|
-
for (const key in anything) {
|
|
3120
|
-
const value = anything[key];
|
|
3121
|
-
let serialized_value;
|
|
3122
|
-
if (value instanceof Element) serialized_value = value.cloneNode(false).outerHTML;else if (value instanceof Headers) serialized_value = Object.fromEntries(value.entries());else if (typeof value == "object" && value != null && (typeof value[Symbol.iterator] === "function" || value instanceof Response)) serialized_value = $45e05ec4fd7f1ee7$export$39d526a1194b6499(value, depth);else serialized_value = value?.toString?.();
|
|
3123
|
-
output[key] = serialized_value;
|
|
3124
|
-
}
|
|
3125
|
-
return output;
|
|
3126
|
-
}
|
|
3127
|
-
const $55769f63ea4d8da4$export$5c069c93d2b7493f = delay => new Promise(resolve => setTimeout(resolve, delay));
|
|
3128
|
-
async function $d2fc3fb450961938$export$bcd70d5ed1cf6313(url, options, max_retries = 10, useFetch = fetch) {
|
|
3129
|
-
const ONE_MINUTE = 60000;
|
|
3130
|
-
const max_backoff_ms = ONE_MINUTE;
|
|
3131
|
-
const {
|
|
3132
|
-
stack: stack
|
|
3133
|
-
} = new Error();
|
|
3134
|
-
const calculate_retry = delay => {
|
|
3135
|
-
delay *= 2 + Math.random();
|
|
3136
|
-
if (delay > max_backoff_ms) delay = max_backoff_ms * (1 + Math.random() / 10);
|
|
3137
|
-
return delay;
|
|
3138
|
-
};
|
|
3139
|
-
let try_again_in_ms = 100;
|
|
3140
|
-
let has_succeeded = false;
|
|
3141
|
-
let result = false;
|
|
3142
|
-
while (max_retries && !has_succeeded) try {
|
|
3143
|
-
const response = await useFetch(url, options);
|
|
3144
|
-
const {
|
|
3145
|
-
status: status,
|
|
3146
|
-
ok: ok
|
|
3147
|
-
} = response;
|
|
3148
|
-
if (!response || !ok || status !== 200) {
|
|
3149
|
-
if (status >= 400 && status < 500) {
|
|
3150
|
-
$268cbd9e4ade92db$export$b3bbfd758f11cfa9($d2fc3fb450961938$var$send_sentry_4xx)(response, options?.body || {}, stack);
|
|
3151
|
-
has_succeeded = true;
|
|
3152
|
-
} else if (status === 404) has_succeeded = true;
|
|
3153
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("Response not ok", response);
|
|
3154
|
-
} else has_succeeded = true;
|
|
3155
|
-
result = response;
|
|
3156
|
-
} catch (error) {
|
|
3157
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("Error while fetching: ", error, url, options);
|
|
3158
|
-
// Don't retry CORS
|
|
3159
|
-
if (error.message.includes("CORS") && error.name.includes("CORS")) has_succeeded = true;
|
|
3160
|
-
} finally {
|
|
3161
|
-
if (!has_succeeded) await $55769f63ea4d8da4$export$5c069c93d2b7493f(try_again_in_ms);
|
|
3162
|
-
try_again_in_ms = calculate_retry(try_again_in_ms);
|
|
3163
|
-
max_retries -= 1;
|
|
3164
|
-
}
|
|
3165
|
-
return result;
|
|
3166
|
-
}
|
|
3167
|
-
async function $d2fc3fb450961938$var$send_sentry_4xx(response, body, stack) {
|
|
3168
|
-
if (process.env.TENANT === "shopify-config" && response.status === 403)
|
|
3169
|
-
// Don't send requests in the shopify admin that say we need to re-authorize to sentry
|
|
3170
|
-
return;
|
|
3171
|
-
const msg = `Validation error: got 4XX from API`;
|
|
3172
|
-
const text = await response.clone().text();
|
|
3173
|
-
$e6c6e7929ea385ae$export$de56f1198d121036(msg, "body", body, "response", response, "text", text, "stack", stack);
|
|
3174
|
-
(0, $61a34358bf0d3d8b$export$af2e17a20c2ea3c5).withScope(function (scope) {
|
|
3175
|
-
scope.setExtra("stack", stack);
|
|
3176
|
-
scope.setExtra("request_body", body);
|
|
3177
|
-
scope.setExtra("response", response);
|
|
3178
|
-
scope.setExtra("serialized_response", $45e05ec4fd7f1ee7$export$39d526a1194b6499(response));
|
|
3179
|
-
scope.setExtra("response_text", text);
|
|
3180
|
-
scope.setLevel("error");
|
|
3181
|
-
this.captureException(new Error(msg));
|
|
3182
|
-
});
|
|
3183
|
-
}
|
|
3184
|
-
async function $94edfb6d9c42a288$export$1bc0df10745d5412(t, options, headers, get_url = $94edfb6d9c42a288$var$default_get_fetch_url) {
|
|
3185
|
-
const res = await $94edfb6d9c42a288$export$d40679eb4cf32f09(t, options, headers, get_url);
|
|
3186
|
-
return res?.displays || [];
|
|
3187
|
-
}
|
|
3188
|
-
async function $94edfb6d9c42a288$export$d40679eb4cf32f09(t, options, headers, get_url = $94edfb6d9c42a288$var$default_get_fetch_url) {
|
|
3189
|
-
const session_id = options.session_id || $e0a87646d12cb987$export$61e7e1f11e96692f();
|
|
3190
|
-
const body = {
|
|
3191
|
-
tenant: t.tenant,
|
|
3192
|
-
market: t.market,
|
|
3193
|
-
session_id: session_id,
|
|
3194
|
-
document_referrer: document.referrer,
|
|
3195
|
-
...options
|
|
3196
|
-
};
|
|
3197
|
-
const endpoint = $94edfb6d9c42a288$var$get_fetch_endpoint_from_options(options);
|
|
3198
|
-
return await $d2fc3fb450961938$export$bcd70d5ed1cf6313(get_url(endpoint), {
|
|
3199
|
-
body: JSON.stringify(body),
|
|
3200
|
-
...(headers ? {
|
|
3201
|
-
headers: headers
|
|
3202
|
-
} : {}),
|
|
3203
|
-
method: "POST"
|
|
3204
|
-
}) // @ts-ignore
|
|
3205
|
-
.then(r => r.json()).catch(e => $e6c6e7929ea385ae$export$de56f1198d121036("fetch_retry threw", e));
|
|
3206
|
-
}
|
|
3207
|
-
function $94edfb6d9c42a288$var$default_get_fetch_url(type) {
|
|
3208
|
-
return $e4a18bf12ad092d9$export$fe609f0216e4ebef(`${(0, $4c6861fbcd3a0611$export$362abebb4b313340)}/v2/recommend/products/${type}`);
|
|
3209
|
-
}
|
|
3210
|
-
function $94edfb6d9c42a288$var$get_fetch_endpoint_from_options(options) {
|
|
3211
|
-
if (options["category_id"] !== undefined) return "category";else if (options["product_id"] !== undefined) return "product";else if (options["product_ids"] !== undefined) return "products";
|
|
3212
|
-
return "general";
|
|
3213
|
-
}
|
|
3214
|
-
async function $558ccd2de887e6d9$export$a9fc160c5ed83bd7(t, rendering_options) {
|
|
3215
|
-
// clone options to prevent nasty bugs where changes of options change the options somewhere else too
|
|
3216
|
-
rendering_options = $558ccd2de887e6d9$export$c42139a43c877ecd(rendering_options);
|
|
3217
|
-
const {
|
|
3218
|
-
type: type
|
|
3219
|
-
} = rendering_options;
|
|
3220
|
-
const displays = await $558ccd2de887e6d9$var$make_sure_we_have_displays(t, rendering_options);
|
|
3221
|
-
if (!displays?.length) {
|
|
3222
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("RR: Got no displays for type " + type + ", can't recover.", t, rendering_options);
|
|
3223
|
-
return {};
|
|
3224
|
-
}
|
|
3225
|
-
// return if too few displays
|
|
3226
|
-
const {
|
|
3227
|
-
min_items_to_run: min_items_to_run
|
|
3228
|
-
} = rendering_options;
|
|
3229
|
-
const good_displays = await $558ccd2de887e6d9$var$check_displays(displays, min_items_to_run).catch((0, $548fd58b14b25a52$export$8048b892d651b310));
|
|
3230
|
-
if (!good_displays) return {};
|
|
3231
|
-
const processed_displays = await $558ccd2de887e6d9$export$c22e610107c5a15a(t, rendering_options, displays);
|
|
3232
|
-
if (!processed_displays.length) {
|
|
3233
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("RR: No displays left after preprocessing");
|
|
3234
|
-
return {};
|
|
3235
|
-
}
|
|
3236
|
-
const {
|
|
3237
|
-
template: template,
|
|
3238
|
-
post_processors = []
|
|
3239
|
-
} = rendering_options;
|
|
3240
|
-
const caught_post_processing_functions = post_processors.map(post_pro => $268cbd9e4ade92db$export$b3bbfd758f11cfa9(post_pro));
|
|
3241
|
-
let a;
|
|
3242
|
-
const caught_html2elems = $268cbd9e4ade92db$export$b3bbfd758f11cfa9((0, $bf7f12fe044e41b2$export$44951404cb8d0583));
|
|
3243
|
-
let output_elements;
|
|
3244
|
-
if (typeof template === "function") {
|
|
3245
|
-
const caught_template = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(template);
|
|
3246
|
-
output_elements = (await Promise.allSettled(processed_displays.map(async (display, index) => {
|
|
3247
|
-
const event_listeners = [];
|
|
3248
|
-
let keep = true;
|
|
3249
|
-
const info = new $558ccd2de887e6d9$export$da854280fb61cd32(t, rendering_options, displays, index, () => keep = false, event_listeners);
|
|
3250
|
-
const template_result = await caught_template(display, info);
|
|
3251
|
-
if (!keep) throw keep;
|
|
3252
|
-
const elements = (typeof template_result == "string" ? caught_html2elems(template_result) : template_result) || [];
|
|
3253
|
-
const post_processed_elements = await $558ccd2de887e6d9$export$cf7cbc6b76039101(t, rendering_options, processed_displays, index, caught_post_processing_functions, elements, event_listeners);
|
|
3254
|
-
return Array.from(post_processed_elements);
|
|
3255
|
-
}))).filter(p => p.status === "fulfilled").map(p => p.value).flat();
|
|
3256
|
-
// I don't want to use anything using spread since spread is a nice form of apply and
|
|
3257
|
-
// there's a - browser engine dependant - limit of arguments that can be applied to a function
|
|
3258
|
-
// we don't know how this will be used and want it to be robust
|
|
3259
|
-
} else output_elements = (await Promise.all(processed_displays.map(async (display, index) => {
|
|
3260
|
-
const html = $558ccd2de887e6d9$export$e0009e7da572f99b(template, display);
|
|
3261
|
-
const elements = caught_html2elems(html) || [];
|
|
3262
|
-
const post_processed_elements = await $558ccd2de887e6d9$export$cf7cbc6b76039101(t, rendering_options, processed_displays, index, caught_post_processing_functions, elements);
|
|
3263
|
-
return Array.from(post_processed_elements);
|
|
3264
|
-
}))).flat();
|
|
3265
|
-
if (!output_elements.length) {
|
|
3266
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("RR: No displays left after postprocessing/rendering");
|
|
3267
|
-
return {};
|
|
3268
|
-
}
|
|
3269
|
-
return {
|
|
3270
|
-
elements: output_elements,
|
|
3271
|
-
displays: processed_displays
|
|
3272
|
-
};
|
|
3273
|
-
}
|
|
3274
|
-
function $558ccd2de887e6d9$export$e0009e7da572f99b(template, display = {}) {
|
|
3275
|
-
const discount_matcher = /{DISCOUNT{([\s\S]+?)}}/g;
|
|
3276
|
-
const no_discount_matcher = /{NODISCOUNT{([\s\S]+?)}}/g;
|
|
3277
|
-
if ("variant_index" in display) throw new Error("Modern display in ancient templating");
|
|
3278
|
-
const {
|
|
3279
|
-
sale_price: sale_price,
|
|
3280
|
-
original_price: original_price
|
|
3281
|
-
} = display;
|
|
3282
|
-
if (sale_price !== original_price) template = template.replaceAll(discount_matcher, "$1").replaceAll(no_discount_matcher, "");else template = template.replaceAll(discount_matcher, "").replaceAll(no_discount_matcher, "$1");
|
|
3283
|
-
// Conditional statements
|
|
3284
|
-
// {if VAR_NAME}
|
|
3285
|
-
// print this if true
|
|
3286
|
-
// {else}
|
|
3287
|
-
// print this if false
|
|
3288
|
-
// {end}
|
|
3289
|
-
// Note: these can't be nested. Else statement is optional
|
|
3290
|
-
template = template.replace(/{if\s+(.+?)}([\S\s]*?)(?:{else}([\S\s]*?))?{end}/g, (_, variable, if_yes, if_no) => {
|
|
3291
|
-
if (typeof if_no !== "string")
|
|
3292
|
-
// if_no is a number if there's no {else} statement
|
|
3293
|
-
if_no = "";
|
|
3294
|
-
return display[variable] ? if_yes : if_no;
|
|
3295
|
-
});
|
|
3296
|
-
return template.replace(/\${(.*?)}/g, (_, g) => display[g] ?? "");
|
|
3297
|
-
// this is copied from here, I hope I'm not breaking any licenses. Need it to transpile for IE11 compatiblity:
|
|
3298
|
-
// https://github.com/mikemaccana/dynamic-template/blob/master/index.js
|
|
3299
|
-
}
|
|
3300
|
-
|
|
3301
|
-
function $558ccd2de887e6d9$export$c42139a43c877ecd(obj) {
|
|
3302
|
-
if (obj && typeof obj === "object" && !(obj instanceof Promise)) {
|
|
3303
|
-
// @ts-ignore (I don't know how to type this)
|
|
3304
|
-
const new_obj = Object.assign(new obj.constructor(), obj);
|
|
3305
|
-
for (const key in new_obj) if (typeof new_obj[key] === "object") new_obj[key] = $558ccd2de887e6d9$export$c42139a43c877ecd(new_obj[key]);
|
|
3306
|
-
return new_obj;
|
|
3307
|
-
}
|
|
3308
|
-
return obj;
|
|
3309
|
-
}
|
|
3310
|
-
async function $558ccd2de887e6d9$export$cf7cbc6b76039101(t, rendering_options, displays, index, functions, elements, event_listeners = []) {
|
|
3311
|
-
let keep = true;
|
|
3312
|
-
const info = new $558ccd2de887e6d9$export$da854280fb61cd32(t, rendering_options, displays, index, () => keep = false, event_listeners);
|
|
3313
|
-
for (let i = 0; i < functions.length; i++) {
|
|
3314
|
-
const result = await functions[i](elements, displays[index], info);
|
|
3315
|
-
if (result) elements = result;
|
|
3316
|
-
if (!keep) break;
|
|
3317
|
-
}
|
|
3318
|
-
if (keep) {
|
|
3319
|
-
for (let i = 0; i < event_listeners.length; i++) for (let j = 0; j < elements.length; j++) elements[j].addEventListener(...event_listeners[i]);
|
|
3320
|
-
}
|
|
3321
|
-
return keep ? elements : [];
|
|
3322
|
-
}
|
|
3323
|
-
async function $558ccd2de887e6d9$export$c22e610107c5a15a(t, rendering_options, displays) {
|
|
3324
|
-
const {
|
|
3325
|
-
max_items: max_items,
|
|
3326
|
-
pre_processors = []
|
|
3327
|
-
} = rendering_options;
|
|
3328
|
-
const caught_pre_processors = pre_processors.map(pre_pro => $268cbd9e4ade92db$export$b3bbfd758f11cfa9(pre_pro));
|
|
3329
|
-
const processed_displays = [];
|
|
3330
|
-
for (let i = 0; i < displays.length; i++) {
|
|
3331
|
-
// classic for loop is both fast and can be stopped with break
|
|
3332
|
-
let keep = true;
|
|
3333
|
-
const info_for_pre_pro = new $558ccd2de887e6d9$export$da854280fb61cd32(t, rendering_options, displays, i, () => keep = false);
|
|
3334
|
-
let display = displays[i];
|
|
3335
|
-
for (let j = 0; j < caught_pre_processors.length; j++) {
|
|
3336
|
-
const pre_processor = caught_pre_processors[j];
|
|
3337
|
-
const result = await pre_processor(display, info_for_pre_pro);
|
|
3338
|
-
if (result) display = result; // Don't understand why this cast is needed
|
|
3339
|
-
if (!keep) break;
|
|
3340
|
-
}
|
|
3341
|
-
if (keep) processed_displays.push(display);
|
|
3342
|
-
if (processed_displays.length >= max_items) break;
|
|
3343
|
-
}
|
|
3344
|
-
return processed_displays;
|
|
3345
|
-
}
|
|
3346
|
-
class $558ccd2de887e6d9$export$da854280fb61cd32 {
|
|
3347
|
-
constructor(t, rendering_options, displays, index, remove_display, event_listeners) {
|
|
3348
|
-
// @ts-ignore Support for no-tenant recommendation rendering for js-ui/react-ui
|
|
3349
|
-
this.t = t;
|
|
3350
|
-
this.rendering_options = rendering_options;
|
|
3351
|
-
this.displays = displays;
|
|
3352
|
-
if (index != null) this.index = index;
|
|
3353
|
-
if (remove_display) this.remove_display = remove_display;
|
|
3354
|
-
if (event_listeners) {
|
|
3355
|
-
this.event_listeners = event_listeners;
|
|
3356
|
-
this.register_event_listener = (...args) => this.event_listeners.push(args);
|
|
3357
|
-
}
|
|
3358
|
-
}
|
|
3359
|
-
}
|
|
3360
|
-
async function $558ccd2de887e6d9$var$check_displays(displays, min_items_to_run) {
|
|
3361
|
-
// don't run if too few recs
|
|
3362
|
-
if (min_items_to_run && displays.length < min_items_to_run) {
|
|
3363
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("RR: Got too few displays, exiting");
|
|
3364
|
-
return false;
|
|
3365
|
-
}
|
|
3366
|
-
return true;
|
|
3367
|
-
}
|
|
3368
|
-
async function $558ccd2de887e6d9$var$make_sure_we_have_displays(t, rendering_options) {
|
|
3369
|
-
const recs = await rendering_options.recs;
|
|
3370
|
-
if (Array.isArray(recs)) return $558ccd2de887e6d9$export$c42139a43c877ecd(recs);
|
|
3371
|
-
if (!t)
|
|
3372
|
-
// No recs and no tenant, so we can't get any. Should never happen.
|
|
3373
|
-
return [];
|
|
3374
|
-
// get displays with get_displays if none are provided
|
|
3375
|
-
const get_displays_options = {
|
|
3376
|
-
type: rendering_options.type,
|
|
3377
|
-
...(rendering_options.extra_api_options || {})
|
|
3378
|
-
};
|
|
3379
|
-
for (const key of ["product_ids", "category_id", "product_id"]) if (key in rendering_options) get_displays_options[key] = rendering_options[key];
|
|
3380
|
-
return await $94edfb6d9c42a288$export$1bc0df10745d5412(t, get_displays_options, rendering_options.headers || {}).catch(t.err);
|
|
3381
|
-
}
|
|
3382
|
-
async function $e5479d0db39d328b$export$c83d8da642b5104a(t, options, GWVM_opts) {
|
|
3383
|
-
const {
|
|
3384
|
-
catchify: catchify,
|
|
3385
|
-
dlog: dlog,
|
|
3386
|
-
is_debug: is_debug
|
|
3387
|
-
} = t;
|
|
3388
|
-
const {
|
|
3389
|
-
container_selector = ".grid",
|
|
3390
|
-
container_template: container_template,
|
|
3391
|
-
start_rows = 1,
|
|
3392
|
-
rows_per_click = 1,
|
|
3393
|
-
override_rec_renderer: override_rec_renderer,
|
|
3394
|
-
button: button,
|
|
3395
|
-
title: title,
|
|
3396
|
-
title_selector: title_selector,
|
|
3397
|
-
only_full_rows = false,
|
|
3398
|
-
should_preload = true
|
|
3399
|
-
} = GWVM_opts;
|
|
3400
|
-
const outer_els = typeof container_template === "string" ? [...$bf7f12fe044e41b2$export$44951404cb8d0583(container_template)] : container_template;
|
|
3401
|
-
const [root] = $bf7f12fe044e41b2$export$5e63aea0cac01fa0(outer_els, container_selector);
|
|
3402
|
-
const cut_off_promise_obj = /*@__PURE__*/new (0, $04a37742898e4bd5$export$32ccf3a614c84258)();
|
|
3403
|
-
const i_observer = new IntersectionObserver(catchify($e5479d0db39d328b$var$observer_callback));
|
|
3404
|
-
let cut_off_point = 0;
|
|
3405
|
-
const recs_per_row = () => typeof GWVM_opts.recs_per_row === "function" ? GWVM_opts.recs_per_row(cut_off_point) : GWVM_opts.recs_per_row ?? 6;
|
|
3406
|
-
cut_off_point = recs_per_row() * start_rows;
|
|
3407
|
-
const get_show_next_num = () => recs_per_row() * rows_per_click;
|
|
3408
|
-
const preload_next_row = catchify(() => {
|
|
3409
|
-
const preload_these = [...rendering_results.displays].slice(cut_off_point, cut_off_point + get_show_next_num());
|
|
3410
|
-
for (const elem of preload_these) {
|
|
3411
|
-
const img = new Image();
|
|
3412
|
-
img.src = elem.image_url;
|
|
3413
|
-
// Element should be garbage collected, and the image source put in cache
|
|
3414
|
-
// https://stackoverflow.com/questions/3646036/preloading-images-with-javascript
|
|
3415
|
-
}
|
|
3416
|
-
});
|
|
3417
|
-
|
|
3418
|
-
const load_more = catchify(num => {
|
|
3419
|
-
const adds = typeof num == "number" ? num : get_show_next_num();
|
|
3420
|
-
cut_off_point += adds;
|
|
3421
|
-
cut_off_promise_obj.resolve(cut_off_point);
|
|
3422
|
-
if ((only_full_rows ? cut_off_point + adds : cut_off_point) >= displays.length)
|
|
3423
|
-
// TODO: make it remove/add back the button depending on viewport
|
|
3424
|
-
load_more_cont.remove();
|
|
3425
|
-
if (adds > 0 && should_preload) preload_next_row();
|
|
3426
|
-
});
|
|
3427
|
-
const our_post_pro = (elements, display, info) => $e5479d0db39d328b$var$post_processor(elements, display, info, cut_off_point, i_observer, cut_off_promise_obj, load_more);
|
|
3428
|
-
const rendering_results = await (override_rec_renderer || (0, $558ccd2de887e6d9$export$a9fc160c5ed83bd7))(t, {
|
|
3429
|
-
...options,
|
|
3430
|
-
post_processors: [our_post_pro, ...(options.post_processors || [])]
|
|
3431
|
-
});
|
|
3432
|
-
const {
|
|
3433
|
-
elements: rendered_elements,
|
|
3434
|
-
displays: displays
|
|
3435
|
-
} = rendering_results;
|
|
3436
|
-
if (!rendered_elements) {
|
|
3437
|
-
dlog("Grid with view more is stopping because it got no elements");
|
|
3438
|
-
return rendering_results;
|
|
3439
|
-
}
|
|
3440
|
-
root.append(...rendered_elements);
|
|
3441
|
-
const load_more_cont = $bf7f12fe044e41b2$export$d3e2a0560cbf4787(`<div class="load-more-container"></div>`);
|
|
3442
|
-
const button_element = button instanceof Element ? button : $bf7f12fe044e41b2$export$d3e2a0560cbf4787(`<button class="load_more">${button || "Visa mer"}</button>`);
|
|
3443
|
-
button_element.addEventListener("click", load_more);
|
|
3444
|
-
load_more_cont.append(button_element);
|
|
3445
|
-
root.after(load_more_cont);
|
|
3446
|
-
if (should_preload) {
|
|
3447
|
-
const load_more_intersection = async (entries, intersection_observer) => {
|
|
3448
|
-
// Multiple observe calls could potentially (?) be batched into one fn call, so check everything
|
|
3449
|
-
let intersected = false;
|
|
3450
|
-
for (let i = 0; i < entries.length; i++) if (entries[i].isIntersecting) {
|
|
3451
|
-
intersected = true;
|
|
3452
|
-
break;
|
|
3453
|
-
}
|
|
3454
|
-
if (!intersected) return;
|
|
3455
|
-
preload_next_row();
|
|
3456
|
-
intersection_observer.disconnect(); // The load_more button has its own preload call, so this only needs to happen the first time.
|
|
3457
|
-
};
|
|
3458
|
-
|
|
3459
|
-
const load_more_observer = new IntersectionObserver(catchify(load_more_intersection));
|
|
3460
|
-
load_more_observer.observe(load_more_cont);
|
|
3461
|
-
}
|
|
3462
|
-
if (title) {
|
|
3463
|
-
const [title_el] = $bf7f12fe044e41b2$export$5e63aea0cac01fa0(outer_els, title_selector || "h1.title");
|
|
3464
|
-
if (title_el) {
|
|
3465
|
-
if (title instanceof Element) title_el.replaceWith(title);else title_el.innerText = title;
|
|
3466
|
-
} else if (is_debug) {
|
|
3467
|
-
console.error("GWVM: Title set but couldn't find title element. Please specify title_selector", () => {});
|
|
3468
|
-
console.trace();
|
|
3469
|
-
}
|
|
3470
|
-
}
|
|
3471
|
-
return {
|
|
3472
|
-
...rendering_results,
|
|
3473
|
-
elements: outer_els,
|
|
3474
|
-
load_more: load_more
|
|
3475
|
-
};
|
|
3476
|
-
}
|
|
3477
|
-
function $e5479d0db39d328b$var$observer_callback(entries) {
|
|
3478
|
-
for (let i = 0; i < entries.length; i++) if (entries[i].isIntersecting) {
|
|
3479
|
-
const target = entries[i].target;
|
|
3480
|
-
if (!target.src?.length && target.dataset?.src?.length) {
|
|
3481
|
-
target.src = target.dataset.src;
|
|
3482
|
-
target.removeAttribute("data-src");
|
|
3483
|
-
}
|
|
3484
|
-
}
|
|
3485
|
-
}
|
|
3486
|
-
function $e5479d0db39d328b$var$post_processor(elements, _,
|
|
3487
|
-
//display: display,
|
|
3488
|
-
info, cut_off_point, i_observer, cut_off_promise_obj, load_more) {
|
|
3489
|
-
const {
|
|
3490
|
-
catchify: catchify,
|
|
3491
|
-
err: err,
|
|
3492
|
-
dlog: dlog
|
|
3493
|
-
} = info.t;
|
|
3494
|
-
const {
|
|
3495
|
-
index: index
|
|
3496
|
-
} = info;
|
|
3497
|
-
const elements_arr = [...elements];
|
|
3498
|
-
const [an_element_node] = elements_arr.filter(node => node.nodeType == Node.ELEMENT_NODE);
|
|
3499
|
-
const is_initially_hidden = index + 1 > cut_off_point;
|
|
3500
|
-
const extras = info.extras ||= {};
|
|
3501
|
-
extras.load_more ||= load_more;
|
|
3502
|
-
extras.load_more_ipo ||= cut_off_promise_obj;
|
|
3503
|
-
$bf7f12fe044e41b2$export$5e63aea0cac01fa0(elements_arr, "img:not(.filler):not(.ngl):not(.nolazy)").forEach(image => {
|
|
3504
|
-
// "img" also selects "image" in IE11 which can be an SVG element which doesn't have a src property, therefore optional chaining
|
|
3505
|
-
if ((image?.src?.length || image?.dataset?.src) && image?.src?.substr?.(0, 6) != "data:") {
|
|
3506
|
-
if (is_initially_hidden && !image?.dataset.src) {
|
|
3507
|
-
image.dataset.src = image.src;
|
|
3508
|
-
image.removeAttribute("src");
|
|
3509
|
-
}
|
|
3510
|
-
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).wait_for_element(an_element_node).then(catchify(el => {
|
|
3511
|
-
if (el?.offsetParent !== null) image.src ||= image.dataset.src;else i_observer.observe(image);
|
|
3512
|
-
}));
|
|
3513
|
-
}
|
|
3514
|
-
});
|
|
3515
|
-
(async function () {
|
|
3516
|
-
if (is_initially_hidden) for (let i = 0; i < elements_arr.length; i++) {
|
|
3517
|
-
// HTMLElement is a lie, but TS is too dumb to understand that we check for it being a Node the line below this
|
|
3518
|
-
const {
|
|
3519
|
-
style: style
|
|
3520
|
-
} = elements_arr[i];
|
|
3521
|
-
if (style) style.display = "none";
|
|
3522
|
-
}
|
|
3523
|
-
while (true) {
|
|
3524
|
-
cut_off_point = await cut_off_promise_obj.promise;
|
|
3525
|
-
extras.load_more_currently_showing = cut_off_point;
|
|
3526
|
-
if (index + 1 <= cut_off_point) {
|
|
3527
|
-
for (let i = 0; i < elements_arr.length; i++) {
|
|
3528
|
-
const {
|
|
3529
|
-
style: style
|
|
3530
|
-
} = elements_arr[i];
|
|
3531
|
-
if (style) style.display = "";
|
|
3532
|
-
}
|
|
3533
|
-
break;
|
|
3534
|
-
}
|
|
3535
|
-
}
|
|
3536
|
-
})().catch(err);
|
|
3537
|
-
return elements;
|
|
3538
|
-
}
|
|
3539
|
-
async function $d1ef5fbddf08305d$export$41de2959a8dd405d(t, options, GWVM_opts, {
|
|
3540
|
-
rec_selector = ".rec_outer"
|
|
3541
|
-
} = {}) {
|
|
3542
|
-
const {
|
|
3543
|
-
start_rows: wished_start_rows = 1
|
|
3544
|
-
} = GWVM_opts;
|
|
3545
|
-
const {
|
|
3546
|
-
dlog: dlog,
|
|
3547
|
-
err: err,
|
|
3548
|
-
catchify: catchify
|
|
3549
|
-
} = t;
|
|
3550
|
-
let result;
|
|
3551
|
-
let rec;
|
|
3552
|
-
let first = true;
|
|
3553
|
-
const modified_GWVM_opts = {
|
|
3554
|
-
...GWVM_opts,
|
|
3555
|
-
start_rows: 1 / 6,
|
|
3556
|
-
recs_per_row(num) {
|
|
3557
|
-
try {
|
|
3558
|
-
if (result?.elements && rec) {
|
|
3559
|
-
let {
|
|
3560
|
-
parentElement: parentElement
|
|
3561
|
-
} = rec;
|
|
3562
|
-
if (!parentElement) {
|
|
3563
|
-
// first rec was removed
|
|
3564
|
-
[rec] = $bf7f12fe044e41b2$export$5e63aea0cac01fa0(result?.elements || [], rec_selector);
|
|
3565
|
-
parentElement = rec?.parentElement;
|
|
3566
|
-
if (!parentElement) throw new Error("Could not find element matching " + rec_selector + "to calculate width");
|
|
3567
|
-
}
|
|
3568
|
-
const recs_fitting_in_row = Math.floor(parentElement.getBoundingClientRect().width / Math.floor(rec.getBoundingClientRect().width));
|
|
3569
|
-
// this is not entirely accurate because of margins but seems to work 100% of the time for our use case
|
|
3570
|
-
if (recs_fitting_in_row != Infinity) {
|
|
3571
|
-
dlog("We think there are currently", recs_fitting_in_row, "columns");
|
|
3572
|
-
const {
|
|
3573
|
-
children: children
|
|
3574
|
-
} = parentElement;
|
|
3575
|
-
const last_visible = $d1ef5fbddf08305d$var$find_last_visible(children);
|
|
3576
|
-
if (!last_visible) {
|
|
3577
|
-
dlog("It seems like no elements are visible, not loading any");
|
|
3578
|
-
return 0;
|
|
3579
|
-
}
|
|
3580
|
-
if (num % recs_fitting_in_row !== 0) {
|
|
3581
|
-
// X % 0 is NaN, prevent this from happening
|
|
3582
|
-
const fill_last_row = recs_fitting_in_row === 0 ? 0 : recs_fitting_in_row - num % recs_fitting_in_row;
|
|
3583
|
-
result.load_more?.(fill_last_row + recs_fitting_in_row * (wished_start_rows - 1));
|
|
3584
|
-
}
|
|
3585
|
-
// Special case for when it's the first "load more" (which is automatically triggered)
|
|
3586
|
-
if (num === 1 && first) {
|
|
3587
|
-
first = false;
|
|
3588
|
-
return 0;
|
|
3589
|
-
}
|
|
3590
|
-
return recs_fitting_in_row;
|
|
3591
|
-
}
|
|
3592
|
-
}
|
|
3593
|
-
} catch (e) {
|
|
3594
|
-
err(e);
|
|
3595
|
-
}
|
|
3596
|
-
return 6;
|
|
3597
|
-
}
|
|
3598
|
-
};
|
|
3599
|
-
// @ts-ignore
|
|
3600
|
-
result = await $e5479d0db39d328b$export$c83d8da642b5104a(t, options, modified_GWVM_opts);
|
|
3601
|
-
if (!result?.elements)
|
|
3602
|
-
// no chance in finding any elements, API didn't return recs
|
|
3603
|
-
return result;
|
|
3604
|
-
if (typeof result?.load_more == "function") (0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).wait_for_element(rec_selector).then(() => {
|
|
3605
|
-
// we load 1 card to be able to determine the width
|
|
3606
|
-
// in this situation recs_per_row will not return actual recs per row but recs_to_complete_row, so we add one card to get actual recs per row
|
|
3607
|
-
// then we remove the one card again from total calculation
|
|
3608
|
-
result.load_more?.();
|
|
3609
|
-
});else err("Could not find recommendation to calculate recs per row. rec_selector: " + rec_selector);
|
|
3610
|
-
return result;
|
|
3611
|
-
}
|
|
3612
|
-
function $d1ef5fbddf08305d$var$find_last_visible(items) {
|
|
3613
|
-
for (let i = items.length - 1; i > -1; i--) {
|
|
3614
|
-
// @ts-ignore
|
|
3615
|
-
if (items[i]?.offsetParent !== null) return items[i];
|
|
3616
|
-
}
|
|
3617
|
-
}
|
|
3618
|
-
|
|
3619
|
-
/**
|
|
3620
|
-
* @deprecated use async_iterable_ipns instead. This can skip values which yields unexpected results.
|
|
3621
|
-
*/
|
|
3622
|
-
function $7198207999c01453$export$55621c1ce3cd536b() {
|
|
3623
|
-
// the idea is to have a new promise available immediately before one resolves, so to say an infinite promise
|
|
3624
|
-
let internal_resolve; // copy and pasted from iconbeauty
|
|
3625
|
-
const cart_promise_object = {
|
|
3626
|
-
// I feel like Anton is not going to like this extremely awesome approach
|
|
3627
|
-
promise: new Promise(r => internal_resolve = r),
|
|
3628
|
-
// which is why I'm reluctant with making it a library
|
|
3629
|
-
internal_resolve: internal_resolve,
|
|
3630
|
-
// Edit from later on: I have realised that this is actually very useful, it just has a steep learning curve.
|
|
3631
|
-
resolve: argument => {
|
|
3632
|
-
// it allows both not having to call functions in a loop and instead just awaiting the promise from multiple places
|
|
3633
|
-
const oldresolve = cart_promise_object.internal_resolve; // and to effortlessly ensure a process is never running twice with 100% reliability
|
|
3634
|
-
cart_promise_object.promise = new Promise(r => cart_promise_object.internal_resolve = r); // it could be made a class, but I already know this works, so I'll leave it as is
|
|
3635
|
-
oldresolve(argument);
|
|
3636
|
-
}
|
|
3637
|
-
};
|
|
3638
|
-
return cart_promise_object;
|
|
3639
|
-
}
|
|
3640
|
-
|
|
3641
|
-
// import { buildThresholdList } from "../../helpers/build_threshold_list";
|
|
3642
|
-
|
|
3643
|
-
async function $55dae85e9309db86$export$c0a4d29bc45a38c6(t, options, GWVM_opts, {
|
|
3644
|
-
rec_selector = ".rec_outer"
|
|
3645
|
-
} = {}) {
|
|
3646
|
-
const options_for_auto_gwvm = {
|
|
3647
|
-
...GWVM_opts,
|
|
3648
|
-
start_rows: 1
|
|
3649
|
-
};
|
|
3650
|
-
let all_rendered_elements = [];
|
|
3651
|
-
options.post_processors = [...(options.post_processors || []), (elements, display, info) => {
|
|
3652
|
-
all_rendered_elements.push(elements);
|
|
3653
|
-
if (!info.index)
|
|
3654
|
-
// the plan:
|
|
3655
|
-
// observe first element - after dom insertion, count the visible elements and observe the last one thereof
|
|
3656
|
-
// once it enters the view port, unobserve it
|
|
3657
|
-
// once new elements have been loaded, count the visible elements - only once tho, in response of the first one being visible
|
|
3658
|
-
// then attach to last element again and repeat
|
|
3659
|
-
$55dae85e9309db86$var$observe_first_el_after_dominsertion(all_rendered_elements, elements, info.extras.load_more);
|
|
3660
|
-
return elements;
|
|
3661
|
-
}];
|
|
3662
|
-
return await $d1ef5fbddf08305d$export$41de2959a8dd405d(t, options, options_for_auto_gwvm, {
|
|
3663
|
-
rec_selector: rec_selector
|
|
3664
|
-
});
|
|
3665
|
-
}
|
|
3666
|
-
function $55dae85e9309db86$var$observe_first_el_after_dominsertion(all_rendered_elements, elements, load_more) {
|
|
3667
|
-
const element = $55dae85e9309db86$var$find_html_element(elements);
|
|
3668
|
-
if (!element) {
|
|
3669
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("Infinite scroll won't work, couldn't find element to observe", elements);
|
|
3670
|
-
return;
|
|
3671
|
-
}
|
|
3672
|
-
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).wait_for_element(element).then($268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => {
|
|
3673
|
-
$55dae85e9309db86$var$find_last_el_and_observe(all_rendered_elements, load_more);
|
|
3674
|
-
}));
|
|
3675
|
-
}
|
|
3676
|
-
function $55dae85e9309db86$var$find_last_el_and_observe(all_rendered_elements, load_more) {
|
|
3677
|
-
const last_visible_el = $55dae85e9309db86$var$find_last_visible(all_rendered_elements);
|
|
3678
|
-
if (!last_visible_el) return;
|
|
3679
|
-
const i_o = new IntersectionObserver($268cbd9e4ade92db$export$b3bbfd758f11cfa9(records => {
|
|
3680
|
-
for (const record of records) if (record.isIntersecting) {
|
|
3681
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("loading more because of", record);
|
|
3682
|
-
load_more();
|
|
3683
|
-
setTimeout($268cbd9e4ade92db$export$b3bbfd758f11cfa9($55dae85e9309db86$var$find_last_el_and_observe), 0, all_rendered_elements, load_more);
|
|
3684
|
-
i_o.disconnect();
|
|
3685
|
-
}
|
|
3686
|
-
}));
|
|
3687
|
-
i_o.observe(last_visible_el);
|
|
3688
|
-
}
|
|
3689
|
-
function $55dae85e9309db86$var$find_html_element(elements) {
|
|
3690
|
-
// intersection observers don't work on text nodes
|
|
3691
|
-
let element;
|
|
3692
|
-
for (let i = 0; !((element = elements[i++]) instanceof HTMLElement) && element;);
|
|
3693
|
-
return element;
|
|
3694
|
-
}
|
|
3695
|
-
function $55dae85e9309db86$var$find_last_visible(bunch_of_elements) {
|
|
3696
|
-
const considered_elements = bunch_of_elements.map(els => $55dae85e9309db86$var$find_html_element(els));
|
|
3697
|
-
// this is a potentially dangerous assumption - that the visibility status of the first element is the same as all other elements, but it should be true 100% of the time right now since GWVM sets display: none uniformally and why tf would you want it differently?
|
|
3698
|
-
for (let i = 0; i < considered_elements.length; i++) {
|
|
3699
|
-
const respected_element = considered_elements[i];
|
|
3700
|
-
if (!respected_element) {
|
|
3701
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("Infinite scroll error: couldn't find last visible element", bunch_of_elements);
|
|
3702
|
-
return;
|
|
3703
|
-
}
|
|
3704
|
-
if (respected_element.offsetParent === null) {
|
|
3705
|
-
if (!i) {
|
|
3706
|
-
// if index is 0 and we are not visible don't return the element at index -1 from the array - shit will hit the fan. Return the first one and everything should work out fine
|
|
3707
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("Inf scroll: No elements visible, ", considered_elements, "will attach to first el", respected_element);
|
|
3708
|
-
return considered_elements[i];
|
|
3709
|
-
}
|
|
3710
|
-
return considered_elements[i - 1];
|
|
3711
|
-
}
|
|
3712
|
-
}
|
|
3713
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("Seems like all elements are loaded");
|
|
3714
|
-
}
|
|
3715
|
-
async function $8686e45614d71607$export$9eae832ae57fbf(t, css, extra_html) {
|
|
3716
|
-
const head = await (0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).wait_for_element("head"),
|
|
3717
|
-
{
|
|
3718
|
-
dlog: dlog
|
|
3719
|
-
} = t,
|
|
3720
|
-
elems = $bf7f12fe044e41b2$export$44951404cb8d0583(`<style type="text/css">${css}</style>` + (extra_html ? extra_html : ""));
|
|
3721
|
-
dlog("inserting", ...elems, "into", head);
|
|
3722
|
-
head.append(...elems);
|
|
3723
|
-
}
|
|
3724
|
-
function $807b852d8decb547$export$c7187bbd1a7a9244(...args) {
|
|
3725
|
-
$807b852d8decb547$var$placeholder_worker(...args).catch((0, $548fd58b14b25a52$export$8048b892d651b310));
|
|
3726
|
-
return args[0];
|
|
3727
|
-
}
|
|
3728
|
-
async function $807b852d8decb547$var$placeholder_worker(placeholder_elements, final_elements, switching_trigger) {
|
|
3729
|
-
let state = false;
|
|
3730
|
-
let has_sanitized_elements = false;
|
|
3731
|
-
const sanit_el_if_needed = async () => {
|
|
3732
|
-
if (!has_sanitized_elements) {
|
|
3733
|
-
has_sanitized_elements = true;
|
|
3734
|
-
placeholder_elements = await $807b852d8decb547$var$convert_to_node_array(placeholder_elements);
|
|
3735
|
-
final_elements = await $807b852d8decb547$var$convert_to_node_array(final_elements);
|
|
3736
|
-
}
|
|
3737
|
-
};
|
|
3738
|
-
if (switching_trigger instanceof (0, $04a37742898e4bd5$export$32ccf3a614c84258)) while (true) {
|
|
3739
|
-
const new_state = await switching_trigger.promise;
|
|
3740
|
-
if (new_state != state) {
|
|
3741
|
-
await sanit_el_if_needed();
|
|
3742
|
-
await $807b852d8decb547$var$decide_direction_and_switch(placeholder_elements, final_elements, new_state);
|
|
3743
|
-
state = new_state;
|
|
3744
|
-
}
|
|
3745
|
-
} else if (switching_trigger instanceof Promise) {
|
|
3746
|
-
const new_state = await switching_trigger;
|
|
3747
|
-
if (state != new_state) {
|
|
3748
|
-
await sanit_el_if_needed();
|
|
3749
|
-
await $807b852d8decb547$var$decide_direction_and_switch(placeholder_elements, final_elements, new_state);
|
|
3750
|
-
state = new_state;
|
|
3751
|
-
}
|
|
3752
|
-
} else {
|
|
3753
|
-
await sanit_el_if_needed();
|
|
3754
|
-
placeholder_elements[0].addEventListener("placeholder_switch", $41f528c04cc8a8da$export$535946eb77c946dd(async e => {
|
|
3755
|
-
const new_state = e.detail.state;
|
|
3756
|
-
if (state != new_state) {
|
|
3757
|
-
await sanit_el_if_needed();
|
|
3758
|
-
await $807b852d8decb547$var$decide_direction_and_switch(placeholder_elements, final_elements, new_state);
|
|
3759
|
-
state = new_state;
|
|
3760
|
-
}
|
|
3761
|
-
}));
|
|
3762
|
-
}
|
|
3763
|
-
}
|
|
3764
|
-
async function $807b852d8decb547$var$convert_to_node_array(elements) {
|
|
3765
|
-
if (typeof elements == "function") elements = elements();
|
|
3766
|
-
elements = await elements;
|
|
3767
|
-
if (typeof elements[Symbol.iterator] != "function") elements = [elements];
|
|
3768
|
-
return elements;
|
|
3769
|
-
}
|
|
3770
|
-
async function $807b852d8decb547$var$decide_direction_and_switch(placeholder_elements, final_elements, switch_to_final) {
|
|
3771
|
-
if (switch_to_final) $807b852d8decb547$var$switch_elements(placeholder_elements, final_elements);else $807b852d8decb547$var$switch_elements(final_elements, placeholder_elements);
|
|
3772
|
-
}
|
|
3773
|
-
function $807b852d8decb547$var$switch_elements(from, to) {
|
|
3774
|
-
if (!from.length || !to.length) $e6c6e7929ea385ae$export$c2363754d4758444("Cannot switch elements as from or to is empty", from, to);
|
|
3775
|
-
from[0].replaceWith(...to);
|
|
3776
|
-
for (let i = 1; i < from.length; i++) from[i].remove();
|
|
3777
|
-
}
|
|
3778
|
-
class $1da560af170fb839$export$3be7054c61590ee3 {
|
|
3779
|
-
#verbose = false;
|
|
3780
|
-
#images_on_first_page = [];
|
|
3781
|
-
#default_lazyfinder = (() => {
|
|
3782
|
-
const class_this = this;
|
|
3783
|
-
return {
|
|
3784
|
-
unload(image) {
|
|
3785
|
-
for (const element of [image, ...$1da560af170fb839$export$e4741190ccada479(image, "source")]) for (const attr of ["src", "srcset"]) {
|
|
3786
|
-
// I spent 30 minutes on debugging and it turns out IE11 always returns undefined for HTMLImageElementWithLoaded.srcset
|
|
3787
|
-
const attribute_value = element.getAttribute(attr);
|
|
3788
|
-
if (attribute_value?.length) {
|
|
3789
|
-
element.dataset[attr] = attribute_value;
|
|
3790
|
-
element.removeAttribute(attr);
|
|
3791
|
-
}
|
|
3792
|
-
}
|
|
3793
|
-
},
|
|
3794
|
-
load: $268cbd9e4ade92db$export$b3bbfd758f11cfa9(async image => {
|
|
3795
|
-
for (const element of [...$1da560af170fb839$export$e4741190ccada479(image, "source"), image]) {
|
|
3796
|
-
if ("loaded" in element) {
|
|
3797
|
-
if (class_this.#verbose) $e6c6e7929ea385ae$export$de56f1198d121036(element, "is already loading, not loading again");
|
|
3798
|
-
continue;
|
|
3799
|
-
}
|
|
3800
|
-
if (document?.body?.contains?.(image) === false) {
|
|
3801
|
-
if (class_this.#verbose) $e6c6e7929ea385ae$export$de56f1198d121036(element, "has been removed from the DOM, can't load");
|
|
3802
|
-
const {
|
|
3803
|
-
elements: elements
|
|
3804
|
-
} = class_this.lazyfinder;
|
|
3805
|
-
const index = elements.indexOf(image);
|
|
3806
|
-
if (index >= 0) elements.splice(index, 1);
|
|
3807
|
-
continue;
|
|
3808
|
-
}
|
|
3809
|
-
const has_src = element.dataset?.src?.length;
|
|
3810
|
-
const has_srcset = element.dataset?.srcset?.length;
|
|
3811
|
-
if (has_src || has_srcset) {
|
|
3812
|
-
if (class_this.#verbose) $e6c6e7929ea385ae$export$de56f1198d121036("Loading", element);
|
|
3813
|
-
element.loaded = false;
|
|
3814
|
-
// here it's of importance that we give the browser the srcset first, otherwise it (safari) might start loading the fallback src at first
|
|
3815
|
-
if (has_srcset) {
|
|
3816
|
-
// in Safari for some reason sometimes the .sizes attribute isn't set yet, like in https://www.notion.so/depictai/Pictures-in-recommendations-are-not-displayed-88e30e0f98de421e94b9eb273aea21dc. In that case, wait up to one event loop execution for it
|
|
3817
|
-
if (!element.sizes) await new Promise(resolve => {
|
|
3818
|
-
const mo = new MutationObserver($268cbd9e4ade92db$export$b3bbfd758f11cfa9(_records => {
|
|
3819
|
-
if (element.sizes) {
|
|
3820
|
-
resolve();
|
|
3821
|
-
mo.disconnect();
|
|
3822
|
-
}
|
|
3823
|
-
}));
|
|
3824
|
-
mo.observe(element, {
|
|
3825
|
-
attributes: true,
|
|
3826
|
-
attributeFilter: ["sizes"]
|
|
3827
|
-
});
|
|
3828
|
-
setTimeout($268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => {
|
|
3829
|
-
resolve(); // in case ResizeObserver doesn't set .sizes or something
|
|
3830
|
-
mo.disconnect();
|
|
3831
|
-
}));
|
|
3832
|
-
});
|
|
3833
|
-
element.setAttribute("srcset", element.dataset.srcset);
|
|
3834
|
-
element.removeAttribute("data-srcset");
|
|
3835
|
-
}
|
|
3836
|
-
if (has_src) {
|
|
3837
|
-
element.src = element.dataset.src;
|
|
3838
|
-
element.removeAttribute("data-src");
|
|
3839
|
-
}
|
|
3840
|
-
class_this.intersection_observer.unobserve(element);
|
|
3841
|
-
} else {
|
|
3842
|
-
if (element.src?.startsWith?.("data:")) continue;
|
|
3843
|
-
// This happens quite often for reasons unknown. One day we will figure out why, or replace this lazyloader with a new one/native.
|
|
3844
|
-
if (class_this.#verbose) $e6c6e7929ea385ae$export$de56f1198d121036("Cannot load", element, "as it doesn't have a data-src or data-srcset attribute");
|
|
3845
|
-
}
|
|
3846
|
-
}
|
|
3847
|
-
}),
|
|
3848
|
-
get elements() {
|
|
3849
|
-
// define ourselves away with an array containing all elements we find. Said array is "listening" and calling unload and add_load_event_listener on every pushed element
|
|
3850
|
-
const lazyfinder_this = this;
|
|
3851
|
-
const currently_existing = [];
|
|
3852
|
-
Object.defineProperty(lazyfinder_this, "elements", {
|
|
3853
|
-
value: currently_existing
|
|
3854
|
-
});
|
|
3855
|
-
class_this.start_observing_for_new_children_();
|
|
3856
|
-
return currently_existing;
|
|
3857
|
-
}
|
|
3858
|
-
};
|
|
3859
|
-
})();
|
|
3860
|
-
#initiate_new_image(image) {
|
|
3861
|
-
if (image.loaded === true || image.loaded === false) {
|
|
3862
|
-
if (this.#verbose) $e6c6e7929ea385ae$export$de56f1198d121036("Not lazyloading", image, "because it was loaded before or is loading");
|
|
3863
|
-
return;
|
|
3864
|
-
}
|
|
3865
|
-
$268cbd9e4ade92db$export$b3bbfd758f11cfa9(this.lazyfinder.unload)(image);
|
|
3866
|
-
this.#add_load_event_listener(image);
|
|
3867
|
-
this.intersection_observer?.observe?.(image); // observe if observer already exists, otherwise it won't and start_observer will do it
|
|
3868
|
-
}
|
|
2104
|
+
class $1da560af170fb839$export$3be7054c61590ee3 {
|
|
2105
|
+
#verbose = false;
|
|
2106
|
+
#images_on_first_page = [];
|
|
2107
|
+
#default_lazyfinder = (() => {
|
|
2108
|
+
const class_this = this;
|
|
2109
|
+
return {
|
|
2110
|
+
unload(image) {
|
|
2111
|
+
for (const element of [image, ...$1da560af170fb839$export$e4741190ccada479(image, "source")]) for (const attr of ["src", "srcset"]) {
|
|
2112
|
+
// I spent 30 minutes on debugging and it turns out IE11 always returns undefined for HTMLImageElementWithLoaded.srcset
|
|
2113
|
+
const attribute_value = element.getAttribute(attr);
|
|
2114
|
+
if (attribute_value?.length) {
|
|
2115
|
+
element.dataset[attr] = attribute_value;
|
|
2116
|
+
element.removeAttribute(attr);
|
|
2117
|
+
}
|
|
2118
|
+
}
|
|
2119
|
+
},
|
|
2120
|
+
load: $268cbd9e4ade92db$export$b3bbfd758f11cfa9(async image => {
|
|
2121
|
+
for (const element of [...$1da560af170fb839$export$e4741190ccada479(image, "source"), image]) {
|
|
2122
|
+
if ("loaded" in element) {
|
|
2123
|
+
if (class_this.#verbose) $e6c6e7929ea385ae$export$de56f1198d121036(element, "is already loading, not loading again");
|
|
2124
|
+
continue;
|
|
2125
|
+
}
|
|
2126
|
+
if (document?.body?.contains?.(image) === false) {
|
|
2127
|
+
if (class_this.#verbose) $e6c6e7929ea385ae$export$de56f1198d121036(element, "has been removed from the DOM, can't load");
|
|
2128
|
+
const {
|
|
2129
|
+
elements: elements
|
|
2130
|
+
} = class_this.lazyfinder;
|
|
2131
|
+
const index = elements.indexOf(image);
|
|
2132
|
+
if (index >= 0) elements.splice(index, 1);
|
|
2133
|
+
continue;
|
|
2134
|
+
}
|
|
2135
|
+
const has_src = element.dataset?.src?.length;
|
|
2136
|
+
const has_srcset = element.dataset?.srcset?.length;
|
|
2137
|
+
if (has_src || has_srcset) {
|
|
2138
|
+
if (class_this.#verbose) $e6c6e7929ea385ae$export$de56f1198d121036("Loading", element);
|
|
2139
|
+
element.loaded = false;
|
|
2140
|
+
// here it's of importance that we give the browser the srcset first, otherwise it (safari) might start loading the fallback src at first
|
|
2141
|
+
if (has_srcset) {
|
|
2142
|
+
// in Safari for some reason sometimes the .sizes attribute isn't set yet, like in https://www.notion.so/depictai/Pictures-in-recommendations-are-not-displayed-88e30e0f98de421e94b9eb273aea21dc. In that case, wait up to one event loop execution for it
|
|
2143
|
+
if (!element.sizes) await new Promise(resolve => {
|
|
2144
|
+
const mo = new MutationObserver($268cbd9e4ade92db$export$b3bbfd758f11cfa9(_records => {
|
|
2145
|
+
if (element.sizes) {
|
|
2146
|
+
resolve();
|
|
2147
|
+
mo.disconnect();
|
|
2148
|
+
}
|
|
2149
|
+
}));
|
|
2150
|
+
mo.observe(element, {
|
|
2151
|
+
attributes: true,
|
|
2152
|
+
attributeFilter: ["sizes"]
|
|
2153
|
+
});
|
|
2154
|
+
setTimeout($268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => {
|
|
2155
|
+
resolve(); // in case ResizeObserver doesn't set .sizes or something
|
|
2156
|
+
mo.disconnect();
|
|
2157
|
+
}));
|
|
2158
|
+
});
|
|
2159
|
+
element.setAttribute("srcset", element.dataset.srcset);
|
|
2160
|
+
element.removeAttribute("data-srcset");
|
|
2161
|
+
}
|
|
2162
|
+
if (has_src) {
|
|
2163
|
+
element.src = element.dataset.src;
|
|
2164
|
+
element.removeAttribute("data-src");
|
|
2165
|
+
}
|
|
2166
|
+
class_this.intersection_observer.unobserve(element);
|
|
2167
|
+
} else {
|
|
2168
|
+
if (element.src?.startsWith?.("data:")) continue;
|
|
2169
|
+
// This happens quite often for reasons unknown. One day we will figure out why, or replace this lazyloader with a new one/native.
|
|
2170
|
+
if (class_this.#verbose) $e6c6e7929ea385ae$export$de56f1198d121036("Cannot load", element, "as it doesn't have a data-src or data-srcset attribute");
|
|
2171
|
+
}
|
|
2172
|
+
}
|
|
2173
|
+
}),
|
|
2174
|
+
get elements() {
|
|
2175
|
+
// define ourselves away with an array containing all elements we find. Said array is "listening" and calling unload and add_load_event_listener on every pushed element
|
|
2176
|
+
const lazyfinder_this = this;
|
|
2177
|
+
const currently_existing = [];
|
|
2178
|
+
Object.defineProperty(lazyfinder_this, "elements", {
|
|
2179
|
+
value: currently_existing
|
|
2180
|
+
});
|
|
2181
|
+
class_this.start_observing_for_new_children_();
|
|
2182
|
+
return currently_existing;
|
|
2183
|
+
}
|
|
2184
|
+
};
|
|
2185
|
+
})();
|
|
2186
|
+
#initiate_new_image(image) {
|
|
2187
|
+
if (image.loaded === true || image.loaded === false) {
|
|
2188
|
+
if (this.#verbose) $e6c6e7929ea385ae$export$de56f1198d121036("Not lazyloading", image, "because it was loaded before or is loading");
|
|
2189
|
+
return;
|
|
2190
|
+
}
|
|
2191
|
+
$268cbd9e4ade92db$export$b3bbfd758f11cfa9(this.lazyfinder.unload)(image);
|
|
2192
|
+
this.#add_load_event_listener(image);
|
|
2193
|
+
this.intersection_observer?.observe?.(image); // observe if observer already exists, otherwise it won't and start_observer will do it
|
|
2194
|
+
}
|
|
3869
2195
|
|
|
3870
2196
|
start_observing_for_new_children_(override_container) {
|
|
3871
2197
|
// should ONLY run on our "stock" elements array and is therefore called if "elements" is get in it - which means it's being used
|
|
@@ -4385,538 +2711,60 @@ class $1683d0164abd7c1d$export$692b27c28639e5b9 {
|
|
|
4385
2711
|
correct_bs_targets: correct_bs_targets,
|
|
4386
2712
|
button_contents: button_contents,
|
|
4387
2713
|
button_elems: button_elems,
|
|
4388
|
-
autoinvalidate_cache: autoinvalidate_cache
|
|
4389
|
-
}) {
|
|
4390
|
-
dist_to_hide_left && (this.dist_to_hide_left = dist_to_hide_left);
|
|
4391
|
-
dist_to_hide_right && (this.dist_to_hide_right = dist_to_hide_right);
|
|
4392
|
-
stepstoslide && (this.stepstoslide = stepstoslide);
|
|
4393
|
-
center_target && (this.center_target = true);
|
|
4394
|
-
mutation_plugins && (this.#mutation_plugins = mutation_plugins);
|
|
4395
|
-
correct_bs_targets == false && (this.correct_bs_targets = correct_bs_targets);
|
|
4396
|
-
if (button_elems) {
|
|
4397
|
-
this.#elements.right_ = button_elems.right;
|
|
4398
|
-
this.#elements.left_ = button_elems.left;
|
|
4399
|
-
}
|
|
4400
|
-
if (button_contents?.right) this.#elements.right_.append(...button_contents.right);
|
|
4401
|
-
if (button_contents?.left) this.#elements.left_.append(...button_contents.left);
|
|
4402
|
-
$268cbd9e4ade92db$export$b3bbfd758f11cfa9(this.#create_element_structure).call(this, autoinvalidate_cache);
|
|
4403
|
-
// @ts-ignore
|
|
4404
|
-
this.#elements.sliding_el_.slider = this; // dunno if this is dumb? So far nordicagolf/kondomvaruhuset depend on it
|
|
4405
|
-
// plugin functionality i.e. for dots
|
|
4406
|
-
const constructor_args = arguments;
|
|
4407
|
-
constructor_plugins?.forEach?.(mplugin => {
|
|
4408
|
-
$268cbd9e4ade92db$export$b3bbfd758f11cfa9(mplugin).call(this, constructor_args);
|
|
4409
|
-
});
|
|
4410
|
-
}
|
|
4411
|
-
}
|
|
4412
|
-
class $a69a5236b5814082$export$68babfc5be0de5da extends (0, $1683d0164abd7c1d$export$692b27c28639e5b9) {
|
|
4413
|
-
constructor(options, lazyfier_options) {
|
|
4414
|
-
super(options);
|
|
4415
|
-
const lazy_promise = new Promise(r => {
|
|
4416
|
-
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onexists(this.insert_here, ({
|
|
4417
|
-
element: element,
|
|
4418
|
-
disconnector: disconnector
|
|
4419
|
-
}) => {
|
|
4420
|
-
const i_o = new IntersectionObserver($268cbd9e4ade92db$export$b3bbfd758f11cfa9(records => {
|
|
4421
|
-
for (const record of records) if (record.intersectionRatio > 0) {
|
|
4422
|
-
r(true);
|
|
4423
|
-
i_o.disconnect();
|
|
4424
|
-
disconnector();
|
|
4425
|
-
return;
|
|
4426
|
-
}
|
|
4427
|
-
}),
|
|
4428
|
-
// Fixes https://gitlab.com/depict-ai/depict.ai/-/merge_requests/5816/diffs, don't understand why
|
|
4429
|
-
{
|
|
4430
|
-
threshold: $0da0cad4f39e8f32$export$f8ea2e7b15b5d129(10)
|
|
4431
|
-
});
|
|
4432
|
-
i_o.observe(element);
|
|
4433
|
-
});
|
|
4434
|
-
});
|
|
4435
|
-
this.lazyfier = new (0, $1da560af170fb839$export$3be7054c61590ee3)({
|
|
4436
|
-
container: this.insert_here,
|
|
4437
|
-
wait_for_dominsertion: lazy_promise,
|
|
4438
|
-
...(lazyfier_options || {})
|
|
4439
|
-
});
|
|
4440
|
-
}
|
|
4441
|
-
}
|
|
4442
|
-
const $04d2f7d9126af667$export$f37c58ab3d3e3b75 = [$04d2f7d9126af667$export$9e1caada6901f552, (0, $11ff7b46c1fb674c$export$d0efd8ed14f5c33), $04d2f7d9126af667$export$fb9afe9f540ae069, ...(process.env.GTAG_VIEW === "true" ? [$04d2f7d9126af667$export$1bffac19f9f0d6fc] : [])];
|
|
4443
|
-
const $04d2f7d9126af667$export$6830ae1fbe21e589 = [$04d2f7d9126af667$export$e9106d6e723510d2, $04d2f7d9126af667$export$32eb5dd18e963410, (0, $44909e19109bf973$export$58c56fe2313fdbe3), ...(process.env.GTAG === "true" ? [$04d2f7d9126af667$export$8d72437623fef90c] : [])];
|
|
4444
|
-
const $04d2f7d9126af667$export$ed8a68dacd075983 = /*@__PURE__*/new Map();
|
|
4445
|
-
const $04d2f7d9126af667$export$4b50a4de9c6bbe09 = /*@__PURE__*/new WeakSet();
|
|
4446
|
-
function $04d2f7d9126af667$export$fb9afe9f540ae069(elements, _display, info) {
|
|
4447
|
-
if (!elements?.length) return elements;
|
|
4448
|
-
if (!info.t) return elements;
|
|
4449
|
-
const elements_as_array = [...elements];
|
|
4450
|
-
const handler = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(async () => {
|
|
4451
|
-
const {
|
|
4452
|
-
rendering_options: rendering_options,
|
|
4453
|
-
t: t
|
|
4454
|
-
} = info;
|
|
4455
|
-
if (!$04d2f7d9126af667$export$4b50a4de9c6bbe09.has(rendering_options) && elements_as_array.some(e => document.documentElement.contains(e)) // check, just in case
|
|
4456
|
-
) {
|
|
4457
|
-
$04d2f7d9126af667$export$4b50a4de9c6bbe09.add(rendering_options);
|
|
4458
|
-
$e0a87646d12cb987$export$82badda1f9923310({
|
|
4459
|
-
...t,
|
|
4460
|
-
product_id: await t.get_product_id(),
|
|
4461
|
-
recommendation_type: info.rendering_options.type,
|
|
4462
|
-
type: "recommendations_inserted"
|
|
4463
|
-
});
|
|
4464
|
-
}
|
|
4465
|
-
});
|
|
4466
|
-
$04d2f7d9126af667$var$push_function($04d2f7d9126af667$export$fb9afe9f540ae069, handler);
|
|
4467
|
-
const first_el = elements_as_array?.[0];
|
|
4468
|
-
if (first_el instanceof Node) (0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).wait_for_element(first_el).then(handler);
|
|
4469
|
-
return elements;
|
|
4470
|
-
}
|
|
4471
|
-
const $04d2f7d9126af667$export$3777a14dd8c2363d = /*@__PURE__*/new WeakSet();
|
|
4472
|
-
function $04d2f7d9126af667$export$1bffac19f9f0d6fc(elements, _display, info) {
|
|
4473
|
-
if (!elements?.length)
|
|
4474
|
-
// don't make it hurt even more that rendering failed
|
|
4475
|
-
return elements;
|
|
4476
|
-
if (!info.t)
|
|
4477
|
-
// GTAG tracking is deprecated, if we're doing no-tenant recommendation rendering it's SDK anyway.
|
|
4478
|
-
return elements;
|
|
4479
|
-
const [first_element] = elements;
|
|
4480
|
-
const handler = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => {
|
|
4481
|
-
const {
|
|
4482
|
-
rendering_options: rendering_options,
|
|
4483
|
-
displays: displays
|
|
4484
|
-
} = info;
|
|
4485
|
-
if (!$04d2f7d9126af667$export$3777a14dd8c2363d.has(displays)) {
|
|
4486
|
-
$04d2f7d9126af667$export$3777a14dd8c2363d.add(displays);
|
|
4487
|
-
const {
|
|
4488
|
-
get_product_id: get_product_id
|
|
4489
|
-
} = info.t;
|
|
4490
|
-
const {
|
|
4491
|
-
type: type
|
|
4492
|
-
} = rendering_options;
|
|
4493
|
-
$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 */, {
|
|
4494
|
-
list_name: "depict_" + type
|
|
4495
|
-
});
|
|
4496
|
-
}
|
|
4497
|
-
});
|
|
4498
|
-
$04d2f7d9126af667$var$push_function($04d2f7d9126af667$export$1bffac19f9f0d6fc, handler);
|
|
4499
|
-
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onexists(first_element, handler);
|
|
4500
|
-
return elements;
|
|
4501
|
-
}
|
|
4502
|
-
function $04d2f7d9126af667$export$9e1caada6901f552(elements, _display, info) {
|
|
4503
|
-
const {
|
|
4504
|
-
t: t
|
|
4505
|
-
} = info;
|
|
4506
|
-
if (!t) return elements;
|
|
4507
|
-
(async () => {
|
|
4508
|
-
$72ee205b59322497$export$eee4c4d924348b05({
|
|
4509
|
-
tenant: t.tenant,
|
|
4510
|
-
market: t.market,
|
|
4511
|
-
product_id: await t.get_product_id()
|
|
4512
|
-
}).catch((0, $548fd58b14b25a52$export$8048b892d651b310));
|
|
4513
|
-
})();
|
|
4514
|
-
return elements;
|
|
4515
|
-
}
|
|
4516
|
-
function $04d2f7d9126af667$export$8d72437623fef90c(elements, display, info) {
|
|
4517
|
-
const handler = () => {
|
|
4518
|
-
const {
|
|
4519
|
-
ga_product_ids: ga_product_ids,
|
|
4520
|
-
ga_product_id: ga_product_id,
|
|
4521
|
-
product_id: product_id
|
|
4522
|
-
} = display;
|
|
4523
|
-
if (Array.isArray(ga_product_ids)) for (let i = 0; i < ga_product_ids.length; i++) $d3d8549954e0318e$export$f522672c9379e339(ga_product_ids[i], info.index, {
|
|
4524
|
-
list_name: "depict_" + info.rendering_options.type
|
|
4525
|
-
});else $d3d8549954e0318e$export$f522672c9379e339(ga_product_id || product_id, info.index, {
|
|
4526
|
-
list_name: "depict_" + info.rendering_options.type
|
|
4527
|
-
});
|
|
4528
|
-
};
|
|
4529
|
-
$04d2f7d9126af667$var$push_function($04d2f7d9126af667$export$8d72437623fef90c, handler);
|
|
4530
|
-
info.register_event_listener("click", handler, {
|
|
4531
|
-
once: true
|
|
4532
|
-
});
|
|
4533
|
-
return elements;
|
|
4534
|
-
}
|
|
4535
|
-
function $04d2f7d9126af667$export$e9106d6e723510d2(elements, display, info) {
|
|
4536
|
-
const handler = () => {
|
|
4537
|
-
const {
|
|
4538
|
-
t: t,
|
|
4539
|
-
index: index,
|
|
4540
|
-
rendering_options: rendering_options
|
|
4541
|
-
} = info;
|
|
4542
|
-
return $e0a87646d12cb987$export$15f8a0cd5a8c0ebb({
|
|
4543
|
-
...t,
|
|
4544
|
-
...rendering_options,
|
|
4545
|
-
...display,
|
|
4546
|
-
click_location: rendering_options.type + "_" + (index + 1),
|
|
4547
|
-
recommendation_type: rendering_options.type,
|
|
4548
|
-
product_id: "variant_index" in display ? display.variant_displays[display.variant_index].product_id : display.product_id
|
|
4549
|
-
});
|
|
4550
|
-
};
|
|
4551
|
-
$04d2f7d9126af667$var$push_function($04d2f7d9126af667$export$e9106d6e723510d2, handler);
|
|
4552
|
-
info.register_event_listener("click", handler, {
|
|
4553
|
-
once: true
|
|
4554
|
-
});
|
|
4555
|
-
return elements;
|
|
4556
|
-
}
|
|
4557
|
-
function $04d2f7d9126af667$export$32eb5dd18e963410(elements, display, info) {
|
|
4558
|
-
const {
|
|
4559
|
-
search_result_id: search_result_id
|
|
4560
|
-
} = display;
|
|
4561
|
-
const {
|
|
4562
|
-
product_id: product_id,
|
|
4563
|
-
recommendation_id: recommendation_id
|
|
4564
|
-
} = "variant_index" in display ? display.variant_displays[display.variant_index] : display;
|
|
4565
|
-
if (!elements?.length) return elements;
|
|
4566
|
-
for (const element of elements) {
|
|
4567
|
-
const handler = $c8263a2185830bf1$export$82a685f2da2fb027(element, product_id, recommendation_id || search_result_id);
|
|
4568
|
-
if (handler) $04d2f7d9126af667$var$push_function($04d2f7d9126af667$export$32eb5dd18e963410, handler);
|
|
4569
|
-
}
|
|
4570
|
-
return elements;
|
|
4571
|
-
}
|
|
4572
|
-
function $04d2f7d9126af667$export$dd32cb565eae0a1f(elements, display, info) {
|
|
4573
|
-
const handler = () => {
|
|
4574
|
-
$d3d8549954e0318e$export$127751e82111fcf();
|
|
4575
|
-
};
|
|
4576
|
-
$04d2f7d9126af667$var$push_function($04d2f7d9126af667$export$dd32cb565eae0a1f, handler);
|
|
4577
|
-
info.register_event_listener("click", handler, {
|
|
4578
|
-
once: true
|
|
4579
|
-
});
|
|
4580
|
-
return elements;
|
|
4581
|
-
}
|
|
4582
|
-
function $04d2f7d9126af667$var$push_function(fn1, handler) {
|
|
4583
|
-
const fn_array = $04d2f7d9126af667$export$ed8a68dacd075983.get(fn1) || [];
|
|
4584
|
-
fn_array.push(new WeakRef(handler));
|
|
4585
|
-
$04d2f7d9126af667$export$ed8a68dacd075983.set(fn1, fn_array);
|
|
4586
|
-
}
|
|
4587
|
-
const $f3f05d97149aec76$export$deca40f48c0569f8 = typeof window === "undefined" ? false : /*@__PURE__*/localStorage.getItem("colorize-logics") === "true";
|
|
4588
|
-
function $f3f05d97149aec76$export$16501883f477737a(elements, display) {
|
|
4589
|
-
elements.forEach(elem => {
|
|
4590
|
-
if (elem.nodeType !== Node.TEXT_NODE) {
|
|
4591
|
-
// calc a hash for given string
|
|
4592
|
-
const hc = (str = "") => {
|
|
4593
|
-
let hash = 0;
|
|
4594
|
-
if (str.length === 0) return hash;
|
|
4595
|
-
for (let i = 0; i < str.length; i++) {
|
|
4596
|
-
const chr = str.charCodeAt(i);
|
|
4597
|
-
hash = (hash << 5) - hash + chr;
|
|
4598
|
-
hash |= 0;
|
|
4599
|
-
}
|
|
4600
|
-
return hash;
|
|
4601
|
-
};
|
|
4602
|
-
const hash = hc(display.logic);
|
|
4603
|
-
// Change hue based on hash
|
|
4604
|
-
const color = "hsl(" + hash % 360 + ",100%,75%)";
|
|
4605
|
-
if ("style" in elem) elem.style.background = color;
|
|
4606
|
-
// @ts-ignore
|
|
4607
|
-
elem?.setAttribute?.("data-logic", display.logic);
|
|
4608
|
-
// @ts-ignore
|
|
4609
|
-
elem?.setAttribute?.("title", "Logic: " + display.logic);
|
|
4610
|
-
}
|
|
4611
|
-
});
|
|
4612
|
-
return elements;
|
|
4613
|
-
}
|
|
4614
|
-
var $92bde32714bb1e07$export$2e2bcd8739ae039 = $92bde32714bb1e07$export$50ce83ace0cdd87e;
|
|
4615
|
-
async function $92bde32714bb1e07$export$50ce83ace0cdd87e(t, rendering_options) {
|
|
4616
|
-
const {
|
|
4617
|
-
view_tracking: view_tracking,
|
|
4618
|
-
click_tracking: click_tracking
|
|
4619
|
-
} = rendering_options;
|
|
4620
|
-
return await $558ccd2de887e6d9$export$a9fc160c5ed83bd7(t, {
|
|
4621
|
-
...rendering_options,
|
|
4622
|
-
headers: {
|
|
4623
|
-
...((0, $f3f05d97149aec76$export$deca40f48c0569f8) ? {
|
|
4624
|
-
"x-debug": "true"
|
|
4625
|
-
} : {}),
|
|
4626
|
-
...(rendering_options.headers || {})
|
|
4627
|
-
},
|
|
4628
|
-
pre_processors: [...(rendering_options.pre_processors || [])],
|
|
4629
|
-
post_processors: [...(Array.isArray(view_tracking) ? view_tracking : (0, $04d2f7d9126af667$export$f37c58ab3d3e3b75)), ...(Array.isArray(click_tracking) ? click_tracking : (0, $04d2f7d9126af667$export$6830ae1fbe21e589)), ...((0, $f3f05d97149aec76$export$deca40f48c0569f8) ? [(0, $f3f05d97149aec76$export$16501883f477737a)] : []), ...(rendering_options.post_processors || [])]
|
|
4630
|
-
});
|
|
4631
|
-
}
|
|
4632
|
-
async function $3cb558cec98ba1a7$export$cab8bc58c64c2013(t, rendering_options, options_for_us, slider_options) {
|
|
4633
|
-
options_for_us ||= {};
|
|
4634
|
-
const {
|
|
4635
|
-
root_selector: root_selector,
|
|
4636
|
-
override_rec_renderer: local_rr = (0, $92bde32714bb1e07$export$2e2bcd8739ae039),
|
|
4637
|
-
insertion_verb = "replaceWith",
|
|
4638
|
-
lazyfier_options: lazyfier_options
|
|
4639
|
-
} = options_for_us;
|
|
4640
|
-
let {
|
|
4641
|
-
container: container
|
|
4642
|
-
} = options_for_us;
|
|
4643
|
-
if (typeof container == "string") container = [...$bf7f12fe044e41b2$export$44951404cb8d0583(container)];
|
|
4644
|
-
if (container && !Array.isArray(container)) container = [...container];
|
|
4645
|
-
const slider = new (0, $a69a5236b5814082$export$68babfc5be0de5da)({
|
|
4646
|
-
dist_to_hide_left: 10,
|
|
4647
|
-
dist_to_hide_right: 10,
|
|
4648
|
-
...slider_options
|
|
4649
|
-
}, lazyfier_options);
|
|
4650
|
-
const recs = await local_rr(t, {
|
|
4651
|
-
...rendering_options,
|
|
4652
|
-
post_processors: [(elements, display) => {
|
|
4653
|
-
$bf7f12fe044e41b2$export$5e63aea0cac01fa0(elements, ".rec_outer").forEach(ro => ro.classList.add("noautospacing"));
|
|
4654
|
-
return elements;
|
|
4655
|
-
}, ...(rendering_options.post_processors || [])]
|
|
4656
|
-
});
|
|
4657
|
-
if (!recs.elements) {
|
|
4658
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("Pro_Slider says bye bye cuz no recs");
|
|
4659
|
-
return {};
|
|
4660
|
-
}
|
|
4661
|
-
slider.insert_here.append(...recs.elements);
|
|
4662
|
-
if (container) {
|
|
4663
|
-
const [root] = $bf7f12fe044e41b2$export$5e63aea0cac01fa0(container, root_selector || ".grid");
|
|
4664
|
-
root[insertion_verb](slider.container);
|
|
4665
|
-
}
|
|
4666
|
-
return {
|
|
4667
|
-
...recs,
|
|
4668
|
-
displays: recs.displays,
|
|
4669
|
-
elements: container ? container : [slider.container]
|
|
4670
|
-
};
|
|
4671
|
-
}
|
|
4672
|
-
const $0b6a8303b64cced1$var$discountMatcher = /{DISCOUNT{([\s\S]+?)}}/g;
|
|
4673
|
-
const $0b6a8303b64cced1$var$noDiscountMatcher = /{NODISCOUNT{([\s\S]+?)}}/g;
|
|
4674
|
-
let $0b6a8303b64cced1$var$pageview_sent = false;
|
|
4675
|
-
class $0b6a8303b64cced1$export$1a8782481a9af507 {
|
|
4676
|
-
constructor(settings) {
|
|
4677
|
-
this.settings = settings;
|
|
4678
|
-
}
|
|
4679
|
-
#dispatched_recs_inserted = false;
|
|
4680
|
-
init(callback, existingDisplays) {
|
|
4681
|
-
if (!this.settings.DNT) this.trackPageView();
|
|
4682
|
-
if (!existingDisplays) this.loadRecommendations(callback);else {
|
|
4683
|
-
this.data = existingDisplays;
|
|
4684
|
-
callback();
|
|
4685
|
-
}
|
|
4686
|
-
}
|
|
4687
|
-
loadRecommendations(callback) {
|
|
4688
|
-
const {
|
|
4689
|
-
tenant: tenant,
|
|
4690
|
-
product_id: product_id,
|
|
4691
|
-
type: type,
|
|
4692
|
-
market: market
|
|
4693
|
-
} = this.settings;
|
|
4694
|
-
$94edfb6d9c42a288$export$1bc0df10745d5412(
|
|
4695
|
-
// @ts-ignore - Quick workaround, as we don't have a tenant object here
|
|
4696
|
-
{
|
|
4697
|
-
tenant: tenant,
|
|
4698
|
-
market: market
|
|
4699
|
-
}, {
|
|
4700
|
-
type: type,
|
|
4701
|
-
product_id: product_id()
|
|
4702
|
-
}).then(recs => {
|
|
4703
|
-
this.data = recs;
|
|
4704
|
-
$eee5951374097b61$export$8582cf3716962dc2({
|
|
4705
|
-
...this.settings,
|
|
4706
|
-
recs: this.data,
|
|
4707
|
-
min_recs: this.settings.min_items || this.settings.max_items
|
|
4708
|
-
});
|
|
4709
|
-
}).catch(e => {
|
|
4710
|
-
if (this.settings.debug) console.warn("template-tool: error fetching: ", e);
|
|
4711
|
-
}).finally(() => callback());
|
|
4712
|
-
}
|
|
4713
|
-
trackGAEvent(action, index, product_id, ga_product_ids) {
|
|
4714
|
-
if (this.settings.sendGa === false) return;
|
|
4715
|
-
// @ts-ignore
|
|
4716
|
-
if (typeof ga !== "function") {
|
|
4717
|
-
console.log("Could not send", action, "to GA. analytics.js not loaded.");
|
|
4718
|
-
return;
|
|
4719
|
-
}
|
|
4720
|
-
if (!action || action instanceof Event) action = "rec_bar_click";
|
|
4721
|
-
if (action == "rec_bar_click" && typeof index != "undefined" && product_id) {
|
|
4722
|
-
if (Array.isArray(ga_product_ids)) for (const id of ga_product_ids) $d3d8549954e0318e$export$f522672c9379e339(id, index, {
|
|
4723
|
-
list_name: "depict_" + this.settings.type
|
|
4724
|
-
});else $d3d8549954e0318e$export$f522672c9379e339(product_id, index, {
|
|
4725
|
-
list_name: "depict_" + this.settings.type
|
|
4726
|
-
});
|
|
4727
|
-
}
|
|
4728
|
-
if (this.tracker === undefined)
|
|
4729
|
-
// @ts-ignore
|
|
4730
|
-
this.tracker = ga("create", this.settings.gaid, "auto", "depict");
|
|
4731
|
-
$d3d8549954e0318e$export$f75172d2e289cd02(action);
|
|
4732
|
-
}
|
|
4733
|
-
trackPageView() {
|
|
4734
|
-
if ($0b6a8303b64cced1$var$pageview_sent) {
|
|
4735
|
-
if (this.settings.debug) console.log("template-tool: not sending page view tracking to depict as it has already been sent");
|
|
4736
|
-
return;
|
|
2714
|
+
autoinvalidate_cache: autoinvalidate_cache
|
|
2715
|
+
}) {
|
|
2716
|
+
dist_to_hide_left && (this.dist_to_hide_left = dist_to_hide_left);
|
|
2717
|
+
dist_to_hide_right && (this.dist_to_hide_right = dist_to_hide_right);
|
|
2718
|
+
stepstoslide && (this.stepstoslide = stepstoslide);
|
|
2719
|
+
center_target && (this.center_target = true);
|
|
2720
|
+
mutation_plugins && (this.#mutation_plugins = mutation_plugins);
|
|
2721
|
+
correct_bs_targets == false && (this.correct_bs_targets = correct_bs_targets);
|
|
2722
|
+
if (button_elems) {
|
|
2723
|
+
this.#elements.right_ = button_elems.right;
|
|
2724
|
+
this.#elements.left_ = button_elems.left;
|
|
4737
2725
|
}
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
return $e0a87646d12cb987$export$15f8a0cd5a8c0ebb({
|
|
4748
|
-
...this.settings,
|
|
4749
|
-
...item,
|
|
4750
|
-
click_location: `${this.settings.type}_${index + 1}`,
|
|
4751
|
-
product_id: item.product_id || this.settings.product_id(item.page_url)
|
|
4752
|
-
});
|
|
4753
|
-
}
|
|
4754
|
-
trackAddToCart(pId) {
|
|
4755
|
-
return $e0a87646d12cb987$export$9028351cb994757e({
|
|
4756
|
-
...this.settings,
|
|
4757
|
-
product_id: pId && !(pId instanceof Event) ? pId : this.settings.product_id()
|
|
2726
|
+
if (button_contents?.right) this.#elements.right_.append(...button_contents.right);
|
|
2727
|
+
if (button_contents?.left) this.#elements.left_.append(...button_contents.left);
|
|
2728
|
+
$268cbd9e4ade92db$export$b3bbfd758f11cfa9(this.#create_element_structure).call(this, autoinvalidate_cache);
|
|
2729
|
+
// @ts-ignore
|
|
2730
|
+
this.#elements.sliding_el_.slider = this; // dunno if this is dumb? So far nordicagolf/kondomvaruhuset depend on it
|
|
2731
|
+
// plugin functionality i.e. for dots
|
|
2732
|
+
const constructor_args = arguments;
|
|
2733
|
+
constructor_plugins?.forEach?.(mplugin => {
|
|
2734
|
+
$268cbd9e4ade92db$export$b3bbfd758f11cfa9(mplugin).call(this, constructor_args);
|
|
4758
2735
|
});
|
|
4759
2736
|
}
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
|
|
4763
|
-
|
|
4764
|
-
|
|
4765
|
-
|
|
4766
|
-
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
|
|
4770
|
-
|
|
4771
|
-
|
|
4772
|
-
|
|
4773
|
-
|
|
4774
|
-
root: root,
|
|
4775
|
-
template: template,
|
|
4776
|
-
itemPreprocessor: itemPreprocessor,
|
|
4777
|
-
itemPostprocessor: itemPostprocessor
|
|
4778
|
-
} = this.settings) {
|
|
4779
|
-
if (document._depict_modify !== true) {
|
|
4780
|
-
if (this.settings.debug) console.warn("Template-tool: not running because document._depict_modify is false!", this);
|
|
4781
|
-
return;
|
|
4782
|
-
}
|
|
4783
|
-
if (!this.data) return;
|
|
4784
|
-
const product_id_at_rendering = this.settings.product_id();
|
|
4785
|
-
if (typeof prep === "function") prep();
|
|
4786
|
-
const interpolator = t => {
|
|
4787
|
-
return function (item) {
|
|
4788
|
-
// Conditional statements
|
|
4789
|
-
// {if VAR_NAME}
|
|
4790
|
-
// print this if true
|
|
4791
|
-
// {else}
|
|
4792
|
-
// print this if false
|
|
4793
|
-
// {end}
|
|
4794
|
-
// Note: these can't be nested
|
|
4795
|
-
t = t.replace(/{if\s+(.+?)}([\S\s]*?)(?:{else}([\S\s]*?))?{end}/g, (_, variable, if_yes, if_no) => {
|
|
4796
|
-
if (typeof if_no !== "string")
|
|
4797
|
-
// if_no is a number if there's no {else} statement
|
|
4798
|
-
if_no = "";
|
|
4799
|
-
return item[variable] ? if_yes : if_no;
|
|
4800
|
-
});
|
|
4801
|
-
return t.replace(/\${(.*?)}/g, (_, g) => item[g]); // this is copied from here, I hope I'm not breaking any licenses. Need it to transpile for IE11 compatiblity: https://github.com/mikemaccana/dynamic-template/blob/master/index.js
|
|
4802
|
-
// if you need variables that go over multiple lines:
|
|
4803
|
-
// const matcher = /\${([^}]+)}/g;
|
|
4804
|
-
};
|
|
4805
|
-
};
|
|
4806
|
-
|
|
4807
|
-
const elementsFromHTML = html => new DOMParser().parseFromString(html, "text/html").body.children;
|
|
4808
|
-
const getContent = () => {
|
|
4809
|
-
const recsArray = [];
|
|
4810
|
-
const resultingElements = [];
|
|
4811
|
-
this.data.forEach((item, rec_index) => {
|
|
4812
|
-
if (typeof itemPreprocessor === "function") {
|
|
4813
|
-
item = itemPreprocessor(item, rec_index);
|
|
4814
|
-
if (!Object.keys(item).length) {
|
|
4815
|
-
if (this.settings.debug) console.info("template-tool: discarding display", item, "because it is empty");
|
|
2737
|
+
}
|
|
2738
|
+
class $a69a5236b5814082$export$68babfc5be0de5da extends (0, $1683d0164abd7c1d$export$692b27c28639e5b9) {
|
|
2739
|
+
constructor(options, lazyfier_options) {
|
|
2740
|
+
super(options);
|
|
2741
|
+
const lazy_promise = new Promise(r => {
|
|
2742
|
+
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onexists(this.insert_here, ({
|
|
2743
|
+
element: element,
|
|
2744
|
+
disconnector: disconnector
|
|
2745
|
+
}) => {
|
|
2746
|
+
const i_o = new IntersectionObserver($268cbd9e4ade92db$export$b3bbfd758f11cfa9(records => {
|
|
2747
|
+
for (const record of records) if (record.intersectionRatio > 0) {
|
|
2748
|
+
r(true);
|
|
2749
|
+
i_o.disconnect();
|
|
2750
|
+
disconnector();
|
|
4816
2751
|
return;
|
|
4817
2752
|
}
|
|
4818
|
-
}
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
|
|
4823
|
-
|
|
4824
|
-
item.discount = `\u{2013}${Math.round(100 * (1 - item.sale_price / item.original_price))}%`;
|
|
4825
|
-
} else {
|
|
4826
|
-
itemTemplate = template.replaceAll($0b6a8303b64cced1$var$discountMatcher, "").replaceAll($0b6a8303b64cced1$var$noDiscountMatcher, "$1");
|
|
4827
|
-
item.discount = "";
|
|
4828
|
-
}
|
|
4829
|
-
const resultHTML = interpolator(itemTemplate)(item);
|
|
4830
|
-
let elements = elementsFromHTML(resultHTML);
|
|
4831
|
-
if (!this.settings.DNT) for (const element of elements) {
|
|
4832
|
-
// recommendations_inserted event
|
|
4833
|
-
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).oncreation(element, () => {
|
|
4834
|
-
if (!this.#dispatched_recs_inserted) {
|
|
4835
|
-
this.#dispatched_recs_inserted = true;
|
|
4836
|
-
$e0a87646d12cb987$export$82badda1f9923310({
|
|
4837
|
-
...this.settings,
|
|
4838
|
-
product_id: product_id_at_rendering,
|
|
4839
|
-
recommendation_type: this.settings.type,
|
|
4840
|
-
type: "recommendations_inserted"
|
|
4841
|
-
});
|
|
4842
|
-
}
|
|
4843
|
-
});
|
|
4844
|
-
const listener = e => {
|
|
4845
|
-
this.trackClick(rec_index);
|
|
4846
|
-
this.trackGAEvent("rec_bar_click", rec_index, item.ga_product_id || item.product_id || this.settings.product_id(item.page_url), item.ga_product_ids);
|
|
4847
|
-
};
|
|
4848
|
-
element.addEventListener("click", listener);
|
|
4849
|
-
$c8263a2185830bf1$export$82a685f2da2fb027(element, item.product_id, item.recommendation_id);
|
|
4850
|
-
if (this.settings.shade) $fbb09973782881cb$export$6ebd242c09192cec(element);
|
|
4851
|
-
// @ts-ignore
|
|
4852
|
-
if (!element.depict_event_listeners)
|
|
4853
|
-
// @ts-ignore
|
|
4854
|
-
element.depict_event_listeners = [];
|
|
4855
|
-
// @ts-ignore
|
|
4856
|
-
element.depict_event_listeners.push(listener);
|
|
4857
|
-
}
|
|
4858
|
-
if (typeof itemPostprocessor === "function") elements = itemPostprocessor(elements, item);
|
|
4859
|
-
resultingElements.push(...elements);
|
|
4860
|
-
});
|
|
4861
|
-
this.data = recsArray;
|
|
4862
|
-
if (!this.settings.DNT) $d3d8549954e0318e$export$7babcd5d4056b2ca(recsArray, this.settings.product_id, {
|
|
4863
|
-
list_name: "depict_" + this.settings.type
|
|
2753
|
+
}),
|
|
2754
|
+
// Fixes https://gitlab.com/depict-ai/depict.ai/-/merge_requests/5816/diffs, don't understand why
|
|
2755
|
+
{
|
|
2756
|
+
threshold: $0da0cad4f39e8f32$export$f8ea2e7b15b5d129(10)
|
|
2757
|
+
});
|
|
2758
|
+
i_o.observe(element);
|
|
4864
2759
|
});
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
|
|
4871
|
-
let MAX_RETRY = Math.round(10000 / SLEEP_TIME_MS);
|
|
4872
|
-
const tick = setInterval(() => {
|
|
4873
|
-
const r = root();
|
|
4874
|
-
if (MAX_RETRY === 0) clearInterval(tick);
|
|
4875
|
-
MAX_RETRY--;
|
|
4876
|
-
if (r !== null) {
|
|
4877
|
-
r.append(...renderedContent);
|
|
4878
|
-
clearInterval(tick);
|
|
4879
|
-
}
|
|
4880
|
-
}, SLEEP_TIME_MS);
|
|
4881
|
-
} else if (document.readyState === "loading") document.addEventListener("DOMContentLoaded", () => {
|
|
4882
|
-
const r = root();
|
|
4883
|
-
r.append(...renderedContent);
|
|
4884
|
-
}, {
|
|
4885
|
-
once: true
|
|
4886
|
-
});else {
|
|
4887
|
-
const r = root();
|
|
4888
|
-
r.append(...renderedContent);
|
|
4889
|
-
}
|
|
4890
|
-
return;
|
|
4891
|
-
}
|
|
4892
|
-
root.append(...renderedContent);
|
|
2760
|
+
});
|
|
2761
|
+
this.lazyfier = new (0, $1da560af170fb839$export$3be7054c61590ee3)({
|
|
2762
|
+
container: this.insert_here,
|
|
2763
|
+
wait_for_dominsertion: lazy_promise,
|
|
2764
|
+
...(lazyfier_options || {})
|
|
2765
|
+
});
|
|
4893
2766
|
}
|
|
4894
2767
|
}
|
|
4895
|
-
var
|
|
4896
|
-
/**
|
|
4897
|
-
* @deprecated Please use RecommendationRenderer instead
|
|
4898
|
-
*/
|
|
4899
|
-
$52d3be7ce5146924$export$2e2bcd8739ae039 = async options => {
|
|
4900
|
-
const depict = new (0, $0b6a8303b64cced1$export$1a8782481a9af507)(options.options),
|
|
4901
|
-
done = new Promise(itsdone => {
|
|
4902
|
-
document._depict_modify = true;
|
|
4903
|
-
depict.init(() => {
|
|
4904
|
-
depict.renderTemplate({
|
|
4905
|
-
itemPostprocessor: options.postProcessor,
|
|
4906
|
-
itemPreprocessor: options.preProcessor,
|
|
4907
|
-
root: options.root,
|
|
4908
|
-
template: options.template
|
|
4909
|
-
});
|
|
4910
|
-
itsdone();
|
|
4911
|
-
}, options.recs);
|
|
4912
|
-
});
|
|
4913
|
-
await done;
|
|
4914
|
-
return depict;
|
|
4915
|
-
};
|
|
4916
|
-
|
|
4917
|
-
// @ts-ignore
|
|
4918
|
-
var $1c4a3b6d660e3905$exports = {};
|
|
4919
|
-
$1c4a3b6d660e3905$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";
|
|
4920
2768
|
const $e090b20cef3f0516$var$default_image_src = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjYsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiDQoJIHZpZXdCb3g9IjAgMCAxNiAxNiIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMTYgMTY7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxwb2x5Z29uIHBvaW50cz0iOSwyLjYgOC4zLDMuNCAxMi40LDcuNSAxLjYsNy41IDEuNiw4LjUgMTIuNCw4LjUgOC4zLDEyLjYgOSwxMy40IDE0LjQsOCAiLz4NCjwvc3ZnPg0K";
|
|
4921
2769
|
class $e090b20cef3f0516$export$4d41c6499d53639c extends (0, $a69a5236b5814082$export$68babfc5be0de5da) {
|
|
4922
2770
|
constructor(static_options, override_lazyfier_options) {
|
|
@@ -4947,228 +2795,29 @@ class $e090b20cef3f0516$export$4d41c6499d53639c extends (0, $a69a5236b5814082$ex
|
|
|
4947
2795
|
function $e090b20cef3f0516$export$f1b8b9fd75ddcab1(slider) {
|
|
4948
2796
|
const style_elem = document.createElement("style");
|
|
4949
2797
|
style_elem.type = "text/css";
|
|
4950
|
-
style_elem.append((0, /*@__PURE__*/$parcel$interopDefault($
|
|
2798
|
+
style_elem.append((0, /*@__PURE__*/$parcel$interopDefault($1286e6ce2079bdeb$exports)));
|
|
4951
2799
|
slider.container.appendChild(style_elem);
|
|
4952
2800
|
}
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
|
|
4965
|
-
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
catchify: catchify,
|
|
4972
|
-
dist_to_hide_left: 6,
|
|
4973
|
-
dist_to_hide_right: 6,
|
|
4974
|
-
...slider_options
|
|
4975
|
-
}, override_lazyfier_options);
|
|
4976
|
-
const recs = await local_rr(t, {
|
|
4977
|
-
...rendering_options,
|
|
4978
|
-
post_processors: [(elements, display) => {
|
|
4979
|
-
$bf7f12fe044e41b2$export$5e63aea0cac01fa0(elements, "a.rec_outer").forEach(ro => ro.classList.add("noautospacing"));
|
|
4980
|
-
return elements;
|
|
4981
|
-
}, ...(rendering_options.post_processors || [])]
|
|
4982
|
-
});
|
|
4983
|
-
if (!recs.elements) {
|
|
4984
|
-
dlog("RR_Slider says bye bye cuz no recs");
|
|
4985
|
-
return {};
|
|
4986
|
-
}
|
|
4987
|
-
slider.insert_here.append(...recs.elements);
|
|
4988
|
-
if (container) {
|
|
4989
|
-
const [root] = $bf7f12fe044e41b2$export$5e63aea0cac01fa0(container, root_selector || ".grid");
|
|
4990
|
-
root[insertion_verb](slider.container);
|
|
4991
|
-
}
|
|
4992
|
-
return {
|
|
4993
|
-
...recs,
|
|
4994
|
-
displays: recs.displays,
|
|
4995
|
-
elements: container ? container : [slider.container]
|
|
4996
|
-
};
|
|
4997
|
-
}
|
|
4998
|
-
var $66a2a93dfa520bc6$var$_tmpl$ = ["<button", ' class="load_more">', "</button>"];
|
|
4999
|
-
async function $66a2a93dfa520bc6$export$30933c637c977eef({
|
|
5000
|
-
t: t,
|
|
5001
|
-
recs: recs,
|
|
5002
|
-
title: title,
|
|
5003
|
-
infinite_scroll = false,
|
|
5004
|
-
with_slider = false,
|
|
5005
|
-
with_loadmore = false,
|
|
5006
|
-
template_tool_options: template_tool_options,
|
|
5007
|
-
slider_options = {},
|
|
5008
|
-
pre_processors = [],
|
|
5009
|
-
post_processors = [],
|
|
5010
|
-
container_template: container_template,
|
|
5011
|
-
template:
|
|
5012
|
-
// container template
|
|
5013
|
-
template,
|
|
5014
|
-
// recommendation template
|
|
5015
|
-
chunk_size_for_load_more = 4,
|
|
5016
|
-
insertion_promise: insertion_promise,
|
|
5017
|
-
view_more_text: view_more_text
|
|
5018
|
-
}) {
|
|
5019
|
-
const {
|
|
5020
|
-
catchify: catchify,
|
|
5021
|
-
dlog: dlog
|
|
5022
|
-
} = t,
|
|
5023
|
-
container = [...$bf7f12fe044e41b2$export$44951404cb8d0583(container_template)],
|
|
5024
|
-
root = $bf7f12fe044e41b2$export$5e63aea0cac01fa0(container, ".grid")[0],
|
|
5025
|
-
internal_pre_processors = [...pre_processors],
|
|
5026
|
-
// copy arrays so we don't unintentionally modify an array of a script calling us when doing auto postprocessor for slider if insertion_promise is defined
|
|
5027
|
-
internal_post_processors = [...post_processors];
|
|
5028
|
-
if (with_slider) var slider = catchify(() => new (0, $e090b20cef3f0516$export$4d41c6499d53639c)({
|
|
5029
|
-
...t,
|
|
5030
|
-
arrow_image: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHN0eWxlPSJkaXNwbGF5OiBpbmxpbmUtYmxvY2s7IHZlcnRpY2FsLWFsaWduOiBtaWRkbGU7IiB3aWR0aD0iMTZweCIgaGVpZ2h0PSIxNnB4IiB2aWV3Qm94PSIwIDAgOCAxNSI+PHBhdGggc3R5bGU9ImZpbGw6IHJnYigwLCAwLCAwKTsiIGQ9Ik0uNjI5LjAwMWMuMTUuMDA4LjI5My4wNzIuMzk4LjE4bDYuNzkyIDYuODlhLjYwMS42MDEgMCAwIDEgMCAuODZsLTYuNzkyIDYuODg4YS41ODYuNTg2IDAgMCAxLS44NDYgMCAuNjAxLjYwMSAwIDAgMSAwLS44Nkw2LjU1NCA3LjUuMjExIDEuMDAxYS42MDEuNjAxIDAgMCAxIDAtLjg2Yy4xMTUtLjEuMjY2LS4xNS40MTgtLjE0Ij48L3BhdGg+PC9zdmc+",
|
|
5031
|
-
...slider_options
|
|
5032
|
-
}))();
|
|
5033
|
-
if (slider) {
|
|
5034
|
-
root.replaceWith(slider.container);
|
|
5035
|
-
if (insertion_promise) internal_post_processors.push((t, items, d) => {
|
|
5036
|
-
for (const item of items) insertion_promise.then(() => {
|
|
5037
|
-
$8e19f8200d357fe7$export$37125ccc5dd98050({
|
|
5038
|
-
element: item,
|
|
5039
|
-
data: {
|
|
5040
|
-
tenant: t.tenant,
|
|
5041
|
-
entity_price: d.entity_price,
|
|
5042
|
-
recommendation_id: d.recommendation_id,
|
|
5043
|
-
market: t.market,
|
|
5044
|
-
product_id: d.product_id,
|
|
5045
|
-
recommendation_type: d.recommendation_type
|
|
5046
|
-
},
|
|
5047
|
-
wait_for_dom_insertion: false
|
|
5048
|
-
});
|
|
5049
|
-
});
|
|
5050
|
-
return items;
|
|
5051
|
-
});
|
|
5052
|
-
}
|
|
5053
|
-
if (!slider || !insertion_promise) internal_post_processors.push((t, items, d) => {
|
|
5054
|
-
for (const item of items) $8e19f8200d357fe7$export$37125ccc5dd98050({
|
|
5055
|
-
element: item,
|
|
5056
|
-
data: {
|
|
5057
|
-
tenant: t.tenant,
|
|
5058
|
-
entity_price: d.entity_price,
|
|
5059
|
-
recommendation_id: d.recommendation_id,
|
|
5060
|
-
market: t.market,
|
|
5061
|
-
product_id: d.product_id,
|
|
5062
|
-
recommendation_type: d.recommendation_type
|
|
5063
|
-
},
|
|
5064
|
-
wait_for_dom_insertion: false
|
|
5065
|
-
});
|
|
5066
|
-
return items;
|
|
5067
|
-
});
|
|
5068
|
-
const template_tool = await $52d3be7ce5146924$export$2e2bcd8739ae039({
|
|
5069
|
-
options: {
|
|
5070
|
-
...t,
|
|
5071
|
-
...(template_tool_options || {})
|
|
5072
|
-
},
|
|
5073
|
-
root: slider ? slider.insert_here : root,
|
|
5074
|
-
recs: recs,
|
|
5075
|
-
template: template,
|
|
5076
|
-
preProcessor: (d, i) => {
|
|
5077
|
-
return internal_pre_processors.reduce((accumulator, currentValue) => {
|
|
5078
|
-
// basic pre processor pipeline
|
|
5079
|
-
return catchify(currentValue)(t, accumulator, i, with_loadmore, with_slider, infinite_scroll) || accumulator;
|
|
5080
|
-
}, d);
|
|
5081
|
-
},
|
|
5082
|
-
postProcessor: (items, d) => {
|
|
5083
|
-
return internal_post_processors.reduce((accumulator, currentValue) => {
|
|
5084
|
-
// basic post processor pipeline
|
|
5085
|
-
return catchify(currentValue)(t, accumulator, d, slider) || accumulator;
|
|
5086
|
-
}, items);
|
|
5087
|
-
}
|
|
5088
|
-
});
|
|
5089
|
-
if (with_loadmore) catchify($66a2a93dfa520bc6$var$setup_load_more)(t, root, chunk_size_for_load_more, view_more_text);
|
|
5090
|
-
if (infinite_scroll) catchify($66a2a93dfa520bc6$var$setup_infinite_scroll)(t, root);
|
|
5091
|
-
if (title) {
|
|
5092
|
-
const [title_element] = $bf7f12fe044e41b2$export$5e63aea0cac01fa0(container, "h1.title, h2.title, h3.title, h4.title, h5.title, h6.title");
|
|
5093
|
-
if (title_element) {
|
|
5094
|
-
if (typeof title == "string") title_element.innerText = title;else title_element.replaceWith(...title);
|
|
5095
|
-
}
|
|
5096
|
-
}
|
|
5097
|
-
if (template_tool?.data?.length) return container;else dlog("Didn't get recs from API", template_tool);
|
|
5098
|
-
}
|
|
5099
|
-
function $66a2a93dfa520bc6$var$setup_infinite_scroll(t, root) {
|
|
5100
|
-
const {
|
|
5101
|
-
dlog: dlog,
|
|
5102
|
-
catchify: catchify
|
|
5103
|
-
} = t,
|
|
5104
|
-
get_last_visible_el = () => [...root.querySelectorAll("a.rec_outer:not(.not_visible)")].slice(-1)[0],
|
|
5105
|
-
last_visible_el = get_last_visible_el();
|
|
5106
|
-
if (!last_visible_el) {
|
|
5107
|
-
dlog("not setting up infinite scroll as there are no elements");
|
|
5108
|
-
return;
|
|
5109
|
-
}
|
|
5110
|
-
const intersection_observer = new IntersectionObserver(catchify(records => {
|
|
5111
|
-
dlog("Intersection observer for", last_visible_el, "has records", records);
|
|
5112
|
-
records.forEach(record => {
|
|
5113
|
-
if (record.isIntersecting && record.target == get_last_visible_el()) {
|
|
5114
|
-
dlog("Loading more recs because of", record);
|
|
5115
|
-
if ($66a2a93dfa520bc6$var$load_more_elements(root)) $66a2a93dfa520bc6$var$setup_infinite_scroll(t, root);
|
|
5116
|
-
}
|
|
5117
|
-
});
|
|
5118
|
-
}));
|
|
5119
|
-
dlog("starting to intersection observe", last_visible_el, "for infinite scroll");
|
|
5120
|
-
intersection_observer.observe(last_visible_el);
|
|
5121
|
-
}
|
|
5122
|
-
function $66a2a93dfa520bc6$var$load_more_elements(root, chunk_size = 4) {
|
|
5123
|
-
const hidden_elements = root.querySelectorAll("a.rec_outer.not_visible");
|
|
5124
|
-
let i = 0;
|
|
5125
|
-
for (; i < Math.min(hidden_elements.length, chunk_size); i++) {
|
|
5126
|
-
// @ts-ignore
|
|
5127
|
-
hidden_elements[i].load_image();
|
|
5128
|
-
hidden_elements[i].classList.remove("not_visible");
|
|
5129
|
-
}
|
|
5130
|
-
const has_more = i >= chunk_size && hidden_elements.length > chunk_size;
|
|
5131
|
-
return has_more;
|
|
5132
|
-
}
|
|
5133
|
-
function $66a2a93dfa520bc6$var$setup_load_more(t, root, chunk_size, view_more_text = "Visa mer") {
|
|
5134
|
-
const {
|
|
5135
|
-
catchify: catchify
|
|
5136
|
-
} = t,
|
|
5137
|
-
load_more_cont = $bf7f12fe044e41b2$export$d3e2a0560cbf4787(`<div class="load-more-container"></div>`),
|
|
5138
|
-
load_button = load_more_cont.appendChild($jVDDb$solidjsweb.ssr($66a2a93dfa520bc6$var$_tmpl$, $jVDDb$solidjsweb.ssrHydrationKey(), $jVDDb$solidjsweb.escape(view_more_text)));
|
|
5139
|
-
load_button.addEventListener("click", catchify(load_more_recs_and_hide_button_if_needed));
|
|
5140
|
-
root.after(load_more_cont);
|
|
5141
|
-
load_more_recs_and_hide_button_if_needed();
|
|
5142
|
-
function load_more_recs_and_hide_button_if_needed() {
|
|
5143
|
-
if (!$66a2a93dfa520bc6$var$load_more_elements(root, chunk_size))
|
|
5144
|
-
// there aren't any recs left to display
|
|
5145
|
-
load_button.classList.add("not_visible");
|
|
5146
|
-
}
|
|
5147
|
-
}
|
|
5148
|
-
function $66a2a93dfa520bc6$export$4f39078bdc72ecd0(_t, d, i, with_loadmore, with_slider, infinite_scroll) {
|
|
5149
|
-
d.class ||= "";
|
|
5150
|
-
if (infinite_scroll) d.class = i >= 4 ? "not_visible" : ""; // this will make it hold image loading until .load_image is called on .rec_outer
|
|
5151
|
-
if (with_loadmore) d.class = "not_visible";
|
|
5152
|
-
d.percentage_off = Math.round(100 - d.sale_price / d.original_price * 100);
|
|
5153
|
-
if (!d.percentage_off || d.percentage_off < 10) d.percentage_off = "";
|
|
5154
|
-
return d;
|
|
5155
|
-
}
|
|
5156
|
-
function $66a2a93dfa520bc6$export$c410ce1205e5118a(_t, itms, d, slider) {
|
|
5157
|
-
for (const item of itms) {
|
|
5158
|
-
const {
|
|
5159
|
-
image_url: image_url
|
|
5160
|
-
} = d,
|
|
5161
|
-
img = item.querySelector("img.image"),
|
|
5162
|
-
load_image = () => {
|
|
5163
|
-
img.src = image_url;
|
|
5164
|
-
slider?.observe?.(img);
|
|
5165
|
-
};
|
|
5166
|
-
if (item.classList.contains("not_visible") || slider)
|
|
5167
|
-
// @ts-ignore
|
|
5168
|
-
item.load_image = load_image;else load_image();
|
|
5169
|
-
if (slider) item.classList.add("noautospacing");
|
|
2801
|
+
|
|
2802
|
+
// not ideal but can help when debugging via sentry
|
|
2803
|
+
/**
|
|
2804
|
+
* A function that attempts to "serialize" an object to a text representation that helps with debugging when using sentry
|
|
2805
|
+
* @param anything Something to try to serialize - this function is crappy and your mileage may vary
|
|
2806
|
+
* @param depth How deep to go when recursing
|
|
2807
|
+
* @return An object that is somehow closer to text (better serializable by sentry) or text
|
|
2808
|
+
*/
|
|
2809
|
+
function $45e05ec4fd7f1ee7$export$39d526a1194b6499(anything, depth) {
|
|
2810
|
+
depth ??= 0;
|
|
2811
|
+
depth++;
|
|
2812
|
+
if (depth > 30) return anything;
|
|
2813
|
+
const output = {};
|
|
2814
|
+
for (const key in anything) {
|
|
2815
|
+
const value = anything[key];
|
|
2816
|
+
let serialized_value;
|
|
2817
|
+
if (value instanceof Element) serialized_value = value.cloneNode(false).outerHTML;else if (value instanceof Headers) serialized_value = Object.fromEntries(value.entries());else if (typeof value == "object" && value != null && (typeof value[Symbol.iterator] === "function" || value instanceof Response)) serialized_value = $45e05ec4fd7f1ee7$export$39d526a1194b6499(value, depth);else serialized_value = value?.toString?.();
|
|
2818
|
+
output[key] = serialized_value;
|
|
5170
2819
|
}
|
|
5171
|
-
return
|
|
2820
|
+
return output;
|
|
5172
2821
|
}
|
|
5173
2822
|
var
|
|
5174
2823
|
/**
|
|
@@ -5309,6 +2958,33 @@ const $febdc40c8da5c25e$export$68c017fd93791405 = ({
|
|
|
5309
2958
|
container: container
|
|
5310
2959
|
};
|
|
5311
2960
|
};
|
|
2961
|
+
const $f3f05d97149aec76$export$deca40f48c0569f8 = typeof window === "undefined" ? false : /*@__PURE__*/localStorage.getItem("colorize-logics") === "true";
|
|
2962
|
+
function $f3f05d97149aec76$export$16501883f477737a(elements, display) {
|
|
2963
|
+
elements.forEach(elem => {
|
|
2964
|
+
if (elem.nodeType !== Node.TEXT_NODE) {
|
|
2965
|
+
// calc a hash for given string
|
|
2966
|
+
const hc = (str = "") => {
|
|
2967
|
+
let hash = 0;
|
|
2968
|
+
if (str.length === 0) return hash;
|
|
2969
|
+
for (let i = 0; i < str.length; i++) {
|
|
2970
|
+
const chr = str.charCodeAt(i);
|
|
2971
|
+
hash = (hash << 5) - hash + chr;
|
|
2972
|
+
hash |= 0;
|
|
2973
|
+
}
|
|
2974
|
+
return hash;
|
|
2975
|
+
};
|
|
2976
|
+
const hash = hc(display.logic);
|
|
2977
|
+
// Change hue based on hash
|
|
2978
|
+
const color = "hsl(" + hash % 360 + ",100%,75%)";
|
|
2979
|
+
if ("style" in elem) elem.style.background = color;
|
|
2980
|
+
// @ts-ignore
|
|
2981
|
+
elem?.setAttribute?.("data-logic", display.logic);
|
|
2982
|
+
// @ts-ignore
|
|
2983
|
+
elem?.setAttribute?.("title", "Logic: " + display.logic);
|
|
2984
|
+
}
|
|
2985
|
+
});
|
|
2986
|
+
return elements;
|
|
2987
|
+
}
|
|
5312
2988
|
function $ef237c2bba47492f$export$f8913c8a18f7ca21(iterables) {
|
|
5313
2989
|
const ourselves = $9a42a570de51ea3d$export$e806c6c1615a59ae();
|
|
5314
2990
|
const values = new Array(iterables.length);
|
|
@@ -5546,98 +3222,6 @@ class $1cc2444a0f1b992e$var$CSSMeasurement {
|
|
|
5546
3222
|
this.u = unit;
|
|
5547
3223
|
}
|
|
5548
3224
|
}
|
|
5549
|
-
async function $a7315720bf2a1638$export$b0a773486c1c2312(t, recommendation_renderer_options, {
|
|
5550
|
-
container_elements: container_elements,
|
|
5551
|
-
container_selector: container_selector,
|
|
5552
|
-
override_rec_renderer: override_rec_renderer,
|
|
5553
|
-
lazyfier_options = {},
|
|
5554
|
-
eager_images: eager_images,
|
|
5555
|
-
...options_for_grid
|
|
5556
|
-
}) {
|
|
5557
|
-
const [insertion_point] = $bf7f12fe044e41b2$export$5e63aea0cac01fa0(container_elements, container_selector || ".grid");
|
|
5558
|
-
const rendering_result = await (override_rec_renderer || (0, $92bde32714bb1e07$export$2e2bcd8739ae039))(t, recommendation_renderer_options);
|
|
5559
|
-
const {
|
|
5560
|
-
elements: elements
|
|
5561
|
-
} = rendering_result;
|
|
5562
|
-
if (!elements) return rendering_result;
|
|
5563
|
-
if (!eager_images)
|
|
5564
|
-
// convoluted lazy loading that
|
|
5565
|
-
// when the elements are in the DOM starts IntersectionObserver on whole grid
|
|
5566
|
-
// when grid intersects starts Lazyfier
|
|
5567
|
-
// this is because Lazyfier is fucking stupid
|
|
5568
|
-
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).wait_for_element(insertion_point).then($268cbd9e4ade92db$export$b3bbfd758f11cfa9(element => {
|
|
5569
|
-
let start_lazy_loading;
|
|
5570
|
-
const lazy_loading_promise = new Promise(r => start_lazy_loading = r);
|
|
5571
|
-
const lf = new (0, $1da560af170fb839$export$3be7054c61590ee3)({
|
|
5572
|
-
only_load_intersecting: true,
|
|
5573
|
-
wait_for_dominsertion: lazy_loading_promise,
|
|
5574
|
-
...lazyfier_options
|
|
5575
|
-
});
|
|
5576
|
-
lf.start_observing_for_new_children_(element);
|
|
5577
|
-
const i_o = new IntersectionObserver($268cbd9e4ade92db$export$b3bbfd758f11cfa9(records => {
|
|
5578
|
-
for (const record of records) if (record.intersectionRatio > 0) {
|
|
5579
|
-
start_lazy_loading();
|
|
5580
|
-
i_o.disconnect();
|
|
5581
|
-
return;
|
|
5582
|
-
}
|
|
5583
|
-
}));
|
|
5584
|
-
i_o.observe(insertion_point);
|
|
5585
|
-
}));
|
|
5586
|
-
insertion_point.append(...elements);
|
|
5587
|
-
$1cc2444a0f1b992e$export$c84671f46d6a1ca({
|
|
5588
|
-
...options_for_grid,
|
|
5589
|
-
container_element: insertion_point,
|
|
5590
|
-
layout: "grid"
|
|
5591
|
-
}).catch((0, $548fd58b14b25a52$export$8048b892d651b310));
|
|
5592
|
-
return {
|
|
5593
|
-
...rendering_result,
|
|
5594
|
-
elements: container_elements
|
|
5595
|
-
};
|
|
5596
|
-
}
|
|
5597
|
-
|
|
5598
|
-
// @ts-ignore
|
|
5599
|
-
var $a1e0549e8669396a$exports = {};
|
|
5600
|
-
$a1e0549e8669396a$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";
|
|
5601
|
-
let $79804e8d76404ae4$var$slider_styling_was_inserted = false;
|
|
5602
|
-
async function $79804e8d76404ae4$export$82cfdc85a4d15688(t, recommendation_renderer_options, {
|
|
5603
|
-
container_elements: container_elements,
|
|
5604
|
-
container_selector: container_selector,
|
|
5605
|
-
override_rec_renderer: override_rec_renderer,
|
|
5606
|
-
lazyfier_options = {},
|
|
5607
|
-
eager_images: eager_images,
|
|
5608
|
-
grid_spacing: grid_spacing,
|
|
5609
|
-
cols_at_size: cols_at_size,
|
|
5610
|
-
override_vertical_spacing: override_vertical_spacing,
|
|
5611
|
-
rows = "all",
|
|
5612
|
-
...slider_options
|
|
5613
|
-
}) {
|
|
5614
|
-
const [insertion_point] = $bf7f12fe044e41b2$export$5e63aea0cac01fa0(container_elements, container_selector || ".grid");
|
|
5615
|
-
const slider = eager_images ? new (0, $1683d0164abd7c1d$export$692b27c28639e5b9)(slider_options) : new (0, $a69a5236b5814082$export$68babfc5be0de5da)(slider_options, lazyfier_options);
|
|
5616
|
-
const rendering_result = await (override_rec_renderer || (0, $92bde32714bb1e07$export$2e2bcd8739ae039))(t, recommendation_renderer_options);
|
|
5617
|
-
const {
|
|
5618
|
-
elements: elements
|
|
5619
|
-
} = rendering_result;
|
|
5620
|
-
if (!elements) return rendering_result;
|
|
5621
|
-
if (!$79804e8d76404ae4$var$slider_styling_was_inserted) {
|
|
5622
|
-
$79804e8d76404ae4$var$slider_styling_was_inserted = true;
|
|
5623
|
-
$e4bebbfa0f0b1454$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($a1e0549e8669396a$exports)));
|
|
5624
|
-
}
|
|
5625
|
-
insertion_point.replaceWith(slider.container);
|
|
5626
|
-
slider.insert_here.append(...elements);
|
|
5627
|
-
$1cc2444a0f1b992e$export$c84671f46d6a1ca({
|
|
5628
|
-
grid_spacing: grid_spacing,
|
|
5629
|
-
cols_at_size: cols_at_size,
|
|
5630
|
-
container_element: slider.insert_here,
|
|
5631
|
-
rows: rows,
|
|
5632
|
-
layout: "slider",
|
|
5633
|
-
override_vertical_spacing: override_vertical_spacing
|
|
5634
|
-
}).catch(e => $268cbd9e4ade92db$export$f18d5b0af29128b7([e, "Grid had an error"], "warning"));
|
|
5635
|
-
return {
|
|
5636
|
-
...rendering_result,
|
|
5637
|
-
slider: slider,
|
|
5638
|
-
elements: container_elements
|
|
5639
|
-
};
|
|
5640
|
-
}
|
|
5641
3225
|
function $535c6ee2337e2717$export$8cbd8aa1c70f9a13(interval = 5000) {
|
|
5642
3226
|
let timer;
|
|
5643
3227
|
let direction = 1;
|
|
@@ -5685,16 +3269,11 @@ function $edc9fe0b09e00df6$export$af88b4929c2dc86() {
|
|
|
5685
3269
|
}
|
|
5686
3270
|
var $158313c0231e6555$var$_tmpl$ = ["<label", ' class="checkbox_container"><input type="radio" name="', '"><span class="checkmark"></span></label>'];
|
|
5687
3271
|
function $158313c0231e6555$export$1d17a045bcc711b1({
|
|
5688
|
-
t: t,
|
|
5689
3272
|
navcont_insertion_fn: navcont_insertion_fn,
|
|
5690
3273
|
navdot: navdot,
|
|
5691
3274
|
dontshowonedot = false,
|
|
5692
3275
|
bitesize: bitesize
|
|
5693
3276
|
}) {
|
|
5694
|
-
const {
|
|
5695
|
-
dlog: dlog,
|
|
5696
|
-
catchify: catchify
|
|
5697
|
-
} = t;
|
|
5698
3277
|
const button_states = [];
|
|
5699
3278
|
const unique_name = Math.round(Math.random() * 1000000);
|
|
5700
3279
|
function constructor_plugin() {
|
|
@@ -5731,14 +3310,14 @@ function $158313c0231e6555$export$1d17a045bcc711b1({
|
|
|
5731
3310
|
const position = Math.round(first_shown_element / amount_of_elements * number_of_slides);
|
|
5732
3311
|
const get_inputs = () => navcont.querySelectorAll("input");
|
|
5733
3312
|
if (number_of_radio_buttons != number_of_slides) {
|
|
5734
|
-
|
|
3313
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Number of buttons doesn't match number of slides, rerendering buttons", button_states);
|
|
5735
3314
|
navcont.innerHTML = "";
|
|
5736
3315
|
if (number_of_slides === 1 && dontshowonedot) {
|
|
5737
|
-
|
|
3316
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("dontshowonedot is on, not rendering any dots");
|
|
5738
3317
|
return;
|
|
5739
3318
|
}
|
|
5740
3319
|
if (number_of_slides == Infinity) {
|
|
5741
|
-
|
|
3320
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Infinite number of slides, wtf", number_of_slides);
|
|
5742
3321
|
return;
|
|
5743
3322
|
}
|
|
5744
3323
|
for (let i = 0; i < number_of_slides; i++) {
|
|
@@ -5746,10 +3325,10 @@ function $158313c0231e6555$export$1d17a045bcc711b1({
|
|
|
5746
3325
|
const input = a_navdot.querySelector("input");
|
|
5747
3326
|
if (process.env.DEBUG === "true" && !input) throw new Error("You need to provide a navdot that contains an <input> element to slider_dots");
|
|
5748
3327
|
input.checked = button_states[i];
|
|
5749
|
-
input.addEventListener("click",
|
|
3328
|
+
input.addEventListener("click", $268cbd9e4ade92db$export$b3bbfd758f11cfa9(e => {
|
|
5750
3329
|
e.preventDefault();
|
|
5751
3330
|
e.stopPropagation();
|
|
5752
|
-
|
|
3331
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Someone checked a box", e);
|
|
5753
3332
|
this.scroll_to_abs(Math.round(amount_of_visible_elements * i));
|
|
5754
3333
|
return false;
|
|
5755
3334
|
}));
|
|
@@ -5784,12 +3363,7 @@ function $158313c0231e6555$export$a09282b33e69b43f(unique_name) {
|
|
|
5784
3363
|
// });
|
|
5785
3364
|
// });
|
|
5786
3365
|
|
|
5787
|
-
function $98ef92db220106f3$export$411b0f20794697ce(
|
|
5788
|
-
const {
|
|
5789
|
-
dlog: dlog,
|
|
5790
|
-
catchify: catchify,
|
|
5791
|
-
err: err
|
|
5792
|
-
} = t;
|
|
3366
|
+
function $98ef92db220106f3$export$411b0f20794697ce() {
|
|
5793
3367
|
function constructor_plugin(slider_options) {
|
|
5794
3368
|
const {
|
|
5795
3369
|
insert_here: sliding
|
|
@@ -5797,7 +3371,7 @@ function $98ef92db220106f3$export$411b0f20794697ce(t) {
|
|
|
5797
3371
|
let last_mouse_position = 0;
|
|
5798
3372
|
let starting_position = 0;
|
|
5799
3373
|
let block_anchor_clicks = false;
|
|
5800
|
-
sliding.addEventListener("mousedown",
|
|
3374
|
+
sliding.addEventListener("mousedown", $268cbd9e4ade92db$export$b3bbfd758f11cfa9(e => {
|
|
5801
3375
|
sliding.classList.remove("slider_snap");
|
|
5802
3376
|
const {
|
|
5803
3377
|
snap_style: snap_style
|
|
@@ -5807,7 +3381,7 @@ function $98ef92db220106f3$export$411b0f20794697ce(t) {
|
|
|
5807
3381
|
last_mouse_position = starting_position = e.clientX;
|
|
5808
3382
|
sliding.addEventListener("mousemove", scroll_on_mousemove);
|
|
5809
3383
|
}));
|
|
5810
|
-
window.addEventListener("mouseup",
|
|
3384
|
+
window.addEventListener("mouseup", $268cbd9e4ade92db$export$b3bbfd758f11cfa9(e => {
|
|
5811
3385
|
// use window to prevent dragging from getting stuck
|
|
5812
3386
|
sliding.classList.remove("grabbing");
|
|
5813
3387
|
sliding.classList.add("slider_snap");
|
|
@@ -5827,9 +3401,9 @@ function $98ef92db220106f3$export$411b0f20794697ce(t) {
|
|
|
5827
3401
|
});
|
|
5828
3402
|
}
|
|
5829
3403
|
}));
|
|
5830
|
-
sliding.addEventListener("click",
|
|
3404
|
+
sliding.addEventListener("click", $268cbd9e4ade92db$export$b3bbfd758f11cfa9(e => {
|
|
5831
3405
|
if (block_anchor_clicks) {
|
|
5832
|
-
|
|
3406
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Block anchor clicks is true, blocking click", e);
|
|
5833
3407
|
block_anchor_clicks = false;
|
|
5834
3408
|
e.preventDefault();
|
|
5835
3409
|
return false;
|
|
@@ -5846,7 +3420,7 @@ function $98ef92db220106f3$export$411b0f20794697ce(t) {
|
|
|
5846
3420
|
});
|
|
5847
3421
|
last_mouse_position = clientX;
|
|
5848
3422
|
} catch (e) {
|
|
5849
|
-
|
|
3423
|
+
$548fd58b14b25a52$export$8048b892d651b310(e);
|
|
5850
3424
|
}
|
|
5851
3425
|
}
|
|
5852
3426
|
}
|
|
@@ -6120,228 +3694,61 @@ function $379066823f8eeb0b$export$dac64fd35a4805a4(options = {}) {
|
|
|
6120
3694
|
mutation_plugin: $268cbd9e4ade92db$export$b3bbfd758f11cfa9(mutation_plugin)
|
|
6121
3695
|
};
|
|
6122
3696
|
}
|
|
6123
|
-
|
|
6124
|
-
|
|
6125
|
-
|
|
6126
|
-
|
|
6127
|
-
|
|
6128
|
-
|
|
6129
|
-
const
|
|
6130
|
-
|
|
6131
|
-
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
let inactive_checker_running = false;
|
|
6137
|
-
let smallest_seen_intersection_ratio = 0.1;
|
|
6138
|
-
let largest_seen_interection_ratio = 0.9;
|
|
6139
|
-
let are_far_right = false;
|
|
6140
|
-
let inactive_checker_timeout;
|
|
6141
|
-
// let elgreen;
|
|
6142
|
-
const check_if_we_inactive = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(function () {
|
|
6143
|
-
// const { insert_here: sliding } = this;
|
|
6144
|
-
const now = window?.performance?.now?.() || +new Date();
|
|
6145
|
-
const time_since_ran = now - last_move;
|
|
6146
|
-
const last_left_intersection = this.first_intersecting;
|
|
6147
|
-
// dlog(last_left_intersection.intersectionRatio, smallest_seen_intersection_ratio, largest_seen_interection_ratio);
|
|
6148
|
-
if (time_since_ran > time_of_no_events_to_count_as_scroll_idle && !touches && last_left_intersection && (last_left_intersection.intersectionRatio <= smallest_seen_intersection_ratio || last_left_intersection.intersectionRatio >= largest_seen_interection_ratio || are_far_right)) {
|
|
6149
|
-
// if (!elgreen) {
|
|
6150
|
-
// sliding.style.background = "green";
|
|
6151
|
-
// elgreen = true;
|
|
6152
|
-
// }
|
|
6153
|
-
$268cbd9e4ade92db$export$b3bbfd758f11cfa9($3d8df0a23b9bebac$var$scroll_idle)(this, originally_rendered_elements.length, clones_per_side);
|
|
6154
|
-
inactive_checker_running = false;
|
|
6155
|
-
} else {
|
|
6156
|
-
// if (elgreen !== false) {
|
|
6157
|
-
// sliding.style.background = "red";
|
|
6158
|
-
// elgreen = false;
|
|
6159
|
-
// }
|
|
6160
|
-
const timeleft = time_of_no_events_to_count_as_scroll_idle - time_since_ran;
|
|
6161
|
-
if (timeleft < 1) requestAnimationFrame(check_if_we_inactive.bind(this));else setTimeout(check_if_we_inactive.bind(this), timeleft);
|
|
6162
|
-
}
|
|
6163
|
-
});
|
|
6164
|
-
function constructor_plugin() {
|
|
6165
|
-
window.addEventListener("touchstart", () => touches++);
|
|
6166
|
-
window.addEventListener("touchend", () => touches--);
|
|
6167
|
-
this.insert_here.addEventListener("scroll", $268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => {
|
|
6168
|
-
last_move = window?.performance?.now?.() || +new Date();
|
|
6169
|
-
}));
|
|
6170
|
-
const mo = new MutationObserver($268cbd9e4ade92db$export$b3bbfd758f11cfa9(records => {
|
|
6171
|
-
for (const record of records) for (const node of record.removedNodes) {
|
|
6172
|
-
if (removed_by_us.has(node)) {
|
|
6173
|
-
removed_by_us.delete(node);
|
|
6174
|
-
continue;
|
|
6175
|
-
}
|
|
6176
|
-
for (const a_set of sets_of_els) {
|
|
6177
|
-
const index_in_el_set = a_set.indexOf(node);
|
|
6178
|
-
if (index_in_el_set >= 0) {
|
|
6179
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("Removing", node, "from el set", a_set);
|
|
6180
|
-
a_set.splice(index_in_el_set, 1);
|
|
6181
|
-
}
|
|
6182
|
-
}
|
|
6183
|
-
}
|
|
6184
|
-
}));
|
|
6185
|
-
mo.observe(this.insert_here, {
|
|
6186
|
-
childList: true
|
|
6187
|
-
});
|
|
6188
|
-
}
|
|
6189
|
-
function mutation_plugin(intersections, intersecting_mutations) {
|
|
6190
|
-
for (let i = 0; i < intersections.length; i++) {
|
|
6191
|
-
const {
|
|
6192
|
-
intersectionRatio: intersectionRatio
|
|
6193
|
-
} = intersections[i];
|
|
6194
|
-
const target_large = intersectionRatio * 0.95;
|
|
6195
|
-
const target_small = intersectionRatio * 1.05;
|
|
6196
|
-
if (target_large > largest_seen_interection_ratio && target_large < 0.999) largest_seen_interection_ratio = target_large;else if (intersectionRatio && target_small < smallest_seen_intersection_ratio && target_small > 0.0001) smallest_seen_intersection_ratio = target_small;
|
|
6197
|
-
}
|
|
6198
|
-
if (mutation_busy) return;
|
|
6199
|
-
mutation_busy = true;
|
|
6200
|
-
last_move = window?.performance?.now?.() || +new Date();
|
|
6201
|
-
const first_element = this.element_by_index(0);
|
|
6202
|
-
const second_element = this.element_by_index(1);
|
|
6203
|
-
let dont_wraparound = false;
|
|
6204
|
-
if (!first_element || !second_element) dont_wraparound = true;else {
|
|
6205
|
-
// calculate how many cards including margin the slider fits
|
|
6206
|
-
const first_rect = first_element.getBoundingClientRect();
|
|
6207
|
-
if (!first_rect.width) {
|
|
6208
|
-
$e6c6e7929ea385ae$export$de56f1198d121036(first_rect);
|
|
6209
|
-
throw new Error("First rect doesn't have width");
|
|
6210
|
-
}
|
|
6211
|
-
const second_rect = second_element.getBoundingClientRect();
|
|
6212
|
-
const container_rect = this.insert_here.getBoundingClientRect();
|
|
6213
|
-
const margin = second_rect.left - first_rect.right;
|
|
6214
|
-
let width = 0;
|
|
6215
|
-
let amount = 0;
|
|
6216
|
-
while (width < container_rect.width) {
|
|
6217
|
-
if (width < 0) throw new Error("width can't be < 0");
|
|
6218
|
-
width += first_rect.width + margin;
|
|
6219
|
-
amount++;
|
|
6220
|
-
}
|
|
6221
|
-
// dlog(originally_rendered_elements.length, amount);
|
|
6222
|
-
if (originally_rendered_elements.length <= amount) dont_wraparound = true;
|
|
6223
|
-
}
|
|
6224
|
-
if (dont_wraparound) {
|
|
6225
|
-
if (surplus_in_body) {
|
|
6226
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("Removing surplus of els. Total els: ", sets_of_els);
|
|
6227
|
-
// @ts-ignore
|
|
6228
|
-
for (let i = (sets_of_els.length || 1) - 1; i--;) for (let j = 0; j < sets_of_els[i].length; j++) {
|
|
6229
|
-
const el = sets_of_els[i][j];
|
|
6230
|
-
if ("remove" in el) {
|
|
6231
|
-
removed_by_us.add(el);
|
|
6232
|
-
el.remove();
|
|
6233
|
-
}
|
|
6234
|
-
}
|
|
6235
|
-
this.invalidate_cache();
|
|
6236
|
-
surplus_in_body = false;
|
|
6237
|
-
}
|
|
6238
|
-
mutation_busy = false;
|
|
6239
|
-
return;
|
|
6240
|
-
}
|
|
6241
|
-
if (!surplus_in_body) {
|
|
6242
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("Adding surplus of els");
|
|
6243
|
-
this.insert_here.append(...sets_of_els.slice(0, -1).flat());
|
|
6244
|
-
this.invalidate_cache();
|
|
6245
|
-
surplus_in_body = true;
|
|
6246
|
-
}
|
|
6247
|
-
are_far_right = intersecting_mutations[this.index_of_last_element]?.intersectionRatio >= largest_seen_interection_ratio;
|
|
6248
|
-
clearTimeout(inactive_checker_timeout);
|
|
6249
|
-
inactive_checker_timeout = setTimeout(function () {
|
|
6250
|
-
if (!inactive_checker_running) {
|
|
6251
|
-
inactive_checker_running = true;
|
|
6252
|
-
check_if_we_inactive.call(this);
|
|
6253
|
-
}
|
|
6254
|
-
}.bind(this), time_of_no_events_to_count_as_scroll_idle * 0.8 // schedule a bit earlier so we hit our target
|
|
6255
|
-
);
|
|
6256
|
-
|
|
6257
|
-
mutation_busy = false;
|
|
3697
|
+
const $69f7524c8bdd85b4$export$20e9533e68ee72e7 = /*@__PURE__*/$9a42a570de51ea3d$export$e806c6c1615a59ae(false);
|
|
3698
|
+
const $69f7524c8bdd85b4$export$a9d39e43ae273d26 = /*@__PURE__*/$9a42a570de51ea3d$export$e806c6c1615a59ae();
|
|
3699
|
+
const $69f7524c8bdd85b4$export$7500cdfd37aafd43 = /*@__PURE__*/new Set();
|
|
3700
|
+
let $69f7524c8bdd85b4$var$old_url;
|
|
3701
|
+
const $69f7524c8bdd85b4$var$maybe_navigation = (what_happened, args) => {
|
|
3702
|
+
if (typeof location === "undefined") return;
|
|
3703
|
+
const new_url = location.href;
|
|
3704
|
+
if ($69f7524c8bdd85b4$var$old_url !== new_url) {
|
|
3705
|
+
$69f7524c8bdd85b4$export$a9d39e43ae273d26(new_url);
|
|
3706
|
+
if ($69f7524c8bdd85b4$var$old_url !== undefined)
|
|
3707
|
+
// don't resolve stateless href change ipns with the initial value - it's not a navigation
|
|
3708
|
+
$69f7524c8bdd85b4$export$20e9533e68ee72e7(new_url);
|
|
3709
|
+
$69f7524c8bdd85b4$var$old_url = new_url;
|
|
6258
3710
|
}
|
|
6259
|
-
|
|
6260
|
-
|
|
6261
|
-
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
|
|
6265
|
-
|
|
6266
|
-
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
while (event_listeners?.length) {
|
|
6270
|
-
// order shouldn't matter, this is fast
|
|
6271
|
-
const event_listener = event_listeners.pop();
|
|
6272
|
-
for (let i = 0; i < elements.length; i++) elements[i].addEventListener(...event_listener);
|
|
6273
|
-
}
|
|
6274
|
-
// render all elements again four times and adds them to the beginning
|
|
6275
|
-
const post_processors = [...(rendering_options.post_processors || [])];
|
|
6276
|
-
const our_index = post_processors.indexOf(post_processor);
|
|
6277
|
-
if (our_index >= 0) post_processors.splice(our_index, 1);else {
|
|
6278
|
-
const msg = "Couldn't find ourselves in post processors, infinite loop might ensue. Exiting. Wraparound will be broken.";
|
|
6279
|
-
(0, $61a34358bf0d3d8b$export$af2e17a20c2ea3c5).captureException(new Error(msg));
|
|
6280
|
-
$e6c6e7929ea385ae$export$de56f1198d121036(msg, () => {});
|
|
6281
|
-
return elements;
|
|
6282
|
-
}
|
|
6283
|
-
for (let i = 0; i < clones_per_side * 2; i++) {
|
|
6284
|
-
const additional_render = await $558ccd2de887e6d9$export$a9fc160c5ed83bd7(info.t, {
|
|
6285
|
-
...rendering_options,
|
|
6286
|
-
post_processors: post_processors,
|
|
6287
|
-
pre_processors: [],
|
|
6288
|
-
// don't need to execute pre processors again, displays are already pre-processed
|
|
6289
|
-
recs: info.displays
|
|
6290
|
-
});
|
|
6291
|
-
sets_of_els.push([...additional_render.elements]);
|
|
6292
|
-
}
|
|
6293
|
-
sets_of_els.reverse(); // here sets_of_els gets modified and reversed
|
|
6294
|
-
const sets_of_els_without_items_1_plus_n_from_first_render = [...sets_of_els];
|
|
6295
|
-
const index_of_first_render = sets_of_els_without_items_1_plus_n_from_first_render.indexOf(originally_rendered_elements);
|
|
6296
|
-
if (index_of_first_render < 0) throw new Error("Something's weird, pls check");
|
|
6297
|
-
sets_of_els_without_items_1_plus_n_from_first_render[index_of_first_render] = elements;
|
|
6298
|
-
// we cannot return the array that _might_ contain the elements from the other rendering passes that run asynchronously, this might lead to duplicated event listeners
|
|
6299
|
-
return sets_of_els_without_items_1_plus_n_from_first_render.flat();
|
|
6300
|
-
} else return elements;
|
|
3711
|
+
for (const fn of $69f7524c8bdd85b4$export$7500cdfd37aafd43) fn(what_happened, args);
|
|
3712
|
+
};
|
|
3713
|
+
$69f7524c8bdd85b4$export$baccefee4a395d8f((args, what_happened) => $69f7524c8bdd85b4$var$maybe_navigation(what_happened, args));
|
|
3714
|
+
$69f7524c8bdd85b4$var$maybe_navigation();
|
|
3715
|
+
globalThis?.window?.addEventListener("popstate", $268cbd9e4ade92db$export$b3bbfd758f11cfa9(e => $69f7524c8bdd85b4$var$maybe_navigation("popstate", e)));
|
|
3716
|
+
async function $69f7524c8bdd85b4$export$1cd22bab0d2c3b0b(callback) {
|
|
3717
|
+
const catchified_callback = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(callback);
|
|
3718
|
+
for await (const href of $69f7524c8bdd85b4$export$20e9533e68ee72e7) {
|
|
3719
|
+
catchified_callback(href);
|
|
3720
|
+
break;
|
|
6301
3721
|
}
|
|
6302
|
-
return {
|
|
6303
|
-
constructor_plugin: constructor_plugin,
|
|
6304
|
-
mutation_plugin: mutation_plugin,
|
|
6305
|
-
post_processor: post_processor
|
|
6306
|
-
};
|
|
6307
3722
|
}
|
|
6308
|
-
function $
|
|
6309
|
-
|
|
6310
|
-
insert_here: sliding
|
|
6311
|
-
} = slider;
|
|
6312
|
-
const slider_box = sliding.getBoundingClientRect();
|
|
6313
|
-
const leftmost_rect = slider.element_by_index(0).getBoundingClientRect();
|
|
6314
|
-
const rightmost_rect = slider.element_by_index(slider.index_of_last_element).getBoundingClientRect();
|
|
6315
|
-
const leftmost_card_to_left_viewport_edge = slider_box.left - leftmost_rect.left;
|
|
6316
|
-
const rightmost_card_to_right_viewport_edge = rightmost_rect.right - slider_box.right;
|
|
6317
|
-
const children = [...sliding.children];
|
|
3723
|
+
async function $69f7524c8bdd85b4$export$baccefee4a395d8f(after_navigation, replace_replaceState = true) {
|
|
3724
|
+
if (typeof History === "undefined") return;
|
|
6318
3725
|
const {
|
|
6319
|
-
|
|
6320
|
-
} =
|
|
6321
|
-
const
|
|
6322
|
-
const
|
|
6323
|
-
|
|
6324
|
-
|
|
6325
|
-
|
|
6326
|
-
|
|
6327
|
-
|
|
6328
|
-
|
|
6329
|
-
|
|
6330
|
-
|
|
3726
|
+
prototype: prototype
|
|
3727
|
+
} = History;
|
|
3728
|
+
const instance = history;
|
|
3729
|
+
const polyfill_dance = the_thing => {
|
|
3730
|
+
const proxy_the_thing = obj => {
|
|
3731
|
+
const orig_pushState = obj[the_thing];
|
|
3732
|
+
obj[the_thing] = new Proxy(orig_pushState, {
|
|
3733
|
+
apply: (target, this_arg, arguments_list) => {
|
|
3734
|
+
const nav_result = Reflect.apply(target, this_arg, arguments_list);
|
|
3735
|
+
try {
|
|
3736
|
+
after_navigation(arguments_list, the_thing);
|
|
3737
|
+
} catch (e) {
|
|
3738
|
+
$548fd58b14b25a52$export$8048b892d651b310(e);
|
|
3739
|
+
}
|
|
3740
|
+
return nav_result;
|
|
3741
|
+
}
|
|
3742
|
+
});
|
|
3743
|
+
};
|
|
3744
|
+
proxy_the_thing(prototype);
|
|
3745
|
+
if (Object.getOwnPropertyNames(instance).includes(the_thing))
|
|
3746
|
+
// we don't want to just change the instance because that's not the way to do it, but we don't want to not work because someone else did it wrong
|
|
3747
|
+
proxy_the_thing(instance);
|
|
6331
3748
|
};
|
|
6332
|
-
|
|
6333
|
-
if (
|
|
6334
|
-
if (leftmost_card_to_left_viewport_edge > rightmost_card_to_right_viewport_edge * 1.1 /* add 10% margin */)
|
|
6335
|
-
// dlog("Moving", chunk_size, "to the right");
|
|
6336
|
-
// sliding.append(...children.slice(0, chunk_size));
|
|
6337
|
-
post_move(1);else if (rightmost_card_to_right_viewport_edge > leftmost_card_to_left_viewport_edge * 1.1)
|
|
6338
|
-
// dlog("Moving", chunk_size, "to the left");
|
|
6339
|
-
// sliding.prepend(...children.slice(-chunk_size));
|
|
6340
|
-
post_move(-1);
|
|
6341
|
-
}
|
|
6342
|
-
// dlog("Scroll idle", leftmost_card_to_left_viewport_edge, rightmost_card_to_right_viewport_edge);
|
|
3749
|
+
polyfill_dance("pushState");
|
|
3750
|
+
if (replace_replaceState) polyfill_dance("replaceState");
|
|
6343
3751
|
}
|
|
6344
|
-
|
|
6345
3752
|
const $3721a5ccba25c247$var$connection_map = /*@__PURE__*/new WeakMap();
|
|
6346
3753
|
function $3721a5ccba25c247$export$3d04c40e7acc1a32(initial_value) {
|
|
6347
3754
|
let subscribed = false;
|
|
@@ -6505,122 +3912,329 @@ function $bf76a92ec2055e1a$export$419f84efad7d9fe(surface_per_size, cleanup_prom
|
|
|
6505
3912
|
function $bf76a92ec2055e1a$export$be95cb0e8cfd099e() {
|
|
6506
3913
|
return new Promise(r => $69f7524c8bdd85b4$export$1cd22bab0d2c3b0b(r));
|
|
6507
3914
|
}
|
|
6508
|
-
function $
|
|
6509
|
-
|
|
6510
|
-
|
|
6511
|
-
|
|
6512
|
-
|
|
6513
|
-
|
|
6514
|
-
|
|
6515
|
-
|
|
3915
|
+
function $c8263a2185830bf1$export$82a685f2da2fb027(a_element, product_id, recommendation_id, additional_listener) {
|
|
3916
|
+
if (!a_element ||
|
|
3917
|
+
// @ts-ignore
|
|
3918
|
+
!a_element.depict_tracked ||
|
|
3919
|
+
// @ts-ignore
|
|
3920
|
+
a_element?.depict_tracked?.recommendation_id != recommendation_id ||
|
|
3921
|
+
// @ts-ignore
|
|
3922
|
+
a_element?.depict_tracked?.product_id != product_id) {
|
|
3923
|
+
const listener = e => {
|
|
3924
|
+
localStorage.setItem(`depict_attribution_${product_id}`, recommendation_id);
|
|
3925
|
+
if (additional_listener) additional_listener(e, product_id, recommendation_id);
|
|
3926
|
+
};
|
|
3927
|
+
// @ts-ignore
|
|
3928
|
+
if (a_element.depict_tracked)
|
|
3929
|
+
// @ts-ignore
|
|
3930
|
+
a_element.removeEventListener("click", a_element.depict_tracked?.listener);
|
|
3931
|
+
// @ts-ignore
|
|
3932
|
+
a_element.depict_tracked = {
|
|
3933
|
+
product_id: product_id,
|
|
3934
|
+
recommendation_id: recommendation_id,
|
|
3935
|
+
listener: listener
|
|
3936
|
+
};
|
|
3937
|
+
a_element.addEventListener("click", listener);
|
|
3938
|
+
return listener;
|
|
3939
|
+
}
|
|
3940
|
+
}
|
|
3941
|
+
async function $c8263a2185830bf1$export$2c34560c3749dc63(button, get_product_id, tracking_fn, unmatching_tracking, event) {
|
|
3942
|
+
// @ts-ignore
|
|
3943
|
+
if (!button || button.depict_tracked) return;
|
|
3944
|
+
button.addEventListener(event ? event : "click", $268cbd9e4ade92db$export$b3bbfd758f11cfa9(async e => {
|
|
3945
|
+
if (!e.isTrusted) {
|
|
3946
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("ignoring event", e, "because it's not user generated");
|
|
3947
|
+
return;
|
|
3948
|
+
}
|
|
3949
|
+
const product_id = await get_product_id(undefined, e);
|
|
3950
|
+
if (product_id) {
|
|
3951
|
+
const item_name = `depict_attribution_${product_id}`;
|
|
3952
|
+
const recommendation_id = localStorage.getItem(item_name);
|
|
3953
|
+
if (recommendation_id) {
|
|
3954
|
+
localStorage.removeItem(item_name);
|
|
3955
|
+
tracking_fn(product_id, recommendation_id, false, e);
|
|
3956
|
+
} else if (unmatching_tracking) tracking_fn(product_id, recommendation_id, true, e);
|
|
3957
|
+
}
|
|
3958
|
+
}));
|
|
3959
|
+
// @ts-ignore
|
|
3960
|
+
button.depict_tracked = true;
|
|
3961
|
+
}
|
|
3962
|
+
function $c18ce8dadd041cdd$export$edfedd0557ca5a2d(ga_tracker, append_to_url) {
|
|
3963
|
+
if (!ga_tracker) return;
|
|
3964
|
+
// Docs for analytics.js Tasks:
|
|
3965
|
+
// https://developers.google.com/analytics/devguides/collection/analyticsjs/tasks
|
|
3966
|
+
const sendHitTask = "sendHitTask";
|
|
3967
|
+
const originalSendHitTask = ga_tracker.get(sendHitTask);
|
|
3968
|
+
ga_tracker.set(sendHitTask, model => {
|
|
3969
|
+
originalSendHitTask(model);
|
|
3970
|
+
// console.log('Sent original hit, now sending to depict');
|
|
3971
|
+
try {
|
|
3972
|
+
const payLoad = model.get("hitPayload");
|
|
3973
|
+
const path = (0, $4c6861fbcd3a0611$export$362abebb4b313340) + "/collect-ga";
|
|
3974
|
+
let url = path + "?" + payLoad;
|
|
3975
|
+
if (append_to_url) url += append_to_url;
|
|
3976
|
+
const n = navigator;
|
|
3977
|
+
const sb = "sendBeacon";
|
|
3978
|
+
if (n[sb])
|
|
3979
|
+
// this is actually smaller, I tested
|
|
3980
|
+
n[sb](url);else {
|
|
3981
|
+
const xhttp = new XMLHttpRequest();
|
|
3982
|
+
xhttp.open("GET", url);
|
|
3983
|
+
xhttp.send();
|
|
3984
|
+
}
|
|
3985
|
+
} catch (e) {
|
|
3986
|
+
// console.log('Could not send beacon to /collect-ga', e);
|
|
3987
|
+
}
|
|
6516
3988
|
});
|
|
6517
3989
|
}
|
|
6518
|
-
function $
|
|
6519
|
-
//
|
|
6520
|
-
|
|
6521
|
-
|
|
6522
|
-
|
|
6523
|
-
|
|
3990
|
+
function $c18ce8dadd041cdd$export$674d8cd8b6868154() {
|
|
3991
|
+
// Snippet to load GA async
|
|
3992
|
+
const w = window;
|
|
3993
|
+
// @ts-ignore
|
|
3994
|
+
w.ga ||= function () {
|
|
3995
|
+
(w.ga.q ||= []).push(arguments);
|
|
3996
|
+
};
|
|
3997
|
+
w.ga.l = +new Date();
|
|
3998
|
+
}
|
|
3999
|
+
|
|
4000
|
+
/**
|
|
4001
|
+
* Elements currently intersecting with the viewport.
|
|
4002
|
+
* If they are intersecting for the `has_to_be_intersecting_for` duration, we count it as an impression, and call the callback.
|
|
4003
|
+
*/
|
|
4004
|
+
const $72ed530554068e4f$var$current_intersections = /*@__PURE__*/new WeakMap();
|
|
4005
|
+
/**
|
|
4006
|
+
* Currently watched elements by the intersection observer with their respective callback
|
|
4007
|
+
* */
|
|
4008
|
+
const $72ed530554068e4f$var$watched_elements = /*@__PURE__*/new WeakMap();
|
|
4009
|
+
const $72ed530554068e4f$var$unwatch_element = element => {
|
|
4010
|
+
$72ed530554068e4f$var$intersection_observer?.unobserve(element);
|
|
4011
|
+
$72ed530554068e4f$var$watched_elements.delete(element);
|
|
4012
|
+
$72ed530554068e4f$var$current_intersections.delete(element);
|
|
4013
|
+
};
|
|
4014
|
+
const $72ed530554068e4f$export$4c51576248bcdf31 = (element, callback) => {
|
|
4015
|
+
if ($72ed530554068e4f$var$watched_elements.has(element)) {
|
|
4016
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Not watching", element, "as it's already being watched");
|
|
4017
|
+
return () => {};
|
|
4018
|
+
}
|
|
4019
|
+
$72ed530554068e4f$var$intersection_observer?.observe(element);
|
|
4020
|
+
/** Calls the given callback and makes sure to stop watching the element */
|
|
4021
|
+
const wrapped_callback = element => {
|
|
4022
|
+
callback(element);
|
|
4023
|
+
$72ed530554068e4f$var$unwatch_element(element);
|
|
4024
|
+
};
|
|
4025
|
+
$72ed530554068e4f$var$watched_elements.set(element, wrapped_callback);
|
|
4026
|
+
const disconnect_observer = (0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onremoved(element, () => {
|
|
4027
|
+
// Sometimes it has already rapidly been reinserted. The observer events lag by one tick.
|
|
4028
|
+
// For that case, make sure we're really out of the DOM
|
|
4029
|
+
if (document.documentElement.contains(element)) return;
|
|
4030
|
+
$72ed530554068e4f$var$unwatch_element(element);
|
|
4031
|
+
});
|
|
4032
|
+
return () => {
|
|
4033
|
+
disconnect_observer();
|
|
4034
|
+
$72ed530554068e4f$var$unwatch_element(element);
|
|
4035
|
+
};
|
|
4036
|
+
};
|
|
4037
|
+
const $72ed530554068e4f$var$intersection_observer_callback = entries => {
|
|
4038
|
+
for (const record of entries) {
|
|
4039
|
+
const {
|
|
4040
|
+
target: target
|
|
4041
|
+
} = record;
|
|
4042
|
+
const callback = $72ed530554068e4f$var$watched_elements.get(target);
|
|
4043
|
+
// Skip the element if it's no longer being watched.
|
|
4044
|
+
if (!callback) {
|
|
4045
|
+
$72ed530554068e4f$var$intersection_observer?.unobserve(target);
|
|
4046
|
+
continue;
|
|
4047
|
+
}
|
|
4048
|
+
const currently_intersecting = $72ed530554068e4f$var$current_intersections.has(target);
|
|
4049
|
+
if (!currently_intersecting && record.intersectionRatio >= (0, $dd025eb6f77f8f8b$export$135da44d0ba958bc)[0]) {
|
|
4050
|
+
// we're intersecting enough and not already in the process of "measuring"
|
|
4051
|
+
const started_intersecting_at_ = +new Date(); // save start time
|
|
4052
|
+
// Schedule the callback function to be called after the element has been intersecting for the required duration
|
|
4053
|
+
const callback_timeout_ = setTimeout(callback, (0, $dd025eb6f77f8f8b$export$ca8321ea61dc2544), target);
|
|
4054
|
+
$72ed530554068e4f$var$current_intersections.set(target, {
|
|
4055
|
+
started_intersecting_at_: started_intersecting_at_,
|
|
4056
|
+
callback_timeout_: callback_timeout_
|
|
4057
|
+
});
|
|
4058
|
+
} else if (currently_intersecting && record.intersectionRatio < (0, $dd025eb6f77f8f8b$export$135da44d0ba958bc)[1]) {
|
|
4059
|
+
// we are in the process of "measuring" and went below the threshold
|
|
4060
|
+
const {
|
|
4061
|
+
started_intersecting_at_: started_intersecting_at_,
|
|
4062
|
+
callback_timeout_: callback_timeout_
|
|
4063
|
+
} = $72ed530554068e4f$var$current_intersections.get(target);
|
|
4064
|
+
const time_elapsed = +new Date() - started_intersecting_at_;
|
|
4065
|
+
// If we stopped intersecting too early we want to abort our timeout.
|
|
4066
|
+
// if we did not we also want to abort the timeout since it's been lagging and just instantly send the event
|
|
4067
|
+
// (the browser can delay setTimeout timers)
|
|
4068
|
+
clearTimeout(callback_timeout_);
|
|
4069
|
+
if (time_elapsed <= (0, $dd025eb6f77f8f8b$export$ca8321ea61dc2544)) $72ed530554068e4f$var$current_intersections.delete(target);else {
|
|
4070
|
+
// we intersected long enough
|
|
4071
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("intersection_observer: setTimeout lagged", time_elapsed, (0, $dd025eb6f77f8f8b$export$ca8321ea61dc2544), "ms", target);
|
|
4072
|
+
callback(target);
|
|
4073
|
+
}
|
|
4074
|
+
}
|
|
4075
|
+
}
|
|
4076
|
+
};
|
|
4077
|
+
/**
|
|
4078
|
+
* Global IntersectionObserver used for all impression tracking.
|
|
4079
|
+
* It's faster to use one observer for all elements than to create a new one for each element.
|
|
4080
|
+
*/
|
|
4081
|
+
const $72ed530554068e4f$var$intersection_observer = typeof window === "object" ? /*@__PURE__*/new IntersectionObserver( /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9($72ed530554068e4f$var$intersection_observer_callback), {
|
|
4082
|
+
threshold: /*@__PURE__*/$0da0cad4f39e8f32$export$f8ea2e7b15b5d129(8)
|
|
4083
|
+
}) : undefined;
|
|
4084
|
+
const $11ff7b46c1fb674c$export$d0efd8ed14f5c33 = (items, display, info) => {
|
|
4085
|
+
if (!items?.length) return items;
|
|
4086
|
+
const node_array = Array.isArray(items) ? items : [...items]; // if it's a NodeList convert it to an array
|
|
4087
|
+
const first_watchable_el = node_array.find(el => el instanceof Element);
|
|
4088
|
+
if (!first_watchable_el) {
|
|
4089
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Impression tracking: Can't observe", items, display);
|
|
4090
|
+
return items;
|
|
4091
|
+
}
|
|
4092
|
+
if (!info.t) {
|
|
4093
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Impression tracking: No tenant instance, can't track", items, display);
|
|
4094
|
+
return items;
|
|
4095
|
+
}
|
|
4096
|
+
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onexists(first_watchable_el, ({
|
|
4097
|
+
element: element
|
|
4098
|
+
}) => {
|
|
4099
|
+
$72ed530554068e4f$export$4c51576248bcdf31(element, () => {
|
|
4100
|
+
const {
|
|
4101
|
+
recommendation_id: recommendation_id,
|
|
4102
|
+
search_result_id: search_result_id,
|
|
4103
|
+
product_listing_result_id: product_listing_result_id,
|
|
4104
|
+
suggestions_result_id: suggestions_result_id
|
|
4105
|
+
} = display;
|
|
4106
|
+
$dd025eb6f77f8f8b$export$4205dc6835bc0d9f({
|
|
4107
|
+
...$e0a87646d12cb987$export$8c6f26a5b6921b95(),
|
|
4108
|
+
recommendation_type: info.rendering_options.type,
|
|
4109
|
+
entity_price: display.sale_price,
|
|
4110
|
+
market: info.t.market,
|
|
4111
|
+
tenant: info.t.tenant,
|
|
4112
|
+
product_id: display.product_id,
|
|
4113
|
+
recommendation_id: recommendation_id,
|
|
4114
|
+
search_result_id: search_result_id,
|
|
4115
|
+
product_listing_result_id: product_listing_result_id,
|
|
4116
|
+
suggestions_result_id: suggestions_result_id
|
|
4117
|
+
});
|
|
4118
|
+
});
|
|
6524
4119
|
});
|
|
4120
|
+
return items;
|
|
4121
|
+
};
|
|
4122
|
+
const $8e19f8200d357fe7$export$37125ccc5dd98050 = ({
|
|
4123
|
+
element: element,
|
|
4124
|
+
data: data,
|
|
4125
|
+
wait_for_dom_insertion = true
|
|
4126
|
+
}) => {
|
|
4127
|
+
const disconnectors = [];
|
|
4128
|
+
const impression_track = () => {
|
|
4129
|
+
const disconnector = $72ed530554068e4f$export$4c51576248bcdf31(element, () => {
|
|
4130
|
+
$dd025eb6f77f8f8b$export$4205dc6835bc0d9f({
|
|
4131
|
+
...$e0a87646d12cb987$export$8c6f26a5b6921b95(),
|
|
4132
|
+
...data
|
|
4133
|
+
});
|
|
4134
|
+
});
|
|
4135
|
+
disconnectors.push(disconnector);
|
|
4136
|
+
};
|
|
4137
|
+
if (wait_for_dom_insertion) disconnectors.push((0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onexists(element, impression_track));else impression_track();
|
|
4138
|
+
return () => disconnectors.forEach(disconnector => disconnector());
|
|
4139
|
+
};
|
|
4140
|
+
let $dd025eb6f77f8f8b$export$135da44d0ba958bc = [0.6, 0.5];
|
|
4141
|
+
const $dd025eb6f77f8f8b$export$c543ee4cdb0d0964 = (start, end) => $dd025eb6f77f8f8b$export$135da44d0ba958bc = [start, end];
|
|
4142
|
+
const $dd025eb6f77f8f8b$export$ca8321ea61dc2544 = 500;
|
|
4143
|
+
const $dd025eb6f77f8f8b$export$4205dc6835bc0d9f = data => {
|
|
4144
|
+
data.type = "element_visible"; // Set the type to element_visible as this is optional to pass here.
|
|
4145
|
+
$0c84f8e99aac5765$export$28cacbd9b4306ffc([data], true);
|
|
4146
|
+
};
|
|
4147
|
+
|
|
4148
|
+
// https://stackoverflow.com/a/39941616
|
|
4149
|
+
function $2fafbbbf345dcde0$var$invert_promise(promise) {
|
|
4150
|
+
return new Promise((res, rej) => promise.then(rej, res));
|
|
6525
4151
|
}
|
|
6526
|
-
function $
|
|
6527
|
-
|
|
6528
|
-
const dataLayer = globalThis.dataLayer ||= [];
|
|
6529
|
-
// Process entries that are already queued at this point
|
|
6530
|
-
process_entries(dataLayer);
|
|
6531
|
-
// And then process any future entries, making sure to pass them on to other potential proxies to the push function
|
|
6532
|
-
dataLayer.push = new Proxy(dataLayer.push, {
|
|
6533
|
-
apply(target, this_arg, args_list) {
|
|
6534
|
-
try {
|
|
6535
|
-
process_entries(args_list);
|
|
6536
|
-
} catch (e) {
|
|
6537
|
-
$268cbd9e4ade92db$export$f18d5b0af29128b7([e, "Processing entries from dataLayer failed"], "warning");
|
|
6538
|
-
}
|
|
6539
|
-
return target.apply(this_arg, args_list);
|
|
6540
|
-
}
|
|
6541
|
-
});
|
|
4152
|
+
function $2fafbbbf345dcde0$export$947a20746936143d(promises) {
|
|
4153
|
+
return Promise?.any?.(promises) ?? $2fafbbbf345dcde0$var$invert_promise(Promise.all([...promises].map($2fafbbbf345dcde0$var$invert_promise)));
|
|
6542
4154
|
}
|
|
6543
|
-
function $
|
|
6544
|
-
(
|
|
6545
|
-
|
|
6546
|
-
|
|
6547
|
-
|
|
6548
|
-
|
|
6549
|
-
})().catch(e => $268cbd9e4ade92db$export$f18d5b0af29128b7([e, "Extracting and sending transaction IDs from URL failed"], "warning"));
|
|
4155
|
+
async function $44909e19109bf973$export$836f70a28c317905(product_id) {
|
|
4156
|
+
if (typeof BroadcastChannel != "function") return;
|
|
4157
|
+
const bc = new BroadcastChannel("right_click_attribution");
|
|
4158
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Broadcasting", product_id, "to", bc);
|
|
4159
|
+
bc.postMessage(product_id);
|
|
4160
|
+
bc.close();
|
|
6550
4161
|
}
|
|
6551
|
-
function $
|
|
6552
|
-
|
|
6553
|
-
|
|
6554
|
-
|
|
6555
|
-
|
|
4162
|
+
function $44909e19109bf973$export$58c56fe2313fdbe3(elements, display, info, get_event_listener_remover) {
|
|
4163
|
+
if (typeof BroadcastChannel != "function") return elements;
|
|
4164
|
+
const disconnectors = [];
|
|
4165
|
+
const handler = $268cbd9e4ade92db$export$b3bbfd758f11cfa9(e => $44909e19109bf973$export$8f66c4c7fb96eda2(e, ("variant_index" in display ? display.variant_displays[display.variant_index] : display).product_id));
|
|
4166
|
+
const auxclick_handler = e => e.button === 1 && handler(e);
|
|
4167
|
+
for (let i = 0; i < elements?.length; i++) {
|
|
4168
|
+
const element = elements[i];
|
|
4169
|
+
element.addEventListener("contextmenu", handler);
|
|
4170
|
+
element.addEventListener("auxclick", auxclick_handler); // actual wheel click - some mouses / OS:es also dispatch auxclick on rightclick
|
|
4171
|
+
if (get_event_listener_remover) disconnectors.push(() => {
|
|
4172
|
+
element.removeEventListener("contextmenu", handler);
|
|
4173
|
+
element.removeEventListener("auxclick", auxclick_handler);
|
|
4174
|
+
});
|
|
6556
4175
|
}
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
tenant: t.tenant,
|
|
6560
|
-
market: t.market,
|
|
6561
|
-
events: [{
|
|
6562
|
-
event_type: "transaction_mapping",
|
|
6563
|
-
transaction_id: transaction_id,
|
|
6564
|
-
session_id: session_id
|
|
6565
|
-
}]
|
|
6566
|
-
};
|
|
6567
|
-
$0c84f8e99aac5765$export$cc3b6ddf805f6156((0, $4c6861fbcd3a0611$export$362abebb4b313340) + "/v2/track", payload);
|
|
4176
|
+
get_event_listener_remover?.(() => disconnectors.forEach(disconnector => disconnector()));
|
|
4177
|
+
return elements;
|
|
6568
4178
|
}
|
|
6569
|
-
function $
|
|
6570
|
-
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
|
|
6574
|
-
|
|
6575
|
-
if (typeof get_all_function !== "function") get_all_function = await $e6d67ef355abb2dc$export$2fc1a072736ae2f6(window, "ga", "getAll");
|
|
6576
|
-
// @ts-ignore
|
|
6577
|
-
const all_trackers = get_all_function.call(ga);
|
|
6578
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("we have trackers", all_trackers);
|
|
6579
|
-
// @ts-ignore
|
|
4179
|
+
async function $44909e19109bf973$export$8f66c4c7fb96eda2(e, product_id) {
|
|
4180
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Contextmenu was invoked", e);
|
|
4181
|
+
const element = e.currentTarget || e.target;
|
|
4182
|
+
const bc = new BroadcastChannel("right_click_attribution");
|
|
4183
|
+
const got_wanted_event = await $2fafbbbf345dcde0$export$947a20746936143d([new Promise(resolve => {
|
|
4184
|
+
bc.addEventListener("message", $268cbd9e4ade92db$export$b3bbfd758f11cfa9(msg => {
|
|
6580
4185
|
const {
|
|
6581
|
-
|
|
6582
|
-
} =
|
|
6583
|
-
$
|
|
6584
|
-
if (
|
|
6585
|
-
// this check is just so we don't fail if this doesn't exist for some reason, but it always should
|
|
6586
|
-
P.push = new Proxy(P.push, {
|
|
6587
|
-
apply(target, this_arg, args_list) {
|
|
6588
|
-
const retval = target.apply(this_arg, args_list);
|
|
6589
|
-
$268cbd9e4ade92db$export$b3bbfd758f11cfa9(modify_trackers_of_iterable)(args_list);
|
|
6590
|
-
return retval;
|
|
6591
|
-
}
|
|
6592
|
-
});
|
|
6593
|
-
function modify_trackers_of_iterable(array) {
|
|
6594
|
-
for (const tracker of array) $268cbd9e4ade92db$export$b3bbfd758f11cfa9($5a44db2d2c8361b9$var$make_tracker_send_to_depict)(tracker, t, filter);
|
|
6595
|
-
}
|
|
4186
|
+
data: data
|
|
4187
|
+
} = msg;
|
|
4188
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Recieved broadcast channel event", data, msg);
|
|
4189
|
+
if (data == product_id) resolve(true);
|
|
6596
4190
|
}));
|
|
4191
|
+
}), new Promise(r => setTimeout(r, 60000, false))]);
|
|
4192
|
+
if (got_wanted_event) {
|
|
4193
|
+
const click = new MouseEvent("click", {
|
|
4194
|
+
view: window,
|
|
4195
|
+
bubbles: true,
|
|
4196
|
+
cancelable: true,
|
|
4197
|
+
metaKey: true
|
|
4198
|
+
});
|
|
4199
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Someone broadcasted our product_id! Simulating a click event on the element that was contextmenu'd", element, click);
|
|
4200
|
+
element.addEventListener("click", e => (e.preventDefault(), false), {
|
|
4201
|
+
once: true
|
|
4202
|
+
});
|
|
4203
|
+
element.dispatchEvent(click);
|
|
4204
|
+
} else $e6c6e7929ea385ae$export$de56f1198d121036("Our product_id did not get broadcasted, closing channel");
|
|
4205
|
+
bc.close();
|
|
4206
|
+
}
|
|
4207
|
+
let $72ee205b59322497$var$last_page_pageview_sent_for;
|
|
4208
|
+
async function $72ee205b59322497$export$eee4c4d924348b05(data) {
|
|
4209
|
+
// Send page view to depict if needed
|
|
4210
|
+
try {
|
|
4211
|
+
const {
|
|
4212
|
+
href: href
|
|
4213
|
+
} = location;
|
|
4214
|
+
if ($72ee205b59322497$var$last_page_pageview_sent_for !== href) {
|
|
4215
|
+
$72ee205b59322497$var$last_page_pageview_sent_for = href;
|
|
4216
|
+
$e0a87646d12cb987$export$82badda1f9923310({
|
|
4217
|
+
...data,
|
|
4218
|
+
type: "page_view"
|
|
4219
|
+
});
|
|
4220
|
+
if (data.product_id) await $44909e19109bf973$export$836f70a28c317905(data.product_id); // this takes care of right click click attribution - broadcasts the URL of the current page
|
|
4221
|
+
}
|
|
6597
4222
|
} catch (error) {
|
|
6598
|
-
$268cbd9e4ade92db$export$f18d5b0af29128b7(error, "
|
|
4223
|
+
$268cbd9e4ade92db$export$f18d5b0af29128b7([error, "Sending page view failed"], "warning");
|
|
6599
4224
|
}
|
|
6600
4225
|
}
|
|
6601
|
-
|
|
6602
|
-
|
|
6603
|
-
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
|
|
6607
|
-
|
|
6608
|
-
|
|
6609
|
-
|
|
6610
|
-
|
|
6611
|
-
|
|
6612
|
-
|
|
6613
|
-
const payload = model.get("hitPayload");
|
|
6614
|
-
const sp = new URLSearchParams(payload);
|
|
6615
|
-
const id = sp.get("ti");
|
|
6616
|
-
if (id) {
|
|
6617
|
-
$e6c6e7929ea385ae$export$de56f1198d121036("Got interesting analytics request", payload, id);
|
|
6618
|
-
$0c9d834f187cc4ff$export$1ac466d53a6636ac(t, id, dsid, filter);
|
|
6619
|
-
}
|
|
6620
|
-
} catch (e) {
|
|
6621
|
-
$268cbd9e4ade92db$export$f18d5b0af29128b7(e, "error");
|
|
6622
|
-
}
|
|
6623
|
-
});
|
|
4226
|
+
let $72ee205b59322497$var$sending_on_navigation = false;
|
|
4227
|
+
async function $72ee205b59322497$export$f7cb1bd47199ec38(data) {
|
|
4228
|
+
if (!$72ee205b59322497$var$sending_on_navigation) {
|
|
4229
|
+
$72ee205b59322497$var$sending_on_navigation = true;
|
|
4230
|
+
$268cbd9e4ade92db$export$b3bbfd758f11cfa9(async () => {
|
|
4231
|
+
for await (const _href of (0, $69f7524c8bdd85b4$export$a9d39e43ae273d26)) $72ee205b59322497$export$eee4c4d924348b05({
|
|
4232
|
+
tenant: data.tenant,
|
|
4233
|
+
market: data.market,
|
|
4234
|
+
product_id: await data.get_product_id(_href)
|
|
4235
|
+
});
|
|
4236
|
+
})();
|
|
4237
|
+
}
|
|
6624
4238
|
}
|
|
6625
4239
|
|
|
6626
4240
|
/**
|
|
@@ -6818,40 +4432,62 @@ const $23d6393391c08860$export$783ef16647773b3d = /*@__PURE__*/$41f528c04cc8a8da
|
|
|
6818
4432
|
const meta = await $e6d67ef355abb2dc$export$2fc1a072736ae2f6(window, "ShopifyAnalytics", "meta");
|
|
6819
4433
|
return meta?.product;
|
|
6820
4434
|
}));
|
|
6821
|
-
|
|
6822
|
-
|
|
6823
|
-
|
|
6824
|
-
|
|
6825
|
-
}) {
|
|
4435
|
+
const $55769f63ea4d8da4$export$5c069c93d2b7493f = delay => new Promise(resolve => setTimeout(resolve, delay));
|
|
4436
|
+
async function $d2fc3fb450961938$export$bcd70d5ed1cf6313(url, options, max_retries = 10, useFetch = fetch) {
|
|
4437
|
+
const ONE_MINUTE = 60000;
|
|
4438
|
+
const max_backoff_ms = ONE_MINUTE;
|
|
6826
4439
|
const {
|
|
6827
|
-
|
|
6828
|
-
|
|
6829
|
-
|
|
6830
|
-
|
|
6831
|
-
|
|
6832
|
-
|
|
6833
|
-
|
|
6834
|
-
|
|
6835
|
-
|
|
6836
|
-
|
|
6837
|
-
|
|
6838
|
-
|
|
6839
|
-
|
|
6840
|
-
|
|
6841
|
-
|
|
6842
|
-
|
|
4440
|
+
stack: stack
|
|
4441
|
+
} = new Error();
|
|
4442
|
+
const calculate_retry = delay => {
|
|
4443
|
+
delay *= 2 + Math.random();
|
|
4444
|
+
if (delay > max_backoff_ms) delay = max_backoff_ms * (1 + Math.random() / 10);
|
|
4445
|
+
return delay;
|
|
4446
|
+
};
|
|
4447
|
+
let try_again_in_ms = 100;
|
|
4448
|
+
let has_succeeded = false;
|
|
4449
|
+
let result = false;
|
|
4450
|
+
while (max_retries && !has_succeeded) try {
|
|
4451
|
+
const response = await useFetch(url, options);
|
|
4452
|
+
const {
|
|
4453
|
+
status: status,
|
|
4454
|
+
ok: ok
|
|
4455
|
+
} = response;
|
|
4456
|
+
if (!response || !ok || status !== 200) {
|
|
4457
|
+
if (status >= 400 && status < 500) {
|
|
4458
|
+
$268cbd9e4ade92db$export$b3bbfd758f11cfa9($d2fc3fb450961938$var$send_sentry_4xx)(response, options?.body || {}, stack);
|
|
4459
|
+
has_succeeded = true;
|
|
4460
|
+
} else if (status === 404) has_succeeded = true;
|
|
4461
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Response not ok", response);
|
|
4462
|
+
} else has_succeeded = true;
|
|
4463
|
+
result = response;
|
|
4464
|
+
} catch (error) {
|
|
4465
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Error while fetching: ", error, url, options);
|
|
4466
|
+
// Don't retry CORS
|
|
4467
|
+
if (error.message.includes("CORS") && error.name.includes("CORS")) has_succeeded = true;
|
|
4468
|
+
} finally {
|
|
4469
|
+
if (!has_succeeded) await $55769f63ea4d8da4$export$5c069c93d2b7493f(try_again_in_ms);
|
|
4470
|
+
try_again_in_ms = calculate_retry(try_again_in_ms);
|
|
4471
|
+
max_retries -= 1;
|
|
6843
4472
|
}
|
|
6844
|
-
|
|
6845
|
-
|
|
6846
|
-
|
|
4473
|
+
return result;
|
|
4474
|
+
}
|
|
4475
|
+
async function $d2fc3fb450961938$var$send_sentry_4xx(response, body, stack) {
|
|
4476
|
+
if (process.env.TENANT === "shopify-config" && response.status === 403)
|
|
4477
|
+
// Don't send requests in the shopify admin that say we need to re-authorize to sentry
|
|
6847
4478
|
return;
|
|
6848
|
-
|
|
6849
|
-
|
|
6850
|
-
|
|
6851
|
-
function
|
|
6852
|
-
|
|
6853
|
-
|
|
6854
|
-
|
|
4479
|
+
const msg = `Validation error: got 4XX from API`;
|
|
4480
|
+
const text = await response.clone().text();
|
|
4481
|
+
$e6c6e7929ea385ae$export$de56f1198d121036(msg, "body", body, "response", response, "text", text, "stack", stack);
|
|
4482
|
+
(0, $61a34358bf0d3d8b$export$af2e17a20c2ea3c5).withScope(function (scope) {
|
|
4483
|
+
scope.setExtra("stack", stack);
|
|
4484
|
+
scope.setExtra("request_body", body);
|
|
4485
|
+
scope.setExtra("response", response);
|
|
4486
|
+
scope.setExtra("serialized_response", $45e05ec4fd7f1ee7$export$39d526a1194b6499(response));
|
|
4487
|
+
scope.setExtra("response_text", text);
|
|
4488
|
+
scope.setLevel("error");
|
|
4489
|
+
this.captureException(new Error(msg));
|
|
4490
|
+
});
|
|
6855
4491
|
}
|
|
6856
4492
|
function $b6542de877d46468$export$2c2f50b30b7b2576(el, attribute_name, async_iterable, quit_after_navigation = true) {
|
|
6857
4493
|
(async () => {
|
|
@@ -7099,80 +4735,85 @@ function $c693a2d89c78efe6$var$deal_w_removal_of_node_array(node_array, push_dis
|
|
|
7099
4735
|
push_disconnector(disconnect_observer);
|
|
7100
4736
|
}
|
|
7101
4737
|
}
|
|
7102
|
-
|
|
7103
|
-
|
|
7104
|
-
const $
|
|
7105
|
-
|
|
7106
|
-
|
|
7107
|
-
|
|
7108
|
-
|
|
7109
|
-
|
|
7110
|
-
|
|
7111
|
-
|
|
7112
|
-
|
|
7113
|
-
|
|
7114
|
-
|
|
7115
|
-
|
|
7116
|
-
|
|
7117
|
-
|
|
7118
|
-
|
|
7119
|
-
|
|
7120
|
-
|
|
7121
|
-
|
|
7122
|
-
|
|
7123
|
-
|
|
7124
|
-
|
|
7125
|
-
|
|
7126
|
-
|
|
7127
|
-
|
|
7128
|
-
|
|
7129
|
-
|
|
7130
|
-
|
|
7131
|
-
|
|
7132
|
-
|
|
7133
|
-
|
|
7134
|
-
|
|
7135
|
-
|
|
7136
|
-
|
|
7137
|
-
|
|
7138
|
-
|
|
7139
|
-
|
|
7140
|
-
|
|
7141
|
-
|
|
7142
|
-
|
|
7143
|
-
|
|
7144
|
-
};
|
|
7145
|
-
// @ts-ignore FIXME: this is a hack to make the type checker happy
|
|
7146
|
-
const placeholder_rendering = await override_rec_renderer(t, placeholder_opts).catch((0, $548fd58b14b25a52$export$8048b892d651b310));
|
|
7147
|
-
let set_should_stay_inserted;
|
|
7148
|
-
const should_stay_inserted = new Promise(r => set_should_stay_inserted = r);
|
|
7149
|
-
if (placeholder_rendering?.elements) {
|
|
7150
|
-
const [template_els, _get_state, set_state] = $3721a5ccba25c247$export$3d04c40e7acc1a32(placeholder_rendering.elements);
|
|
7151
|
-
actual_rendering.then(async rendering_result => {
|
|
7152
|
-
if (typeof post_rendering == "function") await $268cbd9e4ade92db$export$b3bbfd758f11cfa9(post_rendering)(rendering_result);
|
|
7153
|
-
const {
|
|
7154
|
-
elements: elements
|
|
7155
|
-
} = rendering_result || {};
|
|
7156
|
-
await (0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).wait_for_element(placeholder_rendering.elements[0]);
|
|
7157
|
-
// await new Promise(r => window.addEventListener("contextmenu", r, { once: true }));
|
|
7158
|
-
// 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
|
|
7159
|
-
set_state(elements ?? "");
|
|
7160
|
-
if (!elements) {
|
|
7161
|
-
on_no_rendering_result?.(rendering_result);
|
|
7162
|
-
set_should_stay_inserted(false);
|
|
4738
|
+
let $e4bebbfa0f0b1454$var$existing_style_tag;
|
|
4739
|
+
let $e4bebbfa0f0b1454$var$reactions_in_last_s = 0;
|
|
4740
|
+
const $e4bebbfa0f0b1454$export$59ba1eb2c083f0cd = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(async css => {
|
|
4741
|
+
const style_tag = await ($e4bebbfa0f0b1454$var$existing_style_tag ||= (0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).wait_for_element("head").then(head => {
|
|
4742
|
+
const tag = document.createElement("style");
|
|
4743
|
+
(0, $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149).onremoved(
|
|
4744
|
+
// reinsertion for next.js's "portable" <head>
|
|
4745
|
+
tag, eoe => {
|
|
4746
|
+
if (document.head.contains(tag))
|
|
4747
|
+
// just make sure to not freak out if it's already been added again
|
|
4748
|
+
return;
|
|
4749
|
+
if ($e4bebbfa0f0b1454$var$reactions_in_last_s >= 10) {
|
|
4750
|
+
$268cbd9e4ade92db$export$f18d5b0af29128b7(new Error("Someone removed our styling but insists on it (10 removals in previous second). Giving up \uD83D\uDE2B"), "error");
|
|
4751
|
+
return;
|
|
4752
|
+
}
|
|
4753
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Someone removed our styling \uD83D\uDE24, reinserting", eoe);
|
|
4754
|
+
$e4bebbfa0f0b1454$var$reactions_in_last_s++;
|
|
4755
|
+
setTimeout(() => $e4bebbfa0f0b1454$var$reactions_in_last_s--, 1000);
|
|
4756
|
+
document.head.append(tag); // we're sure that head exists now since we inserted it there previously
|
|
4757
|
+
});
|
|
4758
|
+
|
|
4759
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("inserting", tag, "into", head);
|
|
4760
|
+
return head.appendChild(tag);
|
|
4761
|
+
}));
|
|
4762
|
+
style_tag.append(css);
|
|
4763
|
+
});
|
|
4764
|
+
const $e4bebbfa0f0b1454$export$a4f97b27a0592e6c = url => (url ? new URL(url, window.location.origin) : window.location).pathname.split("/").filter(a => a).pop()?.replace(/\.html?$/i, "") || "";
|
|
4765
|
+
const $e4bebbfa0f0b1454$export$692b606677218a16 = callback => {
|
|
4766
|
+
if (document.depictwashere) {
|
|
4767
|
+
if (process.env.BUILD_TARGET === "dev") {
|
|
4768
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("HMR tried to rerun us, reloading page");
|
|
4769
|
+
/* eslint-disable no-self-assign */
|
|
4770
|
+
location.href = location.href;
|
|
4771
|
+
}
|
|
4772
|
+
$e6c6e7929ea385ae$export$de56f1198d121036("Script has already ran", document.currentScript, "is exiting");
|
|
4773
|
+
return;
|
|
4774
|
+
}
|
|
4775
|
+
if (process.env.BUILD_TARGET === "dev") /* eslint-disable no-console */console.clear = new Proxy(console.clear, {
|
|
4776
|
+
apply(target, this_arg, arg_list) {
|
|
4777
|
+
if (new Error().stack?.split("\n").filter(Boolean).some(s => s.includes("http://localhost:1234/depict-ai.js"))) {
|
|
4778
|
+
/* eslint-disable no-console */console.log("CSS change detected through hack, reloading");
|
|
4779
|
+
location.reload();
|
|
7163
4780
|
}
|
|
7164
|
-
|
|
7165
|
-
}
|
|
7166
|
-
|
|
7167
|
-
|
|
7168
|
-
|
|
7169
|
-
|
|
7170
|
-
|
|
4781
|
+
return target.apply(this_arg, arg_list);
|
|
4782
|
+
}
|
|
4783
|
+
});
|
|
4784
|
+
document.depictwashere = true;
|
|
4785
|
+
callback().catch((0, $548fd58b14b25a52$export$8048b892d651b310));
|
|
4786
|
+
};
|
|
4787
|
+
function $e4bebbfa0f0b1454$export$328e81c44cddf3c0(callback, get_market, supported_markets, unsupported_markets, preferred_demo_market) {
|
|
4788
|
+
$e4bebbfa0f0b1454$export$692b606677218a16(async () => {
|
|
4789
|
+
// Handle override for debug scripts (could be used on demo pages too)
|
|
4790
|
+
if (process.env.DEBUG === "true") {
|
|
4791
|
+
let localstorage_override;
|
|
4792
|
+
const query_param_override = new URLSearchParams(location.search).get("depict-override-market");
|
|
4793
|
+
if (query_param_override !== null) {
|
|
4794
|
+
$e6c6e7929ea385ae$export$de56f1198d121036(`Found ?depict-override-market=${query_param_override}. Using that as the market`);
|
|
4795
|
+
get_market = () => query_param_override;
|
|
4796
|
+
localStorage.setItem("depict-override-market", query_param_override);
|
|
4797
|
+
} else if ((localstorage_override = localStorage.getItem("depict-override-market")) !== null) {
|
|
4798
|
+
$e6c6e7929ea385ae$export$de56f1198d121036(`Found depict-override-market="${localstorage_override}" in localStorage. Using that as the market`);
|
|
4799
|
+
get_market = () => localstorage_override;
|
|
4800
|
+
}
|
|
4801
|
+
}
|
|
4802
|
+
const market = await get_market();
|
|
4803
|
+
if (supported_markets.includes(market)) {
|
|
4804
|
+
$e6c6e7929ea385ae$export$de56f1198d121036(`Initializing with market: ${market}`);
|
|
4805
|
+
return callback(market).catch((0, $548fd58b14b25a52$export$8048b892d651b310));
|
|
4806
|
+
} else if (unsupported_markets.includes(market)) {
|
|
4807
|
+
$e6c6e7929ea385ae$export$de56f1198d121036(`Unsupported market: ${market}. Exiting...`);
|
|
4808
|
+
return;
|
|
4809
|
+
} else if (process.env.DEBUG === "true" && location.host.endsWith(".demo.depict.ai") && preferred_demo_market) {
|
|
4810
|
+
$e6c6e7929ea385ae$export$de56f1198d121036(`On demosite with default market override. Setting market to ${preferred_demo_market}`);
|
|
4811
|
+
return callback(preferred_demo_market).catch((0, $548fd58b14b25a52$export$8048b892d651b310));
|
|
7171
4812
|
} else {
|
|
7172
|
-
$
|
|
7173
|
-
return
|
|
4813
|
+
$548fd58b14b25a52$export$8048b892d651b310(new Error(`Unknown market: "${market}". Exiting...`));
|
|
4814
|
+
return;
|
|
7174
4815
|
}
|
|
7175
|
-
};
|
|
4816
|
+
});
|
|
7176
4817
|
}
|
|
7177
4818
|
function $d91a08ea384e6cd4$export$8ec5c86406f333ff() {
|
|
7178
4819
|
const element_weak_set = new WeakSet();
|
|
@@ -7628,8 +5269,8 @@ async function $bd0fccdac6624b01$export$c068ad5361be7646({
|
|
|
7628
5269
|
on_close_(exit_oos_iterator);
|
|
7629
5270
|
}));
|
|
7630
5271
|
}
|
|
7631
|
-
var $
|
|
7632
|
-
$
|
|
5272
|
+
var $adc99c8c4278ad03$exports = {};
|
|
5273
|
+
$adc99c8c4278ad03$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";
|
|
7633
5274
|
let $e587cb3b31b82f43$var$inserted = false;
|
|
7634
5275
|
const $e587cb3b31b82f43$export$84712d0562a614b8 = ({
|
|
7635
5276
|
width: width,
|
|
@@ -7640,7 +5281,7 @@ const $e587cb3b31b82f43$export$84712d0562a614b8 = ({
|
|
|
7640
5281
|
}) => {
|
|
7641
5282
|
if (!$e587cb3b31b82f43$var$inserted) {
|
|
7642
5283
|
// Insert styling on first import
|
|
7643
|
-
$e4bebbfa0f0b1454$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($
|
|
5284
|
+
$e4bebbfa0f0b1454$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($adc99c8c4278ad03$exports)));
|
|
7644
5285
|
$e587cb3b31b82f43$var$inserted = true;
|
|
7645
5286
|
}
|
|
7646
5287
|
return $jVDDb$solidjsweb.ssrElement("div", $jVDDb$solidjsweb.mergeProps({
|
|
@@ -7819,8 +5460,8 @@ const $b25f388f0fe2f1b3$export$237455ad7e59d4e5 = ({
|
|
|
7819
5460
|
collapse: collapse
|
|
7820
5461
|
};
|
|
7821
5462
|
};
|
|
7822
|
-
var $
|
|
7823
|
-
$
|
|
5463
|
+
var $9b2faeca6842dc4b$exports = {};
|
|
5464
|
+
$9b2faeca6842dc4b$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";
|
|
7824
5465
|
var $ff973b2032639b5f$var$_tmpl$ = ["<picture", ">", "</picture>"];
|
|
7825
5466
|
const $ff973b2032639b5f$export$3d13beba9b52c947 = "https://img.depict.ai/ResizeImage" + (process.env.TENANT ? "/" + process.env.TENANT : "");
|
|
7826
5467
|
const $ff973b2032639b5f$export$a98fc8a2c818d3d8 = /*@__PURE__*/(() => typeof navigator === "undefined" ? false : /^((?!chrome|android).)*safari/i.test(navigator.userAgent))(); // https://stackoverflow.com/a/23522755
|
|
@@ -7964,6 +5605,7 @@ var $a312bccd722ac9e4$var$_tmpl$ = ["<div", ' style="', '"></div>'],
|
|
|
7964
5605
|
const $a312bccd722ac9e4$var$rendering_options_to_sourceset_component = /*@__PURE__*/new WeakMap();
|
|
7965
5606
|
// Add nolazy to placeholders to avoid errors with the stupid lazyfier
|
|
7966
5607
|
const $a312bccd722ac9e4$var$add_nolazy_to_placeholder = type => type === "placeholder" ? "nolazy" : "";
|
|
5608
|
+
const $a312bccd722ac9e4$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`;
|
|
7967
5609
|
let $a312bccd722ac9e4$var$inserted = false;
|
|
7968
5610
|
const $a312bccd722ac9e4$export$788756b42446dc2d = ({
|
|
7969
5611
|
init_with_placeholder: init_with_placeholder,
|
|
@@ -7971,13 +5613,13 @@ const $a312bccd722ac9e4$export$788756b42446dc2d = ({
|
|
|
7971
5613
|
}) => {
|
|
7972
5614
|
if (!$a312bccd722ac9e4$var$inserted) {
|
|
7973
5615
|
// Insert styling on first import
|
|
7974
|
-
$e4bebbfa0f0b1454$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($
|
|
5616
|
+
$e4bebbfa0f0b1454$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($9b2faeca6842dc4b$exports)));
|
|
7975
5617
|
$a312bccd722ac9e4$var$inserted = true;
|
|
7976
5618
|
}
|
|
7977
5619
|
const img = process.env.BUILD_TARGET === "modern" || process.env.BUILD_TARGET === "dev" ? $a312bccd722ac9e4$var$Image(options) : $a312bccd722ac9e4$var$CompatibleImage(options);
|
|
7978
5620
|
if (init_with_placeholder)
|
|
7979
5621
|
// 10000 is a magic value, that is just supposed to be bigger than the size of the actual image.
|
|
7980
|
-
img.querySelectorAll("img").forEach(i => i.src = $
|
|
5622
|
+
img.querySelectorAll("img").forEach(i => i.src = $a312bccd722ac9e4$export$a4eccf92efefa04d(10000 * options.aspect_ratio, 10000));
|
|
7981
5623
|
return img;
|
|
7982
5624
|
};
|
|
7983
5625
|
function $a312bccd722ac9e4$var$Image({
|
|
@@ -8039,8 +5681,8 @@ function $a312bccd722ac9e4$var$srcset_comp_from_map_or_new(rendering_options, sr
|
|
|
8039
5681
|
}
|
|
8040
5682
|
return sourceset_component;
|
|
8041
5683
|
}
|
|
8042
|
-
var $
|
|
8043
|
-
$
|
|
5684
|
+
var $da6327fdb5e3fda6$exports = {};
|
|
5685
|
+
$da6327fdb5e3fda6$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";
|
|
8044
5686
|
var $a656daa2fa8c279a$var$_tmpl$ = ["<div", ' class="images-container"><!--$-->', '<!--/--><div class="main-image-container">', "</div></div>"],
|
|
8045
5687
|
$a656daa2fa8c279a$var$_tmpl$2 = ["<div", ' class="second-image-container">', "</div>"];
|
|
8046
5688
|
// Saving bytez
|
|
@@ -8169,7 +5811,7 @@ const $a656daa2fa8c279a$export$2369f6fc1c911576 = ({
|
|
|
8169
5811
|
...options
|
|
8170
5812
|
}) => {
|
|
8171
5813
|
if (!$a656daa2fa8c279a$var$styling_inserted) {
|
|
8172
|
-
$e4bebbfa0f0b1454$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($
|
|
5814
|
+
$e4bebbfa0f0b1454$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($da6327fdb5e3fda6$exports)));
|
|
8173
5815
|
$a656daa2fa8c279a$var$styling_inserted = true;
|
|
8174
5816
|
}
|
|
8175
5817
|
const main_image = $a312bccd722ac9e4$export$788756b42446dc2d({
|
|
@@ -8295,5 +5937,4 @@ function $da35c7e27be2a442$export$e35115e6d0715f77() {
|
|
|
8295
5937
|
$jVDDb$solidjs.onCleanup(() => (0, $69f7524c8bdd85b4$export$7500cdfd37aafd43).delete(handler));
|
|
8296
5938
|
return href;
|
|
8297
5939
|
}
|
|
8298
|
-
$e4a18bf12ad092d9$export$2cefb7e61fcbae00("utilishared", (0, $815f67c61b4c0a42$export$83d89fbfd8236492));
|
|
8299
|
-
$parcel$exportWildcard(module.exports, $28e42b0009d694b2$exports);
|
|
5940
|
+
$e4a18bf12ad092d9$export$2cefb7e61fcbae00("utilishared", (0, $815f67c61b4c0a42$export$83d89fbfd8236492));
|