@useinsider/guido 3.12.0-beta.841bb6a → 3.12.0-beta.86e34da

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/dist/@types/config/schemas.js +9 -4
  2. package/dist/components/Guido.vue.js +6 -6
  3. package/dist/components/Guido.vue2.js +50 -49
  4. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +1 -1
  5. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +8 -8
  6. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +5 -5
  7. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +10 -10
  8. package/dist/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue.js +38 -0
  9. package/dist/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue2.js +271 -0
  10. package/dist/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue.js +18 -0
  11. package/dist/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue2.js +42 -0
  12. package/dist/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue.js +20 -0
  13. package/dist/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue2.js +18 -0
  14. package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue.js +20 -0
  15. package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue2.js +60 -0
  16. package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue.js +19 -0
  17. package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue2.js +19 -0
  18. package/dist/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue.js +22 -0
  19. package/dist/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue2.js +29 -0
  20. package/dist/composables/usePreviewInteractionGuard.js +36 -11
  21. package/dist/composables/useRecommendation.js +56 -40
  22. package/dist/composables/useRecommendationPreview.js +61 -60
  23. package/dist/composables/useStrategyFilters.js +16 -0
  24. package/dist/config/migrator/recommendationMigrator.js +7 -4
  25. package/dist/enums/date.js +4 -3
  26. package/dist/enums/extensions/filteringV2.js +1024 -0
  27. package/dist/enums/extensions/recommendationBlock.js +45 -24
  28. package/dist/enums/extensions/strategyDetail.js +148 -0
  29. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  30. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +12 -11
  31. package/dist/extensions/Blocks/Recommendation/controls/blockBackground/index.js +10 -0
  32. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +141 -123
  33. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +285 -0
  34. package/dist/extensions/Blocks/Recommendation/extension.js +23 -21
  35. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +16 -2
  36. package/dist/extensions/Blocks/Recommendation/recommendation.css.js +257 -0
  37. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +41 -40
  38. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +460 -113
  39. package/dist/extensions/Blocks/Recommendation/utils/strategyHumanizer.js +97 -0
  40. package/dist/extensions/Blocks/Recommendation/utils/strategyNavigation.js +8 -0
  41. package/dist/extensions/Blocks/Recommendation/utils/strategySummary.js +95 -0
  42. package/dist/extensions/Blocks/Recommendation/utils/strategyUrl.js +43 -0
  43. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +24 -10
  44. package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +3 -2
  45. package/dist/extensions/Blocks/common-control.js +2 -1
  46. package/dist/extensions/Blocks/controlFactories.js +125 -75
  47. package/dist/guido.css +1 -1
  48. package/dist/services/recommendationApi.js +120 -32
  49. package/dist/services/stripoApi.js +18 -18
  50. package/dist/src/@types/config/schemas.d.ts +10 -0
  51. package/dist/src/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue.d.ts +2 -0
  52. package/dist/src/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue.d.ts +43 -0
  53. package/dist/src/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue.d.ts +29 -0
  54. package/dist/src/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue.d.ts +40 -0
  55. package/dist/src/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue.d.ts +38 -0
  56. package/dist/src/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue.d.ts +51 -0
  57. package/dist/src/composables/useConfig.d.ts +2 -0
  58. package/dist/src/composables/usePreviewInteractionGuard.d.ts +1 -1
  59. package/dist/src/composables/useRecommendation.d.ts +2 -0
  60. package/dist/src/composables/useStrategyFilters.d.ts +24 -0
  61. package/dist/src/enums/extensions/filteringV2.d.ts +72 -0
  62. package/dist/src/enums/extensions/recommendationBlock.d.ts +33 -0
  63. package/dist/src/enums/extensions/strategyDetail.d.ts +90 -0
  64. package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +1 -0
  65. package/dist/src/extensions/Blocks/Recommendation/controls/blockBackground/index.d.ts +14 -0
  66. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
  67. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +10 -4
  68. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +75 -0
  69. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +903 -1
  70. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +7 -0
  71. package/dist/src/extensions/Blocks/Recommendation/utils/strategyHumanizer.d.ts +50 -0
  72. package/dist/src/extensions/Blocks/Recommendation/utils/strategyNavigation.d.ts +10 -0
  73. package/dist/src/extensions/Blocks/Recommendation/utils/strategySummary.d.ts +34 -0
  74. package/dist/src/extensions/Blocks/Recommendation/utils/strategyUrl.d.ts +51 -0
  75. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +8 -1
  76. package/dist/src/extensions/Blocks/Unsubscribe/utils/constants.d.ts +1 -0
  77. package/dist/src/extensions/Blocks/common-control.d.ts +2 -1
  78. package/dist/src/extensions/Blocks/controlFactories.d.ts +36 -0
  79. package/dist/src/mock/api/recommendation-strategies.d.ts +2 -0
  80. package/dist/src/services/recommendationApi.d.ts +9 -1
  81. package/dist/src/stores/config.d.ts +18 -0
  82. package/dist/src/utils/genericUtil.d.ts +9 -0
  83. package/dist/src/utils/urlSchemes.d.ts +6 -0
  84. package/dist/static/styles/components/base-input.css.js +6 -7
  85. package/dist/utils/dateUtil.js +23 -10
  86. package/dist/utils/genericUtil.js +10 -1
  87. package/dist/utils/pairProductVariables.js +43 -44
  88. package/dist/utils/templatePreparation.js +70 -57
  89. package/dist/utils/urlSchemes.js +4 -0
  90. package/package.json +1 -1
