@aigne/afs-cli 1.11.0-beta.6 → 1.11.0-beta.7
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/dist/cli.cjs +27 -353
- package/dist/cli.d.cts +2 -1
- package/dist/cli.d.mts +2 -1
- package/dist/cli.mjs +28 -353
- package/dist/cli.mjs.map +1 -1
- package/dist/config/afs-loader.cjs +123 -0
- package/dist/config/afs-loader.d.cts +14 -0
- package/dist/config/afs-loader.d.cts.map +1 -0
- package/dist/config/afs-loader.d.mts +14 -0
- package/dist/config/afs-loader.d.mts.map +1 -0
- package/dist/config/afs-loader.mjs +122 -0
- package/dist/config/afs-loader.mjs.map +1 -0
- package/dist/config/loader.cjs +2 -2
- package/dist/config/loader.mjs +2 -2
- package/dist/{commands/mount.cjs → config/mount-commands.cjs} +13 -49
- package/dist/config/mount-commands.d.cts +20 -0
- package/dist/config/mount-commands.d.cts.map +1 -0
- package/dist/config/mount-commands.d.mts +20 -0
- package/dist/config/mount-commands.d.mts.map +1 -0
- package/dist/{commands/mount.mjs → config/mount-commands.mjs} +14 -49
- package/dist/config/mount-commands.mjs.map +1 -0
- package/dist/config/schema.cjs +9 -1
- package/dist/config/schema.mjs +9 -1
- package/dist/config/schema.mjs.map +1 -1
- package/dist/core/commands/delete.cjs +41 -0
- package/dist/core/commands/delete.d.cts +18 -0
- package/dist/core/commands/delete.d.cts.map +1 -0
- package/dist/core/commands/delete.d.mts +18 -0
- package/dist/core/commands/delete.d.mts.map +1 -0
- package/dist/core/commands/delete.mjs +42 -0
- package/dist/core/commands/delete.mjs.map +1 -0
- package/dist/core/commands/exec.cjs +95 -0
- package/dist/core/commands/exec.d.cts +26 -0
- package/dist/core/commands/exec.d.cts.map +1 -0
- package/dist/core/commands/exec.d.mts +26 -0
- package/dist/core/commands/exec.d.mts.map +1 -0
- package/dist/core/commands/exec.mjs +96 -0
- package/dist/core/commands/exec.mjs.map +1 -0
- package/dist/core/commands/explain.cjs +254 -0
- package/dist/core/commands/explain.d.cts +25 -0
- package/dist/core/commands/explain.d.cts.map +1 -0
- package/dist/core/commands/explain.d.mts +25 -0
- package/dist/core/commands/explain.d.mts.map +1 -0
- package/dist/core/commands/explain.mjs +255 -0
- package/dist/core/commands/explain.mjs.map +1 -0
- package/dist/core/commands/explore.cjs +30 -0
- package/dist/core/commands/explore.d.mts +2 -0
- package/dist/core/commands/explore.mjs +31 -0
- package/dist/core/commands/explore.mjs.map +1 -0
- package/dist/core/commands/index.cjs +36 -0
- package/dist/core/commands/index.d.cts +21 -0
- package/dist/core/commands/index.d.cts.map +1 -0
- package/dist/core/commands/index.d.mts +24 -0
- package/dist/core/commands/index.d.mts.map +1 -0
- package/dist/core/commands/index.mjs +37 -0
- package/dist/core/commands/index.mjs.map +1 -0
- package/dist/core/commands/ls.cjs +57 -0
- package/dist/core/commands/ls.d.cts +21 -0
- package/dist/core/commands/ls.d.cts.map +1 -0
- package/dist/core/commands/ls.d.mts +21 -0
- package/dist/core/commands/ls.d.mts.map +1 -0
- package/dist/core/commands/ls.mjs +58 -0
- package/dist/core/commands/ls.mjs.map +1 -0
- package/dist/core/commands/mount.cjs +139 -0
- package/dist/core/commands/mount.d.cts +33 -0
- package/dist/core/commands/mount.d.cts.map +1 -0
- package/dist/core/commands/mount.d.mts +33 -0
- package/dist/core/commands/mount.d.mts.map +1 -0
- package/dist/core/commands/mount.mjs +140 -0
- package/dist/core/commands/mount.mjs.map +1 -0
- package/dist/core/commands/read.cjs +48 -0
- package/dist/core/commands/read.d.cts +17 -0
- package/dist/core/commands/read.d.cts.map +1 -0
- package/dist/core/commands/read.d.mts +17 -0
- package/dist/core/commands/read.d.mts.map +1 -0
- package/dist/core/commands/read.mjs +49 -0
- package/dist/core/commands/read.mjs.map +1 -0
- package/dist/core/commands/search.cjs +40 -0
- package/dist/core/commands/search.d.mts +2 -0
- package/dist/core/commands/search.mjs +41 -0
- package/dist/core/commands/search.mjs.map +1 -0
- package/dist/core/commands/serve.cjs +242 -0
- package/dist/core/commands/serve.d.mts +2 -0
- package/dist/core/commands/serve.mjs +242 -0
- package/dist/core/commands/serve.mjs.map +1 -0
- package/dist/core/commands/stat.cjs +53 -0
- package/dist/core/commands/stat.d.cts +17 -0
- package/dist/core/commands/stat.d.cts.map +1 -0
- package/dist/core/commands/stat.d.mts +17 -0
- package/dist/core/commands/stat.d.mts.map +1 -0
- package/dist/core/commands/stat.mjs +54 -0
- package/dist/core/commands/stat.mjs.map +1 -0
- package/dist/core/commands/types.cjs +13 -0
- package/dist/core/commands/types.d.cts +54 -0
- package/dist/core/commands/types.d.cts.map +1 -0
- package/dist/core/commands/types.d.mts +54 -0
- package/dist/core/commands/types.d.mts.map +1 -0
- package/dist/core/commands/types.mjs +14 -0
- package/dist/core/commands/types.mjs.map +1 -0
- package/dist/core/commands/write.cjs +70 -0
- package/dist/core/commands/write.d.cts +20 -0
- package/dist/core/commands/write.d.cts.map +1 -0
- package/dist/core/commands/write.d.mts +20 -0
- package/dist/core/commands/write.d.mts.map +1 -0
- package/dist/core/commands/write.mjs +71 -0
- package/dist/core/commands/write.mjs.map +1 -0
- package/dist/core/executor/index.cjs +196 -0
- package/dist/core/executor/index.d.cts +77 -0
- package/dist/core/executor/index.d.cts.map +1 -0
- package/dist/core/executor/index.d.mts +77 -0
- package/dist/core/executor/index.d.mts.map +1 -0
- package/dist/core/executor/index.mjs +195 -0
- package/dist/core/executor/index.mjs.map +1 -0
- package/dist/core/formatters/delete.cjs +37 -0
- package/dist/core/formatters/delete.d.cts +18 -0
- package/dist/core/formatters/delete.d.cts.map +1 -0
- package/dist/core/formatters/delete.d.mts +18 -0
- package/dist/core/formatters/delete.d.mts.map +1 -0
- package/dist/core/formatters/delete.mjs +37 -0
- package/dist/core/formatters/delete.mjs.map +1 -0
- package/dist/core/formatters/exec.cjs +60 -0
- package/dist/core/formatters/exec.d.cts +18 -0
- package/dist/core/formatters/exec.d.cts.map +1 -0
- package/dist/core/formatters/exec.d.mts +18 -0
- package/dist/core/formatters/exec.d.mts.map +1 -0
- package/dist/core/formatters/exec.mjs +60 -0
- package/dist/core/formatters/exec.mjs.map +1 -0
- package/dist/core/formatters/explain.cjs +97 -0
- package/dist/core/formatters/explain.d.cts +11 -0
- package/dist/core/formatters/explain.d.cts.map +1 -0
- package/dist/core/formatters/explain.d.mts +11 -0
- package/dist/core/formatters/explain.d.mts.map +1 -0
- package/dist/core/formatters/explain.mjs +96 -0
- package/dist/core/formatters/explain.mjs.map +1 -0
- package/dist/core/formatters/index.d.mts +9 -0
- package/dist/core/formatters/ls.cjs +179 -0
- package/dist/core/formatters/ls.d.cts +20 -0
- package/dist/core/formatters/ls.d.cts.map +1 -0
- package/dist/core/formatters/ls.d.mts +20 -0
- package/dist/core/formatters/ls.d.mts.map +1 -0
- package/dist/core/formatters/ls.mjs +179 -0
- package/dist/core/formatters/ls.mjs.map +1 -0
- package/dist/core/formatters/mount.cjs +55 -0
- package/dist/core/formatters/mount.d.cts +15 -0
- package/dist/core/formatters/mount.d.cts.map +1 -0
- package/dist/core/formatters/mount.d.mts +15 -0
- package/dist/core/formatters/mount.d.mts.map +1 -0
- package/dist/core/formatters/mount.mjs +55 -0
- package/dist/core/formatters/mount.mjs.map +1 -0
- package/dist/core/formatters/read.cjs +100 -0
- package/dist/core/formatters/read.d.cts +22 -0
- package/dist/core/formatters/read.d.cts.map +1 -0
- package/dist/core/formatters/read.d.mts +22 -0
- package/dist/core/formatters/read.d.mts.map +1 -0
- package/dist/core/formatters/read.mjs +100 -0
- package/dist/core/formatters/read.mjs.map +1 -0
- package/dist/core/formatters/search.cjs +44 -0
- package/dist/core/formatters/search.d.mts +1 -0
- package/dist/core/formatters/search.mjs +44 -0
- package/dist/core/formatters/search.mjs.map +1 -0
- package/dist/core/formatters/stat.cjs +155 -0
- package/dist/core/formatters/stat.d.cts +15 -0
- package/dist/core/formatters/stat.d.cts.map +1 -0
- package/dist/core/formatters/stat.d.mts +15 -0
- package/dist/core/formatters/stat.d.mts.map +1 -0
- package/dist/core/formatters/stat.mjs +155 -0
- package/dist/core/formatters/stat.mjs.map +1 -0
- package/dist/core/formatters/write.cjs +51 -0
- package/dist/core/formatters/write.d.cts +22 -0
- package/dist/core/formatters/write.d.cts.map +1 -0
- package/dist/core/formatters/write.d.mts +22 -0
- package/dist/core/formatters/write.d.mts.map +1 -0
- package/dist/core/formatters/write.mjs +51 -0
- package/dist/core/formatters/write.mjs.map +1 -0
- package/dist/core/helpers/exec-args.cjs +142 -0
- package/dist/core/helpers/exec-args.d.cts +46 -0
- package/dist/core/helpers/exec-args.d.cts.map +1 -0
- package/dist/core/helpers/exec-args.d.mts +46 -0
- package/dist/core/helpers/exec-args.d.mts.map +1 -0
- package/dist/core/helpers/exec-args.mjs +139 -0
- package/dist/core/helpers/exec-args.mjs.map +1 -0
- package/dist/core/helpers/stdin.cjs +41 -0
- package/dist/core/helpers/stdin.d.cts +15 -0
- package/dist/core/helpers/stdin.d.cts.map +1 -0
- package/dist/core/helpers/stdin.d.mts +15 -0
- package/dist/core/helpers/stdin.d.mts.map +1 -0
- package/dist/core/helpers/stdin.mjs +41 -0
- package/dist/core/helpers/stdin.mjs.map +1 -0
- package/dist/core/index.cjs +49 -0
- package/dist/core/index.d.cts +24 -0
- package/dist/core/index.d.mts +25 -0
- package/dist/core/index.mjs +24 -0
- package/dist/core/path-utils.cjs +1 -0
- package/dist/core/path-utils.mjs +3 -0
- package/dist/core/types.d.cts +24 -0
- package/dist/core/types.d.cts.map +1 -0
- package/dist/core/types.d.mts +24 -0
- package/dist/core/types.d.mts.map +1 -0
- package/dist/errors.cjs +0 -11
- package/dist/errors.mjs +1 -11
- package/dist/errors.mjs.map +1 -1
- package/dist/explorer/actions.cjs +67 -32
- package/dist/explorer/actions.mjs +66 -32
- package/dist/explorer/actions.mjs.map +1 -1
- package/dist/explorer/components/dialog.cjs +170 -46
- package/dist/explorer/components/dialog.mjs +170 -46
- package/dist/explorer/components/dialog.mjs.map +1 -1
- package/dist/explorer/components/metadata-panel.cjs +86 -3
- package/dist/explorer/components/metadata-panel.mjs +86 -3
- package/dist/explorer/components/metadata-panel.mjs.map +1 -1
- package/dist/explorer/screen.cjs +63 -27
- package/dist/explorer/screen.d.cts +23 -0
- package/dist/explorer/screen.d.cts.map +1 -0
- package/dist/explorer/screen.d.mts +23 -0
- package/dist/explorer/screen.d.mts.map +1 -0
- package/dist/explorer/screen.mjs +63 -27
- package/dist/explorer/screen.mjs.map +1 -1
- package/dist/explorer/theme.cjs +1 -1
- package/dist/explorer/theme.mjs +1 -1
- package/dist/explorer/theme.mjs.map +1 -1
- package/dist/index.cjs +7 -1
- package/dist/index.d.cts +4 -1
- package/dist/index.d.mts +4 -1
- package/dist/index.mjs +4 -1
- package/dist/mcp/http-transport.cjs +68 -0
- package/dist/mcp/http-transport.mjs +68 -0
- package/dist/mcp/http-transport.mjs.map +1 -0
- package/dist/mcp/prompts.cjs +48 -0
- package/dist/mcp/prompts.mjs +48 -0
- package/dist/mcp/prompts.mjs.map +1 -0
- package/dist/mcp/resources.cjs +25 -0
- package/dist/mcp/resources.mjs +25 -0
- package/dist/mcp/resources.mjs.map +1 -0
- package/dist/mcp/server.cjs +30 -0
- package/dist/mcp/server.mjs +30 -0
- package/dist/mcp/server.mjs.map +1 -0
- package/dist/mcp/tools.cjs +196 -0
- package/dist/mcp/tools.mjs +196 -0
- package/dist/mcp/tools.mjs.map +1 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/index.d.cts +10 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/index.d.cts.map +1 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/index.d.mts +10 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/index.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/types.d.cts +46 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/types.d.cts.map +1 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/types.d.mts +46 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/types.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/urlpattern.cjs +902 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/urlpattern.mjs +902 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/urlpattern.mjs.map +1 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/index.cjs +6 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/index.mjs +8 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/index.mjs.map +1 -0
- package/dist/path-utils.d.cts +50 -0
- package/dist/path-utils.d.cts.map +1 -0
- package/dist/path-utils.d.mts +50 -0
- package/dist/path-utils.d.mts.map +1 -0
- package/dist/repl.cjs +485 -0
- package/dist/repl.d.cts +15 -0
- package/dist/repl.d.cts.map +1 -0
- package/dist/repl.d.mts +16 -0
- package/dist/repl.d.mts.map +1 -0
- package/dist/repl.mjs +485 -0
- package/dist/repl.mjs.map +1 -0
- package/dist/serve.cjs +146 -0
- package/dist/serve.d.cts +41 -0
- package/dist/serve.d.cts.map +1 -0
- package/dist/serve.d.mts +41 -0
- package/dist/serve.d.mts.map +1 -0
- package/dist/serve.mjs +146 -0
- package/dist/serve.mjs.map +1 -0
- package/dist/ui/header.cjs +1 -40
- package/dist/ui/header.mjs +1 -39
- package/dist/ui/header.mjs.map +1 -1
- package/dist/ui/index.cjs +2 -9
- package/dist/ui/index.mjs +2 -7
- package/dist/ui/index.mjs.map +1 -1
- package/dist/ui/terminal.cjs +1 -10
- package/dist/ui/terminal.mjs +1 -8
- package/dist/ui/terminal.mjs.map +1 -1
- package/package.json +29 -16
- package/dist/commands/exec.cjs +0 -164
- package/dist/commands/exec.mjs +0 -160
- package/dist/commands/exec.mjs.map +0 -1
- package/dist/commands/explain.cjs +0 -244
- package/dist/commands/explain.mjs +0 -242
- package/dist/commands/explain.mjs.map +0 -1
- package/dist/commands/index.cjs +0 -8
- package/dist/commands/index.mjs +0 -10
- package/dist/commands/ls.cjs +0 -242
- package/dist/commands/ls.mjs +0 -242
- package/dist/commands/ls.mjs.map +0 -1
- package/dist/commands/mount.mjs.map +0 -1
- package/dist/commands/read.cjs +0 -264
- package/dist/commands/read.mjs +0 -263
- package/dist/commands/read.mjs.map +0 -1
- package/dist/commands/serve.cjs +0 -144
- package/dist/commands/serve.mjs +0 -143
- package/dist/commands/serve.mjs.map +0 -1
- package/dist/commands/stat.cjs +0 -195
- package/dist/commands/stat.mjs +0 -195
- package/dist/commands/stat.mjs.map +0 -1
- package/dist/commands/write.cjs +0 -85
- package/dist/commands/write.mjs +0 -85
- package/dist/commands/write.mjs.map +0 -1
- package/dist/config/provider-factory.cjs +0 -400
- package/dist/config/provider-factory.mjs +0 -401
- package/dist/config/provider-factory.mjs.map +0 -1
- package/dist/config/uri-parser.cjs +0 -285
- package/dist/config/uri-parser.mjs +0 -285
- package/dist/config/uri-parser.mjs.map +0 -1
- package/dist/runtime.cjs +0 -120
- package/dist/runtime.mjs +0 -120
- package/dist/runtime.mjs.map +0 -1
- package/dist/utils/meta.cjs +0 -51
- package/dist/utils/meta.mjs +0 -49
- package/dist/utils/meta.mjs.map +0 -1
|
@@ -0,0 +1,902 @@
|
|
|
1
|
+
|
|
2
|
+
//#region ../../node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/urlpattern.js
|
|
3
|
+
var Pe = Object.defineProperty;
|
|
4
|
+
var a = (e, t) => Pe(e, "name", {
|
|
5
|
+
value: t,
|
|
6
|
+
configurable: !0
|
|
7
|
+
});
|
|
8
|
+
var P = class {
|
|
9
|
+
type = 3;
|
|
10
|
+
name = "";
|
|
11
|
+
prefix = "";
|
|
12
|
+
value = "";
|
|
13
|
+
suffix = "";
|
|
14
|
+
modifier = 3;
|
|
15
|
+
constructor(t, r, n, c, l, f) {
|
|
16
|
+
this.type = t, this.name = r, this.prefix = n, this.value = c, this.suffix = l, this.modifier = f;
|
|
17
|
+
}
|
|
18
|
+
hasCustomName() {
|
|
19
|
+
return this.name !== "" && typeof this.name != "number";
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
a(P, "Part");
|
|
23
|
+
var Re = /[$_\p{ID_Start}]/u, Ee = /[$_\u200C\u200D\p{ID_Continue}]/u, v = ".*";
|
|
24
|
+
function Oe(e, t) {
|
|
25
|
+
return (t ? /^[\x00-\xFF]*$/ : /^[\x00-\x7F]*$/).test(e);
|
|
26
|
+
}
|
|
27
|
+
a(Oe, "isASCII");
|
|
28
|
+
function D(e, t = !1) {
|
|
29
|
+
let r = [], n = 0;
|
|
30
|
+
for (; n < e.length;) {
|
|
31
|
+
let c = e[n], l = a(function(f) {
|
|
32
|
+
if (!t) throw new TypeError(f);
|
|
33
|
+
r.push({
|
|
34
|
+
type: "INVALID_CHAR",
|
|
35
|
+
index: n,
|
|
36
|
+
value: e[n++]
|
|
37
|
+
});
|
|
38
|
+
}, "ErrorOrInvalid");
|
|
39
|
+
if (c === "*") {
|
|
40
|
+
r.push({
|
|
41
|
+
type: "ASTERISK",
|
|
42
|
+
index: n,
|
|
43
|
+
value: e[n++]
|
|
44
|
+
});
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
if (c === "+" || c === "?") {
|
|
48
|
+
r.push({
|
|
49
|
+
type: "OTHER_MODIFIER",
|
|
50
|
+
index: n,
|
|
51
|
+
value: e[n++]
|
|
52
|
+
});
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
if (c === "\\") {
|
|
56
|
+
r.push({
|
|
57
|
+
type: "ESCAPED_CHAR",
|
|
58
|
+
index: n++,
|
|
59
|
+
value: e[n++]
|
|
60
|
+
});
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
if (c === "{") {
|
|
64
|
+
r.push({
|
|
65
|
+
type: "OPEN",
|
|
66
|
+
index: n,
|
|
67
|
+
value: e[n++]
|
|
68
|
+
});
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
if (c === "}") {
|
|
72
|
+
r.push({
|
|
73
|
+
type: "CLOSE",
|
|
74
|
+
index: n,
|
|
75
|
+
value: e[n++]
|
|
76
|
+
});
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
if (c === ":") {
|
|
80
|
+
let f = "", s = n + 1;
|
|
81
|
+
for (; s < e.length;) {
|
|
82
|
+
let i = e.substr(s, 1);
|
|
83
|
+
if (s === n + 1 && Re.test(i) || s !== n + 1 && Ee.test(i)) {
|
|
84
|
+
f += e[s++];
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
if (!f) {
|
|
90
|
+
l(`Missing parameter name at ${n}`);
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
r.push({
|
|
94
|
+
type: "NAME",
|
|
95
|
+
index: n,
|
|
96
|
+
value: f
|
|
97
|
+
}), n = s;
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
if (c === "(") {
|
|
101
|
+
let f = 1, s = "", i = n + 1, o = !1;
|
|
102
|
+
if (e[i] === "?") {
|
|
103
|
+
l(`Pattern cannot start with "?" at ${i}`);
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
for (; i < e.length;) {
|
|
107
|
+
if (!Oe(e[i], !1)) {
|
|
108
|
+
l(`Invalid character '${e[i]}' at ${i}.`), o = !0;
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
if (e[i] === "\\") {
|
|
112
|
+
s += e[i++] + e[i++];
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
if (e[i] === ")") {
|
|
116
|
+
if (f--, f === 0) {
|
|
117
|
+
i++;
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
} else if (e[i] === "(" && (f++, e[i + 1] !== "?")) {
|
|
121
|
+
l(`Capturing groups are not allowed at ${i}`), o = !0;
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
s += e[i++];
|
|
125
|
+
}
|
|
126
|
+
if (o) continue;
|
|
127
|
+
if (f) {
|
|
128
|
+
l(`Unbalanced pattern at ${n}`);
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
if (!s) {
|
|
132
|
+
l(`Missing pattern at ${n}`);
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
r.push({
|
|
136
|
+
type: "REGEX",
|
|
137
|
+
index: n,
|
|
138
|
+
value: s
|
|
139
|
+
}), n = i;
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
r.push({
|
|
143
|
+
type: "CHAR",
|
|
144
|
+
index: n,
|
|
145
|
+
value: e[n++]
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
return r.push({
|
|
149
|
+
type: "END",
|
|
150
|
+
index: n,
|
|
151
|
+
value: ""
|
|
152
|
+
}), r;
|
|
153
|
+
}
|
|
154
|
+
a(D, "lexer");
|
|
155
|
+
function F(e, t = {}) {
|
|
156
|
+
let r = D(e);
|
|
157
|
+
t.delimiter ??= "/#?", t.prefixes ??= "./";
|
|
158
|
+
let n = `[^${x(t.delimiter)}]+?`, c = [], l = 0, f = 0, i = /* @__PURE__ */ new Set(), o = a((u) => {
|
|
159
|
+
if (f < r.length && r[f].type === u) return r[f++].value;
|
|
160
|
+
}, "tryConsume"), h = a(() => o("OTHER_MODIFIER") ?? o("ASTERISK"), "tryConsumeModifier"), p = a((u) => {
|
|
161
|
+
let d = o(u);
|
|
162
|
+
if (d !== void 0) return d;
|
|
163
|
+
let { type: g, index: y } = r[f];
|
|
164
|
+
throw new TypeError(`Unexpected ${g} at ${y}, expected ${u}`);
|
|
165
|
+
}, "mustConsume"), A = a(() => {
|
|
166
|
+
let u = "", d;
|
|
167
|
+
for (; d = o("CHAR") ?? o("ESCAPED_CHAR");) u += d;
|
|
168
|
+
return u;
|
|
169
|
+
}, "consumeText"), xe = a((u) => u, "DefaultEncodePart"), N = t.encodePart || xe, H = "", $ = a((u) => {
|
|
170
|
+
H += u;
|
|
171
|
+
}, "appendToPendingFixedValue"), M = a(() => {
|
|
172
|
+
H.length && (c.push(new P(3, "", "", N(H), "", 3)), H = "");
|
|
173
|
+
}, "maybeAddPartFromPendingFixedValue"), X = a((u, d, g, y, Z) => {
|
|
174
|
+
let m = 3;
|
|
175
|
+
switch (Z) {
|
|
176
|
+
case "?":
|
|
177
|
+
m = 1;
|
|
178
|
+
break;
|
|
179
|
+
case "*":
|
|
180
|
+
m = 0;
|
|
181
|
+
break;
|
|
182
|
+
case "+":
|
|
183
|
+
m = 2;
|
|
184
|
+
break;
|
|
185
|
+
}
|
|
186
|
+
if (!d && !g && m === 3) {
|
|
187
|
+
$(u);
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
if (M(), !d && !g) {
|
|
191
|
+
if (!u) return;
|
|
192
|
+
c.push(new P(3, "", "", N(u), "", m));
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
let S;
|
|
196
|
+
g ? g === "*" ? S = v : S = g : S = n;
|
|
197
|
+
let k = 2;
|
|
198
|
+
S === n ? (k = 1, S = "") : S === v && (k = 0, S = "");
|
|
199
|
+
let E;
|
|
200
|
+
if (d ? E = d : g && (E = l++), i.has(E)) throw new TypeError(`Duplicate name '${E}'.`);
|
|
201
|
+
i.add(E), c.push(new P(k, E, N(u), S, N(y), m));
|
|
202
|
+
}, "addPart");
|
|
203
|
+
for (; f < r.length;) {
|
|
204
|
+
let u = o("CHAR"), d = o("NAME"), g = o("REGEX");
|
|
205
|
+
if (!d && !g && (g = o("ASTERISK")), d || g) {
|
|
206
|
+
let m = u ?? "";
|
|
207
|
+
t.prefixes.indexOf(m) === -1 && ($(m), m = ""), M();
|
|
208
|
+
let S = h();
|
|
209
|
+
X(m, d, g, "", S);
|
|
210
|
+
continue;
|
|
211
|
+
}
|
|
212
|
+
let y = u ?? o("ESCAPED_CHAR");
|
|
213
|
+
if (y) {
|
|
214
|
+
$(y);
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
217
|
+
if (o("OPEN")) {
|
|
218
|
+
let m = A(), S = o("NAME"), k = o("REGEX");
|
|
219
|
+
!S && !k && (k = o("ASTERISK"));
|
|
220
|
+
let E = A();
|
|
221
|
+
p("CLOSE");
|
|
222
|
+
let be = h();
|
|
223
|
+
X(m, S, k, E, be);
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
226
|
+
M(), p("END");
|
|
227
|
+
}
|
|
228
|
+
return c;
|
|
229
|
+
}
|
|
230
|
+
a(F, "parse");
|
|
231
|
+
function x(e) {
|
|
232
|
+
return e.replace(/([.+*?^${}()[\]|/\\])/g, "\\$1");
|
|
233
|
+
}
|
|
234
|
+
a(x, "escapeString");
|
|
235
|
+
function B(e) {
|
|
236
|
+
return e && e.ignoreCase ? "ui" : "u";
|
|
237
|
+
}
|
|
238
|
+
a(B, "flags");
|
|
239
|
+
function q(e, t, r) {
|
|
240
|
+
return W(F(e, r), t, r);
|
|
241
|
+
}
|
|
242
|
+
a(q, "stringToRegexp");
|
|
243
|
+
function T(e) {
|
|
244
|
+
switch (e) {
|
|
245
|
+
case 0: return "*";
|
|
246
|
+
case 1: return "?";
|
|
247
|
+
case 2: return "+";
|
|
248
|
+
case 3: return "";
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
a(T, "modifierToString");
|
|
252
|
+
function W(e, t, r = {}) {
|
|
253
|
+
r.delimiter ??= "/#?", r.prefixes ??= "./", r.sensitive ??= !1, r.strict ??= !1, r.end ??= !0, r.start ??= !0, r.endsWith = "";
|
|
254
|
+
let n = r.start ? "^" : "";
|
|
255
|
+
for (let s of e) {
|
|
256
|
+
if (s.type === 3) {
|
|
257
|
+
s.modifier === 3 ? n += x(s.value) : n += `(?:${x(s.value)})${T(s.modifier)}`;
|
|
258
|
+
continue;
|
|
259
|
+
}
|
|
260
|
+
t && t.push(s.name);
|
|
261
|
+
let i = `[^${x(r.delimiter)}]+?`, o = s.value;
|
|
262
|
+
if (s.type === 1 ? o = i : s.type === 0 && (o = v), !s.prefix.length && !s.suffix.length) {
|
|
263
|
+
s.modifier === 3 || s.modifier === 1 ? n += `(${o})${T(s.modifier)}` : n += `((?:${o})${T(s.modifier)})`;
|
|
264
|
+
continue;
|
|
265
|
+
}
|
|
266
|
+
if (s.modifier === 3 || s.modifier === 1) {
|
|
267
|
+
n += `(?:${x(s.prefix)}(${o})${x(s.suffix)})`, n += T(s.modifier);
|
|
268
|
+
continue;
|
|
269
|
+
}
|
|
270
|
+
n += `(?:${x(s.prefix)}`, n += `((?:${o})(?:`, n += x(s.suffix), n += x(s.prefix), n += `(?:${o}))*)${x(s.suffix)})`, s.modifier === 0 && (n += "?");
|
|
271
|
+
}
|
|
272
|
+
let c = `[${x(r.endsWith)}]|$`, l = `[${x(r.delimiter)}]`;
|
|
273
|
+
if (r.end) return r.strict || (n += `${l}?`), r.endsWith.length ? n += `(?=${c})` : n += "$", new RegExp(n, B(r));
|
|
274
|
+
r.strict || (n += `(?:${l}(?=${c}))?`);
|
|
275
|
+
let f = !1;
|
|
276
|
+
if (e.length) {
|
|
277
|
+
let s = e[e.length - 1];
|
|
278
|
+
s.type === 3 && s.modifier === 3 && (f = r.delimiter.indexOf(s) > -1);
|
|
279
|
+
}
|
|
280
|
+
return f || (n += `(?=${l}|${c})`), new RegExp(n, B(r));
|
|
281
|
+
}
|
|
282
|
+
a(W, "partsToRegexp");
|
|
283
|
+
var b = {
|
|
284
|
+
delimiter: "",
|
|
285
|
+
prefixes: "",
|
|
286
|
+
sensitive: !0,
|
|
287
|
+
strict: !0
|
|
288
|
+
}, J = {
|
|
289
|
+
delimiter: ".",
|
|
290
|
+
prefixes: "",
|
|
291
|
+
sensitive: !0,
|
|
292
|
+
strict: !0
|
|
293
|
+
}, Q = {
|
|
294
|
+
delimiter: "/",
|
|
295
|
+
prefixes: "/",
|
|
296
|
+
sensitive: !0,
|
|
297
|
+
strict: !0
|
|
298
|
+
};
|
|
299
|
+
function ee(e, t) {
|
|
300
|
+
return e.length ? e[0] === "/" ? !0 : !t || e.length < 2 ? !1 : (e[0] == "\\" || e[0] == "{") && e[1] == "/" : !1;
|
|
301
|
+
}
|
|
302
|
+
a(ee, "isAbsolutePathname");
|
|
303
|
+
function te(e, t) {
|
|
304
|
+
return e.startsWith(t) ? e.substring(t.length, e.length) : e;
|
|
305
|
+
}
|
|
306
|
+
a(te, "maybeStripPrefix");
|
|
307
|
+
function ke(e, t) {
|
|
308
|
+
return e.endsWith(t) ? e.substr(0, e.length - t.length) : e;
|
|
309
|
+
}
|
|
310
|
+
a(ke, "maybeStripSuffix");
|
|
311
|
+
function _(e) {
|
|
312
|
+
return !e || e.length < 2 ? !1 : e[0] === "[" || (e[0] === "\\" || e[0] === "{") && e[1] === "[";
|
|
313
|
+
}
|
|
314
|
+
a(_, "treatAsIPv6Hostname");
|
|
315
|
+
var re = [
|
|
316
|
+
"ftp",
|
|
317
|
+
"file",
|
|
318
|
+
"http",
|
|
319
|
+
"https",
|
|
320
|
+
"ws",
|
|
321
|
+
"wss"
|
|
322
|
+
];
|
|
323
|
+
function U(e) {
|
|
324
|
+
if (!e) return !0;
|
|
325
|
+
for (let t of re) if (e.test(t)) return !0;
|
|
326
|
+
return !1;
|
|
327
|
+
}
|
|
328
|
+
a(U, "isSpecialScheme");
|
|
329
|
+
function ne(e, t) {
|
|
330
|
+
if (e = te(e, "#"), t || e === "") return e;
|
|
331
|
+
let r = new URL("https://example.com");
|
|
332
|
+
return r.hash = e, r.hash ? r.hash.substring(1, r.hash.length) : "";
|
|
333
|
+
}
|
|
334
|
+
a(ne, "canonicalizeHash");
|
|
335
|
+
function se(e, t) {
|
|
336
|
+
if (e = te(e, "?"), t || e === "") return e;
|
|
337
|
+
let r = new URL("https://example.com");
|
|
338
|
+
return r.search = e, r.search ? r.search.substring(1, r.search.length) : "";
|
|
339
|
+
}
|
|
340
|
+
a(se, "canonicalizeSearch");
|
|
341
|
+
function ie(e, t) {
|
|
342
|
+
return t || e === "" ? e : _(e) ? K(e) : j(e);
|
|
343
|
+
}
|
|
344
|
+
a(ie, "canonicalizeHostname");
|
|
345
|
+
function ae(e, t) {
|
|
346
|
+
if (t || e === "") return e;
|
|
347
|
+
let r = new URL("https://example.com");
|
|
348
|
+
return r.password = e, r.password;
|
|
349
|
+
}
|
|
350
|
+
a(ae, "canonicalizePassword");
|
|
351
|
+
function oe(e, t) {
|
|
352
|
+
if (t || e === "") return e;
|
|
353
|
+
let r = new URL("https://example.com");
|
|
354
|
+
return r.username = e, r.username;
|
|
355
|
+
}
|
|
356
|
+
a(oe, "canonicalizeUsername");
|
|
357
|
+
function ce(e, t, r) {
|
|
358
|
+
if (r || e === "") return e;
|
|
359
|
+
if (t && !re.includes(t)) return new URL(`${t}:${e}`).pathname;
|
|
360
|
+
let n = e[0] == "/";
|
|
361
|
+
return e = new URL(n ? e : "/-" + e, "https://example.com").pathname, n || (e = e.substring(2, e.length)), e;
|
|
362
|
+
}
|
|
363
|
+
a(ce, "canonicalizePathname");
|
|
364
|
+
function le(e, t, r) {
|
|
365
|
+
return z(t) === e && (e = ""), r || e === "" ? e : G(e);
|
|
366
|
+
}
|
|
367
|
+
a(le, "canonicalizePort");
|
|
368
|
+
function fe(e, t) {
|
|
369
|
+
return e = ke(e, ":"), t || e === "" ? e : w(e);
|
|
370
|
+
}
|
|
371
|
+
a(fe, "canonicalizeProtocol");
|
|
372
|
+
function z(e) {
|
|
373
|
+
switch (e) {
|
|
374
|
+
case "ws":
|
|
375
|
+
case "http": return "80";
|
|
376
|
+
case "wws":
|
|
377
|
+
case "https": return "443";
|
|
378
|
+
case "ftp": return "21";
|
|
379
|
+
default: return "";
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
a(z, "defaultPortForProtocol");
|
|
383
|
+
function w(e) {
|
|
384
|
+
if (e === "") return e;
|
|
385
|
+
if (/^[-+.A-Za-z0-9]*$/.test(e)) return e.toLowerCase();
|
|
386
|
+
throw new TypeError(`Invalid protocol '${e}'.`);
|
|
387
|
+
}
|
|
388
|
+
a(w, "protocolEncodeCallback");
|
|
389
|
+
function he(e) {
|
|
390
|
+
if (e === "") return e;
|
|
391
|
+
let t = new URL("https://example.com");
|
|
392
|
+
return t.username = e, t.username;
|
|
393
|
+
}
|
|
394
|
+
a(he, "usernameEncodeCallback");
|
|
395
|
+
function ue(e) {
|
|
396
|
+
if (e === "") return e;
|
|
397
|
+
let t = new URL("https://example.com");
|
|
398
|
+
return t.password = e, t.password;
|
|
399
|
+
}
|
|
400
|
+
a(ue, "passwordEncodeCallback");
|
|
401
|
+
function j(e) {
|
|
402
|
+
if (e === "") return e;
|
|
403
|
+
if (/[\t\n\r #%/:<>?@[\]^\\|]/g.test(e)) throw new TypeError(`Invalid hostname '${e}'`);
|
|
404
|
+
let t = new URL("https://example.com");
|
|
405
|
+
return t.hostname = e, t.hostname;
|
|
406
|
+
}
|
|
407
|
+
a(j, "hostnameEncodeCallback");
|
|
408
|
+
function K(e) {
|
|
409
|
+
if (e === "") return e;
|
|
410
|
+
if (/[^0-9a-fA-F[\]:]/g.test(e)) throw new TypeError(`Invalid IPv6 hostname '${e}'`);
|
|
411
|
+
return e.toLowerCase();
|
|
412
|
+
}
|
|
413
|
+
a(K, "ipv6HostnameEncodeCallback");
|
|
414
|
+
function G(e) {
|
|
415
|
+
if (e === "" || /^[0-9]*$/.test(e) && parseInt(e) <= 65535) return e;
|
|
416
|
+
throw new TypeError(`Invalid port '${e}'.`);
|
|
417
|
+
}
|
|
418
|
+
a(G, "portEncodeCallback");
|
|
419
|
+
function de(e) {
|
|
420
|
+
if (e === "") return e;
|
|
421
|
+
let t = new URL("https://example.com");
|
|
422
|
+
return t.pathname = e[0] !== "/" ? "/-" + e : e, e[0] !== "/" ? t.pathname.substring(2, t.pathname.length) : t.pathname;
|
|
423
|
+
}
|
|
424
|
+
a(de, "standardURLPathnameEncodeCallback");
|
|
425
|
+
function pe(e) {
|
|
426
|
+
return e === "" ? e : new URL(`data:${e}`).pathname;
|
|
427
|
+
}
|
|
428
|
+
a(pe, "pathURLPathnameEncodeCallback");
|
|
429
|
+
function ge(e) {
|
|
430
|
+
if (e === "") return e;
|
|
431
|
+
let t = new URL("https://example.com");
|
|
432
|
+
return t.search = e, t.search.substring(1, t.search.length);
|
|
433
|
+
}
|
|
434
|
+
a(ge, "searchEncodeCallback");
|
|
435
|
+
function me(e) {
|
|
436
|
+
if (e === "") return e;
|
|
437
|
+
let t = new URL("https://example.com");
|
|
438
|
+
return t.hash = e, t.hash.substring(1, t.hash.length);
|
|
439
|
+
}
|
|
440
|
+
a(me, "hashEncodeCallback");
|
|
441
|
+
var C = class {
|
|
442
|
+
#i;
|
|
443
|
+
#n = [];
|
|
444
|
+
#t = {};
|
|
445
|
+
#e = 0;
|
|
446
|
+
#s = 1;
|
|
447
|
+
#l = 0;
|
|
448
|
+
#o = 0;
|
|
449
|
+
#d = 0;
|
|
450
|
+
#p = 0;
|
|
451
|
+
#g = !1;
|
|
452
|
+
constructor(t) {
|
|
453
|
+
this.#i = t;
|
|
454
|
+
}
|
|
455
|
+
get result() {
|
|
456
|
+
return this.#t;
|
|
457
|
+
}
|
|
458
|
+
parse() {
|
|
459
|
+
for (this.#n = D(this.#i, !0); this.#e < this.#n.length; this.#e += this.#s) {
|
|
460
|
+
if (this.#s = 1, this.#n[this.#e].type === "END") {
|
|
461
|
+
if (this.#o === 0) {
|
|
462
|
+
this.#b(), this.#f() ? this.#r(9, 1) : this.#h() ? this.#r(8, 1) : this.#r(7, 0);
|
|
463
|
+
continue;
|
|
464
|
+
} else if (this.#o === 2) {
|
|
465
|
+
this.#u(5);
|
|
466
|
+
continue;
|
|
467
|
+
}
|
|
468
|
+
this.#r(10, 0);
|
|
469
|
+
break;
|
|
470
|
+
}
|
|
471
|
+
if (this.#d > 0) if (this.#A()) this.#d -= 1;
|
|
472
|
+
else continue;
|
|
473
|
+
if (this.#T()) {
|
|
474
|
+
this.#d += 1;
|
|
475
|
+
continue;
|
|
476
|
+
}
|
|
477
|
+
switch (this.#o) {
|
|
478
|
+
case 0:
|
|
479
|
+
this.#P() && this.#u(1);
|
|
480
|
+
break;
|
|
481
|
+
case 1:
|
|
482
|
+
if (this.#P()) {
|
|
483
|
+
this.#C();
|
|
484
|
+
let t = 7, r = 1;
|
|
485
|
+
this.#E() ? (t = 2, r = 3) : this.#g && (t = 2), this.#r(t, r);
|
|
486
|
+
}
|
|
487
|
+
break;
|
|
488
|
+
case 2:
|
|
489
|
+
this.#S() ? this.#u(3) : (this.#x() || this.#h() || this.#f()) && this.#u(5);
|
|
490
|
+
break;
|
|
491
|
+
case 3:
|
|
492
|
+
this.#O() ? this.#r(4, 1) : this.#S() && this.#r(5, 1);
|
|
493
|
+
break;
|
|
494
|
+
case 4:
|
|
495
|
+
this.#S() && this.#r(5, 1);
|
|
496
|
+
break;
|
|
497
|
+
case 5:
|
|
498
|
+
this.#y() ? this.#p += 1 : this.#w() && (this.#p -= 1), this.#k() && !this.#p ? this.#r(6, 1) : this.#x() ? this.#r(7, 0) : this.#h() ? this.#r(8, 1) : this.#f() && this.#r(9, 1);
|
|
499
|
+
break;
|
|
500
|
+
case 6:
|
|
501
|
+
this.#x() ? this.#r(7, 0) : this.#h() ? this.#r(8, 1) : this.#f() && this.#r(9, 1);
|
|
502
|
+
break;
|
|
503
|
+
case 7:
|
|
504
|
+
this.#h() ? this.#r(8, 1) : this.#f() && this.#r(9, 1);
|
|
505
|
+
break;
|
|
506
|
+
case 8:
|
|
507
|
+
this.#f() && this.#r(9, 1);
|
|
508
|
+
break;
|
|
509
|
+
case 9: break;
|
|
510
|
+
case 10: break;
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
this.#t.hostname !== void 0 && this.#t.port === void 0 && (this.#t.port = "");
|
|
514
|
+
}
|
|
515
|
+
#r(t, r) {
|
|
516
|
+
switch (this.#o) {
|
|
517
|
+
case 0: break;
|
|
518
|
+
case 1:
|
|
519
|
+
this.#t.protocol = this.#c();
|
|
520
|
+
break;
|
|
521
|
+
case 2: break;
|
|
522
|
+
case 3:
|
|
523
|
+
this.#t.username = this.#c();
|
|
524
|
+
break;
|
|
525
|
+
case 4:
|
|
526
|
+
this.#t.password = this.#c();
|
|
527
|
+
break;
|
|
528
|
+
case 5:
|
|
529
|
+
this.#t.hostname = this.#c();
|
|
530
|
+
break;
|
|
531
|
+
case 6:
|
|
532
|
+
this.#t.port = this.#c();
|
|
533
|
+
break;
|
|
534
|
+
case 7:
|
|
535
|
+
this.#t.pathname = this.#c();
|
|
536
|
+
break;
|
|
537
|
+
case 8:
|
|
538
|
+
this.#t.search = this.#c();
|
|
539
|
+
break;
|
|
540
|
+
case 9:
|
|
541
|
+
this.#t.hash = this.#c();
|
|
542
|
+
break;
|
|
543
|
+
case 10: break;
|
|
544
|
+
}
|
|
545
|
+
this.#o !== 0 && t !== 10 && ([
|
|
546
|
+
1,
|
|
547
|
+
2,
|
|
548
|
+
3,
|
|
549
|
+
4
|
|
550
|
+
].includes(this.#o) && [
|
|
551
|
+
6,
|
|
552
|
+
7,
|
|
553
|
+
8,
|
|
554
|
+
9
|
|
555
|
+
].includes(t) && (this.#t.hostname ??= ""), [
|
|
556
|
+
1,
|
|
557
|
+
2,
|
|
558
|
+
3,
|
|
559
|
+
4,
|
|
560
|
+
5,
|
|
561
|
+
6
|
|
562
|
+
].includes(this.#o) && [8, 9].includes(t) && (this.#t.pathname ??= this.#g ? "/" : ""), [
|
|
563
|
+
1,
|
|
564
|
+
2,
|
|
565
|
+
3,
|
|
566
|
+
4,
|
|
567
|
+
5,
|
|
568
|
+
6,
|
|
569
|
+
7
|
|
570
|
+
].includes(this.#o) && t === 9 && (this.#t.search ??= "")), this.#R(t, r);
|
|
571
|
+
}
|
|
572
|
+
#R(t, r) {
|
|
573
|
+
this.#o = t, this.#l = this.#e + r, this.#e += r, this.#s = 0;
|
|
574
|
+
}
|
|
575
|
+
#b() {
|
|
576
|
+
this.#e = this.#l, this.#s = 0;
|
|
577
|
+
}
|
|
578
|
+
#u(t) {
|
|
579
|
+
this.#b(), this.#o = t;
|
|
580
|
+
}
|
|
581
|
+
#m(t) {
|
|
582
|
+
return t < 0 && (t = this.#n.length - t), t < this.#n.length ? this.#n[t] : this.#n[this.#n.length - 1];
|
|
583
|
+
}
|
|
584
|
+
#a(t, r) {
|
|
585
|
+
let n = this.#m(t);
|
|
586
|
+
return n.value === r && (n.type === "CHAR" || n.type === "ESCAPED_CHAR" || n.type === "INVALID_CHAR");
|
|
587
|
+
}
|
|
588
|
+
#P() {
|
|
589
|
+
return this.#a(this.#e, ":");
|
|
590
|
+
}
|
|
591
|
+
#E() {
|
|
592
|
+
return this.#a(this.#e + 1, "/") && this.#a(this.#e + 2, "/");
|
|
593
|
+
}
|
|
594
|
+
#S() {
|
|
595
|
+
return this.#a(this.#e, "@");
|
|
596
|
+
}
|
|
597
|
+
#O() {
|
|
598
|
+
return this.#a(this.#e, ":");
|
|
599
|
+
}
|
|
600
|
+
#k() {
|
|
601
|
+
return this.#a(this.#e, ":");
|
|
602
|
+
}
|
|
603
|
+
#x() {
|
|
604
|
+
return this.#a(this.#e, "/");
|
|
605
|
+
}
|
|
606
|
+
#h() {
|
|
607
|
+
if (this.#a(this.#e, "?")) return !0;
|
|
608
|
+
if (this.#n[this.#e].value !== "?") return !1;
|
|
609
|
+
let t = this.#m(this.#e - 1);
|
|
610
|
+
return t.type !== "NAME" && t.type !== "REGEX" && t.type !== "CLOSE" && t.type !== "ASTERISK";
|
|
611
|
+
}
|
|
612
|
+
#f() {
|
|
613
|
+
return this.#a(this.#e, "#");
|
|
614
|
+
}
|
|
615
|
+
#T() {
|
|
616
|
+
return this.#n[this.#e].type == "OPEN";
|
|
617
|
+
}
|
|
618
|
+
#A() {
|
|
619
|
+
return this.#n[this.#e].type == "CLOSE";
|
|
620
|
+
}
|
|
621
|
+
#y() {
|
|
622
|
+
return this.#a(this.#e, "[");
|
|
623
|
+
}
|
|
624
|
+
#w() {
|
|
625
|
+
return this.#a(this.#e, "]");
|
|
626
|
+
}
|
|
627
|
+
#c() {
|
|
628
|
+
let t = this.#n[this.#e], r = this.#m(this.#l).index;
|
|
629
|
+
return this.#i.substring(r, t.index);
|
|
630
|
+
}
|
|
631
|
+
#C() {
|
|
632
|
+
let t = {};
|
|
633
|
+
Object.assign(t, b), t.encodePart = w;
|
|
634
|
+
this.#g = U(q(this.#c(), void 0, t));
|
|
635
|
+
}
|
|
636
|
+
};
|
|
637
|
+
a(C, "Parser");
|
|
638
|
+
var V = [
|
|
639
|
+
"protocol",
|
|
640
|
+
"username",
|
|
641
|
+
"password",
|
|
642
|
+
"hostname",
|
|
643
|
+
"port",
|
|
644
|
+
"pathname",
|
|
645
|
+
"search",
|
|
646
|
+
"hash"
|
|
647
|
+
], O = "*";
|
|
648
|
+
function Se(e, t) {
|
|
649
|
+
if (typeof e != "string") throw new TypeError("parameter 1 is not of type 'string'.");
|
|
650
|
+
let r = new URL(e, t);
|
|
651
|
+
return {
|
|
652
|
+
protocol: r.protocol.substring(0, r.protocol.length - 1),
|
|
653
|
+
username: r.username,
|
|
654
|
+
password: r.password,
|
|
655
|
+
hostname: r.hostname,
|
|
656
|
+
port: r.port,
|
|
657
|
+
pathname: r.pathname,
|
|
658
|
+
search: r.search !== "" ? r.search.substring(1, r.search.length) : void 0,
|
|
659
|
+
hash: r.hash !== "" ? r.hash.substring(1, r.hash.length) : void 0
|
|
660
|
+
};
|
|
661
|
+
}
|
|
662
|
+
a(Se, "extractValues");
|
|
663
|
+
function R(e, t) {
|
|
664
|
+
return t ? I(e) : e;
|
|
665
|
+
}
|
|
666
|
+
a(R, "processBaseURLString");
|
|
667
|
+
function L(e, t, r) {
|
|
668
|
+
let n;
|
|
669
|
+
if (typeof t.baseURL == "string") try {
|
|
670
|
+
n = new URL(t.baseURL), t.protocol === void 0 && (e.protocol = R(n.protocol.substring(0, n.protocol.length - 1), r)), !r && t.protocol === void 0 && t.hostname === void 0 && t.port === void 0 && t.username === void 0 && (e.username = R(n.username, r)), !r && t.protocol === void 0 && t.hostname === void 0 && t.port === void 0 && t.username === void 0 && t.password === void 0 && (e.password = R(n.password, r)), t.protocol === void 0 && t.hostname === void 0 && (e.hostname = R(n.hostname, r)), t.protocol === void 0 && t.hostname === void 0 && t.port === void 0 && (e.port = R(n.port, r)), t.protocol === void 0 && t.hostname === void 0 && t.port === void 0 && t.pathname === void 0 && (e.pathname = R(n.pathname, r)), t.protocol === void 0 && t.hostname === void 0 && t.port === void 0 && t.pathname === void 0 && t.search === void 0 && (e.search = R(n.search.substring(1, n.search.length), r)), t.protocol === void 0 && t.hostname === void 0 && t.port === void 0 && t.pathname === void 0 && t.search === void 0 && t.hash === void 0 && (e.hash = R(n.hash.substring(1, n.hash.length), r));
|
|
671
|
+
} catch {
|
|
672
|
+
throw new TypeError(`invalid baseURL '${t.baseURL}'.`);
|
|
673
|
+
}
|
|
674
|
+
if (typeof t.protocol == "string" && (e.protocol = fe(t.protocol, r)), typeof t.username == "string" && (e.username = oe(t.username, r)), typeof t.password == "string" && (e.password = ae(t.password, r)), typeof t.hostname == "string" && (e.hostname = ie(t.hostname, r)), typeof t.port == "string" && (e.port = le(t.port, e.protocol, r)), typeof t.pathname == "string") {
|
|
675
|
+
if (e.pathname = t.pathname, n && !ee(e.pathname, r)) {
|
|
676
|
+
let c = n.pathname.lastIndexOf("/");
|
|
677
|
+
c >= 0 && (e.pathname = R(n.pathname.substring(0, c + 1), r) + e.pathname);
|
|
678
|
+
}
|
|
679
|
+
e.pathname = ce(e.pathname, e.protocol, r);
|
|
680
|
+
}
|
|
681
|
+
return typeof t.search == "string" && (e.search = se(t.search, r)), typeof t.hash == "string" && (e.hash = ne(t.hash, r)), e;
|
|
682
|
+
}
|
|
683
|
+
a(L, "applyInit");
|
|
684
|
+
function I(e) {
|
|
685
|
+
return e.replace(/([+*?:{}()\\])/g, "\\$1");
|
|
686
|
+
}
|
|
687
|
+
a(I, "escapePatternString");
|
|
688
|
+
function Te(e) {
|
|
689
|
+
return e.replace(/([.+*?^${}()[\]|/\\])/g, "\\$1");
|
|
690
|
+
}
|
|
691
|
+
a(Te, "escapeRegexpString");
|
|
692
|
+
function Ae(e, t) {
|
|
693
|
+
t.delimiter ??= "/#?", t.prefixes ??= "./", t.sensitive ??= !1, t.strict ??= !1, t.end ??= !0, t.start ??= !0, t.endsWith = "";
|
|
694
|
+
let r = ".*", n = `[^${Te(t.delimiter)}]+?`, c = /[$_\u200C\u200D\p{ID_Continue}]/u, l = "";
|
|
695
|
+
for (let f = 0; f < e.length; ++f) {
|
|
696
|
+
let s = e[f];
|
|
697
|
+
if (s.type === 3) {
|
|
698
|
+
if (s.modifier === 3) {
|
|
699
|
+
l += I(s.value);
|
|
700
|
+
continue;
|
|
701
|
+
}
|
|
702
|
+
l += `{${I(s.value)}}${T(s.modifier)}`;
|
|
703
|
+
continue;
|
|
704
|
+
}
|
|
705
|
+
let i = s.hasCustomName(), o = !!s.suffix.length || !!s.prefix.length && (s.prefix.length !== 1 || !t.prefixes.includes(s.prefix)), h = f > 0 ? e[f - 1] : null, p = f < e.length - 1 ? e[f + 1] : null;
|
|
706
|
+
if (!o && i && s.type === 1 && s.modifier === 3 && p && !p.prefix.length && !p.suffix.length) if (p.type === 3) {
|
|
707
|
+
let A = p.value.length > 0 ? p.value[0] : "";
|
|
708
|
+
o = c.test(A);
|
|
709
|
+
} else o = !p.hasCustomName();
|
|
710
|
+
if (!o && !s.prefix.length && h && h.type === 3) {
|
|
711
|
+
let A = h.value[h.value.length - 1];
|
|
712
|
+
o = t.prefixes.includes(A);
|
|
713
|
+
}
|
|
714
|
+
o && (l += "{"), l += I(s.prefix), i && (l += `:${s.name}`), s.type === 2 ? l += `(${s.value})` : s.type === 1 ? i || (l += `(${n})`) : s.type === 0 && (!i && (!h || h.type === 3 || h.modifier !== 3 || o || s.prefix !== "") ? l += "*" : l += `(${r})`), s.type === 1 && i && s.suffix.length && c.test(s.suffix[0]) && (l += "\\"), l += I(s.suffix), o && (l += "}"), s.modifier !== 3 && (l += T(s.modifier));
|
|
715
|
+
}
|
|
716
|
+
return l;
|
|
717
|
+
}
|
|
718
|
+
a(Ae, "partsToPattern");
|
|
719
|
+
var Y = class {
|
|
720
|
+
#i;
|
|
721
|
+
#n = {};
|
|
722
|
+
#t = {};
|
|
723
|
+
#e = {};
|
|
724
|
+
#s = {};
|
|
725
|
+
#l = !1;
|
|
726
|
+
constructor(t = {}, r, n) {
|
|
727
|
+
try {
|
|
728
|
+
let c;
|
|
729
|
+
if (typeof r == "string" ? c = r : n = r, typeof t == "string") {
|
|
730
|
+
let i = new C(t);
|
|
731
|
+
if (i.parse(), t = i.result, c === void 0 && typeof t.protocol != "string") throw new TypeError("A base URL must be provided for a relative constructor string.");
|
|
732
|
+
t.baseURL = c;
|
|
733
|
+
} else {
|
|
734
|
+
if (!t || typeof t != "object") throw new TypeError("parameter 1 is not of type 'string' and cannot convert to dictionary.");
|
|
735
|
+
if (c) throw new TypeError("parameter 1 is not of type 'string'.");
|
|
736
|
+
}
|
|
737
|
+
typeof n > "u" && (n = { ignoreCase: !1 });
|
|
738
|
+
let l = { ignoreCase: n.ignoreCase === !0 };
|
|
739
|
+
this.#i = L({
|
|
740
|
+
pathname: O,
|
|
741
|
+
protocol: O,
|
|
742
|
+
username: O,
|
|
743
|
+
password: O,
|
|
744
|
+
hostname: O,
|
|
745
|
+
port: O,
|
|
746
|
+
search: O,
|
|
747
|
+
hash: O
|
|
748
|
+
}, t, !0), z(this.#i.protocol) === this.#i.port && (this.#i.port = "");
|
|
749
|
+
let s;
|
|
750
|
+
for (s of V) {
|
|
751
|
+
if (!(s in this.#i)) continue;
|
|
752
|
+
let i = {}, o = this.#i[s];
|
|
753
|
+
switch (this.#t[s] = [], s) {
|
|
754
|
+
case "protocol":
|
|
755
|
+
Object.assign(i, b), i.encodePart = w;
|
|
756
|
+
break;
|
|
757
|
+
case "username":
|
|
758
|
+
Object.assign(i, b), i.encodePart = he;
|
|
759
|
+
break;
|
|
760
|
+
case "password":
|
|
761
|
+
Object.assign(i, b), i.encodePart = ue;
|
|
762
|
+
break;
|
|
763
|
+
case "hostname":
|
|
764
|
+
Object.assign(i, J), _(o) ? i.encodePart = K : i.encodePart = j;
|
|
765
|
+
break;
|
|
766
|
+
case "port":
|
|
767
|
+
Object.assign(i, b), i.encodePart = G;
|
|
768
|
+
break;
|
|
769
|
+
case "pathname":
|
|
770
|
+
U(this.#n.protocol) ? (Object.assign(i, Q, l), i.encodePart = de) : (Object.assign(i, b, l), i.encodePart = pe);
|
|
771
|
+
break;
|
|
772
|
+
case "search":
|
|
773
|
+
Object.assign(i, b, l), i.encodePart = ge;
|
|
774
|
+
break;
|
|
775
|
+
case "hash":
|
|
776
|
+
Object.assign(i, b, l), i.encodePart = me;
|
|
777
|
+
break;
|
|
778
|
+
}
|
|
779
|
+
try {
|
|
780
|
+
this.#s[s] = F(o, i), this.#n[s] = W(this.#s[s], this.#t[s], i), this.#e[s] = Ae(this.#s[s], i), this.#l = this.#l || this.#s[s].some((h) => h.type === 2);
|
|
781
|
+
} catch {
|
|
782
|
+
throw new TypeError(`invalid ${s} pattern '${this.#i[s]}'.`);
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
} catch (c) {
|
|
786
|
+
throw new TypeError(`Failed to construct 'URLPattern': ${c.message}`);
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
get [Symbol.toStringTag]() {
|
|
790
|
+
return "URLPattern";
|
|
791
|
+
}
|
|
792
|
+
test(t = {}, r) {
|
|
793
|
+
let n = {
|
|
794
|
+
pathname: "",
|
|
795
|
+
protocol: "",
|
|
796
|
+
username: "",
|
|
797
|
+
password: "",
|
|
798
|
+
hostname: "",
|
|
799
|
+
port: "",
|
|
800
|
+
search: "",
|
|
801
|
+
hash: ""
|
|
802
|
+
};
|
|
803
|
+
if (typeof t != "string" && r) throw new TypeError("parameter 1 is not of type 'string'.");
|
|
804
|
+
if (typeof t > "u") return !1;
|
|
805
|
+
try {
|
|
806
|
+
typeof t == "object" ? n = L(n, t, !1) : n = L(n, Se(t, r), !1);
|
|
807
|
+
} catch {
|
|
808
|
+
return !1;
|
|
809
|
+
}
|
|
810
|
+
let c;
|
|
811
|
+
for (c of V) if (!this.#n[c].exec(n[c])) return !1;
|
|
812
|
+
return !0;
|
|
813
|
+
}
|
|
814
|
+
exec(t = {}, r) {
|
|
815
|
+
let n = {
|
|
816
|
+
pathname: "",
|
|
817
|
+
protocol: "",
|
|
818
|
+
username: "",
|
|
819
|
+
password: "",
|
|
820
|
+
hostname: "",
|
|
821
|
+
port: "",
|
|
822
|
+
search: "",
|
|
823
|
+
hash: ""
|
|
824
|
+
};
|
|
825
|
+
if (typeof t != "string" && r) throw new TypeError("parameter 1 is not of type 'string'.");
|
|
826
|
+
if (typeof t > "u") return;
|
|
827
|
+
try {
|
|
828
|
+
typeof t == "object" ? n = L(n, t, !1) : n = L(n, Se(t, r), !1);
|
|
829
|
+
} catch {
|
|
830
|
+
return null;
|
|
831
|
+
}
|
|
832
|
+
let c = {};
|
|
833
|
+
r ? c.inputs = [t, r] : c.inputs = [t];
|
|
834
|
+
let l;
|
|
835
|
+
for (l of V) {
|
|
836
|
+
let f = this.#n[l].exec(n[l]);
|
|
837
|
+
if (!f) return null;
|
|
838
|
+
let s = {};
|
|
839
|
+
for (let [i, o] of this.#t[l].entries()) if (typeof o == "string" || typeof o == "number") s[o] = f[i + 1];
|
|
840
|
+
c[l] = {
|
|
841
|
+
input: n[l] ?? "",
|
|
842
|
+
groups: s
|
|
843
|
+
};
|
|
844
|
+
}
|
|
845
|
+
return c;
|
|
846
|
+
}
|
|
847
|
+
static compareComponent(t, r, n) {
|
|
848
|
+
let c = a((i, o) => {
|
|
849
|
+
for (let h of [
|
|
850
|
+
"type",
|
|
851
|
+
"modifier",
|
|
852
|
+
"prefix",
|
|
853
|
+
"value",
|
|
854
|
+
"suffix"
|
|
855
|
+
]) {
|
|
856
|
+
if (i[h] < o[h]) return -1;
|
|
857
|
+
if (i[h] === o[h]) continue;
|
|
858
|
+
return 1;
|
|
859
|
+
}
|
|
860
|
+
return 0;
|
|
861
|
+
}, "comparePart"), l = new P(3, "", "", "", "", 3), f = new P(0, "", "", "", "", 3), s = a((i, o) => {
|
|
862
|
+
let h = 0;
|
|
863
|
+
for (; h < Math.min(i.length, o.length); ++h) {
|
|
864
|
+
let p = c(i[h], o[h]);
|
|
865
|
+
if (p) return p;
|
|
866
|
+
}
|
|
867
|
+
return i.length === o.length ? 0 : c(i[h] ?? l, o[h] ?? l);
|
|
868
|
+
}, "comparePartList");
|
|
869
|
+
return !r.#e[t] && !n.#e[t] ? 0 : r.#e[t] && !n.#e[t] ? s(r.#s[t], [f]) : !r.#e[t] && n.#e[t] ? s([f], n.#s[t]) : s(r.#s[t], n.#s[t]);
|
|
870
|
+
}
|
|
871
|
+
get protocol() {
|
|
872
|
+
return this.#e.protocol;
|
|
873
|
+
}
|
|
874
|
+
get username() {
|
|
875
|
+
return this.#e.username;
|
|
876
|
+
}
|
|
877
|
+
get password() {
|
|
878
|
+
return this.#e.password;
|
|
879
|
+
}
|
|
880
|
+
get hostname() {
|
|
881
|
+
return this.#e.hostname;
|
|
882
|
+
}
|
|
883
|
+
get port() {
|
|
884
|
+
return this.#e.port;
|
|
885
|
+
}
|
|
886
|
+
get pathname() {
|
|
887
|
+
return this.#e.pathname;
|
|
888
|
+
}
|
|
889
|
+
get search() {
|
|
890
|
+
return this.#e.search;
|
|
891
|
+
}
|
|
892
|
+
get hash() {
|
|
893
|
+
return this.#e.hash;
|
|
894
|
+
}
|
|
895
|
+
get hasRegExpGroups() {
|
|
896
|
+
return this.#l;
|
|
897
|
+
}
|
|
898
|
+
};
|
|
899
|
+
a(Y, "URLPattern");
|
|
900
|
+
|
|
901
|
+
//#endregion
|
|
902
|
+
exports.Y = Y;
|