@useinsider/guido 3.21.0-beta.1bd7edd → 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 (65) hide show
  1. package/README.md +0 -1
  2. package/dist/@types/config/schemas.js +39 -41
  3. package/dist/components/Guido.vue.js +6 -6
  4. package/dist/components/Guido.vue2.js +79 -81
  5. package/dist/composables/useBlocksConfig.js +24 -32
  6. package/dist/config/compiler/htmlCompilerRules.js +1 -1
  7. package/dist/enums/academy.js +0 -1
  8. package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +68 -59
  9. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +188 -188
  10. package/dist/guido.css +1 -1
  11. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +92 -93
  12. package/dist/node_modules/valibot/dist/index.js +261 -297
  13. package/dist/package.json.js +1 -1
  14. package/dist/src/@types/config/schemas.d.ts +0 -4
  15. package/dist/src/composables/useConfig.d.ts +0 -2
  16. package/dist/src/enums/academy.d.ts +0 -1
  17. package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +5 -2
  18. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +2 -0
  19. package/dist/src/stores/config.d.ts +0 -166
  20. package/dist/static/styles/components/tabs.css.js +5 -0
  21. package/dist/stores/config.js +6 -13
  22. package/dist/utils/pairProductVariables.js +14 -15
  23. package/package.json +2 -2
  24. package/dist/@types/display-condition.js +0 -25
  25. package/dist/components/organisms/display-conditions/CodeEditorField.vue.js +0 -20
  26. package/dist/components/organisms/display-conditions/CodeEditorField.vue2.js +0 -30
  27. package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.js +0 -30
  28. package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue2.js +0 -71
  29. package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.js +0 -34
  30. package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue2.js +0 -57
  31. package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue.js +0 -17
  32. package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue2.js +0 -22
  33. package/dist/composables/useDisplayConditions.js +0 -102
  34. package/dist/enums/display-condition.js +0 -12
  35. package/dist/extensions/DisplayConditions/bridge.js +0 -17
  36. package/dist/extensions/DisplayConditions/constants.js +0 -17
  37. package/dist/extensions/DisplayConditions/control.js +0 -178
  38. package/dist/extensions/DisplayConditions/display-conditions.css.js +0 -201
  39. package/dist/extensions/DisplayConditions/extension.js +0 -28
  40. package/dist/extensions/DisplayConditions/iconsRegistry.js +0 -20
  41. package/dist/extensions/DisplayConditions/library.js +0 -27
  42. package/dist/extensions/DisplayConditions/settingsPanel.js +0 -17
  43. package/dist/services/displayConditionApi.js +0 -39
  44. package/dist/src/@types/display-condition.d.ts +0 -59
  45. package/dist/src/components/organisms/display-conditions/CodeEditorField.vue.d.ts +0 -43
  46. package/dist/src/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.d.ts +0 -2
  47. package/dist/src/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.d.ts +0 -2
  48. package/dist/src/components/organisms/display-conditions/DisplayConditionsHost.vue.d.ts +0 -2
  49. package/dist/src/composables/useDisplayConditions.d.ts +0 -16
  50. package/dist/src/enums/display-condition.d.ts +0 -15
  51. package/dist/src/extensions/DisplayConditions/bridge.d.ts +0 -6
  52. package/dist/src/extensions/DisplayConditions/constants.d.ts +0 -14
  53. package/dist/src/extensions/DisplayConditions/control.d.ts +0 -23
  54. package/dist/src/extensions/DisplayConditions/extension.d.ts +0 -2
  55. package/dist/src/extensions/DisplayConditions/iconsRegistry.d.ts +0 -4
  56. package/dist/src/extensions/DisplayConditions/library.d.ts +0 -8
  57. package/dist/src/extensions/DisplayConditions/settingsPanel.d.ts +0 -5
  58. package/dist/src/mock/api/display-conditions.d.ts +0 -2
  59. package/dist/src/services/displayConditionApi.d.ts +0 -8
  60. package/dist/src/stores/display-condition.d.ts +0 -81
  61. package/dist/src/utils/displayCondition.d.ts +0 -10
  62. package/dist/src/utils/protectTableText.d.ts +0 -2
  63. package/dist/stores/display-condition.js +0 -28
  64. package/dist/utils/displayCondition.js +0 -26
  65. package/dist/utils/protectTableText.js +0 -22
@@ -1,249 +1,249 @@
1
1
  import { ModificationDescription as C } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
2
  import { RecommendationBlockId as m } from "../../constants/blockIds.js";
