Files
vac.dev/assets/js/3281.48bd717b.js
2026-05-08 07:42:49 +00:00

1 line
11 KiB
JavaScript

"use strict";(self.webpackChunkresearch_logos_co=self.webpackChunkresearch_logos_co||[]).push([[3281],{75662:(e,n,t)=>{t.r(n),t.d(n,{render:()=>K});var r=t(73353),i=(t(11334),t(29092)),a=t(97963),o=(t(38278),t(35183),t(4137),t(17726)),d=t(40797),s=t(14210),c=t(43596),g=t(64413);const l=function(e){return(0,g.A)(e,4)};var f=t(83998);t(16999);function h(e){var n={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:p(e),edges:u(e)};return c.A(e.graph())||(n.value=l(e.graph())),n}function p(e){return f.A(e.nodes(),(function(n){var t=e.node(n),r=e.parent(n),i={v:n};return c.A(t)||(i.value=t),c.A(r)||(i.parent=r),i}))}function u(e){return f.A(e.edges(),(function(n){var t=e.edge(n),r={v:n.v,w:n.w};return c.A(n.name)||(r.name=n.name),c.A(t)||(r.value=t),r}))}var m=t(697),w=new Map,R=new Map,v=new Map,y=(0,d.K2)((()=>{R.clear(),v.clear(),w.clear()}),"clear"),X=(0,d.K2)(((e,n)=>{const t=R.get(n)||[];return d.Rm.trace("In isDescendant",n," ",e," = ",t.includes(e)),t.includes(e)}),"isDescendant"),b=(0,d.K2)(((e,n)=>{const t=R.get(n)||[];return d.Rm.info("Descendants of ",n," is ",t),d.Rm.info("Edge is ",e),e.v!==n&&e.w!==n&&(t?t.includes(e.v)||X(e.v,n)||X(e.w,n)||t.includes(e.w):(d.Rm.debug("Tilt, ",n,",not in descendants"),!1))}),"edgeInCluster"),E=(0,d.K2)(((e,n,t,r)=>{d.Rm.warn("Copying children of ",e,"root",r,"data",n.node(e),r);const i=n.children(e)||[];e!==r&&i.push(e),d.Rm.warn("Copying (nodes) clusterId",e,"nodes",i),i.forEach((i=>{if(n.children(i).length>0)E(i,n,t,r);else{const a=n.node(i);d.Rm.info("cp ",i," to ",r," with parent ",e),t.setNode(i,a),r!==n.parent(i)&&(d.Rm.warn("Setting parent",i,n.parent(i)),t.setParent(i,n.parent(i))),e!==r&&i!==e?(d.Rm.debug("Setting parent",i,e),t.setParent(i,e)):(d.Rm.info("In copy ",e,"root",r,"data",n.node(e),r),d.Rm.debug("Not Setting parent for node=",i,"cluster!==rootId",e!==r,"node!==clusterId",i!==e));const o=n.edges(i);d.Rm.debug("Copying Edges",o),o.forEach((i=>{d.Rm.info("Edge",i);const a=n.edge(i.v,i.w,i.name);d.Rm.info("Edge data",a,r);try{b(i,r)?(d.Rm.info("Copying as ",i.v,i.w,a,i.name),t.setEdge(i.v,i.w,a,i.name),d.Rm.info("newGraph edges ",t.edges(),t.edge(t.edges()[0]))):d.Rm.info("Skipping copy of edge ",i.v,"--\x3e",i.w," rootId: ",r," clusterId:",e)}catch(o){d.Rm.error(o)}}))}d.Rm.debug("Removing node",i),n.removeNode(i)}))}),"copy"),N=(0,d.K2)(((e,n)=>{const t=n.children(e);let r=[...t];for(const i of t)v.set(i,e),r=[...r,...N(i,n)];return r}),"extractDescendants"),C=(0,d.K2)(((e,n,t)=>{const r=e.edges().filter((e=>e.v===n||e.w===n)),i=e.edges().filter((e=>e.v===t||e.w===t)),a=r.map((e=>({v:e.v===n?t:e.v,w:e.w===n?n:e.w}))),o=i.map((e=>({v:e.v,w:e.w})));return a.filter((e=>o.some((n=>e.v===n.v&&e.w===n.w))))}),"findCommonEdges"),S=(0,d.K2)(((e,n,t)=>{const r=n.children(e);if(d.Rm.trace("Searching children of id ",e,r),r.length<1)return e;let i;for(const a of r){const e=S(a,n,t),r=C(n,t,e);if(e){if(!(r.length>0))return e;i=e}}return i}),"findNonClusterChild"),x=(0,d.K2)((e=>w.has(e)&&w.get(e).externalConnections&&w.has(e)?w.get(e).id:e),"getAnchorId"),I=(0,d.K2)(((e,n)=>{if(!e||n>10)d.Rm.debug("Opting out, no graph ");else{d.Rm.debug("Opting in, graph "),e.nodes().forEach((function(n){e.children(n).length>0&&(d.Rm.warn("Cluster identified",n," Replacement id in edges: ",S(n,e,n)),R.set(n,N(n,e)),w.set(n,{id:S(n,e,n),clusterData:e.node(n)}))})),e.nodes().forEach((function(n){const t=e.children(n),r=e.edges();t.length>0?(d.Rm.debug("Cluster identified",n,R),r.forEach((e=>{X(e.v,n)^X(e.w,n)&&(d.Rm.warn("Edge: ",e," leaves cluster ",n),d.Rm.warn("Descendants of XXX ",n,": ",R.get(n)),w.get(n).externalConnections=!0)}))):d.Rm.debug("Not a cluster ",n,R)}));for(let n of w.keys()){const t=w.get(n).id,r=e.parent(t);r!==n&&w.has(r)&&!w.get(r).externalConnections&&(w.get(n).id=r)}e.edges().forEach((function(n){const t=e.edge(n);d.Rm.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),d.Rm.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let r=n.v,i=n.w;if(d.Rm.warn("Fix XXX",w,"ids:",n.v,n.w,"Translating: ",w.get(n.v)," --- ",w.get(n.w)),w.get(n.v)||w.get(n.w)){if(d.Rm.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),r=x(n.v),i=x(n.w),e.removeEdge(n.v,n.w,n.name),r!==n.v){const i=e.parent(r);w.get(i).externalConnections=!0,t.fromCluster=n.v}if(i!==n.w){const r=e.parent(i);w.get(r).externalConnections=!0,t.toCluster=n.w}d.Rm.warn("Fix Replacing with XXX",r,i,n.name),e.setEdge(r,i,t,n.name)}})),d.Rm.warn("Adjusted Graph",h(e)),D(e,0),d.Rm.trace(w)}}),"adjustClustersAndEdges"),D=(0,d.K2)(((e,n)=>{if(d.Rm.warn("extractor - ",n,h(e),e.children("D")),n>10)return void d.Rm.error("Bailing out");let t=e.nodes(),r=!1;for(const i of t){const n=e.children(i);r=r||n.length>0}if(r){d.Rm.debug("Nodes = ",t,n);for(const r of t)if(d.Rm.debug("Extracting node",r,w,w.has(r)&&!w.get(r).externalConnections,!e.parent(r),e.node(r),e.children("D")," Depth ",n),w.has(r))if(!w.get(r).externalConnections&&e.children(r)&&e.children(r).length>0){d.Rm.warn("Cluster without external connections, without a parent and with children",r,n);let t="TB"===e.graph().rankdir?"LR":"TB";w.get(r)?.clusterData?.dir&&(t=w.get(r).clusterData.dir,d.Rm.warn("Fixing dir",w.get(r).clusterData.dir,t));const i=new m.T({multigraph:!0,compound:!0}).setGraph({rankdir:t,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel((function(){return{}}));d.Rm.warn("Old graph before copy",h(e)),E(r,e,i,r),e.setNode(r,{clusterNode:!0,id:r,clusterData:w.get(r).clusterData,label:w.get(r).label,graph:i}),d.Rm.warn("New graph after copy node: (",r,")",h(i)),d.Rm.debug("Old graph after copy",h(e))}else d.Rm.warn("Cluster ** ",r," **not meeting the criteria !externalConnections:",!w.get(r).externalConnections," no parent: ",!e.parent(r)," children ",e.children(r)&&e.children(r).length>0,e.children("D"),n),d.Rm.debug(w);else d.Rm.debug("Not a cluster",r,n);t=e.nodes(),d.Rm.warn("New list of nodes",t);for(const r of t){const t=e.node(r);d.Rm.warn(" Now next level",r,t),t?.clusterNode&&D(t.graph,n+1)}}else d.Rm.debug("Done, no node has children",e.nodes())}),"extractor"),A=(0,d.K2)(((e,n)=>{if(0===n.length)return[];let t=Object.assign([],n);return n.forEach((n=>{const r=e.children(n),i=A(e,r);t=[...t,...i]})),t}),"sorter"),O=(0,d.K2)((e=>A(e,e.children())),"sortNodesByHierarchy"),k=(0,d.K2)((async(e,n,t,o,c,g)=>{d.Rm.warn("Graph in recursive render:XAX",h(n),c);const l=n.graph().rankdir;d.Rm.trace("Dir in recursive render - dir:",l);const f=e.insert("g").attr("class","root");n.nodes()?d.Rm.info("Recursive render XXX",n.nodes()):d.Rm.info("No nodes found for",n),n.edges().length>0&&d.Rm.info("Recursive edges",n.edge(n.edges()[0]));const p=f.insert("g").attr("class","clusters"),u=f.insert("g").attr("class","edgePaths"),m=f.insert("g").attr("class","edgeLabels"),R=f.insert("g").attr("class","nodes");await Promise.all(n.nodes().map((async function(e){const r=n.node(e);if(void 0!==c){const t=JSON.parse(JSON.stringify(c.clusterData));d.Rm.trace("Setting data for parent cluster XXX\n Node.id = ",e,"\n data=",t.height,"\nParent cluster",c.height),n.setNode(c.id,t),n.parent(e)||(d.Rm.trace("Setting parent",e,c.id),n.setParent(e,c.id,t))}if(d.Rm.info("(Insert) Node XXX"+e+": "+JSON.stringify(n.node(e))),r?.clusterNode){d.Rm.info("Cluster identified XBX",e,r.width,n.node(e));const{ranksep:a,nodesep:s}=n.graph();r.graph.setGraph({...r.graph.graph(),ranksep:a+25,nodesep:s});const c=await k(R,r.graph,t,o,n.node(e),g),l=c.elem;(0,i.lC)(r,l),r.diff=c.diff||0,d.Rm.info("New compound node after recursive render XAX",e,"width",r.width,"height",r.height),(0,i.U7)(l,r)}else n.children(e).length>0?(d.Rm.trace("Cluster - the non recursive path XBX",e,r.id,r,r.width,"Graph:",n),d.Rm.trace(S(r.id,n)),w.set(r.id,{id:S(r.id,n),node:r})):(d.Rm.trace("Node - the non recursive path XAX",e,R,n.node(e),l),await(0,i.on)(R,n.node(e),{config:g,dir:l}))})));const v=(0,d.K2)((async()=>{const e=n.edges().map((async function(e){const t=n.edge(e.v,e.w,e.name);d.Rm.info("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e)),d.Rm.info("Edge "+e.v+" -> "+e.w+": ",e," ",JSON.stringify(n.edge(e))),d.Rm.info("Fix",w,"ids:",e.v,e.w,"Translating: ",w.get(e.v),w.get(e.w)),await(0,r.jP)(m,t)}));await Promise.all(e)}),"processEdges");await v(),d.Rm.info("Graph before layout:",JSON.stringify(h(n))),d.Rm.info("############################################# XXX"),d.Rm.info("### Layout ### XXX"),d.Rm.info("############################################# XXX"),(0,s.Zp)(n),d.Rm.info("Graph after layout:",JSON.stringify(h(n)));let y=0,{subGraphTitleTotalMargin:X}=(0,a.O)(g);return await Promise.all(O(n).map((async function(e){const t=n.node(e);if(d.Rm.info("Position XBX => "+e+": ("+t.x,","+t.y,") width: ",t.width," height: ",t.height),t?.clusterNode)t.y+=X,d.Rm.info("A tainted cluster node XBX1",e,t.id,t.width,t.height,t.x,t.y,n.parent(e)),w.get(t.id).node=t,(0,i.U_)(t);else if(n.children(e).length>0){d.Rm.info("A pure cluster node XBX1",e,t.id,t.x,t.y,t.width,t.height,n.parent(e)),t.height+=X,n.node(t.parentId);const r=t?.padding/2||0,a=t?.labelBBox?.height||0,o=a-r||0;d.Rm.debug("OffsetY",o,"labelHeight",a,"halfPadding",r),await(0,i.U)(p,t),w.get(t.id).node=t}else{const e=n.node(t.parentId);t.y+=X/2,d.Rm.info("A regular node XBX1 - using the padding",t.id,"parent",t.parentId,t.width,t.height,t.x,t.y,"offsetY",t.offsetY,"parent",e,e?.offsetY,t),(0,i.U_)(t)}}))),n.edges().forEach((function(e){const i=n.edge(e);d.Rm.info("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(i),i),i.points.forEach((e=>e.y+=X/2));const a=n.node(e.v);var s=n.node(e.w);const c=(0,r.Jo)(u,i,w,t,a,s,o);(0,r.T_)(i,c)})),n.nodes().forEach((function(e){const t=n.node(e);d.Rm.info(e,t.type,t.diff),t.isGroup&&(y=t.diff)})),d.Rm.warn("Returning from recursive render XAX",f,y),{elem:f,diff:y}}),"recursiveRender"),K=(0,d.K2)((async(e,n)=>{const t=new m.T({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.config?.flowchart?.nodeSpacing||e.nodeSpacing,ranksep:e.config?.rankSpacing||e.config?.flowchart?.rankSpacing||e.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel((function(){return{}})),a=n.select("g");(0,r.g0)(a,e.markers,e.type,e.diagramId),(0,i.gh)(),(0,r.IU)(),(0,i.IU)(),y(),e.nodes.forEach((e=>{t.setNode(e.id,{...e}),e.parentId&&t.setParent(e.id,e.parentId)})),d.Rm.debug("Edges:",e.edges),e.edges.forEach((e=>{if(e.start===e.end){const n=e.start,r=n+"---"+n+"---1",i=n+"---"+n+"---2",a=t.node(n);t.setNode(r,{domId:r,id:r,parentId:a.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),t.setParent(r,a.parentId),t.setNode(i,{domId:i,id:i,parentId:a.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),t.setParent(i,a.parentId);const o=structuredClone(e),d=structuredClone(e),s=structuredClone(e);o.label="",o.arrowTypeEnd="none",o.id=n+"-cyclic-special-1",d.arrowTypeStart="none",d.arrowTypeEnd="none",d.id=n+"-cyclic-special-mid",s.label="",a.isGroup&&(o.fromCluster=n,s.toCluster=n),s.id=n+"-cyclic-special-2",s.arrowTypeStart="none",t.setEdge(n,r,o,n+"-cyclic-special-0"),t.setEdge(r,i,d,n+"-cyclic-special-1"),t.setEdge(i,n,s,n+"-cyc<lic-special-2")}else t.setEdge(e.start,e.end,{...e},e.id)})),d.Rm.warn("Graph at first:",JSON.stringify(h(t))),I(t),d.Rm.warn("Graph after XAX:",JSON.stringify(h(t)));const s=(0,o.D7)();await k(a,t,e.type,e.diagramId,void 0,s)}),"render")}}]);