import { L as be, E as $, C as he } from "./index-DrxEj-wf.js";
import { p as Te, s as Pe, t as b, E as xe, e as K, g as Ve, a as ye, L as we, i as ve, f as Xe, H as $e } from "./index-D9YWiked.js";
import { cssLanguage as J, css as _e } from "./index-BGMA3xMF.js";
import { typescriptLanguage as qe, jsxLanguage as Ce, tsxLanguage as ke, javascriptLanguage as M, javascript as Qe } from "./index-DBTfT9Zh.js";
const Ae = 55, Ye = 1, Me = 56, Re = 2, Ee = 57, Ze = 3, z = 4, Be = 5, R = 6, ee = 7, te = 8, ae = 9, le = 10, ze = 11, De = 12, We = 13, _ = 58, Ne = 14, Ge = 15, D = 59, re = 21, Ie = 23, ne = 24, je = 25, A = 27, se = 28, Ue = 29, Le = 32, Fe = 35, He = 37, Ke = 38, Je = 0, et = 1, tt = {
  area: !0,
  base: !0,
  br: !0,
  col: !0,
  command: !0,
  embed: !0,
  frame: !0,
  hr: !0,
  img: !0,
  input: !0,
  keygen: !0,
  link: !0,
  meta: !0,
  param: !0,
  source: !0,
  track: !0,
  wbr: !0,
  menuitem: !0
}, at = {
  dd: !0,
  li: !0,
  optgroup: !0,
  option: !0,
  p: !0,
  rp: !0,
  rt: !0,
  tbody: !0,
  td: !0,
  tfoot: !0,
  th: !0,
  tr: !0
}, W = {
  dd: { dd: !0, dt: !0 },
  dt: { dd: !0, dt: !0 },
  li: { li: !0 },
  option: { option: !0, optgroup: !0 },
  optgroup: { optgroup: !0 },
  p: {
    address: !0,
    article: !0,
    aside: !0,
    blockquote: !0,
    dir: !0,
    div: !0,
    dl: !0,
    fieldset: !0,
    footer: !0,
    form: !0,
    h1: !0,
    h2: !0,
    h3: !0,
    h4: !0,
    h5: !0,
    h6: !0,
    header: !0,
    hgroup: !0,
    hr: !0,
    menu: !0,
    nav: !0,
    ol: !0,
    p: !0,
    pre: !0,
    section: !0,
    table: !0,
    ul: !0
  },
  rp: { rp: !0, rt: !0 },
  rt: { rp: !0, rt: !0 },
  tbody: { tbody: !0, tfoot: !0 },
  td: { td: !0, th: !0 },
  tfoot: { tbody: !0 },
  th: { td: !0, th: !0 },
  thead: { tbody: !0, tfoot: !0 },
  tr: { tr: !0 }
};
function lt(e) {
  return e == 45 || e == 46 || e == 58 || e >= 65 && e <= 90 || e == 95 || e >= 97 && e <= 122 || e >= 161;
}
let N = null, G = null, I = 0;
function Y(e, a) {
  let r = e.pos + a;
  if (I == r && G == e) return N;
  let l = e.peek(a), t = "";
  for (; lt(l); )
    t += String.fromCharCode(l), l = e.peek(++a);
  return G = e, I = r, N = t ? t.toLowerCase() : l == rt || l == nt ? void 0 : null;
}
const oe = 60, X = 62, E = 47, rt = 63, nt = 33, st = 45;
function j(e, a) {
  this.name = e, this.parent = a;
}
const ot = [R, le, ee, te, ae], it = new he({
  start: null,
  shift(e, a, r, l) {
    return ot.indexOf(a) > -1 ? new j(Y(l, 1) || "", e) : e;
  },
  reduce(e, a) {
    return a == re && e ? e.parent : e;
  },
  reuse(e, a, r, l) {
    let t = a.type.id;
    return t == R || t == He ? new j(Y(l, 1) || "", e) : e;
  },
  strict: !1
}), ut = new $((e, a) => {
  if (e.next != oe) {
    e.next < 0 && a.context && e.acceptToken(_);
    return;
  }
  e.advance();
  let r = e.next == E;
  r && e.advance();
  let l = Y(e, 0);
  if (l === void 0) return;
  if (!l) return e.acceptToken(r ? Ge : Ne);
  let t = a.context ? a.context.name : null;
  if (r) {
    if (l == t) return e.acceptToken(ze);
    if (t && at[t]) return e.acceptToken(_, -2);
    if (a.dialectEnabled(Je)) return e.acceptToken(De);
    for (let s = a.context; s; s = s.parent) if (s.name == l) return;
    e.acceptToken(We);
  } else {
    if (l == "script") return e.acceptToken(ee);
    if (l == "style") return e.acceptToken(te);
    if (l == "textarea") return e.acceptToken(ae);
    if (tt.hasOwnProperty(l)) return e.acceptToken(le);
    t && W[t] && W[t][l] ? e.acceptToken(_, -1) : e.acceptToken(R);
  }
}, { contextual: !0 }), Ot = new $((e) => {
  for (let a = 0, r = 0; ; r++) {
    if (e.next < 0) {
      r && e.acceptToken(D);
      break;
    }
    if (e.next == st)
      a++;
    else if (e.next == X && a >= 2) {
      r >= 3 && e.acceptToken(D, -2);
      break;
    } else
      a = 0;
    e.advance();
  }
});
function dt(e) {
  for (; e; e = e.parent)
    if (e.name == "svg" || e.name == "math") return !0;
  return !1;
}
const ct = new $((e, a) => {
  if (e.next == E && e.peek(1) == X) {
    let r = a.dialectEnabled(et) || dt(a.context);
    e.acceptToken(r ? Be : z, 2);
  } else e.next == X && e.acceptToken(z, 1);
});
function Z(e, a, r) {
  let l = 2 + e.length;
  return new $((t) => {
    for (let s = 0, o = 0, i = 0; ; i++) {
      if (t.next < 0) {
        i && t.acceptToken(a);
        break;
      }
      if (s == 0 && t.next == oe || s == 1 && t.next == E || s >= 2 && s < l && t.next == e.charCodeAt(s - 2))
        s++, o++;
      else if (s == l && t.next == X) {
        i > o ? t.acceptToken(a, -o) : t.acceptToken(r, -(o - 2));
        break;
      } else if ((t.next == 10 || t.next == 13) && i) {
        t.acceptToken(a, 1);
        break;
      } else
        s = o = 0;
      t.advance();
    }
  });
}
const pt = Z("script", Ae, Ye), mt = Z("style", Me, Re), ft = Z("textarea", Ee, Ze), gt = Pe({
  "Text RawText IncompleteTag IncompleteCloseTag": b.content,
  "StartTag StartCloseTag SelfClosingEndTag EndTag": b.angleBracket,
  TagName: b.tagName,
  "MismatchedCloseTag/TagName": [b.tagName, b.invalid],
  AttributeName: b.attributeName,
  "AttributeValue UnquotedAttributeValue": b.attributeValue,
  Is: b.definitionOperator,
  "EntityReference CharacterReference": b.character,
  Comment: b.blockComment,
  ProcessingInst: b.processingInstruction,
  DoctypeDecl: b.documentMeta
}), St = be.deserialize({
  version: 14,
  states: ",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#t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VPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",
  goto: "%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",
  nodeNames: "⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",
  maxTerm: 68,
  context: it,
  nodeProps: [
    ["closedBy", -10, 1, 2, 3, 7, 8, 9, 10, 11, 12, 13, "EndTag", 6, "EndTag SelfClosingEndTag", -4, 22, 31, 34, 37, "CloseTag"],
    ["openedBy", 4, "StartTag StartCloseTag", 5, "StartTag", -4, 30, 33, 36, 38, "OpenTag"],
    ["group", -10, 14, 15, 18, 19, 20, 21, 40, 41, 42, 43, "Entity", 17, "Entity TextContent", -3, 29, 32, 35, "TextContent Entity"],
    ["isolate", -11, 22, 30, 31, 33, 34, 36, 37, 38, 39, 42, 43, "ltr", -3, 27, 28, 40, ""]
  ],
  propSources: [gt],
  skippedNodes: [0],
  repeatNodeCount: 9,
  tokenData: "!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|caPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bXaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UVaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pTaPOv'kw!^'k!_;'S'k;'S;=`(P<%lO'kP(SP;=`<%l'kp([S!dpOv(V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dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",
  tokenizers: [pt, mt, ft, ct, ut, Ot, 0, 1, 2, 3, 4, 5],
  topRules: { Document: [0, 16] },
  dialects: { noMatch: 0, selfClosing: 515 },
  tokenPrec: 517
});
function ie(e, a) {
  let r = /* @__PURE__ */ Object.create(null);
  for (let l of e.getChildren(ne)) {
    let t = l.getChild(je), s = l.getChild(A) || l.getChild(se);
    t && (r[a.read(t.from, t.to)] = s ? s.type.id == A ? a.read(s.from + 1, s.to - 1) : a.read(s.from, s.to) : "");
  }
  return r;
}
function U(e, a) {
  let r = e.getChild(Ie);
  return r ? a.read(r.from, r.to) : " ";
}
function q(e, a, r) {
  let l;
  for (let t of r)
    if (!t.attrs || t.attrs(l || (l = ie(e.node.parent.firstChild, a))))
      return { parser: t.parser, bracketed: !0 };
  return null;
}
function ue(e = [], a = []) {
  let r = [], l = [], t = [], s = [];
  for (let i of e)
    (i.tag == "script" ? r : i.tag == "style" ? l : i.tag == "textarea" ? t : s).push(i);
  let o = a.length ? /* @__PURE__ */ Object.create(null) : null;
  for (let i of a) (o[i.name] || (o[i.name] = [])).push(i);
  return Te((i, u) => {
    let f = i.type.id;
    if (f == Ue) return q(i, u, r);
    if (f == Le) return q(i, u, l);
    if (f == Fe) return q(i, u, t);
    if (f == re && s.length) {
      let p = i.node, d = p.firstChild, m = d && U(d, u), O;
      if (m) {
        for (let c of s)
          if (c.tag == m && (!c.attrs || c.attrs(O || (O = ie(d, u))))) {
            let S = p.lastChild, h = S.type.id == Ke ? S.from : p.to;
            if (h > d.to)
              return { parser: c.parser, overlay: [{ from: d.to, to: h }] };
          }
      }
    }
    if (o && f == ne) {
      let p = i.node, d;
      if (d = p.firstChild) {
        let m = o[u.read(d.from, d.to)];
        if (m) for (let O of m) {
          if (O.tagName && O.tagName != U(p.parent, u)) continue;
          let c = p.lastChild;
          if (c.type.id == A) {
            let S = c.from + 1, h = c.lastChild, T = c.to - (h && h.isError ? 0 : 1);
            if (T > S) return { parser: O.parser, overlay: [{ from: S, to: T }], bracketed: !0 };
          } else if (c.type.id == se)
            return { parser: O.parser, overlay: [{ from: c.from, to: c.to }] };
        }
      }
    }
    return null;
  });
}
const V = ["_blank", "_self", "_top", "_parent"], C = ["ascii", "utf-8", "utf-16", "latin1", "latin1"], k = ["get", "post", "put", "delete"], Q = ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], g = ["true", "false"], n = {}, bt = {
  a: {
    attrs: {
      href: null,
      ping: null,
      type: null,
      media: null,
      target: V,
      hreflang: null
    }
  },
  abbr: n,
  address: n,
  area: {
    attrs: {
      alt: null,
      coords: null,
      href: null,
      target: null,
      ping: null,
      media: null,
      hreflang: null,
      type: null,
      shape: ["default", "rect", "circle", "poly"]
    }
  },
  article: n,
  aside: n,
  audio: {
    attrs: {
      src: null,
      mediagroup: null,
      crossorigin: ["anonymous", "use-credentials"],
      preload: ["none", "metadata", "auto"],
      autoplay: ["autoplay"],
      loop: ["loop"],
      controls: ["controls"]
    }
  },
  b: n,
  base: { attrs: { href: null, target: V } },
  bdi: n,
  bdo: n,
  blockquote: { attrs: { cite: null } },
  body: n,
  br: n,
  button: {
    attrs: {
      form: null,
      formaction: null,
      name: null,
      value: null,
      autofocus: ["autofocus"],
      disabled: ["autofocus"],
      formenctype: Q,
      formmethod: k,
      formnovalidate: ["novalidate"],
      formtarget: V,
      type: ["submit", "reset", "button"]
    }
  },
  canvas: { attrs: { width: null, height: null } },
  caption: n,
  center: n,
  cite: n,
  code: n,
  col: { attrs: { span: null } },
  colgroup: { attrs: { span: null } },
  command: {
    attrs: {
      type: ["command", "checkbox", "radio"],
      label: null,
      icon: null,
      radiogroup: null,
      command: null,
      title: null,
      disabled: ["disabled"],
      checked: ["checked"]
    }
  },
  data: { attrs: { value: null } },
  datagrid: { attrs: { disabled: ["disabled"], multiple: ["multiple"] } },
  datalist: { attrs: { data: null } },
  dd: n,
  del: { attrs: { cite: null, datetime: null } },
  details: { attrs: { open: ["open"] } },
  dfn: n,
  div: n,
  dl: n,
  dt: n,
  em: n,
  embed: { attrs: { src: null, type: null, width: null, height: null } },
  eventsource: { attrs: { src: null } },
  fieldset: { attrs: { disabled: ["disabled"], form: null, name: null } },
  figcaption: n,
  figure: n,
  footer: n,
  form: {
    attrs: {
      action: null,
      name: null,
      "accept-charset": C,
      autocomplete: ["on", "off"],
      enctype: Q,
      method: k,
      novalidate: ["novalidate"],
      target: V
    }
  },
  h1: n,
  h2: n,
  h3: n,
  h4: n,
  h5: n,
  h6: n,
  head: {
    children: ["title", "base", "link", "style", "meta", "script", "noscript", "command"]
  },
  header: n,
  hgroup: n,
  hr: n,
  html: {
    attrs: { manifest: null }
  },
  i: n,
  iframe: {
    attrs: {
      src: null,
      srcdoc: null,
      name: null,
      width: null,
      height: null,
      sandbox: ["allow-top-navigation", "allow-same-origin", "allow-forms", "allow-scripts"],
      seamless: ["seamless"]
    }
  },
  img: {
    attrs: {
      alt: null,
      src: null,
      ismap: null,
      usemap: null,
      width: null,
      height: null,
      crossorigin: ["anonymous", "use-credentials"]
    }
  },
  input: {
    attrs: {
      alt: null,
      dirname: null,
      form: null,
      formaction: null,
      height: null,
      list: null,
      max: null,
      maxlength: null,
      min: null,
      name: null,
      pattern: null,
      placeholder: null,
      size: null,
      src: null,
      step: null,
      value: null,
      width: null,
      accept: ["audio/*", "video/*", "image/*"],
      autocomplete: ["on", "off"],
      autofocus: ["autofocus"],
      checked: ["checked"],
      disabled: ["disabled"],
      formenctype: Q,
      formmethod: k,
      formnovalidate: ["novalidate"],
      formtarget: V,
      multiple: ["multiple"],
      readonly: ["readonly"],
      required: ["required"],
      type: [
        "hidden",
        "text",
        "search",
        "tel",
        "url",
        "email",
        "password",
        "datetime",
        "date",
        "month",
        "week",
        "time",
        "datetime-local",
        "number",
        "range",
        "color",
        "checkbox",
        "radio",
        "file",
        "submit",
        "image",
        "reset",
        "button"
      ]
    }
  },
  ins: { attrs: { cite: null, datetime: null } },
  kbd: n,
  keygen: {
    attrs: {
      challenge: null,
      form: null,
      name: null,
      autofocus: ["autofocus"],
      disabled: ["disabled"],
      keytype: ["RSA"]
    }
  },
  label: { attrs: { for: null, form: null } },
  legend: n,
  li: { attrs: { value: null } },
  link: {
    attrs: {
      href: null,
      type: null,
      hreflang: null,
      media: null,
      sizes: ["all", "16x16", "16x16 32x32", "16x16 32x32 64x64"]
    }
  },
  map: { attrs: { name: null } },
  mark: n,
  menu: { attrs: { label: null, type: ["list", "context", "toolbar"] } },
  meta: {
    attrs: {
      content: null,
      charset: C,
      name: ["viewport", "application-name", "author", "description", "generator", "keywords"],
      "http-equiv": ["content-language", "content-type", "default-style", "refresh"]
    }
  },
  meter: { attrs: { value: null, min: null, low: null, high: null, max: null, optimum: null } },
  nav: n,
  noscript: n,
  object: {
    attrs: {
      data: null,
      type: null,
      name: null,
      usemap: null,
      form: null,
      width: null,
      height: null,
      typemustmatch: ["typemustmatch"]
    }
  },
  ol: {
    attrs: { reversed: ["reversed"], start: null, type: ["1", "a", "A", "i", "I"] },
    children: ["li", "script", "template", "ul", "ol"]
  },
  optgroup: { attrs: { disabled: ["disabled"], label: null } },
  option: { attrs: { disabled: ["disabled"], label: null, selected: ["selected"], value: null } },
  output: { attrs: { for: null, form: null, name: null } },
  p: n,
  param: { attrs: { name: null, value: null } },
  pre: n,
  progress: { attrs: { value: null, max: null } },
  q: { attrs: { cite: null } },
  rp: n,
  rt: n,
  ruby: n,
  samp: n,
  script: {
    attrs: {
      type: ["text/javascript"],
      src: null,
      async: ["async"],
      defer: ["defer"],
      charset: C
    }
  },
  section: n,
  select: {
    attrs: {
      form: null,
      name: null,
      size: null,
      autofocus: ["autofocus"],
      disabled: ["disabled"],
      multiple: ["multiple"]
    }
  },
  slot: { attrs: { name: null } },
  small: n,
  source: { attrs: { src: null, type: null, media: null } },
  span: n,
  strong: n,
  style: {
    attrs: {
      type: ["text/css"],
      media: null,
      scoped: null
    }
  },
  sub: n,
  summary: n,
  sup: n,
  table: n,
  tbody: n,
  td: { attrs: { colspan: null, rowspan: null, headers: null } },
  template: n,
  textarea: {
    attrs: {
      dirname: null,
      form: null,
      maxlength: null,
      name: null,
      placeholder: null,
      rows: null,
      cols: null,
      autofocus: ["autofocus"],
      disabled: ["disabled"],
      readonly: ["readonly"],
      required: ["required"],
      wrap: ["soft", "hard"]
    }
  },
  tfoot: n,
  th: { attrs: { colspan: null, rowspan: null, headers: null, scope: ["row", "col", "rowgroup", "colgroup"] } },
  thead: n,
  time: { attrs: { datetime: null } },
  title: n,
  tr: n,
  track: {
    attrs: {
      src: null,
      label: null,
      default: null,
      kind: ["subtitles", "captions", "descriptions", "chapters", "metadata"],
      srclang: null
    }
  },
  ul: { children: ["li", "script", "template", "ul", "ol"] },
  var: n,
  video: {
    attrs: {
      src: null,
      poster: null,
      width: null,
      height: null,
      crossorigin: ["anonymous", "use-credentials"],
      preload: ["auto", "metadata", "none"],
      autoplay: ["autoplay"],
      mediagroup: ["movie"],
      muted: ["muted"],
      controls: ["controls"]
    }
  },
  wbr: n
}, Oe = {
  accesskey: null,
  class: null,
  contenteditable: g,
  contextmenu: null,
  dir: ["ltr", "rtl", "auto"],
  draggable: ["true", "false", "auto"],
  dropzone: ["copy", "move", "link", "string:", "file:"],
  hidden: ["hidden"],
  id: null,
  inert: ["inert"],
  itemid: null,
  itemprop: null,
  itemref: null,
  itemscope: ["itemscope"],
  itemtype: null,
  lang: ["ar", "bn", "de", "en-GB", "en-US", "es", "fr", "hi", "id", "ja", "pa", "pt", "ru", "tr", "zh"],
  spellcheck: g,
  autocorrect: g,
  autocapitalize: g,
  style: null,
  tabindex: null,
  title: null,
  translate: ["yes", "no"],
  rel: ["stylesheet", "alternate", "author", "bookmark", "help", "license", "next", "nofollow", "noreferrer", "prefetch", "prev", "search", "tag"],
  role: /* @__PURE__ */ "alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),
  "aria-activedescendant": null,
  "aria-atomic": g,
  "aria-autocomplete": ["inline", "list", "both", "none"],
  "aria-busy": g,
  "aria-checked": ["true", "false", "mixed", "undefined"],
  "aria-controls": null,
  "aria-describedby": null,
  "aria-disabled": g,
  "aria-dropeffect": null,
  "aria-expanded": ["true", "false", "undefined"],
  "aria-flowto": null,
  "aria-grabbed": ["true", "false", "undefined"],
  "aria-haspopup": g,
  "aria-hidden": g,
  "aria-invalid": ["true", "false", "grammar", "spelling"],
  "aria-label": null,
  "aria-labelledby": null,
  "aria-level": null,
  "aria-live": ["off", "polite", "assertive"],
  "aria-multiline": g,
  "aria-multiselectable": g,
  "aria-owns": null,
  "aria-posinset": null,
  "aria-pressed": ["true", "false", "mixed", "undefined"],
  "aria-readonly": g,
  "aria-relevant": null,
  "aria-required": g,
  "aria-selected": ["true", "false", "undefined"],
  "aria-setsize": null,
  "aria-sort": ["ascending", "descending", "none", "other"],
  "aria-valuemax": null,
  "aria-valuemin": null,
  "aria-valuenow": null,
  "aria-valuetext": null
}, de = /* @__PURE__ */ "beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map((e) => "on" + e);
for (let e of de)
  Oe[e] = null;
