@geenius/docs 0.4.1 → 0.5.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.
@@ -1,3489 +1,21 @@
1
- import { Show, For, createSignal, createEffect, children, onCleanup, createMemo } from 'solid-js';
1
+ import { For, Show, createSignal, createUniqueId, createMemo, createEffect, children, onCleanup } from 'solid-js';
2
2
  import { jsx, jsxs, Fragment } from 'solid-js/h/jsx-runtime';
3
3
  import remarkGfm from 'remark-gfm';
4
4
  import { SolidMarkdown } from 'solid-markdown';
5
5
  import { AnimatePresence, motion } from '@geenius/motion/solidjs';
6
6
 
7
- var __create = Object.create;
8
- var __defProp = Object.defineProperty;
9
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
10
- var __getOwnPropNames = Object.getOwnPropertyNames;
11
- var __getProtoOf = Object.getPrototypeOf;
12
- var __hasOwnProp = Object.prototype.hasOwnProperty;
13
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
14
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
15
- }) : x)(function(x) {
16
- if (typeof require !== "undefined") return require.apply(this, arguments);
17
- throw Error('Dynamic require of "' + x + '" is not supported');
18
- });
19
- var __commonJS = (cb, mod) => function __require2() {
20
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
21
- };
22
- var __copyProps = (to, from, except, desc) => {
23
- if (from && typeof from === "object" || typeof from === "function") {
24
- for (let key of __getOwnPropNames(from))
25
- if (!__hasOwnProp.call(to, key) && key !== except)
26
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
27
- }
28
- return to;
29
- };
30
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
31
- // If the importer is in node compatibility mode or this is not an ESM
32
- // file that has been converted to a CommonJS file using a Babel-
33
- // compatible transform (i.e. "__esModule" has not been set), then set
34
- // "default" to the CommonJS "module.exports" for node compatibility.
35
- __defProp(target, "default", { value: mod, enumerable: true }) ,
36
- mod
37
- ));
38
-
39
- // ../../node_modules/.pnpm/kind-of@6.0.3/node_modules/kind-of/index.js
40
- var require_kind_of = __commonJS({
41
- "../../node_modules/.pnpm/kind-of@6.0.3/node_modules/kind-of/index.js"(exports2, module2) {
42
- var toString = Object.prototype.toString;
43
- module2.exports = function kindOf(val) {
44
- if (val === void 0) return "undefined";
45
- if (val === null) return "null";
46
- var type = typeof val;
47
- if (type === "boolean") return "boolean";
48
- if (type === "string") return "string";
49
- if (type === "number") return "number";
50
- if (type === "symbol") return "symbol";
51
- if (type === "function") {
52
- return isGeneratorFn(val) ? "generatorfunction" : "function";
53
- }
54
- if (isArray(val)) return "array";
55
- if (isBuffer(val)) return "buffer";
56
- if (isArguments(val)) return "arguments";
57
- if (isDate(val)) return "date";
58
- if (isError(val)) return "error";
59
- if (isRegexp(val)) return "regexp";
60
- switch (ctorName(val)) {
61
- case "Symbol":
62
- return "symbol";
63
- case "Promise":
64
- return "promise";
65
- // Set, Map, WeakSet, WeakMap
66
- case "WeakMap":
67
- return "weakmap";
68
- case "WeakSet":
69
- return "weakset";
70
- case "Map":
71
- return "map";
72
- case "Set":
73
- return "set";
74
- // 8-bit typed arrays
75
- case "Int8Array":
76
- return "int8array";
77
- case "Uint8Array":
78
- return "uint8array";
79
- case "Uint8ClampedArray":
80
- return "uint8clampedarray";
81
- // 16-bit typed arrays
82
- case "Int16Array":
83
- return "int16array";
84
- case "Uint16Array":
85
- return "uint16array";
86
- // 32-bit typed arrays
87
- case "Int32Array":
88
- return "int32array";
89
- case "Uint32Array":
90
- return "uint32array";
91
- case "Float32Array":
92
- return "float32array";
93
- case "Float64Array":
94
- return "float64array";
95
- }
96
- if (isGeneratorObj(val)) {
97
- return "generator";
98
- }
99
- type = toString.call(val);
100
- switch (type) {
101
- case "[object Object]":
102
- return "object";
103
- // iterators
104
- case "[object Map Iterator]":
105
- return "mapiterator";
106
- case "[object Set Iterator]":
107
- return "setiterator";
108
- case "[object String Iterator]":
109
- return "stringiterator";
110
- case "[object Array Iterator]":
111
- return "arrayiterator";
112
- }
113
- return type.slice(8, -1).toLowerCase().replace(/\s/g, "");
114
- };
115
- function ctorName(val) {
116
- return typeof val.constructor === "function" ? val.constructor.name : null;
117
- }
118
- function isArray(val) {
119
- if (Array.isArray) return Array.isArray(val);
120
- return val instanceof Array;
121
- }
122
- function isError(val) {
123
- return val instanceof Error || typeof val.message === "string" && val.constructor && typeof val.constructor.stackTraceLimit === "number";
124
- }
125
- function isDate(val) {
126
- if (val instanceof Date) return true;
127
- return typeof val.toDateString === "function" && typeof val.getDate === "function" && typeof val.setDate === "function";
128
- }
129
- function isRegexp(val) {
130
- if (val instanceof RegExp) return true;
131
- return typeof val.flags === "string" && typeof val.ignoreCase === "boolean" && typeof val.multiline === "boolean" && typeof val.global === "boolean";
132
- }
133
- function isGeneratorFn(name, val) {
134
- return ctorName(name) === "GeneratorFunction";
135
- }
136
- function isGeneratorObj(val) {
137
- return typeof val.throw === "function" && typeof val.return === "function" && typeof val.next === "function";
138
- }
139
- function isArguments(val) {
140
- try {
141
- if (typeof val.length === "number" && typeof val.callee === "function") {
142
- return true;
143
- }
144
- } catch (err) {
145
- if (err.message.indexOf("callee") !== -1) {
146
- return true;
147
- }
148
- }
149
- return false;
150
- }
151
- function isBuffer(val) {
152
- if (val.constructor && typeof val.constructor.isBuffer === "function") {
153
- return val.constructor.isBuffer(val);
154
- }
155
- return false;
156
- }
157
- }
158
- });
159
-
160
- // ../../node_modules/.pnpm/is-extendable@0.1.1/node_modules/is-extendable/index.js
161
- var require_is_extendable = __commonJS({
162
- "../../node_modules/.pnpm/is-extendable@0.1.1/node_modules/is-extendable/index.js"(exports2, module2) {
163
- module2.exports = function isExtendable(val) {
164
- return typeof val !== "undefined" && val !== null && (typeof val === "object" || typeof val === "function");
165
- };
166
- }
167
- });
168
-
169
- // ../../node_modules/.pnpm/extend-shallow@2.0.1/node_modules/extend-shallow/index.js
170
- var require_extend_shallow = __commonJS({
171
- "../../node_modules/.pnpm/extend-shallow@2.0.1/node_modules/extend-shallow/index.js"(exports2, module2) {
172
- var isObject = require_is_extendable();
173
- module2.exports = function extend(o) {
174
- if (!isObject(o)) {
175
- o = {};
176
- }
177
- var len = arguments.length;
178
- for (var i = 1; i < len; i++) {
179
- var obj = arguments[i];
180
- if (isObject(obj)) {
181
- assign(o, obj);
182
- }
183
- }
184
- return o;
185
- };
186
- function assign(a, b) {
187
- for (var key in b) {
188
- if (hasOwn(b, key)) {
189
- a[key] = b[key];
190
- }
191
- }
192
- }
193
- function hasOwn(obj, key) {
194
- return Object.prototype.hasOwnProperty.call(obj, key);
195
- }
196
- }
197
- });
198
-
199
- // ../../node_modules/.pnpm/section-matter@1.0.0/node_modules/section-matter/index.js
200
- var require_section_matter = __commonJS({
201
- "../../node_modules/.pnpm/section-matter@1.0.0/node_modules/section-matter/index.js"(exports2, module2) {
202
- var typeOf = require_kind_of();
203
- var extend = require_extend_shallow();
204
- module2.exports = function(input, options2) {
205
- if (typeof options2 === "function") {
206
- options2 = { parse: options2 };
207
- }
208
- var file = toObject(input);
209
- var defaults = { section_delimiter: "---", parse: identity };
210
- var opts = extend({}, defaults, options2);
211
- var delim = opts.section_delimiter;
212
- var lines = file.content.split(/\r?\n/);
213
- var sections = null;
214
- var section = createSection();
215
- var content = [];
216
- var stack = [];
217
- function initSections(val) {
218
- file.content = val;
219
- sections = [];
220
- content = [];
221
- }
222
- function closeSection(val) {
223
- if (stack.length) {
224
- section.key = getKey(stack[0], delim);
225
- section.content = val;
226
- opts.parse(section, sections);
227
- sections.push(section);
228
- section = createSection();
229
- content = [];
230
- stack = [];
231
- }
232
- }
233
- for (var i = 0; i < lines.length; i++) {
234
- var line = lines[i];
235
- var len = stack.length;
236
- var ln = line.trim();
237
- if (isDelimiter(ln, delim)) {
238
- if (ln.length === 3 && i !== 0) {
239
- if (len === 0 || len === 2) {
240
- content.push(line);
241
- continue;
242
- }
243
- stack.push(ln);
244
- section.data = content.join("\n");
245
- content = [];
246
- continue;
247
- }
248
- if (sections === null) {
249
- initSections(content.join("\n"));
250
- }
251
- if (len === 2) {
252
- closeSection(content.join("\n"));
253
- }
254
- stack.push(ln);
255
- continue;
256
- }
257
- content.push(line);
258
- }
259
- if (sections === null) {
260
- initSections(content.join("\n"));
261
- } else {
262
- closeSection(content.join("\n"));
263
- }
264
- file.sections = sections;
265
- return file;
266
- };
267
- function isDelimiter(line, delim) {
268
- if (line.slice(0, delim.length) !== delim) {
269
- return false;
270
- }
271
- if (line.charAt(delim.length + 1) === delim.slice(-1)) {
272
- return false;
273
- }
274
- return true;
275
- }
276
- function toObject(input) {
277
- if (typeOf(input) !== "object") {
278
- input = { content: input };
279
- }
280
- if (typeof input.content !== "string" && !isBuffer(input.content)) {
281
- throw new TypeError("expected a buffer or string");
282
- }
283
- input.content = input.content.toString();
284
- input.sections = [];
285
- return input;
286
- }
287
- function getKey(val, delim) {
288
- return val ? val.slice(delim.length).trim() : "";
289
- }
290
- function createSection() {
291
- return { key: "", data: "", content: "" };
292
- }
293
- function identity(val) {
294
- return val;
295
- }
296
- function isBuffer(val) {
297
- if (val && val.constructor && typeof val.constructor.isBuffer === "function") {
298
- return val.constructor.isBuffer(val);
299
- }
300
- return false;
301
- }
302
- }
303
- });
304
-
305
- // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/common.js
306
- var require_common = __commonJS({
307
- "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/common.js"(exports2, module2) {
308
- function isNothing(subject) {
309
- return typeof subject === "undefined" || subject === null;
310
- }
311
- function isObject(subject) {
312
- return typeof subject === "object" && subject !== null;
313
- }
314
- function toArray(sequence) {
315
- if (Array.isArray(sequence)) return sequence;
316
- else if (isNothing(sequence)) return [];
317
- return [sequence];
318
- }
319
- function extend(target, source) {
320
- var index, length, key, sourceKeys;
321
- if (source) {
322
- sourceKeys = Object.keys(source);
323
- for (index = 0, length = sourceKeys.length; index < length; index += 1) {
324
- key = sourceKeys[index];
325
- target[key] = source[key];
326
- }
327
- }
328
- return target;
329
- }
330
- function repeat(string, count) {
331
- var result = "", cycle;
332
- for (cycle = 0; cycle < count; cycle += 1) {
333
- result += string;
334
- }
335
- return result;
336
- }
337
- function isNegativeZero(number) {
338
- return number === 0 && Number.NEGATIVE_INFINITY === 1 / number;
339
- }
340
- module2.exports.isNothing = isNothing;
341
- module2.exports.isObject = isObject;
342
- module2.exports.toArray = toArray;
343
- module2.exports.repeat = repeat;
344
- module2.exports.isNegativeZero = isNegativeZero;
345
- module2.exports.extend = extend;
346
- }
347
- });
348
-
349
- // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/exception.js
350
- var require_exception = __commonJS({
351
- "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/exception.js"(exports2, module2) {
352
- function YAMLException(reason, mark) {
353
- Error.call(this);
354
- this.name = "YAMLException";
355
- this.reason = reason;
356
- this.mark = mark;
357
- this.message = (this.reason || "(unknown reason)") + (this.mark ? " " + this.mark.toString() : "");
358
- if (Error.captureStackTrace) {
359
- Error.captureStackTrace(this, this.constructor);
360
- } else {
361
- this.stack = new Error().stack || "";
362
- }
363
- }
364
- YAMLException.prototype = Object.create(Error.prototype);
365
- YAMLException.prototype.constructor = YAMLException;
366
- YAMLException.prototype.toString = function toString(compact) {
367
- var result = this.name + ": ";
368
- result += this.reason || "(unknown reason)";
369
- if (!compact && this.mark) {
370
- result += " " + this.mark.toString();
371
- }
372
- return result;
373
- };
374
- module2.exports = YAMLException;
375
- }
376
- });
377
-
378
- // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/mark.js
379
- var require_mark = __commonJS({
380
- "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/mark.js"(exports2, module2) {
381
- var common = require_common();
382
- function Mark(name, buffer, position, line, column) {
383
- this.name = name;
384
- this.buffer = buffer;
385
- this.position = position;
386
- this.line = line;
387
- this.column = column;
388
- }
389
- Mark.prototype.getSnippet = function getSnippet(indent, maxLength) {
390
- var head, start, tail, end, snippet;
391
- if (!this.buffer) return null;
392
- indent = indent || 4;
393
- maxLength = maxLength || 75;
394
- head = "";
395
- start = this.position;
396
- while (start > 0 && "\0\r\n\x85\u2028\u2029".indexOf(this.buffer.charAt(start - 1)) === -1) {
397
- start -= 1;
398
- if (this.position - start > maxLength / 2 - 1) {
399
- head = " ... ";
400
- start += 5;
401
- break;
402
- }
403
- }
404
- tail = "";
405
- end = this.position;
406
- while (end < this.buffer.length && "\0\r\n\x85\u2028\u2029".indexOf(this.buffer.charAt(end)) === -1) {
407
- end += 1;
408
- if (end - this.position > maxLength / 2 - 1) {
409
- tail = " ... ";
410
- end -= 5;
411
- break;
412
- }
413
- }
414
- snippet = this.buffer.slice(start, end);
415
- return common.repeat(" ", indent) + head + snippet + tail + "\n" + common.repeat(" ", indent + this.position - start + head.length) + "^";
416
- };
417
- Mark.prototype.toString = function toString(compact) {
418
- var snippet, where = "";
419
- if (this.name) {
420
- where += 'in "' + this.name + '" ';
421
- }
422
- where += "at line " + (this.line + 1) + ", column " + (this.column + 1);
423
- if (!compact) {
424
- snippet = this.getSnippet();
425
- if (snippet) {
426
- where += ":\n" + snippet;
427
- }
428
- }
429
- return where;
430
- };
431
- module2.exports = Mark;
432
- }
433
- });
434
-
435
- // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type.js
436
- var require_type = __commonJS({
437
- "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type.js"(exports2, module2) {
438
- var YAMLException = require_exception();
439
- var TYPE_CONSTRUCTOR_OPTIONS = [
440
- "kind",
441
- "resolve",
442
- "construct",
443
- "instanceOf",
444
- "predicate",
445
- "represent",
446
- "defaultStyle",
447
- "styleAliases"
448
- ];
449
- var YAML_NODE_KINDS = [
450
- "scalar",
451
- "sequence",
452
- "mapping"
453
- ];
454
- function compileStyleAliases(map) {
455
- var result = {};
456
- if (map !== null) {
457
- Object.keys(map).forEach(function(style) {
458
- map[style].forEach(function(alias) {
459
- result[String(alias)] = style;
460
- });
461
- });
462
- }
463
- return result;
464
- }
465
- function Type(tag, options2) {
466
- options2 = options2 || {};
467
- Object.keys(options2).forEach(function(name) {
468
- if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
469
- throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
470
- }
471
- });
472
- this.tag = tag;
473
- this.kind = options2["kind"] || null;
474
- this.resolve = options2["resolve"] || function() {
475
- return true;
476
- };
477
- this.construct = options2["construct"] || function(data) {
478
- return data;
479
- };
480
- this.instanceOf = options2["instanceOf"] || null;
481
- this.predicate = options2["predicate"] || null;
482
- this.represent = options2["represent"] || null;
483
- this.defaultStyle = options2["defaultStyle"] || null;
484
- this.styleAliases = compileStyleAliases(options2["styleAliases"] || null);
485
- if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
486
- throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
487
- }
488
- }
489
- module2.exports = Type;
490
- }
491
- });
492
-
493
- // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema.js
494
- var require_schema = __commonJS({
495
- "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema.js"(exports2, module2) {
496
- var common = require_common();
497
- var YAMLException = require_exception();
498
- var Type = require_type();
499
- function compileList(schema, name, result) {
500
- var exclude = [];
501
- schema.include.forEach(function(includedSchema) {
502
- result = compileList(includedSchema, name, result);
503
- });
504
- schema[name].forEach(function(currentType) {
505
- result.forEach(function(previousType, previousIndex) {
506
- if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) {
507
- exclude.push(previousIndex);
508
- }
509
- });
510
- result.push(currentType);
511
- });
512
- return result.filter(function(type, index) {
513
- return exclude.indexOf(index) === -1;
514
- });
515
- }
516
- function compileMap() {
517
- var result = {
518
- scalar: {},
519
- sequence: {},
520
- mapping: {},
521
- fallback: {}
522
- }, index, length;
523
- function collectType(type) {
524
- result[type.kind][type.tag] = result["fallback"][type.tag] = type;
525
- }
526
- for (index = 0, length = arguments.length; index < length; index += 1) {
527
- arguments[index].forEach(collectType);
528
- }
529
- return result;
530
- }
531
- function Schema(definition) {
532
- this.include = definition.include || [];
533
- this.implicit = definition.implicit || [];
534
- this.explicit = definition.explicit || [];
535
- this.implicit.forEach(function(type) {
536
- if (type.loadKind && type.loadKind !== "scalar") {
537
- throw new YAMLException("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
538
- }
539
- });
540
- this.compiledImplicit = compileList(this, "implicit", []);
541
- this.compiledExplicit = compileList(this, "explicit", []);
542
- this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit);
543
- }
544
- Schema.DEFAULT = null;
545
- Schema.create = function createSchema() {
546
- var schemas, types;
547
- switch (arguments.length) {
548
- case 1:
549
- schemas = Schema.DEFAULT;
550
- types = arguments[0];
551
- break;
552
- case 2:
553
- schemas = arguments[0];
554
- types = arguments[1];
555
- break;
556
- default:
557
- throw new YAMLException("Wrong number of arguments for Schema.create function");
558
- }
559
- schemas = common.toArray(schemas);
560
- types = common.toArray(types);
561
- if (!schemas.every(function(schema) {
562
- return schema instanceof Schema;
563
- })) {
564
- throw new YAMLException("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");
565
- }
566
- if (!types.every(function(type) {
567
- return type instanceof Type;
568
- })) {
569
- throw new YAMLException("Specified list of YAML types (or a single Type object) contains a non-Type object.");
570
- }
571
- return new Schema({
572
- include: schemas,
573
- explicit: types
574
- });
575
- };
576
- module2.exports = Schema;
577
- }
578
- });
579
-
580
- // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/str.js
581
- var require_str = __commonJS({
582
- "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/str.js"(exports2, module2) {
583
- var Type = require_type();
584
- module2.exports = new Type("tag:yaml.org,2002:str", {
585
- kind: "scalar",
586
- construct: function(data) {
587
- return data !== null ? data : "";
588
- }
589
- });
590
- }
591
- });
592
-
593
- // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/seq.js
594
- var require_seq = __commonJS({
595
- "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/seq.js"(exports2, module2) {
596
- var Type = require_type();
597
- module2.exports = new Type("tag:yaml.org,2002:seq", {
598
- kind: "sequence",
599
- construct: function(data) {
600
- return data !== null ? data : [];
601
- }
602
- });
603
- }
604
- });
605
-
606
- // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/map.js
607
- var require_map = __commonJS({
608
- "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/map.js"(exports2, module2) {
609
- var Type = require_type();
610
- module2.exports = new Type("tag:yaml.org,2002:map", {
611
- kind: "mapping",
612
- construct: function(data) {
613
- return data !== null ? data : {};
614
- }
615
- });
616
- }
617
- });
618
-
619
- // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js
620
- var require_failsafe = __commonJS({
621
- "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js"(exports2, module2) {
622
- var Schema = require_schema();
623
- module2.exports = new Schema({
624
- explicit: [
625
- require_str(),
626
- require_seq(),
627
- require_map()
628
- ]
629
- });
630
- }
631
- });
632
-
633
- // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/null.js
634
- var require_null = __commonJS({
635
- "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/null.js"(exports2, module2) {
636
- var Type = require_type();
637
- function resolveYamlNull(data) {
638
- if (data === null) return true;
639
- var max = data.length;
640
- return max === 1 && data === "~" || max === 4 && (data === "null" || data === "Null" || data === "NULL");
641
- }
642
- function constructYamlNull() {
643
- return null;
644
- }
645
- function isNull(object) {
646
- return object === null;
647
- }
648
- module2.exports = new Type("tag:yaml.org,2002:null", {
649
- kind: "scalar",
650
- resolve: resolveYamlNull,
651
- construct: constructYamlNull,
652
- predicate: isNull,
653
- represent: {
654
- canonical: function() {
655
- return "~";
656
- },
657
- lowercase: function() {
658
- return "null";
659
- },
660
- uppercase: function() {
661
- return "NULL";
662
- },
663
- camelcase: function() {
664
- return "Null";
665
- }
666
- },
667
- defaultStyle: "lowercase"
668
- });
669
- }
670
- });
671
-
672
- // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/bool.js
673
- var require_bool = __commonJS({
674
- "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/bool.js"(exports2, module2) {
675
- var Type = require_type();
676
- function resolveYamlBoolean(data) {
677
- if (data === null) return false;
678
- var max = data.length;
679
- return max === 4 && (data === "true" || data === "True" || data === "TRUE") || max === 5 && (data === "false" || data === "False" || data === "FALSE");
680
- }
681
- function constructYamlBoolean(data) {
682
- return data === "true" || data === "True" || data === "TRUE";
683
- }
684
- function isBoolean(object) {
685
- return Object.prototype.toString.call(object) === "[object Boolean]";
686
- }
687
- module2.exports = new Type("tag:yaml.org,2002:bool", {
688
- kind: "scalar",
689
- resolve: resolveYamlBoolean,
690
- construct: constructYamlBoolean,
691
- predicate: isBoolean,
692
- represent: {
693
- lowercase: function(object) {
694
- return object ? "true" : "false";
695
- },
696
- uppercase: function(object) {
697
- return object ? "TRUE" : "FALSE";
698
- },
699
- camelcase: function(object) {
700
- return object ? "True" : "False";
701
- }
702
- },
703
- defaultStyle: "lowercase"
704
- });
705
- }
706
- });
707
-
708
- // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/int.js
709
- var require_int = __commonJS({
710
- "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/int.js"(exports2, module2) {
711
- var common = require_common();
712
- var Type = require_type();
713
- function isHexCode(c) {
714
- return 48 <= c && c <= 57 || 65 <= c && c <= 70 || 97 <= c && c <= 102;
715
- }
716
- function isOctCode(c) {
717
- return 48 <= c && c <= 55;
718
- }
719
- function isDecCode(c) {
720
- return 48 <= c && c <= 57;
721
- }
722
- function resolveYamlInteger(data) {
723
- if (data === null) return false;
724
- var max = data.length, index = 0, hasDigits = false, ch;
725
- if (!max) return false;
726
- ch = data[index];
727
- if (ch === "-" || ch === "+") {
728
- ch = data[++index];
729
- }
730
- if (ch === "0") {
731
- if (index + 1 === max) return true;
732
- ch = data[++index];
733
- if (ch === "b") {
734
- index++;
735
- for (; index < max; index++) {
736
- ch = data[index];
737
- if (ch === "_") continue;
738
- if (ch !== "0" && ch !== "1") return false;
739
- hasDigits = true;
740
- }
741
- return hasDigits && ch !== "_";
742
- }
743
- if (ch === "x") {
744
- index++;
745
- for (; index < max; index++) {
746
- ch = data[index];
747
- if (ch === "_") continue;
748
- if (!isHexCode(data.charCodeAt(index))) return false;
749
- hasDigits = true;
750
- }
751
- return hasDigits && ch !== "_";
752
- }
753
- for (; index < max; index++) {
754
- ch = data[index];
755
- if (ch === "_") continue;
756
- if (!isOctCode(data.charCodeAt(index))) return false;
757
- hasDigits = true;
758
- }
759
- return hasDigits && ch !== "_";
760
- }
761
- if (ch === "_") return false;
762
- for (; index < max; index++) {
763
- ch = data[index];
764
- if (ch === "_") continue;
765
- if (ch === ":") break;
766
- if (!isDecCode(data.charCodeAt(index))) {
767
- return false;
768
- }
769
- hasDigits = true;
770
- }
771
- if (!hasDigits || ch === "_") return false;
772
- if (ch !== ":") return true;
773
- return /^(:[0-5]?[0-9])+$/.test(data.slice(index));
774
- }
775
- function constructYamlInteger(data) {
776
- var value = data, sign = 1, ch, base, digits = [];
777
- if (value.indexOf("_") !== -1) {
778
- value = value.replace(/_/g, "");
779
- }
780
- ch = value[0];
781
- if (ch === "-" || ch === "+") {
782
- if (ch === "-") sign = -1;
783
- value = value.slice(1);
784
- ch = value[0];
785
- }
786
- if (value === "0") return 0;
787
- if (ch === "0") {
788
- if (value[1] === "b") return sign * parseInt(value.slice(2), 2);
789
- if (value[1] === "x") return sign * parseInt(value, 16);
790
- return sign * parseInt(value, 8);
791
- }
792
- if (value.indexOf(":") !== -1) {
793
- value.split(":").forEach(function(v) {
794
- digits.unshift(parseInt(v, 10));
795
- });
796
- value = 0;
797
- base = 1;
798
- digits.forEach(function(d) {
799
- value += d * base;
800
- base *= 60;
801
- });
802
- return sign * value;
803
- }
804
- return sign * parseInt(value, 10);
805
- }
806
- function isInteger(object) {
807
- return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 === 0 && !common.isNegativeZero(object));
808
- }
809
- module2.exports = new Type("tag:yaml.org,2002:int", {
810
- kind: "scalar",
811
- resolve: resolveYamlInteger,
812
- construct: constructYamlInteger,
813
- predicate: isInteger,
814
- represent: {
815
- binary: function(obj) {
816
- return obj >= 0 ? "0b" + obj.toString(2) : "-0b" + obj.toString(2).slice(1);
817
- },
818
- octal: function(obj) {
819
- return obj >= 0 ? "0" + obj.toString(8) : "-0" + obj.toString(8).slice(1);
820
- },
821
- decimal: function(obj) {
822
- return obj.toString(10);
823
- },
824
- /* eslint-disable max-len */
825
- hexadecimal: function(obj) {
826
- return obj >= 0 ? "0x" + obj.toString(16).toUpperCase() : "-0x" + obj.toString(16).toUpperCase().slice(1);
827
- }
828
- },
829
- defaultStyle: "decimal",
830
- styleAliases: {
831
- binary: [2, "bin"],
832
- octal: [8, "oct"],
833
- decimal: [10, "dec"],
834
- hexadecimal: [16, "hex"]
835
- }
836
- });
837
- }
838
- });
839
-
840
- // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/float.js
841
- var require_float = __commonJS({
842
- "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/float.js"(exports2, module2) {
843
- var common = require_common();
844
- var Type = require_type();
845
- var YAML_FLOAT_PATTERN = new RegExp(
846
- // 2.5e4, 2.5 and integers
847
- "^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"
848
- );
849
- function resolveYamlFloat(data) {
850
- if (data === null) return false;
851
- if (!YAML_FLOAT_PATTERN.test(data) || // Quick hack to not allow integers end with `_`
852
- // Probably should update regexp & check speed
853
- data[data.length - 1] === "_") {
854
- return false;
855
- }
856
- return true;
857
- }
858
- function constructYamlFloat(data) {
859
- var value, sign, base, digits;
860
- value = data.replace(/_/g, "").toLowerCase();
861
- sign = value[0] === "-" ? -1 : 1;
862
- digits = [];
863
- if ("+-".indexOf(value[0]) >= 0) {
864
- value = value.slice(1);
865
- }
866
- if (value === ".inf") {
867
- return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
868
- } else if (value === ".nan") {
869
- return NaN;
870
- } else if (value.indexOf(":") >= 0) {
871
- value.split(":").forEach(function(v) {
872
- digits.unshift(parseFloat(v, 10));
873
- });
874
- value = 0;
875
- base = 1;
876
- digits.forEach(function(d) {
877
- value += d * base;
878
- base *= 60;
879
- });
880
- return sign * value;
881
- }
882
- return sign * parseFloat(value, 10);
883
- }
884
- var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
885
- function representYamlFloat(object, style) {
886
- var res;
887
- if (isNaN(object)) {
888
- switch (style) {
889
- case "lowercase":
890
- return ".nan";
891
- case "uppercase":
892
- return ".NAN";
893
- case "camelcase":
894
- return ".NaN";
895
- }
896
- } else if (Number.POSITIVE_INFINITY === object) {
897
- switch (style) {
898
- case "lowercase":
899
- return ".inf";
900
- case "uppercase":
901
- return ".INF";
902
- case "camelcase":
903
- return ".Inf";
904
- }
905
- } else if (Number.NEGATIVE_INFINITY === object) {
906
- switch (style) {
907
- case "lowercase":
908
- return "-.inf";
909
- case "uppercase":
910
- return "-.INF";
911
- case "camelcase":
912
- return "-.Inf";
913
- }
914
- } else if (common.isNegativeZero(object)) {
915
- return "-0.0";
916
- }
917
- res = object.toString(10);
918
- return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace("e", ".e") : res;
919
- }
920
- function isFloat(object) {
921
- return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 !== 0 || common.isNegativeZero(object));
922
- }
923
- module2.exports = new Type("tag:yaml.org,2002:float", {
924
- kind: "scalar",
925
- resolve: resolveYamlFloat,
926
- construct: constructYamlFloat,
927
- predicate: isFloat,
928
- represent: representYamlFloat,
929
- defaultStyle: "lowercase"
930
- });
931
- }
932
- });
933
-
934
- // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/json.js
935
- var require_json = __commonJS({
936
- "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/json.js"(exports2, module2) {
937
- var Schema = require_schema();
938
- module2.exports = new Schema({
939
- include: [
940
- require_failsafe()
941
- ],
942
- implicit: [
943
- require_null(),
944
- require_bool(),
945
- require_int(),
946
- require_float()
947
- ]
948
- });
949
- }
950
- });
951
-
952
- // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/core.js
953
- var require_core = __commonJS({
954
- "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/core.js"(exports2, module2) {
955
- var Schema = require_schema();
956
- module2.exports = new Schema({
957
- include: [
958
- require_json()
959
- ]
960
- });
961
- }
962
- });
963
-
964
- // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/timestamp.js
965
- var require_timestamp = __commonJS({
966
- "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/timestamp.js"(exports2, module2) {
967
- var Type = require_type();
968
- var YAML_DATE_REGEXP = new RegExp(
969
- "^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"
970
- );
971
- var YAML_TIMESTAMP_REGEXP = new RegExp(
972
- "^([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]))?))?$"
973
- );
974
- function resolveYamlTimestamp(data) {
975
- if (data === null) return false;
976
- if (YAML_DATE_REGEXP.exec(data) !== null) return true;
977
- if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;
978
- return false;
979
- }
980
- function constructYamlTimestamp(data) {
981
- var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date;
982
- match = YAML_DATE_REGEXP.exec(data);
983
- if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);
984
- if (match === null) throw new Error("Date resolve error");
985
- year = +match[1];
986
- month = +match[2] - 1;
987
- day = +match[3];
988
- if (!match[4]) {
989
- return new Date(Date.UTC(year, month, day));
990
- }
991
- hour = +match[4];
992
- minute = +match[5];
993
- second = +match[6];
994
- if (match[7]) {
995
- fraction = match[7].slice(0, 3);
996
- while (fraction.length < 3) {
997
- fraction += "0";
998
- }
999
- fraction = +fraction;
1000
- }
1001
- if (match[9]) {
1002
- tz_hour = +match[10];
1003
- tz_minute = +(match[11] || 0);
1004
- delta = (tz_hour * 60 + tz_minute) * 6e4;
1005
- if (match[9] === "-") delta = -delta;
1006
- }
1007
- date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
1008
- if (delta) date.setTime(date.getTime() - delta);
1009
- return date;
1010
- }
1011
- function representYamlTimestamp(object) {
1012
- return object.toISOString();
1013
- }
1014
- module2.exports = new Type("tag:yaml.org,2002:timestamp", {
1015
- kind: "scalar",
1016
- resolve: resolveYamlTimestamp,
1017
- construct: constructYamlTimestamp,
1018
- instanceOf: Date,
1019
- represent: representYamlTimestamp
1020
- });
1021
- }
1022
- });
1023
-
1024
- // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/merge.js
1025
- var require_merge = __commonJS({
1026
- "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/merge.js"(exports2, module2) {
1027
- var Type = require_type();
1028
- function resolveYamlMerge(data) {
1029
- return data === "<<" || data === null;
1030
- }
1031
- module2.exports = new Type("tag:yaml.org,2002:merge", {
1032
- kind: "scalar",
1033
- resolve: resolveYamlMerge
1034
- });
1035
- }
1036
- });
1037
-
1038
- // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/binary.js
1039
- var require_binary = __commonJS({
1040
- "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/binary.js"(exports2, module2) {
1041
- var NodeBuffer;
1042
- try {
1043
- _require = __require;
1044
- NodeBuffer = _require("buffer").Buffer;
1045
- } catch (__) {
1046
- }
1047
- var _require;
1048
- var Type = require_type();
1049
- var BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";
1050
- function resolveYamlBinary(data) {
1051
- if (data === null) return false;
1052
- var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP;
1053
- for (idx = 0; idx < max; idx++) {
1054
- code = map.indexOf(data.charAt(idx));
1055
- if (code > 64) continue;
1056
- if (code < 0) return false;
1057
- bitlen += 6;
1058
- }
1059
- return bitlen % 8 === 0;
1060
- }
1061
- function constructYamlBinary(data) {
1062
- var idx, tailbits, input = data.replace(/[\r\n=]/g, ""), max = input.length, map = BASE64_MAP, bits = 0, result = [];
1063
- for (idx = 0; idx < max; idx++) {
1064
- if (idx % 4 === 0 && idx) {
1065
- result.push(bits >> 16 & 255);
1066
- result.push(bits >> 8 & 255);
1067
- result.push(bits & 255);
1068
- }
1069
- bits = bits << 6 | map.indexOf(input.charAt(idx));
1070
- }
1071
- tailbits = max % 4 * 6;
1072
- if (tailbits === 0) {
1073
- result.push(bits >> 16 & 255);
1074
- result.push(bits >> 8 & 255);
1075
- result.push(bits & 255);
1076
- } else if (tailbits === 18) {
1077
- result.push(bits >> 10 & 255);
1078
- result.push(bits >> 2 & 255);
1079
- } else if (tailbits === 12) {
1080
- result.push(bits >> 4 & 255);
1081
- }
1082
- if (NodeBuffer) {
1083
- return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result);
1084
- }
1085
- return result;
1086
- }
1087
- function representYamlBinary(object) {
1088
- var result = "", bits = 0, idx, tail, max = object.length, map = BASE64_MAP;
1089
- for (idx = 0; idx < max; idx++) {
1090
- if (idx % 3 === 0 && idx) {
1091
- result += map[bits >> 18 & 63];
1092
- result += map[bits >> 12 & 63];
1093
- result += map[bits >> 6 & 63];
1094
- result += map[bits & 63];
1095
- }
1096
- bits = (bits << 8) + object[idx];
1097
- }
1098
- tail = max % 3;
1099
- if (tail === 0) {
1100
- result += map[bits >> 18 & 63];
1101
- result += map[bits >> 12 & 63];
1102
- result += map[bits >> 6 & 63];
1103
- result += map[bits & 63];
1104
- } else if (tail === 2) {
1105
- result += map[bits >> 10 & 63];
1106
- result += map[bits >> 4 & 63];
1107
- result += map[bits << 2 & 63];
1108
- result += map[64];
1109
- } else if (tail === 1) {
1110
- result += map[bits >> 2 & 63];
1111
- result += map[bits << 4 & 63];
1112
- result += map[64];
1113
- result += map[64];
1114
- }
1115
- return result;
1116
- }
1117
- function isBinary(object) {
1118
- return NodeBuffer && NodeBuffer.isBuffer(object);
1119
- }
1120
- module2.exports = new Type("tag:yaml.org,2002:binary", {
1121
- kind: "scalar",
1122
- resolve: resolveYamlBinary,
1123
- construct: constructYamlBinary,
1124
- predicate: isBinary,
1125
- represent: representYamlBinary
1126
- });
1127
- }
1128
- });
1129
-
1130
- // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/omap.js
1131
- var require_omap = __commonJS({
1132
- "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/omap.js"(exports2, module2) {
1133
- var Type = require_type();
1134
- var _hasOwnProperty = Object.prototype.hasOwnProperty;
1135
- var _toString = Object.prototype.toString;
1136
- function resolveYamlOmap(data) {
1137
- if (data === null) return true;
1138
- var objectKeys = [], index, length, pair, pairKey, pairHasKey, object = data;
1139
- for (index = 0, length = object.length; index < length; index += 1) {
1140
- pair = object[index];
1141
- pairHasKey = false;
1142
- if (_toString.call(pair) !== "[object Object]") return false;
1143
- for (pairKey in pair) {
1144
- if (_hasOwnProperty.call(pair, pairKey)) {
1145
- if (!pairHasKey) pairHasKey = true;
1146
- else return false;
1147
- }
1148
- }
1149
- if (!pairHasKey) return false;
1150
- if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);
1151
- else return false;
1152
- }
1153
- return true;
1154
- }
1155
- function constructYamlOmap(data) {
1156
- return data !== null ? data : [];
1157
- }
1158
- module2.exports = new Type("tag:yaml.org,2002:omap", {
1159
- kind: "sequence",
1160
- resolve: resolveYamlOmap,
1161
- construct: constructYamlOmap
1162
- });
1163
- }
1164
- });
1165
-
1166
- // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/pairs.js
1167
- var require_pairs = __commonJS({
1168
- "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/pairs.js"(exports2, module2) {
1169
- var Type = require_type();
1170
- var _toString = Object.prototype.toString;
1171
- function resolveYamlPairs(data) {
1172
- if (data === null) return true;
1173
- var index, length, pair, keys, result, object = data;
1174
- result = new Array(object.length);
1175
- for (index = 0, length = object.length; index < length; index += 1) {
1176
- pair = object[index];
1177
- if (_toString.call(pair) !== "[object Object]") return false;
1178
- keys = Object.keys(pair);
1179
- if (keys.length !== 1) return false;
1180
- result[index] = [keys[0], pair[keys[0]]];
1181
- }
1182
- return true;
1183
- }
1184
- function constructYamlPairs(data) {
1185
- if (data === null) return [];
1186
- var index, length, pair, keys, result, object = data;
1187
- result = new Array(object.length);
1188
- for (index = 0, length = object.length; index < length; index += 1) {
1189
- pair = object[index];
1190
- keys = Object.keys(pair);
1191
- result[index] = [keys[0], pair[keys[0]]];
1192
- }
1193
- return result;
1194
- }
1195
- module2.exports = new Type("tag:yaml.org,2002:pairs", {
1196
- kind: "sequence",
1197
- resolve: resolveYamlPairs,
1198
- construct: constructYamlPairs
1199
- });
1200
- }
1201
- });
1202
-
1203
- // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/set.js
1204
- var require_set = __commonJS({
1205
- "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/set.js"(exports2, module2) {
1206
- var Type = require_type();
1207
- var _hasOwnProperty = Object.prototype.hasOwnProperty;
1208
- function resolveYamlSet(data) {
1209
- if (data === null) return true;
1210
- var key, object = data;
1211
- for (key in object) {
1212
- if (_hasOwnProperty.call(object, key)) {
1213
- if (object[key] !== null) return false;
1214
- }
1215
- }
1216
- return true;
1217
- }
1218
- function constructYamlSet(data) {
1219
- return data !== null ? data : {};
1220
- }
1221
- module2.exports = new Type("tag:yaml.org,2002:set", {
1222
- kind: "mapping",
1223
- resolve: resolveYamlSet,
1224
- construct: constructYamlSet
1225
- });
1226
- }
1227
- });
1228
-
1229
- // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js
1230
- var require_default_safe = __commonJS({
1231
- "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js"(exports2, module2) {
1232
- var Schema = require_schema();
1233
- module2.exports = new Schema({
1234
- include: [
1235
- require_core()
1236
- ],
1237
- implicit: [
1238
- require_timestamp(),
1239
- require_merge()
1240
- ],
1241
- explicit: [
1242
- require_binary(),
1243
- require_omap(),
1244
- require_pairs(),
1245
- require_set()
1246
- ]
1247
- });
1248
- }
1249
- });
1250
-
1251
- // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js
1252
- var require_undefined = __commonJS({
1253
- "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js"(exports2, module2) {
1254
- var Type = require_type();
1255
- function resolveJavascriptUndefined() {
1256
- return true;
1257
- }
1258
- function constructJavascriptUndefined() {
1259
- return void 0;
1260
- }
1261
- function representJavascriptUndefined() {
1262
- return "";
1263
- }
1264
- function isUndefined(object) {
1265
- return typeof object === "undefined";
1266
- }
1267
- module2.exports = new Type("tag:yaml.org,2002:js/undefined", {
1268
- kind: "scalar",
1269
- resolve: resolveJavascriptUndefined,
1270
- construct: constructJavascriptUndefined,
1271
- predicate: isUndefined,
1272
- represent: representJavascriptUndefined
1273
- });
1274
- }
1275
- });
1276
-
1277
- // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js
1278
- var require_regexp = __commonJS({
1279
- "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js"(exports2, module2) {
1280
- var Type = require_type();
1281
- function resolveJavascriptRegExp(data) {
1282
- if (data === null) return false;
1283
- if (data.length === 0) return false;
1284
- var regexp = data, tail = /\/([gim]*)$/.exec(data), modifiers = "";
1285
- if (regexp[0] === "/") {
1286
- if (tail) modifiers = tail[1];
1287
- if (modifiers.length > 3) return false;
1288
- if (regexp[regexp.length - modifiers.length - 1] !== "/") return false;
1289
- }
1290
- return true;
1291
- }
1292
- function constructJavascriptRegExp(data) {
1293
- var regexp = data, tail = /\/([gim]*)$/.exec(data), modifiers = "";
1294
- if (regexp[0] === "/") {
1295
- if (tail) modifiers = tail[1];
1296
- regexp = regexp.slice(1, regexp.length - modifiers.length - 1);
1297
- }
1298
- return new RegExp(regexp, modifiers);
1299
- }
1300
- function representJavascriptRegExp(object) {
1301
- var result = "/" + object.source + "/";
1302
- if (object.global) result += "g";
1303
- if (object.multiline) result += "m";
1304
- if (object.ignoreCase) result += "i";
1305
- return result;
1306
- }
1307
- function isRegExp(object) {
1308
- return Object.prototype.toString.call(object) === "[object RegExp]";
1309
- }
1310
- module2.exports = new Type("tag:yaml.org,2002:js/regexp", {
1311
- kind: "scalar",
1312
- resolve: resolveJavascriptRegExp,
1313
- construct: constructJavascriptRegExp,
1314
- predicate: isRegExp,
1315
- represent: representJavascriptRegExp
1316
- });
1317
- }
1318
- });
1319
-
1320
- // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/js/function.js
1321
- var require_function = __commonJS({
1322
- "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/js/function.js"(exports2, module2) {
1323
- var esprima;
1324
- try {
1325
- _require = __require;
1326
- esprima = _require("esprima");
1327
- } catch (_) {
1328
- if (typeof window !== "undefined") esprima = window.esprima;
1329
- }
1330
- var _require;
1331
- var Type = require_type();
1332
- function resolveJavascriptFunction(data) {
1333
- if (data === null) return false;
1334
- try {
1335
- var source = "(" + data + ")", ast = esprima.parse(source, { range: true });
1336
- if (ast.type !== "Program" || ast.body.length !== 1 || ast.body[0].type !== "ExpressionStatement" || ast.body[0].expression.type !== "ArrowFunctionExpression" && ast.body[0].expression.type !== "FunctionExpression") {
1337
- return false;
1338
- }
1339
- return true;
1340
- } catch (err) {
1341
- return false;
1342
- }
1343
- }
1344
- function constructJavascriptFunction(data) {
1345
- var source = "(" + data + ")", ast = esprima.parse(source, { range: true }), params = [], body;
1346
- if (ast.type !== "Program" || ast.body.length !== 1 || ast.body[0].type !== "ExpressionStatement" || ast.body[0].expression.type !== "ArrowFunctionExpression" && ast.body[0].expression.type !== "FunctionExpression") {
1347
- throw new Error("Failed to resolve function");
1348
- }
1349
- ast.body[0].expression.params.forEach(function(param) {
1350
- params.push(param.name);
1351
- });
1352
- body = ast.body[0].expression.body.range;
1353
- if (ast.body[0].expression.body.type === "BlockStatement") {
1354
- return new Function(params, source.slice(body[0] + 1, body[1] - 1));
1355
- }
1356
- return new Function(params, "return " + source.slice(body[0], body[1]));
1357
- }
1358
- function representJavascriptFunction(object) {
1359
- return object.toString();
1360
- }
1361
- function isFunction(object) {
1362
- return Object.prototype.toString.call(object) === "[object Function]";
1363
- }
1364
- module2.exports = new Type("tag:yaml.org,2002:js/function", {
1365
- kind: "scalar",
1366
- resolve: resolveJavascriptFunction,
1367
- construct: constructJavascriptFunction,
1368
- predicate: isFunction,
1369
- represent: representJavascriptFunction
1370
- });
1371
- }
1372
- });
1373
-
1374
- // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/default_full.js
1375
- var require_default_full = __commonJS({
1376
- "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/default_full.js"(exports2, module2) {
1377
- var Schema = require_schema();
1378
- module2.exports = Schema.DEFAULT = new Schema({
1379
- include: [
1380
- require_default_safe()
1381
- ],
1382
- explicit: [
1383
- require_undefined(),
1384
- require_regexp(),
1385
- require_function()
1386
- ]
1387
- });
1388
- }
1389
- });
1390
-
1391
- // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/loader.js
1392
- var require_loader = __commonJS({
1393
- "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/loader.js"(exports2, module2) {
1394
- var common = require_common();
1395
- var YAMLException = require_exception();
1396
- var Mark = require_mark();
1397
- var DEFAULT_SAFE_SCHEMA = require_default_safe();
1398
- var DEFAULT_FULL_SCHEMA = require_default_full();
1399
- var _hasOwnProperty = Object.prototype.hasOwnProperty;
1400
- var CONTEXT_FLOW_IN = 1;
1401
- var CONTEXT_FLOW_OUT = 2;
1402
- var CONTEXT_BLOCK_IN = 3;
1403
- var CONTEXT_BLOCK_OUT = 4;
1404
- var CHOMPING_CLIP = 1;
1405
- var CHOMPING_STRIP = 2;
1406
- var CHOMPING_KEEP = 3;
1407
- var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
1408
- var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
1409
- var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
1410
- var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
1411
- var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
1412
- function _class(obj) {
1413
- return Object.prototype.toString.call(obj);
1414
- }
1415
- function is_EOL(c) {
1416
- return c === 10 || c === 13;
1417
- }
1418
- function is_WHITE_SPACE(c) {
1419
- return c === 9 || c === 32;
1420
- }
1421
- function is_WS_OR_EOL(c) {
1422
- return c === 9 || c === 32 || c === 10 || c === 13;
1423
- }
1424
- function is_FLOW_INDICATOR(c) {
1425
- return c === 44 || c === 91 || c === 93 || c === 123 || c === 125;
1426
- }
1427
- function fromHexCode(c) {
1428
- var lc;
1429
- if (48 <= c && c <= 57) {
1430
- return c - 48;
1431
- }
1432
- lc = c | 32;
1433
- if (97 <= lc && lc <= 102) {
1434
- return lc - 97 + 10;
1435
- }
1436
- return -1;
1437
- }
1438
- function escapedHexLen(c) {
1439
- if (c === 120) {
1440
- return 2;
1441
- }
1442
- if (c === 117) {
1443
- return 4;
1444
- }
1445
- if (c === 85) {
1446
- return 8;
1447
- }
1448
- return 0;
1449
- }
1450
- function fromDecimalCode(c) {
1451
- if (48 <= c && c <= 57) {
1452
- return c - 48;
1453
- }
1454
- return -1;
1455
- }
1456
- function simpleEscapeSequence(c) {
1457
- return c === 48 ? "\0" : c === 97 ? "\x07" : c === 98 ? "\b" : c === 116 ? " " : c === 9 ? " " : c === 110 ? "\n" : c === 118 ? "\v" : c === 102 ? "\f" : c === 114 ? "\r" : c === 101 ? "\x1B" : c === 32 ? " " : c === 34 ? '"' : c === 47 ? "/" : c === 92 ? "\\" : c === 78 ? "\x85" : c === 95 ? "\xA0" : c === 76 ? "\u2028" : c === 80 ? "\u2029" : "";
1458
- }
1459
- function charFromCodepoint(c) {
1460
- if (c <= 65535) {
1461
- return String.fromCharCode(c);
1462
- }
1463
- return String.fromCharCode(
1464
- (c - 65536 >> 10) + 55296,
1465
- (c - 65536 & 1023) + 56320
1466
- );
1467
- }
1468
- function setProperty(object, key, value) {
1469
- if (key === "__proto__") {
1470
- Object.defineProperty(object, key, {
1471
- configurable: true,
1472
- enumerable: true,
1473
- writable: true,
1474
- value
1475
- });
1476
- } else {
1477
- object[key] = value;
1478
- }
1479
- }
1480
- var simpleEscapeCheck = new Array(256);
1481
- var simpleEscapeMap = new Array(256);
1482
- for (i = 0; i < 256; i++) {
1483
- simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
1484
- simpleEscapeMap[i] = simpleEscapeSequence(i);
1485
- }
1486
- var i;
1487
- function State(input, options2) {
1488
- this.input = input;
1489
- this.filename = options2["filename"] || null;
1490
- this.schema = options2["schema"] || DEFAULT_FULL_SCHEMA;
1491
- this.onWarning = options2["onWarning"] || null;
1492
- this.legacy = options2["legacy"] || false;
1493
- this.json = options2["json"] || false;
1494
- this.listener = options2["listener"] || null;
1495
- this.implicitTypes = this.schema.compiledImplicit;
1496
- this.typeMap = this.schema.compiledTypeMap;
1497
- this.length = input.length;
1498
- this.position = 0;
1499
- this.line = 0;
1500
- this.lineStart = 0;
1501
- this.lineIndent = 0;
1502
- this.documents = [];
1503
- }
1504
- function generateError(state, message) {
1505
- return new YAMLException(
1506
- message,
1507
- new Mark(state.filename, state.input, state.position, state.line, state.position - state.lineStart)
1508
- );
1509
- }
1510
- function throwError(state, message) {
1511
- throw generateError(state, message);
1512
- }
1513
- function throwWarning(state, message) {
1514
- if (state.onWarning) {
1515
- state.onWarning.call(null, generateError(state, message));
1516
- }
1517
- }
1518
- var directiveHandlers = {
1519
- YAML: function handleYamlDirective(state, name, args) {
1520
- var match, major, minor;
1521
- if (state.version !== null) {
1522
- throwError(state, "duplication of %YAML directive");
1523
- }
1524
- if (args.length !== 1) {
1525
- throwError(state, "YAML directive accepts exactly one argument");
1526
- }
1527
- match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
1528
- if (match === null) {
1529
- throwError(state, "ill-formed argument of the YAML directive");
1530
- }
1531
- major = parseInt(match[1], 10);
1532
- minor = parseInt(match[2], 10);
1533
- if (major !== 1) {
1534
- throwError(state, "unacceptable YAML version of the document");
1535
- }
1536
- state.version = args[0];
1537
- state.checkLineBreaks = minor < 2;
1538
- if (minor !== 1 && minor !== 2) {
1539
- throwWarning(state, "unsupported YAML version of the document");
1540
- }
1541
- },
1542
- TAG: function handleTagDirective(state, name, args) {
1543
- var handle, prefix;
1544
- if (args.length !== 2) {
1545
- throwError(state, "TAG directive accepts exactly two arguments");
1546
- }
1547
- handle = args[0];
1548
- prefix = args[1];
1549
- if (!PATTERN_TAG_HANDLE.test(handle)) {
1550
- throwError(state, "ill-formed tag handle (first argument) of the TAG directive");
1551
- }
1552
- if (_hasOwnProperty.call(state.tagMap, handle)) {
1553
- throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
1554
- }
1555
- if (!PATTERN_TAG_URI.test(prefix)) {
1556
- throwError(state, "ill-formed tag prefix (second argument) of the TAG directive");
1557
- }
1558
- state.tagMap[handle] = prefix;
1559
- }
1560
- };
1561
- function captureSegment(state, start, end, checkJson) {
1562
- var _position, _length, _character, _result;
1563
- if (start < end) {
1564
- _result = state.input.slice(start, end);
1565
- if (checkJson) {
1566
- for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
1567
- _character = _result.charCodeAt(_position);
1568
- if (!(_character === 9 || 32 <= _character && _character <= 1114111)) {
1569
- throwError(state, "expected valid JSON character");
1570
- }
1571
- }
1572
- } else if (PATTERN_NON_PRINTABLE.test(_result)) {
1573
- throwError(state, "the stream contains non-printable characters");
1574
- }
1575
- state.result += _result;
1576
- }
1577
- }
1578
- function mergeMappings(state, destination, source, overridableKeys) {
1579
- var sourceKeys, key, index, quantity;
1580
- if (!common.isObject(source)) {
1581
- throwError(state, "cannot merge mappings; the provided source object is unacceptable");
1582
- }
1583
- sourceKeys = Object.keys(source);
1584
- for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
1585
- key = sourceKeys[index];
1586
- if (!_hasOwnProperty.call(destination, key)) {
1587
- setProperty(destination, key, source[key]);
1588
- overridableKeys[key] = true;
1589
- }
1590
- }
1591
- }
1592
- function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) {
1593
- var index, quantity;
1594
- if (Array.isArray(keyNode)) {
1595
- keyNode = Array.prototype.slice.call(keyNode);
1596
- for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {
1597
- if (Array.isArray(keyNode[index])) {
1598
- throwError(state, "nested arrays are not supported inside keys");
1599
- }
1600
- if (typeof keyNode === "object" && _class(keyNode[index]) === "[object Object]") {
1601
- keyNode[index] = "[object Object]";
1602
- }
1603
- }
1604
- }
1605
- if (typeof keyNode === "object" && _class(keyNode) === "[object Object]") {
1606
- keyNode = "[object Object]";
1607
- }
1608
- keyNode = String(keyNode);
1609
- if (_result === null) {
1610
- _result = {};
1611
- }
1612
- if (keyTag === "tag:yaml.org,2002:merge") {
1613
- if (Array.isArray(valueNode)) {
1614
- for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {
1615
- mergeMappings(state, _result, valueNode[index], overridableKeys);
1616
- }
1617
- } else {
1618
- mergeMappings(state, _result, valueNode, overridableKeys);
1619
- }
1620
- } else {
1621
- if (!state.json && !_hasOwnProperty.call(overridableKeys, keyNode) && _hasOwnProperty.call(_result, keyNode)) {
1622
- state.line = startLine || state.line;
1623
- state.position = startPos || state.position;
1624
- throwError(state, "duplicated mapping key");
1625
- }
1626
- setProperty(_result, keyNode, valueNode);
1627
- delete overridableKeys[keyNode];
1628
- }
1629
- return _result;
1630
- }
1631
- function readLineBreak(state) {
1632
- var ch;
1633
- ch = state.input.charCodeAt(state.position);
1634
- if (ch === 10) {
1635
- state.position++;
1636
- } else if (ch === 13) {
1637
- state.position++;
1638
- if (state.input.charCodeAt(state.position) === 10) {
1639
- state.position++;
1640
- }
1641
- } else {
1642
- throwError(state, "a line break is expected");
1643
- }
1644
- state.line += 1;
1645
- state.lineStart = state.position;
1646
- }
1647
- function skipSeparationSpace(state, allowComments, checkIndent) {
1648
- var lineBreaks = 0, ch = state.input.charCodeAt(state.position);
1649
- while (ch !== 0) {
1650
- while (is_WHITE_SPACE(ch)) {
1651
- ch = state.input.charCodeAt(++state.position);
1652
- }
1653
- if (allowComments && ch === 35) {
1654
- do {
1655
- ch = state.input.charCodeAt(++state.position);
1656
- } while (ch !== 10 && ch !== 13 && ch !== 0);
1657
- }
1658
- if (is_EOL(ch)) {
1659
- readLineBreak(state);
1660
- ch = state.input.charCodeAt(state.position);
1661
- lineBreaks++;
1662
- state.lineIndent = 0;
1663
- while (ch === 32) {
1664
- state.lineIndent++;
1665
- ch = state.input.charCodeAt(++state.position);
1666
- }
1667
- } else {
1668
- break;
1669
- }
1670
- }
1671
- if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {
1672
- throwWarning(state, "deficient indentation");
1673
- }
1674
- return lineBreaks;
1675
- }
1676
- function testDocumentSeparator(state) {
1677
- var _position = state.position, ch;
1678
- ch = state.input.charCodeAt(_position);
1679
- if ((ch === 45 || ch === 46) && ch === state.input.charCodeAt(_position + 1) && ch === state.input.charCodeAt(_position + 2)) {
1680
- _position += 3;
1681
- ch = state.input.charCodeAt(_position);
1682
- if (ch === 0 || is_WS_OR_EOL(ch)) {
1683
- return true;
1684
- }
1685
- }
1686
- return false;
1687
- }
1688
- function writeFoldedLines(state, count) {
1689
- if (count === 1) {
1690
- state.result += " ";
1691
- } else if (count > 1) {
1692
- state.result += common.repeat("\n", count - 1);
1693
- }
1694
- }
1695
- function readPlainScalar(state, nodeIndent, withinFlowCollection) {
1696
- var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state.kind, _result = state.result, ch;
1697
- ch = state.input.charCodeAt(state.position);
1698
- if (is_WS_OR_EOL(ch) || is_FLOW_INDICATOR(ch) || ch === 35 || ch === 38 || ch === 42 || ch === 33 || ch === 124 || ch === 62 || ch === 39 || ch === 34 || ch === 37 || ch === 64 || ch === 96) {
1699
- return false;
1700
- }
1701
- if (ch === 63 || ch === 45) {
1702
- following = state.input.charCodeAt(state.position + 1);
1703
- if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
1704
- return false;
1705
- }
1706
- }
1707
- state.kind = "scalar";
1708
- state.result = "";
1709
- captureStart = captureEnd = state.position;
1710
- hasPendingContent = false;
1711
- while (ch !== 0) {
1712
- if (ch === 58) {
1713
- following = state.input.charCodeAt(state.position + 1);
1714
- if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
1715
- break;
1716
- }
1717
- } else if (ch === 35) {
1718
- preceding = state.input.charCodeAt(state.position - 1);
1719
- if (is_WS_OR_EOL(preceding)) {
1720
- break;
1721
- }
1722
- } else if (state.position === state.lineStart && testDocumentSeparator(state) || withinFlowCollection && is_FLOW_INDICATOR(ch)) {
1723
- break;
1724
- } else if (is_EOL(ch)) {
1725
- _line = state.line;
1726
- _lineStart = state.lineStart;
1727
- _lineIndent = state.lineIndent;
1728
- skipSeparationSpace(state, false, -1);
1729
- if (state.lineIndent >= nodeIndent) {
1730
- hasPendingContent = true;
1731
- ch = state.input.charCodeAt(state.position);
1732
- continue;
1733
- } else {
1734
- state.position = captureEnd;
1735
- state.line = _line;
1736
- state.lineStart = _lineStart;
1737
- state.lineIndent = _lineIndent;
1738
- break;
1739
- }
1740
- }
1741
- if (hasPendingContent) {
1742
- captureSegment(state, captureStart, captureEnd, false);
1743
- writeFoldedLines(state, state.line - _line);
1744
- captureStart = captureEnd = state.position;
1745
- hasPendingContent = false;
1746
- }
1747
- if (!is_WHITE_SPACE(ch)) {
1748
- captureEnd = state.position + 1;
1749
- }
1750
- ch = state.input.charCodeAt(++state.position);
1751
- }
1752
- captureSegment(state, captureStart, captureEnd, false);
1753
- if (state.result) {
1754
- return true;
1755
- }
1756
- state.kind = _kind;
1757
- state.result = _result;
1758
- return false;
1759
- }
1760
- function readSingleQuotedScalar(state, nodeIndent) {
1761
- var ch, captureStart, captureEnd;
1762
- ch = state.input.charCodeAt(state.position);
1763
- if (ch !== 39) {
1764
- return false;
1765
- }
1766
- state.kind = "scalar";
1767
- state.result = "";
1768
- state.position++;
1769
- captureStart = captureEnd = state.position;
1770
- while ((ch = state.input.charCodeAt(state.position)) !== 0) {
1771
- if (ch === 39) {
1772
- captureSegment(state, captureStart, state.position, true);
1773
- ch = state.input.charCodeAt(++state.position);
1774
- if (ch === 39) {
1775
- captureStart = state.position;
1776
- state.position++;
1777
- captureEnd = state.position;
1778
- } else {
1779
- return true;
1780
- }
1781
- } else if (is_EOL(ch)) {
1782
- captureSegment(state, captureStart, captureEnd, true);
1783
- writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
1784
- captureStart = captureEnd = state.position;
1785
- } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
1786
- throwError(state, "unexpected end of the document within a single quoted scalar");
1787
- } else {
1788
- state.position++;
1789
- captureEnd = state.position;
1790
- }
1791
- }
1792
- throwError(state, "unexpected end of the stream within a single quoted scalar");
1793
- }
1794
- function readDoubleQuotedScalar(state, nodeIndent) {
1795
- var captureStart, captureEnd, hexLength, hexResult, tmp, ch;
1796
- ch = state.input.charCodeAt(state.position);
1797
- if (ch !== 34) {
1798
- return false;
1799
- }
1800
- state.kind = "scalar";
1801
- state.result = "";
1802
- state.position++;
1803
- captureStart = captureEnd = state.position;
1804
- while ((ch = state.input.charCodeAt(state.position)) !== 0) {
1805
- if (ch === 34) {
1806
- captureSegment(state, captureStart, state.position, true);
1807
- state.position++;
1808
- return true;
1809
- } else if (ch === 92) {
1810
- captureSegment(state, captureStart, state.position, true);
1811
- ch = state.input.charCodeAt(++state.position);
1812
- if (is_EOL(ch)) {
1813
- skipSeparationSpace(state, false, nodeIndent);
1814
- } else if (ch < 256 && simpleEscapeCheck[ch]) {
1815
- state.result += simpleEscapeMap[ch];
1816
- state.position++;
1817
- } else if ((tmp = escapedHexLen(ch)) > 0) {
1818
- hexLength = tmp;
1819
- hexResult = 0;
1820
- for (; hexLength > 0; hexLength--) {
1821
- ch = state.input.charCodeAt(++state.position);
1822
- if ((tmp = fromHexCode(ch)) >= 0) {
1823
- hexResult = (hexResult << 4) + tmp;
1824
- } else {
1825
- throwError(state, "expected hexadecimal character");
1826
- }
1827
- }
1828
- state.result += charFromCodepoint(hexResult);
1829
- state.position++;
1830
- } else {
1831
- throwError(state, "unknown escape sequence");
1832
- }
1833
- captureStart = captureEnd = state.position;
1834
- } else if (is_EOL(ch)) {
1835
- captureSegment(state, captureStart, captureEnd, true);
1836
- writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
1837
- captureStart = captureEnd = state.position;
1838
- } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
1839
- throwError(state, "unexpected end of the document within a double quoted scalar");
1840
- } else {
1841
- state.position++;
1842
- captureEnd = state.position;
1843
- }
1844
- }
1845
- throwError(state, "unexpected end of the stream within a double quoted scalar");
1846
- }
1847
- function readFlowCollection(state, nodeIndent) {
1848
- var readNext = true, _line, _tag = state.tag, _result, _anchor = state.anchor, following, terminator, isPair, isExplicitPair, isMapping, overridableKeys = {}, keyNode, keyTag, valueNode, ch;
1849
- ch = state.input.charCodeAt(state.position);
1850
- if (ch === 91) {
1851
- terminator = 93;
1852
- isMapping = false;
1853
- _result = [];
1854
- } else if (ch === 123) {
1855
- terminator = 125;
1856
- isMapping = true;
1857
- _result = {};
1858
- } else {
1859
- return false;
1860
- }
1861
- if (state.anchor !== null) {
1862
- state.anchorMap[state.anchor] = _result;
1863
- }
1864
- ch = state.input.charCodeAt(++state.position);
1865
- while (ch !== 0) {
1866
- skipSeparationSpace(state, true, nodeIndent);
1867
- ch = state.input.charCodeAt(state.position);
1868
- if (ch === terminator) {
1869
- state.position++;
1870
- state.tag = _tag;
1871
- state.anchor = _anchor;
1872
- state.kind = isMapping ? "mapping" : "sequence";
1873
- state.result = _result;
1874
- return true;
1875
- } else if (!readNext) {
1876
- throwError(state, "missed comma between flow collection entries");
1877
- }
1878
- keyTag = keyNode = valueNode = null;
1879
- isPair = isExplicitPair = false;
1880
- if (ch === 63) {
1881
- following = state.input.charCodeAt(state.position + 1);
1882
- if (is_WS_OR_EOL(following)) {
1883
- isPair = isExplicitPair = true;
1884
- state.position++;
1885
- skipSeparationSpace(state, true, nodeIndent);
1886
- }
1887
- }
1888
- _line = state.line;
1889
- composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
1890
- keyTag = state.tag;
1891
- keyNode = state.result;
1892
- skipSeparationSpace(state, true, nodeIndent);
1893
- ch = state.input.charCodeAt(state.position);
1894
- if ((isExplicitPair || state.line === _line) && ch === 58) {
1895
- isPair = true;
1896
- ch = state.input.charCodeAt(++state.position);
1897
- skipSeparationSpace(state, true, nodeIndent);
1898
- composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
1899
- valueNode = state.result;
1900
- }
1901
- if (isMapping) {
1902
- storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode);
1903
- } else if (isPair) {
1904
- _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode));
1905
- } else {
1906
- _result.push(keyNode);
1907
- }
1908
- skipSeparationSpace(state, true, nodeIndent);
1909
- ch = state.input.charCodeAt(state.position);
1910
- if (ch === 44) {
1911
- readNext = true;
1912
- ch = state.input.charCodeAt(++state.position);
1913
- } else {
1914
- readNext = false;
1915
- }
1916
- }
1917
- throwError(state, "unexpected end of the stream within a flow collection");
1918
- }
1919
- function readBlockScalar(state, nodeIndent) {
1920
- var captureStart, folding, chomping = CHOMPING_CLIP, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch;
1921
- ch = state.input.charCodeAt(state.position);
1922
- if (ch === 124) {
1923
- folding = false;
1924
- } else if (ch === 62) {
1925
- folding = true;
1926
- } else {
1927
- return false;
1928
- }
1929
- state.kind = "scalar";
1930
- state.result = "";
1931
- while (ch !== 0) {
1932
- ch = state.input.charCodeAt(++state.position);
1933
- if (ch === 43 || ch === 45) {
1934
- if (CHOMPING_CLIP === chomping) {
1935
- chomping = ch === 43 ? CHOMPING_KEEP : CHOMPING_STRIP;
1936
- } else {
1937
- throwError(state, "repeat of a chomping mode identifier");
1938
- }
1939
- } else if ((tmp = fromDecimalCode(ch)) >= 0) {
1940
- if (tmp === 0) {
1941
- throwError(state, "bad explicit indentation width of a block scalar; it cannot be less than one");
1942
- } else if (!detectedIndent) {
1943
- textIndent = nodeIndent + tmp - 1;
1944
- detectedIndent = true;
1945
- } else {
1946
- throwError(state, "repeat of an indentation width identifier");
1947
- }
1948
- } else {
1949
- break;
1950
- }
1951
- }
1952
- if (is_WHITE_SPACE(ch)) {
1953
- do {
1954
- ch = state.input.charCodeAt(++state.position);
1955
- } while (is_WHITE_SPACE(ch));
1956
- if (ch === 35) {
1957
- do {
1958
- ch = state.input.charCodeAt(++state.position);
1959
- } while (!is_EOL(ch) && ch !== 0);
1960
- }
1961
- }
1962
- while (ch !== 0) {
1963
- readLineBreak(state);
1964
- state.lineIndent = 0;
1965
- ch = state.input.charCodeAt(state.position);
1966
- while ((!detectedIndent || state.lineIndent < textIndent) && ch === 32) {
1967
- state.lineIndent++;
1968
- ch = state.input.charCodeAt(++state.position);
1969
- }
1970
- if (!detectedIndent && state.lineIndent > textIndent) {
1971
- textIndent = state.lineIndent;
1972
- }
1973
- if (is_EOL(ch)) {
1974
- emptyLines++;
1975
- continue;
1976
- }
1977
- if (state.lineIndent < textIndent) {
1978
- if (chomping === CHOMPING_KEEP) {
1979
- state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
1980
- } else if (chomping === CHOMPING_CLIP) {
1981
- if (didReadContent) {
1982
- state.result += "\n";
1983
- }
1984
- }
1985
- break;
1986
- }
1987
- if (folding) {
1988
- if (is_WHITE_SPACE(ch)) {
1989
- atMoreIndented = true;
1990
- state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
1991
- } else if (atMoreIndented) {
1992
- atMoreIndented = false;
1993
- state.result += common.repeat("\n", emptyLines + 1);
1994
- } else if (emptyLines === 0) {
1995
- if (didReadContent) {
1996
- state.result += " ";
1997
- }
1998
- } else {
1999
- state.result += common.repeat("\n", emptyLines);
2000
- }
2001
- } else {
2002
- state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
2003
- }
2004
- didReadContent = true;
2005
- detectedIndent = true;
2006
- emptyLines = 0;
2007
- captureStart = state.position;
2008
- while (!is_EOL(ch) && ch !== 0) {
2009
- ch = state.input.charCodeAt(++state.position);
2010
- }
2011
- captureSegment(state, captureStart, state.position, false);
2012
- }
2013
- return true;
2014
- }
2015
- function readBlockSequence(state, nodeIndent) {
2016
- var _line, _tag = state.tag, _anchor = state.anchor, _result = [], following, detected = false, ch;
2017
- if (state.anchor !== null) {
2018
- state.anchorMap[state.anchor] = _result;
2019
- }
2020
- ch = state.input.charCodeAt(state.position);
2021
- while (ch !== 0) {
2022
- if (ch !== 45) {
2023
- break;
2024
- }
2025
- following = state.input.charCodeAt(state.position + 1);
2026
- if (!is_WS_OR_EOL(following)) {
2027
- break;
2028
- }
2029
- detected = true;
2030
- state.position++;
2031
- if (skipSeparationSpace(state, true, -1)) {
2032
- if (state.lineIndent <= nodeIndent) {
2033
- _result.push(null);
2034
- ch = state.input.charCodeAt(state.position);
2035
- continue;
2036
- }
2037
- }
2038
- _line = state.line;
2039
- composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
2040
- _result.push(state.result);
2041
- skipSeparationSpace(state, true, -1);
2042
- ch = state.input.charCodeAt(state.position);
2043
- if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) {
2044
- throwError(state, "bad indentation of a sequence entry");
2045
- } else if (state.lineIndent < nodeIndent) {
2046
- break;
2047
- }
2048
- }
2049
- if (detected) {
2050
- state.tag = _tag;
2051
- state.anchor = _anchor;
2052
- state.kind = "sequence";
2053
- state.result = _result;
2054
- return true;
2055
- }
2056
- return false;
2057
- }
2058
- function readBlockMapping(state, nodeIndent, flowIndent) {
2059
- var following, allowCompact, _line, _pos, _tag = state.tag, _anchor = state.anchor, _result = {}, overridableKeys = {}, keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch;
2060
- if (state.anchor !== null) {
2061
- state.anchorMap[state.anchor] = _result;
2062
- }
2063
- ch = state.input.charCodeAt(state.position);
2064
- while (ch !== 0) {
2065
- following = state.input.charCodeAt(state.position + 1);
2066
- _line = state.line;
2067
- _pos = state.position;
2068
- if ((ch === 63 || ch === 58) && is_WS_OR_EOL(following)) {
2069
- if (ch === 63) {
2070
- if (atExplicitKey) {
2071
- storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
2072
- keyTag = keyNode = valueNode = null;
2073
- }
2074
- detected = true;
2075
- atExplicitKey = true;
2076
- allowCompact = true;
2077
- } else if (atExplicitKey) {
2078
- atExplicitKey = false;
2079
- allowCompact = true;
2080
- } else {
2081
- throwError(state, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");
2082
- }
2083
- state.position += 1;
2084
- ch = following;
2085
- } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
2086
- if (state.line === _line) {
2087
- ch = state.input.charCodeAt(state.position);
2088
- while (is_WHITE_SPACE(ch)) {
2089
- ch = state.input.charCodeAt(++state.position);
2090
- }
2091
- if (ch === 58) {
2092
- ch = state.input.charCodeAt(++state.position);
2093
- if (!is_WS_OR_EOL(ch)) {
2094
- throwError(state, "a whitespace character is expected after the key-value separator within a block mapping");
2095
- }
2096
- if (atExplicitKey) {
2097
- storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
2098
- keyTag = keyNode = valueNode = null;
2099
- }
2100
- detected = true;
2101
- atExplicitKey = false;
2102
- allowCompact = false;
2103
- keyTag = state.tag;
2104
- keyNode = state.result;
2105
- } else if (detected) {
2106
- throwError(state, "can not read an implicit mapping pair; a colon is missed");
2107
- } else {
2108
- state.tag = _tag;
2109
- state.anchor = _anchor;
2110
- return true;
2111
- }
2112
- } else if (detected) {
2113
- throwError(state, "can not read a block mapping entry; a multiline key may not be an implicit key");
2114
- } else {
2115
- state.tag = _tag;
2116
- state.anchor = _anchor;
2117
- return true;
2118
- }
2119
- } else {
2120
- break;
2121
- }
2122
- if (state.line === _line || state.lineIndent > nodeIndent) {
2123
- if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
2124
- if (atExplicitKey) {
2125
- keyNode = state.result;
2126
- } else {
2127
- valueNode = state.result;
2128
- }
2129
- }
2130
- if (!atExplicitKey) {
2131
- storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos);
2132
- keyTag = keyNode = valueNode = null;
2133
- }
2134
- skipSeparationSpace(state, true, -1);
2135
- ch = state.input.charCodeAt(state.position);
2136
- }
2137
- if (state.lineIndent > nodeIndent && ch !== 0) {
2138
- throwError(state, "bad indentation of a mapping entry");
2139
- } else if (state.lineIndent < nodeIndent) {
2140
- break;
2141
- }
2142
- }
2143
- if (atExplicitKey) {
2144
- storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
2145
- }
2146
- if (detected) {
2147
- state.tag = _tag;
2148
- state.anchor = _anchor;
2149
- state.kind = "mapping";
2150
- state.result = _result;
2151
- }
2152
- return detected;
2153
- }
2154
- function readTagProperty(state) {
2155
- var _position, isVerbatim = false, isNamed = false, tagHandle, tagName, ch;
2156
- ch = state.input.charCodeAt(state.position);
2157
- if (ch !== 33) return false;
2158
- if (state.tag !== null) {
2159
- throwError(state, "duplication of a tag property");
2160
- }
2161
- ch = state.input.charCodeAt(++state.position);
2162
- if (ch === 60) {
2163
- isVerbatim = true;
2164
- ch = state.input.charCodeAt(++state.position);
2165
- } else if (ch === 33) {
2166
- isNamed = true;
2167
- tagHandle = "!!";
2168
- ch = state.input.charCodeAt(++state.position);
2169
- } else {
2170
- tagHandle = "!";
2171
- }
2172
- _position = state.position;
2173
- if (isVerbatim) {
2174
- do {
2175
- ch = state.input.charCodeAt(++state.position);
2176
- } while (ch !== 0 && ch !== 62);
2177
- if (state.position < state.length) {
2178
- tagName = state.input.slice(_position, state.position);
2179
- ch = state.input.charCodeAt(++state.position);
2180
- } else {
2181
- throwError(state, "unexpected end of the stream within a verbatim tag");
2182
- }
2183
- } else {
2184
- while (ch !== 0 && !is_WS_OR_EOL(ch)) {
2185
- if (ch === 33) {
2186
- if (!isNamed) {
2187
- tagHandle = state.input.slice(_position - 1, state.position + 1);
2188
- if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
2189
- throwError(state, "named tag handle cannot contain such characters");
2190
- }
2191
- isNamed = true;
2192
- _position = state.position + 1;
2193
- } else {
2194
- throwError(state, "tag suffix cannot contain exclamation marks");
2195
- }
2196
- }
2197
- ch = state.input.charCodeAt(++state.position);
2198
- }
2199
- tagName = state.input.slice(_position, state.position);
2200
- if (PATTERN_FLOW_INDICATORS.test(tagName)) {
2201
- throwError(state, "tag suffix cannot contain flow indicator characters");
2202
- }
2203
- }
2204
- if (tagName && !PATTERN_TAG_URI.test(tagName)) {
2205
- throwError(state, "tag name cannot contain such characters: " + tagName);
2206
- }
2207
- if (isVerbatim) {
2208
- state.tag = tagName;
2209
- } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {
2210
- state.tag = state.tagMap[tagHandle] + tagName;
2211
- } else if (tagHandle === "!") {
2212
- state.tag = "!" + tagName;
2213
- } else if (tagHandle === "!!") {
2214
- state.tag = "tag:yaml.org,2002:" + tagName;
2215
- } else {
2216
- throwError(state, 'undeclared tag handle "' + tagHandle + '"');
2217
- }
2218
- return true;
2219
- }
2220
- function readAnchorProperty(state) {
2221
- var _position, ch;
2222
- ch = state.input.charCodeAt(state.position);
2223
- if (ch !== 38) return false;
2224
- if (state.anchor !== null) {
2225
- throwError(state, "duplication of an anchor property");
2226
- }
2227
- ch = state.input.charCodeAt(++state.position);
2228
- _position = state.position;
2229
- while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
2230
- ch = state.input.charCodeAt(++state.position);
2231
- }
2232
- if (state.position === _position) {
2233
- throwError(state, "name of an anchor node must contain at least one character");
2234
- }
2235
- state.anchor = state.input.slice(_position, state.position);
2236
- return true;
2237
- }
2238
- function readAlias(state) {
2239
- var _position, alias, ch;
2240
- ch = state.input.charCodeAt(state.position);
2241
- if (ch !== 42) return false;
2242
- ch = state.input.charCodeAt(++state.position);
2243
- _position = state.position;
2244
- while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
2245
- ch = state.input.charCodeAt(++state.position);
2246
- }
2247
- if (state.position === _position) {
2248
- throwError(state, "name of an alias node must contain at least one character");
2249
- }
2250
- alias = state.input.slice(_position, state.position);
2251
- if (!_hasOwnProperty.call(state.anchorMap, alias)) {
2252
- throwError(state, 'unidentified alias "' + alias + '"');
2253
- }
2254
- state.result = state.anchorMap[alias];
2255
- skipSeparationSpace(state, true, -1);
2256
- return true;
2257
- }
2258
- function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
2259
- var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, type, flowIndent, blockIndent;
2260
- if (state.listener !== null) {
2261
- state.listener("open", state);
2262
- }
2263
- state.tag = null;
2264
- state.anchor = null;
2265
- state.kind = null;
2266
- state.result = null;
2267
- allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext;
2268
- if (allowToSeek) {
2269
- if (skipSeparationSpace(state, true, -1)) {
2270
- atNewLine = true;
2271
- if (state.lineIndent > parentIndent) {
2272
- indentStatus = 1;
2273
- } else if (state.lineIndent === parentIndent) {
2274
- indentStatus = 0;
2275
- } else if (state.lineIndent < parentIndent) {
2276
- indentStatus = -1;
2277
- }
2278
- }
2279
- }
2280
- if (indentStatus === 1) {
2281
- while (readTagProperty(state) || readAnchorProperty(state)) {
2282
- if (skipSeparationSpace(state, true, -1)) {
2283
- atNewLine = true;
2284
- allowBlockCollections = allowBlockStyles;
2285
- if (state.lineIndent > parentIndent) {
2286
- indentStatus = 1;
2287
- } else if (state.lineIndent === parentIndent) {
2288
- indentStatus = 0;
2289
- } else if (state.lineIndent < parentIndent) {
2290
- indentStatus = -1;
2291
- }
2292
- } else {
2293
- allowBlockCollections = false;
2294
- }
2295
- }
2296
- }
2297
- if (allowBlockCollections) {
2298
- allowBlockCollections = atNewLine || allowCompact;
2299
- }
2300
- if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
2301
- if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
2302
- flowIndent = parentIndent;
2303
- } else {
2304
- flowIndent = parentIndent + 1;
2305
- }
2306
- blockIndent = state.position - state.lineStart;
2307
- if (indentStatus === 1) {
2308
- if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || readFlowCollection(state, flowIndent)) {
2309
- hasContent = true;
2310
- } else {
2311
- if (allowBlockScalars && readBlockScalar(state, flowIndent) || readSingleQuotedScalar(state, flowIndent) || readDoubleQuotedScalar(state, flowIndent)) {
2312
- hasContent = true;
2313
- } else if (readAlias(state)) {
2314
- hasContent = true;
2315
- if (state.tag !== null || state.anchor !== null) {
2316
- throwError(state, "alias node should not have any properties");
2317
- }
2318
- } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
2319
- hasContent = true;
2320
- if (state.tag === null) {
2321
- state.tag = "?";
2322
- }
2323
- }
2324
- if (state.anchor !== null) {
2325
- state.anchorMap[state.anchor] = state.result;
2326
- }
2327
- }
2328
- } else if (indentStatus === 0) {
2329
- hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
2330
- }
2331
- }
2332
- if (state.tag !== null && state.tag !== "!") {
2333
- if (state.tag === "?") {
2334
- if (state.result !== null && state.kind !== "scalar") {
2335
- throwError(state, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state.kind + '"');
2336
- }
2337
- for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
2338
- type = state.implicitTypes[typeIndex];
2339
- if (type.resolve(state.result)) {
2340
- state.result = type.construct(state.result);
2341
- state.tag = type.tag;
2342
- if (state.anchor !== null) {
2343
- state.anchorMap[state.anchor] = state.result;
2344
- }
2345
- break;
2346
- }
2347
- }
2348
- } else if (_hasOwnProperty.call(state.typeMap[state.kind || "fallback"], state.tag)) {
2349
- type = state.typeMap[state.kind || "fallback"][state.tag];
2350
- if (state.result !== null && type.kind !== state.kind) {
2351
- throwError(state, "unacceptable node kind for !<" + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"');
2352
- }
2353
- if (!type.resolve(state.result)) {
2354
- throwError(state, "cannot resolve a node with !<" + state.tag + "> explicit tag");
2355
- } else {
2356
- state.result = type.construct(state.result);
2357
- if (state.anchor !== null) {
2358
- state.anchorMap[state.anchor] = state.result;
2359
- }
2360
- }
2361
- } else {
2362
- throwError(state, "unknown tag !<" + state.tag + ">");
2363
- }
2364
- }
2365
- if (state.listener !== null) {
2366
- state.listener("close", state);
2367
- }
2368
- return state.tag !== null || state.anchor !== null || hasContent;
2369
- }
2370
- function readDocument(state) {
2371
- var documentStart = state.position, _position, directiveName, directiveArgs, hasDirectives = false, ch;
2372
- state.version = null;
2373
- state.checkLineBreaks = state.legacy;
2374
- state.tagMap = {};
2375
- state.anchorMap = {};
2376
- while ((ch = state.input.charCodeAt(state.position)) !== 0) {
2377
- skipSeparationSpace(state, true, -1);
2378
- ch = state.input.charCodeAt(state.position);
2379
- if (state.lineIndent > 0 || ch !== 37) {
2380
- break;
2381
- }
2382
- hasDirectives = true;
2383
- ch = state.input.charCodeAt(++state.position);
2384
- _position = state.position;
2385
- while (ch !== 0 && !is_WS_OR_EOL(ch)) {
2386
- ch = state.input.charCodeAt(++state.position);
2387
- }
2388
- directiveName = state.input.slice(_position, state.position);
2389
- directiveArgs = [];
2390
- if (directiveName.length < 1) {
2391
- throwError(state, "directive name must not be less than one character in length");
2392
- }
2393
- while (ch !== 0) {
2394
- while (is_WHITE_SPACE(ch)) {
2395
- ch = state.input.charCodeAt(++state.position);
2396
- }
2397
- if (ch === 35) {
2398
- do {
2399
- ch = state.input.charCodeAt(++state.position);
2400
- } while (ch !== 0 && !is_EOL(ch));
2401
- break;
2402
- }
2403
- if (is_EOL(ch)) break;
2404
- _position = state.position;
2405
- while (ch !== 0 && !is_WS_OR_EOL(ch)) {
2406
- ch = state.input.charCodeAt(++state.position);
2407
- }
2408
- directiveArgs.push(state.input.slice(_position, state.position));
2409
- }
2410
- if (ch !== 0) readLineBreak(state);
2411
- if (_hasOwnProperty.call(directiveHandlers, directiveName)) {
2412
- directiveHandlers[directiveName](state, directiveName, directiveArgs);
2413
- } else {
2414
- throwWarning(state, 'unknown document directive "' + directiveName + '"');
2415
- }
2416
- }
2417
- skipSeparationSpace(state, true, -1);
2418
- if (state.lineIndent === 0 && state.input.charCodeAt(state.position) === 45 && state.input.charCodeAt(state.position + 1) === 45 && state.input.charCodeAt(state.position + 2) === 45) {
2419
- state.position += 3;
2420
- skipSeparationSpace(state, true, -1);
2421
- } else if (hasDirectives) {
2422
- throwError(state, "directives end mark is expected");
2423
- }
2424
- composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
2425
- skipSeparationSpace(state, true, -1);
2426
- if (state.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
2427
- throwWarning(state, "non-ASCII line breaks are interpreted as content");
2428
- }
2429
- state.documents.push(state.result);
2430
- if (state.position === state.lineStart && testDocumentSeparator(state)) {
2431
- if (state.input.charCodeAt(state.position) === 46) {
2432
- state.position += 3;
2433
- skipSeparationSpace(state, true, -1);
2434
- }
2435
- return;
2436
- }
2437
- if (state.position < state.length - 1) {
2438
- throwError(state, "end of the stream or a document separator is expected");
2439
- } else {
2440
- return;
2441
- }
2442
- }
2443
- function loadDocuments(input, options2) {
2444
- input = String(input);
2445
- options2 = options2 || {};
2446
- if (input.length !== 0) {
2447
- if (input.charCodeAt(input.length - 1) !== 10 && input.charCodeAt(input.length - 1) !== 13) {
2448
- input += "\n";
2449
- }
2450
- if (input.charCodeAt(0) === 65279) {
2451
- input = input.slice(1);
2452
- }
2453
- }
2454
- var state = new State(input, options2);
2455
- var nullpos = input.indexOf("\0");
2456
- if (nullpos !== -1) {
2457
- state.position = nullpos;
2458
- throwError(state, "null byte is not allowed in input");
2459
- }
2460
- state.input += "\0";
2461
- while (state.input.charCodeAt(state.position) === 32) {
2462
- state.lineIndent += 1;
2463
- state.position += 1;
2464
- }
2465
- while (state.position < state.length - 1) {
2466
- readDocument(state);
2467
- }
2468
- return state.documents;
2469
- }
2470
- function loadAll(input, iterator, options2) {
2471
- if (iterator !== null && typeof iterator === "object" && typeof options2 === "undefined") {
2472
- options2 = iterator;
2473
- iterator = null;
2474
- }
2475
- var documents = loadDocuments(input, options2);
2476
- if (typeof iterator !== "function") {
2477
- return documents;
2478
- }
2479
- for (var index = 0, length = documents.length; index < length; index += 1) {
2480
- iterator(documents[index]);
2481
- }
2482
- }
2483
- function load(input, options2) {
2484
- var documents = loadDocuments(input, options2);
2485
- if (documents.length === 0) {
2486
- return void 0;
2487
- } else if (documents.length === 1) {
2488
- return documents[0];
2489
- }
2490
- throw new YAMLException("expected a single document in the stream, but found more");
2491
- }
2492
- function safeLoadAll(input, iterator, options2) {
2493
- if (typeof iterator === "object" && iterator !== null && typeof options2 === "undefined") {
2494
- options2 = iterator;
2495
- iterator = null;
2496
- }
2497
- return loadAll(input, iterator, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options2));
2498
- }
2499
- function safeLoad(input, options2) {
2500
- return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options2));
2501
- }
2502
- module2.exports.loadAll = loadAll;
2503
- module2.exports.load = load;
2504
- module2.exports.safeLoadAll = safeLoadAll;
2505
- module2.exports.safeLoad = safeLoad;
2506
- }
2507
- });
2508
-
2509
- // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/dumper.js
2510
- var require_dumper = __commonJS({
2511
- "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/dumper.js"(exports2, module2) {
2512
- var common = require_common();
2513
- var YAMLException = require_exception();
2514
- var DEFAULT_FULL_SCHEMA = require_default_full();
2515
- var DEFAULT_SAFE_SCHEMA = require_default_safe();
2516
- var _toString = Object.prototype.toString;
2517
- var _hasOwnProperty = Object.prototype.hasOwnProperty;
2518
- var CHAR_TAB = 9;
2519
- var CHAR_LINE_FEED = 10;
2520
- var CHAR_CARRIAGE_RETURN = 13;
2521
- var CHAR_SPACE = 32;
2522
- var CHAR_EXCLAMATION = 33;
2523
- var CHAR_DOUBLE_QUOTE = 34;
2524
- var CHAR_SHARP = 35;
2525
- var CHAR_PERCENT = 37;
2526
- var CHAR_AMPERSAND = 38;
2527
- var CHAR_SINGLE_QUOTE = 39;
2528
- var CHAR_ASTERISK = 42;
2529
- var CHAR_COMMA = 44;
2530
- var CHAR_MINUS = 45;
2531
- var CHAR_COLON = 58;
2532
- var CHAR_EQUALS = 61;
2533
- var CHAR_GREATER_THAN = 62;
2534
- var CHAR_QUESTION = 63;
2535
- var CHAR_COMMERCIAL_AT = 64;
2536
- var CHAR_LEFT_SQUARE_BRACKET = 91;
2537
- var CHAR_RIGHT_SQUARE_BRACKET = 93;
2538
- var CHAR_GRAVE_ACCENT = 96;
2539
- var CHAR_LEFT_CURLY_BRACKET = 123;
2540
- var CHAR_VERTICAL_LINE = 124;
2541
- var CHAR_RIGHT_CURLY_BRACKET = 125;
2542
- var ESCAPE_SEQUENCES = {};
2543
- ESCAPE_SEQUENCES[0] = "\\0";
2544
- ESCAPE_SEQUENCES[7] = "\\a";
2545
- ESCAPE_SEQUENCES[8] = "\\b";
2546
- ESCAPE_SEQUENCES[9] = "\\t";
2547
- ESCAPE_SEQUENCES[10] = "\\n";
2548
- ESCAPE_SEQUENCES[11] = "\\v";
2549
- ESCAPE_SEQUENCES[12] = "\\f";
2550
- ESCAPE_SEQUENCES[13] = "\\r";
2551
- ESCAPE_SEQUENCES[27] = "\\e";
2552
- ESCAPE_SEQUENCES[34] = '\\"';
2553
- ESCAPE_SEQUENCES[92] = "\\\\";
2554
- ESCAPE_SEQUENCES[133] = "\\N";
2555
- ESCAPE_SEQUENCES[160] = "\\_";
2556
- ESCAPE_SEQUENCES[8232] = "\\L";
2557
- ESCAPE_SEQUENCES[8233] = "\\P";
2558
- var DEPRECATED_BOOLEANS_SYNTAX = [
2559
- "y",
2560
- "Y",
2561
- "yes",
2562
- "Yes",
2563
- "YES",
2564
- "on",
2565
- "On",
2566
- "ON",
2567
- "n",
2568
- "N",
2569
- "no",
2570
- "No",
2571
- "NO",
2572
- "off",
2573
- "Off",
2574
- "OFF"
2575
- ];
2576
- function compileStyleMap(schema, map) {
2577
- var result, keys, index, length, tag, style, type;
2578
- if (map === null) return {};
2579
- result = {};
2580
- keys = Object.keys(map);
2581
- for (index = 0, length = keys.length; index < length; index += 1) {
2582
- tag = keys[index];
2583
- style = String(map[tag]);
2584
- if (tag.slice(0, 2) === "!!") {
2585
- tag = "tag:yaml.org,2002:" + tag.slice(2);
2586
- }
2587
- type = schema.compiledTypeMap["fallback"][tag];
2588
- if (type && _hasOwnProperty.call(type.styleAliases, style)) {
2589
- style = type.styleAliases[style];
2590
- }
2591
- result[tag] = style;
2592
- }
2593
- return result;
2594
- }
2595
- function encodeHex(character) {
2596
- var string, handle, length;
2597
- string = character.toString(16).toUpperCase();
2598
- if (character <= 255) {
2599
- handle = "x";
2600
- length = 2;
2601
- } else if (character <= 65535) {
2602
- handle = "u";
2603
- length = 4;
2604
- } else if (character <= 4294967295) {
2605
- handle = "U";
2606
- length = 8;
2607
- } else {
2608
- throw new YAMLException("code point within a string may not be greater than 0xFFFFFFFF");
2609
- }
2610
- return "\\" + handle + common.repeat("0", length - string.length) + string;
2611
- }
2612
- function State(options2) {
2613
- this.schema = options2["schema"] || DEFAULT_FULL_SCHEMA;
2614
- this.indent = Math.max(1, options2["indent"] || 2);
2615
- this.noArrayIndent = options2["noArrayIndent"] || false;
2616
- this.skipInvalid = options2["skipInvalid"] || false;
2617
- this.flowLevel = common.isNothing(options2["flowLevel"]) ? -1 : options2["flowLevel"];
2618
- this.styleMap = compileStyleMap(this.schema, options2["styles"] || null);
2619
- this.sortKeys = options2["sortKeys"] || false;
2620
- this.lineWidth = options2["lineWidth"] || 80;
2621
- this.noRefs = options2["noRefs"] || false;
2622
- this.noCompatMode = options2["noCompatMode"] || false;
2623
- this.condenseFlow = options2["condenseFlow"] || false;
2624
- this.implicitTypes = this.schema.compiledImplicit;
2625
- this.explicitTypes = this.schema.compiledExplicit;
2626
- this.tag = null;
2627
- this.result = "";
2628
- this.duplicates = [];
2629
- this.usedDuplicates = null;
2630
- }
2631
- function indentString(string, spaces) {
2632
- var ind = common.repeat(" ", spaces), position = 0, next = -1, result = "", line, length = string.length;
2633
- while (position < length) {
2634
- next = string.indexOf("\n", position);
2635
- if (next === -1) {
2636
- line = string.slice(position);
2637
- position = length;
2638
- } else {
2639
- line = string.slice(position, next + 1);
2640
- position = next + 1;
2641
- }
2642
- if (line.length && line !== "\n") result += ind;
2643
- result += line;
2644
- }
2645
- return result;
2646
- }
2647
- function generateNextLine(state, level) {
2648
- return "\n" + common.repeat(" ", state.indent * level);
2649
- }
2650
- function testImplicitResolving(state, str2) {
2651
- var index, length, type;
2652
- for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
2653
- type = state.implicitTypes[index];
2654
- if (type.resolve(str2)) {
2655
- return true;
2656
- }
2657
- }
2658
- return false;
2659
- }
2660
- function isWhitespace(c) {
2661
- return c === CHAR_SPACE || c === CHAR_TAB;
2662
- }
2663
- function isPrintable(c) {
2664
- return 32 <= c && c <= 126 || 161 <= c && c <= 55295 && c !== 8232 && c !== 8233 || 57344 <= c && c <= 65533 && c !== 65279 || 65536 <= c && c <= 1114111;
2665
- }
2666
- function isNsChar(c) {
2667
- return isPrintable(c) && !isWhitespace(c) && c !== 65279 && c !== CHAR_CARRIAGE_RETURN && c !== CHAR_LINE_FEED;
2668
- }
2669
- function isPlainSafe(c, prev) {
2670
- return isPrintable(c) && c !== 65279 && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET && c !== CHAR_COLON && (c !== CHAR_SHARP || prev && isNsChar(prev));
2671
- }
2672
- function isPlainSafeFirst(c) {
2673
- return isPrintable(c) && c !== 65279 && !isWhitespace(c) && c !== CHAR_MINUS && c !== CHAR_QUESTION && c !== CHAR_COLON && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET && c !== CHAR_SHARP && c !== CHAR_AMPERSAND && c !== CHAR_ASTERISK && c !== CHAR_EXCLAMATION && c !== CHAR_VERTICAL_LINE && c !== CHAR_EQUALS && c !== CHAR_GREATER_THAN && c !== CHAR_SINGLE_QUOTE && c !== CHAR_DOUBLE_QUOTE && c !== CHAR_PERCENT && c !== CHAR_COMMERCIAL_AT && c !== CHAR_GRAVE_ACCENT;
2674
- }
2675
- function needIndentIndicator(string) {
2676
- var leadingSpaceRe = /^\n* /;
2677
- return leadingSpaceRe.test(string);
2678
- }
2679
- var STYLE_PLAIN = 1;
2680
- var STYLE_SINGLE = 2;
2681
- var STYLE_LITERAL = 3;
2682
- var STYLE_FOLDED = 4;
2683
- var STYLE_DOUBLE = 5;
2684
- function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) {
2685
- var i;
2686
- var char, prev_char;
2687
- var hasLineBreak = false;
2688
- var hasFoldableLine = false;
2689
- var shouldTrackWidth = lineWidth !== -1;
2690
- var previousLineBreak = -1;
2691
- var plain = isPlainSafeFirst(string.charCodeAt(0)) && !isWhitespace(string.charCodeAt(string.length - 1));
2692
- if (singleLineOnly) {
2693
- for (i = 0; i < string.length; i++) {
2694
- char = string.charCodeAt(i);
2695
- if (!isPrintable(char)) {
2696
- return STYLE_DOUBLE;
2697
- }
2698
- prev_char = i > 0 ? string.charCodeAt(i - 1) : null;
2699
- plain = plain && isPlainSafe(char, prev_char);
2700
- }
2701
- } else {
2702
- for (i = 0; i < string.length; i++) {
2703
- char = string.charCodeAt(i);
2704
- if (char === CHAR_LINE_FEED) {
2705
- hasLineBreak = true;
2706
- if (shouldTrackWidth) {
2707
- hasFoldableLine = hasFoldableLine || // Foldable line = too long, and not more-indented.
2708
- i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ";
2709
- previousLineBreak = i;
2710
- }
2711
- } else if (!isPrintable(char)) {
2712
- return STYLE_DOUBLE;
2713
- }
2714
- prev_char = i > 0 ? string.charCodeAt(i - 1) : null;
2715
- plain = plain && isPlainSafe(char, prev_char);
2716
- }
2717
- hasFoldableLine = hasFoldableLine || shouldTrackWidth && (i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ");
2718
- }
2719
- if (!hasLineBreak && !hasFoldableLine) {
2720
- return plain && !testAmbiguousType(string) ? STYLE_PLAIN : STYLE_SINGLE;
2721
- }
2722
- if (indentPerLevel > 9 && needIndentIndicator(string)) {
2723
- return STYLE_DOUBLE;
2724
- }
2725
- return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
2726
- }
2727
- function writeScalar(state, string, level, iskey) {
2728
- state.dump = (function() {
2729
- if (string.length === 0) {
2730
- return "''";
2731
- }
2732
- if (!state.noCompatMode && DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) {
2733
- return "'" + string + "'";
2734
- }
2735
- var indent = state.indent * Math.max(1, level);
2736
- var lineWidth = state.lineWidth === -1 ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);
2737
- var singleLineOnly = iskey || state.flowLevel > -1 && level >= state.flowLevel;
2738
- function testAmbiguity(string2) {
2739
- return testImplicitResolving(state, string2);
2740
- }
2741
- switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) {
2742
- case STYLE_PLAIN:
2743
- return string;
2744
- case STYLE_SINGLE:
2745
- return "'" + string.replace(/'/g, "''") + "'";
2746
- case STYLE_LITERAL:
2747
- return "|" + blockHeader(string, state.indent) + dropEndingNewline(indentString(string, indent));
2748
- case STYLE_FOLDED:
2749
- return ">" + blockHeader(string, state.indent) + dropEndingNewline(indentString(foldString(string, lineWidth), indent));
2750
- case STYLE_DOUBLE:
2751
- return '"' + escapeString(string) + '"';
2752
- default:
2753
- throw new YAMLException("impossible error: invalid scalar style");
2754
- }
2755
- })();
2756
- }
2757
- function blockHeader(string, indentPerLevel) {
2758
- var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : "";
2759
- var clip = string[string.length - 1] === "\n";
2760
- var keep = clip && (string[string.length - 2] === "\n" || string === "\n");
2761
- var chomp = keep ? "+" : clip ? "" : "-";
2762
- return indentIndicator + chomp + "\n";
2763
- }
2764
- function dropEndingNewline(string) {
2765
- return string[string.length - 1] === "\n" ? string.slice(0, -1) : string;
2766
- }
2767
- function foldString(string, width) {
2768
- var lineRe = /(\n+)([^\n]*)/g;
2769
- var result = (function() {
2770
- var nextLF = string.indexOf("\n");
2771
- nextLF = nextLF !== -1 ? nextLF : string.length;
2772
- lineRe.lastIndex = nextLF;
2773
- return foldLine(string.slice(0, nextLF), width);
2774
- })();
2775
- var prevMoreIndented = string[0] === "\n" || string[0] === " ";
2776
- var moreIndented;
2777
- var match;
2778
- while (match = lineRe.exec(string)) {
2779
- var prefix = match[1], line = match[2];
2780
- moreIndented = line[0] === " ";
2781
- result += prefix + (!prevMoreIndented && !moreIndented && line !== "" ? "\n" : "") + foldLine(line, width);
2782
- prevMoreIndented = moreIndented;
2783
- }
2784
- return result;
2785
- }
2786
- function foldLine(line, width) {
2787
- if (line === "" || line[0] === " ") return line;
2788
- var breakRe = / [^ ]/g;
2789
- var match;
2790
- var start = 0, end, curr = 0, next = 0;
2791
- var result = "";
2792
- while (match = breakRe.exec(line)) {
2793
- next = match.index;
2794
- if (next - start > width) {
2795
- end = curr > start ? curr : next;
2796
- result += "\n" + line.slice(start, end);
2797
- start = end + 1;
2798
- }
2799
- curr = next;
2800
- }
2801
- result += "\n";
2802
- if (line.length - start > width && curr > start) {
2803
- result += line.slice(start, curr) + "\n" + line.slice(curr + 1);
2804
- } else {
2805
- result += line.slice(start);
2806
- }
2807
- return result.slice(1);
2808
- }
2809
- function escapeString(string) {
2810
- var result = "";
2811
- var char, nextChar;
2812
- var escapeSeq;
2813
- for (var i = 0; i < string.length; i++) {
2814
- char = string.charCodeAt(i);
2815
- if (char >= 55296 && char <= 56319) {
2816
- nextChar = string.charCodeAt(i + 1);
2817
- if (nextChar >= 56320 && nextChar <= 57343) {
2818
- result += encodeHex((char - 55296) * 1024 + nextChar - 56320 + 65536);
2819
- i++;
2820
- continue;
2821
- }
2822
- }
2823
- escapeSeq = ESCAPE_SEQUENCES[char];
2824
- result += !escapeSeq && isPrintable(char) ? string[i] : escapeSeq || encodeHex(char);
2825
- }
2826
- return result;
2827
- }
2828
- function writeFlowSequence(state, level, object) {
2829
- var _result = "", _tag = state.tag, index, length;
2830
- for (index = 0, length = object.length; index < length; index += 1) {
2831
- if (writeNode(state, level, object[index], false, false)) {
2832
- if (index !== 0) _result += "," + (!state.condenseFlow ? " " : "");
2833
- _result += state.dump;
2834
- }
2835
- }
2836
- state.tag = _tag;
2837
- state.dump = "[" + _result + "]";
2838
- }
2839
- function writeBlockSequence(state, level, object, compact) {
2840
- var _result = "", _tag = state.tag, index, length;
2841
- for (index = 0, length = object.length; index < length; index += 1) {
2842
- if (writeNode(state, level + 1, object[index], true, true)) {
2843
- if (!compact || index !== 0) {
2844
- _result += generateNextLine(state, level);
2845
- }
2846
- if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
2847
- _result += "-";
2848
- } else {
2849
- _result += "- ";
2850
- }
2851
- _result += state.dump;
2852
- }
2853
- }
2854
- state.tag = _tag;
2855
- state.dump = _result || "[]";
2856
- }
2857
- function writeFlowMapping(state, level, object) {
2858
- var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, pairBuffer;
2859
- for (index = 0, length = objectKeyList.length; index < length; index += 1) {
2860
- pairBuffer = "";
2861
- if (index !== 0) pairBuffer += ", ";
2862
- if (state.condenseFlow) pairBuffer += '"';
2863
- objectKey = objectKeyList[index];
2864
- objectValue = object[objectKey];
2865
- if (!writeNode(state, level, objectKey, false, false)) {
2866
- continue;
2867
- }
2868
- if (state.dump.length > 1024) pairBuffer += "? ";
2869
- pairBuffer += state.dump + (state.condenseFlow ? '"' : "") + ":" + (state.condenseFlow ? "" : " ");
2870
- if (!writeNode(state, level, objectValue, false, false)) {
2871
- continue;
2872
- }
2873
- pairBuffer += state.dump;
2874
- _result += pairBuffer;
2875
- }
2876
- state.tag = _tag;
2877
- state.dump = "{" + _result + "}";
2878
- }
2879
- function writeBlockMapping(state, level, object, compact) {
2880
- var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, explicitPair, pairBuffer;
2881
- if (state.sortKeys === true) {
2882
- objectKeyList.sort();
2883
- } else if (typeof state.sortKeys === "function") {
2884
- objectKeyList.sort(state.sortKeys);
2885
- } else if (state.sortKeys) {
2886
- throw new YAMLException("sortKeys must be a boolean or a function");
2887
- }
2888
- for (index = 0, length = objectKeyList.length; index < length; index += 1) {
2889
- pairBuffer = "";
2890
- if (!compact || index !== 0) {
2891
- pairBuffer += generateNextLine(state, level);
2892
- }
2893
- objectKey = objectKeyList[index];
2894
- objectValue = object[objectKey];
2895
- if (!writeNode(state, level + 1, objectKey, true, true, true)) {
2896
- continue;
2897
- }
2898
- explicitPair = state.tag !== null && state.tag !== "?" || state.dump && state.dump.length > 1024;
2899
- if (explicitPair) {
2900
- if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
2901
- pairBuffer += "?";
2902
- } else {
2903
- pairBuffer += "? ";
2904
- }
2905
- }
2906
- pairBuffer += state.dump;
2907
- if (explicitPair) {
2908
- pairBuffer += generateNextLine(state, level);
2909
- }
2910
- if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
2911
- continue;
2912
- }
2913
- if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
2914
- pairBuffer += ":";
2915
- } else {
2916
- pairBuffer += ": ";
2917
- }
2918
- pairBuffer += state.dump;
2919
- _result += pairBuffer;
2920
- }
2921
- state.tag = _tag;
2922
- state.dump = _result || "{}";
2923
- }
2924
- function detectType(state, object, explicit) {
2925
- var _result, typeList, index, length, type, style;
2926
- typeList = explicit ? state.explicitTypes : state.implicitTypes;
2927
- for (index = 0, length = typeList.length; index < length; index += 1) {
2928
- type = typeList[index];
2929
- if ((type.instanceOf || type.predicate) && (!type.instanceOf || typeof object === "object" && object instanceof type.instanceOf) && (!type.predicate || type.predicate(object))) {
2930
- state.tag = explicit ? type.tag : "?";
2931
- if (type.represent) {
2932
- style = state.styleMap[type.tag] || type.defaultStyle;
2933
- if (_toString.call(type.represent) === "[object Function]") {
2934
- _result = type.represent(object, style);
2935
- } else if (_hasOwnProperty.call(type.represent, style)) {
2936
- _result = type.represent[style](object, style);
2937
- } else {
2938
- throw new YAMLException("!<" + type.tag + '> tag resolver accepts not "' + style + '" style');
2939
- }
2940
- state.dump = _result;
2941
- }
2942
- return true;
2943
- }
2944
- }
2945
- return false;
2946
- }
2947
- function writeNode(state, level, object, block, compact, iskey) {
2948
- state.tag = null;
2949
- state.dump = object;
2950
- if (!detectType(state, object, false)) {
2951
- detectType(state, object, true);
2952
- }
2953
- var type = _toString.call(state.dump);
2954
- if (block) {
2955
- block = state.flowLevel < 0 || state.flowLevel > level;
2956
- }
2957
- var objectOrArray = type === "[object Object]" || type === "[object Array]", duplicateIndex, duplicate;
2958
- if (objectOrArray) {
2959
- duplicateIndex = state.duplicates.indexOf(object);
2960
- duplicate = duplicateIndex !== -1;
2961
- }
2962
- if (state.tag !== null && state.tag !== "?" || duplicate || state.indent !== 2 && level > 0) {
2963
- compact = false;
2964
- }
2965
- if (duplicate && state.usedDuplicates[duplicateIndex]) {
2966
- state.dump = "*ref_" + duplicateIndex;
2967
- } else {
2968
- if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
2969
- state.usedDuplicates[duplicateIndex] = true;
2970
- }
2971
- if (type === "[object Object]") {
2972
- if (block && Object.keys(state.dump).length !== 0) {
2973
- writeBlockMapping(state, level, state.dump, compact);
2974
- if (duplicate) {
2975
- state.dump = "&ref_" + duplicateIndex + state.dump;
2976
- }
2977
- } else {
2978
- writeFlowMapping(state, level, state.dump);
2979
- if (duplicate) {
2980
- state.dump = "&ref_" + duplicateIndex + " " + state.dump;
2981
- }
2982
- }
2983
- } else if (type === "[object Array]") {
2984
- var arrayLevel = state.noArrayIndent && level > 0 ? level - 1 : level;
2985
- if (block && state.dump.length !== 0) {
2986
- writeBlockSequence(state, arrayLevel, state.dump, compact);
2987
- if (duplicate) {
2988
- state.dump = "&ref_" + duplicateIndex + state.dump;
2989
- }
2990
- } else {
2991
- writeFlowSequence(state, arrayLevel, state.dump);
2992
- if (duplicate) {
2993
- state.dump = "&ref_" + duplicateIndex + " " + state.dump;
2994
- }
2995
- }
2996
- } else if (type === "[object String]") {
2997
- if (state.tag !== "?") {
2998
- writeScalar(state, state.dump, level, iskey);
2999
- }
3000
- } else {
3001
- if (state.skipInvalid) return false;
3002
- throw new YAMLException("unacceptable kind of an object to dump " + type);
3003
- }
3004
- if (state.tag !== null && state.tag !== "?") {
3005
- state.dump = "!<" + state.tag + "> " + state.dump;
3006
- }
3007
- }
3008
- return true;
3009
- }
3010
- function getDuplicateReferences(object, state) {
3011
- var objects = [], duplicatesIndexes = [], index, length;
3012
- inspectNode(object, objects, duplicatesIndexes);
3013
- for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {
3014
- state.duplicates.push(objects[duplicatesIndexes[index]]);
3015
- }
3016
- state.usedDuplicates = new Array(length);
3017
- }
3018
- function inspectNode(object, objects, duplicatesIndexes) {
3019
- var objectKeyList, index, length;
3020
- if (object !== null && typeof object === "object") {
3021
- index = objects.indexOf(object);
3022
- if (index !== -1) {
3023
- if (duplicatesIndexes.indexOf(index) === -1) {
3024
- duplicatesIndexes.push(index);
3025
- }
3026
- } else {
3027
- objects.push(object);
3028
- if (Array.isArray(object)) {
3029
- for (index = 0, length = object.length; index < length; index += 1) {
3030
- inspectNode(object[index], objects, duplicatesIndexes);
3031
- }
3032
- } else {
3033
- objectKeyList = Object.keys(object);
3034
- for (index = 0, length = objectKeyList.length; index < length; index += 1) {
3035
- inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
3036
- }
3037
- }
3038
- }
3039
- }
3040
- }
3041
- function dump(input, options2) {
3042
- options2 = options2 || {};
3043
- var state = new State(options2);
3044
- if (!state.noRefs) getDuplicateReferences(input, state);
3045
- if (writeNode(state, 0, input, true, true)) return state.dump + "\n";
3046
- return "";
3047
- }
3048
- function safeDump(input, options2) {
3049
- return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options2));
3050
- }
3051
- module2.exports.dump = dump;
3052
- module2.exports.safeDump = safeDump;
3053
- }
3054
- });
3055
-
3056
- // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml.js
3057
- var require_js_yaml = __commonJS({
3058
- "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml.js"(exports2, module2) {
3059
- var loader = require_loader();
3060
- var dumper = require_dumper();
3061
- function deprecated(name) {
3062
- return function() {
3063
- throw new Error("Function " + name + " is deprecated and cannot be used.");
3064
- };
3065
- }
3066
- module2.exports.Type = require_type();
3067
- module2.exports.Schema = require_schema();
3068
- module2.exports.FAILSAFE_SCHEMA = require_failsafe();
3069
- module2.exports.JSON_SCHEMA = require_json();
3070
- module2.exports.CORE_SCHEMA = require_core();
3071
- module2.exports.DEFAULT_SAFE_SCHEMA = require_default_safe();
3072
- module2.exports.DEFAULT_FULL_SCHEMA = require_default_full();
3073
- module2.exports.load = loader.load;
3074
- module2.exports.loadAll = loader.loadAll;
3075
- module2.exports.safeLoad = loader.safeLoad;
3076
- module2.exports.safeLoadAll = loader.safeLoadAll;
3077
- module2.exports.dump = dumper.dump;
3078
- module2.exports.safeDump = dumper.safeDump;
3079
- module2.exports.YAMLException = require_exception();
3080
- module2.exports.MINIMAL_SCHEMA = require_failsafe();
3081
- module2.exports.SAFE_SCHEMA = require_default_safe();
3082
- module2.exports.DEFAULT_SCHEMA = require_default_full();
3083
- module2.exports.scan = deprecated("scan");
3084
- module2.exports.parse = deprecated("parse");
3085
- module2.exports.compose = deprecated("compose");
3086
- module2.exports.addConstructor = deprecated("addConstructor");
3087
- }
3088
- });
3089
-
3090
- // ../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/index.js
3091
- var require_js_yaml2 = __commonJS({
3092
- "../../node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/index.js"(exports2, module2) {
3093
- var yaml2 = require_js_yaml();
3094
- module2.exports = yaml2;
3095
- }
3096
- });
3097
-
3098
- // ../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/engines.js
3099
- var require_engines = __commonJS({
3100
- "../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/engines.js"(exports$1, module) {
3101
- var yaml = require_js_yaml2();
3102
- var engines = module.exports;
3103
- engines.yaml = {
3104
- parse: yaml.safeLoad.bind(yaml),
3105
- stringify: yaml.safeDump.bind(yaml)
3106
- };
3107
- engines.json = {
3108
- parse: JSON.parse.bind(JSON),
3109
- stringify: function(obj, options2) {
3110
- const opts = Object.assign({ replacer: null, space: 2 }, options2);
3111
- return JSON.stringify(obj, opts.replacer, opts.space);
3112
- }
3113
- };
3114
- engines.javascript = {
3115
- parse: function parse(str, options, wrap) {
3116
- try {
3117
- if (wrap !== false) {
3118
- str = "(function() {\nreturn " + str.trim() + ";\n}());";
3119
- }
3120
- return eval(str) || {};
3121
- } catch (err) {
3122
- if (wrap !== false && /(unexpected|identifier)/i.test(err.message)) {
3123
- return parse(str, options, false);
3124
- }
3125
- throw new SyntaxError(err);
3126
- }
3127
- },
3128
- stringify: function() {
3129
- throw new Error("stringifying JavaScript is not supported");
3130
- }
3131
- };
3132
- }
3133
- });
3134
-
3135
- // ../../node_modules/.pnpm/strip-bom-string@1.0.0/node_modules/strip-bom-string/index.js
3136
- var require_strip_bom_string = __commonJS({
3137
- "../../node_modules/.pnpm/strip-bom-string@1.0.0/node_modules/strip-bom-string/index.js"(exports2, module2) {
3138
- module2.exports = function(str2) {
3139
- if (typeof str2 === "string" && str2.charAt(0) === "\uFEFF") {
3140
- return str2.slice(1);
3141
- }
3142
- return str2;
3143
- };
3144
- }
3145
- });
3146
-
3147
- // ../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/utils.js
3148
- var require_utils = __commonJS({
3149
- "../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/utils.js"(exports2) {
3150
- var stripBom = require_strip_bom_string();
3151
- var typeOf = require_kind_of();
3152
- exports2.define = function(obj, key, val) {
3153
- Reflect.defineProperty(obj, key, {
3154
- enumerable: false,
3155
- configurable: true,
3156
- writable: true,
3157
- value: val
3158
- });
3159
- };
3160
- exports2.isBuffer = function(val) {
3161
- return typeOf(val) === "buffer";
3162
- };
3163
- exports2.isObject = function(val) {
3164
- return typeOf(val) === "object";
3165
- };
3166
- exports2.toBuffer = function(input) {
3167
- return typeof input === "string" ? Buffer.from(input) : input;
3168
- };
3169
- exports2.toString = function(input) {
3170
- if (exports2.isBuffer(input)) return stripBom(String(input));
3171
- if (typeof input !== "string") {
3172
- throw new TypeError("expected input to be a string or buffer");
3173
- }
3174
- return stripBom(input);
3175
- };
3176
- exports2.arrayify = function(val) {
3177
- return val ? Array.isArray(val) ? val : [val] : [];
3178
- };
3179
- exports2.startsWith = function(str2, substr, len) {
3180
- if (typeof len !== "number") len = substr.length;
3181
- return str2.slice(0, len) === substr;
3182
- };
3183
- }
3184
- });
3185
-
3186
- // ../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/defaults.js
3187
- var require_defaults = __commonJS({
3188
- "../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/defaults.js"(exports2, module2) {
3189
- var engines2 = require_engines();
3190
- var utils = require_utils();
3191
- module2.exports = function(options2) {
3192
- const opts = Object.assign({}, options2);
3193
- opts.delimiters = utils.arrayify(opts.delims || opts.delimiters || "---");
3194
- if (opts.delimiters.length === 1) {
3195
- opts.delimiters.push(opts.delimiters[0]);
3196
- }
3197
- opts.language = (opts.language || opts.lang || "yaml").toLowerCase();
3198
- opts.engines = Object.assign({}, engines2, opts.parsers, opts.engines);
3199
- return opts;
3200
- };
3201
- }
3202
- });
3203
-
3204
- // ../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/engine.js
3205
- var require_engine = __commonJS({
3206
- "../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/engine.js"(exports2, module2) {
3207
- module2.exports = function(name, options2) {
3208
- let engine = options2.engines[name] || options2.engines[aliase(name)];
3209
- if (typeof engine === "undefined") {
3210
- throw new Error('gray-matter engine "' + name + '" is not registered');
3211
- }
3212
- if (typeof engine === "function") {
3213
- engine = { parse: engine };
3214
- }
3215
- return engine;
3216
- };
3217
- function aliase(name) {
3218
- switch (name.toLowerCase()) {
3219
- case "js":
3220
- case "javascript":
3221
- return "javascript";
3222
- case "coffee":
3223
- case "coffeescript":
3224
- case "cson":
3225
- return "coffee";
3226
- case "yaml":
3227
- case "yml":
3228
- return "yaml";
3229
- default: {
3230
- return name;
3231
- }
3232
- }
3233
- }
3234
- }
3235
- });
3236
-
3237
- // ../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/stringify.js
3238
- var require_stringify = __commonJS({
3239
- "../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/stringify.js"(exports2, module2) {
3240
- var typeOf = require_kind_of();
3241
- var getEngine = require_engine();
3242
- var defaults = require_defaults();
3243
- module2.exports = function(file, data, options2) {
3244
- if (data == null && options2 == null) {
3245
- switch (typeOf(file)) {
3246
- case "object":
3247
- data = file.data;
3248
- options2 = {};
3249
- break;
3250
- case "string":
3251
- return file;
3252
- default: {
3253
- throw new TypeError("expected file to be a string or object");
3254
- }
3255
- }
3256
- }
3257
- const str2 = file.content;
3258
- const opts = defaults(options2);
3259
- if (data == null) {
3260
- if (!opts.data) return file;
3261
- data = opts.data;
3262
- }
3263
- const language = file.language || opts.language;
3264
- const engine = getEngine(language, opts);
3265
- if (typeof engine.stringify !== "function") {
3266
- throw new TypeError('expected "' + language + '.stringify" to be a function');
3267
- }
3268
- data = Object.assign({}, file.data, data);
3269
- const open = opts.delimiters[0];
3270
- const close = opts.delimiters[1];
3271
- const matter2 = engine.stringify(data, options2).trim();
3272
- let buf = "";
3273
- if (matter2 !== "{}") {
3274
- buf = newline(open) + newline(matter2) + newline(close);
3275
- }
3276
- if (typeof file.excerpt === "string" && file.excerpt !== "") {
3277
- if (str2.indexOf(file.excerpt.trim()) === -1) {
3278
- buf += newline(file.excerpt) + newline(close);
3279
- }
3280
- }
3281
- return buf + newline(str2);
3282
- };
3283
- function newline(str2) {
3284
- return str2.slice(-1) !== "\n" ? str2 + "\n" : str2;
3285
- }
3286
- }
3287
- });
3288
-
3289
- // ../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/excerpt.js
3290
- var require_excerpt = __commonJS({
3291
- "../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/excerpt.js"(exports2, module2) {
3292
- var defaults = require_defaults();
3293
- module2.exports = function(file, options2) {
3294
- const opts = defaults(options2);
3295
- if (file.data == null) {
3296
- file.data = {};
3297
- }
3298
- if (typeof opts.excerpt === "function") {
3299
- return opts.excerpt(file, opts);
3300
- }
3301
- const sep = file.data.excerpt_separator || opts.excerpt_separator;
3302
- if (sep == null && (opts.excerpt === false || opts.excerpt == null)) {
3303
- return file;
3304
- }
3305
- const delimiter = typeof opts.excerpt === "string" ? opts.excerpt : sep || opts.delimiters[0];
3306
- const idx = file.content.indexOf(delimiter);
3307
- if (idx !== -1) {
3308
- file.excerpt = file.content.slice(0, idx);
3309
- }
3310
- return file;
3311
- };
3312
- }
3313
- });
3314
-
3315
- // ../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/to-file.js
3316
- var require_to_file = __commonJS({
3317
- "../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/to-file.js"(exports2, module2) {
3318
- var typeOf = require_kind_of();
3319
- var stringify = require_stringify();
3320
- var utils = require_utils();
3321
- module2.exports = function(file) {
3322
- if (typeOf(file) !== "object") {
3323
- file = { content: file };
3324
- }
3325
- if (typeOf(file.data) !== "object") {
3326
- file.data = {};
3327
- }
3328
- if (file.contents && file.content == null) {
3329
- file.content = file.contents;
3330
- }
3331
- utils.define(file, "orig", utils.toBuffer(file.content));
3332
- utils.define(file, "language", file.language || "");
3333
- utils.define(file, "matter", file.matter || "");
3334
- utils.define(file, "stringify", function(data, options2) {
3335
- if (options2 && options2.language) {
3336
- file.language = options2.language;
3337
- }
3338
- return stringify(file, data, options2);
3339
- });
3340
- file.content = utils.toString(file.content);
3341
- file.isEmpty = false;
3342
- file.excerpt = "";
3343
- return file;
3344
- };
3345
- }
3346
- });
3347
-
3348
- // ../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/parse.js
3349
- var require_parse = __commonJS({
3350
- "../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/parse.js"(exports2, module2) {
3351
- var getEngine = require_engine();
3352
- var defaults = require_defaults();
3353
- module2.exports = function(language, str2, options2) {
3354
- const opts = defaults(options2);
3355
- const engine = getEngine(language, opts);
3356
- if (typeof engine.parse !== "function") {
3357
- throw new TypeError('expected "' + language + '.parse" to be a function');
3358
- }
3359
- return engine.parse(str2, opts);
3360
- };
3361
- }
3362
- });
3363
-
3364
- // ../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/index.js
3365
- var require_gray_matter = __commonJS({
3366
- "../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/index.js"(exports2, module2) {
3367
- var fs = __require("fs");
3368
- var sections = require_section_matter();
3369
- var defaults = require_defaults();
3370
- var stringify = require_stringify();
3371
- var excerpt = require_excerpt();
3372
- var engines2 = require_engines();
3373
- var toFile = require_to_file();
3374
- var parse2 = require_parse();
3375
- var utils = require_utils();
3376
- function matter2(input, options2) {
3377
- if (input === "") {
3378
- return { data: {}, content: input, excerpt: "", orig: input };
3379
- }
3380
- let file = toFile(input);
3381
- const cached = matter2.cache[file.content];
3382
- if (!options2) {
3383
- if (cached) {
3384
- file = Object.assign({}, cached);
3385
- file.orig = cached.orig;
3386
- return file;
3387
- }
3388
- matter2.cache[file.content] = file;
3389
- }
3390
- return parseMatter(file, options2);
3391
- }
3392
- function parseMatter(file, options2) {
3393
- const opts = defaults(options2);
3394
- const open = opts.delimiters[0];
3395
- const close = "\n" + opts.delimiters[1];
3396
- let str2 = file.content;
3397
- if (opts.language) {
3398
- file.language = opts.language;
3399
- }
3400
- const openLen = open.length;
3401
- if (!utils.startsWith(str2, open, openLen)) {
3402
- excerpt(file, opts);
3403
- return file;
3404
- }
3405
- if (str2.charAt(openLen) === open.slice(-1)) {
3406
- return file;
3407
- }
3408
- str2 = str2.slice(openLen);
3409
- const len = str2.length;
3410
- const language = matter2.language(str2, opts);
3411
- if (language.name) {
3412
- file.language = language.name;
3413
- str2 = str2.slice(language.raw.length);
3414
- }
3415
- let closeIndex = str2.indexOf(close);
3416
- if (closeIndex === -1) {
3417
- closeIndex = len;
3418
- }
3419
- file.matter = str2.slice(0, closeIndex);
3420
- const block = file.matter.replace(/^\s*#[^\n]+/gm, "").trim();
3421
- if (block === "") {
3422
- file.isEmpty = true;
3423
- file.empty = file.content;
3424
- file.data = {};
3425
- } else {
3426
- file.data = parse2(file.language, file.matter, opts);
3427
- }
3428
- if (closeIndex === len) {
3429
- file.content = "";
3430
- } else {
3431
- file.content = str2.slice(closeIndex + close.length);
3432
- if (file.content[0] === "\r") {
3433
- file.content = file.content.slice(1);
3434
- }
3435
- if (file.content[0] === "\n") {
3436
- file.content = file.content.slice(1);
3437
- }
3438
- }
3439
- excerpt(file, opts);
3440
- if (opts.sections === true || typeof opts.section === "function") {
3441
- sections(file, opts.section);
3442
- }
3443
- return file;
3444
- }
3445
- matter2.engines = engines2;
3446
- matter2.stringify = function(file, data, options2) {
3447
- if (typeof file === "string") file = matter2(file, options2);
3448
- return stringify(file, data, options2);
3449
- };
3450
- matter2.read = function(filepath, options2) {
3451
- const str2 = fs.readFileSync(filepath, "utf8");
3452
- const file = matter2(str2, options2);
3453
- file.path = filepath;
3454
- return file;
3455
- };
3456
- matter2.test = function(str2, options2) {
3457
- return utils.startsWith(str2, defaults(options2).delimiters[0]);
3458
- };
3459
- matter2.language = function(str2, options2) {
3460
- const opts = defaults(options2);
3461
- const open = opts.delimiters[0];
3462
- if (matter2.test(str2)) {
3463
- str2 = str2.slice(open.length);
3464
- }
3465
- const language = str2.slice(0, str2.search(/\r?\n/));
3466
- return {
3467
- raw: language,
3468
- name: language ? language.trim() : ""
3469
- };
3470
- };
3471
- matter2.cache = {};
3472
- matter2.clearCache = function() {
3473
- matter2.cache = {};
3474
- };
3475
- module2.exports = matter2;
3476
- }
3477
- });
7
+ // src/components/Breadcrumbs.tsx
3478
8
  function Breadcrumbs(props) {
3479
- return /* @__PURE__ */ jsx(Show, { when: props.items.length > 0, children: /* @__PURE__ */ jsx("nav", { class: "flex items-center gap-1.5 text-sm", "aria-label": "Breadcrumb", children: /* @__PURE__ */ jsx(For, { each: props.items, children: (item, idx) => /* @__PURE__ */ jsxs(Fragment, { children: [
9
+ if (props.items.length === 0) {
10
+ return null;
11
+ }
12
+ return /* @__PURE__ */ jsx("nav", { class: "flex items-center gap-1.5 text-sm", "aria-label": "Breadcrumb", children: /* @__PURE__ */ jsx(For, { each: props.items, children: (item, idx) => /* @__PURE__ */ jsxs(Fragment, { children: [
3480
13
  /* @__PURE__ */ jsx(Show, { when: idx() > 0, children: /* @__PURE__ */ jsx("svg", { "aria-hidden": "true", class: "h-3.5 w-3.5 shrink-0 text-white/20", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M6 4l4 4-4 4", stroke: "currentColor", "stroke-width": "1.5" }) }) }),
3481
14
  /* @__PURE__ */ jsx(Show, { when: idx() === props.items.length - 1, fallback: /* @__PURE__ */ jsx("a", { href: item.href, class: "truncate text-white/40 transition-colors hover:text-white/70", children: item.title }), children: /* @__PURE__ */ jsx("span", { class: "truncate text-white/60", children: item.title }) })
3482
- ] }) }) }) });
15
+ ] }) }) });
3483
16
  }
3484
17
 
3485
- // ../shared/dist/index.js
3486
- __toESM(require_gray_matter());
18
+ // ../shared/dist/chunk-BR2XBF64.js
3487
19
  function toTocLevel(level) {
3488
20
  if (level === 2 || level === 3 || level === 4) {
3489
21
  return level;
@@ -3679,18 +211,35 @@ function DocPage(props) {
3679
211
  }
3680
212
  ) });
3681
213
  }
214
+ function getActiveElement() {
215
+ return document.activeElement instanceof HTMLElement ? document.activeElement : null;
216
+ }
3682
217
  function DocSearch(props) {
3683
218
  const [activeIndex, setActiveIndex] = createSignal(0);
219
+ const dialogId = `docs-search-${createUniqueId()}`;
3684
220
  let inputRef;
221
+ let dialogRef;
222
+ let previousFocus = null;
223
+ const resultRefs = [];
224
+ const activeResultId = createMemo(() => {
225
+ const activeResult = props.results[activeIndex()];
226
+ return activeResult ? `${dialogId}-result-${activeResult.pageId}` : void 0;
227
+ });
3685
228
  createEffect(() => {
3686
- if (props.isOpen) {
3687
- setActiveIndex(0);
229
+ if (!props.isOpen) {
230
+ return;
3688
231
  }
232
+ previousFocus = getActiveElement();
233
+ setActiveIndex(0);
3689
234
  });
3690
235
  createEffect(() => {
236
+ props.query;
3691
237
  props.results;
3692
238
  setActiveIndex(0);
3693
239
  });
240
+ createEffect(() => {
241
+ resultRefs[activeIndex()]?.scrollIntoView({ block: "nearest" });
242
+ });
3694
243
  const handleKeyDown = (e) => {
3695
244
  if (e.key === "ArrowDown") {
3696
245
  e.preventDefault();
@@ -3704,9 +253,13 @@ function DocSearch(props) {
3704
253
  } else if (e.key === "Escape") {
3705
254
  e.preventDefault();
3706
255
  props.onClose();
3707
- }
256
+ previousFocus?.focus();
257
+ } else if (e.key === "Tab" && dialogRef) ;
3708
258
  };
3709
- return /* @__PURE__ */ jsx(AnimatePresence, { children: /* @__PURE__ */ jsx(Show, { when: props.isOpen, children: /* @__PURE__ */ jsxs("div", { class: "fixed inset-0 z-50 flex items-start justify-center pt-[15vh]", children: [
259
+ if (!props.isOpen) {
260
+ return null;
261
+ }
262
+ return /* @__PURE__ */ jsx(AnimatePresence, { children: /* @__PURE__ */ jsxs("div", { class: "fixed inset-0 z-50 flex items-start justify-center pt-[15vh]", children: [
3710
263
  /* @__PURE__ */ jsx(
3711
264
  motion.button,
3712
265
  {
@@ -3716,94 +269,120 @@ function DocSearch(props) {
3716
269
  animate: { opacity: 1 },
3717
270
  exit: { opacity: 0 },
3718
271
  class: "fixed inset-0 bg-black/60 backdrop-blur-md",
3719
- onClick: () => props.onClose()
272
+ onClick: () => {
273
+ props.onClose();
274
+ previousFocus?.focus();
275
+ }
3720
276
  }
3721
277
  ),
3722
278
  /* @__PURE__ */ jsxs(
3723
279
  motion.div,
3724
280
  {
281
+ ref: dialogRef,
3725
282
  initial: { opacity: 0, scale: 0.95, y: -20 },
3726
283
  animate: { opacity: 1, scale: 1, y: 0 },
3727
284
  exit: { opacity: 0, scale: 0.95, y: -20 },
3728
285
  transition: { type: "spring", damping: 25, stiffness: 250 },
3729
286
  class: "relative z-10 w-full max-w-xl overflow-hidden rounded-2xl border border-white/10 bg-zinc-900/40 backdrop-blur-3xl shadow-2xl ring-1 ring-white/5",
287
+ role: "dialog",
288
+ "aria-modal": "true",
289
+ "aria-labelledby": `${dialogId}-title`,
290
+ onKeyDown: handleKeyDown,
3730
291
  onClick: (e) => e.stopPropagation(),
3731
292
  children: [
3732
293
  /* @__PURE__ */ jsxs("div", { class: "flex items-center gap-3 border-b border-white/10 px-5 py-4 bg-white/5", children: [
294
+ /* @__PURE__ */ jsx("h2", { id: `${dialogId}-title`, class: "sr-only", children: "Search documentation" }),
3733
295
  /* @__PURE__ */ jsx("svg", { "aria-hidden": "true", class: "h-5 w-5 shrink-0 text-white/40", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { "fill-rule": "evenodd", d: "M9 3.5a5.5 5.5 0 100 11 5.5 5.5 0 000-11zM2 9a7 7 0 1112.452 4.391l3.328 3.329a.75.75 0 11-1.06 1.06l-3.329-3.328A7 7 0 012 9z", "clip-rule": "evenodd" }) }),
3734
296
  /* @__PURE__ */ jsx(
3735
297
  "input",
3736
298
  {
3737
299
  ref: inputRef,
3738
- type: "text",
300
+ type: "search",
3739
301
  value: props.query,
3740
302
  onInput: (e) => props.onQuery(e.currentTarget.value),
3741
- onKeyDown: handleKeyDown,
3742
303
  placeholder: "Search documentation\u2026",
304
+ "aria-label": "Search documentation",
305
+ "aria-controls": `${dialogId}-results`,
306
+ "aria-activedescendant": activeResultId(),
3743
307
  class: "flex-1 bg-transparent text-sm text-white placeholder-white/30 outline-none"
3744
308
  }
3745
309
  ),
3746
310
  /* @__PURE__ */ jsx("kbd", { class: "rounded border border-white/10 bg-white/5 px-1.5 py-0.5 text-[11px] text-white/30 font-medium", children: "ESC" })
3747
311
  ] }),
3748
- /* @__PURE__ */ jsxs("div", { class: "max-h-80 overflow-y-auto p-2", children: [
3749
- /* @__PURE__ */ jsxs(AnimatePresence, { children: [
3750
- /* @__PURE__ */ jsx(Show, { when: props.results.length === 0 && props.query.trim(), children: /* @__PURE__ */ jsxs(
3751
- motion.div,
3752
- {
3753
- initial: { opacity: 0 },
3754
- animate: { opacity: 1 },
3755
- exit: { opacity: 0 },
3756
- class: "flex flex-col items-center py-10 text-center text-white/30",
3757
- children: [
3758
- /* @__PURE__ */ jsxs("svg", { "aria-hidden": "true", class: "mb-3 h-10 w-10 opacity-50", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", children: [
3759
- /* @__PURE__ */ jsx("circle", { cx: "11", cy: "11", r: "8", "stroke-width": "1.5" }),
3760
- /* @__PURE__ */ jsx("path", { d: "M21 21l-4.35-4.35", "stroke-width": "1.5" })
3761
- ] }),
3762
- /* @__PURE__ */ jsxs("p", { class: "text-sm", children: [
3763
- 'No results for "',
3764
- props.query,
3765
- '"'
3766
- ] }),
3767
- /* @__PURE__ */ jsx("p", { class: "mt-1 text-xs opacity-60", children: "Try different keywords" })
3768
- ]
3769
- }
3770
- ) }),
3771
- /* @__PURE__ */ jsx(Show, { when: props.results.length === 0 && !props.query.trim(), children: /* @__PURE__ */ jsx(
3772
- motion.div,
3773
- {
3774
- initial: { opacity: 0 },
3775
- animate: { opacity: 1 },
3776
- exit: { opacity: 0 },
3777
- class: "py-8 text-center text-sm text-white/30",
3778
- children: "Start typing to search\u2026"
3779
- }
3780
- ) })
3781
- ] }),
3782
- /* @__PURE__ */ jsx(For, { each: props.results, children: (result, idx) => /* @__PURE__ */ jsxs(
3783
- "button",
3784
- {
3785
- type: "button",
3786
- onClick: () => props.onSelect(result),
3787
- class: `group relative flex w-full flex-col gap-1 rounded-xl px-4 py-3 text-left transition-colors my-0.5 ${idx() === activeIndex() ? "bg-indigo-500/15 text-white ring-1 ring-indigo-500/30" : "text-white/70 hover:bg-white/5"}`,
3788
- children: [
3789
- /* @__PURE__ */ jsx(Show, { when: idx() === activeIndex(), children: /* @__PURE__ */ jsx(
312
+ /* @__PURE__ */ jsxs(
313
+ "div",
314
+ {
315
+ id: `${dialogId}-results`,
316
+ class: "max-h-80 overflow-y-auto p-2",
317
+ role: "listbox",
318
+ children: [
319
+ /* @__PURE__ */ jsxs(AnimatePresence, { children: [
320
+ /* @__PURE__ */ jsx(Show, { when: props.results.length === 0 && props.query.trim(), children: /* @__PURE__ */ jsxs(
3790
321
  motion.div,
3791
322
  {
3792
- layoutId: "search-active-bg",
3793
- class: "absolute inset-0 bg-indigo-500/10 rounded-xl",
3794
- transition: { type: "spring", stiffness: 300, damping: 30 }
323
+ initial: { opacity: 0 },
324
+ animate: { opacity: 1 },
325
+ exit: { opacity: 0 },
326
+ class: "flex flex-col items-center py-10 text-center text-white/30",
327
+ children: [
328
+ /* @__PURE__ */ jsxs("svg", { "aria-hidden": "true", class: "mb-3 h-10 w-10 opacity-50", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", children: [
329
+ /* @__PURE__ */ jsx("circle", { cx: "11", cy: "11", r: "8", "stroke-width": "1.5" }),
330
+ /* @__PURE__ */ jsx("path", { d: "M21 21l-4.35-4.35", "stroke-width": "1.5" })
331
+ ] }),
332
+ /* @__PURE__ */ jsxs("p", { class: "text-sm", children: [
333
+ 'No results for "',
334
+ props.query,
335
+ '"'
336
+ ] }),
337
+ /* @__PURE__ */ jsx("p", { class: "mt-1 text-xs opacity-60", children: "Try different keywords" })
338
+ ]
3795
339
  }
3796
340
  ) }),
3797
- /* @__PURE__ */ jsxs("div", { class: "relative z-10 flex items-center gap-2", children: [
3798
- /* @__PURE__ */ jsx("span", { class: "rounded bg-indigo-500/20 px-1.5 py-0.5 text-[10px] font-medium text-indigo-300", children: result.sectionTitle }),
3799
- /* @__PURE__ */ jsx("span", { class: "text-sm font-medium", children: result.pageTitle })
3800
- ] }),
3801
- /* @__PURE__ */ jsx("p", { class: "relative z-10 truncate text-xs text-white/40", children: highlightMatch(result.highlight, props.query) }),
3802
- /* @__PURE__ */ jsx(Show, { when: result.tags.length > 0, children: /* @__PURE__ */ jsx("div", { class: "relative z-10 flex gap-1 mt-1", children: /* @__PURE__ */ jsx(For, { each: result.tags.slice(0, 3), children: (tag) => /* @__PURE__ */ jsx("span", { class: "rounded bg-white/5 px-1.5 py-0.5 text-[10px] text-white/30 border border-white/5", children: tag }) }) }) })
3803
- ]
3804
- }
3805
- ) })
3806
- ] }),
341
+ /* @__PURE__ */ jsx(Show, { when: props.results.length === 0 && !props.query.trim(), children: /* @__PURE__ */ jsx(
342
+ motion.div,
343
+ {
344
+ initial: { opacity: 0 },
345
+ animate: { opacity: 1 },
346
+ exit: { opacity: 0 },
347
+ class: "py-8 text-center text-sm text-white/30",
348
+ children: "Start typing to search\u2026"
349
+ }
350
+ ) })
351
+ ] }),
352
+ /* @__PURE__ */ jsx(For, { each: props.results, children: (result, idx) => /* @__PURE__ */ jsxs(
353
+ "button",
354
+ {
355
+ ref: (element) => {
356
+ resultRefs[idx()] = element;
357
+ },
358
+ id: `${dialogId}-result-${result.pageId}`,
359
+ type: "button",
360
+ role: "option",
361
+ "aria-selected": idx() === activeIndex(),
362
+ onMouseEnter: () => setActiveIndex(idx()),
363
+ onClick: () => props.onSelect(result),
364
+ class: `group relative flex w-full flex-col gap-1 rounded-xl px-4 py-3 text-left transition-colors my-0.5 ${idx() === activeIndex() ? "bg-indigo-500/15 text-white ring-1 ring-indigo-500/30" : "text-white/70 hover:bg-white/5"}`,
365
+ children: [
366
+ /* @__PURE__ */ jsx(Show, { when: idx() === activeIndex(), children: /* @__PURE__ */ jsx(
367
+ motion.div,
368
+ {
369
+ layoutId: "search-active-bg",
370
+ class: "absolute inset-0 bg-indigo-500/10 rounded-xl",
371
+ transition: { type: "spring", stiffness: 300, damping: 30 }
372
+ }
373
+ ) }),
374
+ /* @__PURE__ */ jsxs("div", { class: "relative z-10 flex items-center gap-2", children: [
375
+ /* @__PURE__ */ jsx("span", { class: "rounded bg-indigo-500/20 px-1.5 py-0.5 text-[10px] font-medium text-indigo-300", children: result.sectionTitle }),
376
+ /* @__PURE__ */ jsx("span", { class: "text-sm font-medium", children: result.pageTitle })
377
+ ] }),
378
+ /* @__PURE__ */ jsx("p", { class: "relative z-10 truncate text-xs text-white/40", children: highlightMatch(result.highlight, props.query) }),
379
+ /* @__PURE__ */ jsx(Show, { when: result.tags.length > 0, children: /* @__PURE__ */ jsx("div", { class: "relative z-10 flex gap-1 mt-1", children: /* @__PURE__ */ jsx(For, { each: result.tags.slice(0, 3), children: (tag) => /* @__PURE__ */ jsx("span", { class: "rounded bg-white/5 px-1.5 py-0.5 text-[10px] text-white/30 border border-white/5", children: tag }) }) }) })
380
+ ]
381
+ }
382
+ ) })
383
+ ]
384
+ }
385
+ ),
3807
386
  /* @__PURE__ */ jsxs("div", { class: "flex items-center gap-4 border-t border-white/10 px-5 py-2.5 text-[11px] text-white/30 bg-black/20", children: [
3808
387
  /* @__PURE__ */ jsxs("span", { class: "flex items-center gap-1", children: [
3809
388
  /* @__PURE__ */ jsx("kbd", { class: "rounded border border-white/10 bg-white/5 px-1 pb-0.5 text-[10px]", children: "\u2191" }),
@@ -3823,7 +402,7 @@ function DocSearch(props) {
3823
402
  ]
3824
403
  }
3825
404
  )
3826
- ] }) }) });
405
+ ] }) });
3827
406
  }
3828
407
  function DocSidebar(props) {
3829
408
  const [expandedIds, setExpandedIds] = createSignal(/* @__PURE__ */ new Set());
@@ -3919,6 +498,9 @@ function TocLink(props) {
3919
498
  ] });
3920
499
  }
3921
500
  function TableOfContents(props) {
501
+ if (props.toc.length === 0) {
502
+ return null;
503
+ }
3922
504
  return /* @__PURE__ */ jsxs("nav", { class: "sticky top-24", children: [
3923
505
  /* @__PURE__ */ jsx("h4", { class: "mb-3 text-xs font-semibold uppercase tracking-widest text-white/40", children: "On this page" }),
3924
506
  /* @__PURE__ */ jsx(motion.div, { class: "flex flex-col relative", layoutRoot: true, children: /* @__PURE__ */ jsx(AnimatePresence, { children: /* @__PURE__ */ jsx(For, { each: props.toc, children: (item) => /* @__PURE__ */ jsx(motion.div, { initial: { opacity: 0, x: -10 }, animate: { opacity: 1, x: 0 }, children: /* @__PURE__ */ jsx(TocLink, { item, activeId: props.activeId }) }) }) }) })
@@ -3974,10 +556,13 @@ function DocsLayout(props) {
3974
556
  ] });
3975
557
  }
3976
558
  function EditButton(props) {
3977
- return /* @__PURE__ */ jsx(Show, { when: props.editUrl, children: /* @__PURE__ */ jsxs(
559
+ if (!props.editUrl) {
560
+ return null;
561
+ }
562
+ return /* @__PURE__ */ jsxs(
3978
563
  "a",
3979
564
  {
3980
- href: `${props.editUrl?.replace(/\/$/, "")}/${props.pageSlug}.mdx`,
565
+ href: `${props.editUrl.replace(/\/$/, "")}/${props.pageSlug}.mdx`,
3981
566
  target: "_blank",
3982
567
  rel: "noopener noreferrer",
3983
568
  class: "inline-flex items-center gap-1.5 rounded-lg border border-white/10 px-3 py-1.5 text-xs text-white/40 transition-colors hover:border-white/20 hover:text-white/60",
@@ -3986,10 +571,13 @@ function EditButton(props) {
3986
571
  "Edit this page"
3987
572
  ]
3988
573
  }
3989
- ) });
574
+ );
3990
575
  }
3991
576
  function PageNavigation(props) {
3992
- return /* @__PURE__ */ jsx(Show, { when: props.prev || props.next, children: /* @__PURE__ */ jsxs("div", { class: "mt-12 flex items-stretch gap-4 border-t border-white/10 pt-8", children: [
577
+ if (!props.prev && !props.next) {
578
+ return null;
579
+ }
580
+ return /* @__PURE__ */ jsxs("div", { class: "mt-12 flex items-stretch gap-4 border-t border-white/10 pt-8", children: [
3993
581
  /* @__PURE__ */ jsx(Show, { when: props.prev, fallback: /* @__PURE__ */ jsx("div", { class: "flex-1" }), children: (prev) => /* @__PURE__ */ jsxs("a", { href: prev().href, class: "group flex flex-1 flex-col rounded-xl border border-white/10 p-4 transition-all hover:border-indigo-500/40 hover:bg-white/5", children: [
3994
582
  /* @__PURE__ */ jsx("span", { class: "text-xs text-white/40 group-hover:text-indigo-400 transition-colors", children: "\u2190 Previous" }),
3995
583
  /* @__PURE__ */ jsx("span", { class: "mt-1 text-sm font-medium text-white/80 group-hover:text-white transition-colors truncate", children: prev().title })
@@ -3998,11 +586,14 @@ function PageNavigation(props) {
3998
586
  /* @__PURE__ */ jsx("span", { class: "text-xs text-white/40 group-hover:text-indigo-400 transition-colors", children: "Next \u2192" }),
3999
587
  /* @__PURE__ */ jsx("span", { class: "mt-1 text-sm font-medium text-white/80 group-hover:text-white transition-colors truncate", children: next().title })
4000
588
  ] }) })
4001
- ] }) });
589
+ ] });
4002
590
  }
4003
591
  function VersionSelector(props) {
592
+ if (props.versions.length <= 1) {
593
+ return null;
594
+ }
4004
595
  const [isOpen, setIsOpen] = createSignal(false);
4005
- return /* @__PURE__ */ jsx(Show, { when: props.versions.length > 1, children: /* @__PURE__ */ jsxs("div", { class: "relative", children: [
596
+ return /* @__PURE__ */ jsxs("div", { class: "relative", children: [
4006
597
  /* @__PURE__ */ jsxs(
4007
598
  "button",
4008
599
  {
@@ -4042,7 +633,7 @@ function VersionSelector(props) {
4042
633
  ]
4043
634
  }
4044
635
  ) }) }) })
4045
- ] }) });
636
+ ] });
4046
637
  }
4047
638
  function createDocSearch(searchFn, debounceMs = 250) {
4048
639
  const [query, setQuery] = createSignal("");
@@ -4073,7 +664,10 @@ function createDocSearch(searchFn, debounceMs = 250) {
4073
664
  setResults([]);
4074
665
  setIsSearching(false);
4075
666
  };
4076
- return { results, isSearching, query, setQuery, clearSearch };
667
+ const handleSetQuery = (nextQuery) => {
668
+ setQuery(nextQuery);
669
+ };
670
+ return { results, isSearching, query, setQuery: handleSetQuery, clearSearch };
4077
671
  }
4078
672
  function DocSearchPage(props) {
4079
673
  const sections = createMemo(() => props.tree() ?? []);
@@ -4139,25 +733,37 @@ function DocSearchPage(props) {
4139
733
  }
4140
734
  );
4141
735
  }
4142
- function DocsAdminPage(props) {
4143
- const sections = createMemo(() => props.tree?.() ?? []);
4144
- const [selectedId, setSelectedId] = createSignal(null);
4145
- const [showSF, setShowSF] = createSignal(false);
4146
- const [showPF, setShowPF] = createSignal(false);
4147
- const [sectionForm, setSectionForm] = createSignal({
736
+ function toDocAccess(value) {
737
+ if (value === "public" || value === "team" || value === "admin") {
738
+ return value;
739
+ }
740
+ return "team";
741
+ }
742
+ function initialSectionForm() {
743
+ return {
4148
744
  title: "",
4149
745
  slug: "",
4150
746
  description: "",
4151
747
  icon: "",
4152
748
  access: "team"
4153
- });
4154
- const [pageForm, setPageForm] = createSignal({
749
+ };
750
+ }
751
+ function initialPageForm() {
752
+ return {
4155
753
  title: "",
4156
754
  slug: "",
4157
755
  content: "",
4158
756
  access: "team",
4159
757
  tags: ""
4160
- });
758
+ };
759
+ }
760
+ function DocsAdminPage(props) {
761
+ const sections = createMemo(() => props.tree?.() ?? []);
762
+ const [selectedId, setSelectedId] = createSignal(null);
763
+ const [showSF, setShowSF] = createSignal(false);
764
+ const [showPF, setShowPF] = createSignal(false);
765
+ const [sectionForm, setSectionForm] = createSignal(initialSectionForm());
766
+ const [pageForm, setPageForm] = createSignal(initialPageForm());
4161
767
  const selectedSection = createMemo(() => sections().find((s) => s.id === selectedId()));
4162
768
  const sectionPages = createMemo(() => {
4163
769
  const sec = selectedSection();
@@ -4165,6 +771,12 @@ function DocsAdminPage(props) {
4165
771
  if (props.allPages) return props.allPages.filter((p) => p.sectionId === selectedId());
4166
772
  return sec.pages ?? [];
4167
773
  });
774
+ const canCreateSection = createMemo(
775
+ () => sectionForm().title.trim().length > 0 && sectionForm().slug.trim().length > 0
776
+ );
777
+ const canCreatePage = createMemo(
778
+ () => pageForm().title.trim().length > 0 && pageForm().slug.trim().length > 0 && pageForm().content.trim().length > 0
779
+ );
4168
780
  return /* @__PURE__ */ jsx(
4169
781
  Show,
4170
782
  {
@@ -4179,21 +791,94 @@ function DocsAdminPage(props) {
4179
791
  /* @__PURE__ */ jsx("button", { type: "button", onClick: () => setShowSF(!showSF()), class: "rounded-lg bg-indigo-600 px-3 py-1.5 text-xs font-medium hover:bg-indigo-500", children: "+ Add" })
4180
792
  ] }),
4181
793
  /* @__PURE__ */ jsx(Show, { when: showSF(), children: /* @__PURE__ */ jsxs("div", { class: "mb-4 space-y-2 rounded-lg border border-white/10 bg-white/5 p-4", children: [
4182
- /* @__PURE__ */ jsx("input", { type: "text", placeholder: "Title", value: sectionForm().title, onInput: (e) => setSectionForm({ ...sectionForm(), title: e.currentTarget.value }), class: "w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm outline-none focus:border-indigo-500/40" }),
4183
- /* @__PURE__ */ jsx("input", { type: "text", placeholder: "Slug", value: sectionForm().slug, onInput: (e) => setSectionForm({ ...sectionForm(), slug: e.currentTarget.value }), class: "w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm outline-none focus:border-indigo-500/40" }),
4184
- /* @__PURE__ */ jsx("input", { type: "text", placeholder: "Icon", value: sectionForm().icon, onInput: (e) => setSectionForm({ ...sectionForm(), icon: e.currentTarget.value }), class: "w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm outline-none focus:border-indigo-500/40" }),
4185
- /* @__PURE__ */ jsx("input", { type: "text", placeholder: "Description", value: sectionForm().description, onInput: (e) => setSectionForm({ ...sectionForm(), description: e.currentTarget.value }), class: "w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm outline-none focus:border-indigo-500/40" }),
4186
- /* @__PURE__ */ jsxs("select", { value: sectionForm().access, onChange: (e) => setSectionForm({ ...sectionForm(), access: e.currentTarget.value }), class: "w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm outline-none focus:border-indigo-500/40", children: [
4187
- /* @__PURE__ */ jsx("option", { value: "public", children: "Public" }),
4188
- /* @__PURE__ */ jsx("option", { value: "team", children: "Team" }),
4189
- /* @__PURE__ */ jsx("option", { value: "admin", children: "Admin" })
794
+ /* @__PURE__ */ jsxs("label", { class: "block space-y-1", for: "docs-admin-section-title", children: [
795
+ /* @__PURE__ */ jsx("span", { class: "text-xs font-medium text-white/50", children: "Title" }),
796
+ /* @__PURE__ */ jsx(
797
+ "input",
798
+ {
799
+ id: "docs-admin-section-title",
800
+ type: "text",
801
+ placeholder: "Getting Started",
802
+ value: sectionForm().title,
803
+ onInput: (e) => setSectionForm({ ...sectionForm(), title: e.currentTarget.value }),
804
+ class: "w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm outline-none focus:border-indigo-500/40"
805
+ }
806
+ )
807
+ ] }),
808
+ /* @__PURE__ */ jsxs("label", { class: "block space-y-1", for: "docs-admin-section-slug", children: [
809
+ /* @__PURE__ */ jsx("span", { class: "text-xs font-medium text-white/50", children: "Slug" }),
810
+ /* @__PURE__ */ jsx(
811
+ "input",
812
+ {
813
+ id: "docs-admin-section-slug",
814
+ type: "text",
815
+ placeholder: "getting-started",
816
+ value: sectionForm().slug,
817
+ onInput: (e) => setSectionForm({ ...sectionForm(), slug: e.currentTarget.value }),
818
+ class: "w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm outline-none focus:border-indigo-500/40"
819
+ }
820
+ )
821
+ ] }),
822
+ /* @__PURE__ */ jsxs("label", { class: "block space-y-1", for: "docs-admin-section-icon", children: [
823
+ /* @__PURE__ */ jsx("span", { class: "text-xs font-medium text-white/50", children: "Icon" }),
824
+ /* @__PURE__ */ jsx(
825
+ "input",
826
+ {
827
+ id: "docs-admin-section-icon",
828
+ type: "text",
829
+ placeholder: "\u{1F4DA}",
830
+ value: sectionForm().icon,
831
+ onInput: (e) => setSectionForm({ ...sectionForm(), icon: e.currentTarget.value }),
832
+ class: "w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm outline-none focus:border-indigo-500/40"
833
+ }
834
+ )
835
+ ] }),
836
+ /* @__PURE__ */ jsxs("label", { class: "block space-y-1", for: "docs-admin-section-description", children: [
837
+ /* @__PURE__ */ jsx("span", { class: "text-xs font-medium text-white/50", children: "Description" }),
838
+ /* @__PURE__ */ jsx(
839
+ "input",
840
+ {
841
+ id: "docs-admin-section-description",
842
+ type: "text",
843
+ placeholder: "Overview pages and onboarding guides.",
844
+ value: sectionForm().description,
845
+ onInput: (e) => setSectionForm({ ...sectionForm(), description: e.currentTarget.value }),
846
+ class: "w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm outline-none focus:border-indigo-500/40"
847
+ }
848
+ )
849
+ ] }),
850
+ /* @__PURE__ */ jsxs("label", { class: "block space-y-1", for: "docs-admin-section-access", children: [
851
+ /* @__PURE__ */ jsx("span", { class: "text-xs font-medium text-white/50", children: "Access" }),
852
+ /* @__PURE__ */ jsxs(
853
+ "select",
854
+ {
855
+ id: "docs-admin-section-access",
856
+ value: sectionForm().access,
857
+ onChange: (e) => setSectionForm({ ...sectionForm(), access: toDocAccess(e.currentTarget.value) }),
858
+ class: "w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm outline-none focus:border-indigo-500/40",
859
+ children: [
860
+ /* @__PURE__ */ jsx("option", { value: "public", children: "Public" }),
861
+ /* @__PURE__ */ jsx("option", { value: "team", children: "Team" }),
862
+ /* @__PURE__ */ jsx("option", { value: "admin", children: "Admin" })
863
+ ]
864
+ }
865
+ )
4190
866
  ] }),
4191
867
  /* @__PURE__ */ jsxs("div", { class: "flex gap-2", children: [
4192
- /* @__PURE__ */ jsx("button", { type: "button", onClick: async () => {
4193
- await props.admin.createSection({ ...sectionForm(), order: sections().length });
4194
- setSectionForm({ title: "", slug: "", description: "", icon: "", access: "team" });
4195
- setShowSF(false);
4196
- }, class: "rounded-lg bg-indigo-600 px-4 py-2 text-xs font-medium hover:bg-indigo-500", children: "Create" }),
868
+ /* @__PURE__ */ jsx(
869
+ "button",
870
+ {
871
+ type: "button",
872
+ disabled: !canCreateSection(),
873
+ onClick: async () => {
874
+ await props.admin.createSection({ ...sectionForm(), order: sections().length });
875
+ setSectionForm(initialSectionForm());
876
+ setShowSF(false);
877
+ },
878
+ class: "rounded-lg bg-indigo-600 px-4 py-2 text-xs font-medium disabled:cursor-not-allowed disabled:opacity-40 hover:bg-indigo-500",
879
+ children: "Create"
880
+ }
881
+ ),
4197
882
  /* @__PURE__ */ jsx("button", { type: "button", onClick: () => setShowSF(false), class: "rounded-lg border border-white/10 px-4 py-2 text-xs hover:bg-white/5", children: "Cancel" })
4198
883
  ] })
4199
884
  ] }) }),
@@ -4222,6 +907,7 @@ function DocsAdminPage(props) {
4222
907
  if (confirm(`Delete "${section.title}"?`)) props.admin.deleteSection(section.id);
4223
908
  },
4224
909
  class: "rounded p-1 text-white/20 opacity-0 group-hover:opacity-100 hover:text-red-400",
910
+ "aria-label": `Delete section ${section.title}`,
4225
911
  children: "\u2715"
4226
912
  }
4227
913
  )
@@ -4235,23 +921,96 @@ function DocsAdminPage(props) {
4235
921
  ] }),
4236
922
  /* @__PURE__ */ jsx(Show, { when: !selectedSection(), children: /* @__PURE__ */ jsx("p", { class: "py-16 text-center text-sm text-white/30", children: "Select a section" }) }),
4237
923
  /* @__PURE__ */ jsx(Show, { when: showPF() && selectedSection(), children: /* @__PURE__ */ jsxs("div", { class: "mb-4 space-y-2 rounded-lg border border-white/10 bg-white/5 p-4", children: [
4238
- /* @__PURE__ */ jsx("input", { type: "text", placeholder: "Title", value: pageForm().title, onInput: (e) => setPageForm({ ...pageForm(), title: e.currentTarget.value }), class: "w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm outline-none focus:border-indigo-500/40" }),
4239
- /* @__PURE__ */ jsx("input", { type: "text", placeholder: "Slug", value: pageForm().slug, onInput: (e) => setPageForm({ ...pageForm(), slug: e.currentTarget.value }), class: "w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm outline-none focus:border-indigo-500/40" }),
4240
- /* @__PURE__ */ jsx("textarea", { placeholder: "Content (MDX)", value: pageForm().content, onInput: (e) => setPageForm({ ...pageForm(), content: e.currentTarget.value }), rows: 4, class: "w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm outline-none focus:border-indigo-500/40 resize-y" }),
4241
- /* @__PURE__ */ jsx("input", { type: "text", placeholder: "Tags (comma)", value: pageForm().tags, onInput: (e) => setPageForm({ ...pageForm(), tags: e.currentTarget.value }), class: "w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm outline-none focus:border-indigo-500/40" }),
4242
- /* @__PURE__ */ jsxs("select", { value: pageForm().access, onChange: (e) => setPageForm({ ...pageForm(), access: e.currentTarget.value }), class: "w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm outline-none focus:border-indigo-500/40", children: [
4243
- /* @__PURE__ */ jsx("option", { value: "public", children: "Public" }),
4244
- /* @__PURE__ */ jsx("option", { value: "team", children: "Team" }),
4245
- /* @__PURE__ */ jsx("option", { value: "admin", children: "Admin" })
924
+ /* @__PURE__ */ jsxs("label", { class: "block space-y-1", for: "docs-admin-page-title", children: [
925
+ /* @__PURE__ */ jsx("span", { class: "text-xs font-medium text-white/50", children: "Title" }),
926
+ /* @__PURE__ */ jsx(
927
+ "input",
928
+ {
929
+ id: "docs-admin-page-title",
930
+ type: "text",
931
+ placeholder: "Install the package",
932
+ value: pageForm().title,
933
+ onInput: (e) => setPageForm({ ...pageForm(), title: e.currentTarget.value }),
934
+ class: "w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm outline-none focus:border-indigo-500/40"
935
+ }
936
+ )
937
+ ] }),
938
+ /* @__PURE__ */ jsxs("label", { class: "block space-y-1", for: "docs-admin-page-slug", children: [
939
+ /* @__PURE__ */ jsx("span", { class: "text-xs font-medium text-white/50", children: "Slug" }),
940
+ /* @__PURE__ */ jsx(
941
+ "input",
942
+ {
943
+ id: "docs-admin-page-slug",
944
+ type: "text",
945
+ placeholder: "install",
946
+ value: pageForm().slug,
947
+ onInput: (e) => setPageForm({ ...pageForm(), slug: e.currentTarget.value }),
948
+ class: "w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm outline-none focus:border-indigo-500/40"
949
+ }
950
+ )
951
+ ] }),
952
+ /* @__PURE__ */ jsxs("label", { class: "block space-y-1", for: "docs-admin-page-content", children: [
953
+ /* @__PURE__ */ jsx("span", { class: "text-xs font-medium text-white/50", children: "Content (MDX)" }),
954
+ /* @__PURE__ */ jsx(
955
+ "textarea",
956
+ {
957
+ id: "docs-admin-page-content",
958
+ placeholder: "# Install",
959
+ value: pageForm().content,
960
+ onInput: (e) => setPageForm({ ...pageForm(), content: e.currentTarget.value }),
961
+ rows: 4,
962
+ class: "w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm outline-none focus:border-indigo-500/40 resize-y"
963
+ }
964
+ )
965
+ ] }),
966
+ /* @__PURE__ */ jsxs("label", { class: "block space-y-1", for: "docs-admin-page-tags", children: [
967
+ /* @__PURE__ */ jsx("span", { class: "text-xs font-medium text-white/50", children: "Tags" }),
968
+ /* @__PURE__ */ jsx(
969
+ "input",
970
+ {
971
+ id: "docs-admin-page-tags",
972
+ type: "text",
973
+ placeholder: "setup, install",
974
+ value: pageForm().tags,
975
+ onInput: (e) => setPageForm({ ...pageForm(), tags: e.currentTarget.value }),
976
+ class: "w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm outline-none focus:border-indigo-500/40"
977
+ }
978
+ )
979
+ ] }),
980
+ /* @__PURE__ */ jsxs("label", { class: "block space-y-1", for: "docs-admin-page-access", children: [
981
+ /* @__PURE__ */ jsx("span", { class: "text-xs font-medium text-white/50", children: "Access" }),
982
+ /* @__PURE__ */ jsxs(
983
+ "select",
984
+ {
985
+ id: "docs-admin-page-access",
986
+ value: pageForm().access,
987
+ onChange: (e) => setPageForm({ ...pageForm(), access: toDocAccess(e.currentTarget.value) }),
988
+ class: "w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm outline-none focus:border-indigo-500/40",
989
+ children: [
990
+ /* @__PURE__ */ jsx("option", { value: "public", children: "Public" }),
991
+ /* @__PURE__ */ jsx("option", { value: "team", children: "Team" }),
992
+ /* @__PURE__ */ jsx("option", { value: "admin", children: "Admin" })
993
+ ]
994
+ }
995
+ )
4246
996
  ] }),
4247
997
  /* @__PURE__ */ jsxs("div", { class: "flex gap-2", children: [
4248
- /* @__PURE__ */ jsx("button", { type: "button", onClick: async () => {
4249
- const sectionId = selectedId();
4250
- if (!sectionId) return;
4251
- await props.admin.createPage({ title: pageForm().title, slug: pageForm().slug, content: pageForm().content, sectionId, access: pageForm().access, tags: pageForm().tags ? pageForm().tags.split(",").map((t) => t.trim()) : [], order: sectionPages().length });
4252
- setPageForm({ title: "", slug: "", content: "", access: "team", tags: "" });
4253
- setShowPF(false);
4254
- }, class: "rounded-lg bg-indigo-600 px-4 py-2 text-xs font-medium hover:bg-indigo-500", children: "Create" }),
998
+ /* @__PURE__ */ jsx(
999
+ "button",
1000
+ {
1001
+ type: "button",
1002
+ disabled: !canCreatePage(),
1003
+ onClick: async () => {
1004
+ const sectionId = selectedId();
1005
+ if (!sectionId) return;
1006
+ await props.admin.createPage({ title: pageForm().title, slug: pageForm().slug, content: pageForm().content, sectionId, access: pageForm().access, tags: pageForm().tags ? pageForm().tags.split(",").map((t) => t.trim()) : [], order: sectionPages().length });
1007
+ setPageForm(initialPageForm());
1008
+ setShowPF(false);
1009
+ },
1010
+ class: "rounded-lg bg-indigo-600 px-4 py-2 text-xs font-medium disabled:cursor-not-allowed disabled:opacity-40 hover:bg-indigo-500",
1011
+ children: "Create"
1012
+ }
1013
+ ),
4255
1014
  /* @__PURE__ */ jsx("button", { type: "button", onClick: () => setShowPF(false), class: "rounded-lg border border-white/10 px-4 py-2 text-xs hover:bg-white/5", children: "Cancel" })
4256
1015
  ] })
4257
1016
  ] }) }),
@@ -4267,9 +1026,18 @@ function DocsAdminPage(props) {
4267
1026
  /* @__PURE__ */ jsxs("div", { class: "flex items-center gap-1 opacity-0 group-hover:opacity-100", children: [
4268
1027
  /* @__PURE__ */ jsx(Show, { when: page.status === "draft", children: /* @__PURE__ */ jsx("button", { type: "button", onClick: () => props.admin.publishPage(page.id), class: "rounded px-2 py-1 text-[11px] text-emerald-400 hover:bg-emerald-500/10", children: "Publish" }) }),
4269
1028
  /* @__PURE__ */ jsx(Show, { when: page.status === "published", children: /* @__PURE__ */ jsx("button", { type: "button", onClick: () => props.admin.archivePage(page.id), class: "rounded px-2 py-1 text-[11px] text-amber-400 hover:bg-amber-500/10", children: "Archive" }) }),
4270
- /* @__PURE__ */ jsx("button", { type: "button", onClick: () => {
4271
- if (confirm(`Delete "${page.title}"?`)) props.admin.deletePage(page.id);
4272
- }, class: "rounded p-1 text-white/20 hover:text-red-400", children: "\u2715" })
1029
+ /* @__PURE__ */ jsx(
1030
+ "button",
1031
+ {
1032
+ type: "button",
1033
+ onClick: () => {
1034
+ if (confirm(`Delete "${page.title}"?`)) props.admin.deletePage(page.id);
1035
+ },
1036
+ class: "rounded p-1 text-white/20 hover:text-red-400",
1037
+ "aria-label": `Delete page ${page.title}`,
1038
+ children: "\u2715"
1039
+ }
1040
+ )
4273
1041
  ] })
4274
1042
  ] }) }) }) }),
4275
1043
  /* @__PURE__ */ jsx(Show, { when: selectedSection() && sectionPages().length === 0 && !showPF(), children: /* @__PURE__ */ jsx("p", { class: "py-12 text-center text-sm text-white/30", children: "No pages in this section" }) })
@@ -4291,14 +1059,20 @@ function createDocs(tree, config) {
4291
1059
  setSection(section);
4292
1060
  setPage(null);
4293
1061
  };
1062
+ const handleSetPage = (page) => {
1063
+ setPage(page);
1064
+ };
1065
+ const handleSetSearchQuery = (query) => {
1066
+ setSearchQuery(query);
1067
+ };
4294
1068
  return {
4295
1069
  sections,
4296
1070
  currentSection,
4297
1071
  setSection: handleSetSection,
4298
1072
  currentPage,
4299
- setPage,
1073
+ setPage: handleSetPage,
4300
1074
  searchQuery,
4301
- setSearchQuery,
1075
+ setSearchQuery: handleSetSearchQuery,
4302
1076
  isLoading,
4303
1077
  config: mergedConfig,
4304
1078
  flatPages
@@ -4439,7 +1213,10 @@ function createTableOfContents(mdxContent) {
4439
1213
  }
4440
1214
  onCleanup(() => observer.disconnect());
4441
1215
  });
4442
- return { toc, activeId, setActiveId };
1216
+ const handleSetActiveId = (id) => {
1217
+ setActiveId(id);
1218
+ };
1219
+ return { toc, activeId, setActiveId: handleSetActiveId };
4443
1220
  }
