import{a as tr}from"./chunk-JQRUD6KW.mjs";import{a as _e}from"./chunk-2T2R6R2M.mjs";import"./chunk-UP6H54XL.mjs";import"./chunk-UXSXWOXI.mjs";import"./chunk-C62D2QBJ.mjs";import"./chunk-CEXFNPSA.mjs";import"./chunk-RERM46MO.mjs";import"./chunk-J5EP6P6S.mjs";import"./chunk-RLI5ZMPA.mjs";import"./chunk-2UTLFMKG.mjs";import"./chunk-RKZBBQEN.mjs";import{a as er}from"./chunk-LRIF4GLE.mjs";import{a as Ne}from"./chunk-3SSMPTDK.mjs";import{a as He,b as We,c as ue,f as de}from"./chunk-INKRHTLW.mjs";import{o as Ke,s as je}from"./chunk-QA3QBVWF.mjs";import"./chunk-KNLZD3CH.mjs";import{A as Xe,P as Ve,S as ze,T as Be,U as $e,V as ke,W as Ze,X as Je,Y as qe,_ as ge,j as Ye,t as Ue}from"./chunk-67TQ5CYL.mjs";import{b as fe,h as Qe}from"./chunk-7W6UQGC5.mjs";import"./chunk-KGYTTC2M.mjs";import"./chunk-4R4BOZG6.mjs";import{a as L,b as Ae,d as mr}from"./chunk-AQ6EADP3.mjs";var xe=Ae((se,Me)=>{"use strict";L((function(C,T){typeof se=="object"&&typeof Me=="object"?Me.exports=T():typeof define=="function"&&define.amd?define([],T):typeof se=="object"?se.layoutBase=T():C.layoutBase=T()}),"webpackUniversalModuleDefinition")(se,function(){return(function(D){var C={};function T(u){if(C[u])return C[u].exports;var h=C[u]={i:u,l:!1,exports:{}};return D[u].call(h.exports,h,h.exports,T),h.l=!0,h.exports}return L(T,"__webpack_require__"),T.m=D,T.c=C,T.i=function(u){return u},T.d=function(u,h,a){T.o(u,h)||Object.defineProperty(u,h,{configurable:!1,enumerable:!0,get:a})},T.n=function(u){var h=u&&u.__esModule?L(function(){return u.default},"getDefault"):L(function(){return u},"getModuleExports");return T.d(h,"a",h),h},T.o=function(u,h){return Object.prototype.hasOwnProperty.call(u,h)},T.p="",T(T.s=28)})([(function(D,C,T){"use strict";function u(){}L(u,"LayoutConstants"),u.QUALITY=1,u.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,u.DEFAULT_INCREMENTAL=!1,u.DEFAULT_ANIMATION_ON_LAYOUT=!0,u.DEFAULT_ANIMATION_DURING_LAYOUT=!1,u.DEFAULT_ANIMATION_PERIOD=50,u.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,u.DEFAULT_GRAPH_MARGIN=15,u.NODE_DIMENSIONS_INCLUDE_LABELS=!1,u.SIMPLE_NODE_SIZE=40,u.SIMPLE_NODE_HALF_SIZE=u.SIMPLE_NODE_SIZE/2,u.EMPTY_COMPOUND_NODE_SIZE=40,u.MIN_EDGE_LENGTH=1,u.WORLD_BOUNDARY=1e6,u.INITIAL_WORLD_BOUNDARY=u.WORLD_BOUNDARY/1e3,u.WORLD_CENTER_X=1200,u.WORLD_CENTER_Y=900,D.exports=u}),(function(D,C,T){"use strict";var u=T(2),h=T(8),a=T(9);function i(c,t,f){u.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=c,this.target=t}L(i,"LEdge"),i.prototype=Object.create(u.prototype);for(var n in u)i[n]=u[n];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(c){if(this.source===c)return this.target;if(this.target===c)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(c,t){for(var f=this.getOtherEnd(c),e=t.getGraphManager().getRoot();;){if(f.getOwner()==t)return f;if(f.getOwner()==e)break;f=f.getOwner().getParent()}return null},i.prototype.updateLength=function(){var c=new Array(4);this.isOverlapingSourceAndTarget=h.getIntersection(this.target.getRect(),this.source.getRect(),c),this.isOverlapingSourceAndTarget||(this.lengthX=c[0]-c[2],this.lengthY=c[1]-c[3],Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},i.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},D.exports=i}),(function(D,C,T){"use strict";function u(h){this.vGraphObject=h}L(u,"LGraphObject"),D.exports=u}),(function(D,C,T){"use strict";var u=T(2),h=T(10),a=T(13),i=T(0),n=T(16),c=T(5);function t(e,r,l,g){l==null&&g==null&&(g=r),u.call(this,g),e.graphManager!=null&&(e=e.graphManager),this.estimatedSize=h.MIN_VALUE,this.inclusionTreeDepth=h.MAX_VALUE,this.vGraphObject=g,this.edges=[],this.graphManager=e,l!=null&&r!=null?this.rect=new a(r.x,r.y,l.width,l.height):this.rect=new a}L(t,"LNode"),t.prototype=Object.create(u.prototype);for(var f in u)t[f]=u[f];t.prototype.getEdges=function(){return this.edges},t.prototype.getChild=function(){return this.child},t.prototype.getOwner=function(){return this.owner},t.prototype.getWidth=function(){return this.rect.width},t.prototype.setWidth=function(e){this.rect.width=e},t.prototype.getHeight=function(){return this.rect.height},t.prototype.setHeight=function(e){this.rect.height=e},t.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},t.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},t.prototype.getCenter=function(){return new c(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},t.prototype.getLocation=function(){return new c(this.rect.x,this.rect.y)},t.prototype.getRect=function(){return this.rect},t.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},t.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},t.prototype.setRect=function(e,r){this.rect.x=e.x,this.rect.y=e.y,this.rect.width=r.width,this.rect.height=r.height},t.prototype.setCenter=function(e,r){this.rect.x=e-this.rect.width/2,this.rect.y=r-this.rect.height/2},t.prototype.setLocation=function(e,r){this.rect.x=e,this.rect.y=r},t.prototype.moveBy=function(e,r){this.rect.x+=e,this.rect.y+=r},t.prototype.getEdgeListToNode=function(e){var r=[],l,g=this;return g.edges.forEach(function(s){if(s.target==e){if(s.source!=g)throw"Incorrect edge source!";r.push(s)}}),r},t.prototype.getEdgesBetween=function(e){var r=[],l,g=this;return g.edges.forEach(function(s){if(!(s.source==g||s.target==g))throw"Incorrect edge source and/or target";(s.target==e||s.source==e)&&r.push(s)}),r},t.prototype.getNeighborsList=function(){var e=new Set,r=this;return r.edges.forEach(function(l){if(l.source==r)e.add(l.target);else{if(l.target!=r)throw"Incorrect incidency!";e.add(l.source)}}),e},t.prototype.withChildren=function(){var e=new Set,r,l;if(e.add(this),this.child!=null)for(var g=this.child.getNodes(),s=0;sr?(this.rect.x-=(this.labelWidth-r)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(r+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(l+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>l?(this.rect.y-=(this.labelHeight-l)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(l+this.labelHeight))}}},t.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==h.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},t.prototype.transform=function(e){var r=this.rect.x;r>i.WORLD_BOUNDARY?r=i.WORLD_BOUNDARY:r<-i.WORLD_BOUNDARY&&(r=-i.WORLD_BOUNDARY);var l=this.rect.y;l>i.WORLD_BOUNDARY?l=i.WORLD_BOUNDARY:l<-i.WORLD_BOUNDARY&&(l=-i.WORLD_BOUNDARY);var g=new c(r,l),s=e.inverseTransformPoint(g);this.setLocation(s.x,s.y)},t.prototype.getLeft=function(){return this.rect.x},t.prototype.getRight=function(){return this.rect.x+this.rect.width},t.prototype.getTop=function(){return this.rect.y},t.prototype.getBottom=function(){return this.rect.y+this.rect.height},t.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},D.exports=t}),(function(D,C,T){"use strict";var u=T(0);function h(){}L(h,"FDLayoutConstants");for(var a in u)h[a]=u[a];h.MAX_ITERATIONS=2500,h.DEFAULT_EDGE_LENGTH=50,h.DEFAULT_SPRING_STRENGTH=.45,h.DEFAULT_REPULSION_STRENGTH=4500,h.DEFAULT_GRAVITY_STRENGTH=.4,h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,h.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,h.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,h.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,h.COOLING_ADAPTATION_FACTOR=.33,h.ADAPTATION_LOWER_NODE_LIMIT=1e3,h.ADAPTATION_UPPER_NODE_LIMIT=5e3,h.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,h.MAX_NODE_DISPLACEMENT=h.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,h.MIN_REPULSION_DIST=h.DEFAULT_EDGE_LENGTH/10,h.CONVERGENCE_CHECK_PERIOD=100,h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,h.MIN_EDGE_LENGTH=1,h.GRID_CALCULATION_CHECK_PERIOD=10,D.exports=h}),(function(D,C,T){"use strict";function u(h,a){h==null&&a==null?(this.x=0,this.y=0):(this.x=h,this.y=a)}L(u,"PointD"),u.prototype.getX=function(){return this.x},u.prototype.getY=function(){return this.y},u.prototype.setX=function(h){this.x=h},u.prototype.setY=function(h){this.y=h},u.prototype.getDifference=function(h){return new DimensionD(this.x-h.x,this.y-h.y)},u.prototype.getCopy=function(){return new u(this.x,this.y)},u.prototype.translate=function(h){return this.x+=h.width,this.y+=h.height,this},D.exports=u}),(function(D,C,T){"use strict";var u=T(2),h=T(10),a=T(0),i=T(7),n=T(3),c=T(1),t=T(13),f=T(12),e=T(11);function r(g,s,A){u.call(this,A),this.estimatedSize=h.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=g,s!=null&&s instanceof i?this.graphManager=s:s!=null&&s instanceof Layout&&(this.graphManager=s.graphManager)}L(r,"LGraph"),r.prototype=Object.create(u.prototype);for(var l in u)r[l]=u[l];r.prototype.getNodes=function(){return this.nodes},r.prototype.getEdges=function(){return this.edges},r.prototype.getGraphManager=function(){return this.graphManager},r.prototype.getParent=function(){return this.parent},r.prototype.getLeft=function(){return this.left},r.prototype.getRight=function(){return this.right},r.prototype.getTop=function(){return this.top},r.prototype.getBottom=function(){return this.bottom},r.prototype.isConnected=function(){return this.isConnected},r.prototype.add=function(g,s,A){if(s==null&&A==null){var y=g;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(y)>-1)throw"Node already in graph!";return y.owner=this,this.getNodes().push(y),y}else{var v=g;if(!(this.getNodes().indexOf(s)>-1&&this.getNodes().indexOf(A)>-1))throw"Source or target not in graph!";if(!(s.owner==A.owner&&s.owner==this))throw"Both owners must be this graph!";return s.owner!=A.owner?null:(v.source=s,v.target=A,v.isInterGraph=!1,this.getEdges().push(v),s.edges.push(v),A!=s&&A.edges.push(v),v)}},r.prototype.remove=function(g){var s=g;if(g instanceof n){if(s==null)throw"Node is null!";if(!(s.owner!=null&&s.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var A=s.edges.slice(),y,v=A.length,N=0;N-1&&P>-1))throw"Source and/or target doesn't know this edge!";y.source.edges.splice(w,1),y.target!=y.source&&y.target.edges.splice(P,1);var S=y.source.owner.getEdges().indexOf(y);if(S==-1)throw"Not in owner's edge list!";y.source.owner.getEdges().splice(S,1)}},r.prototype.updateLeftTop=function(){for(var g=h.MAX_VALUE,s=h.MAX_VALUE,A,y,v,N=this.getNodes(),S=N.length,w=0;wA&&(g=A),s>y&&(s=y)}return g==h.MAX_VALUE?null:(N[0].getParent().paddingLeft!=null?v=N[0].getParent().paddingLeft:v=this.margin,this.left=s-v,this.top=g-v,new f(this.left,this.top))},r.prototype.updateBounds=function(g){for(var s=h.MAX_VALUE,A=-h.MAX_VALUE,y=h.MAX_VALUE,v=-h.MAX_VALUE,N,S,w,P,V,Y=this.nodes,K=Y.length,I=0;IN&&(s=N),Aw&&(y=w),vN&&(s=N),Aw&&(y=w),v=this.nodes.length){var K=0;A.forEach(function(I){I.owner==g&&K++}),K==this.nodes.length&&(this.isConnected=!0)}},D.exports=r}),(function(D,C,T){"use strict";var u,h=T(1);function a(i){u=T(6),this.layout=i,this.graphs=[],this.edges=[]}L(a,"LGraphManager"),a.prototype.addRoot=function(){var i=this.layout.newGraph(),n=this.layout.newNode(null),c=this.add(i,n);return this.setRootGraph(c),this.rootGraph},a.prototype.add=function(i,n,c,t,f){if(c==null&&t==null&&f==null){if(i==null)throw"Graph is null!";if(n==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(n.child!=null)throw"Already has a child!";return i.parent=n,n.child=i,i}else{f=c,t=n,c=i;var e=t.getOwner(),r=f.getOwner();if(!(e!=null&&e.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(r!=null&&r.getGraphManager()==this))throw"Target not in this graph mgr!";if(e==r)return c.isInterGraph=!1,e.add(c,t,f);if(c.isInterGraph=!0,c.source=t,c.target=f,this.edges.indexOf(c)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(c),!(c.source!=null&&c.target!=null))throw"Edge source and/or target is null!";if(!(c.source.edges.indexOf(c)==-1&&c.target.edges.indexOf(c)==-1))throw"Edge already in source and/or target incidency list!";return c.source.edges.push(c),c.target.edges.push(c),c}},a.prototype.remove=function(i){if(i instanceof u){var n=i;if(n.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(n==this.rootGraph||n.parent!=null&&n.parent.graphManager==this))throw"Invalid parent node!";var c=[];c=c.concat(n.getEdges());for(var t,f=c.length,e=0;e=i.getRight()?n[0]+=Math.min(i.getX()-a.getX(),a.getRight()-i.getRight()):i.getX()<=a.getX()&&i.getRight()>=a.getRight()&&(n[0]+=Math.min(a.getX()-i.getX(),i.getRight()-a.getRight())),a.getY()<=i.getY()&&a.getBottom()>=i.getBottom()?n[1]+=Math.min(i.getY()-a.getY(),a.getBottom()-i.getBottom()):i.getY()<=a.getY()&&i.getBottom()>=a.getBottom()&&(n[1]+=Math.min(a.getY()-i.getY(),i.getBottom()-a.getBottom()));var f=Math.abs((i.getCenterY()-a.getCenterY())/(i.getCenterX()-a.getCenterX()));i.getCenterY()===a.getCenterY()&&i.getCenterX()===a.getCenterX()&&(f=1);var e=f*n[0],r=n[1]/f;n[0]e)return n[0]=c,n[1]=l,n[2]=f,n[3]=Y,!1;if(tf)return n[0]=r,n[1]=t,n[2]=P,n[3]=e,!1;if(cf?(n[0]=s,n[1]=A,o=!0):(n[0]=g,n[1]=l,o=!0):d===p&&(c>f?(n[0]=r,n[1]=l,o=!0):(n[0]=y,n[1]=A,o=!0)),-E===p?f>c?(n[2]=V,n[3]=Y,m=!0):(n[2]=P,n[3]=w,m=!0):E===p&&(f>c?(n[2]=S,n[3]=w,m=!0):(n[2]=K,n[3]=Y,m=!0)),o&&m)return!1;if(c>f?t>e?(O=this.getCardinalDirection(d,p,4),x=this.getCardinalDirection(E,p,2)):(O=this.getCardinalDirection(-d,p,3),x=this.getCardinalDirection(-E,p,1)):t>e?(O=this.getCardinalDirection(-d,p,1),x=this.getCardinalDirection(-E,p,3)):(O=this.getCardinalDirection(d,p,2),x=this.getCardinalDirection(E,p,4)),!o)switch(O){case 1:b=l,G=c+-N/p,n[0]=G,n[1]=b;break;case 2:G=y,b=t+v*p,n[0]=G,n[1]=b;break;case 3:b=A,G=c+N/p,n[0]=G,n[1]=b;break;case 4:G=s,b=t+-v*p,n[0]=G,n[1]=b;break}if(!m)switch(x){case 1:J=w,R=f+-B/p,n[2]=R,n[3]=J;break;case 2:R=K,J=e+I*p,n[2]=R,n[3]=J;break;case 3:J=Y,R=f+B/p,n[2]=R,n[3]=J;break;case 4:R=V,J=e+-I*p,n[2]=R,n[3]=J;break}}return!1},h.getCardinalDirection=function(a,i,n){return a>i?n:1+n%4},h.getIntersection=function(a,i,n,c){if(c==null)return this.getIntersection2(a,i,n);var t=a.x,f=a.y,e=i.x,r=i.y,l=n.x,g=n.y,s=c.x,A=c.y,y=void 0,v=void 0,N=void 0,S=void 0,w=void 0,P=void 0,V=void 0,Y=void 0,K=void 0;return N=r-f,w=t-e,V=e*f-t*r,S=A-g,P=l-s,Y=s*g-l*A,K=N*P-S*w,K===0?null:(y=(w*Y-P*V)/K,v=(S*V-N*Y)/K,new u(y,v))},h.angleOfVector=function(a,i,n,c){var t=void 0;return a!==n?(t=Math.atan((c-i)/(n-a)),n=0){var A=(-l+Math.sqrt(l*l-4*r*g))/(2*r),y=(-l-Math.sqrt(l*l-4*r*g))/(2*r),v=null;return A>=0&&A<=1?[A]:y>=0&&y<=1?[y]:v}else return null},h.HALF_PI=.5*Math.PI,h.ONE_AND_HALF_PI=1.5*Math.PI,h.TWO_PI=2*Math.PI,h.THREE_PI=3*Math.PI,D.exports=h}),(function(D,C,T){"use strict";function u(){}L(u,"IMath"),u.sign=function(h){return h>0?1:h<0?-1:0},u.floor=function(h){return h<0?Math.ceil(h):Math.floor(h)},u.ceil=function(h){return h<0?Math.floor(h):Math.ceil(h)},D.exports=u}),(function(D,C,T){"use strict";function u(){}L(u,"Integer"),u.MAX_VALUE=2147483647,u.MIN_VALUE=-2147483648,D.exports=u}),(function(D,C,T){"use strict";var u=(function(){function t(f,e){for(var r=0;r"u"?"undefined":u(a);return a==null||i!="object"&&i!="function"},D.exports=h}),(function(D,C,T){"use strict";function u(l){if(Array.isArray(l)){for(var g=0,s=Array(l.length);g0&&g;){for(N.push(w[0]);N.length>0&&g;){var P=N[0];N.splice(0,1),v.add(P);for(var V=P.getEdges(),y=0;y-1&&w.splice(B,1)}v=new Set,S=new Map}}return l},r.prototype.createDummyNodesForBendpoints=function(l){for(var g=[],s=l.source,A=this.graphManager.calcLowestCommonAncestor(l.source,l.target),y=0;y0){for(var A=this.edgeToDummyNodes.get(s),y=0;y=0&&g.splice(Y,1);var K=S.getNeighborsList();K.forEach(function(o){if(s.indexOf(o)<0){var m=A.get(o),d=m-1;d==1&&P.push(o),A.set(o,d)}})}s=s.concat(P),(g.length==1||g.length==2)&&(y=!0,v=g[0])}return v},r.prototype.setGraphManager=function(l){this.graphManager=l},D.exports=r}),(function(D,C,T){"use strict";function u(){}L(u,"RandomSeed"),u.seed=1,u.x=0,u.nextDouble=function(){return u.x=Math.sin(u.seed++)*1e4,u.x-Math.floor(u.x)},D.exports=u}),(function(D,C,T){"use strict";var u=T(5);function h(a,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}L(h,"Transform"),h.prototype.getWorldOrgX=function(){return this.lworldOrgX},h.prototype.setWorldOrgX=function(a){this.lworldOrgX=a},h.prototype.getWorldOrgY=function(){return this.lworldOrgY},h.prototype.setWorldOrgY=function(a){this.lworldOrgY=a},h.prototype.getWorldExtX=function(){return this.lworldExtX},h.prototype.setWorldExtX=function(a){this.lworldExtX=a},h.prototype.getWorldExtY=function(){return this.lworldExtY},h.prototype.setWorldExtY=function(a){this.lworldExtY=a},h.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},h.prototype.setDeviceOrgX=function(a){this.ldeviceOrgX=a},h.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},h.prototype.setDeviceOrgY=function(a){this.ldeviceOrgY=a},h.prototype.getDeviceExtX=function(){return this.ldeviceExtX},h.prototype.setDeviceExtX=function(a){this.ldeviceExtX=a},h.prototype.getDeviceExtY=function(){return this.ldeviceExtY},h.prototype.setDeviceExtY=function(a){this.ldeviceExtY=a},h.prototype.transformX=function(a){var i=0,n=this.lworldExtX;return n!=0&&(i=this.ldeviceOrgX+(a-this.lworldOrgX)*this.ldeviceExtX/n),i},h.prototype.transformY=function(a){var i=0,n=this.lworldExtY;return n!=0&&(i=this.ldeviceOrgY+(a-this.lworldOrgY)*this.ldeviceExtY/n),i},h.prototype.inverseTransformX=function(a){var i=0,n=this.ldeviceExtX;return n!=0&&(i=this.lworldOrgX+(a-this.ldeviceOrgX)*this.lworldExtX/n),i},h.prototype.inverseTransformY=function(a){var i=0,n=this.ldeviceExtY;return n!=0&&(i=this.lworldOrgY+(a-this.ldeviceOrgY)*this.lworldExtY/n),i},h.prototype.inverseTransformPoint=function(a){var i=new u(this.inverseTransformX(a.x),this.inverseTransformY(a.y));return i},D.exports=h}),(function(D,C,T){"use strict";function u(e){if(Array.isArray(e)){for(var r=0,l=Array(e.length);ra.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*a.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(e-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-a.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT_INCREMENTAL):(e>a.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(a.COOLING_ADAPTATION_FACTOR,1-(e-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*(1-a.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*a.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},t.prototype.calcSpringForces=function(){for(var e=this.getAllEdges(),r,l=0;l0&&arguments[0]!==void 0?arguments[0]:!0,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,l,g,s,A,y=this.getAllNodes(),v;if(this.useFRGridVariant)for(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&e&&this.updateGrid(),v=new Set,l=0;lN||v>N)&&(e.gravitationForceX=-this.gravityConstant*s,e.gravitationForceY=-this.gravityConstant*A)):(N=r.getEstimatedSize()*this.compoundGravityRangeFactor,(y>N||v>N)&&(e.gravitationForceX=-this.gravityConstant*s*this.compoundGravityConstant,e.gravitationForceY=-this.gravityConstant*A*this.compoundGravityConstant))},t.prototype.isConverged=function(){var e,r=!1;return this.totalIterations>this.maxIterations/3&&(r=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),e=this.totalDisplacement=y.length||N>=y[0].length)){for(var S=0;St},"_defaultCompareFunction")}]),n})();D.exports=i}),(function(D,C,T){"use strict";function u(){}L(u,"SVD"),u.svd=function(h){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=h.length,this.n=h[0].length;var a=Math.min(this.m,this.n);this.s=(function(xt){for(var At=[];xt-- >0;)At.push(0);return At})(Math.min(this.m+1,this.n)),this.U=(function(xt){var At=L(function $t(Rt){if(Rt.length==0)return 0;for(var Xt=[],zt=0;zt0;)At.push(0);return At})(this.n),n=(function(xt){for(var At=[];xt-- >0;)At.push(0);return At})(this.m),c=!0,t=!0,f=Math.min(this.m-1,this.n),e=Math.max(0,Math.min(this.n-2,this.m)),r=0;r=0;p--)if(this.s[p]!==0){for(var O=p+1;O=0;F--){if((function(xt,At){return xt&&At})(F0;){var Q=void 0,Yt=void 0;for(Q=m-2;Q>=-1&&Q!==-1;Q--)if(Math.abs(i[Q])<=St+Nt*(Math.abs(this.s[Q])+Math.abs(this.s[Q+1]))){i[Q]=0;break}if(Q===m-2)Yt=4;else{var wt=void 0;for(wt=m-1;wt>=Q&&wt!==Q;wt--){var ot=(wt!==m?Math.abs(i[wt]):0)+(wt!==Q+1?Math.abs(i[wt-1]):0);if(Math.abs(this.s[wt])<=St+Nt*ot){this.s[wt]=0;break}}wt===Q?Yt=3:wt===m-1?Yt=1:(Yt=2,Q=wt)}switch(Q++,Yt){case 1:{var rt=i[m-2];i[m-2]=0;for(var vt=m-2;vt>=Q;vt--){var mt=u.hypot(this.s[vt],rt),Lt=this.s[vt]/mt,Et=rt/mt;if(this.s[vt]=mt,vt!==Q&&(rt=-Et*i[vt-1],i[vt-1]=Lt*i[vt-1]),t)for(var Tt=0;Tt=this.s[Q+1]);){var ct=this.s[Q];if(this.s[Q]=this.s[Q+1],this.s[Q+1]=ct,t&&QMath.abs(a)?(i=a/h,i=Math.abs(h)*Math.sqrt(1+i*i)):a!=0?(i=h/a,i=Math.abs(a)*Math.sqrt(1+i*i)):i=0,i},D.exports=u}),(function(D,C,T){"use strict";var u=(function(){function i(n,c){for(var t=0;t2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,e=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;h(this,i),this.sequence1=n,this.sequence2=c,this.match_score=t,this.mismatch_penalty=f,this.gap_penalty=e,this.iMax=n.length+1,this.jMax=c.length+1,this.grid=new Array(this.iMax);for(var r=0;r=0;n--){var c=this.listeners[n];c.event===a&&c.callback===i&&this.listeners.splice(n,1)}},h.emit=function(a,i){for(var n=0;n{"use strict";L((function(C,T){typeof he=="object"&&typeof Oe=="object"?Oe.exports=T(xe()):typeof define=="function"&&define.amd?define(["layout-base"],T):typeof he=="object"?he.coseBase=T(xe()):C.coseBase=T(C.layoutBase)}),"webpackUniversalModuleDefinition")(he,function(D){return(()=>{"use strict";var C={45:((a,i,n)=>{var c={};c.layoutBase=n(551),c.CoSEConstants=n(806),c.CoSEEdge=n(767),c.CoSEGraph=n(880),c.CoSEGraphManager=n(578),c.CoSELayout=n(765),c.CoSENode=n(991),c.ConstraintHandler=n(902),a.exports=c}),806:((a,i,n)=>{var c=n(551).FDLayoutConstants;function t(){}L(t,"CoSEConstants");for(var f in c)t[f]=c[f];t.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,t.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH,t.DEFAULT_COMPONENT_SEPERATION=60,t.TILE=!0,t.TILING_PADDING_VERTICAL=10,t.TILING_PADDING_HORIZONTAL=10,t.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,t.ENFORCE_CONSTRAINTS=!0,t.APPLY_LAYOUT=!0,t.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,t.TREE_REDUCTION_ON_INCREMENTAL=!0,t.PURE_INCREMENTAL=t.DEFAULT_INCREMENTAL,a.exports=t}),767:((a,i,n)=>{var c=n(551).FDLayoutEdge;function t(e,r,l){c.call(this,e,r,l)}L(t,"CoSEEdge"),t.prototype=Object.create(c.prototype);for(var f in c)t[f]=c[f];a.exports=t}),880:((a,i,n)=>{var c=n(551).LGraph;function t(e,r,l){c.call(this,e,r,l)}L(t,"CoSEGraph"),t.prototype=Object.create(c.prototype);for(var f in c)t[f]=c[f];a.exports=t}),578:((a,i,n)=>{var c=n(551).LGraphManager;function t(e){c.call(this,e)}L(t,"CoSEGraphManager"),t.prototype=Object.create(c.prototype);for(var f in c)t[f]=c[f];a.exports=t}),765:((a,i,n)=>{var c=n(551).FDLayout,t=n(578),f=n(880),e=n(991),r=n(767),l=n(806),g=n(902),s=n(551).FDLayoutConstants,A=n(551).LayoutConstants,y=n(551).Point,v=n(551).PointD,N=n(551).DimensionD,S=n(551).Layout,w=n(551).Integer,P=n(551).IGeometry,V=n(551).LGraph,Y=n(551).Transform,K=n(551).LinkedList;function I(){c.call(this),this.toBeTiled={},this.constraints={}}L(I,"CoSELayout"),I.prototype=Object.create(c.prototype);for(var B in c)I[B]=c[B];I.prototype.newGraphManager=function(){var o=new t(this);return this.graphManager=o,o},I.prototype.newGraph=function(o){return new f(null,this.graphManager,o)},I.prototype.newNode=function(o){return new e(this.graphManager,o)},I.prototype.newEdge=function(o){return new r(null,null,o)},I.prototype.initParameters=function(){c.prototype.initParameters.call(this,arguments),this.isSubLayout||(l.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=l.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=s.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=s.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=s.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},I.prototype.initSpringEmbedder=function(){c.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/s.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},I.prototype.layout=function(){var o=A.DEFAULT_CREATE_BENDS_AS_NEEDED;return o&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},I.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(l.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var m=new Set(this.getAllNodes()),d=this.nodesWithGravity.filter(function(O){return m.has(O)});this.graphManager.setAllNodesToApplyGravitation(d)}}else{var o=this.getFlatForest();if(o.length>0)this.positionNodesRadially(o);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var m=new Set(this.getAllNodes()),d=this.nodesWithGravity.filter(function(E){return m.has(E)});this.graphManager.setAllNodesToApplyGravitation(d),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(g.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),l.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},I.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%s.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var o=new Set(this.getAllNodes()),m=this.nodesWithGravity.filter(function(p){return o.has(p)});this.graphManager.setAllNodesToApplyGravitation(m),this.graphManager.updateBounds(),this.updateGrid(),l.PURE_INCREMENTAL?this.coolingFactor=s.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=s.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),l.PURE_INCREMENTAL?this.coolingFactor=s.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=s.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var d=!this.isTreeGrowing&&!this.isGrowthFinished,E=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(d,E),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},I.prototype.getPositionsData=function(){for(var o=this.graphManager.getAllNodes(),m={},d=0;d0&&this.updateDisplacements();for(var d=0;d0&&(E.fixedNodeWeight=O)}}if(this.constraints.relativePlacementConstraint){var x=new Map,G=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(M){o.fixedNodesOnHorizontal.add(M),o.fixedNodesOnVertical.add(M)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var b=this.constraints.alignmentConstraint.vertical,d=0;d=2*M.length/3;j--)X=Math.floor(Math.random()*(j+1)),H=M[j],M[j]=M[X],M[X]=H;return M},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(M){if(M.left){var X=x.has(M.left)?x.get(M.left):M.left,H=x.has(M.right)?x.get(M.right):M.right;o.nodesInRelativeHorizontal.includes(X)||(o.nodesInRelativeHorizontal.push(X),o.nodeToRelativeConstraintMapHorizontal.set(X,[]),o.dummyToNodeForVerticalAlignment.has(X)?o.nodeToTempPositionMapHorizontal.set(X,o.idToNodeMap.get(o.dummyToNodeForVerticalAlignment.get(X)[0]).getCenterX()):o.nodeToTempPositionMapHorizontal.set(X,o.idToNodeMap.get(X).getCenterX())),o.nodesInRelativeHorizontal.includes(H)||(o.nodesInRelativeHorizontal.push(H),o.nodeToRelativeConstraintMapHorizontal.set(H,[]),o.dummyToNodeForVerticalAlignment.has(H)?o.nodeToTempPositionMapHorizontal.set(H,o.idToNodeMap.get(o.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):o.nodeToTempPositionMapHorizontal.set(H,o.idToNodeMap.get(H).getCenterX())),o.nodeToRelativeConstraintMapHorizontal.get(X).push({right:H,gap:M.gap}),o.nodeToRelativeConstraintMapHorizontal.get(H).push({left:X,gap:M.gap})}else{var j=G.has(M.top)?G.get(M.top):M.top,ht=G.has(M.bottom)?G.get(M.bottom):M.bottom;o.nodesInRelativeVertical.includes(j)||(o.nodesInRelativeVertical.push(j),o.nodeToRelativeConstraintMapVertical.set(j,[]),o.dummyToNodeForHorizontalAlignment.has(j)?o.nodeToTempPositionMapVertical.set(j,o.idToNodeMap.get(o.dummyToNodeForHorizontalAlignment.get(j)[0]).getCenterY()):o.nodeToTempPositionMapVertical.set(j,o.idToNodeMap.get(j).getCenterY())),o.nodesInRelativeVertical.includes(ht)||(o.nodesInRelativeVertical.push(ht),o.nodeToRelativeConstraintMapVertical.set(ht,[]),o.dummyToNodeForHorizontalAlignment.has(ht)?o.nodeToTempPositionMapVertical.set(ht,o.idToNodeMap.get(o.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()):o.nodeToTempPositionMapVertical.set(ht,o.idToNodeMap.get(ht).getCenterY())),o.nodeToRelativeConstraintMapVertical.get(j).push({bottom:ht,gap:M.gap}),o.nodeToRelativeConstraintMapVertical.get(ht).push({top:j,gap:M.gap})}});else{var J=new Map,et=new Map;this.constraints.relativePlacementConstraint.forEach(function(M){if(M.left){var X=x.has(M.left)?x.get(M.left):M.left,H=x.has(M.right)?x.get(M.right):M.right;J.has(X)?J.get(X).push(H):J.set(X,[H]),J.has(H)?J.get(H).push(X):J.set(H,[X])}else{var j=G.has(M.top)?G.get(M.top):M.top,ht=G.has(M.bottom)?G.get(M.bottom):M.bottom;et.has(j)?et.get(j).push(ht):et.set(j,[ht]),et.has(ht)?et.get(ht).push(j):et.set(ht,[j])}});var F=L(function(X,H){var j=[],ht=[],Nt=new K,St=new Set,Q=0;return X.forEach(function(Yt,wt){if(!St.has(wt)){j[Q]=[],ht[Q]=!1;var ot=wt;for(Nt.push(ot),St.add(ot),j[Q].push(ot);Nt.length!=0;){ot=Nt.shift(),H.has(ot)&&(ht[Q]=!0);var rt=X.get(ot);rt.forEach(function(vt){St.has(vt)||(Nt.push(vt),St.add(vt),j[Q].push(vt))})}Q++}}),{components:j,isFixed:ht}},"constructComponents"),tt=F(J,o.fixedNodesOnHorizontal);this.componentsOnHorizontal=tt.components,this.fixedComponentsOnHorizontal=tt.isFixed;var $=F(et,o.fixedNodesOnVertical);this.componentsOnVertical=$.components,this.fixedComponentsOnVertical=$.isFixed}}},I.prototype.updateDisplacements=function(){var o=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function($){var M=o.idToNodeMap.get($.nodeId);M.displacementX=0,M.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var m=this.constraints.alignmentConstraint.vertical,d=0;d1){var G;for(G=0;GE&&(E=Math.floor(x.y)),O=Math.floor(x.x+l.DEFAULT_COMPONENT_SEPERATION)}this.transform(new v(A.WORLD_CENTER_X-x.x/2,A.WORLD_CENTER_Y-x.y/2))},I.radialLayout=function(o,m,d){var E=Math.max(this.maxDiagonalInTree(o),l.DEFAULT_RADIAL_SEPARATION);I.branchRadialLayout(m,null,0,359,0,E);var p=V.calculateBounds(o),O=new Y;O.setDeviceOrgX(p.getMinX()),O.setDeviceOrgY(p.getMinY()),O.setWorldOrgX(d.x),O.setWorldOrgY(d.y);for(var x=0;x1;){var j=H[0];H.splice(0,1);var ht=F.indexOf(j);ht>=0&&F.splice(ht,1),M--,tt--}m!=null?X=(F.indexOf(H[0])+1)%M:X=0;for(var Nt=Math.abs(E-d)/tt,St=X;$!=tt;St=++St%M){var Q=F[St].getOtherEnd(o);if(Q!=m){var Yt=(d+$*Nt)%360,wt=(Yt+Nt)%360;I.branchRadialLayout(Q,o,Yt,wt,p+O,O),$++}}},I.maxDiagonalInTree=function(o){for(var m=w.MIN_VALUE,d=0;dm&&(m=p)}return m},I.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},I.prototype.groupZeroDegreeMembers=function(){var o=this,m={};this.memberGroups={},this.idToDummyNode={};for(var d=[],E=this.graphManager.getAllNodes(),p=0;p"u"&&(m[G]=[]),m[G]=m[G].concat(O)}Object.keys(m).forEach(function(b){if(m[b].length>1){var R="DummyCompound_"+b;o.memberGroups[R]=m[b];var J=m[b][0].getParent(),et=new e(o.graphManager);et.id=R,et.paddingLeft=J.paddingLeft||0,et.paddingRight=J.paddingRight||0,et.paddingBottom=J.paddingBottom||0,et.paddingTop=J.paddingTop||0,o.idToDummyNode[R]=et;var F=o.getGraphManager().add(o.newGraph(),et),tt=J.getChild();tt.add(et);for(var $=0;$p?(E.rect.x-=(E.labelWidth-p)/2,E.setWidth(E.labelWidth),E.labelMarginLeft=(E.labelWidth-p)/2):E.labelPosHorizontal=="right"&&E.setWidth(p+E.labelWidth)),E.labelHeight&&(E.labelPosVertical=="top"?(E.rect.y-=E.labelHeight,E.setHeight(O+E.labelHeight),E.labelMarginTop=E.labelHeight):E.labelPosVertical=="center"&&E.labelHeight>O?(E.rect.y-=(E.labelHeight-O)/2,E.setHeight(E.labelHeight),E.labelMarginTop=(E.labelHeight-O)/2):E.labelPosVertical=="bottom"&&E.setHeight(O+E.labelHeight))}})},I.prototype.repopulateCompounds=function(){for(var o=this.compoundOrder.length-1;o>=0;o--){var m=this.compoundOrder[o],d=m.id,E=m.paddingLeft,p=m.paddingTop,O=m.labelMarginLeft,x=m.labelMarginTop;this.adjustLocations(this.tiledMemberPack[d],m.rect.x,m.rect.y,E,p,O,x)}},I.prototype.repopulateZeroDegreeMembers=function(){var o=this,m=this.tiledZeroDegreePack;Object.keys(m).forEach(function(d){var E=o.idToDummyNode[d],p=E.paddingLeft,O=E.paddingTop,x=E.labelMarginLeft,G=E.labelMarginTop;o.adjustLocations(m[d],E.rect.x,E.rect.y,p,O,x,G)})},I.prototype.getToBeTiled=function(o){var m=o.id;if(this.toBeTiled[m]!=null)return this.toBeTiled[m];var d=o.getChild();if(d==null)return this.toBeTiled[m]=!1,!1;for(var E=d.getNodes(),p=0;p0)return this.toBeTiled[m]=!1,!1;if(O.getChild()==null){this.toBeTiled[O.id]=!1;continue}if(!this.getToBeTiled(O))return this.toBeTiled[m]=!1,!1}return this.toBeTiled[m]=!0,!0},I.prototype.getNodeDegree=function(o){for(var m=o.id,d=o.getEdges(),E=0,p=0;pJ&&(J=F.rect.height)}d+=J+o.verticalPadding}},I.prototype.tileCompoundMembers=function(o,m){var d=this;this.tiledMemberPack=[],Object.keys(o).forEach(function(E){var p=m[E];if(d.tiledMemberPack[E]=d.tileNodes(o[E],p.paddingLeft+p.paddingRight),p.rect.width=d.tiledMemberPack[E].width,p.rect.height=d.tiledMemberPack[E].height,p.setCenter(d.tiledMemberPack[E].centerX,d.tiledMemberPack[E].centerY),p.labelMarginLeft=0,p.labelMarginTop=0,l.NODE_DIMENSIONS_INCLUDE_LABELS){var O=p.rect.width,x=p.rect.height;p.labelWidth&&(p.labelPosHorizontal=="left"?(p.rect.x-=p.labelWidth,p.setWidth(O+p.labelWidth),p.labelMarginLeft=p.labelWidth):p.labelPosHorizontal=="center"&&p.labelWidth>O?(p.rect.x-=(p.labelWidth-O)/2,p.setWidth(p.labelWidth),p.labelMarginLeft=(p.labelWidth-O)/2):p.labelPosHorizontal=="right"&&p.setWidth(O+p.labelWidth)),p.labelHeight&&(p.labelPosVertical=="top"?(p.rect.y-=p.labelHeight,p.setHeight(x+p.labelHeight),p.labelMarginTop=p.labelHeight):p.labelPosVertical=="center"&&p.labelHeight>x?(p.rect.y-=(p.labelHeight-x)/2,p.setHeight(p.labelHeight),p.labelMarginTop=(p.labelHeight-x)/2):p.labelPosVertical=="bottom"&&p.setHeight(x+p.labelHeight))}})},I.prototype.tileNodes=function(o,m){var d=this.tileNodesByFavoringDim(o,m,!0),E=this.tileNodesByFavoringDim(o,m,!1),p=this.getOrgRatio(d),O=this.getOrgRatio(E),x;return OG&&(G=$.getWidth())});var b=O/p,R=x/p,J=Math.pow(d-E,2)+4*(b+E)*(R+d)*p,et=(E-d+Math.sqrt(J))/(2*(b+E)),F;m?(F=Math.ceil(et),F==et&&F++):F=Math.floor(et);var tt=F*(b+E)-E;return G>tt&&(tt=G),tt+=E*2,tt},I.prototype.tileNodesByFavoringDim=function(o,m,d){var E=l.TILING_PADDING_VERTICAL,p=l.TILING_PADDING_HORIZONTAL,O=l.TILING_COMPARE_BY,x={rows:[],rowWidth:[],rowHeight:[],width:0,height:m,verticalPadding:E,horizontalPadding:p,centerX:0,centerY:0};O&&(x.idealRowWidth=this.calcIdealRowWidth(o,d));var G=L(function(M){return M.rect.width*M.rect.height},"getNodeArea"),b=L(function(M,X){return G(X)-G(M)},"areaCompareFcn");o.sort(function($,M){var X=b;return x.idealRowWidth?(X=O,X($.id,M.id)):X($,M)});for(var R=0,J=0,et=0;et0&&(x+=o.horizontalPadding),o.rowWidth[d]=x,o.width0&&(G+=o.verticalPadding);var b=0;G>o.rowHeight[d]&&(b=o.rowHeight[d],o.rowHeight[d]=G,b=o.rowHeight[d]-b),o.height+=b,o.rows[d].push(m)},I.prototype.getShortestRowIndex=function(o){for(var m=-1,d=Number.MAX_VALUE,E=0;Ed&&(m=E,d=o.rowWidth[E]);return m},I.prototype.canAddHorizontal=function(o,m,d){if(o.idealRowWidth){var E=o.rows.length-1,p=o.rowWidth[E];return p+m+o.horizontalPadding<=o.idealRowWidth}var O=this.getShortestRowIndex(o);if(O<0)return!0;var x=o.rowWidth[O];if(x+o.horizontalPadding+m<=o.width)return!0;var G=0;o.rowHeight[O]0&&(G=d+o.verticalPadding-o.rowHeight[O]);var b;o.width-x>=m+o.horizontalPadding?b=(o.height+G)/(x+m+o.horizontalPadding):b=(o.height+G)/o.width,G=d+o.verticalPadding;var R;return o.widthO&&m!=d){E.splice(-1,1),o.rows[d].push(p),o.rowWidth[m]=o.rowWidth[m]-O,o.rowWidth[d]=o.rowWidth[d]+O,o.width=o.rowWidth[instance.getLongestRowIndex(o)];for(var x=Number.MIN_VALUE,G=0;Gx&&(x=E[G].height);m>0&&(x+=o.verticalPadding);var b=o.rowHeight[m]+o.rowHeight[d];o.rowHeight[m]=x,o.rowHeight[d]0)for(var tt=p;tt<=O;tt++)F[0]+=this.grid[tt][x-1].length+this.grid[tt][x].length-1;if(O0)for(var tt=x;tt<=G;tt++)F[3]+=this.grid[p-1][tt].length+this.grid[p][tt].length-1;for(var $=w.MAX_VALUE,M,X,H=0;H{var c=n(551).FDLayoutNode,t=n(551).IMath;function f(r,l,g,s){c.call(this,r,l,g,s)}L(f,"CoSENode"),f.prototype=Object.create(c.prototype);for(var e in c)f[e]=c[e];f.prototype.calculateDisplacement=function(){var r=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=r.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=r.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=r.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=r.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>r.coolingFactor*r.maxNodeDisplacement&&(this.displacementX=r.coolingFactor*r.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>r.coolingFactor*r.maxNodeDisplacement&&(this.displacementY=r.coolingFactor*r.maxNodeDisplacement*t.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},f.prototype.propogateDisplacementToChildren=function(r,l){for(var g=this.getChild().getNodes(),s,A=0;A{function c(g){if(Array.isArray(g)){for(var s=0,A=Array(g.length);s0){var dt=0;nt.forEach(function(ct){z=="horizontal"?(q.set(ct,y.has(ct)?v[y.get(ct)]:Z.get(ct)),dt+=q.get(ct)):(q.set(ct,y.has(ct)?N[y.get(ct)]:Z.get(ct)),dt+=q.get(ct))}),dt=dt/nt.length,st.forEach(function(ct){k.has(ct)||q.set(ct,dt)})}else{var at=0;st.forEach(function(ct){z=="horizontal"?at+=y.has(ct)?v[y.get(ct)]:Z.get(ct):at+=y.has(ct)?N[y.get(ct)]:Z.get(ct)}),at=at/st.length,st.forEach(function(ct){q.set(ct,at)})}});for(var it=L(function(){var nt=ut.shift(),dt=W.get(nt);dt.forEach(function(at){if(q.get(at.id)ct&&(ct=Xt),ztbt&&(bt=zt)}}catch(ee){Vt=!0,xt=ee}finally{try{!Ot&&At.return&&At.return()}finally{if(Vt)throw xt}}var ve=(dt+ct)/2-(at+bt)/2,qt=!0,jt=!1,_t=void 0;try{for(var Qt=st[Symbol.iterator](),ce;!(qt=(ce=Qt.next()).done);qt=!0){var te=ce.value;q.set(te,q.get(te)+ve)}}catch(ee){jt=!0,_t=ee}finally{try{!qt&&Qt.return&&Qt.return()}finally{if(jt)throw _t}}})}return q},"findAppropriatePositionForRelativePlacement"),B=L(function(W){var z=0,k=0,Z=0,_=0;if(W.forEach(function(lt){lt.left?v[y.get(lt.left)]-v[y.get(lt.right)]>=0?z++:k++:N[y.get(lt.top)]-N[y.get(lt.bottom)]>=0?Z++:_++}),z>k&&Z>_)for(var gt=0;gtk)for(var ft=0;ft_)for(var q=0;q1)s.fixedNodeConstraint.forEach(function(U,W){E[W]=[U.position.x,U.position.y],p[W]=[v[y.get(U.nodeId)],N[y.get(U.nodeId)]]}),O=!0;else if(s.alignmentConstraint)(function(){var U=0;if(s.alignmentConstraint.vertical){for(var W=s.alignmentConstraint.vertical,z=L(function(q){var lt=new Set;W[q].forEach(function(pt){lt.add(pt)});var ut=new Set([].concat(c(lt)).filter(function(pt){return G.has(pt)})),it=void 0;ut.size>0?it=v[y.get(ut.values().next().value)]:it=K(lt).x,W[q].forEach(function(pt){E[U]=[it,N[y.get(pt)]],p[U]=[v[y.get(pt)],N[y.get(pt)]],U++})},"_loop2"),k=0;k0?it=v[y.get(ut.values().next().value)]:it=K(lt).y,Z[q].forEach(function(pt){E[U]=[v[y.get(pt)],it],p[U]=[v[y.get(pt)],N[y.get(pt)]],U++})},"_loop3"),gt=0;gtet&&(et=J[tt].length,F=tt);if(et0){var Lt={x:0,y:0};s.fixedNodeConstraint.forEach(function(U,W){var z={x:v[y.get(U.nodeId)],y:N[y.get(U.nodeId)]},k=U.position,Z=Y(k,z);Lt.x+=Z.x,Lt.y+=Z.y}),Lt.x/=s.fixedNodeConstraint.length,Lt.y/=s.fixedNodeConstraint.length,v.forEach(function(U,W){v[W]+=Lt.x}),N.forEach(function(U,W){N[W]+=Lt.y}),s.fixedNodeConstraint.forEach(function(U){v[y.get(U.nodeId)]=U.position.x,N[y.get(U.nodeId)]=U.position.y})}if(s.alignmentConstraint){if(s.alignmentConstraint.vertical)for(var Et=s.alignmentConstraint.vertical,Tt=L(function(W){var z=new Set;Et[W].forEach(function(_){z.add(_)});var k=new Set([].concat(c(z)).filter(function(_){return G.has(_)})),Z=void 0;k.size>0?Z=v[y.get(k.values().next().value)]:Z=K(z).x,z.forEach(function(_){G.has(_)||(v[y.get(_)]=Z)})},"_loop4"),Mt=0;Mt0?Z=N[y.get(k.values().next().value)]:Z=K(z).y,z.forEach(function(_){G.has(_)||(N[y.get(_)]=Z)})},"_loop5"),Pt=0;Pt{a.exports=D})},T={};function u(a){var i=T[a];if(i!==void 0)return i.exports;var n=T[a]={exports:{}};return C[a](n,n.exports,u),n.exports}L(u,"__webpack_require__");var h=u(45);return h})()})});var cr=Ae((le,Re)=>{"use strict";L((function(C,T){typeof le=="object"&&typeof Re=="object"?Re.exports=T(Ie()):typeof define=="function"&&define.amd?define(["cose-base"],T):typeof le=="object"?le.cytoscapeFcose=T(Ie()):C.cytoscapeFcose=T(C.coseBase)}),"webpackUniversalModuleDefinition")(le,function(D){return(()=>{"use strict";var C={658:(a=>{a.exports=Object.assign!=null?Object.assign.bind(Object):function(i){for(var n=arguments.length,c=Array(n>1?n-1:0),t=1;t{var c=(function(){function e(r,l){var g=[],s=!0,A=!1,y=void 0;try{for(var v=r[Symbol.iterator](),N;!(s=(N=v.next()).done)&&(g.push(N.value),!(l&&g.length===l));s=!0);}catch(S){A=!0,y=S}finally{try{!s&&v.return&&v.return()}finally{if(A)throw y}}return g}return L(e,"sliceIterator"),function(r,l){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,l);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),t=n(140).layoutBase.LinkedList,f={};f.getTopMostNodes=function(e){for(var r={},l=0;l0&&O.merge(R)});for(var x=0;x1){N=y[0],S=N.connectedEdges().length,y.forEach(function(p){p.connectedEdges().length0&&g.set("dummy"+(g.size+1),V),Y},f.relocateComponent=function(e,r,l){if(!l.fixedNodeConstraint){var g=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,A=Number.POSITIVE_INFINITY,y=Number.NEGATIVE_INFINITY;if(l.quality=="draft"){var v=!0,N=!1,S=void 0;try{for(var w=r.nodeIndexes[Symbol.iterator](),P;!(v=(P=w.next()).done);v=!0){var V=P.value,Y=c(V,2),K=Y[0],I=Y[1],B=l.cy.getElementById(K);if(B){var o=B.boundingBox(),m=r.xCoords[I]-o.w/2,d=r.xCoords[I]+o.w/2,E=r.yCoords[I]-o.h/2,p=r.yCoords[I]+o.h/2;ms&&(s=d),Ey&&(y=p)}}}catch(R){N=!0,S=R}finally{try{!v&&w.return&&w.return()}finally{if(N)throw S}}var O=e.x-(s+g)/2,x=e.y-(y+A)/2;r.xCoords=r.xCoords.map(function(R){return R+O}),r.yCoords=r.yCoords.map(function(R){return R+x})}else{Object.keys(r).forEach(function(R){var J=r[R],et=J.getRect().x,F=J.getRect().x+J.getRect().width,tt=J.getRect().y,$=J.getRect().y+J.getRect().height;ets&&(s=F),tty&&(y=$)});var G=e.x-(s+g)/2,b=e.y-(y+A)/2;Object.keys(r).forEach(function(R){var J=r[R];J.setCenter(J.getCenterX()+G,J.getCenterY()+b)})}}},f.calcBoundingBox=function(e,r,l,g){for(var s=Number.MAX_SAFE_INTEGER,A=Number.MIN_SAFE_INTEGER,y=Number.MAX_SAFE_INTEGER,v=Number.MIN_SAFE_INTEGER,N=void 0,S=void 0,w=void 0,P=void 0,V=e.descendants().not(":parent"),Y=V.length,K=0;KN&&(s=N),Aw&&(y=w),v{var c=n(548),t=n(140).CoSELayout,f=n(140).CoSENode,e=n(140).layoutBase.PointD,r=n(140).layoutBase.DimensionD,l=n(140).layoutBase.LayoutConstants,g=n(140).layoutBase.FDLayoutConstants,s=n(140).CoSEConstants,A=L(function(v,N){var S=v.cy,w=v.eles,P=w.nodes(),V=w.edges(),Y=void 0,K=void 0,I=void 0,B={};v.randomize&&(Y=N.nodeIndexes,K=N.xCoords,I=N.yCoords);var o=L(function(R){return typeof R=="function"},"isFn"),m=L(function(R,J){return o(R)?R(J):R},"optFn"),d=c.calcParentsWithoutChildren(S,w),E=L(function b(R,J,et,F){for(var tt=J.length,$=0;$0){var Nt=void 0;Nt=et.getGraphManager().add(et.newGraph(),H),b(Nt,X,et,F)}}},"processChildrenList"),p=L(function(R,J,et){for(var F=0,tt=0,$=0;$0?s.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=F/tt:o(v.idealEdgeLength)?s.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=50:s.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=v.idealEdgeLength,s.MIN_REPULSION_DIST=g.MIN_REPULSION_DIST=g.DEFAULT_EDGE_LENGTH/10,s.DEFAULT_RADIAL_SEPARATION=g.DEFAULT_EDGE_LENGTH)},"processEdges"),O=L(function(R,J){J.fixedNodeConstraint&&(R.constraints.fixedNodeConstraint=J.fixedNodeConstraint),J.alignmentConstraint&&(R.constraints.alignmentConstraint=J.alignmentConstraint),J.relativePlacementConstraint&&(R.constraints.relativePlacementConstraint=J.relativePlacementConstraint)},"processConstraints");v.nestingFactor!=null&&(s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=g.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=v.nestingFactor),v.gravity!=null&&(s.DEFAULT_GRAVITY_STRENGTH=g.DEFAULT_GRAVITY_STRENGTH=v.gravity),v.numIter!=null&&(s.MAX_ITERATIONS=g.MAX_ITERATIONS=v.numIter),v.gravityRange!=null&&(s.DEFAULT_GRAVITY_RANGE_FACTOR=g.DEFAULT_GRAVITY_RANGE_FACTOR=v.gravityRange),v.gravityCompound!=null&&(s.DEFAULT_COMPOUND_GRAVITY_STRENGTH=g.DEFAULT_COMPOUND_GRAVITY_STRENGTH=v.gravityCompound),v.gravityRangeCompound!=null&&(s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=g.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=v.gravityRangeCompound),v.initialEnergyOnIncremental!=null&&(s.DEFAULT_COOLING_FACTOR_INCREMENTAL=g.DEFAULT_COOLING_FACTOR_INCREMENTAL=v.initialEnergyOnIncremental),v.tilingCompareBy!=null&&(s.TILING_COMPARE_BY=v.tilingCompareBy),v.quality=="proof"?l.QUALITY=2:l.QUALITY=0,s.NODE_DIMENSIONS_INCLUDE_LABELS=g.NODE_DIMENSIONS_INCLUDE_LABELS=l.NODE_DIMENSIONS_INCLUDE_LABELS=v.nodeDimensionsIncludeLabels,s.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=!v.randomize,s.ANIMATE=g.ANIMATE=l.ANIMATE=v.animate,s.TILE=v.tile,s.TILING_PADDING_VERTICAL=typeof v.tilingPaddingVertical=="function"?v.tilingPaddingVertical.call():v.tilingPaddingVertical,s.TILING_PADDING_HORIZONTAL=typeof v.tilingPaddingHorizontal=="function"?v.tilingPaddingHorizontal.call():v.tilingPaddingHorizontal,s.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=!0,s.PURE_INCREMENTAL=!v.randomize,l.DEFAULT_UNIFORM_LEAF_NODE_SIZES=v.uniformNodeDimensions,v.step=="transformed"&&(s.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,s.ENFORCE_CONSTRAINTS=!1,s.APPLY_LAYOUT=!1),v.step=="enforced"&&(s.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,s.ENFORCE_CONSTRAINTS=!0,s.APPLY_LAYOUT=!1),v.step=="cose"&&(s.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,s.ENFORCE_CONSTRAINTS=!1,s.APPLY_LAYOUT=!0),v.step=="all"&&(v.randomize?s.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:s.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,s.ENFORCE_CONSTRAINTS=!0,s.APPLY_LAYOUT=!0),v.fixedNodeConstraint||v.alignmentConstraint||v.relativePlacementConstraint?s.TREE_REDUCTION_ON_INCREMENTAL=!1:s.TREE_REDUCTION_ON_INCREMENTAL=!0;var x=new t,G=x.newGraphManager();return E(G.addRoot(),c.getTopMostNodes(P),x,v),p(x,G,V),O(x,v),x.runLayout(),B},"coseLayout");a.exports={coseLayout:A}}),212:((a,i,n)=>{var c=(function(){function v(N,S){for(var w=0;w0)if(p){var G=e.getTopMostNodes(w.eles.nodes());if(o=e.connectComponents(P,w.eles,G),o.forEach(function(ot){var rt=ot.boundingBox();m.push({x:rt.x1+rt.w/2,y:rt.y1+rt.h/2})}),w.randomize&&o.forEach(function(ot){w.eles=ot,Y.push(l(w))}),w.quality=="default"||w.quality=="proof"){var b=P.collection();if(w.tile){var R=new Map,J=[],et=[],F=0,tt={nodeIndexes:R,xCoords:J,yCoords:et},$=[];if(o.forEach(function(ot,rt){ot.edges().length==0&&(ot.nodes().forEach(function(vt,mt){b.merge(ot.nodes()[mt]),vt.isParent()||(tt.nodeIndexes.set(ot.nodes()[mt].id(),F++),tt.xCoords.push(ot.nodes()[0].position().x),tt.yCoords.push(ot.nodes()[0].position().y))}),$.push(rt))}),b.length>1){var M=b.boundingBox();m.push({x:M.x1+M.w/2,y:M.y1+M.h/2}),o.push(b),Y.push(tt);for(var X=$.length-1;X>=0;X--)o.splice($[X],1),Y.splice($[X],1),m.splice($[X],1)}}o.forEach(function(ot,rt){w.eles=ot,B.push(s(w,Y[rt])),e.relocateComponent(m[rt],B[rt],w)})}else o.forEach(function(ot,rt){e.relocateComponent(m[rt],Y[rt],w)});var H=new Set;if(o.length>1){var j=[],ht=V.filter(function(ot){return ot.css("display")=="none"});o.forEach(function(ot,rt){var vt=void 0;if(w.quality=="draft"&&(vt=Y[rt].nodeIndexes),ot.nodes().not(ht).length>0){var mt={};mt.edges=[],mt.nodes=[];var Lt=void 0;ot.nodes().not(ht).forEach(function(Et){if(w.quality=="draft")if(!Et.isParent())Lt=vt.get(Et.id()),mt.nodes.push({x:Y[rt].xCoords[Lt]-Et.boundingbox().w/2,y:Y[rt].yCoords[Lt]-Et.boundingbox().h/2,width:Et.boundingbox().w,height:Et.boundingbox().h});else{var Tt=e.calcBoundingBox(Et,Y[rt].xCoords,Y[rt].yCoords,vt);mt.nodes.push({x:Tt.topLeftX,y:Tt.topLeftY,width:Tt.width,height:Tt.height})}else B[rt][Et.id()]&&mt.nodes.push({x:B[rt][Et.id()].getLeft(),y:B[rt][Et.id()].getTop(),width:B[rt][Et.id()].getWidth(),height:B[rt][Et.id()].getHeight()})}),ot.edges().forEach(function(Et){var Tt=Et.source(),Mt=Et.target();if(Tt.css("display")!="none"&&Mt.css("display")!="none")if(w.quality=="draft"){var It=vt.get(Tt.id()),Wt=vt.get(Mt.id()),Pt=[],Ut=[];if(Tt.isParent()){var Ft=e.calcBoundingBox(Tt,Y[rt].xCoords,Y[rt].yCoords,vt);Pt.push(Ft.topLeftX+Ft.width/2),Pt.push(Ft.topLeftY+Ft.height/2)}else Pt.push(Y[rt].xCoords[It]),Pt.push(Y[rt].yCoords[It]);if(Mt.isParent()){var U=e.calcBoundingBox(Mt,Y[rt].xCoords,Y[rt].yCoords,vt);Ut.push(U.topLeftX+U.width/2),Ut.push(U.topLeftY+U.height/2)}else Ut.push(Y[rt].xCoords[Wt]),Ut.push(Y[rt].yCoords[Wt]);mt.edges.push({startX:Pt[0],startY:Pt[1],endX:Ut[0],endY:Ut[1]})}else B[rt][Tt.id()]&&B[rt][Mt.id()]&&mt.edges.push({startX:B[rt][Tt.id()].getCenterX(),startY:B[rt][Tt.id()].getCenterY(),endX:B[rt][Mt.id()].getCenterX(),endY:B[rt][Mt.id()].getCenterY()})}),mt.nodes.length>0&&(j.push(mt),H.add(rt))}});var Nt=E.packComponents(j,w.randomize).shifts;if(w.quality=="draft")Y.forEach(function(ot,rt){var vt=ot.xCoords.map(function(Lt){return Lt+Nt[rt].dx}),mt=ot.yCoords.map(function(Lt){return Lt+Nt[rt].dy});ot.xCoords=vt,ot.yCoords=mt});else{var St=0;H.forEach(function(ot){Object.keys(B[ot]).forEach(function(rt){var vt=B[ot][rt];vt.setCenter(vt.getCenterX()+Nt[St].dx,vt.getCenterY()+Nt[St].dy)}),St++})}}}else{var O=w.eles.boundingBox();if(m.push({x:O.x1+O.w/2,y:O.y1+O.h/2}),w.randomize){var x=l(w);Y.push(x)}w.quality=="default"||w.quality=="proof"?(B.push(s(w,Y[0])),e.relocateComponent(m[0],B[0],w)):e.relocateComponent(m[0],Y[0],w)}var Q=L(function(rt,vt){if(w.quality=="default"||w.quality=="proof"){typeof rt=="number"&&(rt=vt);var mt=void 0,Lt=void 0,Et=rt.data("id");return B.forEach(function(Mt){Et in Mt&&(mt={x:Mt[Et].getRect().getCenterX(),y:Mt[Et].getRect().getCenterY()},Lt=Mt[Et])}),w.nodeDimensionsIncludeLabels&&(Lt.labelWidth&&(Lt.labelPosHorizontal=="left"?mt.x+=Lt.labelWidth/2:Lt.labelPosHorizontal=="right"&&(mt.x-=Lt.labelWidth/2)),Lt.labelHeight&&(Lt.labelPosVertical=="top"?mt.y+=Lt.labelHeight/2:Lt.labelPosVertical=="bottom"&&(mt.y-=Lt.labelHeight/2))),mt==null&&(mt={x:rt.position("x"),y:rt.position("y")}),{x:mt.x,y:mt.y}}else{var Tt=void 0;return Y.forEach(function(Mt){var It=Mt.nodeIndexes.get(rt.id());It!=null&&(Tt={x:Mt.xCoords[It],y:Mt.yCoords[It]})}),Tt==null&&(Tt={x:rt.position("x"),y:rt.position("y")}),{x:Tt.x,y:Tt.y}}},"getPositions");if(w.quality=="default"||w.quality=="proof"||w.randomize){var Yt=e.calcParentsWithoutChildren(P,V),wt=V.filter(function(ot){return ot.css("display")=="none"});w.eles=V.not(wt),V.nodes().not(":parent").not(wt).layoutPositions(S,w,Q),Yt.length>0&&Yt.forEach(function(ot){ot.position(Q(ot))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")},"run")}]),v})();a.exports=y}),657:((a,i,n)=>{var c=n(548),t=n(140).layoutBase.Matrix,f=n(140).layoutBase.SVD,e=L(function(l){var g=l.cy,s=l.eles,A=s.nodes(),y=s.nodes(":parent"),v=new Map,N=new Map,S=new Map,w=[],P=[],V=[],Y=[],K=[],I=[],B=[],o=[],m=void 0,d=void 0,E=1e8,p=1e-9,O=l.piTol,x=l.samplingType,G=l.nodeSeparation,b=void 0,R=L(function(){for(var z=0,k=0,Z=!1;k=gt;){q=_[gt++];for(var st=w[q],nt=0;ntit&&(it=K[at],pt=at)}return pt},"BFS"),et=L(function(z){var k=void 0;if(z){k=Math.floor(Math.random()*d),m=k;for(var _=0;_=1)break;it=ut}for(var st=0;st=1)break;it=ut}for(var dt=0;dt0&&(k.isParent()?w[z].push(S.get(k.id())):w[z].push(k.id()))})});var Yt=L(function(z){var k=N.get(z),Z=void 0;v.get(z).forEach(function(_){g.getElementById(_).isParent()?Z=S.get(_):Z=_,w[k].push(Z),w[N.get(Z)].push(z)})},"_loop"),wt=!0,ot=!1,rt=void 0;try{for(var vt=v.keys()[Symbol.iterator](),mt;!(wt=(mt=vt.next()).done);wt=!0){var Lt=mt.value;Yt(Lt)}}catch(W){ot=!0,rt=W}finally{try{!wt&&vt.return&&vt.return()}finally{if(ot)throw rt}}d=N.size;var Et=void 0;if(d>2){b=d{var c=n(212),t=L(function(e){e&&e("layout","fcose",c)},"register");typeof cytoscape<"u"&&t(cytoscape),a.exports=t}),140:(a=>{a.exports=D})},T={};function u(a){var i=T[a];if(i!==void 0)return i.exports;var n=T[a]={exports:{}};return C[a](n,n.exports,u),n.exports}L(u,"__webpack_require__");var h=u(579);return h})()})});var Le={L:"left",R:"right",T:"top",B:"bottom"},De={L:L(D=>`${D},${D/2} 0,${D} 0,0`,"L"),R:L(D=>`0,${D/2} ${D},0 ${D},${D}`,"R"),T:L(D=>`0,0 ${D},0 ${D/2},${D}`,"T"),B:L(D=>`${D/2},0 ${D},${D} 0,${D}`,"B")},ne={L:L((D,C)=>D-C+2,"L"),R:L((D,C)=>D-2,"R"),T:L((D,C)=>D-C+2,"T"),B:L((D,C)=>D-2,"B")},rr=L(function(D){return Ht(D)?D==="L"?"R":"L":D==="T"?"B":"T"},"getOppositeArchitectureDirection"),Ce=L(function(D){let C=D;return C==="L"||C==="R"||C==="T"||C==="B"},"isArchitectureDirection"),Ht=L(function(D){let C=D;return C==="L"||C==="R"},"isArchitectureDirectionX"),kt=L(function(D){let C=D;return C==="T"||C==="B"},"isArchitectureDirectionY"),ae=L(function(D,C){let T=Ht(D)&&kt(C),u=kt(D)&&Ht(C);return T||u},"isArchitectureDirectionXY"),ir=L(function(D){let C=D[0],T=D[1],u=Ht(C)&&kt(T),h=kt(C)&&Ht(T);return u||h},"isArchitecturePairXY"),Er=L(function(D){return D!=="LL"&&D!=="RR"&&D!=="TT"&&D!=="BB"},"isValidArchitectureDirectionPair"),oe=L(function(D,C){let T=`${D}${C}`;return Er(T)?T:void 0},"getArchitectureDirectionPair"),nr=L(function([D,C],T){let u=T[0],h=T[1];return Ht(u)?kt(h)?[D+(u==="L"?-1:1),C+(h==="T"?1:-1)]:[D+(u==="L"?-1:1),C]:Ht(h)?[D+(h==="L"?1:-1),C+(u==="T"?1:-1)]:[D,C+(u==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),ar=L(function(D){return D==="LT"||D==="TL"?[1,1]:D==="BL"||D==="LB"?[1,-1]:D==="BR"||D==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),or=L(function(D,C){return ae(D,C)?"bend":Ht(D)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),sr=L(function(D){return D.type==="service"},"isArchitectureService"),hr=L(function(D){return D.type==="junction"},"isArchitectureJunction"),pe=L(D=>D.data(),"edgeData"),Jt=L(D=>D.data(),"nodeData");var Tr=Ye.architecture,re=class{constructor(){this.nodes={};this.groups={};this.edges=[];this.registeredIds={};this.elements={};this.diagramId="";this.setAccTitle=Be;this.getAccTitle=$e;this.setDiagramTitle=Je;this.getDiagramTitle=qe;this.getAccDescription=Ze;this.setAccDescription=ke;this.clear()}static{L(this,"ArchitectureDB")}setDiagramId(C){this.diagramId=C}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",ze()}addService({id:C,icon:T,in:u,title:h,iconText:a}){if(this.registeredIds[C]!==void 0)throw new Error(`The service id [${C}] is already in use by another ${this.registeredIds[C]}`);if(u!==void 0){if(C===u)throw new Error(`The service [${C}] cannot be placed within itself`);if(this.registeredIds[u]===void 0)throw new Error(`The service [${C}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[u]==="node")throw new Error(`The service [${C}]'s parent is not a group`)}this.registeredIds[C]="node",this.nodes[C]={id:C,type:"service",icon:T,iconText:a,title:h,edges:[],in:u}}getServices(){return Object.values(this.nodes).filter(sr)}addJunction({id:C,in:T}){if(this.registeredIds[C]!==void 0)throw new Error(`The junction id [${C}] is already in use by another ${this.registeredIds[C]}`);if(T!==void 0){if(C===T)throw new Error(`The junction [${C}] cannot be placed within itself`);if(this.registeredIds[T]===void 0)throw new Error(`The junction [${C}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds[T]==="node")throw new Error(`The junction [${C}]'s parent is not a group`)}this.registeredIds[C]="node",this.nodes[C]={id:C,type:"junction",edges:[],in:T}}getJunctions(){return Object.values(this.nodes).filter(hr)}getNodes(){return Object.values(this.nodes)}getNode(C){return this.nodes[C]??null}addGroup({id:C,icon:T,in:u,title:h}){if(this.registeredIds?.[C]!==void 0)throw new Error(`The group id [${C}] is already in use by another ${this.registeredIds[C]}`);if(u!==void 0){if(C===u)throw new Error(`The group [${C}] cannot be placed within itself`);if(this.registeredIds?.[u]===void 0)throw new Error(`The group [${C}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[u]==="node")throw new Error(`The group [${C}]'s parent is not a group`)}this.registeredIds[C]="group",this.groups[C]={id:C,icon:T,title:h,in:u}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:C,rhsId:T,lhsDir:u,rhsDir:h,lhsInto:a,rhsInto:i,lhsGroup:n,rhsGroup:c,title:t}){if(!Ce(u))throw new Error(`Invalid direction given for left hand side of edge ${C}--${T}. Expected (L,R,T,B) got ${String(u)}`);if(!Ce(h))throw new Error(`Invalid direction given for right hand side of edge ${C}--${T}. Expected (L,R,T,B) got ${String(h)}`);if(this.nodes[C]===void 0&&this.groups[C]===void 0)throw new Error(`The left-hand id [${C}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[T]===void 0&&this.groups[T]===void 0)throw new Error(`The right-hand id [${T}] does not yet exist. Please create the service/group before declaring an edge to it.`);let f=this.nodes[C].in,e=this.nodes[T].in;if(n&&f&&e&&f==e)throw new Error(`The left-hand id [${C}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(c&&f&&e&&f==e)throw new Error(`The right-hand id [${T}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let r={lhsId:C,lhsDir:u,lhsInto:a,lhsGroup:n,rhsId:T,rhsDir:h,rhsInto:i,rhsGroup:c,title:t};this.edges.push(r),this.nodes[C]&&this.nodes[T]&&(this.nodes[C].edges.push(this.edges[this.edges.length-1]),this.nodes[T].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(this.dataStructures===void 0){let C={},T=Object.entries(this.nodes).reduce((c,[t,f])=>(c[t]=f.edges.reduce((e,r)=>{let l=this.getNode(r.lhsId)?.in,g=this.getNode(r.rhsId)?.in;if(l&&g&&l!==g){let s=or(r.lhsDir,r.rhsDir);s!=="bend"&&(C[l]??={},C[l][g]=s,C[g]??={},C[g][l]=s)}if(r.lhsId===t){let s=oe(r.lhsDir,r.rhsDir);s&&(e[s]=r.rhsId)}else{let s=oe(r.rhsDir,r.lhsDir);s&&(e[s]=r.lhsId)}return e},{}),c),{}),u=Object.keys(T)[0],h={[u]:1},a=Object.keys(T).reduce((c,t)=>t===u?c:{...c,[t]:1},{}),i=L(c=>{let t={[c]:[0,0]},f=[c];for(;f.length>0;){let e=f.shift();if(e){h[e]=1,delete a[e];let r=T[e],[l,g]=t[e];Object.entries(r).forEach(([s,A])=>{h[A]||(t[A]=nr([l,g],s),f.push(A))})}}return t},"BFS"),n=[i(u)];for(;Object.keys(a).length>0;)n.push(i(Object.keys(a)[0]));this.dataStructures={adjList:T,spatialMaps:n,groupAlignments:C}}return this.dataStructures}setElementForId(C,T){this.elements[C]=T}getElementById(C){return this.elements[C]}getConfig(){return Ke({...Tr,...Ue().architecture})}getConfigField(C){return this.getConfig()[C]}};var Ar=L((D,C)=>{tr(D,C),D.groups.map(T=>C.addGroup(T)),D.services.map(T=>C.addService({...T,type:"service"})),D.junctions.map(T=>C.addJunction({...T,type:"junction"})),D.edges.map(T=>C.addEdge(T))},"populateDb"),we={parser:{yy:void 0},parse:L(async D=>{let C=await _e("architecture",D);fe.debug(C);let T=we.parser?.yy;if(!(T instanceof re))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Ar(C,T)},"parse")};var Nr=L(D=>` .edge { stroke-width: ${D.archEdgeWidth}; stroke: ${D.archEdgeColor}; fill: none; } .arrow { fill: ${D.archEdgeArrowColor}; } .node-bkg { fill: none; stroke: ${D.archGroupBorderColor}; stroke-width: ${D.archGroupBorderWidth}; stroke-dasharray: 8; } .node-icon-text { display: flex; align-items: center; } .node-icon-text > div { color: #fff; margin: 1px; height: fit-content; text-align: center; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; } `,"getStyles"),lr=Nr;var pr=mr(cr(),1);var ie=L(D=>`${D}`,"wrapIcon"),Kt={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:ie('')},server:{body:ie('')},disk:{body:ie('')},internet:{body:ie('')},cloud:{body:ie('')},unknown:He,blank:{body:ie("")}}};var fr=L(async function(D,C,T,u){let h=T.getConfigField("padding"),a=T.getConfigField("iconSize"),i=a/2,n=a/6,c=n/2;await Promise.all(C.edges().map(async t=>{let{source:f,sourceDir:e,sourceArrow:r,sourceGroup:l,target:g,targetDir:s,targetArrow:A,targetGroup:y,label:v}=pe(t),{x:N,y:S}=t[0].sourceEndpoint(),{x:w,y:P}=t[0].midpoint(),{x:V,y:Y}=t[0].targetEndpoint(),K=h+4;if(l&&(Ht(e)?N+=e==="L"?-K:K:S+=e==="T"?-K:K+18),y&&(Ht(s)?V+=s==="L"?-K:K:Y+=s==="T"?-K:K+18),!l&&T.getNode(f)?.type==="junction"&&(Ht(e)?N+=e==="L"?i:-i:S+=e==="T"?i:-i),!y&&T.getNode(g)?.type==="junction"&&(Ht(s)?V+=s==="L"?i:-i:Y+=s==="T"?i:-i),t[0]._private.rscratch){let I=D.insert("g");if(I.insert("path").attr("d",`M ${N},${S} L ${w},${P} L${V},${Y} `).attr("class","edge").attr("id",`${u}-${je(f,g,{prefix:"L"})}`),r){let B=Ht(e)?ne[e](N,n):N-c,o=kt(e)?ne[e](S,n):S-c;I.insert("polygon").attr("points",De[e](n)).attr("transform",`translate(${B},${o})`).attr("class","arrow")}if(A){let B=Ht(s)?ne[s](V,n):V-c,o=kt(s)?ne[s](Y,n):Y-c;I.insert("polygon").attr("points",De[s](n)).attr("transform",`translate(${B},${o})`).attr("class","arrow")}if(v){let B=ae(e,s)?"XY":Ht(e)?"X":"Y",o=0;B==="X"?o=Math.abs(N-V):B==="Y"?o=Math.abs(S-Y)/1.5:o=Math.abs(N-V)/2;let m=I.append("g");if(await de(m,v,{useHtmlLabels:!1,width:o,classes:"architecture-service-label"},ge()),m.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),B==="X")m.attr("transform","translate("+w+", "+P+")");else if(B==="Y")m.attr("transform","translate("+w+", "+P+") rotate(-90)");else if(B==="XY"){let d=oe(e,s);if(d&&ir(d)){let E=m.node().getBoundingClientRect(),[p,O]=ar(d);m.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*p*O*45})`);let x=m.node().getBoundingClientRect();m.attr("transform",` translate(${w}, ${P-E.height/2}) translate(${p*x.width/2}, ${O*x.height/2}) rotate(${-1*p*O*45}, 0, ${E.height/2}) `)}}}}}))},"drawEdges"),ur=L(async function(D,C,T,u){let a=T.getConfigField("padding")*.75,i=T.getConfigField("fontSize"),c=T.getConfigField("iconSize")/2;await Promise.all(C.nodes().map(async t=>{let f=Jt(t);if(f.type==="group"){let{h:e,w:r,x1:l,y1:g}=t.boundingBox(),s=D.append("rect");s.attr("id",`${u}-group-${f.id}`).attr("x",l+c).attr("y",g+c).attr("width",r).attr("height",e).attr("class","node-bkg");let A=D.append("g"),y=l,v=g;if(f.icon){let N=A.append("g");N.html(`${await ue(f.icon,{height:a,width:a,fallbackPrefix:Kt.prefix})}`),N.attr("transform","translate("+(y+c+1)+", "+(v+c+1)+")"),y+=a,v+=i/2-1-2}if(f.label){let N=A.append("g");await de(N,f.label,{useHtmlLabels:!1,width:r,classes:"architecture-service-label"},ge()),N.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),N.attr("transform","translate("+(y+c+4)+", "+(v+c+2)+")")}T.setElementForId(f.id,s)}}))},"drawGroups"),gr=L(async function(D,C,T,u){let h=ge();for(let a of T){let i=C.append("g"),n=D.getConfigField("iconSize");if(a.title){let e=i.append("g");await de(e,a.title,{useHtmlLabels:!1,width:n*1.5,classes:"architecture-service-label"},h),e.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),e.attr("transform","translate("+n/2+", "+n+")")}let c=i.append("g");if(a.icon)c.html(`${await ue(a.icon,{height:n,width:n,fallbackPrefix:Kt.prefix})}`);else if(a.iconText){c.html(`${await ue("blank",{height:n,width:n,fallbackPrefix:Kt.prefix})}`);let l=c.append("g").append("foreignObject").attr("width",n).attr("height",n).append("div").attr("class","node-icon-text").attr("style",`height: ${n}px;`).append("div").html(Xe(a.iconText,h)),g=parseInt(window.getComputedStyle(l.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;l.attr("style",`-webkit-line-clamp: ${Math.floor((n-2)/g)};`)}else c.append("path").attr("class","node-bkg").attr("id",`${u}-node-${a.id}`).attr("d",`M0,${n} V5 Q0,0 5,0 H${n-5} Q${n},0 ${n},5 V${n} Z`);i.attr("id",`${u}-service-${a.id}`).attr("class","architecture-service");let{width:t,height:f}=i.node().getBBox();a.width=t,a.height=f,D.setElementForId(a.id,i)}return 0},"drawServices"),dr=L(function(D,C,T,u){T.forEach(h=>{let a=C.append("g"),i=D.getConfigField("iconSize");a.append("g").append("rect").attr("id",`${u}-node-${h.id}`).attr("fill-opacity","0").attr("width",i).attr("height",i),a.attr("class","architecture-junction");let{width:c,height:t}=a._groups[0][0].getBBox();a.width=c,a.height=t,D.setElementForId(h.id,a)})},"drawJunctions");We([{name:Kt.prefix,icons:Kt}]);Ne.use(pr.default);function Lr(D,C,T){D.forEach(u=>{C.add({group:"nodes",data:{type:"service",id:u.id,icon:u.icon,label:u.title,parent:u.in,width:T.getConfigField("iconSize"),height:T.getConfigField("iconSize")},classes:"node-service"})})}L(Lr,"addServices");function Dr(D,C,T){D.forEach(u=>{C.add({group:"nodes",data:{type:"junction",id:u.id,parent:u.in,width:T.getConfigField("iconSize"),height:T.getConfigField("iconSize")},classes:"node-junction"})})}L(Dr,"addJunctions");function Cr(D,C){C.nodes().map(T=>{let u=Jt(T);if(u.type==="group")return;u.x=T.position().x,u.y=T.position().y,D.getElementById(u.id).attr("transform","translate("+(u.x||0)+","+(u.y||0)+")")})}L(Cr,"positionNodes");function wr(D,C){D.forEach(T=>{C.add({group:"nodes",data:{type:"group",id:T.id,icon:T.icon,label:T.title,parent:T.in},classes:"node-group"})})}L(wr,"addGroups");function Mr(D,C){D.forEach(T=>{let{lhsId:u,rhsId:h,lhsInto:a,lhsGroup:i,rhsInto:n,lhsDir:c,rhsDir:t,rhsGroup:f,title:e}=T,r=ae(T.lhsDir,T.rhsDir)?"segments":"straight",l={id:`${u}-${h}`,label:e,source:u,sourceDir:c,sourceArrow:a,sourceGroup:i,sourceEndpoint:c==="L"?"0 50%":c==="R"?"100% 50%":c==="T"?"50% 0":"50% 100%",target:h,targetDir:t,targetArrow:n,targetGroup:f,targetEndpoint:t==="L"?"0 50%":t==="R"?"100% 50%":t==="T"?"50% 0":"50% 100%"};C.add({group:"edges",data:l,classes:r})})}L(Mr,"addEdges");function xr(D,C,T){let u=L((n,c)=>Object.entries(n).reduce((t,[f,e])=>{let r=0,l=Object.entries(e);if(l.length===1)return t[f]=l[0][1],t;for(let g=0;g{let c={},t={};return Object.entries(n).forEach(([f,[e,r]])=>{let l=D.getNode(f)?.in??"default";c[r]??={},c[r][l]??=[],c[r][l].push(f),t[e]??={},t[e][l]??=[],t[e][l].push(f)}),{horiz:Object.values(u(c,"horizontal")).filter(f=>f.length>1),vert:Object.values(u(t,"vertical")).filter(f=>f.length>1)}}),[a,i]=h.reduce(([n,c],{horiz:t,vert:f})=>[[...n,...t],[...c,...f]],[[],[]]);return{horizontal:a,vertical:i}}L(xr,"getAlignments");function Or(D,C){let T=[],u=L(a=>`${a[0]},${a[1]}`,"posToStr"),h=L(a=>a.split(",").map(i=>parseInt(i)),"strToPos");return D.forEach(a=>{let i=Object.fromEntries(Object.entries(a).map(([f,e])=>[u(e),f])),n=[u([0,0])],c={},t={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;n.length>0;){let f=n.shift();if(f){c[f]=1;let e=i[f];if(e){let r=h(f);Object.entries(t).forEach(([l,g])=>{let s=u([r[0]+g[0],r[1]+g[1]]),A=i[s];A&&!c[s]&&(n.push(s),T.push({[Le[l]]:A,[Le[rr(l)]]:e,gap:1.5*C.getConfigField("iconSize")}))})}}}}),T}L(Or,"getRelativeConstraints");function Ir(D,C,T,u,h,{spatialMaps:a,groupAlignments:i}){return new Promise(n=>{let c=Qe("body").append("div").attr("id","cy").attr("style","display:none"),t=Ne({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${h.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${h.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});c.remove(),wr(T,t),Lr(D,t,h),Dr(C,t,h),Mr(u,t);let f=xr(h,a,i),e=Or(a,h),r=h.getConfigField("iconSize"),l=h.getConfigField("idealEdgeLengthMultiplier")*r,g=.5*r,s=h.getConfigField("edgeElasticity"),A=t.layout({name:"fcose",quality:"proof",randomize:h.getConfigField("randomize"),nodeSeparation:h.getConfigField("nodeSeparation"),numIter:h.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(y){let[v,N]=y.connectedNodes(),{parent:S}=Jt(v),{parent:w}=Jt(N);return S===w?l:g},edgeElasticity(y){let[v,N]=y.connectedNodes(),{parent:S}=Jt(v),{parent:w}=Jt(N);return S===w?s:.001},alignmentConstraint:f,relativePlacementConstraint:e});A.one("layoutstop",()=>{function y(v,N,S,w){let P,V,{x:Y,y:K}=v,{x:I,y:B}=N;V=(w-K+(Y-S)*(K-B)/(Y-I))/Math.sqrt(1+Math.pow((K-B)/(Y-I),2)),P=Math.sqrt(Math.pow(w-K,2)+Math.pow(S-Y,2)-Math.pow(V,2));let o=Math.sqrt(Math.pow(I-Y,2)+Math.pow(B-K,2));P=P/o;let m=(I-Y)*(w-K)-(B-K)*(S-Y);switch(!0){case m>=0:m=1;break;case m<0:m=-1;break}let d=(I-Y)*(S-Y)+(B-K)*(w-K);switch(!0){case d>=0:d=1;break;case d<0:d=-1;break}return V=Math.abs(V)*m,P=P*d,{distances:V,weights:P}}L(y,"getSegmentWeights"),t.startBatch();for(let v of Object.values(t.edges()))if(v.data?.()){let{x:N,y:S}=v.source().position(),{x:w,y:P}=v.target().position();if(N!==w&&S!==P){let V=v.sourceEndpoint(),Y=v.targetEndpoint(),{sourceDir:K}=pe(v),[I,B]=kt(K)?[V.x,Y.y]:[Y.x,V.y],{weights:o,distances:m}=y(V,Y,I,B);v.style("segment-distances",m),v.style("segment-weights",o)}}t.endBatch(),A.run()}),A.run(),t.ready(y=>{fe.info("Ready",y),n(t)})})}L(Ir,"layoutArchitecture");var Rr=L(async(D,C,T,u)=>{let h=u.db;h.setDiagramId(C);let a=h.getServices(),i=h.getJunctions(),n=h.getGroups(),c=h.getEdges(),t=h.getDataStructures(),f=er(C),e=f.append("g");e.attr("class","architecture-edges");let r=f.append("g");r.attr("class","architecture-services");let l=f.append("g");l.attr("class","architecture-groups"),await gr(h,r,a,C),dr(h,r,i,C);let g=await Ir(a,i,n,c,h,t);await fr(e,g,h,C),await ur(l,g,h,C),Cr(h,g),Ve(void 0,f,h.getConfigField("padding"),h.getConfigField("useMaxWidth"))},"draw"),vr={draw:Rr};var Ci={parser:we,get db(){return new re},renderer:vr,styles:lr};export{Ci as diagram};