@useinsider/guido 3.21.0-beta.0df5409 → 3.21.0-beta.23f347e

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 (44) hide show
  1. package/dist/composables/useActionsApi.js +63 -80
  2. package/dist/composables/useGuidoStateBridge.js +3 -3
  3. package/dist/composables/useStripo.js +8 -8
  4. package/dist/config/compiler/htmlCompilerRules.js +1 -1
  5. package/dist/extensions/Blocks/Recommendation/block.js +29 -33
  6. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +83 -78
  7. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +2 -1
  8. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +12 -2
  9. package/dist/extensions/Blocks/Recommendation/controls/main/currency.js +86 -104
  10. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +210 -222
  11. package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +50 -48
  12. package/dist/extensions/Blocks/Recommendation/controls/main/locale.js +21 -16
  13. package/dist/extensions/Blocks/Recommendation/controls/main/pricePlacement.js +40 -44
  14. package/dist/extensions/Blocks/Recommendation/controls/main/productCount.js +19 -14
  15. package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +119 -112
  16. package/dist/extensions/Blocks/Recommendation/controls/main/shuffle.js +23 -18
  17. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +231 -257
  18. package/dist/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.js +20 -24
  19. package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +7 -6
  20. package/dist/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.js +8 -8
  21. package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +151 -113
  22. package/dist/extensions/Blocks/Recommendation/utils/blockRefresh.js +11 -20
  23. package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +1 -1
  24. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +50 -106
  25. package/dist/package.json.js +1 -1
  26. package/dist/src/composables/useActionsApi.d.ts +1 -5
  27. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +0 -1
  28. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +6 -3
  29. package/dist/src/extensions/Blocks/Recommendation/controls/main/currency.d.ts +5 -5
  30. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +11 -5
  31. package/dist/src/extensions/Blocks/Recommendation/controls/main/layoutOrientation.d.ts +3 -6
  32. package/dist/src/extensions/Blocks/Recommendation/controls/main/pricePlacement.d.ts +5 -6
  33. package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +8 -8
  34. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +11 -21
  35. package/dist/src/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.d.ts +13 -19
  36. package/dist/src/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.d.ts +8 -10
  37. package/dist/src/extensions/Blocks/Recommendation/controls/spacing/index.d.ts +5 -9
  38. package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +13 -13
  39. package/dist/src/stores/editor.d.ts +1 -3
  40. package/dist/static/styles/components/tabs.css.js +5 -0
  41. package/dist/stores/editor.js +0 -5
  42. package/package.json +2 -2
  43. package/dist/extensions/Blocks/Recommendation/utils/currencySettings.js +0 -25
  44. package/dist/src/extensions/Blocks/Recommendation/utils/currencySettings.d.ts +0 -6
