@useinsider/guido 3.20.1 → 3.21.0-beta.0df5409

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.
Files changed (90) hide show
  1. package/dist/components/Guido.vue.js +1 -1
  2. package/dist/components/Guido.vue2.js +65 -64
  3. package/dist/components/organisms/AutoSaveController.vue2.js +10 -9
  4. package/dist/components/organisms/header/EditorActions.vue.js +4 -4
  5. package/dist/components/organisms/header/EditorActions.vue2.js +53 -51
  6. package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +3 -3
  7. package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +23 -22
  8. package/dist/composables/useActionsApi.js +80 -63
  9. package/dist/composables/useAutoSave.js +46 -44
  10. package/dist/composables/useGuidoStateBridge.js +3 -3
  11. package/dist/composables/useLegacyStrategyConversion.js +16 -16
  12. package/dist/composables/useSave.js +26 -23
  13. package/dist/composables/useSaveValidation.js +113 -114
  14. package/dist/composables/useSaveValidationRollout.js +17 -6
  15. package/dist/composables/useStripo.js +11 -10
  16. package/dist/extensions/Blocks/Items/block.js +43 -42
  17. package/dist/extensions/Blocks/Recommendation/block.js +33 -29
  18. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +78 -83
  19. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +1 -2
  20. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +2 -12
  21. package/dist/extensions/Blocks/Recommendation/controls/main/currency.js +104 -86
  22. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +348 -263
  23. package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +48 -50
  24. package/dist/extensions/Blocks/Recommendation/controls/main/locale.js +16 -21
  25. package/dist/extensions/Blocks/Recommendation/controls/main/pricePlacement.js +44 -40
  26. package/dist/extensions/Blocks/Recommendation/controls/main/productCount.js +14 -19
  27. package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +104 -102
  28. package/dist/extensions/Blocks/Recommendation/controls/main/shuffle.js +18 -23
  29. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +312 -286
  30. package/dist/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.js +24 -20
  31. package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +6 -7
  32. package/dist/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.js +8 -8
  33. package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +113 -151
  34. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +221 -203
  35. package/dist/extensions/Blocks/Recommendation/utils/blockRefresh.js +28 -0
  36. package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +1 -1
  37. package/dist/extensions/Blocks/Recommendation/utils/currencySettings.js +25 -0
  38. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +111 -40
  39. package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +31 -35
  40. package/dist/extensions/Blocks/Unsubscribe/block.js +70 -75
  41. package/dist/guido.css +1 -1
  42. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +271 -192
  43. package/dist/package.json.js +1 -1
  44. package/dist/services/settingsApi.js +11 -0
  45. package/dist/src/components/Guido.vue.d.ts +1 -1
  46. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -1
  47. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -1
  48. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
  49. package/dist/src/composables/useActionsApi.d.ts +5 -1
  50. package/dist/src/composables/useAutoSave.d.ts +4 -1
  51. package/dist/src/composables/useSaveValidationRollout.d.ts +1 -0
  52. package/dist/src/extensions/Blocks/Checkbox/controls/blockBackground/index.d.ts +1 -0
  53. package/dist/src/extensions/Blocks/CouponBlock/controls/index.d.ts +8 -0
  54. package/dist/src/extensions/Blocks/Items/controls/index.d.ts +40 -0
  55. package/dist/src/extensions/Blocks/RadioButton/controls/blockBackground/index.d.ts +1 -0
  56. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +1 -0
  57. package/dist/src/extensions/Blocks/Recommendation/controls/blockBackground/index.d.ts +1 -0
  58. package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +11 -0
  59. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +3 -6
  60. package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +7 -0
  61. package/dist/src/extensions/Blocks/Recommendation/controls/image/index.d.ts +2 -0
  62. package/dist/src/extensions/Blocks/Recommendation/controls/main/currency.d.ts +5 -5
  63. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +21 -12
  64. package/dist/src/extensions/Blocks/Recommendation/controls/main/layoutOrientation.d.ts +6 -3
  65. package/dist/src/extensions/Blocks/Recommendation/controls/main/pricePlacement.d.ts +6 -5
  66. package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +6 -3
  67. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +21 -9
  68. package/dist/src/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.d.ts +19 -13
  69. package/dist/src/extensions/Blocks/Recommendation/controls/name/index.d.ts +7 -0
  70. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/index.d.ts +7 -0
  71. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.d.ts +7 -0
  72. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/index.d.ts +7 -0
  73. package/dist/src/extensions/Blocks/Recommendation/controls/price/index.d.ts +7 -0
  74. package/dist/src/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.d.ts +10 -8
  75. package/dist/src/extensions/Blocks/Recommendation/controls/spacing/index.d.ts +9 -5
  76. package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +7 -0
  77. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +9 -1
  78. package/dist/src/extensions/Blocks/Recommendation/utils/blockRefresh.d.ts +17 -0
  79. package/dist/src/extensions/Blocks/Recommendation/utils/currencySettings.d.ts +6 -0
  80. package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +18 -11
  81. package/dist/src/extensions/Blocks/Unsubscribe/block.d.ts +1 -6
  82. package/dist/src/extensions/Blocks/_Boilerplate/controls/blockBackground/index.d.ts +1 -0
  83. package/dist/src/extensions/Blocks/controlFactories.d.ts +22 -0
  84. package/dist/src/services/settingsApi.d.ts +6 -0
  85. package/dist/src/stores/editor.d.ts +3 -1
  86. package/dist/src/stores/setup-settings.d.ts +4 -0
  87. package/dist/static/styles/components/button.css.js +5 -0
  88. package/dist/stores/editor.js +5 -0
  89. package/dist/stores/setup-settings.js +10 -0
  90. package/package.json +4 -4
