"use strict";(self.rspackChunk_jupyterlab_application_top=self.rspackChunk_jupyterlab_application_top||[]).push([[4474],{85054(e,t,i){function r(e,t){e.accDescr&&t.setAccDescription?.(e.accDescr),e.accTitle&&t.setAccTitle?.(e.accTitle),e.title&&t.setDiagramTitle?.(e.title)}i.d(t,{S:()=>r}),(0,i(70416).K2)(r,"populateCommonDb")},75463(e,t,i){i.d(t,{m:()=>a});var r=i(70416),a=class{constructor(e){this.init=e,this.records=this.init()}static{(0,r.K2)(this,"ImperativeState")}reset(){this.records=this.init()}}},68305(e,t,i){i.d(t,{diagram:()=>D});var r=i(78599),a=i(85054),n=i(75463),s=i(98143),c=i(76693),l=i(70416),d=i(24010),o=new n.m(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",children:[]}]})),p=(0,l.K2)(()=>{o.reset(),(0,c.IU)()},"clear"),g=(0,l.K2)(()=>o.records.stack[0],"getRoot"),h=(0,l.K2)(()=>o.records.cnt,"getCount"),k=c.UI.treeView,m=(0,l.K2)(()=>(0,s.$t)(k,(0,c.zj)().treeView),"getConfig"),w={clear:p,addNode:(0,l.K2)((e,t)=>{for(;e<=o.records.stack[o.records.stack.length-1].level;)o.records.stack.pop();let i={id:o.records.cnt++,level:e,name:t,children:[]};o.records.stack[o.records.stack.length-1].children.push(i),o.records.stack.push(i)},"addNode"),getRoot:g,getCount:h,getConfig:m,getAccTitle:c.iN,getAccDescription:c.m7,getDiagramTitle:c.ab,setAccDescription:c.EI,setAccTitle:c.SV,setDiagramTitle:c.ke},u=(0,l.K2)(e=>{(0,a.S)(e,w),e.nodes.map(e=>w.addNode(e.indent?parseInt(e.indent):0,e.name))},"populate"),b={parse:(0,l.K2)(async e=>{let t=await (0,d.qg)("treeView",e);l.Rm.debug(t),u(t)},"parse")},K=(0,l.K2)((e,t,i,r,a)=>{let n=r.append("text").text(i.name).attr("dominant-baseline","middle").attr("class","treeView-node-label"),{height:s,width:c}=n.node().getBBox(),l=s+2*a.paddingY,d=c+2*a.paddingX;n.attr("x",e+a.paddingX),n.attr("y",t+l/2),i.BBox={x:e,y:t,width:d,height:l}},"positionLabel"),x=(0,l.K2)((e,t,i,r,a,n)=>e.append("line").attr("x1",t).attr("y1",i).attr("x2",r).attr("y2",a).attr("stroke-width",n).attr("class","treeView-node-line"),"positionLine"),T=(0,l.K2)((e,t,i)=>{let r=0,a=0,n=(0,l.K2)((e,t,i,n)=>{let s=n*(i.rowIndent+i.paddingX);K(s,r,t,e,i);let{height:c,width:l}=t.BBox;x(e,s-i.rowIndent,r+c/2,s,r+c/2,i.lineThickness),a=Math.max(a,s+l),r+=c},"drawNode"),s=(0,l.K2)((t,r=0)=>{n(e,t,i,r),t.children.forEach(e=>{s(e,r+1)});let{x:a,y:c,height:l}=t.BBox;if(t.children.length){let{y:r,height:n}=t.children[t.children.length-1].BBox;x(e,a+i.paddingX,c+l,a+i.paddingX,r+n/2+i.lineThickness/2,i.lineThickness)}},"processNode");return s(t),{totalHeight:r,totalWidth:a}},"drawTree"),f=(0,l.K2)((e,t,i,a)=>{l.Rm.debug("Rendering treeView diagram\n"+e);let n=a.db,s=n.getRoot(),d=n.getConfig(),o=(0,r.D)(t),p=o.append("g");p.attr("class","tree-view");let{totalHeight:g,totalWidth:h}=T(p,s,d);o.attr("viewBox",`-${d.lineThickness/2} 0 ${h} ${g}`),(0,c.a$)(o,g,h,d.useMaxWidth)},"draw"),B={labelFontSize:"16px",labelColor:"black",lineColor:"black"},D={db:w,renderer:{draw:f},parser:b,styles:(0,l.K2)(({treeView:e})=>{let{labelFontSize:t,labelColor:i,lineColor:r}=(0,s.$t)(B,e);return`
    .treeView-node-label {
        font-size: ${t};
        fill: ${i};
    }
    .treeView-node-line {
        stroke: ${r};
    }
    `},"styles")}}}]);
//# sourceMappingURL=4474.5048f047575a4e04.js.map?v=5048f047575a4e04