@incajs/cli 0.0.0 → 0.0.2
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/LICENSE +5 -0
- package/README.md +66 -2
- package/bin/inca.mjs +7 -0
- package/dist/adapter/types.d.mts +47 -0
- package/dist/adapter/vite/build.d.mts +8 -0
- package/dist/adapter/vite/captureOutput.d.mts +15 -0
- package/dist/adapter/vite/config.d.mts +26 -0
- package/dist/adapter/vite/index.d.mts +2 -0
- package/dist/adapter/vite/watch.d.mts +8 -0
- package/dist/build.d.mts +21 -0
- package/dist/chunks/__vite-optional-peer-dep_dotenv_c12-CxKvRg9-.js +3 -0
- package/dist/chunks/__vite-optional-peer-dep_giget_c12-BYcrHYBM.js +5 -0
- package/dist/chunks/__vite-optional-peer-dep_jiti_c12-DZVJNj6v.js +5 -0
- package/dist/chunks/_format-BKs7bsc4.js +98 -0
- package/dist/chunks/defaults-EWjAFeZ3.js +1184 -0
- package/dist/chunks/dist-BVKUE9C4.js +114 -0
- package/dist/chunks/json5-feUuPtTt.js +756 -0
- package/dist/chunks/jsonc-BdzClvC8.js +46 -0
- package/dist/chunks/ohash-CHaRSTtv.js +231 -0
- package/dist/chunks/toml-BERh2MAo.js +417 -0
- package/dist/chunks/yaml-N2dF3WHm.js +2123 -0
- package/dist/cli.d.mts +2 -0
- package/dist/cli.js +503 -0
- package/dist/config/defaults.d.mts +44 -0
- package/dist/config/index.d.mts +18 -0
- package/dist/config/loader.d.mts +37 -0
- package/dist/config/types.d.mts +35 -0
- package/dist/config.js +5 -0
- package/dist/defaultBundler.d.mts +7 -0
- package/dist/dev-client/hostBin.d.mts +9 -0
- package/dist/dev-client/hostClient.d.mts +50 -0
- package/dist/dev-client/hostError.d.mts +6 -0
- package/dist/dev-client/index.d.mts +4 -0
- package/dist/dev-client/protocol.d.mts +38 -0
- package/dist/dev.d.mts +25 -0
- package/dist/entry.d.mts +8 -0
- package/dist/fault.d.mts +6 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.js +0 -0
- package/dist/package.d.mts +45 -0
- package/dist/plist.d.mts +4 -0
- package/package.json +64 -3
|
@@ -0,0 +1,1184 @@
|
|
|
1
|
+
import e, { existsSync as t, lstatSync as n, readFileSync as r, realpathSync as i, statSync as a } from "node:fs";
|
|
2
|
+
import { readFile as o, rm as s } from "node:fs/promises";
|
|
3
|
+
import c, { isAbsolute as l, resolve as u } from "node:path";
|
|
4
|
+
import * as d from "node:util";
|
|
5
|
+
import { format as f, inspect as p } from "node:util";
|
|
6
|
+
import { URL as m, fileURLToPath as h, pathToFileURL as g } from "node:url";
|
|
7
|
+
import { homedir as _ } from "node:os";
|
|
8
|
+
import v from "node:assert";
|
|
9
|
+
import y from "node:process";
|
|
10
|
+
//#region ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
|
|
11
|
+
var ee = /^[A-Za-z]:\//;
|
|
12
|
+
function b(e = "") {
|
|
13
|
+
return e && e.replace(/\\/g, "/").replace(ee, (e) => e.toUpperCase());
|
|
14
|
+
}
|
|
15
|
+
var te = /^[/\\]{2}/, ne = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, re = /^[A-Za-z]:$/, ie = /.(\.[^./]+|\.)$/, x = function(e) {
|
|
16
|
+
if (e.length === 0) return ".";
|
|
17
|
+
e = b(e);
|
|
18
|
+
let t = e.match(te), n = w(e), r = e[e.length - 1] === "/";
|
|
19
|
+
return e = oe(e, !n), e.length === 0 ? n ? "/" : r ? "./" : "." : (r && (e += "/"), re.test(e) && (e += "/"), t ? n ? `//${e}` : `//./${e}` : n && !w(e) ? `/${e}` : e);
|
|
20
|
+
}, S = function(...e) {
|
|
21
|
+
let t = "";
|
|
22
|
+
for (let n of e) if (n) {
|
|
23
|
+
if (t.length > 0) {
|
|
24
|
+
let e = t[t.length - 1] === "/", r = n[0] === "/";
|
|
25
|
+
t += e && r ? n.slice(1) : e || r ? n : `/${n}`;
|
|
26
|
+
} else t += n;
|
|
27
|
+
}
|
|
28
|
+
return x(t);
|
|
29
|
+
};
|
|
30
|
+
function ae() {
|
|
31
|
+
return typeof process < "u" && typeof process.cwd == "function" ? process.cwd().replace(/\\/g, "/") : "/";
|
|
32
|
+
}
|
|
33
|
+
var C = function(...e) {
|
|
34
|
+
e = e.map((e) => b(e));
|
|
35
|
+
let t = "", n = !1;
|
|
36
|
+
for (let r = e.length - 1; r >= -1 && !n; r--) {
|
|
37
|
+
let i = r >= 0 ? e[r] : ae();
|
|
38
|
+
i && i.length !== 0 && (t = `${i}/${t}`, n = w(i));
|
|
39
|
+
}
|
|
40
|
+
return t = oe(t, !n), n && !w(t) ? `/${t}` : t.length > 0 ? t : ".";
|
|
41
|
+
};
|
|
42
|
+
function oe(e, t) {
|
|
43
|
+
let n = "", r = 0, i = -1, a = 0, o = null;
|
|
44
|
+
for (let s = 0; s <= e.length; ++s) {
|
|
45
|
+
if (s < e.length) o = e[s];
|
|
46
|
+
else if (o === "/") break;
|
|
47
|
+
else o = "/";
|
|
48
|
+
if (o === "/") {
|
|
49
|
+
if (i !== s - 1 && a !== 1) {
|
|
50
|
+
if (a === 2) {
|
|
51
|
+
if (n.length < 2 || r !== 2 || n[n.length - 1] !== "." || n[n.length - 2] !== ".") {
|
|
52
|
+
if (n.length > 2) {
|
|
53
|
+
let e = n.lastIndexOf("/");
|
|
54
|
+
e === -1 ? (n = "", r = 0) : (n = n.slice(0, e), r = n.length - 1 - n.lastIndexOf("/")), i = s, a = 0;
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
if (n.length > 0) {
|
|
58
|
+
n = "", r = 0, i = s, a = 0;
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
t && (n += n.length > 0 ? "/.." : "..", r = 2);
|
|
63
|
+
} else n.length > 0 ? n += `/${e.slice(i + 1, s)}` : n = e.slice(i + 1, s), r = s - i - 1;
|
|
64
|
+
}
|
|
65
|
+
i = s, a = 0;
|
|
66
|
+
} else o === "." && a !== -1 ? ++a : a = -1;
|
|
67
|
+
}
|
|
68
|
+
return n;
|
|
69
|
+
}
|
|
70
|
+
var w = function(e) {
|
|
71
|
+
return ne.test(e);
|
|
72
|
+
}, se = function(e) {
|
|
73
|
+
if (e === "..") return "";
|
|
74
|
+
let t = ie.exec(b(e));
|
|
75
|
+
return t && t[1] || "";
|
|
76
|
+
}, T = function(e) {
|
|
77
|
+
let t = b(e).replace(/\/$/, "").split("/").slice(0, -1);
|
|
78
|
+
return t.length === 1 && re.test(t[0]) && (t[0] += "/"), t.join("/") || (w(e) ? "/" : ".");
|
|
79
|
+
}, E = function(e, t) {
|
|
80
|
+
let n = b(e).split("/"), r = "";
|
|
81
|
+
for (let e = n.length - 1; e >= 0; e--) {
|
|
82
|
+
let t = n[e];
|
|
83
|
+
if (t) {
|
|
84
|
+
r = t;
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return t && r.endsWith(t) ? r.slice(0, -t.length) : r;
|
|
89
|
+
}, D = /* @__PURE__ */ "_http_agent._http_client._http_common._http_incoming._http_outgoing._http_server._stream_duplex._stream_passthrough._stream_readable._stream_transform._stream_wrap._stream_writable._tls_common._tls_wrap.assert.assert/strict.async_hooks.buffer.child_process.cluster.console.constants.crypto.dgram.diagnostics_channel.dns.dns/promises.domain.events.fs.fs/promises.http.http2.https.inspector.inspector/promises.module.net.os.path.path/posix.path/win32.perf_hooks.process.punycode.querystring.readline.readline/promises.repl.stream.stream/consumers.stream/promises.stream/web.string_decoder.sys.timers.timers/promises.tls.trace_events.tty.url.util.util/types.v8.vm.wasi.worker_threads.zlib".split("."), ce = /^([A-Z][a-z\d]*)+$/, le = /* @__PURE__ */ new Set([
|
|
90
|
+
"string",
|
|
91
|
+
"function",
|
|
92
|
+
"number",
|
|
93
|
+
"object",
|
|
94
|
+
"Function",
|
|
95
|
+
"Object",
|
|
96
|
+
"boolean",
|
|
97
|
+
"bigint",
|
|
98
|
+
"symbol"
|
|
99
|
+
]), O = /* @__PURE__ */ new Map();
|
|
100
|
+
function k(e, t = "and") {
|
|
101
|
+
switch (e.length) {
|
|
102
|
+
case 0: return "";
|
|
103
|
+
case 1: return `${e[0]}`;
|
|
104
|
+
case 2: return `${e[0]} ${t} ${e[1]}`;
|
|
105
|
+
case 3: return `${e[0]}, ${e[1]}, ${t} ${e[2]}`;
|
|
106
|
+
default: return `${e.slice(0, -1).join(", ")}, ${t} ${e.at(-1)}`;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function ue(e) {
|
|
110
|
+
let t = 0, n = /%[dfijoOs]/g;
|
|
111
|
+
for (; n.exec(e) !== null;) t++;
|
|
112
|
+
return t;
|
|
113
|
+
}
|
|
114
|
+
function A(e, t, n) {
|
|
115
|
+
return O.set(e, t), de(n, e);
|
|
116
|
+
}
|
|
117
|
+
var j = Symbol("kIsNodeError");
|
|
118
|
+
function de(e, t) {
|
|
119
|
+
let n = O.get(t), r = typeof n == "string" ? ue(n) : -1;
|
|
120
|
+
switch (r) {
|
|
121
|
+
case 0: {
|
|
122
|
+
class i extends e {
|
|
123
|
+
code = t;
|
|
124
|
+
constructor(...e) {
|
|
125
|
+
v.ok(e.length === 0, `Code: ${t}; The provided arguments length (${e.length}) does not match the required ones (${r}).`), super(n);
|
|
126
|
+
}
|
|
127
|
+
get ["constructor"]() {
|
|
128
|
+
return e;
|
|
129
|
+
}
|
|
130
|
+
get [j]() {
|
|
131
|
+
return !0;
|
|
132
|
+
}
|
|
133
|
+
toString() {
|
|
134
|
+
return `${this.name} [${t}]: ${this.message}`;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return i;
|
|
138
|
+
}
|
|
139
|
+
case -1: {
|
|
140
|
+
class n extends e {
|
|
141
|
+
code = t;
|
|
142
|
+
constructor(...e) {
|
|
143
|
+
super(), Object.defineProperty(this, "message", {
|
|
144
|
+
value: fe(t, e, this),
|
|
145
|
+
enumerable: !1,
|
|
146
|
+
writable: !0,
|
|
147
|
+
configurable: !0
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
get ["constructor"]() {
|
|
151
|
+
return e;
|
|
152
|
+
}
|
|
153
|
+
get [j]() {
|
|
154
|
+
return !0;
|
|
155
|
+
}
|
|
156
|
+
toString() {
|
|
157
|
+
return `${this.name} [${t}]: ${this.message}`;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return n;
|
|
161
|
+
}
|
|
162
|
+
default: {
|
|
163
|
+
class i extends e {
|
|
164
|
+
code = t;
|
|
165
|
+
constructor(...e) {
|
|
166
|
+
v.ok(e.length === r, `Code: ${t}; The provided arguments length (${e.length}) does not match the required ones (${r}).`), e.unshift(n), super(Reflect.apply(f, null, e));
|
|
167
|
+
}
|
|
168
|
+
get ["constructor"]() {
|
|
169
|
+
return e;
|
|
170
|
+
}
|
|
171
|
+
get [j]() {
|
|
172
|
+
return !0;
|
|
173
|
+
}
|
|
174
|
+
toString() {
|
|
175
|
+
return `${this.name} [${t}]: ${this.message}`;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return i;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
function fe(e, t, n) {
|
|
183
|
+
let r = O.get(e);
|
|
184
|
+
if (v.ok(r !== void 0, "expected `message` to be found"), typeof r == "function") return v.ok(r.length <= t.length, `Code: ${e}; The provided arguments length (${t.length}) does not match the required ones (${r.length}).`), Reflect.apply(r, n, t);
|
|
185
|
+
let i = ue(r);
|
|
186
|
+
return v.ok(i === t.length, `Code: ${e}; The provided arguments length (${t.length}) does not match the required ones (${i}).`), t.length === 0 ? r : (t.unshift(r), Reflect.apply(f, null, t));
|
|
187
|
+
}
|
|
188
|
+
function pe(e) {
|
|
189
|
+
if (e === null) return "null";
|
|
190
|
+
if (e === void 0) return "undefined";
|
|
191
|
+
let t = typeof e;
|
|
192
|
+
switch (t) {
|
|
193
|
+
case "bigint": return `type bigint (${e}n)`;
|
|
194
|
+
case "number": return e === 0 ? 1 / e == -Infinity ? "type number (-0)" : "type number (0)" : Number.isNaN(e) ? "type number (NaN)" : e === Infinity ? "type number (Infinity)" : e === -Infinity ? "type number (-Infinity)" : `type number (${e})`;
|
|
195
|
+
case "boolean": return e ? "type boolean (true)" : "type boolean (false)";
|
|
196
|
+
case "symbol": return `type symbol (${String(e)})`;
|
|
197
|
+
case "function": return `function ${e.name}`;
|
|
198
|
+
case "object": return e.constructor && e.constructor.name ? `an instance of ${e.constructor.name}` : `${p(e, { depth: -1 })}`;
|
|
199
|
+
case "string": {
|
|
200
|
+
let t = e;
|
|
201
|
+
return t.length > 28 && (t = `${t.slice(0, 25)}...`), t.includes("'") ? `type string (${JSON.stringify(t)})` : `type string ('${t}')`;
|
|
202
|
+
}
|
|
203
|
+
default: {
|
|
204
|
+
let n = p(e, { colors: !1 });
|
|
205
|
+
return n.length > 28 && (n = `${n.slice(0, 25)}...`), `type ${t} (${n})`;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
A("ERR_INVALID_ARG_TYPE", (e, t, n) => {
|
|
210
|
+
v.ok(typeof e == "string", "'name' must be a string"), Array.isArray(t) || (t = [t]);
|
|
211
|
+
let r = "The ";
|
|
212
|
+
if (e.endsWith(" argument")) r += `${e} `;
|
|
213
|
+
else {
|
|
214
|
+
let t = e.includes(".") ? "property" : "argument";
|
|
215
|
+
r += `"${e}" ${t} `;
|
|
216
|
+
}
|
|
217
|
+
r += "must be ";
|
|
218
|
+
let i = [], a = [], o = [];
|
|
219
|
+
for (let e of t) v.ok(typeof e == "string", "All expected entries have to be of type string"), le.has(e) ? i.push(e.toLowerCase()) : ce.exec(e) === null ? (v.ok(e !== "object", "The value \"object\" should be written as \"Object\""), o.push(e)) : a.push(e);
|
|
220
|
+
if (a.length > 0) {
|
|
221
|
+
let e = i.indexOf("object");
|
|
222
|
+
e !== -1 && (i.splice(e, 1), a.push("Object"));
|
|
223
|
+
}
|
|
224
|
+
return i.length > 0 && (r += `${i.length > 1 ? "one of type" : "of type"} ${k(i, "or")}`, (a.length > 0 || o.length > 0) && (r += " or ")), a.length > 0 && (r += `an instance of ${k(a, "or")}`, o.length > 0 && (r += " or ")), o.length > 0 && (o.length > 1 ? r += `one of ${k(o, "or")}` : (o[0]?.toLowerCase() !== o[0] && (r += "an "), r += `${o[0]}`)), r += `. Received ${pe(n)}`, r;
|
|
225
|
+
}, TypeError);
|
|
226
|
+
var M = A("ERR_INVALID_MODULE_SPECIFIER", (e, t, n) => `Invalid module "${e}" ${t}${n ? ` imported from ${n}` : ""}`, TypeError), N = A("ERR_INVALID_PACKAGE_CONFIG", (e, t, n) => `Invalid package config ${e}${t ? ` while importing ${t}` : ""}${n ? `. ${n}` : ""}`, Error), me = A("ERR_INVALID_PACKAGE_TARGET", (e, t, n, r = !1, i) => {
|
|
227
|
+
let a = typeof n == "string" && !r && n.length > 0 && !n.startsWith("./");
|
|
228
|
+
return t === "." ? (v.ok(r === !1), `Invalid "exports" main target ${JSON.stringify(n)} defined in the package config ${e}package.json${i ? ` imported from ${i}` : ""}${a ? "; targets must start with \"./\"" : ""}`) : `Invalid "${r ? "imports" : "exports"}" target ${JSON.stringify(n)} defined for '${t}' in the package config ${e}package.json${i ? ` imported from ${i}` : ""}${a ? "; targets must start with \"./\"" : ""}`;
|
|
229
|
+
}, Error), P = A("ERR_MODULE_NOT_FOUND", function(e, t, n = !1) {
|
|
230
|
+
return n && typeof n == "string" && (this.url = `${n}`), `Cannot find ${n ? "module" : "package"} '${e}' imported from ${t}`;
|
|
231
|
+
}, Error), he = A("ERR_PACKAGE_IMPORT_NOT_DEFINED", (e, t, n) => `Package import specifier "${e}" is not defined${t ? ` in package ${t || ""}package.json` : ""} imported from ${n}`, TypeError), ge = A("ERR_PACKAGE_PATH_NOT_EXPORTED", (e, t, n) => t === "." ? `No "exports" main defined in ${e}package.json${n ? ` imported from ${n}` : ""}` : `Package subpath '${t}' is not defined by "exports" in ${e}package.json${n ? ` imported from ${n}` : ""}`, Error), _e = A("ERR_UNSUPPORTED_DIR_IMPORT", function(e, t, n = void 0) {
|
|
232
|
+
return this.url = n, `Directory import '${e}' is not supported resolving ES modules imported from ${t}`;
|
|
233
|
+
}, Error), F = A("ERR_UNSUPPORTED_RESOLVE_REQUEST", "Failed to resolve module specifier \"%s\" from \"%s\": Invalid relative URL or base scheme is not hierarchical.", TypeError), ve = A("ERR_UNKNOWN_FILE_EXTENSION", (e, t) => `Unknown file extension "${e}" for ${t}`, TypeError);
|
|
234
|
+
A("ERR_INVALID_ARG_VALUE", (e, t, n = "is invalid") => {
|
|
235
|
+
let r = p(t);
|
|
236
|
+
return r.length > 128 && (r = `${r.slice(0, 128)}...`), `The ${e.includes(".") ? "property" : "argument"} '${e}' ${n}. Received ${r}`;
|
|
237
|
+
}, TypeError);
|
|
238
|
+
var I = {}.hasOwnProperty, L = /* @__PURE__ */ new Map();
|
|
239
|
+
function R(t, { base: n, specifier: r }) {
|
|
240
|
+
let i = L.get(t);
|
|
241
|
+
if (i) return i;
|
|
242
|
+
let a;
|
|
243
|
+
try {
|
|
244
|
+
a = e.readFileSync(c.toNamespacedPath(t), "utf8");
|
|
245
|
+
} catch (e) {
|
|
246
|
+
let t = e;
|
|
247
|
+
if (t.code !== "ENOENT") throw t;
|
|
248
|
+
}
|
|
249
|
+
let o = {
|
|
250
|
+
exists: !1,
|
|
251
|
+
pjsonPath: t,
|
|
252
|
+
main: void 0,
|
|
253
|
+
name: void 0,
|
|
254
|
+
type: "none",
|
|
255
|
+
exports: void 0,
|
|
256
|
+
imports: void 0
|
|
257
|
+
};
|
|
258
|
+
if (a !== void 0) {
|
|
259
|
+
let e;
|
|
260
|
+
try {
|
|
261
|
+
e = JSON.parse(a);
|
|
262
|
+
} catch (e) {
|
|
263
|
+
let i = new N(t, (n ? `"${r}" from ` : "") + h(n || r), e.message);
|
|
264
|
+
throw i.cause = e, i;
|
|
265
|
+
}
|
|
266
|
+
o.exists = !0, I.call(e, "name") && typeof e.name == "string" && (o.name = e.name), I.call(e, "main") && typeof e.main == "string" && (o.main = e.main), I.call(e, "exports") && (o.exports = e.exports), I.call(e, "imports") && (o.imports = e.imports), I.call(e, "type") && (e.type === "commonjs" || e.type === "module") && (o.type = e.type);
|
|
267
|
+
}
|
|
268
|
+
return L.set(t, o), o;
|
|
269
|
+
}
|
|
270
|
+
function z(e) {
|
|
271
|
+
let t = new URL("package.json", e);
|
|
272
|
+
for (; !t.pathname.endsWith("node_modules/package.json");) {
|
|
273
|
+
let n = R(h(t), { specifier: e });
|
|
274
|
+
if (n.exists) return n;
|
|
275
|
+
let r = t;
|
|
276
|
+
if (t = new URL("../package.json", t), t.pathname === r.pathname) break;
|
|
277
|
+
}
|
|
278
|
+
return {
|
|
279
|
+
pjsonPath: h(t),
|
|
280
|
+
exists: !1,
|
|
281
|
+
type: "none"
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
var ye = {}.hasOwnProperty, be = {
|
|
285
|
+
__proto__: null,
|
|
286
|
+
".json": "json",
|
|
287
|
+
".cjs": "commonjs",
|
|
288
|
+
".cts": "commonjs",
|
|
289
|
+
".js": "module",
|
|
290
|
+
".ts": "module",
|
|
291
|
+
".mts": "module",
|
|
292
|
+
".mjs": "module"
|
|
293
|
+
}, xe = {
|
|
294
|
+
__proto__: null,
|
|
295
|
+
"data:": Ce,
|
|
296
|
+
"file:": De,
|
|
297
|
+
"node:": () => "builtin"
|
|
298
|
+
};
|
|
299
|
+
function Se(e) {
|
|
300
|
+
return e && /^\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?$/i.test(e) ? "module" : e === "application/json" ? "json" : null;
|
|
301
|
+
}
|
|
302
|
+
function Ce(e) {
|
|
303
|
+
let { 1: t } = /^([^/]+\/[^;,]+)(?:[^,]*?)(;base64)?,/.exec(e.pathname) || [
|
|
304
|
+
null,
|
|
305
|
+
null,
|
|
306
|
+
null
|
|
307
|
+
];
|
|
308
|
+
return Se(t);
|
|
309
|
+
}
|
|
310
|
+
var we = 46, Te = 47;
|
|
311
|
+
function Ee(e) {
|
|
312
|
+
let t = e.pathname;
|
|
313
|
+
for (let e = t.length - 1; e > 0; e--) switch (t.charCodeAt(e)) {
|
|
314
|
+
case Te: return "";
|
|
315
|
+
case we: return t.charCodeAt(e - 1) === Te ? "" : t.slice(e);
|
|
316
|
+
}
|
|
317
|
+
return "";
|
|
318
|
+
}
|
|
319
|
+
function De(e, t, n) {
|
|
320
|
+
let r = Ee(e);
|
|
321
|
+
if (r === ".js") {
|
|
322
|
+
let { type: t } = z(e);
|
|
323
|
+
return t === "none" ? "commonjs" : t;
|
|
324
|
+
}
|
|
325
|
+
if (r === "") {
|
|
326
|
+
let { type: t } = z(e);
|
|
327
|
+
return t === "module" ? "module" : t === "none" ? "commonjs" : t;
|
|
328
|
+
}
|
|
329
|
+
let i = be[r];
|
|
330
|
+
if (i) return i;
|
|
331
|
+
if (!n) throw new ve(r, h(e));
|
|
332
|
+
}
|
|
333
|
+
function Oe(e, t) {
|
|
334
|
+
let n = e.protocol;
|
|
335
|
+
return ye.call(xe, n) && xe[n](e, t, !0) || null;
|
|
336
|
+
}
|
|
337
|
+
var B = RegExp.prototype[Symbol.replace], ke = {}.hasOwnProperty, Ae = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i, je = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i, Me = /^\.|%|\\/, V = /\*/g, Ne = /%2f|%5c/i, Pe = /* @__PURE__ */ new Set(), Fe = /[/\\]{2}/;
|
|
338
|
+
function Ie(e, t, n, r, i, a, o) {
|
|
339
|
+
if (y.noDeprecation) return;
|
|
340
|
+
let s = h(r), c = Fe.exec(o ? e : t) !== null;
|
|
341
|
+
y.emitWarning(`Use of deprecated ${c ? "double slash" : "leading or trailing slash matching"} resolving "${e}" for module request "${t}" ${t === n ? "" : `matched to "${n}" `}in the "${i ? "imports" : "exports"}" field module resolution of the package at ${s}${a ? ` imported from ${h(a)}` : ""}.`, "DeprecationWarning", "DEP0166");
|
|
342
|
+
}
|
|
343
|
+
function Le(e, t, n, r) {
|
|
344
|
+
if (y.noDeprecation || Oe(e, { parentURL: n.href }) !== "module") return;
|
|
345
|
+
let i = h(e.href), a = h(new m(".", t)), o = h(n);
|
|
346
|
+
r ? c.resolve(a, r) !== i && y.emitWarning(`Package ${a} has a "main" field set to "${r}", excluding the full filename and extension to the resolved file at "${i.slice(a.length)}", imported from ${o}.\n Automatic extension resolution of the "main" field is deprecated for ES modules.`, "DeprecationWarning", "DEP0151") : y.emitWarning(`No "main" or "exports" field defined in the package.json for ${a} resolving the main entry point "${i.slice(a.length)}", imported from ${o}.\nDefault "index" lookups for the main are deprecated for ES modules.`, "DeprecationWarning", "DEP0151");
|
|
347
|
+
}
|
|
348
|
+
function H(e) {
|
|
349
|
+
try {
|
|
350
|
+
return a(e);
|
|
351
|
+
} catch {}
|
|
352
|
+
}
|
|
353
|
+
function U(e) {
|
|
354
|
+
let t = a(e, { throwIfNoEntry: !1 });
|
|
355
|
+
return (t ? t.isFile() : void 0) ?? !1;
|
|
356
|
+
}
|
|
357
|
+
function Re(e, t, n) {
|
|
358
|
+
let r;
|
|
359
|
+
if (t.main !== void 0) {
|
|
360
|
+
if (r = new m(t.main, e), U(r)) return r;
|
|
361
|
+
let i = [
|
|
362
|
+
`./${t.main}.js`,
|
|
363
|
+
`./${t.main}.json`,
|
|
364
|
+
`./${t.main}.node`,
|
|
365
|
+
`./${t.main}/index.js`,
|
|
366
|
+
`./${t.main}/index.json`,
|
|
367
|
+
`./${t.main}/index.node`
|
|
368
|
+
], a = -1;
|
|
369
|
+
for (; ++a < i.length && (r = new m(i[a], e), !U(r));) r = void 0;
|
|
370
|
+
if (r) return Le(r, e, n, t.main), r;
|
|
371
|
+
}
|
|
372
|
+
let i = [
|
|
373
|
+
"./index.js",
|
|
374
|
+
"./index.json",
|
|
375
|
+
"./index.node"
|
|
376
|
+
], a = -1;
|
|
377
|
+
for (; ++a < i.length && (r = new m(i[a], e), !U(r));) r = void 0;
|
|
378
|
+
if (r) return Le(r, e, n, t.main), r;
|
|
379
|
+
throw new P(h(new m(".", e)), h(n));
|
|
380
|
+
}
|
|
381
|
+
function ze(e, t, n) {
|
|
382
|
+
if (Ne.exec(e.pathname) !== null) throw new M(e.pathname, String.raw`must not include encoded "/" or "\" characters`, h(t));
|
|
383
|
+
let r;
|
|
384
|
+
try {
|
|
385
|
+
r = h(e);
|
|
386
|
+
} catch (n) {
|
|
387
|
+
throw Object.defineProperty(n, "input", { value: String(e) }), Object.defineProperty(n, "module", { value: String(t) }), n;
|
|
388
|
+
}
|
|
389
|
+
let a = H(r.endsWith("/") ? r.slice(-1) : r);
|
|
390
|
+
if (a && a.isDirectory()) {
|
|
391
|
+
let n = new _e(r, h(t));
|
|
392
|
+
throw n.url = String(e), n;
|
|
393
|
+
}
|
|
394
|
+
if (!a || !a.isFile()) {
|
|
395
|
+
let n = new P(r || e.pathname, t && h(t), !0);
|
|
396
|
+
throw n.url = String(e), n;
|
|
397
|
+
}
|
|
398
|
+
if (!n) {
|
|
399
|
+
let t = i(r), { search: n, hash: a } = e;
|
|
400
|
+
e = g(t + (r.endsWith(c.sep) ? "/" : "")), e.search = n, e.hash = a;
|
|
401
|
+
}
|
|
402
|
+
return e;
|
|
403
|
+
}
|
|
404
|
+
function Be(e, t, n) {
|
|
405
|
+
return new he(e, t && h(new m(".", t)), h(n));
|
|
406
|
+
}
|
|
407
|
+
function W(e, t, n) {
|
|
408
|
+
return new ge(h(new m(".", t)), e, n && h(n));
|
|
409
|
+
}
|
|
410
|
+
function Ve(e, t, n, r, i) {
|
|
411
|
+
throw new M(e, `request is not a valid match in pattern "${t}" for the "${r ? "imports" : "exports"}" resolution of ${h(n)}`, i && h(i));
|
|
412
|
+
}
|
|
413
|
+
function G(e, t, n, r, i) {
|
|
414
|
+
return t = typeof t == "object" && t ? JSON.stringify(t, null, "") : `${t}`, new me(h(new m(".", n)), e, t, r, i && h(i));
|
|
415
|
+
}
|
|
416
|
+
function He(e, t, n, r, i, a, o, s, c) {
|
|
417
|
+
if (t !== "" && !a && e.at(-1) !== "/") throw G(n, e, r, o, i);
|
|
418
|
+
if (!e.startsWith("./")) {
|
|
419
|
+
if (o && !e.startsWith("../") && !e.startsWith("/")) {
|
|
420
|
+
let n = !1;
|
|
421
|
+
try {
|
|
422
|
+
new m(e), n = !0;
|
|
423
|
+
} catch {}
|
|
424
|
+
if (!n) return Xe(a ? B.call(V, e, () => t) : e + t, r, c);
|
|
425
|
+
}
|
|
426
|
+
throw G(n, e, r, o, i);
|
|
427
|
+
}
|
|
428
|
+
if (Ae.exec(e.slice(2)) !== null) {
|
|
429
|
+
if (je.exec(e.slice(2)) === null) {
|
|
430
|
+
if (!s) {
|
|
431
|
+
let s = a ? n.replace("*", () => t) : n + t;
|
|
432
|
+
Ie(a ? B.call(V, e, () => t) : e, s, n, r, o, i, !0);
|
|
433
|
+
}
|
|
434
|
+
} else throw G(n, e, r, o, i);
|
|
435
|
+
}
|
|
436
|
+
let l = new m(e, r), u = l.pathname, d = new m(".", r).pathname;
|
|
437
|
+
if (!u.startsWith(d)) throw G(n, e, r, o, i);
|
|
438
|
+
if (t === "") return l;
|
|
439
|
+
if (Ae.exec(t) !== null) {
|
|
440
|
+
let c = a ? n.replace("*", () => t) : n + t;
|
|
441
|
+
je.exec(t) === null ? s || Ie(a ? B.call(V, e, () => t) : e, c, n, r, o, i, !1) : Ve(c, n, r, o, i);
|
|
442
|
+
}
|
|
443
|
+
return a ? new m(B.call(V, l.href, () => t)) : new m(t, l);
|
|
444
|
+
}
|
|
445
|
+
function Ue(e) {
|
|
446
|
+
let t = Number(e);
|
|
447
|
+
return `${t}` === e && t >= 0 && t < 4294967295;
|
|
448
|
+
}
|
|
449
|
+
function K(e, t, n, r, i, a, o, s, c) {
|
|
450
|
+
if (typeof t == "string") return He(t, n, r, e, i, a, o, s, c);
|
|
451
|
+
if (Array.isArray(t)) {
|
|
452
|
+
let l = t;
|
|
453
|
+
if (l.length === 0) return null;
|
|
454
|
+
let u, d = -1;
|
|
455
|
+
for (; ++d < l.length;) {
|
|
456
|
+
let t = l[d], f;
|
|
457
|
+
try {
|
|
458
|
+
f = K(e, t, n, r, i, a, o, s, c);
|
|
459
|
+
} catch (e) {
|
|
460
|
+
let t = e;
|
|
461
|
+
if (u = t, t.code === "ERR_INVALID_PACKAGE_TARGET") continue;
|
|
462
|
+
throw e;
|
|
463
|
+
}
|
|
464
|
+
if (f !== void 0) {
|
|
465
|
+
if (f === null) {
|
|
466
|
+
u = null;
|
|
467
|
+
continue;
|
|
468
|
+
}
|
|
469
|
+
return f;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
if (u == null) return u;
|
|
473
|
+
throw u;
|
|
474
|
+
}
|
|
475
|
+
if (typeof t == "object" && t) {
|
|
476
|
+
let l = Object.getOwnPropertyNames(t), u = -1;
|
|
477
|
+
for (; ++u < l.length;) {
|
|
478
|
+
let t = l[u];
|
|
479
|
+
if (Ue(t)) throw new N(h(e), h(i), "\"exports\" cannot contain numeric property keys.");
|
|
480
|
+
}
|
|
481
|
+
for (u = -1; ++u < l.length;) {
|
|
482
|
+
let d = l[u];
|
|
483
|
+
if (d === "default" || c && c.has(d)) {
|
|
484
|
+
let l = t[d], u = K(e, l, n, r, i, a, o, s, c);
|
|
485
|
+
if (u === void 0) continue;
|
|
486
|
+
return u;
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
return;
|
|
490
|
+
}
|
|
491
|
+
if (t === null) return null;
|
|
492
|
+
throw G(r, t, e, o, i);
|
|
493
|
+
}
|
|
494
|
+
function We(e, t, n) {
|
|
495
|
+
if (typeof e == "string" || Array.isArray(e)) return !0;
|
|
496
|
+
if (typeof e != "object" || !e) return !1;
|
|
497
|
+
let r = Object.getOwnPropertyNames(e), i = !1, a = 0, o = -1;
|
|
498
|
+
for (; ++o < r.length;) {
|
|
499
|
+
let e = r[o], s = e === "" || e[0] !== ".";
|
|
500
|
+
if (a++ === 0) i = s;
|
|
501
|
+
else if (i !== s) throw new N(h(t), h(n), "\"exports\" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.");
|
|
502
|
+
}
|
|
503
|
+
return i;
|
|
504
|
+
}
|
|
505
|
+
function Ge(e, t, n) {
|
|
506
|
+
if (y.noDeprecation) return;
|
|
507
|
+
let r = h(t);
|
|
508
|
+
Pe.has(r + "|" + e) || (Pe.add(r + "|" + e), y.emitWarning(`Use of deprecated trailing slash pattern mapping "${e}" in the "exports" field module resolution of the package at ${r}${n ? ` imported from ${h(n)}` : ""}. Mapping specifiers ending in "/" is no longer supported.`, "DeprecationWarning", "DEP0155"));
|
|
509
|
+
}
|
|
510
|
+
function Ke(e, t, n, r, i) {
|
|
511
|
+
let a = n.exports;
|
|
512
|
+
if (We(a, e, r) && (a = { ".": a }), ke.call(a, t) && !t.includes("*") && !t.endsWith("/")) {
|
|
513
|
+
let n = a[t], o = K(e, n, "", t, r, !1, !1, !1, i);
|
|
514
|
+
if (o == null) throw W(t, e, r);
|
|
515
|
+
return o;
|
|
516
|
+
}
|
|
517
|
+
let o = "", s = "", c = Object.getOwnPropertyNames(a), l = -1;
|
|
518
|
+
for (; ++l < c.length;) {
|
|
519
|
+
let n = c[l], i = n.indexOf("*");
|
|
520
|
+
if (i !== -1 && t.startsWith(n.slice(0, i))) {
|
|
521
|
+
t.endsWith("/") && Ge(t, e, r);
|
|
522
|
+
let a = n.slice(i + 1);
|
|
523
|
+
t.length >= n.length && t.endsWith(a) && qe(o, n) === 1 && n.lastIndexOf("*") === i && (o = n, s = t.slice(i, t.length - a.length));
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
if (o) {
|
|
527
|
+
let n = a[o], c = K(e, n, s, o, r, !0, !1, t.endsWith("/"), i);
|
|
528
|
+
if (c == null) throw W(t, e, r);
|
|
529
|
+
return c;
|
|
530
|
+
}
|
|
531
|
+
throw W(t, e, r);
|
|
532
|
+
}
|
|
533
|
+
function qe(e, t) {
|
|
534
|
+
let n = e.indexOf("*"), r = t.indexOf("*"), i = n === -1 ? e.length : n + 1, a = r === -1 ? t.length : r + 1;
|
|
535
|
+
return i > a ? -1 : a > i || n === -1 ? 1 : r === -1 || e.length > t.length ? -1 : +(t.length > e.length);
|
|
536
|
+
}
|
|
537
|
+
function Je(e, t, n) {
|
|
538
|
+
if (e === "#" || e.endsWith("/")) throw new M(e, "is not a valid internal imports specifier name", h(t));
|
|
539
|
+
let r, i = z(t);
|
|
540
|
+
if (i.exists) {
|
|
541
|
+
r = g(i.pjsonPath);
|
|
542
|
+
let a = i.imports;
|
|
543
|
+
if (a) {
|
|
544
|
+
if (ke.call(a, e) && !e.includes("*")) {
|
|
545
|
+
let i = K(r, a[e], "", e, t, !1, !0, !1, n);
|
|
546
|
+
if (i != null) return i;
|
|
547
|
+
} else {
|
|
548
|
+
let i = "", o = "", s = Object.getOwnPropertyNames(a), c = -1;
|
|
549
|
+
for (; ++c < s.length;) {
|
|
550
|
+
let t = s[c], n = t.indexOf("*");
|
|
551
|
+
if (n !== -1 && e.startsWith(t.slice(0, n))) {
|
|
552
|
+
let r = t.slice(n + 1);
|
|
553
|
+
e.length >= t.length && e.endsWith(r) && qe(i, t) === 1 && t.lastIndexOf("*") === n && (i = t, o = e.slice(n, e.length - r.length));
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
if (i) {
|
|
557
|
+
let e = a[i], s = K(r, e, o, i, t, !0, !0, !1, n);
|
|
558
|
+
if (s != null) return s;
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
throw Be(e, r, t);
|
|
564
|
+
}
|
|
565
|
+
function Ye(e, t) {
|
|
566
|
+
let n = e.indexOf("/"), r = !0, i = !1;
|
|
567
|
+
e[0] === "@" && (i = !0, n === -1 || e.length === 0 ? r = !1 : n = e.indexOf("/", n + 1));
|
|
568
|
+
let a = n === -1 ? e : e.slice(0, n);
|
|
569
|
+
if (Me.exec(a) !== null && (r = !1), !r) throw new M(e, "is not a valid package name", h(t));
|
|
570
|
+
return {
|
|
571
|
+
packageName: a,
|
|
572
|
+
packageSubpath: "." + (n === -1 ? "" : e.slice(n)),
|
|
573
|
+
isScoped: i
|
|
574
|
+
};
|
|
575
|
+
}
|
|
576
|
+
function Xe(e, t, n) {
|
|
577
|
+
if (D.includes(e)) return new m("node:" + e);
|
|
578
|
+
let { packageName: r, packageSubpath: i, isScoped: a } = Ye(e, t), o = z(t);
|
|
579
|
+
if (o.exists && o.name === r && o.exports !== void 0 && o.exports !== null) return Ke(g(o.pjsonPath), i, o, t, n);
|
|
580
|
+
let s = new m("./node_modules/" + r + "/package.json", t), c = h(s), l;
|
|
581
|
+
do {
|
|
582
|
+
let o = H(c.slice(0, -13));
|
|
583
|
+
if (!o || !o.isDirectory()) {
|
|
584
|
+
l = c, s = new m((a ? "../../../../node_modules/" : "../../../node_modules/") + r + "/package.json", s), c = h(s);
|
|
585
|
+
continue;
|
|
586
|
+
}
|
|
587
|
+
let u = R(c, {
|
|
588
|
+
base: t,
|
|
589
|
+
specifier: e
|
|
590
|
+
});
|
|
591
|
+
return u.exports !== void 0 && u.exports !== null ? Ke(s, i, u, t, n) : i === "." ? Re(s, u, t) : new m(i, s);
|
|
592
|
+
} while (c.length !== l.length);
|
|
593
|
+
throw new P(r, h(t), !1);
|
|
594
|
+
}
|
|
595
|
+
function Ze(e) {
|
|
596
|
+
return !(e[0] !== "." || e.length !== 1 && e[1] !== "/" && (e[1] !== "." || e.length !== 2 && e[2] !== "/"));
|
|
597
|
+
}
|
|
598
|
+
function Qe(e) {
|
|
599
|
+
return e === "" ? !1 : e[0] === "/" || Ze(e);
|
|
600
|
+
}
|
|
601
|
+
function $e(e, t, n, r) {
|
|
602
|
+
let i = t.protocol, a = i === "data:", o;
|
|
603
|
+
if (Qe(e)) try {
|
|
604
|
+
o = new m(e, t);
|
|
605
|
+
} catch (n) {
|
|
606
|
+
let r = new F(e, t);
|
|
607
|
+
throw r.cause = n, r;
|
|
608
|
+
}
|
|
609
|
+
else if (i === "file:" && e[0] === "#") o = Je(e, t, n);
|
|
610
|
+
else try {
|
|
611
|
+
o = new m(e);
|
|
612
|
+
} catch (r) {
|
|
613
|
+
if (a && !D.includes(e)) {
|
|
614
|
+
let n = new F(e, t);
|
|
615
|
+
throw n.cause = r, n;
|
|
616
|
+
}
|
|
617
|
+
o = Xe(e, t, n);
|
|
618
|
+
}
|
|
619
|
+
return v.ok(o !== void 0, "expected to be defined"), o.protocol === "file:" ? ze(o, t, r) : o;
|
|
620
|
+
}
|
|
621
|
+
var et = /* #__PURE__ */ new Set(["node", "import"]), tt = "2:6:import4:node", nt = process.platform === "win32", rt = globalThis.__EXSOLVE_CACHE__ ||= /* @__PURE__ */ new Map();
|
|
622
|
+
function it(e, t) {
|
|
623
|
+
let r = ht(e);
|
|
624
|
+
if ("external" in r) return r.external;
|
|
625
|
+
let a = r.specifier, o = r.url, s = r.absolutePath, c, l;
|
|
626
|
+
if (t?.cache !== !1 && (c = ut(s || a, t), l = t?.cache && typeof t?.cache == "object" ? t.cache : rt), l) {
|
|
627
|
+
let e = l.get(c);
|
|
628
|
+
if (typeof e == "string") return e;
|
|
629
|
+
if (e instanceof Error) {
|
|
630
|
+
if (t?.try) return;
|
|
631
|
+
throw e;
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
if (s) try {
|
|
635
|
+
let e = n(s);
|
|
636
|
+
if (e.isSymbolicLink() && (s = i(s), o = g(s)), e.isFile()) return l && l.set(c, o.href), o.href;
|
|
637
|
+
} catch (e) {
|
|
638
|
+
if (e?.code !== "ENOENT") throw l && l.set(c, e), e;
|
|
639
|
+
}
|
|
640
|
+
let u = t?.conditions ? new Set(t.conditions) : et, d = a || o.href, f = st(t?.from), p = t?.suffixes || [""], m = t?.extensions ? ["", ...t.extensions] : [""], h;
|
|
641
|
+
for (let e of f) {
|
|
642
|
+
for (let t of p) {
|
|
643
|
+
let n = ft(d, t);
|
|
644
|
+
n === "." && (n += "/.");
|
|
645
|
+
for (let t of m) if (h = ot(n + t, e, u), h) break;
|
|
646
|
+
if (h) break;
|
|
647
|
+
}
|
|
648
|
+
if (h) break;
|
|
649
|
+
}
|
|
650
|
+
if (!h) {
|
|
651
|
+
let n = /* @__PURE__ */ Error(`Cannot resolve module "${e}" (from: ${f.map((e) => lt(e)).join(", ")})`);
|
|
652
|
+
if (n.code = "ERR_MODULE_NOT_FOUND", l && l.set(c, n), t?.try) return;
|
|
653
|
+
throw n;
|
|
654
|
+
}
|
|
655
|
+
return l && l.set(c, h.href), h.href;
|
|
656
|
+
}
|
|
657
|
+
function at(e, t) {
|
|
658
|
+
let n = it(e, t);
|
|
659
|
+
if (!n || !n.startsWith("file://") && t?.try) return;
|
|
660
|
+
let r = h(n);
|
|
661
|
+
return nt ? pt(r) : r;
|
|
662
|
+
}
|
|
663
|
+
function ot(e, t, n) {
|
|
664
|
+
try {
|
|
665
|
+
return $e(e, t, n);
|
|
666
|
+
} catch {}
|
|
667
|
+
}
|
|
668
|
+
function st(e) {
|
|
669
|
+
let t = (Array.isArray(e) ? e : [e]).flatMap((e) => ct(e));
|
|
670
|
+
return t.length === 0 ? [g("./")] : t;
|
|
671
|
+
}
|
|
672
|
+
function ct(e) {
|
|
673
|
+
if (!e) return [];
|
|
674
|
+
if (mt(e)) return [e];
|
|
675
|
+
if (typeof e != "string") return [];
|
|
676
|
+
if (/^(?:node|data|http|https|file):/.test(e)) return new URL(e);
|
|
677
|
+
try {
|
|
678
|
+
return e.endsWith("/") || a(e).isDirectory() ? g(e + "/") : g(e);
|
|
679
|
+
} catch {
|
|
680
|
+
return [g(e + "/"), g(e)];
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
function lt(e) {
|
|
684
|
+
try {
|
|
685
|
+
return h(e);
|
|
686
|
+
} catch {
|
|
687
|
+
return e;
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
function ut(e, t) {
|
|
691
|
+
let n;
|
|
692
|
+
return Array.isArray(t?.from) ? n = t.from : t?.from && (n = [t.from]), q([e]) + dt(t?.conditions) + q(t?.extensions) + q(n) + q(t?.suffixes);
|
|
693
|
+
}
|
|
694
|
+
function dt(e) {
|
|
695
|
+
return e ? q([...new Set(e)].sort()) : tt;
|
|
696
|
+
}
|
|
697
|
+
function q(e) {
|
|
698
|
+
if (!e) return "-";
|
|
699
|
+
let t = `${e.length}:`;
|
|
700
|
+
for (let n of e) {
|
|
701
|
+
let e = String(n);
|
|
702
|
+
t += `${e.length}:${e}`;
|
|
703
|
+
}
|
|
704
|
+
return t;
|
|
705
|
+
}
|
|
706
|
+
function ft(e, t) {
|
|
707
|
+
return !e || !t || t === "/" ? e : (e.endsWith("/") ? e : e + "/") + (t.startsWith("/") ? t.slice(1) : t);
|
|
708
|
+
}
|
|
709
|
+
function pt(e) {
|
|
710
|
+
return e.replace(/\\/g, "/").replace(/^[a-z]:\//, (e) => e.toUpperCase());
|
|
711
|
+
}
|
|
712
|
+
function mt(e) {
|
|
713
|
+
return e instanceof URL || e?.constructor?.name === "URL";
|
|
714
|
+
}
|
|
715
|
+
function ht(e) {
|
|
716
|
+
if (typeof e == "string") {
|
|
717
|
+
if (e.startsWith("file:")) {
|
|
718
|
+
let t = new URL(e);
|
|
719
|
+
return {
|
|
720
|
+
url: t,
|
|
721
|
+
absolutePath: h(t)
|
|
722
|
+
};
|
|
723
|
+
}
|
|
724
|
+
return l(e) ? {
|
|
725
|
+
url: g(e),
|
|
726
|
+
absolutePath: e
|
|
727
|
+
} : /^(?:node|data|http|https):/.test(e) ? { external: e } : D.includes(e) && !e.includes(":") ? { external: `node:${e}` } : { specifier: e };
|
|
728
|
+
}
|
|
729
|
+
if (mt(e)) return e.protocol === "file:" ? {
|
|
730
|
+
url: e,
|
|
731
|
+
absolutePath: h(e)
|
|
732
|
+
} : { external: e.href };
|
|
733
|
+
throw TypeError("id must be a `string` or `URL`");
|
|
734
|
+
}
|
|
735
|
+
//#endregion
|
|
736
|
+
//#region ../../node_modules/.pnpm/rc9@3.1.0/node_modules/rc9/dist/_chunks/libs/flat.mjs
|
|
737
|
+
function gt(e) {
|
|
738
|
+
return e && e.constructor && typeof e.constructor.isBuffer == "function" && e.constructor.isBuffer(e);
|
|
739
|
+
}
|
|
740
|
+
function _t(e) {
|
|
741
|
+
return e;
|
|
742
|
+
}
|
|
743
|
+
function vt(e, t) {
|
|
744
|
+
t ||= {};
|
|
745
|
+
let n = t.delimiter || ".", r = t.maxDepth, i = t.transformKey || _t, a = {};
|
|
746
|
+
function o(e, s, c) {
|
|
747
|
+
c ||= 1, Object.keys(e).forEach(function(l) {
|
|
748
|
+
let u = e[l], d = t.safe && Array.isArray(u), f = Object.prototype.toString.call(u), p = gt(u), m = f === "[object Object]" || f === "[object Array]", h = s ? s + n + i(l) : i(l);
|
|
749
|
+
if (!d && !p && m && Object.keys(u).length && (!t.maxDepth || c < r)) return o(u, h, c + 1);
|
|
750
|
+
a[h] = u;
|
|
751
|
+
});
|
|
752
|
+
}
|
|
753
|
+
return o(e), a;
|
|
754
|
+
}
|
|
755
|
+
function yt(e, t) {
|
|
756
|
+
t ||= {};
|
|
757
|
+
let n = t.delimiter || ".", r = t.overwrite || !1, i = t.transformKey || _t, a = {};
|
|
758
|
+
if (gt(e) || Object.prototype.toString.call(e) !== "[object Object]") return e;
|
|
759
|
+
function o(e) {
|
|
760
|
+
let n = Number(e);
|
|
761
|
+
return isNaN(n) || e.indexOf(".") !== -1 || t.object ? e : n;
|
|
762
|
+
}
|
|
763
|
+
function s(e, t, r) {
|
|
764
|
+
return Object.keys(r).reduce(function(t, i) {
|
|
765
|
+
return t[e + n + i] = r[i], t;
|
|
766
|
+
}, t);
|
|
767
|
+
}
|
|
768
|
+
function c(e) {
|
|
769
|
+
let t = Object.prototype.toString.call(e), n = t === "[object Array]", r = t === "[object Object]";
|
|
770
|
+
if (!e) return !0;
|
|
771
|
+
if (n) return !e.length;
|
|
772
|
+
if (r) return !Object.keys(e).length;
|
|
773
|
+
}
|
|
774
|
+
return e = Object.keys(e).reduce(function(n, r) {
|
|
775
|
+
let i = Object.prototype.toString.call(e[r]);
|
|
776
|
+
return i !== "[object Object]" && i !== "[object Array]" || c(e[r]) ? (n[r] = e[r], n) : s(r, n, vt(e[r], t));
|
|
777
|
+
}, {}), Object.keys(e).forEach(function(s) {
|
|
778
|
+
let c = s.split(n).map(i), l = o(c.shift()), u = o(c[0]), d = a;
|
|
779
|
+
for (; u !== void 0;) {
|
|
780
|
+
if (l === "__proto__") return;
|
|
781
|
+
let e = Object.prototype.toString.call(d[l]), n = e === "[object Object]" || e === "[object Array]";
|
|
782
|
+
if (!r && !n && d[l] !== void 0) return;
|
|
783
|
+
(r && !n || !r && d[l] == null) && (d[l] = typeof u == "number" && !t.object ? [] : {}), d = d[l], c.length > 0 && (l = o(c.shift()), u = o(c[0]));
|
|
784
|
+
}
|
|
785
|
+
d[l] = yt(e[s], t);
|
|
786
|
+
}), a;
|
|
787
|
+
}
|
|
788
|
+
//#endregion
|
|
789
|
+
//#region ../../node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs
|
|
790
|
+
var bt = /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/, xt = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/, St = /^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;
|
|
791
|
+
function Ct(e, t) {
|
|
792
|
+
if (e === "__proto__" || e === "constructor" && t && typeof t == "object" && "prototype" in t) {
|
|
793
|
+
wt(e);
|
|
794
|
+
return;
|
|
795
|
+
}
|
|
796
|
+
return t;
|
|
797
|
+
}
|
|
798
|
+
function wt(e) {
|
|
799
|
+
console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`);
|
|
800
|
+
}
|
|
801
|
+
function Tt(e, t = {}) {
|
|
802
|
+
if (typeof e != "string") return e;
|
|
803
|
+
if (e[0] === "\"" && e[e.length - 1] === "\"" && e.indexOf("\\") === -1) return e.slice(1, -1);
|
|
804
|
+
let n = e.trim();
|
|
805
|
+
if (n.length <= 9) switch (n.toLowerCase()) {
|
|
806
|
+
case "true": return !0;
|
|
807
|
+
case "false": return !1;
|
|
808
|
+
case "undefined": return;
|
|
809
|
+
case "null": return null;
|
|
810
|
+
case "nan": return NaN;
|
|
811
|
+
case "infinity": return Infinity;
|
|
812
|
+
case "-infinity": return -Infinity;
|
|
813
|
+
}
|
|
814
|
+
if (!St.test(e)) {
|
|
815
|
+
if (t.strict) throw SyntaxError("[destr] Invalid JSON");
|
|
816
|
+
return e;
|
|
817
|
+
}
|
|
818
|
+
try {
|
|
819
|
+
if (bt.test(e) || xt.test(e)) {
|
|
820
|
+
if (t.strict) throw Error("[destr] Possible prototype pollution");
|
|
821
|
+
return JSON.parse(e, Ct);
|
|
822
|
+
}
|
|
823
|
+
return JSON.parse(e);
|
|
824
|
+
} catch (n) {
|
|
825
|
+
if (t.strict) throw n;
|
|
826
|
+
return e;
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
//#endregion
|
|
830
|
+
//#region ../../node_modules/.pnpm/defu@6.1.7/node_modules/defu/dist/defu.mjs
|
|
831
|
+
function J(e) {
|
|
832
|
+
if (typeof e != "object" || !e) return !1;
|
|
833
|
+
let t = Object.getPrototypeOf(e);
|
|
834
|
+
return t !== null && t !== Object.prototype && Object.getPrototypeOf(t) !== null || Symbol.iterator in e ? !1 : Symbol.toStringTag in e ? Object.prototype.toString.call(e) === "[object Module]" : !0;
|
|
835
|
+
}
|
|
836
|
+
function Y(e, t, n = ".", r) {
|
|
837
|
+
if (!J(t)) return Y(e, {}, n, r);
|
|
838
|
+
let i = { ...t };
|
|
839
|
+
for (let t of Object.keys(e)) {
|
|
840
|
+
if (t === "__proto__" || t === "constructor") continue;
|
|
841
|
+
let a = e[t];
|
|
842
|
+
a != null && (r && r(i, t, a, n) || (i[t] = Array.isArray(a) && Array.isArray(i[t]) ? [...a, ...i[t]] : J(a) && J(i[t]) ? Y(a, i[t], (n ? `${n}.` : "") + t.toString(), r) : a));
|
|
843
|
+
}
|
|
844
|
+
return i;
|
|
845
|
+
}
|
|
846
|
+
function Et(e) {
|
|
847
|
+
return (...t) => t.reduce((t, n) => Y(t, n, "", e), {});
|
|
848
|
+
}
|
|
849
|
+
var X = Et(), Dt = /^\s*([^\s=]+)\s*=\s*(.*)?\s*$/, Ot = /\n|\r|\r\n/, kt = {
|
|
850
|
+
name: ".conf",
|
|
851
|
+
dir: process.cwd(),
|
|
852
|
+
flat: !1
|
|
853
|
+
};
|
|
854
|
+
function At(e) {
|
|
855
|
+
return typeof e == "string" && (e = { name: e }), {
|
|
856
|
+
...kt,
|
|
857
|
+
...e
|
|
858
|
+
};
|
|
859
|
+
}
|
|
860
|
+
function jt(e, t = {}) {
|
|
861
|
+
let n = {}, r = e.split(Ot);
|
|
862
|
+
for (let e of r) {
|
|
863
|
+
let t = e.match(Dt);
|
|
864
|
+
if (!t) continue;
|
|
865
|
+
let r = t[1];
|
|
866
|
+
if (!r || r === "__proto__" || r === "constructor") continue;
|
|
867
|
+
let i = Tt((t[2] || "").trim());
|
|
868
|
+
if (r.endsWith("[]")) {
|
|
869
|
+
let e = r.slice(0, Math.max(0, r.length - 2));
|
|
870
|
+
n[e] = (n[e] || []).concat(i);
|
|
871
|
+
continue;
|
|
872
|
+
}
|
|
873
|
+
n[r] = i;
|
|
874
|
+
}
|
|
875
|
+
return t.flat ? n : yt(n, { overwrite: !0 });
|
|
876
|
+
}
|
|
877
|
+
function Mt(e, n) {
|
|
878
|
+
return t(e) ? jt(r(e, "utf8"), n) : {};
|
|
879
|
+
}
|
|
880
|
+
function Z(e) {
|
|
881
|
+
return e = At(e), Mt(u(e.dir, e.name), e);
|
|
882
|
+
}
|
|
883
|
+
function Nt() {
|
|
884
|
+
return process.env.XDG_CONFIG_HOME || u(_(), ".config");
|
|
885
|
+
}
|
|
886
|
+
function Pt(e) {
|
|
887
|
+
return e = At(e), e.dir = Nt(), Z(e);
|
|
888
|
+
}
|
|
889
|
+
//#endregion
|
|
890
|
+
//#region ../../node_modules/.pnpm/c12@4.0.0-rc.1_magicast@0.5.4/node_modules/c12/dist/index.mjs
|
|
891
|
+
async function Ft(e) {
|
|
892
|
+
let t = e.env ?? process.env, n = await It({
|
|
893
|
+
cwd: e.cwd,
|
|
894
|
+
fileName: e.fileName ?? ".env",
|
|
895
|
+
env: t,
|
|
896
|
+
interpolate: e.interpolate ?? !0,
|
|
897
|
+
expandFileReferences: e.expandFileReferences ?? !1
|
|
898
|
+
}), r = zt(t);
|
|
899
|
+
for (let e in n) e.startsWith("_") || (t[e] === void 0 || r.has(e)) && (t[e] = n[e]);
|
|
900
|
+
return n;
|
|
901
|
+
}
|
|
902
|
+
async function It(e) {
|
|
903
|
+
let t = Object.create(null), n = C(e.cwd || "."), i = e.fileName || ".env", o = typeof i == "string" ? [i] : i, s = zt(e.env || {});
|
|
904
|
+
Object.assign(t, e.env);
|
|
905
|
+
for (let e of o) {
|
|
906
|
+
let r = C(n, e);
|
|
907
|
+
if (!a(r, { throwIfNoEntry: !1 })?.isFile()) continue;
|
|
908
|
+
let i = await Lt(r);
|
|
909
|
+
for (let e in i) e in t && !s.has(e) || (t[e] = i[e], s.add(e));
|
|
910
|
+
}
|
|
911
|
+
if (e.expandFileReferences) {
|
|
912
|
+
for (let e in t) if (e.endsWith("_FILE")) {
|
|
913
|
+
let n = e.slice(0, -5);
|
|
914
|
+
if (t[n] === void 0) {
|
|
915
|
+
let i = t[e];
|
|
916
|
+
i && a(i, { throwIfNoEntry: !1 })?.isFile() && (t[n] = r(i, "utf8").trim(), s.add(n));
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
return e.interpolate && Rt(t), t;
|
|
921
|
+
}
|
|
922
|
+
var Q = d.parseEnv;
|
|
923
|
+
async function Lt(e) {
|
|
924
|
+
let t = r(e, "utf8");
|
|
925
|
+
if (!Q) try {
|
|
926
|
+
let e = await import("./__vite-optional-peer-dep_dotenv_c12-CxKvRg9-.js");
|
|
927
|
+
Q = (t) => e.parse(t);
|
|
928
|
+
} catch {
|
|
929
|
+
throw Error("Failed to parse .env file: `node:util.parseEnv` is not available and `dotenv` package is not installed. Please upgrade your runtime or install `dotenv` as a dependency.");
|
|
930
|
+
}
|
|
931
|
+
return Q(t);
|
|
932
|
+
}
|
|
933
|
+
function Rt(e, t = {}, n = (e) => e) {
|
|
934
|
+
function r(n) {
|
|
935
|
+
return t[n] === void 0 ? e[n] : t[n];
|
|
936
|
+
}
|
|
937
|
+
function i(e, t = []) {
|
|
938
|
+
return typeof e == "string" ? n((e.match(/(.?\${?(?:[\w:]+)?}?)/g) || []).reduce((e, n) => {
|
|
939
|
+
let a = /(.?)\${?([\w:]+)?}?/g.exec(n) || [], o = a[1], s, c;
|
|
940
|
+
if (o === "\\") c = a[0] || "", s = c.replace(String.raw`\$`, "$");
|
|
941
|
+
else {
|
|
942
|
+
let e = a[2];
|
|
943
|
+
if (c = (a[0] || "").slice(o.length), t.includes(e)) return console.warn(`Please avoid recursive environment variables ( loop: ${t.join(" > ")} > ${e} )`), "";
|
|
944
|
+
s = r(e), s = i(s, [...t, e]);
|
|
945
|
+
}
|
|
946
|
+
return s === void 0 ? e : e.replace(c, s);
|
|
947
|
+
}, e)) : e;
|
|
948
|
+
}
|
|
949
|
+
for (let t in e) e[t] = i(r(t));
|
|
950
|
+
}
|
|
951
|
+
function zt(e) {
|
|
952
|
+
let t = globalThis.__c12_dotenv_vars__ ||= /* @__PURE__ */ new Map();
|
|
953
|
+
return t.has(e) || t.set(e, /* @__PURE__ */ new Set()), t.get(e);
|
|
954
|
+
}
|
|
955
|
+
var Bt = (e) => e?.replace(/\\/g, "/"), Vt = 0, Ht = {
|
|
956
|
+
".json": () => JSON.parse,
|
|
957
|
+
".yaml": () => import("./yaml-N2dF3WHm.js").then((e) => e.parseYAML),
|
|
958
|
+
".yml": () => import("./yaml-N2dF3WHm.js").then((e) => e.parseYAML),
|
|
959
|
+
".jsonc": () => import("./jsonc-BdzClvC8.js").then((e) => e.n).then((e) => (t) => e.parseJSONC(t, { allowTrailingComma: !0 })),
|
|
960
|
+
".json5": () => import("./json5-feUuPtTt.js").then((e) => e.parseJSON5),
|
|
961
|
+
".toml": () => import("./toml-BERh2MAo.js").then((e) => e.parseTOML)
|
|
962
|
+
}, Ut = Object.freeze([
|
|
963
|
+
".js",
|
|
964
|
+
".ts",
|
|
965
|
+
".mjs",
|
|
966
|
+
".cjs",
|
|
967
|
+
".mts",
|
|
968
|
+
".cts",
|
|
969
|
+
".json",
|
|
970
|
+
".jsonc",
|
|
971
|
+
".json5",
|
|
972
|
+
".yaml",
|
|
973
|
+
".yml",
|
|
974
|
+
".toml"
|
|
975
|
+
]);
|
|
976
|
+
async function Wt(e) {
|
|
977
|
+
e.cwd = C(process.cwd(), e.cwd || "."), e.name = e.name || "config", e.envName = e.envName ?? process.env.NODE_ENV, e.configFile = e.configFile ?? (e.name === "config" ? "config" : `${e.name}.config`), e.rcFile = e.rcFile ?? `.${e.name}rc`, e.extend !== !1 && (e.extend = {
|
|
978
|
+
extendKey: "extends",
|
|
979
|
+
...e.extend
|
|
980
|
+
});
|
|
981
|
+
let t = e.merger || X, n = {
|
|
982
|
+
config: {},
|
|
983
|
+
cwd: e.cwd,
|
|
984
|
+
configFile: C(e.cwd, e.configFile),
|
|
985
|
+
layers: [],
|
|
986
|
+
_configFile: void 0
|
|
987
|
+
}, r = {
|
|
988
|
+
overrides: e.overrides,
|
|
989
|
+
main: void 0,
|
|
990
|
+
rc: void 0,
|
|
991
|
+
packageJson: void 0,
|
|
992
|
+
defaultConfig: e.defaultConfig
|
|
993
|
+
};
|
|
994
|
+
e.dotenv && await Ft({
|
|
995
|
+
cwd: e.cwd,
|
|
996
|
+
...e.dotenv === !0 ? {} : e.dotenv
|
|
997
|
+
});
|
|
998
|
+
let i = await Jt(".", e);
|
|
999
|
+
if (i.configFile && (r.main = i.config, n.configFile = i.configFile, n._configFile = i._configFile), i.meta && (n.meta = i.meta), e.rcFile) {
|
|
1000
|
+
let n = [];
|
|
1001
|
+
if (n.push(Z({
|
|
1002
|
+
name: e.rcFile,
|
|
1003
|
+
dir: e.cwd
|
|
1004
|
+
})), e.globalRc) {
|
|
1005
|
+
let { findWorkspaceDir: t } = await import("./dist-BVKUE9C4.js"), r = await t(e.cwd).catch(() => {});
|
|
1006
|
+
r && n.push(Z({
|
|
1007
|
+
name: e.rcFile,
|
|
1008
|
+
dir: r
|
|
1009
|
+
})), n.push(Pt({ name: e.rcFile })), n.push(Z({
|
|
1010
|
+
name: e.rcFile,
|
|
1011
|
+
dir: _()
|
|
1012
|
+
}));
|
|
1013
|
+
}
|
|
1014
|
+
r.rc = t({}, ...n);
|
|
1015
|
+
}
|
|
1016
|
+
if (e.packageJson) {
|
|
1017
|
+
let n = (Array.isArray(e.packageJson) ? e.packageJson : [typeof e.packageJson == "string" ? e.packageJson : e.name]).filter((e) => e && typeof e == "string"), { readPackageJSON: i } = await import("./dist-BVKUE9C4.js"), a = await i(e.cwd).catch(() => {});
|
|
1018
|
+
r.packageJson = t({}, ...n.map((e) => a?.[e]));
|
|
1019
|
+
}
|
|
1020
|
+
let a = {};
|
|
1021
|
+
for (let e in r) {
|
|
1022
|
+
let t = r[e];
|
|
1023
|
+
a[e] = await (typeof t == "function" ? t({
|
|
1024
|
+
configs: a,
|
|
1025
|
+
rawConfigs: r
|
|
1026
|
+
}) : t);
|
|
1027
|
+
}
|
|
1028
|
+
if (Array.isArray(a.main) ? n.config = a.main : (n.config = t(a.overrides, a.main, a.rc, a.packageJson, a.defaultConfig), e.extend && (await Gt(n.config, e), n.layers = n.config._layers, delete n.config._layers, n.config = t(n.config, ...n.layers.map((e) => e.config)))), n.layers = [...[
|
|
1029
|
+
a.overrides && {
|
|
1030
|
+
config: a.overrides,
|
|
1031
|
+
configFile: void 0,
|
|
1032
|
+
cwd: void 0
|
|
1033
|
+
},
|
|
1034
|
+
{
|
|
1035
|
+
config: a.main,
|
|
1036
|
+
configFile: e.configFile,
|
|
1037
|
+
cwd: e.cwd
|
|
1038
|
+
},
|
|
1039
|
+
a.rc && {
|
|
1040
|
+
config: a.rc,
|
|
1041
|
+
configFile: e.rcFile
|
|
1042
|
+
},
|
|
1043
|
+
a.packageJson && {
|
|
1044
|
+
config: a.packageJson,
|
|
1045
|
+
configFile: "package.json"
|
|
1046
|
+
}
|
|
1047
|
+
].filter((e) => e && e.config), ...n.layers], e.defaults && (n.config = t(n.config, e.defaults)), e.omit$Keys) for (let e in n.config) e.startsWith("$") && delete n.config[e];
|
|
1048
|
+
if (e.configFileRequired && !n._configFile) throw Error(`Required config (${n.configFile}) cannot be resolved.`);
|
|
1049
|
+
return n;
|
|
1050
|
+
}
|
|
1051
|
+
async function Gt(e, t) {
|
|
1052
|
+
if (e._layers = e._layers || [], !t.extend) return;
|
|
1053
|
+
let n = t.extend.extendKey;
|
|
1054
|
+
typeof n == "string" && (n = [n]);
|
|
1055
|
+
let r = [];
|
|
1056
|
+
for (let t of n) r.push(...(Array.isArray(e[t]) ? e[t] : [e[t]]).filter(Boolean)), delete e[t];
|
|
1057
|
+
for (let n of r) {
|
|
1058
|
+
let r = n, i = {};
|
|
1059
|
+
if (n.source && (i = n.options || {}, n = n.source), Array.isArray(n) && (i = n[1] || {}, n = n[0]), typeof n != "string") {
|
|
1060
|
+
console.warn(`Cannot extend config from \`${JSON.stringify(r)}\` in ${t.cwd}`);
|
|
1061
|
+
continue;
|
|
1062
|
+
}
|
|
1063
|
+
let a = await Jt(n, t, i);
|
|
1064
|
+
if (!a.config) {
|
|
1065
|
+
console.warn(`Cannot extend config from \`${n}\` in ${t.cwd}`);
|
|
1066
|
+
continue;
|
|
1067
|
+
}
|
|
1068
|
+
await Gt(a.config, {
|
|
1069
|
+
...t,
|
|
1070
|
+
cwd: a.cwd
|
|
1071
|
+
}), e._layers.push(a), a.config._layers && (e._layers.push(...a.config._layers), delete a.config._layers);
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
var Kt = [
|
|
1075
|
+
"gh:",
|
|
1076
|
+
"github:",
|
|
1077
|
+
"gitlab:",
|
|
1078
|
+
"bitbucket:",
|
|
1079
|
+
"https://",
|
|
1080
|
+
"http://"
|
|
1081
|
+
], qt = /^(@[\da-z~-][\d._a-z~-]*\/)?[\da-z~-][\d._a-z~-]*($|\/.*)/;
|
|
1082
|
+
async function Jt(e, n, r = {}) {
|
|
1083
|
+
if (n.resolve) {
|
|
1084
|
+
let t = await n.resolve(e, n);
|
|
1085
|
+
if (t) return t;
|
|
1086
|
+
}
|
|
1087
|
+
let i = n.merger || X, a = Object.keys(r.giget?.providers || {}).map((e) => `${e}:`), c = a.length > 0 ? [.../* @__PURE__ */ new Set([...a, ...Kt])] : Kt;
|
|
1088
|
+
if (n.giget !== !1 && c.some((t) => e.startsWith(t))) {
|
|
1089
|
+
let { downloadTemplate: i } = await import("./__vite-optional-peer-dep_giget_c12-BYcrHYBM.js").catch((t) => {
|
|
1090
|
+
throw Error(`Extending config from \`${e}\` requires \`giget\` peer dependency to be installed.\n\nInstall it with: \`npx nypm i giget\``, { cause: t });
|
|
1091
|
+
}), { digest: a } = await import("./ohash-CHaRSTtv.js").then((e) => e.dist_exports), o = e.replace(/\W+/g, "_").split("_").splice(0, 3).join("_") + "_" + a(e).slice(0, 10).replace(/[-_]/g, ""), c, l = C(n.cwd, "node_modules"), u = T(n.cwd);
|
|
1092
|
+
c = E(u) === ".c12" ? S(u, o) : t(l) ? S(l, ".c12", o) : process.env.XDG_CACHE_HOME ? C(process.env.XDG_CACHE_HOME, "c12", o) : C(_(), ".cache/c12", o);
|
|
1093
|
+
let d = r.install ? X(r.install === !0 ? {} : r.install, { ignoreWorkspace: !0 }) : !1;
|
|
1094
|
+
t(c) && !d && await s(c, { recursive: !0 }), e = (await i(e, {
|
|
1095
|
+
dir: c,
|
|
1096
|
+
install: d,
|
|
1097
|
+
force: !!d,
|
|
1098
|
+
auth: r.auth,
|
|
1099
|
+
...n.giget,
|
|
1100
|
+
...r.giget
|
|
1101
|
+
})).dir;
|
|
1102
|
+
}
|
|
1103
|
+
qt.test(e) && (e = $(e, n) || e);
|
|
1104
|
+
let l = se(e), u = Yt(C(n.cwd, e)) ?? (!l || l === E(e)), d = C(n.cwd, u ? e : T(e));
|
|
1105
|
+
u && (e = n.configFile);
|
|
1106
|
+
let f = {
|
|
1107
|
+
config: void 0,
|
|
1108
|
+
configFile: void 0,
|
|
1109
|
+
cwd: d,
|
|
1110
|
+
source: e,
|
|
1111
|
+
sourceOptions: r
|
|
1112
|
+
};
|
|
1113
|
+
if (f.configFile = $(C(d, e), n) || $(C(d, ".config", e.replace(/\.config$/, "")), n) || $(C(d, ".config", e), n) || e, !t(f.configFile)) return f;
|
|
1114
|
+
f._configFile = f.configFile;
|
|
1115
|
+
let p = se(f.configFile) || "";
|
|
1116
|
+
if (p in Ht) f.config = (await Ht[p]())(await o(f.configFile, "utf8"));
|
|
1117
|
+
else {
|
|
1118
|
+
let e = n.resolveModule || ((e) => e.default || e);
|
|
1119
|
+
if (n.import) f.config = e(await n.import(f.configFile));
|
|
1120
|
+
else {
|
|
1121
|
+
let t = g(f.configFile);
|
|
1122
|
+
t.search = `_${++Vt}`, f.config = await import(t.href).then(e, async (t) => {
|
|
1123
|
+
let { createJiti: r } = await import("./__vite-optional-peer-dep_jiti_c12-DZVJNj6v.js").catch(() => {
|
|
1124
|
+
throw Error(`Failed to load config file \`${f.configFile}\`: ${t?.message}. Hint install \`jiti\` for compatibility.`, { cause: t });
|
|
1125
|
+
}), i = r(S(n.cwd || ".", n.configFile || "/"), {
|
|
1126
|
+
interopDefault: !0,
|
|
1127
|
+
moduleCache: !1,
|
|
1128
|
+
extensions: [...Ut],
|
|
1129
|
+
...n.jitiOptions
|
|
1130
|
+
});
|
|
1131
|
+
return n.import = (e) => i.import(e), e(await n.import(f.configFile));
|
|
1132
|
+
});
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
if (typeof f.config == "function" && (f.config = await f.config(n.context)), n.envName) {
|
|
1136
|
+
let e = {
|
|
1137
|
+
...f.config["$" + n.envName],
|
|
1138
|
+
...f.config.$env?.[n.envName]
|
|
1139
|
+
};
|
|
1140
|
+
Object.keys(e).length > 0 && (f.config = i(e, f.config));
|
|
1141
|
+
}
|
|
1142
|
+
return f.meta = X(f.sourceOptions.meta, f.config.$meta), delete f.config.$meta, f.sourceOptions.overrides && (f.config = i(f.sourceOptions.overrides, f.config)), f.configFile = Bt(f.configFile), f.source = Bt(f.source), f;
|
|
1143
|
+
}
|
|
1144
|
+
function $(e, t) {
|
|
1145
|
+
let n = at(e, {
|
|
1146
|
+
try: !0,
|
|
1147
|
+
from: g(S(t.cwd || ".", t.configFile || "/")),
|
|
1148
|
+
suffixes: ["", "/index"],
|
|
1149
|
+
extensions: Ut,
|
|
1150
|
+
cache: !1
|
|
1151
|
+
});
|
|
1152
|
+
return n ? x(n) : void 0;
|
|
1153
|
+
}
|
|
1154
|
+
function Yt(e) {
|
|
1155
|
+
try {
|
|
1156
|
+
return a(e).isDirectory();
|
|
1157
|
+
} catch {
|
|
1158
|
+
return null;
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
function Xt() {
|
|
1162
|
+
return (e) => e;
|
|
1163
|
+
}
|
|
1164
|
+
//#endregion
|
|
1165
|
+
//#region src/config/defaults.mts
|
|
1166
|
+
var Zt = {
|
|
1167
|
+
outDir: "dist",
|
|
1168
|
+
version: "0.0.0"
|
|
1169
|
+
};
|
|
1170
|
+
function Qt(e) {
|
|
1171
|
+
let t = e.indexOf("/");
|
|
1172
|
+
return e.startsWith("@") && t !== -1 ? e.slice(t + 1) : e;
|
|
1173
|
+
}
|
|
1174
|
+
function $t(e) {
|
|
1175
|
+
return e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
1176
|
+
}
|
|
1177
|
+
function en(e) {
|
|
1178
|
+
return e ? Qt(e) : void 0;
|
|
1179
|
+
}
|
|
1180
|
+
function tn(e) {
|
|
1181
|
+
return `org.inca.${$t(e)}`;
|
|
1182
|
+
}
|
|
1183
|
+
//#endregion
|
|
1184
|
+
export { Xt as a, T as c, x as d, C as f, $t as i, w as l, tn as n, Wt as o, en as r, at as s, Zt as t, S as u };
|