@appsurify-testmap/rrweb 3.6.0-alpha.1 → 3.11.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.
@@ -828,7 +828,7 @@ try {
828
828
  }
829
829
  } catch (error) {
830
830
  }
831
- const U$1 = {
831
+ const z$1 = {
832
832
  ANCHOR: 0.4,
833
833
  PATH: 0.3,
834
834
  TARGET: 0.2,
@@ -844,10 +844,10 @@ const I$1 = {
844
844
  DEPTH_PENALTY_FACTOR: 0.05,
845
845
  DEGRADED_SCORE: 0.3
846
846
  };
847
- const gt$1 = {
847
+ const bt$1 = {
848
848
  MIN_CONFIDENCE_FOR_SKIP: 0.7
849
849
  };
850
- const K$1 = [
850
+ const tt$1 = [
851
851
  "form",
852
852
  "main",
853
853
  "nav",
@@ -856,7 +856,7 @@ const K$1 = [
856
856
  "footer",
857
857
  "header"
858
858
  ];
859
- const J$1 = [
859
+ const et$1 = [
860
860
  "form",
861
861
  "navigation",
862
862
  "main",
@@ -866,7 +866,7 @@ const J$1 = [
866
866
  "banner",
867
867
  "search"
868
868
  ];
869
- const mt$1 = [
869
+ const St$1 = [
870
870
  // HTML5 Semantic
871
871
  "article",
872
872
  "aside",
@@ -972,7 +972,7 @@ const w$1 = {
972
972
  // Any aria-* attribute (if not above)
973
973
  "aria-*": 25
974
974
  };
975
- const V$1 = /* @__PURE__ */ new Set([
975
+ const Y$1 = /* @__PURE__ */ new Set([
976
976
  "id",
977
977
  // handled separately
978
978
  "class",
@@ -985,7 +985,7 @@ const V$1 = /* @__PURE__ */ new Set([
985
985
  // can change
986
986
  "contenteditable"
987
987
  ]);
988
- const bt$1 = {
988
+ const At$1 = {
989
989
  maxPathDepth: 10,
990
990
  enableSvgFingerprint: true,
991
991
  confidenceThreshold: 0,
@@ -993,7 +993,7 @@ const bt$1 = {
993
993
  includeUtilityClasses: false,
994
994
  source: "dom-dsl"
995
995
  };
996
- function P$1(r2) {
996
+ function L$1(r2) {
997
997
  if (/^[a-z]+-\d+$/i.test(r2) || /^[a-z]+(-[a-z]+)+-\d+$/i.test(r2) || /^[a-z]+(_[a-z]+)*_\d+$/i.test(r2) || /^\d+$/.test(r2) || /^:[a-z0-9]+:$/i.test(r2) || /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i.test(r2))
998
998
  return true;
999
999
  if (/^[a-z]{1,3}[A-Za-z0-9]{8,}$/.test(r2)) {
@@ -1003,7 +1003,7 @@ function P$1(r2) {
1003
1003
  }
1004
1004
  return !!(/^radix-/.test(r2) || /^mui-\d+$/.test(r2));
1005
1005
  }
1006
- const Q$1 = /* @__PURE__ */ new Set([
1006
+ const Z$1 = /* @__PURE__ */ new Set([
1007
1007
  "aria-labelledby",
1008
1008
  "aria-describedby",
1009
1009
  "aria-controls",
@@ -1017,10 +1017,10 @@ const Q$1 = /* @__PURE__ */ new Set([
1017
1017
  "aria-errormessage",
1018
1018
  "aria-flowto"
1019
1019
  ]);
1020
- function Y$1(r2) {
1021
- return r2.trim().split(/\s+/).some((e2) => P$1(e2));
1020
+ function K$1(r2) {
1021
+ return r2.trim().split(/\s+/).some((e2) => L$1(e2));
1022
1022
  }
1023
- let St$1 = class St {
1023
+ let Ct$1 = class Ct {
1024
1024
  constructor(t2, e2) {
1025
1025
  var _a2;
1026
1026
  this.maxDepth = (_a2 = t2.maxPathDepth) != null ? _a2 : 10, this.cache = e2;
@@ -1054,25 +1054,25 @@ let St$1 = class St {
1054
1054
  if (e2 === "head" || this.isInsideHead(t2)) {
1055
1055
  const c2 = s2 == null ? void 0 : s2.documentElement;
1056
1056
  if (c2) {
1057
- const u2 = {
1057
+ const l2 = {
1058
1058
  element: c2,
1059
1059
  score: 1,
1060
1060
  tier: "A",
1061
1061
  depth: 0
1062
1062
  };
1063
- return this.cacheResult(t2, u2), u2;
1063
+ return this.cacheResult(t2, l2), l2;
1064
1064
  }
1065
1065
  }
1066
1066
  if (e2 === "body") {
1067
1067
  const c2 = s2 == null ? void 0 : s2.documentElement;
1068
1068
  if (c2) {
1069
- const u2 = {
1069
+ const l2 = {
1070
1070
  element: c2,
1071
1071
  score: 1,
1072
1072
  tier: "A",
1073
1073
  depth: 0
1074
1074
  };
1075
- return this.cacheResult(t2, u2), u2;
1075
+ return this.cacheResult(t2, l2), l2;
1076
1076
  }
1077
1077
  }
1078
1078
  let n2 = t2.parentElement, a2 = 0, i2 = null;
@@ -1086,10 +1086,10 @@ let St$1 = class St {
1086
1086
  };
1087
1087
  const c2 = this.scoreAnchor(n2);
1088
1088
  if (c2 > 0) {
1089
- const u2 = this.applyDepthPenalty(c2, a2), d = this.getTier(n2), l2 = { element: n2, score: u2, tier: d, depth: a2 };
1090
- if (d === "A")
1091
- return l2;
1092
- (!i2 || u2 > i2.score) && (i2 = l2);
1089
+ const l2 = this.applyDepthPenalty(c2, a2), f2 = this.getTier(n2), h = { element: n2, score: l2, tier: f2, depth: a2 };
1090
+ if (f2 === "A")
1091
+ return h;
1092
+ (!i2 || l2 > i2.score) && (i2 = h);
1093
1093
  }
1094
1094
  n2 = n2.parentElement, a2++;
1095
1095
  }
@@ -1104,11 +1104,11 @@ let St$1 = class St {
1104
1104
  scoreAnchor(t2) {
1105
1105
  let e2 = 0;
1106
1106
  const s2 = t2.tagName.toLowerCase();
1107
- K$1.includes(s2) && (e2 += I$1.SEMANTIC_TAG);
1107
+ tt$1.includes(s2) && (e2 += I$1.SEMANTIC_TAG);
1108
1108
  const n2 = t2.getAttribute("role");
1109
- n2 && J$1.includes(n2) && (e2 += I$1.ROLE), (t2.hasAttribute("aria-label") || t2.hasAttribute("aria-labelledby")) && (e2 += I$1.ARIA_LABEL);
1109
+ n2 && et$1.includes(n2) && (e2 += I$1.ROLE), (t2.hasAttribute("aria-label") || t2.hasAttribute("aria-labelledby")) && (e2 += I$1.ARIA_LABEL);
1110
1110
  const a2 = t2.id;
1111
- return a2 && !P$1(a2) && (e2 += I$1.STABLE_ID), (t2.hasAttribute("data-testid") || t2.hasAttribute("data-qa") || t2.hasAttribute("data-test")) && (e2 += I$1.TEST_MARKER), Math.min(e2, 1);
1111
+ return a2 && !L$1(a2) && (e2 += I$1.STABLE_ID), (t2.hasAttribute("data-testid") || t2.hasAttribute("data-qa") || t2.hasAttribute("data-test")) && (e2 += I$1.TEST_MARKER), Math.min(e2, 1);
1112
1112
  }
1113
1113
  /**
1114
1114
  * Applies depth penalty to score
@@ -1125,10 +1125,10 @@ let St$1 = class St {
1125
1125
  */
1126
1126
  getTier(t2) {
1127
1127
  const e2 = t2.tagName.toLowerCase();
1128
- if (K$1.includes(e2))
1128
+ if (tt$1.includes(e2))
1129
1129
  return "A";
1130
1130
  const s2 = t2.getAttribute("role");
1131
- return s2 && J$1.includes(s2) ? "B" : "C";
1131
+ return s2 && et$1.includes(s2) ? "B" : "C";
1132
1132
  }
1133
1133
  /**
1134
1134
  * Checks if element is inside <head> section.
@@ -1163,7 +1163,7 @@ let St$1 = class St {
1163
1163
  this.cache && this.cache.setAnchor(t2, e2);
1164
1164
  }
1165
1165
  };
1166
- const At$1 = [
1166
+ const Tt$1 = [
1167
1167
  // CSS-in-JS
1168
1168
  /^css-[a-z0-9]+$/i,
1169
1169
  /^sc-[a-z0-9]+-\d+$/i,
@@ -1184,7 +1184,7 @@ const At$1 = [
1184
1184
  /\d{5,}/
1185
1185
  // 5+ digits in a row
1186
1186
  ];
1187
- const xt$1 = [
1187
+ const Et$1 = [
1188
1188
  // === FIX 4: Tailwind arbitrary values and variants (highest priority) ===
1189
1189
  /^\[/,
1190
1190
  // Any arbitrary value or variant starting with [ (e.g., [&_svg]:..., [mask-type:luminance])
@@ -1296,29 +1296,91 @@ const xt$1 = [
1296
1296
  /^pull-(left|right)$/,
1297
1297
  /^float-(left|right|none)$/
1298
1298
  ];
1299
- function O$1(r2) {
1300
- return At$1.some((t2) => t2.test(r2));
1299
+ function q$1(r2) {
1300
+ return Tt$1.some((t2) => t2.test(r2));
1301
1301
  }
1302
- function _$1(r2) {
1303
- return r2.length <= 2 || /^\d/.test(r2) ? true : xt$1.some((t2) => t2.test(r2));
1302
+ function U$1(r2) {
1303
+ return r2.length <= 2 || /^\d/.test(r2) ? true : Et$1.some((t2) => t2.test(r2));
1304
1304
  }
1305
- function Et$1(r2) {
1306
- return !O$1(r2) && !_$1(r2);
1305
+ function $t$1(r2) {
1306
+ return !q$1(r2) && !U$1(r2);
1307
1307
  }
1308
1308
  function M$1(r2) {
1309
- return r2.filter((t2) => Et$1(t2));
1309
+ return r2.filter((t2) => $t$1(t2));
1310
1310
  }
1311
- function vt$1(r2) {
1311
+ function It$1(r2) {
1312
1312
  const t2 = [], e2 = [];
1313
1313
  for (const s2 of r2)
1314
- _$1(s2) || O$1(s2) ? e2.push(s2) : t2.push(s2);
1314
+ U$1(s2) || q$1(s2) ? e2.push(s2) : t2.push(s2);
1315
1315
  return { semantic: t2, utility: e2 };
1316
1316
  }
1317
- function tt$1(r2) {
1318
- return _$1(r2) || O$1(r2);
1317
+ function st$1(r2) {
1318
+ return U$1(r2) || q$1(r2);
1319
+ }
1320
+ const Rt$1 = /* @__PURE__ */ new Set([
1321
+ "tr",
1322
+ "td",
1323
+ "th",
1324
+ "thead",
1325
+ "tbody",
1326
+ "tfoot"
1327
+ ]);
1328
+ const Dt$1 = /* @__PURE__ */ new Set([
1329
+ "data-testid",
1330
+ "data-qa",
1331
+ "data-cy",
1332
+ "data-test",
1333
+ "aria-label",
1334
+ "name",
1335
+ "href"
1336
+ ]);
1337
+ function Mt$1(r2) {
1338
+ if (r2.id)
1339
+ return true;
1340
+ if (r2.attributes) {
1341
+ for (const t2 of Object.keys(r2.attributes))
1342
+ if (Dt$1.has(t2))
1343
+ return true;
1344
+ }
1345
+ return false;
1346
+ }
1347
+ function Lt$1(r2, t2, e2) {
1348
+ var _a3;
1349
+ var _a2;
1350
+ const s2 = r2.parentElement;
1351
+ if (!s2)
1352
+ return true;
1353
+ for (const n2 of Array.from(s2.children)) {
1354
+ if (n2 === r2 || n2.tagName.toLowerCase() !== t2)
1355
+ continue;
1356
+ if (((_a3 = (_a2 = n2.textContent) == null ? void 0 : _a2.trim()) != null ? _a3 : "") === e2)
1357
+ return false;
1358
+ }
1359
+ return true;
1360
+ }
1361
+ function _$1(r2, t2, e2) {
1362
+ var _a2;
1363
+ if (Rt$1.has(r2))
1364
+ return true;
1365
+ if (Mt$1(t2))
1366
+ return false;
1367
+ if (e2) {
1368
+ const s2 = e2.parentElement;
1369
+ if (s2) {
1370
+ const n2 = (_a2 = t2.text) == null ? void 0 : _a2.normalized;
1371
+ if (n2 && Lt$1(e2, r2, n2))
1372
+ return false;
1373
+ if (Array.from(s2.children).some(
1374
+ (i2) => i2 !== e2 && i2.tagName.toLowerCase() === r2
1375
+ ))
1376
+ return true;
1377
+ }
1378
+ return false;
1379
+ }
1380
+ return true;
1319
1381
  }
1320
- const et$1 = (r2) => r2.replace(/([#:.[\]@])/g, "\\$1");
1321
- let $t$1 = class $t {
1382
+ const rt$1 = (r2) => r2.replace(/([#:.[\]@])/g, "\\$1");
1383
+ let Pt$1 = class Pt {
1322
1384
  constructor(t2, e2) {
1323
1385
  var _a2;
1324
1386
  this.maxDepth = (_a2 = t2.maxPathDepth) != null ? _a2 : 10, this.cache = e2;
@@ -1354,19 +1416,22 @@ let $t$1 = class $t {
1354
1416
  degraded: true,
1355
1417
  degradationReason: "target-not-descendant-of-anchor"
1356
1418
  };
1357
- let u2 = this.filterNoise(i2);
1358
- return u2 = this.ensureUniqueness(i2, u2, t2, e2, s2), {
1359
- path: u2.map((l2) => {
1360
- const h = l2.parentElement;
1419
+ let l2 = this.filterNoise(i2);
1420
+ return l2 = this.ensureUniqueness(i2, l2, t2, e2, s2), {
1421
+ path: l2.map((h) => {
1422
+ const d = h.tagName.toLowerCase(), u2 = s2.extract(h);
1361
1423
  let g;
1362
- if (h) {
1363
- const m = Array.from(h.children).indexOf(l2);
1364
- m !== -1 && (g = m + 1);
1424
+ if (_$1(d, u2, h)) {
1425
+ const m = h.parentElement;
1426
+ if (m) {
1427
+ const b = Array.from(m.children).indexOf(h);
1428
+ b !== -1 && (g = b + 1);
1429
+ }
1365
1430
  }
1366
1431
  return {
1367
- tag: l2.tagName.toLowerCase(),
1368
- semantics: s2.extract(l2),
1369
- score: s2.scoreElement(l2),
1432
+ tag: d,
1433
+ semantics: u2,
1434
+ score: s2.scoreElement(h),
1370
1435
  nthChild: g
1371
1436
  };
1372
1437
  }),
@@ -1392,27 +1457,27 @@ let $t$1 = class $t {
1392
1457
  return e2;
1393
1458
  let c2;
1394
1459
  if (this.cache) {
1395
- const d = this.cache.getSelectorResults(i2);
1396
- d !== void 0 ? c2 = d : (c2 = Array.from(o2.querySelectorAll(i2)), this.cache.setSelectorResults(i2, c2));
1460
+ const f2 = this.cache.getSelectorResults(i2);
1461
+ f2 !== void 0 ? c2 = f2 : (c2 = Array.from(o2.querySelectorAll(i2)), this.cache.setSelectorResults(i2, c2));
1397
1462
  } else
1398
1463
  c2 = o2.querySelectorAll(i2);
1399
1464
  if (c2.length <= 1)
1400
1465
  return e2;
1401
- const u2 = t2.filter((d) => !e2.includes(d));
1402
- for (const d of u2) {
1403
- if (a2.scoreElement(d) < gt$1.MIN_CONFIDENCE_FOR_SKIP)
1466
+ const l2 = t2.filter((f2) => !e2.includes(f2));
1467
+ for (const f2 of l2) {
1468
+ if (a2.scoreElement(f2) < bt$1.MIN_CONFIDENCE_FOR_SKIP)
1404
1469
  continue;
1405
- const h = this.insertNodeInOrder(e2, d, t2), g = this.buildTestSelector(s2, h, n2);
1470
+ const d = this.insertNodeInOrder(e2, f2, t2), u2 = this.buildTestSelector(s2, d, n2);
1406
1471
  try {
1407
- let f2;
1472
+ let g;
1408
1473
  if (this.cache) {
1409
- const m = this.cache.getSelectorResults(g);
1410
- m !== void 0 ? f2 = m : (f2 = Array.from(o2.querySelectorAll(g)), this.cache.setSelectorResults(g, f2));
1474
+ const m = this.cache.getSelectorResults(u2);
1475
+ m !== void 0 ? g = m : (g = Array.from(o2.querySelectorAll(u2)), this.cache.setSelectorResults(u2, g));
1411
1476
  } else
1412
- f2 = o2.querySelectorAll(g);
1413
- if (f2.length === 1)
1414
- return h;
1415
- f2.length < c2.length && (e2 = h);
1477
+ g = o2.querySelectorAll(u2);
1478
+ if (g.length === 1)
1479
+ return d;
1480
+ g.length < c2.length && (e2 = d);
1416
1481
  } catch (e3) {
1417
1482
  }
1418
1483
  }
@@ -1446,9 +1511,9 @@ let $t$1 = class $t {
1446
1511
  */
1447
1512
  elementToSelector(t2) {
1448
1513
  let e2 = t2.tagName.toLowerCase();
1449
- t2.id && !P$1(t2.id) && (e2 += `#${et$1(t2.id)}`);
1514
+ t2.id && !L$1(t2.id) && (e2 += `#${rt$1(t2.id)}`);
1450
1515
  for (const s2 of Array.from(t2.classList))
1451
- tt$1(s2) || (e2 += `.${et$1(s2)}`);
1516
+ st$1(s2) || (e2 += `.${rt$1(s2)}`);
1452
1517
  return e2;
1453
1518
  }
1454
1519
  /**
@@ -1462,7 +1527,7 @@ let $t$1 = class $t {
1462
1527
  */
1463
1528
  shouldInclude(t2) {
1464
1529
  const e2 = t2.tagName.toLowerCase();
1465
- return mt$1.includes(e2) ? true : e2 === "div" || e2 === "span" ? this.hasSemanticFeatures(t2) : false;
1530
+ return St$1.includes(e2) ? true : e2 === "div" || e2 === "span" ? this.hasSemanticFeatures(t2) : false;
1466
1531
  }
1467
1532
  /**
1468
1533
  * Checks if element has meaningful semantic features
@@ -1475,13 +1540,13 @@ let $t$1 = class $t {
1475
1540
  return true;
1476
1541
  if (t2.classList.length > 0) {
1477
1542
  for (const s2 of Array.from(t2.classList))
1478
- if (!tt$1(s2))
1543
+ if (!st$1(s2))
1479
1544
  return true;
1480
1545
  }
1481
1546
  if (t2.hasAttribute("data-testid") || t2.hasAttribute("data-qa") || t2.hasAttribute("data-test"))
1482
1547
  return true;
1483
1548
  const e2 = t2.id;
1484
- return !!(e2 && !P$1(e2));
1549
+ return !!(e2 && !L$1(e2));
1485
1550
  }
1486
1551
  /**
1487
1552
  * Checks if element is inside <head> section.
@@ -1530,31 +1595,34 @@ let $t$1 = class $t {
1530
1595
  degradationReason: "head-not-found-in-path"
1531
1596
  } : {
1532
1597
  path: n2.map((c2) => {
1533
- const u2 = c2.parentElement;
1534
- let d;
1535
- if (u2) {
1536
- const h = Array.from(u2.children).indexOf(c2);
1537
- h !== -1 && (d = h + 1);
1598
+ const l2 = c2.tagName.toLowerCase(), f2 = s2.extract(c2);
1599
+ let h;
1600
+ if (_$1(l2, f2, c2)) {
1601
+ const d = c2.parentElement;
1602
+ if (d) {
1603
+ const g = Array.from(d.children).indexOf(c2);
1604
+ g !== -1 && (h = g + 1);
1605
+ }
1538
1606
  }
1539
1607
  return {
1540
- tag: c2.tagName.toLowerCase(),
1541
- semantics: s2.extract(c2),
1608
+ tag: l2,
1609
+ semantics: f2,
1542
1610
  score: s2.scoreElement(c2),
1543
- nthChild: d
1611
+ nthChild: h
1544
1612
  };
1545
1613
  }),
1546
1614
  degraded: false
1547
1615
  };
1548
1616
  }
1549
1617
  };
1550
- function F$1(r2) {
1618
+ function j$1(r2) {
1551
1619
  return r2 ? r2.trim().replace(/[\n\t\r]/g, " ").replace(/\s+/g, " ") : "";
1552
1620
  }
1553
- const Nt$1 = {
1621
+ const Ht$1 = {
1554
1622
  preserveQueryForAbsolute: true,
1555
1623
  removeDynamicHashes: true
1556
1624
  };
1557
- function It$1(r2) {
1625
+ function kt$1(r2) {
1558
1626
  return r2 ? [
1559
1627
  /\d{5,}/,
1560
1628
  // 5+ digits
@@ -1568,20 +1636,20 @@ function It$1(r2) {
1568
1636
  // UUID-like
1569
1637
  ].some((e2) => e2.test(r2)) : false;
1570
1638
  }
1571
- function Rt$1(r2, t2) {
1639
+ function _t$1(r2, t2) {
1572
1640
  if (!r2)
1573
1641
  return r2;
1574
1642
  const e2 = r2.startsWith("http://") || r2.startsWith("https://"), [s2, n2] = r2.split("#"), [a2, i2] = s2.split("?");
1575
1643
  let o2 = a2;
1576
- return e2 && t2.preserveQueryForAbsolute && i2 && (o2 += `?${i2}`), n2 && (t2.removeDynamicHashes && It$1(n2) || (o2 += `#${n2}`)), o2;
1644
+ return e2 && t2.preserveQueryForAbsolute && i2 && (o2 += `?${i2}`), n2 && (t2.removeDynamicHashes && kt$1(n2) || (o2 += `#${n2}`)), o2;
1577
1645
  }
1578
1646
  function D$1(r2, t2, e2 = {}) {
1579
1647
  if (!t2)
1580
1648
  return t2;
1581
- const s2 = __spreadValues(__spreadValues({}, Nt$1), e2);
1582
- return r2 === "href" || r2 === "src" ? Rt$1(t2, s2) : t2;
1649
+ const s2 = __spreadValues(__spreadValues({}, Ht$1), e2);
1650
+ return r2 === "href" || r2 === "src" ? _t$1(t2, s2) : t2;
1583
1651
  }
1584
- const Dt$1 = [
1652
+ const Ot$1 = [
1585
1653
  "role",
1586
1654
  "aria-label",
1587
1655
  "aria-labelledby",
@@ -1593,7 +1661,7 @@ const Dt$1 = [
1593
1661
  "aria-setsize",
1594
1662
  "aria-haspopup"
1595
1663
  ];
1596
- const Mt$1 = [
1664
+ const qt$1 = [
1597
1665
  "aria-selected",
1598
1666
  "aria-checked",
1599
1667
  "aria-pressed",
@@ -1607,7 +1675,7 @@ const Mt$1 = [
1607
1675
  "aria-live",
1608
1676
  "aria-atomic"
1609
1677
  ];
1610
- const Pt$1 = [
1678
+ const Ut$1 = [
1611
1679
  "data-state",
1612
1680
  "data-active",
1613
1681
  "data-inactive",
@@ -1627,7 +1695,7 @@ const Pt$1 = [
1627
1695
  "data-orientation",
1628
1696
  "data-theme"
1629
1697
  ];
1630
- const Ht$1 = [
1698
+ const zt$1 = [
1631
1699
  "data-radix-",
1632
1700
  "data-headlessui-",
1633
1701
  "data-reach-",
@@ -1636,7 +1704,7 @@ const Ht$1 = [
1636
1704
  "data-mantine-",
1637
1705
  "data-tw-"
1638
1706
  ];
1639
- const Lt$1 = [
1707
+ const Ft$1 = [
1640
1708
  "data-testid",
1641
1709
  "data-test-id",
1642
1710
  "data-test",
@@ -1649,7 +1717,7 @@ const Lt$1 = [
1649
1717
  "data-product-id",
1650
1718
  "data-user-id"
1651
1719
  ];
1652
- const kt$1 = [
1720
+ const jt$1 = [
1653
1721
  // Google Analytics / GTM
1654
1722
  "data-ga",
1655
1723
  "data-gtm",
@@ -1686,7 +1754,7 @@ const kt$1 = [
1686
1754
  "data-segment",
1687
1755
  "data-analytics"
1688
1756
  ];
1689
- const qt$1 = [
1757
+ const Wt$1 = [
1690
1758
  "data-category",
1691
1759
  // Google Analytics category
1692
1760
  "data-action",
@@ -1696,7 +1764,7 @@ const qt$1 = [
1696
1764
  "data-value"
1697
1765
  // Google Analytics value
1698
1766
  ];
1699
- const Ot$1 = [
1767
+ const Bt$1 = [
1700
1768
  "id",
1701
1769
  "name",
1702
1770
  "type",
@@ -1706,7 +1774,7 @@ const Ot$1 = [
1706
1774
  "alt",
1707
1775
  "href"
1708
1776
  ];
1709
- const _t$1 = [
1777
+ const Gt$1 = [
1710
1778
  "disabled",
1711
1779
  "checked",
1712
1780
  "selected",
@@ -1715,17 +1783,17 @@ const _t$1 = [
1715
1783
  "required",
1716
1784
  "value"
1717
1785
  ];
1718
- const Ut$1 = [
1786
+ const Vt$1 = [
1719
1787
  /^radix-/,
1720
1788
  /^headlessui-/,
1721
1789
  /^mui-/,
1722
1790
  /:\w+:/
1723
1791
  // matches :ru:, :r1:, etc.
1724
1792
  ];
1725
- function zt$1(r2, t2) {
1726
- return Dt$1.includes(r2) ? true : Mt$1.includes(r2) || Pt$1.includes(r2) || Ht$1.some((e2) => r2.startsWith(e2)) ? false : Lt$1.includes(r2) ? true : kt$1.some((e2) => r2.startsWith(e2)) || qt$1.includes(r2) ? false : r2.startsWith("data-") && r2.endsWith("-id") ? true : r2 === "id" ? !Ut$1.some((e2) => e2.test(t2)) : Ot$1.includes(r2) ? true : _t$1.includes(r2) ? false : !!r2.startsWith("data-");
1793
+ function Qt$1(r2, t2) {
1794
+ return Ot$1.includes(r2) ? true : qt$1.includes(r2) || Ut$1.includes(r2) || zt$1.some((e2) => r2.startsWith(e2)) ? false : Ft$1.includes(r2) ? true : jt$1.some((e2) => r2.startsWith(e2)) || Wt$1.includes(r2) ? false : r2.startsWith("data-") && r2.endsWith("-id") ? true : r2 === "id" ? !Vt$1.some((e2) => e2.test(t2)) : Bt$1.includes(r2) ? true : Gt$1.includes(r2) ? false : !!r2.startsWith("data-");
1727
1795
  }
1728
- let st$1 = class st {
1796
+ let nt$1 = class nt {
1729
1797
  constructor(t2, e2) {
1730
1798
  var _a2;
1731
1799
  this.includeUtilityClasses = (_a2 = t2.includeUtilityClasses) != null ? _a2 : false, this.cache = e2;
@@ -1742,12 +1810,12 @@ let st$1 = class st {
1742
1810
  return i2;
1743
1811
  }
1744
1812
  const e2 = {}, s2 = t2.id;
1745
- if (s2 && !P$1(s2) && (e2.id = s2), t2.classList.length > 0) {
1813
+ if (s2 && !L$1(s2) && (e2.id = s2), t2.classList.length > 0) {
1746
1814
  const i2 = Array.from(t2.classList);
1747
1815
  if (this.includeUtilityClasses)
1748
1816
  e2.classes = i2;
1749
1817
  else {
1750
- const { semantic: o2 } = vt$1(i2);
1818
+ const { semantic: o2 } = It$1(i2);
1751
1819
  o2.length > 0 && (e2.classes = o2);
1752
1820
  }
1753
1821
  }
@@ -1776,7 +1844,7 @@ let st$1 = class st {
1776
1844
  * @returns True if should be ignored
1777
1845
  */
1778
1846
  shouldIgnoreAttribute(t2) {
1779
- return !!(V$1.has(t2) || t2.startsWith("on") || t2.startsWith("ng-") || t2.startsWith("_ng") || t2.startsWith("data-reactid") || t2.startsWith("data-react") || t2.startsWith("data-v-"));
1847
+ return !!(Y$1.has(t2) || t2.startsWith("on") || t2.startsWith("ng-") || t2.startsWith("_ng") || t2.startsWith("data-reactid") || t2.startsWith("data-react") || t2.startsWith("data-v-"));
1780
1848
  }
1781
1849
  /**
1782
1850
  * Gets attribute priority
@@ -1811,7 +1879,7 @@ let st$1 = class st {
1811
1879
  const e2 = {};
1812
1880
  for (const s2 of Array.from(t2.attributes)) {
1813
1881
  const n2 = s2.name;
1814
- if (this.shouldIgnoreAttribute(n2) || !zt$1(n2, s2.value) || Q$1.has(n2) && Y$1(s2.value) || this.getAttributePriority(n2) === 0)
1882
+ if (this.shouldIgnoreAttribute(n2) || !Qt$1(n2, s2.value) || Z$1.has(n2) && K$1(s2.value) || this.getAttributePriority(n2) === 0)
1815
1883
  continue;
1816
1884
  const i2 = n2 === "href" || n2 === "src" ? D$1(n2, s2.value) : s2.value;
1817
1885
  !i2 || i2.trim() === "" || this.isDynamicValue(i2) || (e2[n2] = i2);
@@ -1825,7 +1893,7 @@ let st$1 = class st {
1825
1893
  const e2 = this.getDirectTextContent(t2);
1826
1894
  if (!e2)
1827
1895
  return null;
1828
- const s2 = F$1(e2);
1896
+ const s2 = j$1(e2);
1829
1897
  if (!s2)
1830
1898
  return null;
1831
1899
  const n2 = 100, a2 = e2.length > n2 ? e2.slice(0, n2) + "..." : e2, i2 = s2.length > n2 ? s2.slice(0, n2) + "..." : s2;
@@ -1875,7 +1943,7 @@ let st$1 = class st {
1875
1943
  ].includes(e2);
1876
1944
  }
1877
1945
  };
1878
- let Ft$1 = class Ft {
1946
+ let Yt$1 = class Yt {
1879
1947
  /**
1880
1948
  * Generates fingerprint for SVG element
1881
1949
  * @param element - SVG element to fingerprint
@@ -1990,11 +2058,11 @@ let Ft$1 = class Ft {
1990
2058
  return Math.abs(e2).toString(16).padStart(8, "0");
1991
2059
  }
1992
2060
  };
1993
- function jt$1(r2, t2 = 0) {
1994
- const e2 = r2.anchor.score, s2 = r2.path.length > 0 ? r2.path.reduce((o2, c2) => o2 + c2.score, 0) / r2.path.length : 0.5, n2 = r2.target.score, a2 = e2 * U$1.ANCHOR + s2 * U$1.PATH + n2 * U$1.TARGET + t2 * U$1.UNIQUENESS, i2 = r2.anchor.degraded ? 0.2 : 0;
2061
+ function Zt$1(r2, t2 = 0) {
2062
+ const e2 = r2.anchor.score, s2 = r2.path.length > 0 ? r2.path.reduce((o2, c2) => o2 + c2.score, 0) / r2.path.length : 0.5, n2 = r2.target.score, a2 = e2 * z$1.ANCHOR + s2 * z$1.PATH + n2 * z$1.TARGET + t2 * z$1.UNIQUENESS, i2 = r2.anchor.degraded ? 0.2 : 0;
1995
2063
  return Math.max(0, Math.min(1, a2 - i2));
1996
2064
  }
1997
- let Wt$1 = class Wt {
2065
+ let Kt$1 = class Kt {
1998
2066
  constructor(t2) {
1999
2067
  this.cache = /* @__PURE__ */ new Map(), this.maxSize = t2;
2000
2068
  }
@@ -2025,10 +2093,10 @@ let Wt$1 = class Wt {
2025
2093
  return this.cache.size;
2026
2094
  }
2027
2095
  };
2028
- let Bt$1 = class Bt {
2096
+ let Xt$1 = class Xt {
2029
2097
  constructor(t2 = {}) {
2030
2098
  var _a2, _b;
2031
- this.eidCache = /* @__PURE__ */ new WeakMap(), this.selectorResultCache = new Wt$1(
2099
+ this.eidCache = /* @__PURE__ */ new WeakMap(), this.selectorResultCache = new Kt$1(
2032
2100
  (_a2 = t2.maxSelectorCacheSize) != null ? _a2 : 1e3
2033
2101
  ), this.anchorCache = /* @__PURE__ */ new WeakMap(), this.semanticsCache = /* @__PURE__ */ new WeakMap(), this.stats = {
2034
2102
  eidHits: 0,
@@ -2176,12 +2244,12 @@ let Bt$1 = class Bt {
2176
2244
  return s2 > 0 ? t2 / s2 : 0;
2177
2245
  }
2178
2246
  };
2179
- function Gt$1(r2) {
2180
- return new Bt$1(r2);
2247
+ function Jt$1(r2) {
2248
+ return new Xt$1(r2);
2181
2249
  }
2182
- let z$1 = null;
2183
- function Z$1() {
2184
- return z$1 || (z$1 = Gt$1()), z$1;
2250
+ let F$1 = null;
2251
+ function X$1() {
2252
+ return F$1 || (F$1 = Jt$1()), F$1;
2185
2253
  }
2186
2254
  function k$1(r2) {
2187
2255
  if (r2.ownerDocument)
@@ -2199,7 +2267,7 @@ function k$1(r2) {
2199
2267
  3. You are working with a document node instead of an element`
2200
2268
  );
2201
2269
  }
2202
- function Vt$1(r2, t2) {
2270
+ function te$1(r2, t2) {
2203
2271
  if (!t2)
2204
2272
  return;
2205
2273
  const e2 = k$1(r2), s2 = t2 instanceof Document ? t2 : k$1(t2);
@@ -2214,66 +2282,67 @@ Common causes:
2214
2282
  Solution: Ensure element and root parameter are from the same document context.`
2215
2283
  );
2216
2284
  }
2217
- function X$1(r2, t2 = {}) {
2285
+ function J$1(r2, t2 = {}) {
2218
2286
  var _a3, _b, _c, _d;
2219
2287
  var _a2;
2220
2288
  if (!r2 || !r2.ownerDocument || !r2.isConnected)
2221
2289
  return null;
2222
- const e2 = __spreadValues(__spreadValues({}, bt$1), t2);
2290
+ const e2 = __spreadValues(__spreadValues({}, At$1), t2);
2223
2291
  if (e2.root)
2224
2292
  try {
2225
- Vt$1(r2, e2.root);
2293
+ te$1(r2, e2.root);
2226
2294
  } catch (x2) {
2227
2295
  return console.error("Cross-document generation detected:", x2), null;
2228
2296
  }
2229
- const s2 = (_a3 = e2.cache) != null ? _a3 : Z$1(), n2 = s2.getEID(r2);
2297
+ const s2 = (_a3 = e2.cache) != null ? _a3 : X$1(), n2 = s2.getEID(r2);
2230
2298
  if (n2 !== void 0)
2231
2299
  return n2;
2232
- if (r2.tagName.toLowerCase() === "html") {
2233
- const x2 = new st$1(e2, s2), y = Zt$1(r2, e2, x2);
2300
+ const a2 = r2.tagName.toLowerCase();
2301
+ if (a2 === "html") {
2302
+ const x2 = new nt$1(e2, s2), y = re$1(r2, e2, x2);
2234
2303
  return s2.setEID(r2, y), y;
2235
2304
  }
2236
- const i2 = new St$1(e2, s2), o2 = new $t$1(e2, s2), c2 = new st$1(e2, s2), u2 = new Ft$1(), d = i2.findAnchor(r2);
2237
- if (!d && !e2.fallbackToBody)
2305
+ const i2 = new Ct$1(e2, s2), o2 = new Pt$1(e2, s2), c2 = new nt$1(e2, s2), l2 = new Yt$1(), f2 = i2.findAnchor(r2);
2306
+ if (!f2 && !e2.fallbackToBody)
2238
2307
  return null;
2239
- const l2 = (_c = (_b = d == null ? void 0 : d.element) != null ? _b : (_a2 = r2.ownerDocument) == null ? void 0 : _a2.body) != null ? _c : null;
2240
- if (!l2)
2308
+ const h = (_c = (_b = f2 == null ? void 0 : f2.element) != null ? _b : (_a2 = r2.ownerDocument) == null ? void 0 : _a2.body) != null ? _c : null;
2309
+ if (!h)
2241
2310
  return null;
2242
- const h = !d || d.tier === "C", g = l2.tagName.toLowerCase(), f2 = l2.parentElement;
2243
- let m;
2244
- if (f2 && g !== "body" && g !== "html") {
2245
- const y = Array.from(f2.children).indexOf(l2);
2246
- y !== -1 && (m = y + 1);
2247
- }
2248
- const p = c2.extract(l2), b = {
2249
- tag: l2.tagName.toLowerCase(),
2250
- semantics: p,
2251
- score: (_d = d == null ? void 0 : d.score) != null ? _d : I$1.DEGRADED_SCORE,
2252
- degraded: h,
2253
- nthChild: m
2254
- }, S = o2.buildPath(l2, r2, c2), E = c2.extract(r2);
2255
- e2.enableSvgFingerprint && Qt$1(r2) && (E.svg = u2.fingerprint(r2));
2311
+ const d = !f2 || f2.tier === "C", u2 = h.tagName.toLowerCase(), g = c2.extract(h), m = h.parentElement;
2312
+ let p;
2313
+ if (m && u2 !== "body" && u2 !== "html" && _$1(u2, g, h)) {
2314
+ const y = Array.from(m.children).indexOf(h);
2315
+ y !== -1 && (p = y + 1);
2316
+ }
2317
+ const b = {
2318
+ tag: h.tagName.toLowerCase(),
2319
+ semantics: g,
2320
+ score: (_d = f2 == null ? void 0 : f2.score) != null ? _d : I$1.DEGRADED_SCORE,
2321
+ degraded: d,
2322
+ nthChild: p
2323
+ }, S = o2.buildPath(h, r2, c2), T = c2.extract(r2);
2324
+ e2.enableSvgFingerprint && ee$1(r2) && (T.svg = l2.fingerprint(r2));
2256
2325
  const C = r2.parentElement;
2257
2326
  let A;
2258
- if (C) {
2327
+ if (C && _$1(a2, T, r2)) {
2259
2328
  const y = Array.from(C.children).indexOf(r2);
2260
2329
  y !== -1 && (A = y + 1);
2261
2330
  }
2262
2331
  const v2 = {
2263
2332
  tag: r2.tagName.toLowerCase(),
2264
- semantics: E,
2333
+ semantics: T,
2265
2334
  score: c2.scoreElement(r2),
2266
2335
  nthChild: A
2267
- }, H = [], $ = {
2336
+ }, P = [], $ = {
2268
2337
  onMultiple: "best-score",
2269
2338
  onMissing: "anchor-only",
2270
2339
  maxDepth: 3
2271
- }, T = b.degraded || S.degraded, R = Yt$1(b.degraded, S), N = {
2340
+ }, E = b.degraded || S.degraded, R = se$1(b.degraded, S), N = {
2272
2341
  version: "1.0",
2273
2342
  anchor: b,
2274
2343
  path: S.path,
2275
2344
  target: v2,
2276
- constraints: H,
2345
+ constraints: P,
2277
2346
  fallback: $,
2278
2347
  meta: {
2279
2348
  confidence: 0,
@@ -2281,16 +2350,16 @@ function X$1(r2, t2 = {}) {
2281
2350
  generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
2282
2351
  generator: "dom-eid@1.0",
2283
2352
  source: e2.source,
2284
- degraded: T,
2353
+ degraded: E,
2285
2354
  degradationReason: R
2286
2355
  }
2287
2356
  };
2288
- return N.meta.confidence = jt$1(N), N.meta.confidence < e2.confidenceThreshold ? null : (s2.setEID(r2, N), N);
2357
+ return N.meta.confidence = Zt$1(N), N.meta.confidence < e2.confidenceThreshold ? null : (s2.setEID(r2, N), N);
2289
2358
  }
2290
- function Qt$1(r2) {
2359
+ function ee$1(r2) {
2291
2360
  return r2.namespaceURI === "http://www.w3.org/2000/svg" || r2.tagName.toLowerCase() === "svg" || r2 instanceof SVGElement;
2292
2361
  }
2293
- function Yt$1(r2, t2) {
2362
+ function se$1(r2, t2) {
2294
2363
  if (r2 && t2.degraded)
2295
2364
  return "anchor-and-path-degraded";
2296
2365
  if (r2)
@@ -2298,7 +2367,7 @@ function Yt$1(r2, t2) {
2298
2367
  if (t2.degraded)
2299
2368
  return t2.degradationReason;
2300
2369
  }
2301
- function Zt$1(r2, t2, e2, s2) {
2370
+ function re$1(r2, t2, e2, s2) {
2302
2371
  const a2 = {
2303
2372
  tag: "html",
2304
2373
  semantics: e2.extract(r2),
@@ -2327,91 +2396,124 @@ function Zt$1(r2, t2, e2, s2) {
2327
2396
  }
2328
2397
  };
2329
2398
  }
2330
- const ct$1 = {
2399
+ const ht$2 = {
2400
+ id: "i",
2401
+ "data-testid": "tid",
2402
+ "data-qa": "qa",
2403
+ "data-cy": "cy",
2404
+ "data-test": "dt",
2405
+ "aria-label": "al",
2406
+ "aria-labelledby": "alb",
2407
+ "aria-describedby": "adb",
2408
+ name: "n",
2409
+ href: "h",
2410
+ src: "s",
2411
+ type: "t",
2412
+ role: "r",
2413
+ alt: "at",
2414
+ title: "tt",
2415
+ for: "f",
2416
+ placeholder: "ph",
2417
+ text: "x"
2418
+ };
2419
+ const G$1 = Object.fromEntries(
2420
+ Object.entries(ht$2).map(([r2, t2]) => [t2, r2])
2421
+ );
2422
+ const ut$1 = {
2331
2423
  maxClasses: 2,
2332
2424
  maxAttributes: 5,
2333
2425
  includeText: true,
2334
2426
  maxTextLength: 50,
2335
2427
  simplifyTarget: true,
2336
- includeConstraints: true
2428
+ includeConstraints: true,
2429
+ format: "compact"
2337
2430
  };
2338
- function it$1(r2) {
2431
+ function ct$1(r2) {
2339
2432
  return r2 === "id" ? 101 : w$1[r2] !== void 0 ? w$1[r2] : r2.startsWith("data-") ? w$1["data-*"] : r2.startsWith("aria-") ? w$1["aria-*"] : 0;
2340
2433
  }
2341
- function ae$1(r2) {
2434
+ function de$1(r2) {
2342
2435
  return ["id", "data-testid", "data-qa", "data-cy", "href", "text", "role"].includes(r2);
2343
2436
  }
2344
- function ie$1(r2) {
2437
+ function fe$1(r2) {
2345
2438
  return !!(/@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/.test(r2) || /(\+?\d{1,3}[-.\s]?)?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}/.test(r2) || /\d{4}[-\s]?\d{4}[-\s]?\d{4}[-\s]?\d{4}/.test(r2));
2346
2439
  }
2347
- function oe$1(r2, t2) {
2348
- const e2 = __spreadValues(__spreadValues({}, ct$1), t2), s2 = `v${r2.version}`, n2 = j$1(r2.anchor, false, e2), a2 = r2.path.length > 0 ? r2.path.map((c2) => j$1(c2, false, e2)).join(" > ") + " > " : "", i2 = j$1(r2.target, true, e2), o2 = e2.includeConstraints ? le$1(r2) : "";
2349
- return `${s2}: ${n2} :: ${a2}${i2}${o2}`;
2350
- }
2351
- function j$1(r2, t2 = false, e2 = ct$1) {
2352
- const { tag: s2, semantics: n2 } = r2;
2353
- let a2 = s2;
2354
- const i2 = [], o2 = __spreadValues({}, n2.attributes);
2355
- n2.id && (o2.id = n2.id), n2.role && !o2.role && (o2.role = n2.role);
2356
- const c2 = Object.entries(o2).map(([l2, h]) => {
2357
- const g = it$1(l2), f2 = l2 === "href" || l2 === "src" ? D$1(l2, h) : h;
2358
- return { name: l2, value: f2, priority: g };
2359
- }).filter((l2) => l2.name !== "id" && l2.name !== "class" && V$1.has(l2.name) || Q$1.has(l2.name) && Y$1(l2.value) ? false : l2.priority > 0 || l2.name === "role" || l2.name === "id");
2360
- c2.sort((l2, h) => h.priority - l2.priority);
2361
- const u2 = c2.slice(0, e2.maxAttributes);
2362
- u2.sort((l2, h) => l2.name.localeCompare(h.name));
2363
- for (const { name: l2, value: h } of u2)
2364
- i2.push(`${l2}="${B$1(h)}"`);
2365
- if (e2.includeText && n2.text && !ie$1(n2.text.normalized)) {
2366
- const l2 = n2.text.normalized;
2367
- l2.length > 0 && l2.length <= e2.maxTextLength && i2.push(`text="${B$1(l2)}"`);
2368
- }
2369
- let d = i2;
2370
- if (i2.length > 0 && (t2 && e2.simplifyTarget && n2.id && (d = i2.filter((l2) => {
2371
- const h = l2.split("=")[0];
2372
- return it$1(h) >= 60 || h === "text" || h === "id" || h === "role";
2373
- })), d.length > 0 && d.sort((l2, h) => l2.localeCompare(h))), n2.classes && n2.classes.length > 0) {
2374
- const l2 = M$1(n2.classes), h = !!n2.id || i2.some(
2375
- (f2) => f2.startsWith("href=") || f2.startsWith("data-testid=") || f2.startsWith("text=") || f2.startsWith("role=")
2376
- );
2377
- if (!(t2 && e2.simplifyTarget && h) && l2.length > 0) {
2378
- const f2 = l2.sort().slice(0, e2.maxClasses);
2379
- a2 += f2.map((m) => `.${m}`).join("");
2440
+ function ge$1(r2, t2) {
2441
+ const e2 = __spreadValues(__spreadValues({}, ut$1), t2), s2 = e2.format === "compact", n2 = s2 ? "v1" : `v${r2.version}`, a2 = s2 ? ":" : ": ", i2 = s2 ? "::" : " :: ", o2 = s2 ? ">" : " > ", c2 = e2.includeText && r2.target.semantics.text ? r2.target.semantics.text.normalized : void 0, l2 = W$1(r2.anchor, false, e2), f2 = r2.path.length > 0 ? r2.path.map((u2) => W$1(u2, false, e2, c2)).join(o2) + o2 : "", h = W$1(r2.target, true, e2), d = e2.includeConstraints ? pe$1(r2, e2) : "";
2442
+ return `${n2}${a2}${l2}${i2}${f2}${h}${d}`;
2443
+ }
2444
+ function W$1(r2, t2 = false, e2 = ut$1, s2) {
2445
+ var _a2;
2446
+ const { tag: n2, semantics: a2 } = r2, i2 = e2.format === "compact";
2447
+ let o2 = n2;
2448
+ const c2 = [], l2 = __spreadValues({}, a2.attributes);
2449
+ a2.id && (l2.id = a2.id), a2.role && !l2.role && (l2.role = a2.role);
2450
+ const f2 = Object.entries(l2).map(([u2, g]) => {
2451
+ const m = ct$1(u2), p = u2 === "href" || u2 === "src" ? D$1(u2, g) : g;
2452
+ return { name: u2, value: p, priority: m };
2453
+ }).filter((u2) => u2.name !== "id" && u2.name !== "class" && Y$1.has(u2.name) || Z$1.has(u2.name) && K$1(u2.value) ? false : u2.priority > 0 || u2.name === "role" || u2.name === "id");
2454
+ f2.sort((u2, g) => g.priority - u2.priority);
2455
+ const h = f2.slice(0, e2.maxAttributes);
2456
+ h.sort((u2, g) => u2.name.localeCompare(g.name));
2457
+ for (const { name: u2, value: g } of h) {
2458
+ const m = i2 ? (_a2 = ht$2[u2]) != null ? _a2 : u2 : u2;
2459
+ c2.push(`${m}="${V$1(g)}"`);
2460
+ }
2461
+ if (e2.includeText && a2.text && !fe$1(a2.text.normalized)) {
2462
+ const u2 = a2.text.normalized;
2463
+ if (u2.length > 0 && u2.length <= e2.maxTextLength && !(!t2 && s2 !== void 0 && u2 === s2)) {
2464
+ const m = i2 ? "x" : "text";
2465
+ c2.push(`${m}="${V$1(u2)}"`);
2466
+ }
2467
+ }
2468
+ let d = c2;
2469
+ if (c2.length > 0 && t2 && e2.simplifyTarget && a2.id && (d = c2.filter((u2) => {
2470
+ var _a3;
2471
+ const g = u2.split("=")[0], m = (_a3 = G$1[g]) != null ? _a3 : g;
2472
+ return ct$1(m) >= 60 || m === "text" || m === "id" || m === "role";
2473
+ })), a2.classes && a2.classes.length > 0) {
2474
+ const u2 = M$1(a2.classes), g = !!a2.id || c2.some((p) => {
2475
+ var _a3;
2476
+ const b = p.split("=")[0], S = (_a3 = G$1[b]) != null ? _a3 : b;
2477
+ return S === "href" || S === "data-testid" || S === "text" || S === "role";
2478
+ });
2479
+ if (!(t2 && e2.simplifyTarget && g) && u2.length > 0) {
2480
+ const p = u2.sort().slice(0, e2.maxClasses);
2481
+ o2 += p.map((b) => `.${b}`).join("");
2380
2482
  }
2381
2483
  }
2382
- if (d.length > 0 && (a2 += `[${d.join(",")}]`), "nthChild" in r2 && r2.nthChild) {
2383
- const l2 = !!n2.id || n2.attributes && Object.keys(n2.attributes).some(ae$1);
2384
- t2 && e2.simplifyTarget && l2 || (a2 += `#${r2.nthChild}`);
2484
+ if (d.length > 0 && (o2 += `[${d.join(",")}]`), "nthChild" in r2 && r2.nthChild) {
2485
+ const u2 = !!a2.id || a2.attributes && Object.keys(a2.attributes).some(de$1);
2486
+ t2 && e2.simplifyTarget && u2 || (o2 += `#${r2.nthChild}`);
2385
2487
  }
2386
- return a2;
2488
+ return o2;
2387
2489
  }
2388
- function le$1(r2) {
2490
+ function pe$1(r2, t2) {
2389
2491
  if (!r2.constraints || r2.constraints.length === 0)
2390
2492
  return "";
2391
- const t2 = [];
2392
- for (const e2 of r2.constraints)
2393
- switch (e2.type) {
2493
+ const e2 = [];
2494
+ for (const n2 of r2.constraints)
2495
+ switch (n2.type) {
2394
2496
  case "uniqueness":
2395
- t2.push("unique=true");
2497
+ e2.push("unique=true");
2396
2498
  break;
2397
2499
  case "position":
2398
- e2.params && e2.params.strategy && t2.push(`pos=${e2.params.strategy}`);
2500
+ n2.params && n2.params.strategy && e2.push(`pos=${n2.params.strategy}`);
2399
2501
  break;
2400
2502
  case "text-proximity":
2401
- if (e2.params && e2.params.reference) {
2402
- const s2 = B$1(String(e2.params.reference));
2403
- t2.push(`text="${s2}"`);
2503
+ if (n2.params && n2.params.reference) {
2504
+ const a2 = V$1(String(n2.params.reference));
2505
+ e2.push(`text="${a2}"`);
2404
2506
  }
2405
2507
  break;
2406
2508
  }
2407
- return t2.length === 0 ? "" : ` {${t2.join(",")}}`;
2509
+ return e2.length === 0 ? "" : `${t2.format === "verbose" ? " " : ""}{${e2.join(",")}}`;
2408
2510
  }
2409
- function B$1(r2) {
2511
+ function V$1(r2) {
2410
2512
  return r2.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/>/g, "\\>").replace(/:/g, "\\:");
2411
2513
  }
2412
- function xe$1(r2, t2, e2) {
2413
- const s2 = X$1(r2, t2);
2414
- return s2 ? oe$1(s2, e2) : null;
2514
+ function Ne$1(r2, t2, e2) {
2515
+ const s2 = J$1(r2, t2);
2516
+ return s2 ? ge$1(s2, e2) : null;
2415
2517
  }
2416
2518
  let _id = 1;
2417
2519
  const tagNameRegex = new RegExp("[^a-z0-9-_:]");
@@ -3099,7 +3201,7 @@ function serializeNodeWithId(n2, options) {
3099
3201
  enableSvgFingerprint: selectorOptions.enableSvgFingerprint,
3100
3202
  fallbackToBody: selectorOptions.fallbackToBody
3101
3203
  };
3102
- const selector = xe$1(n2, seqlGeneratorOptions);
3204
+ const selector = Ne$1(n2, seqlGeneratorOptions);
3103
3205
  if (selector) {
3104
3206
  serializedNode.selector = selector;
3105
3207
  }
@@ -7828,6 +7930,29 @@ try {
7828
7930
  }
7829
7931
  } catch (error) {
7830
7932
  }
7933
+ const ht$1 = {
7934
+ id: "i",
7935
+ "data-testid": "tid",
7936
+ "data-qa": "qa",
7937
+ "data-cy": "cy",
7938
+ "data-test": "dt",
7939
+ "aria-label": "al",
7940
+ "aria-labelledby": "alb",
7941
+ "aria-describedby": "adb",
7942
+ name: "n",
7943
+ href: "h",
7944
+ src: "s",
7945
+ type: "t",
7946
+ role: "r",
7947
+ alt: "at",
7948
+ title: "tt",
7949
+ for: "f",
7950
+ placeholder: "ph",
7951
+ text: "x"
7952
+ };
7953
+ Object.fromEntries(
7954
+ Object.entries(ht$1).map(([r2, t2]) => [t2, r2])
7955
+ );
7831
7956
  function getDefaultExportFromCjs(x2) {
7832
7957
  return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
7833
7958
  }
@@ -13640,7 +13765,7 @@ var NodeType = /* @__PURE__ */ ((NodeType2) => {
13640
13765
  NodeType2[NodeType2["Comment"] = 5] = "Comment";
13641
13766
  return NodeType2;
13642
13767
  })(NodeType || {});
13643
- const U = {
13768
+ const z = {
13644
13769
  ANCHOR: 0.4,
13645
13770
  PATH: 0.3,
13646
13771
  TARGET: 0.2,
@@ -13656,10 +13781,10 @@ const I = {
13656
13781
  DEPTH_PENALTY_FACTOR: 0.05,
13657
13782
  DEGRADED_SCORE: 0.3
13658
13783
  };
13659
- const gt = {
13784
+ const bt = {
13660
13785
  MIN_CONFIDENCE_FOR_SKIP: 0.7
13661
13786
  };
13662
- const K = [
13787
+ const tt = [
13663
13788
  "form",
13664
13789
  "main",
13665
13790
  "nav",
@@ -13668,7 +13793,7 @@ const K = [
13668
13793
  "footer",
13669
13794
  "header"
13670
13795
  ];
13671
- const J = [
13796
+ const et = [
13672
13797
  "form",
13673
13798
  "navigation",
13674
13799
  "main",
@@ -13678,7 +13803,7 @@ const J = [
13678
13803
  "banner",
13679
13804
  "search"
13680
13805
  ];
13681
- const mt = [
13806
+ const St = [
13682
13807
  // HTML5 Semantic
13683
13808
  "article",
13684
13809
  "aside",
@@ -13784,7 +13909,7 @@ const w = {
13784
13909
  // Any aria-* attribute (if not above)
13785
13910
  "aria-*": 25
13786
13911
  };
13787
- const V = /* @__PURE__ */ new Set([
13912
+ const Y = /* @__PURE__ */ new Set([
13788
13913
  "id",
13789
13914
  // handled separately
13790
13915
  "class",
@@ -13797,7 +13922,7 @@ const V = /* @__PURE__ */ new Set([
13797
13922
  // can change
13798
13923
  "contenteditable"
13799
13924
  ]);
13800
- const bt = {
13925
+ const At = {
13801
13926
  maxPathDepth: 10,
13802
13927
  enableSvgFingerprint: true,
13803
13928
  confidenceThreshold: 0,
@@ -13805,7 +13930,7 @@ const bt = {
13805
13930
  includeUtilityClasses: false,
13806
13931
  source: "dom-dsl"
13807
13932
  };
13808
- function P(r2) {
13933
+ function L(r2) {
13809
13934
  if (/^[a-z]+-\d+$/i.test(r2) || /^[a-z]+(-[a-z]+)+-\d+$/i.test(r2) || /^[a-z]+(_[a-z]+)*_\d+$/i.test(r2) || /^\d+$/.test(r2) || /^:[a-z0-9]+:$/i.test(r2) || /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i.test(r2))
13810
13935
  return true;
13811
13936
  if (/^[a-z]{1,3}[A-Za-z0-9]{8,}$/.test(r2)) {
@@ -13815,7 +13940,7 @@ function P(r2) {
13815
13940
  }
13816
13941
  return !!(/^radix-/.test(r2) || /^mui-\d+$/.test(r2));
13817
13942
  }
13818
- const Q = /* @__PURE__ */ new Set([
13943
+ const Z = /* @__PURE__ */ new Set([
13819
13944
  "aria-labelledby",
13820
13945
  "aria-describedby",
13821
13946
  "aria-controls",
@@ -13829,10 +13954,10 @@ const Q = /* @__PURE__ */ new Set([
13829
13954
  "aria-errormessage",
13830
13955
  "aria-flowto"
13831
13956
  ]);
13832
- function Y(r2) {
13833
- return r2.trim().split(/\s+/).some((e2) => P(e2));
13957
+ function K(r2) {
13958
+ return r2.trim().split(/\s+/).some((e2) => L(e2));
13834
13959
  }
13835
- class St2 {
13960
+ class Ct2 {
13836
13961
  constructor(t2, e2) {
13837
13962
  var _a2;
13838
13963
  this.maxDepth = (_a2 = t2.maxPathDepth) != null ? _a2 : 10, this.cache = e2;
@@ -13866,25 +13991,25 @@ class St2 {
13866
13991
  if (e2 === "head" || this.isInsideHead(t2)) {
13867
13992
  const c2 = s2 == null ? void 0 : s2.documentElement;
13868
13993
  if (c2) {
13869
- const u2 = {
13994
+ const l2 = {
13870
13995
  element: c2,
13871
13996
  score: 1,
13872
13997
  tier: "A",
13873
13998
  depth: 0
13874
13999
  };
13875
- return this.cacheResult(t2, u2), u2;
14000
+ return this.cacheResult(t2, l2), l2;
13876
14001
  }
13877
14002
  }
13878
14003
  if (e2 === "body") {
13879
14004
  const c2 = s2 == null ? void 0 : s2.documentElement;
13880
14005
  if (c2) {
13881
- const u2 = {
14006
+ const l2 = {
13882
14007
  element: c2,
13883
14008
  score: 1,
13884
14009
  tier: "A",
13885
14010
  depth: 0
13886
14011
  };
13887
- return this.cacheResult(t2, u2), u2;
14012
+ return this.cacheResult(t2, l2), l2;
13888
14013
  }
13889
14014
  }
13890
14015
  let n2 = t2.parentElement, a2 = 0, i2 = null;
@@ -13898,10 +14023,10 @@ class St2 {
13898
14023
  };
13899
14024
  const c2 = this.scoreAnchor(n2);
13900
14025
  if (c2 > 0) {
13901
- const u2 = this.applyDepthPenalty(c2, a2), d = this.getTier(n2), l2 = { element: n2, score: u2, tier: d, depth: a2 };
13902
- if (d === "A")
13903
- return l2;
13904
- (!i2 || u2 > i2.score) && (i2 = l2);
14026
+ const l2 = this.applyDepthPenalty(c2, a2), f2 = this.getTier(n2), h = { element: n2, score: l2, tier: f2, depth: a2 };
14027
+ if (f2 === "A")
14028
+ return h;
14029
+ (!i2 || l2 > i2.score) && (i2 = h);
13905
14030
  }
13906
14031
  n2 = n2.parentElement, a2++;
13907
14032
  }
@@ -13916,11 +14041,11 @@ class St2 {
13916
14041
  scoreAnchor(t2) {
13917
14042
  let e2 = 0;
13918
14043
  const s2 = t2.tagName.toLowerCase();
13919
- K.includes(s2) && (e2 += I.SEMANTIC_TAG);
14044
+ tt.includes(s2) && (e2 += I.SEMANTIC_TAG);
13920
14045
  const n2 = t2.getAttribute("role");
13921
- n2 && J.includes(n2) && (e2 += I.ROLE), (t2.hasAttribute("aria-label") || t2.hasAttribute("aria-labelledby")) && (e2 += I.ARIA_LABEL);
14046
+ n2 && et.includes(n2) && (e2 += I.ROLE), (t2.hasAttribute("aria-label") || t2.hasAttribute("aria-labelledby")) && (e2 += I.ARIA_LABEL);
13922
14047
  const a2 = t2.id;
13923
- return a2 && !P(a2) && (e2 += I.STABLE_ID), (t2.hasAttribute("data-testid") || t2.hasAttribute("data-qa") || t2.hasAttribute("data-test")) && (e2 += I.TEST_MARKER), Math.min(e2, 1);
14048
+ return a2 && !L(a2) && (e2 += I.STABLE_ID), (t2.hasAttribute("data-testid") || t2.hasAttribute("data-qa") || t2.hasAttribute("data-test")) && (e2 += I.TEST_MARKER), Math.min(e2, 1);
13924
14049
  }
13925
14050
  /**
13926
14051
  * Applies depth penalty to score
@@ -13937,10 +14062,10 @@ class St2 {
13937
14062
  */
13938
14063
  getTier(t2) {
13939
14064
  const e2 = t2.tagName.toLowerCase();
13940
- if (K.includes(e2))
14065
+ if (tt.includes(e2))
13941
14066
  return "A";
13942
14067
  const s2 = t2.getAttribute("role");
13943
- return s2 && J.includes(s2) ? "B" : "C";
14068
+ return s2 && et.includes(s2) ? "B" : "C";
13944
14069
  }
13945
14070
  /**
13946
14071
  * Checks if element is inside <head> section.
@@ -13975,7 +14100,7 @@ class St2 {
13975
14100
  this.cache && this.cache.setAnchor(t2, e2);
13976
14101
  }
13977
14102
  }
13978
- const At = [
14103
+ const Tt = [
13979
14104
  // CSS-in-JS
13980
14105
  /^css-[a-z0-9]+$/i,
13981
14106
  /^sc-[a-z0-9]+-\d+$/i,
@@ -13996,7 +14121,7 @@ const At = [
13996
14121
  /\d{5,}/
13997
14122
  // 5+ digits in a row
13998
14123
  ];
13999
- const xt = [
14124
+ const Et = [
14000
14125
  // === FIX 4: Tailwind arbitrary values and variants (highest priority) ===
14001
14126
  /^\[/,
14002
14127
  // Any arbitrary value or variant starting with [ (e.g., [&_svg]:..., [mask-type:luminance])
@@ -14108,29 +14233,91 @@ const xt = [
14108
14233
  /^pull-(left|right)$/,
14109
14234
  /^float-(left|right|none)$/
14110
14235
  ];
14111
- function O(r2) {
14112
- return At.some((t2) => t2.test(r2));
14236
+ function q(r2) {
14237
+ return Tt.some((t2) => t2.test(r2));
14113
14238
  }
14114
- function _(r2) {
14115
- return r2.length <= 2 || /^\d/.test(r2) ? true : xt.some((t2) => t2.test(r2));
14239
+ function U(r2) {
14240
+ return r2.length <= 2 || /^\d/.test(r2) ? true : Et.some((t2) => t2.test(r2));
14116
14241
  }
14117
- function Et(r2) {
14118
- return !O(r2) && !_(r2);
14242
+ function $t(r2) {
14243
+ return !q(r2) && !U(r2);
14119
14244
  }
14120
14245
  function M(r2) {
14121
- return r2.filter((t2) => Et(t2));
14246
+ return r2.filter((t2) => $t(t2));
14122
14247
  }
14123
- function vt(r2) {
14248
+ function It(r2) {
14124
14249
  const t2 = [], e2 = [];
14125
14250
  for (const s2 of r2)
14126
- _(s2) || O(s2) ? e2.push(s2) : t2.push(s2);
14251
+ U(s2) || q(s2) ? e2.push(s2) : t2.push(s2);
14127
14252
  return { semantic: t2, utility: e2 };
14128
14253
  }
14129
- function tt(r2) {
14130
- return _(r2) || O(r2);
14254
+ function st(r2) {
14255
+ return U(r2) || q(r2);
14131
14256
  }
14132
- const et = (r2) => r2.replace(/([#:.[\]@])/g, "\\$1");
14133
- class $t2 {
14257
+ const Rt = /* @__PURE__ */ new Set([
14258
+ "tr",
14259
+ "td",
14260
+ "th",
14261
+ "thead",
14262
+ "tbody",
14263
+ "tfoot"
14264
+ ]);
14265
+ const Dt = /* @__PURE__ */ new Set([
14266
+ "data-testid",
14267
+ "data-qa",
14268
+ "data-cy",
14269
+ "data-test",
14270
+ "aria-label",
14271
+ "name",
14272
+ "href"
14273
+ ]);
14274
+ function Mt(r2) {
14275
+ if (r2.id)
14276
+ return true;
14277
+ if (r2.attributes) {
14278
+ for (const t2 of Object.keys(r2.attributes))
14279
+ if (Dt.has(t2))
14280
+ return true;
14281
+ }
14282
+ return false;
14283
+ }
14284
+ function Lt(r2, t2, e2) {
14285
+ var _a3;
14286
+ var _a2;
14287
+ const s2 = r2.parentElement;
14288
+ if (!s2)
14289
+ return true;
14290
+ for (const n2 of Array.from(s2.children)) {
14291
+ if (n2 === r2 || n2.tagName.toLowerCase() !== t2)
14292
+ continue;
14293
+ if (((_a3 = (_a2 = n2.textContent) == null ? void 0 : _a2.trim()) != null ? _a3 : "") === e2)
14294
+ return false;
14295
+ }
14296
+ return true;
14297
+ }
14298
+ function _(r2, t2, e2) {
14299
+ var _a2;
14300
+ if (Rt.has(r2))
14301
+ return true;
14302
+ if (Mt(t2))
14303
+ return false;
14304
+ if (e2) {
14305
+ const s2 = e2.parentElement;
14306
+ if (s2) {
14307
+ const n2 = (_a2 = t2.text) == null ? void 0 : _a2.normalized;
14308
+ if (n2 && Lt(e2, r2, n2))
14309
+ return false;
14310
+ if (Array.from(s2.children).some(
14311
+ (i2) => i2 !== e2 && i2.tagName.toLowerCase() === r2
14312
+ ))
14313
+ return true;
14314
+ }
14315
+ return false;
14316
+ }
14317
+ return true;
14318
+ }
14319
+ const rt = (r2) => r2.replace(/([#:.[\]@])/g, "\\$1");
14320
+ class Pt2 {
14134
14321
  constructor(t2, e2) {
14135
14322
  var _a2;
14136
14323
  this.maxDepth = (_a2 = t2.maxPathDepth) != null ? _a2 : 10, this.cache = e2;
@@ -14166,19 +14353,22 @@ class $t2 {
14166
14353
  degraded: true,
14167
14354
  degradationReason: "target-not-descendant-of-anchor"
14168
14355
  };
14169
- let u2 = this.filterNoise(i2);
14170
- return u2 = this.ensureUniqueness(i2, u2, t2, e2, s2), {
14171
- path: u2.map((l2) => {
14172
- const h = l2.parentElement;
14356
+ let l2 = this.filterNoise(i2);
14357
+ return l2 = this.ensureUniqueness(i2, l2, t2, e2, s2), {
14358
+ path: l2.map((h) => {
14359
+ const d = h.tagName.toLowerCase(), u2 = s2.extract(h);
14173
14360
  let g;
14174
- if (h) {
14175
- const m = Array.from(h.children).indexOf(l2);
14176
- m !== -1 && (g = m + 1);
14361
+ if (_(d, u2, h)) {
14362
+ const m = h.parentElement;
14363
+ if (m) {
14364
+ const b = Array.from(m.children).indexOf(h);
14365
+ b !== -1 && (g = b + 1);
14366
+ }
14177
14367
  }
14178
14368
  return {
14179
- tag: l2.tagName.toLowerCase(),
14180
- semantics: s2.extract(l2),
14181
- score: s2.scoreElement(l2),
14369
+ tag: d,
14370
+ semantics: u2,
14371
+ score: s2.scoreElement(h),
14182
14372
  nthChild: g
14183
14373
  };
14184
14374
  }),
@@ -14204,27 +14394,27 @@ class $t2 {
14204
14394
  return e2;
14205
14395
  let c2;
14206
14396
  if (this.cache) {
14207
- const d = this.cache.getSelectorResults(i2);
14208
- d !== void 0 ? c2 = d : (c2 = Array.from(o2.querySelectorAll(i2)), this.cache.setSelectorResults(i2, c2));
14397
+ const f2 = this.cache.getSelectorResults(i2);
14398
+ f2 !== void 0 ? c2 = f2 : (c2 = Array.from(o2.querySelectorAll(i2)), this.cache.setSelectorResults(i2, c2));
14209
14399
  } else
14210
14400
  c2 = o2.querySelectorAll(i2);
14211
14401
  if (c2.length <= 1)
14212
14402
  return e2;
14213
- const u2 = t2.filter((d) => !e2.includes(d));
14214
- for (const d of u2) {
14215
- if (a2.scoreElement(d) < gt.MIN_CONFIDENCE_FOR_SKIP)
14403
+ const l2 = t2.filter((f2) => !e2.includes(f2));
14404
+ for (const f2 of l2) {
14405
+ if (a2.scoreElement(f2) < bt.MIN_CONFIDENCE_FOR_SKIP)
14216
14406
  continue;
14217
- const h = this.insertNodeInOrder(e2, d, t2), g = this.buildTestSelector(s2, h, n2);
14407
+ const d = this.insertNodeInOrder(e2, f2, t2), u2 = this.buildTestSelector(s2, d, n2);
14218
14408
  try {
14219
- let f2;
14409
+ let g;
14220
14410
  if (this.cache) {
14221
- const m = this.cache.getSelectorResults(g);
14222
- m !== void 0 ? f2 = m : (f2 = Array.from(o2.querySelectorAll(g)), this.cache.setSelectorResults(g, f2));
14411
+ const m = this.cache.getSelectorResults(u2);
14412
+ m !== void 0 ? g = m : (g = Array.from(o2.querySelectorAll(u2)), this.cache.setSelectorResults(u2, g));
14223
14413
  } else
14224
- f2 = o2.querySelectorAll(g);
14225
- if (f2.length === 1)
14226
- return h;
14227
- f2.length < c2.length && (e2 = h);
14414
+ g = o2.querySelectorAll(u2);
14415
+ if (g.length === 1)
14416
+ return d;
14417
+ g.length < c2.length && (e2 = d);
14228
14418
  } catch (e3) {
14229
14419
  }
14230
14420
  }
@@ -14258,9 +14448,9 @@ class $t2 {
14258
14448
  */
14259
14449
  elementToSelector(t2) {
14260
14450
  let e2 = t2.tagName.toLowerCase();
14261
- t2.id && !P(t2.id) && (e2 += `#${et(t2.id)}`);
14451
+ t2.id && !L(t2.id) && (e2 += `#${rt(t2.id)}`);
14262
14452
  for (const s2 of Array.from(t2.classList))
14263
- tt(s2) || (e2 += `.${et(s2)}`);
14453
+ st(s2) || (e2 += `.${rt(s2)}`);
14264
14454
  return e2;
14265
14455
  }
14266
14456
  /**
@@ -14274,7 +14464,7 @@ class $t2 {
14274
14464
  */
14275
14465
  shouldInclude(t2) {
14276
14466
  const e2 = t2.tagName.toLowerCase();
14277
- return mt.includes(e2) ? true : e2 === "div" || e2 === "span" ? this.hasSemanticFeatures(t2) : false;
14467
+ return St.includes(e2) ? true : e2 === "div" || e2 === "span" ? this.hasSemanticFeatures(t2) : false;
14278
14468
  }
14279
14469
  /**
14280
14470
  * Checks if element has meaningful semantic features
@@ -14287,13 +14477,13 @@ class $t2 {
14287
14477
  return true;
14288
14478
  if (t2.classList.length > 0) {
14289
14479
  for (const s2 of Array.from(t2.classList))
14290
- if (!tt(s2))
14480
+ if (!st(s2))
14291
14481
  return true;
14292
14482
  }
14293
14483
  if (t2.hasAttribute("data-testid") || t2.hasAttribute("data-qa") || t2.hasAttribute("data-test"))
14294
14484
  return true;
14295
14485
  const e2 = t2.id;
14296
- return !!(e2 && !P(e2));
14486
+ return !!(e2 && !L(e2));
14297
14487
  }
14298
14488
  /**
14299
14489
  * Checks if element is inside <head> section.
@@ -14342,31 +14532,34 @@ class $t2 {
14342
14532
  degradationReason: "head-not-found-in-path"
14343
14533
  } : {
14344
14534
  path: n2.map((c2) => {
14345
- const u2 = c2.parentElement;
14346
- let d;
14347
- if (u2) {
14348
- const h = Array.from(u2.children).indexOf(c2);
14349
- h !== -1 && (d = h + 1);
14535
+ const l2 = c2.tagName.toLowerCase(), f2 = s2.extract(c2);
14536
+ let h;
14537
+ if (_(l2, f2, c2)) {
14538
+ const d = c2.parentElement;
14539
+ if (d) {
14540
+ const g = Array.from(d.children).indexOf(c2);
14541
+ g !== -1 && (h = g + 1);
14542
+ }
14350
14543
  }
14351
14544
  return {
14352
- tag: c2.tagName.toLowerCase(),
14353
- semantics: s2.extract(c2),
14545
+ tag: l2,
14546
+ semantics: f2,
14354
14547
  score: s2.scoreElement(c2),
14355
- nthChild: d
14548
+ nthChild: h
14356
14549
  };
14357
14550
  }),
14358
14551
  degraded: false
14359
14552
  };
14360
14553
  }
14361
14554
  }
14362
- function F(r2) {
14555
+ function j(r2) {
14363
14556
  return r2 ? r2.trim().replace(/[\n\t\r]/g, " ").replace(/\s+/g, " ") : "";
14364
14557
  }
14365
- const Nt = {
14558
+ const Ht = {
14366
14559
  preserveQueryForAbsolute: true,
14367
14560
  removeDynamicHashes: true
14368
14561
  };
14369
- function It(r2) {
14562
+ function kt(r2) {
14370
14563
  return r2 ? [
14371
14564
  /\d{5,}/,
14372
14565
  // 5+ digits
@@ -14380,20 +14573,20 @@ function It(r2) {
14380
14573
  // UUID-like
14381
14574
  ].some((e2) => e2.test(r2)) : false;
14382
14575
  }
14383
- function Rt(r2, t2) {
14576
+ function _t(r2, t2) {
14384
14577
  if (!r2)
14385
14578
  return r2;
14386
14579
  const e2 = r2.startsWith("http://") || r2.startsWith("https://"), [s2, n2] = r2.split("#"), [a2, i2] = s2.split("?");
14387
14580
  let o2 = a2;
14388
- return e2 && t2.preserveQueryForAbsolute && i2 && (o2 += `?${i2}`), n2 && (t2.removeDynamicHashes && It(n2) || (o2 += `#${n2}`)), o2;
14581
+ return e2 && t2.preserveQueryForAbsolute && i2 && (o2 += `?${i2}`), n2 && (t2.removeDynamicHashes && kt(n2) || (o2 += `#${n2}`)), o2;
14389
14582
  }
14390
14583
  function D(r2, t2, e2 = {}) {
14391
14584
  if (!t2)
14392
14585
  return t2;
14393
- const s2 = __spreadValues(__spreadValues({}, Nt), e2);
14394
- return r2 === "href" || r2 === "src" ? Rt(t2, s2) : t2;
14586
+ const s2 = __spreadValues(__spreadValues({}, Ht), e2);
14587
+ return r2 === "href" || r2 === "src" ? _t(t2, s2) : t2;
14395
14588
  }
14396
- const Dt = [
14589
+ const Ot = [
14397
14590
  "role",
14398
14591
  "aria-label",
14399
14592
  "aria-labelledby",
@@ -14405,7 +14598,7 @@ const Dt = [
14405
14598
  "aria-setsize",
14406
14599
  "aria-haspopup"
14407
14600
  ];
14408
- const Mt = [
14601
+ const qt = [
14409
14602
  "aria-selected",
14410
14603
  "aria-checked",
14411
14604
  "aria-pressed",
@@ -14419,7 +14612,7 @@ const Mt = [
14419
14612
  "aria-live",
14420
14613
  "aria-atomic"
14421
14614
  ];
14422
- const Pt = [
14615
+ const Ut = [
14423
14616
  "data-state",
14424
14617
  "data-active",
14425
14618
  "data-inactive",
@@ -14439,7 +14632,7 @@ const Pt = [
14439
14632
  "data-orientation",
14440
14633
  "data-theme"
14441
14634
  ];
14442
- const Ht = [
14635
+ const zt = [
14443
14636
  "data-radix-",
14444
14637
  "data-headlessui-",
14445
14638
  "data-reach-",
@@ -14448,7 +14641,7 @@ const Ht = [
14448
14641
  "data-mantine-",
14449
14642
  "data-tw-"
14450
14643
  ];
14451
- const Lt = [
14644
+ const Ft = [
14452
14645
  "data-testid",
14453
14646
  "data-test-id",
14454
14647
  "data-test",
@@ -14461,7 +14654,7 @@ const Lt = [
14461
14654
  "data-product-id",
14462
14655
  "data-user-id"
14463
14656
  ];
14464
- const kt = [
14657
+ const jt = [
14465
14658
  // Google Analytics / GTM
14466
14659
  "data-ga",
14467
14660
  "data-gtm",
@@ -14498,7 +14691,7 @@ const kt = [
14498
14691
  "data-segment",
14499
14692
  "data-analytics"
14500
14693
  ];
14501
- const qt = [
14694
+ const Wt = [
14502
14695
  "data-category",
14503
14696
  // Google Analytics category
14504
14697
  "data-action",
@@ -14508,7 +14701,7 @@ const qt = [
14508
14701
  "data-value"
14509
14702
  // Google Analytics value
14510
14703
  ];
14511
- const Ot = [
14704
+ const Bt = [
14512
14705
  "id",
14513
14706
  "name",
14514
14707
  "type",
@@ -14518,7 +14711,7 @@ const Ot = [
14518
14711
  "alt",
14519
14712
  "href"
14520
14713
  ];
14521
- const _t = [
14714
+ const Gt = [
14522
14715
  "disabled",
14523
14716
  "checked",
14524
14717
  "selected",
@@ -14527,17 +14720,17 @@ const _t = [
14527
14720
  "required",
14528
14721
  "value"
14529
14722
  ];
14530
- const Ut = [
14723
+ const Vt = [
14531
14724
  /^radix-/,
14532
14725
  /^headlessui-/,
14533
14726
  /^mui-/,
14534
14727
  /:\w+:/
14535
14728
  // matches :ru:, :r1:, etc.
14536
14729
  ];
14537
- function zt(r2, t2) {
14538
- return Dt.includes(r2) ? true : Mt.includes(r2) || Pt.includes(r2) || Ht.some((e2) => r2.startsWith(e2)) ? false : Lt.includes(r2) ? true : kt.some((e2) => r2.startsWith(e2)) || qt.includes(r2) ? false : r2.startsWith("data-") && r2.endsWith("-id") ? true : r2 === "id" ? !Ut.some((e2) => e2.test(t2)) : Ot.includes(r2) ? true : _t.includes(r2) ? false : !!r2.startsWith("data-");
14730
+ function Qt(r2, t2) {
14731
+ return Ot.includes(r2) ? true : qt.includes(r2) || Ut.includes(r2) || zt.some((e2) => r2.startsWith(e2)) ? false : Ft.includes(r2) ? true : jt.some((e2) => r2.startsWith(e2)) || Wt.includes(r2) ? false : r2.startsWith("data-") && r2.endsWith("-id") ? true : r2 === "id" ? !Vt.some((e2) => e2.test(t2)) : Bt.includes(r2) ? true : Gt.includes(r2) ? false : !!r2.startsWith("data-");
14539
14732
  }
14540
- class st2 {
14733
+ class nt2 {
14541
14734
  constructor(t2, e2) {
14542
14735
  var _a2;
14543
14736
  this.includeUtilityClasses = (_a2 = t2.includeUtilityClasses) != null ? _a2 : false, this.cache = e2;
@@ -14554,12 +14747,12 @@ class st2 {
14554
14747
  return i2;
14555
14748
  }
14556
14749
  const e2 = {}, s2 = t2.id;
14557
- if (s2 && !P(s2) && (e2.id = s2), t2.classList.length > 0) {
14750
+ if (s2 && !L(s2) && (e2.id = s2), t2.classList.length > 0) {
14558
14751
  const i2 = Array.from(t2.classList);
14559
14752
  if (this.includeUtilityClasses)
14560
14753
  e2.classes = i2;
14561
14754
  else {
14562
- const { semantic: o2 } = vt(i2);
14755
+ const { semantic: o2 } = It(i2);
14563
14756
  o2.length > 0 && (e2.classes = o2);
14564
14757
  }
14565
14758
  }
@@ -14588,7 +14781,7 @@ class st2 {
14588
14781
  * @returns True if should be ignored
14589
14782
  */
14590
14783
  shouldIgnoreAttribute(t2) {
14591
- return !!(V.has(t2) || t2.startsWith("on") || t2.startsWith("ng-") || t2.startsWith("_ng") || t2.startsWith("data-reactid") || t2.startsWith("data-react") || t2.startsWith("data-v-"));
14784
+ return !!(Y.has(t2) || t2.startsWith("on") || t2.startsWith("ng-") || t2.startsWith("_ng") || t2.startsWith("data-reactid") || t2.startsWith("data-react") || t2.startsWith("data-v-"));
14592
14785
  }
14593
14786
  /**
14594
14787
  * Gets attribute priority
@@ -14623,7 +14816,7 @@ class st2 {
14623
14816
  const e2 = {};
14624
14817
  for (const s2 of Array.from(t2.attributes)) {
14625
14818
  const n2 = s2.name;
14626
- if (this.shouldIgnoreAttribute(n2) || !zt(n2, s2.value) || Q.has(n2) && Y(s2.value) || this.getAttributePriority(n2) === 0)
14819
+ if (this.shouldIgnoreAttribute(n2) || !Qt(n2, s2.value) || Z.has(n2) && K(s2.value) || this.getAttributePriority(n2) === 0)
14627
14820
  continue;
14628
14821
  const i2 = n2 === "href" || n2 === "src" ? D(n2, s2.value) : s2.value;
14629
14822
  !i2 || i2.trim() === "" || this.isDynamicValue(i2) || (e2[n2] = i2);
@@ -14637,7 +14830,7 @@ class st2 {
14637
14830
  const e2 = this.getDirectTextContent(t2);
14638
14831
  if (!e2)
14639
14832
  return null;
14640
- const s2 = F(e2);
14833
+ const s2 = j(e2);
14641
14834
  if (!s2)
14642
14835
  return null;
14643
14836
  const n2 = 100, a2 = e2.length > n2 ? e2.slice(0, n2) + "..." : e2, i2 = s2.length > n2 ? s2.slice(0, n2) + "..." : s2;
@@ -14687,7 +14880,7 @@ class st2 {
14687
14880
  ].includes(e2);
14688
14881
  }
14689
14882
  }
14690
- class Ft2 {
14883
+ class Yt2 {
14691
14884
  /**
14692
14885
  * Generates fingerprint for SVG element
14693
14886
  * @param element - SVG element to fingerprint
@@ -14802,11 +14995,11 @@ class Ft2 {
14802
14995
  return Math.abs(e2).toString(16).padStart(8, "0");
14803
14996
  }
14804
14997
  }
14805
- function jt(r2, t2 = 0) {
14806
- const e2 = r2.anchor.score, s2 = r2.path.length > 0 ? r2.path.reduce((o2, c2) => o2 + c2.score, 0) / r2.path.length : 0.5, n2 = r2.target.score, a2 = e2 * U.ANCHOR + s2 * U.PATH + n2 * U.TARGET + t2 * U.UNIQUENESS, i2 = r2.anchor.degraded ? 0.2 : 0;
14998
+ function Zt(r2, t2 = 0) {
14999
+ const e2 = r2.anchor.score, s2 = r2.path.length > 0 ? r2.path.reduce((o2, c2) => o2 + c2.score, 0) / r2.path.length : 0.5, n2 = r2.target.score, a2 = e2 * z.ANCHOR + s2 * z.PATH + n2 * z.TARGET + t2 * z.UNIQUENESS, i2 = r2.anchor.degraded ? 0.2 : 0;
14807
15000
  return Math.max(0, Math.min(1, a2 - i2));
14808
15001
  }
14809
- class Wt2 {
15002
+ class Kt2 {
14810
15003
  constructor(t2) {
14811
15004
  this.cache = /* @__PURE__ */ new Map(), this.maxSize = t2;
14812
15005
  }
@@ -14837,10 +15030,10 @@ class Wt2 {
14837
15030
  return this.cache.size;
14838
15031
  }
14839
15032
  }
14840
- class Bt2 {
15033
+ class Xt2 {
14841
15034
  constructor(t2 = {}) {
14842
15035
  var _a2, _b;
14843
- this.eidCache = /* @__PURE__ */ new WeakMap(), this.selectorResultCache = new Wt2(
15036
+ this.eidCache = /* @__PURE__ */ new WeakMap(), this.selectorResultCache = new Kt2(
14844
15037
  (_a2 = t2.maxSelectorCacheSize) != null ? _a2 : 1e3
14845
15038
  ), this.anchorCache = /* @__PURE__ */ new WeakMap(), this.semanticsCache = /* @__PURE__ */ new WeakMap(), this.stats = {
14846
15039
  eidHits: 0,
@@ -14988,12 +15181,12 @@ class Bt2 {
14988
15181
  return s2 > 0 ? t2 / s2 : 0;
14989
15182
  }
14990
15183
  }
14991
- function Gt(r2) {
14992
- return new Bt2(r2);
15184
+ function Jt(r2) {
15185
+ return new Xt2(r2);
14993
15186
  }
14994
- let z = null;
14995
- function Z() {
14996
- return z || (z = Gt()), z;
15187
+ let F = null;
15188
+ function X() {
15189
+ return F || (F = Jt()), F;
14997
15190
  }
14998
15191
  function k(r2) {
14999
15192
  if (r2.ownerDocument)
@@ -15011,7 +15204,7 @@ function k(r2) {
15011
15204
  3. You are working with a document node instead of an element`
15012
15205
  );
15013
15206
  }
15014
- function Vt(r2, t2) {
15207
+ function te(r2, t2) {
15015
15208
  if (!t2)
15016
15209
  return;
15017
15210
  const e2 = k(r2), s2 = t2 instanceof Document ? t2 : k(t2);
@@ -15026,66 +15219,67 @@ Common causes:
15026
15219
  Solution: Ensure element and root parameter are from the same document context.`
15027
15220
  );
15028
15221
  }
15029
- function X(r2, t2 = {}) {
15222
+ function J(r2, t2 = {}) {
15030
15223
  var _a3, _b, _c, _d;
15031
15224
  var _a2;
15032
15225
  if (!r2 || !r2.ownerDocument || !r2.isConnected)
15033
15226
  return null;
15034
- const e2 = __spreadValues(__spreadValues({}, bt), t2);
15227
+ const e2 = __spreadValues(__spreadValues({}, At), t2);
15035
15228
  if (e2.root)
15036
15229
  try {
15037
- Vt(r2, e2.root);
15230
+ te(r2, e2.root);
15038
15231
  } catch (x2) {
15039
15232
  return console.error("Cross-document generation detected:", x2), null;
15040
15233
  }
15041
- const s2 = (_a3 = e2.cache) != null ? _a3 : Z(), n2 = s2.getEID(r2);
15234
+ const s2 = (_a3 = e2.cache) != null ? _a3 : X(), n2 = s2.getEID(r2);
15042
15235
  if (n2 !== void 0)
15043
15236
  return n2;
15044
- if (r2.tagName.toLowerCase() === "html") {
15045
- const x2 = new st2(e2, s2), y = Zt(r2, e2, x2);
15237
+ const a2 = r2.tagName.toLowerCase();
15238
+ if (a2 === "html") {
15239
+ const x2 = new nt2(e2, s2), y = re(r2, e2, x2);
15046
15240
  return s2.setEID(r2, y), y;
15047
15241
  }
15048
- const i2 = new St2(e2, s2), o2 = new $t2(e2, s2), c2 = new st2(e2, s2), u2 = new Ft2(), d = i2.findAnchor(r2);
15049
- if (!d && !e2.fallbackToBody)
15242
+ const i2 = new Ct2(e2, s2), o2 = new Pt2(e2, s2), c2 = new nt2(e2, s2), l2 = new Yt2(), f2 = i2.findAnchor(r2);
15243
+ if (!f2 && !e2.fallbackToBody)
15050
15244
  return null;
15051
- const l2 = (_c = (_b = d == null ? void 0 : d.element) != null ? _b : (_a2 = r2.ownerDocument) == null ? void 0 : _a2.body) != null ? _c : null;
15052
- if (!l2)
15245
+ const h = (_c = (_b = f2 == null ? void 0 : f2.element) != null ? _b : (_a2 = r2.ownerDocument) == null ? void 0 : _a2.body) != null ? _c : null;
15246
+ if (!h)
15053
15247
  return null;
15054
- const h = !d || d.tier === "C", g = l2.tagName.toLowerCase(), f2 = l2.parentElement;
15055
- let m;
15056
- if (f2 && g !== "body" && g !== "html") {
15057
- const y = Array.from(f2.children).indexOf(l2);
15058
- y !== -1 && (m = y + 1);
15059
- }
15060
- const p = c2.extract(l2), b = {
15061
- tag: l2.tagName.toLowerCase(),
15062
- semantics: p,
15063
- score: (_d = d == null ? void 0 : d.score) != null ? _d : I.DEGRADED_SCORE,
15064
- degraded: h,
15065
- nthChild: m
15066
- }, S = o2.buildPath(l2, r2, c2), E = c2.extract(r2);
15067
- e2.enableSvgFingerprint && Qt(r2) && (E.svg = u2.fingerprint(r2));
15248
+ const d = !f2 || f2.tier === "C", u2 = h.tagName.toLowerCase(), g = c2.extract(h), m = h.parentElement;
15249
+ let p;
15250
+ if (m && u2 !== "body" && u2 !== "html" && _(u2, g, h)) {
15251
+ const y = Array.from(m.children).indexOf(h);
15252
+ y !== -1 && (p = y + 1);
15253
+ }
15254
+ const b = {
15255
+ tag: h.tagName.toLowerCase(),
15256
+ semantics: g,
15257
+ score: (_d = f2 == null ? void 0 : f2.score) != null ? _d : I.DEGRADED_SCORE,
15258
+ degraded: d,
15259
+ nthChild: p
15260
+ }, S = o2.buildPath(h, r2, c2), T = c2.extract(r2);
15261
+ e2.enableSvgFingerprint && ee(r2) && (T.svg = l2.fingerprint(r2));
15068
15262
  const C = r2.parentElement;
15069
15263
  let A;
15070
- if (C) {
15264
+ if (C && _(a2, T, r2)) {
15071
15265
  const y = Array.from(C.children).indexOf(r2);
15072
15266
  y !== -1 && (A = y + 1);
15073
15267
  }
15074
15268
  const v2 = {
15075
15269
  tag: r2.tagName.toLowerCase(),
15076
- semantics: E,
15270
+ semantics: T,
15077
15271
  score: c2.scoreElement(r2),
15078
15272
  nthChild: A
15079
- }, H = [], $ = {
15273
+ }, P = [], $ = {
15080
15274
  onMultiple: "best-score",
15081
15275
  onMissing: "anchor-only",
15082
15276
  maxDepth: 3
15083
- }, T = b.degraded || S.degraded, R = Yt(b.degraded, S), N = {
15277
+ }, E = b.degraded || S.degraded, R = se(b.degraded, S), N = {
15084
15278
  version: "1.0",
15085
15279
  anchor: b,
15086
15280
  path: S.path,
15087
15281
  target: v2,
15088
- constraints: H,
15282
+ constraints: P,
15089
15283
  fallback: $,
15090
15284
  meta: {
15091
15285
  confidence: 0,
@@ -15093,16 +15287,16 @@ function X(r2, t2 = {}) {
15093
15287
  generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
15094
15288
  generator: "dom-eid@1.0",
15095
15289
  source: e2.source,
15096
- degraded: T,
15290
+ degraded: E,
15097
15291
  degradationReason: R
15098
15292
  }
15099
15293
  };
15100
- return N.meta.confidence = jt(N), N.meta.confidence < e2.confidenceThreshold ? null : (s2.setEID(r2, N), N);
15294
+ return N.meta.confidence = Zt(N), N.meta.confidence < e2.confidenceThreshold ? null : (s2.setEID(r2, N), N);
15101
15295
  }
15102
- function Qt(r2) {
15296
+ function ee(r2) {
15103
15297
  return r2.namespaceURI === "http://www.w3.org/2000/svg" || r2.tagName.toLowerCase() === "svg" || r2 instanceof SVGElement;
15104
15298
  }
15105
- function Yt(r2, t2) {
15299
+ function se(r2, t2) {
15106
15300
  if (r2 && t2.degraded)
15107
15301
  return "anchor-and-path-degraded";
15108
15302
  if (r2)
@@ -15110,7 +15304,7 @@ function Yt(r2, t2) {
15110
15304
  if (t2.degraded)
15111
15305
  return t2.degradationReason;
15112
15306
  }
15113
- function Zt(r2, t2, e2, s2) {
15307
+ function re(r2, t2, e2, s2) {
15114
15308
  const a2 = {
15115
15309
  tag: "html",
15116
15310
  semantics: e2.extract(r2),
@@ -15139,91 +15333,124 @@ function Zt(r2, t2, e2, s2) {
15139
15333
  }
15140
15334
  };
15141
15335
  }
15142
- const ct = {
15336
+ const ht = {
15337
+ id: "i",
15338
+ "data-testid": "tid",
15339
+ "data-qa": "qa",
15340
+ "data-cy": "cy",
15341
+ "data-test": "dt",
15342
+ "aria-label": "al",
15343
+ "aria-labelledby": "alb",
15344
+ "aria-describedby": "adb",
15345
+ name: "n",
15346
+ href: "h",
15347
+ src: "s",
15348
+ type: "t",
15349
+ role: "r",
15350
+ alt: "at",
15351
+ title: "tt",
15352
+ for: "f",
15353
+ placeholder: "ph",
15354
+ text: "x"
15355
+ };
15356
+ const G = Object.fromEntries(
15357
+ Object.entries(ht).map(([r2, t2]) => [t2, r2])
15358
+ );
15359
+ const ut = {
15143
15360
  maxClasses: 2,
15144
15361
  maxAttributes: 5,
15145
15362
  includeText: true,
15146
15363
  maxTextLength: 50,
15147
15364
  simplifyTarget: true,
15148
- includeConstraints: true
15365
+ includeConstraints: true,
15366
+ format: "compact"
15149
15367
  };
15150
- function it(r2) {
15368
+ function ct(r2) {
15151
15369
  return r2 === "id" ? 101 : w[r2] !== void 0 ? w[r2] : r2.startsWith("data-") ? w["data-*"] : r2.startsWith("aria-") ? w["aria-*"] : 0;
15152
15370
  }
15153
- function ae(r2) {
15371
+ function de(r2) {
15154
15372
  return ["id", "data-testid", "data-qa", "data-cy", "href", "text", "role"].includes(r2);
15155
15373
  }
15156
- function ie(r2) {
15374
+ function fe(r2) {
15157
15375
  return !!(/@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/.test(r2) || /(\+?\d{1,3}[-.\s]?)?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}/.test(r2) || /\d{4}[-\s]?\d{4}[-\s]?\d{4}[-\s]?\d{4}/.test(r2));
15158
15376
  }
15159
- function oe(r2, t2) {
15160
- const e2 = __spreadValues(__spreadValues({}, ct), t2), s2 = `v${r2.version}`, n2 = j(r2.anchor, false, e2), a2 = r2.path.length > 0 ? r2.path.map((c2) => j(c2, false, e2)).join(" > ") + " > " : "", i2 = j(r2.target, true, e2), o2 = e2.includeConstraints ? le(r2) : "";
15161
- return `${s2}: ${n2} :: ${a2}${i2}${o2}`;
15162
- }
15163
- function j(r2, t2 = false, e2 = ct) {
15164
- const { tag: s2, semantics: n2 } = r2;
15165
- let a2 = s2;
15166
- const i2 = [], o2 = __spreadValues({}, n2.attributes);
15167
- n2.id && (o2.id = n2.id), n2.role && !o2.role && (o2.role = n2.role);
15168
- const c2 = Object.entries(o2).map(([l2, h]) => {
15169
- const g = it(l2), f2 = l2 === "href" || l2 === "src" ? D(l2, h) : h;
15170
- return { name: l2, value: f2, priority: g };
15171
- }).filter((l2) => l2.name !== "id" && l2.name !== "class" && V.has(l2.name) || Q.has(l2.name) && Y(l2.value) ? false : l2.priority > 0 || l2.name === "role" || l2.name === "id");
15172
- c2.sort((l2, h) => h.priority - l2.priority);
15173
- const u2 = c2.slice(0, e2.maxAttributes);
15174
- u2.sort((l2, h) => l2.name.localeCompare(h.name));
15175
- for (const { name: l2, value: h } of u2)
15176
- i2.push(`${l2}="${B(h)}"`);
15177
- if (e2.includeText && n2.text && !ie(n2.text.normalized)) {
15178
- const l2 = n2.text.normalized;
15179
- l2.length > 0 && l2.length <= e2.maxTextLength && i2.push(`text="${B(l2)}"`);
15180
- }
15181
- let d = i2;
15182
- if (i2.length > 0 && (t2 && e2.simplifyTarget && n2.id && (d = i2.filter((l2) => {
15183
- const h = l2.split("=")[0];
15184
- return it(h) >= 60 || h === "text" || h === "id" || h === "role";
15185
- })), d.length > 0 && d.sort((l2, h) => l2.localeCompare(h))), n2.classes && n2.classes.length > 0) {
15186
- const l2 = M(n2.classes), h = !!n2.id || i2.some(
15187
- (f2) => f2.startsWith("href=") || f2.startsWith("data-testid=") || f2.startsWith("text=") || f2.startsWith("role=")
15188
- );
15189
- if (!(t2 && e2.simplifyTarget && h) && l2.length > 0) {
15190
- const f2 = l2.sort().slice(0, e2.maxClasses);
15191
- a2 += f2.map((m) => `.${m}`).join("");
15377
+ function ge(r2, t2) {
15378
+ const e2 = __spreadValues(__spreadValues({}, ut), t2), s2 = e2.format === "compact", n2 = s2 ? "v1" : `v${r2.version}`, a2 = s2 ? ":" : ": ", i2 = s2 ? "::" : " :: ", o2 = s2 ? ">" : " > ", c2 = e2.includeText && r2.target.semantics.text ? r2.target.semantics.text.normalized : void 0, l2 = W(r2.anchor, false, e2), f2 = r2.path.length > 0 ? r2.path.map((u2) => W(u2, false, e2, c2)).join(o2) + o2 : "", h = W(r2.target, true, e2), d = e2.includeConstraints ? pe(r2, e2) : "";
15379
+ return `${n2}${a2}${l2}${i2}${f2}${h}${d}`;
15380
+ }
15381
+ function W(r2, t2 = false, e2 = ut, s2) {
15382
+ var _a2;
15383
+ const { tag: n2, semantics: a2 } = r2, i2 = e2.format === "compact";
15384
+ let o2 = n2;
15385
+ const c2 = [], l2 = __spreadValues({}, a2.attributes);
15386
+ a2.id && (l2.id = a2.id), a2.role && !l2.role && (l2.role = a2.role);
15387
+ const f2 = Object.entries(l2).map(([u2, g]) => {
15388
+ const m = ct(u2), p = u2 === "href" || u2 === "src" ? D(u2, g) : g;
15389
+ return { name: u2, value: p, priority: m };
15390
+ }).filter((u2) => u2.name !== "id" && u2.name !== "class" && Y.has(u2.name) || Z.has(u2.name) && K(u2.value) ? false : u2.priority > 0 || u2.name === "role" || u2.name === "id");
15391
+ f2.sort((u2, g) => g.priority - u2.priority);
15392
+ const h = f2.slice(0, e2.maxAttributes);
15393
+ h.sort((u2, g) => u2.name.localeCompare(g.name));
15394
+ for (const { name: u2, value: g } of h) {
15395
+ const m = i2 ? (_a2 = ht[u2]) != null ? _a2 : u2 : u2;
15396
+ c2.push(`${m}="${V(g)}"`);
15397
+ }
15398
+ if (e2.includeText && a2.text && !fe(a2.text.normalized)) {
15399
+ const u2 = a2.text.normalized;
15400
+ if (u2.length > 0 && u2.length <= e2.maxTextLength && !(!t2 && s2 !== void 0 && u2 === s2)) {
15401
+ const m = i2 ? "x" : "text";
15402
+ c2.push(`${m}="${V(u2)}"`);
15403
+ }
15404
+ }
15405
+ let d = c2;
15406
+ if (c2.length > 0 && t2 && e2.simplifyTarget && a2.id && (d = c2.filter((u2) => {
15407
+ var _a3;
15408
+ const g = u2.split("=")[0], m = (_a3 = G[g]) != null ? _a3 : g;
15409
+ return ct(m) >= 60 || m === "text" || m === "id" || m === "role";
15410
+ })), a2.classes && a2.classes.length > 0) {
15411
+ const u2 = M(a2.classes), g = !!a2.id || c2.some((p) => {
15412
+ var _a3;
15413
+ const b = p.split("=")[0], S = (_a3 = G[b]) != null ? _a3 : b;
15414
+ return S === "href" || S === "data-testid" || S === "text" || S === "role";
15415
+ });
15416
+ if (!(t2 && e2.simplifyTarget && g) && u2.length > 0) {
15417
+ const p = u2.sort().slice(0, e2.maxClasses);
15418
+ o2 += p.map((b) => `.${b}`).join("");
15192
15419
  }
15193
15420
  }
15194
- if (d.length > 0 && (a2 += `[${d.join(",")}]`), "nthChild" in r2 && r2.nthChild) {
15195
- const l2 = !!n2.id || n2.attributes && Object.keys(n2.attributes).some(ae);
15196
- t2 && e2.simplifyTarget && l2 || (a2 += `#${r2.nthChild}`);
15421
+ if (d.length > 0 && (o2 += `[${d.join(",")}]`), "nthChild" in r2 && r2.nthChild) {
15422
+ const u2 = !!a2.id || a2.attributes && Object.keys(a2.attributes).some(de);
15423
+ t2 && e2.simplifyTarget && u2 || (o2 += `#${r2.nthChild}`);
15197
15424
  }
15198
- return a2;
15425
+ return o2;
15199
15426
  }
15200
- function le(r2) {
15427
+ function pe(r2, t2) {
15201
15428
  if (!r2.constraints || r2.constraints.length === 0)
15202
15429
  return "";
15203
- const t2 = [];
15204
- for (const e2 of r2.constraints)
15205
- switch (e2.type) {
15430
+ const e2 = [];
15431
+ for (const n2 of r2.constraints)
15432
+ switch (n2.type) {
15206
15433
  case "uniqueness":
15207
- t2.push("unique=true");
15434
+ e2.push("unique=true");
15208
15435
  break;
15209
15436
  case "position":
15210
- e2.params && e2.params.strategy && t2.push(`pos=${e2.params.strategy}`);
15437
+ n2.params && n2.params.strategy && e2.push(`pos=${n2.params.strategy}`);
15211
15438
  break;
15212
15439
  case "text-proximity":
15213
- if (e2.params && e2.params.reference) {
15214
- const s2 = B(String(e2.params.reference));
15215
- t2.push(`text="${s2}"`);
15440
+ if (n2.params && n2.params.reference) {
15441
+ const a2 = V(String(n2.params.reference));
15442
+ e2.push(`text="${a2}"`);
15216
15443
  }
15217
15444
  break;
15218
15445
  }
15219
- return t2.length === 0 ? "" : ` {${t2.join(",")}}`;
15446
+ return e2.length === 0 ? "" : `${t2.format === "verbose" ? " " : ""}{${e2.join(",")}}`;
15220
15447
  }
15221
- function B(r2) {
15448
+ function V(r2) {
15222
15449
  return r2.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/>/g, "\\>").replace(/:/g, "\\:");
15223
15450
  }
15224
- function xe(r2, t2, e2) {
15225
- const s2 = X(r2, t2);
15226
- return s2 ? oe(s2, e2) : null;
15451
+ function Ne(r2, t2, e2) {
15452
+ const s2 = J(r2, t2);
15453
+ return s2 ? ge(s2, e2) : null;
15227
15454
  }
15228
15455
  const defaultSelectorOptions = {
15229
15456
  maxPathDepth: 10,
@@ -15270,7 +15497,7 @@ function resolveNodeSelector(node2, mirror2, selectorOptions, options) {
15270
15497
  fallbackToBody: selectorOptions.fallbackToBody
15271
15498
  };
15272
15499
  try {
15273
- const selector = xe(element, seqlOptions);
15500
+ const selector = Ne(element, seqlOptions);
15274
15501
  if (selector) {
15275
15502
  if (elementMeta) {
15276
15503
  elementMeta.selector = selector;
@@ -16409,7 +16636,8 @@ function initInputObserver({
16409
16636
  maskInputOptions,
16410
16637
  maskInputFn,
16411
16638
  sampling,
16412
- userTriggeredOnInput
16639
+ userTriggeredOnInput,
16640
+ trustSyntheticInput
16413
16641
  }) {
16414
16642
  function eventHandler(event) {
16415
16643
  let target = getEventTarget(event);
@@ -16459,34 +16687,53 @@ function initInputObserver({
16459
16687
  function cbWithDedup(target, v2) {
16460
16688
  const lastInputValue = lastInputValueMap.get(target);
16461
16689
  const el = target;
16462
- const hasPlaceholder = el.hasAttribute("placeholder");
16463
- const isEmpty = el.value === "";
16464
- const isDefaultEmpty = typeof el.defaultValue === "string" ? el.defaultValue === "" : true;
16465
- const isNonUser = !v2.userTriggered;
16466
- const isRepeatEmpty = !lastInputValue || lastInputValue.text === "";
16467
- const isLikelyPhantom = hasPlaceholder && isEmpty && isDefaultEmpty && isRepeatEmpty && isNonUser && !v2.isChecked && el.type !== "hidden" && INPUT_TAGS.includes(el.tagName);
16468
- const isRenderDrivenTextInput = el.tagName === "INPUT" && el.type === "text" && !v2.userTriggered && v2.text === el.defaultValue && !lastInputValue && el.hasAttribute("placeholder");
16469
- const isValueFromDefault = !v2.userTriggered && el.value === el.defaultValue && !lastInputValue && el.hasAttribute("placeholder") && !v2.isChecked && el.type !== "hidden" && INPUT_TAGS.includes(el.tagName);
16470
- const isPhantomCheckbox = el.type === "checkbox" && !v2.userTriggered && !v2.isChecked && !lastInputValue;
16471
- const isPhantomRadio = el.type === "radio" && !v2.userTriggered && !v2.isChecked && !lastInputValue;
16472
- if (isLikelyPhantom || isRenderDrivenTextInput || isValueFromDefault || isPhantomCheckbox || isPhantomRadio) {
16473
- console.debug(
16474
- `[${nowTimestamp()}] [rrweb:record/observer] \u26D4 phantom input ignored`,
16475
- {
16476
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-call
16477
- node: index.describeNode(el),
16478
- tag: el.tagName,
16479
- nodeType: el.nodeType,
16480
- attribute: el.attributes,
16481
- value: el.value,
16482
- isLikelyPhantom,
16483
- isRenderDrivenTextInput,
16484
- isValueFromDefault,
16485
- isPhantomCheckbox,
16486
- isPhantomRadio
16487
- }
16488
- );
16489
- return;
16690
+ if (trustSyntheticInput) {
16691
+ const isInitialEmpty = !v2.userTriggered && el.value === "" && !v2.isChecked && !lastInputValue;
16692
+ const isSelectDefaultSelection = el.tagName === "SELECT" && !v2.userTriggered && !lastInputValue && el.selectedIndex === 0;
16693
+ if (isInitialEmpty || isSelectDefaultSelection) {
16694
+ console.debug(
16695
+ `[${nowTimestamp()}] [rrweb:record/observer] phantom input ignored (trust mode)`,
16696
+ {
16697
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-call
16698
+ node: index.describeNode(el),
16699
+ tag: el.tagName,
16700
+ value: el.value,
16701
+ isInitialEmpty,
16702
+ isSelectDefaultSelection
16703
+ }
16704
+ );
16705
+ return;
16706
+ }
16707
+ } else {
16708
+ const hasPlaceholder = el.hasAttribute("placeholder");
16709
+ const isEmpty = el.value === "";
16710
+ const isDefaultEmpty = typeof el.defaultValue === "string" ? el.defaultValue === "" : true;
16711
+ const isNonUser = !v2.userTriggered;
16712
+ const isRepeatEmpty = !lastInputValue || lastInputValue.text === "";
16713
+ const isLikelyPhantom = hasPlaceholder && isEmpty && isDefaultEmpty && isRepeatEmpty && isNonUser && !v2.isChecked && el.type !== "hidden" && INPUT_TAGS.includes(el.tagName);
16714
+ const isRenderDrivenTextInput = el.tagName === "INPUT" && el.type === "text" && !v2.userTriggered && v2.text === el.defaultValue && !lastInputValue && el.hasAttribute("placeholder");
16715
+ const isValueFromDefault = !v2.userTriggered && el.value === el.defaultValue && !lastInputValue && el.hasAttribute("placeholder") && !v2.isChecked && el.type !== "hidden" && INPUT_TAGS.includes(el.tagName);
16716
+ const isPhantomCheckbox = el.type === "checkbox" && !v2.userTriggered && !v2.isChecked && !lastInputValue;
16717
+ const isPhantomRadio = el.type === "radio" && !v2.userTriggered && !v2.isChecked && !lastInputValue;
16718
+ if (isLikelyPhantom || isRenderDrivenTextInput || isValueFromDefault || isPhantomCheckbox || isPhantomRadio) {
16719
+ console.debug(
16720
+ `[${nowTimestamp()}] [rrweb:record/observer] \u26D4 phantom input ignored`,
16721
+ {
16722
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-call
16723
+ node: index.describeNode(el),
16724
+ tag: el.tagName,
16725
+ nodeType: el.nodeType,
16726
+ attribute: el.attributes,
16727
+ value: el.value,
16728
+ isLikelyPhantom,
16729
+ isRenderDrivenTextInput,
16730
+ isValueFromDefault,
16731
+ isPhantomCheckbox,
16732
+ isPhantomRadio
16733
+ }
16734
+ );
16735
+ return;
16736
+ }
16490
16737
  }
16491
16738
  if (!lastInputValue || lastInputValue.text !== v2.text || lastInputValue.isChecked !== v2.isChecked) {
16492
16739
  lastInputValueMap.set(target, v2);
@@ -18570,8 +18817,15 @@ class NavigationManager {
18570
18817
  return;
18571
18818
  if (this.locked)
18572
18819
  return;
18573
- this.cancelTimers();
18574
- this.disconnectSettlingObserver();
18820
+ if (this.pendingNavigation) {
18821
+ this.cancelTimers();
18822
+ this.disconnectSettlingObserver();
18823
+ this.pendingNavigation = null;
18824
+ this.onSnapshot(true);
18825
+ } else {
18826
+ this.cancelTimers();
18827
+ this.disconnectSettlingObserver();
18828
+ }
18575
18829
  this.pendingNavigation = data;
18576
18830
  if (this.frozen) {
18577
18831
  return;
@@ -18785,7 +19039,7 @@ class ProcessedNodeManager {
18785
19039
  destroy() {
18786
19040
  }
18787
19041
  }
18788
- const version$1 = "3.6.0-alpha.1";
19042
+ const version$1 = "3.11.0-alpha.1";
18789
19043
  let wrappedEmit;
18790
19044
  let takeFullSnapshot$1;
18791
19045
  let canvasManager;
@@ -18834,6 +19088,7 @@ function record(options = {}) {
18834
19088
  recordAfter = options.recordAfter === "DOMContentLoaded" ? options.recordAfter : "load",
18835
19089
  flushCustomEvent = options.flushCustomEvent !== void 0 ? options.flushCustomEvent : "after",
18836
19090
  userTriggeredOnInput = false,
19091
+ trustSyntheticInput = false,
18837
19092
  collectFonts = false,
18838
19093
  inlineImages = false,
18839
19094
  plugins,
@@ -19360,6 +19615,7 @@ function record(options = {}) {
19360
19615
  recordCanvas,
19361
19616
  inlineImages,
19362
19617
  userTriggeredOnInput,
19618
+ trustSyntheticInput,
19363
19619
  collectFonts,
19364
19620
  doc,
19365
19621
  maskInputFn,
@@ -19438,6 +19694,43 @@ function record(options = {}) {
19438
19694
  );
19439
19695
  }
19440
19696
  return () => {
19697
+ if (recording) {
19698
+ const activeEl = document.activeElement;
19699
+ if (activeEl && INPUT_TAGS.includes(activeEl.tagName)) {
19700
+ const inputEl = activeEl;
19701
+ const id = mirror.getId(inputEl);
19702
+ if (id !== -1) {
19703
+ const lastValue = lastInputValueMap.get(inputEl);
19704
+ let text = inputEl.value;
19705
+ let isChecked = false;
19706
+ const type = getInputType(inputEl) || "";
19707
+ if (type === "radio" || type === "checkbox") {
19708
+ isChecked = inputEl.checked;
19709
+ } else if (maskInputOptions[inputEl.tagName.toLowerCase()] || maskInputOptions[type]) {
19710
+ text = maskInputValue({
19711
+ element: inputEl,
19712
+ maskInputOptions,
19713
+ tagName: inputEl.tagName,
19714
+ type,
19715
+ value: text,
19716
+ maskInputFn
19717
+ });
19718
+ }
19719
+ if (!lastValue || lastValue.text !== text || lastValue.isChecked !== isChecked) {
19720
+ const inputData = userTriggeredOnInput ? { text, isChecked, userTriggered: false } : { text, isChecked };
19721
+ lastInputValueMap.set(inputEl, inputData);
19722
+ wrappedEmit({
19723
+ type: EventType.IncrementalSnapshot,
19724
+ data: __spreadProps(__spreadValues({
19725
+ source: IncrementalSource.Input
19726
+ }, inputData), {
19727
+ id
19728
+ })
19729
+ });
19730
+ }
19731
+ }
19732
+ }
19733
+ }
19441
19734
  if (checkoutDebounceTimer) {
19442
19735
  clearTimeout(checkoutDebounceTimer);
19443
19736
  checkoutDebounceTimer = null;
@@ -19906,16 +20199,16 @@ function s(n2, o2) {
19906
20199
  var S = b.value;
19907
20200
  if (void 0 === S)
19908
20201
  return c(p, g);
19909
- var w2 = "string" == typeof S ? { target: S } : S, j2 = w2.target, E = w2.actions, R = void 0 === E ? [] : E, N = w2.cond, O2 = void 0 === N ? function() {
20202
+ var w2 = "string" == typeof S ? { target: S } : S, j2 = w2.target, E = w2.actions, R = void 0 === E ? [] : E, N = w2.cond, O = void 0 === N ? function() {
19910
20203
  return true;
19911
20204
  } : N, _2 = void 0 === j2, k2 = null != j2 ? j2 : p, T = n2.states[k2];
19912
- if (O2(g, d)) {
19913
- var q = t(f((_2 ? r(R) : [].concat(x2.exit, R, T.entry).filter(function(t2) {
20205
+ if (O(g, d)) {
20206
+ var q2 = t(f((_2 ? r(R) : [].concat(x2.exit, R, T.entry).filter(function(t2) {
19914
20207
  return t2;
19915
20208
  })).map(function(t2) {
19916
20209
  return i(t2, y._options.actions);
19917
- }), g, d), 3), z2 = q[0], A = q[1], B2 = q[2], C = null != j2 ? j2 : p;
19918
- return { value: C, context: A, actions: z2, changed: j2 !== p || z2.length > 0 || B2, matches: a(C) };
20210
+ }), g, d), 3), z2 = q2[0], A = q2[1], B = q2[2], C = null != j2 ? j2 : p;
20211
+ return { value: C, context: A, actions: z2, changed: j2 !== p || z2.length > 0 || B, matches: a(C) };
19919
20212
  }
19920
20213
  }
19921
20214
  } catch (t2) {
@@ -22409,7 +22702,7 @@ class Replayer {
22409
22702
  this.config.logger.log(REPLAY_CONSOLE_PREFIX, ...args);
22410
22703
  }
22411
22704
  }
22412
- const version = "3.6.0-alpha.1";
22705
+ const version = "3.11.0-alpha.1";
22413
22706
  const { getVersion } = record;
22414
22707
  const { isRecording } = record;
22415
22708
  const { flushCustomEventQueue } = record;