import{a}from"./chunk-F4FWBINX.js";var i={},c={info:a(async()=>{let{createInfoServices:e}=await import("./info-A6RAGUB7-K2JNFWHY.js"),r=e().Info.parser.LangiumParser;i.info=r},"info"),packet:a(async()=>{let{createPacketServices:e}=await import("./packet-AYTQ26CC-2JN3KOTW.js"),r=e().Packet.parser.LangiumParser;i.packet=r},"packet"),pie:a(async()=>{let{createPieServices:e}=await import("./pie-WAS4IAKB-BBVIWTWD.js"),r=e().Pie.parser.LangiumParser;i.pie=r},"pie"),treeView:a(async()=>{let{createTreeViewServices:e}=await import("./treeView-Q6P3EWNA-OTW4ZXEN.js"),r=e().TreeView.parser.LangiumParser;i.treeView=r},"treeView"),architecture:a(async()=>{let{createArchitectureServices:e}=await import("./architecture-7GRP2DOG-OTRZJKO2.js"),r=e().Architecture.parser.LangiumParser;i.architecture=r},"architecture"),gitGraph:a(async()=>{let{createGitGraphServices:e}=await import("./gitGraph-4MIJSDKK-4NE5QTBK.js"),r=e().GitGraph.parser.LangiumParser;i.gitGraph=r},"gitGraph"),eventmodeling:a(async()=>{let{createEventModelingServices:e}=await import("./eventmodeling-NTZA5JFV-3IXSFWPX.js"),r=e().EventModel.parser.LangiumParser;i.eventmodeling=r},"eventmodeling"),radar:a(async()=>{let{createRadarServices:e}=await import("./radar-RG4KPBEZ-2JSDCGBA.js"),r=e().Radar.parser.LangiumParser;i.radar=r},"radar"),railroad:a(async()=>{let{createRailroadServices:e}=await import("./railroad-74A4TZTK-LQXKPZ77.js"),r=e().Railroad.parser.LangiumParser;i.railroad=r},"railroad"),railroadEbnf:a(async()=>{let{createRailroadEbnfServices:e}=await import("./railroad-ebnf-LZEXJU2U-YIL7ZWAZ.js"),r=e().RailroadEbnf.parser.LangiumParser;i.railroadEbnf=r},"railroadEbnf"),railroadAbnf:a(async()=>{let{createRailroadAbnfServices:e}=await import("./railroad-abnf-HS5TGJTU-363RGDZ3.js"),r=e().RailroadAbnf.parser.LangiumParser;i.railroadAbnf=r},"railroadAbnf"),railroadPeg:a(async()=>{let{createRailroadPegServices:e}=await import("./railroad-peg-WCYAUIDC-FSQWM5NK.js"),r=e().RailroadPeg.parser.LangiumParser;i.railroadPeg=r},"railroadPeg"),treemap:a(async()=>{let{createTreemapServices:e}=await import("./treemap-WGGIJYW6-2LQ3I3MV.js"),r=e().Treemap.parser.LangiumParser;i.treemap=r},"treemap"),wardley:a(async()=>{let{createWardleyServices:e}=await import("./wardley-WFR3VGLG-UHPDDCRJ.js"),r=e().Wardley.parser.LangiumParser;i.wardley=r},"wardley"),cynefin:a(async()=>{let{createCynefinServices:e}=await import("./cynefin-OW5HDTMX-GPZ44VGM.js"),r=e().Cynefin.parser.LangiumParser;i.cynefin=r},"cynefin")};async function d(e,r){let n=c[e];if(!n)throw new Error(`Unknown diagram type: ${e}`);i[e]||await n();let t=i[e].parse(r);if(t.lexerErrors.length>0||t.parserErrors.length>0)throw new l(t);return t.value}a(d,"parse");var l=class extends Error{constructor(e){let r=e.lexerErrors.map(o=>{let t=o.line!==void 0&&!isNaN(o.line)?o.line:"?",s=o.column!==void 0&&!isNaN(o.column)?o.column:"?";return`Lexer error on line ${t}, column ${s}: ${o.message}`}).join(`
`),n=e.parserErrors.map(o=>{let t=o.token.startLine!==void 0&&!isNaN(o.token.startLine)?o.token.startLine:"?",s=o.token.startColumn!==void 0&&!isNaN(o.token.startColumn)?o.token.startColumn:"?";return`Parse error on line ${t}, column ${s}: ${o.message}`}).join(`
`);super(`Parsing failed: ${r} ${n}`),this.result=e}static{a(this,"MermaidParseError")}};export{d as a,l as b};
