@useinsider/guido 3.21.1 → 3.21.2-beta.066adbf

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.
@@ -1,44 +1,54 @@
1
- import { useActionsApi as L } from "./useActionsApi.js";
2
- import { useBlocksConfig as O } from "./useBlocksConfig.js";
3
- import { useConfig as H } from "./useConfig.js";
4
- import { useCustomInterfaceAppearance as w } from "./useCustomInterfaceAppearance.js";
5
- import { useFullStoryBridge as N } from "./useFullStoryBridge.js";
6
- import { useModuleRepair as j } from "./useModuleRepair.js";
7
- import { useStripoEventHandler as z } from "./useStripoEventHandler.js";
8
- import { useStripoNotifications as $ } from "./useStripoNotifications.js";
9
- import { useToaster as G } from "./useToaster.js";
10
- import { localePatch as J } from "../config/i18n/index.js";
11
- import { en as b } from "../config/i18n/en/index.js";
12
- import { ToasterTypeOptions as X } from "../enums/toaster.js";
13
- import { useStripoApi as K } from "../services/stripoApi.js";
14
- import Q from "../static/styles/customEditorStyle.css.js";
15
- import { useEditorStore as k } from "../stores/editor.js";
16
- import { buildMergeTagEntries as W, flattenDynamicContentList as Y } from "../utils/genericUtil.js";
17
- import Z from "../package.json.js";
18
- let n = null;
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 } = O(), { getStripoNotifications: _ } = $(), f = () => n || (n = new Promise((r, s) => {
21
- var d;
1
+ import { useActionsApi as M } from "./useActionsApi.js";
2
+ import { useBlocksConfig as N } from "./useBlocksConfig.js";
3
+ import { useConfig as j } from "./useConfig.js";
4
+ import { useCustomInterfaceAppearance as _ } from "./useCustomInterfaceAppearance.js";
5
+ import { useFullStoryBridge as z } from "./useFullStoryBridge.js";
6
+ import { useModuleRepair as $ } from "./useModuleRepair.js";
7
+ import { useStripoEventHandler as G } from "./useStripoEventHandler.js";
8
+ import { useStripoNotifications as X } from "./useStripoNotifications.js";
9
+ import { useToaster as J } from "./useToaster.js";
10
+ import { localePatch as K } from "../config/i18n/index.js";
11
+ import { en as B } from "../config/i18n/en/index.js";
12
+ import { ToasterTypeOptions as Q } from "../enums/toaster.js";
13
+ import { useStripoApi as W } from "../services/stripoApi.js";
14
+ import Y from "../static/styles/customEditorStyle.css.js";
15
+ import { useEditorStore as v } from "../stores/editor.js";
16
+ import { buildMergeTagEntries as Z, flattenDynamicContentList as ee } from "../utils/genericUtil.js";
17
+ import { getStripoRuntimeBaseUrl as te } from "../utils/stripoRuntime.js";
18
+ let d = null, T = !1;
19
+ const we = (e) => {
20
+ const { features: u, template: m, isFeatureEnabled: p } = j(), { handleError: f, showToaster: F } = J(), { getToken: A, getCustomFonts: P, getSyncModulesStatus: R } = W(), { handleEvent: U } = G(), { handleModuleAdd: V } = $(), { getStripoBlocksConfig: D } = N(), { getStripoNotifications: I } = X(), g = () => d || (d = new Promise((a, s) => {
22
21
  if (document.getElementById("UiEditorScript")) {
23
- r();
22
+ a();
24
23
  return;
25
24
  }
26
- const o = Z.guido, i = `https://email-static.useinsider.com/guido/${(d = o == null ? void 0 : o.stripo) == null ? void 0 : d.version}/UIEditor.js`, e = document.createElement("script");
27
- e.id = "UiEditorScript", e.type = "module", e.src = i, e.onload = () => r(), e.onerror = () => {
28
- e.remove(), s(new Error(`Failed to load Stripo UIEditor script from S3: ${i}`));
29
- }, document.body.appendChild(e);
30
- }), n.catch(() => {
31
- n = null;
32
- }), n), D = async (r, s, o, a = [], i = !1) => {
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), q = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
35
- w().importCss(), await window.UIEditor.initEditor(
25
+ const i = te();
26
+ if (!i) {
27
+ s(
28
+ new Error("guido.stripo.version is not set in package.json. Please configure the Stripo version.")
29
+ );
30
+ return;
31
+ }
32
+ const n = `${i}UIEditor.js`, t = document.createElement("script");
33
+ t.id = "UiEditorScript", t.type = "module", t.src = n, t.onload = () => {
34
+ T = !0, a();
35
+ }, t.onerror = () => {
36
+ t.remove(), s(new Error(`Failed to load Stripo UIEditor script from S3: ${n}`));
37
+ }, document.body.appendChild(t);
38
+ }), d.catch(() => {
39
+ d = null;
40
+ }), d), L = async (a, s, i, n = [], t = !1) => {
41
+ var C, w, k, b;
42
+ const o = v(), { html: c, css: S } = a, { baseBlocks: y, extensions: q } = await D();
43
+ e.mark("blocks_config_ready");
44
+ const E = ((C = u.value) == null ? void 0 : C.displayConditions) ?? !0, x = ((w = u.value) == null ? void 0 : w.modulesDisabled) ?? !1, h = !!c || (((k = m.value) == null ? void 0 : k.forceRecreate) ?? !1), O = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
45
+ e.setTemplate({ html: c, css: S, forceRecreate: h }), _().importCss(), e.mark("init_editor"), await window.UIEditor.initEditor(
36
46
  document.querySelector("#guido-editor"),
37
47
  {
38
48
  metadata: s,
39
- html: d,
40
- css: P,
41
- forceRecreate: I,
49
+ html: c,
50
+ css: S,
51
+ forceRecreate: h,
42
52
  locale: "en",
43
53
  undoButtonSelector: "#guido__undo-button",
44
54
  redoButtonSelector: "#guido__redo-button",
@@ -48,12 +58,12 @@ const he = () => {
48
58
  customAppearanceMergetags: !p("liquidSyntax"),
49
59
  customAppearanceMergetagsBorderColor: "#f1f3fe",
50
60
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
51
- customViewStyles: Q,
52
- conditionsEnabled: S,
53
- customConditionsEnabled: S,
61
+ customViewStyles: Y,
62
+ conditionsEnabled: E,
63
+ customConditionsEnabled: E,
54
64
  enableXSSSecurity: !0,
55
- modulesDisabled: U,
56
- syncModulesEnabled: i,
65
+ modulesDisabled: x,
66
+ syncModulesEnabled: t,
57
67
  messageSettingsEnabled: !0,
58
68
  displayGmailAnnotations: !0,
59
69
  displayHiddenPreheader: !1,
@@ -63,55 +73,56 @@ const he = () => {
63
73
  copyPasteEnabled: !1,
64
74
  selectElementAfterDrop: !0,
65
75
  sameFontSizeForOutlook: !0,
66
- allowedScriptSourceDomains: q,
67
- ...g ? { baseBlocks: g } : {},
76
+ allowedScriptSourceDomains: O,
77
+ ...y ? { baseBlocks: y } : {},
68
78
  editorFonts: {
69
79
  showDefaultStandardFonts: !0,
70
80
  showDefaultNotStandardFonts: !0,
71
- customFonts: a
81
+ customFonts: n
72
82
  },
73
83
  mergeTags: [
74
84
  {
75
- entries: W(
76
- o.preselectedDynamicContentList,
77
- Y((C = u.value) == null ? void 0 : C.dynamicContentList),
85
+ entries: Z(
86
+ i.preselectedDynamicContentList,
87
+ ee((b = m.value) == null ? void 0 : b.dynamicContentList),
78
88
  p("liquidSyntax")
79
89
  )
80
90
  }
81
91
  ],
82
- async onTokenRefreshRequest(t) {
92
+ async onTokenRefreshRequest(r) {
83
93
  try {
84
- const l = await B();
85
- t(l);
94
+ e.mark("token_start");
95
+ const l = await A();
96
+ e.mark("token_end"), r(l);
86
97
  } catch (l) {
87
- m(l, "Failed to refresh token");
98
+ f(l, "Failed to refresh token");
88
99
  }
89
100
  },
90
101
  onTemplateLoaded() {
91
102
  try {
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
- e.hasChanges = !1;
95
- }, 1e3);
96
- } catch (t) {
97
- m(t, "Failed to load custom interface appearance");
103
+ const { activateCustomViewStyles: r, updateTimerInClonedTemplate: l } = M(), { injectFullStory: H } = z();
104
+ _().importCss(), r(), H(), l(), i.onReady(), o.isStripoInitialized = !0, o.loadingStatus = !1, setTimeout(() => {
105
+ o.hasChanges = !1;
106
+ }, 1e3), e.markReady();
107
+ } catch (r) {
108
+ f(r, "Failed to load custom interface appearance");
98
109
  }
99
110
  },
100
- onCodeEditorVisibilityChanged(t) {
101
- e.isCodeEditorOpen = t;
111
+ onCodeEditorVisibilityChanged(r) {
112
+ o.isCodeEditorOpen = r;
102
113
  },
103
- onEditorVisualModeChanged(t) {
104
- e.editorVisualMode = t.toLowerCase();
114
+ onEditorVisualModeChanged(r) {
115
+ o.editorVisualMode = r.toLowerCase();
105
116
  },
106
- onVersionHistoryVisibilityChanged(t) {
107
- e.isVersionHistoryOpen = t;
117
+ onVersionHistoryVisibilityChanged(r) {
118
+ o.isVersionHistoryOpen = r;
108
119
  },
109
120
  onDataChanged() {
110
- e.hasChanges = !0, e.changeSeq += 1;
121
+ o.hasChanges = !0, o.changeSeq += 1;
111
122
  },
112
- onEvent: F,
113
- onModuleAdd: A,
114
- notifications: _(),
123
+ onEvent: U,
124
+ onModuleAdd: V,
125
+ notifications: I(),
115
126
  // Stripo deselects the block on any click outside the canvas, so every surface
116
127
  // that belongs to the block's own flow has to be listed here (SD-153273).
117
128
  ignoreClickOutsideSelectors: [
@@ -121,35 +132,35 @@ const he = () => {
121
132
  ".in-modal-v2-wrapper",
122
133
  ".in-toasts-wrapper"
123
134
  ],
124
- extensions: R,
125
- localePatch: J
135
+ extensions: q,
136
+ localePatch: K
126
137
  }
127
138
  );
128
139
  };
129
- return { initPlugin: async (r, s, o) => {
130
- const a = k();
140
+ return { initPlugin: async (a, s, i) => {
141
+ const n = v();
131
142
  try {
132
- await f();
133
- const [i, e] = await Promise.all([
134
- M(),
135
- T()
143
+ e.mark("plugin_start"), e.setScriptPreloaded(T), await g(), e.mark("script_ready");
144
+ const [t, o] = await Promise.all([
145
+ P(),
146
+ R()
136
147
  ]);
137
- a.syncModulesEnabled = e, await D(r, s, o, i, e);
148
+ e.mark("fonts_sync_ready"), n.syncModulesEnabled = o, await L(a, s, i, t, o);
138
149
  } catch {
139
- a.loadingStatus = !1, v({
140
- type: X.Error,
141
- message: b["An error has occurred. Please report the error code to support."],
150
+ n.loadingStatus = !1, F({
151
+ type: Q.Error,
152
+ message: B["An error has occurred. Please report the error code to support."],
142
153
  actionButton: {
143
- text: b["Reload page"],
154
+ text: B["Reload page"],
144
155
  onClick: () => window.location.reload()
145
156
  }
146
- });
157
+ }), e.markFailed();
147
158
  }
148
159
  }, preloadRuntime: () => {
149
- f().catch(() => {
160
+ g().catch(() => {
150
161
  });
151
162
  } };
152
163
  };
153
164
  export {
154
- he as useStripo
165
+ we as useStripo
155
166
  };
@@ -7,13 +7,13 @@ function L(t, r, e, o, c = "") {
7
7
  const i = `{{${c}${t}_${r}_${e}}}`, n = `{{${c}${t}_${r}_currency}}`;
8
8
  return o === "before" ? `${n} ${i}` : `${i} ${n}`;
9
9
  }
10
- function _(t) {
10
+ function A(t) {
11
11
  let r = t;
12
12
  for (; r.children.length === 1; )
13
13
  [r] = r.children;
14
14
  return r;
15
15
  }
16
- function A(t, r, e, o, c, i) {
16
+ function y(t, r, e, o, c, i) {
17
17
  switch (r) {
18
18
  case "productImage": {
19
19
  const n = t.querySelector("img");
@@ -24,7 +24,7 @@ function A(t, r, e, o, c, i) {
24
24
  }
25
25
  case "productName": {
26
26
  const n = t.querySelector("p");
27
- n && (_(n).textContent = `{{${i}${e}_${o}_name}}`);
27
+ n && (A(n).textContent = `{{${i}${e}_${o}_name}}`);
28
28
  break;
29
29
  }
30
30
  // Inline mode ("Move to next line" OFF) merges BOTH prices into one row
@@ -32,16 +32,16 @@ function A(t, r, e, o, c, i) {
32
32
  // substitute by cell content, not by the row's anchor (SD-145161).
33
33
  case "productPrice":
34
34
  case "productOldPrice": {
35
- const n = (l, d) => {
36
- l && (_(l).textContent = L(
35
+ const n = (a, l) => {
36
+ a && (A(a).textContent = L(
37
37
  e,
38
38
  o,
39
- d,
39
+ l,
40
40
  c,
41
41
  i
42
42
  ));
43
- }, s = t.querySelector(".product-price p"), a = t.querySelector(".product-old-price p"), u = !s && !a ? t.querySelector("p") : null;
44
- n(s ?? (r === "productPrice" ? u : null), "price"), n(a ?? (r === "productOldPrice" ? u : null), "original_price");
43
+ }, s = t.querySelector(".product-price p"), d = t.querySelector(".product-old-price p"), u = !s && !d ? t.querySelector("p") : null;
44
+ n(s ?? (r === "productPrice" ? u : null), "price"), n(d ?? (r === "productOldPrice" ? u : null), "original_price");
45
45
  break;
46
46
  }
47
47
  case "productButton": {
@@ -70,8 +70,8 @@ function A(t, r, e, o, c, i) {
70
70
  default: {
71
71
  const n = t.getAttribute("product-attr") ? t : t.querySelector("[product-attr]");
72
72
  if (n) {
73
- const s = n.getAttribute("product-attr"), a = n.querySelector("p");
74
- a && (_(a).textContent = `{{${i}${e}_${o}_${s}}}`);
73
+ const s = n.getAttribute("product-attr"), d = n.querySelector("p");
74
+ d && (A(d).textContent = `{{${i}${e}_${o}_${s}}}`);
75
75
  }
76
76
  break;
77
77
  }
@@ -88,54 +88,54 @@ function b(t, r, e, o) {
88
88
  function R(t, r, e) {
89
89
  return b(t, r, 0, e);
90
90
  }
91
- function D(t, r, e, o) {
91
+ function w(t, r, e, o) {
92
92
  if (!t.innerHTML.includes("{{"))
93
93
  return;
94
94
  const { open: c, close: i } = b(t.ownerDocument, r, e, o);
95
95
  t.insertBefore(c, t.firstChild), t.appendChild(i);
96
96
  }
97
- function w(t, r, e, o) {
97
+ function D(t, r, e, o) {
98
98
  var n, s;
99
99
  if (!t.innerHTML.includes("{{"))
100
100
  return;
101
101
  const { open: c, close: i } = b(t.ownerDocument, r, e, o);
102
102
  (n = t.parentNode) == null || n.insertBefore(c, t), (s = t.parentNode) == null || s.insertBefore(i, t.nextSibling);
103
103
  }
104
- function W(t, r, e, o) {
104
+ function v(t, r, e, o) {
105
105
  t.querySelectorAll(".recommendation-product-row").forEach((i, n) => {
106
- i.querySelectorAll("[data-attribute-type]").forEach((a) => {
107
- const u = a.getAttribute("data-attribute-type") || "", l = a.querySelectorAll(".attribute-cell");
108
- l.length > 0 ? l.forEach((d) => {
109
- A(d, u, r, n, e, o);
110
- }) : A(a, u, r, n, e, o);
111
- }), w(i, r, n, o);
106
+ i.querySelectorAll("[data-attribute-type]").forEach((d) => {
107
+ const u = d.getAttribute("data-attribute-type") || "", a = d.querySelectorAll(".attribute-cell");
108
+ a.length > 0 ? a.forEach((l) => {
109
+ y(l, u, r, n, e, o);
110
+ }) : y(d, u, r, n, e, o);
111
+ }), D(i, r, n, o);
112
112
  });
113
113
  }
114
- function v(t, r, e, o) {
114
+ function H(t, r, e, o) {
115
115
  const c = t.querySelectorAll(".recommendation-product-row");
116
116
  if (!c.length)
117
117
  return;
118
118
  const [i] = c, n = i.querySelector("[data-attribute-type]"), s = n ? n.querySelectorAll(".attribute-cell").length : 1;
119
- c.forEach((a, u) => {
120
- a.querySelectorAll("[data-attribute-type]").forEach((d) => {
121
- const p = d.getAttribute("data-attribute-type") || "";
122
- d.querySelectorAll(".attribute-cell").forEach((f, m) => {
123
- const h = u * s + m;
124
- A(f, p, r, h, e, o), D(f, r, h, o);
119
+ c.forEach((d, u) => {
120
+ d.querySelectorAll("[data-attribute-type]").forEach((l) => {
121
+ const p = l.getAttribute("data-attribute-type") || "";
122
+ l.querySelectorAll(".attribute-cell").forEach((f, h) => {
123
+ const S = u * s + h;
124
+ y(f, p, r, S, e, o), w(f, r, S, o);
125
125
  });
126
126
  });
127
127
  });
128
128
  }
129
- function H(t, r, e, o) {
129
+ function W(t, r, e, o) {
130
130
  t.querySelectorAll(".ins-recommendation-product-container").forEach((i) => {
131
- v(i, r, e, o);
131
+ H(i, r, e, o);
132
132
  });
133
133
  }
134
134
  function F(t, r, e) {
135
135
  const o = t.getAttribute("data-layout") || "grid", c = t.getAttribute("currency-alignment") || "after";
136
- o === "list" ? W(t, r, c, e) : H(t, r, c, e);
136
+ o === "list" ? v(t, r, c, e) : W(t, r, c, e);
137
137
  }
138
- function y(t, r, e) {
138
+ function _(t, r, e) {
139
139
  const o = new RegExp(`${r}\\s*:\\s*(\\d+)\\s*px`, "i"), c = t.match(o);
140
140
  return c ? parseInt(c[1]) : e;
141
141
  }
@@ -150,7 +150,7 @@ function C(t) {
150
150
  const e = (t.getAttribute("style") || "").match(/(?:^|[;\s])width\s*:\s*(\d+(?:\.\d+)?(?:px|%))/i);
151
151
  return e && $(e[1]) ? e[1] : null;
152
152
  }
153
- function G(t, r) {
153
+ function x(t, r) {
154
154
  let e = t.parentElement;
155
155
  for (; e && e !== r; ) {
156
156
  if (e.tagName === "TD" && C(e))
@@ -159,35 +159,37 @@ function G(t, r) {
159
159
  }
160
160
  return null;
161
161
  }
162
- function V(t) {
163
- const r = t.getAttribute("style") || "", e = y(r, "width", 600), o = y(r, "padding", 0) * 2, c = Math.max(0, e - o);
162
+ function G(t) {
163
+ const r = t.getAttribute("style") || "", e = _(r, "width", 600), o = _(r, "padding", 0) * 2, c = Math.max(0, e - o);
164
164
  c !== 0 && t.querySelectorAll("img.adapt-img").forEach((i) => {
165
165
  if (i.hasAttribute("width"))
166
166
  return;
167
- const n = G(i, t);
167
+ const n = x(i, t);
168
168
  if (!n)
169
169
  return;
170
- const s = C(n), a = y(n.getAttribute("style") || "", "padding", 0) * 2, u = s.endsWith("%") ? Math.floor(c * parseFloat(s) / 100) : parseInt(s), l = Math.max(1, u - a);
171
- i.setAttribute("width", String(l));
172
- const d = i.getAttribute("style") || "";
173
- if (!/\bwidth\s*:\s*\d/i.test(d)) {
174
- const p = d && !d.trim().endsWith(";") ? "; " : "";
175
- i.setAttribute("style", `${d}${p}width: ${l}px`);
170
+ const s = C(n), d = _(n.getAttribute("style") || "", "padding", 0) * 2, u = s.endsWith("%") ? Math.floor(c * parseFloat(s) / 100) : parseInt(s), a = Math.max(1, u - d), l = i.getAttribute("style") || "", p = /(?:^|[;\s])max-height\s*:\s*(\d+(?:\.\d+)?)px/i.exec(l);
171
+ if (p) {
172
+ i.setAttribute("width", String(Math.max(1, Math.min(a, Math.floor(parseFloat(p[1])))))), i.removeAttribute("height");
173
+ return;
174
+ }
175
+ if (i.setAttribute("width", String(a)), !/\bwidth\s*:\s*\d/i.test(l)) {
176
+ const m = l && !l.trim().endsWith(";") ? "; " : "";
177
+ i.setAttribute("style", `${l}${m}width: ${a}px`);
176
178
  }
177
179
  });
178
180
  }
179
- const E = "MSO_MOBILE_HIDE_START", U = "MSO_MOBILE_HIDE_END";
180
- function X(t, r) {
181
+ const E = "MSO_MOBILE_HIDE_START", V = "MSO_MOBILE_HIDE_END";
182
+ function U(t, r) {
181
183
  t.querySelectorAll(q).forEach((e) => {
182
184
  var i, n;
183
185
  const o = e.querySelector(M);
184
186
  if (!o || o.children.length === 0)
185
187
  return;
186
188
  const c = e.previousSibling;
187
- (c == null ? void 0 : c.nodeType) === Node.COMMENT_NODE && c.data === E || ((i = e.parentNode) == null || i.insertBefore(r.createComment(E), e), (n = e.parentNode) == null || n.insertBefore(r.createComment(U), e.nextSibling));
189
+ (c == null ? void 0 : c.nodeType) === Node.COMMENT_NODE && c.data === E || ((i = e.parentNode) == null || i.insertBefore(r.createComment(E), e), (n = e.parentNode) == null || n.insertBefore(r.createComment(V), e.nextSibling));
188
190
  });
189
191
  }
190
- function j(t, r) {
192
+ function X(t, r) {
191
193
  const e = t.match(/<!DOCTYPE[^>]*>/i);
192
194
  return (e ? `${e[0]}
193
195
  ` : "") + r.documentElement.outerHTML;
@@ -200,17 +202,17 @@ function Q(t) {
200
202
  i.recommendationCampaignUrls = {};
201
203
  const { isFeatureEnabled: n } = g(), s = n("liquidSyntax") ? "reco_" : "";
202
204
  return o.forEach((u) => {
203
- var d, p, S, f;
204
- const l = u.getAttribute("recommendation-id");
205
- if (l) {
206
- if ((d = u.parentNode) == null || d.insertBefore(e.createComment("REC_START"), u), (p = u.parentNode) == null || p.insertBefore(e.createComment("REC_END"), u.nextSibling), u.querySelectorAll('[data-visibility="0"]').forEach((m) => m.remove()), c(l), X(u, e), !T(u)) {
207
- F(u, l, s);
208
- const { open: m, close: h } = R(e, l, s);
209
- (S = u.parentNode) == null || S.insertBefore(m, u), (f = u.parentNode) == null || f.insertBefore(h, u.nextSibling);
205
+ var l, p, m, f;
206
+ const a = u.getAttribute("recommendation-id");
207
+ if (a) {
208
+ if ((l = u.parentNode) == null || l.insertBefore(e.createComment("REC_START"), u), (p = u.parentNode) == null || p.insertBefore(e.createComment("REC_END"), u.nextSibling), u.querySelectorAll('[data-visibility="0"]').forEach((h) => h.remove()), c(a), U(u, e), !T(u)) {
209
+ F(u, a, s);
210
+ const { open: h, close: S } = R(e, a, s);
211
+ (m = u.parentNode) == null || m.insertBefore(h, u), (f = u.parentNode) == null || f.insertBefore(S, u.nextSibling);
210
212
  }
211
- V(u);
213
+ G(u);
212
214
  }
213
- }), j(r, e).replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("&lt;!--{%", "{%").replaceAll("%}--&gt;", "%}");
215
+ }), X(r, e).replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("&lt;!--{%", "{%").replaceAll("%}--&gt;", "%}");
214
216
  }
215
217
  export {
216
218
  L as formatPriceVariable,