import { GitGraphModule as l, createGitGraphServices as P } from "./chunks/mermaid-parser.core/chunk-S6J4BHB3.js";
import { InfoModule as G, createInfoServices as f } from "./chunks/mermaid-parser.core/chunk-LBM3YZW2.js";
import { PacketModule as M, createPacketServices as k } from "./chunks/mermaid-parser.core/chunk-76Q3JFCE.js";
import { PieModule as w, createPieServices as x } from "./chunks/mermaid-parser.core/chunk-T53DSG4Q.js";
import { ArchitectureModule as E, createArchitectureServices as I } from "./chunks/mermaid-parser.core/chunk-O7ZBX7Z2.js";
import { RadarModule as R, createRadarServices as y } from "./chunks/mermaid-parser.core/chunk-LHMN2FUI.js";
import { TreemapModule as B, createTreemapServices as C } from "./chunks/mermaid-parser.core/chunk-FWNWRKHM.js";
import { __name as a } from "./chunks/mermaid-parser.core/chunk-FPAJGGOC.js";
import { AbstractMermaidTokenBuilder as b, AbstractMermaidValueConverter as j, Architecture as z, ArchitectureGeneratedModule as V, Branch as _, Commit as U, CommonValueConverter as q, GitGraph as D, GitGraphGeneratedModule as F, Info as H, InfoGeneratedModule as J, Merge as K, MermaidGeneratedSharedModule as N, Packet as O, PacketBlock as Q, PacketGeneratedModule as W, Pie as X, PieGeneratedModule as Y, PieSection as Z, Radar as ee, RadarGeneratedModule as re, Statement as ae, Treemap as te, TreemapGeneratedModule as ie, isArchitecture as ce, isBranch as se, isCommit as oe, isGitGraph as ne, isInfo as pe, isMerge as me, isPacket as ue, isPacketBlock as de, isPie as he, isPieSection as le, isTreemap as Pe } from "./chunks/mermaid-parser.core/chunk-FPAJGGOC.js";
var t = {}, n = {
  info: /* @__PURE__ */ a(async () => {
    const { createInfoServices: r } = await import("./chunks/mermaid-parser.core/info-NVLQJR56.js"), e = r().Info.parser.LangiumParser;
    t.info = e;
  }, "info"),
  packet: /* @__PURE__ */ a(async () => {
    const { createPacketServices: r } = await import("./chunks/mermaid-parser.core/packet-BFZMPI3H.js"), e = r().Packet.parser.LangiumParser;
    t.packet = e;
  }, "packet"),
  pie: /* @__PURE__ */ a(async () => {
    const { createPieServices: r } = await import("./chunks/mermaid-parser.core/pie-7BOR55EZ.js"), e = r().Pie.parser.LangiumParser;
    t.pie = e;
  }, "pie"),
  architecture: /* @__PURE__ */ a(async () => {
    const { createArchitectureServices: r } = await import("./chunks/mermaid-parser.core/architecture-U656AL7Q.js"), e = r().Architecture.parser.LangiumParser;
    t.architecture = e;
  }, "architecture"),
  gitGraph: /* @__PURE__ */ a(async () => {
    const { createGitGraphServices: r } = await import("./chunks/mermaid-parser.core/gitGraph-F6HP7TQM.js"), e = r().GitGraph.parser.LangiumParser;
    t.gitGraph = e;
  }, "gitGraph"),
  radar: /* @__PURE__ */ a(async () => {
    const { createRadarServices: r } = await import("./chunks/mermaid-parser.core/radar-NHE76QYJ.js"), e = r().Radar.parser.LangiumParser;
    t.radar = e;
  }, "radar"),
  treemap: /* @__PURE__ */ a(async () => {
    const { createTreemapServices: r } = await import("./chunks/mermaid-parser.core/treemap-KMMF4GRG.js"), e = r().Treemap.parser.LangiumParser;
    t.treemap = e;
  }, "treemap")
};
async function p(r, e) {
  const s = n[r];
  if (!s)
    throw new Error(`Unknown diagram type: ${r}`);
  t[r] || await s();
  const i = t[r].parse(e);
  if (i.lexerErrors.length > 0 || i.parserErrors.length > 0)
    throw new m(i);
  return i.value;
}
a(p, "parse");
var c, m = (c = class extends Error {
  constructor(e) {
    const s = e.lexerErrors.map((i) => i.message).join(`
`), o = e.parserErrors.map((i) => i.message).join(`
`);
    super(`Parsing failed: ${s} ${o}`), this.result = e;
  }
}, a(c, "MermaidParseError"), c);
export {
  b as AbstractMermaidTokenBuilder,
  j as AbstractMermaidValueConverter,
  z as Architecture,
  V as ArchitectureGeneratedModule,
  E as ArchitectureModule,
  _ as Branch,
  U as Commit,
  q as CommonValueConverter,
  D as GitGraph,
  F as GitGraphGeneratedModule,
  l as GitGraphModule,
  H as Info,
  J as InfoGeneratedModule,
  G as InfoModule,
  K as Merge,
  N as MermaidGeneratedSharedModule,
  m as MermaidParseError,
  O as Packet,
  Q as PacketBlock,
  W as PacketGeneratedModule,
  M as PacketModule,
  X as Pie,
  Y as PieGeneratedModule,
  w as PieModule,
  Z as PieSection,
  ee as Radar,
  re as RadarGeneratedModule,
  R as RadarModule,
  ae as Statement,
  te as Treemap,
  ie as TreemapGeneratedModule,
  B as TreemapModule,
  I as createArchitectureServices,
  P as createGitGraphServices,
  f as createInfoServices,
  k as createPacketServices,
  x as createPieServices,
  y as createRadarServices,
  C as createTreemapServices,
  ce as isArchitecture,
  se as isBranch,
  oe as isCommit,
  ne as isGitGraph,
  pe as isInfo,
  me as isMerge,
  ue as isPacket,
  de as isPacketBlock,
  he as isPie,
  le as isPieSection,
  Pe as isTreemap,
  p as parse
};
