@fkn/lib 0.9.14 → 0.9.15
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/cloud/net.cjs +1 -1
- package/cloud/net.d.ts +1 -1
- package/cloud/net.js +1 -1
- package/{cloud-xlvU7_rs.d.ts → cloud--8SYg1so.d.ts} +2 -2
- package/cloud-9cCFUQiG.cjs +1 -0
- package/cloud-DWnpupeb.js +130 -0
- package/cloud.cjs +1 -1
- package/cloud.d.ts +2 -2
- package/cloud.js +2 -2
- package/{extension-B0qU5XuR.d.ts → extension-CN9oFZ0Q.d.ts} +1 -1
- package/extension-DPlyfEPO.cjs +1 -0
- package/extension-xVdvgkZL.js +78 -0
- package/extension.cjs +1 -1
- package/extension.d.ts +2 -2
- package/extension.js +3 -3
- package/http.cjs +1 -1
- package/http.d.ts +1 -1
- package/http.js +1 -1
- package/{index-DQfP-Uhy.d.ts → index-DLaonjpx.d.ts} +18 -18
- package/index.cjs +1 -1
- package/index.d.ts +4 -4
- package/index.js +10 -10
- package/{lib-BcEnB4iV.js → lib-CegQxwDI.js} +559 -298
- package/lib-ulyxIbTr.cjs +53 -0
- package/{net-CR3V3Q5W.js → net-BDAN5Mvc.js} +12 -4
- package/{net-1AjTrb23.d.ts → net-BnGcJpUb.d.ts} +14 -1
- package/net-kma1sFhK.cjs +1 -0
- package/net.cjs +1 -1
- package/net.d.ts +1 -1
- package/net.js +1 -1
- package/package.json +1 -1
- package/cloud-C28lGQEP.cjs +0 -1
- package/cloud-y88zoTpE.js +0 -283
- package/extension-B8fd9lvk.cjs +0 -1
- package/extension-Cts968cO.js +0 -78
- package/lib-CQqdCndr.cjs +0 -31
- package/net-D3A-Z8RL.cjs +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
2
|
import { BoxBase as t, createTypedEventTarget as n, expose as r, recursiveBox as i, recursiveRevive as a } from "osra";
|
|
3
|
-
//#region
|
|
3
|
+
//#region node_modules/@mfkn/web-extension/lib/lib/revivables/event-proxy.js
|
|
4
4
|
var o = (e, t) => {
|
|
5
5
|
let n = new EventTarget(), r = /* @__PURE__ */ new Map(), i = EventTarget.prototype.addEventListener.bind(n), a = EventTarget.prototype.removeEventListener.bind(n);
|
|
6
6
|
return Object.defineProperty(n, "addEventListener", {
|
|
@@ -52,10 +52,10 @@ var o = (e, t) => {
|
|
|
52
52
|
dispatchEvent: (t) => e.remoteEvents.dispatchEvent(t)
|
|
53
53
|
};
|
|
54
54
|
}, l = /* @__PURE__ */ e({
|
|
55
|
-
box: () =>
|
|
56
|
-
createVideoElementHandle: () =>
|
|
57
|
-
isType: () =>
|
|
58
|
-
revive: () =>
|
|
55
|
+
box: () => C,
|
|
56
|
+
createVideoElementHandle: () => x,
|
|
57
|
+
isType: () => S,
|
|
58
|
+
revive: () => w,
|
|
59
59
|
type: () => u
|
|
60
60
|
}), u = "videoElement", d = [
|
|
61
61
|
"currentTime",
|
|
@@ -75,15 +75,15 @@ var o = (e, t) => {
|
|
|
75
75
|
"seeking",
|
|
76
76
|
"readyState",
|
|
77
77
|
"currentSrc"
|
|
78
|
-
], p = ["buffered", "seekable"], m = Symbol.for("fkn.remoteVideoElement"), h = Symbol.for("fkn.remoteVideoElement.state"), g = Symbol.for("fkn.remoteVideoElement.controller"),
|
|
78
|
+
], p = ["buffered", "seekable"], m = Symbol.for("fkn.remoteVideoElement"), h = Symbol.for("fkn.remoteVideoElement.state"), g = Symbol.for("fkn.remoteVideoElement.controller"), ee = (e) => e ? Array.from({ length: e.length }, (t, n) => [e.start(n), e.end(n)]) : [], _ = (e) => {
|
|
79
79
|
let t = {};
|
|
80
80
|
for (let n of [...d, ...f]) t[n] = e[n];
|
|
81
|
-
for (let n of p) t[n] =
|
|
81
|
+
for (let n of p) t[n] = ee(e[n]);
|
|
82
82
|
return t.error = e.error ? {
|
|
83
83
|
code: e.error.code,
|
|
84
84
|
message: e.error.message
|
|
85
85
|
} : null, t;
|
|
86
|
-
},
|
|
86
|
+
}, v = (e) => {
|
|
87
87
|
let t = (t) => {
|
|
88
88
|
if (!Number.isInteger(t) || t < 0 || t >= e.length) throw new DOMException("Index or size is negative or greater than the allowed amount", "IndexSizeError");
|
|
89
89
|
};
|
|
@@ -105,10 +105,10 @@ var o = (e, t) => {
|
|
|
105
105
|
MEDIA_ERR_NETWORK: 2,
|
|
106
106
|
MEDIA_ERR_DECODE: 3,
|
|
107
107
|
MEDIA_ERR_SRC_NOT_SUPPORTED: 4
|
|
108
|
-
} : null,
|
|
108
|
+
} : null, ne = (e) => o(e, (e, t) => ({
|
|
109
109
|
originalDetail: e instanceof CustomEvent ? e.detail : null,
|
|
110
|
-
snapshot:
|
|
111
|
-
})),
|
|
110
|
+
snapshot: _(t)
|
|
111
|
+
})), y = async (e, t) => {
|
|
112
112
|
switch (t) {
|
|
113
113
|
case "play": return await e.play(), null;
|
|
114
114
|
case "pause": return e.pause(), null;
|
|
@@ -124,15 +124,15 @@ var o = (e, t) => {
|
|
|
124
124
|
default: throw Error(`videoElement: unknown method "${t}"`);
|
|
125
125
|
}
|
|
126
126
|
}, re = (e) => ({
|
|
127
|
-
call: async (t) =>
|
|
127
|
+
call: async (t) => y(e, t),
|
|
128
128
|
set: async (t, n) => {
|
|
129
129
|
try {
|
|
130
130
|
e[t] = n;
|
|
131
131
|
} catch {}
|
|
132
|
-
return
|
|
132
|
+
return _(e);
|
|
133
133
|
},
|
|
134
|
-
events:
|
|
135
|
-
}),
|
|
134
|
+
events: ne(e)
|
|
135
|
+
}), b = (e, t) => {
|
|
136
136
|
let n = new EventTarget();
|
|
137
137
|
Object.defineProperty(n, m, { value: !0 }), Object.defineProperty(n, h, { value: e }), Object.defineProperty(n, g, { value: t });
|
|
138
138
|
let r = c({
|
|
@@ -229,11 +229,11 @@ var o = (e, t) => {
|
|
|
229
229
|
configurable: !0,
|
|
230
230
|
enumerable: !0,
|
|
231
231
|
get() {
|
|
232
|
-
return
|
|
232
|
+
return v(e[t]);
|
|
233
233
|
}
|
|
234
234
|
};
|
|
235
235
|
return Object.defineProperties(n, i), n;
|
|
236
|
-
},
|
|
236
|
+
}, x = (e) => b(_(e), re(e)), S = (e) => typeof e == "object" && !!e && e[m] === !0, C = (e, n) => {
|
|
237
237
|
let r = e;
|
|
238
238
|
return {
|
|
239
239
|
...t,
|
|
@@ -241,76 +241,76 @@ var o = (e, t) => {
|
|
|
241
241
|
initialState: r[h],
|
|
242
242
|
controller: i(r[g], n)
|
|
243
243
|
};
|
|
244
|
-
},
|
|
244
|
+
}, w = (e, t) => {
|
|
245
245
|
let n = a(e.controller, t);
|
|
246
|
-
return
|
|
247
|
-
},
|
|
248
|
-
typeof document < "u" && document.addEventListener(
|
|
249
|
-
|
|
246
|
+
return b({ ...e.initialState }, n);
|
|
247
|
+
}, T = (e) => [l, ...e], ie = "FKN_WEB_EXTENSION_MAIN_WORLD_CONTENT_SCRIPT_ENABLED_EVENT_KEY", ae = "fknExtension", E = n();
|
|
248
|
+
typeof document < "u" && document.addEventListener(ie, () => {
|
|
249
|
+
E.dispatchEvent(new CustomEvent("statuschange", { detail: { enabled: D() } }));
|
|
250
250
|
});
|
|
251
|
-
var
|
|
252
|
-
|
|
253
|
-
},
|
|
254
|
-
if (
|
|
251
|
+
var D = () => typeof document > "u" ? !1 : document.documentElement.dataset[ae] === "true", O = null, oe = (e) => {
|
|
252
|
+
O = e;
|
|
253
|
+
}, se = 150, k = (e = 1e3) => new Promise((t, n) => {
|
|
254
|
+
if (D()) return t();
|
|
255
255
|
let r, i = (e) => {
|
|
256
256
|
clearTimeout(r), s.disconnect(), document.removeEventListener("readystatechange", c), e();
|
|
257
257
|
}, a = () => i(async () => {
|
|
258
|
-
if (
|
|
258
|
+
if (O && (await O().catch(() => {}), D())) return t();
|
|
259
259
|
n(/* @__PURE__ */ Error("The FKN WebExtension is not installed, enabled or not exposed on this page."));
|
|
260
260
|
}), o = () => {
|
|
261
|
-
clearTimeout(r), r = setTimeout(() =>
|
|
261
|
+
clearTimeout(r), r = setTimeout(() => D() ? i(t) : a(), se);
|
|
262
262
|
}, s = new MutationObserver(() => {
|
|
263
|
-
|
|
263
|
+
D() && i(t);
|
|
264
264
|
}), c = () => {
|
|
265
|
-
document.readyState === "complete" && !
|
|
265
|
+
document.readyState === "complete" && !D() && o();
|
|
266
266
|
};
|
|
267
267
|
if (r = setTimeout(a, e), s.observe(document.documentElement, {
|
|
268
268
|
attributes: !0,
|
|
269
269
|
attributeFilter: ["data-fkn-extension"]
|
|
270
270
|
}), document.addEventListener("readystatechange", c), document.readyState === "complete") return o();
|
|
271
|
-
|
|
272
|
-
}),
|
|
273
|
-
await
|
|
271
|
+
D() && i(t);
|
|
272
|
+
}), ce, A = new Proxy({}, { get: (e, t) => async (...e) => {
|
|
273
|
+
await k(), ce ??= r({}, {
|
|
274
274
|
transport: window,
|
|
275
|
-
revivableModules:
|
|
275
|
+
revivableModules: T
|
|
276
276
|
});
|
|
277
|
-
let n = (await
|
|
277
|
+
let n = (await ce)[t];
|
|
278
278
|
return n(...e);
|
|
279
|
-
} }),
|
|
279
|
+
} }), j = [
|
|
280
280
|
"origin",
|
|
281
281
|
"referer",
|
|
282
282
|
"cookie"
|
|
283
|
-
],
|
|
284
|
-
if (t === "include" &&
|
|
285
|
-
},
|
|
286
|
-
let t = [...new Set((e ?? []).map(([e]) => e.trim().toLowerCase()).filter((e) => !
|
|
283
|
+
], le = (e, t) => (e ?? []).some(([e, n]) => e.trim().toLowerCase() === t && n !== ""), ue = (e) => le(e, "cookie"), de = (e, t) => {
|
|
284
|
+
if (t === "include" && ue(e)) throw Error("fetch: a forged Cookie header and credentials:'include' are different identities - send one or the other");
|
|
285
|
+
}, fe = (e) => {
|
|
286
|
+
let t = [...new Set((e ?? []).map(([e]) => e.trim().toLowerCase()).filter((e) => !j.includes(e)))];
|
|
287
287
|
if (t.length) throw Error(`fetch: refusing to forge request header(s): ${t.join(", ")}`);
|
|
288
|
-
},
|
|
288
|
+
}, pe = {
|
|
289
289
|
scope: "network.fetch",
|
|
290
290
|
category: "network",
|
|
291
291
|
severity: 0,
|
|
292
292
|
title: "Fetch data from other sites",
|
|
293
293
|
description: "Lets the app download public data from other websites directly, past the usual cross-origin limits."
|
|
294
|
-
},
|
|
294
|
+
}, me = {
|
|
295
295
|
scope: "network.fetchCredentialed",
|
|
296
296
|
category: "network",
|
|
297
297
|
severity: 3,
|
|
298
298
|
unsafe: !0,
|
|
299
299
|
title: "Fetch from other sites, signed in as you",
|
|
300
300
|
description: "Lets the app fetch other sites using your logged-in session cookies, so it can read data only you should see."
|
|
301
|
-
},
|
|
301
|
+
}, he = {
|
|
302
302
|
scope: "network.fetchLocal",
|
|
303
303
|
category: "network",
|
|
304
304
|
severity: 3,
|
|
305
305
|
unsafe: !0,
|
|
306
306
|
title: "Access devices on your local network",
|
|
307
307
|
description: "Lets the app reach devices and services on your home or work network, which websites normally cannot touch."
|
|
308
|
-
},
|
|
308
|
+
}, ge = (e) => {
|
|
309
309
|
let t = e.match(/^(\d+)\.(\d+)\.\d+\.\d+$/);
|
|
310
310
|
if (!t) return !1;
|
|
311
311
|
let [n, r] = [Number(t[1]), Number(t[2])];
|
|
312
312
|
return n === 10 || n === 127 || n === 0 || n === 169 && r === 254 || n === 172 && r >= 16 && r <= 31 || n === 192 && r === 168;
|
|
313
|
-
},
|
|
313
|
+
}, _e = (e) => {
|
|
314
314
|
let t;
|
|
315
315
|
try {
|
|
316
316
|
t = new URL(e);
|
|
@@ -318,8 +318,8 @@ var T = () => typeof document > "u" ? !1 : document.documentElement.dataset[oe]
|
|
|
318
318
|
return !1;
|
|
319
319
|
}
|
|
320
320
|
let n = t.hostname.replace(/^\[|\]$/g, "").toLowerCase().replace(/\.$/, "");
|
|
321
|
-
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:") :
|
|
322
|
-
},
|
|
321
|
+
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:") : ge(n);
|
|
322
|
+
}, ve = ["fkn.app", "fkn.dev"], M = (e) => {
|
|
323
323
|
let t;
|
|
324
324
|
try {
|
|
325
325
|
t = new URL(e);
|
|
@@ -328,46 +328,46 @@ var T = () => typeof document > "u" ? !1 : document.documentElement.dataset[oe]
|
|
|
328
328
|
}
|
|
329
329
|
if (t.protocol === "chrome-extension:" || t.protocol === "moz-extension:") return !0;
|
|
330
330
|
let n = t.hostname;
|
|
331
|
-
return
|
|
332
|
-
},
|
|
333
|
-
if (
|
|
334
|
-
},
|
|
331
|
+
return ve.some((e) => n === e || n.endsWith(`.${e}`));
|
|
332
|
+
}, N = (e) => {
|
|
333
|
+
if (M(e)) throw Error("fetch: refusing to target the extension's own pages or FKN platform domains");
|
|
334
|
+
}, ye = (e) => {
|
|
335
335
|
if (!e?.headers) return;
|
|
336
|
-
let t = new Headers(e.headers), n =
|
|
336
|
+
let t = new Headers(e.headers), n = j.map((e) => {
|
|
337
337
|
let n = t.get(e);
|
|
338
338
|
return n === null || n === "" ? void 0 : [e, n];
|
|
339
339
|
}).filter((e) => e !== void 0);
|
|
340
340
|
return n.length ? n : void 0;
|
|
341
|
-
},
|
|
341
|
+
}, be = async (e, t) => {
|
|
342
342
|
let n = new Request(e, t);
|
|
343
|
-
|
|
343
|
+
N(n.url);
|
|
344
344
|
let r = n.body ? await n.arrayBuffer() : null;
|
|
345
|
-
return
|
|
345
|
+
return A.proxyFetch({
|
|
346
346
|
url: n.url,
|
|
347
347
|
method: n.method,
|
|
348
348
|
headers: [...n.headers],
|
|
349
349
|
body: r,
|
|
350
350
|
credentials: t?.credentials === "include" ? "include" : "omit",
|
|
351
351
|
redirect: n.redirect,
|
|
352
|
-
unsafeHeaders:
|
|
352
|
+
unsafeHeaders: ye(t),
|
|
353
353
|
reason: t?.reason,
|
|
354
354
|
signal: t?.signal ?? void 0
|
|
355
355
|
});
|
|
356
|
-
},
|
|
356
|
+
}, xe = {
|
|
357
357
|
scope: "network.readCookie",
|
|
358
358
|
category: "network",
|
|
359
359
|
severity: 3,
|
|
360
360
|
unsafe: !0,
|
|
361
361
|
title: "Read a site’s cookie",
|
|
362
362
|
description: "Lets the app read a named cookie from another site, which can include the login token only that site should see."
|
|
363
|
-
},
|
|
363
|
+
}, Se = { get: (e) => A.getCookie(e) }, Ce = {
|
|
364
364
|
scope: "network.modifyRequestHeaders",
|
|
365
365
|
category: "network",
|
|
366
366
|
severity: 2,
|
|
367
367
|
unsafe: !0,
|
|
368
368
|
title: "Rewrite request headers to other sites",
|
|
369
369
|
description: "Lets the app set or remove headers (like Origin and Referer) on this page’s own requests to the listed sites."
|
|
370
|
-
},
|
|
370
|
+
}, we = (e) => A.setRequestHeaderRule(e), Te = (e) => A.removeRequestHeaderRule({ ruleId: e }), Ee = class extends Error {
|
|
371
371
|
reason;
|
|
372
372
|
filename;
|
|
373
373
|
line;
|
|
@@ -376,18 +376,18 @@ var T = () => typeof document > "u" ? !1 : document.documentElement.dataset[oe]
|
|
|
376
376
|
constructor(e, t, n, r, i) {
|
|
377
377
|
super(`${e}:${n}:${r}: ${t}`), this.reason = t, this.filename = e, this.line = n, this.column = r, this.source = i;
|
|
378
378
|
}
|
|
379
|
-
},
|
|
379
|
+
}, De = class {
|
|
380
380
|
start;
|
|
381
381
|
end;
|
|
382
382
|
source;
|
|
383
383
|
constructor(e, t, n) {
|
|
384
384
|
this.start = e, this.end = t, this.source = n;
|
|
385
385
|
}
|
|
386
|
-
},
|
|
386
|
+
}, P;
|
|
387
387
|
(function(e) {
|
|
388
|
-
e.stylesheet = "stylesheet", e.rule = "rule", e.declaration = "declaration", e.comment = "comment", e.container = "container", e.charset = "charset", e.document = "document", e.customMedia = "custom-media", e.fontFace = "font-face", 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.startingStyle = "starting-style", e.supports = "supports";
|
|
389
|
-
})(
|
|
390
|
-
var
|
|
388
|
+
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";
|
|
389
|
+
})(P ||= {});
|
|
390
|
+
var F = (e, t, n) => {
|
|
391
391
|
let r = n, i = 1e4;
|
|
392
392
|
do {
|
|
393
393
|
let n = t.map((t) => e.indexOf(t, r));
|
|
@@ -399,7 +399,7 @@ var N = (e, t, n) => {
|
|
|
399
399
|
r = o + 2, i--;
|
|
400
400
|
} while (i > 0);
|
|
401
401
|
throw Error("Too many escaping");
|
|
402
|
-
},
|
|
402
|
+
}, I = (e, t, n) => {
|
|
403
403
|
let r = n, i = 1e4;
|
|
404
404
|
do {
|
|
405
405
|
let n = t.map((t) => e.indexOf(t, r));
|
|
@@ -413,21 +413,21 @@ var N = (e, t, n) => {
|
|
|
413
413
|
break;
|
|
414
414
|
case "(":
|
|
415
415
|
{
|
|
416
|
-
let t =
|
|
416
|
+
let t = I(e, [")"], o + 1);
|
|
417
417
|
if (t === -1) return -1;
|
|
418
418
|
r = t + 1;
|
|
419
419
|
}
|
|
420
420
|
break;
|
|
421
421
|
case "\"":
|
|
422
422
|
{
|
|
423
|
-
let t =
|
|
423
|
+
let t = F(e, ["\""], o + 1);
|
|
424
424
|
if (t === -1) return -1;
|
|
425
425
|
r = t + 1;
|
|
426
426
|
}
|
|
427
427
|
break;
|
|
428
428
|
case "'":
|
|
429
429
|
{
|
|
430
|
-
let t =
|
|
430
|
+
let t = F(e, ["'"], o + 1);
|
|
431
431
|
if (t === -1) return -1;
|
|
432
432
|
r = t + 1;
|
|
433
433
|
}
|
|
@@ -437,17 +437,17 @@ var N = (e, t, n) => {
|
|
|
437
437
|
i--;
|
|
438
438
|
} while (i > 0);
|
|
439
439
|
throw Error("Too many escaping");
|
|
440
|
-
},
|
|
441
|
-
function
|
|
440
|
+
}, L = /\/\*[^]*?(?:\*\/|$)/g;
|
|
441
|
+
function R(e) {
|
|
442
442
|
return e ? e.trim() : "";
|
|
443
443
|
}
|
|
444
|
-
function
|
|
444
|
+
function z(e, t) {
|
|
445
445
|
let n = e && typeof e.type == "string", r = n ? e : t;
|
|
446
446
|
for (let t in e) {
|
|
447
447
|
let n = e[t];
|
|
448
448
|
Array.isArray(n) ? n.forEach((e) => {
|
|
449
|
-
|
|
450
|
-
}) : n && typeof n == "object" &&
|
|
449
|
+
z(e, r);
|
|
450
|
+
}) : n && typeof n == "object" && z(n, r);
|
|
451
451
|
}
|
|
452
452
|
return n && Object.defineProperty(e, "parent", {
|
|
453
453
|
configurable: !0,
|
|
@@ -456,7 +456,7 @@ function L(e, t) {
|
|
|
456
456
|
value: t || null
|
|
457
457
|
}), e;
|
|
458
458
|
}
|
|
459
|
-
var
|
|
459
|
+
var Oe = class {
|
|
460
460
|
level = 0;
|
|
461
461
|
indentation = " ";
|
|
462
462
|
compress = !1;
|
|
@@ -471,25 +471,33 @@ var Ae = class {
|
|
|
471
471
|
}
|
|
472
472
|
visit(e) {
|
|
473
473
|
switch (e.type) {
|
|
474
|
-
case
|
|
475
|
-
case
|
|
476
|
-
case
|
|
477
|
-
case
|
|
478
|
-
case
|
|
479
|
-
case
|
|
480
|
-
case
|
|
481
|
-
case
|
|
482
|
-
case
|
|
483
|
-
case
|
|
484
|
-
case
|
|
485
|
-
case
|
|
486
|
-
case
|
|
487
|
-
case
|
|
488
|
-
case
|
|
489
|
-
case
|
|
490
|
-
case
|
|
491
|
-
case
|
|
492
|
-
case
|
|
474
|
+
case P.stylesheet: return this.stylesheet(e);
|
|
475
|
+
case P.rule: return this.rule(e);
|
|
476
|
+
case P.declaration: return this.declaration(e);
|
|
477
|
+
case P.comment: return this.comment(e);
|
|
478
|
+
case P.container: return this.container(e);
|
|
479
|
+
case P.charset: return this.charset(e);
|
|
480
|
+
case P.counterStyle: return this.counterStyle(e);
|
|
481
|
+
case P.document: return this.document(e);
|
|
482
|
+
case P.customMedia: return this.customMedia(e);
|
|
483
|
+
case P.fontFace: return this.fontFace(e);
|
|
484
|
+
case P.fontFeatureValues: return this.fontFeatureValues(e);
|
|
485
|
+
case P.host: return this.host(e);
|
|
486
|
+
case P.import: return this.import(e);
|
|
487
|
+
case P.keyframes: return this.keyframes(e);
|
|
488
|
+
case P.keyframe: return this.keyframe(e);
|
|
489
|
+
case P.layer: return this.layer(e);
|
|
490
|
+
case P.media: return this.media(e);
|
|
491
|
+
case P.namespace: return this.namespace(e);
|
|
492
|
+
case P.page: return this.page(e);
|
|
493
|
+
case P.pageMarginBox: return this.pageMarginBox(e);
|
|
494
|
+
case P.positionTry: return this.positionTry(e);
|
|
495
|
+
case P.property: return this.property(e);
|
|
496
|
+
case P.scope: return this.scope(e);
|
|
497
|
+
case P.startingStyle: return this.startingStyle(e);
|
|
498
|
+
case P.supports: return this.supports(e);
|
|
499
|
+
case P.viewTransition: return this.viewTransition(e);
|
|
500
|
+
case P.atRule: return this.genericAtRule(e);
|
|
493
501
|
}
|
|
494
502
|
}
|
|
495
503
|
mapVisit(e, t) {
|
|
@@ -550,6 +558,9 @@ var Ae = class {
|
|
|
550
558
|
let t = e.selectors.length ? `${e.selectors.join(", ")} ` : "";
|
|
551
559
|
return this.emit(`@page ${t}`, e.position) + this.emit("{\n") + this.emit(this.indent(1)) + this.mapVisit(e.declarations, "\n") + this.emit(this.indent(-1)) + this.emit("\n}");
|
|
552
560
|
}
|
|
561
|
+
pageMarginBox(e) {
|
|
562
|
+
return this.compress ? this.emit(`@${e.name}`, e.position) + this.emit("{") + this.mapVisit(e.declarations) + this.emit("}") : this.emit(`${this.indent()}@${e.name} `, e.position) + this.emit("{\n") + this.emit(this.indent(1)) + this.mapVisit(e.declarations, "\n") + this.emit(this.indent(-1)) + this.emit(`\n${this.indent()}}`);
|
|
563
|
+
}
|
|
553
564
|
fontFace(e) {
|
|
554
565
|
return this.compress ? this.emit("@font-face", e.position) + this.emit("{") + this.mapVisit(e.declarations) + this.emit("}") : this.emit("@font-face ", e.position) + this.emit("{\n") + this.emit(this.indent(1)) + this.mapVisit(e.declarations, "\n") + this.emit(this.indent(-1)) + this.emit("\n}");
|
|
555
566
|
}
|
|
@@ -559,6 +570,32 @@ var Ae = class {
|
|
|
559
570
|
customMedia(e) {
|
|
560
571
|
return this.emit(`@custom-media ${e.name} ${e.media};`, e.position);
|
|
561
572
|
}
|
|
573
|
+
property(e) {
|
|
574
|
+
return this.compress ? this.emit(`@property ${e.name}`, e.position) + this.emit("{") + this.mapVisit(e.declarations) + this.emit("}") : this.emit(`@property ${e.name} `, e.position) + this.emit("{\n") + this.emit(this.indent(1)) + this.mapVisit(e.declarations, "\n") + this.emit(this.indent(-1)) + this.emit("\n}");
|
|
575
|
+
}
|
|
576
|
+
counterStyle(e) {
|
|
577
|
+
return this.compress ? this.emit(`@counter-style ${e.name}`, e.position) + this.emit("{") + this.mapVisit(e.declarations) + this.emit("}") : this.emit(`@counter-style ${e.name} `, e.position) + this.emit("{\n") + this.emit(this.indent(1)) + this.mapVisit(e.declarations, "\n") + this.emit(this.indent(-1)) + this.emit("\n}");
|
|
578
|
+
}
|
|
579
|
+
fontFeatureValues(e) {
|
|
580
|
+
return this.compress ? this.emit(`@font-feature-values ${e.fontFamily}`, e.position) + this.emit("{") + this.mapVisit(e.rules) + this.emit("}") : this.emit(`${this.indent()}@font-feature-values ${e.fontFamily}`, e.position) + this.emit(` {\n${this.indent(1)}`) + this.mapVisit(e.rules, "\n\n") + this.emit(`\n${this.indent(-1)}${this.indent()}}`);
|
|
581
|
+
}
|
|
582
|
+
scope(e) {
|
|
583
|
+
let t = e.scope ? ` ${e.scope}` : "";
|
|
584
|
+
return this.compress ? this.emit(`@scope${t}`, e.position) + this.emit("{") + this.mapVisit(e.rules) + this.emit("}") : this.emit(`${this.indent()}@scope${t}`, e.position) + this.emit(` {\n${this.indent(1)}`) + this.mapVisit(e.rules, "\n\n") + this.emit(`\n${this.indent(-1)}${this.indent()}}`);
|
|
585
|
+
}
|
|
586
|
+
viewTransition(e) {
|
|
587
|
+
return this.compress ? this.emit("@view-transition", e.position) + this.emit("{") + this.mapVisit(e.declarations) + this.emit("}") : this.emit("@view-transition ", e.position) + this.emit("{\n") + this.emit(this.indent(1)) + this.mapVisit(e.declarations, "\n") + this.emit(this.indent(-1)) + this.emit("\n}");
|
|
588
|
+
}
|
|
589
|
+
positionTry(e) {
|
|
590
|
+
return this.compress ? this.emit(`@position-try ${e.name}`, e.position) + this.emit("{") + this.mapVisit(e.declarations) + this.emit("}") : this.emit(`@position-try ${e.name} `, e.position) + this.emit("{\n") + this.emit(this.indent(1)) + this.mapVisit(e.declarations, "\n") + this.emit(this.indent(-1)) + this.emit("\n}");
|
|
591
|
+
}
|
|
592
|
+
genericAtRule(e) {
|
|
593
|
+
let t = e.prelude ? ` ${e.prelude}` : "";
|
|
594
|
+
if (this.compress) return this.emit(`@${e.name}${t}`, e.position) + (e.rules ? this.emit("{") + this.mapVisit(e.rules) + this.emit("}") : ";");
|
|
595
|
+
if (!e.rules) return this.emit(`${this.indent()}@${e.name}${t};`, e.position);
|
|
596
|
+
let n = e.rules.some((e) => e.type !== P.declaration && e.type !== P.comment), r = n ? "\n\n" : "\n";
|
|
597
|
+
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()}}`);
|
|
598
|
+
}
|
|
562
599
|
rule(e) {
|
|
563
600
|
let t = e.declarations;
|
|
564
601
|
if (!t.length) return "";
|
|
@@ -569,7 +606,7 @@ var Ae = class {
|
|
|
569
606
|
declaration(e) {
|
|
570
607
|
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(";");
|
|
571
608
|
}
|
|
572
|
-
},
|
|
609
|
+
}, ke = (e, t) => {
|
|
573
610
|
t ||= {};
|
|
574
611
|
let n = 1, r = 1;
|
|
575
612
|
function i() {
|
|
@@ -577,31 +614,26 @@ var Ae = class {
|
|
|
577
614
|
line: n,
|
|
578
615
|
column: r
|
|
579
616
|
};
|
|
580
|
-
return (i) => (i.position = new
|
|
617
|
+
return (i) => (i.position = new De(e, {
|
|
581
618
|
line: n,
|
|
582
619
|
column: r
|
|
583
|
-
}, t?.source || ""),
|
|
620
|
+
}, t?.source || ""), u(), i);
|
|
584
621
|
}
|
|
585
622
|
let a = [];
|
|
586
623
|
function o(i) {
|
|
587
|
-
let o = new
|
|
624
|
+
let o = new Ee(t?.source || "", i, n, r, e);
|
|
588
625
|
if (!t?.silent) throw o;
|
|
589
626
|
a.push(o);
|
|
590
627
|
}
|
|
591
628
|
function s() {
|
|
592
629
|
let t = /^{\s*/.exec(e);
|
|
593
|
-
return !!t && (
|
|
630
|
+
return !!t && (l(t), !0);
|
|
594
631
|
}
|
|
595
632
|
function c() {
|
|
596
633
|
let t = /^}/.exec(e);
|
|
597
|
-
return !!t && (
|
|
634
|
+
return !!t && (l(t), !0);
|
|
598
635
|
}
|
|
599
|
-
function l() {
|
|
600
|
-
let t, n = [];
|
|
601
|
-
for (d(), f(n); e.length && e.charAt(0) !== "}" && (t = ne() || re(), t);) n.push(t), f(n);
|
|
602
|
-
return n;
|
|
603
|
-
}
|
|
604
|
-
function u(t) {
|
|
636
|
+
function l(t) {
|
|
605
637
|
let i = t[0];
|
|
606
638
|
return function(e) {
|
|
607
639
|
let t = e.match(/\n/g);
|
|
@@ -610,272 +642,501 @@ var Ae = class {
|
|
|
610
642
|
r = ~i ? e.length - i : r + e.length;
|
|
611
643
|
}(i), e = e.slice(i.length), t;
|
|
612
644
|
}
|
|
613
|
-
function
|
|
645
|
+
function u() {
|
|
614
646
|
let t = /^\s*/.exec(e);
|
|
615
|
-
t &&
|
|
647
|
+
t && l(t);
|
|
616
648
|
}
|
|
617
|
-
function
|
|
649
|
+
function d(e) {
|
|
618
650
|
e ||= [];
|
|
619
|
-
let t =
|
|
620
|
-
for (; t;) e.push(t), t =
|
|
651
|
+
let t = f();
|
|
652
|
+
for (; t;) e.push(t), t = f();
|
|
621
653
|
return e;
|
|
622
654
|
}
|
|
623
|
-
function
|
|
655
|
+
function f() {
|
|
624
656
|
let t = i();
|
|
625
657
|
if (e.charAt(0) !== "/" || e.charAt(1) !== "*") return;
|
|
626
658
|
let n = /^\/\*[^]*?\*\//.exec(e);
|
|
627
|
-
return n ? (
|
|
628
|
-
type:
|
|
659
|
+
return n ? (l(n), t({
|
|
660
|
+
type: P.comment,
|
|
629
661
|
comment: n[0].slice(2, -2)
|
|
630
662
|
})) : o("End of comment missing");
|
|
631
663
|
}
|
|
632
|
-
function
|
|
633
|
-
let t =
|
|
634
|
-
if (t
|
|
664
|
+
function p() {
|
|
665
|
+
let t = I(e, ["{"]);
|
|
666
|
+
if (t === -1 || t === 0) return;
|
|
667
|
+
let n = e.substring(0, t);
|
|
668
|
+
return l([n]), ((e, t) => {
|
|
635
669
|
let n = [], r = 0;
|
|
636
670
|
for (; r < e.length;) {
|
|
637
|
-
let i =
|
|
671
|
+
let i = I(e, t, r);
|
|
638
672
|
if (i === -1) return n.push(e.substring(r)), n;
|
|
639
673
|
n.push(e.substring(r, i)), r = i + 1;
|
|
640
674
|
}
|
|
641
675
|
return n;
|
|
642
|
-
})(
|
|
676
|
+
})(R(n).replace(L, ""), [","]).map((e) => R(e));
|
|
643
677
|
}
|
|
644
|
-
function
|
|
678
|
+
function m() {
|
|
645
679
|
let t = i(), n = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/.exec(e);
|
|
646
680
|
if (!n) return;
|
|
647
|
-
|
|
648
|
-
let r =
|
|
681
|
+
l(n);
|
|
682
|
+
let r = R(n[0]), a = /^:\s*/.exec(e);
|
|
649
683
|
if (!a) return o("property missing ':'");
|
|
650
|
-
|
|
651
|
-
let s = "", c =
|
|
652
|
-
c !== -1 && (s = e.substring(0, c),
|
|
653
|
-
let
|
|
654
|
-
type:
|
|
655
|
-
property: r.replace(
|
|
684
|
+
l(a);
|
|
685
|
+
let s = "", c = I(e, [";", "}"]);
|
|
686
|
+
c !== -1 && (s = e.substring(0, c), l([s]), s = R(s).replace(L, ""));
|
|
687
|
+
let u = t({
|
|
688
|
+
type: P.declaration,
|
|
689
|
+
property: r.replace(L, ""),
|
|
656
690
|
value: s
|
|
657
691
|
}), d = /^[;\s]*/.exec(e);
|
|
658
|
-
return d &&
|
|
692
|
+
return d && l(d), u;
|
|
693
|
+
}
|
|
694
|
+
function h() {
|
|
695
|
+
let n = [];
|
|
696
|
+
if (!s()) return o("missing '{'");
|
|
697
|
+
d(n);
|
|
698
|
+
let r = m();
|
|
699
|
+
for (; r;) n.push(r), d(n), r = m();
|
|
700
|
+
for (; t?.silent && e.length && e.charAt(0) !== "}";) {
|
|
701
|
+
let t = e.indexOf(";"), i = e.indexOf("}");
|
|
702
|
+
if (t === -1 || !(i === -1 || t < i)) break;
|
|
703
|
+
for (l([e.substring(0, t + 1)]), u(), d(n), r = m(); r;) n.push(r), d(n), r = m();
|
|
704
|
+
}
|
|
705
|
+
return c() ? n : o("missing '}'");
|
|
659
706
|
}
|
|
660
707
|
function g() {
|
|
661
|
-
let
|
|
708
|
+
let t = I(e, ["{"]);
|
|
709
|
+
if (t === -1) return !1;
|
|
710
|
+
let n = I(e, [";"]), r = I(e, ["}"]);
|
|
711
|
+
return !(n !== -1 && n < t) && !(r !== -1 && r < t);
|
|
712
|
+
}
|
|
713
|
+
function ee() {
|
|
714
|
+
let n = [];
|
|
662
715
|
if (!s()) return o("missing '{'");
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
716
|
+
for (d(n); e.length && e.charAt(0) !== "}";) {
|
|
717
|
+
if (e.charAt(0) === "@") {
|
|
718
|
+
let e = x();
|
|
719
|
+
if (e) {
|
|
720
|
+
n.push(e), d(n);
|
|
721
|
+
continue;
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
if (g()) {
|
|
725
|
+
let e = S();
|
|
726
|
+
if (e) {
|
|
727
|
+
n.push(e), d(n);
|
|
728
|
+
continue;
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
let r = m();
|
|
732
|
+
if (!r) {
|
|
733
|
+
if (t?.silent) {
|
|
734
|
+
let t = e.indexOf(";"), r = e.indexOf("}");
|
|
735
|
+
if (t !== -1 && (r === -1 || t < r)) {
|
|
736
|
+
l([e.substring(0, t + 1)]), u(), d(n);
|
|
737
|
+
continue;
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
break;
|
|
741
|
+
}
|
|
742
|
+
n.push(r), d(n);
|
|
743
|
+
}
|
|
744
|
+
return c() ? n : o("missing '}'");
|
|
667
745
|
}
|
|
668
746
|
function _() {
|
|
747
|
+
let n = [];
|
|
748
|
+
for (u(), d(n); e.length && e.charAt(0) !== "}";) {
|
|
749
|
+
if (e.charAt(0) === "@") {
|
|
750
|
+
let e = x();
|
|
751
|
+
if (e) {
|
|
752
|
+
n.push(e), d(n);
|
|
753
|
+
continue;
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
if (g()) {
|
|
757
|
+
let e = S();
|
|
758
|
+
if (e) {
|
|
759
|
+
n.push(e), d(n);
|
|
760
|
+
continue;
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
let r = m();
|
|
764
|
+
if (!r) {
|
|
765
|
+
if (t?.silent) {
|
|
766
|
+
let t = e.indexOf(";"), r = e.indexOf("}");
|
|
767
|
+
if (t !== -1 && (r === -1 || t < r)) {
|
|
768
|
+
l([e.substring(0, t + 1)]), u(), d(n);
|
|
769
|
+
continue;
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
break;
|
|
773
|
+
}
|
|
774
|
+
n.push(r), d(n);
|
|
775
|
+
}
|
|
776
|
+
return n;
|
|
777
|
+
}
|
|
778
|
+
function v() {
|
|
669
779
|
let t = [], n = i(), r = /^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/.exec(e);
|
|
670
780
|
for (; r;) {
|
|
671
|
-
let n =
|
|
781
|
+
let n = l(r);
|
|
672
782
|
t.push(n[1]);
|
|
673
783
|
let i = /^,\s*/.exec(e);
|
|
674
|
-
i &&
|
|
784
|
+
i && l(i), r = /^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/.exec(e);
|
|
675
785
|
}
|
|
676
786
|
if (t.length) return n({
|
|
677
|
-
type:
|
|
787
|
+
type: P.keyframe,
|
|
678
788
|
values: t,
|
|
679
|
-
declarations:
|
|
789
|
+
declarations: h() || []
|
|
680
790
|
});
|
|
681
791
|
}
|
|
682
|
-
let
|
|
683
|
-
|
|
792
|
+
let te = RegExp(`^@(${[
|
|
793
|
+
"top-left-corner",
|
|
794
|
+
"top-left",
|
|
795
|
+
"top-center",
|
|
796
|
+
"top-right",
|
|
797
|
+
"top-right-corner",
|
|
798
|
+
"bottom-left-corner",
|
|
799
|
+
"bottom-left",
|
|
800
|
+
"bottom-center",
|
|
801
|
+
"bottom-right",
|
|
802
|
+
"bottom-right-corner",
|
|
803
|
+
"left-top",
|
|
804
|
+
"left-middle",
|
|
805
|
+
"left-bottom",
|
|
806
|
+
"right-top",
|
|
807
|
+
"right-middle",
|
|
808
|
+
"right-bottom"
|
|
809
|
+
].join("|")})(?![\\w-])\\s*`), ne = b("import"), y = b("charset"), re = b("namespace");
|
|
810
|
+
function b(t) {
|
|
684
811
|
let n = RegExp("^@" + t + "\\s*((?::?[^;'\"]|\"(?:\\\\\"|[^\"])*?\"|'(?:\\\\'|[^'])*?')+)(?:;|$)");
|
|
685
812
|
return () => {
|
|
686
813
|
let r = i(), a = n.exec(e);
|
|
687
814
|
if (!a) return;
|
|
688
|
-
let o =
|
|
815
|
+
let o = l(a), s = { type: t };
|
|
689
816
|
return s[t] = o[1].trim(), r(s);
|
|
690
817
|
};
|
|
691
818
|
}
|
|
692
|
-
function
|
|
819
|
+
function x() {
|
|
693
820
|
if (e[0] === "@") return function() {
|
|
694
821
|
let t = i(), n = /^@([-\w]+)?keyframes\s*/.exec(e);
|
|
695
822
|
if (!n) return;
|
|
696
|
-
let r =
|
|
823
|
+
let r = l(n)[1], a = /^([-\w]+)\s*/.exec(e);
|
|
697
824
|
if (!a) return o("@keyframes missing name");
|
|
698
|
-
let
|
|
825
|
+
let u = l(a)[1];
|
|
699
826
|
if (!s()) return o("@keyframes missing '{'");
|
|
700
|
-
let
|
|
701
|
-
for (; p;)
|
|
827
|
+
let f = d(), p = v();
|
|
828
|
+
for (; p;) f.push(p), f = f.concat(d()), p = v();
|
|
702
829
|
return c() ? t({
|
|
703
|
-
type:
|
|
704
|
-
name:
|
|
830
|
+
type: P.keyframes,
|
|
831
|
+
name: u,
|
|
705
832
|
vendor: r,
|
|
706
|
-
keyframes:
|
|
833
|
+
keyframes: f
|
|
707
834
|
}) : o("@keyframes missing '}'");
|
|
708
835
|
}() || function() {
|
|
709
836
|
let t = i(), n = /^@media *([^{]+)/.exec(e);
|
|
710
837
|
if (!n) return;
|
|
711
|
-
let r =
|
|
838
|
+
let r = R(l(n)[1]);
|
|
712
839
|
if (!s()) return o("@media missing '{'");
|
|
713
|
-
let a =
|
|
840
|
+
let a = _();
|
|
714
841
|
return c() ? t({
|
|
715
|
-
type:
|
|
842
|
+
type: P.media,
|
|
716
843
|
media: r,
|
|
717
844
|
rules: a
|
|
718
845
|
}) : o("@media missing '}'");
|
|
719
846
|
}() || function() {
|
|
720
847
|
let t = i(), n = /^@custom-media\s+(--\S+)\s+([^{;\s][^{;]*);/.exec(e);
|
|
721
848
|
if (!n) return;
|
|
722
|
-
let r =
|
|
849
|
+
let r = l(n);
|
|
723
850
|
return t({
|
|
724
|
-
type:
|
|
725
|
-
name:
|
|
726
|
-
media:
|
|
851
|
+
type: P.customMedia,
|
|
852
|
+
name: R(r[1]),
|
|
853
|
+
media: R(r[2])
|
|
727
854
|
});
|
|
728
855
|
}() || function() {
|
|
729
856
|
let t = i(), n = /^@supports *([^{]+)/.exec(e);
|
|
730
857
|
if (!n) return;
|
|
731
|
-
let r =
|
|
858
|
+
let r = R(l(n)[1]);
|
|
732
859
|
if (!s()) return o("@supports missing '{'");
|
|
733
|
-
let a =
|
|
860
|
+
let a = _();
|
|
734
861
|
return c() ? t({
|
|
735
|
-
type:
|
|
862
|
+
type: P.supports,
|
|
736
863
|
supports: r,
|
|
737
864
|
rules: a
|
|
738
865
|
}) : o("@supports missing '}'");
|
|
739
|
-
}() ||
|
|
866
|
+
}() || ne() || y() || re() || function() {
|
|
740
867
|
let t = i(), n = /^@([-\w]+)?document *([^{]+)/.exec(e);
|
|
741
868
|
if (!n) return;
|
|
742
|
-
let r =
|
|
869
|
+
let r = l(n), a = R(r[1]), u = R(r[2]);
|
|
743
870
|
if (!s()) return o("@document missing '{'");
|
|
744
|
-
let
|
|
871
|
+
let d = _();
|
|
745
872
|
return c() ? t({
|
|
746
|
-
type:
|
|
747
|
-
document:
|
|
873
|
+
type: P.document,
|
|
874
|
+
document: u,
|
|
748
875
|
vendor: a,
|
|
749
|
-
rules:
|
|
876
|
+
rules: d
|
|
750
877
|
}) : o("@document missing '}'");
|
|
751
878
|
}() || function() {
|
|
752
879
|
let t = i(), n = /^@page */.exec(e);
|
|
753
880
|
if (!n) return;
|
|
754
|
-
|
|
755
|
-
let r =
|
|
881
|
+
l(n);
|
|
882
|
+
let r = p() || [];
|
|
756
883
|
if (!s()) return o("@page missing '{'");
|
|
757
|
-
let a =
|
|
758
|
-
for (;
|
|
884
|
+
let a = [];
|
|
885
|
+
for (d(a); e.length && e.charAt(0) !== "}";) {
|
|
886
|
+
if (e.charAt(0) === "@") {
|
|
887
|
+
let e = x();
|
|
888
|
+
if (e) {
|
|
889
|
+
a.push(e), d(a);
|
|
890
|
+
continue;
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
let t = m();
|
|
894
|
+
if (!t) break;
|
|
895
|
+
a.push(t), d(a);
|
|
896
|
+
}
|
|
759
897
|
return c() ? t({
|
|
760
|
-
type:
|
|
898
|
+
type: P.page,
|
|
761
899
|
selectors: r,
|
|
762
900
|
declarations: a
|
|
763
901
|
}) : o("@page missing '}'");
|
|
764
902
|
}() || function() {
|
|
765
903
|
let t = i(), n = /^@host\s*/.exec(e);
|
|
766
904
|
if (!n) return;
|
|
767
|
-
if (
|
|
768
|
-
let r =
|
|
905
|
+
if (l(n), !s()) return o("@host missing '{'");
|
|
906
|
+
let r = _();
|
|
769
907
|
return c() ? t({
|
|
770
|
-
type:
|
|
908
|
+
type: P.host,
|
|
771
909
|
rules: r
|
|
772
910
|
}) : o("@host missing '}'");
|
|
773
911
|
}() || function() {
|
|
774
912
|
let t = i(), n = /^@font-face\s*/.exec(e);
|
|
775
913
|
if (!n) return;
|
|
776
|
-
if (
|
|
777
|
-
let r =
|
|
778
|
-
for (; a;) r.push(a), r = r.concat(
|
|
914
|
+
if (l(n), !s()) return o("@font-face missing '{'");
|
|
915
|
+
let r = d(), a = m();
|
|
916
|
+
for (; a;) r.push(a), r = r.concat(d()), a = m();
|
|
779
917
|
return c() ? t({
|
|
780
|
-
type:
|
|
918
|
+
type: P.fontFace,
|
|
781
919
|
declarations: r
|
|
782
920
|
}) : o("@font-face missing '}'");
|
|
921
|
+
}() || function() {
|
|
922
|
+
let t = i(), n = /^@font-feature-values\s+([^{]+)/.exec(e);
|
|
923
|
+
if (!n) return;
|
|
924
|
+
let r = R(l(n)[1]);
|
|
925
|
+
if (!s()) return o("@font-feature-values missing '{'");
|
|
926
|
+
let a = _();
|
|
927
|
+
return c() ? t({
|
|
928
|
+
type: P.fontFeatureValues,
|
|
929
|
+
fontFamily: r,
|
|
930
|
+
rules: a
|
|
931
|
+
}) : o("@font-feature-values missing '}'");
|
|
783
932
|
}() || function() {
|
|
784
933
|
let t = i(), n = /^@container *([^{]+)/.exec(e);
|
|
785
934
|
if (!n) return;
|
|
786
|
-
let r =
|
|
935
|
+
let r = R(l(n)[1]);
|
|
787
936
|
if (!s()) return o("@container missing '{'");
|
|
788
|
-
let a =
|
|
937
|
+
let a = _();
|
|
789
938
|
return c() ? t({
|
|
790
|
-
type:
|
|
939
|
+
type: P.container,
|
|
791
940
|
container: r,
|
|
792
941
|
rules: a
|
|
793
942
|
}) : o("@container missing '}'");
|
|
794
943
|
}() || function() {
|
|
795
944
|
let t = i(), n = /^@starting-style\s*/.exec(e);
|
|
796
945
|
if (!n) return;
|
|
797
|
-
if (
|
|
798
|
-
let r =
|
|
946
|
+
if (l(n), !s()) return o("@starting-style missing '{'");
|
|
947
|
+
let r = _();
|
|
799
948
|
return c() ? t({
|
|
800
|
-
type:
|
|
949
|
+
type: P.startingStyle,
|
|
801
950
|
rules: r
|
|
802
951
|
}) : o("@starting-style missing '}'");
|
|
803
952
|
}() || function() {
|
|
804
953
|
let t = i(), n = /^@layer *([^{;@]+)/.exec(e);
|
|
805
954
|
if (!n) return;
|
|
806
|
-
let r =
|
|
955
|
+
let r = R(l(n)[1]);
|
|
807
956
|
if (!s()) {
|
|
808
957
|
let n = /^[;\s]*/.exec(e);
|
|
809
|
-
return n &&
|
|
810
|
-
type:
|
|
958
|
+
return n && l(n), t({
|
|
959
|
+
type: P.layer,
|
|
811
960
|
layer: r
|
|
812
961
|
});
|
|
813
962
|
}
|
|
814
|
-
let a =
|
|
963
|
+
let a = _();
|
|
815
964
|
return c() ? t({
|
|
816
|
-
type:
|
|
965
|
+
type: P.layer,
|
|
817
966
|
layer: r,
|
|
818
967
|
rules: a
|
|
819
968
|
}) : o("@layer missing '}'");
|
|
969
|
+
}() || function() {
|
|
970
|
+
let t = i(), n = /^@property\s+(--[-\w]+)\s*/.exec(e);
|
|
971
|
+
if (!n) return;
|
|
972
|
+
let r = l(n)[1];
|
|
973
|
+
if (!s()) return o("@property missing '{'");
|
|
974
|
+
let a = d(), u = m();
|
|
975
|
+
for (; u;) a.push(u), a = a.concat(d()), u = m();
|
|
976
|
+
return c() ? t({
|
|
977
|
+
type: P.property,
|
|
978
|
+
name: r,
|
|
979
|
+
declarations: a
|
|
980
|
+
}) : o("@property missing '}'");
|
|
981
|
+
}() || function() {
|
|
982
|
+
let t = i(), n = /^@counter-style\s+([-\w]+)\s*/.exec(e);
|
|
983
|
+
if (!n) return;
|
|
984
|
+
let r = l(n)[1];
|
|
985
|
+
if (!s()) return o("@counter-style missing '{'");
|
|
986
|
+
let a = d(), u = m();
|
|
987
|
+
for (; u;) a.push(u), a = a.concat(d()), u = m();
|
|
988
|
+
return c() ? t({
|
|
989
|
+
type: P.counterStyle,
|
|
990
|
+
name: r,
|
|
991
|
+
declarations: a
|
|
992
|
+
}) : o("@counter-style missing '}'");
|
|
993
|
+
}() || function() {
|
|
994
|
+
let t = i(), n = /^@scope\s*([^{]*)/.exec(e);
|
|
995
|
+
if (!n) return;
|
|
996
|
+
let r = R(l(n)[1]);
|
|
997
|
+
if (!s()) return o("@scope missing '{'");
|
|
998
|
+
let a = _();
|
|
999
|
+
return c() ? t({
|
|
1000
|
+
type: P.scope,
|
|
1001
|
+
scope: r,
|
|
1002
|
+
rules: a
|
|
1003
|
+
}) : o("@scope missing '}'");
|
|
1004
|
+
}() || function() {
|
|
1005
|
+
let t = i(), n = /^@view-transition\s*/.exec(e);
|
|
1006
|
+
if (!n) return;
|
|
1007
|
+
if (l(n), !s()) return o("@view-transition missing '{'");
|
|
1008
|
+
let r = d(), a = m();
|
|
1009
|
+
for (; a;) r.push(a), r = r.concat(d()), a = m();
|
|
1010
|
+
return c() ? t({
|
|
1011
|
+
type: P.viewTransition,
|
|
1012
|
+
declarations: r
|
|
1013
|
+
}) : o("@view-transition missing '}'");
|
|
1014
|
+
}() || function() {
|
|
1015
|
+
let t = i(), n = /^@position-try\s+(--[-\w]+)\s*/.exec(e);
|
|
1016
|
+
if (!n) return;
|
|
1017
|
+
let r = l(n)[1];
|
|
1018
|
+
if (!s()) return o("@position-try missing '{'");
|
|
1019
|
+
let a = d(), u = m();
|
|
1020
|
+
for (; u;) a.push(u), a = a.concat(d()), u = m();
|
|
1021
|
+
return c() ? t({
|
|
1022
|
+
type: P.positionTry,
|
|
1023
|
+
name: r,
|
|
1024
|
+
declarations: a
|
|
1025
|
+
}) : o("@position-try missing '}'");
|
|
1026
|
+
}() || function() {
|
|
1027
|
+
let t = i(), n = te.exec(e);
|
|
1028
|
+
if (!n) return;
|
|
1029
|
+
let r = l(n)[1];
|
|
1030
|
+
if (!s()) return o(`@${r} missing '{'`);
|
|
1031
|
+
let a = d(), u = m();
|
|
1032
|
+
for (; u;) a.push(u), a = a.concat(d()), u = m();
|
|
1033
|
+
return c() ? t({
|
|
1034
|
+
type: P.pageMarginBox,
|
|
1035
|
+
name: r,
|
|
1036
|
+
declarations: a
|
|
1037
|
+
}) : o(`@${r} missing '}'`);
|
|
1038
|
+
}() || function() {
|
|
1039
|
+
let t = i(), n = /^@([-\w]+)\s*/.exec(e);
|
|
1040
|
+
if (!n) return;
|
|
1041
|
+
let r = l(n)[1], a = "", u = I(e, ["{", ";"]);
|
|
1042
|
+
if (u !== -1 && u > 0 && (a = R(e.substring(0, u)), l([e.substring(0, u)])), s()) {
|
|
1043
|
+
let e = _();
|
|
1044
|
+
return c() ? t({
|
|
1045
|
+
type: P.atRule,
|
|
1046
|
+
name: r,
|
|
1047
|
+
prelude: a,
|
|
1048
|
+
rules: e
|
|
1049
|
+
}) : o(`@${r} missing '}'`);
|
|
1050
|
+
}
|
|
1051
|
+
let d = /^[;\s]*/.exec(e);
|
|
1052
|
+
return d && l(d), t({
|
|
1053
|
+
type: P.atRule,
|
|
1054
|
+
name: r,
|
|
1055
|
+
prelude: a
|
|
1056
|
+
});
|
|
820
1057
|
}();
|
|
821
1058
|
}
|
|
822
|
-
function
|
|
823
|
-
let e = i(), t =
|
|
824
|
-
return t ? (
|
|
825
|
-
type:
|
|
1059
|
+
function S() {
|
|
1060
|
+
let e = i(), t = p();
|
|
1061
|
+
return t ? (d(), e({
|
|
1062
|
+
type: P.rule,
|
|
826
1063
|
selectors: t,
|
|
827
|
-
declarations:
|
|
1064
|
+
declarations: ee() || []
|
|
828
1065
|
})) : o("selector missing");
|
|
829
1066
|
}
|
|
830
|
-
return
|
|
831
|
-
let
|
|
1067
|
+
return z(function() {
|
|
1068
|
+
let n = function() {
|
|
1069
|
+
let n, r = [];
|
|
1070
|
+
for (u(), d(r); e.length;) {
|
|
1071
|
+
if (e.charAt(0) === "}") {
|
|
1072
|
+
if (t?.silent) {
|
|
1073
|
+
o("extra '}'"), l(["}"]), u(), d(r);
|
|
1074
|
+
continue;
|
|
1075
|
+
}
|
|
1076
|
+
break;
|
|
1077
|
+
}
|
|
1078
|
+
if (n = x() || S(), !n) {
|
|
1079
|
+
if (t?.silent) {
|
|
1080
|
+
l([e.charAt(0)]), u(), d(r);
|
|
1081
|
+
continue;
|
|
1082
|
+
}
|
|
1083
|
+
break;
|
|
1084
|
+
}
|
|
1085
|
+
r.push(n), d(r);
|
|
1086
|
+
}
|
|
1087
|
+
return r;
|
|
1088
|
+
}();
|
|
832
1089
|
return {
|
|
833
|
-
type:
|
|
1090
|
+
type: P.stylesheet,
|
|
834
1091
|
stylesheet: {
|
|
835
1092
|
source: t?.source,
|
|
836
|
-
rules:
|
|
1093
|
+
rules: n,
|
|
837
1094
|
parsingErrors: a
|
|
838
1095
|
}
|
|
839
1096
|
};
|
|
840
1097
|
}());
|
|
841
|
-
},
|
|
1098
|
+
}, Ae = (e, t) => new Oe(t || {}).compile(e), B = "LocatorError", V = "LocatorUnsupportedError", H = "LocatorDeniedError", U = (e) => typeof e == "object" && e ? e.name : void 0, W = (e) => Object.assign(Error(e), { name: B }), je = (e, t = "", n) => Object.assign(Error(e), {
|
|
1099
|
+
name: V,
|
|
1100
|
+
operation: t,
|
|
1101
|
+
backend: n
|
|
1102
|
+
}), Me = (e, t) => je(`Locator operation not supported${t ? ` on the ${t} backend` : ""}: ${e}`, e, t), Ne = (e) => U(e) === V, Pe = (e) => U(e) === H, Fe = (e) => Pe(e) || Ne(e), G = (e) => {
|
|
842
1103
|
let t = (e.ownerDocument ?? e).defaultView;
|
|
843
|
-
if (!t) throw
|
|
1104
|
+
if (!t) throw W("the resolved element belongs to a document with no window");
|
|
844
1105
|
return t;
|
|
845
|
-
},
|
|
1106
|
+
}, Ie = (e, t) => {
|
|
846
1107
|
let n = e?.[t];
|
|
847
1108
|
return typeof n == "function" ? n : null;
|
|
848
1109
|
}, K = (e, t) => {
|
|
849
1110
|
if (typeof e != "object" || !e) return null;
|
|
850
1111
|
let n = (() => {
|
|
851
1112
|
try {
|
|
852
|
-
return
|
|
1113
|
+
return Ie(G(e), t);
|
|
853
1114
|
} catch {
|
|
854
1115
|
return null;
|
|
855
1116
|
}
|
|
856
1117
|
})();
|
|
857
1118
|
if (n && e instanceof n) return n;
|
|
858
|
-
let r =
|
|
1119
|
+
let r = Ie(globalThis, t);
|
|
859
1120
|
return r && e instanceof r ? r : null;
|
|
860
1121
|
}, q = (e, t) => K(e, t) !== null, J = (e) => {
|
|
861
|
-
if (e.length === 0) throw
|
|
862
|
-
if (e.length > 1) throw
|
|
1122
|
+
if (e.length === 0) throw W("No elements found");
|
|
1123
|
+
if (e.length > 1) throw W(`Strict mode violation: locator resolved to ${e.length} elements`);
|
|
863
1124
|
return e[0];
|
|
864
|
-
},
|
|
865
|
-
if (!q(e, t)) throw
|
|
1125
|
+
}, Le = (e, t) => {
|
|
1126
|
+
if (!q(e, t)) throw W(`Strict mode violation: expected ${t}, got <${e.tagName.toLowerCase()}>`);
|
|
866
1127
|
return e;
|
|
867
|
-
},
|
|
868
|
-
|
|
869
|
-
},
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
]),
|
|
877
|
-
if (
|
|
878
|
-
if (e.type ===
|
|
1128
|
+
}, Re = (e) => e.tagName.toLowerCase(), ze = /* @__PURE__ */ new Set(), Be = (e) => {
|
|
1129
|
+
ze.add(e);
|
|
1130
|
+
}, Ve = /(?:^|[^\w-])(?:url|image|image-set|cross-fade|paint|element|expression)\s*\(/i, He = (e) => e.replace(/\\([0-9a-fA-F]{1,6})\s?/g, (e, t) => String.fromCodePoint(Number.parseInt(t, 16))).replace(/\\(.)/g, "$1"), Ue = (e) => !Ve.test(He(e.value)), We = /* @__PURE__ */ new Set([
|
|
1131
|
+
P.import,
|
|
1132
|
+
P.fontFace,
|
|
1133
|
+
P.namespace,
|
|
1134
|
+
P.charset,
|
|
1135
|
+
P.document,
|
|
1136
|
+
P.comment
|
|
1137
|
+
]), Ge = (e) => {
|
|
1138
|
+
if (We.has(e.type)) return null;
|
|
1139
|
+
if (e.type === P.declaration) return Ue(e) ? e : null;
|
|
879
1140
|
let t = e, n = { ...t };
|
|
880
1141
|
for (let e of [
|
|
881
1142
|
"declarations",
|
|
@@ -883,18 +1144,18 @@ var Ae = class {
|
|
|
883
1144
|
"keyframes"
|
|
884
1145
|
]) {
|
|
885
1146
|
let r = t[e];
|
|
886
|
-
Array.isArray(r) && (n[e] =
|
|
1147
|
+
Array.isArray(r) && (n[e] = Ke(r));
|
|
887
1148
|
}
|
|
888
1149
|
return n;
|
|
889
|
-
},
|
|
1150
|
+
}, Ke = (e) => e.map((e) => Ge(e)).filter((e) => e !== null), qe = (e) => {
|
|
890
1151
|
let t;
|
|
891
1152
|
try {
|
|
892
|
-
t =
|
|
1153
|
+
t = ke(e, { silent: !0 });
|
|
893
1154
|
} catch {
|
|
894
1155
|
return "";
|
|
895
1156
|
}
|
|
896
|
-
return t.stylesheet.rules =
|
|
897
|
-
},
|
|
1157
|
+
return t.stylesheet.rules = Ke(t.stylesheet.rules), Ae(t);
|
|
1158
|
+
}, Je = (e, t) => {
|
|
898
1159
|
let n = () => {
|
|
899
1160
|
t.parentNode || (e.head ?? e.documentElement).appendChild(t);
|
|
900
1161
|
};
|
|
@@ -911,27 +1172,27 @@ var Ae = class {
|
|
|
911
1172
|
});
|
|
912
1173
|
let i = () => r.disconnect(), a = e.defaultView;
|
|
913
1174
|
a ? a.addEventListener("load", i, { once: !0 }) : setTimeout(i, 3e4);
|
|
914
|
-
},
|
|
1175
|
+
}, Ye = { resolve: (e, t) => {
|
|
915
1176
|
let n = e.document.createElement("style");
|
|
916
|
-
n.textContent = t.noSanitize ? t.content :
|
|
1177
|
+
n.textContent = t.noSanitize ? t.content : qe(t.content);
|
|
917
1178
|
try {
|
|
918
|
-
|
|
1179
|
+
Je(e.document, n);
|
|
919
1180
|
} catch (e) {
|
|
920
1181
|
console.error(e);
|
|
921
1182
|
}
|
|
922
|
-
|
|
923
|
-
} },
|
|
1183
|
+
Be(n);
|
|
1184
|
+
} }, Xe = (e, t) => {
|
|
924
1185
|
let n = e.getBoundingClientRect();
|
|
925
1186
|
return {
|
|
926
1187
|
clientX: n.left + n.width * (t?.x ?? .5),
|
|
927
1188
|
clientY: n.top + n.height * (t?.y ?? .5)
|
|
928
1189
|
};
|
|
929
|
-
},
|
|
1190
|
+
}, Ze = { resolve: (e, t = {}) => {
|
|
930
1191
|
let n = J(e.elements), r = G(n), i = {
|
|
931
1192
|
bubbles: !0,
|
|
932
1193
|
cancelable: !0,
|
|
933
1194
|
composed: !0,
|
|
934
|
-
...
|
|
1195
|
+
...Xe(n, t.position),
|
|
935
1196
|
button: 0
|
|
936
1197
|
}, a = {
|
|
937
1198
|
...i,
|
|
@@ -955,12 +1216,12 @@ var Ae = class {
|
|
|
955
1216
|
...i,
|
|
956
1217
|
buttons: 0
|
|
957
1218
|
}));
|
|
958
|
-
} },
|
|
1219
|
+
} }, Qe = { resolve: (e, t = {}) => {
|
|
959
1220
|
let n = J(e.elements), r = G(n), i = {
|
|
960
1221
|
bubbles: !0,
|
|
961
1222
|
cancelable: !0,
|
|
962
1223
|
composed: !0,
|
|
963
|
-
...
|
|
1224
|
+
...Xe(n, t.position)
|
|
964
1225
|
}, a = {
|
|
965
1226
|
...i,
|
|
966
1227
|
pointerType: "mouse",
|
|
@@ -974,11 +1235,11 @@ var Ae = class {
|
|
|
974
1235
|
...i,
|
|
975
1236
|
bubbles: !1
|
|
976
1237
|
})), n.dispatchEvent(new r.MouseEvent("mouseover", i)), n.dispatchEvent(new r.PointerEvent("pointermove", a)), n.dispatchEvent(new r.MouseEvent("mousemove", i));
|
|
977
|
-
} },
|
|
1238
|
+
} }, $e = (e, t) => {
|
|
978
1239
|
e._valueTracker?.setValue("");
|
|
979
1240
|
let n = (K(e, "HTMLTextAreaElement") ?? K(e, "HTMLInputElement"))?.prototype, r = n && Object.getOwnPropertyDescriptor(n, "value")?.set;
|
|
980
1241
|
r ? r.call(e, t) : e.value = t;
|
|
981
|
-
},
|
|
1242
|
+
}, et = (e, t) => {
|
|
982
1243
|
if (e.type !== "range") return null;
|
|
983
1244
|
let n = Number(e.min || 0), r = Number(e.max || 100);
|
|
984
1245
|
if (!Number.isFinite(n) || !Number.isFinite(r) || r <= n) return null;
|
|
@@ -1015,36 +1276,36 @@ var Ae = class {
|
|
|
1015
1276
|
buttons: 0
|
|
1016
1277
|
}
|
|
1017
1278
|
};
|
|
1018
|
-
},
|
|
1279
|
+
}, tt = { resolve: (e, t, n = {}) => {
|
|
1019
1280
|
let r = J(e.elements), i = G(r), a = q(r, "HTMLInputElement");
|
|
1020
1281
|
if (a || q(r, "HTMLTextAreaElement")) {
|
|
1021
|
-
let e = r, n = a ?
|
|
1022
|
-
n && (r.dispatchEvent(new i.PointerEvent("pointerdown", n.pointerDown)), r.dispatchEvent(new i.MouseEvent("mousedown", n.mouseDown))),
|
|
1282
|
+
let e = r, n = a ? et(e, t) : null;
|
|
1283
|
+
n && (r.dispatchEvent(new i.PointerEvent("pointerdown", n.pointerDown)), r.dispatchEvent(new i.MouseEvent("mousedown", n.mouseDown))), $e(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 }));
|
|
1023
1284
|
return;
|
|
1024
1285
|
}
|
|
1025
1286
|
if (q(r, "HTMLElement") && r.isContentEditable) {
|
|
1026
1287
|
r.textContent = t, r.dispatchEvent(new i.Event("input", { bubbles: !0 }));
|
|
1027
1288
|
return;
|
|
1028
1289
|
}
|
|
1029
|
-
throw Error(`fill: element <${
|
|
1030
|
-
} },
|
|
1290
|
+
throw Error(`fill: element <${Re(r)}> is not fillable`);
|
|
1291
|
+
} }, nt = { resolve: (e, t = {}) => J(e.elements).textContent }, rt = { resolve: (e, t, n = {}) => J(e.elements).getAttribute(t) }, it = { resolve: (e, t = {}) => {
|
|
1031
1292
|
let n = J(e.elements);
|
|
1032
1293
|
if (!q(n, "HTMLElement")) return !0;
|
|
1033
1294
|
let r = G(n).getComputedStyle(n);
|
|
1034
1295
|
if (r?.display === "none" || r?.visibility === "hidden") return !1;
|
|
1035
1296
|
let i = n.getBoundingClientRect();
|
|
1036
1297
|
return i.width > 0 && i.height > 0;
|
|
1037
|
-
} },
|
|
1298
|
+
} }, at = { resolve: (e, t = {}) => e.elements.length }, ot = { resolve: (e, t = {}) => e.elements.length > 0 }, Y = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1038
1299
|
__proto__: null,
|
|
1039
|
-
click:
|
|
1040
|
-
count:
|
|
1041
|
-
exists:
|
|
1042
|
-
fill:
|
|
1043
|
-
getAttribute:
|
|
1044
|
-
hover:
|
|
1045
|
-
isVisible:
|
|
1046
|
-
textContent:
|
|
1047
|
-
}, Symbol.toStringTag, { value: "Module" })), X = (e, t) => e.elements.flatMap((e) => [...e.querySelectorAll(t)]), Z = (e) => e.replaceAll("\"", "\\\""),
|
|
1300
|
+
click: Ze,
|
|
1301
|
+
count: at,
|
|
1302
|
+
exists: ot,
|
|
1303
|
+
fill: tt,
|
|
1304
|
+
getAttribute: rt,
|
|
1305
|
+
hover: Qe,
|
|
1306
|
+
isVisible: it,
|
|
1307
|
+
textContent: nt
|
|
1308
|
+
}, Symbol.toStringTag, { value: "Module" })), X = (e, t) => e.elements.flatMap((e) => [...e.querySelectorAll(t)]), Z = (e) => e.replaceAll("\"", "\\\""), st = {
|
|
1048
1309
|
to: "element",
|
|
1049
1310
|
css: !0,
|
|
1050
1311
|
resolve: (e, t) => X(e, t),
|
|
@@ -1052,7 +1313,7 @@ var Ae = class {
|
|
|
1052
1313
|
fragment: typeof e == "string" ? e : "?",
|
|
1053
1314
|
separator: "descend"
|
|
1054
1315
|
})
|
|
1055
|
-
},
|
|
1316
|
+
}, ct = {
|
|
1056
1317
|
to: "frame",
|
|
1057
1318
|
css: !0,
|
|
1058
1319
|
barrier: "down",
|
|
@@ -1061,11 +1322,11 @@ var Ae = class {
|
|
|
1061
1322
|
fragment: typeof e == "string" ? e : "?",
|
|
1062
1323
|
separator: "down"
|
|
1063
1324
|
})
|
|
1064
|
-
},
|
|
1325
|
+
}, lt = {
|
|
1065
1326
|
element: {
|
|
1066
1327
|
selectors: {
|
|
1067
|
-
locator:
|
|
1068
|
-
frameLocator:
|
|
1328
|
+
locator: st,
|
|
1329
|
+
frameLocator: ct,
|
|
1069
1330
|
getByRole: {
|
|
1070
1331
|
to: "element",
|
|
1071
1332
|
resolve: (e, t) => X(e, `[role="${CSS.escape(t)}"]`),
|
|
@@ -1096,20 +1357,20 @@ var Ae = class {
|
|
|
1096
1357
|
}
|
|
1097
1358
|
},
|
|
1098
1359
|
operations: {
|
|
1099
|
-
click:
|
|
1100
|
-
fill:
|
|
1101
|
-
hover:
|
|
1102
|
-
textContent:
|
|
1103
|
-
getAttribute:
|
|
1104
|
-
isVisible:
|
|
1105
|
-
count:
|
|
1106
|
-
exists:
|
|
1360
|
+
click: Ze,
|
|
1361
|
+
fill: tt,
|
|
1362
|
+
hover: Qe,
|
|
1363
|
+
textContent: nt,
|
|
1364
|
+
getAttribute: rt,
|
|
1365
|
+
isVisible: it,
|
|
1366
|
+
count: at,
|
|
1367
|
+
exists: ot
|
|
1107
1368
|
}
|
|
1108
1369
|
},
|
|
1109
1370
|
frame: {
|
|
1110
1371
|
selectors: {
|
|
1111
|
-
locator:
|
|
1112
|
-
frameLocator:
|
|
1372
|
+
locator: st,
|
|
1373
|
+
frameLocator: ct,
|
|
1113
1374
|
owner: {
|
|
1114
1375
|
to: "frame",
|
|
1115
1376
|
barrier: "up",
|
|
@@ -1122,9 +1383,9 @@ var Ae = class {
|
|
|
1122
1383
|
})
|
|
1123
1384
|
}
|
|
1124
1385
|
},
|
|
1125
|
-
operations: { addStyleTag:
|
|
1386
|
+
operations: { addStyleTag: Ye }
|
|
1126
1387
|
}
|
|
1127
|
-
},
|
|
1388
|
+
}, ut = (e, t = lt) => ({
|
|
1128
1389
|
element: {
|
|
1129
1390
|
selectors: {
|
|
1130
1391
|
...t.element.selectors,
|
|
@@ -1145,29 +1406,29 @@ var Ae = class {
|
|
|
1145
1406
|
...e.frame?.operations
|
|
1146
1407
|
}
|
|
1147
1408
|
}
|
|
1148
|
-
}),
|
|
1409
|
+
}), dt = 3e4, ft = 50, pt = (e) => {
|
|
1149
1410
|
let t = e[e.length - 1];
|
|
1150
1411
|
return typeof t == "object" && t ? t : void 0;
|
|
1151
|
-
},
|
|
1152
|
-
let t =
|
|
1153
|
-
return typeof t == "number" ? t :
|
|
1154
|
-
},
|
|
1412
|
+
}, mt = (e) => {
|
|
1413
|
+
let t = pt(e)?.timeout;
|
|
1414
|
+
return typeof t == "number" ? t : dt;
|
|
1415
|
+
}, ht = ({ executor: e, parts: t }) => ({ highlight: (n) => e.highlight(t, n).then(() => {}, () => {}) }), gt = async (e) => {
|
|
1155
1416
|
let t = {
|
|
1156
1417
|
parts: e.parts,
|
|
1157
1418
|
operation: e.operation,
|
|
1158
1419
|
args: e.args,
|
|
1159
1420
|
phase: "ensure"
|
|
1160
1421
|
};
|
|
1161
|
-
await e.gate?.(t,
|
|
1162
|
-
},
|
|
1422
|
+
await e.gate?.(t, ht(e));
|
|
1423
|
+
}, _t = async (e) => {
|
|
1163
1424
|
let { executor: t, gate: n, parts: r, operation: i, args: a } = e;
|
|
1164
1425
|
n && await n({
|
|
1165
1426
|
parts: r,
|
|
1166
1427
|
operation: i,
|
|
1167
1428
|
args: a,
|
|
1168
1429
|
phase: "execute"
|
|
1169
|
-
},
|
|
1170
|
-
let o =
|
|
1430
|
+
}, ht(e));
|
|
1431
|
+
let o = mt(a), s = Date.now() + o, c = /* @__PURE__ */ Error(`Locator timeout (${o}ms): ${i}`), { promise: l, reject: u } = Promise.withResolvers();
|
|
1171
1432
|
l.catch(() => {});
|
|
1172
1433
|
let d = setTimeout(() => u(c), o), f = c;
|
|
1173
1434
|
try {
|
|
@@ -1175,36 +1436,36 @@ var Ae = class {
|
|
|
1175
1436
|
return await Promise.race([t.execute(r, i, a), l]);
|
|
1176
1437
|
} catch (e) {
|
|
1177
1438
|
if (e === c) break;
|
|
1178
|
-
if (
|
|
1439
|
+
if (Fe(e)) throw e;
|
|
1179
1440
|
f = e;
|
|
1180
1441
|
let t = s - Date.now();
|
|
1181
1442
|
if (t <= 0) break;
|
|
1182
|
-
await new Promise((e) => setTimeout(e, Math.min(
|
|
1443
|
+
await new Promise((e) => setTimeout(e, Math.min(ft, t)));
|
|
1183
1444
|
}
|
|
1184
1445
|
} finally {
|
|
1185
1446
|
clearTimeout(d);
|
|
1186
1447
|
}
|
|
1187
1448
|
throw f;
|
|
1188
|
-
},
|
|
1449
|
+
}, vt = (e, t, n, r) => {
|
|
1189
1450
|
let i = {};
|
|
1190
|
-
for (let [a, o] of Object.entries(t[n].selectors)) i[a] = (...i) =>
|
|
1451
|
+
for (let [a, o] of Object.entries(t[n].selectors)) i[a] = (...i) => vt(e, t, o.to, [...r, {
|
|
1191
1452
|
kind: n,
|
|
1192
1453
|
name: a,
|
|
1193
1454
|
args: i
|
|
1194
1455
|
}]);
|
|
1195
|
-
for (let a of Object.keys(t[n].operations)) i[a] = (...t) =>
|
|
1456
|
+
for (let a of Object.keys(t[n].operations)) i[a] = (...t) => _t({
|
|
1196
1457
|
...e,
|
|
1197
1458
|
parts: r,
|
|
1198
1459
|
operation: a,
|
|
1199
1460
|
args: t
|
|
1200
1461
|
});
|
|
1201
|
-
return i.ensure = (t, n = {}) =>
|
|
1462
|
+
return i.ensure = (t, n = {}) => gt({
|
|
1202
1463
|
...e,
|
|
1203
1464
|
parts: r,
|
|
1204
1465
|
operation: t,
|
|
1205
1466
|
args: [n]
|
|
1206
1467
|
}), i;
|
|
1207
|
-
},
|
|
1468
|
+
}, yt = (e) => vt(e, e.modules ?? lt, "frame", []), bt = ut({
|
|
1208
1469
|
element: { operations: {
|
|
1209
1470
|
click: { resolve: (e, t = {}) => Y.click.resolve(e, t) },
|
|
1210
1471
|
hover: { resolve: (e, t = {}) => Y.hover.resolve(e, t) },
|
|
@@ -1214,10 +1475,10 @@ var Ae = class {
|
|
|
1214
1475
|
isVisible: { resolve: (e, t = {}) => Y.isVisible.resolve(e) },
|
|
1215
1476
|
count: { resolve: (e, t = {}) => Y.count.resolve(e) },
|
|
1216
1477
|
exists: { resolve: (e, t = {}) => Y.exists.resolve(e) },
|
|
1217
|
-
videoElement: { resolve: (e, t = {}) =>
|
|
1478
|
+
videoElement: { resolve: (e, t = {}) => x(Le(J(e.elements), "HTMLVideoElement")) }
|
|
1218
1479
|
} },
|
|
1219
|
-
frame: { operations: { addStyleTag: { resolve: (e, t) =>
|
|
1220
|
-
}),
|
|
1480
|
+
frame: { operations: { addStyleTag: { resolve: (e, t) => Ye.resolve(e, t) } } }
|
|
1481
|
+
}), Q = (e) => {
|
|
1221
1482
|
if (!e || e === "about:blank") return !1;
|
|
1222
1483
|
let t;
|
|
1223
1484
|
try {
|
|
@@ -1230,25 +1491,25 @@ var Ae = class {
|
|
|
1230
1491
|
let n = t.hostname, r = (e) => n === e || n.endsWith(`.${e}`);
|
|
1231
1492
|
return r("fkn.app") || r("fkn.dev") || r("sdbx.app");
|
|
1232
1493
|
}, $ = (e) => {
|
|
1233
|
-
if (
|
|
1234
|
-
},
|
|
1494
|
+
if (Q(e)) throw Error("attachFrame: refusing to target the extension's own pages or an FKN platform origin");
|
|
1495
|
+
}, xt = ({ src: e, domains: t, lockdown: n }) => {
|
|
1235
1496
|
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");
|
|
1236
|
-
},
|
|
1497
|
+
}, St = {
|
|
1237
1498
|
scope: "embed.iframe",
|
|
1238
1499
|
category: "embed",
|
|
1239
1500
|
severity: 0,
|
|
1240
1501
|
title: "Load another website inside this app",
|
|
1241
1502
|
description: "Lets the app embed external pages directly inside its own view."
|
|
1242
|
-
},
|
|
1503
|
+
}, Ct = {
|
|
1243
1504
|
scope: "embed.open",
|
|
1244
1505
|
category: "embed",
|
|
1245
1506
|
severity: 0,
|
|
1246
1507
|
title: "Open a website inside this app",
|
|
1247
1508
|
description: "Lets the app navigate to another site without leaving its window."
|
|
1248
|
-
},
|
|
1249
|
-
let t =
|
|
1509
|
+
}, wt = (e) => {
|
|
1510
|
+
let t = yt({
|
|
1250
1511
|
executor: e.executor,
|
|
1251
|
-
modules:
|
|
1512
|
+
modules: bt,
|
|
1252
1513
|
gate: e.gate
|
|
1253
1514
|
}), n = (t, n = {}) => ($(t), e.goto(t, n)), r = () => e.url();
|
|
1254
1515
|
return {
|
|
@@ -1256,21 +1517,21 @@ var Ae = class {
|
|
|
1256
1517
|
goto: n,
|
|
1257
1518
|
url: r
|
|
1258
1519
|
};
|
|
1259
|
-
},
|
|
1520
|
+
}, Tt = "FKN_WEB_EXTENSION_ATTACH_FRAME_EVENT_KEY", Et = async ({ iframe: e, domains: t = [], syncCookies: n = !0, lockdown: r = !1 }) => {
|
|
1260
1521
|
let i = crypto.randomUUID();
|
|
1261
|
-
if ($(e.src),
|
|
1522
|
+
if ($(e.src), xt({
|
|
1262
1523
|
src: e.src,
|
|
1263
1524
|
domains: t,
|
|
1264
1525
|
lockdown: r
|
|
1265
|
-
}), await
|
|
1266
|
-
e.dispatchEvent(new CustomEvent(
|
|
1267
|
-
let { executeLocator: a, highlightLocator: o, ensureLocatorPermission: s, goto: c } = await
|
|
1526
|
+
}), await k(), !e.isConnected) throw Error("attachFrame: the iframe must be connected to the document before attaching");
|
|
1527
|
+
e.dispatchEvent(new CustomEvent(Tt, { detail: i }));
|
|
1528
|
+
let { executeLocator: a, highlightLocator: o, ensureLocatorPermission: s, goto: c } = await A.attachFrame({
|
|
1268
1529
|
marker: i,
|
|
1269
1530
|
domains: t,
|
|
1270
1531
|
syncCookies: n,
|
|
1271
1532
|
lockdown: r
|
|
1272
1533
|
});
|
|
1273
|
-
return
|
|
1534
|
+
return wt({
|
|
1274
1535
|
executor: {
|
|
1275
1536
|
execute: a,
|
|
1276
1537
|
highlight: o
|
|
@@ -1282,10 +1543,10 @@ var Ae = class {
|
|
|
1282
1543
|
}),
|
|
1283
1544
|
url: () => e.src
|
|
1284
1545
|
});
|
|
1285
|
-
},
|
|
1546
|
+
}, Dt = { request: (e) => A.requestPermissions(e.map((e) => ({
|
|
1286
1547
|
key: e.key,
|
|
1287
1548
|
scope: e.scope ?? "",
|
|
1288
1549
|
reason: e.reason
|
|
1289
1550
|
}))) };
|
|
1290
1551
|
//#endregion
|
|
1291
|
-
export {
|
|
1552
|
+
export { fe as A, S as B, be as C, M as D, pe as E, oe as F, u as H, k as I, T as L, ue as M, E as N, _e as O, D as P, C as R, N as S, he as T, w as V, Ce as _, wt as a, Se as b, xt as c, Pe as d, Me as f, H as g, V as h, St as i, de as j, j as k, Q as l, Ne as m, Tt as n, Ct as o, Fe as p, Et as r, $ as s, Dt as t, B as u, Te as v, me as w, xe as x, we as y, x as z };
|