@useinsider/guido 3.7.2-beta.1e8f93e → 3.7.2-beta.2220fb0

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 (47) hide show
  1. package/dist/@types/config/schemas.js +70 -66
  2. package/dist/composables/usePreviewMode.js +15 -14
  3. package/dist/composables/useRecommendationPreview.js +100 -0
  4. package/dist/config/compiler/recommendationCompilerRules.js +1 -1
  5. package/dist/config/compiler/utils/recommendationCompilerUtils.js +90 -82
  6. package/dist/config/migrator/recommendation/htmlBuilder.js +59 -58
  7. package/dist/config/migrator/recommendation/settingsMapper.js +38 -33
  8. package/dist/extensions/Blocks/Items/block.js +29 -48
  9. package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +45 -62
  10. package/dist/extensions/Blocks/Recommendation/block.js +60 -41
  11. package/dist/extensions/Blocks/Recommendation/canvasPreview.css.js +16 -0
  12. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +41 -32
  13. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +369 -288
  14. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +96 -84
  15. package/dist/extensions/Blocks/Recommendation/controls/main/pricePlacement.js +133 -0
  16. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +83 -81
  17. package/dist/extensions/Blocks/Recommendation/extension.js +30 -29
  18. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +21 -7
  19. package/dist/extensions/Blocks/Recommendation/recommendation.css.js +64 -4
  20. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +7 -5
  21. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +109 -78
  22. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +31 -30
  23. package/dist/extensions/Blocks/Recommendation/templates/index.js +9 -7
  24. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +78 -61
  25. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +21 -21
  26. package/dist/extensions/Blocks/Recommendation/templates/utils.js +90 -55
  27. package/dist/src/@types/config/schemas.d.ts +16 -0
  28. package/dist/src/composables/useConfig.d.ts +4 -0
  29. package/dist/src/composables/useRecommendationPreview.d.ts +10 -0
  30. package/dist/src/config/migrator/recommendation/settingsMapper.d.ts +1 -1
  31. package/dist/src/extensions/Blocks/Items/block.d.ts +0 -8
  32. package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +1 -1
  33. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +10 -0
  34. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +29 -3
  35. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -1
  36. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +3 -1
  37. package/dist/src/extensions/Blocks/Recommendation/controls/main/pricePlacement.d.ts +59 -0
  38. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +2 -0
  39. package/dist/src/extensions/Blocks/Recommendation/templates/grid/elementRenderer.d.ts +16 -0
  40. package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
  41. package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +1 -1
  42. package/dist/src/extensions/Blocks/Recommendation/templates/list/elementRenderer.d.ts +13 -0
  43. package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -2
  44. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +39 -1
  45. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +15 -0
  46. package/dist/src/stores/config.d.ts +36 -0
  47. package/package.json +1 -1
@@ -3,10 +3,10 @@ import { useRecommendationApi as y } from "../../../../services/recommendationAp
3
3
  import { useConfigStore as G } from "../../../../stores/config.js";
4
4
  import { defineStore as P } from "pinia";
5
5
  import { DEFAULT_MOBILE_CARDS_IN_ROW as D, DEFAULT_CARDS_IN_ROW as F } from "../constants/layout.js";
6
- import { EXCLUDED_ALGORITHM_IDS as w } from "../constants/defaultConfig.js";
6
+ import { EXCLUDED_ALGORITHM_IDS as v } from "../constants/defaultConfig.js";
7
7
  import { getDefaultProducts as S } from "../templates/utils.js";
8
8
  import { generateCompleteFilterQuery as b } from "../utils/filterUtil.js";
9
- import { getPartnerRecommendationParams as v } from "../utils/partnerCustomizations.js";
9
+ import { getPartnerRecommendationParams as w } from "../utils/partnerCustomizations.js";
10
10
  import { isFilterValid as N } from "../validation/filterSchema.js";
11
11
  import { isConfigValid as x } from "../validation/requiredFields.js";
12
12
  const h = y();
