@fkn/lib 0.9.66 → 0.9.68
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-Bm7uIcQo.d.ts → account-CXUwroRM.d.ts} +1 -1
- package/account.d.ts +2 -2
- package/{api-0Yp9uZcV.d.ts → api-DhwJz0vo.d.ts} +36 -2
- package/api.d.ts +2 -2
- package/cloud/dgram.d.ts +1 -1
- package/cloud/dns.d.ts +2 -2
- package/cloud/fetch.d.ts +1 -1
- package/cloud/http.d.ts +1 -1
- package/cloud/net.d.ts +1 -1
- package/{cloud-C7StNncS.js → cloud-CoHrHk6t.js} +1 -1
- package/{cloud-BoH54gaM.d.ts → cloud-P8d7GYmM.d.ts} +6 -6
- package/{cloud-TN0eDUy3.cjs → cloud-r8DsgB1W.cjs} +1 -1
- package/cloud.cjs +1 -1
- package/cloud.d.ts +6 -6
- package/cloud.js +1 -1
- package/{contract-0rua6Wsh.d.ts → contract-CDdIE_Es.d.ts} +50 -3
- package/contract.d.ts +2 -2
- package/{dgram-BYk-QDHW.d.ts → dgram-CPQqam5Z.d.ts} +4 -4
- package/dgram.d.ts +1 -1
- package/{dns-DyB4K2oE.d.ts → dns-_NCe2YLS.d.ts} +1 -1
- package/dns.d.ts +2 -2
- package/{extension-D5UMnEmQ.js → extension-CG7Qi3I0.js} +5 -5
- package/{extension-BXBjpypy.cjs → extension-Dn64NfoU.cjs} +1 -1
- package/{extension-D98KM8W7.d.ts → extension-Kzx83mrR.d.ts} +1 -1
- package/extension.cjs +1 -1
- package/extension.d.ts +2 -2
- package/extension.js +3 -3
- package/{http-CDhG4bUc.d.ts → http-D3wvnIVo.d.ts} +2 -2
- package/http.d.ts +1 -1
- package/{index-Cu5EcdK0.d.ts → index-HMfzm6dF.d.ts} +18 -3
- package/index.cjs +1 -1
- package/index.d.ts +13 -13
- package/index.js +5 -5
- package/{lib-CtJaID_y.js → lib-D2uKjgLV.js} +367 -357
- package/{lib-Bs-g5jyp.cjs → lib-_WDKIXcj.cjs} +1 -1
- package/{net-mVAYXs8e.d.ts → net-v_6ythjK.d.ts} +4 -4
- package/net.d.ts +1 -1
- package/package.json +1 -1
- package/packages-CTqprdnz.cjs +1 -0
- package/{packages-Cws_rcgf.js → packages-CrD5Sa28.js} +72 -69
- package/{packages-BEadIy_h.d.ts → packages-SwO4CxMl.d.ts} +19 -6
- package/packages.cjs +1 -1
- package/packages.d.ts +3 -3
- package/packages.js +1 -1
- package/{proxy-BP40IXYD.d.ts → proxy-CzP07me0.d.ts} +2 -2
- package/{relay-choice-DOUttUnL.d.ts → relay-choice-DB1F7bcn.d.ts} +2 -2
- package/{rooms-C6mbannC.d.ts → rooms-3XplwXzb.d.ts} +1 -1
- package/rooms.d.ts +2 -2
- package/{storage-DpCLksAa.d.ts → storage-C38adB-z.d.ts} +1 -1
- package/storage.d.ts +2 -2
- package/packages-DT8vPB5_.cjs +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-CGnMp29N.js";
|
|
2
2
|
import { _ as t, a as n, d as r, f as i, g as a, h as o, i as s, n as c, o as l, p as u, r as d, s as f, t as p, u as m, v as h, y as g } from "./hosts-HUfgMimI.js";
|
|
3
|
-
import { BoxBase as _, createTypedEventTarget as v, expose as
|
|
3
|
+
import { BoxBase as _, createTypedEventTarget as v, expose as y, recursiveBox as ee, recursiveRevive as te } from "osra";
|
|
4
4
|
// ../web-extension/lib/lib/revivables/event-proxy.js
|
|
5
|
-
var
|
|
5
|
+
var ne = (e, t) => {
|
|
6
6
|
let n = new EventTarget(), r = /* @__PURE__ */ new Map(), i = EventTarget.prototype.addEventListener.bind(n), a = EventTarget.prototype.removeEventListener.bind(n);
|
|
7
7
|
return Object.defineProperty(n, "addEventListener", {
|
|
8
8
|
configurable: !0,
|
|
@@ -34,12 +34,12 @@ var re = (e, t) => {
|
|
|
34
34
|
o !== void 0 && (o.listeners.delete(n), !(o.listeners.size > 0) && (e.removeEventListener(t, o.forward), r.delete(t)));
|
|
35
35
|
}
|
|
36
36
|
}), n;
|
|
37
|
-
},
|
|
37
|
+
}, re = (e) => typeof e == "boolean" ? +!!e : +!!e?.capture, b = (e) => {
|
|
38
38
|
let t = /* @__PURE__ */ new WeakMap();
|
|
39
39
|
return {
|
|
40
40
|
addEventListener: (n, r, i) => {
|
|
41
41
|
if (r === null) return;
|
|
42
|
-
let a = `${n}|${
|
|
42
|
+
let a = `${n}|${re(i)}`, o = t.get(r);
|
|
43
43
|
if (o || (o = /* @__PURE__ */ new Map(), t.set(r, o)), o.has(a)) return;
|
|
44
44
|
let s = typeof i == "object" && !!i && !!i.once, c = (t) => {
|
|
45
45
|
s && o.delete(a);
|
|
@@ -50,18 +50,18 @@ var re = (e, t) => {
|
|
|
50
50
|
},
|
|
51
51
|
removeEventListener: (n, r, i) => {
|
|
52
52
|
if (r === null) return;
|
|
53
|
-
let a = `${n}|${
|
|
53
|
+
let a = `${n}|${re(i)}`, o = t.get(r), s = o?.get(a);
|
|
54
54
|
s && (e.remoteEvents.removeEventListener(n, s, i), o.delete(a));
|
|
55
55
|
},
|
|
56
56
|
dispatchEvent: (t) => e.remoteEvents.dispatchEvent(t)
|
|
57
57
|
};
|
|
58
|
-
},
|
|
58
|
+
}, x = /* @__PURE__ */ e({
|
|
59
59
|
box: () => be,
|
|
60
|
-
createVideoElementHandle: () =>
|
|
60
|
+
createVideoElementHandle: () => ve,
|
|
61
61
|
isType: () => ye,
|
|
62
62
|
revive: () => xe,
|
|
63
|
-
type: () =>
|
|
64
|
-
}),
|
|
63
|
+
type: () => S
|
|
64
|
+
}), S = "videoElement", ie = [
|
|
65
65
|
"currentTime",
|
|
66
66
|
"volume",
|
|
67
67
|
"muted",
|
|
@@ -72,22 +72,22 @@ var re = (e, t) => {
|
|
|
72
72
|
"preload",
|
|
73
73
|
"poster",
|
|
74
74
|
"disableRemotePlayback"
|
|
75
|
-
],
|
|
75
|
+
], ae = [
|
|
76
76
|
"duration",
|
|
77
77
|
"paused",
|
|
78
78
|
"ended",
|
|
79
79
|
"seeking",
|
|
80
80
|
"readyState",
|
|
81
81
|
"currentSrc"
|
|
82
|
-
],
|
|
82
|
+
], oe = ["buffered", "seekable"], se = Symbol.for("fkn.remoteVideoElement"), ce = Symbol.for("fkn.remoteVideoElement.state"), le = Symbol.for("fkn.remoteVideoElement.controller"), ue = (e) => e ? Array.from({ length: e.length }, (t, n) => [e.start(n), e.end(n)]) : [], de = (e) => {
|
|
83
83
|
let t = {};
|
|
84
|
-
for (let n of [...
|
|
85
|
-
for (let n of
|
|
84
|
+
for (let n of [...ie, ...ae]) t[n] = e[n];
|
|
85
|
+
for (let n of oe) t[n] = ue(e[n]);
|
|
86
86
|
return t.error = e.error ? {
|
|
87
87
|
code: e.error.code,
|
|
88
88
|
message: e.error.message
|
|
89
89
|
} : null, t;
|
|
90
|
-
},
|
|
90
|
+
}, fe = (e) => {
|
|
91
91
|
let t = (t) => {
|
|
92
92
|
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
93
|
};
|
|
@@ -102,17 +102,17 @@ var re = (e, t) => {
|
|
|
102
102
|
return t(n), e[n][1];
|
|
103
103
|
}
|
|
104
104
|
};
|
|
105
|
-
},
|
|
105
|
+
}, pe = (e) => e ? {
|
|
106
106
|
code: e.code,
|
|
107
107
|
message: e.message,
|
|
108
108
|
MEDIA_ERR_ABORTED: 1,
|
|
109
109
|
MEDIA_ERR_NETWORK: 2,
|
|
110
110
|
MEDIA_ERR_DECODE: 3,
|
|
111
111
|
MEDIA_ERR_SRC_NOT_SUPPORTED: 4
|
|
112
|
-
} : null,
|
|
112
|
+
} : null, me = (e) => ne(e, (e, t) => ({
|
|
113
113
|
originalDetail: e instanceof CustomEvent ? e.detail : null,
|
|
114
|
-
snapshot:
|
|
115
|
-
})),
|
|
114
|
+
snapshot: de(t)
|
|
115
|
+
})), he = async (e, t) => {
|
|
116
116
|
switch (t) {
|
|
117
117
|
case "play": return await e.play(), null;
|
|
118
118
|
case "pause": return e.pause(), null;
|
|
@@ -127,19 +127,19 @@ var re = (e, t) => {
|
|
|
127
127
|
}
|
|
128
128
|
default: throw Error(`videoElement: unknown method "${t}"`);
|
|
129
129
|
}
|
|
130
|
-
},
|
|
131
|
-
call: async (t) =>
|
|
130
|
+
}, ge = (e) => ({
|
|
131
|
+
call: async (t) => he(e, t),
|
|
132
132
|
set: async (t, n) => {
|
|
133
133
|
try {
|
|
134
134
|
e[t] = n;
|
|
135
135
|
} catch {}
|
|
136
|
-
return
|
|
136
|
+
return de(e);
|
|
137
137
|
},
|
|
138
|
-
events:
|
|
139
|
-
}),
|
|
138
|
+
events: me(e)
|
|
139
|
+
}), _e = (e, t) => {
|
|
140
140
|
let n = new EventTarget();
|
|
141
|
-
Object.defineProperty(n,
|
|
142
|
-
let r =
|
|
141
|
+
Object.defineProperty(n, se, { value: !0 }), Object.defineProperty(n, ce, { value: e }), Object.defineProperty(n, le, { value: t });
|
|
142
|
+
let r = b({
|
|
143
143
|
target: n,
|
|
144
144
|
remoteEvents: t.events,
|
|
145
145
|
unenrich: (t, n) => {
|
|
@@ -174,7 +174,7 @@ var re = (e, t) => {
|
|
|
174
174
|
configurable: !0,
|
|
175
175
|
enumerable: !0,
|
|
176
176
|
get() {
|
|
177
|
-
return
|
|
177
|
+
return pe(e.error);
|
|
178
178
|
}
|
|
179
179
|
},
|
|
180
180
|
play: {
|
|
@@ -210,7 +210,7 @@ var re = (e, t) => {
|
|
|
210
210
|
value: 4
|
|
211
211
|
}
|
|
212
212
|
};
|
|
213
|
-
for (let n of
|
|
213
|
+
for (let n of ie) i[n] = {
|
|
214
214
|
configurable: !0,
|
|
215
215
|
enumerable: !0,
|
|
216
216
|
get() {
|
|
@@ -222,32 +222,32 @@ var re = (e, t) => {
|
|
|
222
222
|
}, () => {});
|
|
223
223
|
}
|
|
224
224
|
};
|
|
225
|
-
for (let t of
|
|
225
|
+
for (let t of ae) i[t] = {
|
|
226
226
|
configurable: !0,
|
|
227
227
|
enumerable: !0,
|
|
228
228
|
get() {
|
|
229
229
|
return e[t];
|
|
230
230
|
}
|
|
231
231
|
};
|
|
232
|
-
for (let t of
|
|
232
|
+
for (let t of oe) i[t] = {
|
|
233
233
|
configurable: !0,
|
|
234
234
|
enumerable: !0,
|
|
235
235
|
get() {
|
|
236
|
-
return
|
|
236
|
+
return fe(e[t]);
|
|
237
237
|
}
|
|
238
238
|
};
|
|
239
239
|
return Object.defineProperties(n, i), n;
|
|
240
|
-
},
|
|
240
|
+
}, ve = (e) => _e(de(e), ge(e)), ye = (e) => typeof e == "object" && !!e && e[se] === !0, be = (e, t) => {
|
|
241
241
|
let n = e;
|
|
242
242
|
return {
|
|
243
243
|
..._,
|
|
244
|
-
type:
|
|
245
|
-
initialState: n[
|
|
246
|
-
controller:
|
|
244
|
+
type: S,
|
|
245
|
+
initialState: n[ce],
|
|
246
|
+
controller: ee(n[le], t)
|
|
247
247
|
};
|
|
248
248
|
}, xe = (e, t) => {
|
|
249
|
-
let n =
|
|
250
|
-
return
|
|
249
|
+
let n = te(e.controller, t);
|
|
250
|
+
return _e({ ...e.initialState }, n);
|
|
251
251
|
}, Se = (e) => {
|
|
252
252
|
let t = [];
|
|
253
253
|
return e.forEach((e, n) => {
|
|
@@ -276,13 +276,13 @@ var re = (e, t) => {
|
|
|
276
276
|
status: e.status,
|
|
277
277
|
statusText: e.statusText,
|
|
278
278
|
headers: we.box(e.headers),
|
|
279
|
-
body: e.body ?
|
|
279
|
+
body: e.body ? ee(e.body, t) : null,
|
|
280
280
|
url: e.url,
|
|
281
281
|
redirected: e.redirected
|
|
282
282
|
}),
|
|
283
283
|
revive: (e, t) => {
|
|
284
284
|
if (e.status === 0) return Response.error();
|
|
285
|
-
let n = we.revive(e.headers), r = e.body ?
|
|
285
|
+
let n = we.revive(e.headers), r = e.body ? te(e.body, t) : null, i = Ee.has(e.status);
|
|
286
286
|
r && i && r.cancel().catch(() => {});
|
|
287
287
|
let a = new Response(i ? null : r, {
|
|
288
288
|
status: e.status,
|
|
@@ -298,7 +298,7 @@ var re = (e, t) => {
|
|
|
298
298
|
}), a;
|
|
299
299
|
}
|
|
300
300
|
}, Oe = (e) => [
|
|
301
|
-
|
|
301
|
+
x,
|
|
302
302
|
we,
|
|
303
303
|
De,
|
|
304
304
|
...e
|
|
@@ -365,7 +365,7 @@ var He = () => typeof document > "u" ? !1 : document.documentElement.dataset[je]
|
|
|
365
365
|
attributeFilter: [...Pe]
|
|
366
366
|
});
|
|
367
367
|
}), Ge, D = new Proxy({}, { get: (e, t) => async (...e) => {
|
|
368
|
-
await E(), Ge ??=
|
|
368
|
+
await E(), Ge ??= y({}, {
|
|
369
369
|
transport: window,
|
|
370
370
|
revivableModules: Oe
|
|
371
371
|
});
|
|
@@ -590,13 +590,13 @@ var Tt = (e, t, n) => {
|
|
|
590
590
|
function P(e) {
|
|
591
591
|
return e ? e.trim() : "";
|
|
592
592
|
}
|
|
593
|
-
function
|
|
593
|
+
function Dt(e, t) {
|
|
594
594
|
let n = e && typeof e.type == "string", r = n ? e : t;
|
|
595
595
|
for (let t in e) {
|
|
596
596
|
let n = e[t];
|
|
597
597
|
Array.isArray(n) ? n.forEach((e) => {
|
|
598
|
-
|
|
599
|
-
}) : n && typeof n == "object" &&
|
|
598
|
+
Dt(e, r);
|
|
599
|
+
}) : n && typeof n == "object" && Dt(n, r);
|
|
600
600
|
}
|
|
601
601
|
return n && Object.defineProperty(e, "parent", {
|
|
602
602
|
configurable: !0,
|
|
@@ -605,7 +605,7 @@ function F(e, t) {
|
|
|
605
605
|
value: t || null
|
|
606
606
|
}), e;
|
|
607
607
|
}
|
|
608
|
-
var
|
|
608
|
+
var Ot = class {
|
|
609
609
|
level = 0;
|
|
610
610
|
indentation = " ";
|
|
611
611
|
compress = !1;
|
|
@@ -755,7 +755,7 @@ var Dt = class {
|
|
|
755
755
|
declaration(e) {
|
|
756
756
|
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
757
|
}
|
|
758
|
-
},
|
|
758
|
+
}, kt = (e, t) => {
|
|
759
759
|
t ||= {};
|
|
760
760
|
let n = 1, r = 1;
|
|
761
761
|
function i() {
|
|
@@ -864,14 +864,14 @@ var Dt = class {
|
|
|
864
864
|
if (!s()) return o("missing '{'");
|
|
865
865
|
for (d(n); e.length && e.charAt(0) !== "}";) {
|
|
866
866
|
if (e.charAt(0) === "@") {
|
|
867
|
-
let e =
|
|
867
|
+
let e = x();
|
|
868
868
|
if (e) {
|
|
869
869
|
n.push(e), d(n);
|
|
870
870
|
continue;
|
|
871
871
|
}
|
|
872
872
|
}
|
|
873
873
|
if (g()) {
|
|
874
|
-
let e =
|
|
874
|
+
let e = S();
|
|
875
875
|
if (e) {
|
|
876
876
|
n.push(e), d(n);
|
|
877
877
|
continue;
|
|
@@ -896,14 +896,14 @@ var Dt = class {
|
|
|
896
896
|
let n = [];
|
|
897
897
|
for (u(), d(n); e.length && e.charAt(0) !== "}";) {
|
|
898
898
|
if (e.charAt(0) === "@") {
|
|
899
|
-
let e =
|
|
899
|
+
let e = x();
|
|
900
900
|
if (e) {
|
|
901
901
|
n.push(e), d(n);
|
|
902
902
|
continue;
|
|
903
903
|
}
|
|
904
904
|
}
|
|
905
905
|
if (g()) {
|
|
906
|
-
let e =
|
|
906
|
+
let e = S();
|
|
907
907
|
if (e) {
|
|
908
908
|
n.push(e), d(n);
|
|
909
909
|
continue;
|
|
@@ -924,7 +924,7 @@ var Dt = class {
|
|
|
924
924
|
}
|
|
925
925
|
return n;
|
|
926
926
|
}
|
|
927
|
-
function
|
|
927
|
+
function y() {
|
|
928
928
|
let t = [], n = i(), r = /^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/.exec(e);
|
|
929
929
|
for (; r;) {
|
|
930
930
|
let n = l(r);
|
|
@@ -938,8 +938,8 @@ var Dt = class {
|
|
|
938
938
|
declarations: h() || []
|
|
939
939
|
});
|
|
940
940
|
}
|
|
941
|
-
let
|
|
942
|
-
function
|
|
941
|
+
let ee = /* @__PURE__ */ RegExp("^@(top-left-corner|top-left|top-center|top-right|top-right-corner|bottom-left-corner|bottom-left|bottom-center|bottom-right|bottom-right-corner|left-top|left-middle|left-bottom|right-top|right-middle|right-bottom)(?![\\w-])\\s*"), te = b("import"), ne = b("charset"), re = b("namespace");
|
|
942
|
+
function b(t) {
|
|
943
943
|
let n = RegExp("^@" + t + "\\s*((?::?[^;'\"]|\"(?:\\\\\"|[^\"])*?\"|'(?:\\\\'|[^'])*?')+)(?:;|$)");
|
|
944
944
|
return () => {
|
|
945
945
|
let r = i(), a = n.exec(e);
|
|
@@ -948,7 +948,7 @@ var Dt = class {
|
|
|
948
948
|
return s[t] = o[1].trim(), r(s);
|
|
949
949
|
};
|
|
950
950
|
}
|
|
951
|
-
function
|
|
951
|
+
function x() {
|
|
952
952
|
if (e[0] === "@") return function() {
|
|
953
953
|
let t = i(), n = /^@([-\w]+)?keyframes\s*/.exec(e);
|
|
954
954
|
if (!n) return;
|
|
@@ -956,8 +956,8 @@ var Dt = class {
|
|
|
956
956
|
if (!a) return o("@keyframes missing name");
|
|
957
957
|
let u = l(a)[1];
|
|
958
958
|
if (!s()) return o("@keyframes missing '{'");
|
|
959
|
-
let f = d(), p =
|
|
960
|
-
for (; p;) f.push(p), f = f.concat(d()), p =
|
|
959
|
+
let f = d(), p = y();
|
|
960
|
+
for (; p;) f.push(p), f = f.concat(d()), p = y();
|
|
961
961
|
return c() ? t({
|
|
962
962
|
type: M.keyframes,
|
|
963
963
|
name: u,
|
|
@@ -995,7 +995,7 @@ var Dt = class {
|
|
|
995
995
|
supports: r,
|
|
996
996
|
rules: a
|
|
997
997
|
}) : o("@supports missing '}'");
|
|
998
|
-
}() ||
|
|
998
|
+
}() || te() || ne() || re() || function() {
|
|
999
999
|
let t = i(), n = /^@([-\w]+)?document *([^{]+)/.exec(e);
|
|
1000
1000
|
if (!n) return;
|
|
1001
1001
|
let r = l(n), a = P(r[1]), u = P(r[2]);
|
|
@@ -1016,7 +1016,7 @@ var Dt = class {
|
|
|
1016
1016
|
let a = [];
|
|
1017
1017
|
for (d(a); e.length && e.charAt(0) !== "}";) {
|
|
1018
1018
|
if (e.charAt(0) === "@") {
|
|
1019
|
-
let e =
|
|
1019
|
+
let e = x();
|
|
1020
1020
|
if (e) {
|
|
1021
1021
|
a.push(e), d(a);
|
|
1022
1022
|
continue;
|
|
@@ -1156,7 +1156,7 @@ var Dt = class {
|
|
|
1156
1156
|
declarations: a
|
|
1157
1157
|
}) : o("@position-try missing '}'");
|
|
1158
1158
|
}() || function() {
|
|
1159
|
-
let t = i(), n =
|
|
1159
|
+
let t = i(), n = ee.exec(e);
|
|
1160
1160
|
if (!n) return;
|
|
1161
1161
|
let r = l(n)[1];
|
|
1162
1162
|
if (!s()) return o(`@${r} missing '{'`);
|
|
@@ -1188,7 +1188,7 @@ var Dt = class {
|
|
|
1188
1188
|
});
|
|
1189
1189
|
}();
|
|
1190
1190
|
}
|
|
1191
|
-
function
|
|
1191
|
+
function S() {
|
|
1192
1192
|
let e = i(), t = p();
|
|
1193
1193
|
return t ? (d(), e({
|
|
1194
1194
|
type: M.rule,
|
|
@@ -1196,7 +1196,7 @@ var Dt = class {
|
|
|
1196
1196
|
declarations: _() || []
|
|
1197
1197
|
})) : o("selector missing");
|
|
1198
1198
|
}
|
|
1199
|
-
return
|
|
1199
|
+
return Dt(function() {
|
|
1200
1200
|
let n = function() {
|
|
1201
1201
|
let n, r = [];
|
|
1202
1202
|
for (u(), d(r); e.length;) {
|
|
@@ -1207,7 +1207,7 @@ var Dt = class {
|
|
|
1207
1207
|
}
|
|
1208
1208
|
break;
|
|
1209
1209
|
}
|
|
1210
|
-
if (n =
|
|
1210
|
+
if (n = x() || S(), !n) {
|
|
1211
1211
|
if (t?.silent) {
|
|
1212
1212
|
l([e.charAt(0)]), u(), d(r);
|
|
1213
1213
|
continue;
|
|
@@ -1227,66 +1227,66 @@ var Dt = class {
|
|
|
1227
1227
|
}
|
|
1228
1228
|
};
|
|
1229
1229
|
}());
|
|
1230
|
-
},
|
|
1230
|
+
}, At = (e, t) => new Ot(t || {}).compile(e), jt = Object.defineProperty, Mt = (e, t) => {
|
|
1231
1231
|
let n = {};
|
|
1232
|
-
for (var r in e)
|
|
1232
|
+
for (var r in e) jt(n, r, {
|
|
1233
1233
|
get: e[r],
|
|
1234
1234
|
enumerable: !0
|
|
1235
1235
|
});
|
|
1236
|
-
return t ||
|
|
1237
|
-
},
|
|
1238
|
-
name:
|
|
1236
|
+
return t || jt(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
1237
|
+
}, Nt = "LocatorError", Pt = "LocatorUnsupportedError", Ft = "LocatorDeniedError", It = "LocatorInvalidError", Lt = (e) => typeof e == "object" && e ? e.name : void 0, F = (e) => Object.assign(Error(e), { name: Nt }), I = (e, t = "", n) => Object.assign(Error(e), {
|
|
1238
|
+
name: Pt,
|
|
1239
1239
|
operation: t,
|
|
1240
1240
|
backend: n
|
|
1241
|
-
}),
|
|
1242
|
-
name:
|
|
1241
|
+
}), Rt = (e, t) => I(`Locator operation not supported${t ? ` on the ${t} backend` : ""}: ${e}`, e, t), L = (e, t) => Object.assign(Error(e), {
|
|
1242
|
+
name: Ft,
|
|
1243
1243
|
operation: t
|
|
1244
|
-
}),
|
|
1245
|
-
name:
|
|
1244
|
+
}), zt = (e, t) => Object.assign(Error(e), {
|
|
1245
|
+
name: It,
|
|
1246
1246
|
operation: t
|
|
1247
|
-
}),
|
|
1247
|
+
}), R = class extends Error {
|
|
1248
1248
|
name = "TimeoutError";
|
|
1249
1249
|
constructor(e, t) {
|
|
1250
1250
|
super(e, t?.cause === void 0 ? void 0 : { cause: t.cause });
|
|
1251
1251
|
}
|
|
1252
|
-
},
|
|
1252
|
+
}, Bt = (e) => Lt(e) === Pt, Vt = (e) => Lt(e) === Ft, Ht = (e) => Lt(e) === It, z = (e) => Vt(e) || Bt(e) || Ht(e), B = (e) => {
|
|
1253
1253
|
let t = (e.ownerDocument ?? e).defaultView;
|
|
1254
|
-
if (!t) throw
|
|
1254
|
+
if (!t) throw F("the resolved element belongs to a document with no window");
|
|
1255
1255
|
return t;
|
|
1256
|
-
},
|
|
1256
|
+
}, Ut = (e, t) => {
|
|
1257
1257
|
let n = e?.[t];
|
|
1258
1258
|
return typeof n == "function" ? n : null;
|
|
1259
|
-
},
|
|
1259
|
+
}, Wt = (e, t) => {
|
|
1260
1260
|
if (typeof e != "object" || !e) return null;
|
|
1261
1261
|
let n = (() => {
|
|
1262
1262
|
try {
|
|
1263
|
-
return
|
|
1263
|
+
return Ut(B(e), t);
|
|
1264
1264
|
} catch {
|
|
1265
1265
|
return null;
|
|
1266
1266
|
}
|
|
1267
1267
|
})();
|
|
1268
1268
|
if (n && e instanceof n) return n;
|
|
1269
|
-
let r =
|
|
1269
|
+
let r = Ut(globalThis, t);
|
|
1270
1270
|
return r && e instanceof r ? r : null;
|
|
1271
|
-
},
|
|
1272
|
-
if (e.length === 0) throw
|
|
1273
|
-
if (e.length > 1) throw
|
|
1271
|
+
}, V = (e, t) => Wt(e, t) !== null, H = (e) => {
|
|
1272
|
+
if (e.length === 0) throw F("No elements found");
|
|
1273
|
+
if (e.length > 1) throw F(`Strict mode violation: locator resolved to ${e.length} elements`);
|
|
1274
1274
|
return e[0];
|
|
1275
|
-
},
|
|
1276
|
-
if (!
|
|
1275
|
+
}, Gt = (e, t) => {
|
|
1276
|
+
if (!V(e, t)) throw F(`Strict mode violation: expected ${t}, got <${e.tagName.toLowerCase()}>`);
|
|
1277
1277
|
return e;
|
|
1278
|
-
},
|
|
1279
|
-
|
|
1280
|
-
},
|
|
1278
|
+
}, Kt = (e) => e.tagName.toLowerCase(), qt = /* @__PURE__ */ new Set(), Jt = (e) => {
|
|
1279
|
+
qt.add(e);
|
|
1280
|
+
}, Yt = /(?:^|[^\w-])(?:url|image|image-set|cross-fade|paint|element|expression)\s*\(/i, Xt = (e) => e.replace(/\\([0-9a-fA-F]{1,6})\s?/g, (e, t) => String.fromCodePoint(Number.parseInt(t, 16))).replace(/\\(.)/g, "$1"), Zt = (e) => !Yt.test(Xt(e.value)), Qt = /* @__PURE__ */ new Set([
|
|
1281
1281
|
M.import,
|
|
1282
1282
|
M.fontFace,
|
|
1283
1283
|
M.namespace,
|
|
1284
1284
|
M.charset,
|
|
1285
1285
|
M.document,
|
|
1286
1286
|
M.comment
|
|
1287
|
-
]),
|
|
1288
|
-
if (
|
|
1289
|
-
if (e.type === M.declaration) return
|
|
1287
|
+
]), $t = (e) => {
|
|
1288
|
+
if (Qt.has(e.type)) return null;
|
|
1289
|
+
if (e.type === M.declaration) return Zt(e) ? e : null;
|
|
1290
1290
|
let t = e, n = { ...t };
|
|
1291
1291
|
for (let e of [
|
|
1292
1292
|
"declarations",
|
|
@@ -1294,18 +1294,18 @@ var Dt = class {
|
|
|
1294
1294
|
"keyframes"
|
|
1295
1295
|
]) {
|
|
1296
1296
|
let r = t[e];
|
|
1297
|
-
Array.isArray(r) && (n[e] =
|
|
1297
|
+
Array.isArray(r) && (n[e] = en(r));
|
|
1298
1298
|
}
|
|
1299
1299
|
return n;
|
|
1300
|
-
},
|
|
1300
|
+
}, en = (e) => e.map((e) => $t(e)).filter((e) => e !== null), tn = (e) => {
|
|
1301
1301
|
let t;
|
|
1302
1302
|
try {
|
|
1303
|
-
t =
|
|
1303
|
+
t = kt(e, { silent: !0 });
|
|
1304
1304
|
} catch {
|
|
1305
1305
|
return "";
|
|
1306
1306
|
}
|
|
1307
|
-
return t.stylesheet.rules =
|
|
1308
|
-
},
|
|
1307
|
+
return t.stylesheet.rules = en(t.stylesheet.rules), At(t);
|
|
1308
|
+
}, nn = (e, t) => {
|
|
1309
1309
|
let n = () => {
|
|
1310
1310
|
t.parentNode || (e.head ?? e.documentElement).appendChild(t);
|
|
1311
1311
|
};
|
|
@@ -1322,30 +1322,30 @@ var Dt = class {
|
|
|
1322
1322
|
});
|
|
1323
1323
|
let i = () => r.disconnect(), a = e.defaultView;
|
|
1324
1324
|
a ? a.addEventListener("load", i, { once: !0 }) : setTimeout(i, 3e4);
|
|
1325
|
-
},
|
|
1325
|
+
}, rn = { resolve: (e, t) => {
|
|
1326
1326
|
let n = e.document.createElement("style");
|
|
1327
|
-
n.textContent = t.noSanitize ? t.content :
|
|
1327
|
+
n.textContent = t.noSanitize ? t.content : tn(t.content);
|
|
1328
1328
|
try {
|
|
1329
|
-
|
|
1329
|
+
nn(e.document, n);
|
|
1330
1330
|
} catch (e) {
|
|
1331
1331
|
console.error(e);
|
|
1332
1332
|
}
|
|
1333
|
-
|
|
1334
|
-
} },
|
|
1333
|
+
Jt(n);
|
|
1334
|
+
} }, an = (e) => {
|
|
1335
1335
|
let t = [];
|
|
1336
1336
|
return e.forEach((e, n) => {
|
|
1337
1337
|
t.push([n, e]);
|
|
1338
1338
|
}), t;
|
|
1339
|
-
},
|
|
1339
|
+
}, U = {
|
|
1340
1340
|
kind: "frame",
|
|
1341
1341
|
ensureArgs: (e) => [void 0, e],
|
|
1342
1342
|
resolve: async (e, t, n = {}) => {
|
|
1343
|
-
if (typeof t != "string") throw
|
|
1344
|
-
let r =
|
|
1343
|
+
if (typeof t != "string") throw zt("fetch: url must be a string", "fetch");
|
|
1344
|
+
let r = B(e.document), i;
|
|
1345
1345
|
try {
|
|
1346
1346
|
i = new r.URL(t, e.document.baseURI).href;
|
|
1347
1347
|
} catch {
|
|
1348
|
-
throw
|
|
1348
|
+
throw zt(`fetch: not a valid url: ${t}`, "fetch");
|
|
1349
1349
|
}
|
|
1350
1350
|
let a = await r.fetch(i, {
|
|
1351
1351
|
method: n.method ?? "GET",
|
|
@@ -1361,60 +1361,67 @@ var Dt = class {
|
|
|
1361
1361
|
url: a.url,
|
|
1362
1362
|
redirected: a.redirected,
|
|
1363
1363
|
type: a.type,
|
|
1364
|
-
headers:
|
|
1364
|
+
headers: an(a.headers),
|
|
1365
1365
|
body: await a.arrayBuffer()
|
|
1366
1366
|
};
|
|
1367
1367
|
}
|
|
1368
|
-
},
|
|
1369
|
-
click: () =>
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1368
|
+
}, W = /* @__PURE__ */ Mt({
|
|
1369
|
+
click: () => cn,
|
|
1370
|
+
clickAsInput: () => ln,
|
|
1371
|
+
count: () => _n,
|
|
1372
|
+
exists: () => vn,
|
|
1373
|
+
fill: () => pn,
|
|
1374
|
+
getAttribute: () => hn,
|
|
1375
|
+
hover: () => un,
|
|
1376
|
+
isVisible: () => gn,
|
|
1377
|
+
textContent: () => mn
|
|
1378
|
+
}), on = (e, t) => {
|
|
1378
1379
|
let n = e.getBoundingClientRect();
|
|
1379
1380
|
return {
|
|
1380
1381
|
clientX: n.left + n.width * (t?.x ?? .5),
|
|
1381
1382
|
clientY: n.top + n.height * (t?.y ?? .5)
|
|
1382
1383
|
};
|
|
1383
|
-
},
|
|
1384
|
-
let
|
|
1384
|
+
}, sn = (e, t, n, r) => {
|
|
1385
|
+
let i = H(e.elements), a = B(i), o = {
|
|
1385
1386
|
bubbles: !0,
|
|
1386
1387
|
cancelable: !0,
|
|
1387
1388
|
composed: !0,
|
|
1388
|
-
...
|
|
1389
|
+
...on(i, t.position),
|
|
1389
1390
|
button: 0
|
|
1390
|
-
},
|
|
1391
|
-
...
|
|
1391
|
+
}, s = {
|
|
1392
|
+
...o,
|
|
1392
1393
|
pointerType: "mouse",
|
|
1393
1394
|
pointerId: 1,
|
|
1394
1395
|
isPrimary: !0
|
|
1395
|
-
}
|
|
1396
|
-
|
|
1397
|
-
...a,
|
|
1396
|
+
}, c = n ? { detail: 1 } : {}, l = r(i, new a.PointerEvent("pointerdown", {
|
|
1397
|
+
...s,
|
|
1398
1398
|
buttons: 1
|
|
1399
|
-
}))
|
|
1400
|
-
|
|
1399
|
+
})) || !n;
|
|
1400
|
+
l && r(i, new a.MouseEvent("mousedown", {
|
|
1401
|
+
...o,
|
|
1402
|
+
...c,
|
|
1401
1403
|
buttons: 1
|
|
1402
|
-
})),
|
|
1403
|
-
...
|
|
1404
|
+
})), r(i, new a.PointerEvent("pointerup", {
|
|
1405
|
+
...s,
|
|
1404
1406
|
buttons: 0
|
|
1405
|
-
})),
|
|
1406
|
-
...
|
|
1407
|
+
})), l && r(i, new a.MouseEvent("mouseup", {
|
|
1408
|
+
...o,
|
|
1409
|
+
...c,
|
|
1407
1410
|
buttons: 0
|
|
1408
|
-
})), n
|
|
1409
|
-
...
|
|
1411
|
+
})), r(i, n ? new a.PointerEvent("click", {
|
|
1412
|
+
...s,
|
|
1413
|
+
...c,
|
|
1414
|
+
buttons: 0
|
|
1415
|
+
}) : new a.MouseEvent("click", {
|
|
1416
|
+
...o,
|
|
1410
1417
|
buttons: 0
|
|
1411
1418
|
}));
|
|
1412
|
-
} }, sn = { resolve: (e, t = {}) => {
|
|
1413
|
-
let n =
|
|
1419
|
+
}, cn = { resolve: (e, t = {}) => sn(e, t, !1, (e, t) => e.dispatchEvent(t)) }, ln = (e, t = {}, n) => sn(e, t, !0, n), un = { resolve: (e, t = {}) => {
|
|
1420
|
+
let n = H(e.elements), r = B(n), i = {
|
|
1414
1421
|
bubbles: !0,
|
|
1415
1422
|
cancelable: !0,
|
|
1416
1423
|
composed: !0,
|
|
1417
|
-
...
|
|
1424
|
+
...on(n, t.position)
|
|
1418
1425
|
}, a = {
|
|
1419
1426
|
...i,
|
|
1420
1427
|
pointerType: "mouse",
|
|
@@ -1428,11 +1435,11 @@ var Dt = class {
|
|
|
1428
1435
|
...i,
|
|
1429
1436
|
bubbles: !1
|
|
1430
1437
|
})), n.dispatchEvent(new r.MouseEvent("mouseover", i)), n.dispatchEvent(new r.PointerEvent("pointermove", a)), n.dispatchEvent(new r.MouseEvent("mousemove", i));
|
|
1431
|
-
} },
|
|
1438
|
+
} }, dn = (e, t) => {
|
|
1432
1439
|
e._valueTracker?.setValue("");
|
|
1433
|
-
let n = (
|
|
1440
|
+
let n = (Wt(e, "HTMLTextAreaElement") ?? Wt(e, "HTMLInputElement"))?.prototype, r = n && Object.getOwnPropertyDescriptor(n, "value")?.set;
|
|
1434
1441
|
r ? r.call(e, t) : e.value = t;
|
|
1435
|
-
},
|
|
1442
|
+
}, fn = (e, t) => {
|
|
1436
1443
|
if (e.type !== "range") return null;
|
|
1437
1444
|
let n = Number(e.min || 0), r = Number(e.max || 100);
|
|
1438
1445
|
if (!Number.isFinite(n) || !Number.isFinite(r) || r <= n) return null;
|
|
@@ -1469,56 +1476,56 @@ var Dt = class {
|
|
|
1469
1476
|
buttons: 0
|
|
1470
1477
|
}
|
|
1471
1478
|
};
|
|
1472
|
-
},
|
|
1473
|
-
let r =
|
|
1474
|
-
if (a ||
|
|
1475
|
-
let e = r, n = a ?
|
|
1476
|
-
n && (r.dispatchEvent(new i.PointerEvent("pointerdown", n.pointerDown)), r.dispatchEvent(new i.MouseEvent("mousedown", n.mouseDown))),
|
|
1477
|
-
} else if (
|
|
1478
|
-
else throw Error(`fill: element <${
|
|
1479
|
-
} },
|
|
1480
|
-
let n =
|
|
1481
|
-
if (!
|
|
1482
|
-
let r =
|
|
1479
|
+
}, pn = { resolve: (e, t, n = {}) => {
|
|
1480
|
+
let r = H(e.elements), i = B(r), a = V(r, "HTMLInputElement");
|
|
1481
|
+
if (a || V(r, "HTMLTextAreaElement")) {
|
|
1482
|
+
let e = r, n = a ? fn(e, t) : null;
|
|
1483
|
+
n && (r.dispatchEvent(new i.PointerEvent("pointerdown", n.pointerDown)), r.dispatchEvent(new i.MouseEvent("mousedown", n.mouseDown))), dn(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
|
+
} else if (V(r, "HTMLElement") && r.isContentEditable) r.textContent = t, r.dispatchEvent(new i.Event("input", { bubbles: !0 }));
|
|
1485
|
+
else throw Error(`fill: element <${Kt(r)}> is not fillable`);
|
|
1486
|
+
} }, mn = { resolve: (e, t = {}) => H(e.elements).textContent }, hn = { resolve: (e, t, n = {}) => H(e.elements).getAttribute(t) }, gn = { resolve: (e, t = {}) => {
|
|
1487
|
+
let n = H(e.elements);
|
|
1488
|
+
if (!V(n, "HTMLElement")) return !0;
|
|
1489
|
+
let r = B(n).getComputedStyle(n);
|
|
1483
1490
|
if (r?.display === "none" || r?.visibility === "hidden") return !1;
|
|
1484
1491
|
let i = n.getBoundingClientRect();
|
|
1485
1492
|
return i.width > 0 && i.height > 0;
|
|
1486
|
-
} },
|
|
1493
|
+
} }, _n = { resolve: (e, t = {}) => e.elements.length }, vn = { resolve: (e, t = {}) => e.elements.length > 0 }, G = (e, t) => (e.topLevel ? [e.document] : e.elements).flatMap((e) => [...e.querySelectorAll(t)]), yn = (e) => e.replaceAll("\"", "\\\""), bn = {
|
|
1487
1494
|
to: "element",
|
|
1488
1495
|
css: !0,
|
|
1489
|
-
resolve: (e, t) =>
|
|
1496
|
+
resolve: (e, t) => G(e, t),
|
|
1490
1497
|
render: (e) => ({
|
|
1491
1498
|
fragment: typeof e == "string" ? e : "?",
|
|
1492
1499
|
separator: "descend"
|
|
1493
1500
|
})
|
|
1494
|
-
},
|
|
1501
|
+
}, xn = {
|
|
1495
1502
|
to: "frame",
|
|
1496
1503
|
css: !0,
|
|
1497
1504
|
barrier: "down",
|
|
1498
|
-
resolve: (e, t) =>
|
|
1505
|
+
resolve: (e, t) => G(e, t),
|
|
1499
1506
|
render: (e) => ({
|
|
1500
1507
|
fragment: typeof e == "string" ? e : "?",
|
|
1501
1508
|
separator: "down"
|
|
1502
1509
|
})
|
|
1503
|
-
},
|
|
1510
|
+
}, Sn = {
|
|
1504
1511
|
element: {
|
|
1505
1512
|
selectors: {
|
|
1506
|
-
locator:
|
|
1507
|
-
frameLocator:
|
|
1513
|
+
locator: bn,
|
|
1514
|
+
frameLocator: xn,
|
|
1508
1515
|
getByRole: {
|
|
1509
1516
|
to: "element",
|
|
1510
|
-
resolve: (e, t) =>
|
|
1511
|
-
render: (e) => ({ fragment: typeof e == "string" ? `[role="${
|
|
1517
|
+
resolve: (e, t) => G(e, `[role="${CSS.escape(t)}"]`),
|
|
1518
|
+
render: (e) => ({ fragment: typeof e == "string" ? `[role="${yn(e)}"]` : "[role]" })
|
|
1512
1519
|
},
|
|
1513
1520
|
getByText: {
|
|
1514
1521
|
to: "element",
|
|
1515
1522
|
resolve: (e, t) => e.elements.flatMap((e) => [e, ...e.querySelectorAll("*")]).filter((e) => e.textContent?.includes(t)),
|
|
1516
|
-
render: (e) => ({ fragment: typeof e == "string" ? `:has-text("${
|
|
1523
|
+
render: (e) => ({ fragment: typeof e == "string" ? `:has-text("${yn(e)}")` : ":has-text(...)" })
|
|
1517
1524
|
},
|
|
1518
1525
|
getByTestId: {
|
|
1519
1526
|
to: "element",
|
|
1520
|
-
resolve: (e, t) =>
|
|
1521
|
-
render: (e) => ({ fragment: typeof e == "string" ? `[data-testid="${
|
|
1527
|
+
resolve: (e, t) => G(e, `[data-testid="${CSS.escape(t)}"]`),
|
|
1528
|
+
render: (e) => ({ fragment: typeof e == "string" ? `[data-testid="${yn(e)}"]` : "[data-testid]" })
|
|
1522
1529
|
},
|
|
1523
1530
|
first: {
|
|
1524
1531
|
to: "element",
|
|
@@ -1535,20 +1542,20 @@ var Dt = class {
|
|
|
1535
1542
|
}
|
|
1536
1543
|
},
|
|
1537
1544
|
operations: {
|
|
1538
|
-
click:
|
|
1539
|
-
fill:
|
|
1540
|
-
hover:
|
|
1541
|
-
textContent:
|
|
1542
|
-
getAttribute:
|
|
1543
|
-
isVisible:
|
|
1544
|
-
count:
|
|
1545
|
-
exists:
|
|
1545
|
+
click: cn,
|
|
1546
|
+
fill: pn,
|
|
1547
|
+
hover: un,
|
|
1548
|
+
textContent: mn,
|
|
1549
|
+
getAttribute: hn,
|
|
1550
|
+
isVisible: gn,
|
|
1551
|
+
count: _n,
|
|
1552
|
+
exists: vn
|
|
1546
1553
|
}
|
|
1547
1554
|
},
|
|
1548
1555
|
frame: {
|
|
1549
1556
|
selectors: {
|
|
1550
|
-
locator:
|
|
1551
|
-
frameLocator:
|
|
1557
|
+
locator: bn,
|
|
1558
|
+
frameLocator: xn,
|
|
1552
1559
|
owner: {
|
|
1553
1560
|
to: "frame",
|
|
1554
1561
|
barrier: "up",
|
|
@@ -1562,11 +1569,11 @@ var Dt = class {
|
|
|
1562
1569
|
}
|
|
1563
1570
|
},
|
|
1564
1571
|
operations: {
|
|
1565
|
-
addStyleTag:
|
|
1566
|
-
fetch:
|
|
1572
|
+
addStyleTag: rn,
|
|
1573
|
+
fetch: U
|
|
1567
1574
|
}
|
|
1568
1575
|
}
|
|
1569
|
-
},
|
|
1576
|
+
}, Cn = (e, t = Sn) => ({
|
|
1570
1577
|
element: {
|
|
1571
1578
|
selectors: {
|
|
1572
1579
|
...t.element.selectors,
|
|
@@ -1587,31 +1594,31 @@ var Dt = class {
|
|
|
1587
1594
|
...e.frame?.operations
|
|
1588
1595
|
}
|
|
1589
1596
|
}
|
|
1590
|
-
}),
|
|
1597
|
+
}), wn = 3e4, Tn = 50, K = (e) => {
|
|
1591
1598
|
let t = e[e.length - 1];
|
|
1592
1599
|
return typeof t == "object" && t ? t : void 0;
|
|
1593
|
-
},
|
|
1594
|
-
let t =
|
|
1595
|
-
return typeof t == "number" ? t :
|
|
1596
|
-
},
|
|
1600
|
+
}, En = (e) => {
|
|
1601
|
+
let t = K(e)?.timeout;
|
|
1602
|
+
return typeof t == "number" ? t : wn;
|
|
1603
|
+
}, Dn = ({ executor: e, parts: t }) => ({ highlight: (n) => e.highlight(t, n).then(() => {}, () => {}) }), On = async (e) => {
|
|
1597
1604
|
let t = {
|
|
1598
1605
|
parts: e.parts,
|
|
1599
1606
|
operation: e.operation,
|
|
1600
1607
|
args: e.args,
|
|
1601
1608
|
phase: "ensure"
|
|
1602
1609
|
};
|
|
1603
|
-
await e.gate?.(t,
|
|
1604
|
-
},
|
|
1610
|
+
await e.gate?.(t, Dn(e));
|
|
1611
|
+
}, kn = (e, t) => {
|
|
1605
1612
|
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`);
|
|
1606
|
-
},
|
|
1613
|
+
}, An = (e) => typeof e == "object" && e && typeof e.message == "string" ? e.message : String(e), jn = async (e) => {
|
|
1607
1614
|
let { executor: t, gate: n, parts: r, operation: i, args: a } = e;
|
|
1608
|
-
|
|
1615
|
+
kn(i, K(a)?.timeout), n && await n({
|
|
1609
1616
|
parts: r,
|
|
1610
1617
|
operation: i,
|
|
1611
1618
|
args: a,
|
|
1612
1619
|
phase: "execute"
|
|
1613
|
-
},
|
|
1614
|
-
let o =
|
|
1620
|
+
}, Dn(e));
|
|
1621
|
+
let o = En(a), s = Date.now() + o, c = /* @__PURE__ */ Error(`Locator timeout (${o}ms): ${i}`), { promise: l, reject: u } = Promise.withResolvers();
|
|
1615
1622
|
l.catch(() => {});
|
|
1616
1623
|
let d = setTimeout(() => u(c), o), f = c;
|
|
1617
1624
|
try {
|
|
@@ -1620,48 +1627,48 @@ var Dt = class {
|
|
|
1620
1627
|
return await Promise.race([t.execute(r, i, a), l]);
|
|
1621
1628
|
} catch (e) {
|
|
1622
1629
|
if (e === c) break;
|
|
1623
|
-
if (
|
|
1630
|
+
if (z(e)) throw e;
|
|
1624
1631
|
f = e;
|
|
1625
1632
|
let t = s - Date.now();
|
|
1626
1633
|
if (t <= 0) break;
|
|
1627
|
-
await new Promise((e) => setTimeout(e, Math.min(
|
|
1634
|
+
await new Promise((e) => setTimeout(e, Math.min(Tn, t)));
|
|
1628
1635
|
}
|
|
1629
1636
|
while (Date.now() < s);
|
|
1630
1637
|
} finally {
|
|
1631
1638
|
clearTimeout(d);
|
|
1632
1639
|
}
|
|
1633
|
-
throw f === c ? new
|
|
1634
|
-
},
|
|
1640
|
+
throw f === c ? new R(c.message) : new R(An(f), { cause: f });
|
|
1641
|
+
}, Mn = (e, t, n, r, i) => {
|
|
1635
1642
|
let a = {};
|
|
1636
|
-
for (let [o, s] of Object.entries(t[r].selectors)) a[o] = (...a) =>
|
|
1643
|
+
for (let [o, s] of Object.entries(t[r].selectors)) a[o] = (...a) => Mn(e, t, n, s.to, [...i, {
|
|
1637
1644
|
kind: r,
|
|
1638
1645
|
name: o,
|
|
1639
1646
|
args: a
|
|
1640
1647
|
}]);
|
|
1641
|
-
for (let [n, o] of Object.entries(t[r].operations)) a[n] = async (...t) =>
|
|
1648
|
+
for (let [n, o] of Object.entries(t[r].operations)) a[n] = async (...t) => jn({
|
|
1642
1649
|
...e,
|
|
1643
1650
|
parts: i,
|
|
1644
1651
|
operation: n,
|
|
1645
1652
|
args: o.send ? o.send(...t) : t
|
|
1646
1653
|
});
|
|
1647
|
-
for (let [o, { to: s, rewrite: c }] of Object.entries(n[r] ?? {})) a[o] = (...r) =>
|
|
1654
|
+
for (let [o, { to: s, rewrite: c }] of Object.entries(n[r] ?? {})) a[o] = (...r) => Mn(e, t, n, s, c(i, ...r));
|
|
1648
1655
|
return a.ensure = (n, a = {}) => {
|
|
1649
1656
|
let o = t[r].operations[n]?.ensureArgs;
|
|
1650
|
-
return
|
|
1657
|
+
return On({
|
|
1651
1658
|
...e,
|
|
1652
1659
|
parts: i,
|
|
1653
1660
|
operation: n,
|
|
1654
1661
|
args: o?.(a) ?? [a]
|
|
1655
1662
|
});
|
|
1656
1663
|
}, a;
|
|
1657
|
-
},
|
|
1664
|
+
}, Nn = (e) => Mn(e, e.modules ?? Sn, e.rewrites ?? {}, "frame", []), Pn = () => {
|
|
1658
1665
|
let e = T();
|
|
1659
1666
|
return e.status === "ok" && e.abi >= 2;
|
|
1660
|
-
},
|
|
1667
|
+
}, Fn = async () => {
|
|
1661
1668
|
await E();
|
|
1662
1669
|
let e = T();
|
|
1663
1670
|
if (e.status === "ok" && e.abi < 2) throw new C(e.abi, 2);
|
|
1664
|
-
},
|
|
1671
|
+
}, In = (e) => `Read the text, links and details ${e} shows.`, Ln = (e) => `Inject unfiltered styles or code into ${e}. This can pass page details along to other sites.`, Rn = [
|
|
1665
1672
|
{
|
|
1666
1673
|
id: "interaction",
|
|
1667
1674
|
heading: "Interaction",
|
|
@@ -1676,9 +1683,9 @@ var Dt = class {
|
|
|
1676
1683
|
heading: "Site data",
|
|
1677
1684
|
summary: "Can read the website's data",
|
|
1678
1685
|
title: (e) => `Read data from ${e}`,
|
|
1679
|
-
description:
|
|
1686
|
+
description: In,
|
|
1680
1687
|
cloudTitle: (e) => `Read what's on ${e}`,
|
|
1681
|
-
cloudDescription:
|
|
1688
|
+
cloudDescription: In
|
|
1682
1689
|
},
|
|
1683
1690
|
{
|
|
1684
1691
|
id: "network",
|
|
@@ -1694,11 +1701,11 @@ var Dt = class {
|
|
|
1694
1701
|
heading: "Evaluation",
|
|
1695
1702
|
summary: "Can execute arbitrary code on the website",
|
|
1696
1703
|
title: (e) => `Run code on ${e}`,
|
|
1697
|
-
description:
|
|
1704
|
+
description: Ln,
|
|
1698
1705
|
cloudTitle: (e) => `Run its own code on ${e}`,
|
|
1699
|
-
cloudDescription:
|
|
1706
|
+
cloudDescription: Ln
|
|
1700
1707
|
}
|
|
1701
|
-
],
|
|
1708
|
+
], zn = (e) => (t) => {
|
|
1702
1709
|
if (typeof t != "object" || !t) return t === void 0 ? [] : [t];
|
|
1703
1710
|
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`);
|
|
1704
1711
|
let { relativePosition: n, ...r } = t;
|
|
@@ -1706,46 +1713,46 @@ var Dt = class {
|
|
|
1706
1713
|
...r,
|
|
1707
1714
|
position: n
|
|
1708
1715
|
}];
|
|
1709
|
-
},
|
|
1716
|
+
}, Bn = async (e, t, n) => {
|
|
1710
1717
|
try {
|
|
1711
|
-
return await
|
|
1718
|
+
return await U.resolve(e, t, n);
|
|
1712
1719
|
} catch (e) {
|
|
1713
|
-
throw
|
|
1720
|
+
throw z(e) ? e : L(`frame.fetch: ${e instanceof Error ? `${e.name}: ${e.message}` : String(e)}; not retried, since the request may already have been sent`, "fetch");
|
|
1714
1721
|
}
|
|
1715
|
-
},
|
|
1722
|
+
}, Vn = Cn({
|
|
1716
1723
|
element: { operations: {
|
|
1717
1724
|
click: {
|
|
1718
|
-
resolve: (e, t = {}) =>
|
|
1719
|
-
send:
|
|
1725
|
+
resolve: (e, t = {}) => W.click.resolve(e, t),
|
|
1726
|
+
send: zn("click")
|
|
1720
1727
|
},
|
|
1721
1728
|
hover: {
|
|
1722
|
-
resolve: (e, t = {}) =>
|
|
1723
|
-
send:
|
|
1729
|
+
resolve: (e, t = {}) => W.hover.resolve(e, t),
|
|
1730
|
+
send: zn("hover")
|
|
1724
1731
|
},
|
|
1725
|
-
fill: { resolve: (e, t, n = {}) =>
|
|
1726
|
-
textContent: { resolve: (e, t = {}) =>
|
|
1727
|
-
getAttribute: { resolve: (e, t, n = {}) =>
|
|
1728
|
-
isVisible: { resolve: (e, t = {}) =>
|
|
1729
|
-
count: { resolve: (e, t = {}) =>
|
|
1730
|
-
exists: { resolve: (e, t = {}) =>
|
|
1731
|
-
videoElement: { resolve: (e, t = {}) =>
|
|
1732
|
+
fill: { resolve: (e, t, n = {}) => W.fill.resolve(e, t, n) },
|
|
1733
|
+
textContent: { resolve: (e, t = {}) => W.textContent.resolve(e) },
|
|
1734
|
+
getAttribute: { resolve: (e, t, n = {}) => W.getAttribute.resolve(e, t) },
|
|
1735
|
+
isVisible: { resolve: (e, t = {}) => W.isVisible.resolve(e) },
|
|
1736
|
+
count: { resolve: (e, t = {}) => W.count.resolve(e) },
|
|
1737
|
+
exists: { resolve: (e, t = {}) => W.exists.resolve(e) },
|
|
1738
|
+
videoElement: { resolve: (e, t = {}) => ve(Gt(H(e.elements), "HTMLVideoElement")) }
|
|
1732
1739
|
} },
|
|
1733
1740
|
frame: { operations: {
|
|
1734
|
-
addStyleTag: { resolve: (e, t) =>
|
|
1741
|
+
addStyleTag: { resolve: (e, t) => rn.resolve(e, t) },
|
|
1735
1742
|
fetch: {
|
|
1736
|
-
resolve: (e, t, n = {}) =>
|
|
1737
|
-
kind:
|
|
1738
|
-
ensureArgs:
|
|
1743
|
+
resolve: (e, t, n = {}) => Bn(e, t, n),
|
|
1744
|
+
kind: U.kind,
|
|
1745
|
+
ensureArgs: U.ensureArgs
|
|
1739
1746
|
},
|
|
1740
1747
|
evaluate: {
|
|
1741
1748
|
kind: "frame",
|
|
1742
1749
|
typed: !1,
|
|
1743
1750
|
resolve: (e, t, n) => {
|
|
1744
|
-
throw
|
|
1751
|
+
throw Rt("evaluate", "this realm");
|
|
1745
1752
|
}
|
|
1746
1753
|
}
|
|
1747
1754
|
} }
|
|
1748
|
-
}),
|
|
1755
|
+
}), Hn = (e) => e[e.length - 1], Un = {
|
|
1749
1756
|
element: {
|
|
1750
1757
|
last: {
|
|
1751
1758
|
to: "element",
|
|
@@ -1758,7 +1765,7 @@ var Dt = class {
|
|
|
1758
1765
|
contentFrame: {
|
|
1759
1766
|
to: "frame",
|
|
1760
1767
|
rewrite: (e) => {
|
|
1761
|
-
let t =
|
|
1768
|
+
let t = Hn(e);
|
|
1762
1769
|
if (t?.name !== "locator") throw TypeError("locator.contentFrame: only a locator that ends in locator(selector) can enter its frame; use frameLocator(selector)");
|
|
1763
1770
|
return [...e.slice(0, -1), {
|
|
1764
1771
|
...t,
|
|
@@ -1771,7 +1778,7 @@ var Dt = class {
|
|
|
1771
1778
|
owner: {
|
|
1772
1779
|
to: "element",
|
|
1773
1780
|
rewrite: (e) => {
|
|
1774
|
-
let t =
|
|
1781
|
+
let t = Hn(e);
|
|
1775
1782
|
if (t?.name !== "frameLocator") throw TypeError("frameLocator.owner: this frame was not entered through frameLocator(selector)");
|
|
1776
1783
|
return [...e.slice(0, -1), {
|
|
1777
1784
|
...t,
|
|
@@ -1788,7 +1795,7 @@ var Dt = class {
|
|
|
1788
1795
|
}]
|
|
1789
1796
|
}
|
|
1790
1797
|
}
|
|
1791
|
-
},
|
|
1798
|
+
}, Wn = (e) => {
|
|
1792
1799
|
if (!e || e === "about:blank") return !1;
|
|
1793
1800
|
let t;
|
|
1794
1801
|
try {
|
|
@@ -1797,45 +1804,45 @@ var Dt = class {
|
|
|
1797
1804
|
return !1;
|
|
1798
1805
|
}
|
|
1799
1806
|
return t.protocol === "chrome-extension:" || t.protocol === "moz-extension:" || t.protocol !== "about:" && k(t.hostname);
|
|
1800
|
-
},
|
|
1801
|
-
if (
|
|
1802
|
-
},
|
|
1807
|
+
}, q = (e) => {
|
|
1808
|
+
if (Wn(e)) throw Error("attachFrame: refusing to target the extension's own pages or an FKN platform origin");
|
|
1809
|
+
}, Gn = ({ src: e, domains: t, lockdown: n }) => {
|
|
1803
1810
|
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");
|
|
1804
|
-
},
|
|
1811
|
+
}, Kn = {
|
|
1805
1812
|
scope: "embed.iframe",
|
|
1806
1813
|
category: "interaction",
|
|
1807
1814
|
severity: 0,
|
|
1808
1815
|
title: "Load another website inside this app",
|
|
1809
1816
|
description: "Lets the app embed external pages directly inside its own view."
|
|
1810
|
-
},
|
|
1817
|
+
}, qn = {
|
|
1811
1818
|
scope: "embed.open",
|
|
1812
1819
|
category: "interaction",
|
|
1813
1820
|
severity: 0,
|
|
1814
1821
|
title: "Open a website inside this app",
|
|
1815
1822
|
description: "Lets the app navigate to another site without leaving its window."
|
|
1816
|
-
},
|
|
1823
|
+
}, Jn = ["load", "commit"], Yn = (e) => {
|
|
1817
1824
|
if ("timeoutMs" in e) throw TypeError("frame.goto: pass timeout, in milliseconds; timeoutMs is not an option");
|
|
1818
1825
|
let { waitUntil: t, timeout: n } = e;
|
|
1819
|
-
if (t !== void 0 && !
|
|
1826
|
+
if (t !== void 0 && !Jn.includes(t)) throw TypeError(`frame.goto: waitUntil must be 'load' or 'commit', not ${JSON.stringify(t)}`);
|
|
1820
1827
|
if (n !== void 0 && typeof n != "number") throw TypeError("frame.goto: timeout must be a number of milliseconds");
|
|
1821
|
-
|
|
1822
|
-
},
|
|
1828
|
+
kn("frame.goto", n);
|
|
1829
|
+
}, Xn = class extends Error {
|
|
1823
1830
|
name = "FrameWindowBlockedError";
|
|
1824
1831
|
constructor() {
|
|
1825
1832
|
super("attachFrame: the browser did not open the window. Call attachFrame directly in a click or key handler, and allow popups for this page");
|
|
1826
1833
|
}
|
|
1827
|
-
},
|
|
1834
|
+
}, Zn = /* @__PURE__ */ new Set([
|
|
1828
1835
|
"jar-unreachable",
|
|
1829
1836
|
"bad-url",
|
|
1830
1837
|
"opaque-opener"
|
|
1831
|
-
]),
|
|
1838
|
+
]), Qn = class extends Error {
|
|
1832
1839
|
name = "FrameWindowRefusedError";
|
|
1833
1840
|
reason;
|
|
1834
1841
|
constructor(e) {
|
|
1835
|
-
let t =
|
|
1842
|
+
let t = Zn.has(e) ? e : "unknown";
|
|
1836
1843
|
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;
|
|
1837
1844
|
}
|
|
1838
|
-
},
|
|
1845
|
+
}, $n = ["message", "document"], er = (e) => {
|
|
1839
1846
|
if (e === "*") return "*";
|
|
1840
1847
|
let t = () => /* @__PURE__ */ TypeError(`frame.postMessage: targetOrigin must be '*' or an origin, not ${JSON.stringify(e)}`);
|
|
1841
1848
|
if (typeof e != "string") throw t();
|
|
@@ -1847,48 +1854,48 @@ var Dt = class {
|
|
|
1847
1854
|
}
|
|
1848
1855
|
if (n === "null") throw t();
|
|
1849
1856
|
return n;
|
|
1850
|
-
},
|
|
1857
|
+
}, tr = (e, t) => {
|
|
1851
1858
|
let n = typeof e == "object" && !!e;
|
|
1852
1859
|
if (n && t !== void 0) throw TypeError("frame.postMessage: pass transfer inside the options object, not after it");
|
|
1853
1860
|
let r = n ? e.targetOrigin ?? "*" : e ?? "*", i = n ? e.transfer : t;
|
|
1854
1861
|
if (i !== void 0 && !Array.isArray(i)) throw TypeError("frame.postMessage: transfer must be an array");
|
|
1855
1862
|
return {
|
|
1856
|
-
targetOrigin:
|
|
1863
|
+
targetOrigin: er(r),
|
|
1857
1864
|
transfer: i === void 0 ? [] : [...i]
|
|
1858
1865
|
};
|
|
1859
|
-
},
|
|
1866
|
+
}, nr = [
|
|
1860
1867
|
"url",
|
|
1861
1868
|
"path",
|
|
1862
1869
|
"type"
|
|
1863
|
-
],
|
|
1870
|
+
], rr = ["content", "sourceUrl"], ir = /[\n\r\u2028\u2029]/, ar = (e) => {
|
|
1864
1871
|
if (typeof e != "object" || !e || Array.isArray(e)) throw TypeError("frame.addScriptTag: options must be an object { content }");
|
|
1865
|
-
let t = Object.keys(e), n = t.find((e) =>
|
|
1872
|
+
let t = Object.keys(e), n = t.find((e) => nr.includes(e));
|
|
1866
1873
|
if (n !== void 0) throw TypeError(`frame.addScriptTag: "${n}" is not served; it runs content as a classic inline script`);
|
|
1867
|
-
let r = t.find((e) => !
|
|
1874
|
+
let r = t.find((e) => !rr.includes(e));
|
|
1868
1875
|
if (r !== void 0) throw TypeError(`frame.addScriptTag: unknown option "${r}"`);
|
|
1869
1876
|
let { content: i, sourceUrl: a } = e;
|
|
1870
1877
|
if (typeof i != "string") throw TypeError("frame.addScriptTag: content must be a string");
|
|
1871
|
-
if (a !== void 0 && (typeof a != "string" || a === "" ||
|
|
1878
|
+
if (a !== void 0 && (typeof a != "string" || a === "" || ir.test(a))) throw TypeError("frame.addScriptTag: sourceUrl must be a non-empty string with no line break");
|
|
1872
1879
|
return a === void 0 ? { content: i } : {
|
|
1873
1880
|
content: i,
|
|
1874
1881
|
sourceUrl: a
|
|
1875
1882
|
};
|
|
1876
|
-
},
|
|
1883
|
+
}, or = [
|
|
1877
1884
|
"name",
|
|
1878
1885
|
"domain",
|
|
1879
1886
|
"path"
|
|
1880
|
-
],
|
|
1887
|
+
], sr = (e) => e instanceof RegExp || Object.prototype.toString.call(e) === "[object RegExp]", cr = (e) => {
|
|
1881
1888
|
if (e === void 0) return {};
|
|
1882
1889
|
if (Object.prototype.toString.call(e) !== "[object Object]") throw TypeError("frame.clearCookies: options must be an object");
|
|
1883
|
-
let t = e, n = Object.keys(t).find((e) => !
|
|
1890
|
+
let t = e, n = Object.keys(t).find((e) => !or.includes(e));
|
|
1884
1891
|
if (n !== void 0) throw TypeError(`frame.clearCookies: unknown option "${n}"`);
|
|
1885
|
-
let r =
|
|
1892
|
+
let r = or.flatMap((e) => {
|
|
1886
1893
|
let n = t[e];
|
|
1887
1894
|
return n === void 0 ? [] : [{
|
|
1888
1895
|
key: e,
|
|
1889
1896
|
value: n
|
|
1890
1897
|
}];
|
|
1891
|
-
}), i = r.find(({ value: e }) =>
|
|
1898
|
+
}), i = r.find(({ value: e }) => sr(e));
|
|
1892
1899
|
if (i !== void 0) throw TypeError(`frame.clearCookies: ${i.key} is a RegExp, and clearCookies takes strings for name, domain and path for now`);
|
|
1893
1900
|
let a = r.find(({ value: e }) => typeof e != "string");
|
|
1894
1901
|
if (a !== void 0) throw TypeError(`frame.clearCookies: ${a.key} must be a string`);
|
|
@@ -1897,17 +1904,17 @@ var Dt = class {
|
|
|
1897
1904
|
let s = {};
|
|
1898
1905
|
for (let { key: e, value: t } of r) s[e] = { equals: t };
|
|
1899
1906
|
return s;
|
|
1900
|
-
},
|
|
1907
|
+
}, lr = (e) => {
|
|
1901
1908
|
typeof globalThis.reportError == "function" ? globalThis.reportError(e) : console.error(e);
|
|
1902
|
-
},
|
|
1903
|
-
let { owner: t, ...n } =
|
|
1909
|
+
}, ur = (e) => {
|
|
1910
|
+
let { owner: t, ...n } = Nn({
|
|
1904
1911
|
executor: e.executor,
|
|
1905
|
-
modules:
|
|
1906
|
-
rewrites:
|
|
1912
|
+
modules: Vn,
|
|
1913
|
+
rewrites: Un,
|
|
1907
1914
|
gate: async (t, n) => {
|
|
1908
|
-
A(t.operation,
|
|
1915
|
+
A(t.operation, K(t.args)?.reason), await e.gate?.(t, n);
|
|
1909
1916
|
}
|
|
1910
|
-
}), r = async (t, n = {}) => (
|
|
1917
|
+
}), r = async (t, n = {}) => (q(t), Yn(n), e.goto(t, n)), i = () => e.url(), a = async (t) => {
|
|
1911
1918
|
for (let e of t) A("frame.requestPermissions", e?.reason);
|
|
1912
1919
|
let n = e.requestPermissions;
|
|
1913
1920
|
if (!n) throw Error("frame.requestPermissions: this backend cannot ask for permission categories");
|
|
@@ -1919,18 +1926,18 @@ var Dt = class {
|
|
|
1919
1926
|
if (typeof i != "string") throw TypeError("frame.evaluate: pass a function or a source string");
|
|
1920
1927
|
return r(i, structuredClone(n));
|
|
1921
1928
|
}, s = async (t) => {
|
|
1922
|
-
let { content: n, ...r } =
|
|
1929
|
+
let { content: n, ...r } = ar(t), i = e.addScriptTag;
|
|
1923
1930
|
if (!i) throw Error("frame.addScriptTag: this backend cannot run scripts in the attached frame");
|
|
1924
1931
|
await i(n, r);
|
|
1925
1932
|
}, c = async (t) => {
|
|
1926
|
-
let n =
|
|
1933
|
+
let n = cr(t), r = e.clearCookies;
|
|
1927
1934
|
if (!r) throw Error("frame.clearCookies: this backend cannot clear cookies");
|
|
1928
1935
|
await r(n);
|
|
1929
1936
|
}, l = ((t, n, r) => {
|
|
1930
1937
|
try {
|
|
1931
1938
|
let i = e.postMessage;
|
|
1932
1939
|
if (!i) throw Error("frame.postMessage: this backend cannot message the attached frame");
|
|
1933
|
-
let a =
|
|
1940
|
+
let a = tr(n, r);
|
|
1934
1941
|
return i(t, a.targetOrigin, a.transfer);
|
|
1935
1942
|
} catch (e) {
|
|
1936
1943
|
return Promise.reject(e);
|
|
@@ -1939,7 +1946,7 @@ var Dt = class {
|
|
|
1939
1946
|
message: /* @__PURE__ */ new Set(),
|
|
1940
1947
|
document: /* @__PURE__ */ new Set()
|
|
1941
1948
|
}, d = null, f = (e, t) => {
|
|
1942
|
-
if (
|
|
1949
|
+
if (!$n.includes(e)) throw TypeError(`frame.${t}: the event type must be ${$n.map((e) => `'${e}'`).join(" or ")}, not ${JSON.stringify(e)}`);
|
|
1943
1950
|
return u[e];
|
|
1944
1951
|
}, p = (e) => {
|
|
1945
1952
|
let t = e.type === "message" ? Object.freeze({
|
|
@@ -1955,7 +1962,7 @@ var Dt = class {
|
|
|
1955
1962
|
for (let n of [...u[e.type]]) try {
|
|
1956
1963
|
n(t);
|
|
1957
1964
|
} catch (e) {
|
|
1958
|
-
|
|
1965
|
+
lr(e);
|
|
1959
1966
|
}
|
|
1960
1967
|
}, m = (e, t) => {
|
|
1961
1968
|
if (f(e, "off").delete(t), d !== null && !u.message.size && !u.document.size) {
|
|
@@ -1988,7 +1995,7 @@ var Dt = class {
|
|
|
1988
1995
|
off: m
|
|
1989
1996
|
};
|
|
1990
1997
|
return _;
|
|
1991
|
-
},
|
|
1998
|
+
}, dr = [
|
|
1992
1999
|
h,
|
|
1993
2000
|
t,
|
|
1994
2001
|
g,
|
|
@@ -2002,8 +2009,8 @@ var Dt = class {
|
|
|
2002
2009
|
l,
|
|
2003
2010
|
f,
|
|
2004
2011
|
u,
|
|
2005
|
-
|
|
2006
|
-
|
|
2012
|
+
Kn,
|
|
2013
|
+
qn,
|
|
2007
2014
|
m,
|
|
2008
2015
|
r,
|
|
2009
2016
|
rt,
|
|
@@ -2011,34 +2018,34 @@ var Dt = class {
|
|
|
2011
2018
|
at,
|
|
2012
2019
|
vt,
|
|
2013
2020
|
bt
|
|
2014
|
-
],
|
|
2021
|
+
], fr = Rn.map((e) => e.id), pr = {
|
|
2015
2022
|
interaction: "act.click",
|
|
2016
2023
|
storage: "read.text",
|
|
2017
2024
|
network: "network.fetchCredentialed",
|
|
2018
2025
|
evaluation: "media.appearU"
|
|
2019
|
-
},
|
|
2026
|
+
}, mr = (e) => e === 0 ? "auto" : e === 4 ? "critical" : "bundled", hr = dr, J = /* @__PURE__ */ new Map(), gr = {};
|
|
2020
2027
|
(() => {
|
|
2021
|
-
|
|
2022
|
-
let e = (e) =>
|
|
2023
|
-
Object.fromEntries(
|
|
2028
|
+
J = new Map(hr.map((e) => [e.scope, e])), gr = Object.fromEntries(J), hr.filter((e) => e.severity === 4).map((e) => e.scope);
|
|
2029
|
+
let e = (e) => hr.filter((t) => t.category === e && mr(t.severity) === "bundled");
|
|
2030
|
+
Object.fromEntries(fr.map((t) => [t, Math.max(0, ...e(t).map((e) => e.severity))])), Object.fromEntries(fr.map((t) => [t, e(t).some((e) => e.unsafe === !0)]));
|
|
2024
2031
|
})();
|
|
2025
|
-
var
|
|
2026
|
-
let t =
|
|
2027
|
-
return t &&
|
|
2028
|
-
},
|
|
2029
|
-
let t =
|
|
2030
|
-
if (t) return
|
|
2031
|
-
},
|
|
2032
|
-
let n = t ?? (e &&
|
|
2033
|
-
return n !== void 0 &&
|
|
2034
|
-
},
|
|
2035
|
-
for (let { category: n, key: r } of t) if (
|
|
2032
|
+
var _r = (e) => J.get(e)?.category, vr = (e) => {
|
|
2033
|
+
let t = J.get(e);
|
|
2034
|
+
return t && mr(t.severity);
|
|
2035
|
+
}, yr = (e) => {
|
|
2036
|
+
let t = J.get(e);
|
|
2037
|
+
if (t) return mr(t.severity) === "critical" ? t.scope : t.category;
|
|
2038
|
+
}, br = (e) => pr[e], xr = ({ category: e, key: t }) => {
|
|
2039
|
+
let n = t ?? (e && br(e));
|
|
2040
|
+
return n !== void 0 && _r(n) !== void 0 ? n : void 0;
|
|
2041
|
+
}, Sr = (e, t) => {
|
|
2042
|
+
for (let { category: n, key: r } of t) if (xr({
|
|
2036
2043
|
category: n,
|
|
2037
2044
|
key: r
|
|
2038
2045
|
}) === 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}"`);
|
|
2039
|
-
},
|
|
2046
|
+
}, Cr = (e, t = {}) => {
|
|
2040
2047
|
let n = [], r = e.map((e) => {
|
|
2041
|
-
let r =
|
|
2048
|
+
let r = xr(e), i = [];
|
|
2042
2049
|
if (r !== void 0) for (let a of e.hosts) i.push(n.length), n.push({
|
|
2043
2050
|
...t,
|
|
2044
2051
|
key: r,
|
|
@@ -2048,8 +2055,8 @@ var mr = (e) => Y.get(e)?.category, hr = (e) => {
|
|
|
2048
2055
|
reason: e.reason
|
|
2049
2056
|
});
|
|
2050
2057
|
return {
|
|
2051
|
-
key: r !== void 0 &&
|
|
2052
|
-
category: r === void 0 ? e.category ?? "interaction" :
|
|
2058
|
+
key: r !== void 0 && vr(r) === "critical" ? r : void 0,
|
|
2059
|
+
category: r === void 0 ? e.category ?? "interaction" : gr[r].category,
|
|
2053
2060
|
hosts: e.hosts,
|
|
2054
2061
|
indexes: i
|
|
2055
2062
|
};
|
|
@@ -2063,30 +2070,30 @@ var mr = (e) => Y.get(e)?.category, hr = (e) => {
|
|
|
2063
2070
|
allow: i.length > 0 && i.every((t) => e[t]?.allow === !0)
|
|
2064
2071
|
}))
|
|
2065
2072
|
};
|
|
2066
|
-
},
|
|
2067
|
-
typeof window < "u" &&
|
|
2068
|
-
if (!
|
|
2073
|
+
}, wr = (e) => typeof e == "object" && !!e, Tr = typeof chrome < "u" && !!chrome.runtime?.id, Er = (e) => wr(e) && e.FKN_WEB_EXTENSION_FRAME_ANNOUNCE_KEY === !0 && typeof e.frameId == "string" && typeof e.document == "string", Dr = /* @__PURE__ */ new WeakMap(), Or = /* @__PURE__ */ new WeakMap(), kr = /* @__PURE__ */ new WeakMap(), Ar = /* @__PURE__ */ new Set();
|
|
2074
|
+
typeof window < "u" && Tr && window.addEventListener("message", (e) => {
|
|
2075
|
+
if (!Er(e.data)) return;
|
|
2069
2076
|
e.stopImmediatePropagation();
|
|
2070
2077
|
let t = e.source;
|
|
2071
2078
|
if (!t || typeof t != "object") return;
|
|
2072
|
-
let n = t, r =
|
|
2073
|
-
if (
|
|
2074
|
-
let o =
|
|
2079
|
+
let n = t, r = Dr.get(n), i = e.data.frameId, a = e.data.document;
|
|
2080
|
+
if (Dr.set(n, i), Or.set(n, a), r) for (let e of Ar) e(r);
|
|
2081
|
+
let o = kr.get(n);
|
|
2075
2082
|
if (o) {
|
|
2076
2083
|
for (let e of [...o]) (e.notDocument === void 0 || e.notDocument !== a) && (o.delete(e), e.resolve(i));
|
|
2077
|
-
o.size ||
|
|
2084
|
+
o.size || kr.delete(n);
|
|
2078
2085
|
}
|
|
2079
2086
|
}, { capture: !0 });
|
|
2080
2087
|
// ../web-extension/lib/lib/evaluate-deadline.js
|
|
2081
|
-
var
|
|
2088
|
+
var jr = 3e4, Mr = `frame.evaluate: the code did not settle within ${jr}ms`, Nr = () => new R(Mr), Pr = (e) => Ht(e) && e.message === Mr ? Nr() : e, Fr = [
|
|
2082
2089
|
/^frame load timed out after \d+ms for /,
|
|
2083
2090
|
/^frame goto: documentstart timed out$/,
|
|
2084
2091
|
/^navigation to .+ did not commit a document within \d+ms$/s
|
|
2085
|
-
],
|
|
2086
|
-
if (e instanceof
|
|
2092
|
+
], Ir = (e) => {
|
|
2093
|
+
if (e instanceof R) return e;
|
|
2087
2094
|
let t = typeof e?.message == "string" ? e.message : "";
|
|
2088
|
-
return
|
|
2089
|
-
},
|
|
2095
|
+
return Fr.some((e) => e.test(t)) ? new R(t) : e;
|
|
2096
|
+
}, Lr = (e) => {
|
|
2090
2097
|
let t = e;
|
|
2091
2098
|
if (t.window === void 0) return "iframe";
|
|
2092
2099
|
if (t.iframe !== void 0) throw TypeError("attachFrame: pass either iframe or window, not both");
|
|
@@ -2094,11 +2101,11 @@ var Or = 3e4, kr = `frame.evaluate: the code did not settle within ${Or}ms`, Ar
|
|
|
2094
2101
|
if (t.blank !== void 0) throw TypeError("attachFrame: blank does not apply to a window");
|
|
2095
2102
|
if (typeof t.window != "object" || t.window === null) throw TypeError("attachFrame: window must be an object");
|
|
2096
2103
|
return "window";
|
|
2097
|
-
},
|
|
2104
|
+
}, Rr = (e, t, n) => {
|
|
2098
2105
|
if (e === void 0) return t;
|
|
2099
2106
|
if (typeof e != "number" || !Number.isFinite(e) || e <= 0) throw TypeError(`attachFrame: window.${n} must be a positive number of CSS pixels`);
|
|
2100
2107
|
return Math.round(e);
|
|
2101
|
-
},
|
|
2108
|
+
}, zr = ({ url: e, width: t, height: n }) => {
|
|
2102
2109
|
let r = (() => {
|
|
2103
2110
|
if (e === void 0 || e === "" || e === "about:blank") return "";
|
|
2104
2111
|
if (typeof e != "string") throw TypeError("attachFrame: window.url must be a string");
|
|
@@ -2112,12 +2119,12 @@ var Or = 3e4, kr = `frame.evaluate: the code did not settle within ${Or}ms`, Ar
|
|
|
2112
2119
|
if (t.protocol !== "http:" && t.protocol !== "https:") throw TypeError("attachFrame: window.url must be an http or https address");
|
|
2113
2120
|
return t.href;
|
|
2114
2121
|
})();
|
|
2115
|
-
return r &&
|
|
2122
|
+
return r && q(r), {
|
|
2116
2123
|
url: r,
|
|
2117
|
-
width:
|
|
2118
|
-
height:
|
|
2124
|
+
width: Rr(t, 500, "width"),
|
|
2125
|
+
height: Rr(n, 700, "height")
|
|
2119
2126
|
};
|
|
2120
|
-
},
|
|
2127
|
+
}, Br = "attachFrame: storageState seeds a fresh jar, so it needs cookies: 'ephemeral'", Vr = 1e11, Hr = [
|
|
2121
2128
|
"name",
|
|
2122
2129
|
"value",
|
|
2123
2130
|
"domain",
|
|
@@ -2126,11 +2133,11 @@ var Or = 3e4, kr = `frame.evaluate: the code did not settle within ${Or}ms`, Ar
|
|
|
2126
2133
|
"httpOnly",
|
|
2127
2134
|
"secure",
|
|
2128
2135
|
"sameSite"
|
|
2129
|
-
],
|
|
2136
|
+
], Ur = [
|
|
2130
2137
|
"Strict",
|
|
2131
2138
|
"Lax",
|
|
2132
2139
|
"None"
|
|
2133
|
-
],
|
|
2140
|
+
], Y = /[;\x00-\x1f\x7f]/, X = (e, t) => /* @__PURE__ */ TypeError(`attachFrame: storageState${e} ${t}`), Z = (e) => Object.prototype.toString.call(e) === "[object Object]", Wr = (e) => {
|
|
2134
2141
|
let t = e.startsWith(".") ? e.slice(1) : e;
|
|
2135
2142
|
if (t === "") return null;
|
|
2136
2143
|
try {
|
|
@@ -2138,19 +2145,19 @@ var Or = 3e4, kr = `frame.evaluate: the code did not settle within ${Or}ms`, Ar
|
|
|
2138
2145
|
} catch {
|
|
2139
2146
|
return null;
|
|
2140
2147
|
}
|
|
2141
|
-
},
|
|
2148
|
+
}, Gr = (e, t) => {
|
|
2142
2149
|
if (!Z(e)) throw X(t, "must be an object");
|
|
2143
|
-
let n = Object.keys(e).find((e) => !
|
|
2150
|
+
let n = Object.keys(e).find((e) => !Hr.includes(e));
|
|
2144
2151
|
if (n !== void 0) throw X(`${t}.${n}`, "is not a cookie field");
|
|
2145
2152
|
let { name: r, value: i, domain: a, path: o, expires: s, httpOnly: c, secure: l, sameSite: u } = e;
|
|
2146
|
-
if (typeof r != "string" || r === "" || r.includes("=") ||
|
|
2147
|
-
if (typeof i != "string" ||
|
|
2148
|
-
if (typeof a != "string" ||
|
|
2149
|
-
if (o !== void 0 && (typeof o != "string" || !o.startsWith("/") ||
|
|
2153
|
+
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
|
+
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" || Wr(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
|
+
if (o !== void 0 && (typeof o != "string" || !o.startsWith("/") || Y.test(o))) throw X(`${t}.path`, "must be a string starting with \"/\"");
|
|
2150
2157
|
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");
|
|
2151
2158
|
if (c !== void 0 && typeof c != "boolean") throw X(`${t}.httpOnly`, "must be a boolean");
|
|
2152
2159
|
if (l !== void 0 && typeof l != "boolean") throw X(`${t}.secure`, "must be a boolean");
|
|
2153
|
-
if (u !== void 0 && !
|
|
2160
|
+
if (u !== void 0 && !Ur.includes(u)) throw X(`${t}.sameSite`, `must be 'Strict', 'Lax' or 'None', not ${JSON.stringify(u)}`);
|
|
2154
2161
|
let d = r.toLowerCase();
|
|
2155
2162
|
if (u === "None" && l !== !0) throw X(t, "is SameSite=None, which needs secure: true");
|
|
2156
2163
|
if (d.startsWith("__secure-") && l !== !0) throw X(t, "is a __Secure- cookie, which needs secure: true");
|
|
@@ -2161,7 +2168,7 @@ var Or = 3e4, kr = `frame.evaluate: the code did not settle within ${Or}ms`, Ar
|
|
|
2161
2168
|
domain: a
|
|
2162
2169
|
};
|
|
2163
2170
|
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;
|
|
2164
|
-
},
|
|
2171
|
+
}, Kr = (e, t) => {
|
|
2165
2172
|
if (!Z(e)) throw X(t, "must be an object { origin, localStorage }");
|
|
2166
2173
|
let n = Object.keys(e).find((e) => e !== "origin" && e !== "localStorage");
|
|
2167
2174
|
if (n !== void 0) throw X(`${t}.${n}`, "is not an origin field");
|
|
@@ -2185,30 +2192,30 @@ var Or = 3e4, kr = `frame.evaluate: the code did not settle within ${Or}ms`, Ar
|
|
|
2185
2192
|
};
|
|
2186
2193
|
})
|
|
2187
2194
|
};
|
|
2188
|
-
},
|
|
2195
|
+
}, qr = (e) => {
|
|
2189
2196
|
if (!Z(e)) throw X("", "must be an object { cookies?, origins? }");
|
|
2190
2197
|
let t = Object.keys(e).find((e) => e !== "cookies" && e !== "origins");
|
|
2191
2198
|
if (t !== void 0) throw X(`.${t}`, "is not a storageState key; it takes cookies and origins");
|
|
2192
2199
|
let { cookies: n = [], origins: r = [] } = e;
|
|
2193
2200
|
if (!Array.isArray(n)) throw X(".cookies", "must be an array");
|
|
2194
2201
|
if (!Array.isArray(r)) throw X(".origins", "must be an array");
|
|
2195
|
-
let i = n.map((e, t) =>
|
|
2202
|
+
let i = n.map((e, t) => Gr(e, `.cookies[${t}]`)), a = r.map((e, t) => Kr(e, `.origins[${t}]`));
|
|
2196
2203
|
return i.forEach(({ expires: e }, t) => {
|
|
2197
|
-
if (e !== void 0 && e > 0 && e <
|
|
2204
|
+
if (e !== void 0 && e > 0 && e < Vr) 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`);
|
|
2198
2205
|
}), {
|
|
2199
2206
|
cookies: i,
|
|
2200
2207
|
origins: a
|
|
2201
2208
|
};
|
|
2202
|
-
},
|
|
2209
|
+
}, Jr = [
|
|
2203
2210
|
"persistent",
|
|
2204
2211
|
"ephemeral",
|
|
2205
2212
|
"native"
|
|
2206
|
-
],
|
|
2207
|
-
if ("syncCookies" in e) throw TypeError(
|
|
2213
|
+
], Yr = "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'", Xr = (e) => {
|
|
2214
|
+
if ("syncCookies" in e) throw TypeError(Yr);
|
|
2208
2215
|
let { cookies: t = "persistent" } = e;
|
|
2209
|
-
if (!
|
|
2210
|
-
if (e.storageState !== void 0 && t !== "ephemeral") throw TypeError(
|
|
2211
|
-
let n = e.storageState === void 0 ? void 0 :
|
|
2216
|
+
if (!Jr.includes(t)) throw TypeError(`attachFrame: cookies must be 'persistent', 'ephemeral' or 'native', not ${JSON.stringify(t)}`);
|
|
2217
|
+
if (e.storageState !== void 0 && t !== "ephemeral") throw TypeError(Br);
|
|
2218
|
+
let n = e.storageState === void 0 ? void 0 : qr(e.storageState), r = Lr(e);
|
|
2212
2219
|
if (r === "iframe" && e.lockdown && t !== "native") throw TypeError("attachFrame: lockdown runs on the extension, which serves only cookies: 'native'");
|
|
2213
2220
|
if (Array.isArray(e.permissions)) for (let t of e.permissions) A("attachFrame", t?.reason);
|
|
2214
2221
|
return n === void 0 ? {
|
|
@@ -2219,9 +2226,9 @@ var Or = 3e4, kr = `frame.evaluate: the code did not settle within ${Or}ms`, Ar
|
|
|
2219
2226
|
cookies: t,
|
|
2220
2227
|
storageState: n
|
|
2221
2228
|
};
|
|
2222
|
-
},
|
|
2223
|
-
|
|
2224
|
-
},
|
|
2229
|
+
}, Zr = "FKN_WEB_EXTENSION_ATTACH_FRAME_EVENT_KEY", Qr = !1, $r = () => {
|
|
2230
|
+
Qr || (Qr = !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."));
|
|
2231
|
+
}, ei = "frame: this frame no longer holds the document the app attached it to", ti = "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", ni = () => {
|
|
2225
2232
|
let e = T();
|
|
2226
2233
|
if (e.status === "ok" && e.abi >= 1) return;
|
|
2227
2234
|
let t = e.status === "absent" ? 0 : e.abi;
|
|
@@ -2235,16 +2242,19 @@ var Or = 3e4, kr = `frame.evaluate: the code did not settle within ${Or}ms`, Ar
|
|
|
2235
2242
|
}, $ = () => {
|
|
2236
2243
|
let e = T();
|
|
2237
2244
|
return e.status === "absent" ? 0 : e.abi;
|
|
2238
|
-
},
|
|
2245
|
+
}, ri = "attachFrame: a blank page is served by the cloud render proxy only; call cloud.attachFrame", ii = "frame.addScriptTag: an extension frame does not run scripts through mirage yet; attach with cloud.attachFrame", ai = "click: isTrusted is served by the cloud render proxy only; attach with cloud.attachFrame", oi = "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", si = ({ executeLocator: e, highlightLocator: t, ensureLocatorPermission: n, requestCategories: r, evaluateFrame: i, goto: a }, { hosts: o, url: s, page: c, unreachable: l, documents: u, navigated: d }) => {
|
|
2239
2246
|
let f = new Set(p(o, { ipv6: !0 })), m = (e) => f.has(p([_t(e)], { ipv6: !0 })[0] ?? "");
|
|
2240
|
-
return
|
|
2247
|
+
return ur({
|
|
2241
2248
|
backend: "extension",
|
|
2242
2249
|
executor: {
|
|
2243
2250
|
execute: e,
|
|
2244
2251
|
highlight: t
|
|
2245
2252
|
},
|
|
2246
|
-
gate: (e) =>
|
|
2247
|
-
|
|
2253
|
+
gate: (e) => {
|
|
2254
|
+
if (e.operation === "click" && K(e.args)?.isTrusted === !0) throw new w("click", $(), ai);
|
|
2255
|
+
return n(e.parts, e.operation, e.args);
|
|
2256
|
+
},
|
|
2257
|
+
requestPermissions: async (e) => (Sr("frame.requestPermissions", e), await Fn(), r(e)),
|
|
2248
2258
|
evaluate: async (e, t) => {
|
|
2249
2259
|
if (!ze(T(), "evaluate")) {
|
|
2250
2260
|
let e = T();
|
|
@@ -2254,25 +2264,25 @@ var Or = 3e4, kr = `frame.evaluate: the code did not settle within ${Or}ms`, Ar
|
|
|
2254
2264
|
source: e,
|
|
2255
2265
|
arg: t
|
|
2256
2266
|
}).catch((e) => {
|
|
2257
|
-
throw
|
|
2267
|
+
throw Pr(e);
|
|
2258
2268
|
});
|
|
2259
2269
|
},
|
|
2260
2270
|
addScriptTag: async () => {
|
|
2261
|
-
throw new w("addScriptTag", $(),
|
|
2271
|
+
throw new w("addScriptTag", $(), ii);
|
|
2262
2272
|
},
|
|
2263
2273
|
clearCookies: async () => {
|
|
2264
|
-
throw new w("clearCookies", $(),
|
|
2274
|
+
throw new w("clearCookies", $(), oi);
|
|
2265
2275
|
},
|
|
2266
2276
|
postMessage: (e, t, n) => {
|
|
2267
|
-
if (t === "*") throw
|
|
2268
|
-
if (!m(t)) throw
|
|
2277
|
+
if (t === "*") throw I(ti, "postMessage", "extension");
|
|
2278
|
+
if (!m(t)) throw L(ei, "postMessage");
|
|
2269
2279
|
let r = l();
|
|
2270
2280
|
if (r) throw r;
|
|
2271
2281
|
return c().postMessage(e, t, n), Promise.resolve();
|
|
2272
2282
|
},
|
|
2273
2283
|
listen: (e) => {
|
|
2274
2284
|
let t = (t) => {
|
|
2275
|
-
t.source !== null && t.source === c() && !
|
|
2285
|
+
t.source !== null && t.source === c() && !Er(t.data) && m(t.origin) && e({
|
|
2276
2286
|
type: "message",
|
|
2277
2287
|
data: t.data,
|
|
2278
2288
|
origin: t.origin,
|
|
@@ -2297,21 +2307,21 @@ var Or = 3e4, kr = `frame.evaluate: the code did not settle within ${Or}ms`, Ar
|
|
|
2297
2307
|
...t === void 0 ? {} : { waitUntil: t === "commit" ? "documentstart" : t },
|
|
2298
2308
|
...n === void 0 ? {} : { timeoutMs: n }
|
|
2299
2309
|
}).catch((e) => {
|
|
2300
|
-
throw
|
|
2310
|
+
throw Ir(e);
|
|
2301
2311
|
});
|
|
2302
2312
|
},
|
|
2303
2313
|
url: s
|
|
2304
2314
|
});
|
|
2305
|
-
},
|
|
2306
|
-
if (i !== void 0) throw new w("blank", $(),
|
|
2315
|
+
}, ci = async ({ iframe: e, domains: t = [], lockdown: n = !1, permissions: r, blank: i }) => {
|
|
2316
|
+
if (i !== void 0) throw new w("blank", $(), ri);
|
|
2307
2317
|
let a = crypto.randomUUID();
|
|
2308
|
-
if (
|
|
2318
|
+
if (q(e.src), Gn({
|
|
2309
2319
|
src: e.src,
|
|
2310
2320
|
domains: t,
|
|
2311
2321
|
lockdown: n
|
|
2312
|
-
}), j("attachFrame", t), await E(), n &&
|
|
2313
|
-
e.dispatchEvent(new CustomEvent(
|
|
2314
|
-
let o =
|
|
2322
|
+
}), j("attachFrame", t), await E(), n && ni(), !e.isConnected) throw Error("attachFrame: the iframe must be connected to the document before attaching");
|
|
2323
|
+
e.dispatchEvent(new CustomEvent(Zr, { detail: a }));
|
|
2324
|
+
let o = si(await D.attachFrame({
|
|
2315
2325
|
marker: a,
|
|
2316
2326
|
domains: t,
|
|
2317
2327
|
syncCookies: !0,
|
|
@@ -2320,17 +2330,17 @@ var Or = 3e4, kr = `frame.evaluate: the code did not settle within ${Or}ms`, Ar
|
|
|
2320
2330
|
hosts: [...t, Q(e.src)],
|
|
2321
2331
|
url: () => e.src,
|
|
2322
2332
|
page: () => e.contentWindow,
|
|
2323
|
-
unreachable: () => e.contentWindow === null ?
|
|
2333
|
+
unreachable: () => e.contentWindow === null ? L("frame: navigate the frame before postMessage", "postMessage") : void 0,
|
|
2324
2334
|
documents: (t) => (e.addEventListener("load", t), () => e.removeEventListener("load", t))
|
|
2325
2335
|
});
|
|
2326
|
-
return r?.length && (
|
|
2327
|
-
},
|
|
2328
|
-
let { domains: t = [], permissions: n } = e, { url: r, width: i, height: a } =
|
|
2336
|
+
return r?.length && (Pn() ? await o.requestPermissions(r) : $r()), o;
|
|
2337
|
+
}, li = "attachFrame: a window on cookies: 'native' needs the FKN WebExtension, which is not on this page", ui = "frame.postMessage: this window's page no longer keeps a link to the app's page, so a message cannot reach it", di = "extension.attachFrame: the attached window closed; attach a fresh window", fi = (e) => `attachFrame: cookies: '${e}' runs on the cloud render proxy; call cloud.attachFrame or the top-level attachFrame`, pi = async (e) => {
|
|
2338
|
+
let { domains: t = [], permissions: n } = e, { url: r, width: i, height: a } = zr(e.window);
|
|
2329
2339
|
j("attachFrame", t);
|
|
2330
2340
|
let o = T();
|
|
2331
|
-
if (!ze(o, "attachWindow")) throw o.status === "absent" ? new w("attachWindow", 0,
|
|
2341
|
+
if (!ze(o, "attachWindow")) throw o.status === "absent" ? new w("attachWindow", 0, li) : new w("attachWindow", o.abi);
|
|
2332
2342
|
let s = window.open(r || "about:blank", "_blank", `popup,width=${i},height=${a}`);
|
|
2333
|
-
if (!s) throw new
|
|
2343
|
+
if (!s) throw new Xn();
|
|
2334
2344
|
let c;
|
|
2335
2345
|
try {
|
|
2336
2346
|
c = await D.attachWindow({
|
|
@@ -2347,11 +2357,11 @@ var Or = 3e4, kr = `frame.evaluate: the code did not settle within ${Or}ms`, Ar
|
|
|
2347
2357
|
u = !0;
|
|
2348
2358
|
}, () => {
|
|
2349
2359
|
u = !0;
|
|
2350
|
-
}), f = r, p =
|
|
2360
|
+
}), f = r, p = si(c, {
|
|
2351
2361
|
hosts: r ? [...t, Q(r)] : t,
|
|
2352
2362
|
url: () => f,
|
|
2353
2363
|
page: () => s,
|
|
2354
|
-
unreachable: () => u ?
|
|
2364
|
+
unreachable: () => u ? I(di, "postMessage", "extension") : s.closed ? L(ui, "postMessage") : void 0,
|
|
2355
2365
|
documents: (e) => {
|
|
2356
2366
|
let t = !0;
|
|
2357
2367
|
return (async () => {
|
|
@@ -2384,11 +2394,11 @@ var Or = 3e4, kr = `frame.evaluate: the code did not settle within ${Or}ms`, Ar
|
|
|
2384
2394
|
throw await h(), e;
|
|
2385
2395
|
}
|
|
2386
2396
|
return g;
|
|
2387
|
-
},
|
|
2388
|
-
let { kind: t, cookies: n } =
|
|
2389
|
-
if (n !== "native") throw new w("cookies", $(),
|
|
2390
|
-
return t === "window" ?
|
|
2391
|
-
}),
|
|
2397
|
+
}, mi = (async (e) => {
|
|
2398
|
+
let { kind: t, cookies: n } = Xr(e);
|
|
2399
|
+
if (n !== "native") throw new w("cookies", $(), fi(n));
|
|
2400
|
+
return t === "window" ? pi(e) : ci(e);
|
|
2401
|
+
}), hi = "permissions.request: pass hosts, the sites the grant applies to", gi = { request: async (e) => {
|
|
2392
2402
|
let t = e.map((e) => {
|
|
2393
2403
|
let { category: t, key: n, scope: r, reason: i, hosts: a } = e;
|
|
2394
2404
|
if (A("permissions.request", i), !("hosts" in e) && !("category" in e)) return { legacy: {
|
|
@@ -2397,7 +2407,7 @@ var Or = 3e4, kr = `frame.evaluate: the code did not settle within ${Or}ms`, Ar
|
|
|
2397
2407
|
reason: i
|
|
2398
2408
|
} };
|
|
2399
2409
|
let o = p(a ?? [], { ipv6: !0 });
|
|
2400
|
-
if (!o.length) throw TypeError(
|
|
2410
|
+
if (!o.length) throw TypeError(hi);
|
|
2401
2411
|
return gt("permissions.request", o), { ask: {
|
|
2402
2412
|
category: t,
|
|
2403
2413
|
key: n,
|
|
@@ -2405,8 +2415,8 @@ var Or = 3e4, kr = `frame.evaluate: the code did not settle within ${Or}ms`, Ar
|
|
|
2405
2415
|
hosts: o
|
|
2406
2416
|
} };
|
|
2407
2417
|
}), n = t.flatMap((e) => "ask" in e ? [e.ask] : []);
|
|
2408
|
-
|
|
2409
|
-
let { items: r, answer: i } =
|
|
2418
|
+
Sr("permissions.request", n), n.length && await Fn();
|
|
2419
|
+
let { items: r, answer: i } = Cr(n), a = t.flatMap((e) => "legacy" in e ? [e.legacy] : []), o = [...r, ...a], s = o.length ? await D.requestPermissions(o) : [], c = i(s.slice(0, r.length)), l = s.slice(r.length), u = 0, d = 0;
|
|
2410
2420
|
return t.map((e) => "ask" in e ? c[u++] : l[d++]);
|
|
2411
|
-
} },
|
|
2412
|
-
export { Xe as $,
|
|
2421
|
+
} }, _i = "PermissionDeniedError", vi = (e) => e instanceof Error ? e.name === _i : wr(e) && e.name === "PermissionDeniedError";
|
|
2422
|
+
export { Xe as $, Ft as A, xt as B, Wn as C, Pt as D, R as E, Vt as F, it as G, vt as H, It as I, ct as J, at as K, z as L, Ht as M, I as N, Bt as O, Nt as P, O as Q, bt as R, Gn as S, K as T, lt as U, yt as V, dt as W, tt as X, st as Y, A as Z, Qn as _, S as _t, mi as a, We as at, qn as b, Ir as c, w as ct, wr as d, Re as dt, Je as et, Sr as f, Oe as ft, Xn as g, xe as gt, vr as h, ye as ht, Zr as i, T as it, Rt as j, L as k, jr as l, C as lt, yr as m, ve as mt, vi as n, Ve as nt, Xr as o, E as ot, _r as p, be as pt, rt as q, gi as r, He as rt, zr as s, ke as st, _i as t, qe as tt, Nr as u, Ae as ut, Kn as v, Rn as w, q as x, ur as y, St as z };
|