class y {
  constructor(a, r) {
    this.tags = { ...bt, ...a }, this.globalAttrs = { ...Oe, ...r }, this.allTags = Object.keys(this.tags), this.globalAttrNames = Object.keys(this.globalAttrs);
  }
}
y.default = /* @__PURE__ */ new y();
function P(e, a, r = e.length) {
  if (!a)
    return "";
  let l = a.firstChild, t = l && l.getChild("TagName");
  return t ? e.sliceString(t.from, Math.min(t.to, r)) : "";
}
function x(e, a = !1) {
  for (; e; e = e.parent)
    if (e.name == "Element")
      if (a)
        a = !1;
      else
        return e;
  return null;
}
function ce(e, a, r) {
  let l = r.tags[P(e, x(a))];
  return (l == null ? void 0 : l.children) || r.allTags;
}
function B(e, a) {
  let r = [];
  for (let l = x(a); l && !l.type.isTop; l = x(l.parent)) {
    let t = P(e, l);
    if (t && l.lastChild.name == "CloseTag")
      break;
    t && r.indexOf(t) < 0 && (a.name == "EndTag" || a.from >= l.firstChild.to) && r.push(t);
  }
  return r;
}
const pe = /^[:\-\.\w\u00b7-\uffff]*$/;
function L(e, a, r, l, t) {
  let s = /\s*>/.test(e.sliceDoc(t, t + 5)) ? "" : ">", o = x(r, r.name == "StartTag" || r.name == "TagName");
  return {
    from: l,
    to: t,
    options: ce(e.doc, o, a).map((i) => ({ label: i, type: "type" })).concat(B(e.doc, r).map((i, u) => ({
      label: "/" + i,
      apply: "/" + i + s,
      type: "type",
      boost: 99 - u
    }))),
    validFor: /^\/?[:\-\.\w\u00b7-\uffff]*$/
  };
}
function F(e, a, r, l) {
  let t = /\s*>/.test(e.sliceDoc(l, l + 5)) ? "" : ">";
  return {
    from: r,
    to: l,
    options: B(e.doc, a).map((s, o) => ({ label: s, apply: s + t, type: "type", boost: 99 - o })),
    validFor: pe
  };
}
function ht(e, a, r, l) {
  let t = [], s = 0;
  for (let o of ce(e.doc, r, a))
    t.push({ label: "<" + o, type: "type" });
  for (let o of B(e.doc, r))
    t.push({ label: "</" + o + ">", type: "type", boost: 99 - s++ });
  return { from: l, to: l, options: t, validFor: /^<\/?[:\-\.\w\u00b7-\uffff]*$/ };
}
function Tt(e, a, r, l, t) {
  let s = x(r), o = s ? a.tags[P(e.doc, s)] : null, i = o && o.attrs ? Object.keys(o.attrs) : [], u = o && o.globalAttrs === !1 ? i : i.length ? i.concat(a.globalAttrNames) : a.globalAttrNames;
  return {
    from: l,
    to: t,
    options: u.map((f) => ({ label: f, type: "property" })),
    validFor: pe
  };
}
function Pt(e, a, r, l, t) {
  var s;
  let o = (s = r.parent) === null || s === void 0 ? void 0 : s.getChild("AttributeName"), i = [], u;
  if (o) {
    let f = e.sliceDoc(o.from, o.to), p = a.globalAttrs[f];
    if (!p) {
      let d = x(r), m = d ? a.tags[P(e.doc, d)] : null;
      p = (m == null ? void 0 : m.attrs) && m.attrs[f];
    }
    if (p) {
      let d = e.sliceDoc(l, t).toLowerCase(), m = '"', O = '"';
      /^['"]/.test(d) ? (u = d[0] == '"' ? /^[^"]*$/ : /^[^']*$/, m = "", O = e.sliceDoc(t, t + 1) == d[0] ? "" : d[0], d = d.slice(1), l++) : u = /^[^\s<>='"]*$/;
      for (let c of p)
        i.push({ label: c, apply: m + c + O, type: "constant" });
    }
  }
  return { from: l, to: t, options: i, validFor: u };
}
function me(e, a) {
  let { state: r, pos: l } = a, t = K(r).resolveInner(l, -1), s = t.resolve(l);
  for (let o = l, i; s == t && (i = t.childBefore(o)); ) {
    let u = i.lastChild;
    if (!u || !u.type.isError || u.from < u.to)
      break;
    s = t = i, o = u.from;
  }
  return t.name == "TagName" ? t.parent && /CloseTag$/.test(t.parent.name) ? F(r, t, t.from, l) : L(r, e, t, t.from, l) : t.name == "StartTag" || t.name == "IncompleteTag" ? L(r, e, t, l, l) : t.name == "StartCloseTag" || t.name == "IncompleteCloseTag" ? F(r, t, l, l) : t.name == "OpenTag" || t.name == "SelfClosingTag" || t.name == "AttributeName" ? Tt(r, e, t, t.name == "AttributeName" ? t.from : l, l) : t.name == "Is" || t.name == "AttributeValue" || t.name == "UnquotedAttributeValue" ? Pt(r, e, t, t.name == "Is" ? l : t.from, l) : a.explicit && (s.name == "Element" || s.name == "Text" || s.name == "Document") ? ht(r, e, t, l) : null;
}
function _t(e) {
  return me(y.default, e);
}
function xt(e) {
  let { extraTags: a, extraGlobalAttributes: r } = e, l = r || a ? new y(a, r) : y.default;
  return (t) => me(l, t);
}
const Vt = /* @__PURE__ */ M.parser.configure({ top: "SingleExpression" }), fe = [
  {
    tag: "script",
    attrs: (e) => e.type == "text/typescript" || e.lang == "ts",
    parser: qe.parser
  },
  {
    tag: "script",
    attrs: (e) => e.type == "text/babel" || e.type == "text/jsx",
    parser: Ce.parser
  },
  {
    tag: "script",
    attrs: (e) => e.type == "text/typescript-jsx",
    parser: ke.parser
  },
  {
    tag: "script",
    attrs(e) {
      return /^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type);
    },
    parser: Vt
  },
  {
    tag: "script",
    attrs(e) {
      return !e.type || /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type);
    },
    parser: M.parser
  },
  {
    tag: "style",
    attrs(e) {
      return (!e.lang || e.lang == "css") && (!e.type || /^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type));
    },
    parser: J.parser
  }
], ge = /* @__PURE__ */ [
  {
    name: "style",
    parser: /* @__PURE__ */ J.parser.configure({ top: "Styles" })
  }
].concat(/* @__PURE__ */ de.map((e) => ({ name: e, parser: M.parser }))), Se = /* @__PURE__ */ we.define({
  name: "html",
  parser: /* @__PURE__ */ St.configure({
    props: [
      /* @__PURE__ */ ve.add({
        Element(e) {
          let a = /^(\s*)(<\/)?/.exec(e.textAfter);
          return e.node.to <= e.pos + a[0].length ? e.continue() : e.lineIndent(e.node.from) + (a[2] ? 0 : e.unit);
        },
        "OpenTag CloseTag SelfClosingTag"(e) {
          return e.column(e.node.from) + e.unit;
        },
        Document(e) {
          if (e.pos + /\s*/.exec(e.textAfter)[0].length < e.node.to)
            return e.continue();
          let a = null, r;
          for (let l = e.node; ; ) {
            let t = l.lastChild;
            if (!t || t.name != "Element" || t.to != l.to)
              break;
            a = l = t;
          }
          return a && !((r = a.lastChild) && (r.name == "CloseTag" || r.name == "SelfClosingTag")) ? e.lineIndent(a.from) + e.unit : null;
        }
      }),
      /* @__PURE__ */ Xe.add({
        Element(e) {
          let a = e.firstChild, r = e.lastChild;
          return !a || a.name != "OpenTag" ? null : { from: a.to, to: r.name == "CloseTag" ? r.from : e.to };
        }
      }),
      /* @__PURE__ */ $e.add({
        "OpenTag CloseTag": (e) => e.getChild("TagName")
      })
    ]
  }),
  languageData: {
    commentTokens: { block: { open: "<!--", close: "-->" } },
    indentOnInput: /^\s*<\/\w+\W$/,
    wordChars: "-_"
  }
}), v = /* @__PURE__ */ Se.configure({
  wrap: /* @__PURE__ */ ue(fe, ge)
});
function qt(e = {}) {
  let a = "", r;
  e.matchClosingTags === !1 && (a = "noMatch"), e.selfClosingTags === !0 && (a = (a ? a + " " : "") + "selfClosing"), (e.nestedLanguages && e.nestedLanguages.length || e.nestedAttributes && e.nestedAttributes.length) && (r = ue((e.nestedLanguages || []).concat(fe), (e.nestedAttributes || []).concat(ge)));
  let l = r ? Se.configure({ wrap: r, dialect: a }) : a ? v.configure({ dialect: a }) : v;
  return new ye(l, [
    v.data.of({ autocomplete: xt(e) }),
    e.autoCloseTags !== !1 ? yt : [],
    Qe().support,
    _e().support
  ]);
}
const H = /* @__PURE__ */ new Set(/* @__PURE__ */ "area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")), yt = /* @__PURE__ */ xe.inputHandler.of((e, a, r, l, t) => {
  if (e.composing || e.state.readOnly || a != r || l != ">" && l != "/" || !v.isActiveAt(e.state, a, -1))
    return !1;
  let s = t(), { state: o } = s, i = o.changeByRange((u) => {
    var f, p, d;
    let m = o.doc.sliceString(u.from - 1, u.to) == l, { head: O } = u, c = K(o).resolveInner(O, -1), S;
    if (m && l == ">" && c.name == "EndTag") {
      let h = c.parent;
      if (((p = (f = h.parent) === null || f === void 0 ? void 0 : f.lastChild) === null || p === void 0 ? void 0 : p.name) != "CloseTag" && (S = P(o.doc, h.parent, O)) && !H.has(S)) {
        let T = O + (o.doc.sliceString(O, O + 1) === ">" ? 1 : 0), w = `</${S}>`;
        return { range: u, changes: { from: O, to: T, insert: w } };
      }
    } else if (m && l == "/" && c.name == "IncompleteCloseTag") {
      let h = c.parent;
      if (c.from == O - 2 && ((d = h.lastChild) === null || d === void 0 ? void 0 : d.name) != "CloseTag" && (S = P(o.doc, h, O)) && !H.has(S)) {
        let T = O + (o.doc.sliceString(O, O + 1) === ">" ? 1 : 0), w = `${S}>`;
        return {
          range: Ve.cursor(O + w.length, -1),
          changes: { from: O, to: T, insert: w }
        };
      }
    }
    return { range: u };
  });
  return i.changes.empty ? !1 : (e.dispatch([
    s,
    o.update(i, {
      userEvent: "input.complete",
      scrollIntoView: !0
    })
  ]), !0);
});
export {
  yt as autoCloseTags,
  qt as html,
  _t as htmlCompletionSource,
  xt as htmlCompletionSourceWith,
  v as htmlLanguage
};
//# sourceMappingURL=index-CLPh8fCN.js.map
