"use strict";(self.webpackChunkforgejo=self.webpackChunkforgejo||[]).push([["node_modules_mermaid_dist_chunks_mermaid_core_diagram-5GNKFQAL_mjs"],{"./node_modules/mermaid/dist/chunks/mermaid.core/diagram-5GNKFQAL.mjs":(function($,C,h){h.d(C,{diagram:function(){return X}});var E=h("./node_modules/mermaid/dist/chunks/mermaid.core/chunk-WU5MYG2G.mjs"),w=h("./node_modules/mermaid/dist/chunks/mermaid.core/chunk-4BX2VUAB.mjs"),j=h("./node_modules/mermaid/dist/chunks/mermaid.core/chunk-QZHKN3VN.mjs"),K=h("./node_modules/mermaid/dist/chunks/mermaid.core/chunk-5ZQYHXKU.mjs"),c=h("./node_modules/mermaid/dist/chunks/mermaid.core/chunk-CSCIHK7Q.mjs"),r=h("./node_modules/mermaid/dist/chunks/mermaid.core/chunk-AGHRB4JF.mjs"),D=h("./node_modules/@mermaid-js/parser/dist/mermaid-parser.core.mjs"),l=new j.m(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",children:[]}]})),b=(0,r.K2)(()=>{l.reset(),(0,c.IU)()},"clear"),M=(0,r.K2)(()=>l.records.stack[0],"getRoot"),T=(0,r.K2)(()=>l.records.cnt,"getCount"),A=c.UI.treeView,I=(0,r.K2)(()=>(0,K.$t)(A,(0,c.zj)().treeView),"getConfig"),R=(0,r.K2)((e,t)=>{for(;e<=l.records.stack[l.records.stack.length-1].level;)l.records.stack.pop();const a={id:l.records.cnt++,level:e,name:t,children:[]};l.records.stack[l.records.stack.length-1].children.push(a),l.records.stack.push(a)},"addNode"),U={clear:b,addNode:R,getRoot:M,getCount:T,getConfig:I,getAccTitle:c.iN,getAccDescription:c.m7,getDiagramTitle:c.ab,setAccDescription:c.EI,setAccTitle:c.SV,setDiagramTitle:c.ke},p=U,x=(0,r.K2)(e=>{(0,w.S)(e,p),e.nodes.map(t=>p.addNode(t.indent?parseInt(t.indent):0,t.name))},"populate"),N={parse:(0,r.K2)(async e=>{const t=await(0,D.qg)("treeView",e);r.Rm.debug(t),x(t)},"parse")},O=(0,r.K2)((e,t,a,d,i)=>{const m=d.append("text").text(a.name).attr("dominant-baseline","middle").attr("class","treeView-node-label"),{height:_,width:s}=m.node().getBBox(),o=_+i.paddingY*2,n=s+i.paddingX*2;m.attr("x",e+i.paddingX),m.attr("y",t+o/2),a.BBox={x:e,y:t,width:n,height:o}},"positionLabel"),B=(0,r.K2)((e,t,a,d,i,m)=>e.append("line").attr("x1",t).attr("y1",a).attr("x2",d).attr("y2",i).attr("stroke-width",m).attr("class","treeView-node-line"),"positionLine"),P=(0,r.K2)((e,t,a)=>{let d=0,i=0;const m=(0,r.K2)((s,o,n,g)=>{const k=g*(n.rowIndent+n.paddingX);O(k,d,o,s,n);const{height:u,width:v}=o.BBox;B(s,k-n.rowIndent,d+u/2,k,d+u/2,n.lineThickness),i=Math.max(i,k+v),d+=u},"drawNode"),_=(0,r.K2)((s,o=0)=>{m(e,s,a,o),s.children.forEach(u=>{_(u,o+1)});const{x:n,y:g,height:k}=s.BBox;if(s.children.length){const{y:u,height:v}=s.children[s.children.length-1].BBox;B(e,n+a.paddingX,g+k,n+a.paddingX,u+v/2+a.lineThickness/2,a.lineThickness)}},"processNode");return _(t),{totalHeight:d,totalWidth:i}},"drawTree"),V=(0,r.K2)((e,t,a,d)=>{r.Rm.debug(`Rendering treeView diagram
`+e);const i=d.db,m=i.getRoot(),_=i.getConfig(),s=(0,E.D)(t),o=s.append("g");o.attr("class","tree-view");const{totalHeight:n,totalWidth:g}=P(o,m,_);s.attr("viewBox",`-${_.lineThickness/2} 0 ${g} ${n}`),(0,c.a$)(s,n,g,_.useMaxWidth)},"draw"),L={draw:V},W=L,H={labelFontSize:"16px",labelColor:"black",lineColor:"black"},f=(0,r.K2)(({treeView:e})=>{const{labelFontSize:t,labelColor:a,lineColor:d}=(0,K.$t)(H,e);return`
    .treeView-node-label {
        font-size: ${t};
        fill: ${a};
    }
    .treeView-node-line {
        stroke: ${d};
    }
    `},"styles"),y=f,X={db:p,renderer:W,parser:N,styles:y}})}]);
