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