"use strict";(self.rspackChunk_JUPYTERLAB_CORE_OUTPUT=self.rspackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[4934],{23850(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(87724).K2)(r,"populateCommonDb")},68931(e,t,i){i.d(t,{m:()=>a});var r=i(87724),a=class{constructor(e){this.init=e,this.records=this.init()}static{(0,r.K2)(this,"ImperativeState")}reset(){this.records=this.init()}}},95285(e,t,i){i.d(t,{diagram:()=>C});var r=i(74571),a=i(23850),n=i(68931),s=i(2961),c=i(74725),d=i(87724),l=i(11150),o=new n.m(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",children:[]}]})),g=(0,d.K2)(()=>{o.reset(),(0,c.IU)()},"clear"),h=(0,d.K2)(()=>o.records.stack[0],"getRoot"),p=(0,d.K2)(()=>o.records.cnt,"getCount"),k=c.UI.treeView,m=(0,d.K2)(()=>(0,s.$t)(k,(0,c.zj)().treeView),"getConfig"),w={clear:g,addNode:(0,d.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:h,getCount:p,getConfig:m,getAccTitle:c.iN,getAccDescription:c.m7,getDiagramTitle:c.ab,setAccDescription:c.EI,setAccTitle:c.SV,setDiagramTitle:c.ke},T=(0,d.K2)(e=>{(0,a.S)(e,w),e.nodes.map(e=>w.addNode(e.indent?parseInt(e.indent):0,e.name))},"populate"),u={parse:(0,d.K2)(async e=>{let t=await (0,l.qg)("treeView",e);d.Rm.debug(t),T(t)},"parse")},K=(0,d.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(),d=s+2*a.paddingY,l=c+2*a.paddingX;n.attr("x",e+a.paddingX),n.attr("y",t+d/2),i.BBox={x:e,y:t,width:l,height:d}},"positionLabel"),b=(0,d.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"),x=(0,d.K2)((e,t,i)=>{let r=0,a=0,n=(0,d.K2)((e,t,i,n)=>{let s=n*(i.rowIndent+i.paddingX);K(s,r,t,e,i);let{height:c,width:d}=t.BBox;b(e,s-i.rowIndent,r+c/2,s,r+c/2,i.lineThickness),a=Math.max(a,s+d),r+=c},"drawNode"),s=(0,d.K2)((t,r=0)=>{n(e,t,i,r),t.children.forEach(e=>{s(e,r+1)});let{x:a,y:c,height:d}=t.BBox;if(t.children.length){let{y:r,height:n}=t.children[t.children.length-1].BBox;b(e,a+i.paddingX,c+d,a+i.paddingX,r+n/2+i.lineThickness/2,i.lineThickness)}},"processNode");return s(t),{totalHeight:r,totalWidth:a}},"drawTree"),B=(0,d.K2)((e,t,i,a)=>{d.Rm.debug("Rendering treeView diagram\n"+e);let n=a.db,s=n.getRoot(),l=n.getConfig(),o=(0,r.D)(t),g=o.append("g");g.attr("class","tree-view");let{totalHeight:h,totalWidth:p}=x(g,s,l);o.attr("viewBox",`-${l.lineThickness/2} 0 ${p} ${h}`),(0,c.a$)(o,h,p,l.useMaxWidth)},"draw"),f={labelFontSize:"16px",labelColor:"black",lineColor:"black"},C={db:w,renderer:{draw:B},parser:u,styles:(0,d.K2)(({treeView:e})=>{let{labelFontSize:t,labelColor:i,lineColor:r}=(0,s.$t)(f,e);return`
    .treeView-node-label {
        font-size: ${t};
        fill: ${i};
    }
    .treeView-node-line {
        stroke: ${r};
    }
    `},"styles")}}}]);