@fkn/lib 0.9.46 → 0.9.48
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/{account-generation-B-6Pn0b5.cjs → account-generation-9VhfEDoW.cjs} +1 -1
- package/{account-generation-XNWOvLea.js → account-generation-hUekEHGW.js} +1 -1
- package/account.cjs +1 -1
- package/account.js +2 -2
- package/{api-DOXb_WrB.d.ts → api-Cpi-qz1j.d.ts} +108 -24
- package/api-DMnVye0K.cjs +3 -0
- package/{api-DIgTslNb.js → api-ySazPAwN.js} +97 -59
- package/api.cjs +1 -1
- package/api.d.ts +2 -2
- package/api.js +1 -1
- package/busy-BXbVH595.cjs +1 -0
- package/{busy-B189uX--.js → busy-DsMWrSzc.js} +6 -3
- package/cloud/dns.d.ts +1 -1
- package/cloud/fetch.cjs +1 -1
- package/cloud/fetch.d.ts +1 -1
- package/cloud/fetch.js +1 -1
- package/cloud/fs/promises.d.ts +1 -1
- package/cloud/fs.cjs +1 -1
- package/cloud/fs.d.ts +2 -2
- package/cloud/fs.js +2 -2
- package/cloud/net.cjs +1 -1
- package/cloud/net.d.ts +1 -1
- package/cloud/net.js +2 -2
- package/{cloud-v5x4uhDC.js → cloud-B4_qsdaE.js} +14 -18
- package/{cloud-CUzZFzG3.cjs → cloud-BmwojOb5.cjs} +1 -1
- package/{cloud-DSx-jDFk.d.ts → cloud-DK3DtdsU.d.ts} +4 -4
- package/cloud.cjs +1 -1
- package/cloud.d.ts +4 -4
- package/cloud.js +2 -2
- package/{contract-BmLpSueo.d.ts → contract-XlEPwc7b.d.ts} +127 -46
- package/contract.cjs +1 -1
- package/contract.d.ts +4 -4
- package/contract.js +6 -9
- package/dgram.cjs +1 -1
- package/dgram.d.ts +3 -3
- package/dgram.js +19 -19
- package/dns.cjs +1 -1
- package/dns.d.ts +1 -1
- package/dns.js +1 -1
- package/{extension-C2tBRE9i.d.ts → extension-C4Don9vi.d.ts} +6 -6
- package/{extension-BnVG0YL4.js → extension-hOZN6A1U.js} +4 -4
- package/{extension-3bxlAW8M.cjs → extension-uAlpUogG.cjs} +1 -1
- package/extension.cjs +1 -1
- package/extension.d.ts +2 -2
- package/extension.js +2 -2
- package/fs/promises.cjs +1 -1
- package/fs/promises.d.ts +1 -1
- package/fs/promises.js +1 -1
- package/fs-BY0Csn2V.js +515 -0
- package/fs-DnF1cQuE.cjs +1 -0
- package/{fs-KA1Mgisv.d.ts → fs-lKZe5xIo.d.ts} +1 -1
- package/fs.cjs +1 -1
- package/fs.d.ts +2 -2
- package/fs.js +2 -2
- package/http.d.ts +1 -1
- package/{index-DKr9L2RI.d.ts → index-D9x6A-Gx.d.ts} +1 -1
- package/{index-B98wvTaI.d.ts → index-DlBWSKwV.d.ts} +92 -32
- package/index.cjs +1 -1
- package/index.d.ts +12 -9
- package/index.js +60 -60
- package/lib-5z-jA7ND.cjs +53 -0
- package/{lib-BFwrzgpu.js → lib-Dhq4W2V8.js} +662 -491
- package/links.cjs +1 -0
- package/links.d.ts +65 -0
- package/links.js +187 -0
- package/{net-BFjtzAK0.d.ts → net-C2Yz0job.d.ts} +5 -5
- package/net.cjs +1 -1
- package/net.d.ts +1 -1
- package/net.js +11 -12
- package/{node-fs-CK2wWIYS.js → node-fs-DY2fO5zd.js} +1 -1
- package/{node-fs-nfX7wisL.cjs → node-fs-vsWuoMGa.cjs} +1 -1
- package/opfs.cjs +1 -1
- package/opfs.js +1 -1
- package/package.json +6 -1
- package/packages.cjs +1 -1
- package/packages.d.ts +1 -1
- package/packages.js +2 -2
- package/{proxy-Dixbk1WL.js → proxy-BXkxwBxK.js} +2 -2
- package/{proxy-BrsMJmiK.d.ts → proxy-BZ-YFeXe.d.ts} +2 -2
- package/{proxy-CFK-KiwE.cjs → proxy-BfkfFsNI.cjs} +1 -1
- package/rooms.cjs +1 -1
- package/rooms.d.ts +1 -1
- package/rooms.js +13 -21
- package/{storage-BLBsmkmp.d.ts → storage-B_mXNAdB.d.ts} +4 -5
- package/{storage-Dn1gTLSZ.js → storage-C6F9SnDM.js} +2 -2
- package/{storage-D2cUJlVH.cjs → storage-DmRIhg1P.cjs} +1 -1
- package/utils-BpHmMkIR.cjs +1 -0
- package/{utils-C-cAd4r4.js → utils-Cyq8uJiy.js} +7 -9
- package/{wire-BwA4JjZH.d.ts → wire-Fk5pJaoy.d.ts} +8 -1
- package/wire.cjs +1 -1
- package/wire.d.ts +2 -2
- package/wire.js +2 -2
- package/api--LOXTOpv.cjs +0 -3
- package/busy-Dv8wzE5M.cjs +0 -1
- package/fs-CVnmXRf7.js +0 -513
- package/fs-p0bOOj5n.cjs +0 -1
- package/lib-47LPHYgB.cjs +0 -53
- package/utils-BvgGdrgN.cjs +0 -1
|
@@ -7,20 +7,23 @@ var ne = (e, t) => {
|
|
|
7
7
|
return Object.defineProperty(n, "addEventListener", {
|
|
8
8
|
configurable: !0,
|
|
9
9
|
value: (a, o, s) => {
|
|
10
|
-
if (o
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
10
|
+
if (o === null) return;
|
|
11
|
+
let c = r.get(a);
|
|
12
|
+
if (c === void 0) {
|
|
13
|
+
let i = (r) => {
|
|
14
|
+
n.dispatchEvent(new CustomEvent(a, {
|
|
15
|
+
detail: t(r, e),
|
|
16
|
+
bubbles: r.bubbles,
|
|
17
|
+
cancelable: r.cancelable,
|
|
18
|
+
composed: r.composed
|
|
19
|
+
}));
|
|
20
|
+
};
|
|
21
|
+
e.addEventListener(a, i), c = {
|
|
22
|
+
forward: i,
|
|
23
|
+
listeners: /* @__PURE__ */ new Set()
|
|
24
|
+
}, r.set(a, c);
|
|
23
25
|
}
|
|
26
|
+
c.listeners.add(o), i(a, o, s);
|
|
24
27
|
}
|
|
25
28
|
}), Object.defineProperty(n, "removeEventListener", {
|
|
26
29
|
configurable: !0,
|
|
@@ -28,15 +31,15 @@ var ne = (e, t) => {
|
|
|
28
31
|
if (n === null) return;
|
|
29
32
|
a(t, n, i);
|
|
30
33
|
let o = r.get(t);
|
|
31
|
-
o && (e.removeEventListener(t, o), r.delete(t));
|
|
34
|
+
o !== void 0 && (o.listeners.delete(n), !(o.listeners.size > 0) && (e.removeEventListener(t, o.forward), r.delete(t)));
|
|
32
35
|
}
|
|
33
36
|
}), n;
|
|
34
|
-
},
|
|
37
|
+
}, re = (e) => typeof e == "boolean" ? +!!e : +!!e?.capture, b = (e) => {
|
|
35
38
|
let t = /* @__PURE__ */ new WeakMap();
|
|
36
39
|
return {
|
|
37
40
|
addEventListener: (n, r, i) => {
|
|
38
41
|
if (r === null) return;
|
|
39
|
-
let a = `${n}|${
|
|
42
|
+
let a = `${n}|${re(i)}`, o = t.get(r);
|
|
40
43
|
if (o || (o = /* @__PURE__ */ new Map(), t.set(r, o)), o.has(a)) return;
|
|
41
44
|
let s = typeof i == "object" && !!i && !!i.once, c = (t) => {
|
|
42
45
|
s && o.delete(a);
|
|
@@ -47,18 +50,18 @@ var ne = (e, t) => {
|
|
|
47
50
|
},
|
|
48
51
|
removeEventListener: (n, r, i) => {
|
|
49
52
|
if (r === null) return;
|
|
50
|
-
let a = `${n}|${
|
|
53
|
+
let a = `${n}|${re(i)}`, o = t.get(r), s = o?.get(a);
|
|
51
54
|
s && (e.remoteEvents.removeEventListener(n, s, i), o.delete(a));
|
|
52
55
|
},
|
|
53
56
|
dispatchEvent: (t) => e.remoteEvents.dispatchEvent(t)
|
|
54
57
|
};
|
|
55
|
-
},
|
|
58
|
+
}, x = /* @__PURE__ */ e({
|
|
56
59
|
box: () => ye,
|
|
57
60
|
createVideoElementHandle: () => _e,
|
|
58
61
|
isType: () => ve,
|
|
59
62
|
revive: () => be,
|
|
60
|
-
type: () =>
|
|
61
|
-
}),
|
|
63
|
+
type: () => S
|
|
64
|
+
}), S = "videoElement", ie = [
|
|
62
65
|
"currentTime",
|
|
63
66
|
"volume",
|
|
64
67
|
"muted",
|
|
@@ -69,17 +72,17 @@ var ne = (e, t) => {
|
|
|
69
72
|
"preload",
|
|
70
73
|
"poster",
|
|
71
74
|
"disableRemotePlayback"
|
|
72
|
-
],
|
|
75
|
+
], ae = [
|
|
73
76
|
"duration",
|
|
74
77
|
"paused",
|
|
75
78
|
"ended",
|
|
76
79
|
"seeking",
|
|
77
80
|
"readyState",
|
|
78
81
|
"currentSrc"
|
|
79
|
-
],
|
|
82
|
+
], 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
83
|
let t = {};
|
|
81
|
-
for (let n of [...
|
|
82
|
-
for (let n of
|
|
84
|
+
for (let n of [...ie, ...ae]) t[n] = e[n];
|
|
85
|
+
for (let n of oe) t[n] = ue(e[n]);
|
|
83
86
|
return t.error = e.error ? {
|
|
84
87
|
code: e.error.code,
|
|
85
88
|
message: e.error.message
|
|
@@ -108,7 +111,7 @@ var ne = (e, t) => {
|
|
|
108
111
|
MEDIA_ERR_SRC_NOT_SUPPORTED: 4
|
|
109
112
|
} : null, pe = (e) => ne(e, (e, t) => ({
|
|
110
113
|
originalDetail: e instanceof CustomEvent ? e.detail : null,
|
|
111
|
-
snapshot:
|
|
114
|
+
snapshot: C(t)
|
|
112
115
|
})), me = async (e, t) => {
|
|
113
116
|
switch (t) {
|
|
114
117
|
case "play": return await e.play(), null;
|
|
@@ -130,13 +133,13 @@ var ne = (e, t) => {
|
|
|
130
133
|
try {
|
|
131
134
|
e[t] = n;
|
|
132
135
|
} catch {}
|
|
133
|
-
return
|
|
136
|
+
return C(e);
|
|
134
137
|
},
|
|
135
138
|
events: pe(e)
|
|
136
139
|
}), ge = (e, t) => {
|
|
137
140
|
let n = new EventTarget();
|
|
138
|
-
Object.defineProperty(n,
|
|
139
|
-
let r =
|
|
141
|
+
Object.defineProperty(n, se, { value: !0 }), Object.defineProperty(n, ce, { value: e }), Object.defineProperty(n, le, { value: t });
|
|
142
|
+
let r = b({
|
|
140
143
|
target: n,
|
|
141
144
|
remoteEvents: t.events,
|
|
142
145
|
unenrich: (t, n) => {
|
|
@@ -207,7 +210,7 @@ var ne = (e, t) => {
|
|
|
207
210
|
value: 4
|
|
208
211
|
}
|
|
209
212
|
};
|
|
210
|
-
for (let n of
|
|
213
|
+
for (let n of ie) i[n] = {
|
|
211
214
|
configurable: !0,
|
|
212
215
|
enumerable: !0,
|
|
213
216
|
get() {
|
|
@@ -219,14 +222,14 @@ var ne = (e, t) => {
|
|
|
219
222
|
}, () => {});
|
|
220
223
|
}
|
|
221
224
|
};
|
|
222
|
-
for (let t of
|
|
225
|
+
for (let t of ae) i[t] = {
|
|
223
226
|
configurable: !0,
|
|
224
227
|
enumerable: !0,
|
|
225
228
|
get() {
|
|
226
229
|
return e[t];
|
|
227
230
|
}
|
|
228
231
|
};
|
|
229
|
-
for (let t of
|
|
232
|
+
for (let t of oe) i[t] = {
|
|
230
233
|
configurable: !0,
|
|
231
234
|
enumerable: !0,
|
|
232
235
|
get() {
|
|
@@ -234,28 +237,82 @@ var ne = (e, t) => {
|
|
|
234
237
|
}
|
|
235
238
|
};
|
|
236
239
|
return Object.defineProperties(n, i), n;
|
|
237
|
-
}, _e = (e) => ge(
|
|
240
|
+
}, _e = (e) => ge(C(e), he(e)), ve = (e) => typeof e == "object" && !!e && e[se] === !0, ye = (e, t) => {
|
|
238
241
|
let n = e;
|
|
239
242
|
return {
|
|
240
243
|
..._,
|
|
241
|
-
type:
|
|
242
|
-
initialState: n[
|
|
243
|
-
controller: ee(n[
|
|
244
|
+
type: S,
|
|
245
|
+
initialState: n[ce],
|
|
246
|
+
controller: ee(n[le], t)
|
|
244
247
|
};
|
|
245
248
|
}, be = (e, t) => {
|
|
246
249
|
let n = te(e.controller, t);
|
|
247
250
|
return ge({ ...e.initialState }, n);
|
|
248
|
-
}, xe = (e) =>
|
|
251
|
+
}, xe = (e) => {
|
|
252
|
+
let t = [];
|
|
253
|
+
return e.forEach((e, n) => {
|
|
254
|
+
t.push([n, e]);
|
|
255
|
+
}), t;
|
|
256
|
+
}, Se = "headers", Ce = {
|
|
257
|
+
type: Se,
|
|
258
|
+
isType: (e) => e instanceof Headers,
|
|
259
|
+
box: (e) => ({
|
|
260
|
+
..._,
|
|
261
|
+
type: Se,
|
|
262
|
+
entries: xe(e)
|
|
263
|
+
}),
|
|
264
|
+
revive: (e) => new Headers(e.entries)
|
|
265
|
+
}, we = "response", Te = /* @__PURE__ */ new Set([
|
|
266
|
+
101,
|
|
267
|
+
204,
|
|
268
|
+
205,
|
|
269
|
+
304
|
|
270
|
+
]), Ee = {
|
|
271
|
+
type: we,
|
|
272
|
+
isType: (e) => e instanceof Response,
|
|
273
|
+
box: (e, t) => ({
|
|
274
|
+
..._,
|
|
275
|
+
type: we,
|
|
276
|
+
status: e.status,
|
|
277
|
+
statusText: e.statusText,
|
|
278
|
+
headers: Ce.box(e.headers),
|
|
279
|
+
body: e.body ? ee(e.body, t) : null,
|
|
280
|
+
url: e.url,
|
|
281
|
+
redirected: e.redirected
|
|
282
|
+
}),
|
|
283
|
+
revive: (e, t) => {
|
|
284
|
+
if (e.status === 0) return Response.error();
|
|
285
|
+
let n = Ce.revive(e.headers), r = e.body ? te(e.body, t) : null, i = Te.has(e.status);
|
|
286
|
+
r && i && r.cancel().catch(() => {});
|
|
287
|
+
let a = new Response(i ? null : r, {
|
|
288
|
+
status: e.status,
|
|
289
|
+
statusText: e.statusText,
|
|
290
|
+
headers: n
|
|
291
|
+
});
|
|
292
|
+
return e.url && Object.defineProperty(a, "url", {
|
|
293
|
+
value: e.url,
|
|
294
|
+
configurable: !0
|
|
295
|
+
}), e.redirected && Object.defineProperty(a, "redirected", {
|
|
296
|
+
value: !0,
|
|
297
|
+
configurable: !0
|
|
298
|
+
}), a;
|
|
299
|
+
}
|
|
300
|
+
}, De = (e) => [
|
|
301
|
+
x,
|
|
302
|
+
Ce,
|
|
303
|
+
Ee,
|
|
304
|
+
...e
|
|
305
|
+
], Oe = 5, ke = 0, Ae = "fknExtension", je = "fknExtensionAbi", Me = "fknExtensionOps", Ne = [
|
|
249
306
|
"data-fkn-extension",
|
|
250
307
|
"data-fkn-extension-abi",
|
|
251
308
|
"data-fkn-extension-ops"
|
|
252
|
-
],
|
|
309
|
+
], Pe = (e) => {
|
|
253
310
|
if (e === void 0) return 0;
|
|
254
311
|
let t = Number(e);
|
|
255
312
|
return Number.isInteger(t) && t >= 0 ? t : 0;
|
|
256
|
-
},
|
|
313
|
+
}, Fe = (e) => e === void 0 ? null : e.split(",").map((e) => e.trim()).filter(Boolean), Ie = (e, t = 0) => {
|
|
257
314
|
if (e.fknExtension !== "true") return { status: "absent" };
|
|
258
|
-
let n =
|
|
315
|
+
let n = Pe(e[je]), r = Fe(e[Me]);
|
|
259
316
|
return n < t ? {
|
|
260
317
|
status: "outdated",
|
|
261
318
|
abi: n,
|
|
@@ -266,7 +323,7 @@ var ne = (e, t) => {
|
|
|
266
323
|
abi: n,
|
|
267
324
|
operations: r
|
|
268
325
|
};
|
|
269
|
-
},
|
|
326
|
+
}, Le = (e, t) => e.status === "ok" ? e.operations === null || e.operations.includes(t) : !1, Re = (e, t) => e.status === "ok" && e.operations !== null && e.operations.includes(t), w = class extends Error {
|
|
270
327
|
abi;
|
|
271
328
|
required;
|
|
272
329
|
name = "ExtensionOutdatedError";
|
|
@@ -280,13 +337,13 @@ var ne = (e, t) => {
|
|
|
280
337
|
constructor(e, t, n) {
|
|
281
338
|
super(n ?? `The FKN WebExtension does not support "${e}" (ABI ${t}). Updating the extension may add it.`), this.operation = e, this.abi = t;
|
|
282
339
|
}
|
|
283
|
-
},
|
|
284
|
-
typeof document < "u" && document.addEventListener(
|
|
285
|
-
|
|
340
|
+
}, ze = "FKN_WEB_EXTENSION_MAIN_WORLD_CONTENT_SCRIPT_ENABLED_EVENT_KEY", Be = v();
|
|
341
|
+
typeof document < "u" && document.addEventListener(ze, () => {
|
|
342
|
+
Be.dispatchEvent(new CustomEvent("statuschange", { detail: { enabled: Ve() } }));
|
|
286
343
|
});
|
|
287
|
-
var
|
|
288
|
-
|
|
289
|
-
},
|
|
344
|
+
var Ve = () => typeof document > "u" ? !1 : document.documentElement.dataset[Ae] === "true", E = () => typeof document > "u" ? { status: "absent" } : Ie(document.documentElement.dataset), He = null, Ue = (e) => {
|
|
345
|
+
He = e;
|
|
346
|
+
}, We = 150, D = (e = 1e3) => new Promise((t, n) => {
|
|
290
347
|
let r = () => E().status === "ok";
|
|
291
348
|
if (r()) return t();
|
|
292
349
|
let i, a = (e) => {
|
|
@@ -294,14 +351,14 @@ var Ie = () => typeof document > "u" ? !1 : document.documentElement.dataset[Pe]
|
|
|
294
351
|
}, o = () => a(async () => {
|
|
295
352
|
let e = E();
|
|
296
353
|
if (e.status === "outdated") return n(new w(e.abi, e.required));
|
|
297
|
-
if (
|
|
298
|
-
if (await
|
|
354
|
+
if (He) {
|
|
355
|
+
if (await He().catch(() => {}), r()) return t();
|
|
299
356
|
let e = E();
|
|
300
357
|
if (e.status === "outdated") return n(new w(e.abi, e.required));
|
|
301
358
|
}
|
|
302
359
|
n(/* @__PURE__ */ Error("The FKN WebExtension is not installed, enabled or not exposed on this page."));
|
|
303
360
|
}), s = () => {
|
|
304
|
-
clearTimeout(i), i = setTimeout(() => r() ? a(t) : o(),
|
|
361
|
+
clearTimeout(i), i = setTimeout(() => r() ? a(t) : o(), We);
|
|
305
362
|
}, c = new MutationObserver(() => {
|
|
306
363
|
r() && a(t);
|
|
307
364
|
}), l = () => {
|
|
@@ -309,39 +366,84 @@ var Ie = () => typeof document > "u" ? !1 : document.documentElement.dataset[Pe]
|
|
|
309
366
|
};
|
|
310
367
|
if (i = setTimeout(o, e), c.observe(document.documentElement, {
|
|
311
368
|
attributes: !0,
|
|
312
|
-
attributeFilter: [...
|
|
369
|
+
attributeFilter: [...Ne]
|
|
313
370
|
}), document.addEventListener("readystatechange", l), document.readyState === "complete") return s();
|
|
314
371
|
r() && a(t);
|
|
315
|
-
}),
|
|
316
|
-
await
|
|
372
|
+
}), Ge, O = new Proxy({}, { get: (e, t) => async (...e) => {
|
|
373
|
+
await D(), Ge ??= y({}, {
|
|
317
374
|
transport: window,
|
|
318
|
-
revivableModules:
|
|
375
|
+
revivableModules: De
|
|
319
376
|
});
|
|
320
|
-
let n = (await
|
|
377
|
+
let n = (await Ge)[t];
|
|
321
378
|
return n(...e);
|
|
322
|
-
} }),
|
|
379
|
+
} }), k = [
|
|
323
380
|
"origin",
|
|
324
381
|
"referer",
|
|
325
382
|
"cookie"
|
|
326
|
-
],
|
|
327
|
-
if (t === "include" &&
|
|
328
|
-
},
|
|
329
|
-
|
|
383
|
+
], Ke = (e, t) => (e ?? []).some(([e, n]) => e.trim().toLowerCase() === t && n !== ""), qe = (e) => Ke(e, "cookie"), Je = (e, t) => {
|
|
384
|
+
if (t === "include" && qe(e)) throw Error("fetch: a forged Cookie header and credentials:'include' are different identities - send one or the other");
|
|
385
|
+
}, Ye = (e, t) => {
|
|
386
|
+
if (!Array.isArray(t)) throw Error(`${e}: requestHeaders must be an array of header operations`);
|
|
387
|
+
let n = [...new Set(t.map((e) => {
|
|
388
|
+
let t = e?.header;
|
|
389
|
+
return typeof t == "string" ? t.trim().toLowerCase() : String(t);
|
|
390
|
+
}).filter((e) => !k.includes(e)))];
|
|
391
|
+
if (n.length) throw Error(`${e}: refusing to rewrite request header(s): ${n.join(", ")}`);
|
|
392
|
+
}, Xe = (e) => {
|
|
393
|
+
let t = [...new Set((e ?? []).map(([e]) => e.trim().toLowerCase()).filter((e) => !k.includes(e)))];
|
|
330
394
|
if (t.length) throw Error(`fetch: refusing to forge request header(s): ${t.join(", ")}`);
|
|
331
|
-
},
|
|
395
|
+
}, Ze = [
|
|
332
396
|
"fkn.app",
|
|
333
397
|
"fkn.dev",
|
|
334
|
-
"sdbx.app"
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
398
|
+
"sdbx.app",
|
|
399
|
+
"fkn.cloudflareaccess.com",
|
|
400
|
+
"horionsoftware.com",
|
|
401
|
+
"62e9d4fbf21d90ebd4342e54b4babbd3.r2.cloudflarestorage.com",
|
|
402
|
+
"web-b3z.pages.dev",
|
|
403
|
+
"fkn-console.pages.dev",
|
|
404
|
+
"dev-dms.pages.dev",
|
|
405
|
+
"fkn-www.pages.dev",
|
|
406
|
+
"fkn-homepage.pages.dev",
|
|
407
|
+
"fkn-sandbox.pages.dev",
|
|
408
|
+
"internal-3ar.pages.dev",
|
|
409
|
+
"stub-ben.pages.dev",
|
|
410
|
+
"ripple-3t3.pages.dev",
|
|
411
|
+
"media-player-e3s.pages.dev",
|
|
412
|
+
"youtube-3c4.pages.dev",
|
|
413
|
+
"horionsoftware.pages.dev",
|
|
414
|
+
"container-ckf.pages.dev",
|
|
415
|
+
"stub-plugin.pages.dev",
|
|
416
|
+
"stub.plugins.banou.dev"
|
|
417
|
+
], Qe = (e) => e.replace(/\.+$/, ""), $e = ["79.127.204.69", "152.233.49.59"], et = (e) => {
|
|
418
|
+
let t;
|
|
419
|
+
try {
|
|
420
|
+
t = new URL(`http://${e.includes(":") && !e.startsWith("[") ? `[${e}]` : e}/`).hostname;
|
|
421
|
+
} catch {
|
|
422
|
+
return;
|
|
423
|
+
}
|
|
424
|
+
let n = /^\[(?:::ffff:|64:ff9b::)([0-9a-f]{1,4}):([0-9a-f]{1,4})\]$/.exec(t);
|
|
425
|
+
if (n) {
|
|
426
|
+
let e = parseInt(n[1], 16), t = parseInt(n[2], 16);
|
|
427
|
+
return [
|
|
428
|
+
e >> 8,
|
|
429
|
+
e & 255,
|
|
430
|
+
t >> 8,
|
|
431
|
+
t & 255
|
|
432
|
+
].join(".");
|
|
433
|
+
}
|
|
434
|
+
return /^\d+\.\d+\.\d+\.\d+$/.test(t) ? t : void 0;
|
|
435
|
+
}, A = (e) => {
|
|
436
|
+
let t = Qe(e);
|
|
437
|
+
if (Ze.some((e) => t === e || t.endsWith(`.${e}`))) return !0;
|
|
438
|
+
let n = et(t);
|
|
439
|
+
return n !== void 0 && $e.includes(n);
|
|
440
|
+
}, tt = {
|
|
339
441
|
scope: "network.fetch",
|
|
340
442
|
category: "network",
|
|
341
443
|
severity: 0,
|
|
342
444
|
title: "Fetch data from other sites",
|
|
343
445
|
description: "Lets the app download public data from other websites directly, past the usual cross-origin limits."
|
|
344
|
-
},
|
|
446
|
+
}, nt = {
|
|
345
447
|
scope: "network.fetchCredentialed",
|
|
346
448
|
category: "network",
|
|
347
449
|
severity: 3,
|
|
@@ -349,7 +451,7 @@ var Ie = () => typeof document > "u" ? !1 : document.documentElement.dataset[Pe]
|
|
|
349
451
|
unsafe: !0,
|
|
350
452
|
title: "Fetch from other sites, signed in as you",
|
|
351
453
|
description: "Lets the app fetch other sites using your logged-in session cookies, so it can read data only you should see."
|
|
352
|
-
},
|
|
454
|
+
}, rt = {
|
|
353
455
|
scope: "network.fetchLocal",
|
|
354
456
|
category: "network",
|
|
355
457
|
severity: 3,
|
|
@@ -357,12 +459,12 @@ var Ie = () => typeof document > "u" ? !1 : document.documentElement.dataset[Pe]
|
|
|
357
459
|
unsafe: !0,
|
|
358
460
|
title: "Access devices on your local network",
|
|
359
461
|
description: "Lets the app reach devices and services on your home or work network, which websites normally cannot touch."
|
|
360
|
-
},
|
|
462
|
+
}, it = (e) => {
|
|
361
463
|
let t = e.match(/^(\d+)\.(\d+)\.\d+\.\d+$/);
|
|
362
464
|
if (!t) return !1;
|
|
363
465
|
let [n, r] = [Number(t[1]), Number(t[2])];
|
|
364
466
|
return n === 10 || n === 127 || n === 0 || n === 169 && r === 254 || n === 172 && r >= 16 && r <= 31 || n === 192 && r === 168;
|
|
365
|
-
},
|
|
467
|
+
}, at = (e) => {
|
|
366
468
|
let t;
|
|
367
469
|
try {
|
|
368
470
|
t = new URL(e);
|
|
@@ -370,8 +472,8 @@ var Ie = () => typeof document > "u" ? !1 : document.documentElement.dataset[Pe]
|
|
|
370
472
|
return !1;
|
|
371
473
|
}
|
|
372
474
|
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
|
-
},
|
|
475
|
+
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:") : it(n);
|
|
476
|
+
}, ot = (e) => {
|
|
375
477
|
let t;
|
|
376
478
|
try {
|
|
377
479
|
t = new URL(e);
|
|
@@ -379,48 +481,48 @@ var Ie = () => typeof document > "u" ? !1 : document.documentElement.dataset[Pe]
|
|
|
379
481
|
return !1;
|
|
380
482
|
}
|
|
381
483
|
return t.protocol === "chrome-extension:" || t.protocol === "moz-extension:" || A(t.hostname);
|
|
382
|
-
},
|
|
383
|
-
if (
|
|
384
|
-
},
|
|
484
|
+
}, st = (e) => {
|
|
485
|
+
if (ot(e)) throw Error("fetch: refusing to target the extension's own pages or FKN platform domains");
|
|
486
|
+
}, ct = (e) => {
|
|
385
487
|
if (!e?.headers) return;
|
|
386
|
-
let t = new Headers(e.headers), n =
|
|
488
|
+
let t = new Headers(e.headers), n = k.map((e) => {
|
|
387
489
|
let n = t.get(e);
|
|
388
490
|
return n === null || n === "" ? void 0 : [e, n];
|
|
389
491
|
}).filter((e) => e !== void 0);
|
|
390
492
|
return n.length ? n : void 0;
|
|
391
|
-
},
|
|
493
|
+
}, lt = async (e, t) => {
|
|
392
494
|
let n = new Request(e, t);
|
|
393
|
-
|
|
495
|
+
st(n.url);
|
|
394
496
|
let r = n.body ? await n.arrayBuffer() : null;
|
|
395
|
-
return
|
|
497
|
+
return O.proxyFetch({
|
|
396
498
|
url: n.url,
|
|
397
499
|
method: n.method,
|
|
398
500
|
headers: [...n.headers],
|
|
399
501
|
body: r,
|
|
400
502
|
credentials: t?.credentials === "include" ? "include" : "omit",
|
|
401
503
|
redirect: n.redirect,
|
|
402
|
-
unsafeHeaders:
|
|
504
|
+
unsafeHeaders: ct(t),
|
|
403
505
|
reason: t?.reason,
|
|
404
506
|
signal: t?.signal ?? void 0
|
|
405
507
|
});
|
|
406
|
-
},
|
|
508
|
+
}, ut = (e) => {
|
|
407
509
|
for (let t of e) if (typeof t == "string" && A(t.trim().toLowerCase())) return t;
|
|
408
|
-
},
|
|
510
|
+
}, dt = (e) => {
|
|
409
511
|
let t = e.trim().toLowerCase().replace(/^\.+|\.+$/g, "");
|
|
410
|
-
return t !== "" && (A(t) ||
|
|
411
|
-
},
|
|
412
|
-
for (let t of e) if (typeof t == "string" &&
|
|
413
|
-
},
|
|
414
|
-
if (
|
|
415
|
-
},
|
|
512
|
+
return t !== "" && (A(t) || [...Ze, ...$e].some((e) => e.endsWith(`.${t}`)));
|
|
513
|
+
}, ft = (e) => {
|
|
514
|
+
for (let t of e) if (typeof t == "string" && dt(t)) return t;
|
|
515
|
+
}, pt = (e) => `${e}: refusing to target FKN platform domains`, mt = (e, t) => {
|
|
516
|
+
if (ut(t) !== void 0) throw Error(pt(e));
|
|
517
|
+
}, ht = (e) => {
|
|
416
518
|
try {
|
|
417
519
|
return new URL(String(e)).hostname;
|
|
418
520
|
} catch {
|
|
419
521
|
return "";
|
|
420
522
|
}
|
|
421
|
-
},
|
|
422
|
-
if (
|
|
423
|
-
},
|
|
523
|
+
}, j = (e, t) => {
|
|
524
|
+
if (ft(t) !== void 0) throw Error(pt(e));
|
|
525
|
+
}, gt = {
|
|
424
526
|
scope: "network.readCookie",
|
|
425
527
|
category: "network",
|
|
426
528
|
severity: 3,
|
|
@@ -428,7 +530,7 @@ var Ie = () => typeof document > "u" ? !1 : document.documentElement.dataset[Pe]
|
|
|
428
530
|
unsafe: !0,
|
|
429
531
|
title: "Read a site’s cookie",
|
|
430
532
|
description: "Lets the app read a named cookie from another site, which can include the login token only that site should see."
|
|
431
|
-
},
|
|
533
|
+
}, _t = { get: async (e) => (mt("cookies.get", [ht(e.url)]), O.getCookie(e)) }, vt = {
|
|
432
534
|
scope: "network.modifyRequestHeaders",
|
|
433
535
|
category: "network",
|
|
434
536
|
severity: 2,
|
|
@@ -436,7 +538,7 @@ var Ie = () => typeof document > "u" ? !1 : document.documentElement.dataset[Pe]
|
|
|
436
538
|
unsafe: !0,
|
|
437
539
|
title: "Rewrite request headers to other sites",
|
|
438
540
|
description: "Lets the app set or remove headers (like Origin and Referer) on this page’s own requests to the listed sites."
|
|
439
|
-
},
|
|
541
|
+
}, yt = async (e) => (j("setRequestHeaderRule", e.domains), Ye("setRequestHeaderRule", e.requestHeaders), O.setRequestHeaderRule(e)), bt = (e) => O.removeRequestHeaderRule({ ruleId: e }), xt = class extends Error {
|
|
440
542
|
reason;
|
|
441
543
|
filename;
|
|
442
544
|
line;
|
|
@@ -445,18 +547,18 @@ var Ie = () => typeof document > "u" ? !1 : document.documentElement.dataset[Pe]
|
|
|
445
547
|
constructor(e, t, n, r, i) {
|
|
446
548
|
super(`${e}:${n}:${r}: ${t}`), this.reason = t, this.filename = e, this.line = n, this.column = r, this.source = i;
|
|
447
549
|
}
|
|
448
|
-
},
|
|
550
|
+
}, St = class {
|
|
449
551
|
start;
|
|
450
552
|
end;
|
|
451
553
|
source;
|
|
452
554
|
constructor(e, t, n) {
|
|
453
555
|
this.start = e, this.end = t, this.source = n;
|
|
454
556
|
}
|
|
455
|
-
},
|
|
557
|
+
}, M;
|
|
456
558
|
(function(e) {
|
|
457
559
|
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";
|
|
458
|
-
})(
|
|
459
|
-
var
|
|
560
|
+
})(M ||= {});
|
|
561
|
+
var Ct = (e, t, n) => {
|
|
460
562
|
let r = n, i = 1e4;
|
|
461
563
|
do {
|
|
462
564
|
let n = t.map((t) => e.indexOf(t, r));
|
|
@@ -468,7 +570,7 @@ var gt = (e, t, n) => {
|
|
|
468
570
|
r = o + 2, i--;
|
|
469
571
|
} while (i > 0);
|
|
470
572
|
throw Error("Too many escaping");
|
|
471
|
-
},
|
|
573
|
+
}, N = (e, t, n) => {
|
|
472
574
|
let r = n, i = 1e4;
|
|
473
575
|
do {
|
|
474
576
|
let n = t.map((t) => e.indexOf(t, r));
|
|
@@ -482,21 +584,21 @@ var gt = (e, t, n) => {
|
|
|
482
584
|
break;
|
|
483
585
|
case "(":
|
|
484
586
|
{
|
|
485
|
-
let t =
|
|
587
|
+
let t = N(e, [")"], o + 1);
|
|
486
588
|
if (t === -1) return -1;
|
|
487
589
|
r = t + 1;
|
|
488
590
|
}
|
|
489
591
|
break;
|
|
490
592
|
case "\"":
|
|
491
593
|
{
|
|
492
|
-
let t =
|
|
594
|
+
let t = Ct(e, ["\""], o + 1);
|
|
493
595
|
if (t === -1) return -1;
|
|
494
596
|
r = t + 1;
|
|
495
597
|
}
|
|
496
598
|
break;
|
|
497
599
|
case "'":
|
|
498
600
|
{
|
|
499
|
-
let t =
|
|
601
|
+
let t = Ct(e, ["'"], o + 1);
|
|
500
602
|
if (t === -1) return -1;
|
|
501
603
|
r = t + 1;
|
|
502
604
|
}
|
|
@@ -506,17 +608,17 @@ var gt = (e, t, n) => {
|
|
|
506
608
|
i--;
|
|
507
609
|
} while (i > 0);
|
|
508
610
|
throw Error("Too many escaping");
|
|
509
|
-
},
|
|
611
|
+
}, wt = /\/\*[^]*?(?:\*\/|$)/g;
|
|
510
612
|
function P(e) {
|
|
511
613
|
return e ? e.trim() : "";
|
|
512
614
|
}
|
|
513
|
-
function
|
|
615
|
+
function Tt(e, t) {
|
|
514
616
|
let n = e && typeof e.type == "string", r = n ? e : t;
|
|
515
617
|
for (let t in e) {
|
|
516
618
|
let n = e[t];
|
|
517
619
|
Array.isArray(n) ? n.forEach((e) => {
|
|
518
|
-
|
|
519
|
-
}) : n && typeof n == "object" &&
|
|
620
|
+
Tt(e, r);
|
|
621
|
+
}) : n && typeof n == "object" && Tt(n, r);
|
|
520
622
|
}
|
|
521
623
|
return n && Object.defineProperty(e, "parent", {
|
|
522
624
|
configurable: !0,
|
|
@@ -525,7 +627,7 @@ function F(e, t) {
|
|
|
525
627
|
value: t || null
|
|
526
628
|
}), e;
|
|
527
629
|
}
|
|
528
|
-
var
|
|
630
|
+
var Et = class {
|
|
529
631
|
level = 0;
|
|
530
632
|
indentation = " ";
|
|
531
633
|
compress = !1;
|
|
@@ -540,33 +642,33 @@ var _t = class {
|
|
|
540
642
|
}
|
|
541
643
|
visit(e) {
|
|
542
644
|
switch (e.type) {
|
|
543
|
-
case
|
|
544
|
-
case
|
|
545
|
-
case
|
|
546
|
-
case
|
|
547
|
-
case
|
|
548
|
-
case
|
|
549
|
-
case
|
|
550
|
-
case
|
|
551
|
-
case
|
|
552
|
-
case
|
|
553
|
-
case
|
|
554
|
-
case
|
|
555
|
-
case
|
|
556
|
-
case
|
|
557
|
-
case
|
|
558
|
-
case
|
|
559
|
-
case
|
|
560
|
-
case
|
|
561
|
-
case
|
|
562
|
-
case
|
|
563
|
-
case
|
|
564
|
-
case
|
|
565
|
-
case
|
|
566
|
-
case
|
|
567
|
-
case
|
|
568
|
-
case
|
|
569
|
-
case
|
|
645
|
+
case M.stylesheet: return this.stylesheet(e);
|
|
646
|
+
case M.rule: return this.rule(e);
|
|
647
|
+
case M.declaration: return this.declaration(e);
|
|
648
|
+
case M.comment: return this.comment(e);
|
|
649
|
+
case M.container: return this.container(e);
|
|
650
|
+
case M.charset: return this.charset(e);
|
|
651
|
+
case M.counterStyle: return this.counterStyle(e);
|
|
652
|
+
case M.document: return this.document(e);
|
|
653
|
+
case M.customMedia: return this.customMedia(e);
|
|
654
|
+
case M.fontFace: return this.fontFace(e);
|
|
655
|
+
case M.fontFeatureValues: return this.fontFeatureValues(e);
|
|
656
|
+
case M.host: return this.host(e);
|
|
657
|
+
case M.import: return this.import(e);
|
|
658
|
+
case M.keyframes: return this.keyframes(e);
|
|
659
|
+
case M.keyframe: return this.keyframe(e);
|
|
660
|
+
case M.layer: return this.layer(e);
|
|
661
|
+
case M.media: return this.media(e);
|
|
662
|
+
case M.namespace: return this.namespace(e);
|
|
663
|
+
case M.page: return this.page(e);
|
|
664
|
+
case M.pageMarginBox: return this.pageMarginBox(e);
|
|
665
|
+
case M.positionTry: return this.positionTry(e);
|
|
666
|
+
case M.property: return this.property(e);
|
|
667
|
+
case M.scope: return this.scope(e);
|
|
668
|
+
case M.startingStyle: return this.startingStyle(e);
|
|
669
|
+
case M.supports: return this.supports(e);
|
|
670
|
+
case M.viewTransition: return this.viewTransition(e);
|
|
671
|
+
case M.atRule: return this.genericAtRule(e);
|
|
570
672
|
}
|
|
571
673
|
}
|
|
572
674
|
mapVisit(e, t) {
|
|
@@ -662,7 +764,7 @@ var _t = class {
|
|
|
662
764
|
let t = e.prelude ? ` ${e.prelude}` : "";
|
|
663
765
|
if (this.compress) return this.emit(`@${e.name}${t}`, e.position) + (e.rules ? this.emit("{") + this.mapVisit(e.rules) + this.emit("}") : ";");
|
|
664
766
|
if (!e.rules) return this.emit(`${this.indent()}@${e.name}${t};`, e.position);
|
|
665
|
-
let n = e.rules.some((e) => e.type !==
|
|
767
|
+
let n = e.rules.some((e) => e.type !== M.declaration && e.type !== M.comment), r = n ? "\n\n" : "\n";
|
|
666
768
|
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()}}`);
|
|
667
769
|
}
|
|
668
770
|
rule(e) {
|
|
@@ -675,7 +777,7 @@ var _t = class {
|
|
|
675
777
|
declaration(e) {
|
|
676
778
|
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(";");
|
|
677
779
|
}
|
|
678
|
-
},
|
|
780
|
+
}, Dt = (e, t) => {
|
|
679
781
|
t ||= {};
|
|
680
782
|
let n = 1, r = 1;
|
|
681
783
|
function i() {
|
|
@@ -683,14 +785,14 @@ var _t = class {
|
|
|
683
785
|
line: n,
|
|
684
786
|
column: r
|
|
685
787
|
};
|
|
686
|
-
return (i) => (i.position = new
|
|
788
|
+
return (i) => (i.position = new St(e, {
|
|
687
789
|
line: n,
|
|
688
790
|
column: r
|
|
689
791
|
}, t?.source || ""), u(), i);
|
|
690
792
|
}
|
|
691
793
|
let a = [];
|
|
692
794
|
function o(i) {
|
|
693
|
-
let o = new
|
|
795
|
+
let o = new xt(t?.source || "", i, n, r, e);
|
|
694
796
|
if (!t?.silent) throw o;
|
|
695
797
|
a.push(o);
|
|
696
798
|
}
|
|
@@ -726,23 +828,23 @@ var _t = class {
|
|
|
726
828
|
if (e.charAt(0) !== "/" || e.charAt(1) !== "*") return;
|
|
727
829
|
let n = /^\/\*[^]*?\*\//.exec(e);
|
|
728
830
|
return n ? (l(n), t({
|
|
729
|
-
type:
|
|
831
|
+
type: M.comment,
|
|
730
832
|
comment: n[0].slice(2, -2)
|
|
731
833
|
})) : o("End of comment missing");
|
|
732
834
|
}
|
|
733
835
|
function p() {
|
|
734
|
-
let t =
|
|
836
|
+
let t = N(e, ["{"]);
|
|
735
837
|
if (t === -1 || t === 0) return;
|
|
736
838
|
let n = e.substring(0, t);
|
|
737
839
|
return l([n]), ((e, t) => {
|
|
738
840
|
let n = [], r = 0;
|
|
739
841
|
for (; r < e.length;) {
|
|
740
|
-
let i =
|
|
842
|
+
let i = N(e, t, r);
|
|
741
843
|
if (i === -1) return n.push(e.substring(r)), n;
|
|
742
844
|
n.push(e.substring(r, i)), r = i + 1;
|
|
743
845
|
}
|
|
744
846
|
return n;
|
|
745
|
-
})(P(n).replace(
|
|
847
|
+
})(P(n).replace(wt, ""), [","]).map((e) => P(e));
|
|
746
848
|
}
|
|
747
849
|
function m() {
|
|
748
850
|
let t = i(), n = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/.exec(e);
|
|
@@ -751,11 +853,11 @@ var _t = class {
|
|
|
751
853
|
let r = P(n[0]), a = /^:\s*/.exec(e);
|
|
752
854
|
if (!a) return o("property missing ':'");
|
|
753
855
|
l(a);
|
|
754
|
-
let s = "", c =
|
|
755
|
-
c !== -1 && (s = e.substring(0, c), l([s]), s = P(s).replace(
|
|
856
|
+
let s = "", c = N(e, [";", "}"]);
|
|
857
|
+
c !== -1 && (s = e.substring(0, c), l([s]), s = P(s).replace(wt, ""));
|
|
756
858
|
let u = t({
|
|
757
|
-
type:
|
|
758
|
-
property: r.replace(
|
|
859
|
+
type: M.declaration,
|
|
860
|
+
property: r.replace(wt, ""),
|
|
759
861
|
value: s
|
|
760
862
|
}), d = /^[;\s]*/.exec(e);
|
|
761
863
|
return d && l(d), u;
|
|
@@ -774,9 +876,9 @@ var _t = class {
|
|
|
774
876
|
return c() ? n : o("missing '}'");
|
|
775
877
|
}
|
|
776
878
|
function g() {
|
|
777
|
-
let t =
|
|
879
|
+
let t = N(e, ["{"]);
|
|
778
880
|
if (t === -1) return !1;
|
|
779
|
-
let n =
|
|
881
|
+
let n = N(e, [";"]), r = N(e, ["}"]);
|
|
780
882
|
return !(n !== -1 && n < t) && !(r !== -1 && r < t);
|
|
781
883
|
}
|
|
782
884
|
function _() {
|
|
@@ -784,14 +886,14 @@ var _t = class {
|
|
|
784
886
|
if (!s()) return o("missing '{'");
|
|
785
887
|
for (d(n); e.length && e.charAt(0) !== "}";) {
|
|
786
888
|
if (e.charAt(0) === "@") {
|
|
787
|
-
let e =
|
|
889
|
+
let e = x();
|
|
788
890
|
if (e) {
|
|
789
891
|
n.push(e), d(n);
|
|
790
892
|
continue;
|
|
791
893
|
}
|
|
792
894
|
}
|
|
793
895
|
if (g()) {
|
|
794
|
-
let e =
|
|
896
|
+
let e = S();
|
|
795
897
|
if (e) {
|
|
796
898
|
n.push(e), d(n);
|
|
797
899
|
continue;
|
|
@@ -816,14 +918,14 @@ var _t = class {
|
|
|
816
918
|
let n = [];
|
|
817
919
|
for (u(), d(n); e.length && e.charAt(0) !== "}";) {
|
|
818
920
|
if (e.charAt(0) === "@") {
|
|
819
|
-
let e =
|
|
921
|
+
let e = x();
|
|
820
922
|
if (e) {
|
|
821
923
|
n.push(e), d(n);
|
|
822
924
|
continue;
|
|
823
925
|
}
|
|
824
926
|
}
|
|
825
927
|
if (g()) {
|
|
826
|
-
let e =
|
|
928
|
+
let e = S();
|
|
827
929
|
if (e) {
|
|
828
930
|
n.push(e), d(n);
|
|
829
931
|
continue;
|
|
@@ -853,7 +955,7 @@ var _t = class {
|
|
|
853
955
|
i && l(i), r = /^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/.exec(e);
|
|
854
956
|
}
|
|
855
957
|
if (t.length) return n({
|
|
856
|
-
type:
|
|
958
|
+
type: M.keyframe,
|
|
857
959
|
values: t,
|
|
858
960
|
declarations: h() || []
|
|
859
961
|
});
|
|
@@ -875,8 +977,8 @@ var _t = class {
|
|
|
875
977
|
"right-top",
|
|
876
978
|
"right-middle",
|
|
877
979
|
"right-bottom"
|
|
878
|
-
].join("|")})(?![\\w-])\\s*`), te =
|
|
879
|
-
function
|
|
980
|
+
].join("|")})(?![\\w-])\\s*`), te = b("import"), ne = b("charset"), re = b("namespace");
|
|
981
|
+
function b(t) {
|
|
880
982
|
let n = RegExp("^@" + t + "\\s*((?::?[^;'\"]|\"(?:\\\\\"|[^\"])*?\"|'(?:\\\\'|[^'])*?')+)(?:;|$)");
|
|
881
983
|
return () => {
|
|
882
984
|
let r = i(), a = n.exec(e);
|
|
@@ -885,7 +987,7 @@ var _t = class {
|
|
|
885
987
|
return s[t] = o[1].trim(), r(s);
|
|
886
988
|
};
|
|
887
989
|
}
|
|
888
|
-
function
|
|
990
|
+
function x() {
|
|
889
991
|
if (e[0] === "@") return function() {
|
|
890
992
|
let t = i(), n = /^@([-\w]+)?keyframes\s*/.exec(e);
|
|
891
993
|
if (!n) return;
|
|
@@ -896,7 +998,7 @@ var _t = class {
|
|
|
896
998
|
let f = d(), p = y();
|
|
897
999
|
for (; p;) f.push(p), f = f.concat(d()), p = y();
|
|
898
1000
|
return c() ? t({
|
|
899
|
-
type:
|
|
1001
|
+
type: M.keyframes,
|
|
900
1002
|
name: u,
|
|
901
1003
|
vendor: r,
|
|
902
1004
|
keyframes: f
|
|
@@ -908,7 +1010,7 @@ var _t = class {
|
|
|
908
1010
|
if (!s()) return o("@media missing '{'");
|
|
909
1011
|
let a = v();
|
|
910
1012
|
return c() ? t({
|
|
911
|
-
type:
|
|
1013
|
+
type: M.media,
|
|
912
1014
|
media: r,
|
|
913
1015
|
rules: a
|
|
914
1016
|
}) : o("@media missing '}'");
|
|
@@ -917,7 +1019,7 @@ var _t = class {
|
|
|
917
1019
|
if (!n) return;
|
|
918
1020
|
let r = l(n);
|
|
919
1021
|
return t({
|
|
920
|
-
type:
|
|
1022
|
+
type: M.customMedia,
|
|
921
1023
|
name: P(r[1]),
|
|
922
1024
|
media: P(r[2])
|
|
923
1025
|
});
|
|
@@ -928,18 +1030,18 @@ var _t = class {
|
|
|
928
1030
|
if (!s()) return o("@supports missing '{'");
|
|
929
1031
|
let a = v();
|
|
930
1032
|
return c() ? t({
|
|
931
|
-
type:
|
|
1033
|
+
type: M.supports,
|
|
932
1034
|
supports: r,
|
|
933
1035
|
rules: a
|
|
934
1036
|
}) : o("@supports missing '}'");
|
|
935
|
-
}() || te() || ne() ||
|
|
1037
|
+
}() || te() || ne() || re() || function() {
|
|
936
1038
|
let t = i(), n = /^@([-\w]+)?document *([^{]+)/.exec(e);
|
|
937
1039
|
if (!n) return;
|
|
938
1040
|
let r = l(n), a = P(r[1]), u = P(r[2]);
|
|
939
1041
|
if (!s()) return o("@document missing '{'");
|
|
940
1042
|
let d = v();
|
|
941
1043
|
return c() ? t({
|
|
942
|
-
type:
|
|
1044
|
+
type: M.document,
|
|
943
1045
|
document: u,
|
|
944
1046
|
vendor: a,
|
|
945
1047
|
rules: d
|
|
@@ -953,7 +1055,7 @@ var _t = class {
|
|
|
953
1055
|
let a = [];
|
|
954
1056
|
for (d(a); e.length && e.charAt(0) !== "}";) {
|
|
955
1057
|
if (e.charAt(0) === "@") {
|
|
956
|
-
let e =
|
|
1058
|
+
let e = x();
|
|
957
1059
|
if (e) {
|
|
958
1060
|
a.push(e), d(a);
|
|
959
1061
|
continue;
|
|
@@ -964,7 +1066,7 @@ var _t = class {
|
|
|
964
1066
|
a.push(t), d(a);
|
|
965
1067
|
}
|
|
966
1068
|
return c() ? t({
|
|
967
|
-
type:
|
|
1069
|
+
type: M.page,
|
|
968
1070
|
selectors: r,
|
|
969
1071
|
declarations: a
|
|
970
1072
|
}) : o("@page missing '}'");
|
|
@@ -974,7 +1076,7 @@ var _t = class {
|
|
|
974
1076
|
if (l(n), !s()) return o("@host missing '{'");
|
|
975
1077
|
let r = v();
|
|
976
1078
|
return c() ? t({
|
|
977
|
-
type:
|
|
1079
|
+
type: M.host,
|
|
978
1080
|
rules: r
|
|
979
1081
|
}) : o("@host missing '}'");
|
|
980
1082
|
}() || function() {
|
|
@@ -984,7 +1086,7 @@ var _t = class {
|
|
|
984
1086
|
let r = d(), a = m();
|
|
985
1087
|
for (; a;) r.push(a), r = r.concat(d()), a = m();
|
|
986
1088
|
return c() ? t({
|
|
987
|
-
type:
|
|
1089
|
+
type: M.fontFace,
|
|
988
1090
|
declarations: r
|
|
989
1091
|
}) : o("@font-face missing '}'");
|
|
990
1092
|
}() || function() {
|
|
@@ -994,7 +1096,7 @@ var _t = class {
|
|
|
994
1096
|
if (!s()) return o("@font-feature-values missing '{'");
|
|
995
1097
|
let a = v();
|
|
996
1098
|
return c() ? t({
|
|
997
|
-
type:
|
|
1099
|
+
type: M.fontFeatureValues,
|
|
998
1100
|
fontFamily: r,
|
|
999
1101
|
rules: a
|
|
1000
1102
|
}) : o("@font-feature-values missing '}'");
|
|
@@ -1005,7 +1107,7 @@ var _t = class {
|
|
|
1005
1107
|
if (!s()) return o("@container missing '{'");
|
|
1006
1108
|
let a = v();
|
|
1007
1109
|
return c() ? t({
|
|
1008
|
-
type:
|
|
1110
|
+
type: M.container,
|
|
1009
1111
|
container: r,
|
|
1010
1112
|
rules: a
|
|
1011
1113
|
}) : o("@container missing '}'");
|
|
@@ -1015,7 +1117,7 @@ var _t = class {
|
|
|
1015
1117
|
if (l(n), !s()) return o("@starting-style missing '{'");
|
|
1016
1118
|
let r = v();
|
|
1017
1119
|
return c() ? t({
|
|
1018
|
-
type:
|
|
1120
|
+
type: M.startingStyle,
|
|
1019
1121
|
rules: r
|
|
1020
1122
|
}) : o("@starting-style missing '}'");
|
|
1021
1123
|
}() || function() {
|
|
@@ -1025,13 +1127,13 @@ var _t = class {
|
|
|
1025
1127
|
if (!s()) {
|
|
1026
1128
|
let n = /^[;\s]*/.exec(e);
|
|
1027
1129
|
return n && l(n), t({
|
|
1028
|
-
type:
|
|
1130
|
+
type: M.layer,
|
|
1029
1131
|
layer: r
|
|
1030
1132
|
});
|
|
1031
1133
|
}
|
|
1032
1134
|
let a = v();
|
|
1033
1135
|
return c() ? t({
|
|
1034
|
-
type:
|
|
1136
|
+
type: M.layer,
|
|
1035
1137
|
layer: r,
|
|
1036
1138
|
rules: a
|
|
1037
1139
|
}) : o("@layer missing '}'");
|
|
@@ -1043,7 +1145,7 @@ var _t = class {
|
|
|
1043
1145
|
let a = d(), u = m();
|
|
1044
1146
|
for (; u;) a.push(u), a = a.concat(d()), u = m();
|
|
1045
1147
|
return c() ? t({
|
|
1046
|
-
type:
|
|
1148
|
+
type: M.property,
|
|
1047
1149
|
name: r,
|
|
1048
1150
|
declarations: a
|
|
1049
1151
|
}) : o("@property missing '}'");
|
|
@@ -1055,7 +1157,7 @@ var _t = class {
|
|
|
1055
1157
|
let a = d(), u = m();
|
|
1056
1158
|
for (; u;) a.push(u), a = a.concat(d()), u = m();
|
|
1057
1159
|
return c() ? t({
|
|
1058
|
-
type:
|
|
1160
|
+
type: M.counterStyle,
|
|
1059
1161
|
name: r,
|
|
1060
1162
|
declarations: a
|
|
1061
1163
|
}) : o("@counter-style missing '}'");
|
|
@@ -1066,7 +1168,7 @@ var _t = class {
|
|
|
1066
1168
|
if (!s()) return o("@scope missing '{'");
|
|
1067
1169
|
let a = v();
|
|
1068
1170
|
return c() ? t({
|
|
1069
|
-
type:
|
|
1171
|
+
type: M.scope,
|
|
1070
1172
|
scope: r,
|
|
1071
1173
|
rules: a
|
|
1072
1174
|
}) : o("@scope missing '}'");
|
|
@@ -1077,7 +1179,7 @@ var _t = class {
|
|
|
1077
1179
|
let r = d(), a = m();
|
|
1078
1180
|
for (; a;) r.push(a), r = r.concat(d()), a = m();
|
|
1079
1181
|
return c() ? t({
|
|
1080
|
-
type:
|
|
1182
|
+
type: M.viewTransition,
|
|
1081
1183
|
declarations: r
|
|
1082
1184
|
}) : o("@view-transition missing '}'");
|
|
1083
1185
|
}() || function() {
|
|
@@ -1088,7 +1190,7 @@ var _t = class {
|
|
|
1088
1190
|
let a = d(), u = m();
|
|
1089
1191
|
for (; u;) a.push(u), a = a.concat(d()), u = m();
|
|
1090
1192
|
return c() ? t({
|
|
1091
|
-
type:
|
|
1193
|
+
type: M.positionTry,
|
|
1092
1194
|
name: r,
|
|
1093
1195
|
declarations: a
|
|
1094
1196
|
}) : o("@position-try missing '}'");
|
|
@@ -1100,18 +1202,18 @@ var _t = class {
|
|
|
1100
1202
|
let a = d(), u = m();
|
|
1101
1203
|
for (; u;) a.push(u), a = a.concat(d()), u = m();
|
|
1102
1204
|
return c() ? t({
|
|
1103
|
-
type:
|
|
1205
|
+
type: M.pageMarginBox,
|
|
1104
1206
|
name: r,
|
|
1105
1207
|
declarations: a
|
|
1106
1208
|
}) : o(`@${r} missing '}'`);
|
|
1107
1209
|
}() || function() {
|
|
1108
1210
|
let t = i(), n = /^@([-\w]+)\s*/.exec(e);
|
|
1109
1211
|
if (!n) return;
|
|
1110
|
-
let r = l(n)[1], a = "", u =
|
|
1212
|
+
let r = l(n)[1], a = "", u = N(e, ["{", ";"]);
|
|
1111
1213
|
if (u !== -1 && u > 0 && (a = P(e.substring(0, u)), l([e.substring(0, u)])), s()) {
|
|
1112
1214
|
let e = v();
|
|
1113
1215
|
return c() ? t({
|
|
1114
|
-
type:
|
|
1216
|
+
type: M.atRule,
|
|
1115
1217
|
name: r,
|
|
1116
1218
|
prelude: a,
|
|
1117
1219
|
rules: e
|
|
@@ -1119,21 +1221,21 @@ var _t = class {
|
|
|
1119
1221
|
}
|
|
1120
1222
|
let d = /^[;\s]*/.exec(e);
|
|
1121
1223
|
return d && l(d), t({
|
|
1122
|
-
type:
|
|
1224
|
+
type: M.atRule,
|
|
1123
1225
|
name: r,
|
|
1124
1226
|
prelude: a
|
|
1125
1227
|
});
|
|
1126
1228
|
}();
|
|
1127
1229
|
}
|
|
1128
|
-
function
|
|
1230
|
+
function S() {
|
|
1129
1231
|
let e = i(), t = p();
|
|
1130
1232
|
return t ? (d(), e({
|
|
1131
|
-
type:
|
|
1233
|
+
type: M.rule,
|
|
1132
1234
|
selectors: t,
|
|
1133
1235
|
declarations: _() || []
|
|
1134
1236
|
})) : o("selector missing");
|
|
1135
1237
|
}
|
|
1136
|
-
return
|
|
1238
|
+
return Tt(function() {
|
|
1137
1239
|
let n = function() {
|
|
1138
1240
|
let n, r = [];
|
|
1139
1241
|
for (u(), d(r); e.length;) {
|
|
@@ -1144,7 +1246,7 @@ var _t = class {
|
|
|
1144
1246
|
}
|
|
1145
1247
|
break;
|
|
1146
1248
|
}
|
|
1147
|
-
if (n =
|
|
1249
|
+
if (n = x() || S(), !n) {
|
|
1148
1250
|
if (t?.silent) {
|
|
1149
1251
|
l([e.charAt(0)]), u(), d(r);
|
|
1150
1252
|
continue;
|
|
@@ -1156,7 +1258,7 @@ var _t = class {
|
|
|
1156
1258
|
return r;
|
|
1157
1259
|
}();
|
|
1158
1260
|
return {
|
|
1159
|
-
type:
|
|
1261
|
+
type: M.stylesheet,
|
|
1160
1262
|
stylesheet: {
|
|
1161
1263
|
source: t?.source,
|
|
1162
1264
|
rules: n,
|
|
@@ -1164,66 +1266,66 @@ var _t = class {
|
|
|
1164
1266
|
}
|
|
1165
1267
|
};
|
|
1166
1268
|
}());
|
|
1167
|
-
},
|
|
1269
|
+
}, Ot = (e, t) => new Et(t || {}).compile(e), kt = Object.defineProperty, At = (e, t) => {
|
|
1168
1270
|
let n = {};
|
|
1169
|
-
for (var r in e)
|
|
1271
|
+
for (var r in e) kt(n, r, {
|
|
1170
1272
|
get: e[r],
|
|
1171
1273
|
enumerable: !0
|
|
1172
1274
|
});
|
|
1173
|
-
return t ||
|
|
1174
|
-
},
|
|
1175
|
-
name:
|
|
1275
|
+
return t || kt(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
1276
|
+
}, jt = "LocatorError", Mt = "LocatorUnsupportedError", Nt = "LocatorDeniedError", Pt = "LocatorInvalidError", Ft = (e) => typeof e == "object" && e ? e.name : void 0, F = (e) => Object.assign(Error(e), { name: jt }), I = (e, t = "", n) => Object.assign(Error(e), {
|
|
1277
|
+
name: Mt,
|
|
1176
1278
|
operation: t,
|
|
1177
1279
|
backend: n
|
|
1178
|
-
}),
|
|
1179
|
-
name:
|
|
1280
|
+
}), It = (e, t) => I(`Locator operation not supported${t ? ` on the ${t} backend` : ""}: ${e}`, e, t), L = (e, t) => Object.assign(Error(e), {
|
|
1281
|
+
name: Nt,
|
|
1180
1282
|
operation: t
|
|
1181
|
-
}),
|
|
1182
|
-
name:
|
|
1283
|
+
}), Lt = (e, t) => Object.assign(Error(e), {
|
|
1284
|
+
name: Pt,
|
|
1183
1285
|
operation: t
|
|
1184
|
-
}),
|
|
1286
|
+
}), R = class extends Error {
|
|
1185
1287
|
name = "TimeoutError";
|
|
1186
1288
|
constructor(e, t) {
|
|
1187
1289
|
super(e, t?.cause === void 0 ? void 0 : { cause: t.cause });
|
|
1188
1290
|
}
|
|
1189
|
-
},
|
|
1291
|
+
}, Rt = (e) => Ft(e) === Mt, zt = (e) => Ft(e) === Nt, z = (e) => Ft(e) === Pt, B = (e) => zt(e) || Rt(e) || z(e), V = (e) => {
|
|
1190
1292
|
let t = (e.ownerDocument ?? e).defaultView;
|
|
1191
|
-
if (!t) throw
|
|
1293
|
+
if (!t) throw F("the resolved element belongs to a document with no window");
|
|
1192
1294
|
return t;
|
|
1193
|
-
},
|
|
1295
|
+
}, Bt = (e, t) => {
|
|
1194
1296
|
let n = e?.[t];
|
|
1195
1297
|
return typeof n == "function" ? n : null;
|
|
1196
1298
|
}, H = (e, t) => {
|
|
1197
1299
|
if (typeof e != "object" || !e) return null;
|
|
1198
1300
|
let n = (() => {
|
|
1199
1301
|
try {
|
|
1200
|
-
return
|
|
1302
|
+
return Bt(V(e), t);
|
|
1201
1303
|
} catch {
|
|
1202
1304
|
return null;
|
|
1203
1305
|
}
|
|
1204
1306
|
})();
|
|
1205
1307
|
if (n && e instanceof n) return n;
|
|
1206
|
-
let r =
|
|
1308
|
+
let r = Bt(globalThis, t);
|
|
1207
1309
|
return r && e instanceof r ? r : null;
|
|
1208
1310
|
}, U = (e, t) => H(e, t) !== null, W = (e) => {
|
|
1209
|
-
if (e.length === 0) throw
|
|
1210
|
-
if (e.length > 1) throw
|
|
1311
|
+
if (e.length === 0) throw F("No elements found");
|
|
1312
|
+
if (e.length > 1) throw F(`Strict mode violation: locator resolved to ${e.length} elements`);
|
|
1211
1313
|
return e[0];
|
|
1212
|
-
},
|
|
1213
|
-
if (!U(e, t)) throw
|
|
1314
|
+
}, Vt = (e, t) => {
|
|
1315
|
+
if (!U(e, t)) throw F(`Strict mode violation: expected ${t}, got <${e.tagName.toLowerCase()}>`);
|
|
1214
1316
|
return e;
|
|
1215
|
-
},
|
|
1216
|
-
|
|
1217
|
-
},
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
]),
|
|
1225
|
-
if (
|
|
1226
|
-
if (e.type ===
|
|
1317
|
+
}, Ht = (e) => e.tagName.toLowerCase(), Ut = /* @__PURE__ */ new Set(), Wt = (e) => {
|
|
1318
|
+
Ut.add(e);
|
|
1319
|
+
}, Gt = /(?:^|[^\w-])(?:url|image|image-set|cross-fade|paint|element|expression)\s*\(/i, Kt = (e) => e.replace(/\\([0-9a-fA-F]{1,6})\s?/g, (e, t) => String.fromCodePoint(Number.parseInt(t, 16))).replace(/\\(.)/g, "$1"), qt = (e) => !Gt.test(Kt(e.value)), Jt = /* @__PURE__ */ new Set([
|
|
1320
|
+
M.import,
|
|
1321
|
+
M.fontFace,
|
|
1322
|
+
M.namespace,
|
|
1323
|
+
M.charset,
|
|
1324
|
+
M.document,
|
|
1325
|
+
M.comment
|
|
1326
|
+
]), Yt = (e) => {
|
|
1327
|
+
if (Jt.has(e.type)) return null;
|
|
1328
|
+
if (e.type === M.declaration) return qt(e) ? e : null;
|
|
1227
1329
|
let t = e, n = { ...t };
|
|
1228
1330
|
for (let e of [
|
|
1229
1331
|
"declarations",
|
|
@@ -1231,18 +1333,18 @@ var _t = class {
|
|
|
1231
1333
|
"keyframes"
|
|
1232
1334
|
]) {
|
|
1233
1335
|
let r = t[e];
|
|
1234
|
-
Array.isArray(r) && (n[e] =
|
|
1336
|
+
Array.isArray(r) && (n[e] = Xt(r));
|
|
1235
1337
|
}
|
|
1236
1338
|
return n;
|
|
1237
|
-
},
|
|
1339
|
+
}, Xt = (e) => e.map((e) => Yt(e)).filter((e) => e !== null), Zt = (e) => {
|
|
1238
1340
|
let t;
|
|
1239
1341
|
try {
|
|
1240
|
-
t =
|
|
1342
|
+
t = Dt(e, { silent: !0 });
|
|
1241
1343
|
} catch {
|
|
1242
1344
|
return "";
|
|
1243
1345
|
}
|
|
1244
|
-
return t.stylesheet.rules =
|
|
1245
|
-
},
|
|
1346
|
+
return t.stylesheet.rules = Xt(t.stylesheet.rules), Ot(t);
|
|
1347
|
+
}, Qt = (e, t) => {
|
|
1246
1348
|
let n = () => {
|
|
1247
1349
|
t.parentNode || (e.head ?? e.documentElement).appendChild(t);
|
|
1248
1350
|
};
|
|
@@ -1259,16 +1361,16 @@ var _t = class {
|
|
|
1259
1361
|
});
|
|
1260
1362
|
let i = () => r.disconnect(), a = e.defaultView;
|
|
1261
1363
|
a ? a.addEventListener("load", i, { once: !0 }) : setTimeout(i, 3e4);
|
|
1262
|
-
},
|
|
1364
|
+
}, $t = { resolve: (e, t) => {
|
|
1263
1365
|
let n = e.document.createElement("style");
|
|
1264
|
-
n.textContent = t.noSanitize ? t.content :
|
|
1366
|
+
n.textContent = t.noSanitize ? t.content : Zt(t.content);
|
|
1265
1367
|
try {
|
|
1266
|
-
|
|
1368
|
+
Qt(e.document, n);
|
|
1267
1369
|
} catch (e) {
|
|
1268
1370
|
console.error(e);
|
|
1269
1371
|
}
|
|
1270
|
-
|
|
1271
|
-
} },
|
|
1372
|
+
Wt(n);
|
|
1373
|
+
} }, en = (e) => {
|
|
1272
1374
|
let t = [];
|
|
1273
1375
|
return e.forEach((e, n) => {
|
|
1274
1376
|
t.push([n, e]);
|
|
@@ -1277,12 +1379,12 @@ var _t = class {
|
|
|
1277
1379
|
kind: "frame",
|
|
1278
1380
|
ensureArgs: (e) => [void 0, e],
|
|
1279
1381
|
resolve: async (e, t, n = {}) => {
|
|
1280
|
-
if (typeof t != "string") throw
|
|
1382
|
+
if (typeof t != "string") throw Lt("fetch: url must be a string", "fetch");
|
|
1281
1383
|
let r = V(e.document), i;
|
|
1282
1384
|
try {
|
|
1283
1385
|
i = new r.URL(t, e.document.baseURI).href;
|
|
1284
1386
|
} catch {
|
|
1285
|
-
throw
|
|
1387
|
+
throw Lt(`fetch: not a valid url: ${t}`, "fetch");
|
|
1286
1388
|
}
|
|
1287
1389
|
let a = await r.fetch(i, {
|
|
1288
1390
|
method: n.method ?? "GET",
|
|
@@ -1298,31 +1400,31 @@ var _t = class {
|
|
|
1298
1400
|
url: a.url,
|
|
1299
1401
|
redirected: a.redirected,
|
|
1300
1402
|
type: a.type,
|
|
1301
|
-
headers:
|
|
1403
|
+
headers: en(a.headers),
|
|
1302
1404
|
body: await a.arrayBuffer()
|
|
1303
1405
|
};
|
|
1304
1406
|
}
|
|
1305
|
-
}, K = /* @__PURE__ */
|
|
1306
|
-
click: () =>
|
|
1307
|
-
count: () =>
|
|
1308
|
-
exists: () =>
|
|
1309
|
-
fill: () =>
|
|
1310
|
-
getAttribute: () =>
|
|
1311
|
-
hover: () =>
|
|
1312
|
-
isVisible: () =>
|
|
1313
|
-
textContent: () =>
|
|
1314
|
-
}),
|
|
1407
|
+
}, K = /* @__PURE__ */ At({
|
|
1408
|
+
click: () => nn,
|
|
1409
|
+
count: () => dn,
|
|
1410
|
+
exists: () => fn,
|
|
1411
|
+
fill: () => sn,
|
|
1412
|
+
getAttribute: () => ln,
|
|
1413
|
+
hover: () => rn,
|
|
1414
|
+
isVisible: () => un,
|
|
1415
|
+
textContent: () => cn
|
|
1416
|
+
}), tn = (e, t) => {
|
|
1315
1417
|
let n = e.getBoundingClientRect();
|
|
1316
1418
|
return {
|
|
1317
1419
|
clientX: n.left + n.width * (t?.x ?? .5),
|
|
1318
1420
|
clientY: n.top + n.height * (t?.y ?? .5)
|
|
1319
1421
|
};
|
|
1320
|
-
},
|
|
1422
|
+
}, nn = { resolve: (e, t = {}) => {
|
|
1321
1423
|
let n = W(e.elements), r = V(n), i = {
|
|
1322
1424
|
bubbles: !0,
|
|
1323
1425
|
cancelable: !0,
|
|
1324
1426
|
composed: !0,
|
|
1325
|
-
...
|
|
1427
|
+
...tn(n, t.position),
|
|
1326
1428
|
button: 0
|
|
1327
1429
|
}, a = {
|
|
1328
1430
|
...i,
|
|
@@ -1346,12 +1448,12 @@ var _t = class {
|
|
|
1346
1448
|
...i,
|
|
1347
1449
|
buttons: 0
|
|
1348
1450
|
}));
|
|
1349
|
-
} },
|
|
1451
|
+
} }, rn = { resolve: (e, t = {}) => {
|
|
1350
1452
|
let n = W(e.elements), r = V(n), i = {
|
|
1351
1453
|
bubbles: !0,
|
|
1352
1454
|
cancelable: !0,
|
|
1353
1455
|
composed: !0,
|
|
1354
|
-
...
|
|
1456
|
+
...tn(n, t.position)
|
|
1355
1457
|
}, a = {
|
|
1356
1458
|
...i,
|
|
1357
1459
|
pointerType: "mouse",
|
|
@@ -1365,11 +1467,11 @@ var _t = class {
|
|
|
1365
1467
|
...i,
|
|
1366
1468
|
bubbles: !1
|
|
1367
1469
|
})), n.dispatchEvent(new r.MouseEvent("mouseover", i)), n.dispatchEvent(new r.PointerEvent("pointermove", a)), n.dispatchEvent(new r.MouseEvent("mousemove", i));
|
|
1368
|
-
} },
|
|
1470
|
+
} }, an = (e, t) => {
|
|
1369
1471
|
e._valueTracker?.setValue("");
|
|
1370
1472
|
let n = (H(e, "HTMLTextAreaElement") ?? H(e, "HTMLInputElement"))?.prototype, r = n && Object.getOwnPropertyDescriptor(n, "value")?.set;
|
|
1371
1473
|
r ? r.call(e, t) : e.value = t;
|
|
1372
|
-
},
|
|
1474
|
+
}, on = (e, t) => {
|
|
1373
1475
|
if (e.type !== "range") return null;
|
|
1374
1476
|
let n = Number(e.min || 0), r = Number(e.max || 100);
|
|
1375
1477
|
if (!Number.isFinite(n) || !Number.isFinite(r) || r <= n) return null;
|
|
@@ -1406,26 +1508,26 @@ var _t = class {
|
|
|
1406
1508
|
buttons: 0
|
|
1407
1509
|
}
|
|
1408
1510
|
};
|
|
1409
|
-
},
|
|
1511
|
+
}, sn = { resolve: (e, t, n = {}) => {
|
|
1410
1512
|
let r = W(e.elements), i = V(r), a = U(r, "HTMLInputElement");
|
|
1411
1513
|
if (a || U(r, "HTMLTextAreaElement")) {
|
|
1412
|
-
let e = r, n = a ?
|
|
1413
|
-
n && (r.dispatchEvent(new i.PointerEvent("pointerdown", n.pointerDown)), r.dispatchEvent(new i.MouseEvent("mousedown", n.mouseDown))),
|
|
1514
|
+
let e = r, n = a ? on(e, t) : null;
|
|
1515
|
+
n && (r.dispatchEvent(new i.PointerEvent("pointerdown", n.pointerDown)), r.dispatchEvent(new i.MouseEvent("mousedown", n.mouseDown))), an(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 }));
|
|
1414
1516
|
return;
|
|
1415
1517
|
}
|
|
1416
1518
|
if (U(r, "HTMLElement") && r.isContentEditable) {
|
|
1417
1519
|
r.textContent = t, r.dispatchEvent(new i.Event("input", { bubbles: !0 }));
|
|
1418
1520
|
return;
|
|
1419
1521
|
}
|
|
1420
|
-
throw Error(`fill: element <${
|
|
1421
|
-
} },
|
|
1522
|
+
throw Error(`fill: element <${Ht(r)}> is not fillable`);
|
|
1523
|
+
} }, cn = { resolve: (e, t = {}) => W(e.elements).textContent }, ln = { resolve: (e, t, n = {}) => W(e.elements).getAttribute(t) }, un = { resolve: (e, t = {}) => {
|
|
1422
1524
|
let n = W(e.elements);
|
|
1423
1525
|
if (!U(n, "HTMLElement")) return !0;
|
|
1424
1526
|
let r = V(n).getComputedStyle(n);
|
|
1425
1527
|
if (r?.display === "none" || r?.visibility === "hidden") return !1;
|
|
1426
1528
|
let i = n.getBoundingClientRect();
|
|
1427
1529
|
return i.width > 0 && i.height > 0;
|
|
1428
|
-
} },
|
|
1530
|
+
} }, dn = { resolve: (e, t = {}) => e.elements.length }, fn = { resolve: (e, t = {}) => e.elements.length > 0 }, q = (e, t) => (e.topLevel ? [e.document] : e.elements).flatMap((e) => [...e.querySelectorAll(t)]), pn = (e) => e.replaceAll("\"", "\\\""), mn = {
|
|
1429
1531
|
to: "element",
|
|
1430
1532
|
css: !0,
|
|
1431
1533
|
resolve: (e, t) => q(e, t),
|
|
@@ -1433,7 +1535,7 @@ var _t = class {
|
|
|
1433
1535
|
fragment: typeof e == "string" ? e : "?",
|
|
1434
1536
|
separator: "descend"
|
|
1435
1537
|
})
|
|
1436
|
-
},
|
|
1538
|
+
}, hn = {
|
|
1437
1539
|
to: "frame",
|
|
1438
1540
|
css: !0,
|
|
1439
1541
|
barrier: "down",
|
|
@@ -1442,25 +1544,25 @@ var _t = class {
|
|
|
1442
1544
|
fragment: typeof e == "string" ? e : "?",
|
|
1443
1545
|
separator: "down"
|
|
1444
1546
|
})
|
|
1445
|
-
},
|
|
1547
|
+
}, gn = {
|
|
1446
1548
|
element: {
|
|
1447
1549
|
selectors: {
|
|
1448
|
-
locator:
|
|
1449
|
-
frameLocator:
|
|
1550
|
+
locator: mn,
|
|
1551
|
+
frameLocator: hn,
|
|
1450
1552
|
getByRole: {
|
|
1451
1553
|
to: "element",
|
|
1452
1554
|
resolve: (e, t) => q(e, `[role="${CSS.escape(t)}"]`),
|
|
1453
|
-
render: (e) => ({ fragment: typeof e == "string" ? `[role="${
|
|
1555
|
+
render: (e) => ({ fragment: typeof e == "string" ? `[role="${pn(e)}"]` : "[role]" })
|
|
1454
1556
|
},
|
|
1455
1557
|
getByText: {
|
|
1456
1558
|
to: "element",
|
|
1457
1559
|
resolve: (e, t) => e.elements.flatMap((e) => [e, ...e.querySelectorAll("*")]).filter((e) => e.textContent?.includes(t)),
|
|
1458
|
-
render: (e) => ({ fragment: typeof e == "string" ? `:has-text("${
|
|
1560
|
+
render: (e) => ({ fragment: typeof e == "string" ? `:has-text("${pn(e)}")` : ":has-text(...)" })
|
|
1459
1561
|
},
|
|
1460
1562
|
getByTestId: {
|
|
1461
1563
|
to: "element",
|
|
1462
1564
|
resolve: (e, t) => q(e, `[data-testid="${CSS.escape(t)}"]`),
|
|
1463
|
-
render: (e) => ({ fragment: typeof e == "string" ? `[data-testid="${
|
|
1565
|
+
render: (e) => ({ fragment: typeof e == "string" ? `[data-testid="${pn(e)}"]` : "[data-testid]" })
|
|
1464
1566
|
},
|
|
1465
1567
|
first: {
|
|
1466
1568
|
to: "element",
|
|
@@ -1477,20 +1579,20 @@ var _t = class {
|
|
|
1477
1579
|
}
|
|
1478
1580
|
},
|
|
1479
1581
|
operations: {
|
|
1480
|
-
click:
|
|
1481
|
-
fill:
|
|
1482
|
-
hover:
|
|
1483
|
-
textContent:
|
|
1484
|
-
getAttribute:
|
|
1485
|
-
isVisible:
|
|
1486
|
-
count:
|
|
1487
|
-
exists:
|
|
1582
|
+
click: nn,
|
|
1583
|
+
fill: sn,
|
|
1584
|
+
hover: rn,
|
|
1585
|
+
textContent: cn,
|
|
1586
|
+
getAttribute: ln,
|
|
1587
|
+
isVisible: un,
|
|
1588
|
+
count: dn,
|
|
1589
|
+
exists: fn
|
|
1488
1590
|
}
|
|
1489
1591
|
},
|
|
1490
1592
|
frame: {
|
|
1491
1593
|
selectors: {
|
|
1492
|
-
locator:
|
|
1493
|
-
frameLocator:
|
|
1594
|
+
locator: mn,
|
|
1595
|
+
frameLocator: hn,
|
|
1494
1596
|
owner: {
|
|
1495
1597
|
to: "frame",
|
|
1496
1598
|
barrier: "up",
|
|
@@ -1504,11 +1606,11 @@ var _t = class {
|
|
|
1504
1606
|
}
|
|
1505
1607
|
},
|
|
1506
1608
|
operations: {
|
|
1507
|
-
addStyleTag:
|
|
1609
|
+
addStyleTag: $t,
|
|
1508
1610
|
fetch: G
|
|
1509
1611
|
}
|
|
1510
1612
|
}
|
|
1511
|
-
},
|
|
1613
|
+
}, _n = (e, t = gn) => ({
|
|
1512
1614
|
element: {
|
|
1513
1615
|
selectors: {
|
|
1514
1616
|
...t.element.selectors,
|
|
@@ -1529,31 +1631,31 @@ var _t = class {
|
|
|
1529
1631
|
...e.frame?.operations
|
|
1530
1632
|
}
|
|
1531
1633
|
}
|
|
1532
|
-
}),
|
|
1634
|
+
}), vn = 3e4, yn = 50, bn = (e) => {
|
|
1533
1635
|
let t = e[e.length - 1];
|
|
1534
1636
|
return typeof t == "object" && t ? t : void 0;
|
|
1535
|
-
},
|
|
1536
|
-
let t =
|
|
1537
|
-
return typeof t == "number" ? t :
|
|
1538
|
-
},
|
|
1637
|
+
}, xn = (e) => {
|
|
1638
|
+
let t = bn(e)?.timeout;
|
|
1639
|
+
return typeof t == "number" ? t : vn;
|
|
1640
|
+
}, Sn = ({ executor: e, parts: t }) => ({ highlight: (n) => e.highlight(t, n).then(() => {}, () => {}) }), Cn = async (e) => {
|
|
1539
1641
|
let t = {
|
|
1540
1642
|
parts: e.parts,
|
|
1541
1643
|
operation: e.operation,
|
|
1542
1644
|
args: e.args,
|
|
1543
1645
|
phase: "ensure"
|
|
1544
1646
|
};
|
|
1545
|
-
await e.gate?.(t,
|
|
1546
|
-
},
|
|
1647
|
+
await e.gate?.(t, Sn(e));
|
|
1648
|
+
}, wn = (e, t) => {
|
|
1547
1649
|
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`);
|
|
1548
|
-
},
|
|
1650
|
+
}, Tn = (e) => typeof e == "object" && e && typeof e.message == "string" ? e.message : String(e), En = async (e) => {
|
|
1549
1651
|
let { executor: t, gate: n, parts: r, operation: i, args: a } = e;
|
|
1550
|
-
|
|
1652
|
+
wn(i, bn(a)?.timeout), n && await n({
|
|
1551
1653
|
parts: r,
|
|
1552
1654
|
operation: i,
|
|
1553
1655
|
args: a,
|
|
1554
1656
|
phase: "execute"
|
|
1555
|
-
},
|
|
1556
|
-
let o =
|
|
1657
|
+
}, Sn(e));
|
|
1658
|
+
let o = xn(a), s = Date.now() + o, c = /* @__PURE__ */ Error(`Locator timeout (${o}ms): ${i}`), { promise: l, reject: u } = Promise.withResolvers();
|
|
1557
1659
|
l.catch(() => {});
|
|
1558
1660
|
let d = setTimeout(() => u(c), o), f = c;
|
|
1559
1661
|
try {
|
|
@@ -1561,47 +1663,47 @@ var _t = class {
|
|
|
1561
1663
|
return await Promise.race([t.execute(r, i, a), l]);
|
|
1562
1664
|
} catch (e) {
|
|
1563
1665
|
if (e === c) break;
|
|
1564
|
-
if (
|
|
1666
|
+
if (B(e)) throw e;
|
|
1565
1667
|
f = e;
|
|
1566
1668
|
let t = s - Date.now();
|
|
1567
1669
|
if (t <= 0) break;
|
|
1568
|
-
await new Promise((e) => setTimeout(e, Math.min(
|
|
1670
|
+
await new Promise((e) => setTimeout(e, Math.min(yn, t)));
|
|
1569
1671
|
}
|
|
1570
1672
|
} finally {
|
|
1571
1673
|
clearTimeout(d);
|
|
1572
1674
|
}
|
|
1573
|
-
throw f === c ? new
|
|
1574
|
-
},
|
|
1675
|
+
throw f === c ? new R(c.message) : new R(Tn(f), { cause: f });
|
|
1676
|
+
}, Dn = (e, t, n, r, i) => {
|
|
1575
1677
|
let a = {};
|
|
1576
|
-
for (let [o, s] of Object.entries(t[r].selectors)) a[o] = (...a) =>
|
|
1678
|
+
for (let [o, s] of Object.entries(t[r].selectors)) a[o] = (...a) => Dn(e, t, n, s.to, [...i, {
|
|
1577
1679
|
kind: r,
|
|
1578
1680
|
name: o,
|
|
1579
1681
|
args: a
|
|
1580
1682
|
}]);
|
|
1581
|
-
for (let [n, o] of Object.entries(t[r].operations)) a[n] = async (...t) =>
|
|
1683
|
+
for (let [n, o] of Object.entries(t[r].operations)) a[n] = async (...t) => En({
|
|
1582
1684
|
...e,
|
|
1583
1685
|
parts: i,
|
|
1584
1686
|
operation: n,
|
|
1585
1687
|
args: o.send ? o.send(...t) : t
|
|
1586
1688
|
});
|
|
1587
|
-
for (let [o, { to: s, rewrite: c }] of Object.entries(n[r] ?? {})) a[o] = (...r) =>
|
|
1689
|
+
for (let [o, { to: s, rewrite: c }] of Object.entries(n[r] ?? {})) a[o] = (...r) => Dn(e, t, n, s, c(i, ...r));
|
|
1588
1690
|
return a.ensure = (n, a = {}) => {
|
|
1589
1691
|
let o = t[r].operations[n]?.ensureArgs;
|
|
1590
|
-
return
|
|
1692
|
+
return Cn({
|
|
1591
1693
|
...e,
|
|
1592
1694
|
parts: i,
|
|
1593
1695
|
operation: n,
|
|
1594
1696
|
args: o?.(a) ?? [a]
|
|
1595
1697
|
});
|
|
1596
1698
|
}, a;
|
|
1597
|
-
},
|
|
1699
|
+
}, On = (e) => Dn(e, e.modules ?? gn, e.rewrites ?? {}, "frame", []), kn = () => {
|
|
1598
1700
|
let e = E();
|
|
1599
1701
|
return e.status === "ok" && e.abi >= 2;
|
|
1600
|
-
},
|
|
1601
|
-
await
|
|
1702
|
+
}, An = async () => {
|
|
1703
|
+
await D();
|
|
1602
1704
|
let e = E();
|
|
1603
1705
|
if (e.status === "ok" && e.abi < 2) throw new w(e.abi, 2);
|
|
1604
|
-
},
|
|
1706
|
+
}, jn = (e) => `Read the text, links and details ${e} shows.`, Mn = (e) => `Inject unfiltered styles or code into ${e}. This can pass page details along to other sites.`, Nn = [
|
|
1605
1707
|
{
|
|
1606
1708
|
id: "interaction",
|
|
1607
1709
|
heading: "Interaction",
|
|
@@ -1616,9 +1718,9 @@ var _t = class {
|
|
|
1616
1718
|
heading: "Site data",
|
|
1617
1719
|
summary: "Can read the website's data",
|
|
1618
1720
|
title: (e) => `Read data from ${e}`,
|
|
1619
|
-
description:
|
|
1721
|
+
description: jn,
|
|
1620
1722
|
cloudTitle: (e) => `Read what's on ${e}`,
|
|
1621
|
-
cloudDescription:
|
|
1723
|
+
cloudDescription: jn
|
|
1622
1724
|
},
|
|
1623
1725
|
{
|
|
1624
1726
|
id: "network",
|
|
@@ -1634,11 +1736,11 @@ var _t = class {
|
|
|
1634
1736
|
heading: "Evaluation",
|
|
1635
1737
|
summary: "Can execute arbitrary code on the website",
|
|
1636
1738
|
title: (e) => `Run code on ${e}`,
|
|
1637
|
-
description:
|
|
1739
|
+
description: Mn,
|
|
1638
1740
|
cloudTitle: (e) => `Run its own code on ${e}`,
|
|
1639
|
-
cloudDescription:
|
|
1741
|
+
cloudDescription: Mn
|
|
1640
1742
|
}
|
|
1641
|
-
],
|
|
1743
|
+
], Pn = (e) => (t) => {
|
|
1642
1744
|
if (typeof t != "object" || !t) return t === void 0 ? [] : [t];
|
|
1643
1745
|
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`);
|
|
1644
1746
|
let { relativePosition: n, ...r } = t;
|
|
@@ -1646,15 +1748,21 @@ var _t = class {
|
|
|
1646
1748
|
...r,
|
|
1647
1749
|
position: n
|
|
1648
1750
|
}];
|
|
1649
|
-
},
|
|
1751
|
+
}, Fn = async (e, t, n) => {
|
|
1752
|
+
try {
|
|
1753
|
+
return await G.resolve(e, t, n);
|
|
1754
|
+
} catch (e) {
|
|
1755
|
+
throw B(e) ? e : L(`frame.fetch: ${e instanceof Error ? `${e.name}: ${e.message}` : String(e)}; not retried, since the request may already have been sent`, "fetch");
|
|
1756
|
+
}
|
|
1757
|
+
}, In = _n({
|
|
1650
1758
|
element: { operations: {
|
|
1651
1759
|
click: {
|
|
1652
1760
|
resolve: (e, t = {}) => K.click.resolve(e, t),
|
|
1653
|
-
send:
|
|
1761
|
+
send: Pn("click")
|
|
1654
1762
|
},
|
|
1655
1763
|
hover: {
|
|
1656
1764
|
resolve: (e, t = {}) => K.hover.resolve(e, t),
|
|
1657
|
-
send:
|
|
1765
|
+
send: Pn("hover")
|
|
1658
1766
|
},
|
|
1659
1767
|
fill: { resolve: (e, t, n = {}) => K.fill.resolve(e, t, n) },
|
|
1660
1768
|
textContent: { resolve: (e, t = {}) => K.textContent.resolve(e) },
|
|
@@ -1662,12 +1770,12 @@ var _t = class {
|
|
|
1662
1770
|
isVisible: { resolve: (e, t = {}) => K.isVisible.resolve(e) },
|
|
1663
1771
|
count: { resolve: (e, t = {}) => K.count.resolve(e) },
|
|
1664
1772
|
exists: { resolve: (e, t = {}) => K.exists.resolve(e) },
|
|
1665
|
-
videoElement: { resolve: (e, t = {}) => _e(
|
|
1773
|
+
videoElement: { resolve: (e, t = {}) => _e(Vt(W(e.elements), "HTMLVideoElement")) }
|
|
1666
1774
|
} },
|
|
1667
1775
|
frame: { operations: {
|
|
1668
|
-
addStyleTag: { resolve: (e, t) =>
|
|
1776
|
+
addStyleTag: { resolve: (e, t) => $t.resolve(e, t) },
|
|
1669
1777
|
fetch: {
|
|
1670
|
-
resolve: (e, t, n = {}) =>
|
|
1778
|
+
resolve: (e, t, n = {}) => Fn(e, t, n),
|
|
1671
1779
|
kind: G.kind,
|
|
1672
1780
|
ensureArgs: G.ensureArgs
|
|
1673
1781
|
},
|
|
@@ -1675,11 +1783,11 @@ var _t = class {
|
|
|
1675
1783
|
kind: "frame",
|
|
1676
1784
|
typed: !1,
|
|
1677
1785
|
resolve: (e, t, n) => {
|
|
1678
|
-
throw
|
|
1786
|
+
throw It("evaluate", "this realm");
|
|
1679
1787
|
}
|
|
1680
1788
|
}
|
|
1681
1789
|
} }
|
|
1682
|
-
}),
|
|
1790
|
+
}), Ln = (e) => e[e.length - 1], Rn = {
|
|
1683
1791
|
element: {
|
|
1684
1792
|
last: {
|
|
1685
1793
|
to: "element",
|
|
@@ -1692,7 +1800,7 @@ var _t = class {
|
|
|
1692
1800
|
contentFrame: {
|
|
1693
1801
|
to: "frame",
|
|
1694
1802
|
rewrite: (e) => {
|
|
1695
|
-
let t =
|
|
1803
|
+
let t = Ln(e);
|
|
1696
1804
|
if (t?.name !== "locator") throw TypeError("locator.contentFrame: only a locator that ends in locator(selector) can enter its frame; use frameLocator(selector)");
|
|
1697
1805
|
return [...e.slice(0, -1), {
|
|
1698
1806
|
...t,
|
|
@@ -1705,7 +1813,7 @@ var _t = class {
|
|
|
1705
1813
|
owner: {
|
|
1706
1814
|
to: "element",
|
|
1707
1815
|
rewrite: (e) => {
|
|
1708
|
-
let t =
|
|
1816
|
+
let t = Ln(e);
|
|
1709
1817
|
if (t?.name !== "frameLocator") throw TypeError("frameLocator.owner: this frame was not entered through frameLocator(selector)");
|
|
1710
1818
|
return [...e.slice(0, -1), {
|
|
1711
1819
|
...t,
|
|
@@ -1722,7 +1830,7 @@ var _t = class {
|
|
|
1722
1830
|
}]
|
|
1723
1831
|
}
|
|
1724
1832
|
}
|
|
1725
|
-
},
|
|
1833
|
+
}, zn = (e) => {
|
|
1726
1834
|
if (!e || e === "about:blank") return !1;
|
|
1727
1835
|
let t;
|
|
1728
1836
|
try {
|
|
@@ -1732,44 +1840,44 @@ var _t = class {
|
|
|
1732
1840
|
}
|
|
1733
1841
|
return t.protocol === "chrome-extension:" || t.protocol === "moz-extension:" || t.protocol !== "about:" && A(t.hostname);
|
|
1734
1842
|
}, J = (e) => {
|
|
1735
|
-
if (
|
|
1736
|
-
},
|
|
1843
|
+
if (zn(e)) throw Error("attachFrame: refusing to target the extension's own pages or an FKN platform origin");
|
|
1844
|
+
}, Bn = ({ src: e, domains: t, lockdown: n }) => {
|
|
1737
1845
|
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");
|
|
1738
|
-
},
|
|
1846
|
+
}, Vn = {
|
|
1739
1847
|
scope: "embed.iframe",
|
|
1740
1848
|
category: "interaction",
|
|
1741
1849
|
severity: 0,
|
|
1742
1850
|
title: "Load another website inside this app",
|
|
1743
1851
|
description: "Lets the app embed external pages directly inside its own view."
|
|
1744
|
-
},
|
|
1852
|
+
}, Hn = {
|
|
1745
1853
|
scope: "embed.open",
|
|
1746
1854
|
category: "interaction",
|
|
1747
1855
|
severity: 0,
|
|
1748
1856
|
title: "Open a website inside this app",
|
|
1749
1857
|
description: "Lets the app navigate to another site without leaving its window."
|
|
1750
|
-
},
|
|
1858
|
+
}, Un = ["load", "commit"], Wn = (e) => {
|
|
1751
1859
|
if ("timeoutMs" in e) throw TypeError("frame.goto: pass timeout, in milliseconds; timeoutMs is not an option");
|
|
1752
1860
|
let { waitUntil: t, timeout: n } = e;
|
|
1753
|
-
if (t !== void 0 && !
|
|
1861
|
+
if (t !== void 0 && !Un.includes(t)) throw TypeError(`frame.goto: waitUntil must be 'load' or 'commit', not ${JSON.stringify(t)}`);
|
|
1754
1862
|
if (n !== void 0 && typeof n != "number") throw TypeError("frame.goto: timeout must be a number of milliseconds");
|
|
1755
|
-
|
|
1756
|
-
},
|
|
1863
|
+
wn("frame.goto", n);
|
|
1864
|
+
}, Gn = class extends Error {
|
|
1757
1865
|
name = "FrameWindowBlockedError";
|
|
1758
1866
|
constructor() {
|
|
1759
1867
|
super("attachFrame: the browser did not open the window. Call attachFrame directly in a click or key handler, and allow popups for this page");
|
|
1760
1868
|
}
|
|
1761
|
-
},
|
|
1869
|
+
}, Kn = /* @__PURE__ */ new Set([
|
|
1762
1870
|
"jar-unreachable",
|
|
1763
1871
|
"bad-url",
|
|
1764
1872
|
"opaque-opener"
|
|
1765
|
-
]),
|
|
1873
|
+
]), qn = class extends Error {
|
|
1766
1874
|
name = "FrameWindowRefusedError";
|
|
1767
1875
|
reason;
|
|
1768
1876
|
constructor(e) {
|
|
1769
|
-
let t =
|
|
1877
|
+
let t = Kn.has(e) ? e : "unknown";
|
|
1770
1878
|
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;
|
|
1771
1879
|
}
|
|
1772
|
-
},
|
|
1880
|
+
}, Jn = ["message", "document"], Yn = (e) => {
|
|
1773
1881
|
if (e === "*") return "*";
|
|
1774
1882
|
let t = () => /* @__PURE__ */ TypeError(`frame.postMessage: targetOrigin must be '*' or an origin, not ${JSON.stringify(e)}`);
|
|
1775
1883
|
if (typeof e != "string") throw t();
|
|
@@ -1781,48 +1889,48 @@ var _t = class {
|
|
|
1781
1889
|
}
|
|
1782
1890
|
if (n === "null") throw t();
|
|
1783
1891
|
return n;
|
|
1784
|
-
},
|
|
1892
|
+
}, Xn = (e, t) => {
|
|
1785
1893
|
let n = typeof e == "object" && !!e;
|
|
1786
1894
|
if (n && t !== void 0) throw TypeError("frame.postMessage: pass transfer inside the options object, not after it");
|
|
1787
1895
|
let r = n ? e.targetOrigin ?? "*" : e ?? "*", i = n ? e.transfer : t;
|
|
1788
1896
|
if (i !== void 0 && !Array.isArray(i)) throw TypeError("frame.postMessage: transfer must be an array");
|
|
1789
1897
|
return {
|
|
1790
|
-
targetOrigin:
|
|
1898
|
+
targetOrigin: Yn(r),
|
|
1791
1899
|
transfer: i === void 0 ? [] : [...i]
|
|
1792
1900
|
};
|
|
1793
|
-
},
|
|
1901
|
+
}, Zn = [
|
|
1794
1902
|
"url",
|
|
1795
1903
|
"path",
|
|
1796
1904
|
"type"
|
|
1797
|
-
],
|
|
1905
|
+
], Qn = ["content", "sourceUrl"], $n = /[\n\r\u2028\u2029]/, er = (e) => {
|
|
1798
1906
|
if (typeof e != "object" || !e || Array.isArray(e)) throw TypeError("frame.addScriptTag: options must be an object { content }");
|
|
1799
|
-
let t = Object.keys(e), n = t.find((e) =>
|
|
1907
|
+
let t = Object.keys(e), n = t.find((e) => Zn.includes(e));
|
|
1800
1908
|
if (n !== void 0) throw TypeError(`frame.addScriptTag: "${n}" is not served; it runs content as a classic inline script`);
|
|
1801
|
-
let r = t.find((e) => !
|
|
1909
|
+
let r = t.find((e) => !Qn.includes(e));
|
|
1802
1910
|
if (r !== void 0) throw TypeError(`frame.addScriptTag: unknown option "${r}"`);
|
|
1803
1911
|
let { content: i, sourceUrl: a } = e;
|
|
1804
1912
|
if (typeof i != "string") throw TypeError("frame.addScriptTag: content must be a string");
|
|
1805
|
-
if (a !== void 0 && (typeof a != "string" || a === "" ||
|
|
1913
|
+
if (a !== void 0 && (typeof a != "string" || a === "" || $n.test(a))) throw TypeError("frame.addScriptTag: sourceUrl must be a non-empty string with no line break");
|
|
1806
1914
|
return a === void 0 ? { content: i } : {
|
|
1807
1915
|
content: i,
|
|
1808
1916
|
sourceUrl: a
|
|
1809
1917
|
};
|
|
1810
|
-
},
|
|
1918
|
+
}, tr = [
|
|
1811
1919
|
"name",
|
|
1812
1920
|
"domain",
|
|
1813
1921
|
"path"
|
|
1814
|
-
],
|
|
1922
|
+
], nr = (e) => e instanceof RegExp || Object.prototype.toString.call(e) === "[object RegExp]", rr = (e) => {
|
|
1815
1923
|
if (e === void 0) return {};
|
|
1816
1924
|
if (Object.prototype.toString.call(e) !== "[object Object]") throw TypeError("frame.clearCookies: options must be an object");
|
|
1817
|
-
let t = e, n = Object.keys(t).find((e) => !
|
|
1925
|
+
let t = e, n = Object.keys(t).find((e) => !tr.includes(e));
|
|
1818
1926
|
if (n !== void 0) throw TypeError(`frame.clearCookies: unknown option "${n}"`);
|
|
1819
|
-
let r =
|
|
1927
|
+
let r = tr.flatMap((e) => {
|
|
1820
1928
|
let n = t[e];
|
|
1821
1929
|
return n === void 0 ? [] : [{
|
|
1822
1930
|
key: e,
|
|
1823
1931
|
value: n
|
|
1824
1932
|
}];
|
|
1825
|
-
}), i = r.find(({ value: e }) =>
|
|
1933
|
+
}), i = r.find(({ value: e }) => nr(e));
|
|
1826
1934
|
if (i !== void 0) throw TypeError(`frame.clearCookies: ${i.key} is a RegExp, and clearCookies takes strings for name, domain and path for now`);
|
|
1827
1935
|
let a = r.find(({ value: e }) => typeof e != "string");
|
|
1828
1936
|
if (a !== void 0) throw TypeError(`frame.clearCookies: ${a.key} must be a string`);
|
|
@@ -1831,15 +1939,15 @@ var _t = class {
|
|
|
1831
1939
|
let s = {};
|
|
1832
1940
|
for (let { key: e, value: t } of r) s[e] = { equals: t };
|
|
1833
1941
|
return s;
|
|
1834
|
-
},
|
|
1942
|
+
}, ir = (e) => {
|
|
1835
1943
|
typeof globalThis.reportError == "function" ? globalThis.reportError(e) : console.error(e);
|
|
1836
|
-
},
|
|
1837
|
-
let { owner: t, ...n } =
|
|
1944
|
+
}, ar = (e) => {
|
|
1945
|
+
let { owner: t, ...n } = On({
|
|
1838
1946
|
executor: e.executor,
|
|
1839
|
-
modules:
|
|
1840
|
-
rewrites:
|
|
1947
|
+
modules: In,
|
|
1948
|
+
rewrites: Rn,
|
|
1841
1949
|
gate: e.gate
|
|
1842
|
-
}), r = async (t, n = {}) => (J(t),
|
|
1950
|
+
}), r = async (t, n = {}) => (J(t), Wn(n), e.goto(t, n)), i = () => e.url(), a = async (t) => {
|
|
1843
1951
|
let n = e.requestPermissions;
|
|
1844
1952
|
if (!n) throw Error("frame.requestPermissions: this backend cannot ask for permission categories");
|
|
1845
1953
|
return n(t);
|
|
@@ -1850,18 +1958,18 @@ var _t = class {
|
|
|
1850
1958
|
if (typeof i != "string") throw TypeError("frame.evaluate: pass a function or a source string");
|
|
1851
1959
|
return r(i, structuredClone(n));
|
|
1852
1960
|
}, s = async (t) => {
|
|
1853
|
-
let { content: n, ...r } =
|
|
1961
|
+
let { content: n, ...r } = er(t), i = e.addScriptTag;
|
|
1854
1962
|
if (!i) throw Error("frame.addScriptTag: this backend cannot run scripts in the attached frame");
|
|
1855
1963
|
await i(n, r);
|
|
1856
1964
|
}, c = async (t) => {
|
|
1857
|
-
let n =
|
|
1965
|
+
let n = rr(t), r = e.clearCookies;
|
|
1858
1966
|
if (!r) throw Error("frame.clearCookies: this backend cannot clear cookies");
|
|
1859
1967
|
await r(n);
|
|
1860
1968
|
}, l = ((t, n, r) => {
|
|
1861
1969
|
try {
|
|
1862
1970
|
let i = e.postMessage;
|
|
1863
1971
|
if (!i) throw Error("frame.postMessage: this backend cannot message the attached frame");
|
|
1864
|
-
let a =
|
|
1972
|
+
let a = Xn(n, r);
|
|
1865
1973
|
return i(t, a.targetOrigin, a.transfer);
|
|
1866
1974
|
} catch (e) {
|
|
1867
1975
|
return Promise.reject(e);
|
|
@@ -1870,7 +1978,7 @@ var _t = class {
|
|
|
1870
1978
|
message: /* @__PURE__ */ new Set(),
|
|
1871
1979
|
document: /* @__PURE__ */ new Set()
|
|
1872
1980
|
}, d = null, f = (e, t) => {
|
|
1873
|
-
if (!
|
|
1981
|
+
if (!Jn.includes(e)) throw TypeError(`frame.${t}: the event type must be ${Jn.map((e) => `'${e}'`).join(" or ")}, not ${JSON.stringify(e)}`);
|
|
1874
1982
|
return u[e];
|
|
1875
1983
|
}, p = (e) => {
|
|
1876
1984
|
let t = e.type === "message" ? Object.freeze({
|
|
@@ -1886,7 +1994,7 @@ var _t = class {
|
|
|
1886
1994
|
for (let n of [...u[e.type]]) try {
|
|
1887
1995
|
n(t);
|
|
1888
1996
|
} catch (e) {
|
|
1889
|
-
|
|
1997
|
+
ir(e);
|
|
1890
1998
|
}
|
|
1891
1999
|
}, m = (e, t) => {
|
|
1892
2000
|
if (f(e, "off").delete(t), d !== null && !u.message.size && !u.document.size) {
|
|
@@ -1919,7 +2027,7 @@ var _t = class {
|
|
|
1919
2027
|
off: m
|
|
1920
2028
|
};
|
|
1921
2029
|
return _;
|
|
1922
|
-
},
|
|
2030
|
+
}, or = [
|
|
1923
2031
|
h,
|
|
1924
2032
|
t,
|
|
1925
2033
|
g,
|
|
@@ -1933,43 +2041,43 @@ var _t = class {
|
|
|
1933
2041
|
l,
|
|
1934
2042
|
f,
|
|
1935
2043
|
u,
|
|
1936
|
-
|
|
1937
|
-
|
|
2044
|
+
Vn,
|
|
2045
|
+
Hn,
|
|
1938
2046
|
m,
|
|
1939
2047
|
r,
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
],
|
|
2048
|
+
tt,
|
|
2049
|
+
nt,
|
|
2050
|
+
rt,
|
|
2051
|
+
gt,
|
|
2052
|
+
vt
|
|
2053
|
+
], sr = Nn.map((e) => e.id), cr = {
|
|
1946
2054
|
interaction: "act.click",
|
|
1947
2055
|
storage: "read.text",
|
|
1948
2056
|
network: "network.fetchCredentialed",
|
|
1949
2057
|
evaluation: "media.appearU"
|
|
1950
|
-
},
|
|
2058
|
+
}, lr = (e) => e === 0 ? "auto" : e === 4 ? "critical" : "bundled", ur = or, Y = /* @__PURE__ */ new Map(), dr = {};
|
|
1951
2059
|
(() => {
|
|
1952
|
-
Y = new Map(
|
|
1953
|
-
let e = (e) =>
|
|
1954
|
-
Object.fromEntries(
|
|
2060
|
+
Y = new Map(ur.map((e) => [e.scope, e])), dr = Object.fromEntries(Y), ur.filter((e) => e.severity === 4).map((e) => e.scope);
|
|
2061
|
+
let e = (e) => ur.filter((t) => t.category === e && lr(t.severity) === "bundled");
|
|
2062
|
+
Object.fromEntries(sr.map((t) => [t, Math.max(0, ...e(t).map((e) => e.severity))])), Object.fromEntries(sr.map((t) => [t, e(t).some((e) => e.unsafe === !0)]));
|
|
1955
2063
|
})();
|
|
1956
|
-
var
|
|
2064
|
+
var fr = (e) => Y.get(e)?.category, pr = (e) => {
|
|
1957
2065
|
let t = Y.get(e);
|
|
1958
|
-
return t &&
|
|
1959
|
-
},
|
|
2066
|
+
return t && lr(t.severity);
|
|
2067
|
+
}, mr = (e) => {
|
|
1960
2068
|
let t = Y.get(e);
|
|
1961
|
-
if (t) return
|
|
1962
|
-
},
|
|
1963
|
-
let n = t ?? (e &&
|
|
1964
|
-
return n !== void 0 &&
|
|
1965
|
-
},
|
|
1966
|
-
for (let { category: n, key: r } of t) if (
|
|
2069
|
+
if (t) return lr(t.severity) === "critical" ? t.scope : t.category;
|
|
2070
|
+
}, hr = (e) => cr[e], gr = ({ category: e, key: t }) => {
|
|
2071
|
+
let n = t ?? (e && hr(e));
|
|
2072
|
+
return n !== void 0 && fr(n) !== void 0 ? n : void 0;
|
|
2073
|
+
}, _r = (e, t) => {
|
|
2074
|
+
for (let { category: n, key: r } of t) if (gr({
|
|
1967
2075
|
category: n,
|
|
1968
2076
|
key: r
|
|
1969
2077
|
}) === 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}"`);
|
|
1970
|
-
},
|
|
2078
|
+
}, vr = (e, t = {}) => {
|
|
1971
2079
|
let n = [], r = e.map((e) => {
|
|
1972
|
-
let r =
|
|
2080
|
+
let r = gr(e), i = [];
|
|
1973
2081
|
if (r !== void 0) for (let a of e.hosts) i.push(n.length), n.push({
|
|
1974
2082
|
...t,
|
|
1975
2083
|
key: r,
|
|
@@ -1979,8 +2087,8 @@ var rr = (e) => Y.get(e)?.category, ir = (e) => {
|
|
|
1979
2087
|
reason: e.reason
|
|
1980
2088
|
});
|
|
1981
2089
|
return {
|
|
1982
|
-
key: r !== void 0 &&
|
|
1983
|
-
category: r === void 0 ? e.category ?? "interaction" :
|
|
2090
|
+
key: r !== void 0 && pr(r) === "critical" ? r : void 0,
|
|
2091
|
+
category: r === void 0 ? e.category ?? "interaction" : dr[r].category,
|
|
1984
2092
|
hosts: e.hosts,
|
|
1985
2093
|
indexes: i
|
|
1986
2094
|
};
|
|
@@ -1994,31 +2102,31 @@ var rr = (e) => Y.get(e)?.category, ir = (e) => {
|
|
|
1994
2102
|
allow: i.length > 0 && i.every((t) => e[t]?.allow === !0)
|
|
1995
2103
|
}))
|
|
1996
2104
|
};
|
|
1997
|
-
},
|
|
1998
|
-
typeof window < "u" &&
|
|
1999
|
-
if (!
|
|
2105
|
+
}, yr = (e) => typeof e == "object" && !!e, br = typeof chrome < "u" && !!chrome.runtime?.id, xr = (e) => yr(e) && e.FKN_WEB_EXTENSION_FRAME_ANNOUNCE_KEY === !0 && typeof e.frameId == "string" && typeof e.document == "string", Sr = /* @__PURE__ */ new WeakMap(), Cr = /* @__PURE__ */ new WeakMap(), wr = /* @__PURE__ */ new WeakMap(), Tr = /* @__PURE__ */ new Set();
|
|
2106
|
+
typeof window < "u" && br && window.addEventListener("message", (e) => {
|
|
2107
|
+
if (!xr(e.data)) return;
|
|
2000
2108
|
e.stopImmediatePropagation();
|
|
2001
2109
|
let t = e.source;
|
|
2002
2110
|
if (!t || typeof t != "object") return;
|
|
2003
|
-
let n = t, r =
|
|
2004
|
-
if (
|
|
2005
|
-
let o =
|
|
2111
|
+
let n = t, r = Sr.get(n), i = e.data.frameId, a = e.data.document;
|
|
2112
|
+
if (Sr.set(n, i), Cr.set(n, a), r) for (let e of Tr) e(r);
|
|
2113
|
+
let o = wr.get(n);
|
|
2006
2114
|
if (o) {
|
|
2007
2115
|
for (let e of [...o]) (e.notDocument === void 0 || e.notDocument !== a) && (o.delete(e), e.resolve(i));
|
|
2008
|
-
o.size ||
|
|
2116
|
+
o.size || wr.delete(n);
|
|
2009
2117
|
}
|
|
2010
2118
|
}, { capture: !0 });
|
|
2011
2119
|
//#endregion
|
|
2012
2120
|
//#region ../web-extension/lib/lib/evaluate-deadline.js
|
|
2013
|
-
var
|
|
2121
|
+
var Er = 3e4, Dr = `frame.evaluate: the code did not settle within ${Er}ms`, Or = () => new R(Dr), kr = (e) => z(e) && e.message === Dr ? Or() : e, Ar = [
|
|
2014
2122
|
/^frame load timed out after \d+ms for /,
|
|
2015
2123
|
/^frame goto: documentstart timed out$/,
|
|
2016
2124
|
/^navigation to .+ did not commit a document within \d+ms$/s
|
|
2017
|
-
],
|
|
2018
|
-
if (e instanceof
|
|
2125
|
+
], jr = (e) => {
|
|
2126
|
+
if (e instanceof R) return e;
|
|
2019
2127
|
let t = typeof e?.message == "string" ? e.message : "";
|
|
2020
|
-
return
|
|
2021
|
-
},
|
|
2128
|
+
return Ar.some((e) => e.test(t)) ? new R(t) : e;
|
|
2129
|
+
}, Mr = (e) => {
|
|
2022
2130
|
let t = e;
|
|
2023
2131
|
if (t.window === void 0) return "iframe";
|
|
2024
2132
|
if (t.iframe !== void 0) throw TypeError("attachFrame: pass either iframe or window, not both");
|
|
@@ -2026,11 +2134,11 @@ var _r = 3e4, vr = `frame.evaluate: the code did not settle within ${_r}ms`, yr
|
|
|
2026
2134
|
if (t.blank !== void 0) throw TypeError("attachFrame: blank does not apply to a window");
|
|
2027
2135
|
if (typeof t.window != "object" || t.window === null) throw TypeError("attachFrame: window must be an object");
|
|
2028
2136
|
return "window";
|
|
2029
|
-
},
|
|
2137
|
+
}, Nr = (e, t, n) => {
|
|
2030
2138
|
if (e === void 0) return t;
|
|
2031
2139
|
if (typeof e != "number" || !Number.isFinite(e) || e <= 0) throw TypeError(`attachFrame: window.${n} must be a positive number of CSS pixels`);
|
|
2032
2140
|
return Math.round(e);
|
|
2033
|
-
},
|
|
2141
|
+
}, Pr = ({ url: e, width: t, height: n }) => {
|
|
2034
2142
|
let r = (() => {
|
|
2035
2143
|
if (e === void 0 || e === "" || e === "about:blank") return "";
|
|
2036
2144
|
if (typeof e != "string") throw TypeError("attachFrame: window.url must be a string");
|
|
@@ -2046,10 +2154,10 @@ var _r = 3e4, vr = `frame.evaluate: the code did not settle within ${_r}ms`, yr
|
|
|
2046
2154
|
})();
|
|
2047
2155
|
return r && J(r), {
|
|
2048
2156
|
url: r,
|
|
2049
|
-
width:
|
|
2050
|
-
height:
|
|
2157
|
+
width: Nr(t, 500, "width"),
|
|
2158
|
+
height: Nr(n, 700, "height")
|
|
2051
2159
|
};
|
|
2052
|
-
},
|
|
2160
|
+
}, Fr = "attachFrame: storageState seeds a fresh jar, so it needs cookies: 'ephemeral'", Ir = 1e11, Lr = [
|
|
2053
2161
|
"name",
|
|
2054
2162
|
"value",
|
|
2055
2163
|
"domain",
|
|
@@ -2058,11 +2166,11 @@ var _r = 3e4, vr = `frame.evaluate: the code did not settle within ${_r}ms`, yr
|
|
|
2058
2166
|
"httpOnly",
|
|
2059
2167
|
"secure",
|
|
2060
2168
|
"sameSite"
|
|
2061
|
-
],
|
|
2169
|
+
], Rr = [
|
|
2062
2170
|
"Strict",
|
|
2063
2171
|
"Lax",
|
|
2064
2172
|
"None"
|
|
2065
|
-
],
|
|
2173
|
+
], zr = /[;\x00-\x1f\x7f]/, X = (e, t) => /* @__PURE__ */ TypeError(`attachFrame: storageState${e} ${t}`), Z = (e) => Object.prototype.toString.call(e) === "[object Object]", Br = (e) => {
|
|
2066
2174
|
let t = e.startsWith(".") ? e.slice(1) : e;
|
|
2067
2175
|
if (t === "") return null;
|
|
2068
2176
|
try {
|
|
@@ -2070,33 +2178,33 @@ var _r = 3e4, vr = `frame.evaluate: the code did not settle within ${_r}ms`, yr
|
|
|
2070
2178
|
} catch {
|
|
2071
2179
|
return null;
|
|
2072
2180
|
}
|
|
2073
|
-
},
|
|
2074
|
-
if (!
|
|
2075
|
-
let n = Object.keys(e).find((e) => !
|
|
2076
|
-
if (n !== void 0) throw
|
|
2181
|
+
}, Vr = (e, t) => {
|
|
2182
|
+
if (!Z(e)) throw X(t, "must be an object");
|
|
2183
|
+
let n = Object.keys(e).find((e) => !Lr.includes(e));
|
|
2184
|
+
if (n !== void 0) throw X(`${t}.${n}`, "is not a cookie field");
|
|
2077
2185
|
let { name: r, value: i, domain: a, path: o, expires: s, httpOnly: c, secure: l, sameSite: u } = e;
|
|
2078
|
-
if (typeof r != "string" || r === "" || r.includes("=") ||
|
|
2079
|
-
if (typeof i != "string" ||
|
|
2080
|
-
if (typeof a != "string" ||
|
|
2081
|
-
if (o !== void 0 && (typeof o != "string" || !o.startsWith("/") ||
|
|
2082
|
-
if (s !== void 0 && (typeof s != "number" || !Number.isFinite(s) || s <= 0 && s !== -1)) throw
|
|
2083
|
-
if (c !== void 0 && typeof c != "boolean") throw
|
|
2084
|
-
if (l !== void 0 && typeof l != "boolean") throw
|
|
2085
|
-
if (u !== void 0 && !
|
|
2186
|
+
if (typeof r != "string" || r === "" || r.includes("=") || zr.test(r)) throw X(`${t}.name`, "must be a non-empty string with no \"=\", \";\" or control character");
|
|
2187
|
+
if (typeof i != "string" || zr.test(i)) throw X(`${t}.value`, "must be a string with no \";\" or control character");
|
|
2188
|
+
if (typeof a != "string" || Br(a) === null) throw X(`${t}.domain`, "must be a host: \".youtube.com\" for a cookie its subdomains also receive, \"www.youtube.com\" for a host-only one");
|
|
2189
|
+
if (o !== void 0 && (typeof o != "string" || !o.startsWith("/") || zr.test(o))) throw X(`${t}.path`, "must be a string starting with \"/\"");
|
|
2190
|
+
if (s !== void 0 && (typeof s != "number" || !Number.isFinite(s) || s <= 0 && s !== -1)) throw X(`${t}.expires`, "must be -1 for a session cookie, or milliseconds since the epoch");
|
|
2191
|
+
if (c !== void 0 && typeof c != "boolean") throw X(`${t}.httpOnly`, "must be a boolean");
|
|
2192
|
+
if (l !== void 0 && typeof l != "boolean") throw X(`${t}.secure`, "must be a boolean");
|
|
2193
|
+
if (u !== void 0 && !Rr.includes(u)) throw X(`${t}.sameSite`, `must be 'Strict', 'Lax' or 'None', not ${JSON.stringify(u)}`);
|
|
2086
2194
|
let d = r.toLowerCase();
|
|
2087
|
-
if (u === "None" && l !== !0) throw
|
|
2088
|
-
if (d.startsWith("__secure-") && l !== !0) throw
|
|
2089
|
-
if (d.startsWith("__host-") && (l !== !0 || a.startsWith(".") || (o ?? "/") !== "/")) throw
|
|
2195
|
+
if (u === "None" && l !== !0) throw X(t, "is SameSite=None, which needs secure: true");
|
|
2196
|
+
if (d.startsWith("__secure-") && l !== !0) throw X(t, "is a __Secure- cookie, which needs secure: true");
|
|
2197
|
+
if (d.startsWith("__host-") && (l !== !0 || a.startsWith(".") || (o ?? "/") !== "/")) throw X(t, "is a __Host- cookie, which needs secure: true, a host-only domain and path \"/\"");
|
|
2090
2198
|
let f = {
|
|
2091
2199
|
name: r,
|
|
2092
2200
|
value: i,
|
|
2093
2201
|
domain: a
|
|
2094
2202
|
};
|
|
2095
2203
|
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;
|
|
2096
|
-
},
|
|
2097
|
-
if (!
|
|
2204
|
+
}, Hr = (e, t) => {
|
|
2205
|
+
if (!Z(e)) throw X(t, "must be an object { origin, localStorage }");
|
|
2098
2206
|
let n = Object.keys(e).find((e) => e !== "origin" && e !== "localStorage");
|
|
2099
|
-
if (n !== void 0) throw
|
|
2207
|
+
if (n !== void 0) throw X(`${t}.${n}`, "is not an origin field");
|
|
2100
2208
|
let { origin: r, localStorage: i } = e, a = (() => {
|
|
2101
2209
|
try {
|
|
2102
2210
|
return typeof r == "string" ? new URL(r) : null;
|
|
@@ -2104,43 +2212,43 @@ var _r = 3e4, vr = `frame.evaluate: the code did not settle within ${_r}ms`, yr
|
|
|
2104
2212
|
return null;
|
|
2105
2213
|
}
|
|
2106
2214
|
})();
|
|
2107
|
-
if (a === null || a.protocol !== "http:" && a.protocol !== "https:" || a.origin !== r) throw
|
|
2108
|
-
if (!Array.isArray(i)) throw
|
|
2215
|
+
if (a === null || a.protocol !== "http:" && a.protocol !== "https:" || a.origin !== r) throw X(`${t}.origin`, `must be an absolute http or https origin, not ${JSON.stringify(r)}`);
|
|
2216
|
+
if (!Array.isArray(i)) throw X(`${t}.localStorage`, "must be an array");
|
|
2109
2217
|
return {
|
|
2110
2218
|
origin: r,
|
|
2111
2219
|
localStorage: i.map((e, n) => {
|
|
2112
|
-
let { name: r, value: i } =
|
|
2113
|
-
if (typeof r != "string" || typeof i != "string") throw
|
|
2220
|
+
let { name: r, value: i } = Z(e) && Object.keys(e).every((e) => e === "name" || e === "value") ? e : {};
|
|
2221
|
+
if (typeof r != "string" || typeof i != "string") throw X(`${t}.localStorage[${n}]`, "must be { name, value } strings");
|
|
2114
2222
|
return {
|
|
2115
2223
|
name: r,
|
|
2116
2224
|
value: i
|
|
2117
2225
|
};
|
|
2118
2226
|
})
|
|
2119
2227
|
};
|
|
2120
|
-
},
|
|
2121
|
-
if (!
|
|
2228
|
+
}, Ur = (e) => {
|
|
2229
|
+
if (!Z(e)) throw X("", "must be an object { cookies?, origins? }");
|
|
2122
2230
|
let t = Object.keys(e).find((e) => e !== "cookies" && e !== "origins");
|
|
2123
|
-
if (t !== void 0) throw
|
|
2231
|
+
if (t !== void 0) throw X(`.${t}`, "is not a storageState key; it takes cookies and origins");
|
|
2124
2232
|
let { cookies: n = [], origins: r = [] } = e;
|
|
2125
|
-
if (!Array.isArray(n)) throw
|
|
2126
|
-
if (!Array.isArray(r)) throw
|
|
2127
|
-
let i = n.map((e, t) =>
|
|
2233
|
+
if (!Array.isArray(n)) throw X(".cookies", "must be an array");
|
|
2234
|
+
if (!Array.isArray(r)) throw X(".origins", "must be an array");
|
|
2235
|
+
let i = n.map((e, t) => Vr(e, `.cookies[${t}]`)), a = r.map((e, t) => Hr(e, `.origins[${t}]`));
|
|
2128
2236
|
return i.forEach(({ expires: e }, t) => {
|
|
2129
|
-
if (e !== void 0 && e > 0 && e <
|
|
2237
|
+
if (e !== void 0 && e > 0 && e < Ir) throw X(`.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`);
|
|
2130
2238
|
}), {
|
|
2131
2239
|
cookies: i,
|
|
2132
2240
|
origins: a
|
|
2133
2241
|
};
|
|
2134
|
-
},
|
|
2242
|
+
}, Wr = [
|
|
2135
2243
|
"persistent",
|
|
2136
2244
|
"ephemeral",
|
|
2137
2245
|
"native"
|
|
2138
|
-
],
|
|
2139
|
-
if ("syncCookies" in e) throw TypeError(
|
|
2246
|
+
], Gr = "attachFrame: syncCookies was replaced by cookies. true is cookies: 'persistent', or 'native' for the person's own browser cookies on the extension; false is cookies: 'ephemeral'", Kr = (e) => {
|
|
2247
|
+
if ("syncCookies" in e) throw TypeError(Gr);
|
|
2140
2248
|
let { cookies: t = "persistent" } = e;
|
|
2141
|
-
if (!
|
|
2142
|
-
if (e.storageState !== void 0 && t !== "ephemeral") throw TypeError(
|
|
2143
|
-
let n = e.storageState === void 0 ? void 0 :
|
|
2249
|
+
if (!Wr.includes(t)) throw TypeError(`attachFrame: cookies must be 'persistent', 'ephemeral' or 'native', not ${JSON.stringify(t)}`);
|
|
2250
|
+
if (e.storageState !== void 0 && t !== "ephemeral") throw TypeError(Fr);
|
|
2251
|
+
let n = e.storageState === void 0 ? void 0 : Ur(e.storageState), r = Mr(e);
|
|
2144
2252
|
if (r === "iframe" && e.lockdown && t !== "native") throw TypeError("attachFrame: lockdown runs on the extension, which serves only cookies: 'native'");
|
|
2145
2253
|
return n === void 0 ? {
|
|
2146
2254
|
kind: r,
|
|
@@ -2150,20 +2258,14 @@ var _r = 3e4, vr = `frame.evaluate: the code did not settle within ${_r}ms`, yr
|
|
|
2150
2258
|
cookies: t,
|
|
2151
2259
|
storageState: n
|
|
2152
2260
|
};
|
|
2153
|
-
},
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
} catch {
|
|
2157
|
-
return "";
|
|
2158
|
-
}
|
|
2159
|
-
}, Rr = "FKN_WEB_EXTENSION_ATTACH_FRAME_EVENT_KEY", zr = !1, Br = () => {
|
|
2160
|
-
zr || (zr = !0, console.warn("[fkn-frame] the installed FKN WebExtension is too old to ask for permission categories upfront, so each capability will be asked for as it is first used. Updating the extension fixes this."));
|
|
2161
|
-
}, Vr = "frame: this frame no longer holds the document the app attached it to", Hr = "frame.postMessage: '*' is not served on the extension yet, since this extension does not report the frame's origin; pass the page's origin as targetOrigin", Ur = () => {
|
|
2261
|
+
}, qr = "FKN_WEB_EXTENSION_ATTACH_FRAME_EVENT_KEY", Jr = !1, Yr = () => {
|
|
2262
|
+
Jr || (Jr = !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."));
|
|
2263
|
+
}, Xr = "frame: this frame no longer holds the document the app attached it to", Zr = "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", Qr = () => {
|
|
2162
2264
|
let e = E();
|
|
2163
2265
|
if (e.status === "ok" && e.abi >= 1) return;
|
|
2164
2266
|
let t = e.status === "absent" ? 0 : e.abi;
|
|
2165
2267
|
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.`);
|
|
2166
|
-
},
|
|
2268
|
+
}, Q = (e) => {
|
|
2167
2269
|
try {
|
|
2168
2270
|
return new URL(e, location.href).hostname;
|
|
2169
2271
|
} catch {
|
|
@@ -2172,91 +2274,160 @@ var _r = 3e4, vr = `frame.evaluate: the code did not settle within ${_r}ms`, yr
|
|
|
2172
2274
|
}, $ = () => {
|
|
2173
2275
|
let e = E();
|
|
2174
2276
|
return e.status === "absent" ? 0 : e.abi;
|
|
2175
|
-
},
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
if (J(e.src), jn({
|
|
2179
|
-
src: e.src,
|
|
2180
|
-
domains: t,
|
|
2181
|
-
lockdown: n
|
|
2182
|
-
}), ct("attachFrame", t), await O(), n && Ur(), !e.isConnected) throw Error("attachFrame: the iframe must be connected to the document before attaching");
|
|
2183
|
-
e.dispatchEvent(new CustomEvent(Rr, { detail: a }));
|
|
2184
|
-
let { executeLocator: o, highlightLocator: s, ensureLocatorPermission: c, requestCategories: l, evaluateFrame: u, goto: d } = await k.attachFrame({
|
|
2185
|
-
marker: a,
|
|
2186
|
-
domains: t,
|
|
2187
|
-
syncCookies: !0,
|
|
2188
|
-
lockdown: n
|
|
2189
|
-
}), f = new Set(p([...t, Wr(e.src)], { ipv6: !0 })), m = (e) => f.has(p([Lr(e)], { ipv6: !0 })[0] ?? ""), h = Xn({
|
|
2277
|
+
}, $r = "attachFrame: a blank page is served by the cloud render proxy only; call cloud.attachFrame", ei = "frame.addScriptTag: an extension frame does not run scripts through mirage yet; attach with cloud.attachFrame", ti = "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", ni = ({ executeLocator: e, highlightLocator: t, ensureLocatorPermission: n, requestCategories: r, evaluateFrame: i, goto: a }, { hosts: o, url: s, page: c, unreachable: l, documents: u, navigated: d }) => {
|
|
2278
|
+
let f = new Set(p(o, { ipv6: !0 })), m = (e) => f.has(p([ht(e)], { ipv6: !0 })[0] ?? "");
|
|
2279
|
+
return ar({
|
|
2190
2280
|
backend: "extension",
|
|
2191
2281
|
executor: {
|
|
2192
|
-
execute:
|
|
2193
|
-
highlight:
|
|
2282
|
+
execute: e,
|
|
2283
|
+
highlight: t
|
|
2194
2284
|
},
|
|
2195
|
-
gate: (e) =>
|
|
2196
|
-
requestPermissions: async (e) => (
|
|
2285
|
+
gate: (e) => n(e.parts, e.operation, e.args),
|
|
2286
|
+
requestPermissions: async (e) => (_r("frame.requestPermissions", e), await An(), r(e)),
|
|
2197
2287
|
evaluate: async (e, t) => {
|
|
2198
|
-
if (!
|
|
2288
|
+
if (!Re(E(), "evaluate")) {
|
|
2199
2289
|
let e = E();
|
|
2200
2290
|
throw new T("evaluate", e.status === "ok" ? e.abi : 0);
|
|
2201
2291
|
}
|
|
2202
|
-
return
|
|
2292
|
+
return i({
|
|
2203
2293
|
source: e,
|
|
2204
2294
|
arg: t
|
|
2205
2295
|
}).catch((e) => {
|
|
2206
|
-
throw
|
|
2296
|
+
throw kr(e);
|
|
2207
2297
|
});
|
|
2208
2298
|
},
|
|
2209
2299
|
addScriptTag: async () => {
|
|
2210
|
-
throw new T("addScriptTag", $(),
|
|
2300
|
+
throw new T("addScriptTag", $(), ei);
|
|
2211
2301
|
},
|
|
2212
2302
|
clearCookies: async () => {
|
|
2213
|
-
throw new T("clearCookies", $(),
|
|
2303
|
+
throw new T("clearCookies", $(), ti);
|
|
2214
2304
|
},
|
|
2215
|
-
postMessage: (t, n
|
|
2216
|
-
if (
|
|
2217
|
-
if (!m(
|
|
2218
|
-
let
|
|
2219
|
-
if (
|
|
2220
|
-
return
|
|
2305
|
+
postMessage: (e, t, n) => {
|
|
2306
|
+
if (t === "*") throw I(Zr, "postMessage", "extension");
|
|
2307
|
+
if (!m(t)) throw L(Xr, "postMessage");
|
|
2308
|
+
let r = l();
|
|
2309
|
+
if (r) throw r;
|
|
2310
|
+
return c().postMessage(e, t, n), Promise.resolve();
|
|
2221
2311
|
},
|
|
2222
|
-
listen: (
|
|
2223
|
-
let
|
|
2224
|
-
|
|
2312
|
+
listen: (e) => {
|
|
2313
|
+
let t = (t) => {
|
|
2314
|
+
t.source !== null && t.source === c() && !xr(t.data) && m(t.origin) && e({
|
|
2225
2315
|
type: "message",
|
|
2226
|
-
data:
|
|
2227
|
-
origin:
|
|
2228
|
-
ports:
|
|
2316
|
+
data: t.data,
|
|
2317
|
+
origin: t.origin,
|
|
2318
|
+
ports: t.ports
|
|
2229
2319
|
});
|
|
2230
|
-
}
|
|
2320
|
+
};
|
|
2321
|
+
window.addEventListener("message", t);
|
|
2322
|
+
let n = u(() => e({
|
|
2231
2323
|
type: "document",
|
|
2232
2324
|
origin: ""
|
|
2233
|
-
});
|
|
2234
|
-
return
|
|
2235
|
-
window.removeEventListener("message",
|
|
2325
|
+
}));
|
|
2326
|
+
return () => {
|
|
2327
|
+
window.removeEventListener("message", t), n();
|
|
2236
2328
|
};
|
|
2237
2329
|
},
|
|
2238
2330
|
goto: (e, { waitUntil: t, timeout: n, ...r } = {}) => {
|
|
2239
|
-
|
|
2240
|
-
for (let t of p([
|
|
2241
|
-
return d({
|
|
2331
|
+
j("frame.goto", [Q(e), ...r.domains ?? []]);
|
|
2332
|
+
for (let t of p([Q(e)], { ipv6: !0 })) f.add(t);
|
|
2333
|
+
return d?.(e), a({
|
|
2242
2334
|
url: e,
|
|
2243
2335
|
...r,
|
|
2244
2336
|
...t === void 0 ? {} : { waitUntil: t === "commit" ? "documentstart" : t },
|
|
2245
2337
|
...n === void 0 ? {} : { timeoutMs: n }
|
|
2246
2338
|
}).catch((e) => {
|
|
2247
|
-
throw
|
|
2339
|
+
throw jr(e);
|
|
2248
2340
|
});
|
|
2249
2341
|
},
|
|
2250
|
-
url:
|
|
2342
|
+
url: s
|
|
2343
|
+
});
|
|
2344
|
+
}, ri = async ({ iframe: e, domains: t = [], lockdown: n = !1, permissions: r, blank: i }) => {
|
|
2345
|
+
if (i !== void 0) throw new T("blank", $(), $r);
|
|
2346
|
+
let a = crypto.randomUUID();
|
|
2347
|
+
if (J(e.src), Bn({
|
|
2348
|
+
src: e.src,
|
|
2349
|
+
domains: t,
|
|
2350
|
+
lockdown: n
|
|
2351
|
+
}), j("attachFrame", t), await D(), n && Qr(), !e.isConnected) throw Error("attachFrame: the iframe must be connected to the document before attaching");
|
|
2352
|
+
e.dispatchEvent(new CustomEvent(qr, { detail: a }));
|
|
2353
|
+
let o = ni(await O.attachFrame({
|
|
2354
|
+
marker: a,
|
|
2355
|
+
domains: t,
|
|
2356
|
+
syncCookies: !0,
|
|
2357
|
+
lockdown: n
|
|
2358
|
+
}), {
|
|
2359
|
+
hosts: [...t, Q(e.src)],
|
|
2360
|
+
url: () => e.src,
|
|
2361
|
+
page: () => e.contentWindow,
|
|
2362
|
+
unreachable: () => e.contentWindow === null ? L("frame: navigate the frame before postMessage", "postMessage") : void 0,
|
|
2363
|
+
documents: (t) => (e.addEventListener("load", t), () => e.removeEventListener("load", t))
|
|
2364
|
+
});
|
|
2365
|
+
return r?.length && (kn() ? await o.requestPermissions(r) : Yr()), o;
|
|
2366
|
+
}, ii = "attachFrame: a window on cookies: 'native' needs the FKN WebExtension, which is not on this page", ai = "frame.postMessage: this window's page no longer keeps a link to the app's page, so a message cannot reach it", oi = "extension.attachFrame: the attached window closed; attach a fresh window", si = (e) => `attachFrame: cookies: '${e}' runs on the cloud render proxy; call cloud.attachFrame or the top-level attachFrame`, ci = async (e) => {
|
|
2367
|
+
let { domains: t = [], permissions: n } = e, { url: r, width: i, height: a } = Pr(e.window);
|
|
2368
|
+
j("attachFrame", t);
|
|
2369
|
+
let o = E();
|
|
2370
|
+
if (!Re(o, "attachWindow")) throw o.status === "absent" ? new T("attachWindow", 0, ii) : new T("attachWindow", o.abi);
|
|
2371
|
+
let s = window.open(r || "about:blank", "_blank", `popup,width=${i},height=${a}`);
|
|
2372
|
+
if (!s) throw new Gn();
|
|
2373
|
+
let c;
|
|
2374
|
+
try {
|
|
2375
|
+
c = await O.attachWindow({
|
|
2376
|
+
url: r,
|
|
2377
|
+
domains: t
|
|
2378
|
+
});
|
|
2379
|
+
} catch (e) {
|
|
2380
|
+
try {
|
|
2381
|
+
s.close();
|
|
2382
|
+
} catch {}
|
|
2383
|
+
throw e;
|
|
2384
|
+
}
|
|
2385
|
+
let l = new Promise((e) => window.addEventListener("pagehide", () => e(), { once: !0 })), u = !1, d = Promise.race([c.closed, l]).then(() => {
|
|
2386
|
+
u = !0;
|
|
2387
|
+
}, () => {
|
|
2388
|
+
u = !0;
|
|
2389
|
+
}), f = r, p = ni(c, {
|
|
2390
|
+
hosts: r ? [...t, Q(r)] : t,
|
|
2391
|
+
url: () => f,
|
|
2392
|
+
page: () => s,
|
|
2393
|
+
unreachable: () => u ? I(oi, "postMessage", "extension") : s.closed ? L(ai, "postMessage") : void 0,
|
|
2394
|
+
documents: (e) => {
|
|
2395
|
+
let t = !0;
|
|
2396
|
+
return (async () => {
|
|
2397
|
+
let n = await c.documentsAfter(-1);
|
|
2398
|
+
for (; t;) {
|
|
2399
|
+
let r = await c.documentsAfter(n);
|
|
2400
|
+
for (; t && n < r; n++) e();
|
|
2401
|
+
}
|
|
2402
|
+
})().catch(() => {}), () => {
|
|
2403
|
+
t = !1;
|
|
2404
|
+
};
|
|
2405
|
+
},
|
|
2406
|
+
navigated: (e) => {
|
|
2407
|
+
try {
|
|
2408
|
+
f = new URL(e, location.href).href;
|
|
2409
|
+
} catch {}
|
|
2410
|
+
}
|
|
2411
|
+
}), m, h = () => m ??= c.close().then(() => d, () => {}).then(() => {
|
|
2412
|
+
u = !0;
|
|
2413
|
+
try {
|
|
2414
|
+
s.close();
|
|
2415
|
+
} catch {}
|
|
2416
|
+
}), g = Object.assign(p, {
|
|
2417
|
+
close: h,
|
|
2418
|
+
closed: d
|
|
2251
2419
|
});
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2420
|
+
try {
|
|
2421
|
+
n?.length && await g.requestPermissions(n);
|
|
2422
|
+
} catch (e) {
|
|
2423
|
+
throw await h(), e;
|
|
2424
|
+
}
|
|
2425
|
+
return g;
|
|
2426
|
+
}, li = (async (e) => {
|
|
2427
|
+
let { kind: t, cookies: n } = Kr(e);
|
|
2428
|
+
if (n !== "native") throw new T("cookies", $(), si(n));
|
|
2429
|
+
return t === "window" ? ci(e) : ri(e);
|
|
2430
|
+
}), ui = "permissions.request: pass hosts, the sites the grant applies to", di = { request: async (e) => {
|
|
2260
2431
|
let t = e.map((e) => {
|
|
2261
2432
|
let { category: t, key: n, scope: r, reason: i, hosts: a } = e;
|
|
2262
2433
|
if (!("hosts" in e) && !("category" in e)) return { legacy: {
|
|
@@ -2265,17 +2436,17 @@ var _r = 3e4, vr = `frame.evaluate: the code did not settle within ${_r}ms`, yr
|
|
|
2265
2436
|
reason: i
|
|
2266
2437
|
} };
|
|
2267
2438
|
let o = p(a ?? [], { ipv6: !0 });
|
|
2268
|
-
if (!o.length) throw TypeError(
|
|
2269
|
-
return
|
|
2439
|
+
if (!o.length) throw TypeError(ui);
|
|
2440
|
+
return mt("permissions.request", o), { ask: {
|
|
2270
2441
|
category: t,
|
|
2271
2442
|
key: n,
|
|
2272
2443
|
reason: i,
|
|
2273
2444
|
hosts: o
|
|
2274
2445
|
} };
|
|
2275
2446
|
}), n = t.flatMap((e) => "ask" in e ? [e.ask] : []);
|
|
2276
|
-
|
|
2277
|
-
let { items: r, answer: i } =
|
|
2447
|
+
_r("permissions.request", n), n.length && await An();
|
|
2448
|
+
let { items: r, answer: i } = vr(n), a = t.flatMap((e) => "legacy" in e ? [e.legacy] : []), o = [...r, ...a], s = o.length ? await O.requestPermissions(o) : [], c = i(s.slice(0, r.length)), l = s.slice(r.length), u = 0, d = 0;
|
|
2278
2449
|
return t.map((e) => "ask" in e ? c[u++] : l[d++]);
|
|
2279
|
-
} },
|
|
2450
|
+
} }, fi = "PermissionDeniedError", pi = (e) => e instanceof Error ? e.name === fi : yr(e) && e.name === "PermissionDeniedError";
|
|
2280
2451
|
//#endregion
|
|
2281
|
-
export {
|
|
2452
|
+
export { Be as $, It as A, _t as B, zn as C, Rt as D, Mt as E, zt as F, rt as G, st as H, Pt as I, at as J, tt as K, vt as L, I as M, B as N, L as O, jt as P, qe as Q, bt as R, Bn as S, R as T, lt as U, gt as V, nt as W, Xe as X, k as Y, Je as Z, qn as _, li as a, T as at, Hn as b, jr as c, Le as ct, yr as d, _e as dt, Ve as et, _r as f, ve as ft, Gn as g, pr as h, qr as i, Oe as it, z as j, Nt as k, Er as l, De as lt, mr as m, S as mt, pi as n, Ue as nt, Kr as o, w as ot, fr as p, be as pt, ot as q, di as r, D as rt, Pr as s, ke as st, fi as t, E as tt, Or as u, ye as ut, Vn as v, Nn as w, J as x, ar as y, yt as z };
|