@useinsider/guido 3.6.0-beta.b75de0e → 3.6.0-beta.d0bfe20

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 (37) hide show
  1. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +2 -2
  2. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +24 -22
  3. package/dist/composables/useHtmlValidator.js +102 -131
  4. package/dist/config/compiler/utils/recommendationCompilerUtils.js +27 -28
  5. package/dist/config/migrator/recommendation/extractors.js +22 -44
  6. package/dist/config/migrator/recommendation/htmlBuilder.js +169 -175
  7. package/dist/config/migrator/recommendationMigrator.js +31 -30
  8. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +15 -21
  9. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +24 -38
  10. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +38 -39
  11. package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +34 -45
  12. package/dist/extensions/Blocks/Recommendation/controls/main/productCount.js +2 -3
  13. package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +52 -62
  14. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +67 -74
  15. package/dist/extensions/Blocks/Recommendation/controls/syncInfoMessage.js +6 -7
  16. package/dist/extensions/Blocks/Recommendation/extension.js +5 -6
  17. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +2 -3
  18. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +2 -3
  19. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +2 -3
  20. package/dist/extensions/Blocks/Recommendation/templates/index.js +4 -5
  21. package/dist/extensions/Blocks/Unsubscribe/control.js +33 -26
  22. package/dist/guido.css +1 -1
  23. package/dist/src/composables/useHtmlValidator.d.ts +0 -9
  24. package/dist/src/config/migrator/recommendation/extractors.d.ts +0 -15
  25. package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +0 -8
  26. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  27. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +0 -21
  28. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +0 -7
  29. package/dist/src/extensions/Blocks/Recommendation/controls/main/layoutOrientation.d.ts +0 -5
  30. package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +0 -6
  31. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +0 -9
  32. package/dist/src/extensions/Blocks/Unsubscribe/control.d.ts +1 -0
  33. package/package.json +1 -1
  34. package/dist/config/compiler/utils/recommendationIgnoreUtils.js +0 -15
  35. package/dist/src/composables/useHtmlValidator.test.d.ts +0 -1
  36. package/dist/src/config/compiler/utils/recommendationIgnoreUtils.d.ts +0 -17
  37. package/dist/src/config/compiler/utils/recommendationIgnoreUtils.test.d.ts +0 -1
@@ -1,16 +1,16 @@
1
1
  import { RecommendationBlockId as g } from "../../../extensions/Blocks/Recommendation/constants/blockIds.js";
2
- import { CSS_CLASS_SKIP_COMPILE as ot, CURRENCY_ATTR as P, ATTR_PRODUCT_IMAGE as O, ATTR_PRODUCT_BUTTON as k, CSS_CLASS_RECO_BUTTON as H, ATTR_PRODUCT_NAME as j, ATTR_PRODUCT_PRICE as V, ATTR_PRODUCT_OLD_PRICE as Y, ATTR_PRODUCT_OMNIBUS_PRICE as M, ATTR_PRODUCT_OMNIBUS_DISCOUNT as F, ATTR_CUSTOM_PREFIX as E } from "../../../extensions/Blocks/Recommendation/constants/selectors.js";
3
- import { formatPrice as L } from "../../../extensions/Blocks/Recommendation/utils/priceFormatter.js";
4
- import { escapeHtml as r } from "../../../utils/htmlEscape.js";
2
+ import { CURRENCY_ATTR as R, ATTR_PRODUCT_IMAGE as I, ATTR_PRODUCT_BUTTON as N, CSS_CLASS_RECO_BUTTON as z, ATTR_PRODUCT_NAME as G, ATTR_PRODUCT_PRICE as H, ATTR_PRODUCT_OLD_PRICE as j, ATTR_PRODUCT_OMNIBUS_PRICE as U, ATTR_PRODUCT_OMNIBUS_DISCOUNT as V, ATTR_CUSTOM_PREFIX as E } from "../../../extensions/Blocks/Recommendation/constants/selectors.js";
3
+ import { formatPrice as v } from "../../../extensions/Blocks/Recommendation/utils/priceFormatter.js";
4
+ import { escapeHtml as c } from "../../../utils/htmlEscape.js";
5
5
  import { appendStyle as $ } from "./themeMapper.js";
