@fkn/lib 0.9.44 → 0.9.45
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.
- package/{api-CFkZVr53.d.ts → api-Cuf3ynZX.d.ts} +23 -1
- package/api.d.ts +2 -2
- package/cloud/dns.d.ts +1 -1
- package/cloud/fetch.d.ts +1 -1
- package/cloud/net.d.ts +1 -1
- package/cloud-CKCrMMB_.cjs +1 -0
- package/cloud-CVWGyZRT.js +559 -0
- package/{cloud-DyOQPyUB.d.ts → cloud-KBzjWzt1.d.ts} +3 -3
- package/cloud.cjs +1 -1
- package/cloud.d.ts +3 -3
- package/cloud.js +1 -1
- package/{contract-6Xfd_qel.d.ts → contract-DP_jc5pZ.d.ts} +54 -7
- package/contract.cjs +1 -1
- package/contract.d.ts +3 -3
- package/contract.js +9 -3
- package/dgram.d.ts +2 -2
- package/dns.d.ts +1 -1
- package/extension-Dmnh5pcs.js +94 -0
- package/{extension-BlEtNAYc.d.ts → extension-X8cnvZej.d.ts} +1 -1
- package/extension-YBe6Q6r_.cjs +1 -0
- package/extension.cjs +1 -1
- package/extension.d.ts +2 -2
- package/extension.js +3 -3
- package/http.d.ts +1 -1
- package/{index-BOInGaEl.d.ts → index-C8Y-YHrU.d.ts} +11 -3
- package/index.cjs +1 -1
- package/index.d.ts +4 -4
- package/index.js +12 -12
- package/lib-D4uqe_rb.cjs +53 -0
- package/{lib-C3UwxjVs.js → lib-H5-e2A1h.js} +483 -468
- package/{net-CmMZgV2a.d.ts → net-eyWUIVn2.d.ts} +2 -2
- package/net.d.ts +1 -1
- package/package.json +1 -1
- package/packages.d.ts +1 -1
- package/{proxy-dOOmiMl4.d.ts → proxy-8Zp-G5da.d.ts} +2 -2
- package/rooms.d.ts +1 -1
- package/cloud-Bx64HSkQ.cjs +0 -1
- package/cloud-D-vDUzzx.js +0 -552
- package/extension-CzZn0bY2.js +0 -94
- package/extension-DvFf7uoG.cjs +0 -1
- package/lib-fqQfEPk6.cjs +0 -53
|
@@ -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
|
|
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
|
|
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
|
-
},
|
|
34
|
+
}, re = (e) => typeof e == "boolean" ? +!!e : +!!e?.capture, b = (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}|${
|
|
39
|
+
let a = `${n}|${re(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}|${
|
|
50
|
+
let a = `${n}|${re(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
|
-
},
|
|
55
|
+
}, x = /* @__PURE__ */ e({
|
|
56
56
|
box: () => ye,
|
|
57
|
-
createVideoElementHandle: () =>
|
|
57
|
+
createVideoElementHandle: () => _e,
|
|
58
58
|
isType: () => ve,
|
|
59
59
|
revive: () => be,
|
|
60
|
-
type: () =>
|
|
61
|
-
}),
|
|
60
|
+
type: () => S
|
|
61
|
+
}), S = "videoElement", ie = [
|
|
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
|
-
],
|
|
72
|
+
], ae = [
|
|
73
73
|
"duration",
|
|
74
74
|
"paused",
|
|
75
75
|
"ended",
|
|
76
76
|
"seeking",
|
|
77
77
|
"readyState",
|
|
78
78
|
"currentSrc"
|
|
79
|
-
],
|
|
79
|
+
], oe = ["buffered", "seekable"], se = Symbol.for("fkn.remoteVideoElement"), ce = Symbol.for("fkn.remoteVideoElement.state"), le = Symbol.for("fkn.remoteVideoElement.controller"), ue = (e) => e ? Array.from({ length: e.length }, (t, n) => [e.start(n), e.end(n)]) : [], C = (e) => {
|
|
80
80
|
let t = {};
|
|
81
|
-
for (let n of [...
|
|
82
|
-
for (let n of
|
|
81
|
+
for (let n of [...ie, ...ae]) t[n] = e[n];
|
|
82
|
+
for (let n of oe) t[n] = ue(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
|
-
},
|
|
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
|
-
},
|
|
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,
|
|
109
|
+
} : null, pe = (e) => ne(e, (e, t) => ({
|
|
110
110
|
originalDetail: e instanceof CustomEvent ? e.detail : null,
|
|
111
|
-
snapshot:
|
|
112
|
-
})),
|
|
111
|
+
snapshot: C(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
|
-
},
|
|
128
|
-
call: async (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
|
|
133
|
+
return C(e);
|
|
134
134
|
},
|
|
135
|
-
events:
|
|
136
|
-
}),
|
|
135
|
+
events: pe(e)
|
|
136
|
+
}), ge = (e, t) => {
|
|
137
137
|
let n = new EventTarget();
|
|
138
|
-
Object.defineProperty(n,
|
|
139
|
-
let r =
|
|
138
|
+
Object.defineProperty(n, se, { value: !0 }), Object.defineProperty(n, ce, { value: e }), Object.defineProperty(n, le, { value: t });
|
|
139
|
+
let r = b({
|
|
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
|
|
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
|
|
210
|
+
for (let n of ie) 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
|
|
222
|
+
for (let t of ae) 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
|
|
229
|
+
for (let t of oe) i[t] = {
|
|
230
230
|
configurable: !0,
|
|
231
231
|
enumerable: !0,
|
|
232
232
|
get() {
|
|
233
|
-
return
|
|
233
|
+
return de(e[t]);
|
|
234
234
|
}
|
|
235
235
|
};
|
|
236
236
|
return Object.defineProperties(n, i), n;
|
|
237
|
-
},
|
|
237
|
+
}, _e = (e) => ge(C(e), he(e)), ve = (e) => typeof e == "object" && !!e && e[se] === !0, ye = (e, t) => {
|
|
238
238
|
let n = e;
|
|
239
239
|
return {
|
|
240
240
|
..._,
|
|
241
|
-
type:
|
|
242
|
-
initialState: n[
|
|
243
|
-
controller:
|
|
241
|
+
type: S,
|
|
242
|
+
initialState: n[ce],
|
|
243
|
+
controller: ee(n[le], t)
|
|
244
244
|
};
|
|
245
245
|
}, be = (e, t) => {
|
|
246
|
-
let n =
|
|
247
|
-
return
|
|
248
|
-
}, xe = (e) => [
|
|
246
|
+
let n = te(e.controller, t);
|
|
247
|
+
return ge({ ...e.initialState }, n);
|
|
248
|
+
}, xe = (e) => [x, ...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),
|
|
288
|
-
|
|
289
|
-
},
|
|
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 (
|
|
298
|
-
if (await
|
|
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(),
|
|
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
|
-
}),
|
|
316
|
-
await
|
|
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
|
|
320
|
+
let n = (await ze)[t];
|
|
321
321
|
return n(...e);
|
|
322
|
-
} }),
|
|
322
|
+
} }), Be = [
|
|
323
323
|
"origin",
|
|
324
324
|
"referer",
|
|
325
325
|
"cookie"
|
|
326
|
-
],
|
|
327
|
-
if (t === "include" &&
|
|
328
|
-
},
|
|
329
|
-
let t = [...new Set((e ?? []).map(([e]) => e.trim().toLowerCase()).filter((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
|
-
},
|
|
331
|
+
}, Ge = [
|
|
332
332
|
"fkn.app",
|
|
333
333
|
"fkn.dev",
|
|
334
334
|
"sdbx.app"
|
|
335
|
-
],
|
|
336
|
-
let t =
|
|
337
|
-
return
|
|
338
|
-
},
|
|
335
|
+
], Ke = (e) => e.replace(/\.+$/, ""), qe = (e) => {
|
|
336
|
+
let t = Ke(e);
|
|
337
|
+
return Ge.some((e) => t === e || t.endsWith(`.${e}`));
|
|
338
|
+
}, Je = {
|
|
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
|
-
},
|
|
344
|
+
}, Ye = {
|
|
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
|
-
},
|
|
352
|
+
}, Xe = {
|
|
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
|
-
},
|
|
360
|
+
}, Ze = (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
|
-
},
|
|
365
|
+
}, Qe = (e) => {
|
|
366
366
|
let t;
|
|
367
367
|
try {
|
|
368
368
|
t = new URL(e);
|
|
@@ -370,40 +370,40 @@ 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:") :
|
|
374
|
-
},
|
|
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:") : Ze(n);
|
|
374
|
+
}, $e = (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:" ||
|
|
381
|
+
return t.protocol === "chrome-extension:" || t.protocol === "moz-extension:" || qe(t.hostname);
|
|
382
|
+
}, et = (e) => {
|
|
383
|
+
if ($e(e)) throw Error("fetch: refusing to target the extension's own pages or FKN platform domains");
|
|
382
384
|
}, tt = (e) => {
|
|
383
|
-
if (et(e)) throw Error("fetch: refusing to target the extension's own pages or FKN platform domains");
|
|
384
|
-
}, nt = (e) => {
|
|
385
385
|
if (!e?.headers) return;
|
|
386
|
-
let t = new Headers(e.headers), n =
|
|
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
|
-
},
|
|
391
|
+
}, nt = async (e, t) => {
|
|
392
392
|
let n = new Request(e, t);
|
|
393
|
-
|
|
393
|
+
et(n.url);
|
|
394
394
|
let r = n.body ? await n.arrayBuffer() : null;
|
|
395
|
-
return
|
|
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:
|
|
402
|
+
unsafeHeaders: tt(t),
|
|
403
403
|
reason: t?.reason,
|
|
404
404
|
signal: t?.signal ?? void 0
|
|
405
405
|
});
|
|
406
|
-
},
|
|
406
|
+
}, rt = {
|
|
407
407
|
scope: "network.readCookie",
|
|
408
408
|
category: "network",
|
|
409
409
|
severity: 3,
|
|
@@ -411,7 +411,7 @@ var Ie = () => typeof document > "u" ? !1 : document.documentElement.dataset[Pe]
|
|
|
411
411
|
unsafe: !0,
|
|
412
412
|
title: "Read a site’s cookie",
|
|
413
413
|
description: "Lets the app read a named cookie from another site, which can include the login token only that site should see."
|
|
414
|
-
},
|
|
414
|
+
}, it = { get: (e) => k.getCookie(e) }, at = {
|
|
415
415
|
scope: "network.modifyRequestHeaders",
|
|
416
416
|
category: "network",
|
|
417
417
|
severity: 2,
|
|
@@ -419,7 +419,7 @@ var Ie = () => typeof document > "u" ? !1 : document.documentElement.dataset[Pe]
|
|
|
419
419
|
unsafe: !0,
|
|
420
420
|
title: "Rewrite request headers to other sites",
|
|
421
421
|
description: "Lets the app set or remove headers (like Origin and Referer) on this page’s own requests to the listed sites."
|
|
422
|
-
},
|
|
422
|
+
}, ot = (e) => k.setRequestHeaderRule(e), st = (e) => k.removeRequestHeaderRule({ ruleId: e }), ct = class extends Error {
|
|
423
423
|
reason;
|
|
424
424
|
filename;
|
|
425
425
|
line;
|
|
@@ -428,18 +428,18 @@ var Ie = () => typeof document > "u" ? !1 : document.documentElement.dataset[Pe]
|
|
|
428
428
|
constructor(e, t, n, r, i) {
|
|
429
429
|
super(`${e}:${n}:${r}: ${t}`), this.reason = t, this.filename = e, this.line = n, this.column = r, this.source = i;
|
|
430
430
|
}
|
|
431
|
-
},
|
|
431
|
+
}, lt = class {
|
|
432
432
|
start;
|
|
433
433
|
end;
|
|
434
434
|
source;
|
|
435
435
|
constructor(e, t, n) {
|
|
436
436
|
this.start = e, this.end = t, this.source = n;
|
|
437
437
|
}
|
|
438
|
-
},
|
|
438
|
+
}, A;
|
|
439
439
|
(function(e) {
|
|
440
440
|
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
|
-
})(
|
|
442
|
-
var
|
|
441
|
+
})(A ||= {});
|
|
442
|
+
var ut = (e, t, n) => {
|
|
443
443
|
let r = n, i = 1e4;
|
|
444
444
|
do {
|
|
445
445
|
let n = t.map((t) => e.indexOf(t, r));
|
|
@@ -451,7 +451,7 @@ var dt = (e, t, n) => {
|
|
|
451
451
|
r = o + 2, i--;
|
|
452
452
|
} while (i > 0);
|
|
453
453
|
throw Error("Too many escaping");
|
|
454
|
-
},
|
|
454
|
+
}, j = (e, t, n) => {
|
|
455
455
|
let r = n, i = 1e4;
|
|
456
456
|
do {
|
|
457
457
|
let n = t.map((t) => e.indexOf(t, r));
|
|
@@ -465,21 +465,21 @@ var dt = (e, t, n) => {
|
|
|
465
465
|
break;
|
|
466
466
|
case "(":
|
|
467
467
|
{
|
|
468
|
-
let t =
|
|
468
|
+
let t = j(e, [")"], o + 1);
|
|
469
469
|
if (t === -1) return -1;
|
|
470
470
|
r = t + 1;
|
|
471
471
|
}
|
|
472
472
|
break;
|
|
473
473
|
case "\"":
|
|
474
474
|
{
|
|
475
|
-
let t =
|
|
475
|
+
let t = ut(e, ["\""], o + 1);
|
|
476
476
|
if (t === -1) return -1;
|
|
477
477
|
r = t + 1;
|
|
478
478
|
}
|
|
479
479
|
break;
|
|
480
480
|
case "'":
|
|
481
481
|
{
|
|
482
|
-
let t =
|
|
482
|
+
let t = ut(e, ["'"], o + 1);
|
|
483
483
|
if (t === -1) return -1;
|
|
484
484
|
r = t + 1;
|
|
485
485
|
}
|
|
@@ -489,17 +489,17 @@ var dt = (e, t, n) => {
|
|
|
489
489
|
i--;
|
|
490
490
|
} while (i > 0);
|
|
491
491
|
throw Error("Too many escaping");
|
|
492
|
-
},
|
|
493
|
-
function
|
|
492
|
+
}, M = /\/\*[^]*?(?:\*\/|$)/g;
|
|
493
|
+
function N(e) {
|
|
494
494
|
return e ? e.trim() : "";
|
|
495
495
|
}
|
|
496
|
-
function
|
|
496
|
+
function P(e, t) {
|
|
497
497
|
let n = e && typeof e.type == "string", r = n ? e : t;
|
|
498
498
|
for (let t in e) {
|
|
499
499
|
let n = e[t];
|
|
500
500
|
Array.isArray(n) ? n.forEach((e) => {
|
|
501
|
-
|
|
502
|
-
}) : n && typeof n == "object" &&
|
|
501
|
+
P(e, r);
|
|
502
|
+
}) : n && typeof n == "object" && P(n, r);
|
|
503
503
|
}
|
|
504
504
|
return n && Object.defineProperty(e, "parent", {
|
|
505
505
|
configurable: !0,
|
|
@@ -508,7 +508,7 @@ function N(e, t) {
|
|
|
508
508
|
value: t || null
|
|
509
509
|
}), e;
|
|
510
510
|
}
|
|
511
|
-
var
|
|
511
|
+
var dt = class {
|
|
512
512
|
level = 0;
|
|
513
513
|
indentation = " ";
|
|
514
514
|
compress = !1;
|
|
@@ -523,33 +523,33 @@ var ft = class {
|
|
|
523
523
|
}
|
|
524
524
|
visit(e) {
|
|
525
525
|
switch (e.type) {
|
|
526
|
-
case
|
|
527
|
-
case
|
|
528
|
-
case
|
|
529
|
-
case
|
|
530
|
-
case
|
|
531
|
-
case
|
|
532
|
-
case
|
|
533
|
-
case
|
|
534
|
-
case
|
|
535
|
-
case
|
|
536
|
-
case
|
|
537
|
-
case
|
|
538
|
-
case
|
|
539
|
-
case
|
|
540
|
-
case
|
|
541
|
-
case
|
|
542
|
-
case
|
|
543
|
-
case
|
|
544
|
-
case
|
|
545
|
-
case
|
|
546
|
-
case
|
|
547
|
-
case
|
|
548
|
-
case
|
|
549
|
-
case
|
|
550
|
-
case
|
|
551
|
-
case
|
|
552
|
-
case
|
|
526
|
+
case A.stylesheet: return this.stylesheet(e);
|
|
527
|
+
case A.rule: return this.rule(e);
|
|
528
|
+
case A.declaration: return this.declaration(e);
|
|
529
|
+
case A.comment: return this.comment(e);
|
|
530
|
+
case A.container: return this.container(e);
|
|
531
|
+
case A.charset: return this.charset(e);
|
|
532
|
+
case A.counterStyle: return this.counterStyle(e);
|
|
533
|
+
case A.document: return this.document(e);
|
|
534
|
+
case A.customMedia: return this.customMedia(e);
|
|
535
|
+
case A.fontFace: return this.fontFace(e);
|
|
536
|
+
case A.fontFeatureValues: return this.fontFeatureValues(e);
|
|
537
|
+
case A.host: return this.host(e);
|
|
538
|
+
case A.import: return this.import(e);
|
|
539
|
+
case A.keyframes: return this.keyframes(e);
|
|
540
|
+
case A.keyframe: return this.keyframe(e);
|
|
541
|
+
case A.layer: return this.layer(e);
|
|
542
|
+
case A.media: return this.media(e);
|
|
543
|
+
case A.namespace: return this.namespace(e);
|
|
544
|
+
case A.page: return this.page(e);
|
|
545
|
+
case A.pageMarginBox: return this.pageMarginBox(e);
|
|
546
|
+
case A.positionTry: return this.positionTry(e);
|
|
547
|
+
case A.property: return this.property(e);
|
|
548
|
+
case A.scope: return this.scope(e);
|
|
549
|
+
case A.startingStyle: return this.startingStyle(e);
|
|
550
|
+
case A.supports: return this.supports(e);
|
|
551
|
+
case A.viewTransition: return this.viewTransition(e);
|
|
552
|
+
case A.atRule: return this.genericAtRule(e);
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
555
|
mapVisit(e, t) {
|
|
@@ -645,7 +645,7 @@ var ft = class {
|
|
|
645
645
|
let t = e.prelude ? ` ${e.prelude}` : "";
|
|
646
646
|
if (this.compress) return this.emit(`@${e.name}${t}`, e.position) + (e.rules ? this.emit("{") + this.mapVisit(e.rules) + this.emit("}") : ";");
|
|
647
647
|
if (!e.rules) return this.emit(`${this.indent()}@${e.name}${t};`, e.position);
|
|
648
|
-
let n = e.rules.some((e) => e.type !==
|
|
648
|
+
let n = e.rules.some((e) => e.type !== A.declaration && e.type !== A.comment), r = n ? "\n\n" : "\n";
|
|
649
649
|
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
650
|
}
|
|
651
651
|
rule(e) {
|
|
@@ -658,7 +658,7 @@ var ft = class {
|
|
|
658
658
|
declaration(e) {
|
|
659
659
|
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
660
|
}
|
|
661
|
-
},
|
|
661
|
+
}, ft = (e, t) => {
|
|
662
662
|
t ||= {};
|
|
663
663
|
let n = 1, r = 1;
|
|
664
664
|
function i() {
|
|
@@ -666,14 +666,14 @@ var ft = class {
|
|
|
666
666
|
line: n,
|
|
667
667
|
column: r
|
|
668
668
|
};
|
|
669
|
-
return (i) => (i.position = new
|
|
669
|
+
return (i) => (i.position = new lt(e, {
|
|
670
670
|
line: n,
|
|
671
671
|
column: r
|
|
672
672
|
}, t?.source || ""), u(), i);
|
|
673
673
|
}
|
|
674
674
|
let a = [];
|
|
675
675
|
function o(i) {
|
|
676
|
-
let o = new
|
|
676
|
+
let o = new ct(t?.source || "", i, n, r, e);
|
|
677
677
|
if (!t?.silent) throw o;
|
|
678
678
|
a.push(o);
|
|
679
679
|
}
|
|
@@ -709,36 +709,36 @@ var ft = class {
|
|
|
709
709
|
if (e.charAt(0) !== "/" || e.charAt(1) !== "*") return;
|
|
710
710
|
let n = /^\/\*[^]*?\*\//.exec(e);
|
|
711
711
|
return n ? (l(n), t({
|
|
712
|
-
type:
|
|
712
|
+
type: A.comment,
|
|
713
713
|
comment: n[0].slice(2, -2)
|
|
714
714
|
})) : o("End of comment missing");
|
|
715
715
|
}
|
|
716
716
|
function p() {
|
|
717
|
-
let t =
|
|
717
|
+
let t = j(e, ["{"]);
|
|
718
718
|
if (t === -1 || t === 0) return;
|
|
719
719
|
let n = e.substring(0, t);
|
|
720
720
|
return l([n]), ((e, t) => {
|
|
721
721
|
let n = [], r = 0;
|
|
722
722
|
for (; r < e.length;) {
|
|
723
|
-
let i =
|
|
723
|
+
let i = j(e, t, r);
|
|
724
724
|
if (i === -1) return n.push(e.substring(r)), n;
|
|
725
725
|
n.push(e.substring(r, i)), r = i + 1;
|
|
726
726
|
}
|
|
727
727
|
return n;
|
|
728
|
-
})(
|
|
728
|
+
})(N(n).replace(M, ""), [","]).map((e) => N(e));
|
|
729
729
|
}
|
|
730
730
|
function m() {
|
|
731
731
|
let t = i(), n = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/.exec(e);
|
|
732
732
|
if (!n) return;
|
|
733
733
|
l(n);
|
|
734
|
-
let r =
|
|
734
|
+
let r = N(n[0]), a = /^:\s*/.exec(e);
|
|
735
735
|
if (!a) return o("property missing ':'");
|
|
736
736
|
l(a);
|
|
737
|
-
let s = "", c =
|
|
738
|
-
c !== -1 && (s = e.substring(0, c), l([s]), s =
|
|
737
|
+
let s = "", c = j(e, [";", "}"]);
|
|
738
|
+
c !== -1 && (s = e.substring(0, c), l([s]), s = N(s).replace(M, ""));
|
|
739
739
|
let u = t({
|
|
740
|
-
type:
|
|
741
|
-
property: r.replace(
|
|
740
|
+
type: A.declaration,
|
|
741
|
+
property: r.replace(M, ""),
|
|
742
742
|
value: s
|
|
743
743
|
}), d = /^[;\s]*/.exec(e);
|
|
744
744
|
return d && l(d), u;
|
|
@@ -757,9 +757,9 @@ var ft = class {
|
|
|
757
757
|
return c() ? n : o("missing '}'");
|
|
758
758
|
}
|
|
759
759
|
function g() {
|
|
760
|
-
let t =
|
|
760
|
+
let t = j(e, ["{"]);
|
|
761
761
|
if (t === -1) return !1;
|
|
762
|
-
let n =
|
|
762
|
+
let n = j(e, [";"]), r = j(e, ["}"]);
|
|
763
763
|
return !(n !== -1 && n < t) && !(r !== -1 && r < t);
|
|
764
764
|
}
|
|
765
765
|
function _() {
|
|
@@ -767,14 +767,14 @@ var ft = class {
|
|
|
767
767
|
if (!s()) return o("missing '{'");
|
|
768
768
|
for (d(n); e.length && e.charAt(0) !== "}";) {
|
|
769
769
|
if (e.charAt(0) === "@") {
|
|
770
|
-
let e =
|
|
770
|
+
let e = x();
|
|
771
771
|
if (e) {
|
|
772
772
|
n.push(e), d(n);
|
|
773
773
|
continue;
|
|
774
774
|
}
|
|
775
775
|
}
|
|
776
776
|
if (g()) {
|
|
777
|
-
let e =
|
|
777
|
+
let e = S();
|
|
778
778
|
if (e) {
|
|
779
779
|
n.push(e), d(n);
|
|
780
780
|
continue;
|
|
@@ -799,14 +799,14 @@ var ft = class {
|
|
|
799
799
|
let n = [];
|
|
800
800
|
for (u(), d(n); e.length && e.charAt(0) !== "}";) {
|
|
801
801
|
if (e.charAt(0) === "@") {
|
|
802
|
-
let e =
|
|
802
|
+
let e = x();
|
|
803
803
|
if (e) {
|
|
804
804
|
n.push(e), d(n);
|
|
805
805
|
continue;
|
|
806
806
|
}
|
|
807
807
|
}
|
|
808
808
|
if (g()) {
|
|
809
|
-
let e =
|
|
809
|
+
let e = S();
|
|
810
810
|
if (e) {
|
|
811
811
|
n.push(e), d(n);
|
|
812
812
|
continue;
|
|
@@ -827,7 +827,7 @@ var ft = class {
|
|
|
827
827
|
}
|
|
828
828
|
return n;
|
|
829
829
|
}
|
|
830
|
-
function
|
|
830
|
+
function y() {
|
|
831
831
|
let t = [], n = i(), r = /^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/.exec(e);
|
|
832
832
|
for (; r;) {
|
|
833
833
|
let n = l(r);
|
|
@@ -836,12 +836,12 @@ var ft = class {
|
|
|
836
836
|
i && l(i), r = /^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/.exec(e);
|
|
837
837
|
}
|
|
838
838
|
if (t.length) return n({
|
|
839
|
-
type:
|
|
839
|
+
type: A.keyframe,
|
|
840
840
|
values: t,
|
|
841
841
|
declarations: h() || []
|
|
842
842
|
});
|
|
843
843
|
}
|
|
844
|
-
let
|
|
844
|
+
let ee = RegExp(`^@(${[
|
|
845
845
|
"top-left-corner",
|
|
846
846
|
"top-left",
|
|
847
847
|
"top-center",
|
|
@@ -858,8 +858,8 @@ var ft = class {
|
|
|
858
858
|
"right-top",
|
|
859
859
|
"right-middle",
|
|
860
860
|
"right-bottom"
|
|
861
|
-
].join("|")})(?![\\w-])\\s*`),
|
|
862
|
-
function
|
|
861
|
+
].join("|")})(?![\\w-])\\s*`), te = b("import"), ne = b("charset"), re = b("namespace");
|
|
862
|
+
function b(t) {
|
|
863
863
|
let n = RegExp("^@" + t + "\\s*((?::?[^;'\"]|\"(?:\\\\\"|[^\"])*?\"|'(?:\\\\'|[^'])*?')+)(?:;|$)");
|
|
864
864
|
return () => {
|
|
865
865
|
let r = i(), a = n.exec(e);
|
|
@@ -868,7 +868,7 @@ var ft = class {
|
|
|
868
868
|
return s[t] = o[1].trim(), r(s);
|
|
869
869
|
};
|
|
870
870
|
}
|
|
871
|
-
function
|
|
871
|
+
function x() {
|
|
872
872
|
if (e[0] === "@") return function() {
|
|
873
873
|
let t = i(), n = /^@([-\w]+)?keyframes\s*/.exec(e);
|
|
874
874
|
if (!n) return;
|
|
@@ -876,10 +876,10 @@ var ft = class {
|
|
|
876
876
|
if (!a) return o("@keyframes missing name");
|
|
877
877
|
let u = l(a)[1];
|
|
878
878
|
if (!s()) return o("@keyframes missing '{'");
|
|
879
|
-
let f = d(), p =
|
|
880
|
-
for (; p;) f.push(p), f = f.concat(d()), p =
|
|
879
|
+
let f = d(), p = y();
|
|
880
|
+
for (; p;) f.push(p), f = f.concat(d()), p = y();
|
|
881
881
|
return c() ? t({
|
|
882
|
-
type:
|
|
882
|
+
type: A.keyframes,
|
|
883
883
|
name: u,
|
|
884
884
|
vendor: r,
|
|
885
885
|
keyframes: f
|
|
@@ -887,11 +887,11 @@ var ft = class {
|
|
|
887
887
|
}() || function() {
|
|
888
888
|
let t = i(), n = /^@media *([^{]+)/.exec(e);
|
|
889
889
|
if (!n) return;
|
|
890
|
-
let r =
|
|
890
|
+
let r = N(l(n)[1]);
|
|
891
891
|
if (!s()) return o("@media missing '{'");
|
|
892
892
|
let a = v();
|
|
893
893
|
return c() ? t({
|
|
894
|
-
type:
|
|
894
|
+
type: A.media,
|
|
895
895
|
media: r,
|
|
896
896
|
rules: a
|
|
897
897
|
}) : o("@media missing '}'");
|
|
@@ -900,29 +900,29 @@ var ft = class {
|
|
|
900
900
|
if (!n) return;
|
|
901
901
|
let r = l(n);
|
|
902
902
|
return t({
|
|
903
|
-
type:
|
|
904
|
-
name:
|
|
905
|
-
media:
|
|
903
|
+
type: A.customMedia,
|
|
904
|
+
name: N(r[1]),
|
|
905
|
+
media: N(r[2])
|
|
906
906
|
});
|
|
907
907
|
}() || function() {
|
|
908
908
|
let t = i(), n = /^@supports *([^{]+)/.exec(e);
|
|
909
909
|
if (!n) return;
|
|
910
|
-
let r =
|
|
910
|
+
let r = N(l(n)[1]);
|
|
911
911
|
if (!s()) return o("@supports missing '{'");
|
|
912
912
|
let a = v();
|
|
913
913
|
return c() ? t({
|
|
914
|
-
type:
|
|
914
|
+
type: A.supports,
|
|
915
915
|
supports: r,
|
|
916
916
|
rules: a
|
|
917
917
|
}) : o("@supports missing '}'");
|
|
918
|
-
}() ||
|
|
918
|
+
}() || te() || ne() || re() || function() {
|
|
919
919
|
let t = i(), n = /^@([-\w]+)?document *([^{]+)/.exec(e);
|
|
920
920
|
if (!n) return;
|
|
921
|
-
let r = l(n), a =
|
|
921
|
+
let r = l(n), a = N(r[1]), u = N(r[2]);
|
|
922
922
|
if (!s()) return o("@document missing '{'");
|
|
923
923
|
let d = v();
|
|
924
924
|
return c() ? t({
|
|
925
|
-
type:
|
|
925
|
+
type: A.document,
|
|
926
926
|
document: u,
|
|
927
927
|
vendor: a,
|
|
928
928
|
rules: d
|
|
@@ -936,7 +936,7 @@ var ft = class {
|
|
|
936
936
|
let a = [];
|
|
937
937
|
for (d(a); e.length && e.charAt(0) !== "}";) {
|
|
938
938
|
if (e.charAt(0) === "@") {
|
|
939
|
-
let e =
|
|
939
|
+
let e = x();
|
|
940
940
|
if (e) {
|
|
941
941
|
a.push(e), d(a);
|
|
942
942
|
continue;
|
|
@@ -947,7 +947,7 @@ var ft = class {
|
|
|
947
947
|
a.push(t), d(a);
|
|
948
948
|
}
|
|
949
949
|
return c() ? t({
|
|
950
|
-
type:
|
|
950
|
+
type: A.page,
|
|
951
951
|
selectors: r,
|
|
952
952
|
declarations: a
|
|
953
953
|
}) : o("@page missing '}'");
|
|
@@ -957,7 +957,7 @@ var ft = class {
|
|
|
957
957
|
if (l(n), !s()) return o("@host missing '{'");
|
|
958
958
|
let r = v();
|
|
959
959
|
return c() ? t({
|
|
960
|
-
type:
|
|
960
|
+
type: A.host,
|
|
961
961
|
rules: r
|
|
962
962
|
}) : o("@host missing '}'");
|
|
963
963
|
}() || function() {
|
|
@@ -967,28 +967,28 @@ var ft = class {
|
|
|
967
967
|
let r = d(), a = m();
|
|
968
968
|
for (; a;) r.push(a), r = r.concat(d()), a = m();
|
|
969
969
|
return c() ? t({
|
|
970
|
-
type:
|
|
970
|
+
type: A.fontFace,
|
|
971
971
|
declarations: r
|
|
972
972
|
}) : o("@font-face missing '}'");
|
|
973
973
|
}() || function() {
|
|
974
974
|
let t = i(), n = /^@font-feature-values\s+([^{]+)/.exec(e);
|
|
975
975
|
if (!n) return;
|
|
976
|
-
let r =
|
|
976
|
+
let r = N(l(n)[1]);
|
|
977
977
|
if (!s()) return o("@font-feature-values missing '{'");
|
|
978
978
|
let a = v();
|
|
979
979
|
return c() ? t({
|
|
980
|
-
type:
|
|
980
|
+
type: A.fontFeatureValues,
|
|
981
981
|
fontFamily: r,
|
|
982
982
|
rules: a
|
|
983
983
|
}) : o("@font-feature-values missing '}'");
|
|
984
984
|
}() || function() {
|
|
985
985
|
let t = i(), n = /^@container *([^{]+)/.exec(e);
|
|
986
986
|
if (!n) return;
|
|
987
|
-
let r =
|
|
987
|
+
let r = N(l(n)[1]);
|
|
988
988
|
if (!s()) return o("@container missing '{'");
|
|
989
989
|
let a = v();
|
|
990
990
|
return c() ? t({
|
|
991
|
-
type:
|
|
991
|
+
type: A.container,
|
|
992
992
|
container: r,
|
|
993
993
|
rules: a
|
|
994
994
|
}) : o("@container missing '}'");
|
|
@@ -998,23 +998,23 @@ var ft = class {
|
|
|
998
998
|
if (l(n), !s()) return o("@starting-style missing '{'");
|
|
999
999
|
let r = v();
|
|
1000
1000
|
return c() ? t({
|
|
1001
|
-
type:
|
|
1001
|
+
type: A.startingStyle,
|
|
1002
1002
|
rules: r
|
|
1003
1003
|
}) : o("@starting-style missing '}'");
|
|
1004
1004
|
}() || function() {
|
|
1005
1005
|
let t = i(), n = /^@layer *([^{;@]+)/.exec(e);
|
|
1006
1006
|
if (!n) return;
|
|
1007
|
-
let r =
|
|
1007
|
+
let r = N(l(n)[1]);
|
|
1008
1008
|
if (!s()) {
|
|
1009
1009
|
let n = /^[;\s]*/.exec(e);
|
|
1010
1010
|
return n && l(n), t({
|
|
1011
|
-
type:
|
|
1011
|
+
type: A.layer,
|
|
1012
1012
|
layer: r
|
|
1013
1013
|
});
|
|
1014
1014
|
}
|
|
1015
1015
|
let a = v();
|
|
1016
1016
|
return c() ? t({
|
|
1017
|
-
type:
|
|
1017
|
+
type: A.layer,
|
|
1018
1018
|
layer: r,
|
|
1019
1019
|
rules: a
|
|
1020
1020
|
}) : o("@layer missing '}'");
|
|
@@ -1026,7 +1026,7 @@ var ft = class {
|
|
|
1026
1026
|
let a = d(), u = m();
|
|
1027
1027
|
for (; u;) a.push(u), a = a.concat(d()), u = m();
|
|
1028
1028
|
return c() ? t({
|
|
1029
|
-
type:
|
|
1029
|
+
type: A.property,
|
|
1030
1030
|
name: r,
|
|
1031
1031
|
declarations: a
|
|
1032
1032
|
}) : o("@property missing '}'");
|
|
@@ -1038,18 +1038,18 @@ var ft = class {
|
|
|
1038
1038
|
let a = d(), u = m();
|
|
1039
1039
|
for (; u;) a.push(u), a = a.concat(d()), u = m();
|
|
1040
1040
|
return c() ? t({
|
|
1041
|
-
type:
|
|
1041
|
+
type: A.counterStyle,
|
|
1042
1042
|
name: r,
|
|
1043
1043
|
declarations: a
|
|
1044
1044
|
}) : o("@counter-style missing '}'");
|
|
1045
1045
|
}() || function() {
|
|
1046
1046
|
let t = i(), n = /^@scope\s*([^{]*)/.exec(e);
|
|
1047
1047
|
if (!n) return;
|
|
1048
|
-
let r =
|
|
1048
|
+
let r = N(l(n)[1]);
|
|
1049
1049
|
if (!s()) return o("@scope missing '{'");
|
|
1050
1050
|
let a = v();
|
|
1051
1051
|
return c() ? t({
|
|
1052
|
-
type:
|
|
1052
|
+
type: A.scope,
|
|
1053
1053
|
scope: r,
|
|
1054
1054
|
rules: a
|
|
1055
1055
|
}) : o("@scope missing '}'");
|
|
@@ -1060,7 +1060,7 @@ var ft = class {
|
|
|
1060
1060
|
let r = d(), a = m();
|
|
1061
1061
|
for (; a;) r.push(a), r = r.concat(d()), a = m();
|
|
1062
1062
|
return c() ? t({
|
|
1063
|
-
type:
|
|
1063
|
+
type: A.viewTransition,
|
|
1064
1064
|
declarations: r
|
|
1065
1065
|
}) : o("@view-transition missing '}'");
|
|
1066
1066
|
}() || function() {
|
|
@@ -1071,30 +1071,30 @@ var ft = class {
|
|
|
1071
1071
|
let a = d(), u = m();
|
|
1072
1072
|
for (; u;) a.push(u), a = a.concat(d()), u = m();
|
|
1073
1073
|
return c() ? t({
|
|
1074
|
-
type:
|
|
1074
|
+
type: A.positionTry,
|
|
1075
1075
|
name: r,
|
|
1076
1076
|
declarations: a
|
|
1077
1077
|
}) : o("@position-try missing '}'");
|
|
1078
1078
|
}() || function() {
|
|
1079
|
-
let t = i(), n =
|
|
1079
|
+
let t = i(), n = ee.exec(e);
|
|
1080
1080
|
if (!n) return;
|
|
1081
1081
|
let r = l(n)[1];
|
|
1082
1082
|
if (!s()) return o(`@${r} missing '{'`);
|
|
1083
1083
|
let a = d(), u = m();
|
|
1084
1084
|
for (; u;) a.push(u), a = a.concat(d()), u = m();
|
|
1085
1085
|
return c() ? t({
|
|
1086
|
-
type:
|
|
1086
|
+
type: A.pageMarginBox,
|
|
1087
1087
|
name: r,
|
|
1088
1088
|
declarations: a
|
|
1089
1089
|
}) : o(`@${r} missing '}'`);
|
|
1090
1090
|
}() || function() {
|
|
1091
1091
|
let t = i(), n = /^@([-\w]+)\s*/.exec(e);
|
|
1092
1092
|
if (!n) return;
|
|
1093
|
-
let r = l(n)[1], a = "", u =
|
|
1094
|
-
if (u !== -1 && u > 0 && (a =
|
|
1093
|
+
let r = l(n)[1], a = "", u = j(e, ["{", ";"]);
|
|
1094
|
+
if (u !== -1 && u > 0 && (a = N(e.substring(0, u)), l([e.substring(0, u)])), s()) {
|
|
1095
1095
|
let e = v();
|
|
1096
1096
|
return c() ? t({
|
|
1097
|
-
type:
|
|
1097
|
+
type: A.atRule,
|
|
1098
1098
|
name: r,
|
|
1099
1099
|
prelude: a,
|
|
1100
1100
|
rules: e
|
|
@@ -1102,21 +1102,21 @@ var ft = class {
|
|
|
1102
1102
|
}
|
|
1103
1103
|
let d = /^[;\s]*/.exec(e);
|
|
1104
1104
|
return d && l(d), t({
|
|
1105
|
-
type:
|
|
1105
|
+
type: A.atRule,
|
|
1106
1106
|
name: r,
|
|
1107
1107
|
prelude: a
|
|
1108
1108
|
});
|
|
1109
1109
|
}();
|
|
1110
1110
|
}
|
|
1111
|
-
function
|
|
1111
|
+
function S() {
|
|
1112
1112
|
let e = i(), t = p();
|
|
1113
1113
|
return t ? (d(), e({
|
|
1114
|
-
type:
|
|
1114
|
+
type: A.rule,
|
|
1115
1115
|
selectors: t,
|
|
1116
1116
|
declarations: _() || []
|
|
1117
1117
|
})) : o("selector missing");
|
|
1118
1118
|
}
|
|
1119
|
-
return
|
|
1119
|
+
return P(function() {
|
|
1120
1120
|
let n = function() {
|
|
1121
1121
|
let n, r = [];
|
|
1122
1122
|
for (u(), d(r); e.length;) {
|
|
@@ -1127,7 +1127,7 @@ var ft = class {
|
|
|
1127
1127
|
}
|
|
1128
1128
|
break;
|
|
1129
1129
|
}
|
|
1130
|
-
if (n =
|
|
1130
|
+
if (n = x() || S(), !n) {
|
|
1131
1131
|
if (t?.silent) {
|
|
1132
1132
|
l([e.charAt(0)]), u(), d(r);
|
|
1133
1133
|
continue;
|
|
@@ -1139,7 +1139,7 @@ var ft = class {
|
|
|
1139
1139
|
return r;
|
|
1140
1140
|
}();
|
|
1141
1141
|
return {
|
|
1142
|
-
type:
|
|
1142
|
+
type: A.stylesheet,
|
|
1143
1143
|
stylesheet: {
|
|
1144
1144
|
source: t?.source,
|
|
1145
1145
|
rules: n,
|
|
@@ -1147,66 +1147,66 @@ var ft = class {
|
|
|
1147
1147
|
}
|
|
1148
1148
|
};
|
|
1149
1149
|
}());
|
|
1150
|
-
},
|
|
1150
|
+
}, pt = (e, t) => new dt(t || {}).compile(e), mt = Object.defineProperty, ht = (e, t) => {
|
|
1151
1151
|
let n = {};
|
|
1152
|
-
for (var r in e)
|
|
1152
|
+
for (var r in e) mt(n, r, {
|
|
1153
1153
|
get: e[r],
|
|
1154
1154
|
enumerable: !0
|
|
1155
1155
|
});
|
|
1156
|
-
return t ||
|
|
1157
|
-
},
|
|
1158
|
-
name:
|
|
1156
|
+
return t || mt(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
1157
|
+
}, gt = "LocatorError", F = "LocatorUnsupportedError", _t = "LocatorDeniedError", vt = "LocatorInvalidError", yt = (e) => typeof e == "object" && e ? e.name : void 0, I = (e) => Object.assign(Error(e), { name: gt }), L = (e, t = "", n) => Object.assign(Error(e), {
|
|
1158
|
+
name: F,
|
|
1159
1159
|
operation: t,
|
|
1160
1160
|
backend: n
|
|
1161
|
-
}),
|
|
1162
|
-
name:
|
|
1161
|
+
}), bt = (e, t) => L(`Locator operation not supported${t ? ` on the ${t} backend` : ""}: ${e}`, e, t), xt = (e, t) => Object.assign(Error(e), {
|
|
1162
|
+
name: _t,
|
|
1163
1163
|
operation: t
|
|
1164
|
-
}),
|
|
1165
|
-
name:
|
|
1164
|
+
}), St = (e, t) => Object.assign(Error(e), {
|
|
1165
|
+
name: vt,
|
|
1166
1166
|
operation: t
|
|
1167
|
-
}),
|
|
1167
|
+
}), R = class extends Error {
|
|
1168
1168
|
name = "TimeoutError";
|
|
1169
1169
|
constructor(e, t) {
|
|
1170
1170
|
super(e, t?.cause === void 0 ? void 0 : { cause: t.cause });
|
|
1171
1171
|
}
|
|
1172
|
-
},
|
|
1172
|
+
}, Ct = (e) => yt(e) === F, wt = (e) => yt(e) === _t, z = (e) => yt(e) === vt, Tt = (e) => wt(e) || Ct(e) || z(e), B = (e) => {
|
|
1173
1173
|
let t = (e.ownerDocument ?? e).defaultView;
|
|
1174
|
-
if (!t) throw
|
|
1174
|
+
if (!t) throw I("the resolved element belongs to a document with no window");
|
|
1175
1175
|
return t;
|
|
1176
|
-
},
|
|
1176
|
+
}, Et = (e, t) => {
|
|
1177
1177
|
let n = e?.[t];
|
|
1178
1178
|
return typeof n == "function" ? n : null;
|
|
1179
|
-
},
|
|
1179
|
+
}, V = (e, t) => {
|
|
1180
1180
|
if (typeof e != "object" || !e) return null;
|
|
1181
1181
|
let n = (() => {
|
|
1182
1182
|
try {
|
|
1183
|
-
return
|
|
1183
|
+
return Et(B(e), t);
|
|
1184
1184
|
} catch {
|
|
1185
1185
|
return null;
|
|
1186
1186
|
}
|
|
1187
1187
|
})();
|
|
1188
1188
|
if (n && e instanceof n) return n;
|
|
1189
|
-
let r =
|
|
1189
|
+
let r = Et(globalThis, t);
|
|
1190
1190
|
return r && e instanceof r ? r : null;
|
|
1191
|
-
},
|
|
1192
|
-
if (e.length === 0) throw
|
|
1193
|
-
if (e.length > 1) throw
|
|
1191
|
+
}, H = (e, t) => V(e, t) !== null, U = (e) => {
|
|
1192
|
+
if (e.length === 0) throw I("No elements found");
|
|
1193
|
+
if (e.length > 1) throw I(`Strict mode violation: locator resolved to ${e.length} elements`);
|
|
1194
1194
|
return e[0];
|
|
1195
|
-
},
|
|
1196
|
-
if (!
|
|
1195
|
+
}, Dt = (e, t) => {
|
|
1196
|
+
if (!H(e, t)) throw I(`Strict mode violation: expected ${t}, got <${e.tagName.toLowerCase()}>`);
|
|
1197
1197
|
return e;
|
|
1198
|
-
},
|
|
1199
|
-
|
|
1200
|
-
},
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
]),
|
|
1208
|
-
if (
|
|
1209
|
-
if (e.type ===
|
|
1198
|
+
}, Ot = (e) => e.tagName.toLowerCase(), kt = /* @__PURE__ */ new Set(), At = (e) => {
|
|
1199
|
+
kt.add(e);
|
|
1200
|
+
}, jt = /(?:^|[^\w-])(?:url|image|image-set|cross-fade|paint|element|expression)\s*\(/i, Mt = (e) => e.replace(/\\([0-9a-fA-F]{1,6})\s?/g, (e, t) => String.fromCodePoint(Number.parseInt(t, 16))).replace(/\\(.)/g, "$1"), Nt = (e) => !jt.test(Mt(e.value)), Pt = /* @__PURE__ */ new Set([
|
|
1201
|
+
A.import,
|
|
1202
|
+
A.fontFace,
|
|
1203
|
+
A.namespace,
|
|
1204
|
+
A.charset,
|
|
1205
|
+
A.document,
|
|
1206
|
+
A.comment
|
|
1207
|
+
]), Ft = (e) => {
|
|
1208
|
+
if (Pt.has(e.type)) return null;
|
|
1209
|
+
if (e.type === A.declaration) return Nt(e) ? e : null;
|
|
1210
1210
|
let t = e, n = { ...t };
|
|
1211
1211
|
for (let e of [
|
|
1212
1212
|
"declarations",
|
|
@@ -1214,18 +1214,18 @@ var ft = class {
|
|
|
1214
1214
|
"keyframes"
|
|
1215
1215
|
]) {
|
|
1216
1216
|
let r = t[e];
|
|
1217
|
-
Array.isArray(r) && (n[e] =
|
|
1217
|
+
Array.isArray(r) && (n[e] = It(r));
|
|
1218
1218
|
}
|
|
1219
1219
|
return n;
|
|
1220
|
-
},
|
|
1220
|
+
}, It = (e) => e.map((e) => Ft(e)).filter((e) => e !== null), Lt = (e) => {
|
|
1221
1221
|
let t;
|
|
1222
1222
|
try {
|
|
1223
|
-
t =
|
|
1223
|
+
t = ft(e, { silent: !0 });
|
|
1224
1224
|
} catch {
|
|
1225
1225
|
return "";
|
|
1226
1226
|
}
|
|
1227
|
-
return t.stylesheet.rules =
|
|
1228
|
-
},
|
|
1227
|
+
return t.stylesheet.rules = It(t.stylesheet.rules), pt(t);
|
|
1228
|
+
}, Rt = (e, t) => {
|
|
1229
1229
|
let n = () => {
|
|
1230
1230
|
t.parentNode || (e.head ?? e.documentElement).appendChild(t);
|
|
1231
1231
|
};
|
|
@@ -1242,30 +1242,30 @@ var ft = class {
|
|
|
1242
1242
|
});
|
|
1243
1243
|
let i = () => r.disconnect(), a = e.defaultView;
|
|
1244
1244
|
a ? a.addEventListener("load", i, { once: !0 }) : setTimeout(i, 3e4);
|
|
1245
|
-
},
|
|
1245
|
+
}, zt = { resolve: (e, t) => {
|
|
1246
1246
|
let n = e.document.createElement("style");
|
|
1247
|
-
n.textContent = t.noSanitize ? t.content :
|
|
1247
|
+
n.textContent = t.noSanitize ? t.content : Lt(t.content);
|
|
1248
1248
|
try {
|
|
1249
|
-
|
|
1249
|
+
Rt(e.document, n);
|
|
1250
1250
|
} catch (e) {
|
|
1251
1251
|
console.error(e);
|
|
1252
1252
|
}
|
|
1253
|
-
|
|
1254
|
-
} },
|
|
1253
|
+
At(n);
|
|
1254
|
+
} }, Bt = (e) => {
|
|
1255
1255
|
let t = [];
|
|
1256
1256
|
return e.forEach((e, n) => {
|
|
1257
1257
|
t.push([n, e]);
|
|
1258
1258
|
}), t;
|
|
1259
|
-
},
|
|
1259
|
+
}, W = {
|
|
1260
1260
|
kind: "frame",
|
|
1261
1261
|
ensureArgs: (e) => [void 0, e],
|
|
1262
1262
|
resolve: async (e, t, n = {}) => {
|
|
1263
|
-
if (typeof t != "string") throw
|
|
1264
|
-
let r =
|
|
1263
|
+
if (typeof t != "string") throw St("fetch: url must be a string", "fetch");
|
|
1264
|
+
let r = B(e.document), i;
|
|
1265
1265
|
try {
|
|
1266
1266
|
i = new r.URL(t, e.document.baseURI).href;
|
|
1267
1267
|
} catch {
|
|
1268
|
-
throw
|
|
1268
|
+
throw St(`fetch: not a valid url: ${t}`, "fetch");
|
|
1269
1269
|
}
|
|
1270
1270
|
let a = await r.fetch(i, {
|
|
1271
1271
|
method: n.method ?? "GET",
|
|
@@ -1281,31 +1281,31 @@ var ft = class {
|
|
|
1281
1281
|
url: a.url,
|
|
1282
1282
|
redirected: a.redirected,
|
|
1283
1283
|
type: a.type,
|
|
1284
|
-
headers:
|
|
1284
|
+
headers: Bt(a.headers),
|
|
1285
1285
|
body: await a.arrayBuffer()
|
|
1286
1286
|
};
|
|
1287
1287
|
}
|
|
1288
|
-
},
|
|
1289
|
-
click: () =>
|
|
1290
|
-
count: () =>
|
|
1291
|
-
exists: () =>
|
|
1292
|
-
fill: () =>
|
|
1293
|
-
getAttribute: () =>
|
|
1294
|
-
hover: () =>
|
|
1295
|
-
isVisible: () =>
|
|
1296
|
-
textContent: () =>
|
|
1297
|
-
}),
|
|
1288
|
+
}, G = /* @__PURE__ */ ht({
|
|
1289
|
+
click: () => Ht,
|
|
1290
|
+
count: () => Xt,
|
|
1291
|
+
exists: () => Zt,
|
|
1292
|
+
fill: () => Kt,
|
|
1293
|
+
getAttribute: () => Jt,
|
|
1294
|
+
hover: () => Ut,
|
|
1295
|
+
isVisible: () => Yt,
|
|
1296
|
+
textContent: () => qt
|
|
1297
|
+
}), Vt = (e, t) => {
|
|
1298
1298
|
let n = e.getBoundingClientRect();
|
|
1299
1299
|
return {
|
|
1300
1300
|
clientX: n.left + n.width * (t?.x ?? .5),
|
|
1301
1301
|
clientY: n.top + n.height * (t?.y ?? .5)
|
|
1302
1302
|
};
|
|
1303
|
-
},
|
|
1304
|
-
let n =
|
|
1303
|
+
}, Ht = { resolve: (e, t = {}) => {
|
|
1304
|
+
let n = U(e.elements), r = B(n), i = {
|
|
1305
1305
|
bubbles: !0,
|
|
1306
1306
|
cancelable: !0,
|
|
1307
1307
|
composed: !0,
|
|
1308
|
-
...
|
|
1308
|
+
...Vt(n, t.position),
|
|
1309
1309
|
button: 0
|
|
1310
1310
|
}, a = {
|
|
1311
1311
|
...i,
|
|
@@ -1329,12 +1329,12 @@ var ft = class {
|
|
|
1329
1329
|
...i,
|
|
1330
1330
|
buttons: 0
|
|
1331
1331
|
}));
|
|
1332
|
-
} },
|
|
1333
|
-
let n =
|
|
1332
|
+
} }, Ut = { resolve: (e, t = {}) => {
|
|
1333
|
+
let n = U(e.elements), r = B(n), i = {
|
|
1334
1334
|
bubbles: !0,
|
|
1335
1335
|
cancelable: !0,
|
|
1336
1336
|
composed: !0,
|
|
1337
|
-
...
|
|
1337
|
+
...Vt(n, t.position)
|
|
1338
1338
|
}, a = {
|
|
1339
1339
|
...i,
|
|
1340
1340
|
pointerType: "mouse",
|
|
@@ -1348,11 +1348,11 @@ var ft = class {
|
|
|
1348
1348
|
...i,
|
|
1349
1349
|
bubbles: !1
|
|
1350
1350
|
})), n.dispatchEvent(new r.MouseEvent("mouseover", i)), n.dispatchEvent(new r.PointerEvent("pointermove", a)), n.dispatchEvent(new r.MouseEvent("mousemove", i));
|
|
1351
|
-
} },
|
|
1351
|
+
} }, Wt = (e, t) => {
|
|
1352
1352
|
e._valueTracker?.setValue("");
|
|
1353
|
-
let n = (
|
|
1353
|
+
let n = (V(e, "HTMLTextAreaElement") ?? V(e, "HTMLInputElement"))?.prototype, r = n && Object.getOwnPropertyDescriptor(n, "value")?.set;
|
|
1354
1354
|
r ? r.call(e, t) : e.value = t;
|
|
1355
|
-
},
|
|
1355
|
+
}, Gt = (e, t) => {
|
|
1356
1356
|
if (e.type !== "range") return null;
|
|
1357
1357
|
let n = Number(e.min || 0), r = Number(e.max || 100);
|
|
1358
1358
|
if (!Number.isFinite(n) || !Number.isFinite(r) || r <= n) return null;
|
|
@@ -1389,61 +1389,61 @@ var ft = class {
|
|
|
1389
1389
|
buttons: 0
|
|
1390
1390
|
}
|
|
1391
1391
|
};
|
|
1392
|
-
},
|
|
1393
|
-
let r =
|
|
1394
|
-
if (a ||
|
|
1395
|
-
let e = r, n = a ?
|
|
1396
|
-
n && (r.dispatchEvent(new i.PointerEvent("pointerdown", n.pointerDown)), r.dispatchEvent(new i.MouseEvent("mousedown", n.mouseDown))),
|
|
1392
|
+
}, Kt = { resolve: (e, t, n = {}) => {
|
|
1393
|
+
let r = U(e.elements), i = B(r), a = H(r, "HTMLInputElement");
|
|
1394
|
+
if (a || H(r, "HTMLTextAreaElement")) {
|
|
1395
|
+
let e = r, n = a ? Gt(e, t) : null;
|
|
1396
|
+
n && (r.dispatchEvent(new i.PointerEvent("pointerdown", n.pointerDown)), r.dispatchEvent(new i.MouseEvent("mousedown", n.mouseDown))), Wt(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
1397
|
return;
|
|
1398
1398
|
}
|
|
1399
|
-
if (
|
|
1399
|
+
if (H(r, "HTMLElement") && r.isContentEditable) {
|
|
1400
1400
|
r.textContent = t, r.dispatchEvent(new i.Event("input", { bubbles: !0 }));
|
|
1401
1401
|
return;
|
|
1402
1402
|
}
|
|
1403
|
-
throw Error(`fill: element <${
|
|
1404
|
-
} },
|
|
1405
|
-
let n =
|
|
1406
|
-
if (!
|
|
1407
|
-
let r =
|
|
1403
|
+
throw Error(`fill: element <${Ot(r)}> is not fillable`);
|
|
1404
|
+
} }, qt = { resolve: (e, t = {}) => U(e.elements).textContent }, Jt = { resolve: (e, t, n = {}) => U(e.elements).getAttribute(t) }, Yt = { resolve: (e, t = {}) => {
|
|
1405
|
+
let n = U(e.elements);
|
|
1406
|
+
if (!H(n, "HTMLElement")) return !0;
|
|
1407
|
+
let r = B(n).getComputedStyle(n);
|
|
1408
1408
|
if (r?.display === "none" || r?.visibility === "hidden") return !1;
|
|
1409
1409
|
let i = n.getBoundingClientRect();
|
|
1410
1410
|
return i.width > 0 && i.height > 0;
|
|
1411
|
-
} },
|
|
1411
|
+
} }, Xt = { resolve: (e, t = {}) => e.elements.length }, Zt = { resolve: (e, t = {}) => e.elements.length > 0 }, K = (e, t) => e.elements.flatMap((e) => [...e.querySelectorAll(t)]), q = (e) => e.replaceAll("\"", "\\\""), Qt = {
|
|
1412
1412
|
to: "element",
|
|
1413
1413
|
css: !0,
|
|
1414
|
-
resolve: (e, t) =>
|
|
1414
|
+
resolve: (e, t) => K(e, t),
|
|
1415
1415
|
render: (e) => ({
|
|
1416
1416
|
fragment: typeof e == "string" ? e : "?",
|
|
1417
1417
|
separator: "descend"
|
|
1418
1418
|
})
|
|
1419
|
-
},
|
|
1419
|
+
}, $t = {
|
|
1420
1420
|
to: "frame",
|
|
1421
1421
|
css: !0,
|
|
1422
1422
|
barrier: "down",
|
|
1423
|
-
resolve: (e, t) =>
|
|
1423
|
+
resolve: (e, t) => K(e, t),
|
|
1424
1424
|
render: (e) => ({
|
|
1425
1425
|
fragment: typeof e == "string" ? e : "?",
|
|
1426
1426
|
separator: "down"
|
|
1427
1427
|
})
|
|
1428
|
-
},
|
|
1428
|
+
}, en = {
|
|
1429
1429
|
element: {
|
|
1430
1430
|
selectors: {
|
|
1431
|
-
locator:
|
|
1432
|
-
frameLocator:
|
|
1431
|
+
locator: Qt,
|
|
1432
|
+
frameLocator: $t,
|
|
1433
1433
|
getByRole: {
|
|
1434
1434
|
to: "element",
|
|
1435
|
-
resolve: (e, t) =>
|
|
1436
|
-
render: (e) => ({ fragment: typeof e == "string" ? `[role="${
|
|
1435
|
+
resolve: (e, t) => K(e, `[role="${CSS.escape(t)}"]`),
|
|
1436
|
+
render: (e) => ({ fragment: typeof e == "string" ? `[role="${q(e)}"]` : "[role]" })
|
|
1437
1437
|
},
|
|
1438
1438
|
getByText: {
|
|
1439
1439
|
to: "element",
|
|
1440
1440
|
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("${
|
|
1441
|
+
render: (e) => ({ fragment: typeof e == "string" ? `:has-text("${q(e)}")` : ":has-text(...)" })
|
|
1442
1442
|
},
|
|
1443
1443
|
getByTestId: {
|
|
1444
1444
|
to: "element",
|
|
1445
|
-
resolve: (e, t) =>
|
|
1446
|
-
render: (e) => ({ fragment: typeof e == "string" ? `[data-testid="${
|
|
1445
|
+
resolve: (e, t) => K(e, `[data-testid="${CSS.escape(t)}"]`),
|
|
1446
|
+
render: (e) => ({ fragment: typeof e == "string" ? `[data-testid="${q(e)}"]` : "[data-testid]" })
|
|
1447
1447
|
},
|
|
1448
1448
|
first: {
|
|
1449
1449
|
to: "element",
|
|
@@ -1460,20 +1460,20 @@ var ft = class {
|
|
|
1460
1460
|
}
|
|
1461
1461
|
},
|
|
1462
1462
|
operations: {
|
|
1463
|
-
click:
|
|
1464
|
-
fill:
|
|
1465
|
-
hover:
|
|
1466
|
-
textContent:
|
|
1467
|
-
getAttribute:
|
|
1468
|
-
isVisible:
|
|
1469
|
-
count:
|
|
1470
|
-
exists:
|
|
1463
|
+
click: Ht,
|
|
1464
|
+
fill: Kt,
|
|
1465
|
+
hover: Ut,
|
|
1466
|
+
textContent: qt,
|
|
1467
|
+
getAttribute: Jt,
|
|
1468
|
+
isVisible: Yt,
|
|
1469
|
+
count: Xt,
|
|
1470
|
+
exists: Zt
|
|
1471
1471
|
}
|
|
1472
1472
|
},
|
|
1473
1473
|
frame: {
|
|
1474
1474
|
selectors: {
|
|
1475
|
-
locator:
|
|
1476
|
-
frameLocator:
|
|
1475
|
+
locator: Qt,
|
|
1476
|
+
frameLocator: $t,
|
|
1477
1477
|
owner: {
|
|
1478
1478
|
to: "frame",
|
|
1479
1479
|
barrier: "up",
|
|
@@ -1487,11 +1487,11 @@ var ft = class {
|
|
|
1487
1487
|
}
|
|
1488
1488
|
},
|
|
1489
1489
|
operations: {
|
|
1490
|
-
addStyleTag:
|
|
1491
|
-
fetch:
|
|
1490
|
+
addStyleTag: zt,
|
|
1491
|
+
fetch: W
|
|
1492
1492
|
}
|
|
1493
1493
|
}
|
|
1494
|
-
},
|
|
1494
|
+
}, tn = (e, t = en) => ({
|
|
1495
1495
|
element: {
|
|
1496
1496
|
selectors: {
|
|
1497
1497
|
...t.element.selectors,
|
|
@@ -1512,31 +1512,31 @@ var ft = class {
|
|
|
1512
1512
|
...e.frame?.operations
|
|
1513
1513
|
}
|
|
1514
1514
|
}
|
|
1515
|
-
}),
|
|
1515
|
+
}), nn = 3e4, rn = 50, an = (e) => {
|
|
1516
1516
|
let t = e[e.length - 1];
|
|
1517
1517
|
return typeof t == "object" && t ? t : void 0;
|
|
1518
|
-
},
|
|
1519
|
-
let t =
|
|
1520
|
-
return typeof t == "number" ? t :
|
|
1521
|
-
},
|
|
1518
|
+
}, on = (e) => {
|
|
1519
|
+
let t = an(e)?.timeout;
|
|
1520
|
+
return typeof t == "number" ? t : nn;
|
|
1521
|
+
}, sn = ({ executor: e, parts: t }) => ({ highlight: (n) => e.highlight(t, n).then(() => {}, () => {}) }), cn = async (e) => {
|
|
1522
1522
|
let t = {
|
|
1523
1523
|
parts: e.parts,
|
|
1524
1524
|
operation: e.operation,
|
|
1525
1525
|
args: e.args,
|
|
1526
1526
|
phase: "ensure"
|
|
1527
1527
|
};
|
|
1528
|
-
await e.gate?.(t,
|
|
1529
|
-
},
|
|
1528
|
+
await e.gate?.(t, sn(e));
|
|
1529
|
+
}, ln = (e, t) => {
|
|
1530
1530
|
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
|
-
},
|
|
1531
|
+
}, un = (e) => typeof e == "object" && e && typeof e.message == "string" ? e.message : String(e), dn = async (e) => {
|
|
1532
1532
|
let { executor: t, gate: n, parts: r, operation: i, args: a } = e;
|
|
1533
|
-
|
|
1533
|
+
ln(i, an(a)?.timeout), n && await n({
|
|
1534
1534
|
parts: r,
|
|
1535
1535
|
operation: i,
|
|
1536
1536
|
args: a,
|
|
1537
1537
|
phase: "execute"
|
|
1538
|
-
},
|
|
1539
|
-
let o =
|
|
1538
|
+
}, sn(e));
|
|
1539
|
+
let o = on(a), s = Date.now() + o, c = /* @__PURE__ */ Error(`Locator timeout (${o}ms): ${i}`), { promise: l, reject: u } = Promise.withResolvers();
|
|
1540
1540
|
l.catch(() => {});
|
|
1541
1541
|
let d = setTimeout(() => u(c), o), f = c;
|
|
1542
1542
|
try {
|
|
@@ -1544,47 +1544,62 @@ var ft = class {
|
|
|
1544
1544
|
return await Promise.race([t.execute(r, i, a), l]);
|
|
1545
1545
|
} catch (e) {
|
|
1546
1546
|
if (e === c) break;
|
|
1547
|
-
if (
|
|
1547
|
+
if (Tt(e)) throw e;
|
|
1548
1548
|
f = e;
|
|
1549
1549
|
let t = s - Date.now();
|
|
1550
1550
|
if (t <= 0) break;
|
|
1551
|
-
await new Promise((e) => setTimeout(e, Math.min(
|
|
1551
|
+
await new Promise((e) => setTimeout(e, Math.min(rn, t)));
|
|
1552
1552
|
}
|
|
1553
1553
|
} finally {
|
|
1554
1554
|
clearTimeout(d);
|
|
1555
1555
|
}
|
|
1556
|
-
throw f === c ? new
|
|
1557
|
-
},
|
|
1556
|
+
throw f === c ? new R(c.message) : new R(un(f), { cause: f });
|
|
1557
|
+
}, fn = (e, t, n, r, i) => {
|
|
1558
1558
|
let a = {};
|
|
1559
|
-
for (let [o, s] of Object.entries(t[r].selectors)) a[o] = (...a) =>
|
|
1559
|
+
for (let [o, s] of Object.entries(t[r].selectors)) a[o] = (...a) => fn(e, t, n, s.to, [...i, {
|
|
1560
1560
|
kind: r,
|
|
1561
1561
|
name: o,
|
|
1562
1562
|
args: a
|
|
1563
1563
|
}]);
|
|
1564
|
-
for (let [n, o] of Object.entries(t[r].operations)) a[n] = async (...t) =>
|
|
1564
|
+
for (let [n, o] of Object.entries(t[r].operations)) a[n] = async (...t) => dn({
|
|
1565
1565
|
...e,
|
|
1566
1566
|
parts: i,
|
|
1567
1567
|
operation: n,
|
|
1568
1568
|
args: o.send ? o.send(...t) : t
|
|
1569
1569
|
});
|
|
1570
|
-
for (let [o, { to: s, rewrite: c }] of Object.entries(n[r] ?? {})) a[o] = (...r) =>
|
|
1570
|
+
for (let [o, { to: s, rewrite: c }] of Object.entries(n[r] ?? {})) a[o] = (...r) => fn(e, t, n, s, c(i, ...r));
|
|
1571
1571
|
return a.ensure = (n, a = {}) => {
|
|
1572
1572
|
let o = t[r].operations[n]?.ensureArgs;
|
|
1573
|
-
return
|
|
1573
|
+
return cn({
|
|
1574
1574
|
...e,
|
|
1575
1575
|
parts: i,
|
|
1576
1576
|
operation: n,
|
|
1577
1577
|
args: o?.(a) ?? [a]
|
|
1578
1578
|
});
|
|
1579
1579
|
}, a;
|
|
1580
|
-
},
|
|
1580
|
+
}, pn = (e) => fn(e, e.modules ?? en, e.rewrites ?? {}, "frame", []), mn = (e, t) => {
|
|
1581
|
+
let n = e[t.kind];
|
|
1582
|
+
if (!n) throw L(`Unknown locator kind: "${t.kind}"`, t.name);
|
|
1583
|
+
let r = n.selectors[t.name];
|
|
1584
|
+
if (!r) throw L(`Unknown selector: "${t.kind}.${t.name}"`, t.name);
|
|
1585
|
+
return r;
|
|
1586
|
+
}, hn = (e, t) => {
|
|
1587
|
+
for (let n = 0; n < t.length; n++) {
|
|
1588
|
+
let r = mn(e, t[n]);
|
|
1589
|
+
if (r.barrier) return {
|
|
1590
|
+
module: r,
|
|
1591
|
+
index: n
|
|
1592
|
+
};
|
|
1593
|
+
}
|
|
1594
|
+
return null;
|
|
1595
|
+
}, gn = () => {
|
|
1581
1596
|
let e = E();
|
|
1582
1597
|
return e.status === "ok" && e.abi >= 2;
|
|
1583
|
-
},
|
|
1584
|
-
await
|
|
1598
|
+
}, _n = async () => {
|
|
1599
|
+
await O();
|
|
1585
1600
|
let e = E();
|
|
1586
1601
|
if (e.status === "ok" && e.abi < 2) throw new w(e.abi, 2);
|
|
1587
|
-
},
|
|
1602
|
+
}, vn = (e) => `Read the text, links and details ${e} shows.`, yn = (e) => `Inject unfiltered styles or code into ${e}. This can pass page details along to other sites.`, bn = [
|
|
1588
1603
|
{
|
|
1589
1604
|
id: "interaction",
|
|
1590
1605
|
heading: "Interaction",
|
|
@@ -1599,9 +1614,9 @@ var ft = class {
|
|
|
1599
1614
|
heading: "Site data",
|
|
1600
1615
|
summary: "Can read the website's data",
|
|
1601
1616
|
title: (e) => `Read data from ${e}`,
|
|
1602
|
-
description:
|
|
1617
|
+
description: vn,
|
|
1603
1618
|
cloudTitle: (e) => `Read what's on ${e}`,
|
|
1604
|
-
cloudDescription:
|
|
1619
|
+
cloudDescription: vn
|
|
1605
1620
|
},
|
|
1606
1621
|
{
|
|
1607
1622
|
id: "network",
|
|
@@ -1617,11 +1632,11 @@ var ft = class {
|
|
|
1617
1632
|
heading: "Evaluation",
|
|
1618
1633
|
summary: "Can execute arbitrary code on the website",
|
|
1619
1634
|
title: (e) => `Run code on ${e}`,
|
|
1620
|
-
description:
|
|
1635
|
+
description: yn,
|
|
1621
1636
|
cloudTitle: (e) => `Run its own code on ${e}`,
|
|
1622
|
-
cloudDescription:
|
|
1637
|
+
cloudDescription: yn
|
|
1623
1638
|
}
|
|
1624
|
-
],
|
|
1639
|
+
], xn = (e) => (t) => {
|
|
1625
1640
|
if (typeof t != "object" || !t) return t === void 0 ? [] : [t];
|
|
1626
1641
|
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
1642
|
let { relativePosition: n, ...r } = t;
|
|
@@ -1629,40 +1644,40 @@ var ft = class {
|
|
|
1629
1644
|
...r,
|
|
1630
1645
|
position: n
|
|
1631
1646
|
}];
|
|
1632
|
-
},
|
|
1647
|
+
}, Sn = tn({
|
|
1633
1648
|
element: { operations: {
|
|
1634
1649
|
click: {
|
|
1635
|
-
resolve: (e, t = {}) =>
|
|
1636
|
-
send:
|
|
1650
|
+
resolve: (e, t = {}) => G.click.resolve(e, t),
|
|
1651
|
+
send: xn("click")
|
|
1637
1652
|
},
|
|
1638
1653
|
hover: {
|
|
1639
|
-
resolve: (e, t = {}) =>
|
|
1640
|
-
send:
|
|
1654
|
+
resolve: (e, t = {}) => G.hover.resolve(e, t),
|
|
1655
|
+
send: xn("hover")
|
|
1641
1656
|
},
|
|
1642
|
-
fill: { resolve: (e, t, n = {}) =>
|
|
1643
|
-
textContent: { resolve: (e, t = {}) =>
|
|
1644
|
-
getAttribute: { resolve: (e, t, n = {}) =>
|
|
1645
|
-
isVisible: { resolve: (e, t = {}) =>
|
|
1646
|
-
count: { resolve: (e, t = {}) =>
|
|
1647
|
-
exists: { resolve: (e, t = {}) =>
|
|
1648
|
-
videoElement: { resolve: (e, t = {}) =>
|
|
1657
|
+
fill: { resolve: (e, t, n = {}) => G.fill.resolve(e, t, n) },
|
|
1658
|
+
textContent: { resolve: (e, t = {}) => G.textContent.resolve(e) },
|
|
1659
|
+
getAttribute: { resolve: (e, t, n = {}) => G.getAttribute.resolve(e, t) },
|
|
1660
|
+
isVisible: { resolve: (e, t = {}) => G.isVisible.resolve(e) },
|
|
1661
|
+
count: { resolve: (e, t = {}) => G.count.resolve(e) },
|
|
1662
|
+
exists: { resolve: (e, t = {}) => G.exists.resolve(e) },
|
|
1663
|
+
videoElement: { resolve: (e, t = {}) => _e(Dt(U(e.elements), "HTMLVideoElement")) }
|
|
1649
1664
|
} },
|
|
1650
1665
|
frame: { operations: {
|
|
1651
|
-
addStyleTag: { resolve: (e, t) =>
|
|
1666
|
+
addStyleTag: { resolve: (e, t) => zt.resolve(e, t) },
|
|
1652
1667
|
fetch: {
|
|
1653
|
-
resolve: (e, t, n = {}) =>
|
|
1654
|
-
kind:
|
|
1655
|
-
ensureArgs:
|
|
1668
|
+
resolve: (e, t, n = {}) => W.resolve(e, t, n),
|
|
1669
|
+
kind: W.kind,
|
|
1670
|
+
ensureArgs: W.ensureArgs
|
|
1656
1671
|
},
|
|
1657
1672
|
evaluate: {
|
|
1658
1673
|
kind: "frame",
|
|
1659
1674
|
typed: !1,
|
|
1660
1675
|
resolve: (e, t, n) => {
|
|
1661
|
-
throw
|
|
1676
|
+
throw bt("evaluate", "this realm");
|
|
1662
1677
|
}
|
|
1663
1678
|
}
|
|
1664
1679
|
} }
|
|
1665
|
-
}),
|
|
1680
|
+
}), Cn = (e) => e[e.length - 1], wn = {
|
|
1666
1681
|
element: {
|
|
1667
1682
|
last: {
|
|
1668
1683
|
to: "element",
|
|
@@ -1675,7 +1690,7 @@ var ft = class {
|
|
|
1675
1690
|
contentFrame: {
|
|
1676
1691
|
to: "frame",
|
|
1677
1692
|
rewrite: (e) => {
|
|
1678
|
-
let t =
|
|
1693
|
+
let t = Cn(e);
|
|
1679
1694
|
if (t?.name !== "locator") throw TypeError("locator.contentFrame: only a locator that ends in locator(selector) can enter its frame; use frameLocator(selector)");
|
|
1680
1695
|
return [...e.slice(0, -1), {
|
|
1681
1696
|
...t,
|
|
@@ -1688,7 +1703,7 @@ var ft = class {
|
|
|
1688
1703
|
owner: {
|
|
1689
1704
|
to: "element",
|
|
1690
1705
|
rewrite: (e) => {
|
|
1691
|
-
let t =
|
|
1706
|
+
let t = Cn(e);
|
|
1692
1707
|
if (t?.name !== "frameLocator") throw TypeError("frameLocator.owner: this frame was not entered through frameLocator(selector)");
|
|
1693
1708
|
return [...e.slice(0, -1), {
|
|
1694
1709
|
...t,
|
|
@@ -1705,7 +1720,7 @@ var ft = class {
|
|
|
1705
1720
|
}]
|
|
1706
1721
|
}
|
|
1707
1722
|
}
|
|
1708
|
-
},
|
|
1723
|
+
}, Tn = (e) => {
|
|
1709
1724
|
if (!e || e === "about:blank") return !1;
|
|
1710
1725
|
let t;
|
|
1711
1726
|
try {
|
|
@@ -1713,46 +1728,46 @@ var ft = class {
|
|
|
1713
1728
|
} catch {
|
|
1714
1729
|
return !1;
|
|
1715
1730
|
}
|
|
1716
|
-
return t.protocol === "chrome-extension:" || t.protocol === "moz-extension:" || t.protocol !== "about:" &&
|
|
1717
|
-
},
|
|
1718
|
-
if (
|
|
1719
|
-
},
|
|
1731
|
+
return t.protocol === "chrome-extension:" || t.protocol === "moz-extension:" || t.protocol !== "about:" && qe(t.hostname);
|
|
1732
|
+
}, J = (e) => {
|
|
1733
|
+
if (Tn(e)) throw Error("attachFrame: refusing to target the extension's own pages or an FKN platform origin");
|
|
1734
|
+
}, En = ({ src: e, domains: t, lockdown: n }) => {
|
|
1720
1735
|
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
|
-
},
|
|
1736
|
+
}, Dn = {
|
|
1722
1737
|
scope: "embed.iframe",
|
|
1723
1738
|
category: "interaction",
|
|
1724
1739
|
severity: 0,
|
|
1725
1740
|
title: "Load another website inside this app",
|
|
1726
1741
|
description: "Lets the app embed external pages directly inside its own view."
|
|
1727
|
-
},
|
|
1742
|
+
}, On = {
|
|
1728
1743
|
scope: "embed.open",
|
|
1729
1744
|
category: "interaction",
|
|
1730
1745
|
severity: 0,
|
|
1731
1746
|
title: "Open a website inside this app",
|
|
1732
1747
|
description: "Lets the app navigate to another site without leaving its window."
|
|
1733
|
-
},
|
|
1748
|
+
}, kn = ["load", "commit"], An = (e) => {
|
|
1734
1749
|
if ("timeoutMs" in e) throw TypeError("frame.goto: pass timeout, in milliseconds; timeoutMs is not an option");
|
|
1735
1750
|
let { waitUntil: t, timeout: n } = e;
|
|
1736
|
-
if (t !== void 0 && !
|
|
1751
|
+
if (t !== void 0 && !kn.includes(t)) throw TypeError(`frame.goto: waitUntil must be 'load' or 'commit', not ${JSON.stringify(t)}`);
|
|
1737
1752
|
if (n !== void 0 && typeof n != "number") throw TypeError("frame.goto: timeout must be a number of milliseconds");
|
|
1738
|
-
|
|
1739
|
-
},
|
|
1753
|
+
ln("frame.goto", n);
|
|
1754
|
+
}, jn = class extends Error {
|
|
1740
1755
|
name = "FrameWindowBlockedError";
|
|
1741
1756
|
constructor() {
|
|
1742
1757
|
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
1758
|
}
|
|
1744
|
-
},
|
|
1759
|
+
}, Mn = /* @__PURE__ */ new Set([
|
|
1745
1760
|
"jar-unreachable",
|
|
1746
1761
|
"bad-url",
|
|
1747
1762
|
"opaque-opener"
|
|
1748
|
-
]),
|
|
1763
|
+
]), Nn = class extends Error {
|
|
1749
1764
|
name = "FrameWindowRefusedError";
|
|
1750
1765
|
reason;
|
|
1751
1766
|
constructor(e) {
|
|
1752
|
-
let t =
|
|
1767
|
+
let t = Mn.has(e) ? e : "unknown";
|
|
1753
1768
|
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
1769
|
}
|
|
1755
|
-
},
|
|
1770
|
+
}, Pn = ["message", "document"], Fn = (e) => {
|
|
1756
1771
|
if (e === "*") return "*";
|
|
1757
1772
|
let t = () => /* @__PURE__ */ TypeError(`frame.postMessage: targetOrigin must be '*' or an origin, not ${JSON.stringify(e)}`);
|
|
1758
1773
|
if (typeof e != "string") throw t();
|
|
@@ -1764,48 +1779,48 @@ var ft = class {
|
|
|
1764
1779
|
}
|
|
1765
1780
|
if (n === "null") throw t();
|
|
1766
1781
|
return n;
|
|
1767
|
-
},
|
|
1782
|
+
}, In = (e, t) => {
|
|
1768
1783
|
let n = typeof e == "object" && !!e;
|
|
1769
1784
|
if (n && t !== void 0) throw TypeError("frame.postMessage: pass transfer inside the options object, not after it");
|
|
1770
1785
|
let r = n ? e.targetOrigin ?? "*" : e ?? "*", i = n ? e.transfer : t;
|
|
1771
1786
|
if (i !== void 0 && !Array.isArray(i)) throw TypeError("frame.postMessage: transfer must be an array");
|
|
1772
1787
|
return {
|
|
1773
|
-
targetOrigin:
|
|
1788
|
+
targetOrigin: Fn(r),
|
|
1774
1789
|
transfer: i === void 0 ? [] : [...i]
|
|
1775
1790
|
};
|
|
1776
|
-
},
|
|
1791
|
+
}, Ln = [
|
|
1777
1792
|
"url",
|
|
1778
1793
|
"path",
|
|
1779
1794
|
"type"
|
|
1780
|
-
],
|
|
1795
|
+
], Rn = ["content", "sourceUrl"], zn = /[\n\r\u2028\u2029]/, Bn = (e) => {
|
|
1781
1796
|
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) =>
|
|
1797
|
+
let t = Object.keys(e), n = t.find((e) => Ln.includes(e));
|
|
1783
1798
|
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) => !
|
|
1799
|
+
let r = t.find((e) => !Rn.includes(e));
|
|
1785
1800
|
if (r !== void 0) throw TypeError(`frame.addScriptTag: unknown option "${r}"`);
|
|
1786
1801
|
let { content: i, sourceUrl: a } = e;
|
|
1787
1802
|
if (typeof i != "string") throw TypeError("frame.addScriptTag: content must be a string");
|
|
1788
|
-
if (a !== void 0 && (typeof a != "string" || a === "" ||
|
|
1803
|
+
if (a !== void 0 && (typeof a != "string" || a === "" || zn.test(a))) throw TypeError("frame.addScriptTag: sourceUrl must be a non-empty string with no line break");
|
|
1789
1804
|
return a === void 0 ? { content: i } : {
|
|
1790
1805
|
content: i,
|
|
1791
1806
|
sourceUrl: a
|
|
1792
1807
|
};
|
|
1793
|
-
},
|
|
1808
|
+
}, Vn = [
|
|
1794
1809
|
"name",
|
|
1795
1810
|
"domain",
|
|
1796
1811
|
"path"
|
|
1797
|
-
],
|
|
1812
|
+
], Hn = (e) => e instanceof RegExp || Object.prototype.toString.call(e) === "[object RegExp]", Un = (e) => {
|
|
1798
1813
|
if (e === void 0) return {};
|
|
1799
1814
|
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) => !
|
|
1815
|
+
let t = e, n = Object.keys(t).find((e) => !Vn.includes(e));
|
|
1801
1816
|
if (n !== void 0) throw TypeError(`frame.clearCookies: unknown option "${n}"`);
|
|
1802
|
-
let r =
|
|
1817
|
+
let r = Vn.flatMap((e) => {
|
|
1803
1818
|
let n = t[e];
|
|
1804
1819
|
return n === void 0 ? [] : [{
|
|
1805
1820
|
key: e,
|
|
1806
1821
|
value: n
|
|
1807
1822
|
}];
|
|
1808
|
-
}), i = r.find(({ value: e }) =>
|
|
1823
|
+
}), i = r.find(({ value: e }) => Hn(e));
|
|
1809
1824
|
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
1825
|
let a = r.find(({ value: e }) => typeof e != "string");
|
|
1811
1826
|
if (a !== void 0) throw TypeError(`frame.clearCookies: ${a.key} must be a string`);
|
|
@@ -1814,15 +1829,15 @@ var ft = class {
|
|
|
1814
1829
|
let s = {};
|
|
1815
1830
|
for (let { key: e, value: t } of r) s[e] = { equals: t };
|
|
1816
1831
|
return s;
|
|
1817
|
-
},
|
|
1832
|
+
}, Wn = (e) => {
|
|
1818
1833
|
typeof globalThis.reportError == "function" ? globalThis.reportError(e) : console.error(e);
|
|
1819
|
-
},
|
|
1820
|
-
let { owner: t, ...n } =
|
|
1834
|
+
}, Gn = (e) => {
|
|
1835
|
+
let { owner: t, ...n } = pn({
|
|
1821
1836
|
executor: e.executor,
|
|
1822
|
-
modules:
|
|
1823
|
-
rewrites:
|
|
1837
|
+
modules: Sn,
|
|
1838
|
+
rewrites: wn,
|
|
1824
1839
|
gate: e.gate
|
|
1825
|
-
}), r = async (t, n = {}) => (
|
|
1840
|
+
}), r = async (t, n = {}) => (J(t), An(n), e.goto(t, n)), i = () => e.url(), a = async (t) => {
|
|
1826
1841
|
let n = e.requestPermissions;
|
|
1827
1842
|
if (!n) throw Error("frame.requestPermissions: this backend cannot ask for permission categories");
|
|
1828
1843
|
return n(t);
|
|
@@ -1833,18 +1848,18 @@ var ft = class {
|
|
|
1833
1848
|
if (typeof i != "string") throw TypeError("frame.evaluate: pass a function or a source string");
|
|
1834
1849
|
return r(i, structuredClone(n));
|
|
1835
1850
|
}, s = async (t) => {
|
|
1836
|
-
let { content: n, ...r } =
|
|
1851
|
+
let { content: n, ...r } = Bn(t), i = e.addScriptTag;
|
|
1837
1852
|
if (!i) throw Error("frame.addScriptTag: this backend cannot run scripts in the attached frame");
|
|
1838
1853
|
await i(n, r);
|
|
1839
1854
|
}, c = async (t) => {
|
|
1840
|
-
let n =
|
|
1855
|
+
let n = Un(t), r = e.clearCookies;
|
|
1841
1856
|
if (!r) throw Error("frame.clearCookies: this backend cannot clear cookies");
|
|
1842
1857
|
await r(n);
|
|
1843
1858
|
}, l = ((t, n, r) => {
|
|
1844
1859
|
try {
|
|
1845
1860
|
let i = e.postMessage;
|
|
1846
1861
|
if (!i) throw Error("frame.postMessage: this backend cannot message the attached frame");
|
|
1847
|
-
let a =
|
|
1862
|
+
let a = In(n, r);
|
|
1848
1863
|
return i(t, a.targetOrigin, a.transfer);
|
|
1849
1864
|
} catch (e) {
|
|
1850
1865
|
return Promise.reject(e);
|
|
@@ -1853,7 +1868,7 @@ var ft = class {
|
|
|
1853
1868
|
message: /* @__PURE__ */ new Set(),
|
|
1854
1869
|
document: /* @__PURE__ */ new Set()
|
|
1855
1870
|
}, d = null, f = (e, t) => {
|
|
1856
|
-
if (!
|
|
1871
|
+
if (!Pn.includes(e)) throw TypeError(`frame.${t}: the event type must be ${Pn.map((e) => `'${e}'`).join(" or ")}, not ${JSON.stringify(e)}`);
|
|
1857
1872
|
return u[e];
|
|
1858
1873
|
}, p = (e) => {
|
|
1859
1874
|
let t = e.type === "message" ? Object.freeze({
|
|
@@ -1869,7 +1884,7 @@ var ft = class {
|
|
|
1869
1884
|
for (let n of [...u[e.type]]) try {
|
|
1870
1885
|
n(t);
|
|
1871
1886
|
} catch (e) {
|
|
1872
|
-
|
|
1887
|
+
Wn(e);
|
|
1873
1888
|
}
|
|
1874
1889
|
}, m = (e, t) => {
|
|
1875
1890
|
if (f(e, "off").delete(t), d !== null && !u.message.size && !u.document.size) {
|
|
@@ -1902,7 +1917,7 @@ var ft = class {
|
|
|
1902
1917
|
off: m
|
|
1903
1918
|
};
|
|
1904
1919
|
return _;
|
|
1905
|
-
},
|
|
1920
|
+
}, Kn = [
|
|
1906
1921
|
h,
|
|
1907
1922
|
t,
|
|
1908
1923
|
g,
|
|
@@ -1916,43 +1931,43 @@ var ft = class {
|
|
|
1916
1931
|
l,
|
|
1917
1932
|
f,
|
|
1918
1933
|
u,
|
|
1919
|
-
|
|
1920
|
-
|
|
1934
|
+
Dn,
|
|
1935
|
+
On,
|
|
1921
1936
|
m,
|
|
1922
1937
|
r,
|
|
1938
|
+
Je,
|
|
1923
1939
|
Ye,
|
|
1924
1940
|
Xe,
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
], Wn = _n.map((e) => e.id), Gn = {
|
|
1941
|
+
rt,
|
|
1942
|
+
at
|
|
1943
|
+
], qn = bn.map((e) => e.id), Jn = {
|
|
1929
1944
|
interaction: "act.click",
|
|
1930
1945
|
storage: "read.text",
|
|
1931
1946
|
network: "network.fetchCredentialed",
|
|
1932
1947
|
evaluation: "media.appearU"
|
|
1933
|
-
},
|
|
1948
|
+
}, Yn = (e) => e === 0 ? "auto" : e === 4 ? "critical" : "bundled", Xn = Kn, Y = /* @__PURE__ */ new Map(), Zn = {};
|
|
1934
1949
|
(() => {
|
|
1935
|
-
|
|
1936
|
-
let e = (e) =>
|
|
1937
|
-
Object.fromEntries(
|
|
1950
|
+
Y = new Map(Xn.map((e) => [e.scope, e])), Zn = Object.fromEntries(Y), Xn.filter((e) => e.severity === 4).map((e) => e.scope);
|
|
1951
|
+
let e = (e) => Xn.filter((t) => t.category === e && Yn(t.severity) === "bundled");
|
|
1952
|
+
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
1953
|
})();
|
|
1939
|
-
var
|
|
1940
|
-
let t =
|
|
1941
|
-
return t &&
|
|
1942
|
-
},
|
|
1943
|
-
let t =
|
|
1944
|
-
if (t) return
|
|
1945
|
-
},
|
|
1946
|
-
let n = t ?? (e &&
|
|
1947
|
-
return n !== void 0 &&
|
|
1948
|
-
},
|
|
1949
|
-
for (let { category: n, key: r } of t) if (
|
|
1954
|
+
var Qn = (e) => Y.get(e)?.category, $n = (e) => {
|
|
1955
|
+
let t = Y.get(e);
|
|
1956
|
+
return t && Yn(t.severity);
|
|
1957
|
+
}, er = (e) => {
|
|
1958
|
+
let t = Y.get(e);
|
|
1959
|
+
if (t) return Yn(t.severity) === "critical" ? t.scope : t.category;
|
|
1960
|
+
}, tr = (e) => Jn[e], nr = ({ category: e, key: t }) => {
|
|
1961
|
+
let n = t ?? (e && tr(e));
|
|
1962
|
+
return n !== void 0 && Qn(n) !== void 0 ? n : void 0;
|
|
1963
|
+
}, rr = (e, t) => {
|
|
1964
|
+
for (let { category: n, key: r } of t) if (nr({
|
|
1950
1965
|
category: n,
|
|
1951
1966
|
key: r
|
|
1952
1967
|
}) === 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
|
-
},
|
|
1968
|
+
}, ir = (e, t = {}) => {
|
|
1954
1969
|
let n = [], r = e.map((e) => {
|
|
1955
|
-
let r =
|
|
1970
|
+
let r = nr(e), i = [];
|
|
1956
1971
|
if (r !== void 0) for (let a of e.hosts) i.push(n.length), n.push({
|
|
1957
1972
|
...t,
|
|
1958
1973
|
key: r,
|
|
@@ -1962,8 +1977,8 @@ var Yn = (e) => X.get(e)?.category, Xn = (e) => {
|
|
|
1962
1977
|
reason: e.reason
|
|
1963
1978
|
});
|
|
1964
1979
|
return {
|
|
1965
|
-
key: r !== void 0 &&
|
|
1966
|
-
category: r === void 0 ? e.category ?? "interaction" :
|
|
1980
|
+
key: r !== void 0 && $n(r) === "critical" ? r : void 0,
|
|
1981
|
+
category: r === void 0 ? e.category ?? "interaction" : Zn[r].category,
|
|
1967
1982
|
hosts: e.hosts,
|
|
1968
1983
|
indexes: i
|
|
1969
1984
|
};
|
|
@@ -1977,31 +1992,31 @@ var Yn = (e) => X.get(e)?.category, Xn = (e) => {
|
|
|
1977
1992
|
allow: i.length > 0 && i.every((t) => e[t]?.allow === !0)
|
|
1978
1993
|
}))
|
|
1979
1994
|
};
|
|
1980
|
-
},
|
|
1981
|
-
typeof window < "u" &&
|
|
1982
|
-
if (!
|
|
1995
|
+
}, ar = (e) => typeof e == "object" && !!e, or = typeof chrome < "u" && !!chrome.runtime?.id, sr = (e) => ar(e) && e.FKN_WEB_EXTENSION_FRAME_ANNOUNCE_KEY === !0 && typeof e.frameId == "string" && typeof e.document == "string", cr = /* @__PURE__ */ new WeakMap(), lr = /* @__PURE__ */ new WeakMap(), ur = /* @__PURE__ */ new WeakMap(), dr = /* @__PURE__ */ new Set();
|
|
1996
|
+
typeof window < "u" && or && window.addEventListener("message", (e) => {
|
|
1997
|
+
if (!sr(e.data)) return;
|
|
1983
1998
|
e.stopImmediatePropagation();
|
|
1984
1999
|
let t = e.source;
|
|
1985
2000
|
if (!t || typeof t != "object") return;
|
|
1986
|
-
let n = t, r =
|
|
1987
|
-
if (
|
|
1988
|
-
let o =
|
|
2001
|
+
let n = t, r = cr.get(n), i = e.data.frameId, a = e.data.document;
|
|
2002
|
+
if (cr.set(n, i), lr.set(n, a), r) for (let e of dr) e(r);
|
|
2003
|
+
let o = ur.get(n);
|
|
1989
2004
|
if (o) {
|
|
1990
2005
|
for (let e of [...o]) (e.notDocument === void 0 || e.notDocument !== a) && (o.delete(e), e.resolve(i));
|
|
1991
|
-
o.size ||
|
|
2006
|
+
o.size || ur.delete(n);
|
|
1992
2007
|
}
|
|
1993
2008
|
}, { capture: !0 });
|
|
1994
2009
|
//#endregion
|
|
1995
2010
|
//#region ../web-extension/lib/lib/evaluate-deadline.js
|
|
1996
|
-
var
|
|
2011
|
+
var fr = 3e4, pr = `frame.evaluate: the code did not settle within ${fr}ms`, mr = () => new R(pr), hr = (e) => z(e) && e.message === pr ? mr() : e, gr = [
|
|
1997
2012
|
/^frame load timed out after \d+ms for /,
|
|
1998
2013
|
/^frame goto: documentstart timed out$/,
|
|
1999
2014
|
/^navigation to .+ did not commit a document within \d+ms$/s
|
|
2000
|
-
],
|
|
2001
|
-
if (e instanceof
|
|
2015
|
+
], _r = (e) => {
|
|
2016
|
+
if (e instanceof R) return e;
|
|
2002
2017
|
let t = typeof e?.message == "string" ? e.message : "";
|
|
2003
|
-
return
|
|
2004
|
-
},
|
|
2018
|
+
return gr.some((e) => e.test(t)) ? new R(t) : e;
|
|
2019
|
+
}, vr = (e) => {
|
|
2005
2020
|
let t = e;
|
|
2006
2021
|
if (t.window === void 0) return "iframe";
|
|
2007
2022
|
if (t.iframe !== void 0) throw TypeError("attachFrame: pass either iframe or window, not both");
|
|
@@ -2009,11 +2024,11 @@ var lr = 3e4, ur = `frame.evaluate: the code did not settle within ${lr}ms`, dr
|
|
|
2009
2024
|
if (t.blank !== void 0) throw TypeError("attachFrame: blank does not apply to a window");
|
|
2010
2025
|
if (typeof t.window != "object" || t.window === null) throw TypeError("attachFrame: window must be an object");
|
|
2011
2026
|
return "window";
|
|
2012
|
-
},
|
|
2027
|
+
}, yr = (e, t, n) => {
|
|
2013
2028
|
if (e === void 0) return t;
|
|
2014
2029
|
if (typeof e != "number" || !Number.isFinite(e) || e <= 0) throw TypeError(`attachFrame: window.${n} must be a positive number of CSS pixels`);
|
|
2015
2030
|
return Math.round(e);
|
|
2016
|
-
},
|
|
2031
|
+
}, br = ({ url: e, width: t, height: n }) => {
|
|
2017
2032
|
let r = (() => {
|
|
2018
2033
|
if (e === void 0 || e === "" || e === "about:blank") return "";
|
|
2019
2034
|
if (typeof e != "string") throw TypeError("attachFrame: window.url must be a string");
|
|
@@ -2027,12 +2042,12 @@ var lr = 3e4, ur = `frame.evaluate: the code did not settle within ${lr}ms`, dr
|
|
|
2027
2042
|
if (t.protocol !== "http:" && t.protocol !== "https:") throw TypeError("attachFrame: window.url must be an http or https address");
|
|
2028
2043
|
return t.href;
|
|
2029
2044
|
})();
|
|
2030
|
-
return r &&
|
|
2045
|
+
return r && J(r), {
|
|
2031
2046
|
url: r,
|
|
2032
|
-
width:
|
|
2033
|
-
height:
|
|
2047
|
+
width: yr(t, 500, "width"),
|
|
2048
|
+
height: yr(n, 700, "height")
|
|
2034
2049
|
};
|
|
2035
|
-
},
|
|
2050
|
+
}, xr = "attachFrame: storageState seeds a fresh jar, so it needs cookies: 'ephemeral'", Sr = 1e11, Cr = [
|
|
2036
2051
|
"name",
|
|
2037
2052
|
"value",
|
|
2038
2053
|
"domain",
|
|
@@ -2041,11 +2056,11 @@ var lr = 3e4, ur = `frame.evaluate: the code did not settle within ${lr}ms`, dr
|
|
|
2041
2056
|
"httpOnly",
|
|
2042
2057
|
"secure",
|
|
2043
2058
|
"sameSite"
|
|
2044
|
-
],
|
|
2059
|
+
], wr = [
|
|
2045
2060
|
"Strict",
|
|
2046
2061
|
"Lax",
|
|
2047
2062
|
"None"
|
|
2048
|
-
],
|
|
2063
|
+
], X = /[;\x00-\x1f\x7f]/, Z = (e, t) => /* @__PURE__ */ TypeError(`attachFrame: storageState${e} ${t}`), Q = (e) => Object.prototype.toString.call(e) === "[object Object]", Tr = (e) => {
|
|
2049
2064
|
let t = e.startsWith(".") ? e.slice(1) : e;
|
|
2050
2065
|
if (t === "") return null;
|
|
2051
2066
|
try {
|
|
@@ -2053,19 +2068,19 @@ var lr = 3e4, ur = `frame.evaluate: the code did not settle within ${lr}ms`, dr
|
|
|
2053
2068
|
} catch {
|
|
2054
2069
|
return null;
|
|
2055
2070
|
}
|
|
2056
|
-
},
|
|
2071
|
+
}, Er = (e, t) => {
|
|
2057
2072
|
if (!Q(e)) throw Z(t, "must be an object");
|
|
2058
|
-
let n = Object.keys(e).find((e) => !
|
|
2073
|
+
let n = Object.keys(e).find((e) => !Cr.includes(e));
|
|
2059
2074
|
if (n !== void 0) throw Z(`${t}.${n}`, "is not a cookie field");
|
|
2060
2075
|
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("=") ||
|
|
2062
|
-
if (typeof i != "string" ||
|
|
2063
|
-
if (typeof a != "string" ||
|
|
2064
|
-
if (o !== void 0 && (typeof o != "string" || !o.startsWith("/") ||
|
|
2076
|
+
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");
|
|
2077
|
+
if (typeof i != "string" || X.test(i)) throw Z(`${t}.value`, "must be a string with no \";\" or control character");
|
|
2078
|
+
if (typeof a != "string" || Tr(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");
|
|
2079
|
+
if (o !== void 0 && (typeof o != "string" || !o.startsWith("/") || X.test(o))) throw Z(`${t}.path`, "must be a string starting with \"/\"");
|
|
2065
2080
|
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
2081
|
if (c !== void 0 && typeof c != "boolean") throw Z(`${t}.httpOnly`, "must be a boolean");
|
|
2067
2082
|
if (l !== void 0 && typeof l != "boolean") throw Z(`${t}.secure`, "must be a boolean");
|
|
2068
|
-
if (u !== void 0 && !
|
|
2083
|
+
if (u !== void 0 && !wr.includes(u)) throw Z(`${t}.sameSite`, `must be 'Strict', 'Lax' or 'None', not ${JSON.stringify(u)}`);
|
|
2069
2084
|
let d = r.toLowerCase();
|
|
2070
2085
|
if (u === "None" && l !== !0) throw Z(t, "is SameSite=None, which needs secure: true");
|
|
2071
2086
|
if (d.startsWith("__secure-") && l !== !0) throw Z(t, "is a __Secure- cookie, which needs secure: true");
|
|
@@ -2076,7 +2091,7 @@ var lr = 3e4, ur = `frame.evaluate: the code did not settle within ${lr}ms`, dr
|
|
|
2076
2091
|
domain: a
|
|
2077
2092
|
};
|
|
2078
2093
|
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
|
-
},
|
|
2094
|
+
}, Dr = (e, t) => {
|
|
2080
2095
|
if (!Q(e)) throw Z(t, "must be an object { origin, localStorage }");
|
|
2081
2096
|
let n = Object.keys(e).find((e) => e !== "origin" && e !== "localStorage");
|
|
2082
2097
|
if (n !== void 0) throw Z(`${t}.${n}`, "is not an origin field");
|
|
@@ -2100,30 +2115,30 @@ var lr = 3e4, ur = `frame.evaluate: the code did not settle within ${lr}ms`, dr
|
|
|
2100
2115
|
};
|
|
2101
2116
|
})
|
|
2102
2117
|
};
|
|
2103
|
-
},
|
|
2118
|
+
}, Or = (e) => {
|
|
2104
2119
|
if (!Q(e)) throw Z("", "must be an object { cookies?, origins? }");
|
|
2105
2120
|
let t = Object.keys(e).find((e) => e !== "cookies" && e !== "origins");
|
|
2106
2121
|
if (t !== void 0) throw Z(`.${t}`, "is not a storageState key; it takes cookies and origins");
|
|
2107
2122
|
let { cookies: n = [], origins: r = [] } = e;
|
|
2108
2123
|
if (!Array.isArray(n)) throw Z(".cookies", "must be an array");
|
|
2109
2124
|
if (!Array.isArray(r)) throw Z(".origins", "must be an array");
|
|
2110
|
-
let i = n.map((e, t) =>
|
|
2125
|
+
let i = n.map((e, t) => Er(e, `.cookies[${t}]`)), a = r.map((e, t) => Dr(e, `.origins[${t}]`));
|
|
2111
2126
|
return i.forEach(({ expires: e }, t) => {
|
|
2112
|
-
if (e !== void 0 && e > 0 && e <
|
|
2127
|
+
if (e !== void 0 && e > 0 && e < Sr) 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
2128
|
}), {
|
|
2114
2129
|
cookies: i,
|
|
2115
2130
|
origins: a
|
|
2116
2131
|
};
|
|
2117
|
-
},
|
|
2132
|
+
}, kr = [
|
|
2118
2133
|
"persistent",
|
|
2119
2134
|
"ephemeral",
|
|
2120
2135
|
"native"
|
|
2121
|
-
],
|
|
2122
|
-
if ("syncCookies" in e) throw TypeError(
|
|
2136
|
+
], Ar = "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'", jr = (e) => {
|
|
2137
|
+
if ("syncCookies" in e) throw TypeError(Ar);
|
|
2123
2138
|
let { cookies: t = "persistent" } = e;
|
|
2124
|
-
if (!
|
|
2125
|
-
if (e.storageState !== void 0 && t !== "ephemeral") throw TypeError(
|
|
2126
|
-
let n = e.storageState === void 0 ? void 0 :
|
|
2139
|
+
if (!kr.includes(t)) throw TypeError(`attachFrame: cookies must be 'persistent', 'ephemeral' or 'native', not ${JSON.stringify(t)}`);
|
|
2140
|
+
if (e.storageState !== void 0 && t !== "ephemeral") throw TypeError(xr);
|
|
2141
|
+
let n = e.storageState === void 0 ? void 0 : Or(e.storageState), r = vr(e);
|
|
2127
2142
|
if (r === "iframe" && e.lockdown && t !== "native") throw TypeError("attachFrame: lockdown runs on the extension, which serves only cookies: 'native'");
|
|
2128
2143
|
return n === void 0 ? {
|
|
2129
2144
|
kind: r,
|
|
@@ -2133,20 +2148,20 @@ var lr = 3e4, ur = `frame.evaluate: the code did not settle within ${lr}ms`, dr
|
|
|
2133
2148
|
cookies: t,
|
|
2134
2149
|
storageState: n
|
|
2135
2150
|
};
|
|
2136
|
-
},
|
|
2151
|
+
}, Mr = (e) => {
|
|
2137
2152
|
try {
|
|
2138
2153
|
return new URL(e).hostname;
|
|
2139
2154
|
} catch {
|
|
2140
2155
|
return "";
|
|
2141
2156
|
}
|
|
2142
|
-
},
|
|
2143
|
-
|
|
2144
|
-
},
|
|
2157
|
+
}, Nr = "FKN_WEB_EXTENSION_ATTACH_FRAME_EVENT_KEY", Pr = !1, Fr = () => {
|
|
2158
|
+
Pr || (Pr = !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."));
|
|
2159
|
+
}, Ir = "frame: this frame no longer holds the document the app attached it to", Lr = "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", Rr = () => {
|
|
2145
2160
|
let e = E();
|
|
2146
2161
|
if (e.status === "ok" && e.abi >= 1) return;
|
|
2147
2162
|
let t = e.status === "absent" ? 0 : e.abi;
|
|
2148
2163
|
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
|
-
},
|
|
2164
|
+
}, zr = (e) => {
|
|
2150
2165
|
try {
|
|
2151
2166
|
return new URL(e, location.href).hostname;
|
|
2152
2167
|
} catch {
|
|
@@ -2155,28 +2170,28 @@ var lr = 3e4, ur = `frame.evaluate: the code did not settle within ${lr}ms`, dr
|
|
|
2155
2170
|
}, $ = () => {
|
|
2156
2171
|
let e = E();
|
|
2157
2172
|
return e.status === "absent" ? 0 : e.abi;
|
|
2158
|
-
},
|
|
2159
|
-
if (i !== void 0) throw new T("blank", $(),
|
|
2173
|
+
}, Br = "attachFrame: a blank page is served by the cloud render proxy only; call cloud.attachFrame", Vr = "frame.addScriptTag: an extension frame does not run scripts through mirage yet; attach with cloud.attachFrame", Hr = "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", Ur = async ({ iframe: e, domains: t = [], lockdown: n = !1, permissions: r, blank: i }) => {
|
|
2174
|
+
if (i !== void 0) throw new T("blank", $(), Br);
|
|
2160
2175
|
let a = crypto.randomUUID();
|
|
2161
|
-
if (
|
|
2176
|
+
if (J(e.src), En({
|
|
2162
2177
|
src: e.src,
|
|
2163
2178
|
domains: t,
|
|
2164
2179
|
lockdown: n
|
|
2165
|
-
}), await
|
|
2166
|
-
e.dispatchEvent(new CustomEvent(
|
|
2167
|
-
let { executeLocator: o, highlightLocator: s, ensureLocatorPermission: c, requestCategories: l, evaluateFrame: u, goto: d } = await
|
|
2180
|
+
}), await O(), n && Rr(), !e.isConnected) throw Error("attachFrame: the iframe must be connected to the document before attaching");
|
|
2181
|
+
e.dispatchEvent(new CustomEvent(Nr, { detail: a }));
|
|
2182
|
+
let { executeLocator: o, highlightLocator: s, ensureLocatorPermission: c, requestCategories: l, evaluateFrame: u, goto: d } = await k.attachFrame({
|
|
2168
2183
|
marker: a,
|
|
2169
2184
|
domains: t,
|
|
2170
2185
|
syncCookies: !0,
|
|
2171
2186
|
lockdown: n
|
|
2172
|
-
}), f = new Set(p([...t,
|
|
2187
|
+
}), f = new Set(p([...t, zr(e.src)], { ipv6: !0 })), m = (e) => f.has(p([Mr(e)], { ipv6: !0 })[0] ?? ""), h = Gn({
|
|
2173
2188
|
backend: "extension",
|
|
2174
2189
|
executor: {
|
|
2175
2190
|
execute: o,
|
|
2176
2191
|
highlight: s
|
|
2177
2192
|
},
|
|
2178
2193
|
gate: (e) => c(e.parts, e.operation, e.args),
|
|
2179
|
-
requestPermissions: async (e) => (
|
|
2194
|
+
requestPermissions: async (e) => (rr("frame.requestPermissions", e), await _n(), l(e)),
|
|
2180
2195
|
evaluate: async (e, t) => {
|
|
2181
2196
|
if (!Me(E(), "evaluate")) {
|
|
2182
2197
|
let e = E();
|
|
@@ -2186,25 +2201,25 @@ var lr = 3e4, ur = `frame.evaluate: the code did not settle within ${lr}ms`, dr
|
|
|
2186
2201
|
source: e,
|
|
2187
2202
|
arg: t
|
|
2188
2203
|
}).catch((e) => {
|
|
2189
|
-
throw
|
|
2204
|
+
throw hr(e);
|
|
2190
2205
|
});
|
|
2191
2206
|
},
|
|
2192
2207
|
addScriptTag: async () => {
|
|
2193
|
-
throw new T("addScriptTag", $(),
|
|
2208
|
+
throw new T("addScriptTag", $(), Vr);
|
|
2194
2209
|
},
|
|
2195
2210
|
clearCookies: async () => {
|
|
2196
|
-
throw new T("clearCookies", $(),
|
|
2211
|
+
throw new T("clearCookies", $(), Hr);
|
|
2197
2212
|
},
|
|
2198
2213
|
postMessage: (t, n, r) => {
|
|
2199
|
-
if (n === "*") throw
|
|
2200
|
-
if (!m(n)) throw
|
|
2214
|
+
if (n === "*") throw L(Lr, "postMessage", "extension");
|
|
2215
|
+
if (!m(n)) throw xt(Ir, "postMessage");
|
|
2201
2216
|
let i = e.contentWindow;
|
|
2202
|
-
if (i === null) throw
|
|
2217
|
+
if (i === null) throw xt("frame: navigate the frame before postMessage", "postMessage");
|
|
2203
2218
|
return i.postMessage(t, n, r), Promise.resolve();
|
|
2204
2219
|
},
|
|
2205
2220
|
listen: (t) => {
|
|
2206
2221
|
let n = (n) => {
|
|
2207
|
-
n.source !== null && n.source === e.contentWindow && !
|
|
2222
|
+
n.source !== null && n.source === e.contentWindow && !sr(n.data) && m(n.origin) && t({
|
|
2208
2223
|
type: "message",
|
|
2209
2224
|
data: n.data,
|
|
2210
2225
|
origin: n.origin,
|
|
@@ -2219,26 +2234,26 @@ var lr = 3e4, ur = `frame.evaluate: the code did not settle within ${lr}ms`, dr
|
|
|
2219
2234
|
};
|
|
2220
2235
|
},
|
|
2221
2236
|
goto: (e, { waitUntil: t, timeout: n, ...r } = {}) => {
|
|
2222
|
-
for (let t of p([
|
|
2237
|
+
for (let t of p([zr(e)], { ipv6: !0 })) f.add(t);
|
|
2223
2238
|
return d({
|
|
2224
2239
|
url: e,
|
|
2225
2240
|
...r,
|
|
2226
2241
|
...t === void 0 ? {} : { waitUntil: t === "commit" ? "documentstart" : t },
|
|
2227
2242
|
...n === void 0 ? {} : { timeoutMs: n }
|
|
2228
2243
|
}).catch((e) => {
|
|
2229
|
-
throw
|
|
2244
|
+
throw _r(e);
|
|
2230
2245
|
});
|
|
2231
2246
|
},
|
|
2232
2247
|
url: () => e.src
|
|
2233
2248
|
});
|
|
2234
|
-
return r?.length && (
|
|
2235
|
-
},
|
|
2236
|
-
throw
|
|
2237
|
-
},
|
|
2238
|
-
let { kind: t, cookies: n } =
|
|
2239
|
-
if (n !== "native") throw new T("cookies", $(),
|
|
2240
|
-
return t === "window" ?
|
|
2241
|
-
}),
|
|
2249
|
+
return r?.length && (gn() ? await h.requestPermissions(r) : Fr()), h;
|
|
2250
|
+
}, Wr = "attachFrame: a window on cookies: 'native' is not served yet; a window runs on the cloud render proxy, which has no browser cookies", Gr = (e) => `attachFrame: cookies: '${e}' runs on the cloud render proxy; call cloud.attachFrame or the top-level attachFrame`, Kr = async (e) => {
|
|
2251
|
+
throw br(e.window), new T("attachWindow", $(), Wr);
|
|
2252
|
+
}, qr = (async (e) => {
|
|
2253
|
+
let { kind: t, cookies: n } = jr(e);
|
|
2254
|
+
if (n !== "native") throw new T("cookies", $(), Gr(n));
|
|
2255
|
+
return t === "window" ? Kr(e) : Ur(e);
|
|
2256
|
+
}), Jr = "permissions.request: pass hosts, the sites the grant applies to", Yr = { request: async (e) => {
|
|
2242
2257
|
let t = e.map((e) => {
|
|
2243
2258
|
let { category: t, key: n, scope: r, reason: i, hosts: a } = e;
|
|
2244
2259
|
if (!("hosts" in e) && !("category" in e)) return { legacy: {
|
|
@@ -2247,7 +2262,7 @@ var lr = 3e4, ur = `frame.evaluate: the code did not settle within ${lr}ms`, dr
|
|
|
2247
2262
|
reason: i
|
|
2248
2263
|
} };
|
|
2249
2264
|
let o = p(a ?? [], { ipv6: !0 });
|
|
2250
|
-
if (!o.length) throw TypeError(
|
|
2265
|
+
if (!o.length) throw TypeError(Jr);
|
|
2251
2266
|
return { ask: {
|
|
2252
2267
|
category: t,
|
|
2253
2268
|
key: n,
|
|
@@ -2255,9 +2270,9 @@ var lr = 3e4, ur = `frame.evaluate: the code did not settle within ${lr}ms`, dr
|
|
|
2255
2270
|
hosts: o
|
|
2256
2271
|
} };
|
|
2257
2272
|
}), n = t.flatMap((e) => "ask" in e ? [e.ask] : []);
|
|
2258
|
-
|
|
2259
|
-
let { items: r, answer: i } =
|
|
2273
|
+
rr("permissions.request", n), n.length && await _n();
|
|
2274
|
+
let { items: r, answer: i } = ir(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
2275
|
return t.map((e) => "ask" in e ? c[u++] : l[d++]);
|
|
2261
|
-
} },
|
|
2276
|
+
} }, Xr = "PermissionDeniedError", Zr = (e) => e instanceof Error ? e.name === Xr : ar(e) && e.name === "PermissionDeniedError";
|
|
2262
2277
|
//#endregion
|
|
2263
|
-
export {
|
|
2278
|
+
export { Ue as $, _t as A, st as B, Tn as C, F as D, R as E, Tt as F, nt as G, it as H, gt as I, Je as J, Ye as K, wt as L, z as M, hn as N, Ct as O, L as P, We as Q, vt as R, En as S, en as T, rt as U, ot as V, et as W, Qe as X, $e as Y, Be as Z, Nn as _, qr as a, O as at, On as b, _r as c, w as ct, ar as d, xe as dt, He as et, rr as f, ye as ft, jn as g, S as gt, $n as h, be as ht, Nr as i, Le as it, bt as j, xt as k, fr as l, Ce as lt, er as m, ve as mt, Zr as n, Ie as nt, jr as o, Se as ot, Qn as p, _e as pt, Xe as q, Yr as r, E as rt, br as s, T as st, Xr as t, Fe as tt, mr as u, je as ut, Dn as v, bn as w, J as x, Gn as y, at as z };
|