vendor: 3,302 bytes, lines 1-2
1/*! pre,oversea,b3706f52,2026-09-29 18:29:09 */ 2import{$ as isUndefined,Dt as clone,ft as map}from"./framework-BWm-jSAY.js";import{n as __name,r as log}from"./chunk-AGHRB4JF--WZFvz_Y.js";import{b as getConfig2}from"./chunk-ABZYJK2D-GUy1XDNo.js";import"./chunk-HN2XXSSU-D0L1-1gr.js";import{t as getSubGraphTitleMargins}from"./chunk-CVBHYZKI-CYLCiNnZ.js";import"./chunk-ATLVNIR6-DR1EbWSC.js";import"./chunk-S3R3BYOJ-DgYvHMFt.js";import"./chunk-JA3XYJ7Z-D2AKgrpJ.js";import{a as insertNode,c as positionNode,i as insertCluster,l as setNodeElem,n as clear2,t as clear,u as updateNodeBounds}from"./chunk-JZLCHNYA-D2TIqCpI.js";import{a as positionEdgeLabel,i as markers_default,n as insertEdge,r as insertEdgeLabel,t as clear$1}from"./chunk-QXUST7PY-DW_nEsxa.js";import{t as Graph}from"./graphlib-DEhKaG81.js";import{t as layout}from"./dagre-CF7wxrtG.js";function write(g){var json={options:{directed:g.isDirected(),multigraph:g.isMultigraph(),compound:g.isCompound()},nodes:writeNodes(g),edges:writeEdges(g)};return isUndefined(g.graph())||(json.value=clone(g.graph())),json}function writeNodes(g){return map(g.nodes(),function(v){var nodeValue=g.node(v),parent=g.parent(v),node={v:v};return isUndefined(nodeValue)||(node.value=nodeValue),isUndefined(parent)||(node.parent=parent),node})}function writeEdges(g){return map(g.edges(),function(e){var edgeValue=g.edge(e),edge={v:e.v,w:e.w};return isUndefined(e.name)||(edge.name=e.name),isUndefined(edgeValue)||(edge.value=edgeValue),edge})}var clusterDb=new Map,descendants=new Map,parents=new Map,clear4=__name(()=>{descendants.clear(),parents.clear(),clusterDb.clear()},"clear"),isDescendant=__name((id,ancestorId)=>{const ancestorDescendants=descendants.get(ancestorId)||[];return log.trace("In isDescendant",ancestorId," ",id," = ",ancestorDescendants.includes(id)),ancestorDescendants.includes(id)},"isDescendant"),edgeInCluster=__name((edge,clusterId)=>{const clusterDescendants=descendants.get(clusterId)||[];return log.info("Descendants of ",clusterId," is ",clusterDescendants),log.info("Edge is ",edge),edge.v!==clusterId&&edge.w!==clusterId&&(clusterDescendants?clusterDescendants.includes(edge.v)||isDescendant(edge.v,clusterId)||isDescendant(edge.w,clusterId)||clusterDescendants.includes(edge.w):(log.debug("Tilt, ",clusterId,",not in descendants"),!1))},"edgeInCluster"),copy=__name((clusterId,graph,newGraph,rootId)=>{log.warn("Copying children of ",clusterId,"root",rootId,"data",graph.node(clusterId),rootId);const nodes=graph.children(clusterId)||[];clusterId!==rootId&&nodes.push(clusterId),log.warn("Copying (nodes) clusterId",clusterId,"nodes",nodes),nodes.forEach(node=>{if(graph.children(node).length>0)copy(node,graph,newGraph,rootId);else{const data=graph.node(node);log.info("cp ",node," to ",rootId," with parent ",clusterId),newGraph.setNode(node,data),rootId!==graph.parent(node)&&(log.warn("Setting parent",node,graph.parent(node)),newGraph.setParent(node,graph.parent(node))),clusterId!==rootId&&node!==clusterId?(log.debug("Setting parent",node,clusterId),newGraph.setParent(node,clusterId)):(log.info("In copy ",clusterId,"root",rootId,"data",graph.node(clusterId),rootId),log.debug("Not Setting parent for node=",node,"cluster!==rootId",clusterId!==rootId,"node!==clusterId",node!==clusterId));const edges=graph.edges(node);
2log.debug("Copying Edges",edges),edges.forEach(edge=>{log.info("Edge",edge);const data2=graph.edge(edge.v,edge.w,edge.name);log.info("Edge data",data2,rootId);try{edgeInCluster(edge,rootId)?(log.info("Copying as ",edge.v,edge.w,data2,edge.name),newGraph.setEdge(edge.v,edge.w,data2,edge.name),log.info("newGraph edges ",newGraph.edges(),newGraph.edge(newGraph.edges()[0]))):log.info("Skipping copy of edge ",edge.v,"--\x3e",edge.w," rootId: ",rootId," clusterId:",clusterId)}catch(e){log.error(e)}})}log.debug("Removing node",node),graph.removeNode(node)})},"copy"),extractDescendants=__name((id,graph)=>{const children=graph.children(id);let res=[...children];for(const child of children)parents.set(child,id),res=[...res,...extractDescendants(child,graph)];return res},"extractDescendants"),findCommonEdges=__name((graph,id1,id2)=>{const edges1=graph.edges().filter(edge=>edge.v===id1||edge.w===id1),edges2=graph.edges().filter(edge=>edge.v===id2||edge.w===id2),edges1Prim=edges1.map(edge=>({v:edge.v===id1?id2:edge.v,w:edge.w===id1?id1:edge.w})),edges2Prim=edges2.map(edge=>({v:edge.v,w:edge.w}));return edges1Prim.filter(edgeIn1=>edges2Prim.some(edge=>edgeIn1.v===edge.v&&edgeIn1.w===edge.w))},"findCommonEdges"),findNonClusterChild=__name((id,graph,clusterId)=>{const children=graph.children(id);if(log.trace("Searching children of id ",id,children),children.length<1)return id;let reserve;for(const child of children){const _id=findNonClusterChild(child,graph,clusterId),commonEdges=findCommonEdges(graph,clusterId,_id);if(_id){if(!(commonEdges.length>0))return _id;reserve=_id}}return reserve},"findNonClusterChild"),getAnchorId=__name(id=>clusterDb.has(id)&&clusterDb.get(id).externalConnections&&clusterDb.has(id)?clusterDb.get(id).id:id,"getAnchorId"),adjustClustersAndEdges=__name((graph,depth)=>{if(!graph||depth>10)log.debug("Opting out, no graph ");else{log.debug("Opting in, graph "),graph.nodes().forEach(function(id){graph.children(id).length>0&&(log.warn("Cluster identified",id," Replacement id in edges: ",findNonClusterChild(id,graph,id)),descendants.set(id,extractDescendants(id,graph)),clusterDb.set(id,{id:findNonClusterChild(id,graph,id),clusterData:graph.node(id)}))}),graph.nodes().forEach(function(id){const children=graph.children(id),edges=graph.edges();children.length>
20?(log.debug("Cluster identified",id,descendants),edges.forEach(edge=>{isDescendant(edge.v,id)^isDescendant(edge.w,id)&&(log.warn("Edge: ",edge," leaves cluster ",id),log.warn("Descendants of XXX ",id,": ",descendants.get(id)),clusterDb.get(id).externalConnections=!0)})):log.debug("Not a cluster ",id,descendants)});for(let id of clusterDb.keys()){const nonClusterChild=clusterDb.get(id).id,parent=graph.parent(nonClusterChild);parent!==id&&clusterDb.has(parent)&&!clusterDb.get(parent).externalConnections&&(clusterDb.get(id).id=parent)}graph.edges().forEach(function(e){const edge=graph.edge(e);log.warn("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e)),log.warn("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(graph.edge(e)));let v=e.v,w=e.w;if(log.warn("Fix XXX",clusterDb,"ids:",e.v,e.w,"Translating: ",clusterDb.get(e.v)," --- ",clusterDb.get(e.w)),clusterDb.get(e.v)||clusterDb.get(e.w)){if(log.warn("Fixing and trying - removing XXX",e.v,e.w,e.name),v=getAnchorId(e.v),w=getAnchorId(e.w),graph.removeEdge(e.v,e.w,e.name),v!==e.v){const parent=graph.parent(v);clusterDb.get(parent).externalConnections=!0,edge.fromCluster=e.v}if(w!==e.w){const parent=graph.parent(w);clusterDb.get(parent).externalConnections=!0,edge.toCluster=e.w}log.warn("Fix Replacing with XXX",v,w,e.name),graph.setEdge(v,w,edge,e.name)}}),log.warn("Adjusted Graph",write(graph)),extractor(graph,0),log.trace(clusterDb)}},"adjustClustersAndEdges"),extractor=__name((graph,depth)=>{if(log.warn("extractor - ",depth,write(graph),graph.children("D")),depth>10)return void log.error("Bailing out");let nodes=graph.nodes(),hasChildren=!1;for(const node of nodes){const children=graph.children(node);hasChildren=hasChildren||children.length>0}if(hasChildren){log.debug("Nodes = ",nodes,depth);for(const node of nodes)if(log.debug("Extracting node",node,clusterDb,clusterDb.has(node)&&!clusterDb.get(node).externalConnections,!graph.parent(node),graph.node(node),graph.children("D")," Depth ",depth),clusterDb.has(node))if(!clusterDb.get(node).externalConnections&&graph.children(node)&&graph.children(node).length>0){var _clusterDb$get;log.warn("Cluster without external connections, without a parent and with children",node,depth);let dir="TB"===graph.graph().rankdir?"LR":"TB";(null===(_clusterDb$get=clusterDb.get(node))||void 0===_clusterDb$get||null===(_clusterDb$get=_clusterDb$get.clusterData)||void 0===_clusterDb$get?void 0:_clusterDb$get.dir)&&(dir=clusterDb.get(node).clusterData.dir,log.warn("Fixing dir",clusterDb.get(node).clusterData.dir,dir));const clusterGraph=new Graph({multigraph:!0,compound:!0}).setGraph({rankdir:dir,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});log.warn("Old graph before copy",write(graph)),copy(node,graph,clusterGraph,node),graph.setNode(node,{clusterNode:!0,id:node,clusterData:clusterDb.get(node).clusterData,label:clusterDb.get(node).label,graph:clusterGraph}),log.warn("New graph after copy node: (",node,")",write(clusterGraph)),log.debug("Old graph after copy",write(graph))}else log.warn("Cluster ** ",node," **not meeting the criteria !externalConnections:",!clusterDb.get(node).externalConnections," no parent: ",!graph.parent(node)," children ",graph.children(node)&&graph.children(node).length>0,graph.children("D"),depth),log.debug(clusterDb);else log.debug("Not a cluster",node,depth);nodes=graph.nodes(),log.warn("New list of nodes",nodes);for(const node of nodes){const data=graph.node(node);log.warn(" Now next level",node,data),(null==data?void 0:data.clusterNode)&&extractor(data.graph,depth+1)}}else log.debug("Done, no node has children",graph.nodes())},"extractor"),sorter=__name((graph,nodes)=>{if(0===nodes.length)return[];let result=Object.assign([],nodes);return nodes.forEach(node=>{const sorted=sorter(graph,graph.children(node));result=[...result,...sorted]}),result},"sorter"),sortNodesByHierarchy=__name(graph=>sorter(graph,graph.children()),"sortNodesByHierarchy"),recursiveRender=__name(async(_elem,graph,diagramType,id,parentCluster,siteConfig)=>{log.warn("Graph in recursive render:XAX",write(graph),parentCluster);const dir=graph.graph().rankdir;log.trace("Dir in recursive render - dir:",dir);const elem=_elem.insert("g").attr("class","root");graph.nodes()?log.info("Recursive render XXX",graph.nodes()):log.info("No nodes found for",graph),graph.edges().length>0&&log.info("Recursive edges",graph.edge(graph.edges()[0]));
2const clusters=elem.insert("g").attr("class","clusters"),edgePaths=elem.insert("g").attr("class","edgePaths"),edgeLabels=elem.insert("g").attr("class","edgeLabels"),nodes=elem.insert("g").attr("class","nodes");await Promise.all(graph.nodes().map(async function(v){const node=graph.node(v);if(void 0!==parentCluster){const data=JSON.parse(JSON.stringify(parentCluster.clusterData));log.trace("Setting data for parent cluster XXX\n Node.id = ",v,"\n data=",data.height,"\nParent cluster",parentCluster.height),graph.setNode(parentCluster.id,data),graph.parent(v)||(log.trace("Setting parent",v,parentCluster.id),graph.setParent(v,parentCluster.id,data))}if(log.info("(Insert) Node XXX"+v+": "+JSON.stringify(graph.node(v))),null==node?void 0:node.clusterNode){log.info("Cluster identified XBX",v,node.width,graph.node(v));const{ranksep:ranksep,nodesep:nodesep}=graph.graph();node.graph.setGraph({...node.graph.graph(),ranksep:ranksep+25,nodesep:nodesep});const o=await recursiveRender(nodes,node.graph,diagramType,id,graph.node(v),siteConfig),newEl=o.elem;updateNodeBounds(node,newEl),node.diff=o.diff||0,log.info("New compound node after recursive render XAX",v,"width",node.width,"height",node.height),setNodeElem(newEl,node)}else graph.children(v).length>0?(log.trace("Cluster - the non recursive path XBX",v,node.id,node,node.width,"Graph:",graph),log.trace(findNonClusterChild(node.id,graph)),clusterDb.set(node.id,{id:findNonClusterChild(node.id,graph),node:node})):(log.trace("Node - the non recursive path XAX",v,nodes,graph.node(v),dir),await insertNode(nodes,graph.node(v),{config:siteConfig,dir:dir}))})),await __name(async()=>{const edgePromises=graph.edges().map(async function(e){const edge=graph.edge(e.v,e.w,e.name);log.info("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e)),log.info("Edge "+e.v+" -> "+e.w+": ",e," ",JSON.stringify(graph.edge(e))),log.info("Fix",clusterDb,"ids:",e.v,e.w,"Translating: ",clusterDb.get(e.v),clusterDb.get(e.w)),await insertEdgeLabel(edgeLabels,edge)});await Promise.all(edgePromises)},"processEdges")(),log.info("Graph before layout:",JSON.stringify(write(graph))),log.info("############################################# XXX"),log.info("### Layout ### XXX"),log.info("############################################# XXX"),layout(graph),log.info("Graph after layout:",JSON.stringify(write(graph)));let diff=0,{subGraphTitleTotalMargin:subGraphTitleTotalMargin}=getSubGraphTitleMargins(siteConfig);return await Promise.all(sortNodesByHierarchy(graph).map(async function(v){const node=graph.node(v);if(log.info("Position XBX => "+v+": ("+node.x,","+node.y,") width: ",node.width," height: ",node.height),null==node?void 0:node.clusterNode)node.y+=subGraphTitleTotalMargin,log.info("A tainted cluster node XBX1",v,node.id,node.width,node.height,node.x,node.y,graph.parent(v)),clusterDb.get(node.id).node=node,positionNode(node);else if(graph.children(v).length>0){var _node$labelBBox;log.info("A pure cluster node XBX1",v,node.id,node.x,node.y,node.width,node.height,graph.parent(v)),node.height+=subGraphTitleTotalMargin,graph.node(node.parentId);const halfPadding=(null==node?void 0:node.padding)/2||0,labelHeight=(null==node||null===(_node$labelBBox=node.labelBBox)||void 0===_node$labelBBox?void 0:_node$labelBBox.height)||0,offsetY=labelHeight-halfPadding||0;log.debug("OffsetY",offsetY,"labelHeight",labelHeight,"halfPadding",halfPadding),await insertCluster(clusters,node),clusterDb.get(node.id).node=node}else{const parent=graph.node(node.parentId);node.y+=subGraphTitleTotalMargin/2,log.info("A regular node XBX1 - using the padding",node.id,"parent",node.parentId,node.width,node.height,node.x,node.y,"offsetY",node.offsetY,"parent",parent,null==parent?void 0:parent.offsetY,node),positionNode(node)}}
2)),graph.edges().forEach(function(e){const edge=graph.edge(e);log.info("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(edge),edge),edge.points.forEach(point=>point.y+=subGraphTitleTotalMargin/2),positionEdgeLabel(edge,insertEdge(edgePaths,edge,clusterDb,diagramType,graph.node(e.v),graph.node(e.w),id))}),graph.nodes().forEach(function(v){const n=graph.node(v);log.info(v,n.type,n.diff),n.isGroup&&(diff=n.diff)}),log.warn("Returning from recursive render XAX",elem,diff),{elem:elem,diff:diff}},"recursiveRender"),render=__name(async(data4Layout,svg)=>{var _data4Layout$config,_data4Layout$config2,_data4Layout$config3,_data4Layout$config4;const graph=new Graph({multigraph:!0,compound:!0}).setGraph({rankdir:data4Layout.direction,nodesep:(null===(_data4Layout$config=data4Layout.config)||void 0===_data4Layout$config?void 0:_data4Layout$config.nodeSpacing)||(null===(_data4Layout$config2=data4Layout.config)||void 0===_data4Layout$config2||null===(_data4Layout$config2=_data4Layout$config2.flowchart)||void 0===_data4Layout$config2?void 0:_data4Layout$config2.nodeSpacing)||data4Layout.nodeSpacing,ranksep:(null===(_data4Layout$config3=data4Layout.config)||void 0===_data4Layout$config3?void 0:_data4Layout$config3.rankSpacing)||(null===(_data4Layout$config4=data4Layout.config)||void 0===_data4Layout$config4||null===(_data4Layout$config4=_data4Layout$config4.flowchart)||void 0===_data4Layout$config4?void 0:_data4Layout$config4.rankSpacing)||data4Layout.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),element=svg.select("g");markers_default(element,data4Layout.markers,data4Layout.type,data4Layout.diagramId),clear2(),clear$1(),clear(),clear4(),data4Layout.nodes.forEach(node=>{graph.setNode(node.id,{...node}),node.parentId&&graph.setParent(node.id,node.parentId)}),log.debug("Edges:",data4Layout.edges),data4Layout.edges.forEac
vendor: 1,587 bytes, lines 2-3
2h(edge=>{if(edge.start===edge.end){const nodeId=edge.start,specialId1=nodeId+"---"+nodeId+"---1",specialId2=nodeId+"---"+nodeId+"---2",node=graph.node(nodeId);graph.setNode(specialId1,{domId:specialId1,id:specialId1,parentId:node.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),graph.setParent(specialId1,node.parentId),graph.setNode(specialId2,{domId:specialId2,id:specialId2,parentId:node.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),graph.setParent(specialId2,node.parentId);const edge1=structuredClone(edge),edgeMid=structuredClone(edge),edge2=structuredClone(edge);edge1.label="",edge1.arrowTypeEnd="none",edge1.id=nodeId+"-cyclic-special-1",edgeMid.arrowTypeStart="none",edgeMid.arrowTypeEnd="none",edgeMid.id=nodeId+"-cyclic-special-mid",edge2.label="",node.isGroup&&(edge1.fromCluster=nodeId,edge2.toCluster=nodeId),edge2.id=nodeId+"-cyclic-special-2",edge2.arrowTypeStart="none",graph.setEdge(nodeId,specialId1,edge1,nodeId+"-cyclic-special-0"),graph.setEdge(specialId1,specialId2,edgeMid,nodeId+"-cyclic-special-1"),graph.setEdge(specialId2,nodeId,edge2,nodeId+"-cyc<lic-special-2")}else graph.setEdge(edge.start,edge.end,{...edge},edge.id)}),log.warn("Graph at first:",JSON.stringify(write(graph))),adjustClustersAndEdges(graph),log.warn("Graph after XAX:",JSON.stringify(write(graph)));const siteConfig=getConfig2();await recursiveRender(element,graph,data4Layout.type,data4Layout.diagramId,void 0,siteConfig)},"render");export{render}; 3//# sourceMappingURL=dagre-6UL2VRFP-Bai8cv-u.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.