import{_ as s,q as y,b as k,s as x,t as C,g as T,a as _,H as w,l as f,L as B,e as I,F as D,I as S,A as V}from"./mermaid.core-BMua9uWp.js";import{p as E}from"./chunk-4BX2VUAB-D2OCPNfC.js";import{I as N}from"./chunk-QZHKN3VN-CtaFri1-.js";import{p as A}from"./wardley-RL74JXVD-B19Iaomu.js";import"./preload-helper-DLdknYSj.js";import"./misc-BNcbB3dR.js";import"./jsx-runtime-hUI6LOBV.js";import"./index-CFdT0RIo.js";import"./chunk-EVOBXE3Y-Bmgys8-c.js";import"./min-BtgwXF5n.js";import"./_baseUniq-C0JF2TKV.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"66e9b849450b819e11683314a547a341cb57f7d0"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7bc9b428-b77e-458e-b41c-338a52298633",e._sentryDebugIdIdentifier="sentry-dbid-7bc9b428-b77e-458e-b41c-338a52298633")}catch{}})();var l=new N(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",children:[]}]})),L=s(()=>{l.reset(),V()},"clear"),R=s(()=>l.records.stack[0],"getRoot"),$=s(()=>l.records.cnt,"getCount"),H=S.treeView,X=s(()=>w(H,D().treeView),"getConfig"),z=s((e,t)=>{for(;e<=l.records.stack[l.records.stack.length-1].level;)l.records.stack.pop();const r={id:l.records.cnt++,level:e,name:t,children:[]};l.records.stack[l.records.stack.length-1].children.push(r),l.records.stack.push(r)},"addNode"),W={clear:L,addNode:z,getRoot:R,getCount:$,getConfig:X,getAccTitle:_,getAccDescription:T,getDiagramTitle:C,setAccDescription:x,setAccTitle:k,setDiagramTitle:y},m=W,F=s(e=>{E(e,m),e.nodes.map(t=>m.addNode(t.indent?parseInt(t.indent):0,t.name))},"populate"),M={parse:s(async e=>{const t=await A("treeView",e);f.debug(t),F(t)},"parse")},Y=s((e,t,r,n,o)=>{const c=n.append("text").text(r.name).attr("dominant-baseline","middle").attr("class","treeView-node-label"),{height:g,width:a}=c.node().getBBox(),d=g+o.paddingY*2,i=a+o.paddingX*2;c.attr("x",e+o.paddingX),c.attr("y",t+d/2),r.BBox={x:e,y:t,width:i,height:d}},"positionLabel"),v=s((e,t,r,n,o,c)=>e.append("line").attr("x1",t).attr("y1",r).attr("x2",n).attr("y2",o).attr("stroke-width",c).attr("class","treeView-node-line"),"positionLine"),q=s((e,t,r)=>{let n=0,o=0;const c=s((a,d,i,h)=>{const b=h*(i.rowIndent+i.paddingX);Y(b,n,d,a,i);const{height:p,width:u}=d.BBox;v(a,b-i.rowIndent,n+p/2,b,n+p/2,i.lineThickness),o=Math.max(o,b+u),n+=p},"drawNode"),g=s((a,d=0)=>{c(e,a,r,d),a.children.forEach(p=>{g(p,d+1)});const{x:i,y:h,height:b}=a.BBox;if(a.children.length){const{y:p,height:u}=a.children[a.children.length-1].BBox;v(e,i+r.paddingX,h+b,i+r.paddingX,p+u/2+r.lineThickness/2,r.lineThickness)}},"processNode");return g(t),{totalHeight:n,totalWidth:o}},"drawTree"),j=s((e,t,r,n)=>{f.debug(`Rendering treeView diagram
`+e);const o=n.db,c=o.getRoot(),g=o.getConfig(),a=B(t),d=a.append("g");d.attr("class","tree-view");const{totalHeight:i,totalWidth:h}=q(d,c,g);a.attr("viewBox",`-${g.lineThickness/2} 0 ${h} ${i}`),I(a,i,h,g.useMaxWidth)},"draw"),G={draw:j},J=G,K={labelFontSize:"16px",labelColor:"black",lineColor:"black"},O=s(({treeView:e})=>{const{labelFontSize:t,labelColor:r,lineColor:n}=w(K,e);return`
    .treeView-node-label {
        font-size: ${t};
        fill: ${r};
    }
    .treeView-node-line {
        stroke: ${n};
    }
    `},"styles"),P=O,de={db:m,renderer:J,parser:M,styles:P};export{de as diagram};
//# sourceMappingURL=diagram-5BDNPKRD-DZoPPAJL.js.map
