@useinsider/guido 3.8.0-beta.bf9ea20 → 3.8.0-beta.eb4074b

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 (56) hide show
  1. package/dist/composables/useHtmlValidator.js +180 -133
  2. package/dist/config/compiler/utils/recommendationCompilerUtils.js +64 -69
  3. package/dist/config/compiler/utils/recommendationIgnoreUtils.js +15 -0
  4. package/dist/config/migrator/recommendation/extractors.js +44 -22
  5. package/dist/config/migrator/recommendation/htmlBuilder.js +175 -169
  6. package/dist/config/migrator/recommendationMigrator.js +30 -31
  7. package/dist/extensions/Blocks/Items/block.js +29 -48
  8. package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +45 -62
  9. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +22 -15
  10. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +55 -41
  11. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +42 -43
  12. package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +48 -45
  13. package/dist/extensions/Blocks/Recommendation/controls/main/productCount.js +3 -2
  14. package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +64 -60
  15. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +294 -335
  16. package/dist/extensions/Blocks/Recommendation/controls/syncInfoMessage.js +7 -6
  17. package/dist/extensions/Blocks/Recommendation/extension.js +7 -5
  18. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +4 -2
  19. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +3 -2
  20. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +142 -173
  21. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +56 -29
  22. package/dist/extensions/Blocks/Recommendation/templates/index.js +30 -8
  23. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +132 -105
  24. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +44 -23
  25. package/dist/extensions/Blocks/Recommendation/templates/utils.js +112 -64
  26. package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +219 -0
  27. package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +24 -19
  28. package/dist/extensions/Blocks/Recommendation/utils/tagName.js +30 -22
  29. package/dist/extensions/Blocks/Unsubscribe/block.js +1 -1
  30. package/dist/extensions/Blocks/controlFactories.js +159 -133
  31. package/dist/src/composables/useHtmlValidator.d.ts +27 -0
  32. package/dist/src/composables/useHtmlValidator.test.d.ts +1 -0
  33. package/dist/src/config/compiler/utils/recommendationIgnoreUtils.d.ts +17 -0
  34. package/dist/src/config/compiler/utils/recommendationIgnoreUtils.test.d.ts +1 -0
  35. package/dist/src/config/migrator/recommendation/extractors.d.ts +15 -0
  36. package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +8 -0
  37. package/dist/src/extensions/Blocks/Items/block.d.ts +0 -8
  38. package/dist/src/extensions/Blocks/Items/controls/index.d.ts +1 -1
  39. package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +1 -1
  40. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  41. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +23 -0
  42. package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +1 -1
  43. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +7 -0
  44. package/dist/src/extensions/Blocks/Recommendation/controls/main/layoutOrientation.d.ts +7 -1
  45. package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +6 -0
  46. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +29 -47
  47. package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
  48. package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +1 -1
  49. package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -2
  50. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +165 -11
  51. package/dist/src/extensions/Blocks/Recommendation/utils/captureStyleTemplates.d.ts +78 -0
  52. package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +15 -0
  53. package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +29 -9
  54. package/dist/src/extensions/Blocks/controlFactories.d.ts +11 -1
  55. package/package.json +1 -1
  56. package/dist/src/extensions/Blocks/Recommendation/utils/stylePreserver.d.ts +0 -113
@@ -1,14 +1,14 @@
1
1
  import { BlockId as f } from "../../enums/block.js";
2
- import { useTemplateStore as u } from "../../stores/template.js";
3
- import { mapComposition as b } from "./recommendation/compositionMapper.js";
4
- import { extractTitleText as y, extractCardBgColor as C } from "./recommendation/extractors.js";
5
- import { buildBlockHtml as v } from "./recommendation/htmlBuilder.js";
6
- import { parseRecommendationId as w, parseLegacyConfig as R } from "./recommendation/parseLegacyConfig.js";
7
- import { mapSettings as S } from "./recommendation/settingsMapper.js";
2
+ import { useTemplateStore as b } from "../../stores/template.js";
3
+ import { mapComposition as y } from "./recommendation/compositionMapper.js";
4
+ import { extractCurrencyFromBlock as v, extractTitleText as C, extractCardBgColor as M, isPartnerManagedBlock as S } from "./recommendation/extractors.js";
5
+ import { buildBlockHtml as w } from "./recommendation/htmlBuilder.js";
6
+ import { parseRecommendationId as x, parseLegacyConfig as R } from "./recommendation/parseLegacyConfig.js";
7
+ import { mapSettings as T } from "./recommendation/settingsMapper.js";
8
8
  const h = 'td[esd-dev-product-config][class*="ins-recommendation-v3-block-"]:not(.recommendation-block-v2), td.product-block[esd-handler-name*="EmailRecommendationV3"][esd-dev-product-config]:not(.recommendation-block-v2)';