@@ -1,31 +1,30 @@
1
- import { productPairs as N } from "../extensions/Blocks/Items/enums/productEnums.js";
2
- import { DefaultConfigValues as O } from "../extensions/Blocks/Items/enums/settingsEnums.js";
3
- import { preserveTextStyles as C } from "../extensions/Blocks/Recommendation/utils/preserveTextStyles.js";
4
- function V(L) {
5
- const H = L.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), g = new DOMParser().parseFromString(H, "text/html"), m = N.PAIRS_FOR_EXTENSION;
1
+ import { productPairs as q } from "../extensions/Blocks/Items/enums/productEnums.js";
2
+ import { DefaultConfigValues as N } from "../extensions/Blocks/Items/enums/settingsEnums.js";
3
+ function W(M) {
4
+ const S = M.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), g = new DOMParser().parseFromString(S, "text/html"), m = q.PAIRS_FOR_EXTENSION;
6
5
  Object.entries(m).forEach(([r, f]) => {
7
6
  g.querySelectorAll(".ins-product-td").forEach((c) => {
8
- const A = c.getAttribute("data-number") || "1", y = c.getAttribute("data-type") || "CART_ITEMS";
9
- c.querySelectorAll(`[product-attr="${r}"]`).forEach((t) => {
7
+ const A = c.getAttribute("data-number") || "1", C = c.getAttribute("data-type") || "CART_ITEMS";
8
+ c.querySelectorAll(`[product-attr="${r}"]`).forEach((e) => {
10
9
  var F, I, w;
11
- const T = t.getAttribute("data-type") || y, u = t.getAttribute("data-number") || A, d = f[T];
10
+ const $ = e.getAttribute("data-type") || C, u = e.getAttribute("data-number") || A, d = f[$];
12
11
  if (d)
13
12
  switch (r) {
14
13
  case "imageSrc": {
15
- let e = null, i = null;
16
- if (t.tagName === "IMG" ? (e = t, i = e.closest("a")) : (e = t.querySelector("img"), i = t.querySelector("a") || t.closest("a")), !e)
14
+ let t = null, i = null;
15
+ if (e.tagName === "IMG" ? (t = e, i = t.closest("a")) : (t = e.querySelector("img"), i = e.querySelector("a") || e.closest("a")), !t)
17
16
  break;
18
17
  const a = d.DEFAULT, s = d.ATTR;
19
- if (a && e.src) {
20
- const o = e.src;
18
+ if (a && t.src) {
19
+ const o = t.src;
21
20
  a.some((h) => {
22
- const l = h.split("/").pop() || "", $ = o.split("/").pop() || "";
23
- return o.includes(h) || o.includes(l) || $ === l;
24
- }) && (e.src = `{{${s}_${u}}}`);
21
+ const l = h.split("/").pop() || "", b = o.split("/").pop() || "";
22
+ return o.includes(h) || o.includes(l) || b === l;
23
+ }) && (t.src = `{{${s}_${u}}}`);
25
24
  }
26
- const n = (I = (F = m.name) == null ? void 0 : F[T]) == null ? void 0 : I.ATTR;
27
- if (n && e.setAttribute("alt", `{{${n}_${u}}}`), i) {
28
- const o = (w = m.itemLink) == null ? void 0 : w[T];
25
+ const n = (I = (F = m.name) == null ? void 0 : F[$]) == null ? void 0 : I.ATTR;
26
+ if (n && t.setAttribute("alt", `{{${n}_${u}}}`), i) {
27
+ const o = (w = m.itemLink) == null ? void 0 : w[$];
29
28
  if (o) {
30
29
  const E = o.HREF, h = o.DEFAULT_HREF || "#!", l = i.href;
31
30
  (l === "#" || l === "" || l.endsWith("#!") || l.endsWith(h) || l === `${window.location.href}${h}` || !l || l === window.location.href) && (i.href = `{{${E}_${u}}}`);
@@ -34,9 +33,9 @@ function V(L) {
34
33
  break;
35
34
  }
36
35
  case "name": {
37
- const e = d, i = e.ATTR, a = e.DEFAULT_HREF || "#!", s = e.HREF;
38
- t.textContent && (t.innerHTML = C(t, `{{${i}_${u}}}`));
39
- const n = t.closest("a") || (t.tagName === "A" ? t : null);
36
+ const t = d, i = t.ATTR, a = t.DEFAULT_HREF || "#!", s = t.HREF;
37
+ e.textContent && (e.textContent = `{{${i}_${u}}}`);
38
+ const n = e.closest("a") || (e.tagName === "A" ? e : null);
40
39
  if (n && s) {
41
40
  const o = n.href, E = `${window.location.href}${a}`;
42
41
  (o === E || o.endsWith(a)) && (n.href = `{{${s}_${u}}}`);
@@ -45,23 +44,23 @@ function V(L) {
45
44
  }
46
45
  case "price":
47
46
  case "originalPrice": {
48
- const e = d, i = t.getAttribute("data-formated"), a = t.getAttribute("data-single_price"), s = i === "true", n = a === "true", o = t.getAttribute("data-curency") || "before";
47
+ const t = d, i = e.getAttribute("data-formated"), a = e.getAttribute("data-single_price"), s = i === "true", n = a === "true", o = e.getAttribute("data-curency") || "before";
49
48
  let E;
50
- n ? E = s ? e.SINGLE_PRICE_FORMATTED : e.SINGLE_PRICE : E = s ? e.PRICE_FORMATTED : e.PRICE;
51
- const h = e.CURRENCY;
49
+ n ? E = s ? t.SINGLE_PRICE_FORMATTED : t.SINGLE_PRICE : E = s ? t.PRICE_FORMATTED : t.PRICE;
50
+ const h = t.CURRENCY;
52
51
  let l = `{{${E}_${u}}}`;
53
- const $ = (t.getAttribute("data-currency_symbol") || "").trim(), q = $ !== "" && $ !== O.productPriceCurrencySymbolControlValue;
54
- let b = "";
55
- q ? b = $ : h && (b = `{{${h}_${u}}}`), b && (l = o === "after" ? `${l} ${b}` : `${b} ${l}`), t.innerHTML = C(t, l);
52
+ const b = (e.getAttribute("data-currency_symbol") || "").trim(), x = b !== "" && b !== N.productPriceCurrencySymbolControlValue;
53
+ let T = "";
54
+ x ? T = b : h && (T = `{{${h}_${u}}}`), T && (l = o === "after" ? `${l} ${T}` : `${T} ${l}`), e.textContent = l;
56
55
  break;
57
56
  }
58
57
  case "quantity": {
59
- const e = d, i = e.ATTR, a = e.DEFAULT;
60
- t.textContent && t.textContent.trim() === a && (t.innerHTML = C(t, `{{${i}_${u}}}`));
58
+ const t = d, i = t.ATTR, a = t.DEFAULT;
59
+ e.textContent && e.textContent.trim() === a && (e.textContent = `{{${i}_${u}}}`);
61
60
  break;
62
61
  }
63
62
  case "button": {
64
- const e = d, i = e.HREF, a = e.DEFAULT_HREF || "#!", s = t.tagName === "A" ? t : t.querySelector("a");
63
+ const t = d, i = t.HREF, a = t.DEFAULT_HREF || "#!", s = e.tagName === "A" ? e : e.querySelector("a");
65
64
  if (s) {
66
65
  const n = s.href || "", o = `${window.location.href}${a}`;
67
66
  (n === "" || n === "#" || n === o || n.endsWith(a) || n.endsWith("#!") || n === window.location.href) && (s.href = `{{${i}_${u}}}`);
@@ -69,7 +68,7 @@ function V(L) {
69
68
  break;
70
69
  }
71
70
  case "itemLink": {
72
- const e = d, i = e.HREF, a = e.DEFAULT_HREF || "#!", s = t;
71
+ const t = d, i = t.HREF, a = t.DEFAULT_HREF || "#!", s = e;
73
72
  if (s.href) {
74
73
  const n = s.href, o = `${window.location.href}${a}`;
75
74
  (n === o || n.endsWith(a)) && (s.href = `{{${i}_${u}}}`);
@@ -78,8 +77,8 @@ function V(L) {
78
77
  }
79
78
  default: {
80
79
  if ("ATTR" in d) {
81
- const e = d.ATTR;
82
- t.textContent && (t.innerHTML = C(t, `{{${e}_${u}}}`));
80
+ const t = d.ATTR;
81
+ e.textContent && (e.textContent = `{{${t}_${u}}}`);
83
82
  }
84
83
  break;
85
84
  }
@@ -87,11 +86,11 @@ function V(L) {
87
86
  });
88
87
  });
89
88
  });
90
- const k = H.match(/<!DOCTYPE[^>]*>/i), P = k ? `${k[0]}
91
- ` : "", D = g.querySelectorAll(".ins-product-td"), M = [];
89
+ const H = S.match(/<!DOCTYPE[^>]*>/i), P = H ? `${H[0]}
90
+ ` : "", D = g.querySelectorAll(".ins-product-td"), k = [];
92
91
  D.forEach((r) => {
93
92
  const f = r.getAttribute("data-type") || "CART_ITEMS", p = r.getAttribute("data-number") || "1", c = r.getAttribute("data-nodup"), A = r.outerHTML;
94
- M.push({
93
+ k.push({
95
94
  element: r,
96
95
  outerHtml: A,
97
96
  type: f,
@@ -100,7 +99,7 @@ function V(L) {
100
99
  });
101
100
  });
102
101
  let _ = P + g.documentElement.outerHTML;
103
- M.reverse().forEach(({ outerHtml: r, type: f, number: p }) => {
102
+ k.reverse().forEach(({ outerHtml: r, type: f, number: p }) => {
104
103
  let c = "";
105
104
  switch (f) {
106
105
  case "CART_ITEMS":
@@ -114,21 +113,21 @@ function V(L) {
114
113
  break;
115
114
  }
116
115
  if (c) {
117
- const y = parseInt(p) - 1, T = `${`{% if ${c} > ${y} %}`}${r}{% endif %}`;
118
- _ = _.replace(r, T);
116
+ const C = parseInt(p) - 1, $ = `${`{% if ${c} > ${C} %}`}${r}{% endif %}`;
117
+ _ = _.replace(r, $);
119
118
  }
120
119
  });
121
- const x = g.querySelectorAll('[product-attr="originalPrice"][data-type="CART_ITEMS"]'), R = [];
122
- return x.forEach((r) => {
120
+ const L = g.querySelectorAll('[product-attr="originalPrice"][data-type="CART_ITEMS"]'), y = [];
121
+ return L.forEach((r) => {
123
122
  const f = r.getAttribute("data-number"), p = r.getAttribute("data-type");
124
123
  if (!f || p !== "CART_ITEMS")
125
124
  return;
126
125
  const c = r.closest(".product-original-price-class");
127
126
  if (c) {
128
127
  const A = c.outerHTML;
129
- R.some((S) => S.tdOuterHtml === A) || R.push({ tdOuterHtml: A, number: f });
128
+ y.some((R) => R.tdOuterHtml === A) || y.push({ tdOuterHtml: A, number: f });
130
129
  }
131
- }), R.reverse().forEach(({ tdOuterHtml: r, number: f }) => {
130
+ }), y.reverse().forEach(({ tdOuterHtml: r, number: f }) => {
132
131
  const p = `{% if ins_apr_price_${f} != ins_apr_originalprice_${f} %}`;
133
132
  if (!_.includes(p) && !r.includes("{% if")) {
134
133
  const A = `${p}${r}{% endif %}`;
@@ -137,5 +136,5 @@ function V(L) {
137
136
  }), _.replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("&lt;!--{%", "{%").replaceAll("%}--&gt;", "%}");
138
137
  }
139
138
  export {
140
- V as pairProductVariables
139
+ W as pairProductVariables
141
140
  };
@@ -1,106 +1,119 @@
1
1
  import { useActionsApi as P } from "../composables/useActionsApi.js";
2
- import { useHtmlCompiler as w } from "../composables/useHtmlCompiler.js";
3
- import { DEFAULT_CURRENCY as l, DEFAULT_NODE_CONFIG as i } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
4
- import { useRecommendationExtensionStore as b } from "../extensions/Blocks/Recommendation/store/recommendation.js";
5
- import { mapLegacyStrategy as E } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
6
- import { DATA_ATTRIBUTES as h } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
7
- import { parsePageList as H } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
8
- import { useDynamicContentStore as U } from "../stores/dynamic-content.js";
9
- import { useUnsubscribeStore as F } from "../stores/unsubscribe.js";
10
- function L(s) {
11
- const o = new DOMParser().parseFromString(s, "text/html").querySelectorAll(`[${h.PAGE_LIST}]`), t = [];
12
- return o.forEach((a) => {
13
- const n = a.getAttribute(h.PAGE_LIST);
14
- n && t.push(...H(n));
15
- }), [...new Set(t)];
2
+ import { useHtmlCompiler as D } from "../composables/useHtmlCompiler.js";
3
+ import { DEFAULT_CURRENCY as u, DEFAULT_NODE_CONFIG as n } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
4
+ import { useRecommendationExtensionStore as w } from "../extensions/Blocks/Recommendation/store/recommendation.js";
5
+ import { mapLegacyStrategy as I } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
6
+ import { DATA_ATTRIBUTES as b } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
7
+ import { parsePageList as U } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
8
+ import { useDynamicContentStore as E } from "../stores/dynamic-content.js";
9
+ import { useUnsubscribeStore as H } from "../stores/unsubscribe.js";
10
+ function R(m) {
11
+ const a = new DOMParser().parseFromString(m, "text/html").querySelectorAll(`[${b.PAGE_LIST}]`), r = [];
12
+ return a.forEach((t) => {
13
+ const i = t.getAttribute(b.PAGE_LIST);
14
+ i && r.push(...U(i));
15
+ }), [...new Set(r)];
16
16
  }
17
- async function R(s) {
18
- const m = new DOMParser().parseFromString(s, "text/html").querySelectorAll(".recommendation-block-v2");
19
- if (m.length === 0)
17
+ async function F(m) {
18
+ const l = new DOMParser().parseFromString(m, "text/html").querySelectorAll(".recommendation-block-v2");
19
+ if (l.length === 0)
20
20
  return;
21
- const o = b();
22
- m.forEach((t) => {
23
- var c, p, g, f, r;
24
- const a = t.getAttribute("recommendation-id"), n = a ? Number(a) : NaN;
25
- if (!Number.isFinite(n))
21
+ const a = w(), r = /* @__PURE__ */ new Set();
22
+ l.forEach((t) => {
23
+ var f, y, d, S, o;
24
+ const i = t.getAttribute("recommendation-id"), g = i ? Number(i) : NaN;
25
+ if (!Number.isFinite(g))
26
26
  return;
27
- const d = t.getAttribute("esd-ext-config");
28
- if (!d)
27
+ const c = t.getAttribute("esd-ext-config");
28
+ if (!c)
29
29
  return;
30
30
  let e;
31
31
  try {
32
- e = JSON.parse(d);
32
+ e = JSON.parse(c);
33
33
  } catch {
34
34
  return;
35
35
  }
36
36
  if (!e || typeof e != "object" || Array.isArray(e))
37
37
  return;
38
- const y = {
38
+ const s = {
39
39
  // Normalize legacy strategy keys (e.g. `mostViewed` → `mostPopular`) so
40
40
  // already-saved blocks that never re-run the migrator don't emit a
41
41
  // strategy-less campaign URL. `||` also catches '' / undefined (SD-144882).
42
- strategy: E(e.strategy) || i.strategy,
43
- language: e.language ?? i.language,
44
- size: e.size ?? i.size,
42
+ strategy: I(e.strategy) || n.strategy,
43
+ strategyId: e.strategyId ?? n.strategyId,
44
+ language: e.language ?? n.language,
45
+ size: e.size ?? n.size,
45
46
  // Spread the default arrays so each block gets a fresh reference
46
47
  // instead of sharing the singleton in DEFAULT_NODE_CONFIG.
47
- productIds: e.productIds ?? [...i.productIds],
48
- filters: e.filters ?? [...i.filters],
49
- shuffleProducts: e.shuffleProducts ?? i.shuffleProducts,
50
- currencyCode: ((c = e.currency) == null ? void 0 : c.code) ?? l.code,
51
- currencyAlignment: ((p = e.currency) == null ? void 0 : p.alignment) ?? l.alignment,
52
- currencyDecimalCount: ((g = e.currency) == null ? void 0 : g.decimalCount) ?? l.decimalCount,
53
- currencyDecimalSeparator: ((f = e.currency) == null ? void 0 : f.decimalSeparator) ?? l.decimalSeparator,
54
- currencyThousandSeparator: ((r = e.currency) == null ? void 0 : r.thousandSeparator) ?? l.thousandSeparator
48
+ productIds: e.productIds ?? [...n.productIds],
49
+ filters: e.filters ?? [...n.filters],
50
+ shuffleProducts: e.shuffleProducts ?? n.shuffleProducts,
51
+ currencyCode: ((f = e.currency) == null ? void 0 : f.code) ?? u.code,
52
+ currencyAlignment: ((y = e.currency) == null ? void 0 : y.alignment) ?? u.alignment,
53
+ currencyDecimalCount: ((d = e.currency) == null ? void 0 : d.decimalCount) ?? u.decimalCount,
54
+ currencyDecimalSeparator: ((S = e.currency) == null ? void 0 : S.decimalSeparator) ?? u.decimalSeparator,
55
+ currencyThousandSeparator: ((o = e.currency) == null ? void 0 : o.thousandSeparator) ?? u.thousandSeparator
55
56
  };
56
- o.seedBlockUrlConfig(n, y);
57
+ a.seedBlockUrlConfig(g, s), r.add(s.strategyId);
57
58
  });
58
59
  try {
59
- await o.fetchRecommendationCreateData();
60
+ await a.fetchRecommendationCreateData();
60
61
  } catch (t) {
61
62
  console.warn(
62
63
  "Recommendation reference data pre-load failed; validator will skip the availability check.",
63
64
  t
64
65
  );
65
66
  }
67
+ if (r.delete(""), !!r.size) {
68
+ try {
69
+ await a.fetchRecommendationStrategies();
70
+ } catch (t) {
71
+ console.warn("Strategy listing pre-load failed; the deleted-strategy save check will be skipped.", t);
72
+ }
73
+ await Promise.all(
74
+ [...r].map((t) => a.fetchStrategyUrlTemplate(t))
75
+ );
76
+ }
66
77
  }
67
78
  const G = () => {
68
- const s = U(), u = F(), { getCompiledEmail: m, getTemplateData: o } = P(), { compileHtml: t, compileAmpHtml: a } = w();
79
+ const m = E(), p = H(), { getCompiledEmail: l, getTemplateData: a } = P(), { compileHtml: r, compileAmpHtml: t } = D();
69
80
  return {
70
81
  prepareTemplateDetails: async () => {
71
- const { html: d, ampHtml: e = "", ampErrors: y = [] } = await m({
82
+ const { html: g, ampHtml: c = "", ampErrors: e = [] } = await l({
72
83
  minimize: !0,
73
84
  resetDataSavedFlag: !1
74
- }), { html: c, css: p, syncModulesIds: g = [] } = await o();
75
- u.selectedUnsubscribePages.length && await u.fetchTemplates(), await R(c);
76
- const { compiledHtml: f, stats: r, appliedRules: A } = t(d), C = e && a(e).compiledHtml, T = s.getSelectedDynamicContentList, D = b(), S = L(c);
85
+ }), { html: s, css: f, syncModulesIds: y = [] } = await a();
86
+ p.selectedUnsubscribePages.length && await p.fetchTemplates(), await F(s);
87
+ const d = w();
88
+ await d.awaitPendingStrategyUrls();
89
+ const { compiledHtml: S, stats: o, appliedRules: A } = r(g), C = c && t(c).compiledHtml, T = m.getSelectedDynamicContentList, h = R(s);
77
90
  return console.debug("HTML Compilation Stats:", {
78
- originalSize: r.originalSize,
79
- compiledSize: r.compiledSize,
80
- reduction: `${r.reductionPercentage.toFixed(2)}%`,
91
+ originalSize: o.originalSize,
92
+ compiledSize: o.compiledSize,
93
+ reduction: `${o.reductionPercentage.toFixed(2)}%`,
81
94
  appliedRules: A,
82
- executionTime: `${r.executionTime.toFixed(2)}ms`
95
+ executionTime: `${o.executionTime.toFixed(2)}ms`
83
96
  }), {
84
97
  dynamicContentList: T,
85
- compiledHtml: f,
86
- rawHtml: c,
87
- css: p,
98
+ compiledHtml: S,
99
+ rawHtml: s,
100
+ css: f,
88
101
  ampHtml: C,
89
- ampErrors: y,
90
- modules: g.map(Number),
102
+ ampErrors: e,
103
+ modules: y.map(Number),
91
104
  recommendation: {
92
- campaignUrls: D.recommendationCampaignUrls,
105
+ campaignUrls: d.recommendationCampaignUrls,
93
106
  configs: {}
94
107
  },
95
108
  unsubscribe: {
96
- status: S.length > 0,
97
- config: S
109
+ status: h.length > 0,
110
+ config: h
98
111
  }
99
112
  };
100
113
  }
101
114
  };
102
115
  };
103
116
  export {
104
- L as getHtmlReferencedUnsubscribePages,
117
+ R as getHtmlReferencedUnsubscribePages,
105
118
  G as useTemplatePreparation
106
119
  };
@@ -0,0 +1,4 @@
1
+ const t = ["http:", "https:", "mailto:"];
2
+ export {
3
+ t as BASE_SAFE_URL_SCHEMES
4
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.12.0-beta.841bb6a",
3
+ "version": "3.12.0-beta.86e34da",
4
4
  "description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
5
5
  "main": "./dist/guido.umd.cjs",
6
6
  "module": "./dist/library.js",