3
- import { CURRENCY_ATTR as b, CSS_CLASS_SKIP_COMPILE as W, MOBILE_CONTAINER_SELECTOR as L, ATTR_DATA_CARD_COMPOSITION as q, DESKTOP_CONTAINER_SELECTOR as w, CONTAINER_SELECTOR as Y, MOBILE_ROW_SELECTOR as k, ATTR_DATA_CUSTOM_ATTRIBUTES as h, ATTR_PRODUCT_ATTR as z, PRODUCT_ATTRIBUTE_PREFIX as M } from "../../constants/selectors.js";
3
+ import { CURRENCY_ATTR as b, CSS_CLASS_SKIP_COMPILE as Y, MOBILE_CONTAINER_SELECTOR as w, ATTR_DATA_CARD_COMPOSITION as q, DESKTOP_CONTAINER_SELECTOR as k, CONTAINER_SELECTOR as z, MOBILE_ROW_SELECTOR as x, ATTR_DATA_CUSTOM_ATTRIBUTES as M, ATTR_PRODUCT_ATTR as J, PRODUCT_ATTRIBUTE_PREFIX as I } from "../../constants/selectors.js";
4
4
  import { RecommendationConfigService as g } from "../../services/configService.js";
5
5
  import { useRecommendationExtensionStore as E } from "../../store/recommendation.js";
