@flemist/simple-utils 2.1.3 → 2.1.4

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,44 +1,44 @@
1
- import { T as mt, Q as pt, E as yt } from "../urlGet-BCW9jvAm.mjs";
2
- import { L as de, V as he, W as me, O as pe, R as ye, _ as we, $ as ge, U as xe, K as Ee, G as Se, a2 as be, J as ke, H as Oe, M as Pe, q as je, Y as Ce, l as Ae, o as Le, A as De, B as Fe, C as Te, D as Ie, y as _e, z as Re, P as We, u as Ne, v as $e, w as Me, I as Be, p as ze, d as Je, g as Ue, Z as He, a1 as Ge, aq as ve, as as Ke, a5 as Ve, a3 as Ye, aP as qe, a4 as Qe, a8 as Xe, au as Ze, ax as tn, am as en, al as nn, a9 as rn, aI as sn, ag as an, aH as on, ae as cn, aG as ln, aj as un, ad as fn, aJ as dn, ab as hn, aa as mn, a7 as pn, aM as yn, ao as wn, an as gn, ac as xn, af as En, aA as Sn, aB as bn, aC as kn, aE as On, ay as Pn, aF as jn, ah as Cn, aD as An, az as Ln, aw as Dn, at as Fn, ap as Tn, ar as In, aK as _n, aL as Rn, a6 as Wn, ai as Nn, av as $n, ak as Mn, aN as Bn, aO as zn, b as Jn, m as Un, c as Hn, n as Gn, f as vn, k as Kn, r as Vn, h as Yn, e as qn, i as Qn, j as Xn, F as Zn, a as tr, s as er, S as nr, t as rr, x as sr, aV as ar, aX as or, aW as ir, aQ as cr, aU as lr, aR as ur, aT as fr, aS as dr, a0 as hr, N as mr, X as pr } from "../urlGet-BCW9jvAm.mjs";
3
- import { Locker as wt, useAbortController as gt, combineAbortSignals as st, delay as at } from "@flemist/async-utils";
4
- import { Pool as xt, poolRunWait as N } from "@flemist/time-limits";
5
- import Et from "node:os";
6
- import * as T from "path";
1
+ import { V as mt, S as pt, F as yt } from "../urlGet-DZEwtNXt.mjs";
2
+ import { ac as he, M as de, W as me, X as pe, P as ye, aj as we, a2 as be, a3 as ge, b5 as xe, b6 as Ee, b7 as Se, b8 as ke, b9 as Oe, ba as je, bb as Ce, bk as Pe, bc as Ae, bd as Le, be as Te, bf as Me, bg as De, bh as Fe, bi as Ie, bj as Re, R as _e, $ as Ne, a0 as We, U as $e, L as Be, H as ze, a6 as Je, ad as Ue, ae as ve, K as He, I as Ge, N as Ke, q as Ve, aa as Ye, a9 as qe, a8 as Xe, Z as Qe, l as Ze, o as tr, B as er, C as rr, D as nr, E as sr, z as ar, A as or, a5 as ir, ag as cr, af as lr, Q as ur, u as fr, v as hr, w as dr, J as mr, p as pr, x as yr, d as wr, g as br, a4 as gr, _ as xr, ab as Er, aH as Sr, aJ as kr, am as Or, ak as jr, b4 as Cr, al as Pr, ap as Ar, aL as Lr, aO as Tr, aD as Mr, aC as Dr, aq as Fr, aZ as Ir, ax as Rr, aY as _r, av as Nr, aX as Wr, aA as $r, au as Br, a_ as zr, as as Jr, ar as Ur, ao as vr, b1 as Hr, aF as Gr, aE as Kr, at as Vr, aw as Yr, aR as qr, aS as Xr, aT as Qr, aV as Zr, aP as tn, aW as en, ay as rn, aU as nn, aQ as sn, aN as an, aK as on, aG as cn, aI as ln, a$ as un, b0 as fn, an as hn, ah as dn, ai as mn, az as pn, aM as yn, aB as wn, b2 as bn, b3 as gn, b as xn, m as En, c as Sn, n as kn, f as On, k as jn, r as Cn, h as Pn, e as An, i as Ln, j as Tn, G as Mn, a as Dn, s as Fn, T as In, t as Rn, y as _n, bq as Nn, bs as Wn, br as $n, bl as Bn, bp as zn, bm as Jn, bo as Un, bn as vn, a7 as Hn, a1 as Gn, O as Kn, Y as Vn } from "../urlGet-DZEwtNXt.mjs";
3
+ import { Locker as wt, useAbortController as bt, combineAbortSignals as st, delay as at } from "@flemist/async-utils";
4
+ import { Pool as gt, poolRunWait as N } from "@flemist/time-limits";
5
+ import xt from "node:os";
6
+ import * as D from "path";
7
7
  import ot from "path";
8
8
  import { priorityCreate as z } from "@flemist/priority-queue";