4444
1221
  function DocViewPage(props) {
4445
1222
  const docs = createDocs(props.tree);
@@ -4560,24 +1337,6 @@ function createDocsAdmin(mutations) {
4560
1337
  }
4561
1338
  };
4562
1339
  }
4563
- /*! Bundled license information:
4564
-
4565
- is-extendable/index.js:
4566
- (*!
4567
- * is-extendable <https://github.com/jonschlinkert/is-extendable>
4568
- *
4569
- * Copyright (c) 2015, Jon Schlinkert.
4570
- * Licensed under the MIT License.
4571
- *)
4572
-
4573
- strip-bom-string/index.js:
4574
- (*!
4575
- * strip-bom-string <https://github.com/jonschlinkert/strip-bom-string>
4576
- *
4577
- * Copyright (c) 2015, 2017, Jon Schlinkert.
4578
- * Released under the MIT License.
4579
- *)
4580
- */
4581
1340
 
4582
1341
  export { Breadcrumbs, DocPage, DocSearch, DocSearchPage, DocSidebar, DocViewPage, DocsAdminPage, DocsIndexPage, DocsLayout, EditButton, PageNavigation, TableOfContents, VersionSelector, createDocSearch, createDocs, createDocsAdmin, createTableOfContents };
4583
1342
  //# sourceMappingURL=index.js.map