6
- import { prepareProductRows as x } from "../../templates/index.js";
7
- import { captureStyles as D } from "../../utils/captureStyleTemplates.js";
8
- import { normalizeCompositionKeys as H, normalizeCustomAttrValues as J } from "../../utils/compositionKeys.js";
9
- import { formatPrice as X } from "../../utils/priceFormatter.js";
10
- import { getDefaultProducts as U, DEFAULT_CARD_COMPOSITION as I, sanitizeImageUrl as Q, isSamePrice as Z, toDisplayableAttributeValue as ee } from "../../templates/utils.js";
11
- const O = "recommendation-block-v2";
12
- function P(t) {
13
- if (!t)
6
+ import { prepareProductRows as D } from "../../templates/index.js";
7
+ import { captureStyles as H } from "../../utils/captureStyleTemplates.js";
8
+ import { normalizeCompositionKeys as U, normalizeCustomAttrValues as X } from "../../utils/compositionKeys.js";
9
+ import { formatPrice as Q } from "../../utils/priceFormatter.js";
10
+ import { getDefaultProducts as B, DEFAULT_CARD_COMPOSITION as O, sanitizeImageUrl as Z, isSamePrice as ee, toDisplayableAttributeValue as te } from "../../templates/utils.js";
11
+ const L = "recommendation-block-v2";
12
+ function P(e) {
13
+ if (!e)
14
14
  return null;
15
- if ("getAttribute" in t) {
16
- const e = t.getAttribute("class");
17
- if (e && e.includes(O))
18
- return t;
15
+ if ("getAttribute" in e) {
16
+ const t = e.getAttribute("class");
17
+ if (t && t.includes(L))
18
+ return e;
19
19
  }
20
- return "querySelector" in t ? t.querySelector(`.${O}`) ?? null : null;
20
+ return "querySelector" in e ? e.querySelector(`.${L}`) ?? null : null;
21
21
  }
22
- function te(t) {
23
- const e = P(t);
24
- return !e || !("getAttribute" in e) ? !1 : (e.getAttribute("class") ?? "").split(/\s+/).includes(W);
22
+ function ne(e) {
23
+ const t = P(e);
24
+ return !t || !("getAttribute" in t) ? !1 : (t.getAttribute("class") ?? "").split(/\s+/).includes(Y);
25
25
  }
26
- function T(t) {
27
- const e = P(t);
28
- if (!e || !("getAttribute" in e))
26
+ function T(e) {
27
+ const t = P(e);
28
+ if (!t || !("getAttribute" in t))
29
29
  return "grid";
30
- const n = e.getAttribute("data-layout");
30
+ const n = t.getAttribute("data-layout");
31
31
  return n === "list" || n === "horizontal" ? "list" : "grid";
32
32
  }
33
- function B(t, e = {}) {
34
- const n = P(t);
33
+ function $(e, t = {}) {
34
+ const n = P(e);
35
35
  if (!n || !("getAttribute" in n))
36
- return I;
36
+ return O;
37
37
  const o = n.getAttribute(q);
38
- return o ? H(
38
+ return o ? U(
39
39
  o.split(",").filter(Boolean),
40
40
  n,
41
- e
42
- ) : I;
41
+ t
42
+ ) : O;
43
43
  }
44
- function $(t) {
45
- if (!t || !("childNodes" in t))
44
+ function v(e) {
45
+ if (!e || !("childNodes" in e))
46
46
  return null;
47
- const e = t.childNodes(), n = e.find(
47
+ const t = e.childNodes(), n = t.find(
48
48
  (o) => "getType" in o && o.getType() === "text"
49
49
  );
50
- return n || e.reduce((o, r) => o || !("getType" in r) || r.getType() === "text" ? o : $(r), null);
50
+ return n || t.reduce((o, r) => o || !("getType" in r) || r.getType() === "text" ? o : v(r), null);
51
51
  }
52
- function S(t, e, n) {
53
- const o = $(e);
54
- return !o || "getTextContent" in o && o.getTextContent() === n ? !1 : (t.modifyHtml(o).setText(n), !0);
52
+ function S(e, t, n) {
53
+ const o = v(t);
54
+ return !o || "getTextContent" in o && o.getTextContent() === n ? !1 : (e.modifyHtml(o).setText(n), !0);
55
55
  }
56
- function A(t, e, n, o) {
57
- return "getAttribute" in e && e.getAttribute(n) === o ? !1 : (t.modifyHtml(e).setAttribute(n, o), !0);
56
+ function A(e, t, n, o) {
57
+ return "getAttribute" in t && t.getAttribute(n) === o ? !1 : (e.modifyHtml(t).setAttribute(n, o), !0);
58
58
  }
59
- function v(t, e) {
60
- return t && t.length > 0 ? t : e.length > 0 ? e : U();
59
+ function j(e, t) {
60
+ return e && e.length > 0 ? e : t.length > 0 ? t : B();
61
61
  }
62
- function j(t) {
63
- if (typeof t == "number")
64
- return `0 ${t / 2}px`;
62
+ function F(e) {
63
+ if (typeof e == "number")
64
+ return `0 ${e / 2}px`;
65
65
  }
66
- function ne(t) {
67
- const { currentNode: e, documentModifier: n } = t;
68
- if (!e || !("querySelector" in e))
66
+ function oe(e) {
67
+ const { currentNode: t, documentModifier: n } = e;
68
+ if (!t || !("querySelector" in t))
69
69
  return !1;
70
- const o = e.querySelector(k);
70
+ const o = t.querySelector(x);
71
71
  return o ? (n.modifyHtml(o).setInnerHtml(""), !0) : !1;
72
72
  }
73
- function oe(t) {
74
- return "getOuterHTML" in t && typeof t.getOuterHTML == "function" ? t.getOuterHTML() : "";
73
+ function re(e) {
74
+ return "getOuterHTML" in e && typeof e.getOuterHTML == "function" ? e.getOuterHTML() : "";
75
75
  }
76
- function re(t) {
77
- const e = t.querySelector(".container");
78
- return !e || !("childNodes" in e) ? null : e.childNodes().find((o) => "getTagName" in o && o.getTagName() === "tbody") ?? e.querySelector("tbody") ?? null;
76
+ function ie(e) {
77
+ const t = e.querySelector(".container");
78
+ return !t || !("childNodes" in t) ? null : t.childNodes().find((o) => "getTagName" in o && o.getTagName() === "tbody") ?? t.querySelector("tbody") ?? null;
79
79
  }
80
- function ie(t, e, n) {
81
- const o = re(t);
80
+ function le(e, t, n) {
81
+ const o = ie(e);
82
82
  if (!o || !("childNodes" in o))
83
83
  return;
84
- const r = o.childNodes().map(oe).join(""), s = `<tr class="ins-recommendation-mobile-row">${n}</tr>`;
85
- e.modifyHtml(o).setInnerHtml(r + s), e.apply(new C("Added mobile product row"));
84
+ const r = o.childNodes().map(re).join(""), s = `<tr class="ins-recommendation-mobile-row">${n}</tr>`;
85
+ t.modifyHtml(o).setInnerHtml(r + s), t.apply(new C("Added mobile product row"));
86
86
  }
87
- function F(t, e = {}) {
87
+ function K(e, t = {}) {
88
88
  const {
89
89
  currentNode: n,
90
90
  documentModifier: o,
91
91
  products: r,
92
92
  layout: s,
93
93
  composition: l
94
- } = t;
94
+ } = e;
95
95
  if (!n || !("querySelector" in n))
96
96
  return !1;
97
- const u = s ?? T(n), i = g.getConfig(n);
98
- if (u === "list" || !i.mobileLayoutEnabled)
99
- return ne({ currentNode: n, documentModifier: o });
100
- const c = E(), a = v(r, c.recommendationProducts), f = l ?? B(n, c.filterList), p = `<td><table class="ins-recommendation-product-container ins-recommendation-mobile-container" width="100%" cellpadding="0" cellspacing="0" border="0">${x(a, u, {
97
+ const u = s ?? T(n), i = g.getConfig(n), c = e.mobileLayoutEnabled ?? i.mobileLayoutEnabled;
98
+ if (u === "list" || !c)
99
+ return oe({ currentNode: n, documentModifier: o });
100
+ const a = E(), f = j(r, a.recommendationProducts), d = l ?? $(n, a.filterList), y = `<td><table class="ins-recommendation-product-container ins-recommendation-mobile-container" width="100%" cellpadding="0" cellspacing="0" border="0">${D(f, u, {
101
101
  productsPerRow: i.mobileCardsInRow,
102
- composition: f,
103
- filterList: c.filterList,
102
+ composition: d,
103
+ filterList: a.filterList,
104
104
  priceInline: !i.priceMovedToNextLine,
105
105
  // Match the initial render's gutter so a regeneration never changes block height (SD-143023, #386).
106
- cellPadding: j(i.mobileColumnSpacing),
106
+ cellPadding: F(i.mobileColumnSpacing),
107
107
  rowSpacingPx: i.mobileRowSpacing,
108
- ...e
109
- })}</table></td>`, y = n.querySelector(k);
110
- return y ? (o.modifyHtml(y).setInnerHtml(p), !0) : (ie(n, o, p), !1);
108
+ ...t
109
+ })}</table></td>`, h = n.querySelector(x);
110
+ return h ? (o.modifyHtml(h).setInnerHtml(y), !0) : (le(n, o, y), !1);
111
111
  }
112
- function Te(t) {
113
- F(t, D(t.currentNode)) && t.documentModifier.apply(new C("Updated mobile product rows"));
112
+ function Re(e) {
113
+ K(e, H(e.currentNode)) && e.documentModifier.apply(new C("Updated mobile product rows"));
114
114
  }
115
- function le(t, e = {}) {
115
+ function ce(e, t = {}) {
116
116
  const {
117
117
  currentNode: n,
118
118
  documentModifier: o,
119
119
  products: r,
120
120
  layout: s,
121
121
  composition: l
122
- } = t;
122
+ } = e;
123
123
  if (!n || !("querySelector" in n))
124
124
  return !1;
125
- const u = n.querySelector(w) ?? n.querySelector(Y);
125
+ const u = n.querySelector(k) ?? n.querySelector(z);
126
126
  if (!u)
127
127
  return !1;
128
- const i = E(), c = v(r, i.recommendationProducts), { cardsInRow: a } = g.getConfig(n), f = l ?? B(n, i.filterList), d = s ?? T(n), p = g.getConfig(n), y = x(c, d, {
128
+ const i = E(), c = j(r, i.recommendationProducts), { cardsInRow: a } = g.getConfig(n), f = l ?? $(n, i.filterList), d = s ?? T(n), p = g.getConfig(n), y = D(c, d, {
129
129
  productsPerRow: a,
130
130
  composition: f,
131
131
  filterList: i.filterList,
132
132
  priceInline: !p.priceMovedToNextLine,
133
133
  // Match the initial render's gutter so a regeneration never changes block height (SD-143023, #386).
134
- cellPadding: j(p.columnSpacing),
134
+ cellPadding: F(p.columnSpacing),
135
135
  rowSpacingPx: p.rowSpacing,
136
- ...e
136
+ ...t
137
137
  });
138
138
  return o.modifyHtml(u).setInnerHtml(y), !0;
139
139
  }
140
- function ce(t) {
141
- if (!t)
140
+ function ue(e) {
141
+ if (!e)
142
142
  return null;
143
143
  try {
144
- const e = JSON.parse(t);
145
- return Array.isArray(e) ? e.map((n) => String(n)) : null;
144
+ const t = JSON.parse(e);
145
+ return Array.isArray(t) ? t.map((n) => String(n)) : null;
146
146
  } catch {
147
147
  return null;
148
148
  }
149
149
  }
150
- function ue(t, e, n) {
151
- const o = P(t);
150
+ function se(e, t, n) {
151
+ const o = P(e);
152
152
  if (n || !o || !("getAttribute" in o))
153
153
  return !1;
154
154
  const r = o.getAttribute(q);
155
155
  if (!r)
156
156
  return !1;
157
- const s = E(), l = r.split(",").filter(Boolean), u = H(l, o, s.filterList), i = [], c = u.join(",") !== l.join(",");
157
+ const s = E(), l = r.split(",").filter(Boolean), u = U(l, o, s.filterList), i = [], c = u.join(",") !== l.join(",");
158
158
  c && i.push([q, u.join(",")]);
159
- const a = ce(
160
- o.getAttribute(h)
161
- ), f = a && J(a, o, s.filterList);
162
- if (a && f && f.join(",") !== a.join(",") && i.push([h, JSON.stringify(f)]), i.length === 0)
159
+ const a = ue(
160
+ o.getAttribute(M)
161
+ ), f = a && X(a, o, s.filterList);
162
+ if (a && f && f.join(",") !== a.join(",") && i.push([M, JSON.stringify(f)]), i.length === 0)
163
163
  return !1;
164
164
  if (i.forEach(([d, p]) => {
165
- e.modifyHtml(o).setAttribute(d, p);
166
- }), c && g.hasConfig(t)) {
165
+ t.modifyHtml(o).setAttribute(d, p);
166
+ }), c && g.hasConfig(e)) {
167
167
  const d = {
168
- ...g.getConfig(t),
168
+ ...g.getConfig(e),
169
169
  composition: u
170
170
  };
171
- e.modifyHtml(t).setNodeConfig(d);
171
+ t.modifyHtml(e).setNodeConfig(d);
172
172
  }
173
173
  return !0;
174
174
  }
175
- function Re(t) {
175
+ function qe(e) {
176
176
  const {
177
- currentNode: e,
177
+ currentNode: t,
178
178
  documentModifier: n,
179
179
  afterRegenerate: o,
180
180
  products: r,
181
181
  layout: s,
182
182
  composition: l,
183
183
  skipStylePreservation: u
184
- } = t;
185
- if (!e)
184
+ } = e;
185
+ if (!t)
186
186
  return !1;
187
- const i = u ? {} : D(e), c = {
188
- currentNode: e,
187
+ const i = u ? {} : H(t), c = {
188
+ currentNode: t,
189
189
  documentModifier: n,
190
190
  products: r,
191
191
  layout: s,
192
192
  composition: l
193
193
  };
194
- let a = le(c, i);
195
- return a = F(c, i) || a, a && (ue(e, n, l), n.apply(new C("Regenerate products with styles"))), o == null || o(), a;
194
+ let a = ce(c, i);
195
+ return a = K(c, i) || a, a && (se(t, n, l), n.apply(new C("Regenerate products with styles"))), o == null || o(), a;
196
196
  }
197
- function qe(t, e) {
198
- return t.length === e ? t : t.length > e ? t.slice(0, e) : [...t, ...U(e - t.length)];
197
+ function he(e, t) {
198
+ return e.length === t ? e : e.length > t ? e.slice(0, t) : [...e, ...B(t - e.length)];
199
199
  }
200
- function K() {
201
- const t = E(), { currencySettings: e } = t.recommendationConfigs, n = parseInt(e.decimalCount);
200
+ function V() {
201
+ const e = E(), { currencySettings: t } = e.recommendationConfigs, n = parseInt(t.decimalCount);
202
202
  return {
203
- code: e.value,
204
- symbol: e.symbol,
205
- alignment: e.alignment === "0" ? "before" : "after",
203
+ code: t.value,
204
+ symbol: t.symbol,
205
+ alignment: t.alignment === "0" ? "before" : "after",
206
206
  decimalCount: Number.isNaN(n) ? 2 : n,
207
- decimalSeparator: e.decimalSeparator,
208
- thousandSeparator: e.thousandSeparator
207
+ decimalSeparator: t.decimalSeparator,
208
+ thousandSeparator: t.thousandSeparator
209
209
  };
210
210
  }
211
- function R(t, e = "price") {
212
- const n = K(), o = t[e], r = (o == null ? void 0 : o[n.code]) ?? Object.values(o ?? {})[0] ?? 0;
213
- return X({
211
+ function R(e, t = "price") {
212
+ const n = V(), o = e[t], r = (o == null ? void 0 : o[n.code]) ?? Object.values(o ?? {})[0] ?? 0;
213
+ return Q({
214
214
  price: r,
215
215
  currency: n
216
216
  });
217
217
  }
218
- function se(t) {
218
+ function ae(e) {
219
219
  var s, l;
220
- const e = K(), n = ((s = t.original_price) == null ? void 0 : s[e.code]) ?? Object.values(t.original_price ?? {})[0] ?? 0, o = ((l = t.price) == null ? void 0 : l[e.code]) ?? Object.values(t.price ?? {})[0] ?? 0, r = n > 0 ? Math.round((n - o) / n * 100) : 0;
220
+ const t = V(), n = ((s = e.original_price) == null ? void 0 : s[t.code]) ?? Object.values(e.original_price ?? {})[0] ?? 0, o = ((l = e.price) == null ? void 0 : l[t.code]) ?? Object.values(e.price ?? {})[0] ?? 0, r = n > 0 ? Math.round((n - o) / n * 100) : 0;
221
221
  return r > 0 ? `-${r}%` : "0%";
222
222
  }
223
- function V(t) {
224
- const { documentModifier: e, product: n, priceEl: o, oldPriceEl: r, omnibusPriceEl: s, omnibusDiscountEl: l } = t;
223
+ function G(e) {
224
+ const { documentModifier: t, product: n, priceEl: o, oldPriceEl: r, omnibusPriceEl: s, omnibusDiscountEl: l } = e;
225
225
  let u = !1;
226
226
  if (o && "querySelector" in o) {
227
227
  const i = o.querySelector("strong") ?? o.querySelector("p"), c = R(n, "price");
228
- S(e, i ?? null, c) && (u = !0);
228
+ S(t, i ?? null, c) && (u = !0);
229
229
  }
230
230
  if (r && "querySelector" in r) {
231
231
  const i = r.querySelector("strong") ?? r.querySelector("p"), c = R(n, "original_price");
232
- S(e, i ?? null, c) && (u = !0), A(e, r, "data-same-price", String(Z(n))) && (u = !0);
232
+ S(t, i ?? null, c) && (u = !0), A(t, r, "data-same-price", String(ee(n))) && (u = !0);
233
233
  }
234
234
  if (s && "querySelector" in s) {
235
235
  const i = s.querySelector(".omnibus-price-value") ?? null, c = R(n, "original_price");
236
- S(e, i, c) && (u = !0);
236
+ S(t, i, c) && (u = !0);
237
237
  }
238
238
  if (l && "querySelector" in l) {
239
- const i = l.querySelector(".omnibus-discount-value") ?? null, c = se(n);
240
- S(e, i, c) && (u = !0);
239
+ const i = l.querySelector(".omnibus-discount-value") ?? null, c = ae(n);
240
+ S(t, i, c) && (u = !0);
241
241
  }
242
242
  return u;
243
243
  }
244
- function ae(t) {
244
+ function fe(e) {
245
245
  const {
246
- documentModifier: e,
246
+ documentModifier: t,
247
247
  product: n,
248
248
  imageEl: o,
249
249
  nameEl: r,
@@ -252,23 +252,23 @@ function ae(t) {
252
252
  omnibusPriceEl: u,
253
253
  omnibusDiscountEl: i,
254
254
  buttonEl: c
255
- } = t;
255
+ } = e;
256
256
  let a = !1;
257
257
  if (o && "querySelector" in o) {
258
258
  const f = o.querySelector("img");
259
259
  if (f) {
260
- const p = A(e, f, "src", Q(n.image_url)), y = A(e, f, "alt", n.name);
260
+ const p = A(t, f, "src", Z(n.image_url)), y = A(t, f, "alt", n.name);
261
261
  a = a || p || y;
262
262
  }
263
263
  const d = o.querySelector("a");
264
- d && A(e, d, "href", n.url) && (a = !0);
264
+ d && A(t, d, "href", n.url) && (a = !0);
265
265
  }
266
266
  if (r && "querySelector" in r) {
267
267
  const f = r.querySelector("strong") ?? r.querySelector("p");
268
- S(e, f ?? null, n.name) && (a = !0);
268
+ S(t, f ?? null, n.name) && (a = !0);
269
269
  }
270
- if (V({
271
- documentModifier: e,
270
+ if (G({
271
+ documentModifier: t,
272
272
  product: n,
273
273
  priceEl: s,
274
274
  oldPriceEl: l,
@@ -276,27 +276,27 @@ function ae(t) {
276
276
  omnibusDiscountEl: i
277
277
  }) && (a = !0), c && "querySelector" in c) {
278
278
  const f = c.querySelector("a.es-button") || c.querySelector("a");
279
- f && A(e, f, "href", n.url) && (a = !0);
279
+ f && A(t, f, "href", n.url) && (a = !0);
280
280
  }
281
281
  return a;
282
282
  }
283
- function G(t) {
284
- return "querySelector" in t ? t.querySelector(w) ?? t : t;
283
+ function W(e) {
284
+ return "querySelector" in e ? e.querySelector(k) ?? e : e;
285
285
  }
286
- function fe(t, e) {
286
+ function de(e, t) {
287
287
  var o;
288
288
  let n;
289
- if (t.startsWith(M)) {
290
- const r = t.slice(M.length);
291
- n = (o = e.product_attributes) == null ? void 0 : o[r];
289
+ if (e.startsWith(I)) {
290
+ const r = e.slice(I.length);
291
+ n = (o = t.product_attributes) == null ? void 0 : o[r];
292
292
  } else
293
- n = e[t];
294
- return ee(n) || null;
293
+ n = t[e];
294
+ return te(n) || null;
295
295
  }
296
- function de(t, e, n) {
297
- if (!("querySelectorAll" in t))
296
+ function me(e, t, n) {
297
+ if (!("querySelectorAll" in e))
298
298
  return !1;
299
- const o = t.querySelectorAll(
299
+ const o = e.querySelectorAll(
300
300
  `[esd-extension-block-id="${m.CUSTOM_ATTRIBUTE}"]`
301
301
  );
302
302
  if (o.length === 0)
@@ -305,7 +305,7 @@ function de(t, e, n) {
305
305
  o.forEach((l) => {
306
306
  if (!("getAttribute" in l))
307
307
  return;
308
- const u = l.getAttribute(z);
308
+ const u = l.getAttribute(J);
309
309
  if (!u)
310
310
  return;
311
311
  const i = r.get(u) ?? [];
@@ -317,36 +317,36 @@ function de(t, e, n) {
317
317
  l.slice(0, i).forEach((c, a) => {
318
318
  if (!("querySelector" in c))
319
319
  return;
320
- const f = fe(u, n[a]);
320
+ const f = de(u, n[a]);
321
321
  if (f === null)
322
322
  return;
323
323
  const d = c.querySelector("p") ?? null;
324
- S(e, d, f) && (s = !0);
324
+ S(t, d, f) && (s = !0);
325
325
  });
326
326
  }), s;
327
327
  }
328
- function _(t, e, n) {
329
- if (!("querySelectorAll" in t))
328
+ function _(e, t, n) {
329
+ if (!("querySelectorAll" in e))
330
330
  return !1;
331
- const o = t.querySelectorAll(
331
+ const o = e.querySelectorAll(
332
332
  `[esd-extension-block-id="${m.IMAGE}"]`
333
- ), r = t.querySelectorAll(
333
+ ), r = e.querySelectorAll(
334
334
  `[esd-extension-block-id="${m.NAME}"]`
335
- ), s = t.querySelectorAll(
335
+ ), s = e.querySelectorAll(
336
336
  `[esd-extension-block-id="${m.PRICE}"]`
337
- ), l = t.querySelectorAll(
337
+ ), l = e.querySelectorAll(
338
338
  `[esd-extension-block-id="${m.OLD_PRICE}"]`
339
- ), u = t.querySelectorAll(
339
+ ), u = e.querySelectorAll(
340
340
  `[esd-extension-block-id="${m.OMNIBUS_PRICE}"]`
341
- ), i = t.querySelectorAll(
341
+ ), i = e.querySelectorAll(
342
342
  `[esd-extension-block-id="${m.OMNIBUS_DISCOUNT}"]`
343
- ), c = t.querySelectorAll(
343
+ ), c = e.querySelectorAll(
344
344
  `[esd-extension-block-id="${m.BUTTON}"]`
345
345
  ), a = Math.min(o.length, n.length);
346
346
  let f = !1;
347
347
  for (let d = 0; d < a; d++) {
348
- const p = ae({
349
- documentModifier: e,
348
+ const p = fe({
349
+ documentModifier: t,
350
350
  product: n[d],
351
351
  imageEl: o[d] ?? null,
352
352
  nameEl: r[d] ?? null,
@@ -358,21 +358,21 @@ function _(t, e, n) {
358
358
  });
359
359
  f = f || p;
360
360
  }
361
- return de(t, e, n) && (f = !0), f;
361
+ return me(e, t, n) && (f = !0), f;
362
362
  }
363
- function he(t) {
364
- const { currentNode: e, documentModifier: n, products: o, onApplied: r } = t;
365
- if (!e || !("querySelectorAll" in e))
363
+ function Me(e) {
364
+ const { currentNode: t, documentModifier: n, products: o, onApplied: r } = e;
365
+ if (!t || !("querySelectorAll" in t))
366
366
  return !1;
367
- const s = G(e);
367
+ const s = W(t);
368
368
  if (!("querySelectorAll" in s) || s.querySelectorAll(
369
369
  `[esd-extension-block-id="${m.IMAGE}"]`
370
370
  ).length !== o.length)
371
371
  return !1;
372
372
  let u = _(s, n, o);
373
- const i = T(e), c = g.getConfig(e);
374
- if (i !== "list" && c.mobileLayoutEnabled && "querySelector" in e) {
375
- const a = e.querySelector(L);
373
+ const i = T(t), c = g.getConfig(t);
374
+ if (i !== "list" && c.mobileLayoutEnabled && "querySelector" in t) {
375
+ const a = t.querySelector(w);
376
376
  if (a) {
377
377
  const f = _(
378
378
  a,
@@ -384,22 +384,22 @@ function he(t) {
384
384
  }
385
385
  return u && (n.apply(new C("Updated product content in-place")), r == null || r()), !0;
386
386
  }
387
- function N(t, e, n) {
388
- if (!("querySelectorAll" in t))
387
+ function N(e, t, n) {
388
+ if (!("querySelectorAll" in e))
389
389
  return !1;
390
- const o = t.querySelectorAll(
390
+ const o = e.querySelectorAll(
391
391
  `[esd-extension-block-id="${m.PRICE}"]`
392
- ), r = t.querySelectorAll(
392
+ ), r = e.querySelectorAll(
393
393
  `[esd-extension-block-id="${m.OLD_PRICE}"]`
394
- ), s = t.querySelectorAll(
394
+ ), s = e.querySelectorAll(
395
395
  `[esd-extension-block-id="${m.OMNIBUS_PRICE}"]`
396
- ), l = t.querySelectorAll(
396
+ ), l = e.querySelectorAll(
397
397
  `[esd-extension-block-id="${m.OMNIBUS_DISCOUNT}"]`
398
398
  ), u = Math.min(o.length, n.length);
399
399
  let i = !1;
400
400
  for (let c = 0; c < u; c++)
401
- V({
402
- documentModifier: e,
401
+ G({
402
+ documentModifier: t,
403
403
  product: n[c],
404
404
  priceEl: o[c] ?? null,
405
405
  oldPriceEl: r[c] ?? null,
@@ -408,20 +408,20 @@ function N(t, e, n) {
408
408
  }) && (i = !0);
409
409
  return i;
410
410
  }
411
- function Me(t) {
412
- const { currentNode: e, documentModifier: n } = t;
413
- if (!e || !("querySelectorAll" in e))
411
+ function Ie(e) {
412
+ const { currentNode: t, documentModifier: n } = e;
413
+ if (!t || !("querySelectorAll" in t))
414
414
  return !1;
415
- if (te(e))
415
+ if (ne(t))
416
416
  return !0;
417
417
  const r = E().recommendationProducts;
418
418
  if (r.length === 0)
419
419
  return !1;
420
- const s = G(e);
420
+ const s = W(t);
421
421
  let l = N(s, n, r);
422
- const u = T(e), i = g.getConfig(e);
423
- if (u !== "list" && i.mobileLayoutEnabled && "querySelector" in e) {
424
- const c = e.querySelector(L);
422
+ const u = T(t), i = g.getConfig(t);
423
+ if (u !== "list" && i.mobileLayoutEnabled && "querySelector" in t) {
424
+ const c = t.querySelector(w);
425
425
  if (c) {
426
426
  const a = N(c, n, r);
427
427
  l = l || a;
@@ -429,8 +429,8 @@ function Me(t) {
429
429
  }
430
430
  return l && n.apply(new C("Updated price formatting in-place")), l;
431
431
  }
432
- function Ie(t) {
433
- const { currentNode: e, documentModifier: n, currency: o } = t, r = P(e);
432
+ function Oe(e) {
433
+ const { currentNode: t, documentModifier: n, currency: o } = e, r = P(t);
434
434
  if (!r)
435
435
  return;
436
436
  const s = o.alignment === "before" ? "0" : "1", l = (u, i) => {
@@ -439,17 +439,17 @@ function Ie(t) {
439
439
  l(b.CURRENCY, o.code), l(b.SYMBOL, o.symbol), l(b.ALIGNMENT, s), l(b.THOUSAND_SEPARATOR, o.thousandSeparator), l(b.DECIMAL_SEPARATOR, o.decimalSeparator), l(b.DECIMAL_COUNT, o.decimalCount.toString()), n.apply(new C("Update currency attributes"));
440
440
  }
441
441
  export {
442
- qe as adjustProductsToSize,
442
+ he as adjustProductsToSize,
443
443
  R as formatProductPrice,
444
444
  P as getBlockElement,
445
- B as getCardComposition,
445
+ $ as getCardComposition,
446
446
  T as getCurrentLayout,
447
- re as getMainContainerTbody,
448
- te as isPartnerManagedBlock,
449
- Te as regenerateMobileProductRows,
450
- Re as regenerateProductRowsWithStyles,
451
- Ie as setCurrencyAttributes,
452
- Me as updatePricesInPlace,
453
- he as updateProductContentInPlace,
454
- ae as updateSingleProductContent
447
+ ie as getMainContainerTbody,
448
+ ne as isPartnerManagedBlock,
449
+ Re as regenerateMobileProductRows,
450
+ qe as regenerateProductRowsWithStyles,
451
+ Oe as setCurrencyAttributes,
452
+ Ie as updatePricesInPlace,
453
+ Me as updateProductContentInPlace,
454
+ fe as updateSingleProductContent
455
455
  };