9
- import * as I from "fs";
10
- import St from "picomatch";
11
- import { spawn as H } from "child_process";
12
- import { AbortControllerFast as bt } from "@flemist/abort-controller-fast";
13
- const Z = new xt(Et.cpus().length);
14
- function $(t) {
9
+ import * as F from "fs";
10
+ import Et from "picomatch";
11
+ import { spawn as v } from "child_process";
12
+ import { AbortControllerFast as St } from "@flemist/abort-controller-fast";
13
+ const Z = new gt(xt.cpus().length);
14
+ function W(t) {
15
15
  return t.replace(/\\/g, "/");
16
16
  }
17
17
  let U = null;
18
18
  function kt(t) {
19
19
  U == null && (U = /* @__PURE__ */ new Map());
20
- const e = $(t);
21
- let r = U.get(e);
22
- return r == null && (r = new wt(), U.set(e, r)), r;
20
+ const e = W(t);
21
+ let n = U.get(e);
22
+ return n == null && (n = new wt(), U.set(e, n)), n;
23
23
  }
24
- function Xt(t) {
25
- const { filePath: e, func: r } = t;
24
+ function Qt(t) {
25
+ const { filePath: e, func: n } = t;
26
26
  return kt(e).lock(
27
27
  () => N({
28
28
  pool: Z,
29
29
  count: 1,
30
- func: r
30
+ func: n
31
31
  })
32
32
  );
33
33
  }
34
34
  function Ot(t) {
35
35
  return t.match(/^[/\\]?[^/\\]+/)[0];
36
36
  }
37
- function Pt(t, e) {
37
+ function jt(t, e) {
38
38
  return Ot(t) + "|" + e.ino;
39
39
  }
40
- function jt(t) {
41
- return t.endsWith(":") && (t += "/"), T.resolve(t);
40
+ function Ct(t) {
41
+ return t.endsWith(":") && (t += "/"), D.resolve(t);
42
42
  }
43
43
  function et(t, e) {
44
44
  t.totalSize += e.totalSize, t.maxFileDateModified = Math.max(
@@ -46,7 +46,7 @@ function et(t, e) {
46
46
  e.maxFileDateModified
47
47
  ), t.countFiles += e.countFiles, t.countDirs += e.countDirs, t.countLinks += e.countLinks;
48
48
  }
49
- const Ct = function(e) {
49
+ const Pt = function(e) {
50
50
  return e.code === "ENOENT";
51
51
  };
52
52
  function it(t) {
@@ -59,36 +59,36 @@ function it(t) {
59
59
  countDirs: 0,
60
60
  countLinks: 0
61
61
  });
62
- const r = t.level ?? 0, s = t.walkedIds ?? /* @__PURE__ */ new Set(), n = t.abortSignal, a = t.pool ?? Z, o = t.handleError, i = t.priority ?? z(0), u = t.walkLinks ?? !1, c = t.log, E = t.handlePath, f = t.matchPath;
63
- async function y(d) {
64
- if (!(o && await o(d)) && !Ct(d))
65
- throw d;
62
+ const n = t.level ?? 0, s = t.walkedIds ?? /* @__PURE__ */ new Set(), r = t.abortSignal, a = t.pool ?? Z, o = t.handleError, i = t.priority ?? z(0), u = t.walkLinks ?? !1, c = t.log, x = t.handlePath, f = t.matchPath;
63
+ async function y(h) {
64
+ if (!(o && await o(h)) && !Pt(h))
65
+ throw h;
66
66
  }
67
- function P(d) {
68
- return !(!c || c.minTotalContentSize != null && d < c.minTotalContentSize || c.maxNestedLevel != null && r > c.maxNestedLevel);
67
+ function j(h) {
68
+ return !(!c || c.minTotalContentSize != null && h < c.minTotalContentSize || c.maxNestedLevel != null && n > c.maxNestedLevel);
69
69
  }
70
- return gt(async (d) => {
71
- const w = st(n, d), m = {
70
+ return bt(async (h) => {
71
+ const w = st(r, h), m = {
72
72
  totalSize: 0,
73
73
  maxFileDateModified: 0,
74
74
  countFiles: 0,
75
75
  countDirs: 0,
76
76
  countLinks: 0
77
77
  };
78
- function D(x, O) {
79
- if (P(O.totalSize)) {
80
- const g = `${O.totalSize.toLocaleString("en-US").replace(/,/g, " ").padStart(19)}: ${x}`;
81
- c?.handleLog ? c.handleLog(g) : console.log(g);
78
+ function T(g, O) {
79
+ if (j(O.totalSize)) {
80
+ const b = `${O.totalSize.toLocaleString("en-US").replace(/,/g, " ").padStart(19)}: ${g}`;
81
+ c?.handleLog ? c.handleLog(b) : console.log(b);
82
82
  }
83
83
  }
84
- async function l(x, O, p, g) {
85
- return E ? await N({
84
+ async function l(g, O, p, b) {
85
+ return x ? await N({
86
86
  pool: a,
87
87
  func: async () => {
88
88
  try {
89
- return await E({
90
- level: r,
91
- path: x,
89
+ return await x({
90
+ level: n,
91
+ path: g,
92
92
  stat: O,
93
93
  itemStat: p,
94
94
  totalStat: m,
@@ -99,26 +99,26 @@ function it(t) {
99
99
  }
100
100
  },
101
101
  count: 1,
102
- priority: g,
102
+ priority: b,
103
103
  abortSignal: w
104
104
  }) : !0;
105
105
  }
106
- async function S(x, O, p, g) {
107
- g || (g = x);
106
+ async function E(g, O, p, b) {
107
+ b || (b = g);
108
108
  const k = await N({
109
109
  pool: a,
110
- func: () => I.promises.lstat(x).catch(y),
110
+ func: () => F.promises.lstat(g).catch(y),
111
111
  count: 1,
112
112
  priority: z(O, z(1, i)),
113
113
  abortSignal: w
114
114
  });
115
115
  if (!k || !p && k.isFile())
116
116
  return null;
117
- const C = Pt(x, k);
118
- if (s.has(C))
117
+ const P = jt(g, k);
118
+ if (s.has(P))
119
119
  return null;
120
- s.add(C);
121
- let h = {
120
+ s.add(P);
121
+ let d = {
122
122
  totalSize: k.size,
123
123
  maxFileDateModified: k.isDirectory() ? 0 : k.mtimeMs,
124
124
  countFiles: 0,
@@ -131,63 +131,63 @@ function it(t) {
131
131
  );
132
132
  if (k.isSymbolicLink()) {
133
133
  if (u) {
134
- const j = await N({
134
+ const C = await N({
135
135
  pool: a,
136
- func: () => I.promises.readlink(x).catch(y).then((F) => F ?? null),
136
+ func: () => F.promises.readlink(g).catch(y).then((M) => M ?? null),
137
137
  count: 1,
138
138
  priority: A,
139
139
  abortSignal: w
140
140
  });
141
- if (j) {
142
- const F = T.isAbsolute(j) ? j : T.resolve(T.dirname(g), j), _ = await S(
143
- F,
141
+ if (C) {
142
+ const M = D.isAbsolute(C) ? C : D.resolve(D.dirname(b), C), I = await E(
143
+ M,
144
144
  O,
145
145
  p,
146
- g
146
+ b
147
147
  );
148
- _ && (h = _);
148
+ I && (d = I);
149
149
  }
150
150
  }
151
- return (p || h.countFiles + h.countDirs + h.countLinks >= 1) && (h.countLinks += 1, await l(
152
- g,
151
+ return (p || d.countFiles + d.countDirs + d.countLinks >= 1) && (d.countLinks += 1, await l(
152
+ b,
153
153
  k,
154
- h,
154
+ d,
155
155
  A
156
- ) && (et(m, h), D(g, h))), h;
156
+ ) && (et(m, d), T(b, d))), d;
157
157
  } else if (k.isDirectory()) {
158
- const j = await N({
158
+ const C = await N({
159
159
  pool: a,
160
- func: () => I.promises.readdir(x).catch(y),
160
+ func: () => F.promises.readdir(g).catch(y),
161
161
  count: 1,
162
162
  priority: i,
163
163
  abortSignal: w
164
164
  });
165
- if (j) {
166
- for (let F = 0, _ = j.length; F < _; F++)
167
- j[F] = T.join(g, j[F]);
168
- h = await it({
165
+ if (C) {
166
+ for (let M = 0, I = C.length; M < I; M++)
167
+ C[M] = D.join(b, C[M]);
168
+ d = await it({
169
169
  ...t,
170
- paths: j,
170
+ paths: C,
171
171
  abortSignal: w,
172
172
  priority: A,
173
- level: r + 1,
173
+ level: n + 1,
174
174
  walkedIds: s
175
175
  });
176
176
  }
177
177
  }
178
- return (p || h.countFiles + h.countDirs + h.countLinks >= 1) && (k.isDirectory() ? h.countDirs += 1 : k.isFile() && (h.countFiles += 1), await l(
179
- g,
178
+ return (p || d.countFiles + d.countDirs + d.countLinks >= 1) && (k.isDirectory() ? d.countDirs += 1 : k.isFile() && (d.countFiles += 1), await l(
179
+ b,
180
180
  k,
181
- h,
181
+ d,
182
182
  A
183
- ) && (et(m, h), D(g, h))), h;
183
+ ) && (et(m, d), T(b, d))), d;
184
184
  }
185
- const b = [];
186
- for (let x = 0, O = e.length; x < O; x++) {
187
- const p = jt(e[x]), g = f ? f(p) : !0;
188
- g !== !1 && b.push(S(p, x, g));
185
+ const S = [];
186
+ for (let g = 0, O = e.length; g < O; g++) {
187
+ const p = Ct(e[g]), b = f ? f(p) : !0;
188
+ b !== !1 && S.push(E(p, g, b));
189
189
  }
190
- return await Promise.all(b), m;
190
+ return await Promise.all(S), m;
191
191
  });
192
192
  }
193
193
  function Zt(t) {
@@ -196,33 +196,33 @@ function Zt(t) {
196
196
  function te({
197
197
  globs: t,
198
198
  rootDir: e,
199
- noCase: r
199
+ noCase: n
200
200
  }) {
201
201
  const s = [];
202
- return t.forEach((n) => {
203
- n = $(n).trim();
204
- const a = n.startsWith("^");
205
- a && (n = n.substring(1).trim());
206
- const o = n.startsWith("!");
207
- if (o && (n = n.substring(1).trim()), n.startsWith("!") || n.startsWith("^"))
202
+ return t.forEach((r) => {
203
+ r = W(r).trim();
204
+ const a = r.startsWith("^");
205
+ a && (r = r.substring(1).trim());
206
+ const o = r.startsWith("!");
207
+ if (o && (r = r.substring(1).trim()), r.startsWith("!") || r.startsWith("^"))
208
208
  throw new Error(
209
- `Invalid glob pattern: "${n}". The syntax '${n.substring(0, 2)}' is not supported. Valid glob patterns use: * (match any characters), ** (match any directories), ? (match single character), [abc] (character class), ! (negate pattern), ^ (exclude if included). Examples of valid patterns: "*.js", "src/**/*.ts", "!node_modules", "^dist". Avoid starting with '!' after '^' or multiple special prefixes.`
209
+ `Invalid glob pattern: "${r}". The syntax '${r.substring(0, 2)}' is not supported. Valid glob patterns use: * (match any characters), ** (match any directories), ? (match single character), [abc] (character class), ! (negate pattern), ^ (exclude if included). Examples of valid patterns: "*.js", "src/**/*.ts", "!node_modules", "^dist". Avoid starting with '!' after '^' or multiple special prefixes.`
210
210
  );
211
- n.startsWith("/") && (n = "." + n);
212
- const i = $(e ? T.resolve(e, n) : n);
211
+ r.startsWith("/") && (r = "." + r);
212
+ const i = W(e ? D.resolve(e, r) : r);
213
213
  if (!i)
214
214
  return;
215
215
  let u;
216
216
  try {
217
- u = St(i, {
218
- nocase: r ?? !1,
217
+ u = Et(i, {
218
+ nocase: n ?? !1,
219
219
  dot: !0,
220
220
  strictBrackets: !0
221
221
  // Validate bracket balance for patterns like "["
222
222
  });
223
223
  } catch (c) {
224
224
  throw new Error(
225
- `Invalid glob pattern: "${n}". ${c instanceof Error ? c.message : "Unknown error"}. Valid glob patterns use: * (match any characters), ** (match any directories), ? (match single character), [abc] (character class with balanced brackets), ! (negate pattern), ^ (exclude if included). Examples: "*.js", "src/**/*.ts", "!node_modules", "[abc]def.txt". Ensure all brackets [ ] are properly closed and balanced.`
225
+ `Invalid glob pattern: "${r}". ${c instanceof Error ? c.message : "Unknown error"}. Valid glob patterns use: * (match any characters), ** (match any directories), ? (match single character), [abc] (character class with balanced brackets), ! (negate pattern), ^ (exclude if included). Examples: "*.js", "src/**/*.ts", "!node_modules", "[abc]def.txt". Ensure all brackets [ ] are properly closed and balanced.`
226
226
  );
227
227
  }
228
228
  s.push({
@@ -232,11 +232,11 @@ function te({
232
232
  match: u
233
233
  });
234
234
  }), function(a) {
235
- a = $(a);
235
+ a = W(a);
236
236
  let o = null, i = !1;
237
237
  for (let u = 0, c = s.length; u < c; u++) {
238
- const E = s[u];
239
- E.match(a) && (E.exclude ? i = !E.negative : (o = !E.negative, i = !1));
238
+ const x = s[u];
239
+ x.match(a) && (x.exclude ? i = !x.negative : (o = !x.negative, i = !1));
240
240
  }
241
241
  return i ? !1 : o;
242
242
  };
@@ -248,76 +248,76 @@ function At(t) {
248
248
  function Lt(t, e) {
249
249
  if (!e || e === ".")
250
250
  return t;
251
- const r = t.startsWith("^");
252
- r && (t = t.substring(1));
251
+ const n = t.startsWith("^");
252
+ n && (t = t.substring(1));
253
253
  const s = t.startsWith("!");
254
- return s && (t = t.substring(1)), t.startsWith("/") ? (e.endsWith("/") && (e = e.substring(0, e.length - 1)), t = e + t) : (e.endsWith("/") || (e += "/"), t.startsWith("./") ? t = e + t.substring(2) : t.startsWith("../") ? t = e + t : (e.startsWith("..") && (e = ""), t.startsWith("**") ? t = e + t : t = e + "**/" + t)), t = $(T.normalize(t)), s && (t = "!" + t), r && (t = "^" + t), t;
254
+ return s && (t = t.substring(1)), t.startsWith("/") ? (e.endsWith("/") && (e = e.substring(0, e.length - 1)), t = e + t) : (e.endsWith("/") || (e += "/"), t.startsWith("./") ? t = e + t.substring(2) : t.startsWith("../") ? t = e + t : (e.startsWith("..") && (e = ""), t.startsWith("**") ? t = e + t : t = e + "**/" + t)), t = W(D.normalize(t)), s && (t = "!" + t), n && (t = "^" + t), t;
255
255
  }
256
- function nt(t) {
256
+ function rt(t) {
257
257
  return "^" + t;
258
258
  }
259
- async function Dt(t) {
260
- const r = (await I.promises.readFile(t, "utf-8")).split(`
259
+ async function Tt(t) {
260
+ const n = (await F.promises.readFile(t, "utf-8")).split(`
261
261
  `), s = [];
262
- return r.forEach((n) => {
263
- n = n.trim(), !(!n || n.startsWith("#")) && s.push(n);
262
+ return n.forEach((r) => {
263
+ r = r.trim(), !(!r || r.startsWith("#")) && s.push(r);
264
264
  }), s;
265
265
  }
266
266
  async function ee(t) {
267
- const e = t.rootDir ?? ".", r = [];
267
+ const e = t.rootDir ?? ".", n = [];
268
268
  if (!t.globs?.length)
269
- return r;
269
+ return n;
270
270
  const s = [];
271
- return t.globs.forEach((n) => {
272
- n.value && (n.valueType === "file-contains-patterns" ? s.push(n) : n.valueType === "pattern" && r.push(n.exclude ? nt(n.value) : n.value));
271
+ return t.globs.forEach((r) => {
272
+ r.value && (r.valueType === "file-contains-patterns" ? s.push(r) : r.valueType === "pattern" && n.push(r.exclude ? rt(r.value) : r.value));
273
273
  }), s.length && await Promise.all(
274
- s.map(async (n) => {
274
+ s.map(async (r) => {
275
275
  await N({
276
276
  pool: Z,
277
277
  count: 1,
278
278
  func: async () => {
279
- const a = T.resolve(e, n.value), o = await Dt(a), i = T.relative(e, T.dirname(a));
279
+ const a = D.resolve(e, r.value), o = await Tt(a), i = D.relative(e, D.dirname(a));
280
280
  o.forEach((u) => {
281
- u = At(u), u = Lt(u, i), r.push(n.exclude ? nt(u) : u);
281
+ u = At(u), u = Lt(u, i), n.push(r.exclude ? rt(u) : u);
282
282
  });
283
283
  }
284
284
  });
285
285
  })
286
- ), r;
286
+ ), n;
287
287
  }
288
- function Ft(t, e = {}) {
289
- return new Promise((r, s) => {
290
- const n = H(t, {
288
+ function Mt(t, e = {}) {
289
+ return new Promise((n, s) => {
290
+ const r = v(t, {
291
291
  shell: !0,
292
292
  ...e
293
293
  }), a = [];
294
- n.stdout.on("data", (o) => {
294
+ r.stdout.on("data", (o) => {
295
295
  a.push(o);
296
- }), n.on("error", (o) => {
296
+ }), r.on("error", (o) => {
297
297
  s(o);
298
- }), n.on("exit", (o) => {
298
+ }), r.on("exit", (o) => {
299
299
  const i = Buffer.concat(a).toString("utf8");
300
300
  if (o !== 0) {
301
301
  s(new Error(`[exec][exit] code: ${o}`));
302
302
  return;
303
303
  }
304
- r(i);
304
+ n(i);
305
305
  });
306
306
  });
307
307
  }
308
- async function ne() {
308
+ async function re() {
309
309
  let t;
310
310
  switch (process.platform) {
311
311
  case "darwin":
312
- t = H("afplay", ["/System/Library/Sounds/Ping.aiff"], {
312
+ t = v("afplay", ["/System/Library/Sounds/Ping.aiff"], {
313
313
  stdio: "ignore"
314
314
  });
315
315
  break;
316
316
  case "linux":
317
- t = H("beep", [], { stdio: "ignore", shell: !0 });
317
+ t = v("beep", [], { stdio: "ignore", shell: !0 });
318
318
  break;
319
319
  case "win32":
320
- t = H("powershell", ["-c", "[console]::beep(1000,300)"], {
320
+ t = v("powershell", ["-c", "[console]::beep(1000,300)"], {
321
321
  stdio: "ignore"
322
322
  });
323
323
  break;
@@ -326,34 +326,34 @@ async function ne() {
326
326
  `[nodeBeep] Beep not supported on platform: ${process.platform}`
327
327
  );
328
328
  }
329
- await new Promise((e, r) => {
330
- t.on("error", r), t.on("close", (s) => {
331
- s !== 0 ? r(new Error(`[nodeBeep] Beep process exited with code ${s}`)) : e();
329
+ await new Promise((e, n) => {
330
+ t.on("error", n), t.on("close", (s) => {
331
+ s !== 0 ? n(new Error(`[nodeBeep] Beep process exited with code ${s}`)) : e();
332
332
  });
333
333
  });
334
334
  }
335
- async function Tt({
335
+ async function Dt({
336
336
  page: t,
337
337
  urlFilters: e,
338
- timeouts: r
338
+ timeouts: n
339
339
  }) {
340
- return r || (r = {}), r.downloadInternal || (r.downloadInternal = 10 * 1e3), r.downloadExternal || (r.downloadExternal = 60 * 1e3), r.total || (r.total = 300 * 1e3), await mt(
340
+ return n || (n = {}), n.downloadInternal || (n.downloadInternal = 10 * 1e3), n.downloadExternal || (n.downloadExternal = 60 * 1e3), n.total || (n.total = 300 * 1e3), await mt(
341
341
  () => t.evaluate(
342
342
  ({
343
- urlFilters: n,
343
+ urlFilters: r,
344
344
  timeouts: a
345
345
  }) => {
346
346
  function o(c) {
347
347
  return function(f) {
348
348
  let y = !1;
349
- for (let P = 0, d = c.length; P < d; P++) {
350
- const w = c[P];
349
+ for (let j = 0, h = c.length; j < h; j++) {
350
+ const w = c[j];
351
351
  w.pattern.test(f) && (y = w.value);
352
352
  }
353
353
  return y;
354
354
  };
355
355
  }
356
- const i = n && o(n);
356
+ const i = r && o(r);
357
357
  let u = performance.getEntries && performance.getEntries();
358
358
  return u || (u = []), u.push({
359
359
  name: location.href
@@ -369,18 +369,18 @@ async function Tt({
369
369
  }) : null;
370
370
  if (navigator.userAgent.indexOf("Chrome") === -1)
371
371
  return null;
372
- const E = typeof AbortController < "u" ? new AbortController() : null, f = new URL(c.name).origin === location.origin, y = f ? a.downloadInternal : a.downloadExternal;
373
- let P;
374
- const d = new Promise((l, S) => {
375
- P = S;
372
+ const x = typeof AbortController < "u" ? new AbortController() : null, f = new URL(c.name).origin === location.origin, y = f ? a.downloadInternal : a.downloadExternal;
373
+ let j;
374
+ const h = new Promise((l, E) => {
375
+ j = E;
376
376
  }), w = y && setTimeout(() => {
377
- E?.abort(), P(
377
+ x?.abort(), j(
378
378
  new Error("[test][getPageHttpErrors] fetch timeout")
379
379
  );
380
380
  }, y);
381
381
  let m = fetch(c.name, {
382
382
  mode: f ? "same-origin" : "no-cors",
383
- signal: E?.signal,
383
+ signal: x?.signal,
384
384
  cache: f ? "force-cache" : void 0,
385
385
  method: "HEAD"
386
386
  }).then((l) => l.ok ? null : {
@@ -390,56 +390,56 @@ async function Tt({
390
390
  url: c.name,
391
391
  error: l.message
392
392
  }));
393
- E || (m = Promise.race([m, d]));
394
- function D() {
393
+ x || (m = Promise.race([m, h]));
394
+ function T() {
395
395
  w && clearTimeout(w);
396
396
  }
397
397
  return m.then(
398
- (l) => (D(), l),
398
+ (l) => (T(), l),
399
399
  (l) => {
400
- throw D(), l;
400
+ throw T(), l;
401
401
  }
402
402
  );
403
403
  }
404
404
  )
405
405
  ).then((c) => {
406
- const E = c.filter((f) => f).map(
406
+ const x = c.filter((f) => f).map(
407
407
  (f) => ({
408
408
  url: new URL(f.url),
409
409
  error: f.error
410
410
  })
411
411
  );
412
- return E.length > 0 ? E : null;
412
+ return x.length > 0 ? x : null;
413
413
  });
414
414
  },
415
415
  {
416
416
  urlFilters: e,
417
- timeouts: r
417
+ timeouts: n
418
418
  }
419
419
  ),
420
- { timeout: r.total }
420
+ { timeout: n.total }
421
421
  );
422
422
  }
423
- async function It({
423
+ async function Ft({
424
424
  page: t,
425
425
  urlFilters: e,
426
- errorFilter: r
426
+ errorFilter: n
427
427
  }) {
428
- let s = await Tt({
428
+ let s = await Dt({
429
429
  page: t,
430
430
  urlFilters: e
431
431
  });
432
- if (s && (r && (s = s.filter(r)), s.length > 0))
432
+ if (s && (n && (s = s.filter(n)), s.length > 0))
433
433
  throw new Error(
434
434
  `[test][checkPageHttpErrors] Page has http errors: ${JSON.stringify(s, null, 2)}`
435
435
  );
436
436
  }
437
- async function _t({
437
+ async function It({
438
438
  page: t,
439
439
  filter: e,
440
- onError: r
440
+ onError: n
441
441
  }) {
442
- const s = "callback_191b355ea6f64499a6607ad571da5d4d", n = t.context().browser()?.browserType().name(), a = pt();
442
+ const s = "callback_191b355ea6f64499a6607ad571da5d4d", r = t.context().browser()?.browserType().name(), a = pt();
443
443
  function o(i) {
444
444
  try {
445
445
  if (e && !e({
@@ -452,10 +452,10 @@ async function _t({
452
452
  }
453
453
  try {
454
454
  console.error(
455
- `[test][subscribeJsErrors] BROWSER JS ERROR (${n}): ${i}`
455
+ `[test][subscribeJsErrors] BROWSER JS ERROR (${r}): ${i}`
456
456
  );
457
457
  const u = new Error(i);
458
- u.stack = a, r(u);
458
+ u.stack = a, n(u);
459
459
  } catch (u) {
460
460
  console.error("[test][subscribeJsErrors] error", u);
461
461
  }
@@ -472,13 +472,13 @@ async function _t({
472
472
  const y = /* @__PURE__ */ new Set();
473
473
  return JSON.stringify(
474
474
  f,
475
- (P, d) => {
476
- if (typeof d == "object" && d != null) {
477
- if (y.has(d))
475
+ (j, h) => {
476
+ if (typeof h == "object" && h != null) {
477
+ if (y.has(h))
478
478
  return "[Circular]";
479
- y.add(d);
479
+ y.add(h);
480
480
  }
481
- return d;
481
+ return h;
482
482
  },
483
483
  2
484
484
  );
@@ -488,14 +488,14 @@ async function _t({
488
488
  function c(f) {
489
489
  window[i](f);
490
490
  }
491
- const E = {
491
+ const x = {
492
492
  warn: console.warn.bind(console),
493
493
  error: console.error.bind(console)
494
494
  };
495
495
  console.warn = function(...y) {
496
- return c("console.warn: " + u(y)), E.warn.apply(this, y);
496
+ return c("console.warn: " + u(y)), x.warn.apply(this, y);
497
497
  }, console.error = function(...y) {
498
- return c("console.error: " + u(y)), E.error.apply(this, y);
498
+ return c("console.error: " + u(y)), x.error.apply(this, y);
499
499
  }, window.addEventListener(
500
500
  "error",
501
501
  function(f) {
@@ -513,7 +513,7 @@ async function _t({
513
513
  }
514
514
  async function Rt() {
515
515
  try {
516
- process.platform === "win32" && await Ft(
516
+ process.platform === "win32" && await Mt(
517
517
  `wmic process where "commandline like '%ms-playwright%' and not commandline like '%wmic.exe%' and priority != 4" CALL setpriority "idle"`
518
518
  );
519
519
  } catch (t) {
@@ -523,59 +523,59 @@ async function Rt() {
523
523
  console.warn("[test][setPlaywrightPriorityLow] error: " + e);
524
524
  }
525
525
  }
526
- let G = null, q = null;
527
- function re(t) {
526
+ let H = null, q = null;
527
+ function ne(t) {
528
528
  q = t;
529
529
  }
530
- function Wt() {
531
- if (G)
530
+ function _t() {
531
+ if (H)
532
532
  return;
533
533
  const t = q || (process.env.DELAY_ON_ERROR ? parseInt(process.env.DELAY_ON_ERROR, 10) : 0);
534
534
  if (q)
535
- return console.log(`[test][delayOnError] Delay on error: ${t} ms`), G = at(t), G;
535
+ return console.log(`[test][delayOnError] Delay on error: ${t} ms`), H = at(t), H;
536
536
  }
537
537
  function se() {
538
- return G;
538
+ return H;
539
539
  }
540
540
  async function Nt(t) {
541
- const { page: e } = t, r = e.context().browser()?.browserType().name(), s = new bt(), n = st(
541
+ const { page: e } = t, n = e.context().browser()?.browserType().name(), s = new St(), r = st(
542
542
  s.signal,
543
543
  t.abortSignal
544
544
  ), a = (i) => {
545
- let u = `Error in (${r}) ${e.url()}
545
+ let u = `Error in (${n}) ${e.url()}
546
546
  `;
547
547
  t.pageFilePath && (u += ` at _ (${ot.resolve(t.pageFilePath)}:0:0)
548
548
  `), i.stack = u + (i.stack || i.message), i.message = u + i.message, console.error("[test][initPage] error", i), s.abort(i);
549
549
  };
550
- return await _t({
550
+ return await It({
551
551
  page: e,
552
552
  filter: t.filters?.js?.filter,
553
553
  onError: a
554
554
  }), {
555
- abortSignal: n,
555
+ abortSignal: r,
556
556
  checkErrors: async () => {
557
- await It({
557
+ await Ft({
558
558
  page: e,
559
559
  urlFilters: t.filters?.http?.urlFilters,
560
560
  errorFilter: t.filters?.http?.errorFilter
561
- }), n.throwIfAborted();
561
+ }), r.throwIfAborted();
562
562
  }
563
563
  };
564
564
  }
565
565
  async function ae({
566
566
  page: t,
567
567
  abortSignal: e,
568
- filters: r,
568
+ filters: n,
569
569
  func: s,
570
- pageFilePath: n
570
+ pageFilePath: r
571
571
  }) {
572
572
  const a = t.context().browser()?.browserType().name();
573
573
  try {
574
574
  const { abortSignal: o, checkErrors: i } = await Nt({
575
575
  page: t,
576
576
  abortSignal: e,
577
- filters: r,
578
- pageFilePath: n
577
+ filters: n,
578
+ pageFilePath: r
579
579
  });
580
580
  await s({
581
581
  page: t,
@@ -585,7 +585,7 @@ async function ae({
585
585
  } catch (o) {
586
586
  let i = `Error in (${a}) ${t.url()}
587
587
  `;
588
- throw n && (i += ` at _ (${ot.resolve(n)}:0:0)
588
+ throw r && (i += ` at _ (${ot.resolve(r)}:0:0)
589
589
  `), o.stack = i + (o.stack || o.message), o.message = i + o.message, o;
590
590
  }
591
591
  }
@@ -594,11 +594,11 @@ function oe({
594
594
  options: e
595
595
  }) {
596
596
  return async function(s) {
597
- const n = await t.launch(e ?? void 0);
597
+ const r = await t.launch(e ?? void 0);
598
598
  try {
599
- return await s(n);
599
+ return await s(r);
600
600
  } finally {
601
- await n.close();
601
+ await r.close();
602
602
  }
603
603
  };
604
604
  }
@@ -607,70 +607,70 @@ function ie({
607
607
  options: e
608
608
  }) {
609
609
  return async function(s) {
610
- const n = await t.newContext(e ?? void 0);
610
+ const r = await t.newContext(e ?? void 0);
611
611
  await Rt();
612
612
  try {
613
- const a = await s(n);
614
- return await n.close(), a;
613
+ const a = await s(r);
614
+ return await r.close(), a;
615
615
  } catch (a) {
616
- const o = Wt?.();
617
- throw o ? (console.error("[test][useBrowserContext] error", a), o.finally(() => n.close())) : await n.close(), a;
616
+ const o = _t?.();
617
+ throw o ? (console.error("[test][useBrowserContext] error", a), o.finally(() => r.close())) : await r.close(), a;
618
618
  }
619
619
  };
620
620
  }
621
621
  async function Y(t, e) {
622
- const r = T.dirname(t);
623
- await I.promises.stat(r).catch(() => null) || await I.promises.mkdir(r, { recursive: !0 }), await I.promises.writeFile(t, JSON.stringify(e, null, 4), {
622
+ const n = D.dirname(t);
623
+ await F.promises.stat(n).catch(() => null) || await F.promises.mkdir(n, { recursive: !0 }), await F.promises.writeFile(t, JSON.stringify(e, null, 4), {
624
624
  encoding: "utf-8"
625
625
  });
626
626
  }
627
- async function $t(t) {
628
- if (!await I.promises.stat(t).catch(() => null))
627
+ async function Wt(t) {
628
+ if (!await F.promises.stat(t).catch(() => null))
629
629
  return null;
630
- const e = await I.promises.readFile(t, { encoding: "utf-8" });
630
+ const e = await F.promises.readFile(t, { encoding: "utf-8" });
631
631
  return JSON.parse(e);
632
632
  }
633
- const Q = "-", X = "+";
634
- function v(t, e, r) {
633
+ const X = "-", Q = "+";
634
+ function G(t, e, n) {
635
635
  if (t === e)
636
636
  return null;
637
637
  if (Array.isArray(t)) {
638
638
  if (Array.isArray(e)) {
639
- let n = null;
639
+ let r = null;
640
640
  for (let a = 0, o = Math.max(e.length, e.length); a < o; a++) {
641
- const i = v(t[a], e[a], r);
642
- i != null && (n || (n = []), n.push(i));
641
+ const i = G(t[a], e[a], n);
642
+ i != null && (r || (r = []), r.push(i));
643
643
  }
644
- return n != null && r && (n = r(t, e, n)), n;
644
+ return r != null && n && (r = n(t, e, r)), r;
645
645
  }
646
646
  } else if (t instanceof Object && e instanceof Object) {
647
- let n = null;
647
+ let r = null;
648
648
  for (const a in t)
649
649
  if (Object.prototype.hasOwnProperty.call(t, a)) {
650
- const o = v(t[a], e[a], r);
651
- o != null && (n || (n = {}), n[a] = o);
650
+ const o = G(t[a], e[a], n);
651
+ o != null && (r || (r = {}), r[a] = o);
652
652
  }
653
653
  for (const a in e)
654
654
  if (Object.prototype.hasOwnProperty.call(e, a) && !Object.prototype.hasOwnProperty.call(t, a)) {
655
- const o = v(t[a], e[a], r);
656
- o != null && (n || (n = {}), n[a] = o);
655
+ const o = G(t[a], e[a], n);
656
+ o != null && (r || (r = {}), r[a] = o);
657
657
  }
658
- return n != null && r && (n = r(t, e, n)), n;
658
+ return r != null && n && (r = n(t, e, r)), r;
659
659
  }
660
660
  let s = {
661
- [Q]: t,
662
- [X]: e
661
+ [X]: t,
662
+ [Q]: e
663
663
  };
664
- return r && (s = r(t, e, s)), s;
664
+ return n && (s = n(t, e, s)), s;
665
665
  }
666
- function rt(t) {
666
+ function nt(t) {
667
667
  function e(l) {
668
- return l.sort((S, b) => S[0] > b[0] ? 1 : -1).reduce((S, b) => (S[b[0]] = b[1], S), {});
668
+ return l.sort((E, S) => E[0] > S[0] ? 1 : -1).reduce((E, S) => (E[S[0]] = S[1], E), {});
669
669
  }
670
- function r(l) {
671
- return l.reduce((S, b) => (S[b] = !0, S), {});
670
+ function n(l) {
671
+ return l.reduce((E, S) => (E[S] = !0, E), {});
672
672
  }
673
- const s = t.filters && t.filters.excludeAttrs && r(t.filters.excludeAttrs), n = t.filters && t.filters.fixAttrs, a = t.filters && t.filters.fixStyles, o = t.filters && t.filters.excludeStyles && r(t.filters.excludeStyles), i = t.filters && t.filters.fixTags, u = t.filters && t.filters.excludeClasses, c = t.filters && t.filters.excludeIds, E = t.filters && t.filters.excludeSelectorClasses, f = t.filters && t.filters.excludeSelectorIds;
673
+ const s = t.filters && t.filters.excludeAttrs && n(t.filters.excludeAttrs), r = t.filters && t.filters.fixAttrs, a = t.filters && t.filters.fixStyles, o = t.filters && t.filters.excludeStyles && n(t.filters.excludeStyles), i = t.filters && t.filters.fixTags, u = t.filters && t.filters.excludeClasses, c = t.filters && t.filters.excludeIds, x = t.filters && t.filters.excludeSelectorClasses, f = t.filters && t.filters.excludeSelectorIds;
674
674
  let y;
675
675
  if (t.filters && t.filters.excludeSelectors && t.filters.excludeSelectors.length > 0) {
676
676
  const l = Array.from(
@@ -678,111 +678,111 @@ function rt(t) {
678
678
  );
679
679
  l.length > 0 && (y = new Set(l));
680
680
  }
681
- function P(l, S, b, x) {
682
- const O = getComputedStyle(l, S), p = [];
683
- for (let g = 0, k = O.length; g < k; g++) {
684
- const C = O[g];
685
- if (o && o[C])
681
+ function j(l, E, S, g) {
682
+ const O = getComputedStyle(l, E), p = [];
683
+ for (let b = 0, k = O.length; b < k; b++) {
684
+ const P = O[b];
685
+ if (o && o[P])
686
686
  continue;
687
- let h = O[C];
688
- if (h && a)
689
- for (let A = 0, j = a.length; A < j; A++)
690
- a[A].name.test(C) && (h = h.replace(a[A].search, a[A].replace));
691
- (!b || b[C] !== h) && (!x || x[C] === h) && p.push([C, h]);
687
+ let d = O[P];
688
+ if (d && a)
689
+ for (let A = 0, C = a.length; A < C; A++)
690
+ a[A].name.test(P) && (d = d.replace(a[A].search, a[A].replace));
691
+ (!S || S[P] !== d) && (!g || g[P] === d) && p.push([P, d]);
692
692
  }
693
693
  return e(p);
694
694
  }
695
- function d(l, S, b) {
695
+ function h(l, E, S) {
696
696
  return {
697
- _: P(
697
+ _: j(
698
698
  l,
699
699
  void 0,
700
- S && S._,
701
- b && b._
700
+ E && E._,
701
+ S && S._
702
702
  ),
703
- before: P(
703
+ before: j(
704
704
  l,
705
705
  "before",
706
- S && S.before,
707
- b && b.before
706
+ E && E.before,
707
+ S && S.before
708
708
  ),
709
- after: P(
709
+ after: j(
710
710
  l,
711
711
  "after",
712
- S && S.after,
713
- b && b.after
712
+ E && E.after,
713
+ S && S.after
714
714
  )
715
715
  };
716
716
  }
717
- function w(l, S, b, x, O) {
718
- for (let p = 0, g = l.childNodes.length; p < g; p++) {
717
+ function w(l, E, S, g, O) {
718
+ for (let p = 0, b = l.childNodes.length; p < b; p++) {
719
719
  const k = l.childNodes[p];
720
720
  if (!k)
721
721
  throw new Error(
722
- `child is null; index=${p}; ${x}, ${l.className}\r
722
+ `child is null; index=${p}; ${g}, ${l.className}\r
723
723
  You should wait js executions before test`
724
724
  );
725
725
  k instanceof Element && m(
726
726
  k,
727
+ E,
727
728
  S,
728
- b,
729
- x,
729
+ g,
730
730
  O
731
731
  );
732
732
  }
733
733
  }
734
- function m(l, S, b, x, O) {
735
- const p = O && O[S.length];
734
+ function m(l, E, S, g, O) {
735
+ const p = O && O[E.length];
736
736
  if (O && !p || y && y.has(l))
737
737
  return;
738
- let g = l.tagName && l.tagName.toLowerCase();
739
- if (g === "head" && (b = !1), i)
740
- for (let L = 0, M = i.length; L < M; L++)
741
- g = g.replace(i[L].search, i[L].replace);
742
- if (p && p.tag !== g)
738
+ let b = l.tagName && l.tagName.toLowerCase();
739
+ if (b === "head" && (S = !1), i)
740
+ for (let L = 0, $ = i.length; L < $; L++)
741
+ b = b.replace(i[L].search, i[L].replace);
742
+ if (p && p.tag !== b)
743
743
  return;
744
744
  const k = [];
745
- for (let L = 0, M = l.attributes.length; L < M; L++) {
745
+ for (let L = 0, $ = l.attributes.length; L < $; L++) {
746
746
  const R = l.attributes.item(L);
747
- let W = R.name, J = R.value;
748
- if (W = W.toLowerCase(), W !== "class" && !(s && s[W])) {
749
- if (n)
750
- for (let B = 0, ht = n.length; B < ht; B++)
751
- n[B].name.test(W) && (J = J.replace(n[B].search, n[B].replace));
752
- (!p || p.attrs && p.attrs[W] === J) && k.push([W, J]);
747
+ let _ = R.name, J = R.value;
748
+ if (_ = _.toLowerCase(), _ !== "class" && !(s && s[_])) {
749
+ if (r)
750
+ for (let B = 0, dt = r.length; B < dt; B++)
751
+ r[B].name.test(_) && (J = J.replace(r[B].search, r[B].replace));
752
+ (!p || p.attrs && p.attrs[_] === J) && k.push([_, J]);
753
753
  }
754
754
  }
755
- const C = [], h = [];
756
- for (let L = 0, M = l.classList.length; L < M; L++) {
755
+ const P = [], d = [];
756
+ for (let L = 0, $ = l.classList.length; L < $; L++) {
757
757
  const R = l.classList.item(L);
758
- (!u || !u.test(R)) && C.push(R), (!E || !E.test(R)) && h.push(R);
758
+ (!u || !u.test(R)) && P.push(R), (!x || !x.test(R)) && d.push(R);
759
759
  }
760
- const A = b ? d(l, t.defaultStyle, p && p.style) : null, j = l.childElementCount ? [] : null;
760
+ const A = S ? h(l, t.defaultStyle, p && p.style) : null, C = l.childElementCount ? [] : null;
761
761
  l.id && (!c || !c.test(l.id)) && l.id;
762
- const F = l.id && (!f || !f.test(l.id)) ? l.id : "", _ = (g || "") + (F ? "#" + F : "") + (h.length > 0 ? "." + h.join(".") : ""), tt = _ ? x ? x + " > " + _ : _ : x, dt = {
763
- tag: g,
762
+ const M = l.id && (!f || !f.test(l.id)) ? l.id : "", I = (b || "") + (M ? "#" + M : "") + (d.length > 0 ? "." + d.join(".") : ""), tt = I ? g ? g + " > " + I : I : g, ht = {
763
+ tag: b,
764
764
  selector: tt,
765
- classes: C,
765
+ classes: P,
766
766
  attrs: k.length > 0 ? e(k) : null,
767
767
  style: A,
768
- childs: j
768
+ childs: C
769
769
  };
770
- S.push(dt), j && w(
770
+ E.push(ht), C && w(
771
771
  l,
772
- j,
773
- b,
772
+ C,
773
+ S,
774
774
  tt,
775
775
  p && p.childs
776
776
  );
777
777
  }
778
- const D = [];
778
+ const T = [];
779
779
  return m(
780
780
  document.documentElement,
781
- D,
781
+ T,
782
782
  !0,
783
783
  "",
784
784
  t.shouldEqualResult && [t.shouldEqualResult]
785
- ), D[0];
785
+ ), T[0];
786
786
  }
787
787
  async function ct(t) {
788
788
  const e = await t.context().newCDPSession(t);
@@ -792,42 +792,42 @@ async function lt(t) {
792
792
  await t.send("CSS.disable"), await t.send("DOM.disable"), await t.detach();
793
793
  }
794
794
  async function ce(t, e) {
795
- const r = await ct(t);
795
+ const n = await ct(t);
796
796
  try {
797
- return await e(r);
797
+ return await e(n);
798
798
  } finally {
799
- await lt(r);
799
+ await lt(n);
800
800
  }
801
801
  }
802
- async function Mt(t, e) {
803
- const { nodes: r } = await t.send("DOM.getFlattenedDocument", {
802
+ async function $t(t, e) {
803
+ const { nodes: n } = await t.send("DOM.getFlattenedDocument", {
804
804
  depth: -1,
805
805
  pierce: !0
806
- }), s = r.filter((n) => n.nodeType === 1).map((n) => n.nodeId);
807
- for (const n of s)
806
+ }), s = n.filter((r) => r.nodeType === 1).map((r) => r.nodeId);
807
+ for (const r of s)
808
808
  await t.send("CSS.forcePseudoState", {
809
- nodeId: n,
809
+ nodeId: r,
810
810
  forcedPseudoClasses: e
811
811
  });
812
812
  }
813
813
  function K(t, e) {
814
814
  if (!t || !e)
815
815
  return e || null;
816
- let r = null;
816
+ let n = null;
817
817
  for (const s in e)
818
- Object.prototype.hasOwnProperty.call(e, s) && e[s] !== t[s] && (r || (r = {}), r[s] = e[s]);
818
+ Object.prototype.hasOwnProperty.call(e, s) && e[s] !== t[s] && (n || (n = {}), n[s] = e[s]);
819
819
  for (const s in t)
820
- Object.prototype.hasOwnProperty.call(t, s) && !Object.prototype.hasOwnProperty.call(e, s) && (r || (r = {}), r[s] = "");
821
- return r;
820
+ Object.prototype.hasOwnProperty.call(t, s) && !Object.prototype.hasOwnProperty.call(e, s) && (n || (n = {}), n[s] = "");
821
+ return n;
822
822
  }
823
823
  function Bt(t, e) {
824
824
  if (!t || !e)
825
825
  return e || null;
826
- const r = K(t._, e._), s = K(t.before, e.before), n = K(t.after, e.after);
827
- return !r && !s && !n ? null : {
828
- _: r || {},
826
+ const n = K(t._, e._), s = K(t.before, e.before), r = K(t.after, e.after);
827
+ return !n && !s && !r ? null : {
828
+ _: n || {},
829
829
  before: s || {},
830
- after: n || {}
830
+ after: r || {}
831
831
  };
832
832
  }
833
833
  function zt(t, e) {
@@ -835,13 +835,13 @@ function zt(t, e) {
835
835
  return e || null;
836
836
  if (t.length !== e.length)
837
837
  return e;
838
- for (let r = 0, s = t.length; r < s; r++)
839
- if (t[r] !== e[r])
838
+ for (let n = 0, s = t.length; n < s; n++)
839
+ if (t[n] !== e[n])
840
840
  return e;
841
841
  return null;
842
842
  }
843
843
  function ut(t, e) {
844
- const r = zt(t.classes, e.classes), s = K(t.attrs, e.attrs), n = Bt(t.style, e.style);
844
+ const n = zt(t.classes, e.classes), s = K(t.attrs, e.attrs), r = Bt(t.style, e.style);
845
845
  let a = null;
846
846
  if (t.childs && e.childs) {
847
847
  const o = Math.min(t.childs.length, e.childs.length);
@@ -857,57 +857,57 @@ function ut(t, e) {
857
857
  }
858
858
  }
859
859
  }
860
- return !r && !s && !n && !a ? null : {
860
+ return !n && !s && !r && !a ? null : {
861
861
  tag: e.tag,
862
862
  selector: e.selector,
863
- classes: r,
863
+ classes: n,
864
864
  attrs: s,
865
- style: n,
865
+ style: r,
866
866
  childs: a
867
867
  };
868
868
  }
869
- const V = (t, e, r, s) => {
870
- const n = s(t, e, r, s);
871
- if (n == null)
872
- return n;
873
- if (Array.isArray(n))
874
- return n.map(
869
+ const V = (t, e, n, s) => {
870
+ const r = s(t, e, n, s);
871
+ if (r == null)
872
+ return r;
873
+ if (Array.isArray(r))
874
+ return r.map(
875
875
  (a, o, i) => V(a, o, i, s)
876
876
  );
877
- if (typeof n == "object") {
877
+ if (typeof r == "object") {
878
878
  const a = {};
879
- for (const o in n)
880
- Object.prototype.hasOwnProperty.call(n, o) && (a[o] = V(n[o], o, n, s));
879
+ for (const o in r)
880
+ Object.prototype.hasOwnProperty.call(r, o) && (a[o] = V(r[o], o, r, s));
881
881
  return a;
882
882
  }
883
- return n;
883
+ return r;
884
884
  };
885
885
  function ft(t, e) {
886
886
  if (t.attrs && e.excludeAttrs) {
887
- for (let r = 0, s = e.excludeAttrs.length; r < s; r++)
888
- delete t.attrs[e.excludeAttrs[r]];
887
+ for (let n = 0, s = e.excludeAttrs.length; n < s; n++)
888
+ delete t.attrs[e.excludeAttrs[n]];
889
889
  Object.keys(t.attrs).length === 0 && (t.attrs = null);
890
890
  }
891
891
  if (t.classes && e.excludeClasses && (t.classes = t.classes.filter(
892
- (r) => !e.excludeClasses.test(r)
892
+ (n) => !e.excludeClasses.test(n)
893
893
  )), t.style && e.excludeStyles)
894
- for (const r of ["_", "before", "after"]) {
895
- const s = t.style[r];
894
+ for (const n of ["_", "before", "after"]) {
895
+ const s = t.style[n];
896
896
  if (s)
897
- for (let n = 0, a = e.excludeStyles.length; n < a; n++)
898
- delete s[e.excludeStyles[n]];
897
+ for (let r = 0, a = e.excludeStyles.length; r < a; r++)
898
+ delete s[e.excludeStyles[r]];
899
899
  }
900
900
  if (t.childs)
901
- for (let r = 0, s = t.childs.length; r < s; r++)
902
- ft(t.childs[r], e);
901
+ for (let n = 0, s = t.childs.length; n < s; n++)
902
+ ft(t.childs[n], e);
903
903
  }
904
904
  function Jt(t, e) {
905
- for (const r in t) {
906
- if (!Object.prototype.hasOwnProperty.call(t, r)) continue;
907
- const s = t[r];
908
- for (const n in s) {
909
- if (!Object.prototype.hasOwnProperty.call(s, n)) continue;
910
- const a = s[n];
905
+ for (const n in t) {
906
+ if (!Object.prototype.hasOwnProperty.call(t, n)) continue;
907
+ const s = t[n];
908
+ for (const r in s) {
909
+ if (!Object.prototype.hasOwnProperty.call(s, r)) continue;
910
+ const a = s[r];
911
911
  for (const o in a)
912
912
  Object.prototype.hasOwnProperty.call(a, o) && ft(a[o], e);
913
913
  }
@@ -916,83 +916,83 @@ function Jt(t, e) {
916
916
  function le({
917
917
  actualResultFile: t,
918
918
  expectedResultFile: e,
919
- diffResultFile: r,
919
+ diffResultFile: n,
920
920
  filters: s,
921
- transform: n,
921
+ transform: r,
922
922
  pseudoStates: a
923
923
  }) {
924
924
  let o, i, u, c = {};
925
925
  return {
926
- async init(E) {
927
- o = await $t(e), n && (o = V(o, null, null, n)), o && s && Jt(o, s), await E.goto("about:blank"), i = await E.evaluate(rt, { filters: s }), u = i.style;
926
+ async init(x) {
927
+ o = await Wt(e), r && (o = V(o, null, null, r)), o && s && Jt(o, s), await x.goto("about:blank"), i = await x.evaluate(nt, { filters: s }), u = i.style;
928
928
  },
929
929
  async handlePage({
930
- page: E,
930
+ page: x,
931
931
  testId: f,
932
932
  url: y,
933
- stateId: P,
934
- _filters: d
933
+ stateId: j,
934
+ _filters: h
935
935
  }) {
936
936
  let w = c[f];
937
937
  w || (w = {}, c[f] = w);
938
938
  let m = w[y.href];
939
- m || (m = {}, w[y.href] = m), await E.addStyleTag({
939
+ m || (m = {}, w[y.href] = m), await x.addStyleTag({
940
940
  content: "*, *::before, *::after { animation-name: none!important; transition-duration: 0s !important; }"
941
941
  });
942
- const D = a ?? [{ states: [] }];
943
- let l = null, S;
942
+ const T = a ?? [{ states: [] }];
943
+ let l = null, E;
944
944
  try {
945
- for (let b = 0; b < D.length; b++) {
946
- const x = D[b], O = x.states.length > 0 ? P + ":" + x.states.join(":") : P;
945
+ for (let S = 0; S < T.length; S++) {
946
+ const g = T[S], O = g.states.length > 0 ? j + ":" + g.states.join(":") : j;
947
947
  let p = null;
948
- if (x.states.length > 0) {
949
- l || (l = await ct(E));
950
- const h = performance.now();
951
- await Mt(l, x.states), p = performance.now() - h;
948
+ if (g.states.length > 0) {
949
+ l || (l = await ct(x));
950
+ const d = performance.now();
951
+ await $t(l, g.states), p = performance.now() - d;
952
952
  }
953
- x.delay && await at(x.delay);
954
- const g = performance.now(), k = await E.evaluate(rt, {
955
- filters: d || s,
953
+ g.delay && await at(g.delay);
954
+ const b = performance.now(), k = await x.evaluate(nt, {
955
+ filters: h || s,
956
956
  defaultStyle: u,
957
957
  shouldEqualResult: m[O]
958
- }), C = performance.now() - g;
958
+ }), P = performance.now() - b;
959
959
  if (console.log(
960
- `SNAPSHOT ${O}:` + (p != null ? ` forcePseudoClasses ${p.toFixed(0)}ms,` : "") + ` getAllElements ${C.toFixed(0)}ms`
961
- ), !S)
962
- S = k, m[O] = k;
960
+ `SNAPSHOT ${O}:` + (p != null ? ` forcePseudoClasses ${p.toFixed(0)}ms,` : "") + ` getAllElements ${P.toFixed(0)}ms`
961
+ ), !E)
962
+ E = k, m[O] = k;
963
963
  else {
964
- const h = ut(S, k);
965
- h && (m[O] = h);
964
+ const d = ut(E, k);
965
+ d && (m[O] = d);
966
966
  }
967
967
  }
968
968
  } finally {
969
969
  l && await lt(l);
970
970
  }
971
971
  },
972
- async end({ checkExistUrlsOnly: E }) {
973
- if (c = yt(c), n && (c = V(c, null, null, n)), o) {
972
+ async end({ checkExistUrlsOnly: x }) {
973
+ if (c = yt(c), r && (c = V(c, null, null, r)), o) {
974
974
  let f, y;
975
- if (!E)
975
+ if (!x)
976
976
  f = o, y = c;
977
977
  else {
978
978
  f = {}, y = {};
979
- for (const d in o)
980
- if (Object.prototype.hasOwnProperty.call(o, d) && Object.prototype.hasOwnProperty.call(c, d)) {
981
- f[d] = {}, y[d] = {};
982
- for (const w in o[d])
983
- Object.prototype.hasOwnProperty.call(o[d], w) && Object.prototype.hasOwnProperty.call(c[d], w) && (f[d][w] = o[d][w], y[d][w] = c[d][w]);
979
+ for (const h in o)
980
+ if (Object.prototype.hasOwnProperty.call(o, h) && Object.prototype.hasOwnProperty.call(c, h)) {
981
+ f[h] = {}, y[h] = {};
982
+ for (const w in o[h])
983
+ Object.prototype.hasOwnProperty.call(o[h], w) && Object.prototype.hasOwnProperty.call(c[h], w) && (f[h][w] = o[h][w], y[h][w] = c[h][w]);
984
984
  }
985
985
  }
986
- const P = v(
986
+ const j = G(
987
987
  f,
988
988
  y,
989
- (d, w, m) => m.selector && (delete m.selector, Object.keys(m).length === 0) ? null : m.childs && m.childs.length === 1 ? m.childs[0] : (w && w.selector ? m[X] ? m[X] = w.selector : m = { selector: w.selector, ...m } : d && d.selector && (m[Q] ? m[Q] = d.selector : m = { selector: d.selector, ...m }), m)
989
+ (h, w, m) => m.selector && (delete m.selector, Object.keys(m).length === 0) ? null : m.childs && m.childs.length === 1 ? m.childs[0] : (w && w.selector ? m[Q] ? m[Q] = w.selector : m = { selector: w.selector, ...m } : h && h.selector && (m[X] ? m[X] = h.selector : m = { selector: h.selector, ...m }), m)
990
990
  );
991
- if (r && await Y(r, P || {}), P)
991
+ if (n && await Y(n, j || {}), j)
992
992
  throw await Y(t, c), console.error(
993
- "Pages elements changes: " + JSON.stringify(P, null, 4).substring(0, 5e3)
993
+ "Pages elements changes: " + JSON.stringify(j, null, 4).substring(0, 5e3)
994
994
  ), new Error("Pages elements changes detected");
995
- await I.promises.stat(t).catch(() => null) && await I.promises.unlink(t);
995
+ await F.promises.stat(t).catch(() => null) && await F.promises.unlink(t);
996
996
  } else
997
997
  await Y(e, c);
998
998
  return c;
@@ -1000,157 +1000,190 @@ function le({
1000
1000
  };
1001
1001
  }
1002
1002
  export {
1003
+ he as CheckError,
1003
1004
  de as ConsoleMessageLevel,
1004
- X as DIFF_NEW,
1005
- Q as DIFF_OLD,
1006
- he as Lazy,
1007
- me as LazyWithId,
1008
- pe as LogLevel,
1009
- ye as Random,
1010
- we as Subject,
1011
- ge as SubjectWithId,
1012
- xe as UNIQUE_PSEUDO_RANDOM_MAX_COUNT,
1013
- Ee as alertConsole,
1014
- Se as alertReplace,
1015
- be as check,
1016
- It as checkPageHttpErrors,
1017
- ke as consoleIntercept,
1018
- Oe as consoleMessageToString,
1019
- Pe as consoleReplace,
1020
- je as convertTimeZone,
1005
+ Q as DIFF_NEW,
1006
+ X as DIFF_OLD,
1007
+ me as Lazy,
1008
+ pe as LazyWithId,
1009
+ ye as LogLevel,
1010
+ we as MAX_REPORT_ITEMS_DEFAULT,
1011
+ be as MatchInternalError,
1012
+ ge as Matcher,
1013
+ xe as MatcherAny,
1014
+ Ee as MatcherArray,
1015
+ Se as MatcherArrayItem,
1016
+ ke as MatcherConvert,
1017
+ Oe as MatcherCustom,
1018
+ je as MatcherFew,
1019
+ Ce as MatcherIn,
1020
+ Pe as MatcherInstanceOf,
1021
+ Ae as MatcherIs,
1022
+ Le as MatcherNever,
1023
+ Te as MatcherNot,
1024
+ Me as MatcherNumber,
1025
+ De as MatcherObject,
1026
+ Fe as MatcherObjectEntry,
1027
+ Ie as MatcherRef,
1028
+ Re as MatcherString,
1029
+ _e as Random,
1030
+ Ne as Subject,
1031
+ We as SubjectWithId,
1032
+ $e as UNIQUE_PSEUDO_RANDOM_MAX_COUNT,
1033
+ Be as alertConsole,
1034
+ ze as alertReplace,
1035
+ Je as argsToString,
1036
+ Ue as check,
1037
+ ve as checkFunc,
1038
+ Ft as checkPageHttpErrors,
1039
+ He as consoleIntercept,
1040
+ Ge as consoleMessageToString,
1041
+ Ke as consoleReplace,
1042
+ Ve as convertTimeZone,
1021
1043
  ct as createCDPSession,
1022
1044
  te as createMatchPath,
1045
+ Ye as createMatchResult,
1046
+ qe as createMatchResultBoolean,
1047
+ Xe as createMatchResultError,
1023
1048
  le as createPagesElementsChangesTest,
1024
- Ce as createTaskDelayRetry,
1025
- Ae as createUniquePseudoRandom,
1026
- Le as dateNowUnique,
1027
- De as deepCloneJsonLike,
1028
- Fe as deepEqualJsonLike,
1029
- Te as deepEqualJsonLikeMap,
1030
- Wt as delayOnErrorCall,
1031
- re as delayOnErrorSet,
1049
+ Qe as createTaskDelayRetry,
1050
+ Ze as createUniquePseudoRandom,
1051
+ tr as dateNowUnique,
1052
+ er as deepCloneJsonLike,
1053
+ rr as deepEqualJsonLike,
1054
+ nr as deepEqualJsonLikeMap,
1055
+ _t as delayOnErrorCall,
1056
+ ne as delayOnErrorSet,
1032
1057
  se as delayOnErrorWait,
1033
1058
  lt as destroyCDPSession,
1034
- Ie as equalArray,
1035
- _e as escapeHtml,
1036
- Re as escapeRegExp,
1037
- Ft as exec,
1038
- Xt as fileLock,
1039
- We as fixStackTrace,
1040
- Mt as forcePseudoClasses,
1041
- Ne as formatAny,
1042
- $e as formatDate,
1043
- Me as formatDateFileName,
1044
- rt as getAllElements,
1045
- Be as getConsoleMessages,
1046
- ze as getDateInet,
1059
+ sr as equalArray,
1060
+ ar as escapeHtml,
1061
+ or as escapeRegExp,
1062
+ Mt as exec,
1063
+ ir as expectedToString,
1064
+ Qt as fileLock,
1065
+ cr as filterMatchResult,
1066
+ lr as filterMatchResultNested,
1067
+ ur as fixStackTrace,
1068
+ $t as forcePseudoClasses,
1069
+ fr as formatAny,
1070
+ hr as formatDate,
1071
+ dr as formatDateFileName,
1072
+ nt as getAllElements,
1073
+ mr as getConsoleMessages,
1074
+ pr as getDateInet,
1047
1075
  Ot as getDrive,
1048
1076
  ut as getElementsStyleDiff,
1049
- Pt as getFileId,
1077
+ jt as getFileId,
1050
1078
  yt as getNormalizedObject,
1051
- v as getObjectsDiff,
1052
- Tt as getPageHttpErrors,
1053
- Je as getRandomFunc,
1054
- Ue as getRandomSeed,
1079
+ yr as getObjectId,
1080
+ G as getObjectsDiff,
1081
+ Dt as getPageHttpErrors,
1082
+ wr as getRandomFunc,
1083
+ br as getRandomSeed,
1055
1084
  pt as getStackTrace,
1056
1085
  At as globGitIgnoreToPicomatch,
1057
1086
  Lt as globToRelative,
1058
1087
  Nt as initPage,
1059
- He as isObservable,
1088
+ gr as isMatcher,
1089
+ xr as isObservable,
1060
1090
  ee as loadGlobs,
1061
- Dt as loadGlobsFromFile,
1062
- $t as loadJson,
1063
- Ge as match,
1064
- ve as matchAnd,
1065
- Ke as matchAndPipe,
1066
- Ve as matchAny,
1067
- Ye as matchArray,
1068
- qe as matchArrayBuffer,
1069
- Qe as matchArrayIncludes,
1070
- Xe as matchArrayItem,
1071
- Ze as matchArrayLength,
1072
- tn as matchArrayWith,
1073
- en as matchBoolean,
1074
- nn as matchConstructor,
1075
- rn as matchConvert,
1076
- sn as matchCustom,
1077
- an as matchDeep,
1078
- on as matchEnum,
1079
- cn as matchFloat,
1080
- ln as matchIn,
1081
- un as matchInstanceOf,
1082
- fn as matchInt,
1083
- dn as matchIntDate,
1084
- hn as matchIs,
1085
- mn as matchIsNonStrict,
1086
- pn as matchNever,
1087
- yn as matchNot,
1088
- wn as matchNotNullish,
1089
- gn as matchNullish,
1090
- xn as matchNumber,
1091
- En as matchObject,
1092
- Sn as matchObjectEntries,
1093
- bn as matchObjectEntry,
1094
- kn as matchObjectKey,
1095
- On as matchObjectKeyValue,
1096
- Pn as matchObjectKeys,
1097
- jn as matchObjectKeysNotNull,
1098
- Cn as matchObjectPartial,
1099
- An as matchObjectValue,
1100
- Ln as matchObjectValues,
1101
- Dn as matchObjectWith,
1102
- Fn as matchOptional,
1103
- Tn as matchOr,
1104
- In as matchOrPipe,
1105
- _n as matchRange,
1106
- Rn as matchRangeDate,
1107
- Wn as matchRef,
1108
- Nn as matchString,
1109
- $n as matchStringLength,
1110
- Mn as matchTypeOf,
1111
- Bn as matchUuid,
1112
- zn as matchValueState,
1113
- Jn as max,
1114
- Un as min,
1115
- Hn as minMax,
1116
- ne as nodeBeep,
1117
- Gn as numberMod,
1091
+ Tt as loadGlobsFromFile,
1092
+ Wt as loadJson,
1093
+ Er as match,
1094
+ Sr as matchAnd,
1095
+ kr as matchAndPipe,
1096
+ Or as matchAny,
1097
+ jr as matchArray,
1098
+ Cr as matchArrayBuffer,
1099
+ Pr as matchArrayIncludes,
1100
+ Ar as matchArrayItem,
1101
+ Lr as matchArrayLength,
1102
+ Tr as matchArrayWith,
1103
+ Mr as matchBoolean,
1104
+ Dr as matchConstructor,
1105
+ Fr as matchConvert,
1106
+ Ir as matchCustom,
1107
+ Rr as matchDeep,
1108
+ _r as matchEnum,
1109
+ Nr as matchFloat,
1110
+ Wr as matchIn,
1111
+ $r as matchInstanceOf,
1112
+ Br as matchInt,
1113
+ zr as matchIntDate,
1114
+ Jr as matchIs,
1115
+ Ur as matchIsNonStrict,
1116
+ vr as matchNever,
1117
+ Hr as matchNot,
1118
+ Gr as matchNotNullish,
1119
+ Kr as matchNullish,
1120
+ Vr as matchNumber,
1121
+ Yr as matchObject,
1122
+ qr as matchObjectEntries,
1123
+ Xr as matchObjectEntry,
1124
+ Qr as matchObjectKey,
1125
+ Zr as matchObjectKeyValue,
1126
+ tn as matchObjectKeys,
1127
+ en as matchObjectKeysNotNull,
1128
+ rn as matchObjectPartial,
1129
+ nn as matchObjectValue,
1130
+ sn as matchObjectValues,
1131
+ an as matchObjectWith,
1132
+ on as matchOptional,
1133
+ cn as matchOr,
1134
+ ln as matchOrPipe,
1135
+ un as matchRange,
1136
+ fn as matchRangeDate,
1137
+ hn as matchRef,
1138
+ dn as matchResultNestedToString,
1139
+ mn as matchResultToString,
1140
+ pn as matchString,
1141
+ yn as matchStringLength,
1142
+ wn as matchTypeOf,
1143
+ bn as matchUuid,
1144
+ gn as matchValueState,
1145
+ xn as max,
1146
+ En as min,
1147
+ Sn as minMax,
1148
+ re as nodeBeep,
1149
+ kn as numberMod,
1118
1150
  V as objectTransform,
1119
- $ as pathNormalize,
1120
- jt as pathResolve,
1151
+ W as pathNormalize,
1152
+ Ct as pathResolve,
1121
1153
  Z as poolFs,
1122
- vn as randomBoolean,
1123
- Kn as randomEnum,
1124
- Vn as randomFloat,
1125
- Yn as randomIndexWeighted,
1126
- qn as randomInt,
1127
- Qn as randomItem,
1128
- Xn as randomItems,
1154
+ On as randomBoolean,
1155
+ jn as randomEnum,
1156
+ Cn as randomFloat,
1157
+ Pn as randomIndexWeighted,
1158
+ An as randomInt,
1159
+ Ln as randomItem,
1160
+ Tn as randomItems,
1129
1161
  Y as saveJson,
1130
- Zn as setFuncName,
1162
+ Mn as setFuncName,
1131
1163
  Rt as setPlaywrightPriorityLow,
1132
- tr as sha256,
1133
- er as sha256Buffer,
1134
- _t as subscribeJsErrors,
1164
+ Dn as sha256,
1165
+ Fn as sha256Buffer,
1166
+ It as subscribeJsErrors,
1135
1167
  ae as testPage,
1136
- nr as timeoutAbortController,
1137
- rr as toHex,
1138
- sr as truncateString,
1139
- ar as urlGetBoolean,
1140
- or as urlGetFloat,
1141
- ir as urlGetInt,
1142
- cr as urlGetParams,
1143
- lr as urlGetString,
1144
- ur as urlParamToBoolean,
1145
- fr as urlParamToFloat,
1146
- dr as urlParamToInt,
1168
+ In as timeoutAbortController,
1169
+ Rn as toHex,
1170
+ _n as truncateString,
1171
+ Nn as urlGetBoolean,
1172
+ Wn as urlGetFloat,
1173
+ $n as urlGetInt,
1174
+ Bn as urlGetParams,
1175
+ zn as urlGetString,
1176
+ Jn as urlParamToBoolean,
1177
+ Un as urlParamToFloat,
1178
+ vn as urlParamToInt,
1147
1179
  oe as useBrowser,
1148
1180
  ie as useBrowserContext,
1149
1181
  ce as usingCDPSession,
1150
- hr as waitObservable,
1151
- Ct as walkPathHandleErrorDefault,
1182
+ Hn as validateMatchResult,
1183
+ Gn as waitObservable,
1184
+ Pt as walkPathHandleErrorDefault,
1152
1185
  Zt as walkPaths,
1153
- mr as withConsoleReplace,
1154
- pr as withRetry,
1186
+ Kn as withConsoleReplace,
1187
+ Vn as withRetry,
1155
1188
  mt as withTimeout
1156
1189
  };