@useinsider/guido 3.14.1-beta.9ad6513 → 3.15.0-beta.0cbd17f

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 (38) hide show
  1. package/dist/composables/useEmailTemplateApplier.js +46 -32
  2. package/dist/composables/useHtmlValidator.js +105 -100
  3. package/dist/composables/useRecommendation.js +20 -19
  4. package/dist/config/i18n/en/labels.json.js +7 -3
  5. package/dist/config/migrator/recommendation/compositionMapper.js +26 -23
  6. package/dist/config/migrator/recommendation/htmlBuilder.js +156 -155
  7. package/dist/extensions/Blocks/Items/block.js +44 -42
  8. package/dist/extensions/Blocks/Items/template.js +86 -86
  9. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +18 -15
  10. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +363 -322
  11. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +37 -26
  12. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +21 -21
  13. package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +8 -8
  14. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +271 -231
  15. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +13 -12
  16. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +16 -16
  17. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +16 -16
  18. package/dist/extensions/Blocks/Recommendation/templates/utils.js +120 -120
  19. package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +55 -54
  20. package/dist/extensions/Blocks/Recommendation/utils/compositionKeys.js +89 -0
  21. package/dist/extensions/Blocks/Recommendation/utils/productIds.js +6 -0
  22. package/dist/extensions/Blocks/common-control.js +42 -35
  23. package/dist/src/composables/useHtmlValidator.d.ts +3 -2
  24. package/dist/src/config/migrator/recommendation/types.d.ts +1 -0
  25. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  26. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +6 -0
  27. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +27 -5
  28. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +4 -2
  29. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +12 -11
  30. package/dist/src/extensions/Blocks/Recommendation/utils/compositionKeys.d.ts +47 -0
  31. package/dist/src/extensions/Blocks/Recommendation/utils/productIds.d.ts +6 -0
  32. package/dist/src/extensions/Blocks/common-control.d.ts +3 -1
  33. package/dist/src/stores/dynamic-content.d.ts +8 -0
  34. package/dist/src/utils/registerUsedDynamicContent.d.ts +8 -0
  35. package/dist/stores/dynamic-content.js +12 -2
  36. package/dist/utils/pairProductVariables.js +105 -99
  37. package/dist/utils/registerUsedDynamicContent.js +23 -0
  38. package/package.json +1 -1
@@ -1,15 +1,16 @@
1
1
  import { getRecommendationFeedSourceMaps as g, getOperatorOptions as R, PriceAttributes as C } from "../../../../enums/extensions/recommendationBlock.js";
2
2
  import { useRecommendationApi as y } from "../../../../services/recommendationApi.js";
3
3
  import { useConfigStore as G } from "../../../../stores/config.js";
4
- import { defineStore as F } from "pinia";
4
+ import { defineStore as P } from "pinia";
5
5
  import "../constants/selectors.js";
6
- import { DEFAULT_MOBILE_CARDS_IN_ROW as P, DEFAULT_CARDS_IN_ROW as D } from "../constants/layout.js";
6
+ import { DEFAULT_MOBILE_CARDS_IN_ROW as F, DEFAULT_CARDS_IN_ROW as D } from "../constants/layout.js";
7
7
  import { EXCLUDED_ALGORITHM_IDS as w } from "../constants/defaultConfig.js";
8
8
  import { getDefaultProducts as S } from "../templates/utils.js";
9
9
  import { generateCompleteFilterQuery as b } from "../utils/filterUtil.js";
10
10
  import { getPartnerRecommendationParams as v } from "../utils/partnerCustomizations.js";
11
- import { isFilterValid as N } from "../validation/filterSchema.js";
12
- import { isConfigValid as x } from "../validation/requiredFields.js";
11
+ import { sanitizeProductIds as N } from "../utils/productIds.js";
12
+ import { isFilterValid as x } from "../validation/filterSchema.js";
13
+ import { isConfigValid as L } from "../validation/requiredFields.js";
13
14
  const h = y();
14
15
  let m = null, u = null, d = null;
