var D = Object.defineProperty;
var L = (O, e, a) => e in O ? D(O, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : O[e] = a;
var Q = (O, e) => D(O, "name", { value: e, configurable: !0 });
var p = (O, e, a) => L(O, typeof e != "symbol" ? e + "" : e, a);
import { ContextTracker as B, ExternalTokenizer as b, styleTags as M, tags as t, LRParser as E, LRLanguage as j, indentNodeProp as A, delimitedIndent as U, foldNodeProp as H, foldInside as N, LanguageSupport as u } from "../../../editor.js";
const c = 63, W = 64, I = 1, F = 2, z = 3, K = 4, G = 5, J = 6, OO = 7, V = 65, eO = 66, aO = 8, rO = 9, QO = 10, PO = 11, tO = 12, Z = 13, oO = 19, nO = 20, sO = 29, lO = 33, fO = 34, cO = 47, XO = 0, h = 1, x = 2, S = 3, m = 4, R = class R {
  constructor(e, a, r) {
    this.parent = e, this.depth = a, this.type = r, this.hash = (e ? e.hash + e.hash << 8 : 0) + a + (a << 4) + r;
  }
};
Q(R, "Context"), p(R, "top", new R(null, -1, XO));
let l = R;
function d(O, e) {
  for (let a = 0, r = e - O.pos - 1; ; r--, a++) {
    let o = O.peek(r);
    if (n(o) || o == -1) return a;
  }
}
Q(d, "findColumn");
function $(O) {
  return O == 32 || O == 9;
}
Q($, "isNonBreakSpace");
function n(O) {
  return O == 10 || O == 13;
}
Q(n, "isBreakSpace");
function w(O) {
  return $(O) || n(O);
}
Q(w, "isSpace");
function f(O) {
  return O < 0 || w(O);
}
Q(f, "isSep");
const dO = new B({
  start: l.top,
  reduce(O, e) {
    return O.type == S && (e == nO || e == fO) ? O.parent : O;
  },
  shift(O, e, a, r) {
    if (e == z)
      return new l(O, d(r, r.pos), h);
    if (e == V || e == G)
      return new l(O, d(r, r.pos), x);
    if (e == c)
      return O.parent;
    if (e == oO || e == lO)
      return new l(O, 0, S);
    if (e == Z && O.type == m)
      return O.parent;
    if (e == cO) {
      let o = /[1-9]/.exec(r.read(r.pos, a.pos));
      if (o) return new l(O, O.depth + +o[0], m);
    }
    return O;
  },
  hash(O) {
    return O.hash;
  }
});
function X(O, e, a = 0) {
  return O.peek(a) == e && O.peek(a + 1) == e && O.peek(a + 2) == e && f(O.peek(a + 3));
}
Q(X, "three");
const RO = new b((O, e) => {
  if (O.next == -1 && e.canShift(W))
    return O.acceptToken(W);
  let a = O.peek(-1);
  if ((n(a) || a < 0) && e.context.type != S) {
    if (X(
      O,
      45
      /* '-' */
    ))
      if (e.canShift(c)) O.acceptToken(c);
      else return O.acceptToken(I, 3);
    if (X(
      O,
      46
      /* '.' */
    ))
      if (e.canShift(c)) O.acceptToken(c);
      else return O.acceptToken(F, 3);
    let r = 0;
    for (; O.next == 32; )
      r++, O.advance();
    (r < e.context.depth || r == e.context.depth && e.context.type == h && (O.next != 45 || !f(O.peek(1)))) && // Not blank
    O.next != -1 && !n(O.next) && O.next != 35 && O.acceptToken(c, -r);
  }
}, { contextual: !0 }), SO = new b((O, e) => {
  if (e.context.type == S) {
    O.next == 63 && (O.advance(), f(O.next) && O.acceptToken(OO));
    return;
  }
  if (O.next == 45)
    O.advance(), f(O.next) && O.acceptToken(e.context.type == h && e.context.depth == d(O, O.pos - 1) ? K : z);
  else if (O.next == 63)
    O.advance(), f(O.next) && O.acceptToken(e.context.type == x && e.context.depth == d(O, O.pos - 1) ? J : G);
  else {
    let a = O.pos;
    for (; ; )
      if ($(O.next)) {
        if (O.pos == a) return;
        O.advance();
      } else if (O.next == 33)
        C(O);
      else if (O.next == 38)
        T(O);
      else if (O.next == 42) {
        T(O);
        break;
      } else if (O.next == 39 || O.next == 34) {
        if (v(O, !0)) break;
        return;
      } else if (O.next == 91 || O.next == 123) {
        if (!kO(O)) return;
        break;
      } else {
        _(O, !0, !1, 0);
        break;
      }
    for (; $(O.next); ) O.advance();
    if (O.next == 58) {
      if (O.pos == a && e.canShift(sO)) return;
      let r = O.peek(1);
      f(r) && O.acceptTokenTo(e.context.type == x && e.context.depth == d(O, a) ? eO : V, a);
    }
  }
}, { contextual: !0 });
function iO(O) {
  return O > 32 && O < 127 && O != 34 && O != 37 && O != 44 && O != 60 && O != 62 && O != 92 && O != 94 && O != 96 && O != 123 && O != 124 && O != 125;
}
Q(iO, "uriChar");
function y(O) {
  return O >= 48 && O <= 57 || O >= 97 && O <= 102 || O >= 65 && O <= 70;
}
Q(y, "hexChar");
function Y(O, e) {
  return O.next == 37 ? (O.advance(), y(O.next) && O.advance(), y(O.next) && O.advance(), !0) : iO(O.next) || e && O.next == 44 ? (O.advance(), !0) : !1;
}
Q(Y, "readUriChar");
function C(O) {
  if (O.advance(), O.next == 60) {
    for (O.advance(); ; )
      if (!Y(O, !0)) {
        O.next == 62 && O.advance();
        break;
      }
  } else
    for (; Y(O, !1); )
      ;
}
Q(C, "readTag");
function T(O) {
  for (O.advance(); !f(O.next) && k(O.tag) != "f"; ) O.advance();
}
Q(T, "readAnchor");
function v(O, e) {
  let a = O.next, r = !1, o = O.pos;
  for (O.advance(); ; ) {
    let P = O.next;
    if (P < 0) break;
    if (O.advance(), P == a)
      if (P == 39)
        if (O.next == 39) O.advance();
        else break;
      else
        break;
    else if (P == 92 && a == 34)
      O.next >= 0 && O.advance();
    else if (n(P)) {
      if (e) return !1;
      r = !0;
    } else if (e && O.pos >= o + 1024)
      return !1;
  }
  return !r;
}
Q(v, "readQuoted");
function kO(O) {
  for (let e = [], a = O.pos + 1024; ; )
    if (O.next == 91 || O.next == 123)
      e.push(O.next), O.advance();
    else if (O.next == 39 || O.next == 34) {
      if (!v(O, !0)) return !1;
    } else if (O.next == 93 || O.next == 125) {
      if (e[e.length - 1] != O.next - 2) return !1;
      if (e.pop(), O.advance(), !e.length) return !0;
    } else {
      if (O.next < 0 || O.pos > a || n(O.next))
        return !1;
      O.advance();
    }
}
Q(kO, "scanBrackets");
const bO = "iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";
function k(O) {
  return O < 33 ? "u" : O > 125 ? "s" : bO[O - 33];
}
Q(k, "charTag");
function g(O, e) {
  let a = k(O);
  return a != "u" && !(e && a == "f");
}
Q(g, "isSafe");
function _(O, e, a, r) {
  if (k(O.next) == "s" || (O.next == 63 || O.next == 58 || O.next == 45) && g(O.peek(1), a))
    O.advance();
  else
    return !1;
  let o = O.pos;
  for (; ; ) {
    let P = O.next, s = 0, i = r + 1;
    for (; w(P); ) {
      if (n(P)) {
        if (e) return !1;
        i = 0;
      } else
        i++;
      P = O.peek(++s);
    }
    if (!(P >= 0 && (P == 58 ? g(O.peek(s + 1), a) : P == 35 ? O.peek(s - 1) != 32 : g(P, a))) || !a && i <= r || i == 0 && !a && (X(O, 45, s) || X(O, 46, s)))
      break;
    if (e && k(P) == "f") return !1;
    for (let q = s; q >= 0; q--) O.advance();
    if (e && O.pos > o + 1024) return !1;
  }
  return !0;
}
Q(_, "readPlain");
const gO = new b((O, e) => {
  if (O.next == 33)
    C(O), O.acceptToken(tO);
  else if (O.next == 38 || O.next == 42) {
    let a = O.next == 38 ? QO : PO;
    T(O), O.acceptToken(a);
  } else O.next == 39 || O.next == 34 ? (v(O, !1), O.acceptToken(rO)) : _(O, !1, e.context.type == S, e.context.depth) && O.acceptToken(aO);
}), xO = new b((O, e) => {
  let a = e.context.type == m ? e.context.depth : -1, r = O.pos;
  O: for (; ; ) {
    let o = 0, P = O.next;
    for (; P == 32; ) P = O.peek(++o);
    if (!o && (X(O, 45, o) || X(O, 46, o)) || !n(P) && (a < 0 && (a = Math.max(e.context.depth + 1, o)), o < a))
      break;
    for (; ; ) {
      if (O.next < 0) break O;
      let s = n(O.next);
      if (O.advance(), s) continue O;
      r = O.pos;
    }
  }
  O.acceptTokenTo(Z, r);
}), mO = M({
  DirectiveName: t.keyword,
  DirectiveContent: t.attributeValue,
  "DirectiveEnd DocEnd": t.meta,
  QuotedLiteral: t.string,
  BlockLiteralHeader: t.special(t.string),
  BlockLiteralContent: t.content,
  Literal: t.content,
  "Key/Literal Key/QuotedLiteral": t.definition(t.propertyName),
  "Anchor Alias": t.labelName,
  Tag: t.typeName,
  Comment: t.l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document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",
  maxTerm: 74,
  context: dO,
  nodeProps: [
    ["isolate", -3, 8, 9, 14, ""],
    ["openedBy", 18, "[", 32, "{"],
    ["closedBy", 19, "]", 33, "}"]
  ],
  propSources: [mO],
  skippedNodes: [0],
  repeatNodeCount: 6,
  tokenData: "-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",
  tokenizers: [RO, SO, gO, xO, 0, 1],
  topRules: { Stream: [0, 15] },
  tokenPrec: 0
}), TO = /* @__PURE__ */ j.define({
  name: "yaml",
  parser: /* @__PURE__ */ $O.configure({
    props: [
      /* @__PURE__ */ A.add({
        Stream: /* @__PURE__ */ Q((O) => {
          for (let e = O.node.resolve(O.pos, -1); e && e.to >= O.pos; e = e.parent) {
            if (e.name == "BlockLiteralContent" && e.from < e.to)
              return O.baseIndentFor(e);
            if (e.name == "BlockLiteral")
              return O.baseIndentFor(e) + O.unit;
            if (e.name == "BlockSequence" || e.name == "BlockMapping")
              return O.column(e.from, 1);
            if (e.name == "QuotedLiteral")
              return null;
            if (e.name == "Literal") {
              let a = O.column(e.from, 1);
              if (a == O.lineIndent(e.from, 1))
                return a;
              if (e.to > O.pos)
                return null;
            }
          }
          return null;
        }, "Stream"),
        FlowMapping: /* @__PURE__ */ U({ closing: "}" }),
        FlowSequence: /* @__PURE__ */ U({ closing: "]" })
      }),
      /* @__PURE__ */ H.add({
        "FlowMapping FlowSequence": N,
        "BlockSequence BlockMapping BlockLiteral": /* @__PURE__ */ Q((O, e) => ({ from: e.doc.lineAt(O.from).to, to: O.to }), "BlockSequence BlockMapping BlockLiteral")
      })
    ]
  }),
  languageData: {
    commentTokens: { line: "#" },
    indentOnInput: /^\s*[\]\}]$/
  }
});
function DO() {
  return new u(TO);
}
Q(DO, "yaml");
export {
  DO as yaml,
  TO as yamlLanguage
};
