@depict-ai/utilishared 1.0.50 → 2.0.0
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 +55 -84
- package/ES10/index.d.ts +9 -22
- package/ES10/index.js +52 -76
- package/latest/index.cjs +54 -84
- package/latest/index.d.ts +9 -22
- package/latest/index.js +51 -76
- package/package.json +4 -4
package/latest/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@ var $z0IcO$solidjs = require("solid-js");
|
|
|
2
2
|
require("../multi_import_deduplicator.cjs").register_es_version("utilishared", "latest");
|
|
3
3
|
function $parcel$exportWildcard(dest, source) {
|
|
4
4
|
Object.keys(source).forEach(function (key) {
|
|
5
|
-
if (key === 'default' || key === '__esModule' ||
|
|
5
|
+
if (key === 'default' || key === '__esModule' || Object.prototype.hasOwnProperty.call(dest, key)) {
|
|
6
6
|
return;
|
|
7
7
|
}
|
|
8
8
|
Object.defineProperty(dest, key, {
|
|
@@ -46,9 +46,9 @@ $parcel$export(module.exports, "simplified_template_tool", () => $52d3be7ce51469
|
|
|
46
46
|
$parcel$export(module.exports, "insert_styling_into_slider", () => $e090b20cef3f0516$export$f1b8b9fd75ddcab1);
|
|
47
47
|
$parcel$export(module.exports, "RR_Slider", () => $7af744346f17bf99$export$cd12721587f4f16d);
|
|
48
48
|
$parcel$export(module.exports, "Depict", () => $0b6a8303b64cced1$export$1a8782481a9af507);
|
|
49
|
-
$parcel$export(module.exports, "get_recs_with_template", () => $
|
|
50
|
-
$parcel$export(module.exports, "default_post_processor", () => $
|
|
51
|
-
$parcel$export(module.exports, "default_pre_processor", () => $
|
|
49
|
+
$parcel$export(module.exports, "get_recs_with_template", () => $66a2a93dfa520bc6$export$30933c637c977eef);
|
|
50
|
+
$parcel$export(module.exports, "default_post_processor", () => $66a2a93dfa520bc6$export$c410ce1205e5118a);
|
|
51
|
+
$parcel$export(module.exports, "default_pre_processor", () => $66a2a93dfa520bc6$export$4f39078bdc72ecd0);
|
|
52
52
|
$parcel$export(module.exports, "wpff", () => $c413c7798924612a$export$2e2bcd8739ae039);
|
|
53
53
|
$parcel$export(module.exports, "ElementObserver", () => $9043c64496e3375f$export$12e07a2a9f87578a);
|
|
54
54
|
$parcel$export(module.exports, "observer", () => $2a1cbc63a04d4a2d$export$b6ae1bc530f4c149);
|
|
@@ -116,10 +116,6 @@ $parcel$export(module.exports, "AIO", () => $fbb09973782881cb$export$29a6094e0bd
|
|
|
116
116
|
$parcel$export(module.exports, "paint_red", () => $fbb09973782881cb$export$6ebd242c09192cec);
|
|
117
117
|
$parcel$export(module.exports, "bind_to_a2c_button", () => $c8263a2185830bf1$export$2c34560c3749dc63);
|
|
118
118
|
$parcel$export(module.exports, "bind_tracking_to_link", () => $c8263a2185830bf1$export$82a685f2da2fb027);
|
|
119
|
-
$parcel$export(module.exports, "set_depict_id_fn", () => $e0a87646d12cb987$export$336e7ad40bae0652);
|
|
120
|
-
$parcel$export(module.exports, "set_user_id_fn", () => $e0a87646d12cb987$export$8a96793bf9f87d90);
|
|
121
|
-
$parcel$export(module.exports, "get_depict_id", () => $e0a87646d12cb987$export$6399bdb2291895e0);
|
|
122
|
-
$parcel$export(module.exports, "get_user_id", () => $e0a87646d12cb987$export$adc61a405a4cabed);
|
|
123
119
|
$parcel$export(module.exports, "depict_click", () => $e0a87646d12cb987$export$15f8a0cd5a8c0ebb);
|
|
124
120
|
$parcel$export(module.exports, "depict_prefilled", () => $e0a87646d12cb987$export$82badda1f9923310);
|
|
125
121
|
$parcel$export(module.exports, "depict_add_to_cart", () => $e0a87646d12cb987$export$9028351cb994757e);
|
|
@@ -161,7 +157,6 @@ $parcel$export(module.exports, "datalayer_interceptor", () => $0c9d834f187cc4ff$
|
|
|
161
157
|
$parcel$export(module.exports, "datalayer_transaction_id_extractor", () => $0c9d834f187cc4ff$export$b11248fa13a8a86c);
|
|
162
158
|
$parcel$export(module.exports, "orderpage_transaction_id_extractor", () => $0c9d834f187cc4ff$export$3ebd86018b39d9d2);
|
|
163
159
|
$parcel$export(module.exports, "url_transaction_id_extractor", () => $0c9d834f187cc4ff$export$ff8673d5dea82bd4);
|
|
164
|
-
$parcel$export(module.exports, "send_product_unavailable_to_depict", () => $8594d423459ba80c$export$d63b08f4f29ddba5);
|
|
165
160
|
$parcel$export(module.exports, "send_page_view_if_needed", () => $72ee205b59322497$export$eee4c4d924348b05);
|
|
166
161
|
$parcel$export(module.exports, "send_page_view_on_navigation", () => $72ee205b59322497$export$f7cb1bd47199ec38);
|
|
167
162
|
$parcel$export(module.exports, "DepictAPIWS", () => $d10801050840d92b$export$1d9c6fddbff3441f);
|
|
@@ -276,7 +271,7 @@ $parcel$export(module.exports, "add_to_version_info", () => $e4a18bf12ad092d9$ex
|
|
|
276
271
|
$parcel$export(module.exports, "edit_current_page_meta_tags", () => $8838e3e61b748a8b$export$ef73ea4f975745ba);
|
|
277
272
|
$parcel$export(module.exports, "sync_el_content_with_accessor", () => $35303d72263038db$export$c3f56a35e076f139);
|
|
278
273
|
$parcel$export(module.exports, "use_href_accessor", () => $da35c7e27be2a442$export$e35115e6d0715f77);
|
|
279
|
-
const $815f67c61b4c0a42$export$83d89fbfd8236492 = "
|
|
274
|
+
const $815f67c61b4c0a42$export$83d89fbfd8236492 = "2.0.0";
|
|
280
275
|
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"))();
|
|
281
276
|
const $e6c6e7929ea385ae$var$browser_prefix_styling = "color: #fff;";
|
|
282
277
|
let $e6c6e7929ea385ae$var$browser_prefix = "[Depict]";
|
|
@@ -1154,7 +1149,7 @@ function $650b64c1b384c895$export$a6db784f019668ba() {
|
|
|
1154
1149
|
const $4c6861fbcd3a0611$export$362abebb4b313340 = process.env.BASE_URL || "https://api.depict.ai";
|
|
1155
1150
|
const $0c84f8e99aac5765$var$c = (0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9);
|
|
1156
1151
|
const $0c84f8e99aac5765$var$ws_instance = /*@__PURE__*/$0c84f8e99aac5765$var$c(() => new (0, $d10801050840d92b$export$1d9c6fddbff3441f)("wss://ws.depict.ai/ws/create-events"))();
|
|
1157
|
-
const $0c84f8e99aac5765$var$allowed_keys = ["tenant", "market", "type", "
|
|
1152
|
+
const $0c84f8e99aac5765$var$allowed_keys = ["tenant", "market", "type", "session_id", "product_id", "entity_identifiers", "url", "entity_price", "currency", "document_referrer", "document_width", "attribution_id", "recommendation_id", "click_location", "ab_test_group", "variant_ids", "transaction_id", "error_type", "detail", "recommendation_type", "search_result_id", "product_listing_result_id"];
|
|
1158
1153
|
const $0c84f8e99aac5765$export$72036d950e1fae95 = /*@__PURE__*/$0c84f8e99aac5765$var$c(payload => {
|
|
1159
1154
|
if (process.env.DEPICT === "false") return;
|
|
1160
1155
|
return payload.map(body => Object.fromEntries(Object.entries(body).filter(([key, value]) => $0c84f8e99aac5765$var$allowed_keys.includes(key) && value != null)));
|
|
@@ -1225,12 +1220,13 @@ const $0c84f8e99aac5765$export$28cacbd9b4306ffc = /*@__PURE__*/$0c84f8e99aac5765
|
|
|
1225
1220
|
// filter_depict_payload will only return undefined if process.env.DEPICT === "false"
|
|
1226
1221
|
return $0c84f8e99aac5765$export$608478473a3304a0($0c84f8e99aac5765$export$72036d950e1fae95(payload), use_ws);
|
|
1227
1222
|
});
|
|
1228
|
-
let $e0a87646d12cb987$export$
|
|
1223
|
+
let $e0a87646d12cb987$export$61e7e1f11e96692f = () => {
|
|
1229
1224
|
if (typeof document === "undefined") return "server";
|
|
1230
1225
|
let id = "";
|
|
1231
1226
|
let localstorage_error;
|
|
1232
1227
|
let cookie_error;
|
|
1233
1228
|
try {
|
|
1229
|
+
// localStorage._dep_id also accessed directly by depict-purchase-tracking Shopify web pixel
|
|
1234
1230
|
id = localStorage._dep_id ||= $650b64c1b384c895$export$656831b7e9c341c3();
|
|
1235
1231
|
} catch (e) {
|
|
1236
1232
|
$e6c6e7929ea385ae$export$de56f1198d121036("Can't use localStorage", e);
|
|
@@ -1264,16 +1260,10 @@ let $e0a87646d12cb987$export$6399bdb2291895e0 = () => {
|
|
|
1264
1260
|
if (!id) id = $650b64c1b384c895$export$656831b7e9c341c3();
|
|
1265
1261
|
return id;
|
|
1266
1262
|
};
|
|
1267
|
-
let $e0a87646d12cb987$export$adc61a405a4cabed = $e0a87646d12cb987$export$6399bdb2291895e0;
|
|
1268
|
-
let $e0a87646d12cb987$export$61e7e1f11e96692f = () => undefined;
|
|
1269
|
-
const $e0a87646d12cb987$export$336e7ad40bae0652 = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(newfn => $e0a87646d12cb987$export$6399bdb2291895e0 = newfn);
|
|
1270
|
-
const $e0a87646d12cb987$export$8a96793bf9f87d90 = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(newfn => $e0a87646d12cb987$export$adc61a405a4cabed = newfn);
|
|
1271
1263
|
const $e0a87646d12cb987$export$93ae15b1ae509334 = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(newfn => $e0a87646d12cb987$export$61e7e1f11e96692f = newfn);
|
|
1272
1264
|
const $e0a87646d12cb987$export$8c6f26a5b6921b95 = /*@__PURE__*/() => {
|
|
1273
1265
|
return {
|
|
1274
1266
|
session_id: $e0a87646d12cb987$export$61e7e1f11e96692f(),
|
|
1275
|
-
user_id: $e0a87646d12cb987$export$adc61a405a4cabed(),
|
|
1276
|
-
dsid: $e0a87646d12cb987$export$6399bdb2291895e0(),
|
|
1277
1267
|
url: document.location.href,
|
|
1278
1268
|
document_width: window.innerWidth,
|
|
1279
1269
|
document_referrer: document?.referrer
|
|
@@ -2525,14 +2515,12 @@ function $28e42b0009d694b2$export$8827362e5e938d26() {
|
|
|
2525
2515
|
const $28e42b0009d694b2$export$abec7fd9f0b9cc22 = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(async (anon_id = "anonymous") => {
|
|
2526
2516
|
$e6c6e7929ea385ae$export$de56f1198d121036("Initializing Cookiebot tracking");
|
|
2527
2517
|
if (!$28e42b0009d694b2$var$required_consent_level) return $e6c6e7929ea385ae$export$de56f1198d121036("No consent level set for Depict tracking. Ignoring consent and tracking everything.");
|
|
2528
|
-
const
|
|
2529
|
-
|
|
2530
|
-
$e0a87646d12cb987$export$336e7ad40bae0652(() => $28e42b0009d694b2$var$has_consent ? original_get_depict_id() : anon_id);
|
|
2531
|
-
$e0a87646d12cb987$export$8a96793bf9f87d90(() => $28e42b0009d694b2$var$has_consent ? original_get_user_id() : anon_id);
|
|
2518
|
+
const original_get_session_id = (0, $e0a87646d12cb987$export$61e7e1f11e96692f);
|
|
2519
|
+
$e0a87646d12cb987$export$93ae15b1ae509334(() => $28e42b0009d694b2$var$has_consent ? original_get_session_id() : anon_id);
|
|
2532
2520
|
for await (const consent_obj of $28e42b0009d694b2$export$8827362e5e938d26()) {
|
|
2533
2521
|
// Changing this will change the return value of function given to set_depict_id_fn above
|
|
2534
2522
|
$28e42b0009d694b2$var$has_consent = consent_obj[$28e42b0009d694b2$var$required_consent_level];
|
|
2535
|
-
if (!$28e42b0009d694b2$var$has_consent) $e6c6e7929ea385ae$export$de56f1198d121036(`dsid
|
|
2523
|
+
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`);
|
|
2536
2524
|
}
|
|
2537
2525
|
});
|
|
2538
2526
|
const $2026711c6c2d6204$var$required_consent_level = process.env.DEPICT_TRACKING_CONSENT_LEVEL;
|
|
@@ -2591,14 +2579,12 @@ function $2026711c6c2d6204$export$7e4427e80d5fc619() {
|
|
|
2591
2579
|
const $2026711c6c2d6204$export$f0f6c846d96fdbec = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(async (anon_id = "anonymous") => {
|
|
2592
2580
|
$e6c6e7929ea385ae$export$de56f1198d121036("Initializing OptAnon tracking");
|
|
2593
2581
|
if (!$2026711c6c2d6204$var$required_consent_level) return $e6c6e7929ea385ae$export$de56f1198d121036("No consent level set for Depict tracking. Ignoring consent and tracking everything.");
|
|
2594
|
-
const
|
|
2595
|
-
|
|
2596
|
-
$e0a87646d12cb987$export$336e7ad40bae0652(() => $2026711c6c2d6204$var$has_consent ? original_get_depict_id() : anon_id);
|
|
2597
|
-
$e0a87646d12cb987$export$8a96793bf9f87d90(() => $2026711c6c2d6204$var$has_consent ? original_get_user_id() : anon_id);
|
|
2582
|
+
const original_get_session_id = (0, $e0a87646d12cb987$export$61e7e1f11e96692f);
|
|
2583
|
+
$e0a87646d12cb987$export$93ae15b1ae509334(() => $2026711c6c2d6204$var$has_consent ? original_get_session_id() : anon_id);
|
|
2598
2584
|
for await (const consent_obj of $2026711c6c2d6204$export$7e4427e80d5fc619()) {
|
|
2599
2585
|
// Changing this will change the return value of function given to set_depict_id_fn above
|
|
2600
2586
|
$2026711c6c2d6204$var$has_consent = consent_obj[$2026711c6c2d6204$var$required_consent_level];
|
|
2601
|
-
if (!$2026711c6c2d6204$var$has_consent) $e6c6e7929ea385ae$export$de56f1198d121036(`dsid/
|
|
2587
|
+
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`);
|
|
2602
2588
|
}
|
|
2603
2589
|
});
|
|
2604
2590
|
const $d3d8549954e0318e$var$g = typeof globalThis == "object" && globalThis || window;
|
|
@@ -3177,15 +3163,11 @@ async function $94edfb6d9c42a288$export$1bc0df10745d5412(t, options, headers, ge
|
|
|
3177
3163
|
return res?.displays || [];
|
|
3178
3164
|
}
|
|
3179
3165
|
async function $94edfb6d9c42a288$export$d40679eb4cf32f09(t, options, headers, get_url = $94edfb6d9c42a288$var$default_get_fetch_url) {
|
|
3180
|
-
const dsid = $e0a87646d12cb987$export$6399bdb2291895e0();
|
|
3181
3166
|
const session_id = options.session_id || $e0a87646d12cb987$export$61e7e1f11e96692f();
|
|
3182
|
-
const user_id = options.user_id || dsid;
|
|
3183
3167
|
const body = {
|
|
3184
3168
|
tenant: t.tenant,
|
|
3185
3169
|
market: t.market,
|
|
3186
|
-
user_id: user_id,
|
|
3187
3170
|
session_id: session_id,
|
|
3188
|
-
dsid: dsid,
|
|
3189
3171
|
document_referrer: document.referrer,
|
|
3190
3172
|
...options
|
|
3191
3173
|
};
|
|
@@ -3871,7 +3853,7 @@ class $1da560af170fb839$export$3be7054c61590ee3 {
|
|
|
3871
3853
|
for (let i = 0; i < mutations.length; i++) {
|
|
3872
3854
|
const matching_added_els = $bf7f12fe044e41b2$export$5e63aea0cac01fa0(mutations[i].addedNodes, this.selector);
|
|
3873
3855
|
if (matching_added_els.length) {
|
|
3874
|
-
if (this.#verbose) $e6c6e7929ea385ae$export$de56f1198d121036("New elements", matching_added_els, " matching selector", this.selector, "were aded to", container, "lazyloading
|
|
3856
|
+
if (this.#verbose) $e6c6e7929ea385ae$export$de56f1198d121036("New elements", matching_added_els, " matching selector", this.selector, "were aded to", container, "lazyloading\u2026");
|
|
3875
3857
|
this.lazyfinder.elements.push(...matching_added_els);
|
|
3876
3858
|
matching_added_els.forEach(this.#initiate_new_image.bind(this));
|
|
3877
3859
|
}
|
|
@@ -4872,7 +4854,7 @@ class $0b6a8303b64cced1$export$1a8782481a9af507 {
|
|
|
4872
4854
|
let itemTemplate;
|
|
4873
4855
|
if (item.sale_price !== item.original_price) {
|
|
4874
4856
|
itemTemplate = template.replaceAll($0b6a8303b64cced1$var$discountMatcher, "$1").replaceAll($0b6a8303b64cced1$var$noDiscountMatcher, "");
|
|
4875
|
-
item.discount =
|
|
4857
|
+
item.discount = `\u{2013}${Math.round(100 * (1 - item.sale_price / item.original_price))}%`;
|
|
4876
4858
|
} else {
|
|
4877
4859
|
itemTemplate = template.replaceAll($0b6a8303b64cced1$var$discountMatcher, "").replaceAll($0b6a8303b64cced1$var$noDiscountMatcher, "$1");
|
|
4878
4860
|
item.discount = "";
|
|
@@ -4966,8 +4948,8 @@ $52d3be7ce5146924$export$2e2bcd8739ae039 = async options => {
|
|
|
4966
4948
|
};
|
|
4967
4949
|
|
|
4968
4950
|
// @ts-ignore
|
|
4969
|
-
var $
|
|
4970
|
-
$
|
|
4951
|
+
var $1c4a3b6d660e3905$exports = {};
|
|
4952
|
+
$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";
|
|
4971
4953
|
const $e090b20cef3f0516$var$default_image_src = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjYsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiDQoJIHZpZXdCb3g9IjAgMCAxNiAxNiIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMTYgMTY7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxwb2x5Z29uIHBvaW50cz0iOSwyLjYgOC4zLDMuNCAxMi40LDcuNSAxLjYsNy41IDEuNiw4LjUgMTIuNCw4LjUgOC4zLDEyLjYgOSwxMy40IDE0LjQsOCAiLz4NCjwvc3ZnPg0K";
|
|
4972
4954
|
class $e090b20cef3f0516$export$4d41c6499d53639c extends (0, $a69a5236b5814082$export$68babfc5be0de5da) {
|
|
4973
4955
|
constructor(static_options, override_lazyfier_options) {
|
|
@@ -4998,7 +4980,7 @@ class $e090b20cef3f0516$export$4d41c6499d53639c extends (0, $a69a5236b5814082$ex
|
|
|
4998
4980
|
function $e090b20cef3f0516$export$f1b8b9fd75ddcab1(slider) {
|
|
4999
4981
|
const style_elem = document.createElement("style");
|
|
5000
4982
|
style_elem.type = "text/css";
|
|
5001
|
-
style_elem.append((0, /*@__PURE__*/$parcel$interopDefault($
|
|
4983
|
+
style_elem.append((0, /*@__PURE__*/$parcel$interopDefault($1c4a3b6d660e3905$exports)));
|
|
5002
4984
|
slider.container.appendChild(style_elem);
|
|
5003
4985
|
}
|
|
5004
4986
|
async function $7af744346f17bf99$export$cd12721587f4f16d(t, rendering_options, options_for_us, slider_options, override_lazyfier_options) {
|
|
@@ -5046,7 +5028,7 @@ async function $7af744346f17bf99$export$cd12721587f4f16d(t, rendering_options, o
|
|
|
5046
5028
|
elements: container ? container : [slider.container]
|
|
5047
5029
|
};
|
|
5048
5030
|
}
|
|
5049
|
-
async function $
|
|
5031
|
+
async function $66a2a93dfa520bc6$export$30933c637c977eef({
|
|
5050
5032
|
t: t,
|
|
5051
5033
|
recs: recs,
|
|
5052
5034
|
title: title,
|
|
@@ -5063,7 +5045,8 @@ async function $765ddca135d7ab33$export$30933c637c977eef({
|
|
|
5063
5045
|
template,
|
|
5064
5046
|
// recommendation template
|
|
5065
5047
|
chunk_size_for_load_more = 4,
|
|
5066
|
-
insertion_promise: insertion_promise
|
|
5048
|
+
insertion_promise: insertion_promise,
|
|
5049
|
+
view_more_text: view_more_text
|
|
5067
5050
|
}) {
|
|
5068
5051
|
const {
|
|
5069
5052
|
catchify: catchify,
|
|
@@ -5135,8 +5118,8 @@ async function $765ddca135d7ab33$export$30933c637c977eef({
|
|
|
5135
5118
|
}, items);
|
|
5136
5119
|
}
|
|
5137
5120
|
});
|
|
5138
|
-
if (with_loadmore) catchify($
|
|
5139
|
-
if (infinite_scroll) catchify($
|
|
5121
|
+
if (with_loadmore) catchify($66a2a93dfa520bc6$var$setup_load_more)(t, root, chunk_size_for_load_more, view_more_text);
|
|
5122
|
+
if (infinite_scroll) catchify($66a2a93dfa520bc6$var$setup_infinite_scroll)(t, root);
|
|
5140
5123
|
if (title) {
|
|
5141
5124
|
const [title_element] = $bf7f12fe044e41b2$export$5e63aea0cac01fa0(container, "h1.title, h2.title, h3.title, h4.title, h5.title, h6.title");
|
|
5142
5125
|
if (title_element) {
|
|
@@ -5145,7 +5128,7 @@ async function $765ddca135d7ab33$export$30933c637c977eef({
|
|
|
5145
5128
|
}
|
|
5146
5129
|
if (template_tool?.data?.length) return container;else dlog("Didn't get recs from API", template_tool);
|
|
5147
5130
|
}
|
|
5148
|
-
function $
|
|
5131
|
+
function $66a2a93dfa520bc6$var$setup_infinite_scroll(t, root) {
|
|
5149
5132
|
const {
|
|
5150
5133
|
dlog: dlog,
|
|
5151
5134
|
catchify: catchify
|
|
@@ -5161,14 +5144,14 @@ function $765ddca135d7ab33$var$setup_infinite_scroll(t, root) {
|
|
|
5161
5144
|
records.forEach(record => {
|
|
5162
5145
|
if (record.isIntersecting && record.target == get_last_visible_el()) {
|
|
5163
5146
|
dlog("Loading more recs because of", record);
|
|
5164
|
-
if ($
|
|
5147
|
+
if ($66a2a93dfa520bc6$var$load_more_elements(root)) $66a2a93dfa520bc6$var$setup_infinite_scroll(t, root);
|
|
5165
5148
|
}
|
|
5166
5149
|
});
|
|
5167
5150
|
}));
|
|
5168
5151
|
dlog("starting to intersection observe", last_visible_el, "for infinite scroll");
|
|
5169
5152
|
intersection_observer.observe(last_visible_el);
|
|
5170
5153
|
}
|
|
5171
|
-
function $
|
|
5154
|
+
function $66a2a93dfa520bc6$var$load_more_elements(root, chunk_size = 4) {
|
|
5172
5155
|
const hidden_elements = root.querySelectorAll("a.rec_outer.not_visible");
|
|
5173
5156
|
let i = 0;
|
|
5174
5157
|
for (; i < Math.min(hidden_elements.length, chunk_size); i++) {
|
|
@@ -5179,22 +5162,25 @@ function $765ddca135d7ab33$var$load_more_elements(root, chunk_size = 4) {
|
|
|
5179
5162
|
const has_more = i >= chunk_size && hidden_elements.length > chunk_size;
|
|
5180
5163
|
return has_more;
|
|
5181
5164
|
}
|
|
5182
|
-
function $
|
|
5165
|
+
function $66a2a93dfa520bc6$var$setup_load_more(t, root, chunk_size, view_more_text = "Visa mer") {
|
|
5183
5166
|
const {
|
|
5184
5167
|
catchify: catchify
|
|
5185
5168
|
} = t,
|
|
5186
5169
|
load_more_cont = $bf7f12fe044e41b2$export$d3e2a0560cbf4787(`<div class="load-more-container"></div>`),
|
|
5187
|
-
load_button = load_more_cont.appendChild($
|
|
5170
|
+
load_button = load_more_cont.appendChild($107a74aa4ea5902d$export$34b9dba7ce09269b("button", {
|
|
5171
|
+
class: "load_more",
|
|
5172
|
+
children: view_more_text
|
|
5173
|
+
}));
|
|
5188
5174
|
load_button.addEventListener("click", catchify(load_more_recs_and_hide_button_if_needed));
|
|
5189
5175
|
root.after(load_more_cont);
|
|
5190
5176
|
load_more_recs_and_hide_button_if_needed();
|
|
5191
5177
|
function load_more_recs_and_hide_button_if_needed() {
|
|
5192
|
-
if (!$
|
|
5178
|
+
if (!$66a2a93dfa520bc6$var$load_more_elements(root, chunk_size))
|
|
5193
5179
|
// there aren't any recs left to display
|
|
5194
5180
|
load_button.classList.add("not_visible");
|
|
5195
5181
|
}
|
|
5196
5182
|
}
|
|
5197
|
-
function $
|
|
5183
|
+
function $66a2a93dfa520bc6$export$4f39078bdc72ecd0(_t, d, i, with_loadmore, with_slider, infinite_scroll) {
|
|
5198
5184
|
d.class ||= "";
|
|
5199
5185
|
if (infinite_scroll) d.class = i >= 4 ? "not_visible" : ""; // this will make it hold image loading until .load_image is called on .rec_outer
|
|
5200
5186
|
if (with_loadmore) d.class = "not_visible";
|
|
@@ -5202,7 +5188,7 @@ function $765ddca135d7ab33$export$4f39078bdc72ecd0(_t, d, i, with_loadmore, with
|
|
|
5202
5188
|
if (!d.percentage_off || d.percentage_off < 10) d.percentage_off = "";
|
|
5203
5189
|
return d;
|
|
5204
5190
|
}
|
|
5205
|
-
function $
|
|
5191
|
+
function $66a2a93dfa520bc6$export$c410ce1205e5118a(_t, itms, d, slider) {
|
|
5206
5192
|
for (const item of itms) {
|
|
5207
5193
|
const {
|
|
5208
5194
|
image_url: image_url
|
|
@@ -5611,8 +5597,8 @@ async function $a7315720bf2a1638$export$b0a773486c1c2312(t, recommendation_rende
|
|
|
5611
5597
|
}
|
|
5612
5598
|
|
|
5613
5599
|
// @ts-ignore
|
|
5614
|
-
var $
|
|
5615
|
-
$
|
|
5600
|
+
var $a1e0549e8669396a$exports = {};
|
|
5601
|
+
$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";
|
|
5616
5602
|
let $79804e8d76404ae4$var$slider_styling_was_inserted = false;
|
|
5617
5603
|
async function $79804e8d76404ae4$export$82cfdc85a4d15688(t, recommendation_renderer_options, {
|
|
5618
5604
|
container_elements: container_elements,
|
|
@@ -5635,7 +5621,7 @@ async function $79804e8d76404ae4$export$82cfdc85a4d15688(t, recommendation_rende
|
|
|
5635
5621
|
if (!elements) return rendering_result;
|
|
5636
5622
|
if (!$79804e8d76404ae4$var$slider_styling_was_inserted) {
|
|
5637
5623
|
$79804e8d76404ae4$var$slider_styling_was_inserted = true;
|
|
5638
|
-
$e4bebbfa0f0b1454$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($
|
|
5624
|
+
$e4bebbfa0f0b1454$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($a1e0549e8669396a$exports)));
|
|
5639
5625
|
}
|
|
5640
5626
|
insertion_point.replaceWith(slider.container);
|
|
5641
5627
|
slider.insert_here.append(...elements);
|
|
@@ -6522,7 +6508,7 @@ function $0c9d834f187cc4ff$export$3ebd86018b39d9d2(t, selector, filter) {
|
|
|
6522
6508
|
element: element
|
|
6523
6509
|
} = eoe;
|
|
6524
6510
|
const the_id = element.innerText;
|
|
6525
|
-
$0c9d834f187cc4ff$export$1ac466d53a6636ac(t, the_id, $e0a87646d12cb987$export$
|
|
6511
|
+
$0c9d834f187cc4ff$export$1ac466d53a6636ac(t, the_id, $e0a87646d12cb987$export$61e7e1f11e96692f(), filter);
|
|
6526
6512
|
});
|
|
6527
6513
|
}
|
|
6528
6514
|
function $0c9d834f187cc4ff$export$b11248fa13a8a86c(tenant, id_extractor) {
|
|
@@ -6558,7 +6544,7 @@ function $0c9d834f187cc4ff$export$ff8673d5dea82bd4(tenant, id_extractor) {
|
|
|
6558
6544
|
}
|
|
6559
6545
|
})().catch(e => $268cbd9e4ade92db$export$f18d5b0af29128b7([e, "Extracting and sending transaction IDs from URL failed"], "warning"));
|
|
6560
6546
|
}
|
|
6561
|
-
function $0c9d834f187cc4ff$export$1ac466d53a6636ac(t, input_id,
|
|
6547
|
+
function $0c9d834f187cc4ff$export$1ac466d53a6636ac(t, input_id, session_id = $e0a87646d12cb987$export$61e7e1f11e96692f(), filter) {
|
|
6562
6548
|
const transaction_id = typeof filter == "function" ? filter(input_id) : input_id;
|
|
6563
6549
|
if (!transaction_id) {
|
|
6564
6550
|
$e6c6e7929ea385ae$export$de56f1198d121036("Not sending", transaction_id, "because it didn't pass filter");
|
|
@@ -6571,7 +6557,7 @@ function $0c9d834f187cc4ff$export$1ac466d53a6636ac(t, input_id, dsid = $e0a87646
|
|
|
6571
6557
|
events: [{
|
|
6572
6558
|
event_type: "transaction_mapping",
|
|
6573
6559
|
transaction_id: transaction_id,
|
|
6574
|
-
|
|
6560
|
+
session_id: session_id
|
|
6575
6561
|
}]
|
|
6576
6562
|
};
|
|
6577
6563
|
$0c84f8e99aac5765$export$cc3b6ddf805f6156((0, $4c6861fbcd3a0611$export$362abebb4b313340) + "/v2/track", payload);
|
|
@@ -6615,7 +6601,7 @@ function $5a44db2d2c8361b9$var$make_tracker_send_to_depict(ga_tracker, t, filter
|
|
|
6615
6601
|
originalSendHitTask(model);
|
|
6616
6602
|
// console.log('Sent original hit, now sending to depict');
|
|
6617
6603
|
try {
|
|
6618
|
-
const dsid = $e0a87646d12cb987$export$
|
|
6604
|
+
const dsid = $e0a87646d12cb987$export$61e7e1f11e96692f();
|
|
6619
6605
|
const payload = model.get("hitPayload");
|
|
6620
6606
|
const sp = new URLSearchParams(payload);
|
|
6621
6607
|
const id = sp.get("ti");
|
|
@@ -6628,22 +6614,6 @@ function $5a44db2d2c8361b9$var$make_tracker_send_to_depict(ga_tracker, t, filter
|
|
|
6628
6614
|
}
|
|
6629
6615
|
});
|
|
6630
6616
|
}
|
|
6631
|
-
async function $8594d423459ba80c$export$d63b08f4f29ddba5(t, unavailability_type) {
|
|
6632
|
-
const product_id = await t.get_product_id();
|
|
6633
|
-
$e6c6e7929ea385ae$export$de56f1198d121036(`Notifying Depict that product id: ${product_id} is ${unavailability_type}`);
|
|
6634
|
-
const payload = {
|
|
6635
|
-
"tenant": t.tenant,
|
|
6636
|
-
"market": t.market,
|
|
6637
|
-
"events": [{
|
|
6638
|
-
event_type: "product_unavailable",
|
|
6639
|
-
product_id: product_id,
|
|
6640
|
-
unavailability_type: unavailability_type,
|
|
6641
|
-
user_id: $e0a87646d12cb987$export$adc61a405a4cabed(),
|
|
6642
|
-
dsid: $e0a87646d12cb987$export$6399bdb2291895e0()
|
|
6643
|
-
}]
|
|
6644
|
-
};
|
|
6645
|
-
$0c84f8e99aac5765$export$cc3b6ddf805f6156((0, $4c6861fbcd3a0611$export$362abebb4b313340) + "/v2/track", payload);
|
|
6646
|
-
}
|
|
6647
6617
|
|
|
6648
6618
|
/**
|
|
6649
6619
|
* Set but you can listen for values being added or removed
|
|
@@ -7121,7 +7091,7 @@ function $c693a2d89c78efe6$var$deal_w_removal_of_node_array(node_array, push_dis
|
|
|
7121
7091
|
push_disconnector(disconnect_observer);
|
|
7122
7092
|
}
|
|
7123
7093
|
}
|
|
7124
|
-
const $fac9c96b6bbe43cd$export$3b75288f46cadd96 = () => new Array($3f34dc07544c5857$export$bb0a9c36cf454ea0(3, 8)).fill("
|
|
7094
|
+
const $fac9c96b6bbe43cd$export$3b75288f46cadd96 = () => new Array($3f34dc07544c5857$export$bb0a9c36cf454ea0(3, 8)).fill("\u2B1C").join("");
|
|
7125
7095
|
const $fac9c96b6bbe43cd$var$make_sel = (image_url, attribute) => `[${attribute}=${JSON.stringify(image_url)}]`;
|
|
7126
7096
|
const $fac9c96b6bbe43cd$export$a4eccf92efefa04d = (image_width, image_height, color = "#f6f7f8") => `data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='${image_width}' height='${image_height}' xmlns:v='https://vecta.io/nano'%3e%3cpath d='M0 0h${image_width}.016v${image_height}.01H0' fill='${encodeURIComponent(color)}'/%3e%3c/svg%3e`;
|
|
7127
7097
|
async function $fac9c96b6bbe43cd$export$2dd69958012e3e49({
|
|
@@ -7539,10 +7509,10 @@ function $9ed7c4b0fbf9ccd8$export$cd1adfb8059b5fcd(promise, ms) {
|
|
|
7539
7509
|
}
|
|
7540
7510
|
const $5185cc9bd668b8f9$var$get_voyado_id = () => {
|
|
7541
7511
|
const va = /\b_vaI=([^;]+)/.exec(document.cookie)?.[1];
|
|
7542
|
-
return va || $e0a87646d12cb987$export$
|
|
7512
|
+
return va || $e0a87646d12cb987$export$61e7e1f11e96692f();
|
|
7543
7513
|
};
|
|
7544
7514
|
const $5185cc9bd668b8f9$export$a739d9a07da7f9ce = /*@__PURE__*/$268cbd9e4ade92db$export$b3bbfd758f11cfa9(() => {
|
|
7545
|
-
$e0a87646d12cb987$export$
|
|
7515
|
+
$e0a87646d12cb987$export$93ae15b1ae509334($5185cc9bd668b8f9$var$get_voyado_id);
|
|
7546
7516
|
});
|
|
7547
7517
|
function $dba3e72fb3e5c53d$export$4a3043e508dd72f0({
|
|
7548
7518
|
children: children,
|
|
@@ -7685,8 +7655,8 @@ async function $bd0fccdac6624b01$export$c068ad5361be7646({
|
|
|
7685
7655
|
on_close_(exit_oos_iterator);
|
|
7686
7656
|
}));
|
|
7687
7657
|
}
|
|
7688
|
-
var $
|
|
7689
|
-
$
|
|
7658
|
+
var $dcdbfd7a994587c9$exports = {};
|
|
7659
|
+
$dcdbfd7a994587c9$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";
|
|
7690
7660
|
let $e587cb3b31b82f43$var$inserted = false;
|
|
7691
7661
|
const $e587cb3b31b82f43$export$84712d0562a614b8 = ({
|
|
7692
7662
|
width: width,
|
|
@@ -7697,7 +7667,7 @@ const $e587cb3b31b82f43$export$84712d0562a614b8 = ({
|
|
|
7697
7667
|
}) => {
|
|
7698
7668
|
if (!$e587cb3b31b82f43$var$inserted) {
|
|
7699
7669
|
// Insert styling on first import
|
|
7700
|
-
$e4bebbfa0f0b1454$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($
|
|
7670
|
+
$e4bebbfa0f0b1454$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($dcdbfd7a994587c9$exports)));
|
|
7701
7671
|
$e587cb3b31b82f43$var$inserted = true;
|
|
7702
7672
|
}
|
|
7703
7673
|
return (
|
|
@@ -7919,8 +7889,8 @@ const $b25f388f0fe2f1b3$export$237455ad7e59d4e5 = ({
|
|
|
7919
7889
|
collapse: collapse
|
|
7920
7890
|
};
|
|
7921
7891
|
};
|
|
7922
|
-
var $
|
|
7923
|
-
$
|
|
7892
|
+
var $aa123ed8001baa5e$exports = {};
|
|
7893
|
+
$aa123ed8001baa5e$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";
|
|
7924
7894
|
const $ff973b2032639b5f$export$3d13beba9b52c947 = "https://img.depict.ai/ResizeImage" + (process.env.TENANT ? "/" + process.env.TENANT : "");
|
|
7925
7895
|
const $ff973b2032639b5f$export$a98fc8a2c818d3d8 = /*@__PURE__*/(() => typeof navigator === "undefined" ? false : /^((?!chrome|android).)*safari/i.test(navigator.userAgent))(); // https://stackoverflow.com/a/23522755
|
|
7926
7896
|
function $ff973b2032639b5f$export$f39a7d0667e924a(what_to_watch, sizes_communicator = $9a42a570de51ea3d$export$e806c6c1615a59ae(), resolution_factor = 1) {
|
|
@@ -8076,7 +8046,7 @@ const $a312bccd722ac9e4$export$788756b42446dc2d = ({
|
|
|
8076
8046
|
}) => {
|
|
8077
8047
|
if (!$a312bccd722ac9e4$var$inserted) {
|
|
8078
8048
|
// Insert styling on first import
|
|
8079
|
-
$e4bebbfa0f0b1454$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($
|
|
8049
|
+
$e4bebbfa0f0b1454$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($aa123ed8001baa5e$exports)));
|
|
8080
8050
|
$a312bccd722ac9e4$var$inserted = true;
|
|
8081
8051
|
}
|
|
8082
8052
|
const img = process.env.BUILD_TARGET === "modern" || process.env.BUILD_TARGET === "dev" ? $a312bccd722ac9e4$var$Image(options) : $a312bccd722ac9e4$var$CompatibleImage(options);
|
|
@@ -8156,8 +8126,8 @@ function $a312bccd722ac9e4$var$srcset_comp_from_map_or_new(rendering_options, sr
|
|
|
8156
8126
|
}
|
|
8157
8127
|
return sourceset_component;
|
|
8158
8128
|
}
|
|
8159
|
-
var $
|
|
8160
|
-
$
|
|
8129
|
+
var $db57c943efeaebed$exports = {};
|
|
8130
|
+
$db57c943efeaebed$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";
|
|
8161
8131
|
|
|
8162
8132
|
// Saving bytez
|
|
8163
8133
|
// Maybe? @Daniel
|
|
@@ -8285,7 +8255,7 @@ const $a656daa2fa8c279a$export$2369f6fc1c911576 = ({
|
|
|
8285
8255
|
...options
|
|
8286
8256
|
}) => {
|
|
8287
8257
|
if (!$a656daa2fa8c279a$var$styling_inserted) {
|
|
8288
|
-
$e4bebbfa0f0b1454$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($
|
|
8258
|
+
$e4bebbfa0f0b1454$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($db57c943efeaebed$exports)));
|
|
8289
8259
|
$a656daa2fa8c279a$var$styling_inserted = true;
|
|
8290
8260
|
}
|
|
8291
8261
|
const main_image = $a312bccd722ac9e4$export$788756b42446dc2d({
|
package/latest/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/// <reference path="../jsx.d.ts" />
|
|
2
|
-
import { EUnavailabilityType } from "@depict-ai/types/api/TrackV2Request";
|
|
3
2
|
import { Accessor } from "solid-js";
|
|
4
|
-
export const version = "
|
|
3
|
+
export const version = "2.0.0";
|
|
5
4
|
export const is_debug: boolean;
|
|
6
5
|
/**
|
|
7
6
|
* Sets the prefix of dlog, dwarn, and derror messages in the browser console. Defaults to `[Depict]`.
|
|
@@ -221,7 +220,7 @@ export function random_string(): string;
|
|
|
221
220
|
export function make_random_classname(): string;
|
|
222
221
|
export const base_url: string;
|
|
223
222
|
export type event_types = "page_view" | "click" | "add_to_cart" | "purchase" | "element_visible";
|
|
224
|
-
declare const allowed_keys: readonly ["tenant", "market", "type", "
|
|
223
|
+
declare const allowed_keys: readonly ["tenant", "market", "type", "session_id", "product_id", "entity_identifiers", "url", "entity_price", "currency", "document_referrer", "document_width", "attribution_id", "recommendation_id", "click_location", "ab_test_group", "variant_ids", "transaction_id", "error_type", "detail", "recommendation_type", "search_result_id", "product_listing_result_id"];
|
|
225
224
|
export type depict_body = Partial<{ [K in (typeof allowed_keys)[number]]: any }>;
|
|
226
225
|
export type depict_payload = depict_body[];
|
|
227
226
|
type any_properties = {
|
|
@@ -235,16 +234,10 @@ export const foolproof_send_beacon: (url: string, payload: {
|
|
|
235
234
|
[key: string]: any;
|
|
236
235
|
}) => boolean | undefined;
|
|
237
236
|
export const send_depict: (payload: noisy_depict_payload, use_ws?: boolean | undefined) => boolean | Promise<void | undefined> | undefined;
|
|
238
|
-
export let
|
|
239
|
-
export let get_user_id: () => string;
|
|
240
|
-
export let get_session_id: () => string | undefined;
|
|
241
|
-
export const set_depict_id_fn: (newfn: () => string) => (() => string) | undefined;
|
|
242
|
-
export const set_user_id_fn: (newfn: () => string) => (() => string) | undefined;
|
|
237
|
+
export let get_session_id: () => string;
|
|
243
238
|
export const set_session_id_fn: (newfn: () => string) => (() => string) | undefined;
|
|
244
239
|
export type TrackingEventContextData = {
|
|
245
|
-
|
|
246
|
-
dsid: string;
|
|
247
|
-
session_id?: string;
|
|
240
|
+
session_id: string;
|
|
248
241
|
url: string;
|
|
249
242
|
document_width: number;
|
|
250
243
|
document_referrer: string;
|
|
@@ -260,7 +253,6 @@ export const depict_prefilled: (vars: Partial<{
|
|
|
260
253
|
currency: any;
|
|
261
254
|
tenant: any;
|
|
262
255
|
market: any;
|
|
263
|
-
user_id: any;
|
|
264
256
|
session_id: any;
|
|
265
257
|
product_id: any;
|
|
266
258
|
entity_identifiers: any;
|
|
@@ -272,7 +264,6 @@ export const depict_prefilled: (vars: Partial<{
|
|
|
272
264
|
click_location: any;
|
|
273
265
|
ab_test_group: any;
|
|
274
266
|
variant_ids: any;
|
|
275
|
-
dsid: any;
|
|
276
267
|
transaction_id: any;
|
|
277
268
|
error_type: any;
|
|
278
269
|
recommendation_type: any;
|
|
@@ -288,7 +279,6 @@ export const depict_click: (vars: Partial<{
|
|
|
288
279
|
currency: any;
|
|
289
280
|
tenant: any;
|
|
290
281
|
market: any;
|
|
291
|
-
user_id: any;
|
|
292
282
|
session_id: any;
|
|
293
283
|
product_id: any;
|
|
294
284
|
entity_identifiers: any;
|
|
@@ -300,7 +290,6 @@ export const depict_click: (vars: Partial<{
|
|
|
300
290
|
click_location: any;
|
|
301
291
|
ab_test_group: any;
|
|
302
292
|
variant_ids: any;
|
|
303
|
-
dsid: any;
|
|
304
293
|
transaction_id: any;
|
|
305
294
|
error_type: any;
|
|
306
295
|
recommendation_type: any;
|
|
@@ -316,7 +305,6 @@ export const depict_add_to_cart: (vars: Partial<{
|
|
|
316
305
|
currency: any;
|
|
317
306
|
tenant: any;
|
|
318
307
|
market: any;
|
|
319
|
-
user_id: any;
|
|
320
308
|
session_id: any;
|
|
321
309
|
product_id: any;
|
|
322
310
|
entity_identifiers: any;
|
|
@@ -328,7 +316,6 @@ export const depict_add_to_cart: (vars: Partial<{
|
|
|
328
316
|
click_location: any;
|
|
329
317
|
ab_test_group: any;
|
|
330
318
|
variant_ids: any;
|
|
331
|
-
dsid: any;
|
|
332
319
|
transaction_id: any;
|
|
333
320
|
error_type: any;
|
|
334
321
|
recommendation_type: any;
|
|
@@ -1006,6 +993,7 @@ type FetchRecsOptions = {
|
|
|
1006
993
|
metadata?: Record<string, any>;
|
|
1007
994
|
} & ExclusiveId;
|
|
1008
995
|
/**
|
|
996
|
+
* @deprecated, use fetchDepictRecommendations instead
|
|
1009
997
|
* Fetches recommendations from the depict v2 recommendation api.
|
|
1010
998
|
* Will select the endpoint after which id property is given.
|
|
1011
999
|
*
|
|
@@ -1153,8 +1141,6 @@ export type RecRendererResult<T extends Display> = Record<string, never> | {
|
|
|
1153
1141
|
export function queueMacroTask(callback: VoidFunction): void;
|
|
1154
1142
|
interface SDKRenderingInfo {
|
|
1155
1143
|
set_on_index_change: (fn: (index: number) => void) => void;
|
|
1156
|
-
merchant: string;
|
|
1157
|
-
market: string;
|
|
1158
1144
|
}
|
|
1159
1145
|
/**
|
|
1160
1146
|
* Creates a handler for sending the "recommendations_inserted" event on new results.
|
|
@@ -1528,7 +1514,8 @@ export function get_recs_with_template({
|
|
|
1528
1514
|
template,
|
|
1529
1515
|
// recommendation template
|
|
1530
1516
|
chunk_size_for_load_more,
|
|
1531
|
-
insertion_promise
|
|
1517
|
+
insertion_promise,
|
|
1518
|
+
view_more_text
|
|
1532
1519
|
}: {
|
|
1533
1520
|
t: Tenant;
|
|
1534
1521
|
recs?: any[];
|
|
@@ -1544,6 +1531,7 @@ export function get_recs_with_template({
|
|
|
1544
1531
|
template: string;
|
|
1545
1532
|
chunk_size_for_load_more?: number;
|
|
1546
1533
|
insertion_promise?: Promise<void | unknown>;
|
|
1534
|
+
view_more_text?: string;
|
|
1547
1535
|
}): Promise<ChildNode[] | void>;
|
|
1548
1536
|
export function default_pre_processor(_t: any, d: any, i: number, with_loadmore: boolean, with_slider: boolean, infinite_scroll: boolean): any;
|
|
1549
1537
|
export function default_post_processor(_t: any, itms: HTMLCollection, d: any, slider: Deprecated_Amazing_Slider | null): HTMLCollection;
|
|
@@ -1907,12 +1895,11 @@ export function datalayer_interceptor(interception_callback: (layer_entry: any)
|
|
|
1907
1895
|
* For example: url => url.searchParams.get("orderId")
|
|
1908
1896
|
*/
|
|
1909
1897
|
export function url_transaction_id_extractor(tenant: Tenant, id_extractor: (url: URL) => unknown): void;
|
|
1910
|
-
export function send_transaction_id_to_depict(t: Tenant, input_id: string,
|
|
1898
|
+
export function send_transaction_id_to_depict(t: Tenant, input_id: string, session_id?: string, filter?: (text: string) => string | undefined): void;
|
|
1911
1899
|
/**
|
|
1912
1900
|
* Intercepts google analytics events for transactions (e.g when payment is made) and also sends it to depict.
|
|
1913
1901
|
* */
|
|
1914
1902
|
export function ga_to_transaction_api(t: Tenant, filter?: (text: string) => string | undefined): void;
|
|
1915
|
-
export function send_product_unavailable_to_depict(t: Tenant, unavailability_type: EUnavailabilityType): Promise<void>;
|
|
1916
1903
|
export interface ListenableSetEvent<T> extends CustomEvent {
|
|
1917
1904
|
detail: T;
|
|
1918
1905
|
}
|