15
16
  function k() {
@@ -28,7 +29,7 @@ function k() {
28
29
  productIds: [],
29
30
  id: 1,
30
31
  language: "en_US",
31
- mobileCardsInRow: P,
32
+ mobileCardsInRow: F,
32
33
  mobileLayoutEnabled: !1,
33
34
  orientation: "grid",
34
35
  recommendedProducts: [],
@@ -54,7 +55,7 @@ function I() {
54
55
  filterSnapshot: null
55
56
  };
56
57
  }
57
- const L = () => ({
58
+ const U = () => ({
58
59
  recommendationCampaignUrls: {},
59
60
  activePredictiveAlgorithms: [],
60
61
  languages: {},
@@ -63,8 +64,8 @@ const L = () => ({
63
64
  blockStates: {},
64
65
  currentRecommendationId: null,
65
66
  configVersion: 0
66
- }), $ = F("guidoRecommendationExtension", {
67
- state: () => L(),
67
+ }), H = P("guidoRecommendationExtension", {
68
+ state: () => U(),
68
69
  getters: {
69
70
  // ====================================================================
70
71
  // Proxy Getters — Backward Compatible Access to Current Block State
@@ -383,7 +384,7 @@ const L = () => ({
383
384
  const n = [...e.recommendationConfigs.filters];
384
385
  n[r] = {
385
386
  ...t,
386
- isValid: N(t)
387
+ isValid: x(t)
387
388
  }, e.recommendationConfigs.filters = n;
388
389
  }
389
390
  },
@@ -429,7 +430,7 @@ const L = () => ({
429
430
  * every block's recommendationConfigs across user edits.
430
431
  */
431
432
  hasInvalidBlock() {
432
- return Object.values(this.blockStates).some((t) => !x(t.recommendationConfigs, this));
433
+ return Object.values(this.blockStates).some((t) => !L(t.recommendationConfigs, this));
433
434
  },
434
435
  // ====================================================================
435
436
  // Per-Block Product Fetching
@@ -458,7 +459,7 @@ const L = () => ({
458
459
  details: !0,
459
460
  campaignId: o.variationId
460
461
  };
461
- 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(
462
+ r.strategy === "manualMerchandising" ? a.productId = N(r.productIds) : r.strategy === "similarViewed" && (a.productId = "{itemId}"), r.strategy === "userBased" && (a.userId = "{user_id}"), c && (a.filter = c), r.shuffleProducts && (a.shuffle = !0), Object.assign(
462
463
  a,
463
464
  v(o.partnerName, r.strategy)
464
465
  );
@@ -479,5 +480,5 @@ const L = () => ({
479
480
  }
480
481
  });
481
482
  export {
482
- $ as useRecommendationExtensionStore
483
+ H as useRecommendationExtensionStore
483
484
  };
@@ -28,10 +28,10 @@ const G = `
28
28
  {-{-CELLS-}-}
29
29
  </tr>
30
30
  `;
31
- function j(e, t, n, r = Y, c = {}, i = {}) {
32
- const { cellPadding: s = k, cardBackgroundColor: u, visibility: a, priceInline: o = !1 } = i, d = (100 / t).toFixed(2), p = t - e.length, T = p > 0 ? x(d, s).repeat(p) : "", m = B(n, r, c), R = F(r), L = o ? r.filter((l) => l !== R.skip) : r, C = I(f, i), P = I(O, i);
31
+ function j(t, r, o, e = Y, c = {}, i = {}) {
32
+ const { cellPadding: s = k, cardBackgroundColor: u, visibility: a, priceInline: n = !1 } = i, d = (100 / r).toFixed(2), p = r - t.length, T = p > 0 ? x(d, s).repeat(p) : "", m = B(o, e, c), R = F(e), L = n ? e.filter((l) => l !== R.skip) : e, C = I(f, i), P = I(O, i);
33
33
  return L.filter((l) => m[l]).map((l) => {
34
- const _ = (a == null ? void 0 : a[l]) ?? W[l] ?? !0, b = _ ? "" : 'style="display: none;"', S = I(l, i), D = e.map((E) => (o && l === R.anchor ? H(
34
+ const _ = (a == null ? void 0 : a[l]) ?? W[l] ?? !0, b = _ ? "" : 'style="display: none;"', S = I(l, i, e), D = t.map((E) => (n && l === R.anchor ? H(
35
35
  E,
36
36
  R.originalFirst,
37
37
  C,
@@ -41,36 +41,36 @@ function j(e, t, n, r = Y, c = {}, i = {}) {
41
41
  return V.replace("{-{-ATTR_TYPE-}-}", l).replace("{-{-VISIBILITY-}-}", _ ? "1" : "0").replace("{-{-DISPLAY_STYLE-}-}", b).replace("{-{-CELLS-}-}", D + T);
42
42
  }).join("");
43
43
  }
44
- function v(e, t, n, r, c = {}, i = {}) {
44
+ function v(t, r, o, e, c = {}, i = {}) {
45
45
  const s = [];
46
- for (let o = 0; o < e.length; o += t)
47
- s.push(e.slice(o, o + t));
46
+ for (let n = 0; n < t.length; n += r)
47
+ s.push(t.slice(n, n + r));
48
48
  const u = h(i.rowSpacingPx);
49
- return s.map((o, d) => {
49
+ return s.map((n, d) => {
50
50
  const p = j(
51
- o,
52
- t,
53
51
  n,
54
52
  r,
53
+ o,
54
+ e,
55
55
  c,
56
56
  i
57
57
  ), T = G.replace("{-{-ATTRIBUTE_ROWS-}-}", p);
58
58
  return d > 0 ? u + T : T;
59
59
  }).join("");
60
60
  }
61
- function M(e, t, n, r = {}, c = {}) {
61
+ function M(t, r, o, e = {}, c = {}) {
62
62
  return v(
63
- e,
64
63
  t,
65
- y,
66
- n,
67
64
  r,
65
+ y,
66
+ o,
67
+ e,
68
68
  c
69
69
  );
70
70
  }
71
- function Q(e) {
72
- const t = e ? `ins-recommendation-v3-block-${e}` : void 0, n = U("grid", t), r = A(), c = M(r, w);
73
- return n.replace("{-{-TITLE-}-}", g.TITLE).replace("{-{-PRODUCT_ROWS-}-}", c).replace("{-{-MOBILE_PRODUCT_ROWS-}-}", "");
71
+ function Q(t) {
72
+ const r = t ? `ins-recommendation-v3-block-${t}` : void 0, o = U("grid", r), e = A(), c = M(e, w);
73
+ return o.replace("{-{-TITLE-}-}", g.TITLE).replace("{-{-PRODUCT_ROWS-}-}", c).replace("{-{-MOBILE_PRODUCT_ROWS-}-}", "");
74
74
  }
75
75
  export {
76
76
  Q as getDefaultTemplate,
@@ -1,13 +1,13 @@
1
- import { ATTR_PRODUCT_IMAGE as p, ATTR_PRODUCT_BUTTON as C, ATTR_PRODUCT_OLD_PRICE as A, ATTR_PRODUCT_PRICE as m } from "../../constants/selectors.js";
2
- import { buildSpacer as I, DEFAULT_CARD_COMPOSITION as g, buildElementRenderer as E, buildCellOptions as i, resolveInlinePriceOrder as w, DEFAULT_CARD_VISIBILITY as y } from "../utils.js";
1
+ import { ATTR_PRODUCT_IMAGE as p, ATTR_PRODUCT_BUTTON as C, ATTR_PRODUCT_OLD_PRICE as A, ATTR_PRODUCT_PRICE as I } from "../../constants/selectors.js";
2
+ import { buildSpacer as m, DEFAULT_CARD_COMPOSITION as g, buildElementRenderer as E, buildCellOptions as i, resolveInlinePriceOrder as w, DEFAULT_CARD_VISIBILITY as y } from "../utils.js";
3
3
  import { listElementRenderer as L, renderInlineListPriceRow as O } from "./elementRenderer.js";
4
4
  const S = "0 5px";
5
5
  function U(l, r, n) {
6
- const e = n ? "" : ' style="display: none;"', o = l.replace(/<tr>/, "").replace(/<\/tr>/, "");
6
+ const t = n ? "" : ' style="display: none;"', o = l.replace(/<tr>/, "").replace(/<\/tr>/, "");
7
7
  return `<tr
8
8
  class="recommendation-attribute-row"
9
9
  data-attribute-type="${r}"
10
- data-visibility="${n ? "1" : "0"}"${e}>${o}</tr>`;
10
+ data-visibility="${n ? "1" : "0"}"${t}>${o}</tr>`;
11
11
  }
12
12
  const N = `
13
13
  <tr class="recommendation-product-row">
@@ -27,36 +27,36 @@ const N = `
27
27
  </td>
28
28
  </tr>
29
29
  `;
30
- function x(l, r = g, n = {}, e = {}) {
30
+ function x(l, r = g, n = {}, t = {}) {
31
31
  const {
32
32
  cellPadding: o = S,
33
33
  cardBackgroundColor: d,
34
34
  visibility: c,
35
35
  priceInline: a = !1
36
- } = e, u = d ? ` style="table-layout: fixed; background-color: ${d};"` : ' style="table-layout: fixed;"', s = E(L, r, n), P = s[p](l, i(p, e)), R = w(r), T = `
36
+ } = t, u = d ? ` style="table-layout: fixed; background-color: ${d};"` : ' style="table-layout: fixed;"', s = E(L, r, n), P = s[p](l, i(p, t)), R = w(r), T = `
37
37
  <td class="product-info-cell" valign="middle" style="padding: 15px;">
38
38
  <table cellpadding="0" cellspacing="0" role="presentation" width="100%" style="table-layout: fixed;">
39
39
  <tbody>
40
- ${r.filter((t) => t !== p && t !== C).filter((t) => !(a && t === R.skip)).filter((t) => s[t]).map((t) => {
41
- const b = (c == null ? void 0 : c[t]) ?? y[t] ?? !0, f = a && t === R.anchor ? O(
40
+ ${r.filter((e) => e !== p && e !== C).filter((e) => !(a && e === R.skip)).filter((e) => s[e]).map((e) => {
41
+ const b = (c == null ? void 0 : c[e]) ?? y[e] ?? !0, f = a && e === R.anchor ? O(
42
42
  l,
43
43
  R.originalFirst,
44
- i(m, e),
45
- i(A, e)
46
- ) : s[t](l, i(t, e));
47
- return U(f, t, b);
44
+ i(I, t),
45
+ i(A, t)
46
+ ) : s[e](l, i(e, t, r));
47
+ return U(f, e, b);
48
48
  }).join(`
49
49
  `)}
50
50
  </tbody>
51
51
  </table>
52
52
  </td>
53
- `, _ = s[C](l, i(C, e)), D = P + T + _;
53
+ `, _ = s[C](l, i(C, t)), D = P + T + _;
54
54
  return N.replace("{-{-CARD_PADDING-}-}", o).replace("{-{-WRAPPER_STYLE-}-}", u).replace("{-{-PRODUCT_CONTENT-}-}", D);
55
55
  }
56
- function W(l, r, n = {}, e = {}) {
57
- const o = I(e.rowSpacingPx);
56
+ function W(l, r, n = {}, t = {}) {
57
+ const o = m(t.rowSpacingPx);
58
58
  return l.map((d, c) => {
59
- const a = x(d, r, n, e);
59
+ const a = x(d, r, n, t);
60
60
  return c > 0 ? o + a : a;
61
61
  }).join("");
62
62
  }
@@ -1,8 +1,9 @@
1
- import { ATTR_PRODUCT_PRICE as c, ATTR_PRODUCT_OLD_PRICE as l, ATTR_CUSTOM_PREFIX as a, PRODUCT_ATTRIBUTE_PREFIX as u, ATTR_PRODUCT_IMAGE as f, ATTR_PRODUCT_NAME as T, ATTR_PRODUCT_OMNIBUS_PRICE as C, ATTR_PRODUCT_OMNIBUS_DISCOUNT as p, ATTR_PRODUCT_BUTTON as _ } from "../constants/selectors.js";
2
- import { useRecommendationExtensionStore as D } from "../store/recommendation.js";
3
- import { formatPrice as O } from "../utils/priceFormatter.js";
4
- function E() {
5
- const t = D(), { currencySettings: e } = t.recommendationConfigs;
1
+ import { ATTR_PRODUCT_PRICE as l, ATTR_PRODUCT_OLD_PRICE as a, ATTR_CUSTOM_PREFIX as T, ATTR_PRODUCT_IMAGE as m, ATTR_PRODUCT_NAME as C, ATTR_PRODUCT_OMNIBUS_PRICE as _, ATTR_PRODUCT_OMNIBUS_DISCOUNT as p, ATTR_PRODUCT_BUTTON as y, PRODUCT_ATTRIBUTE_PREFIX as I } from "../constants/selectors.js";
2
+ import { useRecommendationExtensionStore as L } from "../store/recommendation.js";
3
+ import { compositionKeyToProductAttr as A, isDefaultProductAttr as b, bareAttributeName as S, findFilterByBareName as $, productAttrToCompositionKey as h } from "../utils/compositionKeys.js";
4
+ import { formatPrice as B } from "../utils/priceFormatter.js";
5
+ function k() {
6
+ const t = L(), { currencySettings: e } = t.recommendationConfigs;
6
7
  return {
7
8
  code: e.value,
8
9
  symbol: e.symbol,
@@ -12,137 +13,136 @@ function E() {
12
13
  thousandSeparator: e.thousandSeparator
13
14
  };
14
15
  }
15
- function m(t, e = "price") {
16
- const n = E(), o = t[e], r = (o == null ? void 0 : o[n.code]) ?? Object.values(o ?? {})[0] ?? 0;
17
- return O({
18
- price: r,
19
- currency: n
16
+ function f(t, e = "price") {
17
+ const o = k(), n = t[e], c = (n == null ? void 0 : n[o.code]) ?? Object.values(n ?? {})[0] ?? 0;
18
+ return B({
19
+ price: c,
20
+ currency: o
20
21
  });
21
22
  }
22
- function Y(t) {
23
- return m(t, "price") === m(t, "original_price");
23
+ function q(t) {
24
+ return f(t, "price") === f(t, "original_price");
24
25
  }
25
- function I(t) {
26
+ function x(t) {
26
27
  return t.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
27
28
  }
28
- function G(t) {
29
- const e = t.indexOf(c), n = t.indexOf(l), o = n !== -1 && (e === -1 || n < e);
29
+ function J(t) {
30
+ const e = t.indexOf(l), o = t.indexOf(a), n = o !== -1 && (e === -1 || o < e);
30
31
  return {
31
- originalFirst: o,
32
- anchor: o ? l : c,
33
- skip: o ? c : l
32
+ originalFirst: n,
33
+ anchor: n ? a : l,
34
+ skip: n ? l : a
34
35
  };
35
36
  }
36
- function $(t) {
37
+ function N(t) {
37
38
  const e = Array.isArray(t) ? t[t.length - 1] : t;
38
39
  if (typeof e == "string")
39
40
  return e;
40
41
  if (typeof e == "number")
41
42
  return String(e);
42
43
  }
43
- function h(t, e) {
44
- const n = Object.values(e).find((o) => o.attributeName === t);
45
- return (n == null ? void 0 : n.type) === "defaultAttribute";
44
+ function w(t, e) {
45
+ var o;
46
+ return ((o = $(t, e)) == null ? void 0 : o.type) === "defaultAttribute";
46
47
  }
47
- function L(t, e) {
48
- return h(t, e) ? t : `${u}${t}`;
48
+ function F(t, e) {
49
+ return w(t, e) ? t : `${I}${t}`;
49
50
  }
50
- function j(t) {
51
- const e = t.startsWith(u) ? t.substring(u.length) : t;
52
- return `${a}${e}`;
51
+ function Q(t) {
52
+ return h(t);
53
53
  }
54
- const x = Symbol("customCellHtml");
55
- function z(t, e, n = {}) {
56
- const o = t[x];
57
- if (!o)
54
+ const v = Symbol("customCellHtml");
55
+ function Z(t, e, o = {}) {
56
+ const n = t[v];
57
+ if (!n)
58
58
  return { ...t };
59
- const r = { ...t };
60
- return e.filter((s) => s.startsWith(a) && !r[s]).forEach((s) => {
61
- const i = s.substring(a.length), d = I(i), S = L(i, n), A = h(i, n);
62
- r[s] = (g, R) => {
63
- var b;
64
- const P = A ? g[i] : (b = g.product_attributes) == null ? void 0 : b[i], U = $(P) ?? d;
65
- return o(S, U, R);
59
+ const c = { ...t };
60
+ return e.filter((s) => s.startsWith(T) && !c[s]).forEach((s) => {
61
+ const i = A(s), r = b(i) ? F(i, o) : i, u = S(r), R = x(u), D = b(r);
62
+ c[s] = (d, U) => {
63
+ var g;
64
+ const E = D ? d[u] : (g = d.product_attributes) == null ? void 0 : g[u], O = N(E) ?? R;
65
+ return n(r, O, U);
66
66
  };
67
- }), r;
67
+ }), c;
68
68
  }
69
- function V(t, e) {
70
- var n, o, r, s, i;
69
+ function tt(t, e, o = []) {
70
+ const n = t.startsWith(T) ? h(S(A(t))) : t, s = n !== t && !o.includes(n) ? n : t, i = (r) => (r == null ? void 0 : r[t]) ?? (r == null ? void 0 : r[s]);
71
71
  return {
72
72
  cellPadding: e.cellPadding,
73
73
  cardBackgroundColor: e.cardBackgroundColor,
74
- cellBackgroundColor: (n = e.cellBackgroundColors) == null ? void 0 : n[t],
75
- cellAlignment: (o = e.cellAlignments) == null ? void 0 : o[t],
76
- cellClasses: (r = e.cellClasses) == null ? void 0 : r[t],
77
- omnibusText: (s = e.omnibusTexts) == null ? void 0 : s[t],
78
- styleTemplate: (i = e.styleTemplates) == null ? void 0 : i[t]
74
+ cellBackgroundColor: i(e.cellBackgroundColors),
75
+ cellAlignment: i(e.cellAlignments),
76
+ cellClasses: i(e.cellClasses),
77
+ omnibusText: i(e.omnibusTexts),
78
+ styleTemplate: i(e.styleTemplates)
79
79
  };
80
80
  }
81
- const X = {
81
+ const et = {
82
82
  TITLE: "You May Also Like!"
83
- }, K = [
84
- f,
85
- T,
86
- l,
87
- c,
83
+ }, ot = [
84
+ m,
88
85
  C,
86
+ a,
87
+ l,
88
+ _,
89
89
  p,
90
- _
91
- ], q = {
92
- [f]: !0,
93
- [T]: !0,
94
- [c]: !0,
90
+ y
91
+ ], nt = {
92
+ [m]: !0,
93
+ [C]: !0,
95
94
  [l]: !0,
96
- [C]: !1,
95
+ [a]: !0,
96
+ [_]: !1,
97
97
  [p]: !1,
98
- [_]: !0
99
- }, B = 10;
100
- function k(t = B) {
98
+ [y]: !0
99
+ }, M = 10;
100
+ function W(t = M) {
101
101
  return `
102
102
  <tr>
103
103
  <td class="spacer" style="height: ${t}px;"></td>
104
104
  </tr>
105
105
  `;
106
106
  }
107
- const v = k();
108
- function w(t, e) {
107
+ const H = W();
108
+ function V(t, e) {
109
109
  return e ? e.pStyle ?? "" : t;
110
110
  }
111
- function J(t, e, n) {
112
- const o = w(e.pStyle, n), r = n ? n.openTags ?? "" : e.openTags, s = n ? n.closeTags ?? "" : e.closeTags;
113
- return `<p contenteditable="false" style="${o}">${r}${t}${s}</p>`;
111
+ function rt(t, e, o) {
112
+ const n = V(e.pStyle, o), c = o ? o.openTags ?? "" : e.openTags, s = o ? o.closeTags ?? "" : e.closeTags;
113
+ return `<p contenteditable="false" style="${n}">${c}${t}${s}</p>`;
114
114
  }
115
- function Q(t, e) {
116
- const n = [];
117
- return t && n.push(t), e && n.push(`background-color: ${e};`), n.join(" ");
115
+ function st(t, e) {
116
+ const o = [];
117
+ return t && o.push(t), e && o.push(`background-color: ${e};`), o.join(" ");
118
118
  }
119
- function N(t) {
119
+ function Y(t) {
120
120
  return t ? ` background-color: ${t};` : "";
121
121
  }
122
- function Z(t) {
123
- const e = N(t);
122
+ function it(t) {
123
+ const e = Y(t);
124
124
  return e ? ` style="${e.trim()}"` : "";
125
125
  }
126
- function tt(t, e = "") {
126
+ function ct(t, e = "") {
127
127
  return {
128
128
  before: (t == null ? void 0 : t.before) ?? e,
129
129
  after: (t == null ? void 0 : t.after) ?? ""
130
130
  };
131
131
  }
132
- function et(t, e) {
132
+ function lt(t, e) {
133
133
  return `${(e == null ? void 0 : e.openTags) ?? ""}${t}${(e == null ? void 0 : e.closeTags) ?? ""}`;
134
134
  }
135
- function nt(t) {
135
+ function at(t) {
136
136
  return t != null && t.buttonFitToContainer ? "es-button-border es-fw" : "es-button-border";
137
137
  }
138
- const ot = "display: block; max-width: 100%; height: auto;", rt = "border-width: 1px; background: rgb(217, 234, 211); border-color: rgb(106, 168, 79);", st = "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;", y = "https://email-static.useinsider.com/stripo/modules/email-recommendation-v3/assets/images/image-placeholder.png";
139
- function it(t) {
140
- return !t || typeof t != "string" || t.trim() === "" ? y : t.startsWith("http://") ? t.replace("http://", "https://") : t;
138
+ const ut = "display: block; max-width: 100%; height: auto;", dt = "border-width: 1px; background: rgb(217, 234, 211); border-color: rgb(106, 168, 79);", gt = "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;", P = "https://email-static.useinsider.com/stripo/modules/email-recommendation-v3/assets/images/image-placeholder.png";
139
+ function bt(t) {
140
+ return !t || typeof t != "string" || t.trim() === "" ? P : t.startsWith("http://") ? t.replace("http://", "https://") : t;
141
141
  }
142
- function F(t) {
142
+ function G(t) {
143
143
  return {
144
144
  name: "Product Name",
145
- image_url: y,
145
+ image_url: P,
146
146
  price: { USD: 18 },
147
147
  original_price: { USD: 20 },
148
148
  discount: { USD: 2 },
@@ -154,19 +154,19 @@ function F(t) {
154
154
  category: []
155
155
  };
156
156
  }
157
- function ct(t = 6) {
157
+ function ft(t = 6) {
158
158
  return Array.from(
159
159
  { length: t },
160
- (e, n) => F(String(n + 1))
160
+ (e, o) => G(String(o + 1))
161
161
  );
162
162
  }
163
- function lt(t = "grid", e) {
164
- const n = t === "list" ? `
165
- data-layout="list"` : "", o = e ? ` ${e}` : "";
163
+ function Tt(t = "grid", e) {
164
+ const o = t === "list" ? `
165
+ data-layout="list"` : "", n = e ? ` ${e}` : "";
166
166
  return `
167
167
  <td
168
168
  align="left"
169
- class="${`recommendation-block-v2 esd-block-recommendation-v3-block es-p20${t === "list" ? " es-m-p0 ins-recommendation-list-layout" : ""}${o}`}"${n}>
169
+ class="${`recommendation-block-v2 esd-block-recommendation-v3-block es-p20${t === "list" ? " es-m-p0 ins-recommendation-list-layout" : ""}${n}`}"${o}>
170
170
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
171
171
  <tr>
172
172
  <td align="center">
@@ -198,7 +198,7 @@ function lt(t = "grid", e) {
198
198
  </table>
199
199
  </td>
200
200
  </tr>
201
- ${v}
201
+ ${H}
202
202
  <tr>
203
203
  <td>
204
204
  <table
@@ -237,37 +237,37 @@ function lt(t = "grid", e) {
237
237
  `;
238
238
  }
239
239
  export {
240
- x as CUSTOM_CELL_HTML,
241
- X as DEFAULTS,
242
- st as DEFAULT_BUTTON_ANCHOR_STYLE,
243
- rt as DEFAULT_BUTTON_BORDER_STYLE,
244
- K as DEFAULT_CARD_COMPOSITION,
245
- q as DEFAULT_CARD_VISIBILITY,
246
- ot as DEFAULT_IMG_STYLE,
247
- B as DEFAULT_ROW_SPACING_PX,
248
- y as PLACEHOLDER_IMAGE,
249
- N as bgColorFragment,
250
- V as buildCellOptions,
251
- z as buildElementRenderer,
252
- k as buildSpacer,
253
- Z as cellBgStyleAttr,
254
- lt as createBlockTemplate,
255
- m as formatProductPrice,
256
- E as getCurrentCurrencyConfig,
257
- ct as getDefaultProducts,
258
- h as isDefaultAttribute,
259
- Y as isSamePrice,
260
- et as renderButtonLabel,
261
- J as renderStyledParagraph,
262
- nt as resolveButtonBorderClass,
263
- G as resolveInlinePriceOrder,
264
- tt as resolveOmnibusText,
265
- w as resolvePStyle,
266
- L as resolveProductAttrValue,
267
- Q as resolveSegmentBgStyle,
268
- it as sanitizeImageUrl,
269
- v as spacer,
270
- j as toCustomCompositionKey,
271
- I as toDisplayName,
272
- $ as toDisplayableAttributeValue
240
+ v as CUSTOM_CELL_HTML,
241
+ et as DEFAULTS,
242
+ gt as DEFAULT_BUTTON_ANCHOR_STYLE,
243
+ dt as DEFAULT_BUTTON_BORDER_STYLE,
244
+ ot as DEFAULT_CARD_COMPOSITION,
245
+ nt as DEFAULT_CARD_VISIBILITY,
246
+ ut as DEFAULT_IMG_STYLE,
247
+ M as DEFAULT_ROW_SPACING_PX,
248
+ P as PLACEHOLDER_IMAGE,
249
+ Y as bgColorFragment,
250
+ tt as buildCellOptions,
251
+ Z as buildElementRenderer,
252
+ W as buildSpacer,
253
+ it as cellBgStyleAttr,
254
+ Tt as createBlockTemplate,
255
+ f as formatProductPrice,
256
+ k as getCurrentCurrencyConfig,
257
+ ft as getDefaultProducts,
258
+ w as isDefaultAttribute,
259
+ q as isSamePrice,
260
+ lt as renderButtonLabel,
261
+ rt as renderStyledParagraph,
262
+ at as resolveButtonBorderClass,
263
+ J as resolveInlinePriceOrder,
264
+ ct as resolveOmnibusText,
265
+ V as resolvePStyle,
266
+ F as resolveProductAttrValue,
267
+ st as resolveSegmentBgStyle,
268
+ bt as sanitizeImageUrl,
269
+ H as spacer,
270
+ Q as toCustomCompositionKey,
271
+ x as toDisplayName,
272
+ N as toDisplayableAttributeValue
273
273
  };