6
- const J = "https://email-static.useinsider.com/stripo/modules/email-recommendation-v3/assets/images/image-placeholder.png", K = "attribute-cell", X = "Buy", q = "border-width: 1px; background: rgb(217, 234, 211); border-color: rgb(106, 168, 79)", Q = "color: rgb(56, 118, 29); background: rgb(217, 234, 211); font-family: arial, 'helvetica neue', helvetica, sans-serif; font-size: 16px; font-weight: normal; line-height: 120%; mso-border-alt: 10px solid rgb(217, 234, 211); mso-padding-alt: 0", nt = "ins-recommendation-product-container ins-recommendation-desktop-container";
7
- function lt(t) {
6
+ const Y = "https://email-static.useinsider.com/stripo/modules/email-recommendation-v3/assets/images/image-placeholder.png", F = "attribute-cell", J = "Buy", X = "border-width: 1px; background: rgb(217, 234, 211); border-color: rgb(106, 168, 79)", K = "color: rgb(56, 118, 29); background: rgb(217, 234, 211); font-family: arial, 'helvetica neue', helvetica, sans-serif; font-size: 16px; font-weight: normal; line-height: 120%; mso-border-alt: 10px solid rgb(217, 234, 211); mso-padding-alt: 0", ot = "ins-recommendation-product-container ins-recommendation-desktop-container";
7
+ function nt(t) {
8
8
  return t.replace(/>\s+</g, "><").trim();
9
9
  }
10
10
  function y(t) {
11
- return t ? ` align="${r(t)}"` : ' align="center"';
11
+ return t ? ` align="${c(t)}"` : ' align="center"';
12
12
  }
13
- function R() {
13
+ function _() {
14
14
  return {
15
15
  tdStyle: "",
16
16
  pStyle: "",
@@ -19,36 +19,36 @@ function R() {
19
19
  textTrimming: !1
20
20
  };
21
21
  }
22
- function Z(t) {
23
- return t ? { ...t, wrapBold: !0 } : { ...R(), wrapBold: !0 };
22
+ function q(t) {
23
+ return t ? { ...t, wrapBold: !0 } : { ..._(), wrapBold: !0 };
24
24
  }
25
- function v(t, o) {
26
- let e = r(t);
25
+ function k(t, o) {
26
+ let e = c(t);
27
27
  return o.wrapBold && o.wrapItalic ? e = `<strong><em>${e}</em></strong>` : o.wrapBold ? e = `<strong>${e}</strong>` : o.wrapItalic && (e = `<em>${e}</em>`), e;
28
28
  }
29
- function u(t) {
30
- return t ? ` style="${r(t)}"` : "";
29
+ function b(t) {
30
+ return t ? ` style="${c(t)}"` : "";
31
31
  }
32
- function I(t, o) {
33
- return `<td width="${t}%" class="${K}" ${o}`;
32
+ function O(t, o) {
33
+ return `<td width="${t}%" class="${F}" ${o}`;
34
34
  }
35
- function st(t, o, e, l) {
35
+ function lt(t, o, e, l) {
36
36
  const s = t.width ? ` width="${t.width}"` : "", n = t.height ? ` height="${t.height}"` : "", i = ["display: block", "max-width: 100%", "height: auto"];
37
37
  t.width && i.push(`width: ${t.width}px`), t.height && i.push(`height: ${t.height}px`);
38
- const c = i.join("; "), a = e ? ` style="background-color: ${r(e)}"` : "";
38
+ const a = i.join("; "), r = e ? ` style="background-color: ${c(e)}"` : "";
39
39
  return `
40
- ${I(l, 'valign="top" style="padding: 0 5px; height: 100%"')}>
40
+ ${O(l, 'valign="top" style="padding: 0 5px; height: 100%"')}>
41
41
  <table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0"
42
- class="product-card-segment"${a}>
42
+ class="product-card-segment"${r}>
43
43
  <tbody>
44
44
  <tr valign="top">
45
45
  <td align="center"
46
46
  class="esd-block-image product-image es-p5"
47
47
  esd-extension-block-id="${g.IMAGE}">
48
48
  <a target="_blank" href="https://example.com/product/${o + 1}">
49
- <img src="${J}" alt="Product Name"
49
+ <img src="${Y}" alt="Product Name"
50
50
  class="adapt-img"${s}${n}
51
- style="${c}">
51
+ style="${a}">
52
52
  </a>
53
53
  </td>
54
54
  </tr>
@@ -57,18 +57,18 @@ function st(t, o, e, l) {
57
57
  </td>
58
58
  `;
59
59
  }
60
- function G(t, o, e, l, s, n, i) {
61
- const a = `table-layout: fixed${n ? `; background-color: ${r(n)}` : ""}`, d = u(s.tdStyle), p = y(s.align), b = `esd-block-text ${o}`.trim(), m = $(l, s.pStyle);
60
+ function L(t, o, e, l, s, n, i) {
61
+ const r = `table-layout: fixed${n ? `; background-color: ${c(n)}` : ""}`, d = b(s.tdStyle), p = y(s.align), u = `esd-block-text ${o}`.trim(), m = $(l, s.pStyle);
62
62
  return `
63
- ${I(i, 'valign="top" style="padding: 0 5px; height: 100%"')}>
63
+ ${O(i, 'valign="top" style="padding: 0 5px; height: 100%"')}>
64
64
  <table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0"
65
- class="product-card-segment" style="${a}">
65
+ class="product-card-segment" style="${r}">
66
66
  <tbody>
67
67
  <tr valign="top">
68
68
  <td${p}
69
- class="${b}"
69
+ class="${u}"
70
70
  esd-extension-block-id="${t}"${d}>
71
- <p contenteditable="false"${u(m)}>${v(e, s)}</p>
71
+ <p contenteditable="false"${b(m)}>${k(e, s)}</p>
72
72
  </td>
73
73
  </tr>
74
74
  </tbody>
@@ -76,10 +76,10 @@ function G(t, o, e, l, s, n, i) {
76
76
  </td>
77
77
  `;
78
78
  }
79
- function it(t, o, e, l) {
80
- const s = o ? ` style="background-color: ${r(o)}"` : "", n = u(t.tdStyle), i = y(t.align), a = $("font-size: 14px; color: #999999", t.pStyle);
79
+ function st(t, o, e, l) {
80
+ const s = o ? ` style="background-color: ${c(o)}"` : "", n = b(t.tdStyle), i = y(t.align), r = $("font-size: 14px; color: #999999", t.pStyle);
81
81
  return `
82
- ${I(e, 'valign="top" style="padding: 0 5px; height: 100%"')}>
82
+ ${O(e, 'valign="top" style="padding: 0 5px; height: 100%"')}>
83
83
  <table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0"
84
84
  class="product-card-segment"${s}>
85
85
  <tbody>
@@ -87,8 +87,8 @@ function it(t, o, e, l) {
87
87
  <td${i}
88
88
  class="esd-block-text product-old-price es-p15l es-p15r"
89
89
  esd-extension-block-id="${g.OLD_PRICE}"${n}>
90
- <p contenteditable="false"${u(a)}>
91
- <s>${v(l, t)}</s>
90
+ <p contenteditable="false"${b(r)}>
91
+ <s>${k(l, t)}</s>
92
92
  </p>
93
93
  </td>
94
94
  </tr>
@@ -97,21 +97,21 @@ function it(t, o, e, l) {
97
97
  </td>
98
98
  `;
99
99
  }
100
- function z(t, o, e, l, s, n, i) {
101
- const c = s ? `; background-color: ${r(s)}` : "", a = u(l.tdStyle), d = y(l.align), b = $("font-size: 12px; color: #666666", l.pStyle);
100
+ function D(t, o, e, l, s, n, i) {
101
+ const a = s ? `; background-color: ${c(s)}` : "", r = b(l.tdStyle), d = y(l.align), u = $("font-size: 12px; color: #666666", l.pStyle);
102
102
  return `
103
- ${I(i, 'valign="top" style="padding: 0 5px; height: 100%"')}>
103
+ ${O(i, 'valign="top" style="padding: 0 5px; height: 100%"')}>
104
104
  <table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0"
105
- class="product-card-segment" style="table-layout: fixed${c}">
105
+ class="product-card-segment" style="table-layout: fixed${a}">
106
106
  <tbody>
107
107
  <tr valign="top">
108
108
  <td${d}
109
109
  data-text-before="" data-text-after=""
110
110
  class="esd-block-text ${n} es-p15l es-p15r"
111
- esd-extension-block-id="${t}"${a}>
112
- <p contenteditable="false"${u(b)}>
111
+ esd-extension-block-id="${t}"${r}>
112
+ <p contenteditable="false"${b(u)}>
113
113
  <span class="omnibus-text-before"></span>
114
- <span class="${o}">${r(e)}</span>
114
+ <span class="${o}">${c(e)}</span>
115
115
  <span class="omnibus-text-after"></span>
116
116
  </p>
117
117
  </td>
@@ -121,10 +121,10 @@ function z(t, o, e, l, s, n, i) {
121
121
  </td>
122
122
  `;
123
123
  }
124
- function rt(t, o, e, l) {
125
- const s = e ? ` style="background-color: ${r(e)}"` : "", n = $("padding: 0 5px; height: 100%", o.tdStyle), i = y(o.align), c = o.text || X, a = $(q, o.spanStyle), d = $(Q, o.aStyle);
124
+ function it(t, o, e, l) {
125
+ const s = e ? ` style="background-color: ${c(e)}"` : "", n = $("padding: 0 5px; height: 100%", o.tdStyle), i = y(o.align), a = o.text || J, r = $(X, o.spanStyle), d = $(K, o.aStyle);
126
126
  return `
127
- ${I(l, `valign="top" style="${r(n)}"`)}>
127
+ ${O(l, `valign="top" style="${c(n)}"`)}>
128
128
  <table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0"
129
129
  class="product-card-segment"${s}>
130
130
  <tbody>
@@ -132,10 +132,10 @@ function rt(t, o, e, l) {
132
132
  <td${i}
133
133
  class="esd-block-button product-button es-p10t es-p10b es-p5l es-p5r"
134
134
  esd-extension-block-id="${g.BUTTON}">
135
- <span class="es-button-border" style="${r(a)}">
135
+ <span class="es-button-border" style="${c(r)}">
136
136
  <a href="https://example.com/product/${t + 1}" target="_blank"
137
- class="es-button ${H}"
138
- style="${r(d)}">${r(c)}</a>
137
+ class="es-button ${z}"
138
+ style="${c(d)}">${c(a)}</a>
139
139
  </span>
140
140
  </td>
141
141
  </tr>
@@ -145,17 +145,17 @@ function rt(t, o, e, l) {
145
145
  `;
146
146
  }
147
147
  function ct(t, o, e, l, s) {
148
- const n = l ? `; background-color: ${r(l)}` : "", i = u(e.tdStyle), c = y(e.align), d = $("font-size: 12px; color: #666666; margin: 0", e.pStyle), p = o.replace(/_/g, " ").replace(/\b\w/g, (b) => b.toUpperCase());
148
+ const n = l ? `; background-color: ${c(l)}` : "", i = b(e.tdStyle), a = y(e.align), d = $("font-size: 12px; color: #666666; margin: 0", e.pStyle), p = o.replace(/_/g, " ").replace(/\b\w/g, (u) => u.toUpperCase());
149
149
  return `
150
- ${I(s, 'valign="middle" style="padding: 0 5px; height: 100%"')}>
150
+ ${O(s, 'valign="middle" style="padding: 0 5px; height: 100%"')}>
151
151
  <table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0"
152
152
  class="product-card-segment" style="table-layout: fixed${n}">
153
153
  <tbody>
154
154
  <tr valign="top">
155
- <td product-attr="${r(t)}"${c}
155
+ <td product-attr="${c(t)}"${a}
156
156
  class="esd-block-text product-custom-attribute es-p0t es-p0b es-p15l es-p15r"
157
157
  esd-extension-block-id="${g.CUSTOM_ATTRIBUTE}"${i}>
158
- <p contenteditable="false"${u(d)}>${r(p)}</p>
158
+ <p contenteditable="false"${b(d)}>${c(p)}</p>
159
159
  </td>
160
160
  </tr>
161
161
  </tbody>
@@ -164,110 +164,110 @@ function ct(t, o, e, l, s) {
164
164
  `;
165
165
  }
166
166
  function at(t, o, e, l, s, n, i) {
167
- const c = o[t], a = c ?? R();
167
+ const a = o[t], r = a ?? _();
168
168
  switch (t) {
169
- case O:
170
- return st(
171
- c ?? {},
169
+ case I:
170
+ return lt(
171
+ a ?? {},
172
172
  s,
173
173
  l,
174
174
  n
175
175
  );
176
- case j:
177
- return G(
176
+ case G:
177
+ return L(
178
178
  g.NAME,
179
179
  "product-name es-p10t es-p10b es-p15l es-p15r",
180
180
  "Product Name",
181
181
  "font-size: 16px; color: #333333",
182
- a,
182
+ r,
183
183
  l,
184
184
  n
185
185
  );
186
- case V:
187
- return G(
186
+ case H:
187
+ return L(
188
188
  g.PRICE,
189
189
  "product-price es-p15l es-p15r",
190
190
  i.pricePlaceholder,
191
191
  "font-size: 16px; color: #333333",
192
- Z(c),
192
+ q(a),
193
193
  l,
194
194
  n
195
195
  );
196
- case Y:
197
- return it(a, l, n, i.oldPricePlaceholder);
198
- case M:
199
- return z(
196
+ case j:
197
+ return st(r, l, n, i.oldPricePlaceholder);
198
+ case U:
199
+ return D(
200
200
  g.OMNIBUS_PRICE,
201
201
  "omnibus-price-value",
202
202
  i.omnibusPricePlaceholder,
203
- a,
203
+ r,
204
204
  l,
205
205
  "product-omnibus-price",
206
206
  n
207
207
  );
208
- case F:
209
- return z(
208
+ case V:
209
+ return D(
210
210
  g.OMNIBUS_DISCOUNT,
211
211
  "omnibus-discount-value",
212
212
  "-10%",
213
- a,
213
+ r,
214
214
  l,
215
215
  "product-omnibus-discount",
216
216
  n
217
217
  );
218
- case k:
219
- return rt(
218
+ case N:
219
+ return it(
220
220
  s,
221
- c ?? {},
221
+ a ?? {},
222
222
  l,
223
223
  n
224
224
  );
225
225
  default:
226
226
  if (t.startsWith(E)) {
227
227
  const d = e[t] ?? t.slice(E.length), p = t.slice(E.length);
228
- return ct(d, p, a, l, n);
228
+ return ct(d, p, r, l, n);
229
229
  }
230
230
  return null;
231
231
  }
232
232
  }
233
- const W = `
233
+ const Q = `
234
234
  <tr>
235
235
  <td class="spacer" style="height: 10px"></td>
236
236
  </tr>
237
237
  `;
238
- function dt(t) {
238
+ function rt(t) {
239
239
  return {
240
- pricePlaceholder: L({ price: 18, currency: t }),
241
- oldPricePlaceholder: L({ price: 20, currency: t }),
242
- omnibusPricePlaceholder: L({ price: 20, currency: t })
240
+ pricePlaceholder: v({ price: 18, currency: t }),
241
+ oldPricePlaceholder: v({ price: 20, currency: t }),
242
+ omnibusPricePlaceholder: v({ price: 20, currency: t })
243
243
  };
244
244
  }
245
- function pt(t, o, e, l) {
246
- const { composition: s, visibility: n, perElement: i, customAttrValues: c, cardBg: a } = l, d = (100 / e).toFixed(2), p = e - o, b = `<td class="${K}" style="padding: 0 5px;" width="${d}%"></td>`, m = p > 0 ? b.repeat(p) : "";
245
+ function dt(t, o, e, l) {
246
+ const { composition: s, visibility: n, perElement: i, customAttrValues: a, cardBg: r } = l, d = (100 / e).toFixed(2), p = e - o, u = `<td class="${F}" style="padding: 0 5px;" width="${d}%"></td>`, m = p > 0 ? u.repeat(p) : "";
247
247
  return `
248
248
  <tr class="recommendation-product-row">
249
249
  <td>
250
250
  <table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0"
251
251
  class="product-card-wrapper" style="table-layout: fixed">
252
252
  <tbody>${s.map((T) => {
253
- const C = n[T] !== !1, f = C ? "" : ' style="display: none"', w = C ? "1" : "0", x = [];
254
- for (let A = 0; A < o; A += 1) {
255
- const _ = at(
253
+ const w = n[T] !== !1, f = w ? "" : ' style="display: none"', C = w ? "1" : "0", S = [];
254
+ for (let x = 0; x < o; x += 1) {
255
+ const A = at(
256
256
  T,
257
257
  i,
258
- c,
259
258
  a,
260
- t + A,
259
+ r,
260
+ t + x,
261
261
  d,
262
262
  l
263
263
  );
264
- _ && x.push(_);
264
+ A && S.push(A);
265
265
  }
266
- return x.length === 0 ? "" : `
266
+ return S.length === 0 ? "" : `
267
267
  <tr class="recommendation-attribute-row"
268
- data-attribute-type="${r(T)}"
269
- data-visibility="${w}"${f}>
270
- ${x.join("")}${m}
268
+ data-attribute-type="${c(T)}"
269
+ data-visibility="${C}"${f}>
270
+ ${S.join("")}${m}
271
271
  </tr>
272
272
  `;
273
273
  }).filter(Boolean).join("")}</tbody>
@@ -276,107 +276,107 @@ function pt(t, o, e, l) {
276
276
  </tr>
277
277
  `;
278
278
  }
279
- function ut(t, o, e) {
279
+ function pt(t, o, e) {
280
280
  const l = [];
281
281
  for (let s = 0; s < t; s += o) {
282
282
  const n = Math.min(o, t - s);
283
- s > 0 && l.push(W), l.push(pt(s, n, o, e));
283
+ s > 0 && l.push(Q), l.push(dt(s, n, o, e));
284
284
  }
285
285
  return l.join("");
286
286
  }
287
- function bt(t, o, e, l) {
287
+ function ut(t, o, e, l) {
288
288
  const s = o[t];
289
- if (t === j) {
290
- const n = s ?? R(), i = $("font-size: 16px; color: #333333; margin: 0", n.pStyle), c = y(n.align ?? "left");
289
+ if (t === G) {
290
+ const n = s ?? _(), i = $("font-size: 16px; color: #333333; margin: 0", n.pStyle), a = y(n.align ?? "left");
291
291
  return `
292
292
  <td class="esd-block-text product-name"
293
- esd-extension-block-id="${g.NAME}"${c}${u(n.tdStyle)}>
294
- <p contenteditable="false"${u(i)}>${v("Product Name", n)}</p>
293
+ esd-extension-block-id="${g.NAME}"${a}${b(n.tdStyle)}>
294
+ <p contenteditable="false"${b(i)}>${k("Product Name", n)}</p>
295
295
  </td>
296
296
  `;
297
297
  }
298
- if (t === V) {
299
- const n = Z(s), i = $("font-size: 16px; color: #333333; margin: 0", n.pStyle), c = y(n.align ?? "left");
298
+ if (t === H) {
299
+ const n = q(s), i = $("font-size: 16px; color: #333333; margin: 0", n.pStyle), a = y(n.align ?? "left");
300
300
  return `
301
301
  <td class="esd-block-text product-price"
302
- esd-extension-block-id="${g.PRICE}"${c}${u(n.tdStyle)}>
303
- <p contenteditable="false"${u(i)}>${v(l.pricePlaceholder, n)}</p>
302
+ esd-extension-block-id="${g.PRICE}"${a}${b(n.tdStyle)}>
303
+ <p contenteditable="false"${b(i)}>${k(l.pricePlaceholder, n)}</p>
304
304
  </td>
305
305
  `;
306
306
  }
307
- if (t === Y) {
308
- const n = s ?? R(), c = $("font-size: 14px; color: #999999; text-decoration: line-through; margin: 0", n.pStyle), a = y(n.align ?? "left");
307
+ if (t === j) {
308
+ const n = s ?? _(), a = $("font-size: 14px; color: #999999; text-decoration: line-through; margin: 0", n.pStyle), r = y(n.align ?? "left");
309
309
  return `
310
310
  <td class="esd-block-text product-old-price"
311
- esd-extension-block-id="${g.OLD_PRICE}"${a}${u(n.tdStyle)}>
312
- <p contenteditable="false"${u(c)}><s>${v(l.oldPricePlaceholder, n)}</s></p>
311
+ esd-extension-block-id="${g.OLD_PRICE}"${r}${b(n.tdStyle)}>
312
+ <p contenteditable="false"${b(a)}><s>${k(l.oldPricePlaceholder, n)}</s></p>
313
313
  </td>
314
314
  `;
315
315
  }
316
- if (t === M || t === F) {
317
- const n = t === M, i = n ? g.OMNIBUS_PRICE : g.OMNIBUS_DISCOUNT, c = n ? "omnibus-price-value" : "omnibus-discount-value", a = n ? l.omnibusPricePlaceholder : "-10%", d = n ? "product-omnibus-price" : "product-omnibus-discount", p = s ?? R(), b = $("font-size: 12px; color: #666666; margin: 0", p.pStyle), m = y(p.align ?? "left");
316
+ if (t === U || t === V) {
317
+ const n = t === U, i = n ? g.OMNIBUS_PRICE : g.OMNIBUS_DISCOUNT, a = n ? "omnibus-price-value" : "omnibus-discount-value", r = n ? l.omnibusPricePlaceholder : "-10%", d = n ? "product-omnibus-price" : "product-omnibus-discount", p = s ?? _(), u = $("font-size: 12px; color: #666666; margin: 0", p.pStyle), m = y(p.align ?? "left");
318
318
  return `
319
319
  <td class="esd-block-text ${d}"
320
320
  data-text-before="" data-text-after=""
321
- esd-extension-block-id="${i}"${m}${u(p.tdStyle)}>
322
- <p contenteditable="false"${u(b)}>
321
+ esd-extension-block-id="${i}"${m}${b(p.tdStyle)}>
322
+ <p contenteditable="false"${b(u)}>
323
323
  <span class="omnibus-text-before"></span>
324
- <span class="${c}">${r(a)}</span>
324
+ <span class="${a}">${c(r)}</span>
325
325
  <span class="omnibus-text-after"></span>
326
326
  </p>
327
327
  </td>
328
328
  `;
329
329
  }
330
330
  if (t.startsWith(E)) {
331
- const n = s ?? R(), i = e[t] ?? t.slice(E.length), a = t.slice(E.length).replace(/_/g, " ").replace(/\b\w/g, (m) => m.toUpperCase()), d = $("font-size: 12px; color: #666666; margin: 0", n.pStyle), p = y(n.align ?? "left"), b = g.CUSTOM_ATTRIBUTE;
331
+ const n = s ?? _(), i = e[t] ?? t.slice(E.length), r = t.slice(E.length).replace(/_/g, " ").replace(/\b\w/g, (m) => m.toUpperCase()), d = $("font-size: 12px; color: #666666; margin: 0", n.pStyle), p = y(n.align ?? "left"), u = g.CUSTOM_ATTRIBUTE;
332
332
  return `
333
- <td product-attr="${r(i)}"
333
+ <td product-attr="${c(i)}"
334
334
  class="esd-block-text product-custom-attribute"
335
- esd-extension-block-id="${b}"${p}${u(n.tdStyle)}>
336
- <p contenteditable="false"${u(d)}>${r(a)}</p>
335
+ esd-extension-block-id="${u}"${p}${b(n.tdStyle)}>
336
+ <p contenteditable="false"${b(d)}>${c(r)}</p>
337
337
  </td>
338
338
  `;
339
339
  }
340
340
  return null;
341
341
  }
342
- function gt(t, o) {
343
- const { composition: e, visibility: l, perElement: s, customAttrValues: n, cardBg: i } = o, c = i ? `background-color: ${r(i)}` : "", a = c ? `style="table-layout: fixed; ${c}"` : 'style="table-layout: fixed"', d = s[O] ?? {}, p = l[O] !== !1, b = d.width ? ` width="${d.width}"` : "", m = p ? "" : ' style="display: none"', S = `
342
+ function bt(t, o) {
343
+ const { composition: e, visibility: l, perElement: s, customAttrValues: n, cardBg: i } = o, a = i ? `background-color: ${c(i)}` : "", r = a ? `style="table-layout: fixed; ${a}"` : 'style="table-layout: fixed"', d = s[I] ?? {}, p = l[I] !== !1, u = d.width ? ` width="${d.width}"` : "", m = p ? "" : ' style="display: none"', h = `
344
344
  <td width="120"
345
345
  class="esd-block-image product-image-cell recommendation-attribute-row es-p5"
346
346
  esd-extension-block-id="${g.IMAGE}"
347
- data-attribute-type="${O}"
347
+ data-attribute-type="${I}"
348
348
  data-visibility="${p ? "1" : "0"}"
349
349
  align="center" valign="middle"${m}>
350
350
  <a target="_blank" href="https://example.com/product/${t + 1}">
351
- <img src="${J}" alt="Product Name"
352
- class="adapt-img product-image"${b}
351
+ <img src="${Y}" alt="Product Name"
352
+ class="adapt-img product-image"${u}
353
353
  style="display: block; max-width: 100%; height: auto">
354
354
  </a>
355
355
  </td>
356
- `, C = `
356
+ `, w = `
357
357
  <td class="product-info-cell" valign="middle" style="padding: 15px">
358
358
  <table cellpadding="0" cellspacing="0" role="presentation" width="100%"
359
359
  style="table-layout: fixed">
360
- <tbody>${e.filter((h) => h !== O && h !== k).map((h) => {
361
- const B = l[h] !== !1, tt = B ? "" : ' style="display: none"', et = B ? "1" : "0", D = bt(h, s, n, o);
362
- return D ? `<tr class="recommendation-attribute-row"
363
- data-attribute-type="${r(h)}"
364
- data-visibility="${et}"${tt}>${D}</tr>` : "";
360
+ <tbody>${e.filter((P) => P !== I && P !== N).map((P) => {
361
+ const B = l[P] !== !1, tt = B ? "" : ' style="display: none"', et = B ? "1" : "0", M = ut(P, s, n, o);
362
+ return M ? `<tr class="recommendation-attribute-row"
363
+ data-attribute-type="${c(P)}"
364
+ data-visibility="${et}"${tt}>${M}</tr>` : "";
365
365
  }).filter(Boolean).join(`
366
366
  `)}</tbody>
367
367
  </table>
368
368
  </td>
369
- `, f = s[k] ?? {}, w = l[k] !== !1, x = f.text || X, A = $(q, f.spanStyle ?? ""), _ = $(Q, f.aStyle ?? ""), N = w ? "" : ' style="display: none"', U = `
369
+ `, f = s[N] ?? {}, C = l[N] !== !1, S = f.text || J, x = $(X, f.spanStyle ?? ""), A = $(K, f.aStyle ?? ""), Z = C ? "" : ' style="display: none"', W = `
370
370
  <td width="100"
371
371
  class="esd-block-button button-cell recommendation-attribute-row product-button es-p5l es-p5r"
372
372
  esd-extension-block-id="${g.BUTTON}"
373
- data-attribute-type="${k}"
374
- data-visibility="${w ? "1" : "0"}"
375
- align="${r(f.align ?? "center")}" valign="middle"${N}>
376
- <span class="es-button-border" style="${r(A)}">
373
+ data-attribute-type="${N}"
374
+ data-visibility="${C ? "1" : "0"}"
375
+ align="${c(f.align ?? "center")}" valign="middle"${Z}>
376
+ <span class="es-button-border" style="${c(x)}">
377
377
  <a href="https://example.com/product/${t + 1}" target="_blank"
378
- class="es-button ${H}"
379
- style="${r(_)}">${r(x)}</a>
378
+ class="es-button ${z}"
379
+ style="${c(A)}">${c(S)}</a>
380
380
  </span>
381
381
  </td>
382
382
  `;
@@ -384,37 +384,37 @@ function gt(t, o) {
384
384
  <tr class="recommendation-product-row">
385
385
  <td style="padding: 0 5px">
386
386
  <table width="100%" cellpadding="0" cellspacing="0" border="0"
387
- class="product-card-wrapper" ${a}>
387
+ class="product-card-wrapper" ${r}>
388
388
  <tbody>
389
- <tr>${S}${C}${U}</tr>
389
+ <tr>${h}${w}${W}</tr>
390
390
  </tbody>
391
391
  </table>
392
392
  </td>
393
393
  </tr>
394
394
  `;
395
395
  }
396
- function mt(t, o) {
396
+ function gt(t, o) {
397
397
  const e = [];
398
398
  for (let l = 0; l < t; l += 1)
399
- l > 0 && e.push(W), e.push(gt(l, o));
399
+ l > 0 && e.push(Q), e.push(bt(l, o));
400
400
  return e.join("");
401
401
  }
402
- function $t(t, o) {
403
- var a, d, p, b, m, S;
402
+ function mt(t, o) {
403
+ var r, d, p, u, m, h;
404
404
  const e = t == null ? void 0 : t.theme, l = [];
405
- (a = e == null ? void 0 : e.textStyle) != null && a["font-family"] && l.push(`font-family: ${e.textStyle["font-family"]}`), l.push(`font-size: ${((d = e == null ? void 0 : e.textStyle) == null ? void 0 : d["font-size"]) ?? "28px"}`), l.push(`color: ${((p = e == null ? void 0 : e.textColor) == null ? void 0 : p.color) ?? "#333333"}`), (b = e == null ? void 0 : e.textStyle) != null && b["font-weight"] && l.push(`font-weight: ${e.textStyle["font-weight"]}`), (m = e == null ? void 0 : e.textStyle) != null && m["font-style"] && l.push(`font-style: ${e.textStyle["font-style"]}`);
406
- const s = l.join("; "), n = ((S = e == null ? void 0 : e.textStyle) == null ? void 0 : S["font-weight"]) !== "normal", i = r(o), c = n ? `<strong>${i}</strong>` : i;
405
+ (r = e == null ? void 0 : e.textStyle) != null && r["font-family"] && l.push(`font-family: ${e.textStyle["font-family"]}`), l.push(`font-size: ${((d = e == null ? void 0 : e.textStyle) == null ? void 0 : d["font-size"]) ?? "28px"}`), l.push(`color: ${((p = e == null ? void 0 : e.textColor) == null ? void 0 : p.color) ?? "#333333"}`), (u = e == null ? void 0 : e.textStyle) != null && u["font-weight"] && l.push(`font-weight: ${e.textStyle["font-weight"]}`), (m = e == null ? void 0 : e.textStyle) != null && m["font-style"] && l.push(`font-style: ${e.textStyle["font-style"]}`);
406
+ const s = l.join("; "), n = ((h = e == null ? void 0 : e.textStyle) == null ? void 0 : h["font-weight"]) !== "normal", i = c(o), a = n ? `<strong>${i}</strong>` : i;
407
407
  return `
408
408
  <td class="esd-block-text es-p10t es-p10b es-p20l es-p20r" align="center">
409
- <p${u(s)}>${c}</p>
409
+ <p${b(s)}>${a}</p>
410
410
  </td>
411
411
  `;
412
412
  }
413
- function yt(t) {
413
+ function $t(t) {
414
414
  const o = t.alignment === "before" ? "0" : "1";
415
- return ` ${P.CURRENCY}="${r(t.code)}" ${P.SYMBOL}="${r(t.symbol)}" ${P.ALIGNMENT}="${o}" ${P.THOUSAND_SEPARATOR}="${r(t.thousandSeparator)}" ${P.DECIMAL_SEPARATOR}="${r(t.decimalSeparator)}" ${P.DECIMAL_COUNT}="${t.decimalCount}"`;
415
+ return ` ${R.CURRENCY}="${c(t.code)}" ${R.SYMBOL}="${c(t.symbol)}" ${R.ALIGNMENT}="${o}" ${R.THOUSAND_SEPARATOR}="${c(t.thousandSeparator)}" ${R.DECIMAL_SEPARATOR}="${c(t.decimalSeparator)}" ${R.DECIMAL_COUNT}="${t.decimalCount}"`;
416
416
  }
417
- function Ct(t) {
417
+ function Tt(t) {
418
418
  const {
419
419
  nodeConfig: o,
420
420
  composition: e,
@@ -422,13 +422,18 @@ function Ct(t) {
422
422
  titleText: s,
423
423
  extraClasses: n = "",
424
424
  legacyId: i,
425
- legacyBgColor: c,
426
- preserveInnerHtml: a,
427
- skipCompile: d = !1
428
- } = t, p = o.layout === "list" ? ' data-layout="list"' : "", b = o.layout === "list" ? " es-m-p0 ins-recommendation-list-layout" : "", m = e.composition.join(","), S = JSON.stringify(e.customAttributes), T = [
425
+ legacyBgColor: a
426
+ } = t, r = parseInt(o.size) || 6, d = o.layout === "list" ? ' data-layout="list"' : "", p = o.layout === "list" ? " es-m-p0 ins-recommendation-list-layout" : "", u = {
427
+ composition: e.composition,
428
+ visibility: e.visibility,
429
+ perElement: e.perElementStyles,
430
+ customAttrValues: e.customAttrValues,
431
+ cardBg: l,
432
+ ...rt(o.currency)
433
+ }, m = o.layout === "list" ? gt(r, u) : pt(r, o.cardsInRow, u), h = mt(e.titleVariable, s), T = e.composition.join(","), w = JSON.stringify(e.customAttributes), f = [
429
434
  "recommendation-block-v2",
430
435
  "esd-block-recommendation-v3-block",
431
- `es-p20${b}`,
436
+ `es-p20${p}`,
432
437
  `ins-recommendation-v3-block-${o.recommendationId}`,
433
438
  // Marker class Stripo's block infrastructure uses to identify recommendation
434
439
  // blocks. Without it, certain Styles-panel controls (e.g. button "Fit to
@@ -437,18 +442,20 @@ function Ct(t) {
437
442
  "esd-extension-block",
438
443
  "esd-container-frame",
439
444
  "ins-recommendation-no-mobile-layout",
440
- d ? ot : "",
441
445
  n
442
- ].filter(Boolean).join(" "), C = yt(o.currency), f = ` esd-ext-config="${r(JSON.stringify(o))}"`, w = i ? ` id="${r(i)}"` : "", x = c ? ` bgcolor="${r(c)}"` : "", _ = a ?? (() => {
443
- const N = parseInt(o.size) || 6, U = {
444
- composition: e.composition,
445
- visibility: e.visibility,
446
- perElement: e.perElementStyles,
447
- customAttrValues: e.customAttrValues,
448
- cardBg: l,
449
- ...dt(o.currency)
450
- }, h = o.layout === "list" ? mt(N, U) : ut(N, o.cardsInRow, U);
451
- return `
446
+ ].filter(Boolean).join(" "), C = $t(o.currency), S = ` esd-ext-config="${c(JSON.stringify(o))}"`, x = i ? ` id="${c(i)}"` : "", A = a ? ` bgcolor="${c(a)}"` : "";
447
+ return nt(`
448
+ <td align="left"
449
+ esd-extension-block-id="recommendation-block"
450
+ width="520"
451
+ class="${f}"${x}${A}
452
+ recommendation-id="${o.recommendationId}"${C}
453
+ data-card-composition="${c(T)}"
454
+ data-custom-attributes="${c(w)}"
455
+ data-column-spacing="${o.columnSpacing}"
456
+ data-row-spacing="${o.rowSpacing}"
457
+ data-mobile-column-spacing="${o.mobileColumnSpacing}"
458
+ data-mobile-row-spacing="${o.mobileRowSpacing}"${d}${S}>
452
459
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
453
460
  <tbody>
454
461
  <tr>
@@ -459,7 +466,7 @@ function Ct(t) {
459
466
  <td>
460
467
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
461
468
  <tbody>
462
- <tr>${$t(e.titleVariable, s)}</tr>
469
+ <tr>${h}</tr>
463
470
  </tbody>
464
471
  </table>
465
472
  </td>
@@ -470,7 +477,7 @@ function Ct(t) {
470
477
  <tr>
471
478
  <td>
472
479
  <table width="100%" cellpadding="0" cellspacing="0" border="0"
473
- class="${nt}">${h}
480
+ class="${ot}">${m}
474
481
  </table>
475
482
  </td>
476
483
  </tr>
@@ -480,23 +487,10 @@ function Ct(t) {
480
487
  </td>
481
488
  </tr>
482
489
  </tbody>
483
- </table>`;
484
- })();
485
- return lt(`
486
- <td align="left"
487
- esd-extension-block-id="recommendation-block"
488
- width="520"
489
- class="${T}"${w}${x}
490
- recommendation-id="${o.recommendationId}"${C}
491
- data-card-composition="${r(m)}"
492
- data-custom-attributes="${r(S)}"
493
- data-column-spacing="${o.columnSpacing}"
494
- data-row-spacing="${o.rowSpacing}"
495
- data-mobile-column-spacing="${o.mobileColumnSpacing}"
496
- data-mobile-row-spacing="${o.mobileRowSpacing}"${p}${f}>${_}
490
+ </table>
497
491
  </td>
498
492
  `);
499
493
  }
500
494
  export {
501
- Ct as buildBlockHtml
495
+ Tt as buildBlockHtml
502
496
  };