@@ -37,7 +37,9 @@ function k() {
37
37
  textTrimming: !0,
38
38
  unresponsive: !1,
39
39
  size: "6",
40
- customAttributes: []
40
+ customAttributes: [],
41
+ priceMovedToNextLine: !0,
42
+ priceHideIfSameAsDiscounted: !1
41
43
  };
42
44
  }
43
45
  function I() {
@@ -117,7 +119,7 @@ const L = () => ({
117
119
  },
118
120
  getActivePredictiveAlgorithms: (t) => {
119
121
  const e = g(), r = [];
120
- return t.activePredictiveAlgorithms.filter((n) => !w.includes(n)).forEach((n) => {
122
+ return t.activePredictiveAlgorithms.filter((n) => !v.includes(n)).forEach((n) => {
121
123
  r.push(...e.filter((c) => c.id === n));
122
124
  }), r.map((n) => ({
123
125
  text: n.name,
@@ -457,7 +459,7 @@ const L = () => ({
457
459
  };
458
460
  r.strategy === "manualMerchandising" ? a.productId = r.productIds.join(",") : r.strategy === "similarViewed" && (a.productId = "{itemId}"), r.strategy === "userBased" && (a.userId = "{user_id}"), c && (a.filter = c), r.shuffleProducts && (a.shuffle = !0), Object.assign(
459
461
  a,
460
- v(o.partnerName, r.strategy)
462
+ w(o.partnerName, r.strategy)
461
463
  );
462
464
  let f;
463
465
  try {
@@ -1,33 +1,60 @@
1
1
  import { RecommendationBlockId as l } from "../../constants/blockIds.js";
2
- import { ATTR_PRODUCT_ATTR as u, CSS_CLASS_RECO_BUTTON as p, ATTR_PRODUCT_BUTTON as m, ATTR_PRODUCT_OMNIBUS_DISCOUNT as h, ATTR_PRODUCT_OMNIBUS_PRICE as y, ATTR_PRODUCT_OLD_PRICE as T, ATTR_PRODUCT_PRICE as f, ATTR_PRODUCT_NAME as $, ATTR_PRODUCT_IMAGE as _ } from "../../constants/selectors.js";
3
- import { useRecommendationExtensionStore as x } from "../../store/recommendation.js";
4
- import { formatPrice as C } from "../../utils/priceFormatter.js";
5
- import { CUSTOM_CELL_HTML as R, sanitizeImageUrl as O } from "../utils.js";
6
- const s = "0 5px", a = "attribute-cell";
7
- function S(t, e = s) {
8
- return `<td class="${a}" style="padding: ${e};" width="${t}%"></td>`;
2
+ import { ATTR_PRODUCT_ATTR as u, CSS_CLASS_RECO_BUTTON as g, ATTR_PRODUCT_BUTTON as h, ATTR_PRODUCT_OMNIBUS_DISCOUNT as $, ATTR_PRODUCT_OMNIBUS_PRICE as y, ATTR_PRODUCT_OLD_PRICE as m, ATTR_PRODUCT_PRICE as T, ATTR_PRODUCT_NAME as x, ATTR_PRODUCT_IMAGE as f } from "../../constants/selectors.js";
3
+ import { formatProductPrice as o, isSamePrice as b, CUSTOM_CELL_HTML as _, getCurrentCurrencyConfig as C, sanitizeImageUrl as R } from "../utils.js";
4
+ const s = "0 5px", d = "attribute-cell";
5
+ function U(e, t = s) {
6
+ return `<td class="${d}" style="padding: ${t};" width="${e}%"></td>`;
9
7
  }
10
- function g() {
11
- const t = x(), { currencySettings: e } = t.recommendationConfigs;
12
- return {
13
- code: e.value,
14
- symbol: e.symbol,
15
- alignment: e.alignment === "0" ? "before" : "after",
16
- decimalCount: parseInt(e.decimalCount) || 2,
17
- decimalSeparator: e.decimalSeparator,
18
- thousandSeparator: e.thousandSeparator
19
- };
20
- }
21
- function i(t, e = "price") {
22
- const o = g(), n = t[e], d = (n == null ? void 0 : n[o.code]) ?? Object.values(n ?? {})[0] ?? 0;
23
- return C({
24
- price: d,
25
- currency: o
26
- });
8
+ function I(e, t = !0) {
9
+ const n = `<s><strong>${o(e, "original_price")}</strong></s>`, r = (a) => `<td
10
+ class="esd-block-text product-price ${a}"
11
+ align="center"
12
+ valign="middle"
13
+ esd-extension-block-id="${l.PRICE}">
14
+ <p contenteditable="false" style="font-size: 16px; color: #333333;">
15
+ <strong>${o(e, "price")}</strong>
16
+ </p>
17
+ </td>`, i = (a) => `<td
18
+ class="esd-block-text product-old-price ${a}"
19
+ align="center"
20
+ valign="middle"
21
+ data-same-price="${b(e)}"
22
+ esd-extension-block-id="${l.OLD_PRICE}">
23
+ <p contenteditable="false" style="font-size: 14px; color: #999999;">
24
+ ${n}
25
+ </p>
26
+ </td>`, p = t ? i("es-p15l es-p5r") : r("es-p15l es-p5r"), c = t ? r("es-p5l es-p15r") : i("es-p5l es-p15r");
27
+ return `
28
+ <td class="${d}" style="padding: ${s}; height: 100%;" valign="top">
29
+ <table
30
+ class="product-card-segment"
31
+ width="100%"
32
+ height="100%"
33
+ cellpadding="0"
34
+ cellspacing="0"
35
+ border="0">
36
+ <tbody>
37
+ <tr valign="top">
38
+ <td align="center">
39
+ <table cellpadding="0" cellspacing="0" border="0" align="center" style="margin: 0 auto;">
40
+ <tbody>
41
+ <tr valign="middle">
42
+ ${p}
43
+ ${c}
44
+ </tr>
45
+ </tbody>
46
+ </table>
47
+ </td>
48
+ </tr>
49
+ </tbody>
50
+ </table>
51
+ </td>
52
+ `;
27
53
  }
28
- const A = {
29
- [_]: (t) => `
30
- <td class="${a}" style="padding: ${s}; height: 100%;" valign="top">
54
+ function P(e) {
55
+ const t = `<s><strong>${o(e, "original_price")}</strong></s>`;
56
+ return `
57
+ <td class="${d}" style="padding: ${s}; height: 100%;" valign="top">
31
58
  <table
32
59
  class="product-card-segment"
33
60
  width="100%"
@@ -38,64 +65,67 @@ const A = {
38
65
  <tbody>
39
66
  <tr valign="top">
40
67
  <td
41
- class="esd-block-image product-image"
68
+ class="esd-block-text product-old-price es-p15l es-p15r"
42
69
  align="center"
43
- esd-extension-block-id="${l.IMAGE}">
44
- <a target="_blank" href="${t.url}" class="${p}">
45
- <img
46
- src="${O(t.image_url)}"
47
- alt="${t.name}"
48
- style="display: block; max-width: 100%; height: auto;"
49
- class="adapt-img">
50
- </a>
70
+ data-same-price="${b(e)}"
71
+ esd-extension-block-id="${l.OLD_PRICE}">
72
+ <p contenteditable="false" style="font-size: 14px; color: #999999;">
73
+ ${t}
74
+ </p>
51
75
  </td>
52
76
  </tr>
53
77
  </tbody>
54
78
  </table>
55
79
  </td>
56
- `,
57
- [$]: (t) => `
58
- <td class="${a}" style="padding: ${s}; height: 100%;" valign="middle">
80
+ `;
81
+ }
82
+ const E = {
83
+ [f]: (e) => `
84
+ <td class="${d}" style="padding: ${s}; height: 100%;" valign="top">
59
85
  <table
60
86
  class="product-card-segment"
61
87
  width="100%"
62
88
  height="100%"
63
89
  cellpadding="0"
64
90
  cellspacing="0"
65
- border="0"
66
- style="table-layout: fixed;">
91
+ border="0">
67
92
  <tbody>
68
93
  <tr valign="top">
69
94
  <td
70
- class="esd-block-text product-name es-p10t es-p10b es-p15l es-p15r"
95
+ class="esd-block-image product-image"
71
96
  align="center"
72
- esd-extension-block-id="${l.NAME}">
73
- <p contenteditable="false" style="font-size: 16px; color: #333333;">
74
- <strong>${t.name}</strong>
75
- </p>
97
+ esd-extension-block-id="${l.IMAGE}">
98
+ <a target="_blank" href="${e.url}" class="${g}">
99
+ <img
100
+ src="${R(e.image_url)}"
101
+ alt="${e.name}"
102
+ style="display: block; max-width: 100%; height: auto;"
103
+ class="adapt-img">
104
+ </a>
76
105
  </td>
77
106
  </tr>
78
107
  </tbody>
79
108
  </table>
80
109
  </td>
81
110
  `,
82
- [f]: (t) => `
83
- <td class="${a}" style="padding: ${s}; height: 100%;" valign="top">
111
+ [x]: (e) => `
112
+ <td class="${d}" style="padding: ${s}; height: 100%;" valign="middle">
84
113
  <table
85
114
  class="product-card-segment"
86
115
  width="100%"
87
116
  height="100%"
88
117
  cellpadding="0"
89
118
  cellspacing="0"
90
- border="0">
119
+ border="0"
120
+ style="table-layout: fixed;">
91
121
  <tbody>
92
122
  <tr valign="top">
93
123
  <td
94
- class="esd-block-text product-price es-p15l es-p15r"
124
+ class="esd-block-text product-name es-p10t es-p10b es-p15l es-p15r"
95
125
  align="center"
96
- esd-extension-block-id="${l.PRICE}">
126
+ esd-extension-block-id="${l.NAME}">
97
127
  <p contenteditable="false" style="font-size: 16px; color: #333333;">
98
- <strong>${i(t, "price")}</strong>
128
+ <strong>${e.name}</strong>
99
129
  </p>
100
130
  </td>
101
131
  </tr>
@@ -103,8 +133,8 @@ const A = {
103
133
  </table>
104
134
  </td>
105
135
  `,
106
- [T]: (t) => `
107
- <td class="${a}" style="padding: ${s}; height: 100%;" valign="top">
136
+ [T]: (e) => `
137
+ <td class="${d}" style="padding: ${s}; height: 100%;" valign="top">
108
138
  <table
109
139
  class="product-card-segment"
110
140
  width="100%"
@@ -115,13 +145,11 @@ const A = {
115
145
  <tbody>
116
146
  <tr valign="top">
117
147
  <td
118
- class="esd-block-text product-old-price es-p15l es-p15r"
148
+ class="esd-block-text product-price es-p15l es-p15r"
119
149
  align="center"
120
- esd-extension-block-id="${l.OLD_PRICE}">
121
- <p
122
- contenteditable="false"
123
- style="font-size: 14px; color: #999999;">
124
- <s><strong>${i(t, "original_price")}</strong></s>
150
+ esd-extension-block-id="${l.PRICE}">
151
+ <p contenteditable="false" style="font-size: 16px; color: #333333;">
152
+ <strong>${o(e, "price")}</strong>
125
153
  </p>
126
154
  </td>
127
155
  </tr>
@@ -129,8 +157,9 @@ const A = {
129
157
  </table>
130
158
  </td>
131
159
  `,
132
- [y]: (t) => `
133
- <td class="${a}" style="padding: ${s}; height: 100%;" valign="top">
160
+ [m]: (e) => P(e),
161
+ [y]: (e) => `
162
+ <td class="${d}" style="padding: ${s}; height: 100%;" valign="top">
134
163
  <table
135
164
  class="product-card-segment"
136
165
  width="100%"
@@ -148,7 +177,7 @@ const A = {
148
177
  esd-extension-block-id="${l.OMNIBUS_PRICE}">
149
178
  <p contenteditable="false" style="font-size: 12px; color: #666666;">
150
179
  <span class="omnibus-text-before">Lowest 30-day price: </span>
151
- <span class="omnibus-price-value">${i(t, "original_price")}</span>
180
+ <span class="omnibus-price-value">${o(e, "original_price")}</span>
152
181
  <span class="omnibus-text-after"></span>
153
182
  </p>
154
183
  </td>
@@ -157,11 +186,11 @@ const A = {
157
186
  </table>
158
187
  </td>
159
188
  `,
160
- [h]: (t) => {
161
- var r, c;
162
- const e = g(), o = ((r = t.original_price) == null ? void 0 : r[e.code]) ?? Object.values(t.original_price ?? {})[0] ?? 0, n = ((c = t.price) == null ? void 0 : c[e.code]) ?? Object.values(t.price ?? {})[0] ?? 0, d = o > 0 ? Math.round((o - n) / o * 100) : 0, b = d > 0 ? `-${d}%` : "0%";
189
+ [$]: (e) => {
190
+ var c, a;
191
+ const t = C(), n = ((c = e.original_price) == null ? void 0 : c[t.code]) ?? Object.values(e.original_price ?? {})[0] ?? 0, r = ((a = e.price) == null ? void 0 : a[t.code]) ?? Object.values(e.price ?? {})[0] ?? 0, i = n > 0 ? Math.round((n - r) / n * 100) : 0, p = i > 0 ? `-${i}%` : "0%";
163
192
  return `
164
- <td class="${a}" style="padding: ${s}; height: 100%;" valign="top">
193
+ <td class="${d}" style="padding: ${s}; height: 100%;" valign="top">
165
194
  <table
166
195
  class="product-card-segment"
167
196
  width="100%"
@@ -179,7 +208,7 @@ const A = {
179
208
  esd-extension-block-id="${l.OMNIBUS_DISCOUNT}">
180
209
  <p contenteditable="false" style="font-size: 12px; color: #666666;">
181
210
  <span class="omnibus-text-before"></span>
182
- <span class="omnibus-discount-value">${b}</span>
211
+ <span class="omnibus-discount-value">${p}</span>
183
212
  <span class="omnibus-text-after"></span>
184
213
  </p>
185
214
  </td>
@@ -189,8 +218,8 @@ const A = {
189
218
  </td>
190
219
  `;
191
220
  },
192
- [m]: () => `
193
- <td class="${a}" style="padding: ${s}; height: 100%;" valign="top">
221
+ [h]: () => `
222
+ <td class="${d}" style="padding: ${s}; height: 100%;" valign="top">
194
223
  <table
195
224
  class="product-card-segment"
196
225
  width="100%"
@@ -213,7 +242,7 @@ const A = {
213
242
  ">
214
243
  <a
215
244
  href="#"
216
- class="es-button ${p}"
245
+ class="es-button ${g}"
217
246
  target="_blank"
218
247
  style="
219
248
  color: rgb(56, 118, 29);
@@ -241,8 +270,8 @@ const A = {
241
270
  * @param productAttrValue - Resolved product-attr value (e.g., "brand" for default, "product_attribute.rating_star" for custom)
242
271
  * @param content - Display content for the cell
243
272
  */
244
- [R]: (t, e) => `
245
- <td class="${a}" style="padding: ${s}; height: 100%;" valign="middle">
273
+ [_]: (e, t) => `
274
+ <td class="${d}" style="padding: ${s}; height: 100%;" valign="middle">
246
275
  <table
247
276
  class="product-card-segment"
248
277
  width="100%"
@@ -254,11 +283,11 @@ const A = {
254
283
  <tbody>
255
284
  <tr valign="top">
256
285
  <td
257
- ${u}="${t}"
286
+ ${u}="${e}"
258
287
  class="esd-block-text product-custom-attribute es-p0t es-p0b es-p15l es-p15r"
259
288
  align="center"
260
289
  esd-extension-block-id="${l.CUSTOM_ATTRIBUTE}">
261
- <p contenteditable="false" style="font-size: 12px; color: #666666;">${e}</p>
290
+ <p contenteditable="false" style="font-size: 12px; color: #666666;">${t}</p>
262
291
  </td>
263
292
  </tr>
264
293
  </tbody>
@@ -267,8 +296,10 @@ const A = {
267
296
  `
268
297
  };
269
298
  export {
270
- a as ATTRIBUTE_CELL_CLASS,
299
+ d as ATTRIBUTE_CELL_CLASS,
271
300
  s as DEFAULT_CELL_PADDING,
272
- S as buildFillerCell,
273
- A as gridElementRenderer
301
+ U as buildFillerCell,
302
+ E as gridElementRenderer,
303
+ P as renderGridOldPriceCell,
304
+ I as renderInlineGridPriceCell
274
305
  };
@@ -1,7 +1,7 @@
1
- import { DEFAULT_PRODUCTS_PER_ROW as m } from "../../constants/layout.js";
2
- import { getDefaultProducts as I, DEFAULTS as b, createBlockTemplate as E, DEFAULT_CARD_COMPOSITION as L, spacer as S, buildElementRenderer as _, DEFAULT_CARD_VISIBILITY as f } from "../utils.js";
3
- import { buildFillerCell as w, gridElementRenderer as A } from "./elementRenderer.js";
4
- const D = `
1
+ import { DEFAULT_PRODUCTS_PER_ROW as E } from "../../constants/layout.js";
2
+ import { getDefaultProducts as L, DEFAULTS as S, createBlockTemplate as _, DEFAULT_CARD_COMPOSITION as w, spacer as C, buildElementRenderer as O, resolveInlinePriceOrder as A, DEFAULT_CARD_VISIBILITY as D } from "../utils.js";
3
+ import { renderInlineGridPriceCell as P, buildFillerCell as g, gridElementRenderer as h } from "./elementRenderer.js";
4
+ const U = `
5
5
  <tr class="recommendation-product-row">
6
6
  <td>
7
7
  <table
@@ -18,7 +18,7 @@ const D = `
18
18
  </table>
19
19
  </td>
20
20
  </tr>
21
- `, C = `
21
+ `, Y = `
22
22
  <tr
23
23
  class="recommendation-attribute-row"
24
24
  data-attribute-type="{-{-ATTR_TYPE-}-}"
@@ -27,38 +27,39 @@ const D = `
27
27
  {-{-CELLS-}-}
28
28
  </tr>
29
29
  `;
30
- function O(t, e, n, r = L, c = {}) {
31
- const a = (100 / e).toFixed(2), s = e - t.length, l = s > 0 ? w(a).repeat(s) : "", i = _(n, r, c);
32
- return r.filter((o) => i[o]).map((o) => {
33
- const p = f[o] ?? !0, u = p ? "" : 'style="display: none;"', T = t.map((R) => i[o](R).replace("<td", `<td width="${a}%"`)).join("");
34
- return C.replace("{-{-ATTR_TYPE-}-}", o).replace("{-{-VISIBILITY-}-}", p ? "1" : "0").replace("{-{-DISPLAY_STYLE-}-}", u).replace("{-{-CELLS-}-}", T + l);
30
+ function y(e, t, o, r = w, i = {}, p = {}) {
31
+ const { priceInline: s = !1 } = p, u = (100 / t).toFixed(2), n = t - e.length, T = n > 0 ? g(u).repeat(n) : "", d = O(o, r, i), c = A(r), R = s ? r.filter((l) => l !== c.skip) : r, I = (l, a) => s && l === c.anchor ? P(a, c.originalFirst) : d[l](a);
32
+ return R.filter((l) => d[l]).map((l) => {
33
+ const a = D[l] ?? !0, m = a ? "" : 'style="display: none;"', b = e.map((f) => I(l, f).replace("<td", `<td width="${u}%"`)).join("");
34
+ return Y.replace("{-{-ATTR_TYPE-}-}", l).replace("{-{-VISIBILITY-}-}", a ? "1" : "0").replace("{-{-DISPLAY_STYLE-}-}", m).replace("{-{-CELLS-}-}", b + T);
35
35
  }).join("");
36
36
  }
37
- function g(t, e, n, r, c = {}) {
38
- const a = [];
39
- for (let l = 0; l < t.length; l += e)
40
- a.push(t.slice(l, l + e));
41
- return a.map((l, i) => {
42
- const d = O(
43
- l,
44
- e,
37
+ function B(e, t, o, r, i = {}, p = {}) {
38
+ const s = [];
39
+ for (let n = 0; n < e.length; n += t)
40
+ s.push(e.slice(n, n + t));
41
+ return s.map((n, T) => {
42
+ const d = y(
45
43
  n,
44
+ t,
45
+ o,
46
46
  r,
47
- c
48
- ), o = D.replace("{-{-ATTRIBUTE_ROWS-}-}", d);
49
- return i > 0 ? S + o : o;
47
+ i,
48
+ p
49
+ ), c = U.replace("{-{-ATTRIBUTE_ROWS-}-}", d);
50
+ return T > 0 ? C + c : c;
50
51
  }).join("");
51
52
  }
52
- function P(t, e, n, r = {}) {
53
- return g(t, e, A, n, r);
53
+ function F(e, t, o, r = {}, i = {}) {
54
+ return B(e, t, h, o, r, i);
54
55
  }
55
- function B(t) {
56
- const e = t ? `ins-recommendation-v3-block-${t}` : void 0, n = E("grid", e), r = I(), c = P(r, m);
57
- return n.replace("{-{-TITLE-}-}", b.TITLE).replace("{-{-PRODUCT_ROWS-}-}", c).replace("{-{-MOBILE_PRODUCT_ROWS-}-}", "");
56
+ function j(e) {
57
+ const t = e ? `ins-recommendation-v3-block-${e}` : void 0, o = _("grid", t), r = L(), i = F(r, E);
58
+ return o.replace("{-{-TITLE-}-}", S.TITLE).replace("{-{-PRODUCT_ROWS-}-}", i).replace("{-{-MOBILE_PRODUCT_ROWS-}-}", "");
58
59
  }
59
60
  export {
60
- B as getDefaultTemplate,
61
- O as prepareGridAttributeRows,
62
- g as prepareGridProductRows,
63
- P as prepareProductRows
61
+ j as getDefaultTemplate,
62
+ y as prepareGridAttributeRows,
63
+ B as prepareGridProductRows,
64
+ F as prepareProductRows
64
65
  };
@@ -1,12 +1,14 @@
1
1
  import { DEFAULT_PRODUCTS_PER_ROW as s } from "../constants/layout.js";
2
- import { prepareProductRows as c } from "./grid/template.js";
3
- import { prepareProductRows as R } from "./list/template.js";
4
- function a(o, t, r = {}) {
2
+ import { prepareProductRows as m } from "./grid/template.js";
3
+ import { prepareProductRows as n } from "./list/template.js";
4
+ import "../store/recommendation.js";
5
+ function P(o, t, r = {}) {
6
+ const e = { priceInline: r.priceInline };
5
7
  if (t === "list")
6
- return R(o, r.composition, r.filterList);
7
- const { productsPerRow: e = s, composition: p, filterList: i } = r;
8
- return c(o, e, p, i);
8
+ return n(o, r.composition, r.filterList, e);
9
+ const { productsPerRow: i = s, composition: p, filterList: c } = r;
10
+ return m(o, i, p, c, e);
9
11
  }
10
12
  export {
11
- a as prepareProductRows
13
+ P as prepareProductRows
12
14
  };