import{t}from"./preload-helper-DxVatP6Z.js";import{i as a,r}from"./c25d902c2-Dbv6uExJ.js";import{d as o}from"./c3880bcbc-D5xW2M9A.js";import{b as e,s as i}from"./c255cf682-BhczLtlf.js";import{a as d,i as s,s as n}from"./c472a69b6-D3U45Mzs.js";import{a as l,i as p,n as g,r as c}from"./c06543958-T11R8DH1.js";var m={common:i,getConfig:e,insertCluster:s,insertEdge:g,insertEdgeLabel:c,insertMarkers:p,insertNode:d,interpolateToCurve:o,labelHelper:n,log:a,positionEdgeLabel:l},f={},h=r(t=>{for(const a of t)f[a.name]=a},"registerLayoutLoaders");r(()=>{h([{name:"dagre",loader:r(async()=>await t(()=>import("./c33a6dd95-DVI9_Txz.js"),[]),"loader")},{name:"cose-bilkent",loader:r(async()=>await t(()=>import("./c6ea7803c-CZoCeoZJ.js"),[]),"loader")}])},"registerDefaultLayoutLoaders")();var y=r(async(t,a)=>{if(!(t.layoutAlgorithm in f))throw new Error(`Unknown layout algorithm: ${t.layoutAlgorithm}`);if(t.diagramId)for(const p of t.nodes){const a=p.domId||p.id;p.domId=`${t.diagramId}-${a}`}const r=f[t.layoutAlgorithm],o=await r.loader(),{theme:e,themeVariables:i}=t.config,{useGradient:d,gradientStart:s,gradientStop:n}=i,l=a.attr("id");if(a.append("defs").append("filter").attr("id",`${l}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",""+(e?.includes("dark")?"#FFFFFF":"#000000")),a.append("defs").append("filter").attr("id",`${l}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",""+(e?.includes("dark")?"#FFFFFF":"#000000")),d){const t=a.append("linearGradient").attr("id",a.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");t.append("svg:stop").attr("offset","0%").attr("stop-color",s).attr("stop-opacity",1),t.append("svg:stop").attr("offset","100%").attr("stop-color",n).attr("stop-opacity",1)}return o.render(t,a,m,{algorithm:r.algorithm})},"render"),u=r((t="",{fallback:r="dagre"}={})=>{if(t in f)return t;if(r in f)return a.warn(`Layout algorithm ${t} is not registered. Using ${r} as fallback.`),r;throw new Error(`Both layout algorithms ${t} and ${r} are not registered.`)},"getRegisteredLayoutAlgorithm");export{h as n,y as r,u as t};