@vitest/browser 2.0.0-beta.12 → 2.0.0-beta.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,17 +1,8 @@
1
- function __vite__mapDeps(indexes) {
2
- if (!__vite__mapDeps.viteFileDeps) {
3
- __vite__mapDeps.viteFileDeps = []
4
- }
5
- return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
6
- }
7
1
  var __defProp = Object.defineProperty;
8
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
- var __publicField = (obj, key, value) => {
10
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
11
- return value;
12
- };
13
- import { d as getConfig, b as globalChannel, _ as __vitePreload, i as importFs, e as importId, c as channel, f as extname, g as getBrowserState, w as waitForChannel, j as join, a as client, o as onCancel, h as getWorkerState } from "./client-Dz5Ebwug.js";
14
- import { processError, loadDiffConfig, loadSnapshotSerializers, takeCoverageInsideWorker, SpyModule, setupCommonEnv, startTests } from "/__virtual_vitest__?id=vitest%2Fbrowser";
3
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
+ import { d as getConfig, b as globalChannel, i as importFs, e as importId, c as channel, f as extname, g as getBrowserState, w as waitForChannel, j as join, a as client, o as onCancel, h as getWorkerState } from "./client-dLyjuL0K.js";
5
+ import { processError, loadDiffConfig, loadSnapshotSerializers, takeCoverageInsideWorker, setupCommonEnv, startTests, collectTests, SpyModule } from "/__virtual_vitest__?id=vitest%2Fbrowser";
15
6
  import { getSafeTimers, stringify, format, TraceMap, originalPositionFor } from "/__virtual_vitest__?id=vitest%2Futils";
16
7
  import { VitestTestRunner, NodeBenchmarkRunner } from "/__virtual_vitest__?id=vitest%2Frunners";
17
8
  import { page } from "@vitest/browser/context";
