@useinsider/guido 3.1.1-beta.f1817f3 → 3.1.1-beta.f9482a3

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,18 +1,18 @@
1
- import { useRecommendation as f } from "../../composables/useRecommendation.js";
2
- import { DUMMY_IMAGE_MAPPINGS as P, REGEX as m, VerticalOrientation as g, CSS as e, ATTRIBUTES as a, CONDITIONS as A, HTML as h } from "../../enums/recommendation.js";
3
- import { prepareRecommendationBlocks as D } from "./utils/recommendationCompilerUtils.js";
4
- const G = [
1
+ import { useRecommendation as N } from "../../composables/useRecommendation.js";
2
+ import { DUMMY_IMAGE_MAPPINGS as M, REGEX as _, VerticalOrientation as h, CSS as d, ATTRIBUTES as R, CONDITIONS as y, HTML as C } from "../../enums/recommendation.js";
3
+ import { prepareRecommendationBlocks as x } from "./utils/recommendationCompilerUtils.js";
4
+ const w = [
5
5
  {
6
6
  id: "replace-images-with-variable-names",
7
7
  description: "Replacing dummy images with variable names in recommendation module",
8
8
  type: "custom",
9
- processor: (s) => {
10
- let t = s;
11
- return Object.entries(P).forEach(([, l]) => {
12
- Object.entries(l).forEach(([n, o]) => {
13
- t = t.replaceAll(o, `{{${n}}}`);
9
+ processor: (n) => {
10
+ let e = n;
11
+ return Object.entries(M).forEach(([, l]) => {
12
+ Object.entries(l).forEach(([s, r]) => {
13
+ e = e.replaceAll(r, `{{${s}}}`);
14
14
  });
15
- }), t;
15
+ }), e;
16
16
  },
17
17
  priority: 50
18
18
  },
@@ -29,21 +29,21 @@ const G = [
29
29
  id: "add-recommendation-unresponsive-css",
30
30
  description: "Adding recommendation unresponsive css",
31
31
  type: "custom",
32
- processor: (s) => {
33
- const { calculateCardWidth: t, getRecommendationCampaignData: l } = f();
34
- let n = s;
35
- const o = n.match(m.ID);
36
- if (o) {
37
- const d = [];
38
- if (o.forEach((c) => {
39
- const E = /recommendation-id="(.*?)"/i.exec(c), I = E ? E[1].trim() : "", p = l(I);
40
- p.textTrimming && p.orientation === g && d.push(t(p));
41
- }), d.length) {
42
- const c = `width:${Math.min(...d)}px!important;`;
43
- n = n.replace(e.REGULAR_NAME_HEIGHT, `${e.TRIMMED_NAME_HEIGHT} ${c} ${e.ELLIPSIS}`).replace(e.REGULAR_NAME_CONTAINER_HEIGHT, e.TRIMMED_NAME_CONTAINER_CSS).replace(e.RESPONSIVE_NAME_SIZE, `${e.RESPONSIVE_NAME_HEIGHT} ${c} ${e.ELLIPSIS}`).replace(e.RESPONSIVE_NAME_CONTAINER_HEIGHT, e.TRIMMED_RESPONSIVE_NAME_CONTAINER_CSS);
32
+ processor: (n) => {
33
+ const { calculateCardWidth: e, getRecommendationCampaignData: l } = N();
34
+ let s = n;
35
+ const r = s.match(_.ID);
36
+ if (r) {
37
+ const i = [];
38
+ if (r.forEach((p) => {
39
+ const u = /recommendation-id="(.*?)"/i.exec(p), I = u ? u[1].trim() : "", E = l(I);
40
+ E.textTrimming && E.orientation === h && i.push(e(E));
41
+ }), i.length) {
42
+ const p = `width:${Math.min(...i)}px!important;`;
43
+ s = s.replace(d.REGULAR_NAME_HEIGHT, `${d.TRIMMED_NAME_HEIGHT} ${p} ${d.ELLIPSIS}`).replace(d.REGULAR_NAME_CONTAINER_HEIGHT, d.TRIMMED_NAME_CONTAINER_CSS).replace(d.RESPONSIVE_NAME_SIZE, `${d.RESPONSIVE_NAME_HEIGHT} ${p} ${d.ELLIPSIS}`).replace(d.RESPONSIVE_NAME_CONTAINER_HEIGHT, d.TRIMMED_RESPONSIVE_NAME_CONTAINER_CSS);
44
44
  }
45
45
  }
46
- return n;
46
+ return s;
47
47
  },
48
48
  priority: 52
49
49
  },
@@ -51,39 +51,147 @@ const G = [
51
51
  id: "prepare-recommendations",
52
52
  description: "Replacing product data with template variables in recommendation blocks",
53
53
  type: "custom",
54
- processor: (s) => D(s),
54
+ processor: (n) => x(n),
55
55
  priority: 48
56
56
  },
57
57
  {
58
58
  id: "add-discount-conditions",
59
59
  description: "Adding discount conditions to the recommendation block",
60
60
  type: "custom",
61
- processor: (s) => {
62
- let t = s;
63
- const l = t.match(m.ATTRIBUTE_PARAGRAPH), { getRecommendationCampaignData: n } = f();
64
- return l !== null && l.forEach((o) => {
65
- const d = o.match(m.CUSTOM_FIELD);
66
- if (!d)
61
+ processor: (n) => {
62
+ let e = n;
63
+ const l = e.match(_.ATTRIBUTE_PARAGRAPH), { getRecommendationCampaignData: s } = N();
64
+ return l !== null && l.forEach((r) => {
65
+ const i = r.match(_.CUSTOM_FIELD);
66
+ if (!i)
67
67
  return;
68
- const [c] = d, E = c.match(m.CUSTOM_FIELD_INDEXES_PART), I = c.match(m.CUSTOM_FIELD_NAME_PART), p = o.match(m.ATTRIBUTE_PARAGRAPH_START_TAG);
69
- if (!E || !I || !p)
68
+ const [p] = i, u = p.match(_.CUSTOM_FIELD_INDEXES_PART), I = p.match(_.CUSTOM_FIELD_NAME_PART), E = r.match(_.ATTRIBUTE_PARAGRAPH_START_TAG);
69
+ if (!u || !I || !E)
70
70
  return;
71
- const [u] = E, [R] = I, [_] = p, T = R.substring(1, R.length - 2), S = _.match(m.COMPOSITION) !== null;
72
- let i = c;
73
- if (S) {
74
- const $ = u.substring(2, u.length - 3), r = n($);
75
- T === a.OMNIBUS_PRICE && (r.priceBeforeTextValue && (i = `${r.priceBeforeTextValue}${i}`), r.priceAfterTextValue && (i = `${i}${r.priceAfterTextValue}`)), T === a.OMNIBUS_DISCOUNT && (r.discountBeforeTextValue && (i = `${r.discountBeforeTextValue}${i}`), r.discountAfterTextValue && (i = `${i}${r.discountAfterTextValue}`));
71
+ const [S] = u, [m] = I, [t] = E, o = m.substring(1, m.length - 2), c = t.match(_.COMPOSITION) !== null;
72
+ let a = p;
73
+ if (c) {
74
+ const b = S.substring(2, S.length - 3), A = s(b);
75
+ o === R.OMNIBUS_PRICE && (A.priceBeforeTextValue && (a = `${A.priceBeforeTextValue}${a}`), A.priceAfterTextValue && (a = `${a}${A.priceAfterTextValue}`)), o === R.OMNIBUS_DISCOUNT && (A.discountBeforeTextValue && (a = `${A.discountBeforeTextValue}${a}`), A.discountAfterTextValue && (a = `${a}${A.discountAfterTextValue}`));
76
76
  }
77
- const N = u.substring(2);
78
- let M = "";
79
- T in A.IF && (M = A.IF[T].replaceAll(`{${a.DISCOUNT}}`, `${N}${a.DISCOUNT}`).replaceAll(`{${a.OMNIBUS_DISCOUNT}}`, `${N}${a.OMNIBUS_DISCOUNT}`).replaceAll(`{${a.OMNIBUS_PRICE}}`, `${N}${a.OMNIBUS_PRICE}`));
80
- const O = `${_}${i}${h.PARAGRAPH_END_TAG}`, C = `${M}${S ? O : o}${A.ELSE}${_}${h.PARAGRAPH_END_TAG}${A.END_IF}`;
81
- t = t.replace(o, C);
82
- }), t;
77
+ const f = S.substring(2);
78
+ let T = "";
79
+ o in y.IF && (T = y.IF[o].replaceAll(`{${R.DISCOUNT}}`, `${f}${R.DISCOUNT}`).replaceAll(`{${R.OMNIBUS_DISCOUNT}}`, `${f}${R.OMNIBUS_DISCOUNT}`).replaceAll(`{${R.OMNIBUS_PRICE}}`, `${f}${R.OMNIBUS_PRICE}`));
80
+ const $ = `${t}${a}${C.PARAGRAPH_END_TAG}`, g = `${T}${c ? $ : r}${y.ELSE}${t}${C.PARAGRAPH_END_TAG}${y.END_IF}`;
81
+ e = e.replace(r, g);
82
+ }), e;
83
83
  },
84
84
  priority: 53
85
+ },
86
+ {
87
+ id: "strip-empty-omnibus-spans",
88
+ description: "Remove empty omnibus text-before and text-after span elements",
89
+ type: "regex",
90
+ pattern: '<span class="omnibus-text-(?:before|after)">\\s*</span>',
91
+ replacement: "",
92
+ flags: "g",
93
+ priority: 54
94
+ },
95
+ {
96
+ id: "strip-recommendation-editor-attributes",
97
+ description: "Strip editor-only attributes from compiled recommendation output",
98
+ type: "regex",
99
+ // eslint-disable-next-line @stylistic/max-len
100
+ pattern: '\\s+(?:esd-extension-block-id|data-attribute-type|data-visibility|data-text-before|data-text-after|product-attr|composition)="[^"]*"',
101
+ replacement: "",
102
+ flags: "g",
103
+ priority: 55
104
+ },
105
+ {
106
+ id: "strip-unused-recommendation-classes",
107
+ description: "Remove CSS classes not referenced by any style rule from recommendation elements",
108
+ type: "custom",
109
+ processor: (n) => {
110
+ let e = n.replace(
111
+ / class="(?:product-card-segment|attribute-cell|recommendation-attribute-row|product-image|product-name|product-price|product-old-price|product-omnibus-price|product-omnibus-discount|product-button|recommendation-product-row|product-card-wrapper)"/g,
112
+ ""
113
+ );
114
+ return e = e.replaceAll("es-button buy-button", "es-button"), e = e.replaceAll("ins-recommendation-product-container ", ""), e;
115
+ },
116
+ priority: 56
117
+ },
118
+ {
119
+ id: "remove-empty-mobile-layout-artifacts",
120
+ description: "Remove empty mobile container rows and unused mobile layout CSS",
121
+ type: "custom",
122
+ processor: (n) => {
123
+ let e = n;
124
+ return e = e.replace(
125
+ /<tr[^>]*class="ins-recommendation-mobile-row"[^>]*><\/tr>/g,
126
+ ""
127
+ ), /class="[^"]*ins-recommendation-mobile-container/.test(e) || (e = e.replace(
128
+ /\.ins-recommendation-mobile-container\s*\{\s*display\s*:\s*none\s*;?\s*\}/g,
129
+ ""
130
+ ), e = e.replace(
131
+ /@media[^{]*max-width\s*:\s*480px[^{]*\{((?:[^{}]*\{[^{}]*\})*[^{}]*)\}/g,
132
+ (l, s) => {
133
+ const r = s.match(/[^{}]+\{[^{}]*\}/g) || [], i = /ins-recommendation|product-image-cell|button-cell|product-info-cell/;
134
+ return r.every((u) => i.test(u)) ? "" : l;
135
+ }
136
+ )), e;
137
+ },
138
+ priority: 57
139
+ },
140
+ {
141
+ id: "deduplicate-inline-styles",
142
+ description: "Replace repeated inline styles with CSS class references within recommendation blocks",
143
+ type: "custom",
144
+ processor: (n) => {
145
+ const e = /<!--REC_START-->([\s\S]*?)<!--REC_END-->/g, l = / style="([^"]*)"/g, s = /* @__PURE__ */ new Map();
146
+ let r = e.exec(n);
147
+ for (; r !== null; ) {
148
+ let t = l.exec(r[1]);
149
+ for (; t !== null; ) {
150
+ const [, o] = t;
151
+ s.set(o, (s.get(o) || 0) + 1), t = l.exec(r[1]);
152
+ }
153
+ l.lastIndex = 0, r = e.exec(n);
154
+ }
155
+ const i = /* @__PURE__ */ new Map(), p = [];
156
+ let u = 0;
157
+ if (s.forEach((t, o) => {
158
+ if (t >= 6) {
159
+ const c = `rc${u++}`;
160
+ i.set(o, c), p.push(`.${c}{${o}}`);
161
+ }
162
+ }), i.size === 0) {
163
+ let t = n;
164
+ return t = t.replaceAll("<!--REC_START-->", ""), t = t.replaceAll("<!--REC_END-->", ""), t;
165
+ }
166
+ const I = (t) => t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), E = (t, o) => `${t.slice(0, -1)} ${o}"`, S = /* @__PURE__ */ new Map();
167
+ i.forEach((t, o) => {
168
+ const c = I(o);
169
+ S.set(o, {
170
+ caseA: new RegExp(`(class="[^"]*")((?:[^>]*?)) style="${c}"`, "g"),
171
+ caseB: new RegExp(` style="${c}"((?:[^>]*?))(class="[^"]*")`, "g")
172
+ });
173
+ });
174
+ let m = n.replace("</style>", `${p.join("")}</style>`);
175
+ return m = m.replace(
176
+ /<!--REC_START-->([\s\S]*?)<!--REC_END-->/g,
177
+ (t, o) => {
178
+ let c = o;
179
+ return i.forEach((a, f) => {
180
+ const T = S.get(f);
181
+ T.caseA.lastIndex = 0, c = c.replace(
182
+ T.caseA,
183
+ ($, g, b) => E(g, a) + b
184
+ ), T.caseB.lastIndex = 0, c = c.replace(
185
+ T.caseB,
186
+ ($, g, b) => g + E(b, a)
187
+ ), c = c.replaceAll(` style="${f}"`, ` class="${a}"`);
188
+ }), c;
189
+ }
190
+ ), m = m.replaceAll("<!--REC_START-->", ""), m = m.replaceAll("<!--REC_END-->", ""), m;
191
+ },
192
+ priority: 58
85
193
  }
86
194
  ];
87
195
  export {
88
- G as recommendationCompilerRules
196
+ w as recommendationCompilerRules
89
197
  };
@@ -1,130 +1,131 @@
1
- import { useRecommendation as $ } from "../../../composables/useRecommendation.js";
2
- function b(e, u, r, o) {
3
- const n = `{{${e}_${u}_${r}}}`, t = `{{${e}_${u}_currency}}`;
4
- return o === "before" ? `${t} ${n}` : `${n} ${t}`;
1
+ import { useRecommendation as S } from "../../../composables/useRecommendation.js";
2
+ function b(e, n, r, c) {
3
+ const u = `{{${e}_${n}_${r}}}`, t = `{{${e}_${n}_currency}}`;
4
+ return c === "before" ? `${t} ${u}` : `${u} ${t}`;
5
5
  }
6
- function p(e, u, r, o, n) {
7
- switch (u) {
6
+ function p(e, n, r, c, u) {
7
+ switch (n) {
8
8
  case "productImage": {
9
9
  const t = e.querySelector("img");
10
- t && (t.setAttribute("src", `{{${r}_${o}_image_url}}`), t.setAttribute("alt", `{{${r}_${o}_name}}`));
11
- const c = e.querySelector("a");
12
- c && c.setAttribute("href", `{{${r}_${o}_url}}`);
10
+ t && (t.setAttribute("src", `{{${r}_${c}_image_url}}`), t.setAttribute("alt", `{{${r}_${c}_name}}`));
11
+ const o = e.querySelector("a");
12
+ o && o.setAttribute("href", `{{${r}_${c}_url}}`);
13
13
  break;
14
14
  }
15
15
  case "productName": {
16
16
  const t = e.querySelector("p");
17
17
  if (t) {
18
- const c = t.querySelector("strong") || t;
19
- c.textContent = `{{${r}_${o}_name}}`;
18
+ const o = t.querySelector("strong") || t;
19
+ o.textContent = `{{${r}_${c}_name}}`;
20
20
  }
21
21
  break;
22
22
  }
23
23
  case "productPrice": {
24
24
  const t = e.querySelector("p");
25
25
  if (t) {
26
- const c = t.querySelector("strong") || t;
27
- c.textContent = b(r, o, "price", n);
26
+ const o = t.querySelector("strong") || t;
27
+ o.textContent = b(r, c, "price", u);
28
28
  }
29
29
  break;
30
30
  }
31
31
  case "productOldPrice": {
32
32
  const t = e.querySelector("p");
33
33
  if (t) {
34
- const c = t.querySelector("strong") || t;
35
- c.textContent = b(
34
+ const o = t.querySelector("strong") || t;
35
+ o.textContent = b(
36
36
  r,
37
- o,
37
+ c,
38
38
  "original_price",
39
- n
39
+ u
40
40
  ), t.setAttribute("product-attr", "discount");
41
41
  }
42
42
  break;
43
43
  }
44
44
  case "productButton": {
45
45
  const t = e.querySelector("a");
46
- t && t.setAttribute("href", `{{${r}_${o}_url}}`);
46
+ t && t.setAttribute("href", `{{${r}_${c}_url}}`);
47
47
  break;
48
48
  }
49
49
  case "productOmnibusPrice": {
50
50
  const t = e.querySelector(".omnibus-price-value");
51
51
  if (t) {
52
- t.textContent = `{{${r}_${o}_omnibus_price}}`;
53
- const c = t.closest("p");
54
- c && (c.setAttribute("product-attr", "omnibus_price"), c.setAttribute("composition", "true"));
52
+ t.textContent = `{{${r}_${c}_omnibus_price}}`;
53
+ const o = t.closest("p");
54
+ o && (o.setAttribute("product-attr", "omnibus_price"), o.setAttribute("composition", "true"));
55
55
  }
56
56
  break;
57
57
  }
58
58
  case "productOmnibusDiscount": {
59
59
  const t = e.querySelector(".omnibus-discount-value");
60
60
  if (t) {
61
- t.textContent = `{{${r}_${o}_omnibus_discount}}`;
62
- const c = t.closest("p");
63
- c && (c.setAttribute("product-attr", "omnibus_discount"), c.setAttribute("composition", "true"));
61
+ t.textContent = `{{${r}_${c}_omnibus_discount}}`;
62
+ const o = t.closest("p");
63
+ o && (o.setAttribute("product-attr", "omnibus_discount"), o.setAttribute("composition", "true"));
64
64
  }
65
65
  break;
66
66
  }
67
67
  default: {
68
68
  const t = e.getAttribute("product-attr") ? e : e.querySelector("[product-attr]");
69
69
  if (t) {
70
- const c = t.getAttribute("product-attr"), s = t.querySelector("p");
70
+ const o = t.getAttribute("product-attr"), s = t.querySelector("p");
71
71
  if (s) {
72
72
  const i = s.querySelector("strong") || s;
73
- i.textContent = `{{${r}_${o}_${c}}}`;
73
+ i.textContent = `{{${r}_${c}_${o}}}`;
74
74
  }
75
75
  }
76
76
  break;
77
77
  }
78
78
  }
79
79
  }
80
- function S(e, u, r) {
81
- e.querySelectorAll(".recommendation-product-row").forEach((n, t) => {
82
- n.querySelectorAll("[data-attribute-type]").forEach((s) => {
83
- const i = s.getAttribute("data-attribute-type") || "", l = s.querySelectorAll(".attribute-cell");
84
- l.length > 0 ? l.forEach((a) => {
85
- p(a, i, u, t, r);
86
- }) : p(s, i, u, t, r);
80
+ function _(e, n, r) {
81
+ e.querySelectorAll(".recommendation-product-row").forEach((u, t) => {
82
+ u.querySelectorAll("[data-attribute-type]").forEach((s) => {
83
+ const i = s.getAttribute("data-attribute-type") || "", a = s.querySelectorAll(".attribute-cell");
84
+ a.length > 0 ? a.forEach((l) => {
85
+ p(l, i, n, t, r);
86
+ }) : p(s, i, n, t, r);
87
87
  });
88
88
  });
89
89
  }
90
- function _(e, u, r) {
91
- const o = e.querySelectorAll(".recommendation-product-row");
92
- if (!o.length)
90
+ function $(e, n, r) {
91
+ const c = e.querySelectorAll(".recommendation-product-row");
92
+ if (!c.length)
93
93
  return;
94
- const [n] = o, t = n.querySelector("[data-attribute-type]"), c = t ? t.querySelectorAll(".attribute-cell").length : 1;
95
- o.forEach((s, i) => {
96
- s.querySelectorAll("[data-attribute-type]").forEach((a) => {
97
- const f = a.getAttribute("data-attribute-type") || "";
98
- a.querySelectorAll(".attribute-cell").forEach((y, A) => {
99
- const m = i * c + A;
100
- p(y, f, u, m, r);
94
+ const [u] = c, t = u.querySelector("[data-attribute-type]"), o = t ? t.querySelectorAll(".attribute-cell").length : 1;
95
+ c.forEach((s, i) => {
96
+ s.querySelectorAll("[data-attribute-type]").forEach((l) => {
97
+ const f = l.getAttribute("data-attribute-type") || "";
98
+ l.querySelectorAll(".attribute-cell").forEach((y, m) => {
99
+ const A = i * o + m;
100
+ p(y, f, n, A, r);
101
101
  });
102
102
  });
103
103
  });
104
104
  }
105
- function q(e, u, r) {
106
- e.querySelectorAll(".ins-recommendation-product-container").forEach((n) => {
107
- _(n, u, r);
105
+ function d(e, n, r) {
106
+ e.querySelectorAll(".ins-recommendation-product-container").forEach((u) => {
107
+ $(u, n, r);
108
108
  });
109
109
  }
110
- function d(e, u) {
111
- const r = e.getAttribute("data-layout") || "grid", o = e.getAttribute("currency-alignment") || "after";
112
- r === "list" ? S(e, u, o) : q(e, u, o);
110
+ function q(e, n) {
111
+ const r = e.getAttribute("data-layout") || "grid", c = e.getAttribute("currency-alignment") || "after";
112
+ r === "list" ? _(e, n, c) : d(e, n, c);
113
113
  }
114
- function g(e, u) {
114
+ function g(e, n) {
115
115
  const r = e.match(/<!DOCTYPE[^>]*>/i);
116
116
  return (r ? `${r[0]}
117
- ` : "") + u.documentElement.outerHTML;
117
+ ` : "") + n.documentElement.outerHTML;
118
118
  }
119
119
  function E(e) {
120
- const u = e.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), r = new DOMParser().parseFromString(u, "text/html"), o = r.querySelectorAll(".recommendation-block-v2");
121
- if (!o.length)
120
+ const n = e.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), r = new DOMParser().parseFromString(n, "text/html"), c = r.querySelectorAll(".recommendation-block-v2");
121
+ if (!c.length)
122
122
  return e;
123
- const { buildCampaignUrl: n } = $();
124
- return o.forEach((c) => {
125
- const s = c.getAttribute("recommendation-id");
126
- s && (n(s), d(c, s));
127
- }), g(u, r).replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("&lt;!--{%", "{%").replaceAll("%}--&gt;", "%}");
123
+ const { buildCampaignUrl: u } = S();
124
+ return c.forEach((o) => {
125
+ var i, a;
126
+ const s = o.getAttribute("recommendation-id");
127
+ s && ((i = o.parentNode) == null || i.insertBefore(r.createComment("REC_START"), o), (a = o.parentNode) == null || a.insertBefore(r.createComment("REC_END"), o.nextSibling), u(s), q(o, s));
128
+ }), g(n, r).replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("&lt;!--{%", "{%").replaceAll("%}--&gt;", "%}");
128
129
  }
129
130
  export {
130
131
  b as formatPriceVariable,
@@ -169,7 +169,7 @@ class q extends b {
169
169
  if (e && e.includes(a))
170
170
  return t;
171
171
  }
172
- return "querySelector" in t ? t.querySelector(`.${a}`) ?? null : null;
172
+ return "querySelector" in t ? t.querySelector(`.${a}`) : null;
173
173
  }
174
174
  /**
175
175
  * Migrate configuration from legacy format
@@ -16,7 +16,7 @@ function M(t) {
16
16
  if (e && e.includes(h))
17
17
  return t;
18
18
  }
19
- return "querySelector" in t ? t.querySelector(`.${h}`) ?? null : null;
19
+ return "querySelector" in t ? t.querySelector(`.${h}`) : null;
20
20
  }
21
21
  function g(t) {
22
22
  const e = M(t);