@appsurify-testmap/rrweb-snapshot 3.10.0-alpha.1 → 3.12.0-alpha.1

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.
@@ -170,16 +170,30 @@ function describeNode(el) {
170
170
  const classes = el.classList.length ? "." + Array.from(el.classList).join(".") : "";
171
171
  return `${tag}${id}${classes}`;
172
172
  }
173
+ function isAncestorOpacityVisible(el, win) {
174
+ var _a;
175
+ let node2 = el.parentElement;
176
+ while (node2) {
177
+ const s = (_a = win.getComputedStyle) == null ? void 0 : _a.call(win, node2);
178
+ if (s && (parseFloat(s.opacity) || 0) <= 0) {
179
+ return false;
180
+ }
181
+ node2 = node2.parentElement;
182
+ }
183
+ return true;
184
+ }
173
185
  function getElementVisibility(el) {
174
186
  var _a, _b;
175
187
  const win = ((_a = el.ownerDocument) == null ? void 0 : _a.defaultView) ?? window;
176
188
  const rect = el.getBoundingClientRect();
177
189
  const viewportWidth = win.innerWidth || win.document.documentElement.clientWidth || 0;
178
190
  const viewportHeight = win.innerHeight || win.document.documentElement.clientHeight || 0;
179
- const isRectVisible = rect.width > 0 && rect.height > 0 && rect.bottom > 0 && rect.right > 0 && rect.top < viewportHeight && rect.left < viewportWidth;
191
+ const elHasSize = rect.width > 0 && rect.height > 0;
192
+ const isViewportVisible = elHasSize && rect.bottom > 0 && rect.right > 0 && rect.top < viewportHeight && rect.left < viewportWidth;
180
193
  const style = (_b = win.getComputedStyle) == null ? void 0 : _b.call(win, el);
181
- const isStyleVisible = !!style && style.display !== "none" && style.visibility !== "hidden" && (parseFloat(style.opacity) || 0) > 0;
182
- const isVisible = isStyleVisible && isRectVisible;
194
+ const isOwnStyleVisible = !!style && style.display !== "none" && style.visibility !== "hidden" && (parseFloat(style.opacity) || 0) > 0;
195
+ const isCSSVisible = isOwnStyleVisible && isAncestorOpacityVisible(el, win);
196
+ const isVisible = isCSSVisible && isViewportVisible;
183
197
  let ratio = 0;
184
198
  if (isVisible) {
185
199
  const xOverlap = Math.max(
@@ -196,6 +210,9 @@ function getElementVisibility(el) {
196
210
  }
197
211
  return {
198
212
  isVisible,
213
+ isCSSVisible,
214
+ isViewportVisible,
215
+ hasSize: elHasSize,
199
216
  ratio
200
217
  };
201
218
  }
@@ -647,19 +664,18 @@ function isTextVisible(n) {
647
664
  var _a;
648
665
  const parent = index.parentNode(n);
649
666
  const parentElement2 = parent && parent;
650
- if (!parentElement2) {
667
+ if (!parentElement2 || parentElement2.nodeType !== Node.ELEMENT_NODE) {
651
668
  return false;
652
669
  }
653
- const isParentVisible = isElementVisible(parentElement2);
654
- if (!isParentVisible) {
670
+ const parentVis = isElementVisible(parentElement2);
671
+ if (!parentVis.isVisible) {
655
672
  return false;
656
673
  }
657
674
  const textContent2 = (_a = n.textContent) == null ? void 0 : _a.trim();
658
675
  return textContent2 !== "";
659
676
  }
660
677
  function isElementVisible(el) {
661
- const visibility = index.getElementVisibility(el);
662
- return visibility.isVisible;
678
+ return index.getElementVisibility(el);
663
679
  }
664
680
  const interactiveEvents = [
665
681
  "change",
@@ -775,7 +791,7 @@ try {
775
791
  }
776
792
  } catch (error) {
777
793
  }
778
- const U = {
794
+ const z = {
779
795
  ANCHOR: 0.4,
780
796
  PATH: 0.3,
781
797
  TARGET: 0.2,
@@ -789,9 +805,9 @@ const U = {
789
805
  DEPTH_PENALTY_THRESHOLD: 5,
790
806
  DEPTH_PENALTY_FACTOR: 0.05,
791
807
  DEGRADED_SCORE: 0.3
792
- }, gt = {
808
+ }, bt = {
793
809
  MIN_CONFIDENCE_FOR_SKIP: 0.7
794
- }, K = [
810
+ }, tt = [
795
811
  "form",
796
812
  "main",
797
813
  "nav",
@@ -799,7 +815,7 @@ const U = {
799
815
  "article",
800
816
  "footer",
801
817
  "header"
802
- ], J = [
818
+ ], et = [
803
819
  "form",
804
820
  "navigation",
805
821
  "main",
@@ -808,7 +824,7 @@ const U = {
808
824
  "complementary",
809
825
  "banner",
810
826
  "search"
811
- ], mt = [
827
+ ], St = [
812
828
  // HTML5 Semantic
813
829
  "article",
814
830
  "aside",
@@ -912,7 +928,7 @@ const U = {
912
928
  "data-*": 30,
913
929
  // Any aria-* attribute (if not above)
914
930
  "aria-*": 25
915
- }, V = /* @__PURE__ */ new Set([
931
+ }, Y = /* @__PURE__ */ new Set([
916
932
  "id",
917
933
  // handled separately
918
934
  "class",
@@ -924,7 +940,7 @@ const U = {
924
940
  "tabindex",
925
941
  // can change
926
942
  "contenteditable"
927
- ]), bt = {
943
+ ]), At = {
928
944
  maxPathDepth: 10,
929
945
  enableSvgFingerprint: true,
930
946
  confidenceThreshold: 0,
@@ -932,7 +948,7 @@ const U = {
932
948
  includeUtilityClasses: false,
933
949
  source: "dom-dsl"
934
950
  };
935
- function P(r) {
951
+ function L(r) {
936
952
  if (/^[a-z]+-\d+$/i.test(r) || /^[a-z]+(-[a-z]+)+-\d+$/i.test(r) || /^[a-z]+(_[a-z]+)*_\d+$/i.test(r) || /^\d+$/.test(r) || /^:[a-z0-9]+:$/i.test(r) || /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i.test(r))
937
953
  return true;
938
954
  if (/^[a-z]{1,3}[A-Za-z0-9]{8,}$/.test(r)) {
@@ -942,7 +958,7 @@ function P(r) {
942
958
  }
943
959
  return !!(/^radix-/.test(r) || /^mui-\d+$/.test(r));
944
960
  }
945
- const Q = /* @__PURE__ */ new Set([
961
+ const Z = /* @__PURE__ */ new Set([
946
962
  "aria-labelledby",
947
963
  "aria-describedby",
948
964
  "aria-controls",
@@ -956,10 +972,10 @@ const Q = /* @__PURE__ */ new Set([
956
972
  "aria-errormessage",
957
973
  "aria-flowto"
958
974
  ]);
959
- function Y(r) {
960
- return r.trim().split(/\s+/).some((e) => P(e));
975
+ function K(r) {
976
+ return r.trim().split(/\s+/).some((e) => L(e));
961
977
  }
962
- class St {
978
+ class Ct {
963
979
  constructor(t, e) {
964
980
  this.maxDepth = t.maxPathDepth ?? 10, this.cache = e;
965
981
  }
@@ -992,25 +1008,25 @@ class St {
992
1008
  if (e === "head" || this.isInsideHead(t)) {
993
1009
  const c = s == null ? void 0 : s.documentElement;
994
1010
  if (c) {
995
- const u = {
1011
+ const l = {
996
1012
  element: c,
997
1013
  score: 1,
998
1014
  tier: "A",
999
1015
  depth: 0
1000
1016
  };
1001
- return this.cacheResult(t, u), u;
1017
+ return this.cacheResult(t, l), l;
1002
1018
  }
1003
1019
  }
1004
1020
  if (e === "body") {
1005
1021
  const c = s == null ? void 0 : s.documentElement;
1006
1022
  if (c) {
1007
- const u = {
1023
+ const l = {
1008
1024
  element: c,
1009
1025
  score: 1,
1010
1026
  tier: "A",
1011
1027
  depth: 0
1012
1028
  };
1013
- return this.cacheResult(t, u), u;
1029
+ return this.cacheResult(t, l), l;
1014
1030
  }
1015
1031
  }
1016
1032
  let n = t.parentElement, a = 0, i = null;
@@ -1024,10 +1040,10 @@ class St {
1024
1040
  };
1025
1041
  const c = this.scoreAnchor(n);
1026
1042
  if (c > 0) {
1027
- const u = this.applyDepthPenalty(c, a), d = this.getTier(n), l = { element: n, score: u, tier: d, depth: a };
1028
- if (d === "A")
1029
- return l;
1030
- (!i || u > i.score) && (i = l);
1043
+ const l = this.applyDepthPenalty(c, a), f = this.getTier(n), h = { element: n, score: l, tier: f, depth: a };
1044
+ if (f === "A")
1045
+ return h;
1046
+ (!i || l > i.score) && (i = h);
1031
1047
  }
1032
1048
  n = n.parentElement, a++;
1033
1049
  }
@@ -1042,11 +1058,11 @@ class St {
1042
1058
  scoreAnchor(t) {
1043
1059
  let e = 0;
1044
1060
  const s = t.tagName.toLowerCase();
1045
- K.includes(s) && (e += I.SEMANTIC_TAG);
1061
+ tt.includes(s) && (e += I.SEMANTIC_TAG);
1046
1062
  const n = t.getAttribute("role");
1047
- n && J.includes(n) && (e += I.ROLE), (t.hasAttribute("aria-label") || t.hasAttribute("aria-labelledby")) && (e += I.ARIA_LABEL);
1063
+ n && et.includes(n) && (e += I.ROLE), (t.hasAttribute("aria-label") || t.hasAttribute("aria-labelledby")) && (e += I.ARIA_LABEL);
1048
1064
  const a = t.id;
1049
- return a && !P(a) && (e += I.STABLE_ID), (t.hasAttribute("data-testid") || t.hasAttribute("data-qa") || t.hasAttribute("data-test")) && (e += I.TEST_MARKER), Math.min(e, 1);
1065
+ return a && !L(a) && (e += I.STABLE_ID), (t.hasAttribute("data-testid") || t.hasAttribute("data-qa") || t.hasAttribute("data-test")) && (e += I.TEST_MARKER), Math.min(e, 1);
1050
1066
  }
1051
1067
  /**
1052
1068
  * Applies depth penalty to score
@@ -1063,10 +1079,10 @@ class St {
1063
1079
  */
1064
1080
  getTier(t) {
1065
1081
  const e = t.tagName.toLowerCase();
1066
- if (K.includes(e))
1082
+ if (tt.includes(e))
1067
1083
  return "A";
1068
1084
  const s = t.getAttribute("role");
1069
- return s && J.includes(s) ? "B" : "C";
1085
+ return s && et.includes(s) ? "B" : "C";
1070
1086
  }
1071
1087
  /**
1072
1088
  * Checks if element is inside <head> section.
@@ -1099,7 +1115,7 @@ class St {
1099
1115
  this.cache && this.cache.setAnchor(t, e);
1100
1116
  }
1101
1117
  }
1102
- const At = [
1118
+ const Tt = [
1103
1119
  // CSS-in-JS
1104
1120
  /^css-[a-z0-9]+$/i,
1105
1121
  /^sc-[a-z0-9]+-\d+$/i,
@@ -1119,7 +1135,7 @@ const At = [
1119
1135
  /^_[a-z0-9]{5,}$/i,
1120
1136
  /\d{5,}/
1121
1137
  // 5+ digits in a row
1122
- ], xt = [
1138
+ ], Et = [
1123
1139
  // === FIX 4: Tailwind arbitrary values and variants (highest priority) ===
1124
1140
  /^\[/,
1125
1141
  // Any arbitrary value or variant starting with [ (e.g., [&_svg]:..., [mask-type:luminance])
@@ -1231,29 +1247,81 @@ const At = [
1231
1247
  /^pull-(left|right)$/,
1232
1248
  /^float-(left|right|none)$/
1233
1249
  ];
1234
- function O(r) {
1235
- return At.some((t) => t.test(r));
1250
+ function q(r) {
1251
+ return Tt.some((t) => t.test(r));
1236
1252
  }
1237
- function _(r) {
1238
- return r.length <= 2 || /^\d/.test(r) ? true : xt.some((t) => t.test(r));
1253
+ function U(r) {
1254
+ return r.length <= 2 || /^\d/.test(r) ? true : Et.some((t) => t.test(r));
1239
1255
  }
1240
- function Et(r) {
1241
- return !O(r) && !_(r);
1256
+ function $t(r) {
1257
+ return !q(r) && !U(r);
1242
1258
  }
1243
1259
  function M(r) {
1244
- return r.filter((t) => Et(t));
1260
+ return r.filter((t) => $t(t));
1245
1261
  }
1246
- function vt(r) {
1262
+ function It(r) {
1247
1263
  const t = [], e = [];
1248
1264
  for (const s of r)
1249
- _(s) || O(s) ? e.push(s) : t.push(s);
1265
+ U(s) || q(s) ? e.push(s) : t.push(s);
1250
1266
  return { semantic: t, utility: e };
1251
1267
  }
1252
- function tt(r) {
1253
- return _(r) || O(r);
1268
+ function st(r) {
1269
+ return U(r) || q(r);
1270
+ }
1271
+ const Rt = /* @__PURE__ */ new Set([
1272
+ "tr",
1273
+ "td",
1274
+ "th",
1275
+ "thead",
1276
+ "tbody",
1277
+ "tfoot"
1278
+ ]), Dt = /* @__PURE__ */ new Set([
1279
+ "data-testid",
1280
+ "data-qa",
1281
+ "data-cy",
1282
+ "data-test",
1283
+ "aria-label",
1284
+ "name",
1285
+ "href"
1286
+ ]);
1287
+ function Mt(r) {
1288
+ if (r.id) return true;
1289
+ if (r.attributes) {
1290
+ for (const t of Object.keys(r.attributes))
1291
+ if (Dt.has(t)) return true;
1292
+ }
1293
+ return false;
1294
+ }
1295
+ function Lt(r, t, e) {
1296
+ var _a;
1297
+ const s = r.parentElement;
1298
+ if (!s) return true;
1299
+ for (const n of Array.from(s.children)) {
1300
+ if (n === r || n.tagName.toLowerCase() !== t) continue;
1301
+ if ((((_a = n.textContent) == null ? void 0 : _a.trim()) ?? "") === e) return false;
1302
+ }
1303
+ return true;
1304
+ }
1305
+ function _(r, t, e) {
1306
+ var _a;
1307
+ if (Rt.has(r)) return true;
1308
+ if (Mt(t)) return false;
1309
+ if (e) {
1310
+ const s = e.parentElement;
1311
+ if (s) {
1312
+ const n = (_a = t.text) == null ? void 0 : _a.normalized;
1313
+ if (n && Lt(e, r, n))
1314
+ return false;
1315
+ if (Array.from(s.children).some(
1316
+ (i) => i !== e && i.tagName.toLowerCase() === r
1317
+ )) return true;
1318
+ }
1319
+ return false;
1320
+ }
1321
+ return true;
1254
1322
  }
1255
- const et = (r) => r.replace(/([#:.[\]@])/g, "\\$1");
1256
- class $t {
1323
+ const rt = (r) => r.replace(/([#:.[\]@])/g, "\\$1");
1324
+ class Pt {
1257
1325
  constructor(t, e) {
1258
1326
  this.maxDepth = t.maxPathDepth ?? 10, this.cache = e;
1259
1327
  }
@@ -1288,19 +1356,22 @@ class $t {
1288
1356
  degraded: true,
1289
1357
  degradationReason: "target-not-descendant-of-anchor"
1290
1358
  };
1291
- let u = this.filterNoise(i);
1292
- return u = this.ensureUniqueness(i, u, t, e, s), {
1293
- path: u.map((l) => {
1294
- const h = l.parentElement;
1359
+ let l = this.filterNoise(i);
1360
+ return l = this.ensureUniqueness(i, l, t, e, s), {
1361
+ path: l.map((h) => {
1362
+ const d = h.tagName.toLowerCase(), u = s.extract(h);
1295
1363
  let g;
1296
- if (h) {
1297
- const m = Array.from(h.children).indexOf(l);
1298
- m !== -1 && (g = m + 1);
1364
+ if (_(d, u, h)) {
1365
+ const m = h.parentElement;
1366
+ if (m) {
1367
+ const b = Array.from(m.children).indexOf(h);
1368
+ b !== -1 && (g = b + 1);
1369
+ }
1299
1370
  }
1300
1371
  return {
1301
- tag: l.tagName.toLowerCase(),
1302
- semantics: s.extract(l),
1303
- score: s.scoreElement(l),
1372
+ tag: d,
1373
+ semantics: u,
1374
+ score: s.scoreElement(h),
1304
1375
  nthChild: g
1305
1376
  };
1306
1377
  }),
@@ -1325,27 +1396,27 @@ class $t {
1325
1396
  if (!o) return e;
1326
1397
  let c;
1327
1398
  if (this.cache) {
1328
- const d = this.cache.getSelectorResults(i);
1329
- d !== void 0 ? c = d : (c = Array.from(o.querySelectorAll(i)), this.cache.setSelectorResults(i, c));
1399
+ const f = this.cache.getSelectorResults(i);
1400
+ f !== void 0 ? c = f : (c = Array.from(o.querySelectorAll(i)), this.cache.setSelectorResults(i, c));
1330
1401
  } else
1331
1402
  c = o.querySelectorAll(i);
1332
1403
  if (c.length <= 1)
1333
1404
  return e;
1334
- const u = t.filter((d) => !e.includes(d));
1335
- for (const d of u) {
1336
- if (a.scoreElement(d) < gt.MIN_CONFIDENCE_FOR_SKIP)
1405
+ const l = t.filter((f) => !e.includes(f));
1406
+ for (const f of l) {
1407
+ if (a.scoreElement(f) < bt.MIN_CONFIDENCE_FOR_SKIP)
1337
1408
  continue;
1338
- const h = this.insertNodeInOrder(e, d, t), g = this.buildTestSelector(s, h, n);
1409
+ const d = this.insertNodeInOrder(e, f, t), u = this.buildTestSelector(s, d, n);
1339
1410
  try {
1340
- let f;
1411
+ let g;
1341
1412
  if (this.cache) {
1342
- const m = this.cache.getSelectorResults(g);
1343
- m !== void 0 ? f = m : (f = Array.from(o.querySelectorAll(g)), this.cache.setSelectorResults(g, f));
1413
+ const m = this.cache.getSelectorResults(u);
1414
+ m !== void 0 ? g = m : (g = Array.from(o.querySelectorAll(u)), this.cache.setSelectorResults(u, g));
1344
1415
  } else
1345
- f = o.querySelectorAll(g);
1346
- if (f.length === 1)
1347
- return h;
1348
- f.length < c.length && (e = h);
1416
+ g = o.querySelectorAll(u);
1417
+ if (g.length === 1)
1418
+ return d;
1419
+ g.length < c.length && (e = d);
1349
1420
  } catch {
1350
1421
  }
1351
1422
  }
@@ -1379,9 +1450,9 @@ class $t {
1379
1450
  */
1380
1451
  elementToSelector(t) {
1381
1452
  let e = t.tagName.toLowerCase();
1382
- t.id && !P(t.id) && (e += `#${et(t.id)}`);
1453
+ t.id && !L(t.id) && (e += `#${rt(t.id)}`);
1383
1454
  for (const s of Array.from(t.classList))
1384
- tt(s) || (e += `.${et(s)}`);
1455
+ st(s) || (e += `.${rt(s)}`);
1385
1456
  return e;
1386
1457
  }
1387
1458
  /**
@@ -1395,7 +1466,7 @@ class $t {
1395
1466
  */
1396
1467
  shouldInclude(t) {
1397
1468
  const e = t.tagName.toLowerCase();
1398
- return mt.includes(e) ? true : e === "div" || e === "span" ? this.hasSemanticFeatures(t) : false;
1469
+ return St.includes(e) ? true : e === "div" || e === "span" ? this.hasSemanticFeatures(t) : false;
1399
1470
  }
1400
1471
  /**
1401
1472
  * Checks if element has meaningful semantic features
@@ -1406,12 +1477,12 @@ class $t {
1406
1477
  if (s.name.startsWith("aria-")) return true;
1407
1478
  if (t.classList.length > 0) {
1408
1479
  for (const s of Array.from(t.classList))
1409
- if (!tt(s)) return true;
1480
+ if (!st(s)) return true;
1410
1481
  }
1411
1482
  if (t.hasAttribute("data-testid") || t.hasAttribute("data-qa") || t.hasAttribute("data-test"))
1412
1483
  return true;
1413
1484
  const e = t.id;
1414
- return !!(e && !P(e));
1485
+ return !!(e && !L(e));
1415
1486
  }
1416
1487
  /**
1417
1488
  * Checks if element is inside <head> section.
@@ -1458,31 +1529,34 @@ class $t {
1458
1529
  degradationReason: "head-not-found-in-path"
1459
1530
  } : {
1460
1531
  path: n.map((c) => {
1461
- const u = c.parentElement;
1462
- let d;
1463
- if (u) {
1464
- const h = Array.from(u.children).indexOf(c);
1465
- h !== -1 && (d = h + 1);
1532
+ const l = c.tagName.toLowerCase(), f = s.extract(c);
1533
+ let h;
1534
+ if (_(l, f, c)) {
1535
+ const d = c.parentElement;
1536
+ if (d) {
1537
+ const g = Array.from(d.children).indexOf(c);
1538
+ g !== -1 && (h = g + 1);
1539
+ }
1466
1540
  }
1467
1541
  return {
1468
- tag: c.tagName.toLowerCase(),
1469
- semantics: s.extract(c),
1542
+ tag: l,
1543
+ semantics: f,
1470
1544
  score: s.scoreElement(c),
1471
- nthChild: d
1545
+ nthChild: h
1472
1546
  };
1473
1547
  }),
1474
1548
  degraded: false
1475
1549
  };
1476
1550
  }
1477
1551
  }
1478
- function F(r) {
1552
+ function j(r) {
1479
1553
  return r ? r.trim().replace(/[\n\t\r]/g, " ").replace(/\s+/g, " ") : "";
1480
1554
  }
1481
- const Nt = {
1555
+ const Ht = {
1482
1556
  preserveQueryForAbsolute: true,
1483
1557
  removeDynamicHashes: true
1484
1558
  };
1485
- function It(r) {
1559
+ function kt(r) {
1486
1560
  return r ? [
1487
1561
  /\d{5,}/,
1488
1562
  // 5+ digits
@@ -1496,18 +1570,18 @@ function It(r) {
1496
1570
  // UUID-like
1497
1571
  ].some((e) => e.test(r)) : false;
1498
1572
  }
1499
- function Rt(r, t) {
1573
+ function _t(r, t) {
1500
1574
  if (!r) return r;
1501
1575
  const e = r.startsWith("http://") || r.startsWith("https://"), [s, n] = r.split("#"), [a, i] = s.split("?");
1502
1576
  let o = a;
1503
- return e && t.preserveQueryForAbsolute && i && (o += `?${i}`), n && (t.removeDynamicHashes && It(n) || (o += `#${n}`)), o;
1577
+ return e && t.preserveQueryForAbsolute && i && (o += `?${i}`), n && (t.removeDynamicHashes && kt(n) || (o += `#${n}`)), o;
1504
1578
  }
1505
1579
  function D(r, t, e = {}) {
1506
1580
  if (!t) return t;
1507
- const s = { ...Nt, ...e };
1508
- return r === "href" || r === "src" ? Rt(t, s) : t;
1581
+ const s = { ...Ht, ...e };
1582
+ return r === "href" || r === "src" ? _t(t, s) : t;
1509
1583
  }
1510
- const Dt = [
1584
+ const Ot = [
1511
1585
  "role",
1512
1586
  "aria-label",
1513
1587
  "aria-labelledby",
@@ -1518,7 +1592,7 @@ const Dt = [
1518
1592
  "aria-posinset",
1519
1593
  "aria-setsize",
1520
1594
  "aria-haspopup"
1521
- ], Mt = [
1595
+ ], qt = [
1522
1596
  "aria-selected",
1523
1597
  "aria-checked",
1524
1598
  "aria-pressed",
@@ -1531,7 +1605,7 @@ const Dt = [
1531
1605
  "aria-grabbed",
1532
1606
  "aria-live",
1533
1607
  "aria-atomic"
1534
- ], Pt = [
1608
+ ], Ut = [
1535
1609
  "data-state",
1536
1610
  "data-active",
1537
1611
  "data-inactive",
@@ -1550,7 +1624,7 @@ const Dt = [
1550
1624
  "data-hover",
1551
1625
  "data-orientation",
1552
1626
  "data-theme"
1553
- ], Ht = [
1627
+ ], zt = [
1554
1628
  "data-radix-",
1555
1629
  "data-headlessui-",
1556
1630
  "data-reach-",
@@ -1558,7 +1632,7 @@ const Dt = [
1558
1632
  "data-chakra-",
1559
1633
  "data-mantine-",
1560
1634
  "data-tw-"
1561
- ], Lt = [
1635
+ ], Ft = [
1562
1636
  "data-testid",
1563
1637
  "data-test-id",
1564
1638
  "data-test",
@@ -1570,7 +1644,7 @@ const Dt = [
1570
1644
  "data-entity-id",
1571
1645
  "data-product-id",
1572
1646
  "data-user-id"
1573
- ], kt = [
1647
+ ], jt = [
1574
1648
  // Google Analytics / GTM
1575
1649
  "data-ga",
1576
1650
  "data-gtm",
@@ -1606,7 +1680,7 @@ const Dt = [
1606
1680
  "data-conversion",
1607
1681
  "data-segment",
1608
1682
  "data-analytics"
1609
- ], qt = [
1683
+ ], Wt = [
1610
1684
  "data-category",
1611
1685
  // Google Analytics category
1612
1686
  "data-action",
@@ -1615,7 +1689,7 @@ const Dt = [
1615
1689
  // Google Analytics label
1616
1690
  "data-value"
1617
1691
  // Google Analytics value
1618
- ], Ot = [
1692
+ ], Bt = [
1619
1693
  "id",
1620
1694
  "name",
1621
1695
  "type",
@@ -1624,7 +1698,7 @@ const Dt = [
1624
1698
  "for",
1625
1699
  "alt",
1626
1700
  "href"
1627
- ], _t = [
1701
+ ], Gt = [
1628
1702
  "disabled",
1629
1703
  "checked",
1630
1704
  "selected",
@@ -1632,17 +1706,17 @@ const Dt = [
1632
1706
  "readonly",
1633
1707
  "required",
1634
1708
  "value"
1635
- ], Ut = [
1709
+ ], Vt = [
1636
1710
  /^radix-/,
1637
1711
  /^headlessui-/,
1638
1712
  /^mui-/,
1639
1713
  /:\w+:/
1640
1714
  // matches :ru:, :r1:, etc.
1641
1715
  ];
1642
- function zt(r, t) {
1643
- return Dt.includes(r) ? true : Mt.includes(r) || Pt.includes(r) || Ht.some((e) => r.startsWith(e)) ? false : Lt.includes(r) ? true : kt.some((e) => r.startsWith(e)) || qt.includes(r) ? false : r.startsWith("data-") && r.endsWith("-id") ? true : r === "id" ? !Ut.some((e) => e.test(t)) : Ot.includes(r) ? true : _t.includes(r) ? false : !!r.startsWith("data-");
1716
+ function Qt(r, t) {
1717
+ return Ot.includes(r) ? true : qt.includes(r) || Ut.includes(r) || zt.some((e) => r.startsWith(e)) ? false : Ft.includes(r) ? true : jt.some((e) => r.startsWith(e)) || Wt.includes(r) ? false : r.startsWith("data-") && r.endsWith("-id") ? true : r === "id" ? !Vt.some((e) => e.test(t)) : Bt.includes(r) ? true : Gt.includes(r) ? false : !!r.startsWith("data-");
1644
1718
  }
1645
- class st {
1719
+ class nt {
1646
1720
  constructor(t, e) {
1647
1721
  this.includeUtilityClasses = t.includeUtilityClasses ?? false, this.cache = e;
1648
1722
  }
@@ -1658,12 +1732,12 @@ class st {
1658
1732
  return i;
1659
1733
  }
1660
1734
  const e = {}, s = t.id;
1661
- if (s && !P(s) && (e.id = s), t.classList.length > 0) {
1735
+ if (s && !L(s) && (e.id = s), t.classList.length > 0) {
1662
1736
  const i = Array.from(t.classList);
1663
1737
  if (this.includeUtilityClasses)
1664
1738
  e.classes = i;
1665
1739
  else {
1666
- const { semantic: o } = vt(i);
1740
+ const { semantic: o } = It(i);
1667
1741
  o.length > 0 && (e.classes = o);
1668
1742
  }
1669
1743
  }
@@ -1692,7 +1766,7 @@ class st {
1692
1766
  * @returns True if should be ignored
1693
1767
  */
1694
1768
  shouldIgnoreAttribute(t) {
1695
- return !!(V.has(t) || t.startsWith("on") || t.startsWith("ng-") || t.startsWith("_ng") || t.startsWith("data-reactid") || t.startsWith("data-react") || t.startsWith("data-v-"));
1769
+ return !!(Y.has(t) || t.startsWith("on") || t.startsWith("ng-") || t.startsWith("_ng") || t.startsWith("data-reactid") || t.startsWith("data-react") || t.startsWith("data-v-"));
1696
1770
  }
1697
1771
  /**
1698
1772
  * Gets attribute priority
@@ -1727,7 +1801,7 @@ class st {
1727
1801
  const e = {};
1728
1802
  for (const s of Array.from(t.attributes)) {
1729
1803
  const n = s.name;
1730
- if (this.shouldIgnoreAttribute(n) || !zt(n, s.value) || Q.has(n) && Y(s.value) || this.getAttributePriority(n) === 0) continue;
1804
+ if (this.shouldIgnoreAttribute(n) || !Qt(n, s.value) || Z.has(n) && K(s.value) || this.getAttributePriority(n) === 0) continue;
1731
1805
  const i = n === "href" || n === "src" ? D(n, s.value) : s.value;
1732
1806
  !i || i.trim() === "" || this.isDynamicValue(i) || (e[n] = i);
1733
1807
  }
@@ -1739,7 +1813,7 @@ class st {
1739
1813
  extractText(t) {
1740
1814
  const e = this.getDirectTextContent(t);
1741
1815
  if (!e) return null;
1742
- const s = F(e);
1816
+ const s = j(e);
1743
1817
  if (!s) return null;
1744
1818
  const n = 100, a = e.length > n ? e.slice(0, n) + "..." : e, i = s.length > n ? s.slice(0, n) + "..." : s;
1745
1819
  return {
@@ -1787,7 +1861,7 @@ class st {
1787
1861
  ].includes(e);
1788
1862
  }
1789
1863
  }
1790
- class Ft {
1864
+ class Yt {
1791
1865
  /**
1792
1866
  * Generates fingerprint for SVG element
1793
1867
  * @param element - SVG element to fingerprint
@@ -1898,11 +1972,11 @@ class Ft {
1898
1972
  return Math.abs(e).toString(16).padStart(8, "0");
1899
1973
  }
1900
1974
  }
1901
- function jt(r, t = 0) {
1902
- const e = r.anchor.score, s = r.path.length > 0 ? r.path.reduce((o, c) => o + c.score, 0) / r.path.length : 0.5, n = r.target.score, a = e * U.ANCHOR + s * U.PATH + n * U.TARGET + t * U.UNIQUENESS, i = r.anchor.degraded ? 0.2 : 0;
1975
+ function Zt(r, t = 0) {
1976
+ const e = r.anchor.score, s = r.path.length > 0 ? r.path.reduce((o, c) => o + c.score, 0) / r.path.length : 0.5, n = r.target.score, a = e * z.ANCHOR + s * z.PATH + n * z.TARGET + t * z.UNIQUENESS, i = r.anchor.degraded ? 0.2 : 0;
1903
1977
  return Math.max(0, Math.min(1, a - i));
1904
1978
  }
1905
- class Wt {
1979
+ class Kt {
1906
1980
  constructor(t) {
1907
1981
  this.cache = /* @__PURE__ */ new Map(), this.maxSize = t;
1908
1982
  }
@@ -1933,9 +2007,9 @@ class Wt {
1933
2007
  return this.cache.size;
1934
2008
  }
1935
2009
  }
1936
- class Bt {
2010
+ class Xt {
1937
2011
  constructor(t = {}) {
1938
- this.eidCache = /* @__PURE__ */ new WeakMap(), this.selectorResultCache = new Wt(
2012
+ this.eidCache = /* @__PURE__ */ new WeakMap(), this.selectorResultCache = new Kt(
1939
2013
  t.maxSelectorCacheSize ?? 1e3
1940
2014
  ), this.anchorCache = /* @__PURE__ */ new WeakMap(), this.semanticsCache = /* @__PURE__ */ new WeakMap(), this.stats = {
1941
2015
  eidHits: 0,
@@ -2084,12 +2158,12 @@ class Bt {
2084
2158
  return s > 0 ? t / s : 0;
2085
2159
  }
2086
2160
  }
2087
- function Gt(r) {
2088
- return new Bt(r);
2161
+ function Jt(r) {
2162
+ return new Xt(r);
2089
2163
  }
2090
- let z = null;
2091
- function Z() {
2092
- return z || (z = Gt()), z;
2164
+ let F = null;
2165
+ function X() {
2166
+ return F || (F = Jt()), F;
2093
2167
  }
2094
2168
  function k(r) {
2095
2169
  if (r.ownerDocument)
@@ -2107,7 +2181,7 @@ function k(r) {
2107
2181
  3. You are working with a document node instead of an element`
2108
2182
  );
2109
2183
  }
2110
- function Vt(r, t) {
2184
+ function te(r, t) {
2111
2185
  if (!t)
2112
2186
  return;
2113
2187
  const e = k(r), s = t instanceof Document ? t : k(t);
@@ -2122,64 +2196,65 @@ Common causes:
2122
2196
  Solution: Ensure element and root parameter are from the same document context.`
2123
2197
  );
2124
2198
  }
2125
- function X(r, t = {}) {
2199
+ function J(r, t = {}) {
2126
2200
  var _a;
2127
2201
  if (!r || !r.ownerDocument || !r.isConnected)
2128
2202
  return null;
2129
- const e = { ...bt, ...t };
2203
+ const e = { ...At, ...t };
2130
2204
  if (e.root)
2131
2205
  try {
2132
- Vt(r, e.root);
2206
+ te(r, e.root);
2133
2207
  } catch (x2) {
2134
2208
  return console.error("Cross-document generation detected:", x2), null;
2135
2209
  }
2136
- const s = e.cache ?? Z(), n = s.getEID(r);
2210
+ const s = e.cache ?? X(), n = s.getEID(r);
2137
2211
  if (n !== void 0)
2138
2212
  return n;
2139
- if (r.tagName.toLowerCase() === "html") {
2140
- const x2 = new st(e, s), y = Zt(r, e, x2);
2213
+ const a = r.tagName.toLowerCase();
2214
+ if (a === "html") {
2215
+ const x2 = new nt(e, s), y = re(r, e, x2);
2141
2216
  return s.setEID(r, y), y;
2142
2217
  }
2143
- const i = new St(e, s), o = new $t(e, s), c = new st(e, s), u = new Ft(), d = i.findAnchor(r);
2144
- if (!d && !e.fallbackToBody)
2218
+ const i = new Ct(e, s), o = new Pt(e, s), c = new nt(e, s), l = new Yt(), f = i.findAnchor(r);
2219
+ if (!f && !e.fallbackToBody)
2145
2220
  return null;
2146
- const l = (d == null ? void 0 : d.element) ?? ((_a = r.ownerDocument) == null ? void 0 : _a.body) ?? null;
2147
- if (!l) return null;
2148
- const h = !d || d.tier === "C", g = l.tagName.toLowerCase(), f = l.parentElement;
2149
- let m;
2150
- if (f && g !== "body" && g !== "html") {
2151
- const y = Array.from(f.children).indexOf(l);
2152
- y !== -1 && (m = y + 1);
2153
- }
2154
- const p = c.extract(l), b = {
2155
- tag: l.tagName.toLowerCase(),
2156
- semantics: p,
2157
- score: (d == null ? void 0 : d.score) ?? I.DEGRADED_SCORE,
2158
- degraded: h,
2159
- nthChild: m
2160
- }, S = o.buildPath(l, r, c), E = c.extract(r);
2161
- e.enableSvgFingerprint && Qt(r) && (E.svg = u.fingerprint(r));
2221
+ const h = (f == null ? void 0 : f.element) ?? ((_a = r.ownerDocument) == null ? void 0 : _a.body) ?? null;
2222
+ if (!h) return null;
2223
+ const d = !f || f.tier === "C", u = h.tagName.toLowerCase(), g = c.extract(h), m = h.parentElement;
2224
+ let p;
2225
+ if (m && u !== "body" && u !== "html" && _(u, g, h)) {
2226
+ const y = Array.from(m.children).indexOf(h);
2227
+ y !== -1 && (p = y + 1);
2228
+ }
2229
+ const b = {
2230
+ tag: h.tagName.toLowerCase(),
2231
+ semantics: g,
2232
+ score: (f == null ? void 0 : f.score) ?? I.DEGRADED_SCORE,
2233
+ degraded: d,
2234
+ nthChild: p
2235
+ }, S = o.buildPath(h, r, c), T = c.extract(r);
2236
+ e.enableSvgFingerprint && ee(r) && (T.svg = l.fingerprint(r));
2162
2237
  const C = r.parentElement;
2163
2238
  let A;
2164
- if (C) {
2239
+ if (C && _(a, T, r)) {
2165
2240
  const y = Array.from(C.children).indexOf(r);
2166
2241
  y !== -1 && (A = y + 1);
2167
2242
  }
2168
2243
  const v = {
2169
2244
  tag: r.tagName.toLowerCase(),
2170
- semantics: E,
2245
+ semantics: T,
2171
2246
  score: c.scoreElement(r),
2172
2247
  nthChild: A
2173
- }, H = [], $ = {
2248
+ }, P = [], $ = {
2174
2249
  onMultiple: "best-score",
2175
2250
  onMissing: "anchor-only",
2176
2251
  maxDepth: 3
2177
- }, T = b.degraded || S.degraded, R = Yt(b.degraded, S), N = {
2252
+ }, E = b.degraded || S.degraded, R = se(b.degraded, S), N = {
2178
2253
  version: "1.0",
2179
2254
  anchor: b,
2180
2255
  path: S.path,
2181
2256
  target: v,
2182
- constraints: H,
2257
+ constraints: P,
2183
2258
  fallback: $,
2184
2259
  meta: {
2185
2260
  confidence: 0,
@@ -2187,16 +2262,16 @@ function X(r, t = {}) {
2187
2262
  generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
2188
2263
  generator: "dom-eid@1.0",
2189
2264
  source: e.source,
2190
- degraded: T,
2265
+ degraded: E,
2191
2266
  degradationReason: R
2192
2267
  }
2193
2268
  };
2194
- return N.meta.confidence = jt(N), N.meta.confidence < e.confidenceThreshold ? null : (s.setEID(r, N), N);
2269
+ return N.meta.confidence = Zt(N), N.meta.confidence < e.confidenceThreshold ? null : (s.setEID(r, N), N);
2195
2270
  }
2196
- function Qt(r) {
2271
+ function ee(r) {
2197
2272
  return r.namespaceURI === "http://www.w3.org/2000/svg" || r.tagName.toLowerCase() === "svg" || r instanceof SVGElement;
2198
2273
  }
2199
- function Yt(r, t) {
2274
+ function se(r, t) {
2200
2275
  if (r && t.degraded)
2201
2276
  return "anchor-and-path-degraded";
2202
2277
  if (r)
@@ -2204,7 +2279,7 @@ function Yt(r, t) {
2204
2279
  if (t.degraded)
2205
2280
  return t.degradationReason;
2206
2281
  }
2207
- function Zt(r, t, e, s) {
2282
+ function re(r, t, e, s) {
2208
2283
  const a = {
2209
2284
  tag: "html",
2210
2285
  semantics: e.extract(r),
@@ -2233,91 +2308,119 @@ function Zt(r, t, e, s) {
2233
2308
  }
2234
2309
  };
2235
2310
  }
2236
- const ct = {
2311
+ const ht = {
2312
+ id: "i",
2313
+ "data-testid": "tid",
2314
+ "data-qa": "qa",
2315
+ "data-cy": "cy",
2316
+ "data-test": "dt",
2317
+ "aria-label": "al",
2318
+ "aria-labelledby": "alb",
2319
+ "aria-describedby": "adb",
2320
+ name: "n",
2321
+ href: "h",
2322
+ src: "s",
2323
+ type: "t",
2324
+ role: "r",
2325
+ alt: "at",
2326
+ title: "tt",
2327
+ for: "f",
2328
+ placeholder: "ph",
2329
+ text: "x"
2330
+ }, G = Object.fromEntries(
2331
+ Object.entries(ht).map(([r, t]) => [t, r])
2332
+ ), ut = {
2237
2333
  maxClasses: 2,
2238
2334
  maxAttributes: 5,
2239
2335
  includeText: true,
2240
2336
  maxTextLength: 50,
2241
2337
  simplifyTarget: true,
2242
- includeConstraints: true
2338
+ includeConstraints: true,
2339
+ format: "compact"
2243
2340
  };
2244
- function it(r) {
2341
+ function ct(r) {
2245
2342
  return r === "id" ? 101 : w[r] !== void 0 ? w[r] : r.startsWith("data-") ? w["data-*"] : r.startsWith("aria-") ? w["aria-*"] : 0;
2246
2343
  }
2247
- function ae(r) {
2344
+ function de(r) {
2248
2345
  return ["id", "data-testid", "data-qa", "data-cy", "href", "text", "role"].includes(r);
2249
2346
  }
2250
- function ie(r) {
2347
+ function fe(r) {
2251
2348
  return !!(/@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/.test(r) || /(\+?\d{1,3}[-.\s]?)?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}/.test(r) || /\d{4}[-\s]?\d{4}[-\s]?\d{4}[-\s]?\d{4}/.test(r));
2252
2349
  }
2253
- function oe(r, t) {
2254
- const e = { ...ct, ...t }, s = `v${r.version}`, n = j(r.anchor, false, e), a = r.path.length > 0 ? r.path.map((c) => j(c, false, e)).join(" > ") + " > " : "", i = j(r.target, true, e), o = e.includeConstraints ? le(r) : "";
2255
- return `${s}: ${n} :: ${a}${i}${o}`;
2256
- }
2257
- function j(r, t = false, e = ct) {
2258
- const { tag: s, semantics: n } = r;
2259
- let a = s;
2260
- const i = [], o = { ...n.attributes };
2261
- n.id && (o.id = n.id), n.role && !o.role && (o.role = n.role);
2262
- const c = Object.entries(o).map(([l, h]) => {
2263
- const g = it(l), f = l === "href" || l === "src" ? D(l, h) : h;
2264
- return { name: l, value: f, priority: g };
2265
- }).filter((l) => l.name !== "id" && l.name !== "class" && V.has(l.name) || Q.has(l.name) && Y(l.value) ? false : l.priority > 0 || l.name === "role" || l.name === "id");
2266
- c.sort((l, h) => h.priority - l.priority);
2267
- const u = c.slice(0, e.maxAttributes);
2268
- u.sort((l, h) => l.name.localeCompare(h.name));
2269
- for (const { name: l, value: h } of u)
2270
- i.push(`${l}="${B(h)}"`);
2271
- if (e.includeText && n.text && !ie(n.text.normalized)) {
2272
- const l = n.text.normalized;
2273
- l.length > 0 && l.length <= e.maxTextLength && i.push(`text="${B(l)}"`);
2274
- }
2275
- let d = i;
2276
- if (i.length > 0 && (t && e.simplifyTarget && n.id && (d = i.filter((l) => {
2277
- const h = l.split("=")[0];
2278
- return it(h) >= 60 || h === "text" || h === "id" || h === "role";
2279
- })), d.length > 0 && d.sort((l, h) => l.localeCompare(h))), n.classes && n.classes.length > 0) {
2280
- const l = M(n.classes), h = !!n.id || i.some(
2281
- (f) => f.startsWith("href=") || f.startsWith("data-testid=") || f.startsWith("text=") || f.startsWith("role=")
2282
- );
2283
- if (!(t && e.simplifyTarget && h) && l.length > 0) {
2284
- const f = l.sort().slice(0, e.maxClasses);
2285
- a += f.map((m) => `.${m}`).join("");
2350
+ function ge(r, t) {
2351
+ const e = { ...ut, ...t }, s = e.format === "compact", n = s ? "v1" : `v${r.version}`, a = s ? ":" : ": ", i = s ? "::" : " :: ", o = s ? ">" : " > ", c = e.includeText && r.target.semantics.text ? r.target.semantics.text.normalized : void 0, l = W(r.anchor, false, e), f = r.path.length > 0 ? r.path.map((u) => W(u, false, e, c)).join(o) + o : "", h = W(r.target, true, e), d = e.includeConstraints ? pe(r, e) : "";
2352
+ return `${n}${a}${l}${i}${f}${h}${d}`;
2353
+ }
2354
+ function W(r, t = false, e = ut, s) {
2355
+ const { tag: n, semantics: a } = r, i = e.format === "compact";
2356
+ let o = n;
2357
+ const c = [], l = { ...a.attributes };
2358
+ a.id && (l.id = a.id), a.role && !l.role && (l.role = a.role);
2359
+ const f = Object.entries(l).map(([u, g]) => {
2360
+ const m = ct(u), p = u === "href" || u === "src" ? D(u, g) : g;
2361
+ return { name: u, value: p, priority: m };
2362
+ }).filter((u) => u.name !== "id" && u.name !== "class" && Y.has(u.name) || Z.has(u.name) && K(u.value) ? false : u.priority > 0 || u.name === "role" || u.name === "id");
2363
+ f.sort((u, g) => g.priority - u.priority);
2364
+ const h = f.slice(0, e.maxAttributes);
2365
+ h.sort((u, g) => u.name.localeCompare(g.name));
2366
+ for (const { name: u, value: g } of h) {
2367
+ const m = i ? ht[u] ?? u : u;
2368
+ c.push(`${m}="${V(g)}"`);
2369
+ }
2370
+ if (e.includeText && a.text && !fe(a.text.normalized)) {
2371
+ const u = a.text.normalized;
2372
+ if (u.length > 0 && u.length <= e.maxTextLength && !(!t && s !== void 0 && u === s)) {
2373
+ const m = i ? "x" : "text";
2374
+ c.push(`${m}="${V(u)}"`);
2375
+ }
2376
+ }
2377
+ let d = c;
2378
+ if (c.length > 0 && t && e.simplifyTarget && a.id && (d = c.filter((u) => {
2379
+ const g = u.split("=")[0], m = G[g] ?? g;
2380
+ return ct(m) >= 60 || m === "text" || m === "id" || m === "role";
2381
+ })), a.classes && a.classes.length > 0) {
2382
+ const u = M(a.classes), g = !!a.id || c.some((p) => {
2383
+ const b = p.split("=")[0], S = G[b] ?? b;
2384
+ return S === "href" || S === "data-testid" || S === "text" || S === "role";
2385
+ });
2386
+ if (!(t && e.simplifyTarget && g) && u.length > 0) {
2387
+ const p = u.sort().slice(0, e.maxClasses);
2388
+ o += p.map((b) => `.${b}`).join("");
2286
2389
  }
2287
2390
  }
2288
- if (d.length > 0 && (a += `[${d.join(",")}]`), "nthChild" in r && r.nthChild) {
2289
- const l = !!n.id || n.attributes && Object.keys(n.attributes).some(ae);
2290
- t && e.simplifyTarget && l || (a += `#${r.nthChild}`);
2391
+ if (d.length > 0 && (o += `[${d.join(",")}]`), "nthChild" in r && r.nthChild) {
2392
+ const u = !!a.id || a.attributes && Object.keys(a.attributes).some(de);
2393
+ t && e.simplifyTarget && u || (o += `#${r.nthChild}`);
2291
2394
  }
2292
- return a;
2395
+ return o;
2293
2396
  }
2294
- function le(r) {
2397
+ function pe(r, t) {
2295
2398
  if (!r.constraints || r.constraints.length === 0)
2296
2399
  return "";
2297
- const t = [];
2298
- for (const e of r.constraints)
2299
- switch (e.type) {
2400
+ const e = [];
2401
+ for (const n of r.constraints)
2402
+ switch (n.type) {
2300
2403
  case "uniqueness":
2301
- t.push("unique=true");
2404
+ e.push("unique=true");
2302
2405
  break;
2303
2406
  case "position":
2304
- e.params && e.params.strategy && t.push(`pos=${e.params.strategy}`);
2407
+ n.params && n.params.strategy && e.push(`pos=${n.params.strategy}`);
2305
2408
  break;
2306
2409
  case "text-proximity":
2307
- if (e.params && e.params.reference) {
2308
- const s = B(String(e.params.reference));
2309
- t.push(`text="${s}"`);
2410
+ if (n.params && n.params.reference) {
2411
+ const a = V(String(n.params.reference));
2412
+ e.push(`text="${a}"`);
2310
2413
  }
2311
2414
  break;
2312
2415
  }
2313
- return t.length === 0 ? "" : ` {${t.join(",")}}`;
2416
+ return e.length === 0 ? "" : `${t.format === "verbose" ? " " : ""}{${e.join(",")}}`;
2314
2417
  }
2315
- function B(r) {
2418
+ function V(r) {
2316
2419
  return r.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/>/g, "\\>").replace(/:/g, "\\:");
2317
2420
  }
2318
- function xe(r, t, e) {
2319
- const s = X(r, t);
2320
- return s ? oe(s, e) : null;
2421
+ function Ne(r, t, e) {
2422
+ const s = J(r, t);
2423
+ return s ? ge(s, e) : null;
2321
2424
  }
2322
2425
  let _id = 1;
2323
2426
  const tagNameRegex = new RegExp("[^a-z0-9-_:]");
@@ -2990,7 +3093,7 @@ function serializeNodeWithId(n, options) {
2990
3093
  enableSvgFingerprint: selectorOptions.enableSvgFingerprint,
2991
3094
  fallbackToBody: selectorOptions.fallbackToBody
2992
3095
  };
2993
- const selector = xe(n, seqlGeneratorOptions);
3096
+ const selector = Ne(n, seqlGeneratorOptions);
2994
3097
  if (selector) {
2995
3098
  serializedNode.selector = selector;
2996
3099
  }
@@ -3002,7 +3105,11 @@ function serializeNodeWithId(n, options) {
3002
3105
  serializedNode.isVisible = isTextVisible(n);
3003
3106
  }
3004
3107
  if (n.nodeType === Node.ELEMENT_NODE) {
3005
- serializedNode.isVisible = isElementVisible(n);
3108
+ const vis = isElementVisible(n);
3109
+ serializedNode.isVisible = vis.isVisible;
3110
+ serializedNode.isCSSVisible = vis.isCSSVisible;
3111
+ serializedNode.isViewportVisible = vis.isViewportVisible;
3112
+ serializedNode.hasSize = vis.hasSize;
3006
3113
  serializedNode.isInteractive = isElementInteractive(n);
3007
3114
  }
3008
3115
  }