@@ -1,68 +1,82 @@
1
- var C = Object.defineProperty;
2
- var p = (g, u, t) => u in g ? C(g, u, { enumerable: !0, configurable: !0, writable: !0, value: t }) : g[u] = t;
3
- var i = (g, u, t) => p(g, typeof u != "symbol" ? u + "" : u, t);
4
- import { useConfig as h } from "../../../../../composables/useConfig.js";
5
- import { ModificationDescription as y } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
6
- import { CommonControl as N } from "../../../common-control.js";
7
- import { RRS_CONFIG_VERSION as _, DEFAULT_NODE_CONFIG as a } from "../../constants/defaultConfig.js";
8
- import { RECOMMENDATION_ID_ATTR as I } from "../../constants/selectors.js";
9
- import { RecommendationConfigService as c } from "../../services/configService.js";
10
- import { useRecommendationExtensionStore as R } from "../../store/recommendation.js";
11
- import { registerNodeConfigWriter as b } from "../../utils/nodeConfigWriter.js";
12
- import { AlgorithmControl as P } from "./algorithm.js";
13
- import { ALGORITHM_CONTROL_ID as ut } from "./algorithm.js";
14
- import { CurrencyControl as T } from "./currency.js";
15
- import { CURRENCY_CONTROL_ID as gt } from "./currency.js";
16
- import { FiltersControl as S } from "./filters.js";
17
- import { FILTERS_CONTROL_ID as ft } from "./filters.js";
18
- import { LayoutOrientationControl as O } from "./layoutOrientation.js";
19
- import { LAYOUT_ORIENTATION_CONTROL_ID as Ct } from "./layoutOrientation.js";
20
- import { LocaleControl as k } from "./locale.js";
21
- import { LOCALE_CONTROL_ID as yt } from "./locale.js";
22
- import { PricePlacementControl as L } from "./pricePlacement.js";
23
- import { PRICE_PLACEMENT_CONTROL_ID as _t } from "./pricePlacement.js";
24
- import { ProductCountControl as E } from "./productCount.js";
25
- import { PRODUCT_COUNT_CONTROL_ID as Rt } from "./productCount.js";
26
- import { ProductLayoutControl as F } from "./productLayout.js";
27
- import { PRODUCT_LAYOUT_CONTROL_ID as Pt } from "./productLayout.js";
28
- import { ShuffleControl as D } from "./shuffle.js";
29
- import { SHUFFLE_CONTROL_ID as St } from "./shuffle.js";
30
- import { StrategyControl as B } from "./strategy.js";
31
- import { STRATEGY_CONTROL_ID as kt } from "./strategy.js";
32
- import { setCurrencyAttributes as w, getBlockElement as v, isPartnerManagedBlock as A, updateProductContentInPlace as x, regenerateProductRowsWithStyles as U } from "./utils.js";
33
- import { adjustProductsToSize as Et, formatProductPrice as Ft, getCardComposition as Dt, getCurrentLayout as Bt, getMainContainerTbody as wt, regenerateMobileProductRows as vt, updatePricesInPlace as At, updateSingleProductContent as xt } from "./utils.js";
34
- import { useDebounceFn as f } from "../../../../../node_modules/@vueuse/shared/index.js";
35
- const W = "ui-elements-recommendation-block";
36
- class at extends N {
1
+ var k = Object.defineProperty;
2
+ var I = (h, l, e) => l in h ? k(h, l, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[l] = e;
3
+ var s = (h, l, e) => I(h, typeof l != "symbol" ? l + "" : l, e);
4
+ import { useConfig as m } from "../../../../../composables/useConfig.js";
5
+ import { ModificationDescription as C } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
6
+ import { CommonControl as R } from "../../../common-control.js";
7
+ import { RRS_CONFIG_VERSION as b, DEFAULT_NODE_CONFIG as u } from "../../constants/defaultConfig.js";
8
+ import { RECOMMENDATION_ID_ATTR as O } from "../../constants/selectors.js";
9
+ import { RecommendationConfigService as d } from "../../services/configService.js";
10
+ import { useRecommendationExtensionStore as S } from "../../store/recommendation.js";
11
+ import { refreshBlockOutsidePanel as T } from "../../utils/blockRefresh.js";
12
+ import { toCurrencyConfig as B, toCurrencySettings as p } from "../../utils/currencySettings.js";
13
+ import { registerNodeConfigWriter as F, registerPendingConfigFlush as L, stageConfigChange as _, describeConfigChange as N, writeBlockConfigOutsidePanel as U } from "../../utils/nodeConfigWriter.js";
14
+ import { AlgorithmControl as E } from "./algorithm.js";
15
+ import { ALGORITHM_CONTROL_ID as Pe } from "./algorithm.js";
16
+ import { CurrencyControl as D } from "./currency.js";
17
+ import { CURRENCY_CONTROL_ID as Ie } from "./currency.js";
18
+ import { FiltersControl as v } from "./filters.js";
19
+ import { FILTERS_CONTROL_ID as be } from "./filters.js";
20
+ import { LayoutOrientationControl as w } from "./layoutOrientation.js";
21
+ import { LAYOUT_ORIENTATION_CONTROL_ID as Se } from "./layoutOrientation.js";
22
+ import { LocaleControl as A } from "./locale.js";
23
+ import { LOCALE_CONTROL_ID as Be } from "./locale.js";
24
+ import { PricePlacementControl as V } from "./pricePlacement.js";
25
+ import { PRICE_PLACEMENT_CONTROL_ID as Le } from "./pricePlacement.js";
26
+ import { ProductCountControl as x } from "./productCount.js";
27
+ import { PRODUCT_COUNT_CONTROL_ID as Ee } from "./productCount.js";
28
+ import { ProductLayoutControl as W } from "./productLayout.js";
29
+ import { PRODUCT_LAYOUT_CONTROL_ID as ve } from "./productLayout.js";
30
+ import { ShuffleControl as M } from "./shuffle.js";
31
+ import { SHUFFLE_CONTROL_ID as Ae } from "./shuffle.js";
32
+ import { StrategyControl as G } from "./strategy.js";
33
+ import { STRATEGY_CONTROL_ID as xe } from "./strategy.js";
34
+ import { setCurrencyAttributes as z, getBlockElement as $, isPartnerManagedBlock as H, updateProductContentInPlace as Y, regenerateProductRowsWithStyles as j } from "./utils.js";
35
+ import { adjustProductsToSize as Me, formatProductPrice as Ge, getCardComposition as ze, getCurrencyAttributesFromBlock as $e, getCurrentLayout as He, getMainContainerTbody as Ye, regenerateMobileProductRows as je, updatePricesInPlace as qe, updateSingleProductContent as Je } from "./utils.js";
36
+ import { useDebounceFn as y } from "../../../../../node_modules/@vueuse/shared/index.js";
37
+ const q = "ui-elements-recommendation-block";
38
+ class _e extends R {
37
39
  constructor() {
38
40
  super(...arguments);
39
- i(this, "store", R());
40
- i(this, "storeUnsubscription", () => {
41
+ s(this, "store", S());
42
+ s(this, "storeUnsubscription", () => {
43
+ });
44
+ s(this, "unregisterConfigFlush", () => {
41
45
  });
42
46
  // A config change waiting to reach the node config. Deferred so it can ride the
43
47
  // re-render's single apply() — one user action must cost one undo press.
44
- i(this, "pendingNodeConfigWrite", null);
45
- i(this, "pendingConfigFlushTimer", null);
48
+ s(this, "pendingNodeConfigWrite", null);
49
+ s(this, "pendingConfigFlushTimer", null);
50
+ // What the panel still owes the block it watches — finished outside the panel on teardown
51
+ // and block switch. A new generation tells debounced work queued for the old one to stand down.
52
+ s(this, "trackedBlockId", null);
53
+ s(this, "fetchedConfigVersion", 0);
54
+ s(this, "hasUnrenderedProducts", !1);
55
+ s(this, "panelGeneration", 0);
56
+ s(this, "isPanelAlive", !0);
46
57
  // Sub-control instances for lifecycle management
47
- i(this, "algorithmControl", null);
48
- i(this, "localeControl", null);
49
- i(this, "currencyControl", null);
50
- i(this, "productCountControl", null);
51
- i(this, "productLayoutControl", null);
52
- i(this, "filtersControl", null);
53
- i(this, "shuffleControl", null);
54
- i(this, "pricePlacementControl", null);
55
- i(this, "layoutOrientationControl", null);
56
- i(this, "strategyControl", null);
57
- i(this, "rrsEnabled", !1);
58
+ s(this, "algorithmControl", null);
59
+ s(this, "localeControl", null);
60
+ s(this, "currencyControl", null);
61
+ s(this, "productCountControl", null);
62
+ s(this, "productLayoutControl", null);
63
+ s(this, "filtersControl", null);
64
+ s(this, "shuffleControl", null);
65
+ s(this, "pricePlacementControl", null);
66
+ s(this, "layoutOrientationControl", null);
67
+ s(this, "strategyControl", null);
68
+ s(this, "rrsEnabled", !1);
58
69
  /**
59
70
  * Debounced product fetch to prevent rapid API calls during config changes
60
71
  */
61
- i(this, "_debouncedFetchProducts", f(async () => {
72
+ s(this, "_debouncedFetchProducts", y(async (e, t) => {
73
+ if (t !== this.panelGeneration)
74
+ return;
75
+ const o = this._getBlockConfigVersion(e);
62
76
  try {
63
- await this.store.fetchRecommendationProducts();
77
+ await (e === null ? this.store.fetchRecommendationProducts() : this.store.fetchRecommendationProductsForBlock(e)), t === this.panelGeneration && (this.fetchedConfigVersion = Math.max(this.fetchedConfigVersion, o));
64
78
  } finally {
65
- this._scheduleConfigFlush();
79
+ t === this.panelGeneration && this._scheduleConfigFlush();
66
80
  }
67
81
  }, 500));
68
82
  /**
@@ -76,12 +90,12 @@ class at extends N {
76
90
  * count. The store pads products to the configured size, so in-place only
77
91
  * fails when the size actually changed.
78
92
  */
79
- i(this, "_debouncedRegenerateWithProducts", f(() => {
80
- if (!this.currentNode || !this.api)
93
+ s(this, "_debouncedRegenerateWithProducts", y((e) => {
94
+ if (e !== this.panelGeneration || !this.currentNode || !this.api)
81
95
  return;
82
- const t = this._getRecommendationIdFromNode(this.currentNode), e = this.store.currentRecommendationId;
83
- if (t === null || e === null || t === e || !this.store.blockStates[t]) {
84
- this._regenerateWithProducts();
96
+ const t = this._getRecommendationIdFromNode(this.currentNode), o = this.store.currentRecommendationId;
97
+ if (t === null || o === null || t === o || !this.store.blockStates[t]) {
98
+ this.hasUnrenderedProducts = !1, this._regenerateWithProducts();
85
99
  return;
86
100
  }
87
101
  if (this.store.blockStates[t].recommendationProducts.length) {
@@ -89,13 +103,13 @@ class at extends N {
89
103
  try {
90
104
  this._regenerateWithProducts();
91
105
  } finally {
92
- this.store.setCurrentBlock(e);
106
+ this.store.setCurrentBlock(o);
93
107
  }
94
108
  }
95
109
  }, 100));
96
110
  }
97
111
  getId() {
98
- return W;
112
+ return q;
99
113
  }
100
114
  get _subControls() {
101
115
  return [
@@ -112,15 +126,15 @@ class at extends N {
112
126
  ];
113
127
  }
114
128
  getTemplate() {
115
- var t;
116
- return this.rrsEnabled = h().isFeatureEnabled("reusableRecommendationStrategy"), this._subControls.forEach((e) => {
129
+ var e;
130
+ return this.rrsEnabled = m().isFeatureEnabled("reusableRecommendationStrategy"), this._subControls.forEach((t) => {
117
131
  var o;
118
- return (o = e == null ? void 0 : e.onDestroy) == null ? void 0 : o.call(e);
119
- }), this.algorithmControl = new P(), this.localeControl = new k(), this.currencyControl = new T(), this.productCountControl = new E(), this.productLayoutControl = new F(), this.filtersControl = new S(), this.shuffleControl = new D(), this.pricePlacementControl = new L(), this.layoutOrientationControl = new O(), this.strategyControl = this.rrsEnabled ? new B() : null, this._subControls.forEach((e) => {
120
- e && (e.api = this.api);
132
+ return (o = t == null ? void 0 : t.onDestroy) == null ? void 0 : o.call(t);
133
+ }), this.algorithmControl = new E(), this.localeControl = new A(), this.currencyControl = new D(), this.productCountControl = new x(), this.productLayoutControl = new W(), this.filtersControl = new v(), this.shuffleControl = new M(), this.pricePlacementControl = new V(), this.layoutOrientationControl = new w(), this.strategyControl = this.rrsEnabled ? new G() : null, this._subControls.forEach((t) => {
134
+ t && (t.api = this.api);
121
135
  }), `
122
136
  <div class="recommendation-controls-container">
123
- ${((t = this.strategyControl) == null ? void 0 : t.getTemplate()) ?? ""}
137
+ ${((e = this.strategyControl) == null ? void 0 : e.getTemplate()) ?? ""}
124
138
  ${this.layoutOrientationControl.getTemplate()}
125
139
  ${this.productCountControl.getTemplate()}
126
140
  ${this.productLayoutControl.getTemplate()}
@@ -133,39 +147,39 @@ class at extends N {
133
147
  </div>
134
148
  `;
135
149
  }
136
- _showControlsForBlock(t) {
137
- var n;
138
- const e = (n = this.getContainer()) == null ? void 0 : n.querySelector(".recommendation-controls-container");
139
- if (!e)
150
+ _showControlsForBlock(e) {
151
+ var i;
152
+ const t = (i = this.getContainer()) == null ? void 0 : i.querySelector(".recommendation-controls-container");
153
+ if (!t)
140
154
  return;
141
- const o = this._getRecommendationIdFromNode(t) === null ? null : c.getConfig(t), r = this.rrsEnabled && !!o && (!!(o != null && o.strategyId) || ((o == null ? void 0 : o.configVersion) ?? 0) >= _), s = this.rrsEnabled && !!o && !r;
142
- e.classList.toggle("strategy-block", r), e.classList.toggle("legacy-strategy-block", s);
155
+ 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) >= b), r = this.rrsEnabled && !!o && !n;
156
+ t.classList.toggle("strategy-block", n), t.classList.toggle("legacy-strategy-block", r);
143
157
  }
144
158
  async onRender() {
145
159
  var o;
146
- b(this.api);
147
- const t = this._getRecommendationIdFromNode(this.currentNode), e = t ?? this.store.currentRecommendationId;
148
- if (e !== null && this.store.setCurrentBlock(e), t !== null && this._syncNodeConfigIfChanged(t), this._listenStateUpdates(), this._showControlsForBlock(this.currentNode), t !== null && this.strategyControl && (this.strategyControl.api = this.api, this.strategyControl.currentNode = this.currentNode, this.strategyControl.onRender()), e !== null && ((o = this.store.blockStates[e]) != null && o.isInitialized)) {
160
+ F(this.api), this.unregisterConfigFlush(), this.unregisterConfigFlush = L(() => this._flushPendingNodeConfig());
161
+ const e = this._getRecommendationIdFromNode(this.currentNode), t = e ?? this.store.currentRecommendationId;
162
+ if (t !== null && this.store.setCurrentBlock(t), e !== null && this._syncNodeConfigIfChanged(e), this._listenStateUpdates(), this._showControlsForBlock(this.currentNode), e !== null && this.strategyControl && (this.strategyControl.api = this.api, this.strategyControl.currentNode = this.currentNode, this.strategyControl.onRender()), t !== null && ((o = this.store.blockStates[t]) != null && o.isInitialized)) {
149
163
  this._initializeSubControls();
150
164
  return;
151
165
  }
152
- await this._fetchBlockData(e), this._initializeSubControls();
166
+ await this._fetchBlockData(t), this._initializeSubControls();
153
167
  }
154
- onTemplateNodeUpdated(t) {
168
+ onTemplateNodeUpdated(e) {
155
169
  var o;
156
- super.onTemplateNodeUpdated(t);
157
- const e = this._getRecommendationIdFromNode(t);
158
- e !== null && e !== this.store.currentRecommendationId && this.store.setCurrentBlock(e), e !== null && this._syncNodeConfigIfChanged(e), this._showControlsForBlock(t), e !== null && !((o = this.store.blockStates[e]) != null && o.isInitialized) && this._fetchBlockData(e).then(() => {
170
+ super.onTemplateNodeUpdated(e);
171
+ const t = this._getRecommendationIdFromNode(e);
172
+ 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(() => {
159
173
  this._initializeSubControls();
160
- }), this._subControls.forEach((r) => {
161
- var s;
162
- r != null && r.api && (r.currentNode = t, (s = r.onTemplateNodeUpdated) == null || s.call(r, t));
174
+ }), this._subControls.forEach((n) => {
175
+ var r;
176
+ n != null && n.api && (n.currentNode = e, (r = n.onTemplateNodeUpdated) == null || r.call(n, e));
163
177
  });
164
178
  }
165
179
  onDestroy() {
166
- this.storeUnsubscription(), this._flushPendingNodeConfig(), this._subControls.forEach((t) => {
167
- var e;
168
- return (e = t == null ? void 0 : t.onDestroy) == null ? void 0 : e.call(t);
180
+ this.panelGeneration++, this.isPanelAlive = !1, this.storeUnsubscription(), this._finishBlockOutsidePanel(), this.hasUnrenderedProducts = !1, this.unregisterConfigFlush(), this._subControls.forEach((e) => {
181
+ var t;
182
+ return (t = e == null ? void 0 : e.onDestroy) == null ? void 0 : t.call(e);
169
183
  });
170
184
  }
171
185
  /**
@@ -173,9 +187,9 @@ class at extends N {
173
187
  * Each sub-control manages its own form values and event listeners
174
188
  */
175
189
  _initializeSubControls() {
176
- this._subControls.forEach((t) => {
177
- var e;
178
- t && (t.api = this.api, t.currentNode = this.currentNode, (e = t.onRender) == null || e.call(t));
190
+ this._subControls.forEach((e) => {
191
+ var t;
192
+ e && (e.api = this.api, e.currentNode = this.currentNode, (t = e.onRender) == null || t.call(e));
179
193
  });
180
194
  }
181
195
  /**
@@ -202,50 +216,72 @@ class at extends N {
202
216
  * that state and made a re-dropped saved module keep the defaults its wiped
203
217
  * state was rebuilt with (SD-150347).
204
218
  */
205
- _syncNodeConfigIfChanged(t) {
206
- this.pendingNodeConfigWrite && this.pendingNodeConfigWrite.blockId !== t && this._flushPendingNodeConfig();
207
- const e = this.store.blockStates[t];
208
- if (!e)
219
+ _syncNodeConfigIfChanged(e) {
220
+ var r;
221
+ this.pendingNodeConfigWrite && this.pendingNodeConfigWrite.blockId !== e && this._flushPendingNodeConfig();
222
+ const t = this.store.blockStates[e];
223
+ if (!t)
209
224
  return;
210
- const o = JSON.stringify(c.getConfig(this.currentNode)), r = e.syncedConfigFingerprint;
211
- e.syncedConfigFingerprint = o, r !== o && (this.pendingNodeConfigWrite || this._syncNodeConfigToStore());
225
+ const o = JSON.stringify(d.getConfig(this.currentNode)), n = t.syncedConfigFingerprint;
226
+ t.syncedConfigFingerprint = o, n !== o && ((r = this.pendingNodeConfigWrite) == null ? void 0 : r.blockId) !== e && this._syncNodeConfigToStore();
212
227
  }
213
228
  /** Whether the deferred write would move the node's strategyId — see the caller (SD-149916). */
214
229
  _isPendingStrategyIdChange() {
215
- const t = this.pendingNodeConfigWrite;
216
- return t ? c.getConfig(this.currentNode).strategyId !== t.updates.strategyId : !1;
230
+ const e = this._pendingUpdates();
231
+ return e !== null && d.getConfig(this.currentNode).strategyId !== e.strategyId;
217
232
  }
218
233
  _capturePendingNodeConfigWrite() {
219
- const t = this.store.currentRecommendationId;
220
- if (!this.currentNode || !this.api || t === null)
221
- return;
222
- const { filters: e, strategy: o, strategyId: r, size: s, nodeConfigVersion: n } = this.store.recommendationConfigs, { partnerName: l } = h();
223
- this.pendingNodeConfigWrite = {
224
- blockId: t,
225
- node: this.currentNode,
226
- updates: {
227
- filters: e,
228
- strategy: o,
229
- strategyId: r,
230
- size: s,
231
- configVersion: n,
232
- ...l.value ? { partnerName: l.value } : {}
233
- }
234
+ const e = this.store.currentRecommendationId;
235
+ !this.currentNode || !this.api || e === null || !this.store.blockStates[e] || (this.pendingNodeConfigWrite = { blockId: e });
236
+ }
237
+ // Read at write time, not at capture: a display-only edit (currency symbol) patches the store
238
+ // without a version bump while the write waits, and a snapshot would stage the older value over it.
239
+ _pendingUpdates() {
240
+ const e = this.pendingNodeConfigWrite, t = e ? this.store.blockStates[e.blockId] : void 0;
241
+ return t ? this._getNodeConfigUpdates(t.recommendationConfigs) : null;
242
+ }
243
+ // Another block's pending write must never be staged on, or drive the redraw of, the panel node.
244
+ _pendingUpdatesForCurrentNode() {
245
+ var e;
246
+ return !this.currentNode || ((e = this.pendingNodeConfigWrite) == null ? void 0 : e.blockId) !== this._getRecommendationIdFromNode(this.currentNode) ? null : this._pendingUpdates();
247
+ }
248
+ _getNodeConfigUpdates(e) {
249
+ const {
250
+ filters: t,
251
+ strategy: o,
252
+ strategyId: n,
253
+ size: r,
254
+ productIds: i,
255
+ language: a,
256
+ shuffleProducts: c,
257
+ currencySettings: g,
258
+ nodeConfigVersion: P
259
+ } = e, { partnerName: f } = m();
260
+ return {
261
+ filters: t,
262
+ strategy: o,
263
+ strategyId: n,
264
+ size: r,
265
+ productIds: i,
266
+ language: a,
267
+ shuffleProducts: c,
268
+ currency: B(g),
269
+ configVersion: P,
270
+ ...f.value ? { partnerName: f.value } : {}
234
271
  };
235
272
  }
236
273
  /**
237
274
  * Accumulates the pending write into `documentModifier` without applying, so the
238
275
  * caller's apply() commits config and re-render as ONE undo entry.
239
- *
240
- * Deliberately does not consume the pending record: the product helpers call
241
- * apply() only when they actually changed something, so this batch may never be
242
- * committed and the flush has to stay able to write it standalone.
243
- * @param documentModifier - The batch to accumulate into
244
- * @returns Whether anything was staged
276
+ * @returns the undo label, null when only stamps moved; undefined when nothing was staged
245
277
  */
246
- _stagePendingNodeConfig(t) {
247
- const e = this.pendingNodeConfigWrite;
248
- return !e || !this.currentNode ? !1 : (c.stageConfig(t, this.currentNode, e.updates), !0);
278
+ _stagePendingNodeConfig(e) {
279
+ const t = this._pendingUpdatesForCurrentNode();
280
+ if (!(!t || !this.currentNode))
281
+ return _(e, this.currentNode, t), N(d.getConfig(this.currentNode), t);
282
+ }
283
+ _consumePendingNodeConfig() {
284
+ this.pendingNodeConfigWrite = null, this._clearConfigFlush();
249
285
  }
250
286
  /**
251
287
  * Arms the guaranteed fallback write, once the product fetch has settled. The
@@ -260,48 +296,44 @@ class at extends N {
260
296
  _clearConfigFlush() {
261
297
  this.pendingConfigFlushTimer !== null && (clearTimeout(this.pendingConfigFlushTimer), this.pendingConfigFlushTimer = null);
262
298
  }
263
- /**
264
- * Writes the deferred change standalone when the batch it was staged into never
265
- * committed. Always targets the LIVE node — the captured one is an immutable
266
- * snapshot the intervening re-render staled, and saveConfig swallows that failure.
267
- */
299
+ // Writes the deferred change standalone when its batch never committed. Targets a LIVE node:
300
+ // a captured one is a snapshot the intervening re-render staled, and saveConfig swallows that.
268
301
  _flushPendingNodeConfig() {
269
- const t = this.pendingNodeConfigWrite;
270
- if (this.pendingNodeConfigWrite = null, this._clearConfigFlush(), !t || !this.api)
271
- return;
272
- const e = t.blockId === this.store.currentRecommendationId && this.currentNode ? this.currentNode : t.node, o = c.getConfig(e);
273
- JSON.stringify(o.filters) === JSON.stringify(t.updates.filters) && o.strategy === t.updates.strategy && o.strategyId === t.updates.strategyId && o.size === t.updates.size || c.updateConfig(this.api, e, t.updates, "Update recommendation filters");
302
+ const e = this.pendingNodeConfigWrite, t = this._pendingUpdates();
303
+ if (this._consumePendingNodeConfig(), !e || !t || !this.api)
304
+ return !1;
305
+ if (!(e.blockId === this.store.currentRecommendationId && e.blockId === this._getRecommendationIdFromNode(this.currentNode)) || !this.currentNode) {
306
+ const { blockId: i } = e, a = U(i, t);
307
+ return a === "missing" && this.store.blockStates[i] && console.error("[recommendation] pending config write did not reach a node", { blockId: i }), a === "applied";
308
+ }
309
+ const n = N(d.getConfig(this.currentNode), t);
310
+ if (n === null)
311
+ return !1;
312
+ const r = this.api.getDocumentModifier();
313
+ return _(r, this.currentNode, t), r.apply(new C(n)), !0;
274
314
  }
275
315
  _syncNodeConfigToStore() {
276
- var r;
277
- const t = c.getConfig(this.currentNode), e = this.store.currentRecommendationId, o = e !== null && ((r = this.store.blockStates[e]) == null ? void 0 : r.isInitialized);
316
+ var n;
317
+ const e = d.getConfig(this.currentNode), t = this.store.currentRecommendationId, o = t !== null && ((n = this.store.blockStates[t]) == null ? void 0 : n.isInitialized);
278
318
  this.store.patchCurrentBlockConfig({
279
- strategy: t.strategy,
280
- strategyId: t.strategyId,
281
- nodeConfigVersion: t.configVersion,
282
- language: t.language,
283
- size: t.size,
284
- productIds: t.productIds,
285
- cardsInRow: t.cardsInRow,
286
- mobileCardsInRow: t.mobileCardsInRow,
287
- mobileLayoutEnabled: t.mobileLayoutEnabled,
288
- orientation: t.layout,
319
+ strategy: e.strategy,
320
+ strategyId: e.strategyId,
321
+ nodeConfigVersion: e.configVersion,
322
+ language: e.language,
323
+ size: e.size,
324
+ productIds: e.productIds,
325
+ cardsInRow: e.cardsInRow,
326
+ mobileCardsInRow: e.mobileCardsInRow,
327
+ mobileLayoutEnabled: e.mobileLayoutEnabled,
328
+ orientation: e.layout,
289
329
  // Only sync filters from node config during initial load.
290
330
  // After initialization, the Pinia store is the source of truth
291
331
  // for filters (edited via the filter drawer).
292
- ...o ? {} : { filters: t.filters },
293
- shuffleProducts: t.shuffleProducts,
294
- priceMovedToNextLine: t.priceMovedToNextLine,
295
- priceHideIfSameAsDiscounted: t.priceHideIfSameAsDiscounted,
296
- currencySettings: {
297
- name: t.currency.code,
298
- value: t.currency.code,
299
- symbol: t.currency.symbol,
300
- alignment: t.currency.alignment === "before" ? "0" : "1",
301
- decimalCount: t.currency.decimalCount.toString(),
302
- decimalSeparator: t.currency.decimalSeparator,
303
- thousandSeparator: t.currency.thousandSeparator
304
- }
332
+ ...o ? {} : { filters: e.filters },
333
+ shuffleProducts: e.shuffleProducts,
334
+ priceMovedToNextLine: e.priceMovedToNextLine,
335
+ priceHideIfSameAsDiscounted: e.priceHideIfSameAsDiscounted,
336
+ currencySettings: p(e.currency)
305
337
  }, { triggerRefetch: !1 });
306
338
  }
307
339
  /**
@@ -313,18 +345,27 @@ class at extends N {
313
345
  * Shared by onRender() and onTemplateNodeUpdated() to avoid duplication.
314
346
  * Marks the block as initialized to prevent redundant fetches on re-selection.
315
347
  */
316
- async _fetchBlockData(t) {
317
- t !== null && this.store.markBlockInitialized(t), (await Promise.allSettled([
348
+ async _fetchBlockData(e) {
349
+ if (e !== null && this.store.markBlockInitialized(e), (await Promise.allSettled([
318
350
  this.store.fetchRecommendationCreateData(),
319
351
  this.store.fetchRecommendationFilters()
320
- ])).forEach((o, r) => {
321
- o.status === "rejected" && console.warn(`Recommendation block: ${["fetchRecommendationCreateData", "fetchRecommendationFilters"][r]} failed`, o.reason);
322
- }), this._applySmartDefaults();
352
+ ])).forEach((n, r) => {
353
+ n.status === "rejected" && console.warn(`Recommendation block: ${["fetchRecommendationCreateData", "fetchRecommendationFilters"][r]} failed`, n.reason);
354
+ }), e !== null && this.store.currentRecommendationId !== e) {
355
+ this._refreshOutsidePanel(e, !0);
356
+ return;
357
+ }
358
+ this._applySmartDefaults();
359
+ const o = this._getBlockConfigVersion(e);
323
360
  try {
324
361
  await this.store.fetchRecommendationProducts();
325
- } catch (o) {
326
- console.warn("Recommendation block: fetchRecommendationProducts failed", o);
362
+ } catch (n) {
363
+ console.warn("Recommendation block: fetchRecommendationProducts failed", n);
327
364
  }
365
+ e !== null && !this._isPanelOn(e) && this._refreshOutsidePanel(e, this._getBlockConfigVersion(e) !== o);
366
+ }
367
+ _isPanelOn(e) {
368
+ return this.isPanelAlive && this.store.currentRecommendationId === e;
328
369
  }
329
370
  /**
330
371
  * Applies smart defaults for newly dropped blocks.
@@ -339,91 +380,133 @@ class at extends N {
339
380
  _applySmartDefaults() {
340
381
  if (!this.currentNode || !this.api)
341
382
  return;
342
- const t = c.getConfig(this.currentNode), e = {};
343
- let o = null, r = null, s = null;
344
- if (t.currency.code === a.currency.code) {
345
- const { currencyList: n } = this.store;
346
- n.length > 0 && (n.some(
347
- (d) => d.value === `price.${a.currency.code}`
348
- ) || (o = n[0].value.replace("price.", ""), e.currency = {
349
- ...a.currency,
383
+ const e = d.getConfig(this.currentNode), t = {};
384
+ let o = null, n = null, r = null;
385
+ if (e.currency.code === u.currency.code) {
386
+ const { currencyList: i } = this.store;
387
+ i.length > 0 && (i.some(
388
+ (c) => c.value === `price.${u.currency.code}`
389
+ ) || (o = i[0].value.replace("price.", ""), t.currency = {
390
+ ...u.currency,
350
391
  code: o,
351
392
  symbol: o
352
393
  }));
353
394
  }
354
- if (t.strategy === a.strategy) {
355
- const n = this.store.getActivePredictiveAlgorithms;
356
- n.length > 0 && (n.some(
357
- (d) => d.value === a.strategy
358
- ) || (r = n[0].value, e.strategy = r));
395
+ if (e.strategy === u.strategy) {
396
+ const i = this.store.getActivePredictiveAlgorithms;
397
+ i.length > 0 && (i.some(
398
+ (c) => c.value === u.strategy
399
+ ) || (n = i[0].value, t.strategy = n));
359
400
  }
360
- if (t.language === a.language) {
361
- const n = this.store.getLanguages;
362
- n.length > 0 && (n.some(
363
- (d) => d.value === a.language
364
- ) || (s = n[0].value, e.language = s));
401
+ if (e.language === u.language) {
402
+ const i = this.store.getLanguages;
403
+ i.length > 0 && (i.some(
404
+ (c) => c.value === u.language
405
+ ) || (r = i[0].value, t.language = r));
365
406
  }
366
- !o && !r && !s || (c.updateConfig(
407
+ !o && !n && !r || (d.updateConfig(
367
408
  this.api,
368
409
  this.currentNode,
369
- e,
410
+ t,
370
411
  "Applied smart defaults"
371
- ), o && e.currency && w({
412
+ ), o && t.currency && z({
372
413
  currentNode: this.currentNode,
373
414
  documentModifier: this.api.getDocumentModifier(),
374
- currency: e.currency
415
+ currency: t.currency
375
416
  }), this.store.patchCurrentBlockConfig({
376
- ...o ? {
377
- currencySettings: {
378
- name: o,
379
- value: o,
380
- symbol: o,
381
- alignment: a.currency.alignment === "before" ? "0" : "1",
382
- decimalCount: a.currency.decimalCount.toString(),
383
- decimalSeparator: a.currency.decimalSeparator,
384
- thousandSeparator: a.currency.thousandSeparator
385
- }
386
- } : {},
387
- ...r ? { strategy: r } : {},
388
- ...s ? { language: s } : {}
417
+ ...o && t.currency ? { currencySettings: p(t.currency) } : {},
418
+ ...n ? { strategy: n } : {},
419
+ ...r ? { language: r } : {}
389
420
  }, { triggerRefetch: !1 }));
390
421
  }
391
422
  /**
392
423
  * Reads the recommendation-id attribute from the block element within the node
393
424
  */
394
- _getRecommendationIdFromNode(t) {
395
- const e = v(t);
396
- if (!e || !("getAttribute" in e))
425
+ _getRecommendationIdFromNode(e) {
426
+ const t = $(e);
427
+ if (!t || !("getAttribute" in t))
397
428
  return null;
398
- const o = e.getAttribute(I);
429
+ const o = t.getAttribute(O);
399
430
  if (!o)
400
431
  return null;
401
- const r = parseInt(o);
402
- return Number.isNaN(r) ? null : r;
432
+ const n = parseInt(o);
433
+ return Number.isNaN(n) ? null : n;
434
+ }
435
+ /**
436
+ * Lands what the panel still owes its block before it stops watching it: the config now, the
437
+ * products through a block-scoped refresh. Never throws — it runs from Stripo's teardown.
438
+ */
439
+ _finishBlockOutsidePanel(e = this._trackedBlockSnapshot()) {
440
+ var r;
441
+ const { blockId: t, fetchedConfigVersion: o, hasUnrenderedProducts: n } = e;
442
+ try {
443
+ const i = t === null ? void 0 : this.store.blockStates[t], a = i !== void 0 && o !== i.configVersion;
444
+ if (t !== null && i && (a || n)) {
445
+ ((r = this.pendingNodeConfigWrite) == null ? void 0 : r.blockId) === t && this._consumePendingNodeConfig(), this._flushPendingNodeConfig(), this._refreshOutsidePanel(t, a);
446
+ return;
447
+ }
448
+ this._flushPendingNodeConfig();
449
+ } catch (i) {
450
+ console.error("[recommendation] finishing the block outside the panel failed", i);
451
+ }
452
+ }
453
+ _trackedBlockSnapshot() {
454
+ return {
455
+ blockId: this.trackedBlockId,
456
+ fetchedConfigVersion: this.fetchedConfigVersion,
457
+ hasUnrenderedProducts: this.hasUnrenderedProducts
458
+ };
459
+ }
460
+ _refreshOutsidePanel(e, t) {
461
+ T(e, {
462
+ pickUpdates: (o) => this._getNodeConfigUpdates(o),
463
+ description: "Update recommendation configuration",
464
+ fetch: t
465
+ }).then((o) => {
466
+ !o && this.store.blockStates[e] && console.error("[recommendation] refresh outside the panel did not reach a node", { blockId: e });
467
+ }).catch((o) => {
468
+ console.error("[recommendation] refresh outside the panel failed", o);
469
+ });
470
+ }
471
+ _getBlockConfigVersion(e) {
472
+ var t;
473
+ return e === null ? 0 : ((t = this.store.blockStates[e]) == null ? void 0 : t.configVersion) ?? 0;
403
474
  }
404
475
  /** Draws the current block's products into this panel's node. */
405
476
  _regenerateWithProducts() {
406
477
  if (!this.currentNode || !this.api)
407
478
  return;
408
- const t = this.store.recommendationProducts, e = this.api.getDocumentModifier(), o = this._stagePendingNodeConfig(e);
409
- if (A(this.currentNode)) {
410
- o && (e.apply(new y("Update recommendation configuration")), this.pendingNodeConfigWrite = null, this._clearConfigFlush());
479
+ const { currentNode: e } = this, t = this.store.recommendationProducts, o = this.api.getDocumentModifier(), n = this._pendingUpdatesForCurrentNode() ?? void 0, r = this._stagePendingNodeConfig(o), i = (g) => {
480
+ (r || g) && o.apply(
481
+ new C(r ?? "Updated recommendation products")
482
+ ), r !== void 0 && this._consumePendingNodeConfig();
483
+ };
484
+ if (H(e)) {
485
+ i(!1);
411
486
  return;
412
487
  }
413
- x({
414
- currentNode: this.currentNode,
415
- documentModifier: e,
416
- products: t
417
- }) || U({
418
- currentNode: this.currentNode,
419
- documentModifier: e,
420
- products: t
421
- });
488
+ let a = !1;
489
+ Y({
490
+ currentNode: e,
491
+ documentModifier: o,
492
+ products: t,
493
+ stageOnly: !0,
494
+ configOverrides: n,
495
+ onChanged: () => {
496
+ a = !0;
497
+ }
498
+ }) || (a = j({
499
+ currentNode: e,
500
+ documentModifier: o,
501
+ products: t,
502
+ stageOnly: !0,
503
+ configOverrides: n
504
+ })), i(a);
422
505
  }
423
506
  /**
424
507
  * Listen to store changes that require product refresh or regeneration.
425
508
  *
426
- * Uses configVersion counter (incremented only by patchCurrentBlockConfig)
509
+ * Uses the block's configVersion counter (bumped by patchCurrentBlockConfig and legacy conversion)
427
510
  * to distinguish user-initiated config changes from internal mutations
428
511
  * (e.g., fetchRecommendationCreateData setting preferred currency).
429
512
  *
@@ -434,55 +517,57 @@ class at extends N {
434
517
  * We skip that tick and update tracking references instead.
435
518
  */
436
519
  _listenStateUpdates() {
437
- const { store: t } = this;
438
- let e = t.recommendationProducts, o = t.$state.configVersion, r = t.currentRecommendationId;
439
- this.storeUnsubscription = t.$subscribe(() => {
440
- const s = t.currentRecommendationId;
441
- if (s !== r) {
442
- r = s, e = t.recommendationProducts, o = t.$state.configVersion;
520
+ const { store: e } = this;
521
+ let t = e.recommendationProducts, o = this._getBlockConfigVersion(e.currentRecommendationId);
522
+ this.panelGeneration++, this.isPanelAlive = !0, this.trackedBlockId = e.currentRecommendationId, this.fetchedConfigVersion = o, this.hasUnrenderedProducts = !1, this.storeUnsubscription = e.$subscribe(() => {
523
+ const n = e.currentRecommendationId;
524
+ if (n !== this.trackedBlockId) {
525
+ const g = this._trackedBlockSnapshot();
526
+ this.panelGeneration++, this.trackedBlockId = n, t = e.recommendationProducts, o = this._getBlockConfigVersion(n), this.fetchedConfigVersion = o, this.hasUnrenderedProducts = !1, this._finishBlockOutsidePanel(g);
443
527
  return;
444
528
  }
445
- const n = t.$state.configVersion;
446
- n !== o && (o = n, this._capturePendingNodeConfigWrite(), this._isPendingStrategyIdChange() && this._flushPendingNodeConfig(), this._debouncedFetchProducts());
447
- const l = t.recommendationProducts, d = l !== e, m = Array.isArray(l) && l.length > 0;
448
- d && m && (e = l, this._debouncedRegenerateWithProducts());
529
+ const r = this._getBlockConfigVersion(n);
530
+ r !== o && (o = r, this._capturePendingNodeConfigWrite(), this._isPendingStrategyIdChange() && this._flushPendingNodeConfig(), this._debouncedFetchProducts(n, this.panelGeneration));
531
+ const i = e.recommendationProducts, a = i !== t, c = Array.isArray(i) && i.length > 0;
532
+ a && c && (t = i, this.hasUnrenderedProducts = !0, this._debouncedRegenerateWithProducts(this.panelGeneration));
449
533
  });
450
534
  }
451
535
  }
452
536
  export {
453
- ut as ALGORITHM_CONTROL_ID,
454
- P as AlgorithmControl,
455
- W as CONTROL_BLOCK_ID,
456
- gt as CURRENCY_CONTROL_ID,
457
- T as CurrencyControl,
458
- ft as FILTERS_CONTROL_ID,
459
- S as FiltersControl,
460
- Ct as LAYOUT_ORIENTATION_CONTROL_ID,
461
- yt as LOCALE_CONTROL_ID,
462
- O as LayoutOrientationControl,
463
- k as LocaleControl,
464
- _t as PRICE_PLACEMENT_CONTROL_ID,
465
- Rt as PRODUCT_COUNT_CONTROL_ID,
466
- Pt as PRODUCT_LAYOUT_CONTROL_ID,
467
- L as PricePlacementControl,
468
- E as ProductCountControl,
469
- F as ProductLayoutControl,
470
- at as RecommendationBlockControl,
471
- St as SHUFFLE_CONTROL_ID,
472
- kt as STRATEGY_CONTROL_ID,
473
- D as ShuffleControl,
474
- B as StrategyControl,
475
- Et as adjustProductsToSize,
476
- Ft as formatProductPrice,
477
- v as getBlockElement,
478
- Dt as getCardComposition,
479
- Bt as getCurrentLayout,
480
- wt as getMainContainerTbody,
481
- A as isPartnerManagedBlock,
482
- vt as regenerateMobileProductRows,
483
- U as regenerateProductRowsWithStyles,
484
- w as setCurrencyAttributes,
485
- At as updatePricesInPlace,
486
- x as updateProductContentInPlace,
487
- xt as updateSingleProductContent
537
+ Pe as ALGORITHM_CONTROL_ID,
538
+ E as AlgorithmControl,
539
+ q as CONTROL_BLOCK_ID,
540
+ Ie as CURRENCY_CONTROL_ID,
541
+ D as CurrencyControl,
542
+ be as FILTERS_CONTROL_ID,
543
+ v as FiltersControl,
544
+ Se as LAYOUT_ORIENTATION_CONTROL_ID,
545
+ Be as LOCALE_CONTROL_ID,
546
+ w as LayoutOrientationControl,
547
+ A as LocaleControl,
548
+ Le as PRICE_PLACEMENT_CONTROL_ID,
549
+ Ee as PRODUCT_COUNT_CONTROL_ID,
550
+ ve as PRODUCT_LAYOUT_CONTROL_ID,
551
+ V as PricePlacementControl,
552
+ x as ProductCountControl,
553
+ W as ProductLayoutControl,
554
+ _e as RecommendationBlockControl,
555
+ Ae as SHUFFLE_CONTROL_ID,
556
+ xe as STRATEGY_CONTROL_ID,
557
+ M as ShuffleControl,
558
+ G as StrategyControl,
559
+ Me as adjustProductsToSize,
560
+ Ge as formatProductPrice,
561
+ $ as getBlockElement,
562
+ ze as getCardComposition,
563
+ $e as getCurrencyAttributesFromBlock,
564
+ He as getCurrentLayout,
565
+ Ye as getMainContainerTbody,
566
+ H as isPartnerManagedBlock,
567
+ je as regenerateMobileProductRows,
568
+ j as regenerateProductRowsWithStyles,
569
+ z as setCurrencyAttributes,
570
+ qe as updatePricesInPlace,
571
+ Y as updateProductContentInPlace,
572
+ Je as updateSingleProductContent
488
573
  };