@useinsider/guido 3.21.0-beta.7e166b5 → 3.21.0-beta.9f9407d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/extensions/Blocks/Recommendation/block.js +135 -181
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +1 -6
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +150 -132
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +98 -97
- package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +58 -43
- package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +31 -48
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +0 -11
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +3 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +4 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +3 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/strategyCommit.d.ts +0 -9
- package/package.json +1 -1
|
@@ -1,72 +1,72 @@
|
|
|
1
1
|
var _ = Object.defineProperty;
|
|
2
|
-
var y = (
|
|
3
|
-
var
|
|
2
|
+
var y = (u, l, e) => l in u ? _(u, l, { enumerable: !0, configurable: !0, writable: !0, value: e }) : u[l] = e;
|
|
3
|
+
var r = (u, l, e) => y(u, typeof l != "symbol" ? l + "" : l, e);
|
|
4
4
|
import { useConfig as g } from "../../../../../composables/useConfig.js";
|
|
5
5
|
import { ModificationDescription as N } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
6
6
|
import { CommonControl as P } from "../../../common-control.js";
|
|
7
7
|
import { RRS_CONFIG_VERSION as R, DEFAULT_NODE_CONFIG as a } from "../../constants/defaultConfig.js";
|
|
8
|
-
import { RECOMMENDATION_ID_ATTR as
|
|
9
|
-
import { RecommendationConfigService as
|
|
10
|
-
import { useRecommendationExtensionStore as
|
|
8
|
+
import { RECOMMENDATION_ID_ATTR as I } from "../../constants/selectors.js";
|
|
9
|
+
import { RecommendationConfigService as d } from "../../services/configService.js";
|
|
10
|
+
import { useRecommendationExtensionStore as k } from "../../store/recommendation.js";
|
|
11
11
|
import { refreshBlockOutsidePanel as S } from "../../utils/blockRefresh.js";
|
|
12
|
-
import { registerNodeConfigWriter as T, writeBlockConfigOutsidePanel as m, hasEditedConfigChange as b } from "../../utils/nodeConfigWriter.js";
|
|
13
|
-
import { AlgorithmControl as
|
|
14
|
-
import { ALGORITHM_CONTROL_ID as
|
|
15
|
-
import { CurrencyControl as
|
|
16
|
-
import { CURRENCY_CONTROL_ID as
|
|
17
|
-
import { FiltersControl as
|
|
18
|
-
import { FILTERS_CONTROL_ID as
|
|
19
|
-
import { LayoutOrientationControl as
|
|
20
|
-
import { LAYOUT_ORIENTATION_CONTROL_ID as
|
|
21
|
-
import { LocaleControl as
|
|
22
|
-
import { LOCALE_CONTROL_ID as
|
|
23
|
-
import { PricePlacementControl as
|
|
24
|
-
import { PRICE_PLACEMENT_CONTROL_ID as
|
|
25
|
-
import { ProductCountControl as
|
|
26
|
-
import { PRODUCT_COUNT_CONTROL_ID as
|
|
27
|
-
import { ProductLayoutControl as
|
|
28
|
-
import { PRODUCT_LAYOUT_CONTROL_ID as
|
|
29
|
-
import { ShuffleControl as
|
|
30
|
-
import { SHUFFLE_CONTROL_ID as
|
|
31
|
-
import { StrategyControl as
|
|
32
|
-
import { STRATEGY_CONTROL_ID as
|
|
33
|
-
import { setCurrencyAttributes as
|
|
34
|
-
import { adjustProductsToSize as
|
|
12
|
+
import { registerNodeConfigWriter as T, writeBlockConfigOutsidePanel as m, hasEditedConfigChange as O, isProductIdsChange as b, PRODUCT_IDS_DESCRIPTION as B } from "../../utils/nodeConfigWriter.js";
|
|
13
|
+
import { AlgorithmControl as E } from "./algorithm.js";
|
|
14
|
+
import { ALGORITHM_CONTROL_ID as pe } from "./algorithm.js";
|
|
15
|
+
import { CurrencyControl as L } from "./currency.js";
|
|
16
|
+
import { CURRENCY_CONTROL_ID as ye } from "./currency.js";
|
|
17
|
+
import { FiltersControl as D } from "./filters.js";
|
|
18
|
+
import { FILTERS_CONTROL_ID as Pe } from "./filters.js";
|
|
19
|
+
import { LayoutOrientationControl as F } from "./layoutOrientation.js";
|
|
20
|
+
import { LAYOUT_ORIENTATION_CONTROL_ID as Ie } from "./layoutOrientation.js";
|
|
21
|
+
import { LocaleControl as U } from "./locale.js";
|
|
22
|
+
import { LOCALE_CONTROL_ID as Se } from "./locale.js";
|
|
23
|
+
import { PricePlacementControl as v } from "./pricePlacement.js";
|
|
24
|
+
import { PRICE_PLACEMENT_CONTROL_ID as Oe } from "./pricePlacement.js";
|
|
25
|
+
import { ProductCountControl as w } from "./productCount.js";
|
|
26
|
+
import { PRODUCT_COUNT_CONTROL_ID as Be } from "./productCount.js";
|
|
27
|
+
import { ProductLayoutControl as A } from "./productLayout.js";
|
|
28
|
+
import { PRODUCT_LAYOUT_CONTROL_ID as Le } from "./productLayout.js";
|
|
29
|
+
import { ShuffleControl as V } from "./shuffle.js";
|
|
30
|
+
import { SHUFFLE_CONTROL_ID as Fe } from "./shuffle.js";
|
|
31
|
+
import { StrategyControl as x } from "./strategy.js";
|
|
32
|
+
import { STRATEGY_CONTROL_ID as ve } from "./strategy.js";
|
|
33
|
+
import { setCurrencyAttributes as W, getBlockElement as M, isPartnerManagedBlock as G, updateProductContentInPlace as z, regenerateProductRowsWithStyles as $ } from "./utils.js";
|
|
34
|
+
import { adjustProductsToSize as Ae, formatProductPrice as Ve, getCardComposition as xe, getCurrentLayout as We, getMainContainerTbody as Me, regenerateMobileProductRows as Ge, updatePricesInPlace as ze, updateSingleProductContent as $e } from "./utils.js";
|
|
35
35
|
import { useDebounceFn as C } from "../../../../../node_modules/@vueuse/shared/index.js";
|
|
36
|
-
const f = "Update recommendation filters",
|
|
37
|
-
class
|
|
36
|
+
const f = "Update recommendation filters", H = "ui-elements-recommendation-block";
|
|
37
|
+
class ge extends P {
|
|
38
38
|
constructor() {
|
|
39
39
|
super(...arguments);
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
r(this, "store", k());
|
|
41
|
+
r(this, "storeUnsubscription", () => {
|
|
42
42
|
});
|
|
43
43
|
// A config change waiting to reach the node config. Deferred so it can ride the
|
|
44
44
|
// re-render's single apply() — one user action must cost one undo press.
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
r(this, "pendingNodeConfigWrite", null);
|
|
46
|
+
r(this, "pendingConfigFlushTimer", null);
|
|
47
47
|
// What the panel still owes the block it watches — finished outside the panel on teardown
|
|
48
48
|
// and block switch. A new generation tells debounced work queued for the old one to stand down.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
r(this, "trackedBlockId", null);
|
|
50
|
+
r(this, "fetchedConfigVersion", 0);
|
|
51
|
+
r(this, "hasUnrenderedProducts", !1);
|
|
52
|
+
r(this, "panelGeneration", 0);
|
|
53
|
+
r(this, "isPanelAlive", !0);
|
|
54
54
|
// Sub-control instances for lifecycle management
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
55
|
+
r(this, "algorithmControl", null);
|
|
56
|
+
r(this, "localeControl", null);
|
|
57
|
+
r(this, "currencyControl", null);
|
|
58
|
+
r(this, "productCountControl", null);
|
|
59
|
+
r(this, "productLayoutControl", null);
|
|
60
|
+
r(this, "filtersControl", null);
|
|
61
|
+
r(this, "shuffleControl", null);
|
|
62
|
+
r(this, "pricePlacementControl", null);
|
|
63
|
+
r(this, "layoutOrientationControl", null);
|
|
64
|
+
r(this, "strategyControl", null);
|
|
65
|
+
r(this, "rrsEnabled", !1);
|
|
66
66
|
/**
|
|
67
67
|
* Debounced product fetch to prevent rapid API calls during config changes
|
|
68
68
|
*/
|
|
69
|
-
|
|
69
|
+
r(this, "_debouncedFetchProducts", C(async (e, t) => {
|
|
70
70
|
if (t !== this.panelGeneration)
|
|
71
71
|
return;
|
|
72
72
|
const o = this._getBlockConfigVersion(e);
|
|
@@ -87,7 +87,7 @@ class he extends P {
|
|
|
87
87
|
* count. The store pads products to the configured size, so in-place only
|
|
88
88
|
* fails when the size actually changed.
|
|
89
89
|
*/
|
|
90
|
-
|
|
90
|
+
r(this, "_debouncedRegenerateWithProducts", C((e) => {
|
|
91
91
|
if (e !== this.panelGeneration || !this.currentNode || !this.api)
|
|
92
92
|
return;
|
|
93
93
|
const t = this._getRecommendationIdFromNode(this.currentNode), o = this.store.currentRecommendationId;
|
|
@@ -106,7 +106,7 @@ class he extends P {
|
|
|
106
106
|
}, 100));
|
|
107
107
|
}
|
|
108
108
|
getId() {
|
|
109
|
-
return
|
|
109
|
+
return H;
|
|
110
110
|
}
|
|
111
111
|
get _subControls() {
|
|
112
112
|
return [
|
|
@@ -127,7 +127,7 @@ class he extends P {
|
|
|
127
127
|
return this.rrsEnabled = g().isFeatureEnabled("reusableRecommendationStrategy"), this._subControls.forEach((t) => {
|
|
128
128
|
var o;
|
|
129
129
|
return (o = t == null ? void 0 : t.onDestroy) == null ? void 0 : o.call(t);
|
|
130
|
-
}), this.algorithmControl = new
|
|
130
|
+
}), this.algorithmControl = new E(), this.localeControl = new U(), this.currencyControl = new L(), this.productCountControl = new w(), this.productLayoutControl = new A(), this.filtersControl = new D(), this.shuffleControl = new V(), this.pricePlacementControl = new v(), this.layoutOrientationControl = new F(), this.strategyControl = this.rrsEnabled ? new x() : null, this._subControls.forEach((t) => {
|
|
131
131
|
t && (t.api = this.api);
|
|
132
132
|
}), `
|
|
133
133
|
<div class="recommendation-controls-container">
|
|
@@ -149,8 +149,8 @@ class he extends P {
|
|
|
149
149
|
const t = (s = this.getContainer()) == null ? void 0 : s.querySelector(".recommendation-controls-container");
|
|
150
150
|
if (!t)
|
|
151
151
|
return;
|
|
152
|
-
const o = this._getRecommendationIdFromNode(e) === null ? null :
|
|
153
|
-
t.classList.toggle("strategy-block", n), t.classList.toggle("legacy-strategy-block",
|
|
152
|
+
const o = this._getRecommendationIdFromNode(e) === null ? null : d.getConfig(e), n = this.rrsEnabled && !!o && (!!(o != null && o.strategyId) || ((o == null ? void 0 : o.configVersion) ?? 0) >= R), i = this.rrsEnabled && !!o && !n;
|
|
153
|
+
t.classList.toggle("strategy-block", n), t.classList.toggle("legacy-strategy-block", i);
|
|
154
154
|
}
|
|
155
155
|
async onRender() {
|
|
156
156
|
var o;
|
|
@@ -169,8 +169,8 @@ class he extends P {
|
|
|
169
169
|
t !== null && t !== this.store.currentRecommendationId && this.store.setCurrentBlock(t), t !== null && this._syncNodeConfigIfChanged(t), this._showControlsForBlock(e), t !== null && !((o = this.store.blockStates[t]) != null && o.isInitialized) && this._fetchBlockData(t).then(() => {
|
|
170
170
|
this._initializeSubControls();
|
|
171
171
|
}), this._subControls.forEach((n) => {
|
|
172
|
-
var
|
|
173
|
-
n != null && n.api && (n.currentNode = e, (
|
|
172
|
+
var i;
|
|
173
|
+
n != null && n.api && (n.currentNode = e, (i = n.onTemplateNodeUpdated) == null || i.call(n, e));
|
|
174
174
|
});
|
|
175
175
|
}
|
|
176
176
|
onDestroy() {
|
|
@@ -214,18 +214,18 @@ class he extends P {
|
|
|
214
214
|
* state was rebuilt with (SD-150347).
|
|
215
215
|
*/
|
|
216
216
|
_syncNodeConfigIfChanged(e) {
|
|
217
|
-
var
|
|
217
|
+
var i;
|
|
218
218
|
this.pendingNodeConfigWrite && this.pendingNodeConfigWrite.blockId !== e && this._flushPendingNodeConfig();
|
|
219
219
|
const t = this.store.blockStates[e];
|
|
220
220
|
if (!t)
|
|
221
221
|
return;
|
|
222
|
-
const o = JSON.stringify(
|
|
223
|
-
t.syncedConfigFingerprint = o, n !== o && ((
|
|
222
|
+
const o = JSON.stringify(d.getConfig(this.currentNode)), n = t.syncedConfigFingerprint;
|
|
223
|
+
t.syncedConfigFingerprint = o, n !== o && ((i = this.pendingNodeConfigWrite) == null ? void 0 : i.blockId) !== e && this._syncNodeConfigToStore();
|
|
224
224
|
}
|
|
225
225
|
/** Whether the deferred write would move the node's strategyId — see the caller (SD-149916). */
|
|
226
226
|
_isPendingStrategyIdChange() {
|
|
227
227
|
const e = this.pendingNodeConfigWrite;
|
|
228
|
-
return e ?
|
|
228
|
+
return e ? d.getConfig(this.currentNode).strategyId !== e.updates.strategyId : !1;
|
|
229
229
|
}
|
|
230
230
|
_capturePendingNodeConfigWrite() {
|
|
231
231
|
const e = this.store.currentRecommendationId, t = e === null ? void 0 : this.store.blockStates[e];
|
|
@@ -235,14 +235,15 @@ class he extends P {
|
|
|
235
235
|
});
|
|
236
236
|
}
|
|
237
237
|
_getNodeConfigUpdates(e) {
|
|
238
|
-
const { filters: t, strategy: o, strategyId: n, size:
|
|
238
|
+
const { filters: t, strategy: o, strategyId: n, size: i, productIds: s, nodeConfigVersion: h } = e, { partnerName: c } = g();
|
|
239
239
|
return {
|
|
240
240
|
filters: t,
|
|
241
241
|
strategy: o,
|
|
242
242
|
strategyId: n,
|
|
243
|
-
size:
|
|
244
|
-
|
|
245
|
-
|
|
243
|
+
size: i,
|
|
244
|
+
productIds: s,
|
|
245
|
+
configVersion: h,
|
|
246
|
+
...c.value ? { partnerName: c.value } : {}
|
|
246
247
|
};
|
|
247
248
|
}
|
|
248
249
|
/**
|
|
@@ -257,7 +258,7 @@ class he extends P {
|
|
|
257
258
|
*/
|
|
258
259
|
_stagePendingNodeConfig(e) {
|
|
259
260
|
const t = this.pendingNodeConfigWrite;
|
|
260
|
-
return !t || !this.currentNode ? !1 : (
|
|
261
|
+
return !t || !this.currentNode ? !1 : (d.stageConfig(e, this.currentNode, t.updates), !0);
|
|
261
262
|
}
|
|
262
263
|
/**
|
|
263
264
|
* Arms the guaranteed fallback write, once the product fetch has settled. The
|
|
@@ -285,17 +286,26 @@ class he extends P {
|
|
|
285
286
|
!m(t, o, f) && this.store.blockStates[t] && console.error("[recommendation] pending config write did not reach a node", { blockId: t });
|
|
286
287
|
return;
|
|
287
288
|
}
|
|
288
|
-
|
|
289
|
+
O(this.currentNode, e.updates) && d.updateConfig(
|
|
289
290
|
this.api,
|
|
290
291
|
this.currentNode,
|
|
291
292
|
e.updates,
|
|
292
|
-
f
|
|
293
|
+
this._pendingDescription(e.updates) ?? f
|
|
293
294
|
);
|
|
294
295
|
}
|
|
295
296
|
}
|
|
297
|
+
_cardsPredatePendingWrite() {
|
|
298
|
+
const e = this.pendingNodeConfigWrite;
|
|
299
|
+
return e !== null && this.fetchedConfigVersion < this._getBlockConfigVersion(e.blockId);
|
|
300
|
+
}
|
|
301
|
+
/** The Product Ids label when the pending write moves the node's ids; the caller's default otherwise. */
|
|
302
|
+
_pendingDescription(e = ((t) => (t = this.pendingNodeConfigWrite) == null ? void 0 : t.updates)()) {
|
|
303
|
+
if (!(!e || !this.currentNode || !b(this.currentNode, e)))
|
|
304
|
+
return B;
|
|
305
|
+
}
|
|
296
306
|
_syncNodeConfigToStore() {
|
|
297
307
|
var n;
|
|
298
|
-
const e =
|
|
308
|
+
const e = d.getConfig(this.currentNode), t = this.store.currentRecommendationId, o = t !== null && ((n = this.store.blockStates[t]) == null ? void 0 : n.isInitialized);
|
|
299
309
|
this.store.patchCurrentBlockConfig({
|
|
300
310
|
strategy: e.strategy,
|
|
301
311
|
strategyId: e.strategyId,
|
|
@@ -338,8 +348,8 @@ class he extends P {
|
|
|
338
348
|
if (e !== null && this.store.markBlockInitialized(e), (await Promise.allSettled([
|
|
339
349
|
this.store.fetchRecommendationCreateData(),
|
|
340
350
|
this.store.fetchRecommendationFilters()
|
|
341
|
-
])).forEach((n,
|
|
342
|
-
n.status === "rejected" && console.warn(`Recommendation block: ${["fetchRecommendationCreateData", "fetchRecommendationFilters"][
|
|
351
|
+
])).forEach((n, i) => {
|
|
352
|
+
n.status === "rejected" && console.warn(`Recommendation block: ${["fetchRecommendationCreateData", "fetchRecommendationFilters"][i]} failed`, n.reason);
|
|
343
353
|
}), e !== null && this.store.currentRecommendationId !== e) {
|
|
344
354
|
this._refreshOutsidePanel(e, !0);
|
|
345
355
|
return;
|
|
@@ -369,12 +379,12 @@ class he extends P {
|
|
|
369
379
|
_applySmartDefaults() {
|
|
370
380
|
if (!this.currentNode || !this.api)
|
|
371
381
|
return;
|
|
372
|
-
const e =
|
|
373
|
-
let o = null, n = null,
|
|
382
|
+
const e = d.getConfig(this.currentNode), t = {};
|
|
383
|
+
let o = null, n = null, i = null;
|
|
374
384
|
if (e.currency.code === a.currency.code) {
|
|
375
385
|
const { currencyList: s } = this.store;
|
|
376
386
|
s.length > 0 && (s.some(
|
|
377
|
-
(
|
|
387
|
+
(c) => c.value === `price.${a.currency.code}`
|
|
378
388
|
) || (o = s[0].value.replace("price.", ""), t.currency = {
|
|
379
389
|
...a.currency,
|
|
380
390
|
code: o,
|
|
@@ -384,21 +394,21 @@ class he extends P {
|
|
|
384
394
|
if (e.strategy === a.strategy) {
|
|
385
395
|
const s = this.store.getActivePredictiveAlgorithms;
|
|
386
396
|
s.length > 0 && (s.some(
|
|
387
|
-
(
|
|
397
|
+
(c) => c.value === a.strategy
|
|
388
398
|
) || (n = s[0].value, t.strategy = n));
|
|
389
399
|
}
|
|
390
400
|
if (e.language === a.language) {
|
|
391
401
|
const s = this.store.getLanguages;
|
|
392
402
|
s.length > 0 && (s.some(
|
|
393
|
-
(
|
|
394
|
-
) || (
|
|
403
|
+
(c) => c.value === a.language
|
|
404
|
+
) || (i = s[0].value, t.language = i));
|
|
395
405
|
}
|
|
396
|
-
!o && !n && !
|
|
406
|
+
!o && !n && !i || (d.updateConfig(
|
|
397
407
|
this.api,
|
|
398
408
|
this.currentNode,
|
|
399
409
|
t,
|
|
400
410
|
"Applied smart defaults"
|
|
401
|
-
), o && t.currency &&
|
|
411
|
+
), o && t.currency && W({
|
|
402
412
|
currentNode: this.currentNode,
|
|
403
413
|
documentModifier: this.api.getDocumentModifier(),
|
|
404
414
|
currency: t.currency
|
|
@@ -415,17 +425,17 @@ class he extends P {
|
|
|
415
425
|
}
|
|
416
426
|
} : {},
|
|
417
427
|
...n ? { strategy: n } : {},
|
|
418
|
-
...
|
|
428
|
+
...i ? { language: i } : {}
|
|
419
429
|
}, { triggerRefetch: !1 }));
|
|
420
430
|
}
|
|
421
431
|
/**
|
|
422
432
|
* Reads the recommendation-id attribute from the block element within the node
|
|
423
433
|
*/
|
|
424
434
|
_getRecommendationIdFromNode(e) {
|
|
425
|
-
const t =
|
|
435
|
+
const t = M(e);
|
|
426
436
|
if (!t || !("getAttribute" in t))
|
|
427
437
|
return null;
|
|
428
|
-
const o = t.getAttribute(
|
|
438
|
+
const o = t.getAttribute(I);
|
|
429
439
|
if (!o)
|
|
430
440
|
return null;
|
|
431
441
|
const n = parseInt(o);
|
|
@@ -441,12 +451,12 @@ class he extends P {
|
|
|
441
451
|
const n = e === null ? void 0 : this.store.blockStates[e];
|
|
442
452
|
if (e === null || !n)
|
|
443
453
|
return;
|
|
444
|
-
const
|
|
445
|
-
|
|
454
|
+
const i = t !== n.configVersion;
|
|
455
|
+
i && !m(
|
|
446
456
|
e,
|
|
447
457
|
this._getNodeConfigUpdates(n.recommendationConfigs),
|
|
448
458
|
f
|
|
449
|
-
) && console.error("[recommendation] config write outside the panel did not reach a node", { blockId: e }), (
|
|
459
|
+
) && console.error("[recommendation] config write outside the panel did not reach a node", { blockId: e }), (i || o) && this._refreshOutsidePanel(e, i);
|
|
450
460
|
} catch (n) {
|
|
451
461
|
console.error("[recommendation] finishing the block outside the panel failed", n);
|
|
452
462
|
}
|
|
@@ -477,19 +487,27 @@ class he extends P {
|
|
|
477
487
|
_regenerateWithProducts() {
|
|
478
488
|
if (!this.currentNode || !this.api)
|
|
479
489
|
return;
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
490
|
+
if (this._cardsPredatePendingWrite()) {
|
|
491
|
+
this.hasUnrenderedProducts = !0;
|
|
492
|
+
return;
|
|
493
|
+
}
|
|
494
|
+
const e = this.store.recommendationProducts, t = this.api.getDocumentModifier(), o = this._pendingDescription(), n = this._stagePendingNodeConfig(t);
|
|
495
|
+
if (G(this.currentNode)) {
|
|
496
|
+
n && (t.apply(
|
|
497
|
+
new N(o ?? "Update recommendation configuration")
|
|
498
|
+
), this.pendingNodeConfigWrite = null, this._clearConfigFlush());
|
|
483
499
|
return;
|
|
484
500
|
}
|
|
485
|
-
|
|
501
|
+
z({
|
|
486
502
|
currentNode: this.currentNode,
|
|
487
503
|
documentModifier: t,
|
|
488
|
-
products: e
|
|
489
|
-
|
|
504
|
+
products: e,
|
|
505
|
+
description: o
|
|
506
|
+
}) || $({
|
|
490
507
|
currentNode: this.currentNode,
|
|
491
508
|
documentModifier: t,
|
|
492
|
-
products: e
|
|
509
|
+
products: e,
|
|
510
|
+
description: o
|
|
493
511
|
});
|
|
494
512
|
}
|
|
495
513
|
/**
|
|
@@ -515,47 +533,47 @@ class he extends P {
|
|
|
515
533
|
this.panelGeneration++, this.trackedBlockId = n, t = e.recommendationProducts, o = this._getBlockConfigVersion(n), this.fetchedConfigVersion = o, this.hasUnrenderedProducts = !1, this._finishBlockOutsidePanel(p);
|
|
516
534
|
return;
|
|
517
535
|
}
|
|
518
|
-
const
|
|
519
|
-
|
|
520
|
-
const s = e.recommendationProducts,
|
|
521
|
-
|
|
536
|
+
const i = this._getBlockConfigVersion(n);
|
|
537
|
+
i !== o && (o = i, this._capturePendingNodeConfigWrite(), this._isPendingStrategyIdChange() && this._flushPendingNodeConfig(), this._debouncedFetchProducts(n, this.panelGeneration));
|
|
538
|
+
const s = e.recommendationProducts, h = s !== t, c = Array.isArray(s) && s.length > 0;
|
|
539
|
+
h && c && (t = s, this.hasUnrenderedProducts = !0, this._debouncedRegenerateWithProducts(this.panelGeneration));
|
|
522
540
|
});
|
|
523
541
|
}
|
|
524
542
|
}
|
|
525
543
|
export {
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
544
|
+
pe as ALGORITHM_CONTROL_ID,
|
|
545
|
+
E as AlgorithmControl,
|
|
546
|
+
H as CONTROL_BLOCK_ID,
|
|
547
|
+
ye as CURRENCY_CONTROL_ID,
|
|
548
|
+
L as CurrencyControl,
|
|
549
|
+
Pe as FILTERS_CONTROL_ID,
|
|
550
|
+
D as FiltersControl,
|
|
551
|
+
Ie as LAYOUT_ORIENTATION_CONTROL_ID,
|
|
552
|
+
Se as LOCALE_CONTROL_ID,
|
|
553
|
+
F as LayoutOrientationControl,
|
|
554
|
+
U as LocaleControl,
|
|
555
|
+
Oe as PRICE_PLACEMENT_CONTROL_ID,
|
|
556
|
+
Be as PRODUCT_COUNT_CONTROL_ID,
|
|
557
|
+
Le as PRODUCT_LAYOUT_CONTROL_ID,
|
|
558
|
+
v as PricePlacementControl,
|
|
559
|
+
w as ProductCountControl,
|
|
560
|
+
A as ProductLayoutControl,
|
|
561
|
+
ge as RecommendationBlockControl,
|
|
562
|
+
Fe as SHUFFLE_CONTROL_ID,
|
|
563
|
+
ve as STRATEGY_CONTROL_ID,
|
|
564
|
+
V as ShuffleControl,
|
|
565
|
+
x as StrategyControl,
|
|
566
|
+
Ae as adjustProductsToSize,
|
|
567
|
+
Ve as formatProductPrice,
|
|
568
|
+
M as getBlockElement,
|
|
569
|
+
xe as getCardComposition,
|
|
570
|
+
We as getCurrentLayout,
|
|
571
|
+
Me as getMainContainerTbody,
|
|
572
|
+
G as isPartnerManagedBlock,
|
|
573
|
+
Ge as regenerateMobileProductRows,
|
|
574
|
+
$ as regenerateProductRowsWithStyles,
|
|
575
|
+
W as setCurrencyAttributes,
|
|
576
|
+
ze as updatePricesInPlace,
|
|
577
|
+
z as updateProductContentInPlace,
|
|
578
|
+
$e as updateSingleProductContent
|
|
561
579
|
};
|