@fkn/lib 0.9.44 → 0.9.46

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,8 +1,8 @@
1
1
  import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
2
  import { _ as t, a as n, d as r, f as i, g as a, h as o, i as s, n as c, o as l, p as u, r as d, s as f, t as p, u as m, v as h, y as g } from "./hosts-t7CKGTRz.js";
3
- import { BoxBase as _, createTypedEventTarget as v, expose as ee, recursiveBox as te, recursiveRevive as ne } from "osra";
3
+ import { BoxBase as _, createTypedEventTarget as v, expose as y, recursiveBox as ee, recursiveRevive as te } from "osra";
4
4
  //#region ../web-extension/lib/lib/revivables/event-proxy.js
5
- var re = (e, t) => {
5
+ var ne = (e, t) => {
6
6
  let n = new EventTarget(), r = /* @__PURE__ */ new Map(), i = EventTarget.prototype.addEventListener.bind(n), a = EventTarget.prototype.removeEventListener.bind(n);
7
7
  return Object.defineProperty(n, "addEventListener", {
8
8
  configurable: !0,
@@ -31,12 +31,12 @@ var re = (e, t) => {
31
31
  o && (e.removeEventListener(t, o), r.delete(t));
32
32
  }
33
33
  }), n;
34
- }, ie = (e) => typeof e == "boolean" ? +!!e : +!!e?.capture, y = (e) => {
34
+ }, b = (e) => typeof e == "boolean" ? +!!e : +!!e?.capture, x = (e) => {
35
35
  let t = /* @__PURE__ */ new WeakMap();
36
36
  return {
37
37
  addEventListener: (n, r, i) => {
38
38
  if (r === null) return;
39
- let a = `${n}|${ie(i)}`, o = t.get(r);
39
+ let a = `${n}|${b(i)}`, o = t.get(r);
40
40
  if (o || (o = /* @__PURE__ */ new Map(), t.set(r, o)), o.has(a)) return;
41
41
  let s = typeof i == "object" && !!i && !!i.once, c = (t) => {
42
42
  s && o.delete(a);
@@ -47,18 +47,18 @@ var re = (e, t) => {
47
47
  },
48
48
  removeEventListener: (n, r, i) => {
49
49
  if (r === null) return;
50
- let a = `${n}|${ie(i)}`, o = t.get(r), s = o?.get(a);
50
+ let a = `${n}|${b(i)}`, o = t.get(r), s = o?.get(a);
51
51
  s && (e.remoteEvents.removeEventListener(n, s, i), o.delete(a));
52
52
  },
53
53
  dispatchEvent: (t) => e.remoteEvents.dispatchEvent(t)
54
54
  };
55
- }, b = /* @__PURE__ */ e({
55
+ }, S = /* @__PURE__ */ e({
56
56
  box: () => ye,
57
- createVideoElementHandle: () => C,
57
+ createVideoElementHandle: () => _e,
58
58
  isType: () => ve,
59
59
  revive: () => be,
60
- type: () => x
61
- }), x = "videoElement", ae = [
60
+ type: () => C
61
+ }), C = "videoElement", re = [
62
62
  "currentTime",
63
63
  "volume",
64
64
  "muted",
@@ -69,22 +69,22 @@ var re = (e, t) => {
69
69
  "preload",
70
70
  "poster",
71
71
  "disableRemotePlayback"
72
- ], oe = [
72
+ ], ie = [
73
73
  "duration",
74
74
  "paused",
75
75
  "ended",
76
76
  "seeking",
77
77
  "readyState",
78
78
  "currentSrc"
79
- ], se = ["buffered", "seekable"], ce = Symbol.for("fkn.remoteVideoElement"), le = Symbol.for("fkn.remoteVideoElement.state"), ue = Symbol.for("fkn.remoteVideoElement.controller"), de = (e) => e ? Array.from({ length: e.length }, (t, n) => [e.start(n), e.end(n)]) : [], S = (e) => {
79
+ ], ae = ["buffered", "seekable"], oe = Symbol.for("fkn.remoteVideoElement"), se = Symbol.for("fkn.remoteVideoElement.state"), ce = Symbol.for("fkn.remoteVideoElement.controller"), le = (e) => e ? Array.from({ length: e.length }, (t, n) => [e.start(n), e.end(n)]) : [], ue = (e) => {
80
80
  let t = {};
81
- for (let n of [...ae, ...oe]) t[n] = e[n];
82
- for (let n of se) t[n] = de(e[n]);
81
+ for (let n of [...re, ...ie]) t[n] = e[n];
82
+ for (let n of ae) t[n] = le(e[n]);
83
83
  return t.error = e.error ? {
84
84
  code: e.error.code,
85
85
  message: e.error.message
86
86
  } : null, t;
87
- }, fe = (e) => {
87
+ }, de = (e) => {
88
88
  let t = (t) => {
89
89
  if (!Number.isInteger(t) || t < 0 || t >= e.length) throw new DOMException("Index or size is negative or greater than the allowed amount", "IndexSizeError");
90
90
  };
@@ -99,17 +99,17 @@ var re = (e, t) => {
99
99
  return t(n), e[n][1];
100
100
  }
101
101
  };
102
- }, pe = (e) => e ? {
102
+ }, fe = (e) => e ? {
103
103
  code: e.code,
104
104
  message: e.message,
105
105
  MEDIA_ERR_ABORTED: 1,
106
106
  MEDIA_ERR_NETWORK: 2,
107
107
  MEDIA_ERR_DECODE: 3,
108
108
  MEDIA_ERR_SRC_NOT_SUPPORTED: 4
109
- } : null, me = (e) => re(e, (e, t) => ({
109
+ } : null, pe = (e) => ne(e, (e, t) => ({
110
110
  originalDetail: e instanceof CustomEvent ? e.detail : null,
111
- snapshot: S(t)
112
- })), he = async (e, t) => {
111
+ snapshot: ue(t)
112
+ })), me = async (e, t) => {
113
113
  switch (t) {
114
114
  case "play": return await e.play(), null;
115
115
  case "pause": return e.pause(), null;
@@ -124,19 +124,19 @@ var re = (e, t) => {
124
124
  }
125
125
  default: throw Error(`videoElement: unknown method "${t}"`);
126
126
  }
127
- }, ge = (e) => ({
128
- call: async (t) => he(e, t),
127
+ }, he = (e) => ({
128
+ call: async (t) => me(e, t),
129
129
  set: async (t, n) => {
130
130
  try {
131
131
  e[t] = n;
132
132
  } catch {}
133
- return S(e);
133
+ return ue(e);
134
134
  },
135
- events: me(e)
136
- }), _e = (e, t) => {
135
+ events: pe(e)
136
+ }), ge = (e, t) => {
137
137
  let n = new EventTarget();
138
- Object.defineProperty(n, ce, { value: !0 }), Object.defineProperty(n, le, { value: e }), Object.defineProperty(n, ue, { value: t });
139
- let r = y({
138
+ Object.defineProperty(n, oe, { value: !0 }), Object.defineProperty(n, se, { value: e }), Object.defineProperty(n, ce, { value: t });
139
+ let r = x({
140
140
  target: n,
141
141
  remoteEvents: t.events,
142
142
  unenrich: (t, n) => {
@@ -171,7 +171,7 @@ var re = (e, t) => {
171
171
  configurable: !0,
172
172
  enumerable: !0,
173
173
  get() {
174
- return pe(e.error);
174
+ return fe(e.error);
175
175
  }
176
176
  },
177
177
  play: {
@@ -207,7 +207,7 @@ var re = (e, t) => {
207
207
  value: 4
208
208
  }
209
209
  };
210
- for (let n of ae) i[n] = {
210
+ for (let n of re) i[n] = {
211
211
  configurable: !0,
212
212
  enumerable: !0,
213
213
  get() {
@@ -219,33 +219,33 @@ var re = (e, t) => {
219
219
  }, () => {});
220
220
  }
221
221
  };
222
- for (let t of oe) i[t] = {
222
+ for (let t of ie) i[t] = {
223
223
  configurable: !0,
224
224
  enumerable: !0,
225
225
  get() {
226
226
  return e[t];
227
227
  }
228
228
  };
229
- for (let t of se) i[t] = {
229
+ for (let t of ae) i[t] = {
230
230
  configurable: !0,
231
231
  enumerable: !0,
232
232
  get() {
233
- return fe(e[t]);
233
+ return de(e[t]);
234
234
  }
235
235
  };
236
236
  return Object.defineProperties(n, i), n;
237
- }, C = (e) => _e(S(e), ge(e)), ve = (e) => typeof e == "object" && !!e && e[ce] === !0, ye = (e, t) => {
237
+ }, _e = (e) => ge(ue(e), he(e)), ve = (e) => typeof e == "object" && !!e && e[oe] === !0, ye = (e, t) => {
238
238
  let n = e;
239
239
  return {
240
240
  ..._,
241
- type: x,
242
- initialState: n[le],
243
- controller: te(n[ue], t)
241
+ type: C,
242
+ initialState: n[se],
243
+ controller: ee(n[ce], t)
244
244
  };
245
245
  }, be = (e, t) => {
246
- let n = ne(e.controller, t);
247
- return _e({ ...e.initialState }, n);
248
- }, xe = (e) => [b, ...e], Se = 4, Ce = 0, we = "fknExtension", Te = "fknExtensionAbi", Ee = "fknExtensionOps", De = [
246
+ let n = te(e.controller, t);
247
+ return ge({ ...e.initialState }, n);
248
+ }, xe = (e) => [S, ...e], Se = 4, Ce = 0, we = "fknExtension", Te = "fknExtensionAbi", Ee = "fknExtensionOps", De = [
249
249
  "data-fkn-extension",
250
250
  "data-fkn-extension-abi",
251
251
  "data-fkn-extension-ops"
@@ -284,9 +284,9 @@ var re = (e, t) => {
284
284
  typeof document < "u" && document.addEventListener(Ne, () => {
285
285
  Fe.dispatchEvent(new CustomEvent("statuschange", { detail: { enabled: Ie() } }));
286
286
  });
287
- var Ie = () => typeof document > "u" ? !1 : document.documentElement.dataset[Pe] === "true", E = () => typeof document > "u" ? { status: "absent" } : Ae(document.documentElement.dataset), Le = null, Re = (e) => {
288
- Le = e;
289
- }, ze = 150, D = (e = 1e3) => new Promise((t, n) => {
287
+ var Ie = () => typeof document > "u" ? !1 : document.documentElement.dataset[Pe] === "true", E = () => typeof document > "u" ? { status: "absent" } : Ae(document.documentElement.dataset), D = null, Le = (e) => {
288
+ D = e;
289
+ }, Re = 150, O = (e = 1e3) => new Promise((t, n) => {
290
290
  let r = () => E().status === "ok";
291
291
  if (r()) return t();
292
292
  let i, a = (e) => {
@@ -294,14 +294,14 @@ var Ie = () => typeof document > "u" ? !1 : document.documentElement.dataset[Pe]
294
294
  }, o = () => a(async () => {
295
295
  let e = E();
296
296
  if (e.status === "outdated") return n(new w(e.abi, e.required));
297
- if (Le) {
298
- if (await Le().catch(() => {}), r()) return t();
297
+ if (D) {
298
+ if (await D().catch(() => {}), r()) return t();
299
299
  let e = E();
300
300
  if (e.status === "outdated") return n(new w(e.abi, e.required));
301
301
  }
302
302
  n(/* @__PURE__ */ Error("The FKN WebExtension is not installed, enabled or not exposed on this page."));
303
303
  }), s = () => {
304
- clearTimeout(i), i = setTimeout(() => r() ? a(t) : o(), ze);
304
+ clearTimeout(i), i = setTimeout(() => r() ? a(t) : o(), Re);
305
305
  }, c = new MutationObserver(() => {
306
306
  r() && a(t);
307
307
  }), l = () => {
@@ -312,36 +312,36 @@ var Ie = () => typeof document > "u" ? !1 : document.documentElement.dataset[Pe]
312
312
  attributeFilter: [...De]
313
313
  }), document.addEventListener("readystatechange", l), document.readyState === "complete") return s();
314
314
  r() && a(t);
315
- }), Be, O = new Proxy({}, { get: (e, t) => async (...e) => {
316
- await D(), Be ??= ee({}, {
315
+ }), ze, k = new Proxy({}, { get: (e, t) => async (...e) => {
316
+ await O(), ze ??= y({}, {
317
317
  transport: window,
318
318
  revivableModules: xe
319
319
  });
320
- let n = (await Be)[t];
320
+ let n = (await ze)[t];
321
321
  return n(...e);
322
- } }), Ve = [
322
+ } }), Be = [
323
323
  "origin",
324
324
  "referer",
325
325
  "cookie"
326
- ], He = (e, t) => (e ?? []).some(([e, n]) => e.trim().toLowerCase() === t && n !== ""), Ue = (e) => He(e, "cookie"), We = (e, t) => {
327
- if (t === "include" && Ue(e)) throw Error("fetch: a forged Cookie header and credentials:'include' are different identities - send one or the other");
328
- }, Ge = (e) => {
329
- let t = [...new Set((e ?? []).map(([e]) => e.trim().toLowerCase()).filter((e) => !Ve.includes(e)))];
326
+ ], Ve = (e, t) => (e ?? []).some(([e, n]) => e.trim().toLowerCase() === t && n !== ""), He = (e) => Ve(e, "cookie"), Ue = (e, t) => {
327
+ if (t === "include" && He(e)) throw Error("fetch: a forged Cookie header and credentials:'include' are different identities - send one or the other");
328
+ }, We = (e) => {
329
+ let t = [...new Set((e ?? []).map(([e]) => e.trim().toLowerCase()).filter((e) => !Be.includes(e)))];
330
330
  if (t.length) throw Error(`fetch: refusing to forge request header(s): ${t.join(", ")}`);
331
- }, Ke = [
331
+ }, Ge = [
332
332
  "fkn.app",
333
333
  "fkn.dev",
334
334
  "sdbx.app"
335
- ], qe = (e) => e.replace(/\.+$/, ""), Je = (e) => {
336
- let t = qe(e);
337
- return Ke.some((e) => t === e || t.endsWith(`.${e}`));
338
- }, Ye = {
335
+ ], Ke = (e) => e.replace(/\.+$/, ""), A = (e) => {
336
+ let t = Ke(e);
337
+ return Ge.some((e) => t === e || t.endsWith(`.${e}`));
338
+ }, qe = {
339
339
  scope: "network.fetch",
340
340
  category: "network",
341
341
  severity: 0,
342
342
  title: "Fetch data from other sites",
343
343
  description: "Lets the app download public data from other websites directly, past the usual cross-origin limits."
344
- }, Xe = {
344
+ }, Je = {
345
345
  scope: "network.fetchCredentialed",
346
346
  category: "network",
347
347
  severity: 3,
@@ -349,7 +349,7 @@ var Ie = () => typeof document > "u" ? !1 : document.documentElement.dataset[Pe]
349
349
  unsafe: !0,
350
350
  title: "Fetch from other sites, signed in as you",
351
351
  description: "Lets the app fetch other sites using your logged-in session cookies, so it can read data only you should see."
352
- }, Ze = {
352
+ }, Ye = {
353
353
  scope: "network.fetchLocal",
354
354
  category: "network",
355
355
  severity: 3,
@@ -357,12 +357,12 @@ var Ie = () => typeof document > "u" ? !1 : document.documentElement.dataset[Pe]
357
357
  unsafe: !0,
358
358
  title: "Access devices on your local network",
359
359
  description: "Lets the app reach devices and services on your home or work network, which websites normally cannot touch."
360
- }, Qe = (e) => {
360
+ }, Xe = (e) => {
361
361
  let t = e.match(/^(\d+)\.(\d+)\.\d+\.\d+$/);
362
362
  if (!t) return !1;
363
363
  let [n, r] = [Number(t[1]), Number(t[2])];
364
364
  return n === 10 || n === 127 || n === 0 || n === 169 && r === 254 || n === 172 && r >= 16 && r <= 31 || n === 192 && r === 168;
365
- }, $e = (e) => {
365
+ }, Ze = (e) => {
366
366
  let t;
367
367
  try {
368
368
  t = new URL(e);
@@ -370,40 +370,57 @@ var Ie = () => typeof document > "u" ? !1 : document.documentElement.dataset[Pe]
370
370
  return !1;
371
371
  }
372
372
  let n = t.hostname.replace(/^\[|\]$/g, "").toLowerCase().replace(/\.$/, "");
373
- return n === "localhost" || n.endsWith(".localhost") || n.endsWith(".local") || n.endsWith(".internal") || n.endsWith(".home.arpa") ? !0 : n.includes(":") ? n === "::" || n === "::1" || n.startsWith("fc") || n.startsWith("fd") || /^fe[89ab]/.test(n) || n.startsWith("::ffff:") : Qe(n);
374
- }, et = (e) => {
373
+ return n === "localhost" || n.endsWith(".localhost") || n.endsWith(".local") || n.endsWith(".internal") || n.endsWith(".home.arpa") ? !0 : n.includes(":") ? n === "::" || n === "::1" || n.startsWith("fc") || n.startsWith("fd") || /^fe[89ab]/.test(n) || n.startsWith("::ffff:") : Xe(n);
374
+ }, Qe = (e) => {
375
375
  let t;
376
376
  try {
377
377
  t = new URL(e);
378
378
  } catch {
379
379
  return !1;
380
380
  }
381
- return t.protocol === "chrome-extension:" || t.protocol === "moz-extension:" || Je(t.hostname);
382
- }, tt = (e) => {
383
- if (et(e)) throw Error("fetch: refusing to target the extension's own pages or FKN platform domains");
384
- }, nt = (e) => {
381
+ return t.protocol === "chrome-extension:" || t.protocol === "moz-extension:" || A(t.hostname);
382
+ }, $e = (e) => {
383
+ if (Qe(e)) throw Error("fetch: refusing to target the extension's own pages or FKN platform domains");
384
+ }, et = (e) => {
385
385
  if (!e?.headers) return;
386
- let t = new Headers(e.headers), n = Ve.map((e) => {
386
+ let t = new Headers(e.headers), n = Be.map((e) => {
387
387
  let n = t.get(e);
388
388
  return n === null || n === "" ? void 0 : [e, n];
389
389
  }).filter((e) => e !== void 0);
390
390
  return n.length ? n : void 0;
391
- }, rt = async (e, t) => {
391
+ }, tt = async (e, t) => {
392
392
  let n = new Request(e, t);
393
- tt(n.url);
393
+ $e(n.url);
394
394
  let r = n.body ? await n.arrayBuffer() : null;
395
- return O.proxyFetch({
395
+ return k.proxyFetch({
396
396
  url: n.url,
397
397
  method: n.method,
398
398
  headers: [...n.headers],
399
399
  body: r,
400
400
  credentials: t?.credentials === "include" ? "include" : "omit",
401
401
  redirect: n.redirect,
402
- unsafeHeaders: nt(t),
402
+ unsafeHeaders: et(t),
403
403
  reason: t?.reason,
404
404
  signal: t?.signal ?? void 0
405
405
  });
406
- }, it = {
406
+ }, nt = (e) => {
407
+ for (let t of e) if (typeof t == "string" && A(t.trim().toLowerCase())) return t;
408
+ }, rt = (e) => {
409
+ let t = e.trim().toLowerCase().replace(/^\.+|\.+$/g, "");
410
+ return t !== "" && (A(t) || Ge.some((e) => e.endsWith(`.${t}`)));
411
+ }, it = (e) => {
412
+ for (let t of e) if (typeof t == "string" && rt(t)) return t;
413
+ }, at = (e) => `${e}: refusing to target FKN platform domains`, ot = (e, t) => {
414
+ if (nt(t) !== void 0) throw Error(at(e));
415
+ }, st = (e) => {
416
+ try {
417
+ return new URL(String(e)).hostname;
418
+ } catch {
419
+ return "";
420
+ }
421
+ }, ct = (e, t) => {
422
+ if (it(t) !== void 0) throw Error(at(e));
423
+ }, lt = {
407
424
  scope: "network.readCookie",
408
425
  category: "network",
409
426
  severity: 3,
@@ -411,7 +428,7 @@ var Ie = () => typeof document > "u" ? !1 : document.documentElement.dataset[Pe]
411
428
  unsafe: !0,
412
429
  title: "Read a site’s cookie",
413
430
  description: "Lets the app read a named cookie from another site, which can include the login token only that site should see."
414
- }, at = { get: (e) => O.getCookie(e) }, ot = {
431
+ }, ut = { get: async (e) => (ot("cookies.get", [st(e.url)]), k.getCookie(e)) }, dt = {
415
432
  scope: "network.modifyRequestHeaders",
416
433
  category: "network",
417
434
  severity: 2,
@@ -419,7 +436,7 @@ var Ie = () => typeof document > "u" ? !1 : document.documentElement.dataset[Pe]
419
436
  unsafe: !0,
420
437
  title: "Rewrite request headers to other sites",
421
438
  description: "Lets the app set or remove headers (like Origin and Referer) on this page’s own requests to the listed sites."
422
- }, st = (e) => O.setRequestHeaderRule(e), ct = (e) => O.removeRequestHeaderRule({ ruleId: e }), lt = class extends Error {
439
+ }, ft = async (e) => (ct("setRequestHeaderRule", e.domains), k.setRequestHeaderRule(e)), pt = (e) => k.removeRequestHeaderRule({ ruleId: e }), mt = class extends Error {
423
440
  reason;
424
441
  filename;
425
442
  line;
@@ -428,18 +445,18 @@ var Ie = () => typeof document > "u" ? !1 : document.documentElement.dataset[Pe]
428
445
  constructor(e, t, n, r, i) {
429
446
  super(`${e}:${n}:${r}: ${t}`), this.reason = t, this.filename = e, this.line = n, this.column = r, this.source = i;
430
447
  }
431
- }, ut = class {
448
+ }, ht = class {
432
449
  start;
433
450
  end;
434
451
  source;
435
452
  constructor(e, t, n) {
436
453
  this.start = e, this.end = t, this.source = n;
437
454
  }
438
- }, k;
455
+ }, j;
439
456
  (function(e) {
440
457
  e.stylesheet = "stylesheet", e.rule = "rule", e.declaration = "declaration", e.comment = "comment", e.atRule = "at-rule", e.container = "container", e.charset = "charset", e.counterStyle = "counter-style", e.document = "document", e.customMedia = "custom-media", e.fontFace = "font-face", e.fontFeatureValues = "font-feature-values", e.host = "host", e.import = "import", e.keyframes = "keyframes", e.keyframe = "keyframe", e.layer = "layer", e.media = "media", e.namespace = "namespace", e.page = "page", e.pageMarginBox = "page-margin-box", e.positionTry = "position-try", e.property = "property", e.scope = "scope", e.startingStyle = "starting-style", e.supports = "supports", e.viewTransition = "view-transition";
441
- })(k ||= {});
442
- var dt = (e, t, n) => {
458
+ })(j ||= {});
459
+ var gt = (e, t, n) => {
443
460
  let r = n, i = 1e4;
444
461
  do {
445
462
  let n = t.map((t) => e.indexOf(t, r));
@@ -451,7 +468,7 @@ var dt = (e, t, n) => {
451
468
  r = o + 2, i--;
452
469
  } while (i > 0);
453
470
  throw Error("Too many escaping");
454
- }, A = (e, t, n) => {
471
+ }, M = (e, t, n) => {
455
472
  let r = n, i = 1e4;
456
473
  do {
457
474
  let n = t.map((t) => e.indexOf(t, r));
@@ -465,21 +482,21 @@ var dt = (e, t, n) => {
465
482
  break;
466
483
  case "(":
467
484
  {
468
- let t = A(e, [")"], o + 1);
485
+ let t = M(e, [")"], o + 1);
469
486
  if (t === -1) return -1;
470
487
  r = t + 1;
471
488
  }
472
489
  break;
473
490
  case "\"":
474
491
  {
475
- let t = dt(e, ["\""], o + 1);
492
+ let t = gt(e, ["\""], o + 1);
476
493
  if (t === -1) return -1;
477
494
  r = t + 1;
478
495
  }
479
496
  break;
480
497
  case "'":
481
498
  {
482
- let t = dt(e, ["'"], o + 1);
499
+ let t = gt(e, ["'"], o + 1);
483
500
  if (t === -1) return -1;
484
501
  r = t + 1;
485
502
  }
@@ -489,17 +506,17 @@ var dt = (e, t, n) => {
489
506
  i--;
490
507
  } while (i > 0);
491
508
  throw Error("Too many escaping");
492
- }, j = /\/\*[^]*?(?:\*\/|$)/g;
493
- function M(e) {
509
+ }, N = /\/\*[^]*?(?:\*\/|$)/g;
510
+ function P(e) {
494
511
  return e ? e.trim() : "";
495
512
  }
496
- function N(e, t) {
513
+ function F(e, t) {
497
514
  let n = e && typeof e.type == "string", r = n ? e : t;
498
515
  for (let t in e) {
499
516
  let n = e[t];
500
517
  Array.isArray(n) ? n.forEach((e) => {
501
- N(e, r);
502
- }) : n && typeof n == "object" && N(n, r);
518
+ F(e, r);
519
+ }) : n && typeof n == "object" && F(n, r);
503
520
  }
504
521
  return n && Object.defineProperty(e, "parent", {
505
522
  configurable: !0,
@@ -508,7 +525,7 @@ function N(e, t) {
508
525
  value: t || null
509
526
  }), e;
510
527
  }
511
- var ft = class {
528
+ var _t = class {
512
529
  level = 0;
513
530
  indentation = " ";
514
531
  compress = !1;
@@ -523,33 +540,33 @@ var ft = class {
523
540
  }
524
541
  visit(e) {
525
542
  switch (e.type) {
526
- case k.stylesheet: return this.stylesheet(e);
527
- case k.rule: return this.rule(e);
528
- case k.declaration: return this.declaration(e);
529
- case k.comment: return this.comment(e);
530
- case k.container: return this.container(e);
531
- case k.charset: return this.charset(e);
532
- case k.counterStyle: return this.counterStyle(e);
533
- case k.document: return this.document(e);
534
- case k.customMedia: return this.customMedia(e);
535
- case k.fontFace: return this.fontFace(e);
536
- case k.fontFeatureValues: return this.fontFeatureValues(e);
537
- case k.host: return this.host(e);
538
- case k.import: return this.import(e);
539
- case k.keyframes: return this.keyframes(e);
540
- case k.keyframe: return this.keyframe(e);
541
- case k.layer: return this.layer(e);
542
- case k.media: return this.media(e);
543
- case k.namespace: return this.namespace(e);
544
- case k.page: return this.page(e);
545
- case k.pageMarginBox: return this.pageMarginBox(e);
546
- case k.positionTry: return this.positionTry(e);
547
- case k.property: return this.property(e);
548
- case k.scope: return this.scope(e);
549
- case k.startingStyle: return this.startingStyle(e);
550
- case k.supports: return this.supports(e);
551
- case k.viewTransition: return this.viewTransition(e);
552
- case k.atRule: return this.genericAtRule(e);
543
+ case j.stylesheet: return this.stylesheet(e);
544
+ case j.rule: return this.rule(e);
545
+ case j.declaration: return this.declaration(e);
546
+ case j.comment: return this.comment(e);
547
+ case j.container: return this.container(e);
548
+ case j.charset: return this.charset(e);
549
+ case j.counterStyle: return this.counterStyle(e);
550
+ case j.document: return this.document(e);
551
+ case j.customMedia: return this.customMedia(e);
552
+ case j.fontFace: return this.fontFace(e);
553
+ case j.fontFeatureValues: return this.fontFeatureValues(e);
554
+ case j.host: return this.host(e);
555
+ case j.import: return this.import(e);
556
+ case j.keyframes: return this.keyframes(e);
557
+ case j.keyframe: return this.keyframe(e);
558
+ case j.layer: return this.layer(e);
559
+ case j.media: return this.media(e);
560
+ case j.namespace: return this.namespace(e);
561
+ case j.page: return this.page(e);
562
+ case j.pageMarginBox: return this.pageMarginBox(e);
563
+ case j.positionTry: return this.positionTry(e);
564
+ case j.property: return this.property(e);
565
+ case j.scope: return this.scope(e);
566
+ case j.startingStyle: return this.startingStyle(e);
567
+ case j.supports: return this.supports(e);
568
+ case j.viewTransition: return this.viewTransition(e);
569
+ case j.atRule: return this.genericAtRule(e);
553
570
  }
554
571
  }
555
572
  mapVisit(e, t) {
@@ -645,7 +662,7 @@ var ft = class {
645
662
  let t = e.prelude ? ` ${e.prelude}` : "";
646
663
  if (this.compress) return this.emit(`@${e.name}${t}`, e.position) + (e.rules ? this.emit("{") + this.mapVisit(e.rules) + this.emit("}") : ";");
647
664
  if (!e.rules) return this.emit(`${this.indent()}@${e.name}${t};`, e.position);
648
- let n = e.rules.some((e) => e.type !== k.declaration && e.type !== k.comment), r = n ? "\n\n" : "\n";
665
+ let n = e.rules.some((e) => e.type !== j.declaration && e.type !== j.comment), r = n ? "\n\n" : "\n";
649
666
  return this.emit(`${this.indent()}@${e.name}${t}`, e.position) + this.emit(n ? ` {\n${this.indent(1)}` : " {\n") + this.emit(n ? "" : this.indent(1)) + this.mapVisit(e.rules, r) + this.emit(n ? `\n${this.indent(-1)}${this.indent()}}` : `${this.indent(-1)}\n${this.indent()}}`);
650
667
  }
651
668
  rule(e) {
@@ -658,7 +675,7 @@ var ft = class {
658
675
  declaration(e) {
659
676
  return this.compress ? this.emit(`${e.property}:${e.value}`, e.position) + this.emit(";") : e.property === "grid-template-areas" ? this.emit(this.indent()) + this.emit(e.property + ": " + e.value.split("\n").join("\n".padEnd(22) + this.indent()), e.position) + this.emit(";") : this.emit(this.indent()) + this.emit(`${e.property}: ${e.value}`, e.position) + this.emit(";");
660
677
  }
661
- }, pt = (e, t) => {
678
+ }, vt = (e, t) => {
662
679
  t ||= {};
663
680
  let n = 1, r = 1;
664
681
  function i() {
@@ -666,14 +683,14 @@ var ft = class {
666
683
  line: n,
667
684
  column: r
668
685
  };
669
- return (i) => (i.position = new ut(e, {
686
+ return (i) => (i.position = new ht(e, {
670
687
  line: n,
671
688
  column: r
672
689
  }, t?.source || ""), u(), i);
673
690
  }
674
691
  let a = [];
675
692
  function o(i) {
676
- let o = new lt(t?.source || "", i, n, r, e);
693
+ let o = new mt(t?.source || "", i, n, r, e);
677
694
  if (!t?.silent) throw o;
678
695
  a.push(o);
679
696
  }
@@ -709,36 +726,36 @@ var ft = class {
709
726
  if (e.charAt(0) !== "/" || e.charAt(1) !== "*") return;
710
727
  let n = /^\/\*[^]*?\*\//.exec(e);
711
728
  return n ? (l(n), t({
712
- type: k.comment,
729
+ type: j.comment,
713
730
  comment: n[0].slice(2, -2)
714
731
  })) : o("End of comment missing");
715
732
  }
716
733
  function p() {
717
- let t = A(e, ["{"]);
734
+ let t = M(e, ["{"]);
718
735
  if (t === -1 || t === 0) return;
719
736
  let n = e.substring(0, t);
720
737
  return l([n]), ((e, t) => {
721
738
  let n = [], r = 0;
722
739
  for (; r < e.length;) {
723
- let i = A(e, t, r);
740
+ let i = M(e, t, r);
724
741
  if (i === -1) return n.push(e.substring(r)), n;
725
742
  n.push(e.substring(r, i)), r = i + 1;
726
743
  }
727
744
  return n;
728
- })(M(n).replace(j, ""), [","]).map((e) => M(e));
745
+ })(P(n).replace(N, ""), [","]).map((e) => P(e));
729
746
  }
730
747
  function m() {
731
748
  let t = i(), n = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/.exec(e);
732
749
  if (!n) return;
733
750
  l(n);
734
- let r = M(n[0]), a = /^:\s*/.exec(e);
751
+ let r = P(n[0]), a = /^:\s*/.exec(e);
735
752
  if (!a) return o("property missing ':'");
736
753
  l(a);
737
- let s = "", c = A(e, [";", "}"]);
738
- c !== -1 && (s = e.substring(0, c), l([s]), s = M(s).replace(j, ""));
754
+ let s = "", c = M(e, [";", "}"]);
755
+ c !== -1 && (s = e.substring(0, c), l([s]), s = P(s).replace(N, ""));
739
756
  let u = t({
740
- type: k.declaration,
741
- property: r.replace(j, ""),
757
+ type: j.declaration,
758
+ property: r.replace(N, ""),
742
759
  value: s
743
760
  }), d = /^[;\s]*/.exec(e);
744
761
  return d && l(d), u;
@@ -757,9 +774,9 @@ var ft = class {
757
774
  return c() ? n : o("missing '}'");
758
775
  }
759
776
  function g() {
760
- let t = A(e, ["{"]);
777
+ let t = M(e, ["{"]);
761
778
  if (t === -1) return !1;
762
- let n = A(e, [";"]), r = A(e, ["}"]);
779
+ let n = M(e, [";"]), r = M(e, ["}"]);
763
780
  return !(n !== -1 && n < t) && !(r !== -1 && r < t);
764
781
  }
765
782
  function _() {
@@ -767,14 +784,14 @@ var ft = class {
767
784
  if (!s()) return o("missing '{'");
768
785
  for (d(n); e.length && e.charAt(0) !== "}";) {
769
786
  if (e.charAt(0) === "@") {
770
- let e = b();
787
+ let e = S();
771
788
  if (e) {
772
789
  n.push(e), d(n);
773
790
  continue;
774
791
  }
775
792
  }
776
793
  if (g()) {
777
- let e = x();
794
+ let e = C();
778
795
  if (e) {
779
796
  n.push(e), d(n);
780
797
  continue;
@@ -799,14 +816,14 @@ var ft = class {
799
816
  let n = [];
800
817
  for (u(), d(n); e.length && e.charAt(0) !== "}";) {
801
818
  if (e.charAt(0) === "@") {
802
- let e = b();
819
+ let e = S();
803
820
  if (e) {
804
821
  n.push(e), d(n);
805
822
  continue;
806
823
  }
807
824
  }
808
825
  if (g()) {
809
- let e = x();
826
+ let e = C();
810
827
  if (e) {
811
828
  n.push(e), d(n);
812
829
  continue;
@@ -827,7 +844,7 @@ var ft = class {
827
844
  }
828
845
  return n;
829
846
  }
830
- function ee() {
847
+ function y() {
831
848
  let t = [], n = i(), r = /^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/.exec(e);
832
849
  for (; r;) {
833
850
  let n = l(r);
@@ -836,12 +853,12 @@ var ft = class {
836
853
  i && l(i), r = /^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/.exec(e);
837
854
  }
838
855
  if (t.length) return n({
839
- type: k.keyframe,
856
+ type: j.keyframe,
840
857
  values: t,
841
858
  declarations: h() || []
842
859
  });
843
860
  }
844
- let te = RegExp(`^@(${[
861
+ let ee = RegExp(`^@(${[
845
862
  "top-left-corner",
846
863
  "top-left",
847
864
  "top-center",
@@ -858,8 +875,8 @@ var ft = class {
858
875
  "right-top",
859
876
  "right-middle",
860
877
  "right-bottom"
861
- ].join("|")})(?![\\w-])\\s*`), ne = y("import"), re = y("charset"), ie = y("namespace");
862
- function y(t) {
878
+ ].join("|")})(?![\\w-])\\s*`), te = x("import"), ne = x("charset"), b = x("namespace");
879
+ function x(t) {
863
880
  let n = RegExp("^@" + t + "\\s*((?::?[^;'\"]|\"(?:\\\\\"|[^\"])*?\"|'(?:\\\\'|[^'])*?')+)(?:;|$)");
864
881
  return () => {
865
882
  let r = i(), a = n.exec(e);
@@ -868,7 +885,7 @@ var ft = class {
868
885
  return s[t] = o[1].trim(), r(s);
869
886
  };
870
887
  }
871
- function b() {
888
+ function S() {
872
889
  if (e[0] === "@") return function() {
873
890
  let t = i(), n = /^@([-\w]+)?keyframes\s*/.exec(e);
874
891
  if (!n) return;
@@ -876,10 +893,10 @@ var ft = class {
876
893
  if (!a) return o("@keyframes missing name");
877
894
  let u = l(a)[1];
878
895
  if (!s()) return o("@keyframes missing '{'");
879
- let f = d(), p = ee();
880
- for (; p;) f.push(p), f = f.concat(d()), p = ee();
896
+ let f = d(), p = y();
897
+ for (; p;) f.push(p), f = f.concat(d()), p = y();
881
898
  return c() ? t({
882
- type: k.keyframes,
899
+ type: j.keyframes,
883
900
  name: u,
884
901
  vendor: r,
885
902
  keyframes: f
@@ -887,11 +904,11 @@ var ft = class {
887
904
  }() || function() {
888
905
  let t = i(), n = /^@media *([^{]+)/.exec(e);
889
906
  if (!n) return;
890
- let r = M(l(n)[1]);
907
+ let r = P(l(n)[1]);
891
908
  if (!s()) return o("@media missing '{'");
892
909
  let a = v();
893
910
  return c() ? t({
894
- type: k.media,
911
+ type: j.media,
895
912
  media: r,
896
913
  rules: a
897
914
  }) : o("@media missing '}'");
@@ -900,29 +917,29 @@ var ft = class {
900
917
  if (!n) return;
901
918
  let r = l(n);
902
919
  return t({
903
- type: k.customMedia,
904
- name: M(r[1]),
905
- media: M(r[2])
920
+ type: j.customMedia,
921
+ name: P(r[1]),
922
+ media: P(r[2])
906
923
  });
907
924
  }() || function() {
908
925
  let t = i(), n = /^@supports *([^{]+)/.exec(e);
909
926
  if (!n) return;
910
- let r = M(l(n)[1]);
927
+ let r = P(l(n)[1]);
911
928
  if (!s()) return o("@supports missing '{'");
912
929
  let a = v();
913
930
  return c() ? t({
914
- type: k.supports,
931
+ type: j.supports,
915
932
  supports: r,
916
933
  rules: a
917
934
  }) : o("@supports missing '}'");
918
- }() || ne() || re() || ie() || function() {
935
+ }() || te() || ne() || b() || function() {
919
936
  let t = i(), n = /^@([-\w]+)?document *([^{]+)/.exec(e);
920
937
  if (!n) return;
921
- let r = l(n), a = M(r[1]), u = M(r[2]);
938
+ let r = l(n), a = P(r[1]), u = P(r[2]);
922
939
  if (!s()) return o("@document missing '{'");
923
940
  let d = v();
924
941
  return c() ? t({
925
- type: k.document,
942
+ type: j.document,
926
943
  document: u,
927
944
  vendor: a,
928
945
  rules: d
@@ -936,7 +953,7 @@ var ft = class {
936
953
  let a = [];
937
954
  for (d(a); e.length && e.charAt(0) !== "}";) {
938
955
  if (e.charAt(0) === "@") {
939
- let e = b();
956
+ let e = S();
940
957
  if (e) {
941
958
  a.push(e), d(a);
942
959
  continue;
@@ -947,7 +964,7 @@ var ft = class {
947
964
  a.push(t), d(a);
948
965
  }
949
966
  return c() ? t({
950
- type: k.page,
967
+ type: j.page,
951
968
  selectors: r,
952
969
  declarations: a
953
970
  }) : o("@page missing '}'");
@@ -957,7 +974,7 @@ var ft = class {
957
974
  if (l(n), !s()) return o("@host missing '{'");
958
975
  let r = v();
959
976
  return c() ? t({
960
- type: k.host,
977
+ type: j.host,
961
978
  rules: r
962
979
  }) : o("@host missing '}'");
963
980
  }() || function() {
@@ -967,28 +984,28 @@ var ft = class {
967
984
  let r = d(), a = m();
968
985
  for (; a;) r.push(a), r = r.concat(d()), a = m();
969
986
  return c() ? t({
970
- type: k.fontFace,
987
+ type: j.fontFace,
971
988
  declarations: r
972
989
  }) : o("@font-face missing '}'");
973
990
  }() || function() {
974
991
  let t = i(), n = /^@font-feature-values\s+([^{]+)/.exec(e);
975
992
  if (!n) return;
976
- let r = M(l(n)[1]);
993
+ let r = P(l(n)[1]);
977
994
  if (!s()) return o("@font-feature-values missing '{'");
978
995
  let a = v();
979
996
  return c() ? t({
980
- type: k.fontFeatureValues,
997
+ type: j.fontFeatureValues,
981
998
  fontFamily: r,
982
999
  rules: a
983
1000
  }) : o("@font-feature-values missing '}'");
984
1001
  }() || function() {
985
1002
  let t = i(), n = /^@container *([^{]+)/.exec(e);
986
1003
  if (!n) return;
987
- let r = M(l(n)[1]);
1004
+ let r = P(l(n)[1]);
988
1005
  if (!s()) return o("@container missing '{'");
989
1006
  let a = v();
990
1007
  return c() ? t({
991
- type: k.container,
1008
+ type: j.container,
992
1009
  container: r,
993
1010
  rules: a
994
1011
  }) : o("@container missing '}'");
@@ -998,23 +1015,23 @@ var ft = class {
998
1015
  if (l(n), !s()) return o("@starting-style missing '{'");
999
1016
  let r = v();
1000
1017
  return c() ? t({
1001
- type: k.startingStyle,
1018
+ type: j.startingStyle,
1002
1019
  rules: r
1003
1020
  }) : o("@starting-style missing '}'");
1004
1021
  }() || function() {
1005
1022
  let t = i(), n = /^@layer *([^{;@]+)/.exec(e);
1006
1023
  if (!n) return;
1007
- let r = M(l(n)[1]);
1024
+ let r = P(l(n)[1]);
1008
1025
  if (!s()) {
1009
1026
  let n = /^[;\s]*/.exec(e);
1010
1027
  return n && l(n), t({
1011
- type: k.layer,
1028
+ type: j.layer,
1012
1029
  layer: r
1013
1030
  });
1014
1031
  }
1015
1032
  let a = v();
1016
1033
  return c() ? t({
1017
- type: k.layer,
1034
+ type: j.layer,
1018
1035
  layer: r,
1019
1036
  rules: a
1020
1037
  }) : o("@layer missing '}'");
@@ -1026,7 +1043,7 @@ var ft = class {
1026
1043
  let a = d(), u = m();
1027
1044
  for (; u;) a.push(u), a = a.concat(d()), u = m();
1028
1045
  return c() ? t({
1029
- type: k.property,
1046
+ type: j.property,
1030
1047
  name: r,
1031
1048
  declarations: a
1032
1049
  }) : o("@property missing '}'");
@@ -1038,18 +1055,18 @@ var ft = class {
1038
1055
  let a = d(), u = m();
1039
1056
  for (; u;) a.push(u), a = a.concat(d()), u = m();
1040
1057
  return c() ? t({
1041
- type: k.counterStyle,
1058
+ type: j.counterStyle,
1042
1059
  name: r,
1043
1060
  declarations: a
1044
1061
  }) : o("@counter-style missing '}'");
1045
1062
  }() || function() {
1046
1063
  let t = i(), n = /^@scope\s*([^{]*)/.exec(e);
1047
1064
  if (!n) return;
1048
- let r = M(l(n)[1]);
1065
+ let r = P(l(n)[1]);
1049
1066
  if (!s()) return o("@scope missing '{'");
1050
1067
  let a = v();
1051
1068
  return c() ? t({
1052
- type: k.scope,
1069
+ type: j.scope,
1053
1070
  scope: r,
1054
1071
  rules: a
1055
1072
  }) : o("@scope missing '}'");
@@ -1060,7 +1077,7 @@ var ft = class {
1060
1077
  let r = d(), a = m();
1061
1078
  for (; a;) r.push(a), r = r.concat(d()), a = m();
1062
1079
  return c() ? t({
1063
- type: k.viewTransition,
1080
+ type: j.viewTransition,
1064
1081
  declarations: r
1065
1082
  }) : o("@view-transition missing '}'");
1066
1083
  }() || function() {
@@ -1071,30 +1088,30 @@ var ft = class {
1071
1088
  let a = d(), u = m();
1072
1089
  for (; u;) a.push(u), a = a.concat(d()), u = m();
1073
1090
  return c() ? t({
1074
- type: k.positionTry,
1091
+ type: j.positionTry,
1075
1092
  name: r,
1076
1093
  declarations: a
1077
1094
  }) : o("@position-try missing '}'");
1078
1095
  }() || function() {
1079
- let t = i(), n = te.exec(e);
1096
+ let t = i(), n = ee.exec(e);
1080
1097
  if (!n) return;
1081
1098
  let r = l(n)[1];
1082
1099
  if (!s()) return o(`@${r} missing '{'`);
1083
1100
  let a = d(), u = m();
1084
1101
  for (; u;) a.push(u), a = a.concat(d()), u = m();
1085
1102
  return c() ? t({
1086
- type: k.pageMarginBox,
1103
+ type: j.pageMarginBox,
1087
1104
  name: r,
1088
1105
  declarations: a
1089
1106
  }) : o(`@${r} missing '}'`);
1090
1107
  }() || function() {
1091
1108
  let t = i(), n = /^@([-\w]+)\s*/.exec(e);
1092
1109
  if (!n) return;
1093
- let r = l(n)[1], a = "", u = A(e, ["{", ";"]);
1094
- if (u !== -1 && u > 0 && (a = M(e.substring(0, u)), l([e.substring(0, u)])), s()) {
1110
+ let r = l(n)[1], a = "", u = M(e, ["{", ";"]);
1111
+ if (u !== -1 && u > 0 && (a = P(e.substring(0, u)), l([e.substring(0, u)])), s()) {
1095
1112
  let e = v();
1096
1113
  return c() ? t({
1097
- type: k.atRule,
1114
+ type: j.atRule,
1098
1115
  name: r,
1099
1116
  prelude: a,
1100
1117
  rules: e
@@ -1102,21 +1119,21 @@ var ft = class {
1102
1119
  }
1103
1120
  let d = /^[;\s]*/.exec(e);
1104
1121
  return d && l(d), t({
1105
- type: k.atRule,
1122
+ type: j.atRule,
1106
1123
  name: r,
1107
1124
  prelude: a
1108
1125
  });
1109
1126
  }();
1110
1127
  }
1111
- function x() {
1128
+ function C() {
1112
1129
  let e = i(), t = p();
1113
1130
  return t ? (d(), e({
1114
- type: k.rule,
1131
+ type: j.rule,
1115
1132
  selectors: t,
1116
1133
  declarations: _() || []
1117
1134
  })) : o("selector missing");
1118
1135
  }
1119
- return N(function() {
1136
+ return F(function() {
1120
1137
  let n = function() {
1121
1138
  let n, r = [];
1122
1139
  for (u(), d(r); e.length;) {
@@ -1127,7 +1144,7 @@ var ft = class {
1127
1144
  }
1128
1145
  break;
1129
1146
  }
1130
- if (n = b() || x(), !n) {
1147
+ if (n = S() || C(), !n) {
1131
1148
  if (t?.silent) {
1132
1149
  l([e.charAt(0)]), u(), d(r);
1133
1150
  continue;
@@ -1139,7 +1156,7 @@ var ft = class {
1139
1156
  return r;
1140
1157
  }();
1141
1158
  return {
1142
- type: k.stylesheet,
1159
+ type: j.stylesheet,
1143
1160
  stylesheet: {
1144
1161
  source: t?.source,
1145
1162
  rules: n,
@@ -1147,66 +1164,66 @@ var ft = class {
1147
1164
  }
1148
1165
  };
1149
1166
  }());
1150
- }, mt = (e, t) => new ft(t || {}).compile(e), ht = Object.defineProperty, gt = (e, t) => {
1167
+ }, yt = (e, t) => new _t(t || {}).compile(e), bt = Object.defineProperty, xt = (e, t) => {
1151
1168
  let n = {};
1152
- for (var r in e) ht(n, r, {
1169
+ for (var r in e) bt(n, r, {
1153
1170
  get: e[r],
1154
1171
  enumerable: !0
1155
1172
  });
1156
- return t || ht(n, Symbol.toStringTag, { value: "Module" }), n;
1157
- }, _t = "LocatorError", P = "LocatorUnsupportedError", F = "LocatorDeniedError", I = "LocatorInvalidError", L = (e) => typeof e == "object" && e ? e.name : void 0, R = (e) => Object.assign(Error(e), { name: _t }), z = (e, t = "", n) => Object.assign(Error(e), {
1158
- name: P,
1173
+ return t || bt(n, Symbol.toStringTag, { value: "Module" }), n;
1174
+ }, St = "LocatorError", I = "LocatorUnsupportedError", L = "LocatorDeniedError", Ct = "LocatorInvalidError", wt = (e) => typeof e == "object" && e ? e.name : void 0, R = (e) => Object.assign(Error(e), { name: St }), Tt = (e, t = "", n) => Object.assign(Error(e), {
1175
+ name: I,
1159
1176
  operation: t,
1160
1177
  backend: n
1161
- }), vt = (e, t) => z(`Locator operation not supported${t ? ` on the ${t} backend` : ""}: ${e}`, e, t), B = (e, t) => Object.assign(Error(e), {
1162
- name: F,
1178
+ }), Et = (e, t) => Tt(`Locator operation not supported${t ? ` on the ${t} backend` : ""}: ${e}`, e, t), Dt = (e, t) => Object.assign(Error(e), {
1179
+ name: L,
1163
1180
  operation: t
1164
- }), yt = (e, t) => Object.assign(Error(e), {
1165
- name: I,
1181
+ }), Ot = (e, t) => Object.assign(Error(e), {
1182
+ name: Ct,
1166
1183
  operation: t
1167
- }), V = class extends Error {
1184
+ }), z = class extends Error {
1168
1185
  name = "TimeoutError";
1169
1186
  constructor(e, t) {
1170
1187
  super(e, t?.cause === void 0 ? void 0 : { cause: t.cause });
1171
1188
  }
1172
- }, bt = (e) => L(e) === P, xt = (e) => L(e) === F, H = (e) => L(e) === I, St = (e) => xt(e) || bt(e) || H(e), U = (e) => {
1189
+ }, kt = (e) => wt(e) === I, At = (e) => wt(e) === L, B = (e) => wt(e) === Ct, jt = (e) => At(e) || kt(e) || B(e), V = (e) => {
1173
1190
  let t = (e.ownerDocument ?? e).defaultView;
1174
1191
  if (!t) throw R("the resolved element belongs to a document with no window");
1175
1192
  return t;
1176
- }, Ct = (e, t) => {
1193
+ }, Mt = (e, t) => {
1177
1194
  let n = e?.[t];
1178
1195
  return typeof n == "function" ? n : null;
1179
- }, wt = (e, t) => {
1196
+ }, H = (e, t) => {
1180
1197
  if (typeof e != "object" || !e) return null;
1181
1198
  let n = (() => {
1182
1199
  try {
1183
- return Ct(U(e), t);
1200
+ return Mt(V(e), t);
1184
1201
  } catch {
1185
1202
  return null;
1186
1203
  }
1187
1204
  })();
1188
1205
  if (n && e instanceof n) return n;
1189
- let r = Ct(globalThis, t);
1206
+ let r = Mt(globalThis, t);
1190
1207
  return r && e instanceof r ? r : null;
1191
- }, W = (e, t) => wt(e, t) !== null, G = (e) => {
1208
+ }, U = (e, t) => H(e, t) !== null, W = (e) => {
1192
1209
  if (e.length === 0) throw R("No elements found");
1193
1210
  if (e.length > 1) throw R(`Strict mode violation: locator resolved to ${e.length} elements`);
1194
1211
  return e[0];
1195
- }, Tt = (e, t) => {
1196
- if (!W(e, t)) throw R(`Strict mode violation: expected ${t}, got <${e.tagName.toLowerCase()}>`);
1212
+ }, Nt = (e, t) => {
1213
+ if (!U(e, t)) throw R(`Strict mode violation: expected ${t}, got <${e.tagName.toLowerCase()}>`);
1197
1214
  return e;
1198
- }, Et = (e) => e.tagName.toLowerCase(), Dt = /* @__PURE__ */ new Set(), Ot = (e) => {
1199
- Dt.add(e);
1200
- }, kt = /(?:^|[^\w-])(?:url|image|image-set|cross-fade|paint|element|expression)\s*\(/i, At = (e) => e.replace(/\\([0-9a-fA-F]{1,6})\s?/g, (e, t) => String.fromCodePoint(Number.parseInt(t, 16))).replace(/\\(.)/g, "$1"), jt = (e) => !kt.test(At(e.value)), Mt = /* @__PURE__ */ new Set([
1201
- k.import,
1202
- k.fontFace,
1203
- k.namespace,
1204
- k.charset,
1205
- k.document,
1206
- k.comment
1207
- ]), Nt = (e) => {
1208
- if (Mt.has(e.type)) return null;
1209
- if (e.type === k.declaration) return jt(e) ? e : null;
1215
+ }, Pt = (e) => e.tagName.toLowerCase(), Ft = /* @__PURE__ */ new Set(), It = (e) => {
1216
+ Ft.add(e);
1217
+ }, Lt = /(?:^|[^\w-])(?:url|image|image-set|cross-fade|paint|element|expression)\s*\(/i, Rt = (e) => e.replace(/\\([0-9a-fA-F]{1,6})\s?/g, (e, t) => String.fromCodePoint(Number.parseInt(t, 16))).replace(/\\(.)/g, "$1"), zt = (e) => !Lt.test(Rt(e.value)), Bt = /* @__PURE__ */ new Set([
1218
+ j.import,
1219
+ j.fontFace,
1220
+ j.namespace,
1221
+ j.charset,
1222
+ j.document,
1223
+ j.comment
1224
+ ]), Vt = (e) => {
1225
+ if (Bt.has(e.type)) return null;
1226
+ if (e.type === j.declaration) return zt(e) ? e : null;
1210
1227
  let t = e, n = { ...t };
1211
1228
  for (let e of [
1212
1229
  "declarations",
@@ -1214,18 +1231,18 @@ var ft = class {
1214
1231
  "keyframes"
1215
1232
  ]) {
1216
1233
  let r = t[e];
1217
- Array.isArray(r) && (n[e] = Pt(r));
1234
+ Array.isArray(r) && (n[e] = Ht(r));
1218
1235
  }
1219
1236
  return n;
1220
- }, Pt = (e) => e.map((e) => Nt(e)).filter((e) => e !== null), Ft = (e) => {
1237
+ }, Ht = (e) => e.map((e) => Vt(e)).filter((e) => e !== null), Ut = (e) => {
1221
1238
  let t;
1222
1239
  try {
1223
- t = pt(e, { silent: !0 });
1240
+ t = vt(e, { silent: !0 });
1224
1241
  } catch {
1225
1242
  return "";
1226
1243
  }
1227
- return t.stylesheet.rules = Pt(t.stylesheet.rules), mt(t);
1228
- }, It = (e, t) => {
1244
+ return t.stylesheet.rules = Ht(t.stylesheet.rules), yt(t);
1245
+ }, Wt = (e, t) => {
1229
1246
  let n = () => {
1230
1247
  t.parentNode || (e.head ?? e.documentElement).appendChild(t);
1231
1248
  };
@@ -1242,30 +1259,30 @@ var ft = class {
1242
1259
  });
1243
1260
  let i = () => r.disconnect(), a = e.defaultView;
1244
1261
  a ? a.addEventListener("load", i, { once: !0 }) : setTimeout(i, 3e4);
1245
- }, Lt = { resolve: (e, t) => {
1262
+ }, Gt = { resolve: (e, t) => {
1246
1263
  let n = e.document.createElement("style");
1247
- n.textContent = t.noSanitize ? t.content : Ft(t.content);
1264
+ n.textContent = t.noSanitize ? t.content : Ut(t.content);
1248
1265
  try {
1249
- It(e.document, n);
1266
+ Wt(e.document, n);
1250
1267
  } catch (e) {
1251
1268
  console.error(e);
1252
1269
  }
1253
- Ot(n);
1254
- } }, Rt = (e) => {
1270
+ It(n);
1271
+ } }, Kt = (e) => {
1255
1272
  let t = [];
1256
1273
  return e.forEach((e, n) => {
1257
1274
  t.push([n, e]);
1258
1275
  }), t;
1259
- }, K = {
1276
+ }, G = {
1260
1277
  kind: "frame",
1261
1278
  ensureArgs: (e) => [void 0, e],
1262
1279
  resolve: async (e, t, n = {}) => {
1263
- if (typeof t != "string") throw yt("fetch: url must be a string", "fetch");
1264
- let r = U(e.document), i;
1280
+ if (typeof t != "string") throw Ot("fetch: url must be a string", "fetch");
1281
+ let r = V(e.document), i;
1265
1282
  try {
1266
1283
  i = new r.URL(t, e.document.baseURI).href;
1267
1284
  } catch {
1268
- throw yt(`fetch: not a valid url: ${t}`, "fetch");
1285
+ throw Ot(`fetch: not a valid url: ${t}`, "fetch");
1269
1286
  }
1270
1287
  let a = await r.fetch(i, {
1271
1288
  method: n.method ?? "GET",
@@ -1281,31 +1298,31 @@ var ft = class {
1281
1298
  url: a.url,
1282
1299
  redirected: a.redirected,
1283
1300
  type: a.type,
1284
- headers: Rt(a.headers),
1301
+ headers: Kt(a.headers),
1285
1302
  body: await a.arrayBuffer()
1286
1303
  };
1287
1304
  }
1288
- }, q = /* @__PURE__ */ gt({
1289
- click: () => Bt,
1290
- count: () => Jt,
1291
- exists: () => Yt,
1292
- fill: () => Wt,
1293
- getAttribute: () => Kt,
1294
- hover: () => Vt,
1295
- isVisible: () => qt,
1296
- textContent: () => Gt
1297
- }), zt = (e, t) => {
1305
+ }, K = /* @__PURE__ */ xt({
1306
+ click: () => Jt,
1307
+ count: () => nn,
1308
+ exists: () => rn,
1309
+ fill: () => Qt,
1310
+ getAttribute: () => en,
1311
+ hover: () => Yt,
1312
+ isVisible: () => tn,
1313
+ textContent: () => $t
1314
+ }), qt = (e, t) => {
1298
1315
  let n = e.getBoundingClientRect();
1299
1316
  return {
1300
1317
  clientX: n.left + n.width * (t?.x ?? .5),
1301
1318
  clientY: n.top + n.height * (t?.y ?? .5)
1302
1319
  };
1303
- }, Bt = { resolve: (e, t = {}) => {
1304
- let n = G(e.elements), r = U(n), i = {
1320
+ }, Jt = { resolve: (e, t = {}) => {
1321
+ let n = W(e.elements), r = V(n), i = {
1305
1322
  bubbles: !0,
1306
1323
  cancelable: !0,
1307
1324
  composed: !0,
1308
- ...zt(n, t.position),
1325
+ ...qt(n, t.position),
1309
1326
  button: 0
1310
1327
  }, a = {
1311
1328
  ...i,
@@ -1329,12 +1346,12 @@ var ft = class {
1329
1346
  ...i,
1330
1347
  buttons: 0
1331
1348
  }));
1332
- } }, Vt = { resolve: (e, t = {}) => {
1333
- let n = G(e.elements), r = U(n), i = {
1349
+ } }, Yt = { resolve: (e, t = {}) => {
1350
+ let n = W(e.elements), r = V(n), i = {
1334
1351
  bubbles: !0,
1335
1352
  cancelable: !0,
1336
1353
  composed: !0,
1337
- ...zt(n, t.position)
1354
+ ...qt(n, t.position)
1338
1355
  }, a = {
1339
1356
  ...i,
1340
1357
  pointerType: "mouse",
@@ -1348,11 +1365,11 @@ var ft = class {
1348
1365
  ...i,
1349
1366
  bubbles: !1
1350
1367
  })), n.dispatchEvent(new r.MouseEvent("mouseover", i)), n.dispatchEvent(new r.PointerEvent("pointermove", a)), n.dispatchEvent(new r.MouseEvent("mousemove", i));
1351
- } }, Ht = (e, t) => {
1368
+ } }, Xt = (e, t) => {
1352
1369
  e._valueTracker?.setValue("");
1353
- let n = (wt(e, "HTMLTextAreaElement") ?? wt(e, "HTMLInputElement"))?.prototype, r = n && Object.getOwnPropertyDescriptor(n, "value")?.set;
1370
+ let n = (H(e, "HTMLTextAreaElement") ?? H(e, "HTMLInputElement"))?.prototype, r = n && Object.getOwnPropertyDescriptor(n, "value")?.set;
1354
1371
  r ? r.call(e, t) : e.value = t;
1355
- }, Ut = (e, t) => {
1372
+ }, Zt = (e, t) => {
1356
1373
  if (e.type !== "range") return null;
1357
1374
  let n = Number(e.min || 0), r = Number(e.max || 100);
1358
1375
  if (!Number.isFinite(n) || !Number.isFinite(r) || r <= n) return null;
@@ -1389,61 +1406,61 @@ var ft = class {
1389
1406
  buttons: 0
1390
1407
  }
1391
1408
  };
1392
- }, Wt = { resolve: (e, t, n = {}) => {
1393
- let r = G(e.elements), i = U(r), a = W(r, "HTMLInputElement");
1394
- if (a || W(r, "HTMLTextAreaElement")) {
1395
- let e = r, n = a ? Ut(e, t) : null;
1396
- n && (r.dispatchEvent(new i.PointerEvent("pointerdown", n.pointerDown)), r.dispatchEvent(new i.MouseEvent("mousedown", n.mouseDown))), Ht(e, t), r.dispatchEvent(new i.Event("input", { bubbles: !0 })), n && (r.dispatchEvent(new i.PointerEvent("pointerup", n.pointerUp)), r.dispatchEvent(new i.MouseEvent("mouseup", n.mouseUp))), r.dispatchEvent(new i.Event("change", { bubbles: !0 }));
1409
+ }, Qt = { resolve: (e, t, n = {}) => {
1410
+ let r = W(e.elements), i = V(r), a = U(r, "HTMLInputElement");
1411
+ if (a || U(r, "HTMLTextAreaElement")) {
1412
+ let e = r, n = a ? Zt(e, t) : null;
1413
+ n && (r.dispatchEvent(new i.PointerEvent("pointerdown", n.pointerDown)), r.dispatchEvent(new i.MouseEvent("mousedown", n.mouseDown))), Xt(e, t), r.dispatchEvent(new i.Event("input", { bubbles: !0 })), n && (r.dispatchEvent(new i.PointerEvent("pointerup", n.pointerUp)), r.dispatchEvent(new i.MouseEvent("mouseup", n.mouseUp))), r.dispatchEvent(new i.Event("change", { bubbles: !0 }));
1397
1414
  return;
1398
1415
  }
1399
- if (W(r, "HTMLElement") && r.isContentEditable) {
1416
+ if (U(r, "HTMLElement") && r.isContentEditable) {
1400
1417
  r.textContent = t, r.dispatchEvent(new i.Event("input", { bubbles: !0 }));
1401
1418
  return;
1402
1419
  }
1403
- throw Error(`fill: element <${Et(r)}> is not fillable`);
1404
- } }, Gt = { resolve: (e, t = {}) => G(e.elements).textContent }, Kt = { resolve: (e, t, n = {}) => G(e.elements).getAttribute(t) }, qt = { resolve: (e, t = {}) => {
1405
- let n = G(e.elements);
1406
- if (!W(n, "HTMLElement")) return !0;
1407
- let r = U(n).getComputedStyle(n);
1420
+ throw Error(`fill: element <${Pt(r)}> is not fillable`);
1421
+ } }, $t = { resolve: (e, t = {}) => W(e.elements).textContent }, en = { resolve: (e, t, n = {}) => W(e.elements).getAttribute(t) }, tn = { resolve: (e, t = {}) => {
1422
+ let n = W(e.elements);
1423
+ if (!U(n, "HTMLElement")) return !0;
1424
+ let r = V(n).getComputedStyle(n);
1408
1425
  if (r?.display === "none" || r?.visibility === "hidden") return !1;
1409
1426
  let i = n.getBoundingClientRect();
1410
1427
  return i.width > 0 && i.height > 0;
1411
- } }, Jt = { resolve: (e, t = {}) => e.elements.length }, Yt = { resolve: (e, t = {}) => e.elements.length > 0 }, J = (e, t) => e.elements.flatMap((e) => [...e.querySelectorAll(t)]), Xt = (e) => e.replaceAll("\"", "\\\""), Zt = {
1428
+ } }, nn = { resolve: (e, t = {}) => e.elements.length }, rn = { resolve: (e, t = {}) => e.elements.length > 0 }, q = (e, t) => e.elements.flatMap((e) => [...e.querySelectorAll(t)]), an = (e) => e.replaceAll("\"", "\\\""), on = {
1412
1429
  to: "element",
1413
1430
  css: !0,
1414
- resolve: (e, t) => J(e, t),
1431
+ resolve: (e, t) => q(e, t),
1415
1432
  render: (e) => ({
1416
1433
  fragment: typeof e == "string" ? e : "?",
1417
1434
  separator: "descend"
1418
1435
  })
1419
- }, Qt = {
1436
+ }, sn = {
1420
1437
  to: "frame",
1421
1438
  css: !0,
1422
1439
  barrier: "down",
1423
- resolve: (e, t) => J(e, t),
1440
+ resolve: (e, t) => q(e, t),
1424
1441
  render: (e) => ({
1425
1442
  fragment: typeof e == "string" ? e : "?",
1426
1443
  separator: "down"
1427
1444
  })
1428
- }, $t = {
1445
+ }, cn = {
1429
1446
  element: {
1430
1447
  selectors: {
1431
- locator: Zt,
1432
- frameLocator: Qt,
1448
+ locator: on,
1449
+ frameLocator: sn,
1433
1450
  getByRole: {
1434
1451
  to: "element",
1435
- resolve: (e, t) => J(e, `[role="${CSS.escape(t)}"]`),
1436
- render: (e) => ({ fragment: typeof e == "string" ? `[role="${Xt(e)}"]` : "[role]" })
1452
+ resolve: (e, t) => q(e, `[role="${CSS.escape(t)}"]`),
1453
+ render: (e) => ({ fragment: typeof e == "string" ? `[role="${an(e)}"]` : "[role]" })
1437
1454
  },
1438
1455
  getByText: {
1439
1456
  to: "element",
1440
1457
  resolve: (e, t) => e.elements.flatMap((e) => [e, ...e.querySelectorAll("*")]).filter((e) => e.textContent?.includes(t)),
1441
- render: (e) => ({ fragment: typeof e == "string" ? `:has-text("${Xt(e)}")` : ":has-text(...)" })
1458
+ render: (e) => ({ fragment: typeof e == "string" ? `:has-text("${an(e)}")` : ":has-text(...)" })
1442
1459
  },
1443
1460
  getByTestId: {
1444
1461
  to: "element",
1445
- resolve: (e, t) => J(e, `[data-testid="${CSS.escape(t)}"]`),
1446
- render: (e) => ({ fragment: typeof e == "string" ? `[data-testid="${Xt(e)}"]` : "[data-testid]" })
1462
+ resolve: (e, t) => q(e, `[data-testid="${CSS.escape(t)}"]`),
1463
+ render: (e) => ({ fragment: typeof e == "string" ? `[data-testid="${an(e)}"]` : "[data-testid]" })
1447
1464
  },
1448
1465
  first: {
1449
1466
  to: "element",
@@ -1460,20 +1477,20 @@ var ft = class {
1460
1477
  }
1461
1478
  },
1462
1479
  operations: {
1463
- click: Bt,
1464
- fill: Wt,
1465
- hover: Vt,
1466
- textContent: Gt,
1467
- getAttribute: Kt,
1468
- isVisible: qt,
1469
- count: Jt,
1470
- exists: Yt
1480
+ click: Jt,
1481
+ fill: Qt,
1482
+ hover: Yt,
1483
+ textContent: $t,
1484
+ getAttribute: en,
1485
+ isVisible: tn,
1486
+ count: nn,
1487
+ exists: rn
1471
1488
  }
1472
1489
  },
1473
1490
  frame: {
1474
1491
  selectors: {
1475
- locator: Zt,
1476
- frameLocator: Qt,
1492
+ locator: on,
1493
+ frameLocator: sn,
1477
1494
  owner: {
1478
1495
  to: "frame",
1479
1496
  barrier: "up",
@@ -1487,11 +1504,11 @@ var ft = class {
1487
1504
  }
1488
1505
  },
1489
1506
  operations: {
1490
- addStyleTag: Lt,
1491
- fetch: K
1507
+ addStyleTag: Gt,
1508
+ fetch: G
1492
1509
  }
1493
1510
  }
1494
- }, en = (e, t = $t) => ({
1511
+ }, ln = (e, t = cn) => ({
1495
1512
  element: {
1496
1513
  selectors: {
1497
1514
  ...t.element.selectors,
@@ -1512,31 +1529,31 @@ var ft = class {
1512
1529
  ...e.frame?.operations
1513
1530
  }
1514
1531
  }
1515
- }), tn = 3e4, nn = 50, rn = (e) => {
1532
+ }), un = 3e4, dn = 50, fn = (e) => {
1516
1533
  let t = e[e.length - 1];
1517
1534
  return typeof t == "object" && t ? t : void 0;
1518
- }, an = (e) => {
1519
- let t = rn(e)?.timeout;
1520
- return typeof t == "number" ? t : tn;
1521
- }, on = ({ executor: e, parts: t }) => ({ highlight: (n) => e.highlight(t, n).then(() => {}, () => {}) }), sn = async (e) => {
1535
+ }, pn = (e) => {
1536
+ let t = fn(e)?.timeout;
1537
+ return typeof t == "number" ? t : un;
1538
+ }, mn = ({ executor: e, parts: t }) => ({ highlight: (n) => e.highlight(t, n).then(() => {}, () => {}) }), hn = async (e) => {
1522
1539
  let t = {
1523
1540
  parts: e.parts,
1524
1541
  operation: e.operation,
1525
1542
  args: e.args,
1526
1543
  phase: "ensure"
1527
1544
  };
1528
- await e.gate?.(t, on(e));
1529
- }, cn = (e, t) => {
1545
+ await e.gate?.(t, mn(e));
1546
+ }, gn = (e, t) => {
1530
1547
  if (t !== void 0 && typeof t == "number" && !(Number.isFinite(t) && t > 0)) throw TypeError(`${e}: timeout must be a positive number of milliseconds, not ${t}; every call ends at its deadline, so 0 does not turn it off`);
1531
- }, ln = (e) => typeof e == "object" && e && typeof e.message == "string" ? e.message : String(e), un = async (e) => {
1548
+ }, _n = (e) => typeof e == "object" && e && typeof e.message == "string" ? e.message : String(e), vn = async (e) => {
1532
1549
  let { executor: t, gate: n, parts: r, operation: i, args: a } = e;
1533
- cn(i, rn(a)?.timeout), n && await n({
1550
+ gn(i, fn(a)?.timeout), n && await n({
1534
1551
  parts: r,
1535
1552
  operation: i,
1536
1553
  args: a,
1537
1554
  phase: "execute"
1538
- }, on(e));
1539
- let o = an(a), s = Date.now() + o, c = /* @__PURE__ */ Error(`Locator timeout (${o}ms): ${i}`), { promise: l, reject: u } = Promise.withResolvers();
1555
+ }, mn(e));
1556
+ let o = pn(a), s = Date.now() + o, c = /* @__PURE__ */ Error(`Locator timeout (${o}ms): ${i}`), { promise: l, reject: u } = Promise.withResolvers();
1540
1557
  l.catch(() => {});
1541
1558
  let d = setTimeout(() => u(c), o), f = c;
1542
1559
  try {
@@ -1544,47 +1561,47 @@ var ft = class {
1544
1561
  return await Promise.race([t.execute(r, i, a), l]);
1545
1562
  } catch (e) {
1546
1563
  if (e === c) break;
1547
- if (St(e)) throw e;
1564
+ if (jt(e)) throw e;
1548
1565
  f = e;
1549
1566
  let t = s - Date.now();
1550
1567
  if (t <= 0) break;
1551
- await new Promise((e) => setTimeout(e, Math.min(nn, t)));
1568
+ await new Promise((e) => setTimeout(e, Math.min(dn, t)));
1552
1569
  }
1553
1570
  } finally {
1554
1571
  clearTimeout(d);
1555
1572
  }
1556
- throw f === c ? new V(c.message) : new V(ln(f), { cause: f });
1557
- }, dn = (e, t, n, r, i) => {
1573
+ throw f === c ? new z(c.message) : new z(_n(f), { cause: f });
1574
+ }, yn = (e, t, n, r, i) => {
1558
1575
  let a = {};
1559
- for (let [o, s] of Object.entries(t[r].selectors)) a[o] = (...a) => dn(e, t, n, s.to, [...i, {
1576
+ for (let [o, s] of Object.entries(t[r].selectors)) a[o] = (...a) => yn(e, t, n, s.to, [...i, {
1560
1577
  kind: r,
1561
1578
  name: o,
1562
1579
  args: a
1563
1580
  }]);
1564
- for (let [n, o] of Object.entries(t[r].operations)) a[n] = async (...t) => un({
1581
+ for (let [n, o] of Object.entries(t[r].operations)) a[n] = async (...t) => vn({
1565
1582
  ...e,
1566
1583
  parts: i,
1567
1584
  operation: n,
1568
1585
  args: o.send ? o.send(...t) : t
1569
1586
  });
1570
- for (let [o, { to: s, rewrite: c }] of Object.entries(n[r] ?? {})) a[o] = (...r) => dn(e, t, n, s, c(i, ...r));
1587
+ for (let [o, { to: s, rewrite: c }] of Object.entries(n[r] ?? {})) a[o] = (...r) => yn(e, t, n, s, c(i, ...r));
1571
1588
  return a.ensure = (n, a = {}) => {
1572
1589
  let o = t[r].operations[n]?.ensureArgs;
1573
- return sn({
1590
+ return hn({
1574
1591
  ...e,
1575
1592
  parts: i,
1576
1593
  operation: n,
1577
1594
  args: o?.(a) ?? [a]
1578
1595
  });
1579
1596
  }, a;
1580
- }, fn = (e) => dn(e, e.modules ?? $t, e.rewrites ?? {}, "frame", []), pn = () => {
1597
+ }, bn = (e) => yn(e, e.modules ?? cn, e.rewrites ?? {}, "frame", []), xn = () => {
1581
1598
  let e = E();
1582
1599
  return e.status === "ok" && e.abi >= 2;
1583
- }, mn = async () => {
1584
- await D();
1600
+ }, Sn = async () => {
1601
+ await O();
1585
1602
  let e = E();
1586
1603
  if (e.status === "ok" && e.abi < 2) throw new w(e.abi, 2);
1587
- }, hn = (e) => `Read the text, links and details ${e} shows.`, gn = (e) => `Inject unfiltered styles or code into ${e}. This can pass page details along to other sites.`, _n = [
1604
+ }, Cn = (e) => `Read the text, links and details ${e} shows.`, wn = (e) => `Inject unfiltered styles or code into ${e}. This can pass page details along to other sites.`, Tn = [
1588
1605
  {
1589
1606
  id: "interaction",
1590
1607
  heading: "Interaction",
@@ -1599,9 +1616,9 @@ var ft = class {
1599
1616
  heading: "Site data",
1600
1617
  summary: "Can read the website's data",
1601
1618
  title: (e) => `Read data from ${e}`,
1602
- description: hn,
1619
+ description: Cn,
1603
1620
  cloudTitle: (e) => `Read what's on ${e}`,
1604
- cloudDescription: hn
1621
+ cloudDescription: Cn
1605
1622
  },
1606
1623
  {
1607
1624
  id: "network",
@@ -1617,11 +1634,11 @@ var ft = class {
1617
1634
  heading: "Evaluation",
1618
1635
  summary: "Can execute arbitrary code on the website",
1619
1636
  title: (e) => `Run code on ${e}`,
1620
- description: gn,
1637
+ description: wn,
1621
1638
  cloudTitle: (e) => `Run its own code on ${e}`,
1622
- cloudDescription: gn
1639
+ cloudDescription: wn
1623
1640
  }
1624
- ], vn = (e) => (t) => {
1641
+ ], En = (e) => (t) => {
1625
1642
  if (typeof t != "object" || !t) return t === void 0 ? [] : [t];
1626
1643
  if (t.position !== void 0) throw TypeError(`${e}: position is Playwright's offset in pixels, which no backend serves yet; pass relativePosition, a 0..1 fraction of the box`);
1627
1644
  let { relativePosition: n, ...r } = t;
@@ -1629,40 +1646,40 @@ var ft = class {
1629
1646
  ...r,
1630
1647
  position: n
1631
1648
  }];
1632
- }, yn = en({
1649
+ }, Dn = ln({
1633
1650
  element: { operations: {
1634
1651
  click: {
1635
- resolve: (e, t = {}) => q.click.resolve(e, t),
1636
- send: vn("click")
1652
+ resolve: (e, t = {}) => K.click.resolve(e, t),
1653
+ send: En("click")
1637
1654
  },
1638
1655
  hover: {
1639
- resolve: (e, t = {}) => q.hover.resolve(e, t),
1640
- send: vn("hover")
1656
+ resolve: (e, t = {}) => K.hover.resolve(e, t),
1657
+ send: En("hover")
1641
1658
  },
1642
- fill: { resolve: (e, t, n = {}) => q.fill.resolve(e, t, n) },
1643
- textContent: { resolve: (e, t = {}) => q.textContent.resolve(e) },
1644
- getAttribute: { resolve: (e, t, n = {}) => q.getAttribute.resolve(e, t) },
1645
- isVisible: { resolve: (e, t = {}) => q.isVisible.resolve(e) },
1646
- count: { resolve: (e, t = {}) => q.count.resolve(e) },
1647
- exists: { resolve: (e, t = {}) => q.exists.resolve(e) },
1648
- videoElement: { resolve: (e, t = {}) => C(Tt(G(e.elements), "HTMLVideoElement")) }
1659
+ fill: { resolve: (e, t, n = {}) => K.fill.resolve(e, t, n) },
1660
+ textContent: { resolve: (e, t = {}) => K.textContent.resolve(e) },
1661
+ getAttribute: { resolve: (e, t, n = {}) => K.getAttribute.resolve(e, t) },
1662
+ isVisible: { resolve: (e, t = {}) => K.isVisible.resolve(e) },
1663
+ count: { resolve: (e, t = {}) => K.count.resolve(e) },
1664
+ exists: { resolve: (e, t = {}) => K.exists.resolve(e) },
1665
+ videoElement: { resolve: (e, t = {}) => _e(Nt(W(e.elements), "HTMLVideoElement")) }
1649
1666
  } },
1650
1667
  frame: { operations: {
1651
- addStyleTag: { resolve: (e, t) => Lt.resolve(e, t) },
1668
+ addStyleTag: { resolve: (e, t) => Gt.resolve(e, t) },
1652
1669
  fetch: {
1653
- resolve: (e, t, n = {}) => K.resolve(e, t, n),
1654
- kind: K.kind,
1655
- ensureArgs: K.ensureArgs
1670
+ resolve: (e, t, n = {}) => G.resolve(e, t, n),
1671
+ kind: G.kind,
1672
+ ensureArgs: G.ensureArgs
1656
1673
  },
1657
1674
  evaluate: {
1658
1675
  kind: "frame",
1659
1676
  typed: !1,
1660
1677
  resolve: (e, t, n) => {
1661
- throw vt("evaluate", "this realm");
1678
+ throw Et("evaluate", "this realm");
1662
1679
  }
1663
1680
  }
1664
1681
  } }
1665
- }), bn = (e) => e[e.length - 1], xn = {
1682
+ }), On = (e) => e[e.length - 1], kn = {
1666
1683
  element: {
1667
1684
  last: {
1668
1685
  to: "element",
@@ -1675,7 +1692,7 @@ var ft = class {
1675
1692
  contentFrame: {
1676
1693
  to: "frame",
1677
1694
  rewrite: (e) => {
1678
- let t = bn(e);
1695
+ let t = On(e);
1679
1696
  if (t?.name !== "locator") throw TypeError("locator.contentFrame: only a locator that ends in locator(selector) can enter its frame; use frameLocator(selector)");
1680
1697
  return [...e.slice(0, -1), {
1681
1698
  ...t,
@@ -1688,7 +1705,7 @@ var ft = class {
1688
1705
  owner: {
1689
1706
  to: "element",
1690
1707
  rewrite: (e) => {
1691
- let t = bn(e);
1708
+ let t = On(e);
1692
1709
  if (t?.name !== "frameLocator") throw TypeError("frameLocator.owner: this frame was not entered through frameLocator(selector)");
1693
1710
  return [...e.slice(0, -1), {
1694
1711
  ...t,
@@ -1705,7 +1722,7 @@ var ft = class {
1705
1722
  }]
1706
1723
  }
1707
1724
  }
1708
- }, Sn = (e) => {
1725
+ }, An = (e) => {
1709
1726
  if (!e || e === "about:blank") return !1;
1710
1727
  let t;
1711
1728
  try {
@@ -1713,46 +1730,46 @@ var ft = class {
1713
1730
  } catch {
1714
1731
  return !1;
1715
1732
  }
1716
- return t.protocol === "chrome-extension:" || t.protocol === "moz-extension:" || t.protocol !== "about:" && Je(t.hostname);
1717
- }, Y = (e) => {
1718
- if (Sn(e)) throw Error("attachFrame: refusing to target the extension's own pages or an FKN platform origin");
1719
- }, Cn = ({ src: e, domains: t, lockdown: n }) => {
1733
+ return t.protocol === "chrome-extension:" || t.protocol === "moz-extension:" || t.protocol !== "about:" && A(t.hostname);
1734
+ }, J = (e) => {
1735
+ if (An(e)) throw Error("attachFrame: refusing to target the extension's own pages or an FKN platform origin");
1736
+ }, jn = ({ src: e, domains: t, lockdown: n }) => {
1720
1737
  if (n && !t.length && e && e !== "about:blank") throw Error("attachFrame: lockdown needs domains when the frame already has a src; pass domains or load it via goto");
1721
- }, wn = {
1738
+ }, Mn = {
1722
1739
  scope: "embed.iframe",
1723
1740
  category: "interaction",
1724
1741
  severity: 0,
1725
1742
  title: "Load another website inside this app",
1726
1743
  description: "Lets the app embed external pages directly inside its own view."
1727
- }, Tn = {
1744
+ }, Nn = {
1728
1745
  scope: "embed.open",
1729
1746
  category: "interaction",
1730
1747
  severity: 0,
1731
1748
  title: "Open a website inside this app",
1732
1749
  description: "Lets the app navigate to another site without leaving its window."
1733
- }, En = ["load", "commit"], Dn = (e) => {
1750
+ }, Pn = ["load", "commit"], Fn = (e) => {
1734
1751
  if ("timeoutMs" in e) throw TypeError("frame.goto: pass timeout, in milliseconds; timeoutMs is not an option");
1735
1752
  let { waitUntil: t, timeout: n } = e;
1736
- if (t !== void 0 && !En.includes(t)) throw TypeError(`frame.goto: waitUntil must be 'load' or 'commit', not ${JSON.stringify(t)}`);
1753
+ if (t !== void 0 && !Pn.includes(t)) throw TypeError(`frame.goto: waitUntil must be 'load' or 'commit', not ${JSON.stringify(t)}`);
1737
1754
  if (n !== void 0 && typeof n != "number") throw TypeError("frame.goto: timeout must be a number of milliseconds");
1738
- cn("frame.goto", n);
1739
- }, On = class extends Error {
1755
+ gn("frame.goto", n);
1756
+ }, In = class extends Error {
1740
1757
  name = "FrameWindowBlockedError";
1741
1758
  constructor() {
1742
1759
  super("attachFrame: the browser did not open the window. Call attachFrame directly in a click or key handler, and allow popups for this page");
1743
1760
  }
1744
- }, kn = /* @__PURE__ */ new Set([
1761
+ }, Ln = /* @__PURE__ */ new Set([
1745
1762
  "jar-unreachable",
1746
1763
  "bad-url",
1747
1764
  "opaque-opener"
1748
- ]), An = class extends Error {
1765
+ ]), Rn = class extends Error {
1749
1766
  name = "FrameWindowRefusedError";
1750
1767
  reason;
1751
1768
  constructor(e) {
1752
- let t = kn.has(e) ? e : "unknown";
1769
+ let t = Ln.has(e) ? e : "unknown";
1753
1770
  super(t === "opaque-opener" ? "attachFrame: this page has an opaque origin, which a window can never answer, so no window was opened" : `attachFrame: the window refused to attach (${t}), and loaded nothing`), this.reason = t;
1754
1771
  }
1755
- }, jn = ["message", "document"], Mn = (e) => {
1772
+ }, zn = ["message", "document"], Bn = (e) => {
1756
1773
  if (e === "*") return "*";
1757
1774
  let t = () => /* @__PURE__ */ TypeError(`frame.postMessage: targetOrigin must be '*' or an origin, not ${JSON.stringify(e)}`);
1758
1775
  if (typeof e != "string") throw t();
@@ -1764,48 +1781,48 @@ var ft = class {
1764
1781
  }
1765
1782
  if (n === "null") throw t();
1766
1783
  return n;
1767
- }, Nn = (e, t) => {
1784
+ }, Vn = (e, t) => {
1768
1785
  let n = typeof e == "object" && !!e;
1769
1786
  if (n && t !== void 0) throw TypeError("frame.postMessage: pass transfer inside the options object, not after it");
1770
1787
  let r = n ? e.targetOrigin ?? "*" : e ?? "*", i = n ? e.transfer : t;
1771
1788
  if (i !== void 0 && !Array.isArray(i)) throw TypeError("frame.postMessage: transfer must be an array");
1772
1789
  return {
1773
- targetOrigin: Mn(r),
1790
+ targetOrigin: Bn(r),
1774
1791
  transfer: i === void 0 ? [] : [...i]
1775
1792
  };
1776
- }, Pn = [
1793
+ }, Hn = [
1777
1794
  "url",
1778
1795
  "path",
1779
1796
  "type"
1780
- ], Fn = ["content", "sourceUrl"], In = /[\n\r\u2028\u2029]/, Ln = (e) => {
1797
+ ], Un = ["content", "sourceUrl"], Wn = /[\n\r\u2028\u2029]/, Gn = (e) => {
1781
1798
  if (typeof e != "object" || !e || Array.isArray(e)) throw TypeError("frame.addScriptTag: options must be an object { content }");
1782
- let t = Object.keys(e), n = t.find((e) => Pn.includes(e));
1799
+ let t = Object.keys(e), n = t.find((e) => Hn.includes(e));
1783
1800
  if (n !== void 0) throw TypeError(`frame.addScriptTag: "${n}" is not served; it runs content as a classic inline script`);
1784
- let r = t.find((e) => !Fn.includes(e));
1801
+ let r = t.find((e) => !Un.includes(e));
1785
1802
  if (r !== void 0) throw TypeError(`frame.addScriptTag: unknown option "${r}"`);
1786
1803
  let { content: i, sourceUrl: a } = e;
1787
1804
  if (typeof i != "string") throw TypeError("frame.addScriptTag: content must be a string");
1788
- if (a !== void 0 && (typeof a != "string" || a === "" || In.test(a))) throw TypeError("frame.addScriptTag: sourceUrl must be a non-empty string with no line break");
1805
+ if (a !== void 0 && (typeof a != "string" || a === "" || Wn.test(a))) throw TypeError("frame.addScriptTag: sourceUrl must be a non-empty string with no line break");
1789
1806
  return a === void 0 ? { content: i } : {
1790
1807
  content: i,
1791
1808
  sourceUrl: a
1792
1809
  };
1793
- }, Rn = [
1810
+ }, Kn = [
1794
1811
  "name",
1795
1812
  "domain",
1796
1813
  "path"
1797
- ], zn = (e) => e instanceof RegExp || Object.prototype.toString.call(e) === "[object RegExp]", Bn = (e) => {
1814
+ ], qn = (e) => e instanceof RegExp || Object.prototype.toString.call(e) === "[object RegExp]", Jn = (e) => {
1798
1815
  if (e === void 0) return {};
1799
1816
  if (Object.prototype.toString.call(e) !== "[object Object]") throw TypeError("frame.clearCookies: options must be an object");
1800
- let t = e, n = Object.keys(t).find((e) => !Rn.includes(e));
1817
+ let t = e, n = Object.keys(t).find((e) => !Kn.includes(e));
1801
1818
  if (n !== void 0) throw TypeError(`frame.clearCookies: unknown option "${n}"`);
1802
- let r = Rn.flatMap((e) => {
1819
+ let r = Kn.flatMap((e) => {
1803
1820
  let n = t[e];
1804
1821
  return n === void 0 ? [] : [{
1805
1822
  key: e,
1806
1823
  value: n
1807
1824
  }];
1808
- }), i = r.find(({ value: e }) => zn(e));
1825
+ }), i = r.find(({ value: e }) => qn(e));
1809
1826
  if (i !== void 0) throw TypeError(`frame.clearCookies: ${i.key} is a RegExp, and clearCookies takes strings for name, domain and path for now`);
1810
1827
  let a = r.find(({ value: e }) => typeof e != "string");
1811
1828
  if (a !== void 0) throw TypeError(`frame.clearCookies: ${a.key} must be a string`);
@@ -1814,15 +1831,15 @@ var ft = class {
1814
1831
  let s = {};
1815
1832
  for (let { key: e, value: t } of r) s[e] = { equals: t };
1816
1833
  return s;
1817
- }, Vn = (e) => {
1834
+ }, Yn = (e) => {
1818
1835
  typeof globalThis.reportError == "function" ? globalThis.reportError(e) : console.error(e);
1819
- }, Hn = (e) => {
1820
- let { owner: t, ...n } = fn({
1836
+ }, Xn = (e) => {
1837
+ let { owner: t, ...n } = bn({
1821
1838
  executor: e.executor,
1822
- modules: yn,
1823
- rewrites: xn,
1839
+ modules: Dn,
1840
+ rewrites: kn,
1824
1841
  gate: e.gate
1825
- }), r = async (t, n = {}) => (Y(t), Dn(n), e.goto(t, n)), i = () => e.url(), a = async (t) => {
1842
+ }), r = async (t, n = {}) => (J(t), Fn(n), e.goto(t, n)), i = () => e.url(), a = async (t) => {
1826
1843
  let n = e.requestPermissions;
1827
1844
  if (!n) throw Error("frame.requestPermissions: this backend cannot ask for permission categories");
1828
1845
  return n(t);
@@ -1833,18 +1850,18 @@ var ft = class {
1833
1850
  if (typeof i != "string") throw TypeError("frame.evaluate: pass a function or a source string");
1834
1851
  return r(i, structuredClone(n));
1835
1852
  }, s = async (t) => {
1836
- let { content: n, ...r } = Ln(t), i = e.addScriptTag;
1853
+ let { content: n, ...r } = Gn(t), i = e.addScriptTag;
1837
1854
  if (!i) throw Error("frame.addScriptTag: this backend cannot run scripts in the attached frame");
1838
1855
  await i(n, r);
1839
1856
  }, c = async (t) => {
1840
- let n = Bn(t), r = e.clearCookies;
1857
+ let n = Jn(t), r = e.clearCookies;
1841
1858
  if (!r) throw Error("frame.clearCookies: this backend cannot clear cookies");
1842
1859
  await r(n);
1843
1860
  }, l = ((t, n, r) => {
1844
1861
  try {
1845
1862
  let i = e.postMessage;
1846
1863
  if (!i) throw Error("frame.postMessage: this backend cannot message the attached frame");
1847
- let a = Nn(n, r);
1864
+ let a = Vn(n, r);
1848
1865
  return i(t, a.targetOrigin, a.transfer);
1849
1866
  } catch (e) {
1850
1867
  return Promise.reject(e);
@@ -1853,7 +1870,7 @@ var ft = class {
1853
1870
  message: /* @__PURE__ */ new Set(),
1854
1871
  document: /* @__PURE__ */ new Set()
1855
1872
  }, d = null, f = (e, t) => {
1856
- if (!jn.includes(e)) throw TypeError(`frame.${t}: the event type must be ${jn.map((e) => `'${e}'`).join(" or ")}, not ${JSON.stringify(e)}`);
1873
+ if (!zn.includes(e)) throw TypeError(`frame.${t}: the event type must be ${zn.map((e) => `'${e}'`).join(" or ")}, not ${JSON.stringify(e)}`);
1857
1874
  return u[e];
1858
1875
  }, p = (e) => {
1859
1876
  let t = e.type === "message" ? Object.freeze({
@@ -1869,7 +1886,7 @@ var ft = class {
1869
1886
  for (let n of [...u[e.type]]) try {
1870
1887
  n(t);
1871
1888
  } catch (e) {
1872
- Vn(e);
1889
+ Yn(e);
1873
1890
  }
1874
1891
  }, m = (e, t) => {
1875
1892
  if (f(e, "off").delete(t), d !== null && !u.message.size && !u.document.size) {
@@ -1902,7 +1919,7 @@ var ft = class {
1902
1919
  off: m
1903
1920
  };
1904
1921
  return _;
1905
- }, Un = [
1922
+ }, Zn = [
1906
1923
  h,
1907
1924
  t,
1908
1925
  g,
@@ -1916,43 +1933,43 @@ var ft = class {
1916
1933
  l,
1917
1934
  f,
1918
1935
  u,
1919
- wn,
1920
- Tn,
1936
+ Mn,
1937
+ Nn,
1921
1938
  m,
1922
1939
  r,
1940
+ qe,
1941
+ Je,
1923
1942
  Ye,
1924
- Xe,
1925
- Ze,
1926
- it,
1927
- ot
1928
- ], Wn = _n.map((e) => e.id), Gn = {
1943
+ lt,
1944
+ dt
1945
+ ], Qn = Tn.map((e) => e.id), $n = {
1929
1946
  interaction: "act.click",
1930
1947
  storage: "read.text",
1931
1948
  network: "network.fetchCredentialed",
1932
1949
  evaluation: "media.appearU"
1933
- }, Kn = (e) => e === 0 ? "auto" : e === 4 ? "critical" : "bundled", qn = Un, X = /* @__PURE__ */ new Map(), Jn = {};
1950
+ }, er = (e) => e === 0 ? "auto" : e === 4 ? "critical" : "bundled", tr = Zn, Y = /* @__PURE__ */ new Map(), nr = {};
1934
1951
  (() => {
1935
- X = new Map(qn.map((e) => [e.scope, e])), Jn = Object.fromEntries(X), qn.filter((e) => e.severity === 4).map((e) => e.scope);
1936
- let e = (e) => qn.filter((t) => t.category === e && Kn(t.severity) === "bundled");
1937
- Object.fromEntries(Wn.map((t) => [t, Math.max(0, ...e(t).map((e) => e.severity))])), Object.fromEntries(Wn.map((t) => [t, e(t).some((e) => e.unsafe === !0)]));
1952
+ Y = new Map(tr.map((e) => [e.scope, e])), nr = Object.fromEntries(Y), tr.filter((e) => e.severity === 4).map((e) => e.scope);
1953
+ let e = (e) => tr.filter((t) => t.category === e && er(t.severity) === "bundled");
1954
+ Object.fromEntries(Qn.map((t) => [t, Math.max(0, ...e(t).map((e) => e.severity))])), Object.fromEntries(Qn.map((t) => [t, e(t).some((e) => e.unsafe === !0)]));
1938
1955
  })();
1939
- var Yn = (e) => X.get(e)?.category, Xn = (e) => {
1940
- let t = X.get(e);
1941
- return t && Kn(t.severity);
1942
- }, Zn = (e) => {
1943
- let t = X.get(e);
1944
- if (t) return Kn(t.severity) === "critical" ? t.scope : t.category;
1945
- }, Qn = (e) => Gn[e], $n = ({ category: e, key: t }) => {
1946
- let n = t ?? (e && Qn(e));
1947
- return n !== void 0 && Yn(n) !== void 0 ? n : void 0;
1948
- }, er = (e, t) => {
1949
- for (let { category: n, key: r } of t) if ($n({
1956
+ var rr = (e) => Y.get(e)?.category, ir = (e) => {
1957
+ let t = Y.get(e);
1958
+ return t && er(t.severity);
1959
+ }, ar = (e) => {
1960
+ let t = Y.get(e);
1961
+ if (t) return er(t.severity) === "critical" ? t.scope : t.category;
1962
+ }, or = (e) => $n[e], sr = ({ category: e, key: t }) => {
1963
+ let n = t ?? (e && or(e));
1964
+ return n !== void 0 && rr(n) !== void 0 ? n : void 0;
1965
+ }, cr = (e, t) => {
1966
+ for (let { category: n, key: r } of t) if (sr({
1950
1967
  category: n,
1951
1968
  key: r
1952
1969
  }) === void 0) throw TypeError(r === void 0 ? n === void 0 ? `${e}: name a category or a permission key` : `${e}: unknown permission category "${n}"` : `${e}: unknown permission key "${r}"`);
1953
- }, tr = (e, t = {}) => {
1970
+ }, lr = (e, t = {}) => {
1954
1971
  let n = [], r = e.map((e) => {
1955
- let r = $n(e), i = [];
1972
+ let r = sr(e), i = [];
1956
1973
  if (r !== void 0) for (let a of e.hosts) i.push(n.length), n.push({
1957
1974
  ...t,
1958
1975
  key: r,
@@ -1962,8 +1979,8 @@ var Yn = (e) => X.get(e)?.category, Xn = (e) => {
1962
1979
  reason: e.reason
1963
1980
  });
1964
1981
  return {
1965
- key: r !== void 0 && Xn(r) === "critical" ? r : void 0,
1966
- category: r === void 0 ? e.category ?? "interaction" : Jn[r].category,
1982
+ key: r !== void 0 && ir(r) === "critical" ? r : void 0,
1983
+ category: r === void 0 ? e.category ?? "interaction" : nr[r].category,
1967
1984
  hosts: e.hosts,
1968
1985
  indexes: i
1969
1986
  };
@@ -1977,31 +1994,31 @@ var Yn = (e) => X.get(e)?.category, Xn = (e) => {
1977
1994
  allow: i.length > 0 && i.every((t) => e[t]?.allow === !0)
1978
1995
  }))
1979
1996
  };
1980
- }, nr = (e) => typeof e == "object" && !!e, rr = typeof chrome < "u" && !!chrome.runtime?.id, ir = (e) => nr(e) && e.FKN_WEB_EXTENSION_FRAME_ANNOUNCE_KEY === !0 && typeof e.frameId == "string" && typeof e.document == "string", ar = /* @__PURE__ */ new WeakMap(), or = /* @__PURE__ */ new WeakMap(), sr = /* @__PURE__ */ new WeakMap(), cr = /* @__PURE__ */ new Set();
1981
- typeof window < "u" && rr && window.addEventListener("message", (e) => {
1982
- if (!ir(e.data)) return;
1997
+ }, ur = (e) => typeof e == "object" && !!e, dr = typeof chrome < "u" && !!chrome.runtime?.id, fr = (e) => ur(e) && e.FKN_WEB_EXTENSION_FRAME_ANNOUNCE_KEY === !0 && typeof e.frameId == "string" && typeof e.document == "string", pr = /* @__PURE__ */ new WeakMap(), mr = /* @__PURE__ */ new WeakMap(), hr = /* @__PURE__ */ new WeakMap(), gr = /* @__PURE__ */ new Set();
1998
+ typeof window < "u" && dr && window.addEventListener("message", (e) => {
1999
+ if (!fr(e.data)) return;
1983
2000
  e.stopImmediatePropagation();
1984
2001
  let t = e.source;
1985
2002
  if (!t || typeof t != "object") return;
1986
- let n = t, r = ar.get(n), i = e.data.frameId, a = e.data.document;
1987
- if (ar.set(n, i), or.set(n, a), r) for (let e of cr) e(r);
1988
- let o = sr.get(n);
2003
+ let n = t, r = pr.get(n), i = e.data.frameId, a = e.data.document;
2004
+ if (pr.set(n, i), mr.set(n, a), r) for (let e of gr) e(r);
2005
+ let o = hr.get(n);
1989
2006
  if (o) {
1990
2007
  for (let e of [...o]) (e.notDocument === void 0 || e.notDocument !== a) && (o.delete(e), e.resolve(i));
1991
- o.size || sr.delete(n);
2008
+ o.size || hr.delete(n);
1992
2009
  }
1993
2010
  }, { capture: !0 });
1994
2011
  //#endregion
1995
2012
  //#region ../web-extension/lib/lib/evaluate-deadline.js
1996
- var lr = 3e4, ur = `frame.evaluate: the code did not settle within ${lr}ms`, dr = () => new V(ur), fr = (e) => H(e) && e.message === ur ? dr() : e, pr = [
2013
+ var _r = 3e4, vr = `frame.evaluate: the code did not settle within ${_r}ms`, yr = () => new z(vr), br = (e) => B(e) && e.message === vr ? yr() : e, xr = [
1997
2014
  /^frame load timed out after \d+ms for /,
1998
2015
  /^frame goto: documentstart timed out$/,
1999
2016
  /^navigation to .+ did not commit a document within \d+ms$/s
2000
- ], mr = (e) => {
2001
- if (e instanceof V) return e;
2017
+ ], Sr = (e) => {
2018
+ if (e instanceof z) return e;
2002
2019
  let t = typeof e?.message == "string" ? e.message : "";
2003
- return pr.some((e) => e.test(t)) ? new V(t) : e;
2004
- }, hr = (e) => {
2020
+ return xr.some((e) => e.test(t)) ? new z(t) : e;
2021
+ }, Cr = (e) => {
2005
2022
  let t = e;
2006
2023
  if (t.window === void 0) return "iframe";
2007
2024
  if (t.iframe !== void 0) throw TypeError("attachFrame: pass either iframe or window, not both");
@@ -2009,11 +2026,11 @@ var lr = 3e4, ur = `frame.evaluate: the code did not settle within ${lr}ms`, dr
2009
2026
  if (t.blank !== void 0) throw TypeError("attachFrame: blank does not apply to a window");
2010
2027
  if (typeof t.window != "object" || t.window === null) throw TypeError("attachFrame: window must be an object");
2011
2028
  return "window";
2012
- }, gr = (e, t, n) => {
2029
+ }, wr = (e, t, n) => {
2013
2030
  if (e === void 0) return t;
2014
2031
  if (typeof e != "number" || !Number.isFinite(e) || e <= 0) throw TypeError(`attachFrame: window.${n} must be a positive number of CSS pixels`);
2015
2032
  return Math.round(e);
2016
- }, _r = ({ url: e, width: t, height: n }) => {
2033
+ }, Tr = ({ url: e, width: t, height: n }) => {
2017
2034
  let r = (() => {
2018
2035
  if (e === void 0 || e === "" || e === "about:blank") return "";
2019
2036
  if (typeof e != "string") throw TypeError("attachFrame: window.url must be a string");
@@ -2027,12 +2044,12 @@ var lr = 3e4, ur = `frame.evaluate: the code did not settle within ${lr}ms`, dr
2027
2044
  if (t.protocol !== "http:" && t.protocol !== "https:") throw TypeError("attachFrame: window.url must be an http or https address");
2028
2045
  return t.href;
2029
2046
  })();
2030
- return r && Y(r), {
2047
+ return r && J(r), {
2031
2048
  url: r,
2032
- width: gr(t, 500, "width"),
2033
- height: gr(n, 700, "height")
2049
+ width: wr(t, 500, "width"),
2050
+ height: wr(n, 700, "height")
2034
2051
  };
2035
- }, vr = "attachFrame: storageState seeds a fresh jar, so it needs cookies: 'ephemeral'", yr = 1e11, br = [
2052
+ }, Er = "attachFrame: storageState seeds a fresh jar, so it needs cookies: 'ephemeral'", Dr = 1e11, Or = [
2036
2053
  "name",
2037
2054
  "value",
2038
2055
  "domain",
@@ -2041,11 +2058,11 @@ var lr = 3e4, ur = `frame.evaluate: the code did not settle within ${lr}ms`, dr
2041
2058
  "httpOnly",
2042
2059
  "secure",
2043
2060
  "sameSite"
2044
- ], xr = [
2061
+ ], kr = [
2045
2062
  "Strict",
2046
2063
  "Lax",
2047
2064
  "None"
2048
- ], Sr = /[;\x00-\x1f\x7f]/, Z = (e, t) => /* @__PURE__ */ TypeError(`attachFrame: storageState${e} ${t}`), Q = (e) => Object.prototype.toString.call(e) === "[object Object]", Cr = (e) => {
2065
+ ], X = /[;\x00-\x1f\x7f]/, Z = (e, t) => /* @__PURE__ */ TypeError(`attachFrame: storageState${e} ${t}`), Q = (e) => Object.prototype.toString.call(e) === "[object Object]", Ar = (e) => {
2049
2066
  let t = e.startsWith(".") ? e.slice(1) : e;
2050
2067
  if (t === "") return null;
2051
2068
  try {
@@ -2053,19 +2070,19 @@ var lr = 3e4, ur = `frame.evaluate: the code did not settle within ${lr}ms`, dr
2053
2070
  } catch {
2054
2071
  return null;
2055
2072
  }
2056
- }, wr = (e, t) => {
2073
+ }, jr = (e, t) => {
2057
2074
  if (!Q(e)) throw Z(t, "must be an object");
2058
- let n = Object.keys(e).find((e) => !br.includes(e));
2075
+ let n = Object.keys(e).find((e) => !Or.includes(e));
2059
2076
  if (n !== void 0) throw Z(`${t}.${n}`, "is not a cookie field");
2060
2077
  let { name: r, value: i, domain: a, path: o, expires: s, httpOnly: c, secure: l, sameSite: u } = e;
2061
- if (typeof r != "string" || r === "" || r.includes("=") || Sr.test(r)) throw Z(`${t}.name`, "must be a non-empty string with no \"=\", \";\" or control character");
2062
- if (typeof i != "string" || Sr.test(i)) throw Z(`${t}.value`, "must be a string with no \";\" or control character");
2063
- if (typeof a != "string" || Cr(a) === null) throw Z(`${t}.domain`, "must be a host: \".youtube.com\" for a cookie its subdomains also receive, \"www.youtube.com\" for a host-only one");
2064
- if (o !== void 0 && (typeof o != "string" || !o.startsWith("/") || Sr.test(o))) throw Z(`${t}.path`, "must be a string starting with \"/\"");
2078
+ if (typeof r != "string" || r === "" || r.includes("=") || X.test(r)) throw Z(`${t}.name`, "must be a non-empty string with no \"=\", \";\" or control character");
2079
+ if (typeof i != "string" || X.test(i)) throw Z(`${t}.value`, "must be a string with no \";\" or control character");
2080
+ if (typeof a != "string" || Ar(a) === null) throw Z(`${t}.domain`, "must be a host: \".youtube.com\" for a cookie its subdomains also receive, \"www.youtube.com\" for a host-only one");
2081
+ if (o !== void 0 && (typeof o != "string" || !o.startsWith("/") || X.test(o))) throw Z(`${t}.path`, "must be a string starting with \"/\"");
2065
2082
  if (s !== void 0 && (typeof s != "number" || !Number.isFinite(s) || s <= 0 && s !== -1)) throw Z(`${t}.expires`, "must be -1 for a session cookie, or milliseconds since the epoch");
2066
2083
  if (c !== void 0 && typeof c != "boolean") throw Z(`${t}.httpOnly`, "must be a boolean");
2067
2084
  if (l !== void 0 && typeof l != "boolean") throw Z(`${t}.secure`, "must be a boolean");
2068
- if (u !== void 0 && !xr.includes(u)) throw Z(`${t}.sameSite`, `must be 'Strict', 'Lax' or 'None', not ${JSON.stringify(u)}`);
2085
+ if (u !== void 0 && !kr.includes(u)) throw Z(`${t}.sameSite`, `must be 'Strict', 'Lax' or 'None', not ${JSON.stringify(u)}`);
2069
2086
  let d = r.toLowerCase();
2070
2087
  if (u === "None" && l !== !0) throw Z(t, "is SameSite=None, which needs secure: true");
2071
2088
  if (d.startsWith("__secure-") && l !== !0) throw Z(t, "is a __Secure- cookie, which needs secure: true");
@@ -2076,7 +2093,7 @@ var lr = 3e4, ur = `frame.evaluate: the code did not settle within ${lr}ms`, dr
2076
2093
  domain: a
2077
2094
  };
2078
2095
  return o !== void 0 && (f.path = o), s !== void 0 && (f.expires = s), c !== void 0 && (f.httpOnly = c), l !== void 0 && (f.secure = l), u !== void 0 && (f.sameSite = u), f;
2079
- }, Tr = (e, t) => {
2096
+ }, Mr = (e, t) => {
2080
2097
  if (!Q(e)) throw Z(t, "must be an object { origin, localStorage }");
2081
2098
  let n = Object.keys(e).find((e) => e !== "origin" && e !== "localStorage");
2082
2099
  if (n !== void 0) throw Z(`${t}.${n}`, "is not an origin field");
@@ -2100,30 +2117,30 @@ var lr = 3e4, ur = `frame.evaluate: the code did not settle within ${lr}ms`, dr
2100
2117
  };
2101
2118
  })
2102
2119
  };
2103
- }, Er = (e) => {
2120
+ }, Nr = (e) => {
2104
2121
  if (!Q(e)) throw Z("", "must be an object { cookies?, origins? }");
2105
2122
  let t = Object.keys(e).find((e) => e !== "cookies" && e !== "origins");
2106
2123
  if (t !== void 0) throw Z(`.${t}`, "is not a storageState key; it takes cookies and origins");
2107
2124
  let { cookies: n = [], origins: r = [] } = e;
2108
2125
  if (!Array.isArray(n)) throw Z(".cookies", "must be an array");
2109
2126
  if (!Array.isArray(r)) throw Z(".origins", "must be an array");
2110
- let i = n.map((e, t) => wr(e, `.cookies[${t}]`)), a = r.map((e, t) => Tr(e, `.origins[${t}]`));
2127
+ let i = n.map((e, t) => jr(e, `.cookies[${t}]`)), a = r.map((e, t) => Mr(e, `.origins[${t}]`));
2111
2128
  return i.forEach(({ expires: e }, t) => {
2112
- if (e !== void 0 && e > 0 && e < yr) throw Z(`.cookies[${t}].expires`, `is milliseconds since the epoch, and ${e} reads as a date before 1974; a Playwright storageState gives seconds, so multiply it by 1000`);
2129
+ if (e !== void 0 && e > 0 && e < Dr) throw Z(`.cookies[${t}].expires`, `is milliseconds since the epoch, and ${e} reads as a date before 1974; a Playwright storageState gives seconds, so multiply it by 1000`);
2113
2130
  }), {
2114
2131
  cookies: i,
2115
2132
  origins: a
2116
2133
  };
2117
- }, Dr = [
2134
+ }, Pr = [
2118
2135
  "persistent",
2119
2136
  "ephemeral",
2120
2137
  "native"
2121
- ], Or = "attachFrame: syncCookies was replaced by cookies. true is cookies: 'persistent', or 'native' for the person's own browser cookies on the extension; false is cookies: 'ephemeral'", kr = (e) => {
2122
- if ("syncCookies" in e) throw TypeError(Or);
2138
+ ], Fr = "attachFrame: syncCookies was replaced by cookies. true is cookies: 'persistent', or 'native' for the person's own browser cookies on the extension; false is cookies: 'ephemeral'", Ir = (e) => {
2139
+ if ("syncCookies" in e) throw TypeError(Fr);
2123
2140
  let { cookies: t = "persistent" } = e;
2124
- if (!Dr.includes(t)) throw TypeError(`attachFrame: cookies must be 'persistent', 'ephemeral' or 'native', not ${JSON.stringify(t)}`);
2125
- if (e.storageState !== void 0 && t !== "ephemeral") throw TypeError(vr);
2126
- let n = e.storageState === void 0 ? void 0 : Er(e.storageState), r = hr(e);
2141
+ if (!Pr.includes(t)) throw TypeError(`attachFrame: cookies must be 'persistent', 'ephemeral' or 'native', not ${JSON.stringify(t)}`);
2142
+ if (e.storageState !== void 0 && t !== "ephemeral") throw TypeError(Er);
2143
+ let n = e.storageState === void 0 ? void 0 : Nr(e.storageState), r = Cr(e);
2127
2144
  if (r === "iframe" && e.lockdown && t !== "native") throw TypeError("attachFrame: lockdown runs on the extension, which serves only cookies: 'native'");
2128
2145
  return n === void 0 ? {
2129
2146
  kind: r,
@@ -2133,20 +2150,20 @@ var lr = 3e4, ur = `frame.evaluate: the code did not settle within ${lr}ms`, dr
2133
2150
  cookies: t,
2134
2151
  storageState: n
2135
2152
  };
2136
- }, Ar = (e) => {
2153
+ }, Lr = (e) => {
2137
2154
  try {
2138
2155
  return new URL(e).hostname;
2139
2156
  } catch {
2140
2157
  return "";
2141
2158
  }
2142
- }, jr = "FKN_WEB_EXTENSION_ATTACH_FRAME_EVENT_KEY", Mr = !1, Nr = () => {
2143
- Mr || (Mr = !0, console.warn("[fkn-frame] the installed FKN WebExtension is too old to ask for permission categories upfront, so each capability will be asked for as it is first used. Updating the extension fixes this."));
2144
- }, Pr = "frame: this frame no longer holds the document the app attached it to", Fr = "frame.postMessage: '*' is not served on the extension yet, since this extension does not report the frame's origin; pass the page's origin as targetOrigin", Ir = () => {
2159
+ }, Rr = "FKN_WEB_EXTENSION_ATTACH_FRAME_EVENT_KEY", zr = !1, Br = () => {
2160
+ zr || (zr = !0, console.warn("[fkn-frame] the installed FKN WebExtension is too old to ask for permission categories upfront, so each capability will be asked for as it is first used. Updating the extension fixes this."));
2161
+ }, Vr = "frame: this frame no longer holds the document the app attached it to", Hr = "frame.postMessage: '*' is not served on the extension yet, since this extension does not report the frame's origin; pass the page's origin as targetOrigin", Ur = () => {
2145
2162
  let e = E();
2146
2163
  if (e.status === "ok" && e.abi >= 1) return;
2147
2164
  let t = e.status === "absent" ? 0 : e.abi;
2148
2165
  throw new T("lockdown", t, `attachFrame: the installed FKN WebExtension (ABI ${t}) may predate lockdown, and one that does attaches the frame with its CSP removed rather than locked down. Updating the extension fixes this.`);
2149
- }, Lr = (e) => {
2166
+ }, Wr = (e) => {
2150
2167
  try {
2151
2168
  return new URL(e, location.href).hostname;
2152
2169
  } catch {
@@ -2155,28 +2172,28 @@ var lr = 3e4, ur = `frame.evaluate: the code did not settle within ${lr}ms`, dr
2155
2172
  }, $ = () => {
2156
2173
  let e = E();
2157
2174
  return e.status === "absent" ? 0 : e.abi;
2158
- }, Rr = "attachFrame: a blank page is served by the cloud render proxy only; call cloud.attachFrame", zr = "frame.addScriptTag: an extension frame does not run scripts through mirage yet; attach with cloud.attachFrame", Br = "frame.clearCookies: an extension frame runs on the browser's own cookies (cookies: 'native'), which FKN does not clear; attach with cookies: 'persistent' to clear the app's jar", Vr = async ({ iframe: e, domains: t = [], lockdown: n = !1, permissions: r, blank: i }) => {
2159
- if (i !== void 0) throw new T("blank", $(), Rr);
2175
+ }, Gr = "attachFrame: a blank page is served by the cloud render proxy only; call cloud.attachFrame", Kr = "frame.addScriptTag: an extension frame does not run scripts through mirage yet; attach with cloud.attachFrame", qr = "frame.clearCookies: an extension frame runs on the browser's own cookies (cookies: 'native'), which FKN does not clear; attach with cookies: 'persistent' to clear the app's jar", Jr = async ({ iframe: e, domains: t = [], lockdown: n = !1, permissions: r, blank: i }) => {
2176
+ if (i !== void 0) throw new T("blank", $(), Gr);
2160
2177
  let a = crypto.randomUUID();
2161
- if (Y(e.src), Cn({
2178
+ if (J(e.src), jn({
2162
2179
  src: e.src,
2163
2180
  domains: t,
2164
2181
  lockdown: n
2165
- }), await D(), n && Ir(), !e.isConnected) throw Error("attachFrame: the iframe must be connected to the document before attaching");
2166
- e.dispatchEvent(new CustomEvent(jr, { detail: a }));
2167
- let { executeLocator: o, highlightLocator: s, ensureLocatorPermission: c, requestCategories: l, evaluateFrame: u, goto: d } = await O.attachFrame({
2182
+ }), ct("attachFrame", t), await O(), n && Ur(), !e.isConnected) throw Error("attachFrame: the iframe must be connected to the document before attaching");
2183
+ e.dispatchEvent(new CustomEvent(Rr, { detail: a }));
2184
+ let { executeLocator: o, highlightLocator: s, ensureLocatorPermission: c, requestCategories: l, evaluateFrame: u, goto: d } = await k.attachFrame({
2168
2185
  marker: a,
2169
2186
  domains: t,
2170
2187
  syncCookies: !0,
2171
2188
  lockdown: n
2172
- }), f = new Set(p([...t, Lr(e.src)], { ipv6: !0 })), m = (e) => f.has(p([Ar(e)], { ipv6: !0 })[0] ?? ""), h = Hn({
2189
+ }), f = new Set(p([...t, Wr(e.src)], { ipv6: !0 })), m = (e) => f.has(p([Lr(e)], { ipv6: !0 })[0] ?? ""), h = Xn({
2173
2190
  backend: "extension",
2174
2191
  executor: {
2175
2192
  execute: o,
2176
2193
  highlight: s
2177
2194
  },
2178
2195
  gate: (e) => c(e.parts, e.operation, e.args),
2179
- requestPermissions: async (e) => (er("frame.requestPermissions", e), await mn(), l(e)),
2196
+ requestPermissions: async (e) => (cr("frame.requestPermissions", e), await Sn(), l(e)),
2180
2197
  evaluate: async (e, t) => {
2181
2198
  if (!Me(E(), "evaluate")) {
2182
2199
  let e = E();
@@ -2186,25 +2203,25 @@ var lr = 3e4, ur = `frame.evaluate: the code did not settle within ${lr}ms`, dr
2186
2203
  source: e,
2187
2204
  arg: t
2188
2205
  }).catch((e) => {
2189
- throw fr(e);
2206
+ throw br(e);
2190
2207
  });
2191
2208
  },
2192
2209
  addScriptTag: async () => {
2193
- throw new T("addScriptTag", $(), zr);
2210
+ throw new T("addScriptTag", $(), Kr);
2194
2211
  },
2195
2212
  clearCookies: async () => {
2196
- throw new T("clearCookies", $(), Br);
2213
+ throw new T("clearCookies", $(), qr);
2197
2214
  },
2198
2215
  postMessage: (t, n, r) => {
2199
- if (n === "*") throw z(Fr, "postMessage", "extension");
2200
- if (!m(n)) throw B(Pr, "postMessage");
2216
+ if (n === "*") throw Tt(Hr, "postMessage", "extension");
2217
+ if (!m(n)) throw Dt(Vr, "postMessage");
2201
2218
  let i = e.contentWindow;
2202
- if (i === null) throw B("frame: navigate the frame before postMessage", "postMessage");
2219
+ if (i === null) throw Dt("frame: navigate the frame before postMessage", "postMessage");
2203
2220
  return i.postMessage(t, n, r), Promise.resolve();
2204
2221
  },
2205
2222
  listen: (t) => {
2206
2223
  let n = (n) => {
2207
- n.source !== null && n.source === e.contentWindow && !ir(n.data) && m(n.origin) && t({
2224
+ n.source !== null && n.source === e.contentWindow && !fr(n.data) && m(n.origin) && t({
2208
2225
  type: "message",
2209
2226
  data: n.data,
2210
2227
  origin: n.origin,
@@ -2219,26 +2236,27 @@ var lr = 3e4, ur = `frame.evaluate: the code did not settle within ${lr}ms`, dr
2219
2236
  };
2220
2237
  },
2221
2238
  goto: (e, { waitUntil: t, timeout: n, ...r } = {}) => {
2222
- for (let t of p([Lr(e)], { ipv6: !0 })) f.add(t);
2239
+ ct("frame.goto", [Wr(e), ...r.domains ?? []]);
2240
+ for (let t of p([Wr(e)], { ipv6: !0 })) f.add(t);
2223
2241
  return d({
2224
2242
  url: e,
2225
2243
  ...r,
2226
2244
  ...t === void 0 ? {} : { waitUntil: t === "commit" ? "documentstart" : t },
2227
2245
  ...n === void 0 ? {} : { timeoutMs: n }
2228
2246
  }).catch((e) => {
2229
- throw mr(e);
2247
+ throw Sr(e);
2230
2248
  });
2231
2249
  },
2232
2250
  url: () => e.src
2233
2251
  });
2234
- return r?.length && (pn() ? await h.requestPermissions(r) : Nr()), h;
2235
- }, Hr = "attachFrame: a window on cookies: 'native' is not served yet; a window runs on the cloud render proxy, which has no browser cookies", Ur = (e) => `attachFrame: cookies: '${e}' runs on the cloud render proxy; call cloud.attachFrame or the top-level attachFrame`, Wr = async (e) => {
2236
- throw _r(e.window), new T("attachWindow", $(), Hr);
2237
- }, Gr = (async (e) => {
2238
- let { kind: t, cookies: n } = kr(e);
2239
- if (n !== "native") throw new T("cookies", $(), Ur(n));
2240
- return t === "window" ? Wr(e) : Vr(e);
2241
- }), Kr = "permissions.request: pass hosts, the sites the grant applies to", qr = { request: async (e) => {
2252
+ return r?.length && (xn() ? await h.requestPermissions(r) : Br()), h;
2253
+ }, Yr = "attachFrame: a window on cookies: 'native' is not served yet; a window runs on the cloud render proxy, which has no browser cookies", Xr = (e) => `attachFrame: cookies: '${e}' runs on the cloud render proxy; call cloud.attachFrame or the top-level attachFrame`, Zr = async (e) => {
2254
+ throw Tr(e.window), new T("attachWindow", $(), Yr);
2255
+ }, Qr = (async (e) => {
2256
+ let { kind: t, cookies: n } = Ir(e);
2257
+ if (n !== "native") throw new T("cookies", $(), Xr(n));
2258
+ return t === "window" ? Zr(e) : Jr(e);
2259
+ }), $r = "permissions.request: pass hosts, the sites the grant applies to", ei = { request: async (e) => {
2242
2260
  let t = e.map((e) => {
2243
2261
  let { category: t, key: n, scope: r, reason: i, hosts: a } = e;
2244
2262
  if (!("hosts" in e) && !("category" in e)) return { legacy: {
@@ -2247,17 +2265,17 @@ var lr = 3e4, ur = `frame.evaluate: the code did not settle within ${lr}ms`, dr
2247
2265
  reason: i
2248
2266
  } };
2249
2267
  let o = p(a ?? [], { ipv6: !0 });
2250
- if (!o.length) throw TypeError(Kr);
2251
- return { ask: {
2268
+ if (!o.length) throw TypeError($r);
2269
+ return ot("permissions.request", o), { ask: {
2252
2270
  category: t,
2253
2271
  key: n,
2254
2272
  reason: i,
2255
2273
  hosts: o
2256
2274
  } };
2257
2275
  }), n = t.flatMap((e) => "ask" in e ? [e.ask] : []);
2258
- er("permissions.request", n), n.length && await mn();
2259
- let { items: r, answer: i } = tr(n), a = t.flatMap((e) => "legacy" in e ? [e.legacy] : []), o = [...r, ...a], s = o.length ? await O.requestPermissions(o) : [], c = i(s.slice(0, r.length)), l = s.slice(r.length), u = 0, d = 0;
2276
+ cr("permissions.request", n), n.length && await Sn();
2277
+ let { items: r, answer: i } = lr(n), a = t.flatMap((e) => "legacy" in e ? [e.legacy] : []), o = [...r, ...a], s = o.length ? await k.requestPermissions(o) : [], c = i(s.slice(0, r.length)), l = s.slice(r.length), u = 0, d = 0;
2260
2278
  return t.map((e) => "ask" in e ? c[u++] : l[d++]);
2261
- } }, Jr = "PermissionDeniedError", Yr = (e) => e instanceof Error ? e.name === Jr : nr(e) && e.name === "PermissionDeniedError";
2279
+ } }, ti = "PermissionDeniedError", ni = (e) => e instanceof Error ? e.name === ti : ur(e) && e.name === "PermissionDeniedError";
2262
2280
  //#endregion
2263
- export { Fe as $, vt as A, at as B, Sn as C, bt as D, P as E, xt as F, Ze as G, tt as H, I, $e as J, Ye as K, ot as L, z as M, St as N, B as O, _t as P, Ue as Q, ct as R, Cn as S, V as T, rt as U, it as V, Xe as W, Ge as X, Ve as Y, We as Z, An as _, Gr as a, T as at, Tn as b, mr as c, je as ct, nr as d, C as dt, Ie as et, er as f, ve as ft, On as g, Xn as h, jr as i, Se as it, H as j, F as k, lr as l, xe as lt, Zn as m, x as mt, Yr as n, Re as nt, kr as o, w as ot, Yn as p, be as pt, et as q, qr as r, D as rt, _r as s, Ce as st, Jr as t, E as tt, dr as u, ye as ut, wn as v, _n as w, Y as x, Hn as y, st as z };
2281
+ export { Fe as $, Et as A, ut as B, An as C, kt as D, I as E, At as F, Ye as G, $e as H, Ct as I, Ze as J, qe as K, dt as L, Tt as M, jt as N, Dt as O, St as P, He as Q, pt as R, jn as S, z as T, tt as U, lt as V, Je as W, We as X, Be as Y, Ue as Z, Rn as _, Qr as a, T as at, Nn as b, Sr as c, je as ct, ur as d, _e as dt, Ie as et, cr as f, ve as ft, In as g, ir as h, Rr as i, Se as it, B as j, L as k, _r as l, xe as lt, ar as m, C as mt, ni as n, Le as nt, Ir as o, w as ot, rr as p, be as pt, Qe as q, ei as r, O as rt, Tr as s, Ce as st, ti as t, E as tt, yr as u, ye as ut, Mn as v, Tn as w, J as x, Xn as y, ft as z };