@useinsider/guido 3.14.0-beta.1e474dd → 3.14.0-beta.38ec3aa

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