import{a as t}from"/vendor/chunk-BEN46RUL.js";var i={},c={info:t(async()=>{let{createInfoServices:e}=await import("/vendor/chunk-PV7NKEMN.js"),r=e().Info.parser.LangiumParser;i.info=r},"info"),packet:t(async()=>{let{createPacketServices:e}=await import("/vendor/chunk-MOBNOEFS.js"),r=e().Packet.parser.LangiumParser;i.packet=r},"packet"),pie:t(async()=>{let{createPieServices:e}=await import("/vendor/chunk-YF7W6LNR.js"),r=e().Pie.parser.LangiumParser;i.pie=r},"pie"),treeView:t(async()=>{let{createTreeViewServices:e}=await import("/vendor/chunk-TI3C7E6C.js"),r=e().TreeView.parser.LangiumParser;i.treeView=r},"treeView"),architecture:t(async()=>{let{createArchitectureServices:e}=await import("/vendor/chunk-5XT4DC5Y.js"),r=e().Architecture.parser.LangiumParser;i.architecture=r},"architecture"),gitGraph:t(async()=>{let{createGitGraphServices:e}=await import("/vendor/chunk-33ZAVIGH.js"),r=e().GitGraph.parser.LangiumParser;i.gitGraph=r},"gitGraph"),eventmodeling:t(async()=>{let{createEventModelingServices:e}=await import("/vendor/chunk-QHYUZMME.js"),r=e().EventModel.parser.LangiumParser;i.eventmodeling=r},"eventmodeling"),radar:t(async()=>{let{createRadarServices:e}=await import("/vendor/chunk-CCKMF2CO.js"),r=e().Radar.parser.LangiumParser;i.radar=r},"radar"),treemap:t(async()=>{let{createTreemapServices:e}=await import("/vendor/chunk-G3TKJJLC.js"),r=e().Treemap.parser.LangiumParser;i.treemap=r},"treemap"),wardley:t(async()=>{let{createWardleyServices:e}=await import("/vendor/chunk-XDNI6GSH.js"),r=e().Wardley.parser.LangiumParser;i.wardley=r},"wardley")};async function m(e,r){let s=c[e];if(!s)throw new Error(`Unknown diagram type: ${e}`);i[e]||await s();let o=i[e].parse(r);if(o.lexerErrors.length>0||o.parserErrors.length>0)throw new d(o);return o.value}t(m,"parse");var d=class extends Error{constructor(e){let r=e.lexerErrors.map(a=>{let o=a.line!==void 0&&!isNaN(a.line)?a.line:"?",n=a.column!==void 0&&!isNaN(a.column)?a.column:"?";return`Lexer error on line ${o}, column ${n}: ${a.message}`}).join(`
`),s=e.parserErrors.map(a=>{let o=a.token.startLine!==void 0&&!isNaN(a.token.startLine)?a.token.startLine:"?",n=a.token.startColumn!==void 0&&!isNaN(a.token.startColumn)?a.token.startColumn:"?";return`Parse error on line ${o}, column ${n}: ${a.message}`}).join(`
`);super(`Parsing failed: ${r} ${s}`),this.result=e}static{t(this,"MermaidParseError")}};export{m as a};