9
- function x(i, t, c) {
10
- var s;
11
- const o = w(t);
9
+ function B(i, t, a) {
10
+ var d;
11
+ const o = x(t);
12
12
  if (o === null)
13
13
  return console.warn(
14
14
  "[RecommendationMigrator] Skipping block — missing/invalid `ins-recommendation-v3-campaign-id`"
@@ -18,30 +18,29 @@ function x(i, t, c) {
18
18
  return console.warn(
19
19
  `[RecommendationMigrator] Aborting block id=${o} — \`esd-dev-product-config\` missing or unable to be parsed`
20
20
  ), !1;
21
- const n = c[String(o)];
22
- if (!n)
23
- return console.warn(
24
- `[RecommendationMigrator] Aborting block id=${o} — recommendationConfigs entry missing in Guido Config`
25
- ), !1;
26
- const a = S(n, r, o), e = b((s = r.composition) == null ? void 0 : s.variables), d = y(t), l = C(t), g = {
27
- ...a,
21
+ const n = a[String(o)] ?? {
22
+ currencySettings: v(t)
23
+ }, c = T(n, r, o), e = y((d = r.composition) == null ? void 0 : d.variables), l = C(t), g = M(t), p = {
24
+ ...c,
28
25
  composition: e.composition,
29
26
  visibility: e.visibility,
30
27
  textTrimming: e.anyTextTrimming
31
- }, p = `
28
+ }, m = S(t), u = `
32
29
  <table>
33
30
  <tbody>
34
31
  <tr>
35
32
  <td class="esd-structure" align="left">
36
33
  <table width="100%" cellpadding="0" cellspacing="0">
37
34
  <tbody>
38
- <tr>${v({
39
- nodeConfig: g,
35
+ <tr>${w({
36
+ nodeConfig: p,
40
37
  composition: e,
41
- cardBg: l,
42
- titleText: d,
38
+ cardBg: g,
39
+ titleText: l,
43
40
  legacyId: t.getAttribute("id") ?? void 0,
44
- legacyBgColor: t.getAttribute("bgcolor") ?? void 0
41
+ legacyBgColor: t.getAttribute("bgcolor") ?? void 0,
42
+ preserveInnerHtml: m ? t.innerHTML : void 0,
43
+ skipCompile: m
45
44
  })}</tr>
46
45
  </tbody>
47
46
  </table>
@@ -49,15 +48,15 @@ function x(i, t, c) {
49
48
  </tr>
50
49
  </tbody>
51
50
  </table>
52
- `, m = i.parseFromString(p, "text/html").querySelector("td.esd-structure");
53
- return !m || !t.parentNode ? (console.warn(
51
+ `, s = i.parseFromString(u, "text/html").querySelector("td.esd-structure");
52
+ return !s || !t.parentNode ? (console.warn(
54
53
  `[RecommendationMigrator] Aborting block id=${o} — failed to construct new HTML element`
55
- ), !1) : (t.parentNode.replaceChild(m, t), !0);
54
+ ), !1) : (t.parentNode.replaceChild(s, t), !0);
56
55
  }
57
- function I(i, t = {}) {
58
- const c = new DOMParser(), o = c.parseFromString(i, "text/html"), r = Array.from(o.querySelectorAll(h));
56
+ function q(i, t = {}) {
57
+ const a = new DOMParser(), o = a.parseFromString(i, "text/html"), r = Array.from(o.querySelectorAll(h));
59
58
  try {
60
- u().$patch((e) => {
59
+ b().$patch((e) => {
61
60
  e.migrations = {
62
61
  ...e.migrations,
63
62
  [f.Recommendation]: r.length
@@ -68,14 +67,14 @@ function I(i, t = {}) {
68
67
  if (r.length === 0)
69
68
  return i;
70
69
  let n = 0;
71
- return r.forEach((a) => {
70
+ return r.forEach((c) => {
72
71
  try {
73
- x(c, a, t) && (n += 1);
72
+ B(a, c, t) && (n += 1);
74
73
  } catch (e) {
75
74
  console.error("[RecommendationMigrator] Unexpected error migrating block:", e);
76
75
  }
77
76
  }), n > 0 && console.info(`[RecommendationMigrator] Migrated ${n} legacy Recommendation block(s)`), o.documentElement.outerHTML;
78
77
  }
79
78
  export {
80
- I as migrateRecommendation
79
+ q as migrateRecommendation
81
80
  };
@@ -1,20 +1,20 @@
1
- import { BlockId as u } from "../../../enums/block.js";
1
+ import { BlockId as g } from "../../../enums/block.js";
2
2
  import { useOnboardingStore as p } from "../../../stores/onboarding.js";
3
- import { getMigrationBannerHtml as C } from "../../../utils/migrationBannerHtml.js";
4
- import { Block as I, BlockCompositionType as y, ModificationDescription as s } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
- import { SETTINGS_ENUMS as c, DefaultConfigValues as a } from "./enums/settingsEnums.js";
6
- import { getDefaultTemplate as h } from "./template.js";
7
- import { getItemsBlockContainer as l, getItemsBlockConfig as m, getDefaultItemsBlockConfig as b } from "./utils/nodeConfigUtils.js";
8
- const d = u.Items;
9
- class E extends I {
3
+ import { getMigrationBannerHtml as f } from "../../../utils/migrationBannerHtml.js";
4
+ import { Block as u, BlockCompositionType as I, ModificationDescription as o } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
+ import { SETTINGS_ENUMS as a, DefaultConfigValues as i } from "./enums/settingsEnums.js";
6
+ import { getDefaultTemplate as C } from "./template.js";
7
+ import { getItemsBlockContainer as y, getItemsBlockConfig as b, getDefaultItemsBlockConfig as h } from "./utils/nodeConfigUtils.js";
8
+ const c = g.Items;
9
+ class E extends u {
10
10
  getId() {
11
- return d;
11
+ return c;
12
12
  }
13
13
  getIcon() {
14
14
  return "items-icon";
15
15
  }
16
16
  getBlockCompositionType() {
17
- return y.CONTAINER;
17
+ return I.CONTAINER;
18
18
  }
19
19
  getName() {
20
20
  return this.api.translate("Items");
@@ -23,60 +23,41 @@ class E extends I {
23
23
  return this.api.translate("Items lets you display personalized products based on user behavior.");
24
24
  }
25
25
  getSettingsPanelTitleHtml() {
26
- return C(
27
- d,
26
+ return f(
27
+ c,
28
28
  this.api.translate("Items"),
29
29
  this.api.translate("This block is switched from the Old Version to the New Version. We recommend you check the Items block and test your message to ensure it works properly.")
30
30
  );
31
31
  }
32
32
  getTemplate() {
33
- return h({
34
- orientation: c.ORIENTATION.VERTICAL,
35
- itemsType: c.ITEMS_TYPE.CART_ITEMS,
33
+ return C({
34
+ orientation: a.ORIENTATION.VERTICAL,
35
+ itemsType: a.ITEMS_TYPE.CART_ITEMS,
36
36
  itemId: "{{Abandoned Cart Item (1) Url}}",
37
- currencySymbol: a.productPriceCurrencySymbolControlValue,
38
- currencyLocation: a.productPriceCurrencyLocationControlValue,
39
- formattedPrice: a.productPriceFormattedControlValue === "1"
37
+ currencySymbol: i.productPriceCurrencySymbolControlValue,
38
+ currencyLocation: i.productPriceCurrencyLocationControlValue,
39
+ formattedPrice: i.productPriceFormattedControlValue === "1"
40
40
  });
41
41
  }
42
42
  allowInnerBlocksDND() {
43
43
  return !1;
44
44
  }
45
- canBeSavedAsModule() {
46
- return !0;
47
- }
48
- onCreated(i) {
49
- const n = this.api.getDocumentModifier(), r = this.api.getDocumentRootCssNode();
50
- r.querySelector('[product-attr="imageSrc"] img') || n.modifyCss(r).appendRule('[product-attr="imageSrc"] img {object-fit: contain;}');
51
- const t = l(i);
52
- if (!t)
45
+ onCreated(n) {
46
+ const l = this.api.getDocumentModifier(), r = this.api.getDocumentRootCssNode();
47
+ r.querySelector('[product-attr="imageSrc"] img') || l.modifyCss(r).appendRule('[product-attr="imageSrc"] img {object-fit: contain;}');
48
+ const e = y(n);
49
+ if (!e)
53
50
  return;
54
- const e = t.getNodeConfig(), g = e && Object.keys(e).length > 0, o = m(i);
55
- if (o != null && o.initialized)
56
- g ? o.blockInstanceId || this.api.getDocumentModifier().modifyHtml(t).setNodeConfig({ ...o, blockInstanceId: String(Date.now()) }).apply(new s("Assign block instance ID to block")) : this.api.getDocumentModifier().modifyHtml(t).setNodeConfig(o).apply(new s("Migrate legacy config to nodeConfig"));
51
+ const s = e.getNodeConfig(), m = s && Object.keys(s).length > 0, t = b(n);
52
+ if (t != null && t.initialized)
53
+ m ? t.blockInstanceId || this.api.getDocumentModifier().modifyHtml(e).setNodeConfig({ ...t, blockInstanceId: String(Date.now()) }).apply(new o("Assign block instance ID to block")) : this.api.getDocumentModifier().modifyHtml(e).setNodeConfig(t).apply(new o("Migrate legacy config to nodeConfig"));
57
54
  else {
58
- const f = b();
59
- this.api.getDocumentModifier().modifyHtml(t).setNodeConfig(f).apply(new s("Initialize Items block with default configuration")), p().startOnboarding("itemsOnboarding");
55
+ const d = h();
56
+ this.api.getDocumentModifier().modifyHtml(e).setNodeConfig(d).apply(new o("Initialize Items block with default configuration")), p().startOnboarding("itemsOnboarding");
60
57
  }
61
58
  }
62
- /**
63
- * Re-seeds nodeConfig from the persisted esd-ext-config when a saved module
64
- * surfaces via document load. Stripo strips esd-ext-config and never restores it
65
- * into nodeConfig, so without this a reused module would reset to defaults.
66
- * Guarded to the nodeConfig-empty case so it runs once and never loops.
67
- */
68
- onDocumentChanged(i) {
69
- const n = l(i);
70
- if (!n)
71
- return;
72
- const r = n.getNodeConfig();
73
- if (r && Object.keys(r).length > 0)
74
- return;
75
- const e = m(i);
76
- e != null && e.initialized && this.api.getDocumentModifier().modifyHtml(n).setNodeConfig(e).apply(new s("Recover Items block config from saved module"));
77
- }
78
59
  }
79
60
  export {
80
- d as BLOCK_ID,
61
+ c as BLOCK_ID,
81
62
  E as ItemsBlock
82
63
  };
@@ -1,36 +1,36 @@
1
1
  import { ModificationDescription as b } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { DefaultConfigValues as i, SETTINGS_ENUMS as n, ItemInCartOptions as g } from "../enums/settingsEnums.js";
2
+ import { DefaultConfigValues as o, SETTINGS_ENUMS as n, ItemInCartOptions as g } from "../enums/settingsEnums.js";
3
3
  function _() {
4
4
  return String(Date.now() + Math.floor(Math.random() * 1e3));
5
5
  }
6
6
  const E = (r) => r.replace(/\$/g, "$$$$");
7
- function y() {
7
+ function S() {
8
8
  return {
9
9
  initialized: !0,
10
10
  blockInstanceId: _(),
11
11
  source: n.ITEMS_TYPE.CART_ITEMS,
12
12
  type: n.ITEMS_TYPE.CART_ITEMS,
13
- itemsSelectValue: i.cartItemsSelectControlValue,
13
+ itemsSelectValue: o.cartItemsSelectControlValue,
14
14
  orientation: n.ORIENTATION.VERTICAL,
15
- nameTrimming: i.productNameTrimmingControlValue === "1",
16
- priceHideDiscount: i.productPriceHideDiscountControlValue === "1",
17
- priceFormatted: i.productPriceFormattedControlValue === "1",
15
+ nameTrimming: o.productNameTrimmingControlValue === "1",
16
+ priceHideDiscount: o.productPriceHideDiscountControlValue === "1",
17
+ priceFormatted: o.productPriceFormattedControlValue === "1",
18
18
  priceSinglePrice: !1,
19
- priceCurrencySymbol: i.productPriceCurrencySymbolControlValue,
20
- priceCurrencyLocation: i.productPriceCurrencyLocationControlValue,
19
+ priceCurrencySymbol: o.productPriceCurrencySymbolControlValue,
20
+ priceCurrencyLocation: o.productPriceCurrencyLocationControlValue,
21
21
  priceOrientation: "horizontal",
22
- quantityControlEnabled: i.productQuantityControlEnabled === "1",
23
- buttonLink: i.productButtonLinkControlValue,
24
- imageLink: i.productImageLinkControlValue,
22
+ quantityControlEnabled: o.productQuantityControlEnabled === "1",
23
+ buttonLink: o.productButtonLinkControlValue,
24
+ imageLink: o.productImageLinkControlValue,
25
25
  buttonLabel: "Buy",
26
26
  buttonFullWidth: !0,
27
27
  // Default to full width (es-fw class)
28
- imageVisible: i.productImageVisible === "1",
29
- nameVisible: i.productNameVisible === "1",
30
- quantityVisible: i.productQuantityVisible === "1",
31
- priceVisible: i.productPriceVisible === "1",
32
- originalPriceVisible: i.productOriginalPriceVisible === "1",
33
- buttonVisible: i.productButtonVisible === "1"
28
+ imageVisible: o.productImageVisible === "1",
29
+ nameVisible: o.productNameVisible === "1",
30
+ quantityVisible: o.productQuantityVisible === "1",
31
+ priceVisible: o.productPriceVisible === "1",
32
+ originalPriceVisible: o.productOriginalPriceVisible === "1",
33
+ buttonVisible: o.productButtonVisible === "1"
34
34
  };
35
35
  }
36
36
  function p(r) {
@@ -50,26 +50,26 @@ function m(r) {
50
50
  PURCHASED_ITEMS: n.ITEMS_TYPE.PURCHASED_ITEMS
51
51
  }[r] || n.ITEMS_TYPE.CART_ITEMS : n.ITEMS_TYPE.CART_ITEMS;
52
52
  }
53
- function f(r, t) {
53
+ function I(r, t) {
54
54
  if (!r)
55
- return i.cartItemsSelectControlValue;
55
+ return o.cartItemsSelectControlValue;
56
56
  if (r.includes("{{"))
57
57
  return r;
58
58
  if (/^\d+$/.test(r)) {
59
- const e = parseInt(r) - 1, o = g[t];
60
- if (o && o[e])
61
- return o[e].value;
59
+ const e = parseInt(r) - 1, i = g[t];
60
+ if (i && i[e])
61
+ return i[e].value;
62
62
  }
63
- return i.cartItemsSelectControlValue;
63
+ return o.cartItemsSelectControlValue;
64
64
  }
65
65
  function C(r) {
66
66
  const t = r.querySelector("esd-config-block");
67
67
  if (!t)
68
68
  return null;
69
- const e = (u, s) => u == null ? s : u === "1" || u === "true", o = (u, s) => u || s, c = t.getAttribute("data-type"), a = m(c), d = t.getAttribute("data-cart_items_select_control_value"), l = f(d, a);
69
+ const e = (c, s) => c == null ? s : c === "1" || c === "true", i = (c, s) => c || s, u = t.getAttribute("data-type"), a = m(u), d = t.getAttribute("data-cart_items_select_control_value"), l = I(d, a);
70
70
  return {
71
71
  initialized: e(t.getAttribute("data-initialized"), !1),
72
- blockInstanceId: o(
72
+ blockInstanceId: i(
73
73
  t.getAttribute("data-block-instance-id"),
74
74
  _()
75
75
  ),
@@ -93,28 +93,28 @@ function C(r) {
93
93
  t.getAttribute("data-product_price_control_single_price"),
94
94
  !1
95
95
  ),
96
- priceCurrencySymbol: o(
96
+ priceCurrencySymbol: i(
97
97
  t.getAttribute("data-product_price_control_currency_symbol"),
98
- i.productPriceCurrencySymbolControlValue
98
+ o.productPriceCurrencySymbolControlValue
99
99
  ),
100
- priceCurrencyLocation: o(
100
+ priceCurrencyLocation: i(
101
101
  t.getAttribute("data-product_price_currency_location"),
102
- i.productPriceCurrencyLocationControlValue
102
+ o.productPriceCurrencyLocationControlValue
103
103
  ),
104
104
  priceOrientation: t.getAttribute("data-product_original_price_control_orientation") || "horizontal",
105
105
  quantityControlEnabled: e(
106
106
  t.getAttribute("data-product_quantity_control_enabled"),
107
107
  !0
108
108
  ),
109
- buttonLink: o(
109
+ buttonLink: i(
110
110
  t.getAttribute("data-product_button_link"),
111
- i.productButtonLinkControlValue
111
+ o.productButtonLinkControlValue
112
112
  ),
113
- imageLink: o(
113
+ imageLink: i(
114
114
  t.getAttribute("data-product_image_link"),
115
- i.productImageLinkControlValue
115
+ o.productImageLinkControlValue
116
116
  ),
117
- buttonLabel: o(
117
+ buttonLabel: i(
118
118
  t.getAttribute("data-product_button_control_label"),
119
119
  "Buy"
120
120
  ),
@@ -149,45 +149,28 @@ function C(r) {
149
149
  )
150
150
  };
151
151
  }
152
- function I(r) {
153
- if (typeof r.getAttribute != "function")
154
- return null;
155
- const t = r.getAttribute("esd-ext-config");
156
- if (!t)
157
- return null;
158
- try {
159
- const e = JSON.parse(t);
160
- if (e && e.initialized)
161
- return e;
162
- } catch {
163
- }
164
- return null;
165
- }
166
- function A(r) {
152
+ function y(r) {
167
153
  const t = p(r);
168
154
  if (!t)
169
155
  return null;
170
156
  const e = t.getNodeConfig();
171
157
  if (e && e.initialized)
172
158
  return e;
173
- const o = I(t);
174
- if (o)
175
- return o;
176
- const c = C(t);
177
- return c || null;
159
+ const i = C(t);
160
+ return i || null;
178
161
  }
179
- function V(r, t, e, o) {
180
- const c = p(r);
181
- if (!c)
162
+ function A(r, t, e, i) {
163
+ const u = p(r);
164
+ if (!u)
182
165
  return;
183
- const d = { ...c.getNodeConfig() || {}, ...e }, l = o ?? t.getDocumentModifier();
184
- l.modifyHtml(c).setNodeConfig(d), o || l.apply(new b("Update Items block configuration"));
166
+ const d = { ...u.getNodeConfig() || {}, ...e }, l = i ?? t.getDocumentModifier();
167
+ l.modifyHtml(u).setNodeConfig(d), i || l.apply(new b("Update Items block configuration"));
185
168
  }
186
169
  export {
187
170
  E as escapeReplacement,
188
171
  _ as generateBlockInstanceId,
189
- y as getDefaultItemsBlockConfig,
190
- A as getItemsBlockConfig,
172
+ S as getDefaultItemsBlockConfig,
173
+ y as getItemsBlockConfig,
191
174
  p as getItemsBlockContainer,
192
- V as setItemsBlockConfig
175
+ A as setItemsBlockConfig
193
176
  };
@@ -1,11 +1,11 @@
1
- const T = ".recommendation-block-v2", c = ".ins-recommendation-product-container", o = ".ins-recommendation-desktop-container", n = ".ins-recommendation-mobile-container", t = ".ins-recommendation-mobile-row", r = "reco-v3-button", _ = {
1
+ const c = ".recommendation-block-v2", t = ".ins-recommendation-product-container", o = ".ins-recommendation-desktop-container", n = ".ins-recommendation-mobile-container", _ = ".ins-recommendation-mobile-row", r = "reco-v3-button", R = "ins-skip-compile", e = {
2
2
  CURRENCY: "currency",
3
3
  SYMBOL: "currency-symbol",
4
4
  ALIGNMENT: "currency-alignment",
5
5
  THOUSAND_SEPARATOR: "currency-thousand-separator",
6
6
  DECIMAL_SEPARATOR: "currency-decimal-separator",
7
7
  DECIMAL_COUNT: "currency-decimal-count"
8
- }, R = "productImage", e = "productName", O = "productPrice", s = "productOldPrice", i = "productOmnibusPrice", C = "productOmnibusDiscount", E = "productButton", A = "customAttr:", u = "data-custom-attributes", m = "product-attr", a = /* @__PURE__ */ new Set([
8
+ }, O = "productImage", s = "productName", E = "productPrice", i = "productOldPrice", A = "productOmnibusPrice", C = "productOmnibusDiscount", u = "productButton", I = "customAttr:", S = "data-custom-attributes", m = "product-attr", U = "product_attribute.", T = /* @__PURE__ */ new Set([
9
9
  "name",
10
10
  // productName
11
11
  "price",
@@ -20,24 +20,31 @@ const T = ".recommendation-block-v2", c = ".ins-recommendation-product-container
20
20
  // productOmnibusPrice
21
21
  "omnibus_discount"
22
22
  // productOmnibusDiscount
23
+ ]), a = /* @__PURE__ */ new Set([
24
+ ...T,
25
+ "currency",
26
+ "discount"
23
27
  ]);
24
28
  export {
25
- A as ATTR_CUSTOM_PREFIX,
26
- u as ATTR_DATA_CUSTOM_ATTRIBUTES,
29
+ I as ATTR_CUSTOM_PREFIX,
30
+ S as ATTR_DATA_CUSTOM_ATTRIBUTES,
27
31
  m as ATTR_PRODUCT_ATTR,
28
- E as ATTR_PRODUCT_BUTTON,
29
- R as ATTR_PRODUCT_IMAGE,
30
- e as ATTR_PRODUCT_NAME,
31
- s as ATTR_PRODUCT_OLD_PRICE,
32
+ u as ATTR_PRODUCT_BUTTON,
33
+ O as ATTR_PRODUCT_IMAGE,
34
+ s as ATTR_PRODUCT_NAME,
35
+ i as ATTR_PRODUCT_OLD_PRICE,
32
36
  C as ATTR_PRODUCT_OMNIBUS_DISCOUNT,
33
- i as ATTR_PRODUCT_OMNIBUS_PRICE,
34
- O as ATTR_PRODUCT_PRICE,
35
- T as BLOCK_ROOT_SELECTOR,
36
- a as BUILT_IN_DEFAULT_ATTRIBUTES,
37
- c as CONTAINER_SELECTOR,
37
+ A as ATTR_PRODUCT_OMNIBUS_PRICE,
38
+ E as ATTR_PRODUCT_PRICE,
39
+ c as BLOCK_ROOT_SELECTOR,
40
+ T as BUILT_IN_DEFAULT_ATTRIBUTES,
41
+ t as CONTAINER_SELECTOR,
38
42
  r as CSS_CLASS_RECO_BUTTON,
39
- _ as CURRENCY_ATTR,
43
+ R as CSS_CLASS_SKIP_COMPILE,
44
+ e as CURRENCY_ATTR,
40
45
  o as DESKTOP_CONTAINER_SELECTOR,
41
46
  n as MOBILE_CONTAINER_SELECTOR,
42
- t as MOBILE_ROW_SELECTOR
47
+ _ as MOBILE_ROW_SELECTOR,
48
+ U as PRODUCT_ATTRIBUTE_PREFIX,
49
+ a as RECOMMENDATION_VARIABLE_BUILTIN_ATTRIBUTES
43
50
  };