@caiquecamargo/vite-plugin-netlify-cms 0.0.6 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,7 +1,8 @@
1
- import { readdir as $s, mkdir as Cs, writeFile as vs, readFile as _s } from "fs/promises";
2
- import Ee from "path";
3
- const ft = Symbol.for("yaml.alias"), rt = Symbol.for("yaml.document"), W = Symbol.for("yaml.map"), Kt = Symbol.for("yaml.pair"), R = Symbol.for("yaml.scalar"), ce = Symbol.for("yaml.seq"), M = Symbol.for("yaml.node.type"), X = (s) => !!s && typeof s == "object" && s[M] === ft, ke = (s) => !!s && typeof s == "object" && s[M] === rt, z = (s) => !!s && typeof s == "object" && s[M] === W, I = (s) => !!s && typeof s == "object" && s[M] === Kt, A = (s) => !!s && typeof s == "object" && s[M] === R, fe = (s) => !!s && typeof s == "object" && s[M] === ce;
4
- function L(s) {
1
+ import { readdir as Kt, mkdir as vs, writeFile as _s } from "fs/promises";
2
+ import _e from "path";
3
+ import { loadConfigFromFile as Bs } from "vite";
4
+ const ft = Symbol.for("yaml.alias"), rt = Symbol.for("yaml.document"), W = Symbol.for("yaml.map"), Ft = Symbol.for("yaml.pair"), R = Symbol.for("yaml.scalar"), ce = Symbol.for("yaml.seq"), M = Symbol.for("yaml.node.type"), X = (s) => !!s && typeof s == "object" && s[M] === ft, ke = (s) => !!s && typeof s == "object" && s[M] === rt, z = (s) => !!s && typeof s == "object" && s[M] === W, I = (s) => !!s && typeof s == "object" && s[M] === Ft, A = (s) => !!s && typeof s == "object" && s[M] === R, fe = (s) => !!s && typeof s == "object" && s[M] === ce;
5
+ function T(s) {
5
6
  if (s && typeof s == "object")
6
7
  switch (s[M]) {
7
8
  case W:
@@ -10,7 +11,7 @@ function L(s) {
10
11
  }
11
12
  return !1;
12
13
  }
13
- function T(s) {
14
+ function L(s) {
14
15
  if (s && typeof s == "object")
15
16
  switch (s[M]) {
16
17
  case ft:
@@ -21,7 +22,7 @@ function T(s) {
21
22
  }
22
23
  return !1;
23
24
  }
24
- const Bs = (s) => (A(s) || L(s)) && !!s.anchor;
25
+ const js = (s) => (A(s) || T(s)) && !!s.anchor;
25
26
  class ut {
26
27
  constructor(e) {
27
28
  Object.defineProperty(this, M, { value: e });
@@ -32,20 +33,20 @@ class ut {
32
33
  return this.range && (e.range = this.range.slice()), e;
33
34
  }
34
35
  }
35
- const v = Symbol("break visit"), Ft = Symbol("skip children"), K = Symbol("remove node");
36
+ const v = Symbol("break visit"), qt = Symbol("skip children"), K = Symbol("remove node");
36
37
  function J(s, e) {
37
- const t = qt(e);
38
+ const t = Ut(e);
38
39
  ke(s) ? ne(null, s.contents, t, Object.freeze([s])) === K && (s.contents = null) : ne(null, s, t, Object.freeze([]));
39
40
  }
40
41
  J.BREAK = v;
41
- J.SKIP = Ft;
42
+ J.SKIP = qt;
42
43
  J.REMOVE = K;
43
44
  function ne(s, e, t, n) {
44
- const i = Ut(s, e, t, n);
45
- if (T(i) || I(i))
46
- return Rt(s, n, i), ne(s, i, t, n);
45
+ const i = Rt(s, e, t, n);
46
+ if (L(i) || I(i))
47
+ return Vt(s, n, i), ne(s, i, t, n);
47
48
  if (typeof i != "symbol") {
48
- if (L(e)) {
49
+ if (T(e)) {
49
50
  n = Object.freeze(n.concat(e));
50
51
  for (let r = 0; r < e.items.length; ++r) {
51
52
  const o = ne(r, e.items[r], t, n);
@@ -72,18 +73,18 @@ function ne(s, e, t, n) {
72
73
  return i;
73
74
  }
74
75
  async function De(s, e) {
75
- const t = qt(e);
76
+ const t = Ut(e);
76
77
  ke(s) ? await ie(null, s.contents, t, Object.freeze([s])) === K && (s.contents = null) : await ie(null, s, t, Object.freeze([]));
77
78
  }
78
79
  De.BREAK = v;
79
- De.SKIP = Ft;
80
+ De.SKIP = qt;
80
81
  De.REMOVE = K;
81
82
  async function ie(s, e, t, n) {
82
- const i = await Ut(s, e, t, n);
83
- if (T(i) || I(i))
84
- return Rt(s, n, i), ie(s, i, t, n);
83
+ const i = await Rt(s, e, t, n);
84
+ if (L(i) || I(i))
85
+ return Vt(s, n, i), ie(s, i, t, n);
85
86
  if (typeof i != "symbol") {
86
- if (L(e)) {
87
+ if (T(e)) {
87
88
  n = Object.freeze(n.concat(e));
88
89
  for (let r = 0; r < e.items.length; ++r) {
89
90
  const o = await ie(r, e.items[r], t, n);
@@ -109,7 +110,7 @@ async function ie(s, e, t, n) {
109
110
  }
110
111
  return i;
111
112
  }
112
- function qt(s) {
113
+ function Ut(s) {
113
114
  return typeof s == "object" && (s.Collection || s.Node || s.Value) ? Object.assign({
114
115
  Alias: s.Node,
115
116
  Map: s.Node,
@@ -124,7 +125,7 @@ function qt(s) {
124
125
  Seq: s.Collection
125
126
  }, s) : s;
126
127
  }
127
- function Ut(s, e, t, n) {
128
+ function Rt(s, e, t, n) {
128
129
  if (typeof t == "function")
129
130
  return t(s, e, n);
130
131
  if (z(e))
@@ -138,9 +139,9 @@ function Ut(s, e, t, n) {
138
139
  if (X(e))
139
140
  return t.Alias?.(s, e, n);
140
141
  }
141
- function Rt(s, e, t) {
142
+ function Vt(s, e, t) {
142
143
  const n = e[e.length - 1];
143
- if (L(n))
144
+ if (T(n))
144
145
  n.items[s] = t;
145
146
  else if (I(n))
146
147
  s === "key" ? n.key = t : n.value = t;
@@ -151,14 +152,14 @@ function Rt(s, e, t) {
151
152
  throw new Error(`Cannot replace node with ${i} parent`);
152
153
  }
153
154
  }
154
- const js = {
155
+ const Ms = {
155
156
  "!": "%21",
156
157
  ",": "%2C",
157
158
  "[": "%5B",
158
159
  "]": "%5D",
159
160
  "{": "%7B",
160
161
  "}": "%7D"
161
- }, Ms = (s) => s.replace(/[!,[\]{}]/g, (e) => js[e]);
162
+ }, Ps = (s) => s.replace(/[!,[\]{}]/g, (e) => Ms[e]);
162
163
  class C {
163
164
  constructor(e, t) {
164
165
  this.docStart = null, this.docEnd = !1, this.yaml = Object.assign({}, C.defaultYaml, e), this.tags = Object.assign({}, C.defaultTags, t);
@@ -242,16 +243,16 @@ class C {
242
243
  tagString(e) {
243
244
  for (const [t, n] of Object.entries(this.tags))
244
245
  if (e.startsWith(n))
245
- return t + Ms(e.substring(n.length));
246
+ return t + Ps(e.substring(n.length));
246
247
  return e[0] === "!" ? e : `!<${e}>`;
247
248
  }
248
249
  toString(e) {
249
250
  const t = this.yaml.explicit ? [`%YAML ${this.yaml.version || "1.2"}`] : [], n = Object.entries(this.tags);
250
251
  let i;
251
- if (e && n.length > 0 && T(e.contents)) {
252
+ if (e && n.length > 0 && L(e.contents)) {
252
253
  const r = {};
253
254
  J(e.contents, (o, l) => {
254
- T(l) && l.tag && (r[l.tag] = !0);
255
+ L(l) && l.tag && (r[l.tag] = !0);
255
256
  }), i = Object.keys(r);
256
257
  } else
257
258
  i = [];
@@ -263,14 +264,14 @@ class C {
263
264
  }
264
265
  C.defaultYaml = { explicit: !1, version: "1.2" };
265
266
  C.defaultTags = { "!!": "tag:yaml.org,2002:" };
266
- function Vt(s) {
267
+ function Wt(s) {
267
268
  if (/[\x00-\x19\s,[\]{}]/.test(s)) {
268
269
  const t = `Anchor must not contain whitespace or control characters: ${JSON.stringify(s)}`;
269
270
  throw new Error(t);
270
271
  }
271
272
  return !0;
272
273
  }
273
- function Wt(s) {
274
+ function Jt(s) {
274
275
  const e = /* @__PURE__ */ new Set();
275
276
  return J(s, {
276
277
  Value(t, n) {
@@ -278,20 +279,20 @@ function Wt(s) {
278
279
  }
279
280
  }), e;
280
281
  }
281
- function Jt(s, e) {
282
+ function Yt(s, e) {
282
283
  for (let t = 1; ; ++t) {
283
284
  const n = `${s}${t}`;
284
285
  if (!e.has(n))
285
286
  return n;
286
287
  }
287
288
  }
288
- function Ps(s, e) {
289
+ function Ds(s, e) {
289
290
  const t = [], n = /* @__PURE__ */ new Map();
290
291
  let i = null;
291
292
  return {
292
293
  onAnchor: (r) => {
293
- t.push(r), i || (i = Wt(s));
294
- const o = Jt(e, i);
294
+ t.push(r), i || (i = Jt(s));
295
+ const o = Yt(e, i);
295
296
  return i.add(o), o;
296
297
  },
297
298
  /**
@@ -302,7 +303,7 @@ function Ps(s, e) {
302
303
  setAnchors: () => {
303
304
  for (const r of t) {
304
305
  const o = n.get(r);
305
- if (typeof o == "object" && o.anchor && (A(o.node) || L(o.node)))
306
+ if (typeof o == "object" && o.anchor && (A(o.node) || T(o.node)))
306
307
  o.node.anchor = o.anchor;
307
308
  else {
308
309
  const l = new Error("Failed to resolve repeated object (this should not happen)");
@@ -348,7 +349,7 @@ class Ke extends ut {
348
349
  const a = "This should not happen: Alias anchor was not resolved?";
349
350
  throw new ReferenceError(a);
350
351
  }
351
- if (r >= 0 && (l.count += 1, l.aliasCount === 0 && (l.aliasCount = $e(i, o, n)), l.count * l.aliasCount > r)) {
352
+ if (r >= 0 && (l.count += 1, l.aliasCount === 0 && (l.aliasCount = Le(i, o, n)), l.count * l.aliasCount > r)) {
352
353
  const a = "Excessive alias count indicates a resource exhaustion attack";
353
354
  throw new ReferenceError(a);
354
355
  }
@@ -357,7 +358,7 @@ class Ke extends ut {
357
358
  toString(e, t, n) {
358
359
  const i = `*${this.source}`;
359
360
  if (e) {
360
- if (Vt(this.source), e.options.verifyAliasOrder && !e.anchors.has(this.source)) {
361
+ if (Wt(this.source), e.options.verifyAliasOrder && !e.anchors.has(this.source)) {
361
362
  const r = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
362
363
  throw new Error(r);
363
364
  }
@@ -367,19 +368,19 @@ class Ke extends ut {
367
368
  return i;
368
369
  }
369
370
  }
370
- function $e(s, e, t) {
371
+ function Le(s, e, t) {
371
372
  if (X(e)) {
372
373
  const n = e.resolve(s), i = t && n && t.get(n);
373
374
  return i ? i.count * i.aliasCount : 0;
374
- } else if (L(e)) {
375
+ } else if (T(e)) {
375
376
  let n = 0;
376
377
  for (const i of e.items) {
377
- const r = $e(s, i, t);
378
+ const r = Le(s, i, t);
378
379
  r > n && (n = r);
379
380
  }
380
381
  return n;
381
382
  } else if (I(e)) {
382
- const n = $e(s, e.key, t), i = $e(s, e.value, t);
383
+ const n = Le(s, e.key, t), i = Le(s, e.value, t);
383
384
  return Math.max(n, i);
384
385
  }
385
386
  return 1;
@@ -388,7 +389,7 @@ function F(s, e, t) {
388
389
  if (Array.isArray(s))
389
390
  return s.map((n, i) => F(n, String(i), t));
390
391
  if (s && typeof s.toJSON == "function") {
391
- if (!t || !Bs(s))
392
+ if (!t || !js(s))
392
393
  return s.toJSON(e, t);
393
394
  const n = { aliasCount: 0, count: 1, res: void 0 };
394
395
  t.anchors.set(s, n), t.onCreate = (r) => {
@@ -399,7 +400,7 @@ function F(s, e, t) {
399
400
  }
400
401
  return typeof s == "bigint" && !t?.keep ? Number(s) : s;
401
402
  }
402
- const Yt = (s) => !s || typeof s != "function" && typeof s != "object";
403
+ const Gt = (s) => !s || typeof s != "function" && typeof s != "object";
403
404
  class N extends ut {
404
405
  constructor(e) {
405
406
  super(R), this.value = e;
@@ -416,8 +417,8 @@ N.BLOCK_LITERAL = "BLOCK_LITERAL";
416
417
  N.PLAIN = "PLAIN";
417
418
  N.QUOTE_DOUBLE = "QUOTE_DOUBLE";
418
419
  N.QUOTE_SINGLE = "QUOTE_SINGLE";
419
- const Ds = "tag:yaml.org,2002:";
420
- function Ks(s, e, t) {
420
+ const Ks = "tag:yaml.org,2002:";
421
+ function Fs(s, e, t) {
421
422
  if (e) {
422
423
  const n = t.filter((r) => r.tag === e), i = n.find((r) => !r.format) ?? n[0];
423
424
  if (!i)
@@ -427,7 +428,7 @@ function Ks(s, e, t) {
427
428
  return t.find((n) => n.identify?.(s) && !n.format);
428
429
  }
429
430
  function be(s, e, t) {
430
- if (ke(s) && (s = s.contents), T(s))
431
+ if (ke(s) && (s = s.contents), L(s))
431
432
  return s;
432
433
  if (I(s)) {
433
434
  const f = t.schema[W].createNode?.(t.schema, null, t);
@@ -441,8 +442,8 @@ function be(s, e, t) {
441
442
  return a.anchor || (a.anchor = i(s)), new Ke(a.anchor);
442
443
  a = { anchor: null, node: null }, l.set(s, a);
443
444
  }
444
- e?.startsWith("!!") && (e = Ds + e.slice(2));
445
- let c = Ks(s, e, o.tags);
445
+ e?.startsWith("!!") && (e = Ks + e.slice(2));
446
+ let c = Fs(s, e, o.tags);
446
447
  if (!c) {
447
448
  if (s && typeof s.toJSON == "function" && (s = s.toJSON()), !s || typeof s != "object") {
448
449
  const f = new N(s);
@@ -491,7 +492,7 @@ class Fe extends ut {
491
492
  */
492
493
  clone(e) {
493
494
  const t = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
494
- return e && (t.schema = e), t.items = t.items.map((n) => T(n) || I(n) ? n.clone(e) : n), this.range && (t.range = this.range.slice()), t;
495
+ return e && (t.schema = e), t.items = t.items.map((n) => L(n) || I(n) ? n.clone(e) : n), this.range && (t.range = this.range.slice()), t;
495
496
  }
496
497
  /**
497
498
  * Adds a value to the collection. For `!!map` and `!!omap` the value must
@@ -503,7 +504,7 @@ class Fe extends ut {
503
504
  this.add(t);
504
505
  else {
505
506
  const [n, ...i] = e, r = this.get(n, !0);
506
- if (L(r))
507
+ if (T(r))
507
508
  r.addIn(i, t);
508
509
  else if (r === void 0 && this.schema)
509
510
  this.set(n, Be(this.schema, i, t));
@@ -520,7 +521,7 @@ class Fe extends ut {
520
521
  if (n.length === 0)
521
522
  return this.delete(t);
522
523
  const i = this.get(t, !0);
523
- if (L(i))
524
+ if (T(i))
524
525
  return i.deleteIn(n);
525
526
  throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`);
526
527
  }
@@ -531,7 +532,7 @@ class Fe extends ut {
531
532
  */
532
533
  getIn(e, t) {
533
534
  const [n, ...i] = e, r = this.get(n, !0);
534
- return i.length === 0 ? !t && A(r) ? r.value : r : L(r) ? r.getIn(i, t) : void 0;
535
+ return i.length === 0 ? !t && A(r) ? r.value : r : T(r) ? r.getIn(i, t) : void 0;
535
536
  }
536
537
  hasAllNullValues(e) {
537
538
  return this.items.every((t) => {
@@ -549,7 +550,7 @@ class Fe extends ut {
549
550
  if (n.length === 0)
550
551
  return this.has(t);
551
552
  const i = this.get(t, !0);
552
- return L(i) ? i.hasIn(n) : !1;
553
+ return T(i) ? i.hasIn(n) : !1;
553
554
  }
554
555
  /**
555
556
  * Sets a value in this collection. For `!!set`, `value` needs to be a
@@ -561,7 +562,7 @@ class Fe extends ut {
561
562
  this.set(n, t);
562
563
  else {
563
564
  const r = this.get(n, !0);
564
- if (L(r))
565
+ if (T(r))
565
566
  r.setIn(i, t);
566
567
  else if (r === void 0 && this.schema)
567
568
  this.set(n, Be(this.schema, i, t));
@@ -571,14 +572,14 @@ class Fe extends ut {
571
572
  }
572
573
  }
573
574
  Fe.maxFlowStringSingleLineLength = 60;
574
- const Fs = (s) => s.replace(/^(?!$)(?: $)?/gm, "#");
575
+ const qs = (s) => s.replace(/^(?!$)(?: $)?/gm, "#");
575
576
  function U(s, e) {
576
577
  return /^\n+$/.test(s) ? s.substring(1) : e ? s.replace(/^(?! *$)/gm, e) : s;
577
578
  }
578
579
  const V = (s, e, t) => s.endsWith(`
579
580
  `) ? U(t, e) : t.includes(`
580
581
  `) ? `
581
- ` + U(t, e) : (s.endsWith(" ") ? "" : " ") + t, Gt = "flow", ot = "block", Ce = "quoted";
582
+ ` + U(t, e) : (s.endsWith(" ") ? "" : " ") + t, Qt = "flow", ot = "block", $e = "quoted";
582
583
  function qe(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentWidth: r = 20, onFold: o, onOverflow: l } = {}) {
583
584
  if (!i || i < 0)
584
585
  return s;
@@ -591,7 +592,7 @@ function qe(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentW
591
592
  let h, p, y = !1, d = -1, m = -1, b = -1;
592
593
  t === ot && (d = It(s, d), d !== -1 && (f = d + a));
593
594
  for (let k; k = s[d += 1]; ) {
594
- if (t === Ce && k === "\\") {
595
+ if (t === $e && k === "\\") {
595
596
  switch (m = d, s[d + 1]) {
596
597
  case "x":
597
598
  d += 3;
@@ -620,7 +621,7 @@ function qe(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentW
620
621
  if (d >= f)
621
622
  if (h)
622
623
  c.push(h), f = h + a, h = void 0;
623
- else if (t === Ce) {
624
+ else if (t === $e) {
624
625
  for (; p === " " || p === " "; )
625
626
  p = k, k = s[d += 1], y = !0;
626
627
  const S = d > b + 1 ? d - 2 : m - 1;
@@ -639,7 +640,7 @@ function qe(s, e, t = "flow", { indentAtStart: n, lineWidth: i = 80, minContentW
639
640
  for (let k = 0; k < c.length; ++k) {
640
641
  const S = c[k], O = c[k + 1] || s.length;
641
642
  S === 0 ? w = `
642
- ${e}${s.slice(0, O)}` : (t === Ce && u[S] && (w += `${s[S]}\\`), w += `
643
+ ${e}${s.slice(0, O)}` : (t === $e && u[S] && (w += `${s[S]}\\`), w += `
643
644
  ${e}${s.slice(S + 1, O)}`);
644
645
  }
645
646
  return w;
@@ -660,7 +661,7 @@ const Ue = (s) => ({
660
661
  lineWidth: s.options.lineWidth,
661
662
  minContentWidth: s.options.minContentWidth
662
663
  }), Re = (s) => /^(%|---|\.\.\.)/m.test(s);
663
- function qs(s, e, t) {
664
+ function Us(s, e, t) {
664
665
  if (!e || e < 0)
665
666
  return !1;
666
667
  const n = e - t, i = s.length;
@@ -735,7 +736,7 @@ function ye(s, e) {
735
736
  default:
736
737
  a += 1;
737
738
  }
738
- return o = l ? o + t.slice(l) : t, n ? o : qe(o, r, Ce, Ue(e));
739
+ return o = l ? o + t.slice(l) : t, n ? o : qe(o, r, $e, Ue(e));
739
740
  }
740
741
  function lt(s, e) {
741
742
  if (e.options.singleQuote === !1 || e.implicitKey && s.includes(`
@@ -743,7 +744,7 @@ function lt(s, e) {
743
744
  return ye(s, e);
744
745
  const t = e.indent || (Re(s) ? " " : ""), n = "'" + s.replace(/'/g, "''").replace(/\n+/g, `$&
745
746
  ${t}`) + "'";
746
- return e.implicitKey ? n : qe(n, t, Gt, Ue(e));
747
+ return e.implicitKey ? n : qe(n, t, Qt, Ue(e));
747
748
  }
748
749
  function re(s, e) {
749
750
  const { singleQuote: t } = e.options;
@@ -756,11 +757,11 @@ function re(s, e) {
756
757
  }
757
758
  return n(s, e);
758
759
  }
759
- function ve({ comment: s, type: e, value: t }, n, i, r) {
760
+ function Ce({ comment: s, type: e, value: t }, n, i, r) {
760
761
  const { blockQuote: o, commentString: l, lineWidth: a } = n.options;
761
762
  if (!o || /\n[\t ]+$/.test(t) || /^\s*$/.test(t))
762
763
  return re(t, n);
763
- const c = n.indent || (n.forceBlockIndent || Re(t) ? " " : ""), u = o === "literal" ? !0 : o === "folded" || e === N.BLOCK_FOLDED ? !1 : e === N.BLOCK_LITERAL ? !0 : !qs(t, a, c.length);
764
+ const c = n.indent || (n.forceBlockIndent || Re(t) ? " " : ""), u = o === "literal" ? !0 : o === "folded" || e === N.BLOCK_FOLDED ? !1 : e === N.BLOCK_LITERAL ? !0 : !Us(t, a, c.length);
764
765
  if (!t)
765
766
  return u ? `|
766
767
  ` : `>
@@ -800,19 +801,19 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/
800
801
  return `${S}
801
802
  ${c}${O}`;
802
803
  }
803
- function Us(s, e, t, n) {
804
+ function Rs(s, e, t, n) {
804
805
  const { type: i, value: r } = s, { actualString: o, implicitKey: l, indent: a, indentStep: c, inFlow: u } = e;
805
806
  if (l && /[\n[\]{},]/.test(r) || u && /[[\]{},]/.test(r))
806
807
  return re(r, e);
807
808
  if (!r || /^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))
808
809
  return l || u || !r.includes(`
809
- `) ? re(r, e) : ve(s, e, t, n);
810
+ `) ? re(r, e) : Ce(s, e, t, n);
810
811
  if (!l && !u && i !== N.PLAIN && r.includes(`
811
812
  `))
812
- return ve(s, e, t, n);
813
+ return Ce(s, e, t, n);
813
814
  if (Re(r)) {
814
815
  if (a === "")
815
- return e.forceBlockIndent = !0, ve(s, e, t, n);
816
+ return e.forceBlockIndent = !0, Ce(s, e, t, n);
816
817
  if (l && a === c)
817
818
  return re(r, e);
818
819
  }
@@ -823,7 +824,7 @@ ${a}`);
823
824
  if (y.some(h) || p?.some(h))
824
825
  return re(r, e);
825
826
  }
826
- return l ? f : qe(f, a, Gt, Ue(e));
827
+ return l ? f : qe(f, a, Qt, Ue(e));
827
828
  }
828
829
  function Ne(s, e, t, n) {
829
830
  const { implicitKey: i, inFlow: r } = e, o = typeof s.value == "string" ? s : Object.assign({}, s, { value: String(s.value) });
@@ -833,13 +834,13 @@ function Ne(s, e, t, n) {
833
834
  switch (u) {
834
835
  case N.BLOCK_FOLDED:
835
836
  case N.BLOCK_LITERAL:
836
- return i || r ? re(o.value, e) : ve(o, e, t, n);
837
+ return i || r ? re(o.value, e) : Ce(o, e, t, n);
837
838
  case N.QUOTE_DOUBLE:
838
839
  return ye(o.value, e);
839
840
  case N.QUOTE_SINGLE:
840
841
  return lt(o.value, e);
841
842
  case N.PLAIN:
842
- return Us(o, e, t, n);
843
+ return Rs(o, e, t, n);
843
844
  default:
844
845
  return null;
845
846
  }
@@ -852,10 +853,10 @@ function Ne(s, e, t, n) {
852
853
  }
853
854
  return c;
854
855
  }
855
- function Qt(s, e) {
856
+ function Ht(s, e) {
856
857
  const t = Object.assign({
857
858
  blockQuote: !0,
858
- commentString: Fs,
859
+ commentString: qs,
859
860
  defaultKeyType: null,
860
861
  defaultStringType: "PLAIN",
861
862
  directives: null,
@@ -893,7 +894,7 @@ function Qt(s, e) {
893
894
  options: t
894
895
  };
895
896
  }
896
- function Rs(s, e) {
897
+ function Vs(s, e) {
897
898
  if (e.tag) {
898
899
  const i = s.filter((r) => r.tag === e.tag);
899
900
  if (i.length > 0)
@@ -912,11 +913,11 @@ function Rs(s, e) {
912
913
  }
913
914
  return t;
914
915
  }
915
- function Vs(s, e, { anchors: t, doc: n }) {
916
+ function Ws(s, e, { anchors: t, doc: n }) {
916
917
  if (!n.directives)
917
918
  return "";
918
- const i = [], r = (A(s) || L(s)) && s.anchor;
919
- r && Vt(r) && (t.add(r), i.push(`&${r}`));
919
+ const i = [], r = (A(s) || T(s)) && s.anchor;
920
+ r && Wt(r) && (t.add(r), i.push(`&${r}`));
920
921
  const o = s.tag ? s.tag : e.default ? null : e.tag;
921
922
  return o && i.push(n.directives.tagString(o)), i.join(" ");
922
923
  }
@@ -931,26 +932,26 @@ function H(s, e, t, n) {
931
932
  e.resolvedAliases ? e.resolvedAliases.add(s) : e.resolvedAliases = /* @__PURE__ */ new Set([s]), s = s.resolve(e.doc);
932
933
  }
933
934
  let i;
934
- const r = T(s) ? s : e.doc.createNode(s, { onTagObj: (a) => i = a });
935
- i || (i = Rs(e.doc.schema.tags, r));
936
- const o = Vs(r, i, e);
935
+ const r = L(s) ? s : e.doc.createNode(s, { onTagObj: (a) => i = a });
936
+ i || (i = Vs(e.doc.schema.tags, r));
937
+ const o = Ws(r, i, e);
937
938
  o.length > 0 && (e.indentAtStart = (e.indentAtStart ?? 0) + o.length + 1);
938
939
  const l = typeof i.stringify == "function" ? i.stringify(r, e, t, n) : A(r) ? Ne(r, e, t, n) : r.toString(e, t, n);
939
940
  return o ? A(r) || l[0] === "{" || l[0] === "[" ? `${o} ${l}` : `${o}
940
941
  ${e.indent}${l}` : l;
941
942
  }
942
- function Ws({ key: s, value: e }, t, n, i) {
943
+ function Js({ key: s, value: e }, t, n, i) {
943
944
  const { allNullValues: r, doc: o, indent: l, indentStep: a, options: { commentString: c, indentSeq: u, simpleKeys: f } } = t;
944
- let h = T(s) && s.comment || null;
945
+ let h = L(s) && s.comment || null;
945
946
  if (f) {
946
947
  if (h)
947
948
  throw new Error("With simple keys, key nodes cannot have comments");
948
- if (L(s)) {
949
+ if (T(s)) {
949
950
  const E = "With simple keys, collection cannot be used as a key value";
950
951
  throw new Error(E);
951
952
  }
952
953
  }
953
- let p = !f && (!s || h && e == null && !t.inFlow || L(s) || (A(s) ? s.type === N.BLOCK_FOLDED || s.type === N.BLOCK_LITERAL : typeof s == "object"));
954
+ let p = !f && (!s || h && e == null && !t.inFlow || T(s) || (A(s) ? s.type === N.BLOCK_FOLDED || s.type === N.BLOCK_LITERAL : typeof s == "object"));
954
955
  t = Object.assign({}, t, {
955
956
  allNullValues: !1,
956
957
  implicitKey: !p && (f || !r),
@@ -970,7 +971,7 @@ function Ws({ key: s, value: e }, t, n, i) {
970
971
  y && (h = null), p ? (h && (m += V(m, t.indent, c(h))), m = `? ${m}
971
972
  ${l}:`) : (m = `${m}:`, h && (m += V(m, t.indent, c(h))));
972
973
  let b, w, k;
973
- T(e) ? (b = !!e.spaceBefore, w = e.commentBefore, k = e.comment) : (b = !1, w = null, k = null, e && typeof e == "object" && (e = o.createNode(e))), t.implicitKey = !1, !p && !h && A(e) && (t.indentAtStart = m.length + 1), d = !1, !u && a.length >= 2 && !t.inFlow && !p && fe(e) && !e.flow && !e.tag && !e.anchor && (t.indent = t.indent.substring(2));
974
+ L(e) ? (b = !!e.spaceBefore, w = e.commentBefore, k = e.comment) : (b = !1, w = null, k = null, e && typeof e == "object" && (e = o.createNode(e))), t.implicitKey = !1, !p && !h && A(e) && (t.indentAtStart = m.length + 1), d = !1, !u && a.length >= 2 && !t.inFlow && !p && fe(e) && !e.flow && !e.tag && !e.anchor && (t.indent = t.indent.substring(2));
974
975
  let S = !1;
975
976
  const O = H(e, t, () => S = !0, () => d = !0);
976
977
  let g = " ";
@@ -986,7 +987,7 @@ ${U(E, t.indent)}`;
986
987
 
987
988
  `) : g += `
988
989
  ${t.indent}`;
989
- } else if (!p && L(e)) {
990
+ } else if (!p && T(e)) {
990
991
  const E = O[0], q = O.indexOf(`
991
992
  `), ee = q !== -1, _ = t.inFlow ?? e.flow ?? e.items.length === 0;
992
993
  if (ee || !_) {
@@ -1003,12 +1004,12 @@ ${t.indent}`);
1003
1004
  `) && (g = "");
1004
1005
  return m += g + O, t.inFlow ? S && n && n() : k && !S ? m += V(m, t.indent, c(k)) : d && i && i(), m;
1005
1006
  }
1006
- function Ht(s, e) {
1007
+ function xt(s, e) {
1007
1008
  (s === "debug" || s === "warn") && (typeof process < "u" && process.emitWarning ? process.emitWarning(e) : console.warn(e));
1008
1009
  }
1009
- const Lt = "<<";
1010
- function xt(s, e, { key: t, value: n }) {
1011
- if (s?.doc.schema.merge && Js(t))
1010
+ const Tt = "<<";
1011
+ function Xt(s, e, { key: t, value: n }) {
1012
+ if (s?.doc.schema.merge && Ys(t))
1012
1013
  if (n = X(n) ? n.resolve(s.doc) : n, fe(n))
1013
1014
  for (const i of n.items)
1014
1015
  ze(s, e, i);
@@ -1024,7 +1025,7 @@ function xt(s, e, { key: t, value: n }) {
1024
1025
  else if (e instanceof Set)
1025
1026
  e.add(i);
1026
1027
  else {
1027
- const r = Ys(t, i, s), o = F(n, r, s);
1028
+ const r = Gs(t, i, s), o = F(n, r, s);
1028
1029
  r in e ? Object.defineProperty(e, r, {
1029
1030
  value: o,
1030
1031
  writable: !0,
@@ -1035,7 +1036,7 @@ function xt(s, e, { key: t, value: n }) {
1035
1036
  }
1036
1037
  return e;
1037
1038
  }
1038
- const Js = (s) => s === Lt || A(s) && s.value === Lt && (!s.type || s.type === N.PLAIN);
1039
+ const Ys = (s) => s === Tt || A(s) && s.value === Tt && (!s.type || s.type === N.PLAIN);
1039
1040
  function ze(s, e, t) {
1040
1041
  const n = s && X(t) ? t.resolve(s.doc) : t;
1041
1042
  if (!z(n))
@@ -1050,13 +1051,13 @@ function ze(s, e, t) {
1050
1051
  });
1051
1052
  return e;
1052
1053
  }
1053
- function Ys(s, e, t) {
1054
+ function Gs(s, e, t) {
1054
1055
  if (e === null)
1055
1056
  return "";
1056
1057
  if (typeof e != "object")
1057
1058
  return String(e);
1058
- if (T(s) && t && t.doc) {
1059
- const n = Qt(t.doc, {});
1059
+ if (L(s) && t && t.doc) {
1060
+ const n = Ht(t.doc, {});
1060
1061
  n.anchors = /* @__PURE__ */ new Set();
1061
1062
  for (const r of t.anchors.keys())
1062
1063
  n.anchors.add(r.anchor);
@@ -1064,7 +1065,7 @@ function Ys(s, e, t) {
1064
1065
  const i = s.toString(n);
1065
1066
  if (!t.mapKeyWarned) {
1066
1067
  let r = JSON.stringify(i);
1067
- r.length > 40 && (r = r.substring(0, 36) + '..."'), Ht(t.doc.options.logLevel, `Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`), t.mapKeyWarned = !0;
1068
+ r.length > 40 && (r = r.substring(0, 36) + '..."'), xt(t.doc.options.logLevel, `Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`), t.mapKeyWarned = !0;
1068
1069
  }
1069
1070
  return i;
1070
1071
  }
@@ -1076,34 +1077,34 @@ function ht(s, e, t) {
1076
1077
  }
1077
1078
  class $ {
1078
1079
  constructor(e, t = null) {
1079
- Object.defineProperty(this, M, { value: Kt }), this.key = e, this.value = t;
1080
+ Object.defineProperty(this, M, { value: Ft }), this.key = e, this.value = t;
1080
1081
  }
1081
1082
  clone(e) {
1082
1083
  let { key: t, value: n } = this;
1083
- return T(t) && (t = t.clone(e)), T(n) && (n = n.clone(e)), new $(t, n);
1084
+ return L(t) && (t = t.clone(e)), L(n) && (n = n.clone(e)), new $(t, n);
1084
1085
  }
1085
1086
  toJSON(e, t) {
1086
1087
  const n = t?.mapAsMap ? /* @__PURE__ */ new Map() : {};
1087
- return xt(t, n, this);
1088
+ return Xt(t, n, this);
1088
1089
  }
1089
1090
  toString(e, t, n) {
1090
- return e?.doc ? Ws(this, e, t, n) : JSON.stringify(this);
1091
+ return e?.doc ? Js(this, e, t, n) : JSON.stringify(this);
1091
1092
  }
1092
1093
  }
1093
- function Xt(s, e, t) {
1094
- return (e.inFlow ?? s.flow ? Qs : Gs)(s, e, t);
1094
+ function zt(s, e, t) {
1095
+ return (e.inFlow ?? s.flow ? Hs : Qs)(s, e, t);
1095
1096
  }
1096
- function Gs({ comment: s, items: e }, t, { blockItemPrefix: n, flowChars: i, itemIndent: r, onChompKeep: o, onComment: l }) {
1097
+ function Qs({ comment: s, items: e }, t, { blockItemPrefix: n, flowChars: i, itemIndent: r, onChompKeep: o, onComment: l }) {
1097
1098
  const { indent: a, options: { commentString: c } } = t, u = Object.assign({}, t, { indent: r, type: null });
1098
1099
  let f = !1;
1099
1100
  const h = [];
1100
1101
  for (let y = 0; y < e.length; ++y) {
1101
1102
  const d = e[y];
1102
1103
  let m = null;
1103
- if (T(d))
1104
+ if (L(d))
1104
1105
  !f && d.spaceBefore && h.push(""), je(t, h, d.commentBefore, f), d.comment && (m = d.comment);
1105
1106
  else if (I(d)) {
1106
- const w = T(d.key) ? d.key : null;
1107
+ const w = L(d.key) ? d.key : null;
1107
1108
  w && (!f && w.spaceBefore && h.push(""), je(t, h, w.commentBefore, f));
1108
1109
  }
1109
1110
  f = !1;
@@ -1125,7 +1126,7 @@ ${a}${d}` : `
1125
1126
  return s ? (p += `
1126
1127
  ` + U(c(s), a), l && l()) : f && o && o(), p;
1127
1128
  }
1128
- function Qs({ comment: s, items: e }, t, { flowChars: n, itemIndent: i, onComment: r }) {
1129
+ function Hs({ comment: s, items: e }, t, { flowChars: n, itemIndent: i, onComment: r }) {
1129
1130
  const { indent: o, indentStep: l, flowCollectionPadding: a, options: { commentString: c } } = t;
1130
1131
  i += l;
1131
1132
  const u = Object.assign({}, t, {
@@ -1138,12 +1139,12 @@ function Qs({ comment: s, items: e }, t, { flowChars: n, itemIndent: i, onCommen
1138
1139
  for (let b = 0; b < e.length; ++b) {
1139
1140
  const w = e[b];
1140
1141
  let k = null;
1141
- if (T(w))
1142
+ if (L(w))
1142
1143
  w.spaceBefore && p.push(""), je(t, p, w.commentBefore, !1), w.comment && (k = w.comment);
1143
1144
  else if (I(w)) {
1144
- const O = T(w.key) ? w.key : null;
1145
+ const O = L(w.key) ? w.key : null;
1145
1146
  O && (O.spaceBefore && p.push(""), je(t, p, O.commentBefore, !1), O.comment && (f = !0));
1146
- const g = T(w.value) ? w.value : null;
1147
+ const g = L(w.value) ? w.value : null;
1147
1148
  g ? (g.comment && (k = g.comment), g.commentBefore && (f = !0)) : w.value == null && O && O.comment && (k = O.comment);
1148
1149
  }
1149
1150
  k && (f = !0);
@@ -1199,7 +1200,7 @@ class j extends Fe {
1199
1200
  if (i) {
1200
1201
  if (!t)
1201
1202
  throw new Error(`Key ${n.key} already set`);
1202
- A(i.value) && Yt(n.value) ? i.value.value = n.value : i.value = n.value;
1203
+ A(i.value) && Gt(n.value) ? i.value.value = n.value : i.value = n.value;
1203
1204
  } else if (r) {
1204
1205
  const o = this.items.findIndex((l) => r(n, l) < 0);
1205
1206
  o === -1 ? this.items.push(n) : this.items.splice(o, 0, n);
@@ -1229,7 +1230,7 @@ class j extends Fe {
1229
1230
  const i = n ? new n() : t?.mapAsMap ? /* @__PURE__ */ new Map() : {};
1230
1231
  t?.onCreate && t.onCreate(i);
1231
1232
  for (const r of this.items)
1232
- xt(t, i, r);
1233
+ Xt(t, i, r);
1233
1234
  return i;
1234
1235
  }
1235
1236
  toString(e, t, n) {
@@ -1238,7 +1239,7 @@ class j extends Fe {
1238
1239
  for (const i of this.items)
1239
1240
  if (!I(i))
1240
1241
  throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);
1241
- return !e.allNullValues && this.hasAllNullValues(!1) && (e = Object.assign({}, e, { allNullValues: !0 })), Xt(this, e, {
1242
+ return !e.allNullValues && this.hasAllNullValues(!1) && (e = Object.assign({}, e, { allNullValues: !0 })), zt(this, e, {
1242
1243
  blockItemPrefix: "",
1243
1244
  flowChars: { start: "{", end: "}" },
1244
1245
  itemIndent: e.indent || "",
@@ -1247,7 +1248,7 @@ class j extends Fe {
1247
1248
  });
1248
1249
  }
1249
1250
  }
1250
- function Hs(s, e, t) {
1251
+ function xs(s, e, t) {
1251
1252
  const { keepUndefined: n, replacer: i } = t, r = new j(s), o = (l, a) => {
1252
1253
  if (typeof i == "function")
1253
1254
  a = i.call(e, l, a);
@@ -1265,7 +1266,7 @@ function Hs(s, e, t) {
1265
1266
  }
1266
1267
  const ue = {
1267
1268
  collection: "map",
1268
- createNode: Hs,
1269
+ createNode: xs,
1269
1270
  default: !0,
1270
1271
  nodeClass: j,
1271
1272
  tag: "tag:yaml.org,2002:map",
@@ -1292,11 +1293,11 @@ class Z extends Fe {
1292
1293
  * @returns `true` if the item was found and removed.
1293
1294
  */
1294
1295
  delete(e) {
1295
- const t = Ie(e);
1296
+ const t = Ee(e);
1296
1297
  return typeof t != "number" ? !1 : this.items.splice(t, 1).length > 0;
1297
1298
  }
1298
1299
  get(e, t) {
1299
- const n = Ie(e);
1300
+ const n = Ee(e);
1300
1301
  if (typeof n != "number")
1301
1302
  return;
1302
1303
  const i = this.items[n];
@@ -1309,7 +1310,7 @@ class Z extends Fe {
1309
1310
  * It may be wrapped in a `Scalar`.
1310
1311
  */
1311
1312
  has(e) {
1312
- const t = Ie(e);
1313
+ const t = Ee(e);
1313
1314
  return typeof t == "number" && t < this.items.length;
1314
1315
  }
1315
1316
  /**
@@ -1320,11 +1321,11 @@ class Z extends Fe {
1320
1321
  * It may be wrapped in a `Scalar`.
1321
1322
  */
1322
1323
  set(e, t) {
1323
- const n = Ie(e);
1324
+ const n = Ee(e);
1324
1325
  if (typeof n != "number")
1325
1326
  throw new Error(`Expected a valid index, not ${e}.`);
1326
1327
  const i = this.items[n];
1327
- A(i) && Yt(t) ? i.value = t : this.items[n] = t;
1328
+ A(i) && Gt(t) ? i.value = t : this.items[n] = t;
1328
1329
  }
1329
1330
  toJSON(e, t) {
1330
1331
  const n = [];
@@ -1335,7 +1336,7 @@ class Z extends Fe {
1335
1336
  return n;
1336
1337
  }
1337
1338
  toString(e, t, n) {
1338
- return e ? Xt(this, e, {
1339
+ return e ? zt(this, e, {
1339
1340
  blockItemPrefix: "- ",
1340
1341
  flowChars: { start: "[", end: "]" },
1341
1342
  itemIndent: (e.indent || "") + " ",
@@ -1344,11 +1345,11 @@ class Z extends Fe {
1344
1345
  }) : JSON.stringify(this);
1345
1346
  }
1346
1347
  }
1347
- function Ie(s) {
1348
+ function Ee(s) {
1348
1349
  let e = A(s) ? s.value : s;
1349
1350
  return e && typeof e == "string" && (e = Number(e)), typeof e == "number" && Number.isInteger(e) && e >= 0 ? e : null;
1350
1351
  }
1351
- function xs(s, e, t) {
1352
+ function Xs(s, e, t) {
1352
1353
  const { replacer: n } = t, i = new Z(s);
1353
1354
  if (e && Symbol.iterator in Object(e)) {
1354
1355
  let r = 0;
@@ -1364,7 +1365,7 @@ function xs(s, e, t) {
1364
1365
  }
1365
1366
  const he = {
1366
1367
  collection: "seq",
1367
- createNode: xs,
1368
+ createNode: Xs,
1368
1369
  default: !0,
1369
1370
  nodeClass: Z,
1370
1371
  tag: "tag:yaml.org,2002:seq",
@@ -1418,14 +1419,14 @@ function D({ format: s, minFractionDigits: e, tag: t, value: n }) {
1418
1419
  }
1419
1420
  return r;
1420
1421
  }
1421
- const zt = {
1422
+ const Zt = {
1422
1423
  identify: (s) => typeof s == "number",
1423
1424
  default: !0,
1424
1425
  tag: "tag:yaml.org,2002:float",
1425
1426
  test: /^(?:[-+]?\.(?:inf|Inf|INF|nan|NaN|NAN))$/,
1426
1427
  resolve: (s) => s.slice(-3).toLowerCase() === "nan" ? NaN : s[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
1427
1428
  stringify: D
1428
- }, Zt = {
1429
+ }, es = {
1429
1430
  identify: (s) => typeof s == "number",
1430
1431
  default: !0,
1431
1432
  tag: "tag:yaml.org,2002:float",
@@ -1436,7 +1437,7 @@ const zt = {
1436
1437
  const e = Number(s.value);
1437
1438
  return isFinite(e) ? e.toExponential() : D(s);
1438
1439
  }
1439
- }, es = {
1440
+ }, ts = {
1440
1441
  identify: (s) => typeof s == "number",
1441
1442
  default: !0,
1442
1443
  tag: "tag:yaml.org,2002:float",
@@ -1447,56 +1448,56 @@ const zt = {
1447
1448
  },
1448
1449
  stringify: D
1449
1450
  }, Je = (s) => typeof s == "bigint" || Number.isInteger(s), pt = (s, e, t, { intAsBigInt: n }) => n ? BigInt(s) : parseInt(s.substring(e), t);
1450
- function ts(s, e, t) {
1451
+ function ss(s, e, t) {
1451
1452
  const { value: n } = s;
1452
1453
  return Je(n) && n >= 0 ? t + n.toString(e) : D(s);
1453
1454
  }
1454
- const ss = {
1455
+ const ns = {
1455
1456
  identify: (s) => Je(s) && s >= 0,
1456
1457
  default: !0,
1457
1458
  tag: "tag:yaml.org,2002:int",
1458
1459
  format: "OCT",
1459
1460
  test: /^0o[0-7]+$/,
1460
1461
  resolve: (s, e, t) => pt(s, 2, 8, t),
1461
- stringify: (s) => ts(s, 8, "0o")
1462
- }, ns = {
1462
+ stringify: (s) => ss(s, 8, "0o")
1463
+ }, is = {
1463
1464
  identify: Je,
1464
1465
  default: !0,
1465
1466
  tag: "tag:yaml.org,2002:int",
1466
1467
  test: /^[-+]?[0-9]+$/,
1467
1468
  resolve: (s, e, t) => pt(s, 0, 10, t),
1468
1469
  stringify: D
1469
- }, is = {
1470
+ }, rs = {
1470
1471
  identify: (s) => Je(s) && s >= 0,
1471
1472
  default: !0,
1472
1473
  tag: "tag:yaml.org,2002:int",
1473
1474
  format: "HEX",
1474
1475
  test: /^0x[0-9a-fA-F]+$/,
1475
1476
  resolve: (s, e, t) => pt(s, 2, 16, t),
1476
- stringify: (s) => ts(s, 16, "0x")
1477
- }, Xs = [
1477
+ stringify: (s) => ss(s, 16, "0x")
1478
+ }, zs = [
1478
1479
  ue,
1479
1480
  he,
1480
1481
  Ve,
1481
1482
  We,
1482
1483
  dt,
1483
- ss,
1484
1484
  ns,
1485
1485
  is,
1486
- zt,
1486
+ rs,
1487
1487
  Zt,
1488
- es
1488
+ es,
1489
+ ts
1489
1490
  ];
1490
- function Tt(s) {
1491
+ function Lt(s) {
1491
1492
  return typeof s == "bigint" || Number.isInteger(s);
1492
1493
  }
1493
- const Le = ({ value: s }) => JSON.stringify(s), zs = [
1494
+ const Ie = ({ value: s }) => JSON.stringify(s), Zs = [
1494
1495
  {
1495
1496
  identify: (s) => typeof s == "string",
1496
1497
  default: !0,
1497
1498
  tag: "tag:yaml.org,2002:str",
1498
1499
  resolve: (s) => s,
1499
- stringify: Le
1500
+ stringify: Ie
1500
1501
  },
1501
1502
  {
1502
1503
  identify: (s) => s == null,
@@ -1505,7 +1506,7 @@ const Le = ({ value: s }) => JSON.stringify(s), zs = [
1505
1506
  tag: "tag:yaml.org,2002:null",
1506
1507
  test: /^null$/,
1507
1508
  resolve: () => null,
1508
- stringify: Le
1509
+ stringify: Ie
1509
1510
  },
1510
1511
  {
1511
1512
  identify: (s) => typeof s == "boolean",
@@ -1513,15 +1514,15 @@ const Le = ({ value: s }) => JSON.stringify(s), zs = [
1513
1514
  tag: "tag:yaml.org,2002:bool",
1514
1515
  test: /^true|false$/,
1515
1516
  resolve: (s) => s === "true",
1516
- stringify: Le
1517
+ stringify: Ie
1517
1518
  },
1518
1519
  {
1519
- identify: Tt,
1520
+ identify: Lt,
1520
1521
  default: !0,
1521
1522
  tag: "tag:yaml.org,2002:int",
1522
1523
  test: /^-?(?:0|[1-9][0-9]*)$/,
1523
1524
  resolve: (s, e, { intAsBigInt: t }) => t ? BigInt(s) : parseInt(s, 10),
1524
- stringify: ({ value: s }) => Tt(s) ? s.toString() : JSON.stringify(s)
1525
+ stringify: ({ value: s }) => Lt(s) ? s.toString() : JSON.stringify(s)
1525
1526
  },
1526
1527
  {
1527
1528
  identify: (s) => typeof s == "number",
@@ -1529,16 +1530,16 @@ const Le = ({ value: s }) => JSON.stringify(s), zs = [
1529
1530
  tag: "tag:yaml.org,2002:float",
1530
1531
  test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,
1531
1532
  resolve: (s) => parseFloat(s),
1532
- stringify: Le
1533
+ stringify: Ie
1533
1534
  }
1534
- ], Zs = {
1535
+ ], en = {
1535
1536
  default: !0,
1536
1537
  tag: "",
1537
1538
  test: /^/,
1538
1539
  resolve(s, e) {
1539
1540
  return e(`Unresolved plain scalar ${JSON.stringify(s)}`), s;
1540
1541
  }
1541
- }, en = [ue, he].concat(zs, Zs), mt = {
1542
+ }, tn = [ue, he].concat(Zs, en), mt = {
1542
1543
  identify: (s) => s instanceof Uint8Array,
1543
1544
  default: !1,
1544
1545
  tag: "tag:yaml.org,2002:binary",
@@ -1583,7 +1584,7 @@ const Le = ({ value: s }) => JSON.stringify(s), zs = [
1583
1584
  return Ne({ comment: s, type: e, value: l }, n, i, r);
1584
1585
  }
1585
1586
  };
1586
- function rs(s, e) {
1587
+ function os(s, e) {
1587
1588
  if (fe(s))
1588
1589
  for (let t = 0; t < s.items.length; ++t) {
1589
1590
  let n = s.items[t];
@@ -1606,7 +1607,7 @@ ${r.comment}` : n.comment;
1606
1607
  e("Expected a sequence for this tag");
1607
1608
  return s;
1608
1609
  }
1609
- function os(s, e, t) {
1610
+ function ls(s, e, t) {
1610
1611
  const { replacer: n } = t, i = new Z(s);
1611
1612
  i.tag = "tag:yaml.org,2002:pairs";
1612
1613
  let r = 0;
@@ -1635,8 +1636,8 @@ const gt = {
1635
1636
  collection: "seq",
1636
1637
  default: !1,
1637
1638
  tag: "tag:yaml.org,2002:pairs",
1638
- resolve: rs,
1639
- createNode: os
1639
+ resolve: os,
1640
+ createNode: ls
1640
1641
  };
1641
1642
  class oe extends Z {
1642
1643
  constructor() {
@@ -1668,41 +1669,41 @@ const yt = {
1668
1669
  default: !1,
1669
1670
  tag: "tag:yaml.org,2002:omap",
1670
1671
  resolve(s, e) {
1671
- const t = rs(s, e), n = [];
1672
+ const t = os(s, e), n = [];
1672
1673
  for (const { key: i } of t.items)
1673
1674
  A(i) && (n.includes(i.value) ? e(`Ordered maps must not include duplicate keys: ${i.value}`) : n.push(i.value));
1674
1675
  return Object.assign(new oe(), t);
1675
1676
  },
1676
1677
  createNode(s, e, t) {
1677
- const n = os(s, e, t), i = new oe();
1678
+ const n = ls(s, e, t), i = new oe();
1678
1679
  return i.items = n.items, i;
1679
1680
  }
1680
1681
  };
1681
- function ls({ value: s, source: e }, t) {
1682
- return e && (s ? as : cs).test.test(e) ? e : s ? t.options.trueStr : t.options.falseStr;
1682
+ function as({ value: s, source: e }, t) {
1683
+ return e && (s ? cs : fs).test.test(e) ? e : s ? t.options.trueStr : t.options.falseStr;
1683
1684
  }
1684
- const as = {
1685
+ const cs = {
1685
1686
  identify: (s) => s === !0,
1686
1687
  default: !0,
1687
1688
  tag: "tag:yaml.org,2002:bool",
1688
1689
  test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,
1689
1690
  resolve: () => new N(!0),
1690
- stringify: ls
1691
- }, cs = {
1691
+ stringify: as
1692
+ }, fs = {
1692
1693
  identify: (s) => s === !1,
1693
1694
  default: !0,
1694
1695
  tag: "tag:yaml.org,2002:bool",
1695
1696
  test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i,
1696
1697
  resolve: () => new N(!1),
1697
- stringify: ls
1698
- }, tn = {
1698
+ stringify: as
1699
+ }, sn = {
1699
1700
  identify: (s) => typeof s == "number",
1700
1701
  default: !0,
1701
1702
  tag: "tag:yaml.org,2002:float",
1702
1703
  test: /^[-+]?\.(?:inf|Inf|INF|nan|NaN|NAN)$/,
1703
1704
  resolve: (s) => s.slice(-3).toLowerCase() === "nan" ? NaN : s[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
1704
1705
  stringify: D
1705
- }, sn = {
1706
+ }, nn = {
1706
1707
  identify: (s) => typeof s == "number",
1707
1708
  default: !0,
1708
1709
  tag: "tag:yaml.org,2002:float",
@@ -1713,7 +1714,7 @@ const as = {
1713
1714
  const e = Number(s.value);
1714
1715
  return isFinite(e) ? e.toExponential() : D(s);
1715
1716
  }
1716
- }, nn = {
1717
+ }, rn = {
1717
1718
  identify: (s) => typeof s == "number",
1718
1719
  default: !0,
1719
1720
  tag: "tag:yaml.org,2002:float",
@@ -1756,7 +1757,7 @@ function bt(s, e, t) {
1756
1757
  }
1757
1758
  return D(s);
1758
1759
  }
1759
- const rn = {
1760
+ const on = {
1760
1761
  identify: Oe,
1761
1762
  default: !0,
1762
1763
  tag: "tag:yaml.org,2002:int",
@@ -1764,7 +1765,7 @@ const rn = {
1764
1765
  test: /^[-+]?0b[0-1_]+$/,
1765
1766
  resolve: (s, e, t) => Ye(s, 2, 2, t),
1766
1767
  stringify: (s) => bt(s, 2, "0b")
1767
- }, on = {
1768
+ }, ln = {
1768
1769
  identify: Oe,
1769
1770
  default: !0,
1770
1771
  tag: "tag:yaml.org,2002:int",
@@ -1772,14 +1773,14 @@ const rn = {
1772
1773
  test: /^[-+]?0[0-7_]+$/,
1773
1774
  resolve: (s, e, t) => Ye(s, 1, 8, t),
1774
1775
  stringify: (s) => bt(s, 8, "0")
1775
- }, ln = {
1776
+ }, an = {
1776
1777
  identify: Oe,
1777
1778
  default: !0,
1778
1779
  tag: "tag:yaml.org,2002:int",
1779
1780
  test: /^[-+]?[0-9][0-9_]*$/,
1780
1781
  resolve: (s, e, t) => Ye(s, 0, 10, t),
1781
1782
  stringify: D
1782
- }, an = {
1783
+ }, cn = {
1783
1784
  identify: Oe,
1784
1785
  default: !0,
1785
1786
  tag: "tag:yaml.org,2002:int",
@@ -1849,7 +1850,7 @@ function St(s, e) {
1849
1850
  const t = s[0], n = t === "-" || t === "+" ? s.substring(1) : s, i = (o) => e ? BigInt(o) : Number(o), r = n.replace(/_/g, "").split(":").reduce((o, l) => o * i(60) + i(l), i(0));
1850
1851
  return t === "-" ? i(-1) * r : r;
1851
1852
  }
1852
- function fs(s) {
1853
+ function us(s) {
1853
1854
  let { value: e } = s, t = (o) => o;
1854
1855
  if (typeof e == "bigint")
1855
1856
  t = (o) => BigInt(o);
@@ -1860,22 +1861,22 @@ function fs(s) {
1860
1861
  const i = t(60), r = [e % i];
1861
1862
  return e < 60 ? r.unshift(0) : (e = (e - r[0]) / i, r.unshift(e % i), e >= 60 && (e = (e - r[0]) / i, r.unshift(e))), n + r.map((o) => o < 10 ? "0" + String(o) : String(o)).join(":").replace(/000000\d*$/, "");
1862
1863
  }
1863
- const us = {
1864
+ const hs = {
1864
1865
  identify: (s) => typeof s == "bigint" || Number.isInteger(s),
1865
1866
  default: !0,
1866
1867
  tag: "tag:yaml.org,2002:int",
1867
1868
  format: "TIME",
1868
1869
  test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,
1869
1870
  resolve: (s, e, { intAsBigInt: t }) => St(s, t),
1870
- stringify: fs
1871
- }, hs = {
1871
+ stringify: us
1872
+ }, ds = {
1872
1873
  identify: (s) => typeof s == "number",
1873
1874
  default: !0,
1874
1875
  tag: "tag:yaml.org,2002:float",
1875
1876
  format: "TIME",
1876
1877
  test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,
1877
1878
  resolve: (s) => St(s, !1),
1878
- stringify: fs
1879
+ stringify: us
1879
1880
  }, Ge = {
1880
1881
  identify: (s) => s instanceof Date,
1881
1882
  default: !0,
@@ -1903,39 +1904,39 @@ const us = {
1903
1904
  he,
1904
1905
  Ve,
1905
1906
  We,
1906
- as,
1907
1907
  cs,
1908
- rn,
1908
+ fs,
1909
1909
  on,
1910
1910
  ln,
1911
1911
  an,
1912
- tn,
1912
+ cn,
1913
1913
  sn,
1914
1914
  nn,
1915
+ rn,
1915
1916
  mt,
1916
1917
  yt,
1917
1918
  gt,
1918
1919
  wt,
1919
- us,
1920
1920
  hs,
1921
+ ds,
1921
1922
  Ge
1922
1923
  ], Ct = /* @__PURE__ */ new Map([
1923
- ["core", Xs],
1924
+ ["core", zs],
1924
1925
  ["failsafe", [ue, he, Ve]],
1925
- ["json", en],
1926
+ ["json", tn],
1926
1927
  ["yaml11", $t],
1927
1928
  ["yaml-1.1", $t]
1928
1929
  ]), vt = {
1929
1930
  binary: mt,
1930
1931
  bool: dt,
1931
- float: es,
1932
- floatExp: Zt,
1933
- floatNaN: zt,
1934
- floatTime: hs,
1935
- int: ns,
1936
- intHex: is,
1937
- intOct: ss,
1938
- intTime: us,
1932
+ float: ts,
1933
+ floatExp: es,
1934
+ floatNaN: Zt,
1935
+ floatTime: ds,
1936
+ int: is,
1937
+ intHex: rs,
1938
+ intOct: ns,
1939
+ intTime: hs,
1939
1940
  map: ue,
1940
1941
  null: We,
1941
1942
  omap: yt,
@@ -1943,7 +1944,7 @@ const us = {
1943
1944
  seq: he,
1944
1945
  set: wt,
1945
1946
  timestamp: Ge
1946
- }, cn = {
1947
+ }, fn = {
1947
1948
  "tag:yaml.org,2002:binary": mt,
1948
1949
  "tag:yaml.org,2002:omap": yt,
1949
1950
  "tag:yaml.org,2002:pairs": gt,
@@ -1974,17 +1975,17 @@ function Ze(s, e) {
1974
1975
  throw new Error(`Unknown custom tag "${n}"; use one of ${r}`);
1975
1976
  });
1976
1977
  }
1977
- const fn = (s, e) => s.key < e.key ? -1 : s.key > e.key ? 1 : 0;
1978
+ const un = (s, e) => s.key < e.key ? -1 : s.key > e.key ? 1 : 0;
1978
1979
  class Qe {
1979
1980
  constructor({ compat: e, customTags: t, merge: n, resolveKnownTags: i, schema: r, sortMapEntries: o, toStringDefaults: l }) {
1980
- this.compat = Array.isArray(e) ? Ze(e, "compat") : e ? Ze(null, e) : null, this.merge = !!n, this.name = typeof r == "string" && r || "core", this.knownTags = i ? cn : {}, this.tags = Ze(t, this.name), this.toStringOptions = l ?? null, Object.defineProperty(this, W, { value: ue }), Object.defineProperty(this, R, { value: Ve }), Object.defineProperty(this, ce, { value: he }), this.sortMapEntries = typeof o == "function" ? o : o === !0 ? fn : null;
1981
+ this.compat = Array.isArray(e) ? Ze(e, "compat") : e ? Ze(null, e) : null, this.merge = !!n, this.name = typeof r == "string" && r || "core", this.knownTags = i ? fn : {}, this.tags = Ze(t, this.name), this.toStringOptions = l ?? null, Object.defineProperty(this, W, { value: ue }), Object.defineProperty(this, R, { value: Ve }), Object.defineProperty(this, ce, { value: he }), this.sortMapEntries = typeof o == "function" ? o : o === !0 ? un : null;
1981
1982
  }
1982
1983
  clone() {
1983
1984
  const e = Object.create(Qe.prototype, Object.getOwnPropertyDescriptors(this));
1984
1985
  return e.tags = this.tags.slice(), e;
1985
1986
  }
1986
1987
  }
1987
- function un(s, e) {
1988
+ function hn(s, e) {
1988
1989
  const t = [];
1989
1990
  let n = e.directives === !0;
1990
1991
  if (e.directives !== !1 && s.directives) {
@@ -1992,7 +1993,7 @@ function un(s, e) {
1992
1993
  a ? (t.push(a), n = !0) : s.directives.docStart && (n = !0);
1993
1994
  }
1994
1995
  n && t.push("---");
1995
- const i = Qt(s, e), { commentString: r } = i.options;
1996
+ const i = Ht(s, e), { commentString: r } = i.options;
1996
1997
  if (s.commentBefore) {
1997
1998
  t.length !== 1 && t.unshift("");
1998
1999
  const a = r(s.commentBefore);
@@ -2000,7 +2001,7 @@ function un(s, e) {
2000
2001
  }
2001
2002
  let o = !1, l = null;
2002
2003
  if (s.contents) {
2003
- if (T(s.contents)) {
2004
+ if (L(s.contents)) {
2004
2005
  if (s.contents.spaceBefore && n && t.push(""), s.contents.commentBefore) {
2005
2006
  const u = r(s.contents.commentBefore);
2006
2007
  t.push(U(u, ""));
@@ -2078,7 +2079,7 @@ class de {
2078
2079
  const e = Object.create(de.prototype, {
2079
2080
  [M]: { value: rt }
2080
2081
  });
2081
- return e.commentBefore = this.commentBefore, e.comment = this.comment, e.errors = this.errors.slice(), e.warnings = this.warnings.slice(), e.options = Object.assign({}, this.options), this.directives && (e.directives = this.directives.clone()), e.schema = this.schema.clone(), e.contents = T(this.contents) ? this.contents.clone(e.schema) : this.contents, this.range && (e.range = this.range.slice()), e;
2082
+ return e.commentBefore = this.commentBefore, e.comment = this.comment, e.errors = this.errors.slice(), e.warnings = this.warnings.slice(), e.options = Object.assign({}, this.options), this.directives && (e.directives = this.directives.clone()), e.schema = this.schema.clone(), e.contents = L(this.contents) ? this.contents.clone(e.schema) : this.contents, this.range && (e.range = this.range.slice()), e;
2082
2083
  }
2083
2084
  /** Adds a value to the document. */
2084
2085
  add(e) {
@@ -2099,9 +2100,9 @@ class de {
2099
2100
  */
2100
2101
  createAlias(e, t) {
2101
2102
  if (!e.anchor) {
2102
- const n = Wt(this);
2103
+ const n = Jt(this);
2103
2104
  e.anchor = // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
2104
- !t || n.has(t) ? Jt(t || "a", n) : t;
2105
+ !t || n.has(t) ? Yt(t || "a", n) : t;
2105
2106
  }
2106
2107
  return new Ke(e.anchor);
2107
2108
  }
@@ -2114,7 +2115,7 @@ class de {
2114
2115
  b.length > 0 && (t = t.concat(b)), i = t;
2115
2116
  } else
2116
2117
  n === void 0 && t && (n = t, t = void 0);
2117
- const { aliasDuplicateObjects: r, anchorPrefix: o, flow: l, keepUndefined: a, onTagObj: c, tag: u } = n ?? {}, { onAnchor: f, setAnchors: h, sourceObjects: p } = Ps(
2118
+ const { aliasDuplicateObjects: r, anchorPrefix: o, flow: l, keepUndefined: a, onTagObj: c, tag: u } = n ?? {}, { onAnchor: f, setAnchors: h, sourceObjects: p } = Ds(
2118
2119
  this,
2119
2120
  // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
2120
2121
  o || "a"
@@ -2127,7 +2128,7 @@ class de {
2127
2128
  schema: this.schema,
2128
2129
  sourceObjects: p
2129
2130
  }, d = be(e, u, y);
2130
- return l && L(d) && (d.flow = !0), h(), d;
2131
+ return l && T(d) && (d.flow = !0), h(), d;
2131
2132
  }
2132
2133
  /**
2133
2134
  * Convert a key and a value into a `Pair` using the current schema,
@@ -2157,7 +2158,7 @@ class de {
2157
2158
  * `true` (collections are always returned intact).
2158
2159
  */
2159
2160
  get(e, t) {
2160
- return L(this.contents) ? this.contents.get(e, t) : void 0;
2161
+ return T(this.contents) ? this.contents.get(e, t) : void 0;
2161
2162
  }
2162
2163
  /**
2163
2164
  * Returns item at `path`, or `undefined` if not found. By default unwraps
@@ -2165,19 +2166,19 @@ class de {
2165
2166
  * `true` (collections are always returned intact).
2166
2167
  */
2167
2168
  getIn(e, t) {
2168
- return me(e) ? !t && A(this.contents) ? this.contents.value : this.contents : L(this.contents) ? this.contents.getIn(e, t) : void 0;
2169
+ return me(e) ? !t && A(this.contents) ? this.contents.value : this.contents : T(this.contents) ? this.contents.getIn(e, t) : void 0;
2169
2170
  }
2170
2171
  /**
2171
2172
  * Checks if the document includes a value with the key `key`.
2172
2173
  */
2173
2174
  has(e) {
2174
- return L(this.contents) ? this.contents.has(e) : !1;
2175
+ return T(this.contents) ? this.contents.has(e) : !1;
2175
2176
  }
2176
2177
  /**
2177
2178
  * Checks if the document includes a value at `path`.
2178
2179
  */
2179
2180
  hasIn(e) {
2180
- return me(e) ? this.contents !== void 0 : L(this.contents) ? this.contents.hasIn(e) : !1;
2181
+ return me(e) ? this.contents !== void 0 : T(this.contents) ? this.contents.hasIn(e) : !1;
2181
2182
  }
2182
2183
  /**
2183
2184
  * Sets a value in this document. For `!!set`, `value` needs to be a
@@ -2259,11 +2260,11 @@ class de {
2259
2260
  const t = JSON.stringify(e.indent);
2260
2261
  throw new Error(`"indent" option must be a positive integer, not ${t}`);
2261
2262
  }
2262
- return un(this, e);
2263
+ return hn(this, e);
2263
2264
  }
2264
2265
  }
2265
2266
  function te(s) {
2266
- if (L(s))
2267
+ if (T(s))
2267
2268
  return !0;
2268
2269
  throw new Error("Expected a YAML collection as document contents");
2269
2270
  }
@@ -2277,7 +2278,7 @@ class Q extends kt {
2277
2278
  super("YAMLParseError", e, t, n);
2278
2279
  }
2279
2280
  }
2280
- class ds extends kt {
2281
+ class ps extends kt {
2281
2282
  constructor(e, t, n) {
2282
2283
  super("YAMLWarning", e, t, n);
2283
2284
  }
@@ -2399,7 +2400,7 @@ function at(s, e, t) {
2399
2400
  n.indent === s && (n.source === "]" || n.source === "}") && we(e) && t(n, "BAD_INDENT", "Flow end indicator should be more indented than parent", !0);
2400
2401
  }
2401
2402
  }
2402
- function ps(s, e, t) {
2403
+ function ms(s, e, t) {
2403
2404
  const { uniqueKeys: n } = s.options;
2404
2405
  if (n === !1)
2405
2406
  return !1;
@@ -2407,7 +2408,7 @@ function ps(s, e, t) {
2407
2408
  return e.some((r) => i(r.key, t));
2408
2409
  }
2409
2410
  const _t = "All mapping items must start at the same column";
2410
- function hn({ composeNode: s, composeEmptyNode: e }, t, n, i) {
2411
+ function dn({ composeNode: s, composeEmptyNode: e }, t, n, i) {
2411
2412
  const r = new j(t.schema);
2412
2413
  t.atRoot && (t.atRoot = !1);
2413
2414
  let o = n.offset, l = null;
@@ -2429,7 +2430,7 @@ function hn({ composeNode: s, composeEmptyNode: e }, t, n, i) {
2429
2430
  } else
2430
2431
  p.found?.indent !== n.indent && i(o, "BAD_INDENT", _t);
2431
2432
  const d = p.end, m = u ? s(t, u, p, i) : e(t, d, c, null, p, i);
2432
- t.schema.compat && at(n.indent, u, i), ps(t, r.items, m) && i(d, "DUPLICATE_KEY", "Map keys must be unique");
2433
+ t.schema.compat && at(n.indent, u, i), ms(t, r.items, m) && i(d, "DUPLICATE_KEY", "Map keys must be unique");
2433
2434
  const b = ae(f ?? [], {
2434
2435
  indicator: "map-value-ind",
2435
2436
  next: h,
@@ -2452,7 +2453,7 @@ function hn({ composeNode: s, composeEmptyNode: e }, t, n, i) {
2452
2453
  }
2453
2454
  return l && l < o && i(l, "IMPOSSIBLE", "Map comment with trailing content"), r.range = [n.offset, o, l ?? o], r;
2454
2455
  }
2455
- function dn({ composeNode: s, composeEmptyNode: e }, t, n, i) {
2456
+ function pn({ composeNode: s, composeEmptyNode: e }, t, n, i) {
2456
2457
  const r = new Z(t.schema);
2457
2458
  t.atRoot && (t.atRoot = !1);
2458
2459
  let o = n.offset, l = null;
@@ -2504,7 +2505,7 @@ function Ae(s, e, t, n) {
2504
2505
  return { comment: i, offset: e };
2505
2506
  }
2506
2507
  const et = "Block collections are not allowed within flow collections", tt = (s) => s && (s.type === "block-map" || s.type === "block-seq");
2507
- function pn({ composeNode: s, composeEmptyNode: e }, t, n, i) {
2508
+ function mn({ composeNode: s, composeEmptyNode: e }, t, n, i) {
2508
2509
  const r = n.start.source === "{", o = r ? "flow map" : "flow sequence", l = r ? new j(t.schema) : new Z(t.schema);
2509
2510
  l.flow = !0;
2510
2511
  const a = t.atRoot;
@@ -2589,7 +2590,7 @@ function pn({ composeNode: s, composeEmptyNode: e }, t, n, i) {
2589
2590
  const ee = new $(g, q);
2590
2591
  if (t.options.keepSourceTokens && (ee.srcToken = d), r) {
2591
2592
  const _ = l;
2592
- ps(t, _.items, g) && i(O, "DUPLICATE_KEY", "Map keys must be unique"), _.items.push(ee);
2593
+ ms(t, _.items, g) && i(O, "DUPLICATE_KEY", "Map keys must be unique"), _.items.push(ee);
2593
2594
  } else {
2594
2595
  const _ = new j(t.schema);
2595
2596
  _.flow = !0, _.items.push(ee), l.items.push(_);
@@ -2613,19 +2614,19 @@ function pn({ composeNode: s, composeEmptyNode: e }, t, n, i) {
2613
2614
  l.range = [n.offset, p, p];
2614
2615
  return l;
2615
2616
  }
2616
- function mn(s, e, t, n, i) {
2617
+ function gn(s, e, t, n, i) {
2617
2618
  let r;
2618
2619
  switch (t.type) {
2619
2620
  case "block-map": {
2620
- r = hn(s, e, t, i);
2621
+ r = dn(s, e, t, i);
2621
2622
  break;
2622
2623
  }
2623
2624
  case "block-seq": {
2624
- r = dn(s, e, t, i);
2625
+ r = pn(s, e, t, i);
2625
2626
  break;
2626
2627
  }
2627
2628
  case "flow-collection": {
2628
- r = pn(s, e, t, i);
2629
+ r = mn(s, e, t, i);
2629
2630
  break;
2630
2631
  }
2631
2632
  }
@@ -2646,14 +2647,14 @@ function mn(s, e, t, n, i) {
2646
2647
  else
2647
2648
  return i(n, "TAG_RESOLVE_FAILED", `Unresolved tag: ${o}`, !0), r.tag = o, r;
2648
2649
  }
2649
- const u = c.resolve(r, (h) => i(n, "TAG_RESOLVE_FAILED", h), e.options), f = T(u) ? u : new N(u);
2650
+ const u = c.resolve(r, (h) => i(n, "TAG_RESOLVE_FAILED", h), e.options), f = L(u) ? u : new N(u);
2650
2651
  return f.range = r.range, f.tag = o, c?.format && (f.format = c.format), f;
2651
2652
  }
2652
- function ms(s, e, t) {
2653
- const n = s.offset, i = gn(s, e, t);
2653
+ function gs(s, e, t) {
2654
+ const n = s.offset, i = yn(s, e, t);
2654
2655
  if (!i)
2655
2656
  return { value: "", type: null, comment: "", range: [n, n, n] };
2656
- const r = i.mode === ">" ? N.BLOCK_FOLDED : N.BLOCK_LITERAL, o = s.source ? yn(s.source) : [];
2657
+ const r = i.mode === ">" ? N.BLOCK_FOLDED : N.BLOCK_LITERAL, o = s.source ? bn(s.source) : [];
2657
2658
  let l = o.length;
2658
2659
  for (let d = o.length - 1; d >= 0; --d) {
2659
2660
  const m = o[d][1];
@@ -2726,7 +2727,7 @@ function ms(s, e, t) {
2726
2727
  const y = n + i.length + s.source.length;
2727
2728
  return { value: f, type: r, comment: i.comment, range: [n, y, y] };
2728
2729
  }
2729
- function gn({ offset: s, props: e }, t, n) {
2730
+ function yn({ offset: s, props: e }, t, n) {
2730
2731
  if (e[0].type !== "block-scalar-header")
2731
2732
  return n(e[0], "IMPOSSIBLE", "Block scalar header not found"), null;
2732
2733
  const { source: i } = e[0], r = i[0];
@@ -2766,25 +2767,25 @@ function gn({ offset: s, props: e }, t, n) {
2766
2767
  }
2767
2768
  return { mode: r, indent: o, chomp: l, comment: u, length: f };
2768
2769
  }
2769
- function yn(s) {
2770
+ function bn(s) {
2770
2771
  const e = s.split(/\n( *)/), t = e[0], n = t.match(/^( *)/), r = [n?.[1] ? [n[1], t.slice(n[1].length)] : ["", t]];
2771
2772
  for (let o = 1; o < e.length; o += 2)
2772
2773
  r.push([e[o], e[o + 1]]);
2773
2774
  return r;
2774
2775
  }
2775
- function gs(s, e, t) {
2776
+ function ys(s, e, t) {
2776
2777
  const { offset: n, type: i, source: r, end: o } = s;
2777
2778
  let l, a;
2778
2779
  const c = (h, p, y) => t(n + h, p, y);
2779
2780
  switch (i) {
2780
2781
  case "scalar":
2781
- l = N.PLAIN, a = bn(r, c);
2782
+ l = N.PLAIN, a = wn(r, c);
2782
2783
  break;
2783
2784
  case "single-quoted-scalar":
2784
- l = N.QUOTE_SINGLE, a = wn(r, c);
2785
+ l = N.QUOTE_SINGLE, a = Sn(r, c);
2785
2786
  break;
2786
2787
  case "double-quoted-scalar":
2787
- l = N.QUOTE_DOUBLE, a = Sn(r, c);
2788
+ l = N.QUOTE_DOUBLE, a = kn(r, c);
2788
2789
  break;
2789
2790
  default:
2790
2791
  return t(s, "UNEXPECTED_TOKEN", `Expected a flow scalar value, but found: ${i}`), {
@@ -2802,7 +2803,7 @@ function gs(s, e, t) {
2802
2803
  range: [n, u, f.offset]
2803
2804
  };
2804
2805
  }
2805
- function bn(s, e) {
2806
+ function wn(s, e) {
2806
2807
  let t = "";
2807
2808
  switch (s[0]) {
2808
2809
  case " ":
@@ -2825,12 +2826,12 @@ function bn(s, e) {
2825
2826
  break;
2826
2827
  }
2827
2828
  }
2828
- return t && e(0, "BAD_SCALAR_START", `Plain value cannot start with ${t}`), ys(s);
2829
+ return t && e(0, "BAD_SCALAR_START", `Plain value cannot start with ${t}`), bs(s);
2829
2830
  }
2830
- function wn(s, e) {
2831
- return (s[s.length - 1] !== "'" || s.length === 1) && e(s.length, "MISSING_CHAR", "Missing closing 'quote"), ys(s.slice(1, -1)).replace(/''/g, "'");
2831
+ function Sn(s, e) {
2832
+ return (s[s.length - 1] !== "'" || s.length === 1) && e(s.length, "MISSING_CHAR", "Missing closing 'quote"), bs(s.slice(1, -1)).replace(/''/g, "'");
2832
2833
  }
2833
- function ys(s) {
2834
+ function bs(s) {
2834
2835
  let e, t;
2835
2836
  try {
2836
2837
  e = new RegExp(`(.*?)(?<![ ])[ ]*\r?
@@ -2850,7 +2851,7 @@ function ys(s) {
2850
2851
  const l = /[ \t]*(.*)/sy;
2851
2852
  return l.lastIndex = o, n = l.exec(s), i + r + (n?.[1] ?? "");
2852
2853
  }
2853
- function Sn(s, e) {
2854
+ function kn(s, e) {
2854
2855
  let t = "";
2855
2856
  for (let n = 1; n < s.length - 1; ++n) {
2856
2857
  const i = s[n];
@@ -2858,11 +2859,11 @@ function Sn(s, e) {
2858
2859
  `))
2859
2860
  if (i === `
2860
2861
  `) {
2861
- const { fold: r, offset: o } = kn(s, n);
2862
+ const { fold: r, offset: o } = Nn(s, n);
2862
2863
  t += r, n = o;
2863
2864
  } else if (i === "\\") {
2864
2865
  let r = s[++n];
2865
- const o = Nn[r];
2866
+ const o = On[r];
2866
2867
  if (o)
2867
2868
  t += o;
2868
2869
  else if (r === `
@@ -2875,7 +2876,7 @@ function Sn(s, e) {
2875
2876
  r = s[++n + 1];
2876
2877
  else if (r === "x" || r === "u" || r === "U") {
2877
2878
  const l = { x: 2, u: 4, U: 8 }[r];
2878
- t += On(s, n + 1, l, e), n += l;
2879
+ t += An(s, n + 1, l, e), n += l;
2879
2880
  } else {
2880
2881
  const l = s.substr(n - 1, 2);
2881
2882
  e(n - 1, "BAD_DQ_ESCAPE", `Invalid escape sequence ${l}`), t += l;
@@ -2893,7 +2894,7 @@ function Sn(s, e) {
2893
2894
  }
2894
2895
  return (s[s.length - 1] !== '"' || s.length === 1) && e(s.length, "MISSING_CHAR", 'Missing closing "quote'), t;
2895
2896
  }
2896
- function kn(s, e) {
2897
+ function Nn(s, e) {
2897
2898
  let t = "", n = s[e + 1];
2898
2899
  for (; (n === " " || n === " " || n === `
2899
2900
  ` || n === "\r") && !(n === "\r" && s[e + 2] !== `
@@ -2903,7 +2904,7 @@ function kn(s, e) {
2903
2904
  `), e += 1, n = s[e + 1];
2904
2905
  return t || (t = " "), { fold: t, offset: e };
2905
2906
  }
2906
- const Nn = {
2907
+ const On = {
2907
2908
  0: "\0",
2908
2909
  a: "\x07",
2909
2910
  b: "\b",
@@ -2924,7 +2925,7 @@ const Nn = {
2924
2925
  "\\": "\\",
2925
2926
  " ": " "
2926
2927
  };
2927
- function On(s, e, t, n) {
2928
+ function An(s, e, t, n) {
2928
2929
  const i = s.substr(e, t), o = i.length === t && /^[0-9a-fA-F]+$/.test(i) ? parseInt(i, 16) : NaN;
2929
2930
  if (isNaN(o)) {
2930
2931
  const l = s.substr(e - 2, t + 2);
@@ -2932,8 +2933,8 @@ function On(s, e, t, n) {
2932
2933
  }
2933
2934
  return String.fromCodePoint(o);
2934
2935
  }
2935
- function bs(s, e, t, n) {
2936
- const { value: i, type: r, comment: o, range: l } = e.type === "block-scalar" ? ms(e, s.options.strict, n) : gs(e, s.options.strict, n), a = t ? s.directives.tagName(t.source, (f) => n(t, "TAG_RESOLVE_FAILED", f)) : null, c = t && a ? An(s.schema, i, a, t, n) : e.type === "scalar" ? En(s, i, e, n) : s.schema[R];
2936
+ function ws(s, e, t, n) {
2937
+ const { value: i, type: r, comment: o, range: l } = e.type === "block-scalar" ? gs(e, s.options.strict, n) : ys(e, s.options.strict, n), a = t ? s.directives.tagName(t.source, (f) => n(t, "TAG_RESOLVE_FAILED", f)) : null, c = t && a ? En(s.schema, i, a, t, n) : e.type === "scalar" ? In(s, i, e, n) : s.schema[R];
2937
2938
  let u;
2938
2939
  try {
2939
2940
  const f = c.resolve(i, (h) => n(t ?? e, "TAG_RESOLVE_FAILED", h), s.options);
@@ -2944,7 +2945,7 @@ function bs(s, e, t, n) {
2944
2945
  }
2945
2946
  return u.range = l, u.source = i, r && (u.type = r), a && (u.tag = a), c.format && (u.format = c.format), o && (u.comment = o), u;
2946
2947
  }
2947
- function An(s, e, t, n, i) {
2948
+ function En(s, e, t, n, i) {
2948
2949
  if (t === "!")
2949
2950
  return s[R];
2950
2951
  const r = [];
@@ -2960,7 +2961,7 @@ function An(s, e, t, n, i) {
2960
2961
  const o = s.knownTags[t];
2961
2962
  return o && !o.collection ? (s.tags.push(Object.assign({}, o, { default: !1, test: void 0 })), o) : (i(n, "TAG_RESOLVE_FAILED", `Unresolved tag: ${t}`, t !== "tag:yaml.org,2002:str"), s[R]);
2962
2963
  }
2963
- function En({ directives: s, schema: e }, t, n, i) {
2964
+ function In({ directives: s, schema: e }, t, n, i) {
2964
2965
  const r = e.tags.find((o) => o.default && o.test?.test(t)) || e[R];
2965
2966
  if (e.compat) {
2966
2967
  const o = e.compat.find((l) => l.default && l.test?.test(t)) ?? e[R];
@@ -2971,7 +2972,7 @@ function En({ directives: s, schema: e }, t, n, i) {
2971
2972
  }
2972
2973
  return r;
2973
2974
  }
2974
- function In(s, e, t) {
2975
+ function Tn(s, e, t) {
2975
2976
  if (e) {
2976
2977
  t === null && (t = e.length);
2977
2978
  for (let n = t - 1; n >= 0; --n) {
@@ -2990,24 +2991,24 @@ function In(s, e, t) {
2990
2991
  }
2991
2992
  return s;
2992
2993
  }
2993
- const Ln = { composeNode: ws, composeEmptyNode: Nt };
2994
- function ws(s, e, t, n) {
2994
+ const Ln = { composeNode: Ss, composeEmptyNode: Nt };
2995
+ function Ss(s, e, t, n) {
2995
2996
  const { spaceBefore: i, comment: r, anchor: o, tag: l } = t;
2996
2997
  let a, c = !0;
2997
2998
  switch (e.type) {
2998
2999
  case "alias":
2999
- a = Tn(s, e, n), (o || l) && n(e, "ALIAS_PROPS", "An alias node must not specify any properties");
3000
+ a = $n(s, e, n), (o || l) && n(e, "ALIAS_PROPS", "An alias node must not specify any properties");
3000
3001
  break;
3001
3002
  case "scalar":
3002
3003
  case "single-quoted-scalar":
3003
3004
  case "double-quoted-scalar":
3004
3005
  case "block-scalar":
3005
- a = bs(s, e, l, n), o && (a.anchor = o.source.substring(1));
3006
+ a = ws(s, e, l, n), o && (a.anchor = o.source.substring(1));
3006
3007
  break;
3007
3008
  case "block-map":
3008
3009
  case "block-seq":
3009
3010
  case "flow-collection":
3010
- a = mn(Ln, s, e, l, n), o && (a.anchor = o.source.substring(1));
3011
+ a = gn(Ln, s, e, l, n), o && (a.anchor = o.source.substring(1));
3011
3012
  break;
3012
3013
  default: {
3013
3014
  const u = e.type === "error" ? e.message : `Unsupported token (type: ${e.type})`;
@@ -3019,19 +3020,19 @@ function ws(s, e, t, n) {
3019
3020
  function Nt(s, e, t, n, { spaceBefore: i, comment: r, anchor: o, tag: l, end: a }, c) {
3020
3021
  const u = {
3021
3022
  type: "scalar",
3022
- offset: In(e, t, n),
3023
+ offset: Tn(e, t, n),
3023
3024
  indent: -1,
3024
3025
  source: ""
3025
- }, f = bs(s, u, l, c);
3026
+ }, f = ws(s, u, l, c);
3026
3027
  return o && (f.anchor = o.source.substring(1), f.anchor === "" && c(o, "BAD_ALIAS", "Anchor cannot be an empty string")), i && (f.spaceBefore = !0), r && (f.comment = r, f.range[2] = a), f;
3027
3028
  }
3028
- function Tn({ options: s }, { offset: e, source: t, end: n }, i) {
3029
+ function $n({ options: s }, { offset: e, source: t, end: n }, i) {
3029
3030
  const r = new Ke(t.substring(1));
3030
3031
  r.source === "" && i(e, "BAD_ALIAS", "Alias cannot be an empty string"), r.source.endsWith(":") && i(e + t.length - 1, "BAD_ALIAS", "Alias ending in : is ambiguous", !0);
3031
3032
  const o = e + t.length, l = Ae(n, o, s.strict, i);
3032
3033
  return r.range = [e, o, l.offset], l.comment && (r.comment = l.comment), r;
3033
3034
  }
3034
- function $n(s, e, { offset: t, start: n, value: i, end: r }, o) {
3035
+ function Cn(s, e, { offset: t, start: n, value: i, end: r }, o) {
3035
3036
  const l = Object.assign({ _directives: e }, s), a = new de(void 0, l), c = {
3036
3037
  atRoot: !0,
3037
3038
  directives: a.directives,
@@ -3044,7 +3045,7 @@ function $n(s, e, { offset: t, start: n, value: i, end: r }, o) {
3044
3045
  onError: o,
3045
3046
  startOnNewline: !0
3046
3047
  });
3047
- u.found && (a.directives.docStart = !0, i && (i.type === "block-map" || i.type === "block-seq") && !u.hasNewline && o(u.end, "MISSING_CHAR", "Block collection cannot start on same line with directives-end marker")), a.contents = i ? ws(c, i, u, o) : Nt(c, u.end, n, null, u, o);
3048
+ u.found && (a.directives.docStart = !0, i && (i.type === "block-map" || i.type === "block-seq") && !u.hasNewline && o(u.end, "MISSING_CHAR", "Block collection cannot start on same line with directives-end marker")), a.contents = i ? Ss(c, i, u, o) : Nt(c, u.end, n, null, u, o);
3048
3049
  const f = a.contents.range[2], h = Ae(r, f, !1, o);
3049
3050
  return h.comment && (a.comment = h.comment), a.range = [t, f, h.offset], a;
3050
3051
  }
@@ -3080,7 +3081,7 @@ class Ot {
3080
3081
  constructor(e = {}) {
3081
3082
  this.doc = null, this.atDirectives = !1, this.prelude = [], this.errors = [], this.warnings = [], this.onError = (t, n, i, r) => {
3082
3083
  const o = pe(t);
3083
- r ? this.warnings.push(new ds(o, n, i)) : this.errors.push(new Q(o, n, i));
3084
+ r ? this.warnings.push(new ps(o, n, i)) : this.errors.push(new Q(o, n, i));
3084
3085
  }, this.directives = new C({ version: e.version || "1.2" }), this.options = e;
3085
3086
  }
3086
3087
  decorate(e, t) {
@@ -3092,7 +3093,7 @@ class Ot {
3092
3093
  ${n}` : n;
3093
3094
  else if (i || e.directives.docStart || !r)
3094
3095
  e.commentBefore = n;
3095
- else if (L(r) && !r.flow && r.items.length > 0) {
3096
+ else if (T(r) && !r.flow && r.items.length > 0) {
3096
3097
  let o = r.items[0];
3097
3098
  I(o) && (o = o.key);
3098
3099
  const l = o.commentBefore;
@@ -3140,7 +3141,7 @@ ${o}` : n;
3140
3141
  }), this.prelude.push(e.source), this.atDirectives = !0;
3141
3142
  break;
3142
3143
  case "document": {
3143
- const t = $n(this.options, this.directives, e, this.onError);
3144
+ const t = Cn(this.options, this.directives, e, this.onError);
3144
3145
  this.atDirectives && !t.directives.docStart && this.onError(e, "MISSING_CHAR", "Missing directives-end/doc-start indicator line"), this.decorate(t, !1), this.doc && (yield this.doc), this.doc = t, this.atDirectives = !1;
3145
3146
  break;
3146
3147
  }
@@ -3191,7 +3192,7 @@ ${t.comment}` : t.comment;
3191
3192
  }
3192
3193
  }
3193
3194
  }
3194
- function Cn(s, e = !0, t) {
3195
+ function vn(s, e = !0, t) {
3195
3196
  if (s) {
3196
3197
  const n = (i, r, o) => {
3197
3198
  const l = typeof i == "number" ? i : Array.isArray(i) ? i[0] : i.offset;
@@ -3204,14 +3205,14 @@ function Cn(s, e = !0, t) {
3204
3205
  case "scalar":
3205
3206
  case "single-quoted-scalar":
3206
3207
  case "double-quoted-scalar":
3207
- return gs(s, e, n);
3208
+ return ys(s, e, n);
3208
3209
  case "block-scalar":
3209
- return ms(s, e, n);
3210
+ return gs(s, e, n);
3210
3211
  }
3211
3212
  }
3212
3213
  return null;
3213
3214
  }
3214
- function vn(s, e) {
3215
+ function _n(s, e) {
3215
3216
  const { implicitKey: t = !1, indent: n, inFlow: i = !1, offset: r = -1, type: o = "PLAIN" } = e, l = Ne({ type: o, value: s }, {
3216
3217
  implicitKey: t,
3217
3218
  indent: n > 0 ? " ".repeat(n) : "",
@@ -3229,7 +3230,7 @@ function vn(s, e) {
3229
3230
  `, h = [
3230
3231
  { type: "block-scalar-header", offset: r, indent: n, source: u }
3231
3232
  ];
3232
- return Ss(h, a) || h.push({ type: "newline", offset: -1, indent: n, source: `
3233
+ return ks(h, a) || h.push({ type: "newline", offset: -1, indent: n, source: `
3233
3234
  ` }), { type: "block-scalar", offset: r, indent: n, props: h, source: f };
3234
3235
  }
3235
3236
  case '"':
@@ -3240,7 +3241,7 @@ function vn(s, e) {
3240
3241
  return { type: "scalar", offset: r, indent: n, source: l, end: a };
3241
3242
  }
3242
3243
  }
3243
- function _n(s, e, t = {}) {
3244
+ function Bn(s, e, t = {}) {
3244
3245
  let { afterKey: n = !1, implicitKey: i = !1, inFlow: r = !1, type: o } = t, l = "indent" in s ? s.indent : null;
3245
3246
  if (n && typeof l == "number" && (l += 2), !o)
3246
3247
  switch (s.type) {
@@ -3269,7 +3270,7 @@ function _n(s, e, t = {}) {
3269
3270
  switch (a[0]) {
3270
3271
  case "|":
3271
3272
  case ">":
3272
- Bn(s, a);
3273
+ jn(s, a);
3273
3274
  break;
3274
3275
  case '"':
3275
3276
  st(s, a, "double-quoted-scalar");
@@ -3281,7 +3282,7 @@ function _n(s, e, t = {}) {
3281
3282
  st(s, a, "scalar");
3282
3283
  }
3283
3284
  }
3284
- function Bn(s, e) {
3285
+ function jn(s, e) {
3285
3286
  const t = e.indexOf(`
3286
3287
  `), n = e.substring(0, t), i = e.substring(t + 1) + `
3287
3288
  `;
@@ -3294,14 +3295,14 @@ function Bn(s, e) {
3294
3295
  const { offset: r } = s, o = "indent" in s ? s.indent : -1, l = [
3295
3296
  { type: "block-scalar-header", offset: r, indent: o, source: n }
3296
3297
  ];
3297
- Ss(l, "end" in s ? s.end : void 0) || l.push({ type: "newline", offset: -1, indent: o, source: `
3298
+ ks(l, "end" in s ? s.end : void 0) || l.push({ type: "newline", offset: -1, indent: o, source: `
3298
3299
  ` });
3299
3300
  for (const a of Object.keys(s))
3300
3301
  a !== "type" && a !== "offset" && delete s[a];
3301
3302
  Object.assign(s, { type: "block-scalar", indent: o, props: l, source: i });
3302
3303
  }
3303
3304
  }
3304
- function Ss(s, e) {
3305
+ function ks(s, e) {
3305
3306
  if (e)
3306
3307
  for (const t of e)
3307
3308
  switch (t.type) {
@@ -3345,7 +3346,7 @@ function st(s, e, t) {
3345
3346
  }
3346
3347
  }
3347
3348
  }
3348
- const jn = (s) => "type" in s ? Pe(s) : _e(s);
3349
+ const Mn = (s) => "type" in s ? Pe(s) : ve(s);
3349
3350
  function Pe(s) {
3350
3351
  switch (s.type) {
3351
3352
  case "block-scalar": {
@@ -3358,19 +3359,19 @@ function Pe(s) {
3358
3359
  case "block-seq": {
3359
3360
  let e = "";
3360
3361
  for (const t of s.items)
3361
- e += _e(t);
3362
+ e += ve(t);
3362
3363
  return e;
3363
3364
  }
3364
3365
  case "flow-collection": {
3365
3366
  let e = s.start.source;
3366
3367
  for (const t of s.items)
3367
- e += _e(t);
3368
+ e += ve(t);
3368
3369
  for (const t of s.end)
3369
3370
  e += t.source;
3370
3371
  return e;
3371
3372
  }
3372
3373
  case "document": {
3373
- let e = _e(s);
3374
+ let e = ve(s);
3374
3375
  if (s.end)
3375
3376
  for (const t of s.end)
3376
3377
  e += t.source;
@@ -3385,7 +3386,7 @@ function Pe(s) {
3385
3386
  }
3386
3387
  }
3387
3388
  }
3388
- function _e({ start: s, key: e, sep: t, value: n }) {
3389
+ function ve({ start: s, key: e, sep: t, value: n }) {
3389
3390
  let i = "";
3390
3391
  for (const r of s)
3391
3392
  i += r.source;
@@ -3394,13 +3395,13 @@ function _e({ start: s, key: e, sep: t, value: n }) {
3394
3395
  i += r.source;
3395
3396
  return n && (i += Pe(n)), i;
3396
3397
  }
3397
- const ct = Symbol("break visit"), Mn = Symbol("skip children"), ks = Symbol("remove item");
3398
+ const ct = Symbol("break visit"), Pn = Symbol("skip children"), Ns = Symbol("remove item");
3398
3399
  function x(s, e) {
3399
- "type" in s && s.type === "document" && (s = { start: s.start, value: s.value }), Ns(Object.freeze([]), s, e);
3400
+ "type" in s && s.type === "document" && (s = { start: s.start, value: s.value }), Os(Object.freeze([]), s, e);
3400
3401
  }
3401
3402
  x.BREAK = ct;
3402
- x.SKIP = Mn;
3403
- x.REMOVE = ks;
3403
+ x.SKIP = Pn;
3404
+ x.REMOVE = Ns;
3404
3405
  x.itemAtPath = (s, e) => {
3405
3406
  let t = s;
3406
3407
  for (const [n, i] of e) {
@@ -3418,7 +3419,7 @@ x.parentCollection = (s, e) => {
3418
3419
  return i;
3419
3420
  throw new Error("Parent collection not found");
3420
3421
  };
3421
- function Ns(s, e, t) {
3422
+ function Os(s, e, t) {
3422
3423
  let n = t(e, s);
3423
3424
  if (typeof n == "symbol")
3424
3425
  return n;
@@ -3426,13 +3427,13 @@ function Ns(s, e, t) {
3426
3427
  const r = e[i];
3427
3428
  if (r && "items" in r) {
3428
3429
  for (let o = 0; o < r.items.length; ++o) {
3429
- const l = Ns(Object.freeze(s.concat([[i, o]])), r.items[o], t);
3430
+ const l = Os(Object.freeze(s.concat([[i, o]])), r.items[o], t);
3430
3431
  if (typeof l == "number")
3431
3432
  o = l - 1;
3432
3433
  else {
3433
3434
  if (l === ct)
3434
3435
  return ct;
3435
- l === ks && (r.items.splice(o, 1), o -= 1);
3436
+ l === Ns && (r.items.splice(o, 1), o -= 1);
3436
3437
  }
3437
3438
  }
3438
3439
  typeof n == "function" && i === "key" && (n = n(e, s));
@@ -3440,8 +3441,8 @@ function Ns(s, e, t) {
3440
3441
  }
3441
3442
  return typeof n == "function" ? n(e, s) : n;
3442
3443
  }
3443
- const He = "\uFEFF", xe = "", Xe = "", Se = "", Pn = (s) => !!s && "items" in s, Dn = (s) => !!s && (s.type === "scalar" || s.type === "single-quoted-scalar" || s.type === "double-quoted-scalar" || s.type === "block-scalar");
3444
- function Kn(s) {
3444
+ const He = "\uFEFF", xe = "", Xe = "", Se = "", Dn = (s) => !!s && "items" in s, Kn = (s) => !!s && (s.type === "scalar" || s.type === "single-quoted-scalar" || s.type === "double-quoted-scalar" || s.type === "block-scalar");
3445
+ function Fn(s) {
3445
3446
  switch (s) {
3446
3447
  case He:
3447
3448
  return "<BOM>";
@@ -3455,7 +3456,7 @@ function Kn(s) {
3455
3456
  return JSON.stringify(s);
3456
3457
  }
3457
3458
  }
3458
- function Os(s) {
3459
+ function As(s) {
3459
3460
  switch (s) {
3460
3461
  case He:
3461
3462
  return "byte-order-mark";
@@ -3516,20 +3517,20 @@ function Os(s) {
3516
3517
  }
3517
3518
  return null;
3518
3519
  }
3519
- const Fn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3520
+ const qn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3520
3521
  __proto__: null,
3521
3522
  BOM: He,
3522
3523
  DOCUMENT: xe,
3523
3524
  FLOW_END: Xe,
3524
3525
  SCALAR: Se,
3525
- createScalarToken: vn,
3526
- isCollection: Pn,
3527
- isScalar: Dn,
3528
- prettyToken: Kn,
3529
- resolveAsScalar: Cn,
3530
- setScalarValue: _n,
3531
- stringify: jn,
3532
- tokenType: Os,
3526
+ createScalarToken: _n,
3527
+ isCollection: Dn,
3528
+ isScalar: Kn,
3529
+ prettyToken: Fn,
3530
+ resolveAsScalar: vn,
3531
+ setScalarValue: Bn,
3532
+ stringify: Mn,
3533
+ tokenType: As,
3533
3534
  visit: x
3534
3535
  }, Symbol.toStringTag, { value: "Module" }));
3535
3536
  function B(s) {
@@ -3545,9 +3546,9 @@ function B(s) {
3545
3546
  return !1;
3546
3547
  }
3547
3548
  }
3548
- const jt = "0123456789ABCDEFabcdef".split(""), qn = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()".split(""), nt = ",[]{}".split(""), Un = ` ,[]{}
3549
- \r `.split(""), it = (s) => !s || Un.includes(s);
3550
- class As {
3549
+ const jt = "0123456789ABCDEFabcdef".split(""), Un = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()".split(""), nt = ",[]{}".split(""), Rn = ` ,[]{}
3550
+ \r `.split(""), it = (s) => !s || Rn.includes(s);
3551
+ class Es {
3551
3552
  constructor() {
3552
3553
  this.atEnd = !1, this.blockScalarIndent = -1, this.blockScalarKeep = !1, this.buffer = "", this.flowKey = !1, this.flowLevel = 0, this.indentNext = 0, this.indentValue = 0, this.lineEndPos = null, this.next = null, this.pos = 0;
3553
3554
  }
@@ -3914,7 +3915,7 @@ class As {
3914
3915
  } else {
3915
3916
  let e = this.pos + 1, t = this.buffer[e];
3916
3917
  for (; t; )
3917
- if (qn.includes(t))
3918
+ if (Un.includes(t))
3918
3919
  t = this.buffer[++e];
3919
3920
  else if (t === "%" && jt.includes(this.buffer[e + 1]) && jt.includes(this.buffer[e + 2]))
3920
3921
  t = this.buffer[e += 3];
@@ -3944,7 +3945,7 @@ class As {
3944
3945
  return yield* this.pushToIndex(t, !1);
3945
3946
  }
3946
3947
  }
3947
- class Es {
3948
+ class Is {
3948
3949
  constructor() {
3949
3950
  this.lineStarts = [], this.addNewLine = (e) => this.lineStarts.push(e), this.linePos = (e) => {
3950
3951
  let t = 0, n = this.lineStarts.length;
@@ -3979,7 +3980,7 @@ function Mt(s) {
3979
3980
  }
3980
3981
  return -1;
3981
3982
  }
3982
- function Is(s) {
3983
+ function Ts(s) {
3983
3984
  switch (s?.type) {
3984
3985
  case "alias":
3985
3986
  case "scalar":
@@ -4026,7 +4027,7 @@ function se(s) {
4026
4027
  function Pt(s) {
4027
4028
  if (s.start.type === "flow-seq-start")
4028
4029
  for (const e of s.items)
4029
- e.sep && !e.value && !P(e.start, "explicit-key-ind") && !P(e.sep, "map-value-ind") && (e.key && (e.value = e.key), delete e.key, Is(e.value) ? e.value.end ? Array.prototype.push.apply(e.value.end, e.sep) : e.value.end = e.sep : Array.prototype.push.apply(e.start, e.sep), delete e.sep);
4030
+ e.sep && !e.value && !P(e.start, "explicit-key-ind") && !P(e.sep, "map-value-ind") && (e.key && (e.value = e.key), delete e.key, Ts(e.value) ? e.value.end ? Array.prototype.push.apply(e.value.end, e.sep) : e.value.end = e.sep : Array.prototype.push.apply(e.start, e.sep), delete e.sep);
4030
4031
  }
4031
4032
  class At {
4032
4033
  /**
@@ -4034,7 +4035,7 @@ class At {
4034
4035
  * each new line (in `parse()`, including the start of input).
4035
4036
  */
4036
4037
  constructor(e) {
4037
- this.atNewLine = !0, this.atScalar = !1, this.indent = 0, this.offset = 0, this.onKeyLine = !1, this.stack = [], this.source = "", this.type = "", this.lexer = new As(), this.onNewLine = e;
4038
+ this.atNewLine = !0, this.atScalar = !1, this.indent = 0, this.offset = 0, this.onKeyLine = !1, this.stack = [], this.source = "", this.type = "", this.lexer = new Es(), this.onNewLine = e;
4038
4039
  }
4039
4040
  /**
4040
4041
  * Parse `source` as a YAML stream.
@@ -4058,7 +4059,7 @@ class At {
4058
4059
  this.atScalar = !1, yield* this.step(), this.offset += e.length;
4059
4060
  return;
4060
4061
  }
4061
- const t = Os(e);
4062
+ const t = As(e);
4062
4063
  if (t)
4063
4064
  if (t === "scalar")
4064
4065
  this.atNewLine = !1, this.atScalar = !0, this.type = "scalar";
@@ -4353,7 +4354,7 @@ class At {
4353
4354
  indent: this.indent,
4354
4355
  items: [{ start: i, key: null, sep: [this.sourceToken] }]
4355
4356
  });
4356
- else if (Is(t.key) && !P(t.sep, "newline")) {
4357
+ else if (Ts(t.key) && !P(t.sep, "newline")) {
4357
4358
  const r = se(t.start), o = t.key, l = t.sep;
4358
4359
  l.push(this.sourceToken), delete t.key, delete t.sep, this.stack.push({
4359
4360
  type: "block-map",
@@ -4603,16 +4604,16 @@ class At {
4603
4604
  }
4604
4605
  function Ls(s) {
4605
4606
  const e = s.prettyErrors !== !1;
4606
- return { lineCounter: s.lineCounter || e && new Es() || null, prettyErrors: e };
4607
+ return { lineCounter: s.lineCounter || e && new Is() || null, prettyErrors: e };
4607
4608
  }
4608
- function Rn(s, e = {}) {
4609
+ function Vn(s, e = {}) {
4609
4610
  const { lineCounter: t, prettyErrors: n } = Ls(e), i = new At(t?.addNewLine), r = new Ot(e), o = Array.from(r.compose(i.parse(s)));
4610
4611
  if (n && t)
4611
4612
  for (const l of o)
4612
4613
  l.errors.forEach(Me(s, t)), l.warnings.forEach(Me(s, t));
4613
4614
  return o.length > 0 ? o : Object.assign([], { empty: !0 }, r.streamInfo());
4614
4615
  }
4615
- function Ts(s, e = {}) {
4616
+ function $s(s, e = {}) {
4616
4617
  const { lineCounter: t, prettyErrors: n } = Ls(e), i = new At(t?.addNewLine), r = new Ot(e);
4617
4618
  let o = null;
4618
4619
  for (const l of r.compose(i.parse(s), !0, s.length))
@@ -4624,20 +4625,20 @@ function Ts(s, e = {}) {
4624
4625
  }
4625
4626
  return n && t && (o.errors.forEach(Me(s, t)), o.warnings.forEach(Me(s, t))), o;
4626
4627
  }
4627
- function Vn(s, e, t) {
4628
+ function Wn(s, e, t) {
4628
4629
  let n;
4629
4630
  typeof e == "function" ? n = e : t === void 0 && e && typeof e == "object" && (t = e);
4630
- const i = Ts(s, t);
4631
+ const i = $s(s, t);
4631
4632
  if (!i)
4632
4633
  return null;
4633
- if (i.warnings.forEach((r) => Ht(i.options.logLevel, r)), i.errors.length > 0) {
4634
+ if (i.warnings.forEach((r) => xt(i.options.logLevel, r)), i.errors.length > 0) {
4634
4635
  if (i.options.logLevel !== "silent")
4635
4636
  throw i.errors[0];
4636
4637
  i.errors = [];
4637
4638
  }
4638
4639
  return i.toJS(Object.assign({ reviver: n }, t));
4639
4640
  }
4640
- function Wn(s, e, t) {
4641
+ function Jn(s, e, t) {
4641
4642
  let n = null;
4642
4643
  if (typeof e == "function" || Array.isArray(e) ? n = e : t === void 0 && e && (t = e), typeof t == "string" && (t = t.length), typeof t == "number") {
4643
4644
  const i = Math.round(t);
@@ -4650,14 +4651,14 @@ function Wn(s, e, t) {
4650
4651
  }
4651
4652
  return new de(s, n, t).toString(t);
4652
4653
  }
4653
- const Jn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4654
+ const Yn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4654
4655
  __proto__: null,
4655
4656
  Alias: Ke,
4656
- CST: Fn,
4657
+ CST: qn,
4657
4658
  Composer: Ot,
4658
4659
  Document: de,
4659
- Lexer: As,
4660
- LineCounter: Es,
4660
+ Lexer: Es,
4661
+ LineCounter: Is,
4661
4662
  Pair: $,
4662
4663
  Parser: At,
4663
4664
  Scalar: N,
@@ -4666,86 +4667,98 @@ const Jn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4666
4667
  YAMLMap: j,
4667
4668
  YAMLParseError: Q,
4668
4669
  YAMLSeq: Z,
4669
- YAMLWarning: ds,
4670
+ YAMLWarning: ps,
4670
4671
  isAlias: X,
4671
- isCollection: L,
4672
+ isCollection: T,
4672
4673
  isDocument: ke,
4673
4674
  isMap: z,
4674
- isNode: T,
4675
+ isNode: L,
4675
4676
  isPair: I,
4676
4677
  isScalar: A,
4677
4678
  isSeq: fe,
4678
- parse: Vn,
4679
- parseAllDocuments: Rn,
4680
- parseDocument: Ts,
4681
- stringify: Wn,
4679
+ parse: Wn,
4680
+ parseAllDocuments: Vn,
4681
+ parseDocument: $s,
4682
+ stringify: Jn,
4682
4683
  visit: J,
4683
4684
  visitAsync: De
4684
- }, Symbol.toStringTag, { value: "Module" })), Xn = (s) => s, zn = (s) => s, Zn = (s) => s, ei = (s) => ({
4685
+ }, Symbol.toStringTag, { value: "Module" })), Zn = (s) => s, ei = (s) => s, ti = (s) => s, si = (s) => ({
4685
4686
  widget: "boolean",
4686
4687
  ...s
4687
- }), ti = (s) => ({
4688
+ }), ni = (s) => ({
4688
4689
  widget: "code",
4689
4690
  ...s
4690
- }), si = (s) => ({
4691
+ }), ii = (s) => ({
4691
4692
  widget: "color",
4692
4693
  ...s
4693
- }), ni = (s) => ({ widget: "datetime", ...s }), ii = (s) => ({
4694
+ }), ri = (s) => ({ widget: "datetime", ...s }), oi = (s) => ({
4694
4695
  widget: "hidden",
4695
4696
  ...s
4696
- }), ri = (s) => ({
4697
+ }), li = (s) => ({
4697
4698
  widget: "file",
4698
4699
  ...s
4699
- }), oi = (s) => ({
4700
+ }), ai = (s) => ({
4700
4701
  widget: "image",
4701
4702
  ...s
4702
- }), li = (s) => ({
4703
+ }), ci = (s) => ({
4703
4704
  widget: "list",
4704
4705
  ...s
4705
- }), ai = (s) => ({
4706
+ }), fi = (s) => ({
4706
4707
  widget: "map",
4707
4708
  ...s
4708
- }), ci = (s) => ({
4709
+ }), ui = (s) => ({
4709
4710
  widget: "number",
4710
4711
  ...s
4711
- }), fi = (s) => ({
4712
+ }), hi = (s) => ({
4712
4713
  widget: "object",
4713
4714
  ...s
4714
- }), ui = (s) => ({ widget: "relation", ...s }), hi = (s) => ({
4715
+ }), di = (s) => ({ widget: "relation", ...s }), pi = (s) => ({
4715
4716
  widget: "select",
4716
4717
  ...s
4717
- }), di = (s) => ({
4718
+ }), mi = (s) => ({
4718
4719
  widget: "string",
4719
4720
  ...s
4720
- }), pi = (s) => ({
4721
+ }), gi = (s) => ({
4721
4722
  widget: "text",
4722
4723
  ...s
4723
- }), Yn = async (s) => {
4724
+ }), yi = (s) => ({
4725
+ widget: "markdown",
4726
+ ...s
4727
+ }), Gn = async (s) => {
4724
4728
  try {
4725
- await $s(s);
4729
+ await Kt(s);
4726
4730
  } catch {
4727
- await Cs(s, { recursive: !0 });
4728
- }
4729
- }, Gn = async (s, e) => {
4730
- await vs(e, s);
4731
- }, Qn = async (s) => {
4731
+ await vs(s, { recursive: !0 });
4732
+ }
4733
+ }, Qn = async (s, e) => {
4734
+ await _s(e, s);
4735
+ }, Hn = (s) => {
4736
+ const e = s.startsWith(".") ? s.slice(2) : s;
4737
+ return e ? ["ts", "js", "cjs", "mjs"].some((t) => e.includes(t)) ? e.split(".").slice(0, -1).join(".") : e : s;
4738
+ }, Cs = async (s, e) => {
4732
4739
  try {
4733
- await _s(s);
4734
- const { default: e } = await import(
4735
- /* @vite-ignore */
4736
- s
4737
- );
4738
- return e;
4740
+ const t = await Kt(s), n = Hn(e);
4741
+ if (n.includes("/")) {
4742
+ const [o, l] = n.split("/");
4743
+ return await Cs(_e.join(s, o), l);
4744
+ }
4745
+ const i = t.find((o) => o.startsWith(n));
4746
+ if (!i)
4747
+ throw new Error("Config file not found");
4748
+ const { config: r } = await Bs({ command: "build", mode: "" }, _e.join(s, i)) ?? {};
4749
+ if (!r)
4750
+ throw new Error("Config file not found");
4751
+ return r;
4739
4752
  } catch {
4740
- throw new Error(`Config file not found on ${s}`);
4753
+ throw new Error("Config file not found");
4741
4754
  }
4742
4755
  }, Dt = async (s, e) => {
4743
- const { configFile: t = "./netlify.config.ts", config: n, saveFolder: i = "./public/admin" } = e ?? {};
4744
- console.log("config path: ", s, t, Ee.join(s, t)), await Yn(Ee.join(s, i));
4745
- const r = n ?? await Qn(Ee.join(s, t)), o = Jn.stringify(r);
4746
- await Gn(o, Ee.join(s, i, "config.yml"));
4756
+ const { configFile: t = "./netlify.config.ts", config: n, saveFolder: i = "./public/admin" } = e ?? {}, r = n ?? await Cs(s, t);
4757
+ await Gn(_e.join(s, i));
4758
+ const o = Yn.stringify(r);
4759
+ await Qn(o, _e.join(s, i, "config.yml"));
4747
4760
  };
4748
- async function mi(s) {
4761
+ async function bi(s) {
4749
4762
  let e = "";
4750
4763
  return {
4751
4764
  name: "vite-plugin-netlify-cms",
@@ -4761,24 +4774,26 @@ async function mi(s) {
4761
4774
  };
4762
4775
  }
4763
4776
  export {
4764
- mi as default,
4765
- ei as defineBooleanWidget,
4766
- ti as defineCodeWidget,
4767
- si as defineColorWidget,
4768
- Xn as defineConfig,
4769
- ni as defineDateTimeWidget,
4770
- Zn as defineFileCollection,
4771
- ri as defineFileWidget,
4772
- zn as defineFolderCollection,
4773
- ii as defineHiddenWidget,
4774
- oi as defineImageWidget,
4775
- li as defineListWidget,
4776
- ai as defineMapWidget,
4777
- ci as defineNumberWidget,
4778
- fi as defineObjectWidget,
4779
- ui as defineRelationWidget,
4780
- hi as defineSelectWidget,
4781
- di as defineStringWidget,
4782
- pi as defineTextWidget
4777
+ Dt as createConfig,
4778
+ bi as default,
4779
+ si as defineBooleanWidget,
4780
+ ni as defineCodeWidget,
4781
+ ii as defineColorWidget,
4782
+ Zn as defineConfig,
4783
+ ri as defineDateTimeWidget,
4784
+ ti as defineFileCollection,
4785
+ li as defineFileWidget,
4786
+ ei as defineFolderCollection,
4787
+ oi as defineHiddenWidget,
4788
+ ai as defineImageWidget,
4789
+ ci as defineListWidget,
4790
+ fi as defineMapWidget,
4791
+ yi as defineMarkdownWidget,
4792
+ ui as defineNumberWidget,
4793
+ hi as defineObjectWidget,
4794
+ di as defineRelationWidget,
4795
+ pi as defineSelectWidget,
4796
+ mi as defineStringWidget,
4797
+ gi as defineTextWidget
4783
4798
  };
4784
4799
  //# sourceMappingURL=index.es.js.map