typerighter 0.2.2 → 0.3.0
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/bin/typerighter.js +1 -1
- package/dist/cli-CoyGXgR1.js +579 -0
- package/dist/cli.js +1 -1
- package/dist/{vite-BNDqb1zM.js → constants-B7b8AsH0.js} +126 -315
- package/dist/index.js +4 -4
- package/dist/init-CUo89E7j.js +2358 -0
- package/dist/node/build/index.d.ts +2 -3
- package/dist/node/build/index.d.ts.map +1 -1
- package/dist/node/build/{render.d.ts → prerender.d.ts} +6 -3
- package/dist/node/build/prerender.d.ts.map +1 -0
- package/dist/node/cli/index.d.ts +1 -1
- package/dist/node/cli/index.d.ts.map +1 -1
- package/dist/node/cli/init.d.ts +1 -1
- package/dist/node/cli/init.d.ts.map +1 -1
- package/dist/node/context.d.ts +14 -0
- package/dist/node/context.d.ts.map +1 -0
- package/dist/node/lib/logger.d.ts +10 -3
- package/dist/node/lib/logger.d.ts.map +1 -1
- package/dist/node/lib/progress.d.ts +10 -0
- package/dist/node/lib/progress.d.ts.map +1 -0
- package/dist/node/lib/typedown-context.d.ts +1 -3
- package/dist/node/lib/typedown-context.d.ts.map +1 -1
- package/dist/node/plugin/vite/index.d.ts +5 -1
- package/dist/node/plugin/vite/index.d.ts.map +1 -1
- package/dist/plugin-D2xuSVM4.js +1 -0
- package/dist/rolldown-runtime-Dqa2HsxW.js +20 -0
- package/dist/shared/utils/format.d.ts +2 -0
- package/dist/shared/utils/format.d.ts.map +1 -0
- package/dist/shared/utils/html.d.ts +2 -0
- package/dist/shared/utils/html.d.ts.map +1 -0
- package/dist/shared/utils/html.test.d.ts.map +1 -0
- package/dist/shared/utils/index.d.ts +2 -0
- package/dist/shared/utils/index.d.ts.map +1 -1
- package/dist/vite-BxXQPieu.js +228 -0
- package/dist/vite.js +2 -2
- package/package.json +6 -3
- package/dist/cli-CfMrevh1.js +0 -160
- package/dist/constants-BN1OmC7K.js +0 -46
- package/dist/init-0BIO3hYI.js +0 -647
- package/dist/node/build/html.d.ts +0 -21
- package/dist/node/build/html.d.ts.map +0 -1
- package/dist/node/build/html.test.d.ts.map +0 -1
- package/dist/node/build/render.d.ts.map +0 -1
- package/dist/plugin-B-At85hl.js +0 -1
- /package/dist/{node/build → shared/utils}/html.test.d.ts +0 -0
|
@@ -0,0 +1,2358 @@
|
|
|
1
|
+
import { t as e } from "./rolldown-runtime-Dqa2HsxW.js";
|
|
2
|
+
import "./shared-DzTfF-_d.js";
|
|
3
|
+
import { i as t, n, s as r } from "./constants-B7b8AsH0.js";
|
|
4
|
+
import { r as i } from "./brand-CeSqpEQ2.js";
|
|
5
|
+
import "node:fs";
|
|
6
|
+
import a from "node:path";
|
|
7
|
+
import o from "node:fs/promises";
|
|
8
|
+
import { styleText as s } from "node:util";
|
|
9
|
+
import c, { stdin as l, stdout as u } from "node:process";
|
|
10
|
+
import d from "node:readline";
|
|
11
|
+
import "node:tty";
|
|
12
|
+
//#region ../../node_modules/.pnpm/js-yaml@5.2.3/node_modules/js-yaml/dist/js-yaml.mjs
|
|
13
|
+
var f = Symbol("NOT_RESOLVED"), p = Symbol("MERGE_KEY");
|
|
14
|
+
function m(e, t) {
|
|
15
|
+
return {
|
|
16
|
+
tagName: e,
|
|
17
|
+
nodeKind: "scalar",
|
|
18
|
+
implicit: t.implicit ?? !1,
|
|
19
|
+
matchByTagPrefix: t.matchByTagPrefix ?? !1,
|
|
20
|
+
implicitFirstChars: t.implicitFirstChars ?? null,
|
|
21
|
+
resolve: t.resolve,
|
|
22
|
+
identify: t.identify ?? null,
|
|
23
|
+
represent: t.represent ?? ((e) => String(e)),
|
|
24
|
+
representTagName: t.representTagName ?? null
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function h(e, t) {
|
|
28
|
+
let n = t.finalize === void 0;
|
|
29
|
+
return {
|
|
30
|
+
tagName: e,
|
|
31
|
+
nodeKind: "sequence",
|
|
32
|
+
implicit: !1,
|
|
33
|
+
matchByTagPrefix: t.matchByTagPrefix ?? !1,
|
|
34
|
+
create: t.create,
|
|
35
|
+
addItem: t.addItem,
|
|
36
|
+
finalize: t.finalize ?? ((e) => e),
|
|
37
|
+
carrierIsResult: n,
|
|
38
|
+
identify: t.identify ?? null,
|
|
39
|
+
represent: t.represent ?? ((e) => e),
|
|
40
|
+
representTagName: t.representTagName ?? null
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function g(e, t) {
|
|
44
|
+
let n = t.finalize === void 0;
|
|
45
|
+
return {
|
|
46
|
+
tagName: e,
|
|
47
|
+
nodeKind: "mapping",
|
|
48
|
+
implicit: !1,
|
|
49
|
+
matchByTagPrefix: t.matchByTagPrefix ?? !1,
|
|
50
|
+
create: t.create,
|
|
51
|
+
addPair: t.addPair,
|
|
52
|
+
has: t.has,
|
|
53
|
+
keys: t.keys,
|
|
54
|
+
get: t.get,
|
|
55
|
+
finalize: t.finalize ?? ((e) => e),
|
|
56
|
+
carrierIsResult: n,
|
|
57
|
+
identify: t.identify ?? null,
|
|
58
|
+
represent: t.represent ?? ((e) => e),
|
|
59
|
+
representTagName: t.representTagName ?? null
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
var _ = m("tag:yaml.org,2002:str", {
|
|
63
|
+
resolve: (e) => e,
|
|
64
|
+
identify: (e) => typeof e == "string"
|
|
65
|
+
}), v = [
|
|
66
|
+
"",
|
|
67
|
+
"~",
|
|
68
|
+
"null",
|
|
69
|
+
"Null",
|
|
70
|
+
"NULL"
|
|
71
|
+
], y = m("tag:yaml.org,2002:null", {
|
|
72
|
+
implicit: !0,
|
|
73
|
+
implicitFirstChars: [
|
|
74
|
+
"",
|
|
75
|
+
"~",
|
|
76
|
+
"n",
|
|
77
|
+
"N"
|
|
78
|
+
],
|
|
79
|
+
resolve: (e) => v.indexOf(e) === -1 ? f : null,
|
|
80
|
+
identify: (e) => e === null,
|
|
81
|
+
represent: () => "null"
|
|
82
|
+
}), b = m("tag:yaml.org,2002:null", {
|
|
83
|
+
implicit: !0,
|
|
84
|
+
implicitFirstChars: ["n"],
|
|
85
|
+
resolve: (e, t) => e === "null" || t && e === "" ? null : f,
|
|
86
|
+
identify: (e) => e === null,
|
|
87
|
+
represent: () => "null"
|
|
88
|
+
}), x = [
|
|
89
|
+
"",
|
|
90
|
+
"~",
|
|
91
|
+
"null",
|
|
92
|
+
"Null",
|
|
93
|
+
"NULL"
|
|
94
|
+
], S = m("tag:yaml.org,2002:null", {
|
|
95
|
+
implicit: !0,
|
|
96
|
+
implicitFirstChars: [
|
|
97
|
+
"",
|
|
98
|
+
"~",
|
|
99
|
+
"n",
|
|
100
|
+
"N"
|
|
101
|
+
],
|
|
102
|
+
resolve: (e) => x.indexOf(e) === -1 ? f : null,
|
|
103
|
+
identify: (e) => e === null,
|
|
104
|
+
represent: () => "null"
|
|
105
|
+
}), ee = [
|
|
106
|
+
"true",
|
|
107
|
+
"True",
|
|
108
|
+
"TRUE"
|
|
109
|
+
], te = [
|
|
110
|
+
"false",
|
|
111
|
+
"False",
|
|
112
|
+
"FALSE"
|
|
113
|
+
], ne = m("tag:yaml.org,2002:bool", {
|
|
114
|
+
implicit: !0,
|
|
115
|
+
implicitFirstChars: [
|
|
116
|
+
"t",
|
|
117
|
+
"T",
|
|
118
|
+
"f",
|
|
119
|
+
"F"
|
|
120
|
+
],
|
|
121
|
+
resolve: (e) => ee.indexOf(e) !== -1 || te.indexOf(e) === -1 && f,
|
|
122
|
+
identify: (e) => Object.prototype.toString.call(e) === "[object Boolean]",
|
|
123
|
+
represent: (e) => e ? "true" : "false"
|
|
124
|
+
}), re = ["true"], ie = ["false"], ae = m("tag:yaml.org,2002:bool", {
|
|
125
|
+
implicit: !0,
|
|
126
|
+
implicitFirstChars: ["t", "f"],
|
|
127
|
+
resolve: (e) => re.indexOf(e) !== -1 || ie.indexOf(e) === -1 && f,
|
|
128
|
+
identify: (e) => Object.prototype.toString.call(e) === "[object Boolean]",
|
|
129
|
+
represent: (e) => e ? "true" : "false"
|
|
130
|
+
}), oe = [
|
|
131
|
+
"true",
|
|
132
|
+
"True",
|
|
133
|
+
"TRUE",
|
|
134
|
+
"y",
|
|
135
|
+
"Y",
|
|
136
|
+
"yes",
|
|
137
|
+
"Yes",
|
|
138
|
+
"YES",
|
|
139
|
+
"on",
|
|
140
|
+
"On",
|
|
141
|
+
"ON"
|
|
142
|
+
], se = [
|
|
143
|
+
"false",
|
|
144
|
+
"False",
|
|
145
|
+
"FALSE",
|
|
146
|
+
"n",
|
|
147
|
+
"N",
|
|
148
|
+
"no",
|
|
149
|
+
"No",
|
|
150
|
+
"NO",
|
|
151
|
+
"off",
|
|
152
|
+
"Off",
|
|
153
|
+
"OFF"
|
|
154
|
+
], ce = m("tag:yaml.org,2002:bool", {
|
|
155
|
+
implicit: !0,
|
|
156
|
+
implicitFirstChars: [
|
|
157
|
+
"y",
|
|
158
|
+
"Y",
|
|
159
|
+
"n",
|
|
160
|
+
"N",
|
|
161
|
+
"t",
|
|
162
|
+
"T",
|
|
163
|
+
"f",
|
|
164
|
+
"F",
|
|
165
|
+
"o",
|
|
166
|
+
"O"
|
|
167
|
+
],
|
|
168
|
+
resolve: (e) => oe.indexOf(e) !== -1 || se.indexOf(e) === -1 && f,
|
|
169
|
+
identify: (e) => Object.prototype.toString.call(e) === "[object Boolean]",
|
|
170
|
+
represent: (e) => e ? "true" : "false"
|
|
171
|
+
}), le = /* @__PURE__ */ RegExp("^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$"), ue = /* @__PURE__ */ RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");
|
|
172
|
+
function de(e) {
|
|
173
|
+
let t = e, n = 1;
|
|
174
|
+
return (t[0] === "-" || t[0] === "+") && (t[0] === "-" && (n = -1), t = t.slice(1)), t.startsWith("0b") ? n * parseInt(t.slice(2), 2) : t.startsWith("0o") ? n * parseInt(t.slice(2), 8) : t.startsWith("0x") ? n * parseInt(t.slice(2), 16) : n * parseInt(t, 10);
|
|
175
|
+
}
|
|
176
|
+
function fe(e, t) {
|
|
177
|
+
if (t) {
|
|
178
|
+
if (!ue.test(e)) return f;
|
|
179
|
+
} else if (!le.test(e)) return f;
|
|
180
|
+
let n = de(e);
|
|
181
|
+
return Number.isFinite(n) ? n : f;
|
|
182
|
+
}
|
|
183
|
+
var pe = m("tag:yaml.org,2002:int", {
|
|
184
|
+
implicit: !0,
|
|
185
|
+
implicitFirstChars: [
|
|
186
|
+
"-",
|
|
187
|
+
"+",
|
|
188
|
+
..."0123456789"
|
|
189
|
+
],
|
|
190
|
+
resolve: fe,
|
|
191
|
+
identify: (e) => Number.isInteger(e) && !Object.is(e, -0) && e.toString(10).indexOf("e") < 0,
|
|
192
|
+
represent: (e) => e.toString(10)
|
|
193
|
+
}), me = /* @__PURE__ */ RegExp("^-?(?:0|[1-9][0-9]*)$"), he = /* @__PURE__ */ RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");
|
|
194
|
+
function ge(e) {
|
|
195
|
+
let t = e, n = 1;
|
|
196
|
+
return (t[0] === "-" || t[0] === "+") && (t[0] === "-" && (n = -1), t = t.slice(1)), t.startsWith("0b") ? n * parseInt(t.slice(2), 2) : t.startsWith("0o") ? n * parseInt(t.slice(2), 8) : t.startsWith("0x") ? n * parseInt(t.slice(2), 16) : n * parseInt(t, 10);
|
|
197
|
+
}
|
|
198
|
+
function _e(e, t) {
|
|
199
|
+
if (t) {
|
|
200
|
+
if (!he.test(e)) return f;
|
|
201
|
+
} else if (!me.test(e)) return f;
|
|
202
|
+
let n = ge(e);
|
|
203
|
+
return Number.isFinite(n) ? n : f;
|
|
204
|
+
}
|
|
205
|
+
var ve = m("tag:yaml.org,2002:int", {
|
|
206
|
+
implicit: !0,
|
|
207
|
+
implicitFirstChars: ["-", ..."0123456789"],
|
|
208
|
+
resolve: _e,
|
|
209
|
+
identify: (e) => Number.isInteger(e) && !Object.is(e, -0) && e.toString(10).indexOf("e") < 0,
|
|
210
|
+
represent: (e) => e.toString(10)
|
|
211
|
+
}), ye = /* @__PURE__ */ RegExp("^(?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?0x[0-9a-fA-F_]+|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+|[-+]?(?:0|[1-9][0-9_]*))$");
|
|
212
|
+
function be(e) {
|
|
213
|
+
let t = e.replace(/_/g, ""), n = 1;
|
|
214
|
+
if ((t[0] === "-" || t[0] === "+") && (t[0] === "-" && (n = -1), t = t.slice(1)), t.startsWith("0b")) return n * parseInt(t.slice(2), 2);
|
|
215
|
+
if (t.startsWith("0x")) return n * parseInt(t.slice(2), 16);
|
|
216
|
+
if (t.includes(":")) {
|
|
217
|
+
let e = 0;
|
|
218
|
+
for (let n of t.split(":")) e = e * 60 + Number(n);
|
|
219
|
+
return n * e;
|
|
220
|
+
}
|
|
221
|
+
return t !== "0" && t[0] === "0" ? n * parseInt(t, 8) : n * parseInt(t, 10);
|
|
222
|
+
}
|
|
223
|
+
function xe(e) {
|
|
224
|
+
if (!ye.test(e)) return f;
|
|
225
|
+
let t = be(e);
|
|
226
|
+
return Number.isFinite(t) ? t : f;
|
|
227
|
+
}
|
|
228
|
+
var Se = m("tag:yaml.org,2002:int", {
|
|
229
|
+
implicit: !0,
|
|
230
|
+
implicitFirstChars: [
|
|
231
|
+
"-",
|
|
232
|
+
"+",
|
|
233
|
+
..."0123456789"
|
|
234
|
+
],
|
|
235
|
+
resolve: xe,
|
|
236
|
+
identify: (e) => Number.isInteger(e) && !Object.is(e, -0) && e.toString(10).indexOf("e") < 0,
|
|
237
|
+
represent: (e) => e.toString(10)
|
|
238
|
+
}), Ce = /* @__PURE__ */ RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"), we = /* @__PURE__ */ RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
|
|
239
|
+
function Te(e) {
|
|
240
|
+
if (!Ce.test(e)) return f;
|
|
241
|
+
let t = e.toLowerCase(), n = t[0] === "-" ? -1 : 1;
|
|
242
|
+
if ("+-".includes(t[0]) && (t = t.slice(1)), t === ".inf") return n === 1 ? Infinity : -Infinity;
|
|
243
|
+
if (t === ".nan") return NaN;
|
|
244
|
+
let r = n * parseFloat(t);
|
|
245
|
+
return Number.isFinite(r) || we.test(e) ? r : f;
|
|
246
|
+
}
|
|
247
|
+
function Ee(e) {
|
|
248
|
+
if (isNaN(e)) return ".nan";
|
|
249
|
+
if (e === Infinity) return ".inf";
|
|
250
|
+
if (e === -Infinity) return "-.inf";
|
|
251
|
+
if (Object.is(e, -0)) return "-0.0";
|
|
252
|
+
let t = e.toString(10);
|
|
253
|
+
return /^[-+]?[0-9]+e/.test(t) ? t.replace("e", ".e") : t;
|
|
254
|
+
}
|
|
255
|
+
var De = m("tag:yaml.org,2002:float", {
|
|
256
|
+
implicit: !0,
|
|
257
|
+
implicitFirstChars: [
|
|
258
|
+
"-",
|
|
259
|
+
"+",
|
|
260
|
+
".",
|
|
261
|
+
..."0123456789"
|
|
262
|
+
],
|
|
263
|
+
resolve: Te,
|
|
264
|
+
identify: (e) => typeof e == "number" && (!Number.isInteger(e) || Object.is(e, -0) || e.toString(10).indexOf("e") >= 0),
|
|
265
|
+
represent: Ee
|
|
266
|
+
}), Oe = /* @__PURE__ */ RegExp("^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$"), ke = /* @__PURE__ */ RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
|
|
267
|
+
function Ae(e, t) {
|
|
268
|
+
if (t) {
|
|
269
|
+
if (!ke.test(e)) return f;
|
|
270
|
+
let t = e.toLowerCase(), n = t[0] === "-" ? -1 : 1;
|
|
271
|
+
if ("+-".includes(t[0]) && (t = t.slice(1)), t === ".inf") return n === 1 ? Infinity : -Infinity;
|
|
272
|
+
if (t === ".nan") return NaN;
|
|
273
|
+
let r = n * parseFloat(t);
|
|
274
|
+
return Number.isFinite(r) ? r : f;
|
|
275
|
+
}
|
|
276
|
+
if (!Oe.test(e)) return f;
|
|
277
|
+
let n = Number(e);
|
|
278
|
+
return Number.isFinite(n) ? n : f;
|
|
279
|
+
}
|
|
280
|
+
function je(e) {
|
|
281
|
+
if (isNaN(e)) return ".nan";
|
|
282
|
+
if (e === Infinity) return ".inf";
|
|
283
|
+
if (e === -Infinity) return "-.inf";
|
|
284
|
+
if (Object.is(e, -0)) return "-0.0";
|
|
285
|
+
let t = e.toString(10);
|
|
286
|
+
return /^[-+]?[0-9]+e/.test(t) ? t.replace("e", ".e") : t;
|
|
287
|
+
}
|
|
288
|
+
var Me = m("tag:yaml.org,2002:float", {
|
|
289
|
+
implicit: !0,
|
|
290
|
+
implicitFirstChars: ["-", ..."0123456789"],
|
|
291
|
+
resolve: Ae,
|
|
292
|
+
identify: (e) => typeof e == "number" && (!Number.isInteger(e) || Object.is(e, -0) || e.toString(10).indexOf("e") >= 0),
|
|
293
|
+
represent: je
|
|
294
|
+
}), Ne = /* @__PURE__ */ RegExp("^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\.[0-9_]*)(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"), Pe = /* @__PURE__ */ RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
|
|
295
|
+
function Fe(e) {
|
|
296
|
+
if (!Ne.test(e)) return f;
|
|
297
|
+
let t = e.toLowerCase().replace(/_/g, ""), n = t[0] === "-" ? -1 : 1;
|
|
298
|
+
if ("+-".includes(t[0]) && (t = t.slice(1)), t === ".inf") return n === 1 ? Infinity : -Infinity;
|
|
299
|
+
if (t === ".nan") return NaN;
|
|
300
|
+
let r = 0;
|
|
301
|
+
if (t.includes(":")) {
|
|
302
|
+
for (let e of t.split(":")) r = r * 60 + Number(e);
|
|
303
|
+
r *= n;
|
|
304
|
+
} else r = n * parseFloat(t);
|
|
305
|
+
return Number.isFinite(r) || Pe.test(e) ? r : f;
|
|
306
|
+
}
|
|
307
|
+
function Ie(e) {
|
|
308
|
+
if (isNaN(e)) return ".nan";
|
|
309
|
+
if (e === Infinity) return ".inf";
|
|
310
|
+
if (e === -Infinity) return "-.inf";
|
|
311
|
+
if (Object.is(e, -0)) return "-0.0";
|
|
312
|
+
let t = e.toString(10);
|
|
313
|
+
return /^[-+]?[0-9]+e/.test(t) ? t.replace("e", ".e") : t;
|
|
314
|
+
}
|
|
315
|
+
var Le = m("tag:yaml.org,2002:float", {
|
|
316
|
+
implicit: !0,
|
|
317
|
+
implicitFirstChars: [
|
|
318
|
+
"-",
|
|
319
|
+
"+",
|
|
320
|
+
".",
|
|
321
|
+
..."0123456789"
|
|
322
|
+
],
|
|
323
|
+
resolve: Fe,
|
|
324
|
+
identify: (e) => typeof e == "number" && (!Number.isInteger(e) || Object.is(e, -0) || e.toString(10).indexOf("e") >= 0),
|
|
325
|
+
represent: Ie
|
|
326
|
+
}), Re = m("tag:yaml.org,2002:merge", {
|
|
327
|
+
implicit: !0,
|
|
328
|
+
implicitFirstChars: ["<"],
|
|
329
|
+
resolve: (e, t) => e === "<<" || t && e === "" ? p : f
|
|
330
|
+
}), ze = /^[A-Za-z0-9+/]*={0,2}$/;
|
|
331
|
+
function Be(e) {
|
|
332
|
+
let t = e.replace(/\s/g, "");
|
|
333
|
+
if (t.length % 4 != 0 || !ze.test(t)) return f;
|
|
334
|
+
let n = atob(t), r = new Uint8Array(n.length);
|
|
335
|
+
for (let e = 0; e < n.length; e++) r[e] = n.charCodeAt(e);
|
|
336
|
+
return r;
|
|
337
|
+
}
|
|
338
|
+
function Ve(e) {
|
|
339
|
+
let t = "";
|
|
340
|
+
for (let n = 0; n < e.length; n++) t += String.fromCharCode(e[n]);
|
|
341
|
+
return btoa(t);
|
|
342
|
+
}
|
|
343
|
+
var He = m("tag:yaml.org,2002:binary", {
|
|
344
|
+
resolve: Be,
|
|
345
|
+
identify: (e) => Object.prototype.toString.call(e) === "[object Uint8Array]",
|
|
346
|
+
represent: Ve
|
|
347
|
+
}), Ue = /* @__PURE__ */ RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"), We = /* @__PURE__ */ RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");
|
|
348
|
+
function Ge(e, t, n, r = 0, i = 0, a = 0, o = 0) {
|
|
349
|
+
let s = new Date(Date.UTC(e, t, n, r, i, a, o));
|
|
350
|
+
return s.setUTCFullYear(e, t, n), s;
|
|
351
|
+
}
|
|
352
|
+
function Ke(e) {
|
|
353
|
+
let t = Ue.exec(e);
|
|
354
|
+
if (t === null && (t = We.exec(e)), t === null) return f;
|
|
355
|
+
let n = +t[1], r = t[2] - 1, i = +t[3];
|
|
356
|
+
if (!t[4]) {
|
|
357
|
+
let e = Ge(n, r, i);
|
|
358
|
+
return e.getUTCFullYear() !== n || e.getUTCMonth() !== r || e.getUTCDate() !== i ? f : e;
|
|
359
|
+
}
|
|
360
|
+
let a = +t[4], o = +t[5], s = +t[6], c = 0;
|
|
361
|
+
if (a > 23 || o > 59 || s > 59) return f;
|
|
362
|
+
if (t[7]) {
|
|
363
|
+
let e = t[7].slice(0, 3);
|
|
364
|
+
for (; e.length < 3;) e += "0";
|
|
365
|
+
c = +e;
|
|
366
|
+
}
|
|
367
|
+
let l = Ge(n, r, i, a, o, s, c);
|
|
368
|
+
if (l.getUTCFullYear() !== n || l.getUTCMonth() !== r || l.getUTCDate() !== i) return f;
|
|
369
|
+
if (t[9]) {
|
|
370
|
+
let e = +t[10], n = +(t[11] || 0);
|
|
371
|
+
if (e > 23 || n > 59) return f;
|
|
372
|
+
let r = (e * 60 + n) * 6e4;
|
|
373
|
+
l.setTime(l.getTime() - (t[9] === "-" ? -r : r));
|
|
374
|
+
}
|
|
375
|
+
return l;
|
|
376
|
+
}
|
|
377
|
+
var qe = m("tag:yaml.org,2002:timestamp", {
|
|
378
|
+
implicit: !0,
|
|
379
|
+
implicitFirstChars: [..."0123456789"],
|
|
380
|
+
resolve: Ke,
|
|
381
|
+
identify: (e) => e instanceof Date,
|
|
382
|
+
represent: (e) => e.toISOString()
|
|
383
|
+
}), Je = h("tag:yaml.org,2002:seq", {
|
|
384
|
+
create: () => [],
|
|
385
|
+
addItem: (e, t) => {
|
|
386
|
+
e.push(t);
|
|
387
|
+
},
|
|
388
|
+
identify: Array.isArray
|
|
389
|
+
});
|
|
390
|
+
function C(e) {
|
|
391
|
+
if (typeof e != "object" || !e || Array.isArray(e)) return !1;
|
|
392
|
+
let t = Object.getPrototypeOf(e);
|
|
393
|
+
return t === null || t === Object.prototype;
|
|
394
|
+
}
|
|
395
|
+
function Ye(e, t) {
|
|
396
|
+
let n = {};
|
|
397
|
+
for (let r of t) e[r] !== void 0 && (n[r] = e[r]);
|
|
398
|
+
return n;
|
|
399
|
+
}
|
|
400
|
+
var Xe = h("tag:yaml.org,2002:omap", {
|
|
401
|
+
create: () => ({
|
|
402
|
+
list: [],
|
|
403
|
+
seen: /* @__PURE__ */ new Set()
|
|
404
|
+
}),
|
|
405
|
+
addItem: (e, t) => {
|
|
406
|
+
let n;
|
|
407
|
+
if (t instanceof Map) {
|
|
408
|
+
if (t.size !== 1) return "cannot resolve an ordered map item";
|
|
409
|
+
n = t.keys().next().value;
|
|
410
|
+
} else if (C(t)) {
|
|
411
|
+
let e = Object.keys(t);
|
|
412
|
+
if (e.length !== 1) return "cannot resolve an ordered map item";
|
|
413
|
+
n = e[0];
|
|
414
|
+
} else return "cannot resolve an ordered map item";
|
|
415
|
+
return e.seen.has(n) ? "duplicate key in ordered map" : (e.seen.add(n), e.list.push(t), "");
|
|
416
|
+
},
|
|
417
|
+
finalize: (e) => e.list
|
|
418
|
+
}), Ze = h("tag:yaml.org,2002:pairs", {
|
|
419
|
+
create: () => [],
|
|
420
|
+
addItem: (e, t) => {
|
|
421
|
+
if (t instanceof Map) return t.size === 1 ? (e.push(t.entries().next().value), "") : "cannot resolve a pairs item";
|
|
422
|
+
if (Object.prototype.toString.call(t) !== "[object Object]") return "cannot resolve a pairs item";
|
|
423
|
+
let n = t, r = Object.keys(n);
|
|
424
|
+
return r.length === 1 ? (e.push([r[0], n[r[0]]]), "") : "cannot resolve a pairs item";
|
|
425
|
+
}
|
|
426
|
+
}), Qe = g("tag:yaml.org,2002:map", {
|
|
427
|
+
create: () => ({}),
|
|
428
|
+
identify: C,
|
|
429
|
+
represent: (e) => {
|
|
430
|
+
let t = /* @__PURE__ */ new Map();
|
|
431
|
+
for (let n of Object.keys(e)) t.set(n, e[n]);
|
|
432
|
+
return t;
|
|
433
|
+
},
|
|
434
|
+
addPair: (e, t, n) => {
|
|
435
|
+
if (typeof t == "object" && t) return "object-based map does not support complex keys";
|
|
436
|
+
let r = String(t);
|
|
437
|
+
return r === "__proto__" ? Object.defineProperty(e, r, {
|
|
438
|
+
value: n,
|
|
439
|
+
enumerable: !0,
|
|
440
|
+
configurable: !0,
|
|
441
|
+
writable: !0
|
|
442
|
+
}) : e[r] = n, "";
|
|
443
|
+
},
|
|
444
|
+
has: (e, t) => typeof t == "object" && t ? !1 : Object.prototype.hasOwnProperty.call(e, String(t)),
|
|
445
|
+
keys: (e) => Object.keys(e),
|
|
446
|
+
get: (e, t) => {
|
|
447
|
+
let n = String(t);
|
|
448
|
+
return Object.prototype.hasOwnProperty.call(e, n) ? e[n] : null;
|
|
449
|
+
}
|
|
450
|
+
}), $e = g("tag:yaml.org,2002:set", {
|
|
451
|
+
create: () => /* @__PURE__ */ new Set(),
|
|
452
|
+
identify: (e) => e instanceof Set,
|
|
453
|
+
represent: (e) => {
|
|
454
|
+
let t = /* @__PURE__ */ new Map();
|
|
455
|
+
for (let n of e) t.set(n, null);
|
|
456
|
+
return t;
|
|
457
|
+
},
|
|
458
|
+
addPair: (e, t, n) => n === null ? (e.add(t), "") : "cannot resolve a set item",
|
|
459
|
+
has: (e, t) => e.has(t),
|
|
460
|
+
keys: (e) => e.keys(),
|
|
461
|
+
get: () => null
|
|
462
|
+
});
|
|
463
|
+
function et() {
|
|
464
|
+
return {
|
|
465
|
+
scalar: Object.create(null),
|
|
466
|
+
sequence: Object.create(null),
|
|
467
|
+
mapping: Object.create(null)
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
function tt() {
|
|
471
|
+
return {
|
|
472
|
+
scalar: [],
|
|
473
|
+
sequence: [],
|
|
474
|
+
mapping: []
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
function nt(e) {
|
|
478
|
+
let t = [];
|
|
479
|
+
for (let n of e) {
|
|
480
|
+
let e = t.length;
|
|
481
|
+
for (let r = 0; r < t.length; r++) {
|
|
482
|
+
let i = t[r];
|
|
483
|
+
if (i.nodeKind === n.nodeKind && i.tagName === n.tagName && i.matchByTagPrefix === n.matchByTagPrefix) {
|
|
484
|
+
e = r;
|
|
485
|
+
break;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
t[e] = n;
|
|
489
|
+
}
|
|
490
|
+
return t;
|
|
491
|
+
}
|
|
492
|
+
var w = class e {
|
|
493
|
+
tags;
|
|
494
|
+
implicitScalarTags;
|
|
495
|
+
implicitScalarByFirstChar;
|
|
496
|
+
implicitScalarAnyFirstChar;
|
|
497
|
+
defaultScalarTag;
|
|
498
|
+
defaultSequenceTag;
|
|
499
|
+
defaultMappingTag;
|
|
500
|
+
exact;
|
|
501
|
+
prefix;
|
|
502
|
+
constructor(e) {
|
|
503
|
+
let t = nt(e), n = [], r = et(), i = tt();
|
|
504
|
+
for (let e of t) {
|
|
505
|
+
if (e.nodeKind === "scalar" && e.implicit) {
|
|
506
|
+
if (e.matchByTagPrefix) throw Error("Implicit scalar tags cannot match by tag prefix");
|
|
507
|
+
n.push(e);
|
|
508
|
+
}
|
|
509
|
+
switch (e.nodeKind) {
|
|
510
|
+
case "scalar":
|
|
511
|
+
e.matchByTagPrefix ? i.scalar.push(e) : r.scalar[e.tagName] = e;
|
|
512
|
+
break;
|
|
513
|
+
case "sequence":
|
|
514
|
+
e.matchByTagPrefix ? i.sequence.push(e) : r.sequence[e.tagName] = e;
|
|
515
|
+
break;
|
|
516
|
+
case "mapping":
|
|
517
|
+
e.matchByTagPrefix ? i.mapping.push(e) : r.mapping[e.tagName] = e;
|
|
518
|
+
break;
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
let a = n.filter((e) => e.implicitFirstChars === null), o = /* @__PURE__ */ new Set();
|
|
522
|
+
for (let e of n) if (e.implicitFirstChars !== null) for (let t of e.implicitFirstChars) o.add(t);
|
|
523
|
+
let s = /* @__PURE__ */ new Map();
|
|
524
|
+
for (let e of o) s.set(e, n.filter((t) => t.implicitFirstChars === null || t.implicitFirstChars.indexOf(e) !== -1));
|
|
525
|
+
let c = r.scalar["tag:yaml.org,2002:str"];
|
|
526
|
+
if (!c) throw Error("schema does not define the default scalar tag (tag:yaml.org,2002:str)");
|
|
527
|
+
this.tags = t, this.implicitScalarTags = n, this.implicitScalarByFirstChar = s, this.implicitScalarAnyFirstChar = a, this.defaultScalarTag = c, this.defaultSequenceTag = r.sequence["tag:yaml.org,2002:seq"], this.defaultMappingTag = r.mapping["tag:yaml.org,2002:map"], this.exact = r, this.prefix = i;
|
|
528
|
+
}
|
|
529
|
+
withTags(...t) {
|
|
530
|
+
let n = [];
|
|
531
|
+
for (let e of t) n = n.concat(e);
|
|
532
|
+
return new e([...this.tags, ...n]);
|
|
533
|
+
}
|
|
534
|
+
}, rt = new w([
|
|
535
|
+
_,
|
|
536
|
+
Je,
|
|
537
|
+
Qe
|
|
538
|
+
]);
|
|
539
|
+
new w([
|
|
540
|
+
...rt.tags,
|
|
541
|
+
b,
|
|
542
|
+
ae,
|
|
543
|
+
ve,
|
|
544
|
+
Me
|
|
545
|
+
]);
|
|
546
|
+
var it = new w([
|
|
547
|
+
...rt.tags,
|
|
548
|
+
y,
|
|
549
|
+
ne,
|
|
550
|
+
pe,
|
|
551
|
+
De
|
|
552
|
+
]), at = new w([
|
|
553
|
+
...rt.tags,
|
|
554
|
+
S,
|
|
555
|
+
ce,
|
|
556
|
+
Se,
|
|
557
|
+
Le,
|
|
558
|
+
qe,
|
|
559
|
+
Re,
|
|
560
|
+
He,
|
|
561
|
+
Xe,
|
|
562
|
+
Ze,
|
|
563
|
+
$e
|
|
564
|
+
]);
|
|
565
|
+
g("tag:yaml.org,2002:map", {
|
|
566
|
+
create: () => /* @__PURE__ */ new Map(),
|
|
567
|
+
addPair: (e, t, n) => (e.set(t, n), ""),
|
|
568
|
+
has: (e, t) => e.has(t),
|
|
569
|
+
keys: (e) => e.keys(),
|
|
570
|
+
get: (e, t) => e.get(t),
|
|
571
|
+
identify: (e) => e instanceof Map || C(e),
|
|
572
|
+
represent: (e) => {
|
|
573
|
+
if (e instanceof Map) return e;
|
|
574
|
+
let t = /* @__PURE__ */ new Map(), n = e;
|
|
575
|
+
for (let e of Object.keys(n)) t.set(e, n[e]);
|
|
576
|
+
return t;
|
|
577
|
+
}
|
|
578
|
+
});
|
|
579
|
+
function ot(e) {
|
|
580
|
+
if (Array.isArray(e)) {
|
|
581
|
+
let t = Array.prototype.slice.call(e);
|
|
582
|
+
for (let e = 0; e < t.length; e++) {
|
|
583
|
+
if (Array.isArray(t[e])) return null;
|
|
584
|
+
typeof t[e] == "object" && Object.prototype.toString.call(t[e]) === "[object Object]" && (t[e] = "[object Object]");
|
|
585
|
+
}
|
|
586
|
+
return String(t);
|
|
587
|
+
}
|
|
588
|
+
return typeof e == "object" && Object.prototype.toString.call(e) === "[object Object]" ? "[object Object]" : String(e);
|
|
589
|
+
}
|
|
590
|
+
g("tag:yaml.org,2002:map", {
|
|
591
|
+
create: () => ({}),
|
|
592
|
+
identify: C,
|
|
593
|
+
represent: (e) => {
|
|
594
|
+
let t = /* @__PURE__ */ new Map();
|
|
595
|
+
for (let n of Object.keys(e)) t.set(n, e[n]);
|
|
596
|
+
return t;
|
|
597
|
+
},
|
|
598
|
+
addPair: (e, t, n) => {
|
|
599
|
+
let r = ot(t);
|
|
600
|
+
return r === null ? "nested arrays are not supported inside keys" : (r === "__proto__" ? Object.defineProperty(e, r, {
|
|
601
|
+
value: n,
|
|
602
|
+
enumerable: !0,
|
|
603
|
+
configurable: !0,
|
|
604
|
+
writable: !0
|
|
605
|
+
}) : e[r] = n, "");
|
|
606
|
+
},
|
|
607
|
+
has: (e, t) => {
|
|
608
|
+
let n = ot(t);
|
|
609
|
+
return n !== null && Object.prototype.hasOwnProperty.call(e, n);
|
|
610
|
+
},
|
|
611
|
+
keys: (e) => Object.keys(e),
|
|
612
|
+
get: (e, t) => {
|
|
613
|
+
let n = String(t);
|
|
614
|
+
return Object.prototype.hasOwnProperty.call(e, n) ? e[n] : null;
|
|
615
|
+
}
|
|
616
|
+
});
|
|
617
|
+
var st = {
|
|
618
|
+
maxLength: 79,
|
|
619
|
+
indent: 1,
|
|
620
|
+
linesBefore: 3,
|
|
621
|
+
linesAfter: 2
|
|
622
|
+
};
|
|
623
|
+
function ct(e, t, n, r, i) {
|
|
624
|
+
let a = "", o = "", s = Math.floor(i / 2) - 1;
|
|
625
|
+
return r - t > s && (a = " ... ", t = r - s + a.length), n - r > s && (o = " ...", n = r + s - o.length), {
|
|
626
|
+
str: a + e.slice(t, n).replace(/\t/g, "→") + o,
|
|
627
|
+
pos: r - t + a.length
|
|
628
|
+
};
|
|
629
|
+
}
|
|
630
|
+
function lt(e, t) {
|
|
631
|
+
return " ".repeat(Math.max(t - e.length, 0)) + e;
|
|
632
|
+
}
|
|
633
|
+
function ut(e, t) {
|
|
634
|
+
if (!e.buffer) return null;
|
|
635
|
+
let n = {
|
|
636
|
+
...st,
|
|
637
|
+
...t
|
|
638
|
+
}, r = /\r?\n|\r|\0/g, i = [0], a = [], o, s = -1;
|
|
639
|
+
for (; o = r.exec(e.buffer);) a.push(o.index), i.push(o.index + o[0].length), e.position <= o.index && s < 0 && (s = i.length - 2);
|
|
640
|
+
s < 0 && (s = i.length - 1);
|
|
641
|
+
let c = "", l = Math.min(e.line + n.linesAfter, a.length).toString().length, u = n.maxLength - (n.indent + l + 3);
|
|
642
|
+
for (let t = 1; t <= n.linesBefore && !(s - t < 0); t++) {
|
|
643
|
+
let r = ct(e.buffer, i[s - t], a[s - t], e.position - (i[s] - i[s - t]), u);
|
|
644
|
+
c = `${" ".repeat(n.indent)}${lt((e.line - t + 1).toString(), l)} | ${r.str}\n${c}`;
|
|
645
|
+
}
|
|
646
|
+
let d = ct(e.buffer, i[s], a[s], e.position, u);
|
|
647
|
+
c += `${" ".repeat(n.indent)}${lt((e.line + 1).toString(), l)} | ${d.str}\n`, c += `${"-".repeat(n.indent + l + 3 + d.pos)}^\n`;
|
|
648
|
+
for (let t = 1; t <= n.linesAfter && !(s + t >= a.length); t++) {
|
|
649
|
+
let r = ct(e.buffer, i[s + t], a[s + t], e.position - (i[s] - i[s + t]), u);
|
|
650
|
+
c += `${" ".repeat(n.indent)}${lt((e.line + t + 1).toString(), l)} | ${r.str}\n`;
|
|
651
|
+
}
|
|
652
|
+
return c.replace(/\n$/, "");
|
|
653
|
+
}
|
|
654
|
+
function dt(e, t) {
|
|
655
|
+
let n = "";
|
|
656
|
+
return e.mark ? (e.mark.name && (n += `in "${e.mark.name}" `), n += `(${e.mark.line + 1}:${e.mark.column + 1})`, !t && e.mark.snippet && (n += `\n\n${e.mark.snippet}`), `${e.reason} ${n}`) : e.reason;
|
|
657
|
+
}
|
|
658
|
+
var ft = class extends Error {
|
|
659
|
+
reason;
|
|
660
|
+
mark;
|
|
661
|
+
constructor(e, t) {
|
|
662
|
+
super(), this.name = "YAMLException", this.reason = e, this.mark = t, this.message = dt(this, !1), Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);
|
|
663
|
+
}
|
|
664
|
+
toString(e) {
|
|
665
|
+
return `${this.name}: ${dt(this, e)}`;
|
|
666
|
+
}
|
|
667
|
+
};
|
|
668
|
+
function pt(e, t, n, r = "") {
|
|
669
|
+
let i = 0, a = 0;
|
|
670
|
+
for (let n = 0; n < t; n++) {
|
|
671
|
+
let t = e.charCodeAt(n);
|
|
672
|
+
t === 10 ? (i++, a = n + 1) : t === 13 && (i++, e.charCodeAt(n + 1) === 10 && n++, a = n + 1);
|
|
673
|
+
}
|
|
674
|
+
let o = {
|
|
675
|
+
name: r,
|
|
676
|
+
buffer: e,
|
|
677
|
+
position: t,
|
|
678
|
+
line: i,
|
|
679
|
+
column: t - a
|
|
680
|
+
};
|
|
681
|
+
throw o.snippet = ut(o), new ft(n, o);
|
|
682
|
+
}
|
|
683
|
+
var mt = -1;
|
|
684
|
+
function ht(e) {
|
|
685
|
+
switch (e) {
|
|
686
|
+
case 48: return "\0";
|
|
687
|
+
case 97: return "\x07";
|
|
688
|
+
case 98: return "\b";
|
|
689
|
+
case 116: return " ";
|
|
690
|
+
case 9: return " ";
|
|
691
|
+
case 110: return "\n";
|
|
692
|
+
case 118: return "\v";
|
|
693
|
+
case 102: return "\f";
|
|
694
|
+
case 114: return "\r";
|
|
695
|
+
case 101: return "\x1B";
|
|
696
|
+
case 32: return " ";
|
|
697
|
+
case 34: return "\"";
|
|
698
|
+
case 47: return "/";
|
|
699
|
+
case 92: return "\\";
|
|
700
|
+
case 78: return "
";
|
|
701
|
+
case 95: return "\xA0";
|
|
702
|
+
case 76: return "\u2028";
|
|
703
|
+
case 80: return "\u2029";
|
|
704
|
+
default: return "";
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
var gt = Array(256), _t = Array(256);
|
|
708
|
+
for (let e = 0; e < 256; e++) gt[e] = +!!ht(e), _t[e] = ht(e);
|
|
709
|
+
function vt(e) {
|
|
710
|
+
return e <= 65535 ? String.fromCharCode(e) : String.fromCharCode((e - 65536 >> 10) + 55296, (e - 65536 & 1023) + 56320);
|
|
711
|
+
}
|
|
712
|
+
function yt(e) {
|
|
713
|
+
return e >= 48 && e <= 57 ? e - 48 : (e | 32) - 97 + 10;
|
|
714
|
+
}
|
|
715
|
+
function bt(e) {
|
|
716
|
+
return e === 120 ? 2 : e === 117 ? 4 : 8;
|
|
717
|
+
}
|
|
718
|
+
function xt(e, t, n) {
|
|
719
|
+
let r = 0;
|
|
720
|
+
for (; t < n;) {
|
|
721
|
+
let n = e.charCodeAt(t);
|
|
722
|
+
if (n === 10) r++, t++;
|
|
723
|
+
else if (n === 13) r++, t++, e.charCodeAt(t) === 10 && t++;
|
|
724
|
+
else if (n === 32 || n === 9) t++;
|
|
725
|
+
else break;
|
|
726
|
+
}
|
|
727
|
+
return {
|
|
728
|
+
position: t,
|
|
729
|
+
breaks: r
|
|
730
|
+
};
|
|
731
|
+
}
|
|
732
|
+
function St(e) {
|
|
733
|
+
return e === 1 ? " " : "\n".repeat(e - 1);
|
|
734
|
+
}
|
|
735
|
+
function Ct(e, t, n) {
|
|
736
|
+
let r = "", i = t, a = t, o = t;
|
|
737
|
+
for (; i < n;) {
|
|
738
|
+
let t = e.charCodeAt(i);
|
|
739
|
+
if (t === 10 || t === 13) {
|
|
740
|
+
r += e.slice(a, o);
|
|
741
|
+
let t = xt(e, i, n);
|
|
742
|
+
r += St(t.breaks), i = a = o = t.position;
|
|
743
|
+
} else i++, t !== 32 && t !== 9 && (o = i);
|
|
744
|
+
}
|
|
745
|
+
return r + e.slice(a, o);
|
|
746
|
+
}
|
|
747
|
+
function wt(e, t, n) {
|
|
748
|
+
let r = "", i = t, a = t, o = t;
|
|
749
|
+
for (; i < n;) {
|
|
750
|
+
let t = e.charCodeAt(i);
|
|
751
|
+
if (t === 39) r += e.slice(a, i) + "'", i += 2, a = o = i;
|
|
752
|
+
else if (t === 10 || t === 13) {
|
|
753
|
+
r += e.slice(a, o);
|
|
754
|
+
let t = xt(e, i, n);
|
|
755
|
+
r += St(t.breaks), i = a = o = t.position;
|
|
756
|
+
} else i++, t !== 32 && t !== 9 && (o = i);
|
|
757
|
+
}
|
|
758
|
+
return r + e.slice(a, n);
|
|
759
|
+
}
|
|
760
|
+
function Tt(e, t, n) {
|
|
761
|
+
let r = "", i = t, a = t, o = t;
|
|
762
|
+
for (; i < n;) {
|
|
763
|
+
let t = e.charCodeAt(i);
|
|
764
|
+
if (t === 92) {
|
|
765
|
+
r += e.slice(a, i), i++;
|
|
766
|
+
let t = e.charCodeAt(i);
|
|
767
|
+
if (t === 10 || t === 13) i = xt(e, i, n).position;
|
|
768
|
+
else if (t < 256 && gt[t]) r += _t[t], i++;
|
|
769
|
+
else {
|
|
770
|
+
let n = bt(t), a = 0;
|
|
771
|
+
for (; n > 0; n--) {
|
|
772
|
+
i++;
|
|
773
|
+
let t = yt(e.charCodeAt(i));
|
|
774
|
+
a = (a << 4) + t;
|
|
775
|
+
}
|
|
776
|
+
r += vt(a), i++;
|
|
777
|
+
}
|
|
778
|
+
a = o = i;
|
|
779
|
+
} else if (t === 10 || t === 13) {
|
|
780
|
+
r += e.slice(a, o);
|
|
781
|
+
let t = xt(e, i, n);
|
|
782
|
+
r += St(t.breaks), i = a = o = t.position;
|
|
783
|
+
} else i++, t !== 32 && t !== 9 && (o = i);
|
|
784
|
+
}
|
|
785
|
+
return r + e.slice(a, n);
|
|
786
|
+
}
|
|
787
|
+
function Et(e, t, n, r, i, a) {
|
|
788
|
+
let o = r < 0 ? 0 : r, s = e.slice(t, n).replace(/\r\n?/g, "\n"), c = s === "" ? [] : (s.endsWith("\n") ? s.slice(0, -1) : s).split("\n"), l = "", u = !1, d = 0, f = !1;
|
|
789
|
+
for (let e of c) {
|
|
790
|
+
let t = 0;
|
|
791
|
+
for (; t < o && e.charCodeAt(t) === 32;) t++;
|
|
792
|
+
if (r < 0 || t >= e.length) {
|
|
793
|
+
d++;
|
|
794
|
+
continue;
|
|
795
|
+
}
|
|
796
|
+
let n = e.slice(o), i = n.charCodeAt(0);
|
|
797
|
+
a ? i === 32 || i === 9 ? (f = !0, l += "\n".repeat(u ? 1 + d : d)) : f ? (f = !1, l += "\n".repeat(d + 1)) : d === 0 ? u && (l += " ") : l += "\n".repeat(d) : l += "\n".repeat(u ? 1 + d : d), l += n, u = !0, d = 0;
|
|
798
|
+
}
|
|
799
|
+
return i === 3 ? l += "\n".repeat(u ? 1 + d : d) : i !== 2 && u && (l += "\n"), l;
|
|
800
|
+
}
|
|
801
|
+
function Dt(e, t) {
|
|
802
|
+
if (t.valueStart === mt) return "";
|
|
803
|
+
let { valueStart: n, valueEnd: r } = t;
|
|
804
|
+
if (t.fast) return e.slice(n, r);
|
|
805
|
+
switch (t.style) {
|
|
806
|
+
case 2: return wt(e, n, r);
|
|
807
|
+
case 3: return Tt(e, n, r);
|
|
808
|
+
case 4: return Et(e, n, r, t.indent, t.chomping, !1);
|
|
809
|
+
case 5: return Et(e, n, r, t.indent, t.chomping, !0);
|
|
810
|
+
default: return Ct(e, n, r);
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
var Ot = Object.assign(Object.create(null), {
|
|
814
|
+
"!": "!",
|
|
815
|
+
"!!": "tag:yaml.org,2002:"
|
|
816
|
+
});
|
|
817
|
+
function kt(e, t) {
|
|
818
|
+
if (e.startsWith("!<") && e.endsWith(">")) return decodeURIComponent(e.slice(2, -1));
|
|
819
|
+
let n = e.indexOf("!", 1), r = n === -1 ? "!" : e.slice(0, n + 1), i = t?.[r] ?? Ot[r] ?? r;
|
|
820
|
+
return decodeURIComponent(i) + decodeURIComponent(e.slice(r.length));
|
|
821
|
+
}
|
|
822
|
+
var T = -1, At = {
|
|
823
|
+
filename: "",
|
|
824
|
+
schema: it,
|
|
825
|
+
json: !1,
|
|
826
|
+
maxTotalMergeKeys: 1e4,
|
|
827
|
+
maxAliases: -1
|
|
828
|
+
};
|
|
829
|
+
function jt(e) {
|
|
830
|
+
return "tagStart" in e && e.tagStart !== T ? e.tagStart : "anchorStart" in e && e.anchorStart !== T ? e.anchorStart : "valueStart" in e && e.valueStart !== T ? e.valueStart : "start" in e ? e.start : 0;
|
|
831
|
+
}
|
|
832
|
+
function E(e, t) {
|
|
833
|
+
pt(e.source, e.position, t, e.filename);
|
|
834
|
+
}
|
|
835
|
+
function Mt(e, t, n, r) {
|
|
836
|
+
try {
|
|
837
|
+
return n.finalize(r);
|
|
838
|
+
} catch (n) {
|
|
839
|
+
if (n instanceof ft) throw n;
|
|
840
|
+
pt(e.source, t, n instanceof Error ? n.message : String(n), e.filename);
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
function Nt(e, t, n) {
|
|
844
|
+
let r = e[n];
|
|
845
|
+
if (r) return r;
|
|
846
|
+
for (let e of t) if (n.startsWith(e.tagName)) return e;
|
|
847
|
+
}
|
|
848
|
+
function Pt(e, t, n, r, i) {
|
|
849
|
+
let a = Nt(t, n, r);
|
|
850
|
+
if (a) return a;
|
|
851
|
+
E(e, `unknown ${i} tag !<${r}>`);
|
|
852
|
+
}
|
|
853
|
+
function Ft(e, t) {
|
|
854
|
+
let n = Dt(e.source, t), r = t.tagStart === T ? "" : e.source.slice(t.tagStart, t.tagEnd), i = e.schema.defaultScalarTag;
|
|
855
|
+
if (r !== "") {
|
|
856
|
+
if (r === "!") return {
|
|
857
|
+
value: n,
|
|
858
|
+
tag: i
|
|
859
|
+
};
|
|
860
|
+
let t = kt(r, e.tagHandlers), a = Nt(e.schema.exact.scalar, e.schema.prefix.scalar, t);
|
|
861
|
+
if (a) {
|
|
862
|
+
let r = a.resolve(n, !0, t);
|
|
863
|
+
return r === f && E(e, `cannot resolve a node with !<${t}> explicit tag`), {
|
|
864
|
+
value: r,
|
|
865
|
+
tag: a
|
|
866
|
+
};
|
|
867
|
+
}
|
|
868
|
+
let o = Nt(e.schema.exact.mapping, e.schema.prefix.mapping, t) ?? Nt(e.schema.exact.sequence, e.schema.prefix.sequence, t);
|
|
869
|
+
if (o) {
|
|
870
|
+
n !== "" && E(e, `cannot resolve a node with !<${t}> explicit tag`);
|
|
871
|
+
let r = o.create(t);
|
|
872
|
+
return {
|
|
873
|
+
value: o.carrierIsResult ? r : Mt(e, e.position, o, r),
|
|
874
|
+
tag: o
|
|
875
|
+
};
|
|
876
|
+
}
|
|
877
|
+
E(e, `unknown scalar tag !<${t}>`);
|
|
878
|
+
}
|
|
879
|
+
if (t.style === 1) {
|
|
880
|
+
let t = e.schema.implicitScalarByFirstChar.get(n.charAt(0)) ?? e.schema.implicitScalarAnyFirstChar;
|
|
881
|
+
for (let e of t) {
|
|
882
|
+
let t = e.resolve(n, !1, e.tagName);
|
|
883
|
+
if (t !== f) return {
|
|
884
|
+
value: t,
|
|
885
|
+
tag: e
|
|
886
|
+
};
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
return {
|
|
890
|
+
value: i.resolve(n, !1, i.tagName),
|
|
891
|
+
tag: i
|
|
892
|
+
};
|
|
893
|
+
}
|
|
894
|
+
function It(e, t, n, r, i, a) {
|
|
895
|
+
let o = t.tagStart === T ? "" : e.source.slice(t.tagStart, t.tagEnd), s = o === "" || o === "!" ? i : kt(o, e.tagHandlers);
|
|
896
|
+
return {
|
|
897
|
+
tagName: s,
|
|
898
|
+
tag: Pt(e, n, r, s, a)
|
|
899
|
+
};
|
|
900
|
+
}
|
|
901
|
+
function Lt(e) {
|
|
902
|
+
return e.nodeKind === "mapping";
|
|
903
|
+
}
|
|
904
|
+
function Rt(e, t, n, r) {
|
|
905
|
+
for (let i of r.keys(n)) {
|
|
906
|
+
if (e.maxTotalMergeKeys !== -1 && ++e.totalMergeKeys > e.maxTotalMergeKeys && E(e, `merge keys exceeded maxTotalMergeKeys (${e.maxTotalMergeKeys})`), t.tag.has(t.value, i)) continue;
|
|
907
|
+
let a = t.tag.addPair(t.value, i, r.get(n, i));
|
|
908
|
+
a && E(e, a), (t.overridable ??= /* @__PURE__ */ new Set()).add(i);
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
function zt(e, t, n, r) {
|
|
912
|
+
if (e.position = t.keyPosition, Lt(r)) Rt(e, t, n, r);
|
|
913
|
+
else if (r.nodeKind === "sequence" && Array.isArray(n)) for (let r of n) Rt(e, t, r, t.tag);
|
|
914
|
+
else E(e, "cannot merge mappings; the provided source object is unacceptable");
|
|
915
|
+
}
|
|
916
|
+
function Bt(e, t, n, r, i) {
|
|
917
|
+
if (e.position = t.keyPosition, n === p) {
|
|
918
|
+
zt(e, t, r, i);
|
|
919
|
+
return;
|
|
920
|
+
}
|
|
921
|
+
!e.json && t.tag.has(t.value, n) && !t.overridable?.has(n) && E(e, "duplicated mapping key");
|
|
922
|
+
let a = t.tag.addPair(t.value, n, r);
|
|
923
|
+
a && E(e, a), t.overridable?.delete(n);
|
|
924
|
+
}
|
|
925
|
+
function Vt(e, t, n) {
|
|
926
|
+
let r = e.frames[e.frames.length - 1];
|
|
927
|
+
if (r.kind === "document") r.value = t, r.hasValue = !0;
|
|
928
|
+
else if (r.kind === "sequence") {
|
|
929
|
+
r.merge && (Lt(n) || E(e, "cannot merge mappings; the provided source object is unacceptable"));
|
|
930
|
+
let i = r.tag.addItem(r.value, t, r.index++);
|
|
931
|
+
i && E(e, i);
|
|
932
|
+
} else if (r.hasKey) {
|
|
933
|
+
let i = r.key;
|
|
934
|
+
r.key = void 0, r.hasKey = !1, Bt(e, r, i, t, n);
|
|
935
|
+
} else r.key = t, r.keyPosition = e.position, r.hasKey = !0;
|
|
936
|
+
}
|
|
937
|
+
function Ht(e, t, n, r, i) {
|
|
938
|
+
if (t.anchorStart !== T) {
|
|
939
|
+
let a = {
|
|
940
|
+
value: n,
|
|
941
|
+
tag: r,
|
|
942
|
+
isValueFinal: i
|
|
943
|
+
};
|
|
944
|
+
return e.anchors.set(e.source.slice(t.anchorStart, t.anchorEnd), a), a;
|
|
945
|
+
}
|
|
946
|
+
return null;
|
|
947
|
+
}
|
|
948
|
+
function Ut(e, t) {
|
|
949
|
+
let n = {
|
|
950
|
+
...At,
|
|
951
|
+
...t,
|
|
952
|
+
events: e,
|
|
953
|
+
documents: [],
|
|
954
|
+
eventIndex: 0,
|
|
955
|
+
position: 0,
|
|
956
|
+
frames: [],
|
|
957
|
+
anchors: /* @__PURE__ */ new Map(),
|
|
958
|
+
tagHandlers: Object.create(null),
|
|
959
|
+
totalMergeKeys: 0,
|
|
960
|
+
aliasCount: 0
|
|
961
|
+
};
|
|
962
|
+
for (; n.eventIndex < n.events.length;) {
|
|
963
|
+
let e = n.events[n.eventIndex++];
|
|
964
|
+
switch (n.position = jt(e), e.type) {
|
|
965
|
+
case 1:
|
|
966
|
+
n.anchors = /* @__PURE__ */ new Map(), n.aliasCount = 0, n.tagHandlers = Object.create(null);
|
|
967
|
+
for (let t of e.directives) t.kind === "tag" && (n.tagHandlers[t.handle] = t.prefix);
|
|
968
|
+
n.frames.push({
|
|
969
|
+
kind: "document",
|
|
970
|
+
position: n.position,
|
|
971
|
+
value: void 0,
|
|
972
|
+
hasValue: !1
|
|
973
|
+
});
|
|
974
|
+
break;
|
|
975
|
+
case 4: {
|
|
976
|
+
let { value: t, tag: r } = Ft(n, e);
|
|
977
|
+
Ht(n, e, t, r, !0), Vt(n, t, r);
|
|
978
|
+
break;
|
|
979
|
+
}
|
|
980
|
+
case 2: {
|
|
981
|
+
let t = It(n, e, n.schema.exact.sequence, n.schema.prefix.sequence, "tag:yaml.org,2002:seq", "sequence"), r = t.tag.create(t.tagName), i = Ht(n, e, r, t.tag, t.tag.carrierIsResult), a = n.frames[n.frames.length - 1], o = a !== void 0 && a.kind === "mapping" && a.hasKey && a.key === p;
|
|
982
|
+
n.frames.push({
|
|
983
|
+
kind: "sequence",
|
|
984
|
+
position: n.position,
|
|
985
|
+
value: r,
|
|
986
|
+
tag: t.tag,
|
|
987
|
+
anchor: i,
|
|
988
|
+
index: 0,
|
|
989
|
+
merge: o
|
|
990
|
+
});
|
|
991
|
+
break;
|
|
992
|
+
}
|
|
993
|
+
case 3: {
|
|
994
|
+
let t = It(n, e, n.schema.exact.mapping, n.schema.prefix.mapping, "tag:yaml.org,2002:map", "mapping"), r = t.tag.create(t.tagName), i = Ht(n, e, r, t.tag, t.tag.carrierIsResult);
|
|
995
|
+
n.frames.push({
|
|
996
|
+
kind: "mapping",
|
|
997
|
+
position: n.position,
|
|
998
|
+
value: r,
|
|
999
|
+
tag: t.tag,
|
|
1000
|
+
anchor: i,
|
|
1001
|
+
key: void 0,
|
|
1002
|
+
keyPosition: n.position,
|
|
1003
|
+
hasKey: !1,
|
|
1004
|
+
overridable: null
|
|
1005
|
+
});
|
|
1006
|
+
break;
|
|
1007
|
+
}
|
|
1008
|
+
case 5: {
|
|
1009
|
+
n.maxAliases !== -1 && ++n.aliasCount > n.maxAliases && E(n, `aliases exceeded maxAliases (${n.maxAliases})`);
|
|
1010
|
+
let t = n.source.slice(e.anchorStart, e.anchorEnd), r = n.anchors.get(t);
|
|
1011
|
+
r || E(n, `unidentified alias "${t}"`), r.isValueFinal || E(n, `recursive alias "${t}" is not supported for tag ${r.tag.tagName} because it uses finalize()`), Vt(n, r.value, r.tag);
|
|
1012
|
+
break;
|
|
1013
|
+
}
|
|
1014
|
+
case 6: {
|
|
1015
|
+
let e = n.frames.pop();
|
|
1016
|
+
if (e.kind === "mapping" && e.hasKey && (n.position = e.keyPosition, E(n, "incomplete mapping pair in event stream")), e.kind === "document") n.documents.push(e.value);
|
|
1017
|
+
else {
|
|
1018
|
+
let t = e.tag.carrierIsResult ? e.value : Mt(n, e.position, e.tag, e.value);
|
|
1019
|
+
e.anchor && (e.anchor.value = t, e.anchor.isValueFinal = !0), Vt(n, t, e.tag);
|
|
1020
|
+
}
|
|
1021
|
+
break;
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
return n.documents;
|
|
1026
|
+
}
|
|
1027
|
+
var D = -1, Wt = Object.prototype.hasOwnProperty, O = 1, Gt = 2, Kt = 3, k = 4, qt = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, Jt = /[,\[\]{}]/, Yt = /^(?:!|!!|![0-9A-Za-z-]+!)$/, Xt = String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]])`, Zt = String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$.~*'()_])`, Qt = RegExp(`^(?:${Xt})*$`), $t = RegExp(`^(?:${Zt})+$`), en = RegExp(`^(?:!(?:${Xt})*|${Zt}(?:${Xt})*)$`), tn = {
|
|
1028
|
+
filename: "",
|
|
1029
|
+
maxDepth: 100
|
|
1030
|
+
};
|
|
1031
|
+
function nn(e, t, n) {
|
|
1032
|
+
e.events.push({
|
|
1033
|
+
type: 1,
|
|
1034
|
+
explicitStart: t,
|
|
1035
|
+
explicitEnd: n,
|
|
1036
|
+
directives: e.directives
|
|
1037
|
+
});
|
|
1038
|
+
}
|
|
1039
|
+
function rn(e, t, n, r, i, a, o) {
|
|
1040
|
+
e.events.push({
|
|
1041
|
+
type: 2,
|
|
1042
|
+
start: t,
|
|
1043
|
+
anchorStart: n,
|
|
1044
|
+
anchorEnd: r,
|
|
1045
|
+
tagStart: i,
|
|
1046
|
+
tagEnd: a,
|
|
1047
|
+
style: o
|
|
1048
|
+
});
|
|
1049
|
+
}
|
|
1050
|
+
function an(e, t, n, r, i, a, o) {
|
|
1051
|
+
e.events.push({
|
|
1052
|
+
type: 3,
|
|
1053
|
+
start: t,
|
|
1054
|
+
anchorStart: n,
|
|
1055
|
+
anchorEnd: r,
|
|
1056
|
+
tagStart: i,
|
|
1057
|
+
tagEnd: a,
|
|
1058
|
+
style: o
|
|
1059
|
+
});
|
|
1060
|
+
}
|
|
1061
|
+
function on(e, t) {
|
|
1062
|
+
e.events.splice(t.eventsLength, 0, {
|
|
1063
|
+
type: 3,
|
|
1064
|
+
start: t.position,
|
|
1065
|
+
anchorStart: D,
|
|
1066
|
+
anchorEnd: D,
|
|
1067
|
+
tagStart: D,
|
|
1068
|
+
tagEnd: D,
|
|
1069
|
+
style: 2
|
|
1070
|
+
});
|
|
1071
|
+
}
|
|
1072
|
+
function A(e, t, n, r, i, a, o, s, c = 1, l = -1, u = !1) {
|
|
1073
|
+
e.events.push({
|
|
1074
|
+
type: 4,
|
|
1075
|
+
valueStart: t,
|
|
1076
|
+
valueEnd: n,
|
|
1077
|
+
anchorStart: r,
|
|
1078
|
+
anchorEnd: i,
|
|
1079
|
+
tagStart: a,
|
|
1080
|
+
tagEnd: o,
|
|
1081
|
+
style: s,
|
|
1082
|
+
chomping: c,
|
|
1083
|
+
indent: l,
|
|
1084
|
+
fast: u
|
|
1085
|
+
});
|
|
1086
|
+
}
|
|
1087
|
+
function sn(e, t, n) {
|
|
1088
|
+
e.events.push({
|
|
1089
|
+
type: 5,
|
|
1090
|
+
anchorStart: t,
|
|
1091
|
+
anchorEnd: n
|
|
1092
|
+
});
|
|
1093
|
+
}
|
|
1094
|
+
function j(e) {
|
|
1095
|
+
e.events.push({ type: 6 });
|
|
1096
|
+
}
|
|
1097
|
+
function M(e) {
|
|
1098
|
+
A(e, D, D, D, D, D, D, 1);
|
|
1099
|
+
}
|
|
1100
|
+
function cn() {
|
|
1101
|
+
return {
|
|
1102
|
+
anchorStart: D,
|
|
1103
|
+
anchorEnd: D,
|
|
1104
|
+
tagStart: D,
|
|
1105
|
+
tagEnd: D
|
|
1106
|
+
};
|
|
1107
|
+
}
|
|
1108
|
+
function N(e) {
|
|
1109
|
+
return {
|
|
1110
|
+
position: e.position,
|
|
1111
|
+
line: e.line,
|
|
1112
|
+
lineStart: e.lineStart,
|
|
1113
|
+
lineIndent: e.lineIndent,
|
|
1114
|
+
firstTabInLine: e.firstTabInLine,
|
|
1115
|
+
eventsLength: e.events.length
|
|
1116
|
+
};
|
|
1117
|
+
}
|
|
1118
|
+
function P(e, t) {
|
|
1119
|
+
e.position = t.position, e.line = t.line, e.lineStart = t.lineStart, e.lineIndent = t.lineIndent, e.firstTabInLine = t.firstTabInLine, e.events.length = t.eventsLength;
|
|
1120
|
+
}
|
|
1121
|
+
function F(e, t) {
|
|
1122
|
+
pt(e.input.slice(0, e.length), e.position, t, e.filename);
|
|
1123
|
+
}
|
|
1124
|
+
function I(e) {
|
|
1125
|
+
return e === 10 || e === 13;
|
|
1126
|
+
}
|
|
1127
|
+
function L(e) {
|
|
1128
|
+
return e === 9 || e === 32;
|
|
1129
|
+
}
|
|
1130
|
+
function R(e) {
|
|
1131
|
+
return L(e) || I(e);
|
|
1132
|
+
}
|
|
1133
|
+
function z(e) {
|
|
1134
|
+
return e === 0 || R(e);
|
|
1135
|
+
}
|
|
1136
|
+
function B(e) {
|
|
1137
|
+
return e === 44 || e === 91 || e === 93 || e === 123 || e === 125;
|
|
1138
|
+
}
|
|
1139
|
+
function ln(e) {
|
|
1140
|
+
return e >= 48 && e <= 57 ? e - 48 : -1;
|
|
1141
|
+
}
|
|
1142
|
+
function un(e) {
|
|
1143
|
+
if (e >= 48 && e <= 57) return e - 48;
|
|
1144
|
+
let t = e | 32;
|
|
1145
|
+
return t >= 97 && t <= 102 ? t - 97 + 10 : -1;
|
|
1146
|
+
}
|
|
1147
|
+
function dn(e) {
|
|
1148
|
+
return e === 120 ? 2 : e === 117 ? 4 : e === 85 ? 8 : 0;
|
|
1149
|
+
}
|
|
1150
|
+
function fn(e) {
|
|
1151
|
+
return e === 48 || e === 97 || e === 98 || e === 116 || e === 9 || e === 110 || e === 118 || e === 102 || e === 114 || e === 101 || e === 32 || e === 34 || e === 47 || e === 92 || e === 78 || e === 95 || e === 76 || e === 80;
|
|
1152
|
+
}
|
|
1153
|
+
function pn(e) {
|
|
1154
|
+
e.input.charCodeAt(e.position) === 10 ? e.position++ : (e.position++, e.input.charCodeAt(e.position) === 10 && e.position++), e.line++, e.lineStart = e.position, e.lineIndent = 0, e.firstTabInLine = -1;
|
|
1155
|
+
}
|
|
1156
|
+
function V(e, t) {
|
|
1157
|
+
let n = 0, r = e.input.charCodeAt(e.position), i = e.position === e.lineStart || R(e.input.charCodeAt(e.position - 1));
|
|
1158
|
+
for (; r !== 0;) {
|
|
1159
|
+
for (; L(r);) i = !0, r === 9 && e.firstTabInLine === -1 && (e.firstTabInLine = e.position), r = e.input.charCodeAt(++e.position);
|
|
1160
|
+
if (t && i && r === 35) do
|
|
1161
|
+
r = e.input.charCodeAt(++e.position);
|
|
1162
|
+
while (!I(r) && r !== 0);
|
|
1163
|
+
if (!I(r)) break;
|
|
1164
|
+
for (pn(e), n++, i = !0, r = e.input.charCodeAt(e.position); r === 32;) e.lineIndent++, r = e.input.charCodeAt(++e.position);
|
|
1165
|
+
}
|
|
1166
|
+
return n;
|
|
1167
|
+
}
|
|
1168
|
+
function H(e, t = e.position) {
|
|
1169
|
+
let n = e.input.charCodeAt(t);
|
|
1170
|
+
if ((n === 45 || n === 46) && n === e.input.charCodeAt(t + 1) && n === e.input.charCodeAt(t + 2)) {
|
|
1171
|
+
let n = e.input.charCodeAt(t + 3);
|
|
1172
|
+
return n === 0 || R(n);
|
|
1173
|
+
}
|
|
1174
|
+
return !1;
|
|
1175
|
+
}
|
|
1176
|
+
function mn(e) {
|
|
1177
|
+
let t = e.input.charCodeAt(e.position);
|
|
1178
|
+
for (; t !== 0 && !I(t);) t = e.input.charCodeAt(++e.position);
|
|
1179
|
+
}
|
|
1180
|
+
function hn(e, t, n) {
|
|
1181
|
+
qt.test(e.input.slice(t, n)) && F(e, "the stream contains non-printable characters");
|
|
1182
|
+
}
|
|
1183
|
+
function gn(e, t, n) {
|
|
1184
|
+
if (e.input.charCodeAt(e.position) !== 33) return !1;
|
|
1185
|
+
t.tagStart !== D && F(e, "duplication of a tag property");
|
|
1186
|
+
let r = e.position, i = !1, a = !1, o = "!", s = e.input.charCodeAt(++e.position);
|
|
1187
|
+
s === 60 ? (i = !0, s = e.input.charCodeAt(++e.position)) : s === 33 && (a = !0, o = "!!", s = e.input.charCodeAt(++e.position));
|
|
1188
|
+
let c = e.position, l;
|
|
1189
|
+
if (i) {
|
|
1190
|
+
for (; s !== 0 && s !== 62;) s = e.input.charCodeAt(++e.position);
|
|
1191
|
+
s !== 62 && F(e, "unexpected end of the stream within a verbatim tag"), l = e.input.slice(c, e.position), e.position++;
|
|
1192
|
+
} else {
|
|
1193
|
+
for (; s !== 0 && !R(s) && !(n && B(s));) s === 33 && (a ? F(e, "tag suffix cannot contain exclamation marks") : (o = e.input.slice(c - 1, e.position + 1), Yt.test(o) || F(e, "named tag handle cannot contain such characters"), a = !0, c = e.position + 1)), s = e.input.charCodeAt(++e.position);
|
|
1194
|
+
l = e.input.slice(c, e.position), Jt.test(l) && F(e, "tag suffix cannot contain flow indicator characters");
|
|
1195
|
+
}
|
|
1196
|
+
return l && !(i ? Qt.test(l) : $t.test(l)) && F(e, `tag name cannot contain such characters: ${l}`), !i && o !== "!" && o !== "!!" && !Wt.call(e.tagHandlers, o) && F(e, `undeclared tag handle "${o}"`), t.tagStart = r, t.tagEnd = e.position, !0;
|
|
1197
|
+
}
|
|
1198
|
+
function _n(e, t) {
|
|
1199
|
+
if (e.input.charCodeAt(e.position) !== 38) return !1;
|
|
1200
|
+
t.anchorStart !== D && F(e, "duplication of an anchor property"), e.position++;
|
|
1201
|
+
let n = e.position;
|
|
1202
|
+
for (; e.input.charCodeAt(e.position) !== 0 && !R(e.input.charCodeAt(e.position)) && !B(e.input.charCodeAt(e.position));) e.position++;
|
|
1203
|
+
return e.position === n && F(e, "name of an anchor node must contain at least one character"), t.anchorStart = n, t.anchorEnd = e.position, !0;
|
|
1204
|
+
}
|
|
1205
|
+
function vn(e, t) {
|
|
1206
|
+
if (e.input.charCodeAt(e.position) !== 42) return !1;
|
|
1207
|
+
(t.anchorStart !== D || t.tagStart !== D) && F(e, "alias node should not have any properties"), e.position++;
|
|
1208
|
+
let n = e.position;
|
|
1209
|
+
for (; e.input.charCodeAt(e.position) !== 0 && !R(e.input.charCodeAt(e.position)) && !B(e.input.charCodeAt(e.position));) e.position++;
|
|
1210
|
+
return e.position === n && F(e, "name of an alias node must contain at least one character"), sn(e, n, e.position), !0;
|
|
1211
|
+
}
|
|
1212
|
+
function yn(e, t) {
|
|
1213
|
+
V(e, !1), e.lineIndent < t && F(e, "deficient indentation");
|
|
1214
|
+
}
|
|
1215
|
+
function bn(e, t, n) {
|
|
1216
|
+
if (e.input.charCodeAt(e.position) !== 39) return !1;
|
|
1217
|
+
e.position++;
|
|
1218
|
+
let r = e.position, i = !0;
|
|
1219
|
+
for (; e.input.charCodeAt(e.position) !== 0;) {
|
|
1220
|
+
let a = e.input.charCodeAt(e.position);
|
|
1221
|
+
if (a === 39) {
|
|
1222
|
+
if (e.input.charCodeAt(e.position + 1) === 39) {
|
|
1223
|
+
i = !1, e.position += 2;
|
|
1224
|
+
continue;
|
|
1225
|
+
}
|
|
1226
|
+
let t = e.position;
|
|
1227
|
+
return e.position++, A(e, r, t, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, 2, 1, -1, i), !0;
|
|
1228
|
+
}
|
|
1229
|
+
I(a) ? (i = !1, yn(e, t)) : e.position === e.lineStart && H(e) ? F(e, "unexpected end of the document within a single quoted scalar") : a !== 9 && a < 32 ? F(e, "expected valid JSON character") : e.position++;
|
|
1230
|
+
}
|
|
1231
|
+
F(e, "unexpected end of the stream within a single quoted scalar");
|
|
1232
|
+
}
|
|
1233
|
+
function xn(e, t, n) {
|
|
1234
|
+
if (e.input.charCodeAt(e.position) !== 34) return !1;
|
|
1235
|
+
e.position++;
|
|
1236
|
+
let r = e.position, i = !0;
|
|
1237
|
+
for (; e.input.charCodeAt(e.position) !== 0;) {
|
|
1238
|
+
let a = e.input.charCodeAt(e.position);
|
|
1239
|
+
if (a === 34) {
|
|
1240
|
+
let t = e.position;
|
|
1241
|
+
return e.position++, A(e, r, t, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, 3, 1, -1, i), !0;
|
|
1242
|
+
}
|
|
1243
|
+
if (a === 92) {
|
|
1244
|
+
i = !1;
|
|
1245
|
+
let n = e.input.charCodeAt(++e.position);
|
|
1246
|
+
if (I(n)) yn(e, t);
|
|
1247
|
+
else if (fn(n)) e.position++;
|
|
1248
|
+
else {
|
|
1249
|
+
let t = dn(n);
|
|
1250
|
+
for (t === 0 && F(e, "unknown escape sequence"); t-- > 0;) e.position++, un(e.input.charCodeAt(e.position)) < 0 && F(e, "expected hexadecimal character");
|
|
1251
|
+
e.position++;
|
|
1252
|
+
}
|
|
1253
|
+
} else I(a) ? (i = !1, yn(e, t)) : e.position === e.lineStart && H(e) ? F(e, "unexpected end of the document within a double quoted scalar") : a !== 9 && a < 32 ? F(e, "expected valid JSON character") : e.position++;
|
|
1254
|
+
}
|
|
1255
|
+
F(e, "unexpected end of the stream within a double quoted scalar");
|
|
1256
|
+
}
|
|
1257
|
+
function Sn(e, t, n) {
|
|
1258
|
+
let r = e.input.charCodeAt(e.position), i = 1, a = -1, o = !1;
|
|
1259
|
+
if (r !== 124 && r !== 62) return !1;
|
|
1260
|
+
let s = r === 124 ? 4 : 5;
|
|
1261
|
+
for (e.position++; e.input.charCodeAt(e.position) !== 0;) {
|
|
1262
|
+
let n = e.input.charCodeAt(e.position), r = ln(n);
|
|
1263
|
+
if (n === 43 || n === 45) i !== 1 && F(e, "repeat of a chomping mode identifier"), i = n === 43 ? 3 : 2, e.position++;
|
|
1264
|
+
else if (r >= 0) r === 0 && F(e, "bad explicit indentation width of a block scalar; it cannot be less than one"), o && F(e, "repeat of an indentation width identifier"), a = t + r - 1, o = !0, e.position++;
|
|
1265
|
+
else break;
|
|
1266
|
+
}
|
|
1267
|
+
let c = !1;
|
|
1268
|
+
for (; L(e.input.charCodeAt(e.position));) c = !0, e.position++;
|
|
1269
|
+
c && e.input.charCodeAt(e.position) === 35 && mn(e), I(e.input.charCodeAt(e.position)) ? pn(e) : e.input.charCodeAt(e.position) !== 0 && F(e, "a line break is expected");
|
|
1270
|
+
let l = o ? a : -1, u = 0, d = e.position, f = e.position;
|
|
1271
|
+
for (; e.input.charCodeAt(e.position) !== 0;) {
|
|
1272
|
+
let n = e.position, r = 0;
|
|
1273
|
+
for (; e.input.charCodeAt(n + r) === 32;) r++;
|
|
1274
|
+
let i = e.input.charCodeAt(n + r);
|
|
1275
|
+
if (i === 0) {
|
|
1276
|
+
l >= 0 ? r > l && (f = n + r) : r > 0 && (f = n + r);
|
|
1277
|
+
break;
|
|
1278
|
+
}
|
|
1279
|
+
if (n === e.lineStart && H(e, n)) break;
|
|
1280
|
+
if (!o && l === -1 && I(i) && (u = Math.max(u, r)), !o && l === -1 && !I(i) && (i === 9 && r < t && (e.position = n + r, F(e, "tab characters must not be used in indentation")), r < u && (e.position = n + r, F(e, "bad indentation of a mapping entry"))), l === -1 && i !== 0 && !I(i) && r < t) {
|
|
1281
|
+
e.lineIndent = r, e.position = n + r;
|
|
1282
|
+
break;
|
|
1283
|
+
}
|
|
1284
|
+
!o && i !== 0 && !I(i) && l === -1 && (l = r);
|
|
1285
|
+
let a = l === -1 ? t + 1 : l;
|
|
1286
|
+
if (i !== 0 && !I(i) && r < a) {
|
|
1287
|
+
e.lineIndent = r, e.position = n + r;
|
|
1288
|
+
break;
|
|
1289
|
+
}
|
|
1290
|
+
mn(e), f = e.position, I(e.input.charCodeAt(e.position)) && (pn(e), f = e.position);
|
|
1291
|
+
}
|
|
1292
|
+
return hn(e, d, f), A(e, d, f, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, s, i, l), !0;
|
|
1293
|
+
}
|
|
1294
|
+
function Cn(e, t) {
|
|
1295
|
+
let n = e.input.charCodeAt(e.position), r = t === O;
|
|
1296
|
+
if (n === 0 || R(n) || n === 35 || n === 38 || n === 42 || n === 33 || n === 124 || n === 62 || n === 39 || n === 34 || n === 37 || n === 64 || n === 96 || r && B(n)) return !1;
|
|
1297
|
+
if (n === 63 || n === 45) {
|
|
1298
|
+
let t = e.input.charCodeAt(e.position + 1);
|
|
1299
|
+
if (z(t) || r && B(t)) return !1;
|
|
1300
|
+
}
|
|
1301
|
+
return !0;
|
|
1302
|
+
}
|
|
1303
|
+
function wn(e, t, n, r) {
|
|
1304
|
+
if (!Cn(e, n)) return !1;
|
|
1305
|
+
let i = e.position, a = e.position, o = e.input.charCodeAt(e.position), s = n === O, c = !1;
|
|
1306
|
+
for (; o !== 0 && !(e.position === e.lineStart && H(e));) {
|
|
1307
|
+
if (o === 58) {
|
|
1308
|
+
let t = e.input.charCodeAt(e.position + 1);
|
|
1309
|
+
if (z(t) || s && B(t)) break;
|
|
1310
|
+
} else if (o === 35) {
|
|
1311
|
+
if (R(e.input.charCodeAt(e.position - 1))) break;
|
|
1312
|
+
} else if (s && B(o)) break;
|
|
1313
|
+
else if (I(o)) {
|
|
1314
|
+
let n = e.position, r = e.line, i = e.lineStart, a = e.lineIndent;
|
|
1315
|
+
if (V(e, !1), e.lineIndent >= t) {
|
|
1316
|
+
c = !0, o = e.input.charCodeAt(e.position);
|
|
1317
|
+
continue;
|
|
1318
|
+
}
|
|
1319
|
+
e.position = n, e.line = r, e.lineStart = i, e.lineIndent = a;
|
|
1320
|
+
break;
|
|
1321
|
+
}
|
|
1322
|
+
L(o) || (a = e.position + 1), o = e.input.charCodeAt(++e.position);
|
|
1323
|
+
}
|
|
1324
|
+
return a === i ? !1 : (hn(e, i, a), A(e, i, a, r.anchorStart, r.anchorEnd, r.tagStart, r.tagEnd, 1, 1, -1, !c), !0);
|
|
1325
|
+
}
|
|
1326
|
+
function U(e, t) {
|
|
1327
|
+
let n = e.line;
|
|
1328
|
+
V(e, !0), (e.line > n && e.lineIndent < t || e.firstTabInLine !== -1 && e.lineIndent < t) && F(e, "deficient indentation");
|
|
1329
|
+
}
|
|
1330
|
+
function Tn(e, t, n) {
|
|
1331
|
+
let r = e.input.charCodeAt(e.position), i = r === 123, a = e.position, o = !0;
|
|
1332
|
+
if (r !== 91 && r !== 123) return !1;
|
|
1333
|
+
let s = i ? 125 : 93;
|
|
1334
|
+
for (i ? an(e, a, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, 2) : rn(e, a, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, 2), e.position++; e.input.charCodeAt(e.position) !== 0;) {
|
|
1335
|
+
U(e, t);
|
|
1336
|
+
let n = e.input.charCodeAt(e.position);
|
|
1337
|
+
if (n === s) return e.position++, j(e), !0;
|
|
1338
|
+
o ? n === 44 && F(e, "expected the node content, but found ','") : F(e, "missed comma between flow collection entries");
|
|
1339
|
+
let r = !1, a = !1;
|
|
1340
|
+
n === 63 && R(e.input.charCodeAt(e.position + 1)) && (r = a = !0, e.position += 1, U(e, t));
|
|
1341
|
+
let c = e.line, l = N(e), u = W(e, t, O, !1, !0);
|
|
1342
|
+
U(e, t), n = e.input.charCodeAt(e.position), (i || a || e.line === c) && n === 58 ? (r = !0, e.position++, U(e, t), i || on(e, l), u || M(e), W(e, t, O, !1, !0) || M(e), U(e, t), i || j(e)) : i && r ? (u || M(e), M(e)) : i ? M(e) : r && (on(e, l), u || M(e), M(e), j(e)), n = e.input.charCodeAt(e.position), n === 44 ? (o = !0, e.position++) : o = !1;
|
|
1343
|
+
}
|
|
1344
|
+
F(e, "unexpected end of the stream within a flow collection");
|
|
1345
|
+
}
|
|
1346
|
+
function En(e, t, n) {
|
|
1347
|
+
if (e.firstTabInLine !== -1 || e.input.charCodeAt(e.position) !== 45 || !z(e.input.charCodeAt(e.position + 1))) return !1;
|
|
1348
|
+
for (rn(e, e.position, n.anchorStart, n.anchorEnd, n.tagStart, n.tagEnd, 1); e.input.charCodeAt(e.position) === 45 && z(e.input.charCodeAt(e.position + 1));) {
|
|
1349
|
+
e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, F(e, "tab characters must not be used in indentation"));
|
|
1350
|
+
let n = e.line;
|
|
1351
|
+
e.position++;
|
|
1352
|
+
let r = V(e, !0) > 0;
|
|
1353
|
+
if (e.firstTabInLine !== -1 && e.input.charCodeAt(e.position) === 45 && z(e.input.charCodeAt(e.position + 1)) && F(e, "bad indentation of a sequence entry"), r && e.lineIndent <= t ? M(e) : W(e, t, Kt, !1, !0), V(e, !0), e.lineIndent < t || e.position >= e.length) break;
|
|
1354
|
+
e.lineIndent > t && F(e, "bad indentation of a sequence entry"), e.line === n && e.input.charCodeAt(e.position) === 45 && z(e.input.charCodeAt(e.position + 1)) && F(e, "bad indentation of a sequence entry");
|
|
1355
|
+
}
|
|
1356
|
+
return j(e), !0;
|
|
1357
|
+
}
|
|
1358
|
+
function Dn(e, t, n, r) {
|
|
1359
|
+
let i = !1, a = !1, o = !1, s = !1;
|
|
1360
|
+
if (e.firstTabInLine !== -1) return !1;
|
|
1361
|
+
let c = e.input.charCodeAt(e.position);
|
|
1362
|
+
for (; c !== 0;) {
|
|
1363
|
+
!i && e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, F(e, "tab characters must not be used in indentation"));
|
|
1364
|
+
let l = e.input.charCodeAt(e.position + 1), u = e.line;
|
|
1365
|
+
if ((c === 63 || c === 58) && z(l)) o ||= (an(e, e.position, r.anchorStart, r.anchorEnd, r.tagStart, r.tagEnd, 1), !0), c === 63 ? (i && M(e), a = !0, i = !0) : i ? i = !1 : (M(e), a = !0, i = !1), e.position += 1, s = !0;
|
|
1366
|
+
else {
|
|
1367
|
+
i &&= (M(e), !1);
|
|
1368
|
+
let t = N(e);
|
|
1369
|
+
if (!W(e, n, Gt, !1, !0)) break;
|
|
1370
|
+
if (e.line === u) {
|
|
1371
|
+
for (c = e.input.charCodeAt(e.position); L(c);) c = e.input.charCodeAt(++e.position);
|
|
1372
|
+
if (c === 58) {
|
|
1373
|
+
if (c = e.input.charCodeAt(++e.position), z(c) || F(e, "a whitespace character is expected after the key-value separator within a block mapping"), !o) {
|
|
1374
|
+
for (P(e, t), an(e, t.position, r.anchorStart, r.anchorEnd, r.tagStart, r.tagEnd, 1), o = !0, W(e, n, Gt, !1, !0), c = e.input.charCodeAt(e.position); L(c);) c = e.input.charCodeAt(++e.position);
|
|
1375
|
+
e.position++;
|
|
1376
|
+
}
|
|
1377
|
+
a = !0, i = !1, s = !1;
|
|
1378
|
+
} else if (a) F(e, "expected ':' after a mapping key");
|
|
1379
|
+
else return r.anchorStart !== D || r.tagStart !== D ? (P(e, t), !1) : !0;
|
|
1380
|
+
} else if (a) F(e, "can not read a block mapping entry; a multiline key may not be an implicit key");
|
|
1381
|
+
else return r.anchorStart !== D || r.tagStart !== D ? (P(e, t), !1) : !0;
|
|
1382
|
+
}
|
|
1383
|
+
if (W(e, t, k, !0, s) && (s = !1), i || (s &&= (M(e), !1)), V(e, !0), c = e.input.charCodeAt(e.position), (e.line === u || e.lineIndent > t) && c !== 0) F(e, "bad indentation of a mapping entry");
|
|
1384
|
+
else if (e.lineIndent < t) break;
|
|
1385
|
+
}
|
|
1386
|
+
return a ? (i && M(e), o && j(e), !0) : !1;
|
|
1387
|
+
}
|
|
1388
|
+
function W(e, t, n, r, i, a = !0) {
|
|
1389
|
+
e.depth >= e.maxDepth && F(e, `nesting exceeded maxDepth (${e.maxDepth})`), e.depth++;
|
|
1390
|
+
let o = 1, s = !1, c = !1, l = null, u = cn(), d = n === k || n === Kt, f = d, p = d;
|
|
1391
|
+
if (r && V(e, !0) && (s = !0, o = e.lineIndent > t ? 1 : e.lineIndent === t ? 0 : -1), o === 1) for (;;) {
|
|
1392
|
+
let r = e.input.charCodeAt(e.position), i = N(e);
|
|
1393
|
+
if (s && o !== 1 && (r === 33 || r === 38)) break;
|
|
1394
|
+
if (s && p && (u.tagStart !== D || u.anchorStart !== D) && (r === 33 || r === 38)) {
|
|
1395
|
+
let n = N(e), r = t + 1;
|
|
1396
|
+
if (Dn(e, e.position - e.lineStart, r, u) && e.events[n.eventsLength]?.type === 3) return e.depth--, !0;
|
|
1397
|
+
P(e, n);
|
|
1398
|
+
}
|
|
1399
|
+
if (s && (r === 33 && u.tagStart !== D || r === 38 && u.anchorStart !== D) || !gn(e, u, n === O) && !_n(e, u)) break;
|
|
1400
|
+
l === null && (l = i), V(e, !0) ? (s = !0, f = p, o = e.lineIndent > t ? 1 : e.lineIndent === t ? 0 : -1) : f = !1;
|
|
1401
|
+
}
|
|
1402
|
+
if (f &&= s || i, o === 1 || n === k) {
|
|
1403
|
+
let r = n === O || n === Gt ? t : t + 1, i = e.position - e.lineStart;
|
|
1404
|
+
if (o === 1) if (f && (En(e, i, u) || Dn(e, i, r, u)) || Tn(e, r, u)) c = !0;
|
|
1405
|
+
else {
|
|
1406
|
+
let t = e.input.charCodeAt(e.position);
|
|
1407
|
+
if (l !== null && a && p && !f && t !== 124 && t !== 62) {
|
|
1408
|
+
let t = N(e), n = l.position - l.lineStart;
|
|
1409
|
+
P(e, l), Dn(e, n, r, cn()) && e.events[t.eventsLength]?.type === 3 ? c = !0 : P(e, t);
|
|
1410
|
+
}
|
|
1411
|
+
!c && (d && Sn(e, r, u) || bn(e, r, u) || xn(e, r, u) || vn(e, u) || wn(e, r, n, u)) && (c = !0);
|
|
1412
|
+
}
|
|
1413
|
+
else o === 0 && (c = f && En(e, i, u));
|
|
1414
|
+
}
|
|
1415
|
+
return d &&= !c, !c && (u.anchorStart !== D || u.tagStart !== D || d) && (A(e, D, D, u.anchorStart, u.anchorEnd, u.tagStart, u.tagEnd, 1), c = !0), e.depth--, c || u.anchorStart !== D || u.tagStart !== D;
|
|
1416
|
+
}
|
|
1417
|
+
function On(e) {
|
|
1418
|
+
if (e.lineIndent > 0 || e.input.charCodeAt(e.position) !== 37) return !1;
|
|
1419
|
+
e.position++;
|
|
1420
|
+
let t = e.position;
|
|
1421
|
+
for (; e.input.charCodeAt(e.position) !== 0 && !R(e.input.charCodeAt(e.position));) e.position++;
|
|
1422
|
+
let n = e.input.slice(t, e.position), r = [];
|
|
1423
|
+
for (n.length === 0 && F(e, "directive name must not be less than one character in length"); e.input.charCodeAt(e.position) !== 0 && !I(e.input.charCodeAt(e.position));) {
|
|
1424
|
+
for (; L(e.input.charCodeAt(e.position));) e.position++;
|
|
1425
|
+
if (e.input.charCodeAt(e.position) === 35 || I(e.input.charCodeAt(e.position)) || e.input.charCodeAt(e.position) === 0) break;
|
|
1426
|
+
let t = e.position;
|
|
1427
|
+
for (; e.input.charCodeAt(e.position) !== 0 && !R(e.input.charCodeAt(e.position));) e.position++;
|
|
1428
|
+
r.push(e.input.slice(t, e.position));
|
|
1429
|
+
}
|
|
1430
|
+
if (I(e.input.charCodeAt(e.position)) && pn(e), n === "YAML") {
|
|
1431
|
+
e.directives.some((e) => e.kind === "yaml") && F(e, "duplication of %YAML directive"), r.length !== 1 && F(e, "YAML directive accepts exactly one argument");
|
|
1432
|
+
let t = /^([0-9]+)\.([0-9]+)$/.exec(r[0]);
|
|
1433
|
+
t === null && F(e, "ill-formed argument of the YAML directive"), parseInt(t[1], 10) !== 1 && F(e, "unacceptable YAML version of the document"), e.directives.push({
|
|
1434
|
+
kind: "yaml",
|
|
1435
|
+
version: r[0]
|
|
1436
|
+
});
|
|
1437
|
+
} else if (n === "TAG") {
|
|
1438
|
+
r.length !== 2 && F(e, "TAG directive accepts exactly two arguments");
|
|
1439
|
+
let [t, n] = r;
|
|
1440
|
+
Yt.test(t) || F(e, "ill-formed tag handle (first argument) of the TAG directive"), Wt.call(e.tagHandlers, t) && F(e, `there is a previously declared suffix for "${t}" tag handle`), en.test(n) || F(e, "ill-formed tag prefix (second argument) of the TAG directive"), e.tagHandlers[t] = n, e.directives.push({
|
|
1441
|
+
kind: "tag",
|
|
1442
|
+
handle: t,
|
|
1443
|
+
prefix: n
|
|
1444
|
+
});
|
|
1445
|
+
}
|
|
1446
|
+
return !0;
|
|
1447
|
+
}
|
|
1448
|
+
function kn(e) {
|
|
1449
|
+
e.directives = [], e.tagHandlers = Object.create(null);
|
|
1450
|
+
let t = !1;
|
|
1451
|
+
for (V(e, !0); On(e);) t = !0, V(e, !0);
|
|
1452
|
+
let n = !1, r = !1, i = !0;
|
|
1453
|
+
if (e.lineIndent === 0 && e.input.charCodeAt(e.position) === 45 && e.input.charCodeAt(e.position + 1) === 45 && e.input.charCodeAt(e.position + 2) === 45 && z(e.input.charCodeAt(e.position + 3))) {
|
|
1454
|
+
n = !0;
|
|
1455
|
+
let t = e.line;
|
|
1456
|
+
e.position += 3, V(e, !0), i = e.line > t;
|
|
1457
|
+
} else t && F(e, "directives end mark is expected");
|
|
1458
|
+
let a = e.events.length;
|
|
1459
|
+
if (!n && e.position === e.lineStart && e.input.charCodeAt(e.position) === 46 && H(e)) {
|
|
1460
|
+
e.position += 3, V(e, !0);
|
|
1461
|
+
return;
|
|
1462
|
+
}
|
|
1463
|
+
if (nn(e, n, !1), W(e, e.lineIndent - 1, k, !1, i, i) || M(e), V(e, !0), e.position === e.lineStart && H(e) && (r = e.input.charCodeAt(e.position) === 46, r)) {
|
|
1464
|
+
let t = e.line;
|
|
1465
|
+
e.position += 3, V(e, !0), e.line === t && e.position < e.length && F(e, "end of the stream or a document separator is expected");
|
|
1466
|
+
}
|
|
1467
|
+
let o = e.events[a];
|
|
1468
|
+
o?.type === 1 && (o.explicitEnd = r), j(e), !r && e.position < e.length && !(e.position === e.lineStart && H(e)) && F(e, "end of the stream or a document separator is expected");
|
|
1469
|
+
}
|
|
1470
|
+
function An(e, t) {
|
|
1471
|
+
let n = e.length, r = {
|
|
1472
|
+
...tn,
|
|
1473
|
+
...t,
|
|
1474
|
+
input: `${e}\0`,
|
|
1475
|
+
length: n,
|
|
1476
|
+
position: 0,
|
|
1477
|
+
line: 0,
|
|
1478
|
+
lineStart: 0,
|
|
1479
|
+
lineIndent: 0,
|
|
1480
|
+
firstTabInLine: -1,
|
|
1481
|
+
depth: 0,
|
|
1482
|
+
directives: [],
|
|
1483
|
+
tagHandlers: Object.create(null),
|
|
1484
|
+
events: []
|
|
1485
|
+
}, i = e.indexOf("\0");
|
|
1486
|
+
for (i !== -1 && pt(e, i, "null byte is not allowed in input", r.filename), r.input.charCodeAt(r.position) === 65279 && r.position++; r.position < r.length && (V(r, !0), !(r.position >= r.length));) {
|
|
1487
|
+
let e = r.position;
|
|
1488
|
+
kn(r), r.position === e && F(r, "can not read a document");
|
|
1489
|
+
}
|
|
1490
|
+
return r.events;
|
|
1491
|
+
}
|
|
1492
|
+
var jn = {
|
|
1493
|
+
...tn,
|
|
1494
|
+
...At
|
|
1495
|
+
};
|
|
1496
|
+
function Mn(e, t = {}) {
|
|
1497
|
+
let n = {
|
|
1498
|
+
...jn,
|
|
1499
|
+
...t
|
|
1500
|
+
}, r = String(e), i = Object.keys(tn), a = Object.keys(At);
|
|
1501
|
+
return Ut(An(r, Ye(n, i)), {
|
|
1502
|
+
...Ye(n, a),
|
|
1503
|
+
source: r
|
|
1504
|
+
});
|
|
1505
|
+
}
|
|
1506
|
+
function Nn(e, t) {
|
|
1507
|
+
let n = Mn(e, t);
|
|
1508
|
+
if (n.length === 0) throw new ft("expected a document, but the input is empty");
|
|
1509
|
+
if (n.length === 1) return n[0];
|
|
1510
|
+
throw new ft("expected a single document in the stream, but found more");
|
|
1511
|
+
}
|
|
1512
|
+
var G = {};
|
|
1513
|
+
G[0] = "\\0", G[7] = "\\a", G[8] = "\\b", G[9] = "\\t", G[10] = "\\n", G[11] = "\\v", G[12] = "\\f", G[13] = "\\r", G[27] = "\\e", G[34] = "\\\"", G[92] = "\\\\", G[133] = "\\N", G[160] = "\\_", G[8232] = "\\L", G[8233] = "\\P";
|
|
1514
|
+
var Pn = {
|
|
1515
|
+
indent: 2,
|
|
1516
|
+
seqNoIndent: !1,
|
|
1517
|
+
seqInlineFirst: !0,
|
|
1518
|
+
sortKeys: !1,
|
|
1519
|
+
lineWidth: 80,
|
|
1520
|
+
flowBracketPadding: !1,
|
|
1521
|
+
flowSkipCommaSpace: !1,
|
|
1522
|
+
flowSkipColonSpace: !1,
|
|
1523
|
+
quoteFlowKeys: !1,
|
|
1524
|
+
quoteStyle: "single",
|
|
1525
|
+
forceQuotes: !1,
|
|
1526
|
+
tagBeforeAnchor: !1
|
|
1527
|
+
};
|
|
1528
|
+
at.withTags({
|
|
1529
|
+
...Se,
|
|
1530
|
+
resolve: (e, t, n) => {
|
|
1531
|
+
let r = Se.resolve(e, t, n);
|
|
1532
|
+
return r === f ? pe.resolve(e, t, n) : r;
|
|
1533
|
+
}
|
|
1534
|
+
}, {
|
|
1535
|
+
...Le,
|
|
1536
|
+
resolve: (e, t, n) => {
|
|
1537
|
+
let r = Le.resolve(e, t, n);
|
|
1538
|
+
return r === f ? De.resolve(e, t, n) : r;
|
|
1539
|
+
}
|
|
1540
|
+
}), { ...Pn };
|
|
1541
|
+
//#endregion
|
|
1542
|
+
//#region ../../node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js
|
|
1543
|
+
var Fn = (() => {
|
|
1544
|
+
let e = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
|
|
1545
|
+
return (t) => {
|
|
1546
|
+
let n = 0;
|
|
1547
|
+
for (e.lastIndex = 0; e.test(t);) n += 1;
|
|
1548
|
+
return t.length - n;
|
|
1549
|
+
};
|
|
1550
|
+
})(), In = (e) => e === 12288 || e >= 65281 && e <= 65376 || e >= 65504 && e <= 65510, Ln = (e) => e === 8987 || e === 9001 || e >= 12272 && e <= 12287 || e >= 12289 && e <= 12350 || e >= 12441 && e <= 12543 || e >= 12549 && e <= 12591 || e >= 12593 && e <= 12686 || e >= 12688 && e <= 12771 || e >= 12783 && e <= 12830 || e >= 12832 && e <= 12871 || e >= 12880 && e <= 19903 || e >= 65040 && e <= 65049 || e >= 65072 && e <= 65106 || e >= 65108 && e <= 65126 || e >= 65128 && e <= 65131 || e >= 127488 && e <= 127490 || e >= 127504 && e <= 127547 || e >= 127552 && e <= 127560 || e >= 131072 && e <= 196605 || e >= 196608 && e <= 262141, Rn = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y, zn = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y, Bn = /(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy, Vn = /\t{1,1000}/y, Hn = /[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy, Un = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y, Wn = /\p{M}+/gu, Gn = {
|
|
1551
|
+
limit: Infinity,
|
|
1552
|
+
ellipsis: ""
|
|
1553
|
+
}, Kn = (e, t = {}, n = {}) => {
|
|
1554
|
+
let r = t.limit ?? Infinity, i = t.ellipsis ?? "", a = t?.ellipsisWidth ?? (i ? Kn(i, Gn, n).width : 0), o = n.controlWidth ?? 0, s = n.tabWidth ?? 8, c = n.emojiWidth ?? 2, l = n.regularWidth ?? 1, u = n.wideWidth ?? 2, d = [
|
|
1555
|
+
[Un, l],
|
|
1556
|
+
[Rn, 0],
|
|
1557
|
+
[zn, o],
|
|
1558
|
+
[Vn, s],
|
|
1559
|
+
[Hn, c],
|
|
1560
|
+
[Bn, u]
|
|
1561
|
+
], f = 0, p = 0, m = e.length, h = 0, g = !1, _ = m, v = Math.max(0, r - a), y = 0, b = 0, x = 0, S = 0;
|
|
1562
|
+
outer: for (;;) {
|
|
1563
|
+
if (b > y || p >= m && p > f) {
|
|
1564
|
+
let t = e.slice(y, b) || e.slice(f, p);
|
|
1565
|
+
h = 0;
|
|
1566
|
+
for (let e of t.replaceAll(Wn, "")) {
|
|
1567
|
+
let t = e.codePointAt(0) || 0;
|
|
1568
|
+
if (S = In(t) ? 2 : Ln(t) ? u : l, x + S > v && (_ = Math.min(_, Math.max(y, f) + h)), x + S > r) {
|
|
1569
|
+
g = !0;
|
|
1570
|
+
break outer;
|
|
1571
|
+
}
|
|
1572
|
+
h += e.length, x += S;
|
|
1573
|
+
}
|
|
1574
|
+
y = b = 0;
|
|
1575
|
+
}
|
|
1576
|
+
if (p >= m) break outer;
|
|
1577
|
+
for (let t = 0, n = d.length; t < n; t++) {
|
|
1578
|
+
let [n, i] = d[t];
|
|
1579
|
+
if (n.lastIndex = p, n.test(e)) {
|
|
1580
|
+
if (h = n === Bn ? Fn(e.slice(p, n.lastIndex)) : n === Hn ? 1 : n.lastIndex - p, S = h * i, x + S > v && (_ = Math.min(_, p + Math.floor((v - x) / i))), x + S > r) {
|
|
1581
|
+
g = !0;
|
|
1582
|
+
break outer;
|
|
1583
|
+
}
|
|
1584
|
+
x += S, y = f, b = p, p = f = n.lastIndex;
|
|
1585
|
+
continue outer;
|
|
1586
|
+
}
|
|
1587
|
+
}
|
|
1588
|
+
p += 1;
|
|
1589
|
+
}
|
|
1590
|
+
return {
|
|
1591
|
+
width: g ? v : x,
|
|
1592
|
+
index: g ? _ : m,
|
|
1593
|
+
truncated: g,
|
|
1594
|
+
ellipsed: g && r >= a
|
|
1595
|
+
};
|
|
1596
|
+
}, qn = {
|
|
1597
|
+
limit: Infinity,
|
|
1598
|
+
ellipsis: "",
|
|
1599
|
+
ellipsisWidth: 0
|
|
1600
|
+
}, K = (e, t = {}) => Kn(e, qn, t).width, Jn = "\x1B", Yn = "", Xn = 39, Zn = "\x07", Qn = "[", $n = "]", er = "m", tr = `${$n}8;;`, nr = RegExp(`(?:\\${Qn}(?<code>\\d+)m|\\${tr}(?<uri>.*)${Zn})`, "y"), rr = (e) => {
|
|
1601
|
+
if (e >= 30 && e <= 37 || e >= 90 && e <= 97) return 39;
|
|
1602
|
+
if (e >= 40 && e <= 47 || e >= 100 && e <= 107) return 49;
|
|
1603
|
+
if (e === 1 || e === 2) return 22;
|
|
1604
|
+
if (e === 3) return 23;
|
|
1605
|
+
if (e === 4) return 24;
|
|
1606
|
+
if (e === 7) return 27;
|
|
1607
|
+
if (e === 8) return 28;
|
|
1608
|
+
if (e === 9) return 29;
|
|
1609
|
+
if (e === 0) return 0;
|
|
1610
|
+
}, ir = (e) => `${Jn}${Qn}${e}${er}`, ar = (e) => `${Jn}${tr}${e}${Zn}`, or = (e, t, n) => {
|
|
1611
|
+
let r = t[Symbol.iterator](), i = !1, a = !1, o = e.at(-1), s = o === void 0 ? 0 : K(o), c = r.next(), l = r.next(), u = 0;
|
|
1612
|
+
for (; !c.done;) {
|
|
1613
|
+
let o = c.value, d = K(o);
|
|
1614
|
+
s + d <= n ? e[e.length - 1] += o : (e.push(o), s = 0), (o === Jn || o === Yn) && (i = !0, a = t.startsWith(tr, u + 1)), i ? a ? o === Zn && (i = !1, a = !1) : o === er && (i = !1) : (s += d, s === n && !l.done && (e.push(""), s = 0)), c = l, l = r.next(), u += o.length;
|
|
1615
|
+
}
|
|
1616
|
+
o = e.at(-1), !s && o !== void 0 && o.length && e.length > 1 && (e[e.length - 2] += e.pop());
|
|
1617
|
+
}, sr = (e) => {
|
|
1618
|
+
let t = e.split(" "), n = t.length;
|
|
1619
|
+
for (; n && !K(t[n - 1]);) n--;
|
|
1620
|
+
return n === t.length ? e : t.slice(0, n).join(" ") + t.slice(n).join("");
|
|
1621
|
+
}, cr = (e, t, n = {}) => {
|
|
1622
|
+
if (n.trim !== !1 && e.trim() === "") return "";
|
|
1623
|
+
let r = "", i, a, o = e.split(" "), s = [""], c = 0;
|
|
1624
|
+
for (let e = 0; e < o.length; e++) {
|
|
1625
|
+
let r = o[e];
|
|
1626
|
+
if (n.trim !== !1) {
|
|
1627
|
+
let e = s.at(-1) ?? "", t = e.trimStart();
|
|
1628
|
+
e.length !== t.length && (s[s.length - 1] = t, c = K(t));
|
|
1629
|
+
}
|
|
1630
|
+
e !== 0 && (c >= t && (n.wordWrap === !1 || n.trim === !1) && (s.push(""), c = 0), (c || n.trim === !1) && (s[s.length - 1] += " ", c++));
|
|
1631
|
+
let i = K(r);
|
|
1632
|
+
if (n.hard && i > t) {
|
|
1633
|
+
let e = t - c, n = 1 + Math.floor((i - e - 1) / t);
|
|
1634
|
+
Math.floor((i - 1) / t) < n && s.push(""), or(s, r, t), c = K(s.at(-1) ?? "");
|
|
1635
|
+
continue;
|
|
1636
|
+
}
|
|
1637
|
+
if (c + i > t && c && i) {
|
|
1638
|
+
if (n.wordWrap === !1 && c < t) {
|
|
1639
|
+
or(s, r, t), c = K(s.at(-1) ?? "");
|
|
1640
|
+
continue;
|
|
1641
|
+
}
|
|
1642
|
+
s.push(""), c = 0;
|
|
1643
|
+
}
|
|
1644
|
+
if (c + i > t && n.wordWrap === !1) {
|
|
1645
|
+
or(s, r, t), c = K(s.at(-1) ?? "");
|
|
1646
|
+
continue;
|
|
1647
|
+
}
|
|
1648
|
+
s[s.length - 1] += r, c += i;
|
|
1649
|
+
}
|
|
1650
|
+
n.trim !== !1 && (s = s.map((e) => sr(e)));
|
|
1651
|
+
let l = s.join("\n"), u = !1;
|
|
1652
|
+
for (let e = 0; e < l.length; e++) {
|
|
1653
|
+
let t = l[e];
|
|
1654
|
+
if (r += t, u) u = !1;
|
|
1655
|
+
else if (u = t >= "\ud800" && t <= "\udbff", u) continue;
|
|
1656
|
+
if (t === Jn || t === Yn) {
|
|
1657
|
+
nr.lastIndex = e + 1;
|
|
1658
|
+
let t = nr.exec(l)?.groups;
|
|
1659
|
+
if (t?.code !== void 0) {
|
|
1660
|
+
let e = Number.parseFloat(t.code);
|
|
1661
|
+
i = e === Xn ? void 0 : e;
|
|
1662
|
+
} else t?.uri !== void 0 && (a = t.uri.length === 0 ? void 0 : t.uri);
|
|
1663
|
+
}
|
|
1664
|
+
if (l[e + 1] === "\n") {
|
|
1665
|
+
a && (r += ar(""));
|
|
1666
|
+
let e = i ? rr(i) : void 0;
|
|
1667
|
+
i && e && (r += ir(e));
|
|
1668
|
+
} else t === "\n" && (i && rr(i) && (r += ir(i)), a && (r += ar(a)));
|
|
1669
|
+
}
|
|
1670
|
+
return r;
|
|
1671
|
+
}, lr = /\r?\n/;
|
|
1672
|
+
function ur(e, t, n) {
|
|
1673
|
+
return String(e).normalize().split(lr).map((e) => cr(e, t, n)).join("\n");
|
|
1674
|
+
}
|
|
1675
|
+
//#endregion
|
|
1676
|
+
//#region ../../node_modules/.pnpm/@clack+core@1.4.3/node_modules/@clack/core/dist/index.mjs
|
|
1677
|
+
var q = (/* @__PURE__ */ e(((e, t) => {
|
|
1678
|
+
var n = "\x1B", r = `${n}[`, i = "\x07", a = {
|
|
1679
|
+
to(e, t) {
|
|
1680
|
+
return t ? `${r}${t + 1};${e + 1}H` : `${r}${e + 1}G`;
|
|
1681
|
+
},
|
|
1682
|
+
move(e, t) {
|
|
1683
|
+
let n = "";
|
|
1684
|
+
return e < 0 ? n += `${r}${-e}D` : e > 0 && (n += `${r}${e}C`), t < 0 ? n += `${r}${-t}A` : t > 0 && (n += `${r}${t}B`), n;
|
|
1685
|
+
},
|
|
1686
|
+
up: (e = 1) => `${r}${e}A`,
|
|
1687
|
+
down: (e = 1) => `${r}${e}B`,
|
|
1688
|
+
forward: (e = 1) => `${r}${e}C`,
|
|
1689
|
+
backward: (e = 1) => `${r}${e}D`,
|
|
1690
|
+
nextLine: (e = 1) => `${r}E`.repeat(e),
|
|
1691
|
+
prevLine: (e = 1) => `${r}F`.repeat(e),
|
|
1692
|
+
left: `${r}G`,
|
|
1693
|
+
hide: `${r}?25l`,
|
|
1694
|
+
show: `${r}?25h`,
|
|
1695
|
+
save: `${n}7`,
|
|
1696
|
+
restore: `${n}8`
|
|
1697
|
+
};
|
|
1698
|
+
t.exports = {
|
|
1699
|
+
cursor: a,
|
|
1700
|
+
scroll: {
|
|
1701
|
+
up: (e = 1) => `${r}S`.repeat(e),
|
|
1702
|
+
down: (e = 1) => `${r}T`.repeat(e)
|
|
1703
|
+
},
|
|
1704
|
+
erase: {
|
|
1705
|
+
screen: `${r}2J`,
|
|
1706
|
+
up: (e = 1) => `${r}1J`.repeat(e),
|
|
1707
|
+
down: (e = 1) => `${r}J`.repeat(e),
|
|
1708
|
+
line: `${r}2K`,
|
|
1709
|
+
lineEnd: `${r}K`,
|
|
1710
|
+
lineStart: `${r}1K`,
|
|
1711
|
+
lines(e) {
|
|
1712
|
+
let t = "";
|
|
1713
|
+
for (let n = 0; n < e; n++) t += this.line + (n < e - 1 ? a.up() : "");
|
|
1714
|
+
return e && (t += a.left), t;
|
|
1715
|
+
}
|
|
1716
|
+
},
|
|
1717
|
+
beep: i
|
|
1718
|
+
};
|
|
1719
|
+
})))();
|
|
1720
|
+
function dr(e, t, n) {
|
|
1721
|
+
if (!n.some((e) => !e.disabled)) return e;
|
|
1722
|
+
let r = e + t, i = Math.max(n.length - 1, 0), a = r < 0 ? i : r > i ? 0 : r;
|
|
1723
|
+
return n[a]?.disabled ? dr(a, t < 0 ? -1 : 1, n) : a;
|
|
1724
|
+
}
|
|
1725
|
+
var J = {
|
|
1726
|
+
actions: /* @__PURE__ */ new Set([
|
|
1727
|
+
"up",
|
|
1728
|
+
"down",
|
|
1729
|
+
"left",
|
|
1730
|
+
"right",
|
|
1731
|
+
"space",
|
|
1732
|
+
"enter",
|
|
1733
|
+
"cancel"
|
|
1734
|
+
]),
|
|
1735
|
+
aliases: /* @__PURE__ */ new Map([
|
|
1736
|
+
["k", "up"],
|
|
1737
|
+
["j", "down"],
|
|
1738
|
+
["h", "left"],
|
|
1739
|
+
["l", "right"],
|
|
1740
|
+
["", "cancel"],
|
|
1741
|
+
["escape", "cancel"]
|
|
1742
|
+
]),
|
|
1743
|
+
messages: {
|
|
1744
|
+
cancel: "Canceled",
|
|
1745
|
+
error: "Something went wrong"
|
|
1746
|
+
},
|
|
1747
|
+
withGuide: !0,
|
|
1748
|
+
date: {
|
|
1749
|
+
monthNames: [
|
|
1750
|
+
"January",
|
|
1751
|
+
"February",
|
|
1752
|
+
"March",
|
|
1753
|
+
"April",
|
|
1754
|
+
"May",
|
|
1755
|
+
"June",
|
|
1756
|
+
"July",
|
|
1757
|
+
"August",
|
|
1758
|
+
"September",
|
|
1759
|
+
"October",
|
|
1760
|
+
"November",
|
|
1761
|
+
"December"
|
|
1762
|
+
],
|
|
1763
|
+
messages: {
|
|
1764
|
+
required: "Please enter a valid date",
|
|
1765
|
+
invalidMonth: "There are only 12 months in a year",
|
|
1766
|
+
invalidDay: (e, t) => `There are only ${e} days in ${t}`,
|
|
1767
|
+
afterMin: (e) => `Date must be on or after ${e.toISOString().slice(0, 10)}`,
|
|
1768
|
+
beforeMax: (e) => `Date must be on or before ${e.toISOString().slice(0, 10)}`
|
|
1769
|
+
}
|
|
1770
|
+
}
|
|
1771
|
+
};
|
|
1772
|
+
function fr(e, t) {
|
|
1773
|
+
if (typeof e == "string") return J.aliases.get(e) === t;
|
|
1774
|
+
for (let n of e) if (n !== void 0 && fr(n, t)) return !0;
|
|
1775
|
+
return !1;
|
|
1776
|
+
}
|
|
1777
|
+
function pr(e, t) {
|
|
1778
|
+
if (e === t) return;
|
|
1779
|
+
let n = e.split("\n"), r = t.split("\n"), i = Math.max(n.length, r.length), a = [];
|
|
1780
|
+
for (let e = 0; e < i; e++) n[e] !== r[e] && a.push(e);
|
|
1781
|
+
return {
|
|
1782
|
+
lines: a,
|
|
1783
|
+
numLinesBefore: n.length,
|
|
1784
|
+
numLinesAfter: r.length,
|
|
1785
|
+
numLines: i
|
|
1786
|
+
};
|
|
1787
|
+
}
|
|
1788
|
+
globalThis.process.platform.startsWith("win");
|
|
1789
|
+
var mr = Symbol("clack:cancel");
|
|
1790
|
+
function hr(e) {
|
|
1791
|
+
return e === mr;
|
|
1792
|
+
}
|
|
1793
|
+
function gr(e, t) {
|
|
1794
|
+
let n = e;
|
|
1795
|
+
n.isTTY && n.setRawMode(t);
|
|
1796
|
+
}
|
|
1797
|
+
var _r = (e) => "columns" in e && typeof e.columns == "number" ? e.columns : 80, vr = (e) => "rows" in e && typeof e.rows == "number" ? e.rows : 20;
|
|
1798
|
+
function yr(e, t, n, r = n, i = n, a) {
|
|
1799
|
+
return ur(t, _r(e ?? u) - n.length, {
|
|
1800
|
+
hard: !0,
|
|
1801
|
+
trim: !1
|
|
1802
|
+
}).split("\n").map((e, t, o) => {
|
|
1803
|
+
let s = a ? a(e, t) : e;
|
|
1804
|
+
return t === 0 ? `${r}${s}` : t === o.length - 1 ? `${i}${s}` : `${n}${s}`;
|
|
1805
|
+
}).join("\n");
|
|
1806
|
+
}
|
|
1807
|
+
function br(e, t) {
|
|
1808
|
+
if ("~standard" in e) {
|
|
1809
|
+
let n = e["~standard"].validate(t);
|
|
1810
|
+
if (n instanceof Promise) throw TypeError("Schema validation must be synchronous. Update `validate()` and remove any asynchronous logic.");
|
|
1811
|
+
return n.issues?.at(0)?.message;
|
|
1812
|
+
}
|
|
1813
|
+
return e(t);
|
|
1814
|
+
}
|
|
1815
|
+
var xr = class {
|
|
1816
|
+
input;
|
|
1817
|
+
output;
|
|
1818
|
+
_abortSignal;
|
|
1819
|
+
rl;
|
|
1820
|
+
opts;
|
|
1821
|
+
_render;
|
|
1822
|
+
_track = !1;
|
|
1823
|
+
_prevFrame = "";
|
|
1824
|
+
_subscribers = /* @__PURE__ */ new Map();
|
|
1825
|
+
_cursor = 0;
|
|
1826
|
+
state = "initial";
|
|
1827
|
+
error = "";
|
|
1828
|
+
value;
|
|
1829
|
+
userInput = "";
|
|
1830
|
+
constructor(e, t = !0) {
|
|
1831
|
+
let { input: n = l, output: r = u, render: i, signal: a, ...o } = e;
|
|
1832
|
+
this.opts = o, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = i.bind(this), this._track = t, this._abortSignal = a, this.input = n, this.output = r;
|
|
1833
|
+
}
|
|
1834
|
+
unsubscribe() {
|
|
1835
|
+
this._subscribers.clear();
|
|
1836
|
+
}
|
|
1837
|
+
setSubscriber(e, t) {
|
|
1838
|
+
let n = this._subscribers.get(e) ?? [];
|
|
1839
|
+
n.push(t), this._subscribers.set(e, n);
|
|
1840
|
+
}
|
|
1841
|
+
on(e, t) {
|
|
1842
|
+
this.setSubscriber(e, { cb: t });
|
|
1843
|
+
}
|
|
1844
|
+
once(e, t) {
|
|
1845
|
+
this.setSubscriber(e, {
|
|
1846
|
+
cb: t,
|
|
1847
|
+
once: !0
|
|
1848
|
+
});
|
|
1849
|
+
}
|
|
1850
|
+
emit(e, ...t) {
|
|
1851
|
+
let n = this._subscribers.get(e) ?? [], r = [];
|
|
1852
|
+
for (let e of n) e.cb(...t), e.once && r.push(() => n.splice(n.indexOf(e), 1));
|
|
1853
|
+
for (let e of r) e();
|
|
1854
|
+
}
|
|
1855
|
+
prompt() {
|
|
1856
|
+
return new Promise((e) => {
|
|
1857
|
+
if (this._abortSignal) {
|
|
1858
|
+
if (this._abortSignal.aborted) return this.state = "cancel", this.close(), e(mr);
|
|
1859
|
+
this._abortSignal.addEventListener("abort", () => {
|
|
1860
|
+
this.state = "cancel", this.close();
|
|
1861
|
+
}, { once: !0 });
|
|
1862
|
+
}
|
|
1863
|
+
this.rl = d.createInterface({
|
|
1864
|
+
input: this.input,
|
|
1865
|
+
tabSize: 2,
|
|
1866
|
+
prompt: "",
|
|
1867
|
+
escapeCodeTimeout: 50,
|
|
1868
|
+
terminal: !0
|
|
1869
|
+
}), this.rl.prompt(), this.opts.initialUserInput !== void 0 && this._setUserInput(this.opts.initialUserInput, !0), this.input.on("keypress", this.onKeypress), gr(this.input, !0), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
|
|
1870
|
+
this.output.write(q.cursor.show), this.output.off("resize", this.render), gr(this.input, !1), e(this.value);
|
|
1871
|
+
}), this.once("cancel", () => {
|
|
1872
|
+
this.output.write(q.cursor.show), this.output.off("resize", this.render), gr(this.input, !1), e(mr);
|
|
1873
|
+
});
|
|
1874
|
+
});
|
|
1875
|
+
}
|
|
1876
|
+
_isActionKey(e, t) {
|
|
1877
|
+
return e === " ";
|
|
1878
|
+
}
|
|
1879
|
+
_shouldSubmit(e, t) {
|
|
1880
|
+
return !0;
|
|
1881
|
+
}
|
|
1882
|
+
_setValue(e) {
|
|
1883
|
+
this.value = e, this.emit("value", this.value);
|
|
1884
|
+
}
|
|
1885
|
+
_setUserInput(e, t) {
|
|
1886
|
+
this.userInput = e ?? "", this.emit("userInput", this.userInput), t && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
|
|
1887
|
+
}
|
|
1888
|
+
_clearUserInput() {
|
|
1889
|
+
this.rl?.write(null, {
|
|
1890
|
+
ctrl: !0,
|
|
1891
|
+
name: "u"
|
|
1892
|
+
}), this._setUserInput("");
|
|
1893
|
+
}
|
|
1894
|
+
onKeypress(e, t) {
|
|
1895
|
+
if (this._track && t.name !== "return" && (t.name && this._isActionKey(e, t) && this.rl?.write(null, {
|
|
1896
|
+
ctrl: !0,
|
|
1897
|
+
name: "h"
|
|
1898
|
+
}), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), t?.name && (!this._track && J.aliases.has(t.name) && this.emit("cursor", J.aliases.get(t.name)), J.actions.has(t.name) && this.emit("cursor", t.name)), e && (e.toLowerCase() === "y" || e.toLowerCase() === "n") && this.emit("confirm", e.toLowerCase() === "y"), this.emit("key", e, t), t?.name === "return" && this._shouldSubmit(e, t)) {
|
|
1899
|
+
if (this.opts.validate) {
|
|
1900
|
+
let e = br(this.opts.validate, this.value);
|
|
1901
|
+
e && (this.error = e instanceof Error ? e.message : e, this.state = "error", this.rl?.write(this.userInput));
|
|
1902
|
+
}
|
|
1903
|
+
this.state !== "error" && (this.state = "submit");
|
|
1904
|
+
}
|
|
1905
|
+
fr([
|
|
1906
|
+
e,
|
|
1907
|
+
t?.name,
|
|
1908
|
+
t?.sequence
|
|
1909
|
+
], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
|
|
1910
|
+
}
|
|
1911
|
+
close() {
|
|
1912
|
+
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write("\n"), gr(this.input, !1), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
1913
|
+
}
|
|
1914
|
+
restoreCursor() {
|
|
1915
|
+
let e = ur(this._prevFrame, process.stdout.columns, {
|
|
1916
|
+
hard: !0,
|
|
1917
|
+
trim: !1
|
|
1918
|
+
}).split("\n").length - 1;
|
|
1919
|
+
this.output.write(q.cursor.move(-999, e * -1));
|
|
1920
|
+
}
|
|
1921
|
+
render() {
|
|
1922
|
+
let e = ur(this._render(this) ?? "", process.stdout.columns, {
|
|
1923
|
+
hard: !0,
|
|
1924
|
+
trim: !1
|
|
1925
|
+
});
|
|
1926
|
+
if (e !== this._prevFrame) {
|
|
1927
|
+
if (this.state === "initial") this.output.write(q.cursor.hide);
|
|
1928
|
+
else {
|
|
1929
|
+
let t = pr(this._prevFrame, e), n = vr(this.output);
|
|
1930
|
+
if (this.restoreCursor(), t) {
|
|
1931
|
+
let r = Math.max(0, t.numLinesAfter - n), i = Math.max(0, t.numLinesBefore - n), a = t.lines.find((e) => e >= r);
|
|
1932
|
+
if (a === void 0) {
|
|
1933
|
+
this._prevFrame = e;
|
|
1934
|
+
return;
|
|
1935
|
+
}
|
|
1936
|
+
if (t.lines.length === 1) {
|
|
1937
|
+
this.output.write(q.cursor.move(0, a - i)), this.output.write(q.erase.lines(1));
|
|
1938
|
+
let t = e.split("\n");
|
|
1939
|
+
this.output.write(t[a]), this._prevFrame = e, this.output.write(q.cursor.move(0, t.length - a - 1));
|
|
1940
|
+
return;
|
|
1941
|
+
} else if (t.lines.length > 1) {
|
|
1942
|
+
if (r < i) a = r;
|
|
1943
|
+
else {
|
|
1944
|
+
let e = a - i;
|
|
1945
|
+
e > 0 && this.output.write(q.cursor.move(0, e));
|
|
1946
|
+
}
|
|
1947
|
+
this.output.write(q.erase.down());
|
|
1948
|
+
let t = e.split("\n").slice(a);
|
|
1949
|
+
this.output.write(t.join("\n")), this._prevFrame = e;
|
|
1950
|
+
return;
|
|
1951
|
+
}
|
|
1952
|
+
}
|
|
1953
|
+
this.output.write(q.erase.down());
|
|
1954
|
+
}
|
|
1955
|
+
this.output.write(e), this.state === "initial" && (this.state = "active"), this._prevFrame = e;
|
|
1956
|
+
}
|
|
1957
|
+
}
|
|
1958
|
+
}, Sr = class extends xr {
|
|
1959
|
+
options;
|
|
1960
|
+
cursor = 0;
|
|
1961
|
+
get _selectedValue() {
|
|
1962
|
+
return this.options[this.cursor];
|
|
1963
|
+
}
|
|
1964
|
+
changeValue() {
|
|
1965
|
+
let e = this._selectedValue;
|
|
1966
|
+
this.value = e === void 0 ? void 0 : e.value;
|
|
1967
|
+
}
|
|
1968
|
+
constructor(e) {
|
|
1969
|
+
super(e, !1), this.options = e.options;
|
|
1970
|
+
let t = this.options.findIndex(({ value: t }) => t === e.initialValue), n = t === -1 ? 0 : t;
|
|
1971
|
+
this.cursor = this.options[n]?.disabled ? dr(n, 1, this.options) : n, this.changeValue(), this.on("cursor", (e) => {
|
|
1972
|
+
switch (e) {
|
|
1973
|
+
case "left":
|
|
1974
|
+
case "up":
|
|
1975
|
+
this.cursor = dr(this.cursor, -1, this.options);
|
|
1976
|
+
break;
|
|
1977
|
+
case "down":
|
|
1978
|
+
case "right":
|
|
1979
|
+
this.cursor = dr(this.cursor, 1, this.options);
|
|
1980
|
+
break;
|
|
1981
|
+
}
|
|
1982
|
+
this.changeValue();
|
|
1983
|
+
});
|
|
1984
|
+
}
|
|
1985
|
+
}, Cr = class extends xr {
|
|
1986
|
+
get userInputWithCursor() {
|
|
1987
|
+
if (this.state === "submit") return this.userInput;
|
|
1988
|
+
let e = this.userInput;
|
|
1989
|
+
if (this.cursor >= e.length) return `${this.userInput}\u2588`;
|
|
1990
|
+
let t = e.slice(0, this.cursor), n = e.slice(this.cursor, this.cursor + 1), r = e.slice(this.cursor + 1);
|
|
1991
|
+
return `${t}${s("inverse", n)}${r}`;
|
|
1992
|
+
}
|
|
1993
|
+
get cursor() {
|
|
1994
|
+
return this._cursor;
|
|
1995
|
+
}
|
|
1996
|
+
constructor(e) {
|
|
1997
|
+
super({
|
|
1998
|
+
...e,
|
|
1999
|
+
initialUserInput: e.initialUserInput ?? e.initialValue
|
|
2000
|
+
}), this.on("userInput", (e) => {
|
|
2001
|
+
this._setValue(e);
|
|
2002
|
+
}), this.on("finalize", () => {
|
|
2003
|
+
this.value ||= e.defaultValue, this.value === void 0 && (this.value = "");
|
|
2004
|
+
});
|
|
2005
|
+
}
|
|
2006
|
+
};
|
|
2007
|
+
//#endregion
|
|
2008
|
+
//#region ../../node_modules/.pnpm/@clack+prompts@1.7.0/node_modules/@clack/prompts/dist/index.mjs
|
|
2009
|
+
function wr() {
|
|
2010
|
+
return c.platform === "win32" ? !!c.env.CI || !!c.env.WT_SESSION || !!c.env.TERMINUS_SUBLIME || c.env.ConEmuTask === "{cmd::Cmder}" || c.env.TERM_PROGRAM === "Terminus-Sublime" || c.env.TERM_PROGRAM === "vscode" || c.env.TERM === "xterm-256color" || c.env.TERM === "alacritty" || c.env.TERMINAL_EMULATOR === "JetBrains-JediTerm" : c.env.TERM !== "linux";
|
|
2011
|
+
}
|
|
2012
|
+
var Tr = wr(), Y = (e, t) => Tr ? e : t, Er = Y("◆", "*"), Dr = Y("■", "x"), Or = Y("▲", "x"), kr = Y("◇", "o"), Ar = Y("┌", "T"), X = Y("│", "|"), Z = Y("└", "—"), jr = Y("●", ">"), Mr = Y("○", " "), Nr = Y("●", "•"), Pr = Y("◆", "*"), Fr = Y("▲", "!"), Ir = Y("■", "x"), Lr = (e) => {
|
|
2013
|
+
switch (e) {
|
|
2014
|
+
case "initial":
|
|
2015
|
+
case "active": return s("cyan", Er);
|
|
2016
|
+
case "cancel": return s("red", Dr);
|
|
2017
|
+
case "error": return s("yellow", Or);
|
|
2018
|
+
case "submit": return s("green", kr);
|
|
2019
|
+
}
|
|
2020
|
+
}, Rr = (e) => {
|
|
2021
|
+
switch (e) {
|
|
2022
|
+
case "initial":
|
|
2023
|
+
case "active": return s("cyan", X);
|
|
2024
|
+
case "cancel": return s("red", X);
|
|
2025
|
+
case "error": return s("yellow", X);
|
|
2026
|
+
case "submit": return s("green", X);
|
|
2027
|
+
}
|
|
2028
|
+
};
|
|
2029
|
+
function zr(e, t) {
|
|
2030
|
+
let n = [`${t ? `${s("cyan", X)} ` : ""}${e.join(" • ")}`];
|
|
2031
|
+
return t && n.push(s("cyan", Z)), n;
|
|
2032
|
+
}
|
|
2033
|
+
var Br = (e, t, n, r, i, a = !1) => {
|
|
2034
|
+
let o = t, s = 0;
|
|
2035
|
+
if (a) for (let t = r - 1; t >= n; t--) {
|
|
2036
|
+
let n = e[t];
|
|
2037
|
+
if (n && (o -= n.length), s++, o <= i) break;
|
|
2038
|
+
}
|
|
2039
|
+
else for (let t = n; t < r; t++) {
|
|
2040
|
+
let n = e[t];
|
|
2041
|
+
if (n && (o -= n.length), s++, o <= i) break;
|
|
2042
|
+
}
|
|
2043
|
+
return {
|
|
2044
|
+
lineCount: o,
|
|
2045
|
+
removals: s
|
|
2046
|
+
};
|
|
2047
|
+
}, Vr = ({ cursor: e, options: t, style: n, output: r = process.stdout, maxItems: i = Infinity, columnPadding: a = 0, rowPadding: o = 4 }) => {
|
|
2048
|
+
let c = _r(r) - a, l = vr(r), u = s("dim", "..."), d = Math.max(l - o, 0), f = Math.max(Math.min(i, d), 5), p = 0;
|
|
2049
|
+
e >= f - 3 && (p = Math.max(Math.min(e - f + 3, t.length - f), 0));
|
|
2050
|
+
let m = f < t.length && p > 0, h = f < t.length && p + f < t.length, g = Math.min(p + f, t.length), _ = [], v = 0;
|
|
2051
|
+
m && v++, h && v++;
|
|
2052
|
+
let y = p + +!!m, b = g - +!!h;
|
|
2053
|
+
for (let r = y; r < b; r++) {
|
|
2054
|
+
let i = t[r], a = ur(i ? n(i, r === e) : "", c, {
|
|
2055
|
+
hard: !0,
|
|
2056
|
+
trim: !1
|
|
2057
|
+
}).split("\n");
|
|
2058
|
+
_.push(a), v += a.length;
|
|
2059
|
+
}
|
|
2060
|
+
if (v > d) {
|
|
2061
|
+
let t = 0, n = 0, r = v, i = e - y, a = d, o = () => Br(_, r, 0, i, a), s = () => Br(_, r, i + 1, _.length, a, !0);
|
|
2062
|
+
m ? ({lineCount: r, removals: t} = o(), r > a && (h || --a, {lineCount: r, removals: n} = s())) : (h || --a, {lineCount: r, removals: n} = s(), r > a && (--a, {lineCount: r, removals: t} = o())), t > 0 && (m = !0, _.splice(0, t)), n > 0 && (h = !0, _.splice(_.length - n, n));
|
|
2063
|
+
}
|
|
2064
|
+
let x = [];
|
|
2065
|
+
m && x.push(u);
|
|
2066
|
+
for (let e of _) for (let t of e) x.push(t);
|
|
2067
|
+
return h && x.push(u), x;
|
|
2068
|
+
};
|
|
2069
|
+
`${s("dim", "↑/↓")}`, `${s("dim", "Space:")}`, `${s("dim", "Enter:")}`;
|
|
2070
|
+
var Q = {
|
|
2071
|
+
message: (e = [], { symbol: t = s("gray", X), secondarySymbol: n = s("gray", X), output: r = process.stdout, spacing: i = 1, withGuide: a } = {}) => {
|
|
2072
|
+
let o = [], c = a ?? J.withGuide, l = c ? n : "", u = c ? `${t} ` : "", d = c ? `${n} ` : "";
|
|
2073
|
+
for (let e = 0; e < i; e++) o.push(l);
|
|
2074
|
+
let f = Array.isArray(e) ? e : e.split("\n");
|
|
2075
|
+
if (f.length > 0) {
|
|
2076
|
+
let [e, ...r] = f;
|
|
2077
|
+
e.length > 0 ? o.push(`${u}${e}`) : o.push(c ? t : "");
|
|
2078
|
+
for (let e of r) e.length > 0 ? o.push(`${d}${e}`) : o.push(c ? n : "");
|
|
2079
|
+
}
|
|
2080
|
+
r.write(`${o.join("\n")}
|
|
2081
|
+
`);
|
|
2082
|
+
},
|
|
2083
|
+
info: (e, t) => {
|
|
2084
|
+
Q.message(e, {
|
|
2085
|
+
...t,
|
|
2086
|
+
symbol: s("blue", Nr)
|
|
2087
|
+
});
|
|
2088
|
+
},
|
|
2089
|
+
success: (e, t) => {
|
|
2090
|
+
Q.message(e, {
|
|
2091
|
+
...t,
|
|
2092
|
+
symbol: s("green", Pr)
|
|
2093
|
+
});
|
|
2094
|
+
},
|
|
2095
|
+
step: (e, t) => {
|
|
2096
|
+
Q.message(e, {
|
|
2097
|
+
...t,
|
|
2098
|
+
symbol: s("green", kr)
|
|
2099
|
+
});
|
|
2100
|
+
},
|
|
2101
|
+
warn: (e, t) => {
|
|
2102
|
+
Q.message(e, {
|
|
2103
|
+
...t,
|
|
2104
|
+
symbol: s("yellow", Fr)
|
|
2105
|
+
});
|
|
2106
|
+
},
|
|
2107
|
+
warning: (e, t) => {
|
|
2108
|
+
Q.warn(e, t);
|
|
2109
|
+
},
|
|
2110
|
+
error: (e, t) => {
|
|
2111
|
+
Q.message(e, {
|
|
2112
|
+
...t,
|
|
2113
|
+
symbol: s("red", Ir)
|
|
2114
|
+
});
|
|
2115
|
+
}
|
|
2116
|
+
}, Hr = (e = "", t) => {
|
|
2117
|
+
let n = t?.output ?? process.stdout, r = t?.withGuide ?? J.withGuide ? `${s("gray", Z)} ` : "";
|
|
2118
|
+
n.write(`${r}${s("red", e)}
|
|
2119
|
+
|
|
2120
|
+
`);
|
|
2121
|
+
}, Ur = (e = "", t) => {
|
|
2122
|
+
let n = t?.output ?? process.stdout, r = t?.withGuide ?? J.withGuide ? `${s("gray", Ar)} ` : "";
|
|
2123
|
+
n.write(`${r}${e}
|
|
2124
|
+
`);
|
|
2125
|
+
}, Wr = (e = "", t) => {
|
|
2126
|
+
let n = t?.output ?? process.stdout, r = t?.withGuide ?? J.withGuide ? `${s("gray", X)}
|
|
2127
|
+
${s("gray", Z)} ` : "";
|
|
2128
|
+
n.write(`${r}${e}
|
|
2129
|
+
|
|
2130
|
+
`);
|
|
2131
|
+
}, Gr = [`${s("dim", "↑/↓")} to navigate`, `${s("dim", "Enter:")} confirm`], Kr = (e, t) => e.includes("\n") ? e.split("\n").map((e) => t(e)).join("\n") : t(e), qr = (e) => {
|
|
2132
|
+
let t = (e, t) => {
|
|
2133
|
+
if (e === void 0) return "";
|
|
2134
|
+
let n = e.label ?? String(e.value);
|
|
2135
|
+
switch (t) {
|
|
2136
|
+
case "disabled": return `${s("gray", Mr)} ${Kr(n, (e) => s("gray", e))}${e.hint ? ` ${s("dim", `(${e.hint ?? "disabled"})`)}` : ""}`;
|
|
2137
|
+
case "selected": return `${Kr(n, (e) => s("dim", e))}`;
|
|
2138
|
+
case "active": return `${s("green", jr)} ${n}${e.hint ? ` ${s("dim", `(${e.hint})`)}` : ""}`;
|
|
2139
|
+
case "cancelled": return `${Kr(n, (e) => s(["strikethrough", "dim"], e))}`;
|
|
2140
|
+
default: return `${s("dim", Mr)} ${Kr(n, (e) => s("dim", e))}`;
|
|
2141
|
+
}
|
|
2142
|
+
}, n = e.showInstructions ?? !0;
|
|
2143
|
+
return new Sr({
|
|
2144
|
+
options: e.options,
|
|
2145
|
+
signal: e.signal,
|
|
2146
|
+
input: e.input,
|
|
2147
|
+
output: e.output,
|
|
2148
|
+
initialValue: e.initialValue,
|
|
2149
|
+
render() {
|
|
2150
|
+
let r = e.withGuide ?? J.withGuide, i = `${Lr(this.state)} `, a = `${Rr(this.state)} `, o = yr(e.output, e.message, a, i), c = `${r ? `${s("gray", X)}
|
|
2151
|
+
` : ""}${o}
|
|
2152
|
+
`;
|
|
2153
|
+
switch (this.state) {
|
|
2154
|
+
case "submit": {
|
|
2155
|
+
let n = r ? `${s("gray", X)} ` : "";
|
|
2156
|
+
return `${c}${yr(e.output, t(this.options[this.cursor], "selected"), n)}`;
|
|
2157
|
+
}
|
|
2158
|
+
case "cancel": {
|
|
2159
|
+
let n = r ? `${s("gray", X)} ` : "";
|
|
2160
|
+
return `${c}${yr(e.output, t(this.options[this.cursor], "cancelled"), n)}${r ? `
|
|
2161
|
+
${s("gray", X)}` : ""}`;
|
|
2162
|
+
}
|
|
2163
|
+
default: {
|
|
2164
|
+
let i = r ? `${s("cyan", X)} ` : "", a = c.split("\n").length, o = n ? zr(Gr, r) : r ? [s("cyan", Z)] : [], l = o.join("\n"), u = o.length + 1;
|
|
2165
|
+
return `${c}${i}${Vr({
|
|
2166
|
+
output: e.output,
|
|
2167
|
+
cursor: this.cursor,
|
|
2168
|
+
options: this.options,
|
|
2169
|
+
maxItems: e.maxItems,
|
|
2170
|
+
columnPadding: i.length,
|
|
2171
|
+
rowPadding: a + u,
|
|
2172
|
+
style: (e, n) => t(e, e.disabled ? "disabled" : n ? "active" : "inactive")
|
|
2173
|
+
}).join(`
|
|
2174
|
+
${i}`)}
|
|
2175
|
+
${l}
|
|
2176
|
+
`;
|
|
2177
|
+
}
|
|
2178
|
+
}
|
|
2179
|
+
}
|
|
2180
|
+
}).prompt();
|
|
2181
|
+
};
|
|
2182
|
+
`${s("gray", X)}`;
|
|
2183
|
+
var Jr = (e) => new Cr({
|
|
2184
|
+
validate: e.validate,
|
|
2185
|
+
placeholder: e.placeholder,
|
|
2186
|
+
defaultValue: e.defaultValue,
|
|
2187
|
+
initialValue: e.initialValue,
|
|
2188
|
+
output: e.output,
|
|
2189
|
+
signal: e.signal,
|
|
2190
|
+
input: e.input,
|
|
2191
|
+
render() {
|
|
2192
|
+
let t = e?.withGuide ?? J.withGuide, n = `${`${t ? `${s("gray", X)}
|
|
2193
|
+
` : ""}${Lr(this.state)} `}${e.message}
|
|
2194
|
+
`, r = e.placeholder && e.placeholder.length > 0 ? s("inverse", e.placeholder[0]) + s("dim", e.placeholder.slice(1)) : s(["inverse", "hidden"], "_"), i = this.userInput ? this.userInputWithCursor : r, a = this.value ?? "";
|
|
2195
|
+
switch (this.state) {
|
|
2196
|
+
case "error": {
|
|
2197
|
+
let e = this.error ? ` ${s("yellow", this.error)}` : "", r = t ? `${s("yellow", X)} ` : "", a = t ? s("yellow", Z) : "";
|
|
2198
|
+
return `${n.trim()}
|
|
2199
|
+
${r}${i}
|
|
2200
|
+
${a}${e}
|
|
2201
|
+
`;
|
|
2202
|
+
}
|
|
2203
|
+
case "submit": {
|
|
2204
|
+
let e = a ? ` ${s("dim", a)}` : "";
|
|
2205
|
+
return `${n}${t ? s("gray", X) : ""}${e}`;
|
|
2206
|
+
}
|
|
2207
|
+
case "cancel": {
|
|
2208
|
+
let e = a ? ` ${s(["strikethrough", "dim"], a)}` : "", r = t ? s("gray", X) : "";
|
|
2209
|
+
return `${n}${r}${e}${a.trim() ? `
|
|
2210
|
+
${r}` : ""}`;
|
|
2211
|
+
}
|
|
2212
|
+
default: return `${n}${t ? `${s("cyan", X)} ` : ""}${i}
|
|
2213
|
+
${t ? s("cyan", Z) : ""}
|
|
2214
|
+
`;
|
|
2215
|
+
}
|
|
2216
|
+
}
|
|
2217
|
+
}).prompt();
|
|
2218
|
+
//#endregion
|
|
2219
|
+
//#region src/node/cli/init.ts
|
|
2220
|
+
async function Yr(e) {
|
|
2221
|
+
await oi(e, await Xr(e)), ii(e);
|
|
2222
|
+
}
|
|
2223
|
+
async function Xr(e) {
|
|
2224
|
+
Ur("typedown");
|
|
2225
|
+
let t = await Qr(e);
|
|
2226
|
+
t.hasTypedownYaml && await Zr();
|
|
2227
|
+
let n = await ai("Project name", t.packageName ?? a.basename(e));
|
|
2228
|
+
return {
|
|
2229
|
+
projectName: n,
|
|
2230
|
+
siteTitle: await ai("Site title", t.siteTitle ?? n),
|
|
2231
|
+
siteDescription: await ai("Site description", t.siteDescription ?? "A typedown site")
|
|
2232
|
+
};
|
|
2233
|
+
}
|
|
2234
|
+
async function Zr() {
|
|
2235
|
+
Q.warn("typedown.yaml already exists in this directory");
|
|
2236
|
+
let e = await qr({
|
|
2237
|
+
message: "What would you like to do?",
|
|
2238
|
+
options: [{
|
|
2239
|
+
value: "scaffold",
|
|
2240
|
+
label: "Continue scaffolding (skip existing files)"
|
|
2241
|
+
}, {
|
|
2242
|
+
value: "cancel",
|
|
2243
|
+
label: "Cancel"
|
|
2244
|
+
}]
|
|
2245
|
+
});
|
|
2246
|
+
(hr(e) || e === "cancel") && (Hr("Cancelled."), process.exit(0));
|
|
2247
|
+
}
|
|
2248
|
+
async function Qr(e) {
|
|
2249
|
+
let n = {
|
|
2250
|
+
hasPackageJson: !1,
|
|
2251
|
+
hasTypedownYaml: !1,
|
|
2252
|
+
packageName: void 0,
|
|
2253
|
+
siteTitle: void 0,
|
|
2254
|
+
siteDescription: void 0
|
|
2255
|
+
}, r = a.join(e, "package.json");
|
|
2256
|
+
try {
|
|
2257
|
+
let e = await o.readFile(r, "utf-8"), t = JSON.parse(e);
|
|
2258
|
+
n.hasPackageJson = !0, typeof t.name == "string" && 0 < t.name.length && (n.packageName = t.name);
|
|
2259
|
+
} catch {}
|
|
2260
|
+
for (let r of t) try {
|
|
2261
|
+
let t = Nn(await o.readFile(a.join(e, r), "utf-8"));
|
|
2262
|
+
n.hasTypedownYaml = !0;
|
|
2263
|
+
let i = t?.site;
|
|
2264
|
+
typeof i?.title == "string" && (n.siteTitle = i.title), typeof i?.description == "string" && (n.siteDescription = i.description);
|
|
2265
|
+
break;
|
|
2266
|
+
} catch {}
|
|
2267
|
+
return n;
|
|
2268
|
+
}
|
|
2269
|
+
function $r(e) {
|
|
2270
|
+
return `<!doctype html>
|
|
2271
|
+
<html lang="en">
|
|
2272
|
+
<head>
|
|
2273
|
+
<meta charset="UTF-8" />
|
|
2274
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
2275
|
+
<title>${r(e.siteTitle)}</title>
|
|
2276
|
+
<link
|
|
2277
|
+
rel="icon"
|
|
2278
|
+
type="image/svg+xml"
|
|
2279
|
+
href="${i}"
|
|
2280
|
+
>
|
|
2281
|
+
</head>
|
|
2282
|
+
<body>
|
|
2283
|
+
<div id="app"></div>
|
|
2284
|
+
<script
|
|
2285
|
+
type="module"
|
|
2286
|
+
src="/${n}"
|
|
2287
|
+
><\/script>
|
|
2288
|
+
</body>
|
|
2289
|
+
</html>
|
|
2290
|
+
`;
|
|
2291
|
+
}
|
|
2292
|
+
function ei(e) {
|
|
2293
|
+
return JSON.stringify({
|
|
2294
|
+
name: e.projectName,
|
|
2295
|
+
version: "0.0.0",
|
|
2296
|
+
private: !0,
|
|
2297
|
+
type: "module",
|
|
2298
|
+
scripts: {
|
|
2299
|
+
dev: "typerighter dev",
|
|
2300
|
+
build: "typerighter build",
|
|
2301
|
+
preview: "typerighter preview"
|
|
2302
|
+
},
|
|
2303
|
+
devDependencies: { typerighter: "^0.3.0" }
|
|
2304
|
+
}, void 0, 2) + "\n";
|
|
2305
|
+
}
|
|
2306
|
+
function ti() {
|
|
2307
|
+
return "---\n_type: Article\ntitle: \"Hello, world\"\n---\n\nWelcome to your new typedown site.\n";
|
|
2308
|
+
}
|
|
2309
|
+
function ni() {
|
|
2310
|
+
return "---\n_type: schema\nproperties:\n title:\n type: string\n tags:\n type: list[string]\n optional: true\n---\n";
|
|
2311
|
+
}
|
|
2312
|
+
function ri(e) {
|
|
2313
|
+
return `version: "1.0.0"
|
|
2314
|
+
vault:
|
|
2315
|
+
content_dir: vault/content
|
|
2316
|
+
schema_dir: vault/schemas
|
|
2317
|
+
site:
|
|
2318
|
+
title: "${e.siteTitle}"
|
|
2319
|
+
description: "${e.siteDescription}"
|
|
2320
|
+
`;
|
|
2321
|
+
}
|
|
2322
|
+
function ii(e) {
|
|
2323
|
+
let t = ["Done scaffolding."];
|
|
2324
|
+
e !== "." && t.push(`cd ${e}`), t.push("pnpm install"), t.push("pnpm dev"), Wr(t.join("\n"));
|
|
2325
|
+
}
|
|
2326
|
+
async function ai(e, t) {
|
|
2327
|
+
let n = await Jr({
|
|
2328
|
+
message: e,
|
|
2329
|
+
placeholder: t,
|
|
2330
|
+
defaultValue: t
|
|
2331
|
+
});
|
|
2332
|
+
return hr(n) && (Hr("Cancelled."), process.exit(0)), n;
|
|
2333
|
+
}
|
|
2334
|
+
async function oi(e, t) {
|
|
2335
|
+
let n = a.join(e, "vault", "content"), r = a.join(e, "vault", "schemas"), i = a.join(e, ".typedown", ".local");
|
|
2336
|
+
await Promise.all([
|
|
2337
|
+
o.mkdir(n, { recursive: !0 }),
|
|
2338
|
+
o.mkdir(r, { recursive: !0 }),
|
|
2339
|
+
o.mkdir(i, { recursive: !0 })
|
|
2340
|
+
]), await $(i, ".gitignore", "*\n", { silent: !0 }), await Promise.all([
|
|
2341
|
+
$(e, ".gitignore", "node_modules/\ndist/\n", { silent: !0 }),
|
|
2342
|
+
$(e, "package.json", ei(t)),
|
|
2343
|
+
$(e, "typedown.yaml", ri(t)),
|
|
2344
|
+
$(e, "index.html", $r(t))
|
|
2345
|
+
]);
|
|
2346
|
+
let s = await Promise.all([$(r, "Article.td", ni(), { silent: !0 }), $(n, "hello.td", ti(), { silent: !0 })]), c = s.filter(Boolean), l = s.filter((e) => !e);
|
|
2347
|
+
0 < c.length && Q.success(`created sample schema and content (${c.length} files)`), 0 < l.length && Q.warn(`skipped ${l.length} sample files (already exist)`);
|
|
2348
|
+
}
|
|
2349
|
+
async function $(e, t, n, r = {}) {
|
|
2350
|
+
let i = a.join(e, t);
|
|
2351
|
+
try {
|
|
2352
|
+
return await o.access(i), r.silent || Q.warn(`skip ${t} (already exists)`), !1;
|
|
2353
|
+
} catch {
|
|
2354
|
+
return await o.writeFile(i, n), r.silent || Q.success(`created ${t}`), !0;
|
|
2355
|
+
}
|
|
2356
|
+
}
|
|
2357
|
+
//#endregion
|
|
2358
|
+
export { Yr as initialize };
|