import{f as t}from"./chunk-FXACKDTF.mjs";import{a as n}from"./chunk-VELTKBKT.mjs";var i={},m={info:t(async()=>{let{createInfoServices:e}=await import("./info-OMHHGYJF-BF2H5H6G.mjs"),r=e().Info.parser.LangiumParser;i.info=r},"info"),packet:t(async()=>{let{createPacketServices:e}=await import("./packet-4T2RLAQJ-EV4IVRXR.mjs"),r=e().Packet.parser.LangiumParser;i.packet=r},"packet"),pie:t(async()=>{let{createPieServices:e}=await import("./pie-ZZUOXDRM-N23DN5KN.mjs"),r=e().Pie.parser.LangiumParser;i.pie=r},"pie"),treeView:t(async()=>{let{createTreeViewServices:e}=await import("./treeView-SZITEDCU-5DXDK3XO.mjs"),r=e().TreeView.parser.LangiumParser;i.treeView=r},"treeView"),architecture:t(async()=>{let{createArchitectureServices:e}=await import("./architecture-YZFGNWBL-S5CXDPWN.mjs"),r=e().Architecture.parser.LangiumParser;i.architecture=r},"architecture"),gitGraph:t(async()=>{let{createGitGraphServices:e}=await import("./gitGraph-7Q5UKJZL-54BCDZD5.mjs"),r=e().GitGraph.parser.LangiumParser;i.gitGraph=r},"gitGraph"),radar:t(async()=>{let{createRadarServices:e}=await import("./radar-PYXPWWZC-P6TP7ZYP.mjs"),r=e().Radar.parser.LangiumParser;i.radar=r},"radar"),treemap:t(async()=>{let{createTreemapServices:e}=await import("./treemap-W4RFUUIX-WYLRDWKO.mjs"),r=e().Treemap.parser.LangiumParser;i.treemap=r},"treemap"),wardley:t(async()=>{let{createWardleyServices:e}=await import("./wardley-RL74JXVD-BCRCBASE.mjs"),r=e().Wardley.parser.LangiumParser;i.wardley=r},"wardley")};async function d(e,r){let o=m[e];if(!o)throw new Error(`Unknown diagram type: ${e}`);i[e]||await o();let s=i[e].parse(r);if(s.lexerErrors.length>0||s.parserErrors.length>0)throw new p(s);return s.value}n(d,"parse");t(d,"parse");var p=class extends Error{static{n(this,"MermaidParseError")}constructor(e){let r=e.lexerErrors.map(a=>{let s=a.line!==void 0&&!isNaN(a.line)?a.line:"?",c=a.column!==void 0&&!isNaN(a.column)?a.column:"?";return`Lexer error on line ${s}, column ${c}: ${a.message}`}).join(`
`),o=e.parserErrors.map(a=>{let s=a.token.startLine!==void 0&&!isNaN(a.token.startLine)?a.token.startLine:"?",c=a.token.startColumn!==void 0&&!isNaN(a.token.startColumn)?a.token.startColumn:"?";return`Parse error on line ${s}, column ${c}: ${a.message}`}).join(`
`);super(`Parsing failed: ${r} ${o}`),this.result=e}static{t(this,"MermaidParseError")}};export{d as a};