@@ -1,41 +1,24 @@
1
- import { flushPendingNodeConfigWrites as P } from "../extensions/Blocks/Recommendation/utils/nodeConfigWriter.js";
2
- import { useEditorStore as H } from "../stores/editor.js";
3
- import { filterAmpErrors as _ } from "../utils/ampErrorFilter.js";
4
- import { getEditorApi as c } from "../utils/stripoEditorApi.js";
5
- import { watch as F } from "vue";
6
- import { useToaster as M } from "./useToaster.js";
7
- const O = 1e4, C = 3e4, L = 1e3, T = (i, n, r) => new Promise((s, l) => {
8
- const p = setTimeout(
9
- () => l(new Error(`${i} did not report completion within ${n}ms`)),
10
- n
11
- ), f = (d) => (S) => {
12
- clearTimeout(p), d(S);
13
- }, g = f(l);
1
+ import { filterAmpErrors as y } from "../utils/ampErrorFilter.js";
2
+ import { getEditorApi as s } from "../utils/stripoEditorApi.js";
3
+ import { useToaster as D } from "./useToaster.js";
4
+ const h = 1e4, T = 3e4, r = (n, l, A) => new Promise((C, p) => {
5
+ const f = setTimeout(
6
+ () => p(new Error(`${n} did not report completion within ${l}ms`)),
7
+ l
8
+ ), c = (t) => (e) => {
9
+ clearTimeout(f), t(e);
10
+ }, d = c(p);
14
11
  try {
15
- r(f(s), g);
16
- } catch (d) {
17
- g(d);
12
+ A(c(C), d);
13
+ } catch (t) {
14
+ d(t);
18
15
  }
19
- });
20
- let A = Promise.resolve();
21
- const h = () => {
22
- const i = H(), n = i.changeSeq + P();
23
- return i.changeSeq >= n || (A = new Promise((r) => {
24
- let s = () => {
25
- };
26
- const l = setTimeout(() => {
27
- s(), r();
28
- }, L);
29
- s = F(() => i.changeSeq, (p) => {
30
- p >= n && (clearTimeout(l), s(), r());
31
- });
32
- })), A;
33
- }, z = () => {
34
- const { handleError: i } = M(), n = (t) => T(
16
+ }), P = () => {
17
+ const { handleError: n } = D(), l = (t = {}) => r(
35
18
  "compileEmail",
36
- C,
37
- (e, o) => {
38
- const m = { ...{
19
+ T,
20
+ (e, i) => {
21
+ const o = { ...{
39
22
  minimize: !0,
40
23
  utmEntity: {
41
24
  utmSource: "",
@@ -54,56 +37,56 @@ const h = () => {
54
37
  forceAmp: !1,
55
38
  resetDataSavedFlag: !1,
56
39
  disableLineHeightsReplace: !0
57
- }, ...t }, E = {
58
- callback: (u, y, v, D, I) => {
59
- u ? o(u) : e({
60
- html: y,
61
- ampHtml: v,
62
- ampErrors: _(D ?? []),
63
- displayConditions: I
40
+ }, ...t }, u = {
41
+ callback: (m, g, w, S, v) => {
42
+ m ? i(m) : e({
43
+ html: g,
44
+ ampHtml: w,
45
+ ampErrors: y(S ?? []),
46
+ displayConditions: v
64
47
  });
65
48
  },
66
- ...m
49
+ ...o
67
50
  };
68
- c().actionsApi.compileEmail(E);
69
- }
70
- ), r = async (t = {}) => (await h(), n(t)), s = () => T(
71
- "getTemplateData",
72
- C,
73
- (t) => {
74
- const e = ({ html: o, css: a, width: m, height: w, utmParams: E, syncModulesIds: u }) => t({
75
- html: o,
76
- css: a,
77
- width: m,
78
- height: w,
79
- utmParams: E,
80
- syncModulesIds: u
81
- });
82
- c().actionsApi.getTemplateData(e);
51
+ s().actionsApi.compileEmail(u);
83
52
  }
84
53
  );
85
54
  return {
86
- getCompiledEmail: r,
87
- getTemplateData: async ({ flushPendingEdits: t = !0 } = {}) => (t && await h(), s()),
55
+ getCompiledEmail: l,
56
+ getTemplateData: () => r(
57
+ "getTemplateData",
58
+ T,
59
+ (t) => {
60
+ const e = ({ html: i, css: a, width: o, height: E, utmParams: u, syncModulesIds: m }) => t({
61
+ html: i,
62
+ css: a,
63
+ width: o,
64
+ height: E,
65
+ utmParams: u,
66
+ syncModulesIds: m
67
+ });
68
+ s().actionsApi.getTemplateData(e);
69
+ }
70
+ ),
88
71
  activateCustomViewStyles: (t = !0) => {
89
- c().actionsApi.activateCustomViewStyles(t);
72
+ s().actionsApi.activateCustomViewStyles(t);
90
73
  },
91
74
  getPreviewData: async (t) => {
92
75
  try {
93
76
  const {
94
77
  html: e,
95
- displayConditions: o,
78
+ displayConditions: i,
96
79
  ampHtml: a = "",
97
- ampErrors: m = []
98
- } = await r({ minimize: !1, resetDataSavedFlag: !1, ...t });
80
+ ampErrors: o = []
81
+ } = await l({ minimize: !1, resetDataSavedFlag: !1, ...t });
99
82
  return {
100
83
  html: e,
101
84
  ampHtml: a,
102
- ampErrors: m,
103
- displayConditions: o
85
+ ampErrors: o,
86
+ displayConditions: i
104
87
  };
105
88
  } catch (e) {
106
- return i(e, "Error loading preview"), {
89
+ return n(e, "Error loading preview"), {
107
90
  html: "",
108
91
  ampHtml: "",
109
92
  ampErrors: [],
@@ -112,32 +95,32 @@ const h = () => {
112
95
  }
113
96
  },
114
97
  updateTimerInClonedTemplate: () => new Promise((t) => {
115
- var e, o;
116
- if (typeof ((o = (e = window.StripoEditorApi) == null ? void 0 : e.actionsApi) == null ? void 0 : o.updateTimerInClonedTemplate) != "function") {
98
+ var e, i;
99
+ if (typeof ((i = (e = window.StripoEditorApi) == null ? void 0 : e.actionsApi) == null ? void 0 : i.updateTimerInClonedTemplate) != "function") {
117
100
  t(null);
118
101
  return;
119
102
  }
120
103
  try {
121
- window.StripoEditorApi.actionsApi.updateTimerInClonedTemplate((a, m) => {
122
- a ? (i(a, "Failed to update timer in cloned template"), t(null)) : t(m || null);
104
+ window.StripoEditorApi.actionsApi.updateTimerInClonedTemplate((a, o) => {
105
+ a ? (n(a, "Failed to update timer in cloned template"), t(null)) : t(o || null);
123
106
  });
124
107
  } catch (a) {
125
- i(a, "Failed to call updateTimerInClonedTemplate"), t(null);
108
+ n(a, "Failed to call updateTimerInClonedTemplate"), t(null);
126
109
  }
127
110
  }),
128
111
  updateHtmlAndCss: (t, e) => {
129
- const { actionsApi: o } = c();
130
- return T("updateHtmlAndCss", O, (a) => {
131
- o.updateHtmlAndCss(t, e, () => a());
112
+ const { actionsApi: i } = s();
113
+ return r("updateHtmlAndCss", h, (a) => {
114
+ i.updateHtmlAndCss(t, e, () => a());
132
115
  });
133
116
  },
134
- editorSave: () => T(
117
+ editorSave: () => r(
135
118
  "save",
136
- C,
119
+ T,
137
120
  (t) => {
138
- c().actionsApi.save((e) => {
121
+ s().actionsApi.save((e) => {
139
122
  if (e) {
140
- i(e, "Failed to save template"), t(!1);
123
+ n(e, "Failed to save template"), t(!1);
141
124
  return;
142
125
  }
143
126
  t(!0);
@@ -147,5 +130,5 @@ const h = () => {
147
130
  };
148
131
  };
149
132
  export {
150
- z as useActionsApi
133
+ P as useActionsApi
151
134
  };
@@ -5,7 +5,7 @@ import { useEditorStore as w } from "../stores/editor.js";
5
5
  import { useGuidoEmailEditorStore as y } from "../stores/guido-email-editor.js";
6
6
  import { watch as c, onUnmounted as z } from "vue";
7
7
  const B = 500, G = () => {
8
- const i = w(), d = y(), l = T(), { getTemplateData: u } = v(), { runExclusive: m, isEditorBusy: p } = C();
8
+ const i = w(), u = y(), d = T(), { getTemplateData: l } = v(), { runExclusive: m, isEditorBusy: p } = C();
9
9
  let o = null, n = !1;
10
10
  const r = () => {
11
11
  o && (clearTimeout(o), o = null);
@@ -21,10 +21,10 @@ const B = 500, G = () => {
21
21
  return;
22
22
  }
23
23
  try {
24
- const { html: E, css: I } = await m(() => u({ flushPendingEdits: !1 })), b = ((s = (t = l.config) == null ? void 0 : t.identity) == null ? void 0 : s.templateId) ?? "";
24
+ const { html: E, css: I } = await m(l), b = ((s = (t = d.config) == null ? void 0 : t.identity) == null ? void 0 : s.templateId) ?? "";
25
25
  if (n)
26
26
  return;
27
- d.$patch({
27
+ u.$patch({
28
28
  html: E ?? "",
29
29
  css: I ?? "",
30
30
  templateId: b,
@@ -1,5 +1,5 @@
1
- import { useActionsApi as O } from "./useActionsApi.js";
2
- import { useBlocksConfig as q } from "./useBlocksConfig.js";
1
+ import { useActionsApi as L } from "./useActionsApi.js";
2
+ import { useBlocksConfig as O } from "./useBlocksConfig.js";
3
3
  import { useConfig as H } from "./useConfig.js";
4
4
  import { useCustomInterfaceAppearance as w } from "./useCustomInterfaceAppearance.js";
5
5
  import { useFullStoryBridge as N } from "./useFullStoryBridge.js";
@@ -17,7 +17,7 @@ import { buildMergeTagEntries as W, flattenDynamicContentList as Y } from "../ut
17
17
  import Z from "../package.json.js";
18
18
  let n = null;
19
19
  const he = () => {
20
- const { features: c, template: u, isFeatureEnabled: p } = H(), { handleError: m, showToaster: v } = G(), { getToken: B, getCustomFonts: M, getSyncModulesStatus: T } = K(), { handleEvent: F } = z(), { handleModuleAdd: A } = j(), { getStripoBlocksConfig: V } = q(), { getStripoNotifications: _ } = $(), f = () => n || (n = new Promise((r, s) => {
20
+ const { features: c, template: u, isFeatureEnabled: p } = H(), { handleError: m, showToaster: v } = G(), { getToken: B, getCustomFonts: M, getSyncModulesStatus: T } = K(), { handleEvent: F } = z(), { handleModuleAdd: A } = j(), { getStripoBlocksConfig: V } = O(), { getStripoNotifications: _ } = $(), f = () => n || (n = new Promise((r, s) => {
21
21
  var d;
22
22
  if (document.getElementById("UiEditorScript")) {
23
23
  r();
@@ -31,7 +31,7 @@ const he = () => {
31
31
  n = null;
32
32
  }), n), D = async (r, s, o, a = [], i = !1) => {
33
33
  var y, E, h, C;
34
- const e = k(), { html: d, css: P } = r, { baseBlocks: g, extensions: R } = await V(), S = ((y = c.value) == null ? void 0 : y.displayConditions) ?? !0, U = ((E = c.value) == null ? void 0 : E.modulesDisabled) ?? !1, I = !!d || (((h = u.value) == null ? void 0 : h.forceRecreate) ?? !1), x = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
34
+ const e = k(), { html: d, css: P } = r, { baseBlocks: g, extensions: R } = await V(), S = ((y = c.value) == null ? void 0 : y.displayConditions) ?? !0, U = ((E = c.value) == null ? void 0 : E.modulesDisabled) ?? !1, I = !!d || (((h = u.value) == null ? void 0 : h.forceRecreate) ?? !1), q = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
35
35
  w().importCss(), await window.UIEditor.initEditor(
36
36
  document.querySelector("#guido-editor"),
37
37
  {
@@ -63,7 +63,7 @@ const he = () => {
63
63
  copyPasteEnabled: !1,
64
64
  selectElementAfterDrop: !0,
65
65
  sameFontSizeForOutlook: !0,
66
- allowedScriptSourceDomains: x,
66
+ allowedScriptSourceDomains: q,
67
67
  ...g ? { baseBlocks: g } : {},
68
68
  editorFonts: {
69
69
  showDefaultStandardFonts: !0,
@@ -89,8 +89,8 @@ const he = () => {
89
89
  },
90
90
  onTemplateLoaded() {
91
91
  try {
92
- const { activateCustomViewStyles: t, updateTimerInClonedTemplate: l } = O(), { injectFullStory: L } = N();
93
- w().importCss(), t(), L(), l(), o.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
92
+ const { activateCustomViewStyles: t, updateTimerInClonedTemplate: l } = L(), { injectFullStory: x } = N();
93
+ w().importCss(), t(), x(), l(), o.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
94
94
  e.hasChanges = !1;
95
95
  }, 1e3);
96
96
  } catch (t) {
@@ -107,7 +107,7 @@ const he = () => {
107
107
  e.isVersionHistoryOpen = t;
108
108
  },
109
109
  onDataChanged() {
110
- e.markChanged();
110
+ e.hasChanges = !0, e.changeSeq += 1;
111
111
  },
112
112
  onEvent: F,
113
113
  onModuleAdd: A,
@@ -88,7 +88,7 @@ const d = [
88
88
  /<!--\[if\s\(mso 16\)\]>\s*<style\s*\S*>\s*a\s*\{\s*text-decoration\s*:\s*none\s*;*\s*\}\s*<\/style>\s*<!\[endif\]-->/g,
89
89
  /<!--\[if\sgte mso 9\]>\s*<style\s*\S*>\s*sup\s*\{\s*font-size\s*:\s*100%\s*!important\s*;*\s*\}\s*<\/style>\s*<!\[endif\]-->/g,
90
90
  /<!--\[if\sgte mso 9\]>\s*<noscript>\s*<xml>\s*<o:OfficeDocumentSettings>\s*<o:AllowPNG>\s*<\/o:AllowPNG>\s*<o:PixelsPerInch>\d+<\/o:PixelsPerInch>\s*<\/o:OfficeDocumentSettings>\s*<\/xml>\s*<\/noscript>\s*<!\[endif\]-->/g,
91
- /<!--\[if mso\]>\s*<xml>\s*<w:WordDocument\s+xmlns:w="urn:schemas-microsoft-com:office:word">\s*<w:DontUseAdvancedTypographyReadingMail><\/w:DontUseAdvancedTypographyReadingMail>\s*<\/w:WordDocument>\s*<\/xml>\s*<!\[endif\]-->/g,
91
+ /<!--\[if mso\]>\s*<xml>\s*<w:WordDocument\s+xmlns:w="urn:schemas-microsoft-com:office:word">\s*<w:DontUseAdvancedTypographyReadingMail\s*(?:\/>|><\/w:DontUseAdvancedTypographyReadingMail>)\s*<\/w:WordDocument>\s*<\/xml>\s*<!\[endif\]-->/g,
92
92
  /<\!--\[if \!mso\]><\!--\s*\d*\s*-->\s*<\!--\[if \!mso\]><\!--\s*\d*\s*-->\s*<\!--<!\[endif\]-->/g,
93
93
  /<!--\[if\s\!mso\]>\s*<!-- \d -->/g
94
94
  ],
@@ -1,23 +1,23 @@
1
- var b = Object.defineProperty;
2
- var C = (a, l, t) => l in a ? b(a, l, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[l] = t;
3
- var d = (a, l, t) => C(a, typeof l != "symbol" ? l + "" : l, t);
1
+ var B = Object.defineProperty;
2
+ var b = (a, l, t) => l in a ? B(a, l, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[l] = t;
3
+ var d = (a, l, t) => b(a, typeof l != "symbol" ? l + "" : l, t);
4
4
  import { useConfig as g } from "../../../composables/useConfig.js";
5
- import { BlockId as A } from "../../../enums/block.js";
6
- import { getMigrationBannerHtml as E } from "../../../utils/migrationBannerHtml.js";
7
- import { Block as S, BlockCompositionType as N, ModificationDescription as p } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
8
- import { CURRENT_CONFIG_VERSION as w, PRE_RRS_CONFIG_VERSION as M } from "./constants/defaultConfig.js";
5
+ import { BlockId as C } from "../../../enums/block.js";
6
+ import { getMigrationBannerHtml as A } from "../../../utils/migrationBannerHtml.js";
7
+ import { Block as E, BlockCompositionType as S, ModificationDescription as p } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
8
+ import { CURRENT_CONFIG_VERSION as N, PRE_RRS_CONFIG_VERSION as w } from "./constants/defaultConfig.js";
9
9
  import { RECOMMENDATION_ID_ATTR as m } from "./constants/selectors.js";
10
- import { regenerateMobileProductRows as O } from "./controls/main/utils.js";
11
- import { ensureMobileCssRulesExist as I, setMobileLayoutOptOut as R, hasMobileLayoutOptOut as x } from "./controls/mobileLayout/cssRules.js";
10
+ import { regenerateMobileProductRows as M } from "./controls/main/utils.js";
11
+ import { ensureMobileCssRulesExist as I, setMobileLayoutOptOut as R, hasMobileLayoutOptOut as O } from "./controls/mobileLayout/cssRules.js";
12
12
  import { RecommendationConfigService as s } from "./services/configService.js";
13
13
  import { useRecommendationExtensionStore as h } from "./store/recommendation.js";
14
- import { getDefaultTemplate as T } from "./templates/grid/template.js";
15
- import { useRecommendationBlockWarning as H } from "./useRecommendationBlockWarning.js";
16
- import { registerNodeConfigWriter as k } from "./utils/nodeConfigWriter.js";
14
+ import { getDefaultTemplate as x } from "./templates/grid/template.js";
15
+ import { useRecommendationBlockWarning as T } from "./useRecommendationBlockWarning.js";
16
+ import { registerNodeConfigWriter as H } from "./utils/nodeConfigWriter.js";
17
17
  import { refreshDuplicatedStrategyBlocks as $ } from "./utils/strategyCommit.js";
18
- const D = A.Recommendation, u = "recommendation-block-v2", y = "hide-price";
19
- let B = !1;
20
- class Y extends S {
18
+ const k = C.Recommendation, u = "recommendation-block-v2", D = "hide-price";
19
+ let y = !1;
20
+ class Y extends E {
21
21
  constructor() {
22
22
  super();
23
23
  /**
@@ -31,13 +31,13 @@ class Y extends S {
31
31
  d(this, "_unsettledDuplicateIds", /* @__PURE__ */ new Set());
32
32
  }
33
33
  getId() {
34
- return D;
34
+ return k;
35
35
  }
36
36
  getIcon() {
37
37
  return "recommendation-icon";
38
38
  }
39
39
  getBlockCompositionType() {
40
- return N.CONTAINER;
40
+ return S.CONTAINER;
41
41
  }
42
42
  getName() {
43
43
  return this.api.translate("Recommendation Block");
@@ -48,8 +48,8 @@ class Y extends S {
48
48
  );
49
49
  }
50
50
  getSettingsPanelTitleHtml() {
51
- return E(
52
- D,
51
+ return A(
52
+ k,
53
53
  this.api.translate("Recommendation Block"),
54
54
  this.api.translate("This block is switched from the Old Version to the New Version. We recommend you check the Recommendation block and test your message to ensure it works properly.")
55
55
  );
@@ -72,11 +72,7 @@ class Y extends S {
72
72
  */
73
73
  getTemplate() {
74
74
  const t = this._generateNextId();
75
- return this._pendingBlockId = t, T(t);
76
- }
77
- // A restore can redraw blocks before any settings panel registered a document handle this session.
78
- onDocumentInit() {
79
- k(this.api);
75
+ return this._pendingBlockId = t, x(t);
80
76
  }
81
77
  /**
82
78
  * Called when a new block is dropped into the template
@@ -104,7 +100,7 @@ class Y extends S {
104
100
  t,
105
101
  {
106
102
  recommendationId: i,
107
- configVersion: n ? w : M,
103
+ configVersion: n ? N : w,
108
104
  ...o ? { partnerName: g().partnerName.value } : {},
109
105
  // An RRS block picks a strategy, not an algorithm, and its algorithm control is
110
106
  // hidden. Keeping the `mostPopular` default would bake a most-popular feed URL
@@ -115,7 +111,7 @@ class Y extends S {
115
111
  if (f.setCurrentBlock(i), this._stampHidePrice(t, r.priceHideIfSameAsDiscounted), c) {
116
112
  I(this.api);
117
113
  const _ = this._getBlockElement(t);
118
- _ && (R(this.api, _, !0), O({
114
+ _ && (R(this.api, _, !0), M({
119
115
  currentNode: t,
120
116
  documentModifier: this.api.getDocumentModifier()
121
117
  }));
@@ -142,11 +138,11 @@ class Y extends S {
142
138
  }
143
139
  this._healLingeringDuplicate(t), s.needsMigration(t) && this._migrateFromLegacy(t), this._healHidePriceAttr(t);
144
140
  try {
145
- B || (I(this.api), B = !0);
141
+ y || (I(this.api), y = !0);
146
142
  const e = s.getConfig(t), i = this._getBlockElement(t);
147
143
  if (i) {
148
144
  const n = !e.mobileLayoutEnabled;
149
- x(i) !== n && R(this.api, i, n);
145
+ O(i) !== n && R(this.api, i, n);
150
146
  }
151
147
  } catch {
152
148
  }
@@ -176,7 +172,7 @@ class Y extends S {
176
172
  */
177
173
  _warnIfMultipleBlocks() {
178
174
  try {
179
- H().warnIfMultipleBlocks(this.api.getDocumentRootHtmlNode());
175
+ T().warnIfMultipleBlocks(this.api.getDocumentRootHtmlNode());
180
176
  } catch {
181
177
  }
182
178
  }
@@ -268,7 +264,7 @@ class Y extends S {
268
264
  /** Assigns a fresh id to a duplicated block and syncs DOM, node config and store. */
269
265
  _handleDuplicate(t, e) {
270
266
  const i = this._reassignDuplicateId(t, e), n = h();
271
- n.cloneBlockState(e, i), n.setCurrentBlock(i), g().isFeatureEnabled("reusableRecommendationStrategy") && (this._resetSourceIds.add(e), k(this.api), $(e, i, s.getConfig(t)).catch((o) => console.error("[recommendation] refreshing a duplicated strategy failed", o))), this._warnIfMultipleBlocks();
267
+ n.cloneBlockState(e, i), n.setCurrentBlock(i), g().isFeatureEnabled("reusableRecommendationStrategy") && (this._resetSourceIds.add(e), H(this.api), $(e, i, s.getConfig(t)).catch((o) => console.error("[recommendation] refreshing a duplicated strategy failed", o))), this._warnIfMultipleBlocks();
272
268
  }
273
269
  /**
274
270
  * Core id-reassignment for a duplicated block: rewrites the DOM
@@ -324,7 +320,7 @@ class Y extends S {
324
320
  */
325
321
  _stampHidePrice(t, e) {
326
322
  const i = this._getBlockElement(t);
327
- i && this.api.getDocumentModifier().modifyHtml(i).setAttribute(y, String(e)).apply(new p("Stamp hide-price"));
323
+ i && this.api.getDocumentModifier().modifyHtml(i).setAttribute(D, String(e)).apply(new p("Stamp hide-price"));
328
324
  }
329
325
  /**
330
326
  * Stamps `hide-price` from config only when the block lacks the attribute —
@@ -332,7 +328,7 @@ class Y extends S {
332
328
  */
333
329
  _healHidePriceAttr(t) {
334
330
  const e = this._getBlockElement(t);
335
- if (!e || !("getAttribute" in e) || e.getAttribute(y) !== null)
331
+ if (!e || !("getAttribute" in e) || e.getAttribute(D) !== null)
336
332
  return;
337
333
  const { priceHideIfSameAsDiscounted: i } = s.getConfig(t);
338
334
  this._stampHidePrice(t, i);
@@ -369,6 +365,6 @@ class Y extends S {
369
365
  }
370
366
  }
371
367
  export {
372
- D as BLOCK_ID,
368
+ k as BLOCK_ID,
373
369
  Y as RecommendationBlock
374
370
  };