@@ -26,7 +17,7 @@ function getType(value) {
26
17
  function showPopupWarning(name, value, defaultValue) {
27
18
  return (...params) => {
28
19
  const formatedParams = params.map((p) => JSON.stringify(p)).join(", ");
29
- console.warn(`Vitest encountered a \`${name}(${formatedParams})\` call that it cannot handle by default, so it returned \`${value}\`. Read more in https://vitest.dev/guide/browser#thread-blocking-dialogs.
20
+ console.warn(`Vitest encountered a \`${name}(${formatedParams})\` call that it cannot handle by default, so it returned \`${value}\`. Read more in https://vitest.dev/guide/browser/#thread-blocking-dialogs.
30
21
  If needed, mock the \`${name}\` call manually like:
31
22
 
32
23
  \`\`\`
@@ -324,7 +315,7 @@ function createBrowserRunner(runnerClass, mocker, state, coverageModule) {
324
315
  __publicField(this, "onTaskFinished", async (task) => {
325
316
  var _a;
326
317
  if (this.config.browser.screenshotFailures && ((_a = task.result) == null ? void 0 : _a.state) === "fail") {
327
- await page.screenshot();
318
+ task.meta.failScreenshotPath = await page.screenshot();
328
319
  }
329
320
  });
330
321
  __publicField(this, "onCancel", (reason) => {
@@ -390,10 +381,10 @@ function createBrowserRunner(runnerClass, mocker, state, coverageModule) {
390
381
  const prefix = `/${/^\w:/.test(filepath) ? "@fs/" : ""}`;
391
382
  const query = `${test ? "browserv" : "v"}=${hash}`;
392
383
  const importpath = `${prefix}${filepath}?${query}`.replace(/\/+/g, "/");
393
- await __vitePreload(() => import(
384
+ await import(
394
385
  /* @vite-ignore */
395
386
  importpath
396
- ), true ? __vite__mapDeps([]) : void 0);
387
+ );
397
388
  });
398
389
  this.config = options.config;
399
390
  }
@@ -452,6 +443,61 @@ async function updateFilesLocations(files, sourceMaps) {
452
443
  });
453
444
  await Promise.all(promises2);
454
445
  }
446
+ const scriptRel = "modulepreload";
447
+ const assetsURL = function(dep) {
448
+ return "/" + dep;
449
+ };
450
+ const seen = {};
451
+ const __vitePreload = function preload(baseModule, deps, importerUrl) {
452
+ let promise = Promise.resolve();
453
+ if (deps && deps.length > 0) {
454
+ document.getElementsByTagName("link");
455
+ const cspNonceMeta = document.querySelector(
456
+ "meta[property=csp-nonce]"
457
+ );
458
+ const cspNonce = (cspNonceMeta == null ? void 0 : cspNonceMeta.nonce) || (cspNonceMeta == null ? void 0 : cspNonceMeta.getAttribute("nonce"));
459
+ promise = Promise.all(
460
+ deps.map((dep) => {
461
+ dep = assetsURL(dep);
462
+ if (dep in seen) return;
463
+ seen[dep] = true;
464
+ const isCss = dep.endsWith(".css");
465
+ const cssSelector = isCss ? '[rel="stylesheet"]' : "";
466
+ if (document.querySelector(`link[href="${dep}"]${cssSelector}`)) {
467
+ return;
468
+ }
469
+ const link = document.createElement("link");
470
+ link.rel = isCss ? "stylesheet" : scriptRel;
471
+ if (!isCss) {
472
+ link.as = "script";
473
+ link.crossOrigin = "";
474
+ }
475
+ link.href = dep;
476
+ if (cspNonce) {
477
+ link.setAttribute("nonce", cspNonce);
478
+ }
479
+ document.head.appendChild(link);
480
+ if (isCss) {
481
+ return new Promise((res, rej) => {
482
+ link.addEventListener("load", res);
483
+ link.addEventListener(
484
+ "error",
485
+ () => rej(new Error(`Unable to preload CSS for ${dep}`))
486
+ );
487
+ });
488
+ }
489
+ })
490
+ );
491
+ }
492
+ return promise.then(() => baseModule()).catch((err) => {
493
+ const e = new Event("vite:preloadError", { cancelable: true });
494
+ e.payload = err;
495
+ window.dispatchEvent(e);
496
+ if (!e.defaultPrevented) {
497
+ throw err;
498
+ }
499
+ });
500
+ };
455
501
  const now = Date.now;
456
502
  class VitestBrowserClientMocker {
457
503
  constructor() {
@@ -501,10 +547,10 @@ class VitestBrowserClientMocker {
501
547
  const url2 = new URL(`/@id/${resolved.id}`, location.href);
502
548
  const query = `_vitest_original&ext.${ext}`;
503
549
  const actualUrl = `${url2.pathname}${url2.search ? `${url2.search}&${query}` : `?${query}`}${url2.hash}`;
504
- return getBrowserState().wrapModule(() => __vitePreload(() => import(
550
+ return getBrowserState().wrapModule(() => import(
505
551
  /* @vite-ignore */
506
552
  actualUrl
507
- ), true ? __vite__mapDeps([]) : void 0));
553
+ ));
508
554
  }
509
555
  async importMock(rawId, importer) {
510
556
  await this.prepare();
@@ -522,17 +568,17 @@ class VitestBrowserClientMocker {
522
568
  }
523
569
  if (type === "redirect") {
524
570
  const url22 = new URL(`/@id/${mockPath}`, location.href);
525
- return __vitePreload(() => import(
571
+ return import(
526
572
  /* @vite-ignore */
527
573
  url22.toString()
528
- ), true ? __vite__mapDeps([]) : void 0);
574
+ );
529
575
  }
530
576
  const url2 = new URL(`/@id/${resolvedId}`, location.href);
531
577
  const query = url2.search ? `${url2.search}&t=${now()}` : `?t=${now()}`;
532
578
  const moduleObject = await __vitePreload(() => import(
533
579
  /* @vite-ignore */
534
580
  `${url2.pathname}${query}${url2.hash}`
535
- ), true ? __vite__mapDeps([]) : void 0);
581
+ ), true ? [] : void 0);
536
582
  return this.mockObject(moduleObject);
537
583
  }
538
584
  getMockContext() {
@@ -570,13 +616,19 @@ class VitestBrowserClientMocker {
570
616
  }
571
617
  }
572
618
  queueMock(id, importer, factory) {
573
- const promise = rpc$1().resolveMock(id, importer, !!factory).then(async ({ mockPath, resolvedId }) => {
619
+ const promise = rpc$1().resolveMock(id, importer, !!factory).then(async ({ mockPath, resolvedId, needsInterop }) => {
574
620
  this.ids.add(resolvedId);
575
- const urlPaths = resolveMockPaths(resolvedId);
576
- const resolvedMock = typeof mockPath === "string" ? new URL(resolvedMockedPath(mockPath), location.href).toString() : mockPath;
621
+ const urlPaths = resolveMockPaths(cleanVersion(resolvedId));
622
+ const resolvedMock = typeof mockPath === "string" ? new URL(resolvedMockedPath(cleanVersion(mockPath)), location.href).toString() : mockPath;
623
+ const _factory = factory && needsInterop ? async () => {
624
+ const data = await factory();
625
+ return { default: data };
626
+ } : factory;
577
627
  urlPaths.forEach((url2) => {
578
628
  this.mocks[url2] = resolvedMock;
579
- this.factories[url2] = factory;
629
+ if (_factory) {
630
+ this.factories[url2] = _factory;
631
+ }
580
632
  });
581
633
  channel.postMessage({
582
634
  type: "mock",
@@ -595,7 +647,7 @@ class VitestBrowserClientMocker {
595
647
  return;
596
648
  }
597
649
  this.ids.delete(resolved.id);
598
- const urlPaths = resolveMockPaths(resolved.id);
650
+ const urlPaths = resolveMockPaths(cleanVersion(resolved.id));
599
651
  urlPaths.forEach((url2) => {
600
652
  delete this.mocks[url2];
601
653
  delete this.factories[url2];
@@ -785,6 +837,10 @@ function resolveMockPaths(path) {
785
837
  }
786
838
  return paths;
787
839
  }
840
+ const versionRegexp = /(\?|&)v=\w{8}/;
841
+ function cleanVersion(url2) {
842
+ return url2.replace(versionRegexp, "");
843
+ }
788
844
  var minIndent$1 = (string) => {
789
845
  const match = string.match(/^[ \t]*(?=\S)/gm);
790
846
  if (!match) {
@@ -892,8 +948,7 @@ const $d708735ed1303b43$export$98e6a39c04603d36 = (css, options) => {
892
948
  let column = 1;
893
949
  function updatePosition(str) {
894
950
  const lines = str.match(/\n/g);
895
- if (lines)
896
- lineno += lines.length;
951
+ if (lines) lineno += lines.length;
897
952
  const i = str.lastIndexOf("\n");
898
953
  column = ~i ? str.length - i : column + str.length;
899
954
  }
@@ -914,10 +969,8 @@ const $d708735ed1303b43$export$98e6a39c04603d36 = (css, options) => {
914
969
  const errorsList = [];
915
970
  function error(msg) {
916
971
  const err = new $009ddb00d3ec72b8$export$2e2bcd8739ae039((options == null ? void 0 : options.source) || "", msg, lineno, column, css);
917
- if (options == null ? void 0 : options.silent)
918
- errorsList.push(err);
919
- else
920
- throw err;
972
+ if (options == null ? void 0 : options.silent) errorsList.push(err);
973
+ else throw err;
921
974
  }
922
975
  function stylesheet() {
923
976
  const rulesList = rules();
@@ -942,17 +995,15 @@ const $d708735ed1303b43$export$98e6a39c04603d36 = (css, options) => {
942
995
  const rules2 = [];
943
996
  whitespace();
944
997
  comments(rules2);
945
- while (css.length && css.charAt(0) !== "}" && (node = atrule() || rule()))
946
- if (node) {
947
- rules2.push(node);
948
- comments(rules2);
949
- }
998
+ while (css.length && css.charAt(0) !== "}" && (node = atrule() || rule())) if (node) {
999
+ rules2.push(node);
1000
+ comments(rules2);
1001
+ }
950
1002
  return rules2;
951
1003
  }
952
1004
  function match(re) {
953
1005
  const m = re.exec(css);
954
- if (!m)
955
- return;
1006
+ if (!m) return;
956
1007
  const str = m[0];
957
1008
  updatePosition(str);
958
1009
  css = css.slice(str.length);
@@ -964,18 +1015,14 @@ const $d708735ed1303b43$export$98e6a39c04603d36 = (css, options) => {
964
1015
  function comments(rules2) {
965
1016
  let c;
966
1017
  rules2 = rules2 || [];
967
- while (c = comment())
968
- if (c)
969
- rules2.push(c);
1018
+ while (c = comment()) if (c) rules2.push(c);
970
1019
  return rules2;
971
1020
  }
972
1021
  function comment() {
973
1022
  const pos = position();
974
- if ("/" !== css.charAt(0) || "*" !== css.charAt(1))
975
- return;
1023
+ if ("/" !== css.charAt(0) || "*" !== css.charAt(1)) return;
976
1024
  const m = match(/^\/\*[^]*?\*\//);
977
- if (!m)
978
- return error("End of comment missing");
1025
+ if (!m) return error("End of comment missing");
979
1026
  return pos({
980
1027
  type: $b2e137848b48cf4f$export$9be5dd6e61d5d73a.comment,
981
1028
  comment: m[0].slice(2, -2)
@@ -991,29 +1038,23 @@ const $d708735ed1303b43$export$98e6a39c04603d36 = (css, options) => {
991
1038
  const nextSearch = findClosingParenthese(str, nextParentheses + 1);
992
1039
  ptr = nextSearch + 1;
993
1040
  closeParentheses = str.indexOf(")", ptr);
994
- } else
995
- found = true;
1041
+ } else found = true;
996
1042
  }
997
- if (found && closeParentheses !== -1)
998
- return closeParentheses;
999
- else
1000
- return -1;
1043
+ if (found && closeParentheses !== -1) return closeParentheses;
1044
+ else return -1;
1001
1045
  }
1002
1046
  function selector() {
1003
1047
  const m = match(/^([^{]+)/);
1004
- if (!m)
1005
- return;
1048
+ if (!m) return;
1006
1049
  let res = $d708735ed1303b43$var$trim(m[0]).replace($d708735ed1303b43$var$commentre, "");
1007
- if (res.indexOf(",") === -1)
1008
- return [
1009
- res
1010
- ];
1050
+ if (res.indexOf(",") === -1) return [
1051
+ res
1052
+ ];
1011
1053
  let ptr = 0;
1012
1054
  let startParentheses = res.indexOf("(", ptr);
1013
1055
  while (startParentheses !== -1) {
1014
1056
  const closeParentheses = findClosingParenthese(res, startParentheses);
1015
- if (closeParentheses === -1)
1016
- break;
1057
+ if (closeParentheses === -1) break;
1017
1058
  ptr = closeParentheses + 1;
1018
1059
  res = res.substring(0, startParentheses) + res.substring(startParentheses, closeParentheses).replace(/,/g, "‌") + res.substring(closeParentheses);
1019
1060
  startParentheses = res.indexOf("(", ptr);
@@ -1026,11 +1067,9 @@ const $d708735ed1303b43$export$98e6a39c04603d36 = (css, options) => {
1026
1067
  function declaration() {
1027
1068
  const pos = position();
1028
1069
  const propMatch = match(/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);
1029
- if (!propMatch)
1030
- return;
1070
+ if (!propMatch) return;
1031
1071
  const propValue = $d708735ed1303b43$var$trim(propMatch[0]);
1032
- if (!match(/^:\s*/))
1033
- return error("property missing ':'");
1072
+ if (!match(/^:\s*/)) return error("property missing ':'");
1034
1073
  const val = match(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/);
1035
1074
  const ret = pos({
1036
1075
  type: $b2e137848b48cf4f$export$9be5dd6e61d5d73a.declaration,
@@ -1042,17 +1081,14 @@ const $d708735ed1303b43$export$98e6a39c04603d36 = (css, options) => {
1042
1081
  }
1043
1082
  function declarations() {
1044
1083
  const decls = [];
1045
- if (!open())
1046
- return error("missing '{'");
1084
+ if (!open()) return error("missing '{'");
1047
1085
  comments(decls);
1048
1086
  let decl;
1049
- while (decl = declaration())
1050
- if (decl) {
1051
- decls.push(decl);
1052
- comments(decls);
1053
- }
1054
- if (!close())
1055
- return error("missing '}'");
1087
+ while (decl = declaration()) if (decl) {
1088
+ decls.push(decl);
1089
+ comments(decls);
1090
+ }
1091
+ if (!close()) return error("missing '}'");
1056
1092
  return decls;
1057
1093
  }
1058
1094
  function keyframe() {
@@ -1063,8 +1099,7 @@ const $d708735ed1303b43$export$98e6a39c04603d36 = (css, options) => {
1063
1099
  vals.push(m[1]);
1064
1100
  match(/^,\s*/);
1065
1101
  }
1066
- if (!vals.length)
1067
- return;
1102
+ if (!vals.length) return;
1068
1103
  return pos({
1069
1104
  type: $b2e137848b48cf4f$export$9be5dd6e61d5d73a.keyframe,
1070
1105
  values: vals,
@@ -1074,23 +1109,19 @@ const $d708735ed1303b43$export$98e6a39c04603d36 = (css, options) => {
1074
1109
  function atkeyframes() {
1075
1110
  const pos = position();
1076
1111
  const m1 = match(/^@([-\w]+)?keyframes\s*/);
1077
- if (!m1)
1078
- return;
1112
+ if (!m1) return;
1079
1113
  const vendor = m1[1];
1080
1114
  const m2 = match(/^([-\w]+)\s*/);
1081
- if (!m2)
1082
- return error("@keyframes missing name");
1115
+ if (!m2) return error("@keyframes missing name");
1083
1116
  const name = m2[1];
1084
- if (!open())
1085
- return error("@keyframes missing '{'");
1117
+ if (!open()) return error("@keyframes missing '{'");
1086
1118
  let frame;
1087
1119
  let frames = comments();
1088
1120
  while (frame = keyframe()) {
1089
1121
  frames.push(frame);
1090
1122
  frames = frames.concat(comments());
1091
1123
  }
1092
- if (!close())
1093
- return error("@keyframes missing '}'");
1124
+ if (!close()) return error("@keyframes missing '}'");
1094
1125
  return pos({
1095
1126
  type: $b2e137848b48cf4f$export$9be5dd6e61d5d73a.keyframes,
1096
1127
  name,
@@ -1101,14 +1132,11 @@ const $d708735ed1303b43$export$98e6a39c04603d36 = (css, options) => {
1101
1132
  function atsupports() {
1102
1133
  const pos = position();
1103
1134
  const m = match(/^@supports *([^{]+)/);
1104
- if (!m)
1105
- return;
1135
+ if (!m) return;
1106
1136
  const supports = $d708735ed1303b43$var$trim(m[1]);
1107
- if (!open())
1108
- return error("@supports missing '{'");
1137
+ if (!open()) return error("@supports missing '{'");
1109
1138
  const style = comments().concat(rules());
1110
- if (!close())
1111
- return error("@supports missing '}'");
1139
+ if (!close()) return error("@supports missing '}'");
1112
1140
  return pos({
1113
1141
  type: $b2e137848b48cf4f$export$9be5dd6e61d5d73a.supports,
1114
1142
  supports,
@@ -1118,13 +1146,10 @@ const $d708735ed1303b43$export$98e6a39c04603d36 = (css, options) => {
1118
1146
  function athost() {
1119
1147
  const pos = position();
1120
1148
  const m = match(/^@host\s*/);
1121
- if (!m)
1122
- return;
1123
- if (!open())
1124
- return error("@host missing '{'");
1149
+ if (!m) return;
1150
+ if (!open()) return error("@host missing '{'");
1125
1151
  const style = comments().concat(rules());
1126
- if (!close())
1127
- return error("@host missing '}'");
1152
+ if (!close()) return error("@host missing '}'");
1128
1153
  return pos({
1129
1154
  type: $b2e137848b48cf4f$export$9be5dd6e61d5d73a.host,
1130
1155
  rules: style
@@ -1133,14 +1158,11 @@ const $d708735ed1303b43$export$98e6a39c04603d36 = (css, options) => {
1133
1158
  function atcontainer() {
1134
1159
  const pos = position();
1135
1160
  const m = match(/^@container *([^{]+)/);
1136
- if (!m)
1137
- return;
1161
+ if (!m) return;
1138
1162
  const container = $d708735ed1303b43$var$trim(m[1]);
1139
- if (!open())
1140
- return error("@container missing '{'");
1163
+ if (!open()) return error("@container missing '{'");
1141
1164
  const style = comments().concat(rules());
1142
- if (!close())
1143
- return error("@container missing '}'");
1165
+ if (!close()) return error("@container missing '}'");
1144
1166
  return pos({
1145
1167
  type: $b2e137848b48cf4f$export$9be5dd6e61d5d73a.container,
1146
1168
  container,
@@ -1150,8 +1172,7 @@ const $d708735ed1303b43$export$98e6a39c04603d36 = (css, options) => {
1150
1172
  function atlayer() {
1151
1173
  const pos = position();
1152
1174
  const m = match(/^@layer *([^{;@]+)/);
1153
- if (!m)
1154
- return;
1175
+ if (!m) return;
1155
1176
  const layer = $d708735ed1303b43$var$trim(m[1]);
1156
1177
  if (!open()) {
1157
1178
  match(/^[;\s]*/);
@@ -1161,8 +1182,7 @@ const $d708735ed1303b43$export$98e6a39c04603d36 = (css, options) => {
1161
1182
  });
1162
1183
  }
1163
1184
  const style = comments().concat(rules());
1164
- if (!close())
1165
- return error("@layer missing '}'");
1185
+ if (!close()) return error("@layer missing '}'");
1166
1186
  return pos({
1167
1187
  type: $b2e137848b48cf4f$export$9be5dd6e61d5d73a.layer,
1168
1188
  layer,
@@ -1172,14 +1192,11 @@ const $d708735ed1303b43$export$98e6a39c04603d36 = (css, options) => {
1172
1192
  function atmedia() {
1173
1193
  const pos = position();
1174
1194
  const m = match(/^@media *([^{]+)/);
1175
- if (!m)
1176
- return;
1195
+ if (!m) return;
1177
1196
  const media = $d708735ed1303b43$var$trim(m[1]);
1178
- if (!open())
1179
- return error("@media missing '{'");
1197
+ if (!open()) return error("@media missing '{'");
1180
1198
  const style = comments().concat(rules());
1181
- if (!close())
1182
- return error("@media missing '}'");
1199
+ if (!close()) return error("@media missing '}'");
1183
1200
  return pos({
1184
1201
  type: $b2e137848b48cf4f$export$9be5dd6e61d5d73a.media,
1185
1202
  media,
@@ -1189,8 +1206,7 @@ const $d708735ed1303b43$export$98e6a39c04603d36 = (css, options) => {
1189
1206
  function atcustommedia() {
1190
1207
  const pos = position();
1191
1208
  const m = match(/^@custom-media\s+(--\S+)\s*([^{;\s][^{;]*);/);
1192
- if (!m)
1193
- return;
1209
+ if (!m) return;
1194
1210
  return pos({
1195
1211
  type: $b2e137848b48cf4f$export$9be5dd6e61d5d73a.customMedia,
1196
1212
  name: $d708735ed1303b43$var$trim(m[1]),
@@ -1200,19 +1216,16 @@ const $d708735ed1303b43$export$98e6a39c04603d36 = (css, options) => {
1200
1216
  function atpage() {
1201
1217
  const pos = position();
1202
1218
  const m = match(/^@page */);
1203
- if (!m)
1204
- return;
1219
+ if (!m) return;
1205
1220
  const sel = selector() || [];
1206
- if (!open())
1207
- return error("@page missing '{'");
1221
+ if (!open()) return error("@page missing '{'");
1208
1222
  let decls = comments();
1209
1223
  let decl;
1210
1224
  while (decl = declaration()) {
1211
1225
  decls.push(decl);
1212
1226
  decls = decls.concat(comments());
1213
1227
  }
1214
- if (!close())
1215
- return error("@page missing '}'");
1228
+ if (!close()) return error("@page missing '}'");
1216
1229
  return pos({
1217
1230
  type: $b2e137848b48cf4f$export$9be5dd6e61d5d73a.page,
1218
1231
  selectors: sel,
@@ -1222,15 +1235,12 @@ const $d708735ed1303b43$export$98e6a39c04603d36 = (css, options) => {
1222
1235
  function atdocument() {
1223
1236
  const pos = position();
1224
1237
  const m = match(/^@([-\w]+)?document *([^{]+)/);
1225
- if (!m)
1226
- return;
1238
+ if (!m) return;
1227
1239
  const vendor = $d708735ed1303b43$var$trim(m[1]);
1228
1240
  const doc = $d708735ed1303b43$var$trim(m[2]);
1229
- if (!open())
1230
- return error("@document missing '{'");
1241
+ if (!open()) return error("@document missing '{'");
1231
1242
  const style = comments().concat(rules());
1232
- if (!close())
1233
- return error("@document missing '}'");
1243
+ if (!close()) return error("@document missing '}'");
1234
1244
  return pos({
1235
1245
  type: $b2e137848b48cf4f$export$9be5dd6e61d5d73a.document,
1236
1246
  document: doc,
@@ -1241,18 +1251,15 @@ const $d708735ed1303b43$export$98e6a39c04603d36 = (css, options) => {
1241
1251
  function atfontface() {
1242
1252
  const pos = position();
1243
1253
  const m = match(/^@font-face\s*/);
1244
- if (!m)
1245
- return;
1246
- if (!open())
1247
- return error("@font-face missing '{'");
1254
+ if (!m) return;
1255
+ if (!open()) return error("@font-face missing '{'");
1248
1256
  let decls = comments();
1249
1257
  let decl;
1250
1258
  while (decl = declaration()) {
1251
1259
  decls.push(decl);
1252
1260
  decls = decls.concat(comments());
1253
1261
  }
1254
- if (!close())
1255
- return error("@font-face missing '}'");
1262
+ if (!close()) return error("@font-face missing '}'");
1256
1263
  return pos({
1257
1264
  type: $b2e137848b48cf4f$export$9be5dd6e61d5d73a.fontFace,
1258
1265
  declarations: decls
@@ -1261,13 +1268,10 @@ const $d708735ed1303b43$export$98e6a39c04603d36 = (css, options) => {
1261
1268
  function atstartingstyle() {
1262
1269
  const pos = position();
1263
1270
  const m = match(/^@starting-style\s*/);
1264
- if (!m)
1265
- return;
1266
- if (!open())
1267
- return error("@starting-style missing '{'");
1271
+ if (!m) return;
1272
+ if (!open()) return error("@starting-style missing '{'");
1268
1273
  const style = comments().concat(rules());
1269
- if (!close())
1270
- return error("@starting-style missing '}'");
1274
+ if (!close()) return error("@starting-style missing '}'");
1271
1275
  return pos({
1272
1276
  type: $b2e137848b48cf4f$export$9be5dd6e61d5d73a.startingStyle,
1273
1277
  rules: style
@@ -1281,8 +1285,7 @@ const $d708735ed1303b43$export$98e6a39c04603d36 = (css, options) => {
1281
1285
  return function() {
1282
1286
  const pos = position();
1283
1287
  const m = match(re);
1284
- if (!m)
1285
- return;
1288
+ if (!m) return;
1286
1289
  const ret = {
1287
1290
  type: name
1288
1291
  };
@@ -1291,15 +1294,13 @@ const $d708735ed1303b43$export$98e6a39c04603d36 = (css, options) => {
1291
1294
  };
1292
1295
  }
1293
1296
  function atrule() {
1294
- if (css[0] !== "@")
1295
- return;
1297
+ if (css[0] !== "@") return;
1296
1298
  return atkeyframes() || atmedia() || atcustommedia() || atsupports() || atimport() || atcharset() || atnamespace() || atdocument() || atpage() || athost() || atfontface() || atcontainer() || atstartingstyle() || atlayer();
1297
1299
  }
1298
1300
  function rule() {
1299
1301
  const pos = position();
1300
1302
  const sel = selector();
1301
- if (!sel)
1302
- return error("selector missing");
1303
+ if (!sel) return error("selector missing");
1303
1304
  comments();
1304
1305
  return pos({
1305
1306
  type: $b2e137848b48cf4f$export$9be5dd6e61d5d73a.rule,
@@ -1317,20 +1318,17 @@ function $d708735ed1303b43$var$addParent(obj, parent) {
1317
1318
  const childParent = isNode ? obj : parent;
1318
1319
  for (const k in obj) {
1319
1320
  const value = obj[k];
1320
- if (Array.isArray(value))
1321
- value.forEach((v) => {
1322
- $d708735ed1303b43$var$addParent(v, childParent);
1323
- });
1324
- else if (value && typeof value === "object")
1325
- $d708735ed1303b43$var$addParent(value, childParent);
1326
- }
1327
- if (isNode)
1328
- Object.defineProperty(obj, "parent", {
1329
- configurable: true,
1330
- writable: true,
1331
- enumerable: false,
1332
- value: parent || null
1321
+ if (Array.isArray(value)) value.forEach((v) => {
1322
+ $d708735ed1303b43$var$addParent(v, childParent);
1333
1323
  });
1324
+ else if (value && typeof value === "object") $d708735ed1303b43$var$addParent(value, childParent);
1325
+ }
1326
+ if (isNode) Object.defineProperty(obj, "parent", {
1327
+ configurable: true,
1328
+ writable: true,
1329
+ enumerable: false,
1330
+ value: parent || null
1331
+ });
1334
1332
  return obj;
1335
1333
  }
1336
1334
  var $d708735ed1303b43$export$2e2bcd8739ae039 = $d708735ed1303b43$export$98e6a39c04603d36;
@@ -1392,14 +1390,12 @@ function _defineProperties(target, props) {
1392
1390
  var descriptor = props[i];
1393
1391
  descriptor.enumerable = descriptor.enumerable || false;
1394
1392
  descriptor.configurable = true;
1395
- if ("value" in descriptor)
1396
- descriptor.writable = true;
1393
+ if ("value" in descriptor) descriptor.writable = true;
1397
1394
  Object.defineProperty(target, _toPropertyKey$1(descriptor.key), descriptor);
1398
1395
  }
1399
1396
  }
1400
1397
  function _createClass(Constructor, protoProps, staticProps) {
1401
- if (protoProps)
1402
- _defineProperties(Constructor.prototype, protoProps);
1398
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
1403
1399
  Object.defineProperty(Constructor, "prototype", { writable: false });
1404
1400
  return Constructor;
1405
1401
  }
@@ -1417,13 +1413,11 @@ function _toPropertyKey$1(arg) {
1417
1413
  return _typeof$2(key) === "symbol" ? key : String(key);
1418
1414
  }
1419
1415
  function _toPrimitive$1(input, hint) {
1420
- if (_typeof$2(input) !== "object" || input === null)
1421
- return input;
1416
+ if (_typeof$2(input) !== "object" || input === null) return input;
1422
1417
  var prim = input[Symbol.toPrimitive];
1423
1418
  if (prim !== void 0) {
1424
1419
  var res = prim.call(input, hint || "default");
1425
- if (_typeof$2(res) !== "object")
1426
- return res;
1420
+ if (_typeof$2(res) !== "object") return res;
1427
1421
  throw new TypeError("@@toPrimitive must return a primitive value.");
1428
1422
  }
1429
1423
  return (hint === "string" ? String : Number)(input);
@@ -1835,8 +1829,8 @@ function getLabels(element) {
1835
1829
  if (!isLabelableElement(element)) {
1836
1830
  return null;
1837
1831
  }
1838
- var document = element.ownerDocument;
1839
- return arrayFrom(document.querySelectorAll("label")).filter(function(label) {
1832
+ var document2 = element.ownerDocument;
1833
+ return arrayFrom(document2.querySelectorAll("label")).filter(function(label) {
1840
1834
  return getControlOfLabel(label) === element;
1841
1835
  });
1842
1836
  }
@@ -2140,13 +2134,11 @@ function _toPropertyKey(arg) {
2140
2134
  return _typeof$1(key) === "symbol" ? key : String(key);
2141
2135
  }
2142
2136
  function _toPrimitive(input, hint) {
2143
- if (_typeof$1(input) !== "object" || input === null)
2144
- return input;
2137
+ if (_typeof$1(input) !== "object" || input === null) return input;
2145
2138
  var prim = input[Symbol.toPrimitive];
2146
2139
  if (prim !== void 0) {
2147
2140
  var res = prim.call(input, hint || "default");
2148
- if (_typeof$1(res) !== "object")
2149
- return res;
2141
+ if (_typeof$1(res) !== "object") return res;
2150
2142
  throw new TypeError("@@toPrimitive must return a primitive value.");
2151
2143
  }
2152
2144
  return (hint === "string" ? String : Number)(input);
@@ -2252,8 +2244,7 @@ function _nonIterableRest$4() {
2252
2244
  }
2253
2245
  function _iterableToArrayLimit$4(arr, i) {
2254
2246
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
2255
- if (_i == null)
2256
- return;
2247
+ if (_i == null) return;
2257
2248
  var _arr = [];
2258
2249
  var _n = true;
2259
2250
  var _d = false;
@@ -2261,39 +2252,33 @@ function _iterableToArrayLimit$4(arr, i) {
2261
2252
  try {
2262
2253
  for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
2263
2254
  _arr.push(_s.value);
2264
- if (i && _arr.length === i)
2265
- break;
2255
+ if (i && _arr.length === i) break;
2266
2256
  }
2267
2257
  } catch (err) {
2268
2258
  _d = true;
2269
2259
  _e = err;
2270
2260
  } finally {
2271
2261
  try {
2272
- if (!_n && _i["return"] != null)
2273
- _i["return"]();
2262
+ if (!_n && _i["return"] != null) _i["return"]();
2274
2263
  } finally {
2275
- if (_d)
2276
- throw _e;
2264
+ if (_d) throw _e;
2277
2265
  }
2278
2266
  }
2279
2267
  return _arr;
2280
2268
  }
2281
2269
  function _arrayWithHoles$4(arr) {
2282
- if (Array.isArray(arr))
2283
- return arr;
2270
+ if (Array.isArray(arr)) return arr;
2284
2271
  }
2285
2272
  function _createForOfIteratorHelper$4(o, allowArrayLike) {
2286
2273
  var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
2287
2274
  if (!it) {
2288
2275
  if (Array.isArray(o) || (it = _unsupportedIterableToArray$4(o)) || allowArrayLike) {
2289
- if (it)
2290
- o = it;
2276
+ if (it) o = it;
2291
2277
  var i = 0;
2292
2278
  var F = function F2() {
2293
2279
  };
2294
2280
  return { s: F, n: function n() {
2295
- if (i >= o.length)
2296
- return { done: true };
2281
+ if (i >= o.length) return { done: true };
2297
2282
  return { done: false, value: o[i++] };
2298
2283
  }, e: function e(_e2) {
2299
2284
  throw _e2;
@@ -2313,30 +2298,22 @@ function _createForOfIteratorHelper$4(o, allowArrayLike) {
2313
2298
  err = _e3;
2314
2299
  }, f: function f() {
2315
2300
  try {
2316
- if (!normalCompletion && it.return != null)
2317
- it.return();
2301
+ if (!normalCompletion && it.return != null) it.return();
2318
2302
  } finally {
2319
- if (didErr)
2320
- throw err;
2303
+ if (didErr) throw err;
2321
2304
  }
2322
2305
  } };
2323
2306
  }
2324
2307
  function _unsupportedIterableToArray$4(o, minLen) {
2325
- if (!o)
2326
- return;
2327
- if (typeof o === "string")
2328
- return _arrayLikeToArray$4(o, minLen);
2308
+ if (!o) return;
2309
+ if (typeof o === "string") return _arrayLikeToArray$4(o, minLen);
2329
2310
  var n = Object.prototype.toString.call(o).slice(8, -1);
2330
- if (n === "Object" && o.constructor)
2331
- n = o.constructor.name;
2332
- if (n === "Map" || n === "Set")
2333
- return Array.from(o);
2334
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
2335
- return _arrayLikeToArray$4(o, minLen);
2311
+ if (n === "Object" && o.constructor) n = o.constructor.name;
2312
+ if (n === "Map" || n === "Set") return Array.from(o);
2313
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$4(o, minLen);
2336
2314
  }
2337
2315
  function _arrayLikeToArray$4(arr, len) {
2338
- if (len == null || len > arr.length)
2339
- len = arr.length;
2316
+ if (len == null || len > arr.length) len = arr.length;
2340
2317
  for (var i = 0, arr2 = new Array(len); i < len; i++) {
2341
2318
  arr2[i] = arr[i];
2342
2319
  }
@@ -2517,8 +2494,7 @@ function _nonIterableRest$3() {
2517
2494
  }
2518
2495
  function _iterableToArrayLimit$3(arr, i) {
2519
2496
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
2520
- if (_i == null)
2521
- return;
2497
+ if (_i == null) return;
2522
2498
  var _arr = [];
2523
2499
  var _n = true;
2524
2500
  var _d = false;
@@ -2526,39 +2502,33 @@ function _iterableToArrayLimit$3(arr, i) {
2526
2502
  try {
2527
2503
  for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
2528
2504
  _arr.push(_s.value);
2529
- if (i && _arr.length === i)
2530
- break;
2505
+ if (i && _arr.length === i) break;
2531
2506
  }
2532
2507
  } catch (err) {
2533
2508
  _d = true;
2534
2509
  _e = err;
2535
2510
  } finally {
2536
2511
  try {
2537
- if (!_n && _i["return"] != null)
2538
- _i["return"]();
2512
+ if (!_n && _i["return"] != null) _i["return"]();
2539
2513
  } finally {
2540
- if (_d)
2541
- throw _e;
2514
+ if (_d) throw _e;
2542
2515
  }
2543
2516
  }
2544
2517
  return _arr;
2545
2518
  }
2546
2519
  function _arrayWithHoles$3(arr) {
2547
- if (Array.isArray(arr))
2548
- return arr;
2520
+ if (Array.isArray(arr)) return arr;
2549
2521
  }
2550
2522
  function _createForOfIteratorHelper$3(o, allowArrayLike) {
2551
2523
  var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
2552
2524
  if (!it) {
2553
2525
  if (Array.isArray(o) || (it = _unsupportedIterableToArray$3(o)) || allowArrayLike) {
2554
- if (it)
2555
- o = it;
2526
+ if (it) o = it;
2556
2527
  var i = 0;
2557
2528
  var F = function F2() {
2558
2529
  };
2559
2530
  return { s: F, n: function n() {
2560
- if (i >= o.length)
2561
- return { done: true };
2531
+ if (i >= o.length) return { done: true };
2562
2532
  return { done: false, value: o[i++] };
2563
2533
  }, e: function e(_e2) {
2564
2534
  throw _e2;
@@ -2578,30 +2548,22 @@ function _createForOfIteratorHelper$3(o, allowArrayLike) {
2578
2548
  err = _e3;
2579
2549
  }, f: function f() {
2580
2550
  try {
2581
- if (!normalCompletion && it.return != null)
2582
- it.return();
2551
+ if (!normalCompletion && it.return != null) it.return();
2583
2552
  } finally {
2584
- if (didErr)
2585
- throw err;
2553
+ if (didErr) throw err;
2586
2554
  }
2587
2555
  } };
2588
2556
  }
2589
2557
  function _unsupportedIterableToArray$3(o, minLen) {
2590
- if (!o)
2591
- return;
2592
- if (typeof o === "string")
2593
- return _arrayLikeToArray$3(o, minLen);
2558
+ if (!o) return;
2559
+ if (typeof o === "string") return _arrayLikeToArray$3(o, minLen);
2594
2560
  var n = Object.prototype.toString.call(o).slice(8, -1);
2595
- if (n === "Object" && o.constructor)
2596
- n = o.constructor.name;
2597
- if (n === "Map" || n === "Set")
2598
- return Array.from(o);
2599
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
2600
- return _arrayLikeToArray$3(o, minLen);
2561
+ if (n === "Object" && o.constructor) n = o.constructor.name;
2562
+ if (n === "Map" || n === "Set") return Array.from(o);
2563
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$3(o, minLen);
2601
2564
  }
2602
2565
  function _arrayLikeToArray$3(arr, len) {
2603
- if (len == null || len > arr.length)
2604
- len = arr.length;
2566
+ if (len == null || len > arr.length) len = arr.length;
2605
2567
  for (var i = 0, arr2 = new Array(len); i < len; i++) {
2606
2568
  arr2[i] = arr[i];
2607
2569
  }
@@ -7784,14 +7746,12 @@ function _createForOfIteratorHelper$2(o, allowArrayLike) {
7784
7746
  var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
7785
7747
  if (!it) {
7786
7748
  if (Array.isArray(o) || (it = _unsupportedIterableToArray$2(o)) || allowArrayLike) {
7787
- if (it)
7788
- o = it;
7749
+ if (it) o = it;
7789
7750
  var i = 0;
7790
7751
  var F = function F2() {
7791
7752
  };
7792
7753
  return { s: F, n: function n() {
7793
- if (i >= o.length)
7794
- return { done: true };
7754
+ if (i >= o.length) return { done: true };
7795
7755
  return { done: false, value: o[i++] };
7796
7756
  }, e: function e(_e2) {
7797
7757
  throw _e2;
@@ -7811,11 +7771,9 @@ function _createForOfIteratorHelper$2(o, allowArrayLike) {
7811
7771
  err = _e3;
7812
7772
  }, f: function f() {
7813
7773
  try {
7814
- if (!normalCompletion && it.return != null)
7815
- it.return();
7774
+ if (!normalCompletion && it.return != null) it.return();
7816
7775
  } finally {
7817
- if (didErr)
7818
- throw err;
7776
+ if (didErr) throw err;
7819
7777
  }
7820
7778
  } };
7821
7779
  }
@@ -7826,21 +7784,15 @@ function _nonIterableRest$2() {
7826
7784
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
7827
7785
  }
7828
7786
  function _unsupportedIterableToArray$2(o, minLen) {
7829
- if (!o)
7830
- return;
7831
- if (typeof o === "string")
7832
- return _arrayLikeToArray$2(o, minLen);
7787
+ if (!o) return;
7788
+ if (typeof o === "string") return _arrayLikeToArray$2(o, minLen);
7833
7789
  var n = Object.prototype.toString.call(o).slice(8, -1);
7834
- if (n === "Object" && o.constructor)
7835
- n = o.constructor.name;
7836
- if (n === "Map" || n === "Set")
7837
- return Array.from(o);
7838
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
7839
- return _arrayLikeToArray$2(o, minLen);
7790
+ if (n === "Object" && o.constructor) n = o.constructor.name;
7791
+ if (n === "Map" || n === "Set") return Array.from(o);
7792
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$2(o, minLen);
7840
7793
  }
7841
7794
  function _arrayLikeToArray$2(arr, len) {
7842
- if (len == null || len > arr.length)
7843
- len = arr.length;
7795
+ if (len == null || len > arr.length) len = arr.length;
7844
7796
  for (var i = 0, arr2 = new Array(len); i < len; i++) {
7845
7797
  arr2[i] = arr[i];
7846
7798
  }
@@ -7848,8 +7800,7 @@ function _arrayLikeToArray$2(arr, len) {
7848
7800
  }
7849
7801
  function _iterableToArrayLimit$2(arr, i) {
7850
7802
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
7851
- if (_i == null)
7852
- return;
7803
+ if (_i == null) return;
7853
7804
  var _arr = [];
7854
7805
  var _n = true;
7855
7806
  var _d = false;
@@ -7857,26 +7808,22 @@ function _iterableToArrayLimit$2(arr, i) {
7857
7808
  try {
7858
7809
  for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
7859
7810
  _arr.push(_s.value);
7860
- if (i && _arr.length === i)
7861
- break;
7811
+ if (i && _arr.length === i) break;
7862
7812
  }
7863
7813
  } catch (err) {
7864
7814
  _d = true;
7865
7815
  _e = err;
7866
7816
  } finally {
7867
7817
  try {
7868
- if (!_n && _i["return"] != null)
7869
- _i["return"]();
7818
+ if (!_n && _i["return"] != null) _i["return"]();
7870
7819
  } finally {
7871
- if (_d)
7872
- throw _e;
7820
+ if (_d) throw _e;
7873
7821
  }
7874
7822
  }
7875
7823
  return _arr;
7876
7824
  }
7877
7825
  function _arrayWithHoles$2(arr) {
7878
- if (Array.isArray(arr))
7879
- return arr;
7826
+ if (Array.isArray(arr)) return arr;
7880
7827
  }
7881
7828
  var roles$1 = [].concat(_ariaAbstractRoles.default, _ariaLiteralRoles.default, _ariaDpubRoles.default, _ariaGraphicsRoles.default);
7882
7829
  roles$1.forEach(function(_ref) {
@@ -7968,27 +7915,21 @@ var lite = {};
7968
7915
  var has4 = Object.prototype.hasOwnProperty;
7969
7916
  function dequal(foo, bar) {
7970
7917
  var ctor, len;
7971
- if (foo === bar)
7972
- return true;
7918
+ if (foo === bar) return true;
7973
7919
  if (foo && bar && (ctor = foo.constructor) === bar.constructor) {
7974
- if (ctor === Date)
7975
- return foo.getTime() === bar.getTime();
7976
- if (ctor === RegExp)
7977
- return foo.toString() === bar.toString();
7920
+ if (ctor === Date) return foo.getTime() === bar.getTime();
7921
+ if (ctor === RegExp) return foo.toString() === bar.toString();
7978
7922
  if (ctor === Array) {
7979
7923
  if ((len = foo.length) === bar.length) {
7980
- while (len-- && dequal(foo[len], bar[len]))
7981
- ;
7924
+ while (len-- && dequal(foo[len], bar[len])) ;
7982
7925
  }
7983
7926
  return len === -1;
7984
7927
  }
7985
7928
  if (!ctor || typeof foo === "object") {
7986
7929
  len = 0;
7987
7930
  for (ctor in foo) {
7988
- if (has4.call(foo, ctor) && ++len && !has4.call(bar, ctor))
7989
- return false;
7990
- if (!(ctor in bar) || !dequal(foo[ctor], bar[ctor]))
7991
- return false;
7931
+ if (has4.call(foo, ctor) && ++len && !has4.call(bar, ctor)) return false;
7932
+ if (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;
7992
7933
  }
7993
7934
  return Object.keys(bar).length === len;
7994
7935
  }
@@ -8014,8 +7955,7 @@ function _nonIterableRest$1() {
8014
7955
  }
8015
7956
  function _iterableToArrayLimit$1(arr, i) {
8016
7957
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
8017
- if (_i == null)
8018
- return;
7958
+ if (_i == null) return;
8019
7959
  var _arr = [];
8020
7960
  var _n = true;
8021
7961
  var _d = false;
@@ -8023,39 +7963,33 @@ function _iterableToArrayLimit$1(arr, i) {
8023
7963
  try {
8024
7964
  for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
8025
7965
  _arr.push(_s.value);
8026
- if (i && _arr.length === i)
8027
- break;
7966
+ if (i && _arr.length === i) break;
8028
7967
  }
8029
7968
  } catch (err) {
8030
7969
  _d = true;
8031
7970
  _e = err;
8032
7971
  } finally {
8033
7972
  try {
8034
- if (!_n && _i["return"] != null)
8035
- _i["return"]();
7973
+ if (!_n && _i["return"] != null) _i["return"]();
8036
7974
  } finally {
8037
- if (_d)
8038
- throw _e;
7975
+ if (_d) throw _e;
8039
7976
  }
8040
7977
  }
8041
7978
  return _arr;
8042
7979
  }
8043
7980
  function _arrayWithHoles$1(arr) {
8044
- if (Array.isArray(arr))
8045
- return arr;
7981
+ if (Array.isArray(arr)) return arr;
8046
7982
  }
8047
7983
  function _createForOfIteratorHelper$1(o, allowArrayLike) {
8048
7984
  var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
8049
7985
  if (!it) {
8050
7986
  if (Array.isArray(o) || (it = _unsupportedIterableToArray$1(o)) || allowArrayLike) {
8051
- if (it)
8052
- o = it;
7987
+ if (it) o = it;
8053
7988
  var i = 0;
8054
7989
  var F = function F2() {
8055
7990
  };
8056
7991
  return { s: F, n: function n() {
8057
- if (i >= o.length)
8058
- return { done: true };
7992
+ if (i >= o.length) return { done: true };
8059
7993
  return { done: false, value: o[i++] };
8060
7994
  }, e: function e(_e2) {
8061
7995
  throw _e2;
@@ -8075,30 +8009,22 @@ function _createForOfIteratorHelper$1(o, allowArrayLike) {
8075
8009
  err = _e3;
8076
8010
  }, f: function f() {
8077
8011
  try {
8078
- if (!normalCompletion && it.return != null)
8079
- it.return();
8012
+ if (!normalCompletion && it.return != null) it.return();
8080
8013
  } finally {
8081
- if (didErr)
8082
- throw err;
8014
+ if (didErr) throw err;
8083
8015
  }
8084
8016
  } };
8085
8017
  }
8086
8018
  function _unsupportedIterableToArray$1(o, minLen) {
8087
- if (!o)
8088
- return;
8089
- if (typeof o === "string")
8090
- return _arrayLikeToArray$1(o, minLen);
8019
+ if (!o) return;
8020
+ if (typeof o === "string") return _arrayLikeToArray$1(o, minLen);
8091
8021
  var n = Object.prototype.toString.call(o).slice(8, -1);
8092
- if (n === "Object" && o.constructor)
8093
- n = o.constructor.name;
8094
- if (n === "Map" || n === "Set")
8095
- return Array.from(o);
8096
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
8097
- return _arrayLikeToArray$1(o, minLen);
8022
+ if (n === "Object" && o.constructor) n = o.constructor.name;
8023
+ if (n === "Map" || n === "Set") return Array.from(o);
8024
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen);
8098
8025
  }
8099
8026
  function _arrayLikeToArray$1(arr, len) {
8100
- if (len == null || len > arr.length)
8101
- len = arr.length;
8027
+ if (len == null || len > arr.length) len = arr.length;
8102
8028
  for (var i = 0, arr2 = new Array(len); i < len; i++) {
8103
8029
  arr2[i] = arr[i];
8104
8030
  }
@@ -8203,8 +8129,7 @@ function _nonIterableRest() {
8203
8129
  }
8204
8130
  function _iterableToArrayLimit(arr, i) {
8205
8131
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
8206
- if (_i == null)
8207
- return;
8132
+ if (_i == null) return;
8208
8133
  var _arr = [];
8209
8134
  var _n = true;
8210
8135
  var _d = false;
@@ -8212,39 +8137,33 @@ function _iterableToArrayLimit(arr, i) {
8212
8137
  try {
8213
8138
  for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
8214
8139
  _arr.push(_s.value);
8215
- if (i && _arr.length === i)
8216
- break;
8140
+ if (i && _arr.length === i) break;
8217
8141
  }
8218
8142
  } catch (err) {
8219
8143
  _d = true;
8220
8144
  _e = err;
8221
8145
  } finally {
8222
8146
  try {
8223
- if (!_n && _i["return"] != null)
8224
- _i["return"]();
8147
+ if (!_n && _i["return"] != null) _i["return"]();
8225
8148
  } finally {
8226
- if (_d)
8227
- throw _e;
8149
+ if (_d) throw _e;
8228
8150
  }
8229
8151
  }
8230
8152
  return _arr;
8231
8153
  }
8232
8154
  function _arrayWithHoles(arr) {
8233
- if (Array.isArray(arr))
8234
- return arr;
8155
+ if (Array.isArray(arr)) return arr;
8235
8156
  }
8236
8157
  function _createForOfIteratorHelper(o, allowArrayLike) {
8237
8158
  var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
8238
8159
  if (!it) {
8239
8160
  if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike) {
8240
- if (it)
8241
- o = it;
8161
+ if (it) o = it;
8242
8162
  var i = 0;
8243
8163
  var F = function F2() {
8244
8164
  };
8245
8165
  return { s: F, n: function n() {
8246
- if (i >= o.length)
8247
- return { done: true };
8166
+ if (i >= o.length) return { done: true };
8248
8167
  return { done: false, value: o[i++] };
8249
8168
  }, e: function e(_e2) {
8250
8169
  throw _e2;
@@ -8264,30 +8183,22 @@ function _createForOfIteratorHelper(o, allowArrayLike) {
8264
8183
  err = _e3;
8265
8184
  }, f: function f() {
8266
8185
  try {
8267
- if (!normalCompletion && it.return != null)
8268
- it.return();
8186
+ if (!normalCompletion && it.return != null) it.return();
8269
8187
  } finally {
8270
- if (didErr)
8271
- throw err;
8188
+ if (didErr) throw err;
8272
8189
  }
8273
8190
  } };
8274
8191
  }
8275
8192
  function _unsupportedIterableToArray(o, minLen) {
8276
- if (!o)
8277
- return;
8278
- if (typeof o === "string")
8279
- return _arrayLikeToArray(o, minLen);
8193
+ if (!o) return;
8194
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
8280
8195
  var n = Object.prototype.toString.call(o).slice(8, -1);
8281
- if (n === "Object" && o.constructor)
8282
- n = o.constructor.name;
8283
- if (n === "Map" || n === "Set")
8284
- return Array.from(o);
8285
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
8286
- return _arrayLikeToArray(o, minLen);
8196
+ if (n === "Object" && o.constructor) n = o.constructor.name;
8197
+ if (n === "Map" || n === "Set") return Array.from(o);
8198
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
8287
8199
  }
8288
8200
  function _arrayLikeToArray(arr, len) {
8289
- if (len == null || len > arr.length)
8290
- len = arr.length;
8201
+ if (len == null || len > arr.length) len = arr.length;
8291
8202
  for (var i = 0, arr2 = new Array(len); i < len; i++) {
8292
8203
  arr2[i] = arr[i];
8293
8204
  }
@@ -8383,8 +8294,7 @@ var ansiStyles$1 = { exports: {} };
8383
8294
  var colorName;
8384
8295
  var hasRequiredColorName;
8385
8296
  function requireColorName() {
8386
- if (hasRequiredColorName)
8387
- return colorName;
8297
+ if (hasRequiredColorName) return colorName;
8388
8298
  hasRequiredColorName = 1;
8389
8299
  colorName = {
8390
8300
  "aliceblue": [240, 248, 255],
@@ -8541,8 +8451,7 @@ function requireColorName() {
8541
8451
  var conversions;
8542
8452
  var hasRequiredConversions;
8543
8453
  function requireConversions() {
8544
- if (hasRequiredConversions)
8545
- return conversions;
8454
+ if (hasRequiredConversions) return conversions;
8546
8455
  hasRequiredConversions = 1;
8547
8456
  const cssKeywords = requireColorName();
8548
8457
  const reverseKeywords = {};
@@ -9214,8 +9123,7 @@ function requireConversions() {
9214
9123
  var route;
9215
9124
  var hasRequiredRoute;
9216
9125
  function requireRoute() {
9217
- if (hasRequiredRoute)
9218
- return route;
9126
+ if (hasRequiredRoute) return route;
9219
9127
  hasRequiredRoute = 1;
9220
9128
  const conversions2 = requireConversions();
9221
9129
  function buildGraph() {
@@ -9286,8 +9194,7 @@ function requireRoute() {
9286
9194
  var colorConvert;
9287
9195
  var hasRequiredColorConvert;
9288
9196
  function requireColorConvert() {
9289
- if (hasRequiredColorConvert)
9290
- return colorConvert;
9197
+ if (hasRequiredColorConvert) return colorConvert;
9291
9198
  hasRequiredColorConvert = 1;
9292
9199
  const conversions2 = requireConversions();
9293
9200
  const route2 = requireRoute();
@@ -9524,8 +9431,7 @@ var util = {
9524
9431
  var templates;
9525
9432
  var hasRequiredTemplates;
9526
9433
  function requireTemplates() {
9527
- if (hasRequiredTemplates)
9528
- return templates;
9434
+ if (hasRequiredTemplates) return templates;
9529
9435
  hasRequiredTemplates = 1;
9530
9436
  const TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
9531
9437
  const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
@@ -10228,7 +10134,7 @@ function equalArrays$2(array, other, bitmask, customizer, equalFunc, stack) {
10228
10134
  if (arrStacked && othStacked) {
10229
10135
  return arrStacked == other && othStacked == array;
10230
10136
  }
10231
- var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG$1 ? new SetCache() : void 0;
10137
+ var index = -1, result = true, seen2 = bitmask & COMPARE_UNORDERED_FLAG$1 ? new SetCache() : void 0;
10232
10138
  stack.set(array, other);
10233
10139
  stack.set(other, array);
10234
10140
  while (++index < arrLength) {
@@ -10243,10 +10149,10 @@ function equalArrays$2(array, other, bitmask, customizer, equalFunc, stack) {
10243
10149
  result = false;
10244
10150
  break;
10245
10151
  }
10246
- if (seen) {
10152
+ if (seen2) {
10247
10153
  if (!arraySome(other, function(othValue2, othIndex) {
10248
- if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
10249
- return seen.push(othIndex);
10154
+ if (!cacheHas(seen2, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
10155
+ return seen2.push(othIndex);
10250
10156
  }
10251
10157
  })) {
10252
10158
  result = false;
@@ -11361,8 +11267,7 @@ function getExpectedClassNamesAndOptions(params) {
11361
11267
  return { expectedClassNames, options };
11362
11268
  }
11363
11269
  function splitClassNames(str) {
11364
- if (!str)
11365
- return [];
11270
+ if (!str) return [];
11366
11271
  return str.split(/\s+/).filter((s) => s.length > 0);
11367
11272
  }
11368
11273
  function isSubset$1(subset, superset) {
@@ -11436,9 +11341,9 @@ function toHaveClass(htmlElement, ...params) {
11436
11341
  ].join("\n")
11437
11342
  };
11438
11343
  }
11439
- function getStyleDeclaration(document, css) {
11344
+ function getStyleDeclaration(document2, css) {
11440
11345
  const styles2 = {};
11441
- const copy = document.createElement("div");
11346
+ const copy = document2.createElement("div");
11442
11347
  Object.keys(css).forEach((property) => {
11443
11348
  copy.style[property] = css[property];
11444
11349
  styles2[property] = copy.style[property];
@@ -11449,8 +11354,7 @@ function isSubset(styles2, computedStyle) {
11449
11354
  return !!Object.keys(styles2).length && Object.entries(styles2).every(([prop, value]) => {
11450
11355
  const isCustomProperty = prop.startsWith("--");
11451
11356
  const spellingVariants = [prop];
11452
- if (!isCustomProperty)
11453
- spellingVariants.push(prop.toLowerCase());
11357
+ if (!isCustomProperty) spellingVariants.push(prop.toLowerCase());
11454
11358
  return spellingVariants.some(
11455
11359
  (name) => computedStyle[name] === value || computedStyle.getPropertyValue(name) === value
11456
11360
  );
@@ -11887,8 +11791,7 @@ function toBeChecked(element) {
11887
11791
  };
11888
11792
  }
11889
11793
  const isChecked = () => {
11890
- if (isValidInput())
11891
- return element.checked;
11794
+ if (isValidInput()) return element.checked;
11892
11795
  return element.getAttribute("aria-checked") === "true";
11893
11796
  };
11894
11797
  return {
@@ -11970,8 +11873,8 @@ function toHaveDescription(htmlElement, checkWith) {
11970
11873
  const descriptionIDs = descriptionIDRaw.split(/\s+/).filter(Boolean);
11971
11874
  let description = "";
11972
11875
  if (descriptionIDs.length > 0) {
11973
- const document = htmlElement.ownerDocument;
11974
- const descriptionEls = descriptionIDs.map((descriptionID) => document.getElementById(descriptionID)).filter(Boolean);
11876
+ const document2 = htmlElement.ownerDocument;
11877
+ const descriptionEls = descriptionIDs.map((descriptionID) => document2.getElementById(descriptionID)).filter(Boolean);
11975
11878
  description = normalize(descriptionEls.map((el) => el.textContent).join(" "));
11976
11879
  }
11977
11880
  return {
@@ -12017,8 +11920,8 @@ function toHaveErrorMessage(htmlElement, checkWith) {
12017
11920
  const errormessageIDs = errormessageIDRaw.split(/\s+/).filter(Boolean);
12018
11921
  let errormessage = "";
12019
11922
  if (errormessageIDs.length > 0) {
12020
- const document = htmlElement.ownerDocument;
12021
- const errormessageEls = errormessageIDs.map((errormessageID) => document.getElementById(errormessageID)).filter(Boolean);
11923
+ const document2 = htmlElement.ownerDocument;
11924
+ const errormessageEls = errormessageIDs.map((errormessageID) => document2.getElementById(errormessageID)).filter(Boolean);
12022
11925
  errormessage = normalize(
12023
11926
  errormessageEls.map((el) => el.textContent).join(" ")
12024
11927
  );
@@ -12118,9 +12021,7 @@ async function prepareTestEnvironment(files) {
12118
12021
  return {
12119
12022
  runner,
12120
12023
  config,
12121
- state,
12122
- setupCommonEnv,
12123
- startTests
12024
+ state
12124
12025
  };
12125
12026
  }
12126
12027
  function done(files) {
@@ -12130,7 +12031,7 @@ function done(files) {
12130
12031
  id: getBrowserState().iframeId
12131
12032
  });
12132
12033
  }
12133
- async function runTests(files) {
12034
+ async function executeTests(method, files) {
12134
12035
  await client.waitForConnection();
12135
12036
  debug("client is connected to ws server");
12136
12037
  let preparedData;
@@ -12147,13 +12048,17 @@ async function runTests(files) {
12147
12048
  return;
12148
12049
  }
12149
12050
  debug("runner resolved successfully");
12150
- const { config, runner, state, setupCommonEnv: setupCommonEnv2, startTests: startTests2 } = preparedData;
12051
+ const { config, runner, state } = preparedData;
12151
12052
  state.durations.prepare = performance.now() - state.durations.prepare;
12152
12053
  debug("prepare time", state.durations.prepare, "ms");
12153
12054
  try {
12154
- await setupCommonEnv2(config);
12055
+ await setupCommonEnv(config);
12155
12056
  for (const file of files) {
12156
- await startTests2([file], runner);
12057
+ if (method === "run") {
12058
+ await startTests([file], runner);
12059
+ } else {
12060
+ await collectTests([file], runner);
12061
+ }
12157
12062
  }
12158
12063
  } finally {
12159
12064
  state.environmentTeardownRun = true;
@@ -12161,4 +12066,5 @@ async function runTests(files) {
12161
12066
  done(files);
12162
12067
  }
12163
12068
  }
12164
- window.__vitest_browser_runner__.runTests = runTests;
12069
+ window.__vitest_browser_runner__.runTests = (files) => executeTests("run", files);
12070
+ window.__vitest_browser_runner__.collectTests = (files) => executeTests("collect", files);