@fkn/lib 0.9.71 → 0.9.72
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-DFWaytT5.cjs → account-CZYGFU5m.cjs} +1 -1
- package/{account-DF9jsI5N.js → account-Czik26yc.js} +2 -2
- package/{account-generation-BsXJ6WWS.cjs → account-generation-BTxZWNQz.cjs} +1 -1
- package/{account-generation-C0BizGmy.js → account-generation-D2hoQYXp.js} +1 -1
- package/{account-storage-B7QBr9aX.cjs → account-storage-CIfiAHa1.cjs} +1 -1
- package/{account-storage-Jgp8ycMy.js → account-storage-DcbJCOvI.js} +2 -2
- package/account.cjs +1 -1
- package/account.js +1 -1
- package/{api-dxNQsC_v.js → api-e82hhULK.js} +116 -108
- package/api-oE2v5tpj.cjs +3 -0
- package/api.cjs +1 -1
- package/api.js +1 -1
- package/cloud/dgram.cjs +1 -1
- package/cloud/dgram.js +1 -1
- package/cloud/dns.cjs +1 -1
- package/cloud/dns.js +1 -1
- package/cloud/fetch.cjs +1 -1
- package/cloud/fetch.js +1 -1
- package/cloud/fs/promises.cjs +1 -1
- package/cloud/fs/promises.js +1 -1
- package/cloud/fs.cjs +1 -1
- package/cloud/fs.js +2 -2
- package/cloud/http.cjs +1 -1
- package/cloud/http.js +1 -1
- package/cloud/net.cjs +1 -1
- package/cloud/net.js +1 -1
- package/{cloud-pJ8R_Dmx.cjs → cloud-6ddOLS37.cjs} +1 -1
- package/{cloud-CyU_k-d9.js → cloud-BV96BYFR.js} +120 -120
- package/cloud.cjs +1 -1
- package/cloud.js +7 -7
- package/{dgram-B14T5Lqo.js → dgram-CTcHo7BL.js} +1 -1
- package/{dgram-BPXm8haL.cjs → dgram-wTKAuRI3.cjs} +1 -1
- package/dgram.cjs +1 -1
- package/dgram.js +1 -1
- package/{dns-BQkSttLP.js → dns-Cdmp7tw4.js} +1 -1
- package/{dns-DlTvtfVk.cjs → dns-OXiS-nXH.cjs} +1 -1
- package/dns.cjs +1 -1
- package/dns.js +1 -1
- package/{extension-Ce1wlb_F.js → extension-DlPOuZum.js} +9 -9
- package/{extension-veLhWipR.cjs → extension-eA0r72hp.cjs} +1 -1
- package/extension.cjs +1 -1
- package/extension.js +2 -2
- package/fs/promises.cjs +1 -1
- package/fs/promises.js +1 -1
- package/{fs-sR6cw1ay.js → fs-9LWii1mp.js} +3 -3
- package/{fs-DJ4wpfml.js → fs-BHfRf_xt.js} +1 -1
- package/{fs-DgPbKycT.cjs → fs-CLvS_YSq.cjs} +1 -1
- package/{fs-DxECe50Z.cjs → fs-CiZZf0ne.cjs} +1 -1
- package/fs.cjs +1 -1
- package/fs.js +2 -2
- package/{http-aUVH9bBn.js → http-Cg5aK6Jn.js} +1 -1
- package/{http-hIJh5XTX.cjs → http-KKqCypOh.cjs} +1 -1
- package/http.cjs +1 -1
- package/http.js +1 -1
- package/index.cjs +1 -1
- package/index.js +13 -13
- package/{lib-6lykV0aT.js → lib-B895LZTn.js} +514 -508
- package/lib-BJzKHh4X.cjs +53 -0
- package/{net-DVYOBov-.js → net-BUeelrnH.js} +1 -1
- package/{net-DUyZ7_3E.cjs → net-i4BzwpoN.cjs} +1 -1
- package/net.cjs +1 -1
- package/net.js +1 -1
- package/package.json +1 -1
- package/{packages-BTDKiQyC.cjs → packages-Bw1OE9Ra.cjs} +1 -1
- package/{packages-XWRhSAUe.js → packages-C27FhPmh.js} +1 -1
- package/packages.cjs +1 -1
- package/packages.js +1 -1
- package/proxy-BET3xNJw.js +81 -0
- package/proxy-khQQJbGw.cjs +1 -0
- package/{rooms-CZZfCZRv.cjs → rooms-C8FW4mDY.cjs} +1 -1
- package/{rooms-CYP8Bf6L.js → rooms-r09iUhIA.js} +1 -1
- package/rooms.cjs +1 -1
- package/rooms.js +1 -1
- package/{storage-DtynxQDJ.cjs → storage-BINUKDl1.cjs} +1 -1
- package/{storage-d61R3-P1.js → storage-CFk2AT4V.js} +3 -3
- package/storage.cjs +1 -1
- package/storage.js +1 -1
- package/api-b88Y1QDE.cjs +0 -3
- package/lib-C1OPIW6F.cjs +0 -53
- package/proxy-BOHZkjk-.js +0 -61
- package/proxy-vI5LhXLv.cjs +0 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-CGnMp29N.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { n as t, r as n } from "./proxy-BET3xNJw.js";
|
|
3
|
+
import { _ as r, a as i, d as a, f as o, g as s, h as c, i as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g, v as _, y as v } from "./hosts-HUfgMimI.js";
|
|
4
|
+
import { BoxBase as y, createTypedEventTarget as ee, expose as te, recursiveBox as ne, recursiveRevive as re } from "osra";
|
|
4
5
|
// ../web-extension/lib/lib/revivables/event-proxy.js
|
|
5
|
-
var
|
|
6
|
+
var b = (e, t) => {
|
|
6
7
|
let n = new EventTarget(), r = /* @__PURE__ */ new Map(), i = EventTarget.prototype.addEventListener.bind(n), a = EventTarget.prototype.removeEventListener.bind(n);
|
|
7
8
|
return Object.defineProperty(n, "addEventListener", {
|
|
8
9
|
configurable: !0,
|
|
@@ -34,12 +35,12 @@ var ne = (e, t) => {
|
|
|
34
35
|
o !== void 0 && (o.listeners.delete(n), !(o.listeners.size > 0) && (e.removeEventListener(t, o.forward), r.delete(t)));
|
|
35
36
|
}
|
|
36
37
|
}), n;
|
|
37
|
-
},
|
|
38
|
+
}, x = (e) => typeof e == "boolean" ? +!!e : +!!e?.capture, S = (e) => {
|
|
38
39
|
let t = /* @__PURE__ */ new WeakMap();
|
|
39
40
|
return {
|
|
40
41
|
addEventListener: (n, r, i) => {
|
|
41
42
|
if (r === null) return;
|
|
42
|
-
let a = `${n}|${
|
|
43
|
+
let a = `${n}|${x(i)}`, o = t.get(r);
|
|
43
44
|
if (o || (o = /* @__PURE__ */ new Map(), t.set(r, o)), o.has(a)) return;
|
|
44
45
|
let s = typeof i == "object" && !!i && !!i.once, c = (t) => {
|
|
45
46
|
s && o.delete(a);
|
|
@@ -50,18 +51,18 @@ var ne = (e, t) => {
|
|
|
50
51
|
},
|
|
51
52
|
removeEventListener: (n, r, i) => {
|
|
52
53
|
if (r === null) return;
|
|
53
|
-
let a = `${n}|${
|
|
54
|
+
let a = `${n}|${x(i)}`, o = t.get(r), s = o?.get(a);
|
|
54
55
|
s && (e.remoteEvents.removeEventListener(n, s, i), o.delete(a));
|
|
55
56
|
},
|
|
56
57
|
dispatchEvent: (t) => e.remoteEvents.dispatchEvent(t)
|
|
57
58
|
};
|
|
58
|
-
},
|
|
59
|
-
box: () =>
|
|
60
|
-
createVideoElementHandle: () =>
|
|
61
|
-
isType: () =>
|
|
62
|
-
revive: () =>
|
|
63
|
-
type: () =>
|
|
64
|
-
}),
|
|
59
|
+
}, ie = /* @__PURE__ */ e({
|
|
60
|
+
box: () => Se,
|
|
61
|
+
createVideoElementHandle: () => be,
|
|
62
|
+
isType: () => xe,
|
|
63
|
+
revive: () => Ce,
|
|
64
|
+
type: () => ae
|
|
65
|
+
}), ae = "videoElement", oe = [
|
|
65
66
|
"currentTime",
|
|
66
67
|
"volume",
|
|
67
68
|
"muted",
|
|
@@ -72,22 +73,22 @@ var ne = (e, t) => {
|
|
|
72
73
|
"preload",
|
|
73
74
|
"poster",
|
|
74
75
|
"disableRemotePlayback"
|
|
75
|
-
],
|
|
76
|
+
], se = [
|
|
76
77
|
"duration",
|
|
77
78
|
"paused",
|
|
78
79
|
"ended",
|
|
79
80
|
"seeking",
|
|
80
81
|
"readyState",
|
|
81
82
|
"currentSrc"
|
|
82
|
-
],
|
|
83
|
+
], ce = ["buffered", "seekable"], le = Symbol.for("fkn.remoteVideoElement"), ue = Symbol.for("fkn.remoteVideoElement.state"), de = Symbol.for("fkn.remoteVideoElement.controller"), fe = (e) => e ? Array.from({ length: e.length }, (t, n) => [e.start(n), e.end(n)]) : [], pe = (e) => {
|
|
83
84
|
let t = {};
|
|
84
|
-
for (let n of [...
|
|
85
|
-
for (let n of
|
|
85
|
+
for (let n of [...oe, ...se]) t[n] = e[n];
|
|
86
|
+
for (let n of ce) t[n] = fe(e[n]);
|
|
86
87
|
return t.error = e.error ? {
|
|
87
88
|
code: e.error.code,
|
|
88
89
|
message: e.error.message
|
|
89
90
|
} : null, t;
|
|
90
|
-
},
|
|
91
|
+
}, me = (e) => {
|
|
91
92
|
let t = (t) => {
|
|
92
93
|
if (!Number.isInteger(t) || t < 0 || t >= e.length) throw new DOMException("Index or size is negative or greater than the allowed amount", "IndexSizeError");
|
|
93
94
|
};
|
|
@@ -102,17 +103,17 @@ var ne = (e, t) => {
|
|
|
102
103
|
return t(n), e[n][1];
|
|
103
104
|
}
|
|
104
105
|
};
|
|
105
|
-
},
|
|
106
|
+
}, he = (e) => e ? {
|
|
106
107
|
code: e.code,
|
|
107
108
|
message: e.message,
|
|
108
109
|
MEDIA_ERR_ABORTED: 1,
|
|
109
110
|
MEDIA_ERR_NETWORK: 2,
|
|
110
111
|
MEDIA_ERR_DECODE: 3,
|
|
111
112
|
MEDIA_ERR_SRC_NOT_SUPPORTED: 4
|
|
112
|
-
} : null,
|
|
113
|
+
} : null, ge = (e) => b(e, (e, t) => ({
|
|
113
114
|
originalDetail: e instanceof CustomEvent ? e.detail : null,
|
|
114
|
-
snapshot:
|
|
115
|
-
})),
|
|
115
|
+
snapshot: pe(t)
|
|
116
|
+
})), _e = async (e, t) => {
|
|
116
117
|
switch (t) {
|
|
117
118
|
case "play": return await e.play(), null;
|
|
118
119
|
case "pause": return e.pause(), null;
|
|
@@ -127,19 +128,19 @@ var ne = (e, t) => {
|
|
|
127
128
|
}
|
|
128
129
|
default: throw Error(`videoElement: unknown method "${t}"`);
|
|
129
130
|
}
|
|
130
|
-
},
|
|
131
|
-
call: async (t) =>
|
|
131
|
+
}, ve = (e) => ({
|
|
132
|
+
call: async (t) => _e(e, t),
|
|
132
133
|
set: async (t, n) => {
|
|
133
134
|
try {
|
|
134
135
|
e[t] = n;
|
|
135
136
|
} catch {}
|
|
136
|
-
return
|
|
137
|
+
return pe(e);
|
|
137
138
|
},
|
|
138
|
-
events:
|
|
139
|
-
}),
|
|
139
|
+
events: ge(e)
|
|
140
|
+
}), ye = (e, t) => {
|
|
140
141
|
let n = new EventTarget();
|
|
141
|
-
Object.defineProperty(n,
|
|
142
|
-
let r =
|
|
142
|
+
Object.defineProperty(n, le, { value: !0 }), Object.defineProperty(n, ue, { value: e }), Object.defineProperty(n, de, { value: t });
|
|
143
|
+
let r = S({
|
|
143
144
|
target: n,
|
|
144
145
|
remoteEvents: t.events,
|
|
145
146
|
unenrich: (t, n) => {
|
|
@@ -174,7 +175,7 @@ var ne = (e, t) => {
|
|
|
174
175
|
configurable: !0,
|
|
175
176
|
enumerable: !0,
|
|
176
177
|
get() {
|
|
177
|
-
return
|
|
178
|
+
return he(e.error);
|
|
178
179
|
}
|
|
179
180
|
},
|
|
180
181
|
play: {
|
|
@@ -210,7 +211,7 @@ var ne = (e, t) => {
|
|
|
210
211
|
value: 4
|
|
211
212
|
}
|
|
212
213
|
};
|
|
213
|
-
for (let n of
|
|
214
|
+
for (let n of oe) i[n] = {
|
|
214
215
|
configurable: !0,
|
|
215
216
|
enumerable: !0,
|
|
216
217
|
get() {
|
|
@@ -222,67 +223,67 @@ var ne = (e, t) => {
|
|
|
222
223
|
}, () => {});
|
|
223
224
|
}
|
|
224
225
|
};
|
|
225
|
-
for (let t of
|
|
226
|
+
for (let t of se) i[t] = {
|
|
226
227
|
configurable: !0,
|
|
227
228
|
enumerable: !0,
|
|
228
229
|
get() {
|
|
229
230
|
return e[t];
|
|
230
231
|
}
|
|
231
232
|
};
|
|
232
|
-
for (let t of
|
|
233
|
+
for (let t of ce) i[t] = {
|
|
233
234
|
configurable: !0,
|
|
234
235
|
enumerable: !0,
|
|
235
236
|
get() {
|
|
236
|
-
return
|
|
237
|
+
return me(e[t]);
|
|
237
238
|
}
|
|
238
239
|
};
|
|
239
240
|
return Object.defineProperties(n, i), n;
|
|
240
|
-
},
|
|
241
|
+
}, be = (e) => ye(pe(e), ve(e)), xe = (e) => typeof e == "object" && !!e && e[le] === !0, Se = (e, t) => {
|
|
241
242
|
let n = e;
|
|
242
243
|
return {
|
|
243
|
-
...
|
|
244
|
-
type:
|
|
245
|
-
initialState: n[
|
|
246
|
-
controller:
|
|
244
|
+
...y,
|
|
245
|
+
type: ae,
|
|
246
|
+
initialState: n[ue],
|
|
247
|
+
controller: ne(n[de], t)
|
|
247
248
|
};
|
|
248
|
-
},
|
|
249
|
-
let n =
|
|
250
|
-
return
|
|
251
|
-
},
|
|
249
|
+
}, Ce = (e, t) => {
|
|
250
|
+
let n = re(e.controller, t);
|
|
251
|
+
return ye({ ...e.initialState }, n);
|
|
252
|
+
}, we = (e) => {
|
|
252
253
|
let t = [];
|
|
253
254
|
return e.forEach((e, n) => {
|
|
254
255
|
t.push([n, e]);
|
|
255
256
|
}), t;
|
|
256
|
-
},
|
|
257
|
-
type:
|
|
257
|
+
}, Te = "headers", Ee = {
|
|
258
|
+
type: Te,
|
|
258
259
|
isType: (e) => e instanceof Headers,
|
|
259
260
|
box: (e) => ({
|
|
260
|
-
...
|
|
261
|
-
type:
|
|
262
|
-
entries:
|
|
261
|
+
...y,
|
|
262
|
+
type: Te,
|
|
263
|
+
entries: we(e)
|
|
263
264
|
}),
|
|
264
265
|
revive: (e) => new Headers(e.entries)
|
|
265
|
-
},
|
|
266
|
+
}, De = "response", Oe = /* @__PURE__ */ new Set([
|
|
266
267
|
101,
|
|
267
268
|
204,
|
|
268
269
|
205,
|
|
269
270
|
304
|
|
270
|
-
]),
|
|
271
|
-
type:
|
|
271
|
+
]), ke = {
|
|
272
|
+
type: De,
|
|
272
273
|
isType: (e) => e instanceof Response,
|
|
273
274
|
box: (e, t) => ({
|
|
274
|
-
...
|
|
275
|
-
type:
|
|
275
|
+
...y,
|
|
276
|
+
type: De,
|
|
276
277
|
status: e.status,
|
|
277
278
|
statusText: e.statusText,
|
|
278
|
-
headers:
|
|
279
|
-
body: e.body ?
|
|
279
|
+
headers: Ee.box(e.headers),
|
|
280
|
+
body: e.body ? ne(e.body, t) : null,
|
|
280
281
|
url: e.url,
|
|
281
282
|
redirected: e.redirected
|
|
282
283
|
}),
|
|
283
284
|
revive: (e, t) => {
|
|
284
285
|
if (e.status === 0) return Response.error();
|
|
285
|
-
let n =
|
|
286
|
+
let n = Ee.revive(e.headers), r = e.body ? re(e.body, t) : null, i = Oe.has(e.status);
|
|
286
287
|
r && i && r.cancel().catch(() => {});
|
|
287
288
|
let a = new Response(i ? null : r, {
|
|
288
289
|
status: e.status,
|
|
@@ -297,22 +298,22 @@ var ne = (e, t) => {
|
|
|
297
298
|
configurable: !0
|
|
298
299
|
}), a;
|
|
299
300
|
}
|
|
300
|
-
},
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
301
|
+
}, Ae = (e) => [
|
|
302
|
+
ie,
|
|
303
|
+
Ee,
|
|
304
|
+
ke,
|
|
304
305
|
...e
|
|
305
|
-
],
|
|
306
|
+
], je = 5, Me = 0, Ne = "fknExtension", Pe = "fknExtensionAbi", Fe = "fknExtensionOps", Ie = [
|
|
306
307
|
"data-fkn-extension",
|
|
307
308
|
"data-fkn-extension-abi",
|
|
308
309
|
"data-fkn-extension-ops"
|
|
309
|
-
],
|
|
310
|
+
], Le = (e) => {
|
|
310
311
|
if (e === void 0) return 0;
|
|
311
312
|
let t = Number(e);
|
|
312
313
|
return Number.isInteger(t) && t >= 0 ? t : 0;
|
|
313
|
-
},
|
|
314
|
+
}, Re = (e) => e === void 0 ? null : e.split(",").map((e) => e.trim()).filter(Boolean), ze = (e, t = 0) => {
|
|
314
315
|
if (e.fknExtension !== "true") return { status: "absent" };
|
|
315
|
-
let n =
|
|
316
|
+
let n = Le(e[Pe]), r = Re(e[Fe]);
|
|
316
317
|
return n < t ? {
|
|
317
318
|
status: "outdated",
|
|
318
319
|
abi: n,
|
|
@@ -323,7 +324,7 @@ var ne = (e, t) => {
|
|
|
323
324
|
abi: n,
|
|
324
325
|
operations: r
|
|
325
326
|
};
|
|
326
|
-
},
|
|
327
|
+
}, Be = (e, t) => e.status === "ok" ? e.operations === null || e.operations.includes(t) : !1, Ve = (e, t) => e.status === "ok" && e.operations !== null && e.operations.includes(t), C = class extends Error {
|
|
327
328
|
abi;
|
|
328
329
|
required;
|
|
329
330
|
name = "ExtensionOutdatedError";
|
|
@@ -337,13 +338,13 @@ var ne = (e, t) => {
|
|
|
337
338
|
constructor(e, t, n) {
|
|
338
339
|
super(n ?? `The FKN WebExtension does not support "${e}" (ABI ${t}). Updating the extension may add it.`), this.operation = e, this.abi = t;
|
|
339
340
|
}
|
|
340
|
-
},
|
|
341
|
-
typeof document < "u" && document.addEventListener(
|
|
342
|
-
|
|
341
|
+
}, He = "FKN_WEB_EXTENSION_MAIN_WORLD_CONTENT_SCRIPT_ENABLED_EVENT_KEY", Ue = ee();
|
|
342
|
+
typeof document < "u" && document.addEventListener(He, () => {
|
|
343
|
+
Ue.dispatchEvent(new CustomEvent("statuschange", { detail: { enabled: We() } }));
|
|
343
344
|
});
|
|
344
|
-
var
|
|
345
|
-
|
|
346
|
-
},
|
|
345
|
+
var We = () => typeof document > "u" ? !1 : document.documentElement.dataset[Ne] === "true", T = () => typeof document > "u" ? { status: "absent" } : ze(document.documentElement.dataset), E = null, Ge = (e) => {
|
|
346
|
+
E = e;
|
|
347
|
+
}, D = (e = 2e3) => new Promise((t, n) => {
|
|
347
348
|
let r = () => T().status === "ok";
|
|
348
349
|
if (r()) return t();
|
|
349
350
|
let i = (e) => {
|
|
@@ -351,8 +352,8 @@ var He = () => typeof document > "u" ? !1 : document.documentElement.dataset[je]
|
|
|
351
352
|
}, a = () => i(async () => {
|
|
352
353
|
let e = T();
|
|
353
354
|
if (e.status === "outdated") return n(new C(e.abi, e.required));
|
|
354
|
-
if (
|
|
355
|
-
if (await
|
|
355
|
+
if (E) {
|
|
356
|
+
if (await E().catch(() => {}), r()) return t();
|
|
356
357
|
let e = T();
|
|
357
358
|
if (e.status === "outdated") return n(new C(e.abi, e.required));
|
|
358
359
|
}
|
|
@@ -362,32 +363,32 @@ var He = () => typeof document > "u" ? !1 : document.documentElement.dataset[je]
|
|
|
362
363
|
}), s = setTimeout(a, e);
|
|
363
364
|
o.observe(document.documentElement, {
|
|
364
365
|
attributes: !0,
|
|
365
|
-
attributeFilter: [...
|
|
366
|
+
attributeFilter: [...Ie]
|
|
366
367
|
});
|
|
367
|
-
}),
|
|
368
|
-
await
|
|
368
|
+
}), Ke, O = new Proxy({}, { get: (e, t) => async (...e) => {
|
|
369
|
+
await D(), Ke ??= te({}, {
|
|
369
370
|
transport: window,
|
|
370
|
-
revivableModules:
|
|
371
|
+
revivableModules: Ae
|
|
371
372
|
});
|
|
372
|
-
let n = (await
|
|
373
|
+
let n = (await Ke)[t];
|
|
373
374
|
return n(...e);
|
|
374
|
-
} }),
|
|
375
|
+
} }), k = [
|
|
375
376
|
"origin",
|
|
376
377
|
"referer",
|
|
377
378
|
"cookie"
|
|
378
|
-
],
|
|
379
|
-
if (t === "include" &&
|
|
380
|
-
},
|
|
379
|
+
], qe = (e, t) => (e ?? []).some(([e, n]) => e.trim().toLowerCase() === t && n !== ""), Je = (e) => qe(e, "cookie"), Ye = (e, t) => {
|
|
380
|
+
if (t === "include" && Je(e)) throw Error("fetch: a forged Cookie header and credentials:'include' are different identities - send one or the other");
|
|
381
|
+
}, Xe = (e, t) => {
|
|
381
382
|
if (!Array.isArray(t)) throw Error(`${e}: requestHeaders must be an array of header operations`);
|
|
382
383
|
let n = [...new Set(t.map((e) => {
|
|
383
384
|
let t = e?.header;
|
|
384
385
|
return typeof t == "string" ? t.trim().toLowerCase() : String(t);
|
|
385
|
-
}).filter((e) => !
|
|
386
|
+
}).filter((e) => !k.includes(e)))];
|
|
386
387
|
if (n.length) throw Error(`${e}: refusing to rewrite request header(s): ${n.join(", ")}`);
|
|
387
|
-
},
|
|
388
|
-
let t = [...new Set((e ?? []).map(([e]) => e.trim().toLowerCase()).filter((e) => !
|
|
388
|
+
}, Ze = (e) => {
|
|
389
|
+
let t = [...new Set((e ?? []).map(([e]) => e.trim().toLowerCase()).filter((e) => !k.includes(e)))];
|
|
389
390
|
if (t.length) throw Error(`fetch: refusing to forge request header(s): ${t.join(", ")}`);
|
|
390
|
-
},
|
|
391
|
+
}, Qe = /* @__PURE__ */ "fkn.app,fkn.dev,sdbx.app,horionsoftware.com,webvpn.dev,fknmail.app,clairv.app,fkn.cloudflareaccess.com,me-62e.workers.dev,62e9d4fbf21d90ebd4342e54b4babbd3.r2.cloudflarestorage.com,62e9d4fbf21d90ebd4342e54b4babbd3.eu.r2.cloudflarestorage.com,62e9d4fbf21d90ebd4342e54b4babbd3.fedramp.r2.cloudflarestorage.com,pub-8a3dc68041874c7e9c9a54bde972605a.r2.dev,pub-26b534eb9aa04cffbe1cdbb3be3fb1d2.r2.dev,pub-3d97d79220b94243812e60b0e742f2c5.r2.dev,pub-f8bd4876cc3c4b4a951715da5958e49c.r2.dev,web-b3z.pages.dev,fkn-console.pages.dev,dev-dms.pages.dev,fkn-www.pages.dev,fkn-homepage.pages.dev,fkn-sandbox.pages.dev,internal-3ar.pages.dev,stub-ben.pages.dev,ripple-3t3.pages.dev,media-player-e3s.pages.dev,youtube-3c4.pages.dev,horionsoftware.pages.dev,container-ckf.pages.dev,stub-plugin.pages.dev,social-3n2.pages.dev,plugins.banou.dev".split(","), $e = (e) => e.toLowerCase().replace(/\.+$/, ""), et = ["79.127.204.69", "152.233.49.59"], tt = (e) => {
|
|
391
392
|
let t;
|
|
392
393
|
try {
|
|
393
394
|
t = new URL(`http://${e.includes(":") && !e.startsWith("[") ? `[${e}]` : e}/`).hostname;
|
|
@@ -405,22 +406,22 @@ var He = () => typeof document > "u" ? !1 : document.documentElement.dataset[je]
|
|
|
405
406
|
].join(".");
|
|
406
407
|
}
|
|
407
408
|
return /^\d+\.\d+\.\d+\.\d+$/.test(t) ? t : void 0;
|
|
408
|
-
},
|
|
409
|
-
let t =
|
|
410
|
-
if (
|
|
411
|
-
let n =
|
|
412
|
-
return n !== void 0 &&
|
|
413
|
-
},
|
|
409
|
+
}, A = (e) => {
|
|
410
|
+
let t = $e(e);
|
|
411
|
+
if (Qe.some((e) => t === e || t.endsWith(`.${e}`))) return !0;
|
|
412
|
+
let n = tt(t);
|
|
413
|
+
return n !== void 0 && et.includes(n);
|
|
414
|
+
}, nt = 100, rt = (e) => [...e.trim()], j = (e, t) => {
|
|
414
415
|
if (typeof t != "string") return;
|
|
415
|
-
let n =
|
|
416
|
+
let n = rt(t).length;
|
|
416
417
|
if (n > 100) throw TypeError(`${e}: reason must be at most 100 characters, not ${n}`);
|
|
417
|
-
},
|
|
418
|
+
}, it = {
|
|
418
419
|
scope: "network.fetch",
|
|
419
420
|
category: "network",
|
|
420
421
|
severity: 0,
|
|
421
422
|
title: "Fetch data from other sites",
|
|
422
423
|
description: "Lets the app download public data from other websites directly, past the usual cross-origin limits."
|
|
423
|
-
},
|
|
424
|
+
}, at = {
|
|
424
425
|
scope: "network.fetchCredentialed",
|
|
425
426
|
category: "network",
|
|
426
427
|
severity: 3,
|
|
@@ -428,7 +429,7 @@ var He = () => typeof document > "u" ? !1 : document.documentElement.dataset[je]
|
|
|
428
429
|
unsafe: !0,
|
|
429
430
|
title: "Fetch from other sites, signed in as you",
|
|
430
431
|
description: "Lets the app fetch other sites using your logged-in session cookies, so it can read data only you should see."
|
|
431
|
-
},
|
|
432
|
+
}, ot = {
|
|
432
433
|
scope: "network.fetchLocal",
|
|
433
434
|
category: "network",
|
|
434
435
|
severity: 3,
|
|
@@ -436,12 +437,12 @@ var He = () => typeof document > "u" ? !1 : document.documentElement.dataset[je]
|
|
|
436
437
|
unsafe: !0,
|
|
437
438
|
title: "Access devices on your local network",
|
|
438
439
|
description: "Lets the app reach devices and services on your home or work network, which websites normally cannot touch."
|
|
439
|
-
},
|
|
440
|
+
}, st = (e) => {
|
|
440
441
|
let t = e.match(/^(\d+)\.(\d+)\.\d+\.\d+$/);
|
|
441
442
|
if (!t) return !1;
|
|
442
443
|
let [n, r] = [Number(t[1]), Number(t[2])];
|
|
443
444
|
return n === 10 || n === 127 || n === 0 || n === 169 && r === 254 || n === 172 && r >= 16 && r <= 31 || n === 192 && r === 168;
|
|
444
|
-
},
|
|
445
|
+
}, ct = (e) => {
|
|
445
446
|
let t;
|
|
446
447
|
try {
|
|
447
448
|
t = new URL(e);
|
|
@@ -449,58 +450,63 @@ var He = () => typeof document > "u" ? !1 : document.documentElement.dataset[je]
|
|
|
449
450
|
return !1;
|
|
450
451
|
}
|
|
451
452
|
let n = t.hostname.replace(/^\[|\]$/g, "").toLowerCase().replace(/\.$/, "");
|
|
452
|
-
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:") :
|
|
453
|
-
},
|
|
453
|
+
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:") : st(n);
|
|
454
|
+
}, lt = (e) => {
|
|
454
455
|
let t;
|
|
455
456
|
try {
|
|
456
457
|
t = new URL(e);
|
|
457
458
|
} catch {
|
|
458
459
|
return !1;
|
|
459
460
|
}
|
|
460
|
-
return t.protocol === "chrome-extension:" || t.protocol === "moz-extension:" ||
|
|
461
|
-
}, lt = (e) => {
|
|
462
|
-
if (ct(e)) throw Error("fetch: refusing to target the extension's own pages or FKN platform domains");
|
|
461
|
+
return t.protocol === "chrome-extension:" || t.protocol === "moz-extension:" || A(t.hostname);
|
|
463
462
|
}, ut = (e) => {
|
|
463
|
+
if (lt(e)) throw Error("fetch: refusing to target the extension's own pages or FKN platform domains");
|
|
464
|
+
}, dt = (e) => {
|
|
464
465
|
if (!e?.headers) return;
|
|
465
|
-
let t = new Headers(e.headers), n =
|
|
466
|
+
let t = new Headers(e.headers), n = k.map((e) => {
|
|
466
467
|
let n = t.get(e);
|
|
467
468
|
return n === null || n === "" ? void 0 : [e, n];
|
|
468
469
|
}).filter((e) => e !== void 0);
|
|
469
470
|
return n.length ? n : void 0;
|
|
470
|
-
},
|
|
471
|
-
|
|
472
|
-
let
|
|
473
|
-
|
|
474
|
-
let
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
}
|
|
487
|
-
|
|
471
|
+
}, ft = async (e, r) => {
|
|
472
|
+
j("fetch", r?.reason);
|
|
473
|
+
let i = new Request(e, r);
|
|
474
|
+
ut(i.url);
|
|
475
|
+
let a = i.body ? await i.arrayBuffer() : null, { signal: o, release: s } = t(r?.signal);
|
|
476
|
+
try {
|
|
477
|
+
let e = await O.proxyFetch({
|
|
478
|
+
url: i.url,
|
|
479
|
+
method: i.method,
|
|
480
|
+
headers: [...i.headers],
|
|
481
|
+
body: a,
|
|
482
|
+
credentials: r?.credentials === "include" ? "include" : "omit",
|
|
483
|
+
redirect: i.redirect,
|
|
484
|
+
unsafeHeaders: dt(r),
|
|
485
|
+
reason: r?.reason,
|
|
486
|
+
signal: o
|
|
487
|
+
});
|
|
488
|
+
return n(e, s);
|
|
489
|
+
} catch (e) {
|
|
490
|
+
throw s(), e;
|
|
491
|
+
}
|
|
488
492
|
}, pt = (e) => {
|
|
489
|
-
let t
|
|
490
|
-
return t !== "" && (k(t) || [...Ze, ...$e].some((e) => e.endsWith(`.${t}`)));
|
|
493
|
+
for (let t of e) if (typeof t == "string" && A(t.trim().toLowerCase())) return t;
|
|
491
494
|
}, mt = (e) => {
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
495
|
+
let t = e.trim().toLowerCase().replace(/^\.+|\.+$/g, "");
|
|
496
|
+
return t !== "" && (A(t) || [...Qe, ...et].some((e) => e.endsWith(`.${t}`)));
|
|
497
|
+
}, ht = (e) => {
|
|
498
|
+
for (let t of e) if (typeof t == "string" && mt(t)) return t;
|
|
499
|
+
}, gt = (e) => `${e}: refusing to target FKN platform domains`, _t = (e, t) => {
|
|
500
|
+
if (pt(t) !== void 0) throw Error(gt(e));
|
|
501
|
+
}, vt = (e) => {
|
|
496
502
|
try {
|
|
497
503
|
return new URL(String(e)).hostname;
|
|
498
504
|
} catch {
|
|
499
505
|
return "";
|
|
500
506
|
}
|
|
501
|
-
},
|
|
502
|
-
if (
|
|
503
|
-
},
|
|
507
|
+
}, M = (e, t) => {
|
|
508
|
+
if (ht(t) !== void 0) throw Error(gt(e));
|
|
509
|
+
}, yt = {
|
|
504
510
|
scope: "network.readCookie",
|
|
505
511
|
category: "network",
|
|
506
512
|
severity: 3,
|
|
@@ -508,7 +514,7 @@ var He = () => typeof document > "u" ? !1 : document.documentElement.dataset[je]
|
|
|
508
514
|
unsafe: !0,
|
|
509
515
|
title: "Read a site’s cookie",
|
|
510
516
|
description: "Lets the app read a named cookie from another site, which can include the login token only that site should see."
|
|
511
|
-
},
|
|
517
|
+
}, bt = { get: async (e) => (_t("cookies.get", [vt(e.url)]), O.getCookie(e)) }, xt = {
|
|
512
518
|
scope: "network.modifyRequestHeaders",
|
|
513
519
|
category: "network",
|
|
514
520
|
severity: 2,
|
|
@@ -516,7 +522,7 @@ var He = () => typeof document > "u" ? !1 : document.documentElement.dataset[je]
|
|
|
516
522
|
unsafe: !0,
|
|
517
523
|
title: "Rewrite request headers to other sites",
|
|
518
524
|
description: "Lets the app set or remove headers (like Origin and Referer) on this page’s own requests to the listed sites."
|
|
519
|
-
},
|
|
525
|
+
}, St = async (e) => (M("setRequestHeaderRule", e.domains), Xe("setRequestHeaderRule", e.requestHeaders), j("setRequestHeaderRule", e.reason), O.setRequestHeaderRule(e)), Ct = (e) => O.removeRequestHeaderRule({ ruleId: e }), wt = class extends Error {
|
|
520
526
|
reason;
|
|
521
527
|
filename;
|
|
522
528
|
line;
|
|
@@ -525,18 +531,18 @@ var He = () => typeof document > "u" ? !1 : document.documentElement.dataset[je]
|
|
|
525
531
|
constructor(e, t, n, r, i) {
|
|
526
532
|
super(`${e}:${n}:${r}: ${t}`), this.reason = t, this.filename = e, this.line = n, this.column = r, this.source = i;
|
|
527
533
|
}
|
|
528
|
-
},
|
|
534
|
+
}, Tt = class {
|
|
529
535
|
start;
|
|
530
536
|
end;
|
|
531
537
|
source;
|
|
532
538
|
constructor(e, t, n) {
|
|
533
539
|
this.start = e, this.end = t, this.source = n;
|
|
534
540
|
}
|
|
535
|
-
},
|
|
541
|
+
}, N;
|
|
536
542
|
(function(e) {
|
|
537
543
|
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";
|
|
538
|
-
})(
|
|
539
|
-
var
|
|
544
|
+
})(N ||= {});
|
|
545
|
+
var Et = (e, t, n) => {
|
|
540
546
|
let r = n, i = 1e4;
|
|
541
547
|
do {
|
|
542
548
|
let n = t.map((t) => e.indexOf(t, r));
|
|
@@ -548,7 +554,7 @@ var Tt = (e, t, n) => {
|
|
|
548
554
|
r = o + 2, i--;
|
|
549
555
|
} while (i > 0);
|
|
550
556
|
throw Error("Too many escaping");
|
|
551
|
-
},
|
|
557
|
+
}, P = (e, t, n) => {
|
|
552
558
|
let r = n, i = 1e4;
|
|
553
559
|
do {
|
|
554
560
|
let n = t.map((t) => e.indexOf(t, r));
|
|
@@ -562,21 +568,21 @@ var Tt = (e, t, n) => {
|
|
|
562
568
|
break;
|
|
563
569
|
case "(":
|
|
564
570
|
{
|
|
565
|
-
let t =
|
|
571
|
+
let t = P(e, [")"], o + 1);
|
|
566
572
|
if (t === -1) return -1;
|
|
567
573
|
r = t + 1;
|
|
568
574
|
}
|
|
569
575
|
break;
|
|
570
576
|
case "\"":
|
|
571
577
|
{
|
|
572
|
-
let t =
|
|
578
|
+
let t = Et(e, ["\""], o + 1);
|
|
573
579
|
if (t === -1) return -1;
|
|
574
580
|
r = t + 1;
|
|
575
581
|
}
|
|
576
582
|
break;
|
|
577
583
|
case "'":
|
|
578
584
|
{
|
|
579
|
-
let t =
|
|
585
|
+
let t = Et(e, ["'"], o + 1);
|
|
580
586
|
if (t === -1) return -1;
|
|
581
587
|
r = t + 1;
|
|
582
588
|
}
|
|
@@ -586,17 +592,17 @@ var Tt = (e, t, n) => {
|
|
|
586
592
|
i--;
|
|
587
593
|
} while (i > 0);
|
|
588
594
|
throw Error("Too many escaping");
|
|
589
|
-
},
|
|
590
|
-
function
|
|
595
|
+
}, Dt = /\/\*[^]*?(?:\*\/|$)/g;
|
|
596
|
+
function F(e) {
|
|
591
597
|
return e ? e.trim() : "";
|
|
592
598
|
}
|
|
593
|
-
function
|
|
599
|
+
function Ot(e, t) {
|
|
594
600
|
let n = e && typeof e.type == "string", r = n ? e : t;
|
|
595
601
|
for (let t in e) {
|
|
596
602
|
let n = e[t];
|
|
597
603
|
Array.isArray(n) ? n.forEach((e) => {
|
|
598
|
-
|
|
599
|
-
}) : n && typeof n == "object" &&
|
|
604
|
+
Ot(e, r);
|
|
605
|
+
}) : n && typeof n == "object" && Ot(n, r);
|
|
600
606
|
}
|
|
601
607
|
return n && Object.defineProperty(e, "parent", {
|
|
602
608
|
configurable: !0,
|
|
@@ -605,7 +611,7 @@ function Dt(e, t) {
|
|
|
605
611
|
value: t || null
|
|
606
612
|
}), e;
|
|
607
613
|
}
|
|
608
|
-
var
|
|
614
|
+
var kt = class {
|
|
609
615
|
level = 0;
|
|
610
616
|
indentation = " ";
|
|
611
617
|
compress = !1;
|
|
@@ -620,33 +626,33 @@ var Ot = class {
|
|
|
620
626
|
}
|
|
621
627
|
visit(e) {
|
|
622
628
|
switch (e.type) {
|
|
623
|
-
case
|
|
624
|
-
case
|
|
625
|
-
case
|
|
626
|
-
case
|
|
627
|
-
case
|
|
628
|
-
case
|
|
629
|
-
case
|
|
630
|
-
case
|
|
631
|
-
case
|
|
632
|
-
case
|
|
633
|
-
case
|
|
634
|
-
case
|
|
635
|
-
case
|
|
636
|
-
case
|
|
637
|
-
case
|
|
638
|
-
case
|
|
639
|
-
case
|
|
640
|
-
case
|
|
641
|
-
case
|
|
642
|
-
case
|
|
643
|
-
case
|
|
644
|
-
case
|
|
645
|
-
case
|
|
646
|
-
case
|
|
647
|
-
case
|
|
648
|
-
case
|
|
649
|
-
case
|
|
629
|
+
case N.stylesheet: return this.stylesheet(e);
|
|
630
|
+
case N.rule: return this.rule(e);
|
|
631
|
+
case N.declaration: return this.declaration(e);
|
|
632
|
+
case N.comment: return this.comment(e);
|
|
633
|
+
case N.container: return this.container(e);
|
|
634
|
+
case N.charset: return this.charset(e);
|
|
635
|
+
case N.counterStyle: return this.counterStyle(e);
|
|
636
|
+
case N.document: return this.document(e);
|
|
637
|
+
case N.customMedia: return this.customMedia(e);
|
|
638
|
+
case N.fontFace: return this.fontFace(e);
|
|
639
|
+
case N.fontFeatureValues: return this.fontFeatureValues(e);
|
|
640
|
+
case N.host: return this.host(e);
|
|
641
|
+
case N.import: return this.import(e);
|
|
642
|
+
case N.keyframes: return this.keyframes(e);
|
|
643
|
+
case N.keyframe: return this.keyframe(e);
|
|
644
|
+
case N.layer: return this.layer(e);
|
|
645
|
+
case N.media: return this.media(e);
|
|
646
|
+
case N.namespace: return this.namespace(e);
|
|
647
|
+
case N.page: return this.page(e);
|
|
648
|
+
case N.pageMarginBox: return this.pageMarginBox(e);
|
|
649
|
+
case N.positionTry: return this.positionTry(e);
|
|
650
|
+
case N.property: return this.property(e);
|
|
651
|
+
case N.scope: return this.scope(e);
|
|
652
|
+
case N.startingStyle: return this.startingStyle(e);
|
|
653
|
+
case N.supports: return this.supports(e);
|
|
654
|
+
case N.viewTransition: return this.viewTransition(e);
|
|
655
|
+
case N.atRule: return this.genericAtRule(e);
|
|
650
656
|
}
|
|
651
657
|
}
|
|
652
658
|
mapVisit(e, t) {
|
|
@@ -742,7 +748,7 @@ var Ot = class {
|
|
|
742
748
|
let t = e.prelude ? ` ${e.prelude}` : "";
|
|
743
749
|
if (this.compress) return this.emit(`@${e.name}${t}`, e.position) + (e.rules ? this.emit("{") + this.mapVisit(e.rules) + this.emit("}") : ";");
|
|
744
750
|
if (!e.rules) return this.emit(`${this.indent()}@${e.name}${t};`, e.position);
|
|
745
|
-
let n = e.rules.some((e) => e.type !==
|
|
751
|
+
let n = e.rules.some((e) => e.type !== N.declaration && e.type !== N.comment), r = n ? "\n\n" : "\n";
|
|
746
752
|
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()}}`);
|
|
747
753
|
}
|
|
748
754
|
rule(e) {
|
|
@@ -755,7 +761,7 @@ var Ot = class {
|
|
|
755
761
|
declaration(e) {
|
|
756
762
|
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(";");
|
|
757
763
|
}
|
|
758
|
-
},
|
|
764
|
+
}, At = (e, t) => {
|
|
759
765
|
t ||= {};
|
|
760
766
|
let n = 1, r = 1;
|
|
761
767
|
function i() {
|
|
@@ -763,14 +769,14 @@ var Ot = class {
|
|
|
763
769
|
line: n,
|
|
764
770
|
column: r
|
|
765
771
|
};
|
|
766
|
-
return (i) => (i.position = new
|
|
772
|
+
return (i) => (i.position = new Tt(e, {
|
|
767
773
|
line: n,
|
|
768
774
|
column: r
|
|
769
775
|
}, t?.source || ""), u(), i);
|
|
770
776
|
}
|
|
771
777
|
let a = [];
|
|
772
778
|
function o(i) {
|
|
773
|
-
let o = new
|
|
779
|
+
let o = new wt(t?.source || "", i, n, r, e);
|
|
774
780
|
if (!t?.silent) throw o;
|
|
775
781
|
a.push(o);
|
|
776
782
|
}
|
|
@@ -806,36 +812,36 @@ var Ot = class {
|
|
|
806
812
|
if (e.charAt(0) !== "/" || e.charAt(1) !== "*") return;
|
|
807
813
|
let n = /^\/\*[^]*?\*\//.exec(e);
|
|
808
814
|
return n ? (l(n), t({
|
|
809
|
-
type:
|
|
815
|
+
type: N.comment,
|
|
810
816
|
comment: n[0].slice(2, -2)
|
|
811
817
|
})) : o("End of comment missing");
|
|
812
818
|
}
|
|
813
819
|
function p() {
|
|
814
|
-
let t =
|
|
820
|
+
let t = P(e, ["{"]);
|
|
815
821
|
if (t === -1 || t === 0) return;
|
|
816
822
|
let n = e.substring(0, t);
|
|
817
823
|
return l([n]), ((e, t) => {
|
|
818
824
|
let n = [], r = 0;
|
|
819
825
|
for (; r < e.length;) {
|
|
820
|
-
let i =
|
|
826
|
+
let i = P(e, t, r);
|
|
821
827
|
if (i === -1) return n.push(e.substring(r)), n;
|
|
822
828
|
n.push(e.substring(r, i)), r = i + 1;
|
|
823
829
|
}
|
|
824
830
|
return n;
|
|
825
|
-
})(
|
|
831
|
+
})(F(n).replace(Dt, ""), [","]).map((e) => F(e));
|
|
826
832
|
}
|
|
827
833
|
function m() {
|
|
828
834
|
let t = i(), n = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/.exec(e);
|
|
829
835
|
if (!n) return;
|
|
830
836
|
l(n);
|
|
831
|
-
let r =
|
|
837
|
+
let r = F(n[0]), a = /^:\s*/.exec(e);
|
|
832
838
|
if (!a) return o("property missing ':'");
|
|
833
839
|
l(a);
|
|
834
|
-
let s = "", c =
|
|
835
|
-
c !== -1 && (s = e.substring(0, c), l([s]), s =
|
|
840
|
+
let s = "", c = P(e, [";", "}"]);
|
|
841
|
+
c !== -1 && (s = e.substring(0, c), l([s]), s = F(s).replace(Dt, ""));
|
|
836
842
|
let u = t({
|
|
837
|
-
type:
|
|
838
|
-
property: r.replace(
|
|
843
|
+
type: N.declaration,
|
|
844
|
+
property: r.replace(Dt, ""),
|
|
839
845
|
value: s
|
|
840
846
|
}), d = /^[;\s]*/.exec(e);
|
|
841
847
|
return d && l(d), u;
|
|
@@ -854,9 +860,9 @@ var Ot = class {
|
|
|
854
860
|
return c() ? n : o("missing '}'");
|
|
855
861
|
}
|
|
856
862
|
function g() {
|
|
857
|
-
let t =
|
|
863
|
+
let t = P(e, ["{"]);
|
|
858
864
|
if (t === -1) return !1;
|
|
859
|
-
let n =
|
|
865
|
+
let n = P(e, [";"]), r = P(e, ["}"]);
|
|
860
866
|
return !(n !== -1 && n < t) && !(r !== -1 && r < t);
|
|
861
867
|
}
|
|
862
868
|
function _() {
|
|
@@ -933,7 +939,7 @@ var Ot = class {
|
|
|
933
939
|
i && l(i), r = /^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/.exec(e);
|
|
934
940
|
}
|
|
935
941
|
if (t.length) return n({
|
|
936
|
-
type:
|
|
942
|
+
type: N.keyframe,
|
|
937
943
|
values: t,
|
|
938
944
|
declarations: h() || []
|
|
939
945
|
});
|
|
@@ -959,7 +965,7 @@ var Ot = class {
|
|
|
959
965
|
let f = d(), p = y();
|
|
960
966
|
for (; p;) f.push(p), f = f.concat(d()), p = y();
|
|
961
967
|
return c() ? t({
|
|
962
|
-
type:
|
|
968
|
+
type: N.keyframes,
|
|
963
969
|
name: u,
|
|
964
970
|
vendor: r,
|
|
965
971
|
keyframes: f
|
|
@@ -967,11 +973,11 @@ var Ot = class {
|
|
|
967
973
|
}() || function() {
|
|
968
974
|
let t = i(), n = /^@media *([^{]+)/.exec(e);
|
|
969
975
|
if (!n) return;
|
|
970
|
-
let r =
|
|
976
|
+
let r = F(l(n)[1]);
|
|
971
977
|
if (!s()) return o("@media missing '{'");
|
|
972
978
|
let a = v();
|
|
973
979
|
return c() ? t({
|
|
974
|
-
type:
|
|
980
|
+
type: N.media,
|
|
975
981
|
media: r,
|
|
976
982
|
rules: a
|
|
977
983
|
}) : o("@media missing '}'");
|
|
@@ -980,29 +986,29 @@ var Ot = class {
|
|
|
980
986
|
if (!n) return;
|
|
981
987
|
let r = l(n);
|
|
982
988
|
return t({
|
|
983
|
-
type:
|
|
984
|
-
name:
|
|
985
|
-
media:
|
|
989
|
+
type: N.customMedia,
|
|
990
|
+
name: F(r[1]),
|
|
991
|
+
media: F(r[2])
|
|
986
992
|
});
|
|
987
993
|
}() || function() {
|
|
988
994
|
let t = i(), n = /^@supports *([^{]+)/.exec(e);
|
|
989
995
|
if (!n) return;
|
|
990
|
-
let r =
|
|
996
|
+
let r = F(l(n)[1]);
|
|
991
997
|
if (!s()) return o("@supports missing '{'");
|
|
992
998
|
let a = v();
|
|
993
999
|
return c() ? t({
|
|
994
|
-
type:
|
|
1000
|
+
type: N.supports,
|
|
995
1001
|
supports: r,
|
|
996
1002
|
rules: a
|
|
997
1003
|
}) : o("@supports missing '}'");
|
|
998
1004
|
}() || te() || ne() || re() || function() {
|
|
999
1005
|
let t = i(), n = /^@([-\w]+)?document *([^{]+)/.exec(e);
|
|
1000
1006
|
if (!n) return;
|
|
1001
|
-
let r = l(n), a =
|
|
1007
|
+
let r = l(n), a = F(r[1]), u = F(r[2]);
|
|
1002
1008
|
if (!s()) return o("@document missing '{'");
|
|
1003
1009
|
let d = v();
|
|
1004
1010
|
return c() ? t({
|
|
1005
|
-
type:
|
|
1011
|
+
type: N.document,
|
|
1006
1012
|
document: u,
|
|
1007
1013
|
vendor: a,
|
|
1008
1014
|
rules: d
|
|
@@ -1027,7 +1033,7 @@ var Ot = class {
|
|
|
1027
1033
|
a.push(t), d(a);
|
|
1028
1034
|
}
|
|
1029
1035
|
return c() ? t({
|
|
1030
|
-
type:
|
|
1036
|
+
type: N.page,
|
|
1031
1037
|
selectors: r,
|
|
1032
1038
|
declarations: a
|
|
1033
1039
|
}) : o("@page missing '}'");
|
|
@@ -1037,7 +1043,7 @@ var Ot = class {
|
|
|
1037
1043
|
if (l(n), !s()) return o("@host missing '{'");
|
|
1038
1044
|
let r = v();
|
|
1039
1045
|
return c() ? t({
|
|
1040
|
-
type:
|
|
1046
|
+
type: N.host,
|
|
1041
1047
|
rules: r
|
|
1042
1048
|
}) : o("@host missing '}'");
|
|
1043
1049
|
}() || function() {
|
|
@@ -1047,28 +1053,28 @@ var Ot = class {
|
|
|
1047
1053
|
let r = d(), a = m();
|
|
1048
1054
|
for (; a;) r.push(a), r = r.concat(d()), a = m();
|
|
1049
1055
|
return c() ? t({
|
|
1050
|
-
type:
|
|
1056
|
+
type: N.fontFace,
|
|
1051
1057
|
declarations: r
|
|
1052
1058
|
}) : o("@font-face missing '}'");
|
|
1053
1059
|
}() || function() {
|
|
1054
1060
|
let t = i(), n = /^@font-feature-values\s+([^{]+)/.exec(e);
|
|
1055
1061
|
if (!n) return;
|
|
1056
|
-
let r =
|
|
1062
|
+
let r = F(l(n)[1]);
|
|
1057
1063
|
if (!s()) return o("@font-feature-values missing '{'");
|
|
1058
1064
|
let a = v();
|
|
1059
1065
|
return c() ? t({
|
|
1060
|
-
type:
|
|
1066
|
+
type: N.fontFeatureValues,
|
|
1061
1067
|
fontFamily: r,
|
|
1062
1068
|
rules: a
|
|
1063
1069
|
}) : o("@font-feature-values missing '}'");
|
|
1064
1070
|
}() || function() {
|
|
1065
1071
|
let t = i(), n = /^@container *([^{]+)/.exec(e);
|
|
1066
1072
|
if (!n) return;
|
|
1067
|
-
let r =
|
|
1073
|
+
let r = F(l(n)[1]);
|
|
1068
1074
|
if (!s()) return o("@container missing '{'");
|
|
1069
1075
|
let a = v();
|
|
1070
1076
|
return c() ? t({
|
|
1071
|
-
type:
|
|
1077
|
+
type: N.container,
|
|
1072
1078
|
container: r,
|
|
1073
1079
|
rules: a
|
|
1074
1080
|
}) : o("@container missing '}'");
|
|
@@ -1078,23 +1084,23 @@ var Ot = class {
|
|
|
1078
1084
|
if (l(n), !s()) return o("@starting-style missing '{'");
|
|
1079
1085
|
let r = v();
|
|
1080
1086
|
return c() ? t({
|
|
1081
|
-
type:
|
|
1087
|
+
type: N.startingStyle,
|
|
1082
1088
|
rules: r
|
|
1083
1089
|
}) : o("@starting-style missing '}'");
|
|
1084
1090
|
}() || function() {
|
|
1085
1091
|
let t = i(), n = /^@layer *([^{;@]+)/.exec(e);
|
|
1086
1092
|
if (!n) return;
|
|
1087
|
-
let r =
|
|
1093
|
+
let r = F(l(n)[1]);
|
|
1088
1094
|
if (!s()) {
|
|
1089
1095
|
let n = /^[;\s]*/.exec(e);
|
|
1090
1096
|
return n && l(n), t({
|
|
1091
|
-
type:
|
|
1097
|
+
type: N.layer,
|
|
1092
1098
|
layer: r
|
|
1093
1099
|
});
|
|
1094
1100
|
}
|
|
1095
1101
|
let a = v();
|
|
1096
1102
|
return c() ? t({
|
|
1097
|
-
type:
|
|
1103
|
+
type: N.layer,
|
|
1098
1104
|
layer: r,
|
|
1099
1105
|
rules: a
|
|
1100
1106
|
}) : o("@layer missing '}'");
|
|
@@ -1106,7 +1112,7 @@ var Ot = class {
|
|
|
1106
1112
|
let a = d(), u = m();
|
|
1107
1113
|
for (; u;) a.push(u), a = a.concat(d()), u = m();
|
|
1108
1114
|
return c() ? t({
|
|
1109
|
-
type:
|
|
1115
|
+
type: N.property,
|
|
1110
1116
|
name: r,
|
|
1111
1117
|
declarations: a
|
|
1112
1118
|
}) : o("@property missing '}'");
|
|
@@ -1118,18 +1124,18 @@ var Ot = class {
|
|
|
1118
1124
|
let a = d(), u = m();
|
|
1119
1125
|
for (; u;) a.push(u), a = a.concat(d()), u = m();
|
|
1120
1126
|
return c() ? t({
|
|
1121
|
-
type:
|
|
1127
|
+
type: N.counterStyle,
|
|
1122
1128
|
name: r,
|
|
1123
1129
|
declarations: a
|
|
1124
1130
|
}) : o("@counter-style missing '}'");
|
|
1125
1131
|
}() || function() {
|
|
1126
1132
|
let t = i(), n = /^@scope\s*([^{]*)/.exec(e);
|
|
1127
1133
|
if (!n) return;
|
|
1128
|
-
let r =
|
|
1134
|
+
let r = F(l(n)[1]);
|
|
1129
1135
|
if (!s()) return o("@scope missing '{'");
|
|
1130
1136
|
let a = v();
|
|
1131
1137
|
return c() ? t({
|
|
1132
|
-
type:
|
|
1138
|
+
type: N.scope,
|
|
1133
1139
|
scope: r,
|
|
1134
1140
|
rules: a
|
|
1135
1141
|
}) : o("@scope missing '}'");
|
|
@@ -1140,7 +1146,7 @@ var Ot = class {
|
|
|
1140
1146
|
let r = d(), a = m();
|
|
1141
1147
|
for (; a;) r.push(a), r = r.concat(d()), a = m();
|
|
1142
1148
|
return c() ? t({
|
|
1143
|
-
type:
|
|
1149
|
+
type: N.viewTransition,
|
|
1144
1150
|
declarations: r
|
|
1145
1151
|
}) : o("@view-transition missing '}'");
|
|
1146
1152
|
}() || function() {
|
|
@@ -1151,7 +1157,7 @@ var Ot = class {
|
|
|
1151
1157
|
let a = d(), u = m();
|
|
1152
1158
|
for (; u;) a.push(u), a = a.concat(d()), u = m();
|
|
1153
1159
|
return c() ? t({
|
|
1154
|
-
type:
|
|
1160
|
+
type: N.positionTry,
|
|
1155
1161
|
name: r,
|
|
1156
1162
|
declarations: a
|
|
1157
1163
|
}) : o("@position-try missing '}'");
|
|
@@ -1163,18 +1169,18 @@ var Ot = class {
|
|
|
1163
1169
|
let a = d(), u = m();
|
|
1164
1170
|
for (; u;) a.push(u), a = a.concat(d()), u = m();
|
|
1165
1171
|
return c() ? t({
|
|
1166
|
-
type:
|
|
1172
|
+
type: N.pageMarginBox,
|
|
1167
1173
|
name: r,
|
|
1168
1174
|
declarations: a
|
|
1169
1175
|
}) : o(`@${r} missing '}'`);
|
|
1170
1176
|
}() || function() {
|
|
1171
1177
|
let t = i(), n = /^@([-\w]+)\s*/.exec(e);
|
|
1172
1178
|
if (!n) return;
|
|
1173
|
-
let r = l(n)[1], a = "", u =
|
|
1174
|
-
if (u !== -1 && u > 0 && (a =
|
|
1179
|
+
let r = l(n)[1], a = "", u = P(e, ["{", ";"]);
|
|
1180
|
+
if (u !== -1 && u > 0 && (a = F(e.substring(0, u)), l([e.substring(0, u)])), s()) {
|
|
1175
1181
|
let e = v();
|
|
1176
1182
|
return c() ? t({
|
|
1177
|
-
type:
|
|
1183
|
+
type: N.atRule,
|
|
1178
1184
|
name: r,
|
|
1179
1185
|
prelude: a,
|
|
1180
1186
|
rules: e
|
|
@@ -1182,7 +1188,7 @@ var Ot = class {
|
|
|
1182
1188
|
}
|
|
1183
1189
|
let d = /^[;\s]*/.exec(e);
|
|
1184
1190
|
return d && l(d), t({
|
|
1185
|
-
type:
|
|
1191
|
+
type: N.atRule,
|
|
1186
1192
|
name: r,
|
|
1187
1193
|
prelude: a
|
|
1188
1194
|
});
|
|
@@ -1191,12 +1197,12 @@ var Ot = class {
|
|
|
1191
1197
|
function S() {
|
|
1192
1198
|
let e = i(), t = p();
|
|
1193
1199
|
return t ? (d(), e({
|
|
1194
|
-
type:
|
|
1200
|
+
type: N.rule,
|
|
1195
1201
|
selectors: t,
|
|
1196
1202
|
declarations: _() || []
|
|
1197
1203
|
})) : o("selector missing");
|
|
1198
1204
|
}
|
|
1199
|
-
return
|
|
1205
|
+
return Ot(function() {
|
|
1200
1206
|
let n = function() {
|
|
1201
1207
|
let n, r = [];
|
|
1202
1208
|
for (u(), d(r); e.length;) {
|
|
@@ -1219,7 +1225,7 @@ var Ot = class {
|
|
|
1219
1225
|
return r;
|
|
1220
1226
|
}();
|
|
1221
1227
|
return {
|
|
1222
|
-
type:
|
|
1228
|
+
type: N.stylesheet,
|
|
1223
1229
|
stylesheet: {
|
|
1224
1230
|
source: t?.source,
|
|
1225
1231
|
rules: n,
|
|
@@ -1227,66 +1233,66 @@ var Ot = class {
|
|
|
1227
1233
|
}
|
|
1228
1234
|
};
|
|
1229
1235
|
}());
|
|
1230
|
-
},
|
|
1236
|
+
}, jt = (e, t) => new kt(t || {}).compile(e), Mt = Object.defineProperty, Nt = (e, t) => {
|
|
1231
1237
|
let n = {};
|
|
1232
|
-
for (var r in e)
|
|
1238
|
+
for (var r in e) Mt(n, r, {
|
|
1233
1239
|
get: e[r],
|
|
1234
1240
|
enumerable: !0
|
|
1235
1241
|
});
|
|
1236
|
-
return t ||
|
|
1237
|
-
},
|
|
1238
|
-
name:
|
|
1242
|
+
return t || Mt(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
1243
|
+
}, Pt = "LocatorError", Ft = "LocatorUnsupportedError", It = "LocatorDeniedError", Lt = "LocatorInvalidError", Rt = (e) => typeof e == "object" && e ? e.name : void 0, I = (e) => Object.assign(Error(e), { name: Pt }), L = (e, t = "", n) => Object.assign(Error(e), {
|
|
1244
|
+
name: Ft,
|
|
1239
1245
|
operation: t,
|
|
1240
1246
|
backend: n
|
|
1241
|
-
}),
|
|
1242
|
-
name: Ft,
|
|
1243
|
-
operation: t
|
|
1244
|
-
}), zt = (e, t) => Object.assign(Error(e), {
|
|
1247
|
+
}), zt = (e, t) => L(`Locator operation not supported${t ? ` on the ${t} backend` : ""}: ${e}`, e, t), R = (e, t) => Object.assign(Error(e), {
|
|
1245
1248
|
name: It,
|
|
1246
1249
|
operation: t
|
|
1247
|
-
}),
|
|
1250
|
+
}), Bt = (e, t) => Object.assign(Error(e), {
|
|
1251
|
+
name: Lt,
|
|
1252
|
+
operation: t
|
|
1253
|
+
}), z = class extends Error {
|
|
1248
1254
|
name = "TimeoutError";
|
|
1249
1255
|
constructor(e, t) {
|
|
1250
1256
|
super(e, t?.cause === void 0 ? void 0 : { cause: t.cause });
|
|
1251
1257
|
}
|
|
1252
|
-
},
|
|
1258
|
+
}, Vt = (e) => Rt(e) === Ft, Ht = (e) => Rt(e) === It, Ut = (e) => Rt(e) === Lt, Wt = (e) => Ht(e) || Vt(e) || Ut(e), B = (e) => {
|
|
1253
1259
|
let t = (e.ownerDocument ?? e).defaultView;
|
|
1254
|
-
if (!t) throw
|
|
1260
|
+
if (!t) throw I("the resolved element belongs to a document with no window");
|
|
1255
1261
|
return t;
|
|
1256
|
-
},
|
|
1262
|
+
}, Gt = (e, t) => {
|
|
1257
1263
|
let n = e?.[t];
|
|
1258
1264
|
return typeof n == "function" ? n : null;
|
|
1259
|
-
},
|
|
1265
|
+
}, Kt = (e, t) => {
|
|
1260
1266
|
if (typeof e != "object" || !e) return null;
|
|
1261
1267
|
let n = (() => {
|
|
1262
1268
|
try {
|
|
1263
|
-
return
|
|
1269
|
+
return Gt(B(e), t);
|
|
1264
1270
|
} catch {
|
|
1265
1271
|
return null;
|
|
1266
1272
|
}
|
|
1267
1273
|
})();
|
|
1268
1274
|
if (n && e instanceof n) return n;
|
|
1269
|
-
let r =
|
|
1275
|
+
let r = Gt(globalThis, t);
|
|
1270
1276
|
return r && e instanceof r ? r : null;
|
|
1271
|
-
}, V = (e, t) =>
|
|
1272
|
-
if (e.length === 0) throw
|
|
1273
|
-
if (e.length > 1) throw
|
|
1277
|
+
}, V = (e, t) => Kt(e, t) !== null, H = (e) => {
|
|
1278
|
+
if (e.length === 0) throw I("No elements found");
|
|
1279
|
+
if (e.length > 1) throw I(`Strict mode violation: locator resolved to ${e.length} elements`);
|
|
1274
1280
|
return e[0];
|
|
1275
|
-
},
|
|
1276
|
-
if (!V(e, t)) throw
|
|
1281
|
+
}, qt = (e, t) => {
|
|
1282
|
+
if (!V(e, t)) throw I(`Strict mode violation: expected ${t}, got <${e.tagName.toLowerCase()}>`);
|
|
1277
1283
|
return e;
|
|
1278
|
-
},
|
|
1279
|
-
|
|
1280
|
-
},
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
]),
|
|
1288
|
-
if (
|
|
1289
|
-
if (e.type ===
|
|
1284
|
+
}, Jt = (e) => e.tagName.toLowerCase(), Yt = /* @__PURE__ */ new Set(), Xt = (e) => {
|
|
1285
|
+
Yt.add(e);
|
|
1286
|
+
}, Zt = /(?:^|[^\w-])(?:url|image|image-set|cross-fade|paint|element|expression)\s*\(/i, Qt = (e) => e.replace(/\\([0-9a-fA-F]{1,6})\s?/g, (e, t) => String.fromCodePoint(Number.parseInt(t, 16))).replace(/\\(.)/g, "$1"), $t = (e) => !Zt.test(Qt(e.value)), en = /* @__PURE__ */ new Set([
|
|
1287
|
+
N.import,
|
|
1288
|
+
N.fontFace,
|
|
1289
|
+
N.namespace,
|
|
1290
|
+
N.charset,
|
|
1291
|
+
N.document,
|
|
1292
|
+
N.comment
|
|
1293
|
+
]), tn = (e) => {
|
|
1294
|
+
if (en.has(e.type)) return null;
|
|
1295
|
+
if (e.type === N.declaration) return $t(e) ? e : null;
|
|
1290
1296
|
let t = e, n = { ...t };
|
|
1291
1297
|
for (let e of [
|
|
1292
1298
|
"declarations",
|
|
@@ -1294,18 +1300,18 @@ var Ot = class {
|
|
|
1294
1300
|
"keyframes"
|
|
1295
1301
|
]) {
|
|
1296
1302
|
let r = t[e];
|
|
1297
|
-
Array.isArray(r) && (n[e] =
|
|
1303
|
+
Array.isArray(r) && (n[e] = nn(r));
|
|
1298
1304
|
}
|
|
1299
1305
|
return n;
|
|
1300
|
-
},
|
|
1306
|
+
}, nn = (e) => e.map((e) => tn(e)).filter((e) => e !== null), rn = (e) => {
|
|
1301
1307
|
let t;
|
|
1302
1308
|
try {
|
|
1303
|
-
t =
|
|
1309
|
+
t = At(e, { silent: !0 });
|
|
1304
1310
|
} catch {
|
|
1305
1311
|
return "";
|
|
1306
1312
|
}
|
|
1307
|
-
return t.stylesheet.rules =
|
|
1308
|
-
},
|
|
1313
|
+
return t.stylesheet.rules = nn(t.stylesheet.rules), jt(t);
|
|
1314
|
+
}, an = (e, t) => {
|
|
1309
1315
|
let n = () => {
|
|
1310
1316
|
t.parentNode || (e.head ?? e.documentElement).appendChild(t);
|
|
1311
1317
|
};
|
|
@@ -1322,16 +1328,16 @@ var Ot = class {
|
|
|
1322
1328
|
});
|
|
1323
1329
|
let i = () => r.disconnect(), a = e.defaultView;
|
|
1324
1330
|
a ? a.addEventListener("load", i, { once: !0 }) : setTimeout(i, 3e4);
|
|
1325
|
-
},
|
|
1331
|
+
}, on = { resolve: (e, t) => {
|
|
1326
1332
|
let n = e.document.createElement("style");
|
|
1327
|
-
n.textContent = t.noSanitize ? t.content :
|
|
1333
|
+
n.textContent = t.noSanitize ? t.content : rn(t.content);
|
|
1328
1334
|
try {
|
|
1329
|
-
|
|
1335
|
+
an(e.document, n);
|
|
1330
1336
|
} catch (e) {
|
|
1331
1337
|
console.error(e);
|
|
1332
1338
|
}
|
|
1333
|
-
|
|
1334
|
-
} },
|
|
1339
|
+
Xt(n);
|
|
1340
|
+
} }, sn = (e) => {
|
|
1335
1341
|
let t = [];
|
|
1336
1342
|
return e.forEach((e, n) => {
|
|
1337
1343
|
t.push([n, e]);
|
|
@@ -1340,12 +1346,12 @@ var Ot = class {
|
|
|
1340
1346
|
kind: "frame",
|
|
1341
1347
|
ensureArgs: (e) => [void 0, e],
|
|
1342
1348
|
resolve: async (e, t, n = {}) => {
|
|
1343
|
-
if (typeof t != "string") throw
|
|
1349
|
+
if (typeof t != "string") throw Bt("fetch: url must be a string", "fetch");
|
|
1344
1350
|
let r = B(e.document), i;
|
|
1345
1351
|
try {
|
|
1346
1352
|
i = new r.URL(t, e.document.baseURI).href;
|
|
1347
1353
|
} catch {
|
|
1348
|
-
throw
|
|
1354
|
+
throw Bt(`fetch: not a valid url: ${t}`, "fetch");
|
|
1349
1355
|
}
|
|
1350
1356
|
let a = await r.fetch(i, {
|
|
1351
1357
|
method: n.method ?? "GET",
|
|
@@ -1361,32 +1367,32 @@ var Ot = class {
|
|
|
1361
1367
|
url: a.url,
|
|
1362
1368
|
redirected: a.redirected,
|
|
1363
1369
|
type: a.type,
|
|
1364
|
-
headers:
|
|
1370
|
+
headers: sn(a.headers),
|
|
1365
1371
|
body: await a.arrayBuffer()
|
|
1366
1372
|
};
|
|
1367
1373
|
}
|
|
1368
|
-
}, W = /* @__PURE__ */
|
|
1369
|
-
click: () =>
|
|
1370
|
-
clickAsInput: () =>
|
|
1371
|
-
count: () =>
|
|
1372
|
-
exists: () =>
|
|
1373
|
-
fill: () =>
|
|
1374
|
-
getAttribute: () =>
|
|
1375
|
-
hover: () =>
|
|
1376
|
-
isVisible: () =>
|
|
1377
|
-
textContent: () =>
|
|
1378
|
-
}),
|
|
1374
|
+
}, W = /* @__PURE__ */ Nt({
|
|
1375
|
+
click: () => un,
|
|
1376
|
+
clickAsInput: () => dn,
|
|
1377
|
+
count: () => yn,
|
|
1378
|
+
exists: () => bn,
|
|
1379
|
+
fill: () => hn,
|
|
1380
|
+
getAttribute: () => _n,
|
|
1381
|
+
hover: () => fn,
|
|
1382
|
+
isVisible: () => vn,
|
|
1383
|
+
textContent: () => gn
|
|
1384
|
+
}), cn = (e, t) => {
|
|
1379
1385
|
let n = e.getBoundingClientRect();
|
|
1380
1386
|
return {
|
|
1381
1387
|
clientX: n.left + n.width * (t?.x ?? .5),
|
|
1382
1388
|
clientY: n.top + n.height * (t?.y ?? .5)
|
|
1383
1389
|
};
|
|
1384
|
-
},
|
|
1390
|
+
}, ln = (e, t, n, r) => {
|
|
1385
1391
|
let i = H(e.elements), a = B(i), o = {
|
|
1386
1392
|
bubbles: !0,
|
|
1387
1393
|
cancelable: !0,
|
|
1388
1394
|
composed: !0,
|
|
1389
|
-
...
|
|
1395
|
+
...cn(i, t.position),
|
|
1390
1396
|
button: 0
|
|
1391
1397
|
}, s = {
|
|
1392
1398
|
...o,
|
|
@@ -1416,12 +1422,12 @@ var Ot = class {
|
|
|
1416
1422
|
...o,
|
|
1417
1423
|
buttons: 0
|
|
1418
1424
|
}));
|
|
1419
|
-
},
|
|
1425
|
+
}, un = { resolve: (e, t = {}) => ln(e, t, !1, (e, t) => e.dispatchEvent(t)) }, dn = (e, t = {}, n) => ln(e, t, !0, n), fn = { resolve: (e, t = {}) => {
|
|
1420
1426
|
let n = H(e.elements), r = B(n), i = {
|
|
1421
1427
|
bubbles: !0,
|
|
1422
1428
|
cancelable: !0,
|
|
1423
1429
|
composed: !0,
|
|
1424
|
-
...
|
|
1430
|
+
...cn(n, t.position)
|
|
1425
1431
|
}, a = {
|
|
1426
1432
|
...i,
|
|
1427
1433
|
pointerType: "mouse",
|
|
@@ -1435,11 +1441,11 @@ var Ot = class {
|
|
|
1435
1441
|
...i,
|
|
1436
1442
|
bubbles: !1
|
|
1437
1443
|
})), n.dispatchEvent(new r.MouseEvent("mouseover", i)), n.dispatchEvent(new r.PointerEvent("pointermove", a)), n.dispatchEvent(new r.MouseEvent("mousemove", i));
|
|
1438
|
-
} },
|
|
1444
|
+
} }, pn = (e, t) => {
|
|
1439
1445
|
e._valueTracker?.setValue("");
|
|
1440
|
-
let n = (
|
|
1446
|
+
let n = (Kt(e, "HTMLTextAreaElement") ?? Kt(e, "HTMLInputElement"))?.prototype, r = n && Object.getOwnPropertyDescriptor(n, "value")?.set;
|
|
1441
1447
|
r ? r.call(e, t) : e.value = t;
|
|
1442
|
-
},
|
|
1448
|
+
}, mn = (e, t) => {
|
|
1443
1449
|
if (e.type !== "range") return null;
|
|
1444
1450
|
let n = Number(e.min || 0), r = Number(e.max || 100);
|
|
1445
1451
|
if (!Number.isFinite(n) || !Number.isFinite(r) || r <= n) return null;
|
|
@@ -1476,21 +1482,21 @@ var Ot = class {
|
|
|
1476
1482
|
buttons: 0
|
|
1477
1483
|
}
|
|
1478
1484
|
};
|
|
1479
|
-
},
|
|
1485
|
+
}, hn = { resolve: (e, t, n = {}) => {
|
|
1480
1486
|
let r = H(e.elements), i = B(r), a = V(r, "HTMLInputElement");
|
|
1481
1487
|
if (a || V(r, "HTMLTextAreaElement")) {
|
|
1482
|
-
let e = r, n = a ?
|
|
1483
|
-
n && (r.dispatchEvent(new i.PointerEvent("pointerdown", n.pointerDown)), r.dispatchEvent(new i.MouseEvent("mousedown", n.mouseDown))),
|
|
1488
|
+
let e = r, n = a ? mn(e, t) : null;
|
|
1489
|
+
n && (r.dispatchEvent(new i.PointerEvent("pointerdown", n.pointerDown)), r.dispatchEvent(new i.MouseEvent("mousedown", n.mouseDown))), pn(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 }));
|
|
1484
1490
|
} else if (V(r, "HTMLElement") && r.isContentEditable) r.textContent = t, r.dispatchEvent(new i.Event("input", { bubbles: !0 }));
|
|
1485
|
-
else throw Error(`fill: element <${
|
|
1486
|
-
} },
|
|
1491
|
+
else throw Error(`fill: element <${Jt(r)}> is not fillable`);
|
|
1492
|
+
} }, gn = { resolve: (e, t = {}) => H(e.elements).textContent }, _n = { resolve: (e, t, n = {}) => H(e.elements).getAttribute(t) }, vn = { resolve: (e, t = {}) => {
|
|
1487
1493
|
let n = H(e.elements);
|
|
1488
1494
|
if (!V(n, "HTMLElement")) return !0;
|
|
1489
1495
|
let r = B(n).getComputedStyle(n);
|
|
1490
1496
|
if (r?.display === "none" || r?.visibility === "hidden") return !1;
|
|
1491
1497
|
let i = n.getBoundingClientRect();
|
|
1492
1498
|
return i.width > 0 && i.height > 0;
|
|
1493
|
-
} },
|
|
1499
|
+
} }, yn = { resolve: (e, t = {}) => e.elements.length }, bn = { resolve: (e, t = {}) => e.elements.length > 0 }, G = (e, t) => (e.topLevel ? [e.document] : e.elements).flatMap((e) => [...e.querySelectorAll(t)]), xn = (e) => e.replaceAll("\"", "\\\""), Sn = {
|
|
1494
1500
|
to: "element",
|
|
1495
1501
|
css: !0,
|
|
1496
1502
|
resolve: (e, t) => G(e, t),
|
|
@@ -1498,7 +1504,7 @@ var Ot = class {
|
|
|
1498
1504
|
fragment: typeof e == "string" ? e : "?",
|
|
1499
1505
|
separator: "descend"
|
|
1500
1506
|
})
|
|
1501
|
-
},
|
|
1507
|
+
}, Cn = {
|
|
1502
1508
|
to: "frame",
|
|
1503
1509
|
css: !0,
|
|
1504
1510
|
barrier: "down",
|
|
@@ -1507,25 +1513,25 @@ var Ot = class {
|
|
|
1507
1513
|
fragment: typeof e == "string" ? e : "?",
|
|
1508
1514
|
separator: "down"
|
|
1509
1515
|
})
|
|
1510
|
-
},
|
|
1516
|
+
}, wn = {
|
|
1511
1517
|
element: {
|
|
1512
1518
|
selectors: {
|
|
1513
|
-
locator:
|
|
1514
|
-
frameLocator:
|
|
1519
|
+
locator: Sn,
|
|
1520
|
+
frameLocator: Cn,
|
|
1515
1521
|
getByRole: {
|
|
1516
1522
|
to: "element",
|
|
1517
1523
|
resolve: (e, t) => G(e, `[role="${CSS.escape(t)}"]`),
|
|
1518
|
-
render: (e) => ({ fragment: typeof e == "string" ? `[role="${
|
|
1524
|
+
render: (e) => ({ fragment: typeof e == "string" ? `[role="${xn(e)}"]` : "[role]" })
|
|
1519
1525
|
},
|
|
1520
1526
|
getByText: {
|
|
1521
1527
|
to: "element",
|
|
1522
1528
|
resolve: (e, t) => e.elements.flatMap((e) => [e, ...e.querySelectorAll("*")]).filter((e) => e.textContent?.includes(t)),
|
|
1523
|
-
render: (e) => ({ fragment: typeof e == "string" ? `:has-text("${
|
|
1529
|
+
render: (e) => ({ fragment: typeof e == "string" ? `:has-text("${xn(e)}")` : ":has-text(...)" })
|
|
1524
1530
|
},
|
|
1525
1531
|
getByTestId: {
|
|
1526
1532
|
to: "element",
|
|
1527
1533
|
resolve: (e, t) => G(e, `[data-testid="${CSS.escape(t)}"]`),
|
|
1528
|
-
render: (e) => ({ fragment: typeof e == "string" ? `[data-testid="${
|
|
1534
|
+
render: (e) => ({ fragment: typeof e == "string" ? `[data-testid="${xn(e)}"]` : "[data-testid]" })
|
|
1529
1535
|
},
|
|
1530
1536
|
first: {
|
|
1531
1537
|
to: "element",
|
|
@@ -1542,20 +1548,20 @@ var Ot = class {
|
|
|
1542
1548
|
}
|
|
1543
1549
|
},
|
|
1544
1550
|
operations: {
|
|
1545
|
-
click:
|
|
1546
|
-
fill:
|
|
1547
|
-
hover:
|
|
1548
|
-
textContent:
|
|
1549
|
-
getAttribute:
|
|
1550
|
-
isVisible:
|
|
1551
|
-
count:
|
|
1552
|
-
exists:
|
|
1551
|
+
click: un,
|
|
1552
|
+
fill: hn,
|
|
1553
|
+
hover: fn,
|
|
1554
|
+
textContent: gn,
|
|
1555
|
+
getAttribute: _n,
|
|
1556
|
+
isVisible: vn,
|
|
1557
|
+
count: yn,
|
|
1558
|
+
exists: bn
|
|
1553
1559
|
}
|
|
1554
1560
|
},
|
|
1555
1561
|
frame: {
|
|
1556
1562
|
selectors: {
|
|
1557
|
-
locator:
|
|
1558
|
-
frameLocator:
|
|
1563
|
+
locator: Sn,
|
|
1564
|
+
frameLocator: Cn,
|
|
1559
1565
|
owner: {
|
|
1560
1566
|
to: "frame",
|
|
1561
1567
|
barrier: "up",
|
|
@@ -1569,11 +1575,11 @@ var Ot = class {
|
|
|
1569
1575
|
}
|
|
1570
1576
|
},
|
|
1571
1577
|
operations: {
|
|
1572
|
-
addStyleTag:
|
|
1578
|
+
addStyleTag: on,
|
|
1573
1579
|
fetch: U
|
|
1574
1580
|
}
|
|
1575
1581
|
}
|
|
1576
|
-
},
|
|
1582
|
+
}, Tn = (e, t = wn) => ({
|
|
1577
1583
|
element: {
|
|
1578
1584
|
selectors: {
|
|
1579
1585
|
...t.element.selectors,
|
|
@@ -1594,31 +1600,31 @@ var Ot = class {
|
|
|
1594
1600
|
...e.frame?.operations
|
|
1595
1601
|
}
|
|
1596
1602
|
}
|
|
1597
|
-
}),
|
|
1603
|
+
}), En = 3e4, Dn = 50, K = (e) => {
|
|
1598
1604
|
let t = e[e.length - 1];
|
|
1599
1605
|
return typeof t == "object" && t ? t : void 0;
|
|
1600
|
-
},
|
|
1606
|
+
}, On = (e) => {
|
|
1601
1607
|
let t = K(e)?.timeout;
|
|
1602
|
-
return typeof t == "number" ? t :
|
|
1603
|
-
},
|
|
1608
|
+
return typeof t == "number" ? t : En;
|
|
1609
|
+
}, kn = ({ executor: e, parts: t }) => ({ highlight: (n) => e.highlight(t, n).then(() => {}, () => {}) }), An = async (e) => {
|
|
1604
1610
|
let t = {
|
|
1605
1611
|
parts: e.parts,
|
|
1606
1612
|
operation: e.operation,
|
|
1607
1613
|
args: e.args,
|
|
1608
1614
|
phase: "ensure"
|
|
1609
1615
|
};
|
|
1610
|
-
await e.gate?.(t,
|
|
1611
|
-
},
|
|
1616
|
+
await e.gate?.(t, kn(e));
|
|
1617
|
+
}, jn = (e, t) => {
|
|
1612
1618
|
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`);
|
|
1613
|
-
},
|
|
1619
|
+
}, Mn = (e) => typeof e == "object" && e && typeof e.message == "string" ? e.message : String(e), Nn = async (e) => {
|
|
1614
1620
|
let { executor: t, gate: n, parts: r, operation: i, args: a } = e;
|
|
1615
|
-
|
|
1621
|
+
jn(i, K(a)?.timeout), n && await n({
|
|
1616
1622
|
parts: r,
|
|
1617
1623
|
operation: i,
|
|
1618
1624
|
args: a,
|
|
1619
1625
|
phase: "execute"
|
|
1620
|
-
},
|
|
1621
|
-
let o =
|
|
1626
|
+
}, kn(e));
|
|
1627
|
+
let o = On(a), s = Date.now() + o, c = /* @__PURE__ */ Error(`Locator timeout (${o}ms): ${i}`), { promise: l, reject: u } = Promise.withResolvers();
|
|
1622
1628
|
l.catch(() => {});
|
|
1623
1629
|
let d = setTimeout(() => u(c), o), f = c;
|
|
1624
1630
|
try {
|
|
@@ -1627,48 +1633,48 @@ var Ot = class {
|
|
|
1627
1633
|
return await Promise.race([t.execute(r, i, a), l]);
|
|
1628
1634
|
} catch (e) {
|
|
1629
1635
|
if (e === c) break;
|
|
1630
|
-
if (
|
|
1636
|
+
if (Wt(e)) throw e;
|
|
1631
1637
|
f = e;
|
|
1632
1638
|
let t = s - Date.now();
|
|
1633
1639
|
if (t <= 0) break;
|
|
1634
|
-
await new Promise((e) => setTimeout(e, Math.min(
|
|
1640
|
+
await new Promise((e) => setTimeout(e, Math.min(Dn, t)));
|
|
1635
1641
|
}
|
|
1636
1642
|
while (Date.now() < s);
|
|
1637
1643
|
} finally {
|
|
1638
1644
|
clearTimeout(d);
|
|
1639
1645
|
}
|
|
1640
|
-
throw f === c ? new
|
|
1641
|
-
},
|
|
1646
|
+
throw f === c ? new z(c.message) : new z(Mn(f), { cause: f });
|
|
1647
|
+
}, Pn = (e, t, n, r, i) => {
|
|
1642
1648
|
let a = {};
|
|
1643
|
-
for (let [o, s] of Object.entries(t[r].selectors)) a[o] = (...a) =>
|
|
1649
|
+
for (let [o, s] of Object.entries(t[r].selectors)) a[o] = (...a) => Pn(e, t, n, s.to, [...i, {
|
|
1644
1650
|
kind: r,
|
|
1645
1651
|
name: o,
|
|
1646
1652
|
args: a
|
|
1647
1653
|
}]);
|
|
1648
|
-
for (let [n, o] of Object.entries(t[r].operations)) a[n] = async (...t) =>
|
|
1654
|
+
for (let [n, o] of Object.entries(t[r].operations)) a[n] = async (...t) => Nn({
|
|
1649
1655
|
...e,
|
|
1650
1656
|
parts: i,
|
|
1651
1657
|
operation: n,
|
|
1652
1658
|
args: o.send ? o.send(...t) : t
|
|
1653
1659
|
});
|
|
1654
|
-
for (let [o, { to: s, rewrite: c }] of Object.entries(n[r] ?? {})) a[o] = (...r) =>
|
|
1660
|
+
for (let [o, { to: s, rewrite: c }] of Object.entries(n[r] ?? {})) a[o] = (...r) => Pn(e, t, n, s, c(i, ...r));
|
|
1655
1661
|
return a.ensure = (n, a = {}) => {
|
|
1656
1662
|
let o = t[r].operations[n]?.ensureArgs;
|
|
1657
|
-
return
|
|
1663
|
+
return An({
|
|
1658
1664
|
...e,
|
|
1659
1665
|
parts: i,
|
|
1660
1666
|
operation: n,
|
|
1661
1667
|
args: o?.(a) ?? [a]
|
|
1662
1668
|
});
|
|
1663
1669
|
}, a;
|
|
1664
|
-
},
|
|
1670
|
+
}, Fn = (e) => Pn(e, e.modules ?? wn, e.rewrites ?? {}, "frame", []), In = () => {
|
|
1665
1671
|
let e = T();
|
|
1666
1672
|
return e.status === "ok" && e.abi >= 2;
|
|
1667
|
-
},
|
|
1668
|
-
await
|
|
1673
|
+
}, Ln = async () => {
|
|
1674
|
+
await D();
|
|
1669
1675
|
let e = T();
|
|
1670
1676
|
if (e.status === "ok" && e.abi < 2) throw new C(e.abi, 2);
|
|
1671
|
-
},
|
|
1677
|
+
}, Rn = (e) => `Read the text, links and details ${e} shows.`, zn = (e) => `Inject unfiltered styles or code into ${e}. This can pass page details along to other sites.`, Bn = [
|
|
1672
1678
|
{
|
|
1673
1679
|
id: "interaction",
|
|
1674
1680
|
heading: "Interaction",
|
|
@@ -1683,9 +1689,9 @@ var Ot = class {
|
|
|
1683
1689
|
heading: "Site data",
|
|
1684
1690
|
summary: "Can read the website's data",
|
|
1685
1691
|
title: (e) => `Read data from ${e}`,
|
|
1686
|
-
description:
|
|
1692
|
+
description: Rn,
|
|
1687
1693
|
cloudTitle: (e) => `Read what's on ${e}`,
|
|
1688
|
-
cloudDescription:
|
|
1694
|
+
cloudDescription: Rn
|
|
1689
1695
|
},
|
|
1690
1696
|
{
|
|
1691
1697
|
id: "network",
|
|
@@ -1701,11 +1707,11 @@ var Ot = class {
|
|
|
1701
1707
|
heading: "Evaluation",
|
|
1702
1708
|
summary: "Can execute arbitrary code on the website",
|
|
1703
1709
|
title: (e) => `Run code on ${e}`,
|
|
1704
|
-
description:
|
|
1710
|
+
description: zn,
|
|
1705
1711
|
cloudTitle: (e) => `Run its own code on ${e}`,
|
|
1706
|
-
cloudDescription:
|
|
1712
|
+
cloudDescription: zn
|
|
1707
1713
|
}
|
|
1708
|
-
],
|
|
1714
|
+
], Vn = (e) => (t) => {
|
|
1709
1715
|
if (typeof t != "object" || !t) return t === void 0 ? [] : [t];
|
|
1710
1716
|
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`);
|
|
1711
1717
|
let { relativePosition: n, ...r } = t;
|
|
@@ -1713,21 +1719,21 @@ var Ot = class {
|
|
|
1713
1719
|
...r,
|
|
1714
1720
|
position: n
|
|
1715
1721
|
}];
|
|
1716
|
-
},
|
|
1722
|
+
}, Hn = async (e, t, n) => {
|
|
1717
1723
|
try {
|
|
1718
1724
|
return await U.resolve(e, t, n);
|
|
1719
1725
|
} catch (e) {
|
|
1720
|
-
throw
|
|
1726
|
+
throw Wt(e) ? e : R(`frame.fetch: ${e instanceof Error ? `${e.name}: ${e.message}` : String(e)}; not retried, since the request may already have been sent`, "fetch");
|
|
1721
1727
|
}
|
|
1722
|
-
},
|
|
1728
|
+
}, Un = Tn({
|
|
1723
1729
|
element: { operations: {
|
|
1724
1730
|
click: {
|
|
1725
1731
|
resolve: (e, t = {}) => W.click.resolve(e, t),
|
|
1726
|
-
send:
|
|
1732
|
+
send: Vn("click")
|
|
1727
1733
|
},
|
|
1728
1734
|
hover: {
|
|
1729
1735
|
resolve: (e, t = {}) => W.hover.resolve(e, t),
|
|
1730
|
-
send:
|
|
1736
|
+
send: Vn("hover")
|
|
1731
1737
|
},
|
|
1732
1738
|
fill: { resolve: (e, t, n = {}) => W.fill.resolve(e, t, n) },
|
|
1733
1739
|
textContent: { resolve: (e, t = {}) => W.textContent.resolve(e) },
|
|
@@ -1735,12 +1741,12 @@ var Ot = class {
|
|
|
1735
1741
|
isVisible: { resolve: (e, t = {}) => W.isVisible.resolve(e) },
|
|
1736
1742
|
count: { resolve: (e, t = {}) => W.count.resolve(e) },
|
|
1737
1743
|
exists: { resolve: (e, t = {}) => W.exists.resolve(e) },
|
|
1738
|
-
videoElement: { resolve: (e, t = {}) =>
|
|
1744
|
+
videoElement: { resolve: (e, t = {}) => be(qt(H(e.elements), "HTMLVideoElement")) }
|
|
1739
1745
|
} },
|
|
1740
1746
|
frame: { operations: {
|
|
1741
|
-
addStyleTag: { resolve: (e, t) =>
|
|
1747
|
+
addStyleTag: { resolve: (e, t) => on.resolve(e, t) },
|
|
1742
1748
|
fetch: {
|
|
1743
|
-
resolve: (e, t, n = {}) =>
|
|
1749
|
+
resolve: (e, t, n = {}) => Hn(e, t, n),
|
|
1744
1750
|
kind: U.kind,
|
|
1745
1751
|
ensureArgs: U.ensureArgs
|
|
1746
1752
|
},
|
|
@@ -1748,11 +1754,11 @@ var Ot = class {
|
|
|
1748
1754
|
kind: "frame",
|
|
1749
1755
|
typed: !1,
|
|
1750
1756
|
resolve: (e, t, n) => {
|
|
1751
|
-
throw
|
|
1757
|
+
throw zt("evaluate", "this realm");
|
|
1752
1758
|
}
|
|
1753
1759
|
}
|
|
1754
1760
|
} }
|
|
1755
|
-
}),
|
|
1761
|
+
}), Wn = (e) => e[e.length - 1], Gn = {
|
|
1756
1762
|
element: {
|
|
1757
1763
|
last: {
|
|
1758
1764
|
to: "element",
|
|
@@ -1765,7 +1771,7 @@ var Ot = class {
|
|
|
1765
1771
|
contentFrame: {
|
|
1766
1772
|
to: "frame",
|
|
1767
1773
|
rewrite: (e) => {
|
|
1768
|
-
let t =
|
|
1774
|
+
let t = Wn(e);
|
|
1769
1775
|
if (t?.name !== "locator") throw TypeError("locator.contentFrame: only a locator that ends in locator(selector) can enter its frame; use frameLocator(selector)");
|
|
1770
1776
|
return [...e.slice(0, -1), {
|
|
1771
1777
|
...t,
|
|
@@ -1778,7 +1784,7 @@ var Ot = class {
|
|
|
1778
1784
|
owner: {
|
|
1779
1785
|
to: "element",
|
|
1780
1786
|
rewrite: (e) => {
|
|
1781
|
-
let t =
|
|
1787
|
+
let t = Wn(e);
|
|
1782
1788
|
if (t?.name !== "frameLocator") throw TypeError("frameLocator.owner: this frame was not entered through frameLocator(selector)");
|
|
1783
1789
|
return [...e.slice(0, -1), {
|
|
1784
1790
|
...t,
|
|
@@ -1795,7 +1801,7 @@ var Ot = class {
|
|
|
1795
1801
|
}]
|
|
1796
1802
|
}
|
|
1797
1803
|
}
|
|
1798
|
-
},
|
|
1804
|
+
}, Kn = (e) => {
|
|
1799
1805
|
if (!e || e === "about:blank") return !1;
|
|
1800
1806
|
let t;
|
|
1801
1807
|
try {
|
|
@@ -1803,46 +1809,46 @@ var Ot = class {
|
|
|
1803
1809
|
} catch {
|
|
1804
1810
|
return !1;
|
|
1805
1811
|
}
|
|
1806
|
-
return t.protocol === "chrome-extension:" || t.protocol === "moz-extension:" || t.protocol !== "about:" &&
|
|
1812
|
+
return t.protocol === "chrome-extension:" || t.protocol === "moz-extension:" || t.protocol !== "about:" && A(t.hostname);
|
|
1807
1813
|
}, q = (e) => {
|
|
1808
|
-
if (
|
|
1809
|
-
},
|
|
1814
|
+
if (Kn(e)) throw Error("attachFrame: refusing to target the extension's own pages or an FKN platform origin");
|
|
1815
|
+
}, qn = ({ src: e, domains: t, lockdown: n }) => {
|
|
1810
1816
|
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");
|
|
1811
|
-
},
|
|
1817
|
+
}, Jn = {
|
|
1812
1818
|
scope: "embed.iframe",
|
|
1813
1819
|
category: "interaction",
|
|
1814
1820
|
severity: 0,
|
|
1815
1821
|
title: "Load another website inside this app",
|
|
1816
1822
|
description: "Lets the app embed external pages directly inside its own view."
|
|
1817
|
-
},
|
|
1823
|
+
}, Yn = {
|
|
1818
1824
|
scope: "embed.open",
|
|
1819
1825
|
category: "interaction",
|
|
1820
1826
|
severity: 0,
|
|
1821
1827
|
title: "Open a website inside this app",
|
|
1822
1828
|
description: "Lets the app navigate to another site without leaving its window."
|
|
1823
|
-
},
|
|
1829
|
+
}, Xn = ["load", "commit"], Zn = (e) => {
|
|
1824
1830
|
if ("timeoutMs" in e) throw TypeError("frame.goto: pass timeout, in milliseconds; timeoutMs is not an option");
|
|
1825
1831
|
let { waitUntil: t, timeout: n } = e;
|
|
1826
|
-
if (t !== void 0 && !
|
|
1832
|
+
if (t !== void 0 && !Xn.includes(t)) throw TypeError(`frame.goto: waitUntil must be 'load' or 'commit', not ${JSON.stringify(t)}`);
|
|
1827
1833
|
if (n !== void 0 && typeof n != "number") throw TypeError("frame.goto: timeout must be a number of milliseconds");
|
|
1828
|
-
|
|
1829
|
-
},
|
|
1834
|
+
jn("frame.goto", n);
|
|
1835
|
+
}, Qn = class extends Error {
|
|
1830
1836
|
name = "FrameWindowBlockedError";
|
|
1831
1837
|
constructor() {
|
|
1832
1838
|
super("attachFrame: the browser did not open the window. Call attachFrame directly in a click or key handler, and allow popups for this page");
|
|
1833
1839
|
}
|
|
1834
|
-
},
|
|
1840
|
+
}, $n = /* @__PURE__ */ new Set([
|
|
1835
1841
|
"jar-unreachable",
|
|
1836
1842
|
"bad-url",
|
|
1837
1843
|
"opaque-opener"
|
|
1838
|
-
]),
|
|
1844
|
+
]), er = class extends Error {
|
|
1839
1845
|
name = "FrameWindowRefusedError";
|
|
1840
1846
|
reason;
|
|
1841
1847
|
constructor(e) {
|
|
1842
|
-
let t =
|
|
1848
|
+
let t = $n.has(e) ? e : "unknown";
|
|
1843
1849
|
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;
|
|
1844
1850
|
}
|
|
1845
|
-
},
|
|
1851
|
+
}, tr = ["message", "document"], nr = (e) => {
|
|
1846
1852
|
if (e === "*") return "*";
|
|
1847
1853
|
let t = () => /* @__PURE__ */ TypeError(`frame.postMessage: targetOrigin must be '*' or an origin, not ${JSON.stringify(e)}`);
|
|
1848
1854
|
if (typeof e != "string") throw t();
|
|
@@ -1854,48 +1860,48 @@ var Ot = class {
|
|
|
1854
1860
|
}
|
|
1855
1861
|
if (n === "null") throw t();
|
|
1856
1862
|
return n;
|
|
1857
|
-
},
|
|
1863
|
+
}, rr = (e, t) => {
|
|
1858
1864
|
let n = typeof e == "object" && !!e;
|
|
1859
1865
|
if (n && t !== void 0) throw TypeError("frame.postMessage: pass transfer inside the options object, not after it");
|
|
1860
1866
|
let r = n ? e.targetOrigin ?? "*" : e ?? "*", i = n ? e.transfer : t;
|
|
1861
1867
|
if (i !== void 0 && !Array.isArray(i)) throw TypeError("frame.postMessage: transfer must be an array");
|
|
1862
1868
|
return {
|
|
1863
|
-
targetOrigin:
|
|
1869
|
+
targetOrigin: nr(r),
|
|
1864
1870
|
transfer: i === void 0 ? [] : [...i]
|
|
1865
1871
|
};
|
|
1866
|
-
},
|
|
1872
|
+
}, ir = [
|
|
1867
1873
|
"url",
|
|
1868
1874
|
"path",
|
|
1869
1875
|
"type"
|
|
1870
|
-
],
|
|
1876
|
+
], ar = ["content", "sourceUrl"], or = /[\n\r\u2028\u2029]/, sr = (e) => {
|
|
1871
1877
|
if (typeof e != "object" || !e || Array.isArray(e)) throw TypeError("frame.addScriptTag: options must be an object { content }");
|
|
1872
|
-
let t = Object.keys(e), n = t.find((e) =>
|
|
1878
|
+
let t = Object.keys(e), n = t.find((e) => ir.includes(e));
|
|
1873
1879
|
if (n !== void 0) throw TypeError(`frame.addScriptTag: "${n}" is not served; it runs content as a classic inline script`);
|
|
1874
|
-
let r = t.find((e) => !
|
|
1880
|
+
let r = t.find((e) => !ar.includes(e));
|
|
1875
1881
|
if (r !== void 0) throw TypeError(`frame.addScriptTag: unknown option "${r}"`);
|
|
1876
1882
|
let { content: i, sourceUrl: a } = e;
|
|
1877
1883
|
if (typeof i != "string") throw TypeError("frame.addScriptTag: content must be a string");
|
|
1878
|
-
if (a !== void 0 && (typeof a != "string" || a === "" ||
|
|
1884
|
+
if (a !== void 0 && (typeof a != "string" || a === "" || or.test(a))) throw TypeError("frame.addScriptTag: sourceUrl must be a non-empty string with no line break");
|
|
1879
1885
|
return a === void 0 ? { content: i } : {
|
|
1880
1886
|
content: i,
|
|
1881
1887
|
sourceUrl: a
|
|
1882
1888
|
};
|
|
1883
|
-
},
|
|
1889
|
+
}, cr = [
|
|
1884
1890
|
"name",
|
|
1885
1891
|
"domain",
|
|
1886
1892
|
"path"
|
|
1887
|
-
],
|
|
1893
|
+
], lr = (e) => e instanceof RegExp || Object.prototype.toString.call(e) === "[object RegExp]", ur = (e) => {
|
|
1888
1894
|
if (e === void 0) return {};
|
|
1889
1895
|
if (Object.prototype.toString.call(e) !== "[object Object]") throw TypeError("frame.clearCookies: options must be an object");
|
|
1890
|
-
let t = e, n = Object.keys(t).find((e) => !
|
|
1896
|
+
let t = e, n = Object.keys(t).find((e) => !cr.includes(e));
|
|
1891
1897
|
if (n !== void 0) throw TypeError(`frame.clearCookies: unknown option "${n}"`);
|
|
1892
|
-
let r =
|
|
1898
|
+
let r = cr.flatMap((e) => {
|
|
1893
1899
|
let n = t[e];
|
|
1894
1900
|
return n === void 0 ? [] : [{
|
|
1895
1901
|
key: e,
|
|
1896
1902
|
value: n
|
|
1897
1903
|
}];
|
|
1898
|
-
}), i = r.find(({ value: e }) =>
|
|
1904
|
+
}), i = r.find(({ value: e }) => lr(e));
|
|
1899
1905
|
if (i !== void 0) throw TypeError(`frame.clearCookies: ${i.key} is a RegExp, and clearCookies takes strings for name, domain and path for now`);
|
|
1900
1906
|
let a = r.find(({ value: e }) => typeof e != "string");
|
|
1901
1907
|
if (a !== void 0) throw TypeError(`frame.clearCookies: ${a.key} must be a string`);
|
|
@@ -1904,18 +1910,18 @@ var Ot = class {
|
|
|
1904
1910
|
let s = {};
|
|
1905
1911
|
for (let { key: e, value: t } of r) s[e] = { equals: t };
|
|
1906
1912
|
return s;
|
|
1907
|
-
},
|
|
1913
|
+
}, dr = (e) => {
|
|
1908
1914
|
typeof globalThis.reportError == "function" ? globalThis.reportError(e) : console.error(e);
|
|
1909
|
-
},
|
|
1910
|
-
let { owner: t, ...n } =
|
|
1915
|
+
}, fr = (e) => {
|
|
1916
|
+
let { owner: t, ...n } = Fn({
|
|
1911
1917
|
executor: e.executor,
|
|
1912
|
-
modules:
|
|
1913
|
-
rewrites:
|
|
1918
|
+
modules: Un,
|
|
1919
|
+
rewrites: Gn,
|
|
1914
1920
|
gate: async (t, n) => {
|
|
1915
|
-
|
|
1921
|
+
j(t.operation, K(t.args)?.reason), await e.gate?.(t, n);
|
|
1916
1922
|
}
|
|
1917
|
-
}), r = async (t, n = {}) => (q(t),
|
|
1918
|
-
for (let e of t)
|
|
1923
|
+
}), r = async (t, n = {}) => (q(t), Zn(n), e.goto(t, n)), i = () => e.url(), a = async (t) => {
|
|
1924
|
+
for (let e of t) j("frame.requestPermissions", e?.reason);
|
|
1919
1925
|
let n = e.requestPermissions;
|
|
1920
1926
|
if (!n) throw Error("frame.requestPermissions: this backend cannot ask for permission categories");
|
|
1921
1927
|
return n(t);
|
|
@@ -1926,18 +1932,18 @@ var Ot = class {
|
|
|
1926
1932
|
if (typeof i != "string") throw TypeError("frame.evaluate: pass a function or a source string");
|
|
1927
1933
|
return r(i, structuredClone(n));
|
|
1928
1934
|
}, s = async (t) => {
|
|
1929
|
-
let { content: n, ...r } =
|
|
1935
|
+
let { content: n, ...r } = sr(t), i = e.addScriptTag;
|
|
1930
1936
|
if (!i) throw Error("frame.addScriptTag: this backend cannot run scripts in the attached frame");
|
|
1931
1937
|
await i(n, r);
|
|
1932
1938
|
}, c = async (t) => {
|
|
1933
|
-
let n =
|
|
1939
|
+
let n = ur(t), r = e.clearCookies;
|
|
1934
1940
|
if (!r) throw Error("frame.clearCookies: this backend cannot clear cookies");
|
|
1935
1941
|
await r(n);
|
|
1936
1942
|
}, l = ((t, n, r) => {
|
|
1937
1943
|
try {
|
|
1938
1944
|
let i = e.postMessage;
|
|
1939
1945
|
if (!i) throw Error("frame.postMessage: this backend cannot message the attached frame");
|
|
1940
|
-
let a =
|
|
1946
|
+
let a = rr(n, r);
|
|
1941
1947
|
return i(t, a.targetOrigin, a.transfer);
|
|
1942
1948
|
} catch (e) {
|
|
1943
1949
|
return Promise.reject(e);
|
|
@@ -1946,7 +1952,7 @@ var Ot = class {
|
|
|
1946
1952
|
message: /* @__PURE__ */ new Set(),
|
|
1947
1953
|
document: /* @__PURE__ */ new Set()
|
|
1948
1954
|
}, d = null, f = (e, t) => {
|
|
1949
|
-
if (
|
|
1955
|
+
if (!tr.includes(e)) throw TypeError(`frame.${t}: the event type must be ${tr.map((e) => `'${e}'`).join(" or ")}, not ${JSON.stringify(e)}`);
|
|
1950
1956
|
return u[e];
|
|
1951
1957
|
}, p = (e) => {
|
|
1952
1958
|
let t = e.type === "message" ? Object.freeze({
|
|
@@ -1962,7 +1968,7 @@ var Ot = class {
|
|
|
1962
1968
|
for (let n of [...u[e.type]]) try {
|
|
1963
1969
|
n(t);
|
|
1964
1970
|
} catch (e) {
|
|
1965
|
-
|
|
1971
|
+
dr(e);
|
|
1966
1972
|
}
|
|
1967
1973
|
}, m = (e, t) => {
|
|
1968
1974
|
if (f(e, "off").delete(t), d !== null && !u.message.size && !u.document.size) {
|
|
@@ -1995,57 +2001,57 @@ var Ot = class {
|
|
|
1995
2001
|
off: m
|
|
1996
2002
|
};
|
|
1997
2003
|
return _;
|
|
1998
|
-
},
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
o,
|
|
2003
|
-
a,
|
|
2004
|
+
}, pr = [
|
|
2005
|
+
_,
|
|
2006
|
+
r,
|
|
2007
|
+
v,
|
|
2004
2008
|
c,
|
|
2005
2009
|
s,
|
|
2006
|
-
d,
|
|
2007
|
-
i,
|
|
2008
|
-
n,
|
|
2009
|
-
l,
|
|
2010
|
-
f,
|
|
2011
2010
|
u,
|
|
2012
|
-
|
|
2013
|
-
|
|
2011
|
+
l,
|
|
2012
|
+
p,
|
|
2013
|
+
o,
|
|
2014
|
+
i,
|
|
2015
|
+
d,
|
|
2014
2016
|
m,
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
+
f,
|
|
2018
|
+
Jn,
|
|
2019
|
+
Yn,
|
|
2020
|
+
g,
|
|
2021
|
+
a,
|
|
2017
2022
|
it,
|
|
2018
2023
|
at,
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2024
|
+
ot,
|
|
2025
|
+
yt,
|
|
2026
|
+
xt
|
|
2027
|
+
], mr = Bn.map((e) => e.id), hr = {
|
|
2022
2028
|
interaction: "act.click",
|
|
2023
2029
|
storage: "read.text",
|
|
2024
2030
|
network: "network.fetchCredentialed",
|
|
2025
2031
|
evaluation: "media.appearU"
|
|
2026
|
-
},
|
|
2032
|
+
}, gr = (e) => e === 0 ? "auto" : e === 4 ? "critical" : "bundled", _r = pr, J = /* @__PURE__ */ new Map(), vr = {};
|
|
2027
2033
|
(() => {
|
|
2028
|
-
J = new Map(
|
|
2029
|
-
let e = (e) =>
|
|
2030
|
-
Object.fromEntries(
|
|
2034
|
+
J = new Map(_r.map((e) => [e.scope, e])), vr = Object.fromEntries(J), _r.filter((e) => e.severity === 4).map((e) => e.scope);
|
|
2035
|
+
let e = (e) => _r.filter((t) => t.category === e && gr(t.severity) === "bundled");
|
|
2036
|
+
Object.fromEntries(mr.map((t) => [t, Math.max(0, ...e(t).map((e) => e.severity))])), Object.fromEntries(mr.map((t) => [t, e(t).some((e) => e.unsafe === !0)]));
|
|
2031
2037
|
})();
|
|
2032
|
-
var
|
|
2038
|
+
var yr = (e) => J.get(e)?.category, br = (e) => {
|
|
2033
2039
|
let t = J.get(e);
|
|
2034
|
-
return t &&
|
|
2035
|
-
},
|
|
2040
|
+
return t && gr(t.severity);
|
|
2041
|
+
}, xr = (e) => {
|
|
2036
2042
|
let t = J.get(e);
|
|
2037
|
-
if (t) return
|
|
2038
|
-
},
|
|
2039
|
-
let n = t ?? (e &&
|
|
2040
|
-
return n !== void 0 &&
|
|
2041
|
-
},
|
|
2042
|
-
for (let { category: n, key: r } of t) if (
|
|
2043
|
+
if (t) return gr(t.severity) === "critical" ? t.scope : t.category;
|
|
2044
|
+
}, Sr = (e) => hr[e], Cr = ({ category: e, key: t }) => {
|
|
2045
|
+
let n = t ?? (e && Sr(e));
|
|
2046
|
+
return n !== void 0 && yr(n) !== void 0 ? n : void 0;
|
|
2047
|
+
}, wr = (e, t) => {
|
|
2048
|
+
for (let { category: n, key: r } of t) if (Cr({
|
|
2043
2049
|
category: n,
|
|
2044
2050
|
key: r
|
|
2045
2051
|
}) === 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}"`);
|
|
2046
|
-
},
|
|
2052
|
+
}, Tr = (e, t = {}) => {
|
|
2047
2053
|
let n = [], r = e.map((e) => {
|
|
2048
|
-
let r =
|
|
2054
|
+
let r = Cr(e), i = [];
|
|
2049
2055
|
if (r !== void 0) for (let a of e.hosts) i.push(n.length), n.push({
|
|
2050
2056
|
...t,
|
|
2051
2057
|
key: r,
|
|
@@ -2055,8 +2061,8 @@ var _r = (e) => J.get(e)?.category, vr = (e) => {
|
|
|
2055
2061
|
reason: e.reason
|
|
2056
2062
|
});
|
|
2057
2063
|
return {
|
|
2058
|
-
key: r !== void 0 &&
|
|
2059
|
-
category: r === void 0 ? e.category ?? "interaction" :
|
|
2064
|
+
key: r !== void 0 && br(r) === "critical" ? r : void 0,
|
|
2065
|
+
category: r === void 0 ? e.category ?? "interaction" : vr[r].category,
|
|
2060
2066
|
hosts: e.hosts,
|
|
2061
2067
|
indexes: i
|
|
2062
2068
|
};
|
|
@@ -2070,30 +2076,30 @@ var _r = (e) => J.get(e)?.category, vr = (e) => {
|
|
|
2070
2076
|
allow: i.length > 0 && i.every((t) => e[t]?.allow === !0)
|
|
2071
2077
|
}))
|
|
2072
2078
|
};
|
|
2073
|
-
},
|
|
2074
|
-
typeof window < "u" &&
|
|
2075
|
-
if (!
|
|
2079
|
+
}, Er = (e) => typeof e == "object" && !!e, Dr = typeof chrome < "u" && !!chrome.runtime?.id, Or = (e) => Er(e) && e.FKN_WEB_EXTENSION_FRAME_ANNOUNCE_KEY === !0 && typeof e.frameId == "string" && typeof e.document == "string", kr = /* @__PURE__ */ new WeakMap(), Ar = /* @__PURE__ */ new WeakMap(), jr = /* @__PURE__ */ new WeakMap(), Mr = /* @__PURE__ */ new Set();
|
|
2080
|
+
typeof window < "u" && Dr && window.addEventListener("message", (e) => {
|
|
2081
|
+
if (!Or(e.data)) return;
|
|
2076
2082
|
e.stopImmediatePropagation();
|
|
2077
2083
|
let t = e.source;
|
|
2078
2084
|
if (!t || typeof t != "object") return;
|
|
2079
|
-
let n = t, r =
|
|
2080
|
-
if (
|
|
2081
|
-
let o =
|
|
2085
|
+
let n = t, r = kr.get(n), i = e.data.frameId, a = e.data.document;
|
|
2086
|
+
if (kr.set(n, i), Ar.set(n, a), r) for (let e of Mr) e(r);
|
|
2087
|
+
let o = jr.get(n);
|
|
2082
2088
|
if (o) {
|
|
2083
2089
|
for (let e of [...o]) (e.notDocument === void 0 || e.notDocument !== a) && (o.delete(e), e.resolve(i));
|
|
2084
|
-
o.size ||
|
|
2090
|
+
o.size || jr.delete(n);
|
|
2085
2091
|
}
|
|
2086
2092
|
}, { capture: !0 });
|
|
2087
2093
|
// ../web-extension/lib/lib/evaluate-deadline.js
|
|
2088
|
-
var
|
|
2094
|
+
var Nr = 3e4, Pr = `frame.evaluate: the code did not settle within ${Nr}ms`, Fr = () => new z(Pr), Ir = (e) => Ut(e) && e.message === Pr ? Fr() : e, Lr = [
|
|
2089
2095
|
/^frame load timed out after \d+ms for /,
|
|
2090
2096
|
/^frame goto: documentstart timed out$/,
|
|
2091
2097
|
/^navigation to .+ did not commit a document within \d+ms$/s
|
|
2092
|
-
],
|
|
2093
|
-
if (e instanceof
|
|
2098
|
+
], Rr = (e) => {
|
|
2099
|
+
if (e instanceof z) return e;
|
|
2094
2100
|
let t = typeof e?.message == "string" ? e.message : "";
|
|
2095
|
-
return
|
|
2096
|
-
},
|
|
2101
|
+
return Lr.some((e) => e.test(t)) ? new z(t) : e;
|
|
2102
|
+
}, zr = (e) => {
|
|
2097
2103
|
let t = e;
|
|
2098
2104
|
if (t.window === void 0) return "iframe";
|
|
2099
2105
|
if (t.iframe !== void 0) throw TypeError("attachFrame: pass either iframe or window, not both");
|
|
@@ -2101,11 +2107,11 @@ var jr = 3e4, Mr = `frame.evaluate: the code did not settle within ${jr}ms`, Nr
|
|
|
2101
2107
|
if (t.blank !== void 0) throw TypeError("attachFrame: blank does not apply to a window");
|
|
2102
2108
|
if (typeof t.window != "object" || t.window === null) throw TypeError("attachFrame: window must be an object");
|
|
2103
2109
|
return "window";
|
|
2104
|
-
},
|
|
2110
|
+
}, Br = (e, t, n) => {
|
|
2105
2111
|
if (e === void 0) return t;
|
|
2106
2112
|
if (typeof e != "number" || !Number.isFinite(e) || e <= 0) throw TypeError(`attachFrame: window.${n} must be a positive number of CSS pixels`);
|
|
2107
2113
|
return Math.round(e);
|
|
2108
|
-
},
|
|
2114
|
+
}, Vr = ({ url: e, width: t, height: n }) => {
|
|
2109
2115
|
let r = (() => {
|
|
2110
2116
|
if (e === void 0 || e === "" || e === "about:blank") return "";
|
|
2111
2117
|
if (typeof e != "string") throw TypeError("attachFrame: window.url must be a string");
|
|
@@ -2121,10 +2127,10 @@ var jr = 3e4, Mr = `frame.evaluate: the code did not settle within ${jr}ms`, Nr
|
|
|
2121
2127
|
})();
|
|
2122
2128
|
return r && q(r), {
|
|
2123
2129
|
url: r,
|
|
2124
|
-
width:
|
|
2125
|
-
height:
|
|
2130
|
+
width: Br(t, 500, "width"),
|
|
2131
|
+
height: Br(n, 700, "height")
|
|
2126
2132
|
};
|
|
2127
|
-
},
|
|
2133
|
+
}, Hr = "attachFrame: storageState seeds a fresh jar, so it needs cookies: 'ephemeral'", Ur = 1e11, Wr = [
|
|
2128
2134
|
"name",
|
|
2129
2135
|
"value",
|
|
2130
2136
|
"domain",
|
|
@@ -2133,11 +2139,11 @@ var jr = 3e4, Mr = `frame.evaluate: the code did not settle within ${jr}ms`, Nr
|
|
|
2133
2139
|
"httpOnly",
|
|
2134
2140
|
"secure",
|
|
2135
2141
|
"sameSite"
|
|
2136
|
-
],
|
|
2142
|
+
], Gr = [
|
|
2137
2143
|
"Strict",
|
|
2138
2144
|
"Lax",
|
|
2139
2145
|
"None"
|
|
2140
|
-
], Y = /[;\x00-\x1f\x7f]/, X = (e, t) => /* @__PURE__ */ TypeError(`attachFrame: storageState${e} ${t}`), Z = (e) => Object.prototype.toString.call(e) === "[object Object]",
|
|
2146
|
+
], Y = /[;\x00-\x1f\x7f]/, X = (e, t) => /* @__PURE__ */ TypeError(`attachFrame: storageState${e} ${t}`), Z = (e) => Object.prototype.toString.call(e) === "[object Object]", Kr = (e) => {
|
|
2141
2147
|
let t = e.startsWith(".") ? e.slice(1) : e;
|
|
2142
2148
|
if (t === "") return null;
|
|
2143
2149
|
try {
|
|
@@ -2145,19 +2151,19 @@ var jr = 3e4, Mr = `frame.evaluate: the code did not settle within ${jr}ms`, Nr
|
|
|
2145
2151
|
} catch {
|
|
2146
2152
|
return null;
|
|
2147
2153
|
}
|
|
2148
|
-
},
|
|
2154
|
+
}, qr = (e, t) => {
|
|
2149
2155
|
if (!Z(e)) throw X(t, "must be an object");
|
|
2150
|
-
let n = Object.keys(e).find((e) => !
|
|
2156
|
+
let n = Object.keys(e).find((e) => !Wr.includes(e));
|
|
2151
2157
|
if (n !== void 0) throw X(`${t}.${n}`, "is not a cookie field");
|
|
2152
2158
|
let { name: r, value: i, domain: a, path: o, expires: s, httpOnly: c, secure: l, sameSite: u } = e;
|
|
2153
2159
|
if (typeof r != "string" || r === "" || r.includes("=") || Y.test(r)) throw X(`${t}.name`, "must be a non-empty string with no \"=\", \";\" or control character");
|
|
2154
2160
|
if (typeof i != "string" || Y.test(i)) throw X(`${t}.value`, "must be a string with no \";\" or control character");
|
|
2155
|
-
if (typeof a != "string" ||
|
|
2161
|
+
if (typeof a != "string" || Kr(a) === null) throw X(`${t}.domain`, "must be a host: \".youtube.com\" for a cookie its subdomains also receive, \"www.youtube.com\" for a host-only one");
|
|
2156
2162
|
if (o !== void 0 && (typeof o != "string" || !o.startsWith("/") || Y.test(o))) throw X(`${t}.path`, "must be a string starting with \"/\"");
|
|
2157
2163
|
if (s !== void 0 && (typeof s != "number" || !Number.isFinite(s) || s <= 0 && s !== -1)) throw X(`${t}.expires`, "must be -1 for a session cookie, or milliseconds since the epoch");
|
|
2158
2164
|
if (c !== void 0 && typeof c != "boolean") throw X(`${t}.httpOnly`, "must be a boolean");
|
|
2159
2165
|
if (l !== void 0 && typeof l != "boolean") throw X(`${t}.secure`, "must be a boolean");
|
|
2160
|
-
if (u !== void 0 && !
|
|
2166
|
+
if (u !== void 0 && !Gr.includes(u)) throw X(`${t}.sameSite`, `must be 'Strict', 'Lax' or 'None', not ${JSON.stringify(u)}`);
|
|
2161
2167
|
let d = r.toLowerCase();
|
|
2162
2168
|
if (u === "None" && l !== !0) throw X(t, "is SameSite=None, which needs secure: true");
|
|
2163
2169
|
if (d.startsWith("__secure-") && l !== !0) throw X(t, "is a __Secure- cookie, which needs secure: true");
|
|
@@ -2168,7 +2174,7 @@ var jr = 3e4, Mr = `frame.evaluate: the code did not settle within ${jr}ms`, Nr
|
|
|
2168
2174
|
domain: a
|
|
2169
2175
|
};
|
|
2170
2176
|
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;
|
|
2171
|
-
},
|
|
2177
|
+
}, Jr = (e, t) => {
|
|
2172
2178
|
if (!Z(e)) throw X(t, "must be an object { origin, localStorage }");
|
|
2173
2179
|
let n = Object.keys(e).find((e) => e !== "origin" && e !== "localStorage");
|
|
2174
2180
|
if (n !== void 0) throw X(`${t}.${n}`, "is not an origin field");
|
|
@@ -2192,32 +2198,32 @@ var jr = 3e4, Mr = `frame.evaluate: the code did not settle within ${jr}ms`, Nr
|
|
|
2192
2198
|
};
|
|
2193
2199
|
})
|
|
2194
2200
|
};
|
|
2195
|
-
},
|
|
2201
|
+
}, Yr = (e) => {
|
|
2196
2202
|
if (!Z(e)) throw X("", "must be an object { cookies?, origins? }");
|
|
2197
2203
|
let t = Object.keys(e).find((e) => e !== "cookies" && e !== "origins");
|
|
2198
2204
|
if (t !== void 0) throw X(`.${t}`, "is not a storageState key; it takes cookies and origins");
|
|
2199
2205
|
let { cookies: n = [], origins: r = [] } = e;
|
|
2200
2206
|
if (!Array.isArray(n)) throw X(".cookies", "must be an array");
|
|
2201
2207
|
if (!Array.isArray(r)) throw X(".origins", "must be an array");
|
|
2202
|
-
let i = n.map((e, t) =>
|
|
2208
|
+
let i = n.map((e, t) => qr(e, `.cookies[${t}]`)), a = r.map((e, t) => Jr(e, `.origins[${t}]`));
|
|
2203
2209
|
return i.forEach(({ expires: e }, t) => {
|
|
2204
|
-
if (e !== void 0 && e > 0 && e <
|
|
2210
|
+
if (e !== void 0 && e > 0 && e < Ur) throw X(`.cookies[${t}].expires`, `is milliseconds since the epoch, and ${e} reads as a date before 1974; a Playwright storageState gives seconds, so multiply it by 1000`);
|
|
2205
2211
|
}), {
|
|
2206
2212
|
cookies: i,
|
|
2207
2213
|
origins: a
|
|
2208
2214
|
};
|
|
2209
|
-
},
|
|
2215
|
+
}, Xr = [
|
|
2210
2216
|
"persistent",
|
|
2211
2217
|
"ephemeral",
|
|
2212
2218
|
"native"
|
|
2213
|
-
],
|
|
2214
|
-
if ("syncCookies" in e) throw TypeError(
|
|
2219
|
+
], Zr = "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'", Qr = (e) => {
|
|
2220
|
+
if ("syncCookies" in e) throw TypeError(Zr);
|
|
2215
2221
|
let { cookies: t = "persistent" } = e;
|
|
2216
|
-
if (!
|
|
2217
|
-
if (e.storageState !== void 0 && t !== "ephemeral") throw TypeError(
|
|
2218
|
-
let n = e.storageState === void 0 ? void 0 :
|
|
2222
|
+
if (!Xr.includes(t)) throw TypeError(`attachFrame: cookies must be 'persistent', 'ephemeral' or 'native', not ${JSON.stringify(t)}`);
|
|
2223
|
+
if (e.storageState !== void 0 && t !== "ephemeral") throw TypeError(Hr);
|
|
2224
|
+
let n = e.storageState === void 0 ? void 0 : Yr(e.storageState), r = zr(e);
|
|
2219
2225
|
if (r === "iframe" && e.lockdown && t !== "native") throw TypeError("attachFrame: lockdown runs on the extension, which serves only cookies: 'native'");
|
|
2220
|
-
if (Array.isArray(e.permissions)) for (let t of e.permissions)
|
|
2226
|
+
if (Array.isArray(e.permissions)) for (let t of e.permissions) j("attachFrame", t?.reason);
|
|
2221
2227
|
return n === void 0 ? {
|
|
2222
2228
|
kind: r,
|
|
2223
2229
|
cookies: t
|
|
@@ -2226,9 +2232,9 @@ var jr = 3e4, Mr = `frame.evaluate: the code did not settle within ${jr}ms`, Nr
|
|
|
2226
2232
|
cookies: t,
|
|
2227
2233
|
storageState: n
|
|
2228
2234
|
};
|
|
2229
|
-
},
|
|
2230
|
-
|
|
2231
|
-
},
|
|
2235
|
+
}, $r = "FKN_WEB_EXTENSION_ATTACH_FRAME_EVENT_KEY", ei = !1, ti = () => {
|
|
2236
|
+
ei || (ei = !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."));
|
|
2237
|
+
}, ni = "frame: this frame no longer holds the document the app attached it to", ri = "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", ii = () => {
|
|
2232
2238
|
let e = T();
|
|
2233
2239
|
if (e.status === "ok" && e.abi >= 1) return;
|
|
2234
2240
|
let t = e.status === "absent" ? 0 : e.abi;
|
|
@@ -2242,21 +2248,21 @@ var jr = 3e4, Mr = `frame.evaluate: the code did not settle within ${jr}ms`, Nr
|
|
|
2242
2248
|
}, $ = () => {
|
|
2243
2249
|
let e = T();
|
|
2244
2250
|
return e.status === "absent" ? 0 : e.abi;
|
|
2245
|
-
},
|
|
2246
|
-
let f = new Set(
|
|
2247
|
-
return
|
|
2251
|
+
}, ai = "attachFrame: a blank page is served by the cloud render proxy only; call cloud.attachFrame", oi = "frame.addScriptTag: an extension frame does not run scripts through mirage yet; attach with cloud.attachFrame", si = "click: isTrusted is served by the cloud render proxy only; attach with cloud.attachFrame", ci = "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", li = ({ executeLocator: e, highlightLocator: t, ensureLocatorPermission: n, requestCategories: r, evaluateFrame: i, goto: a }, { hosts: o, url: s, page: c, unreachable: l, documents: u, navigated: d }) => {
|
|
2252
|
+
let f = new Set(h(o, { ipv6: !0 })), p = (e) => f.has(h([vt(e)], { ipv6: !0 })[0] ?? "");
|
|
2253
|
+
return fr({
|
|
2248
2254
|
backend: "extension",
|
|
2249
2255
|
executor: {
|
|
2250
2256
|
execute: e,
|
|
2251
2257
|
highlight: t
|
|
2252
2258
|
},
|
|
2253
2259
|
gate: (e) => {
|
|
2254
|
-
if (e.operation === "click" && K(e.args)?.isTrusted === !0) throw new w("click", $(),
|
|
2260
|
+
if (e.operation === "click" && K(e.args)?.isTrusted === !0) throw new w("click", $(), si);
|
|
2255
2261
|
return n(e.parts, e.operation, e.args);
|
|
2256
2262
|
},
|
|
2257
|
-
requestPermissions: async (e) => (
|
|
2263
|
+
requestPermissions: async (e) => (wr("frame.requestPermissions", e), await Ln(), r(e)),
|
|
2258
2264
|
evaluate: async (e, t) => {
|
|
2259
|
-
if (!
|
|
2265
|
+
if (!Ve(T(), "evaluate")) {
|
|
2260
2266
|
let e = T();
|
|
2261
2267
|
throw new w("evaluate", e.status === "ok" ? e.abi : 0);
|
|
2262
2268
|
}
|
|
@@ -2264,25 +2270,25 @@ var jr = 3e4, Mr = `frame.evaluate: the code did not settle within ${jr}ms`, Nr
|
|
|
2264
2270
|
source: e,
|
|
2265
2271
|
arg: t
|
|
2266
2272
|
}).catch((e) => {
|
|
2267
|
-
throw
|
|
2273
|
+
throw Ir(e);
|
|
2268
2274
|
});
|
|
2269
2275
|
},
|
|
2270
2276
|
addScriptTag: async () => {
|
|
2271
|
-
throw new w("addScriptTag", $(),
|
|
2277
|
+
throw new w("addScriptTag", $(), oi);
|
|
2272
2278
|
},
|
|
2273
2279
|
clearCookies: async () => {
|
|
2274
|
-
throw new w("clearCookies", $(),
|
|
2280
|
+
throw new w("clearCookies", $(), ci);
|
|
2275
2281
|
},
|
|
2276
2282
|
postMessage: (e, t, n) => {
|
|
2277
|
-
if (t === "*") throw
|
|
2278
|
-
if (!
|
|
2283
|
+
if (t === "*") throw L(ri, "postMessage", "extension");
|
|
2284
|
+
if (!p(t)) throw R(ni, "postMessage");
|
|
2279
2285
|
let r = l();
|
|
2280
2286
|
if (r) throw r;
|
|
2281
2287
|
return c().postMessage(e, t, n), Promise.resolve();
|
|
2282
2288
|
},
|
|
2283
2289
|
listen: (e) => {
|
|
2284
2290
|
let t = (t) => {
|
|
2285
|
-
t.source !== null && t.source === c() && !
|
|
2291
|
+
t.source !== null && t.source === c() && !Or(t.data) && p(t.origin) && e({
|
|
2286
2292
|
type: "message",
|
|
2287
2293
|
data: t.data,
|
|
2288
2294
|
origin: t.origin,
|
|
@@ -2299,29 +2305,29 @@ var jr = 3e4, Mr = `frame.evaluate: the code did not settle within ${jr}ms`, Nr
|
|
|
2299
2305
|
};
|
|
2300
2306
|
},
|
|
2301
2307
|
goto: (e, { waitUntil: t, timeout: n, ...r } = {}) => {
|
|
2302
|
-
|
|
2303
|
-
for (let t of
|
|
2308
|
+
M("frame.goto", [Q(e), ...r.domains ?? []]);
|
|
2309
|
+
for (let t of h([Q(e)], { ipv6: !0 })) f.add(t);
|
|
2304
2310
|
return d?.(e), a({
|
|
2305
2311
|
url: e,
|
|
2306
2312
|
...r,
|
|
2307
2313
|
...t === void 0 ? {} : { waitUntil: t === "commit" ? "documentstart" : t },
|
|
2308
2314
|
...n === void 0 ? {} : { timeoutMs: n }
|
|
2309
2315
|
}).catch((e) => {
|
|
2310
|
-
throw
|
|
2316
|
+
throw Rr(e);
|
|
2311
2317
|
});
|
|
2312
2318
|
},
|
|
2313
2319
|
url: s
|
|
2314
2320
|
});
|
|
2315
|
-
},
|
|
2316
|
-
if (i !== void 0) throw new w("blank", $(),
|
|
2321
|
+
}, ui = async ({ iframe: e, domains: t = [], lockdown: n = !1, permissions: r, blank: i }) => {
|
|
2322
|
+
if (i !== void 0) throw new w("blank", $(), ai);
|
|
2317
2323
|
let a = crypto.randomUUID();
|
|
2318
|
-
if (q(e.src),
|
|
2324
|
+
if (q(e.src), qn({
|
|
2319
2325
|
src: e.src,
|
|
2320
2326
|
domains: t,
|
|
2321
2327
|
lockdown: n
|
|
2322
|
-
}),
|
|
2323
|
-
e.dispatchEvent(new CustomEvent(
|
|
2324
|
-
let o =
|
|
2328
|
+
}), M("attachFrame", t), await D(), n && ii(), !e.isConnected) throw Error("attachFrame: the iframe must be connected to the document before attaching");
|
|
2329
|
+
e.dispatchEvent(new CustomEvent($r, { detail: a }));
|
|
2330
|
+
let o = li(await O.attachFrame({
|
|
2325
2331
|
marker: a,
|
|
2326
2332
|
domains: t,
|
|
2327
2333
|
syncCookies: !0,
|
|
@@ -2330,20 +2336,20 @@ var jr = 3e4, Mr = `frame.evaluate: the code did not settle within ${jr}ms`, Nr
|
|
|
2330
2336
|
hosts: [...t, Q(e.src)],
|
|
2331
2337
|
url: () => e.src,
|
|
2332
2338
|
page: () => e.contentWindow,
|
|
2333
|
-
unreachable: () => e.contentWindow === null ?
|
|
2339
|
+
unreachable: () => e.contentWindow === null ? R("frame: navigate the frame before postMessage", "postMessage") : void 0,
|
|
2334
2340
|
documents: (t) => (e.addEventListener("load", t), () => e.removeEventListener("load", t))
|
|
2335
2341
|
});
|
|
2336
|
-
return r?.length && (
|
|
2337
|
-
},
|
|
2338
|
-
let { domains: t = [], permissions: n } = e, { url: r, width: i, height: a } =
|
|
2339
|
-
|
|
2342
|
+
return r?.length && (In() ? await o.requestPermissions(r) : ti()), o;
|
|
2343
|
+
}, di = "attachFrame: a window on cookies: 'native' needs the FKN WebExtension, which is not on this page", fi = "frame.postMessage: this window's page no longer keeps a link to the app's page, so a message cannot reach it", pi = "extension.attachFrame: the attached window closed; attach a fresh window", mi = (e) => `attachFrame: cookies: '${e}' runs on the cloud render proxy; call cloud.attachFrame or the top-level attachFrame`, hi = async (e) => {
|
|
2344
|
+
let { domains: t = [], permissions: n } = e, { url: r, width: i, height: a } = Vr(e.window);
|
|
2345
|
+
M("attachFrame", t);
|
|
2340
2346
|
let o = T();
|
|
2341
|
-
if (!
|
|
2347
|
+
if (!Ve(o, "attachWindow")) throw o.status === "absent" ? new w("attachWindow", 0, di) : new w("attachWindow", o.abi);
|
|
2342
2348
|
let s = window.open(r || "about:blank", "_blank", `popup,width=${i},height=${a}`);
|
|
2343
|
-
if (!s) throw new
|
|
2349
|
+
if (!s) throw new Qn();
|
|
2344
2350
|
let c;
|
|
2345
2351
|
try {
|
|
2346
|
-
c = await
|
|
2352
|
+
c = await O.attachWindow({
|
|
2347
2353
|
url: r,
|
|
2348
2354
|
domains: t
|
|
2349
2355
|
});
|
|
@@ -2357,11 +2363,11 @@ var jr = 3e4, Mr = `frame.evaluate: the code did not settle within ${jr}ms`, Nr
|
|
|
2357
2363
|
u = !0;
|
|
2358
2364
|
}, () => {
|
|
2359
2365
|
u = !0;
|
|
2360
|
-
}), f = r, p =
|
|
2366
|
+
}), f = r, p = li(c, {
|
|
2361
2367
|
hosts: r ? [...t, Q(r)] : t,
|
|
2362
2368
|
url: () => f,
|
|
2363
2369
|
page: () => s,
|
|
2364
|
-
unreachable: () => u ?
|
|
2370
|
+
unreachable: () => u ? L(pi, "postMessage", "extension") : s.closed ? R(fi, "postMessage") : void 0,
|
|
2365
2371
|
documents: (e) => {
|
|
2366
2372
|
let t = !0;
|
|
2367
2373
|
return (async () => {
|
|
@@ -2394,29 +2400,29 @@ var jr = 3e4, Mr = `frame.evaluate: the code did not settle within ${jr}ms`, Nr
|
|
|
2394
2400
|
throw await h(), e;
|
|
2395
2401
|
}
|
|
2396
2402
|
return g;
|
|
2397
|
-
},
|
|
2398
|
-
let { kind: t, cookies: n } =
|
|
2399
|
-
if (n !== "native") throw new w("cookies", $(),
|
|
2400
|
-
return t === "window" ?
|
|
2401
|
-
}),
|
|
2403
|
+
}, gi = (async (e) => {
|
|
2404
|
+
let { kind: t, cookies: n } = Qr(e);
|
|
2405
|
+
if (n !== "native") throw new w("cookies", $(), mi(n));
|
|
2406
|
+
return t === "window" ? hi(e) : ui(e);
|
|
2407
|
+
}), _i = "permissions.request: pass hosts, the sites the grant applies to", vi = { request: async (e) => {
|
|
2402
2408
|
let t = e.map((e) => {
|
|
2403
2409
|
let { category: t, key: n, scope: r, reason: i, hosts: a } = e;
|
|
2404
|
-
if (
|
|
2410
|
+
if (j("permissions.request", i), !("hosts" in e) && !("category" in e)) return { legacy: {
|
|
2405
2411
|
key: n,
|
|
2406
2412
|
scope: r ?? "",
|
|
2407
2413
|
reason: i
|
|
2408
2414
|
} };
|
|
2409
|
-
let o =
|
|
2410
|
-
if (!o.length) throw TypeError(
|
|
2411
|
-
return
|
|
2415
|
+
let o = h(a ?? [], { ipv6: !0 });
|
|
2416
|
+
if (!o.length) throw TypeError(_i);
|
|
2417
|
+
return _t("permissions.request", o), { ask: {
|
|
2412
2418
|
category: t,
|
|
2413
2419
|
key: n,
|
|
2414
2420
|
reason: i,
|
|
2415
2421
|
hosts: o
|
|
2416
2422
|
} };
|
|
2417
2423
|
}), n = t.flatMap((e) => "ask" in e ? [e.ask] : []);
|
|
2418
|
-
|
|
2419
|
-
let { items: r, answer: i } =
|
|
2424
|
+
wr("permissions.request", n), n.length && await Ln();
|
|
2425
|
+
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;
|
|
2420
2426
|
return t.map((e) => "ask" in e ? c[u++] : l[d++]);
|
|
2421
|
-
} },
|
|
2422
|
-
export {
|
|
2427
|
+
} }, yi = "PermissionDeniedError", bi = (e) => e instanceof Error ? e.name === yi : Er(e) && e.name === "PermissionDeniedError";
|
|
2428
|
+
export { Ze as $, It as A, St as B, Kn as C, Ft as D, z as E, Ht as F, at as G, yt as H, Lt as I, lt as J, ot as K, Wt as L, Ut as M, L as N, Vt as O, Pt as P, k as Q, xt as R, qn as S, K as T, ut as U, bt as V, ft as W, nt as X, ct as Y, j as Z, er as _, ae as _t, gi as a, Ge as at, Yn as b, Rr as c, w as ct, Er as d, Be as dt, Ye as et, wr as f, Ae as ft, Qn as g, Ce as gt, br as h, xe as ht, $r as i, T as it, zt as j, R as k, Nr as l, C as lt, xr as m, be as mt, bi as n, Ue as nt, Qr as o, D as ot, yr as p, Se as pt, it as q, vi as r, We as rt, Vr as s, je as st, yi as t, Je as tt, Fr as u, Me as ut, Jn as v, Bn as w, q as x, fr as y, Ct as z };
|