@lyhue1991/pi-web 0.8.6 → 0.8.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +2 -2
  3. package/.next/required-server-files.js +3 -2
  4. package/.next/required-server-files.json +3 -2
  5. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  6. package/.next/server/app/_global-error.html +1 -1
  7. package/.next/server/app/_global-error.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  14. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  15. package/.next/server/app/_not-found.html +1 -1
  16. package/.next/server/app/_not-found.rsc +2 -2
  17. package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  18. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  19. package/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  20. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  21. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  22. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  23. package/.next/server/app/api/agent/[id]/bash-output/route.js +1 -1
  24. package/.next/server/app/api/files/[...path]/route.js +2 -2
  25. package/.next/server/app/api/files/[...path]/route.js.nft.json +1 -1
  26. package/.next/server/app/index.html +1 -1
  27. package/.next/server/app/index.rsc +4 -4
  28. package/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
  29. package/.next/server/app/index.segments/_full.segment.rsc +4 -4
  30. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  31. package/.next/server/app/index.segments/_index.segment.rsc +2 -2
  32. package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  33. package/.next/server/app/page.js +3 -3
  34. package/.next/server/app/page_client-reference-manifest.js +1 -1
  35. package/.next/server/chunks/3397.js +1 -1
  36. package/.next/server/chunks/358.js +1 -1
  37. package/.next/server/chunks/4365.js +1 -1
  38. package/.next/server/chunks/4407.js +1 -1
  39. package/.next/server/chunks/5414.js +1 -1
  40. package/.next/server/chunks/5460.js +2 -2
  41. package/.next/server/chunks/5737.js +1 -1
  42. package/.next/server/chunks/5985.js +1 -1
  43. package/.next/server/chunks/6073.js +1 -1
  44. package/.next/server/chunks/7702.js +1 -1
  45. package/.next/server/chunks/8360.js +1 -1
  46. package/.next/server/chunks/8469.js +1 -1
  47. package/.next/server/chunks/8704.js +1 -1
  48. package/.next/server/chunks/9963.js +1 -1
  49. package/.next/server/middleware-build-manifest.js +1 -1
  50. package/.next/server/middleware.js +1 -1
  51. package/.next/server/pages/404.html +1 -1
  52. package/.next/server/pages/500.html +1 -1
  53. package/.next/server/webpack-runtime.js +1 -1
  54. package/.next/static/chunks/app/{layout-ca97634a96114a03.js → layout-91584a19e4ccf9ed.js} +1 -1
  55. package/.next/static/chunks/app/{page-4be55877df86a39c.js → page-b3407109c4aa0f5a.js} +2 -2
  56. package/.next/trace +6 -37
  57. package/.next/trace-build +1 -1
  58. package/next.config.ts +4 -0
  59. package/package.json +1 -1
  60. package/.next/server/chunks/1309.js +0 -14
  61. package/.next/server/chunks/2715.js +0 -1
  62. package/.next/server/chunks/4893.js +0 -1
  63. package/.next/server/chunks/7424.js +0 -4
  64. package/.next/server/chunks/7635.js +0 -1
  65. package/.next/server/chunks/static/media/macos-trash.6c01a2a6 +0 -0
  66. package/.next/server/chunks/static/media/windows-trash.2b7fe177.exe +0 -0
  67. /package/.next/static/{JpAkqjRvCHtp3M_ChE6_B → X-p5oTeavB3wT75VEcMAa}/_buildManifest.js +0 -0
  68. /package/.next/static/{JpAkqjRvCHtp3M_ChE6_B → X-p5oTeavB3wT75VEcMAa}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- exports.id=8360,exports.ids=[8360],exports.modules={18980:function(a,b,c){var d;d=c(50980),a.exports=(()=>{"use strict";var a={658:a=>{a.exports=null!=Object.assign?Object.assign.bind(Object):function(a){for(var b=arguments.length,c=Array(b>1?b-1:0),d=1;d<b;d++)c[d-1]=arguments[d];return c.forEach(function(b){Object.keys(b).forEach(function(c){return a[c]=b[c]})}),a}},548:(a,b,c)=>{var d=function(a,b){if(Array.isArray(a))return a;if(Symbol.iterator in Object(a))return function(a,b){var c=[],d=!0,e=!1,f=void 0;try{for(var g,h=a[Symbol.iterator]();!(d=(g=h.next()).done)&&(c.push(g.value),!b||c.length!==b);d=!0);}catch(a){e=!0,f=a}finally{try{!d&&h.return&&h.return()}finally{if(e)throw f}}return c}(a,b);throw TypeError("Invalid attempt to destructure non-iterable instance")},e=c(140).layoutBase.LinkedList,f={};f.getTopMostNodes=function(a){for(var b={},c=0;c<a.length;c++)b[a[c].id()]=!0;return a.filter(function(a,c){"number"==typeof a&&(a=c);for(var d=a.parent()[0];null!=d;){if(b[d.id()])return!1;d=d.parent()[0]}return!0})},f.connectComponents=function(a,b,c,d){var f=new e,g=new Set,h=[],i=void 0,j=void 0,k=void 0,l=!1,m=1,n=[],o=[];do!function(){var d=a.collection();o.push(d);var e=c[0],p=a.collection();for(p.merge(e).merge(e.descendants().intersection(b)),h.push(e),p.forEach(function(a){f.push(a),g.add(a),d.merge(a)});0!=f.length;)!function(){e=f.shift();var j=a.collection();e.neighborhood().nodes().forEach(function(a){b.intersection(e.edgesWith(a)).length>0&&j.merge(a)});for(var k=0;k<j.length;k++){var l=j[k];null==(i=c.intersection(l.union(l.ancestors())))||g.has(i[0])||i.union(i.descendants()).forEach(function(a){f.push(a),g.add(a),d.merge(a),c.has(a)&&h.push(a)})}}();if(d.forEach(function(a){b.intersection(a.connectedEdges()).forEach(function(a){d.has(a.source())&&d.has(a.target())&&d.merge(a)})}),h.length==c.length&&(l=!0),!l||l&&m>1){k=(j=h[0]).connectedEdges().length,h.forEach(function(a){a.connectedEdges().length<k&&(k=a.connectedEdges().length,j=a)}),n.push(j.id());var q=a.collection();q.merge(h[0]),h.forEach(function(a){q.merge(a)}),h=[],c=c.difference(q),m++}}();while(!l);return d&&n.length>0&&d.set("dummy"+(d.size+1),n),o},f.relocateComponent=function(a,b,c){if(!c.fixedNodeConstraint){var e=1/0,f=-1/0,g=1/0,h=-1/0;if("draft"==c.quality){var i=!0,j=!1,k=void 0;try{for(var l,m=b.nodeIndexes[Symbol.iterator]();!(i=(l=m.next()).done);i=!0){var n=l.value,o=d(n,2),p=o[0],q=o[1],r=c.cy.getElementById(p);if(r){var s=r.boundingBox(),t=b.xCoords[q]-s.w/2,u=b.xCoords[q]+s.w/2,v=b.yCoords[q]-s.h/2,w=b.yCoords[q]+s.h/2;t<e&&(e=t),u>f&&(f=u),v<g&&(g=v),w>h&&(h=w)}}}catch(a){j=!0,k=a}finally{try{!i&&m.return&&m.return()}finally{if(j)throw k}}var x=a.x-(f+e)/2,y=a.y-(h+g)/2;b.xCoords=b.xCoords.map(function(a){return a+x}),b.yCoords=b.yCoords.map(function(a){return a+y})}else{Object.keys(b).forEach(function(a){var c=b[a],d=c.getRect().x,i=c.getRect().x+c.getRect().width,j=c.getRect().y,k=c.getRect().y+c.getRect().height;d<e&&(e=d),i>f&&(f=i),j<g&&(g=j),k>h&&(h=k)});var z=a.x-(f+e)/2,A=a.y-(h+g)/2;Object.keys(b).forEach(function(a){var c=b[a];c.setCenter(c.getCenterX()+z,c.getCenterY()+A)})}}},f.calcBoundingBox=function(a,b,c,d){for(var e=Number.MAX_SAFE_INTEGER,f=Number.MIN_SAFE_INTEGER,g=Number.MAX_SAFE_INTEGER,h=Number.MIN_SAFE_INTEGER,i=void 0,j=void 0,k=void 0,l=void 0,m=a.descendants().not(":parent"),n=m.length,o=0;o<n;o++){var p=m[o];i=b[d.get(p.id())]-p.width()/2,j=b[d.get(p.id())]+p.width()/2,k=c[d.get(p.id())]-p.height()/2,l=c[d.get(p.id())]+p.height()/2,e>i&&(e=i),f<j&&(f=j),g>k&&(g=k),h<l&&(h=l)}var q={};return q.topLeftX=e,q.topLeftY=g,q.width=f-e,q.height=h-g,q},f.calcParentsWithoutChildren=function(a,b){var c=a.collection();return b.nodes(":parent").forEach(function(a){var b=!1;a.children().forEach(function(a){"none"!=a.css("display")&&(b=!0)}),b||c.merge(a)}),c},a.exports=f},816:(a,b,c)=>{var d=c(548),e=c(140).CoSELayout,f=c(140).CoSENode,g=c(140).layoutBase.PointD,h=c(140).layoutBase.DimensionD,i=c(140).layoutBase.LayoutConstants,j=c(140).layoutBase.FDLayoutConstants,k=c(140).CoSEConstants;a.exports={coseLayout:function(a,b){var c=a.cy,l=a.eles,m=l.nodes(),n=l.edges(),o=void 0,p=void 0,q=void 0,r={};a.randomize&&(o=b.nodeIndexes,p=b.xCoords,q=b.yCoords);var s=function(a){return"function"==typeof a},t=function(a,b){return s(a)?a(b):a},u=d.calcParentsWithoutChildren(c,l);null!=a.nestingFactor&&(k.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=j.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=a.nestingFactor),null!=a.gravity&&(k.DEFAULT_GRAVITY_STRENGTH=j.DEFAULT_GRAVITY_STRENGTH=a.gravity),null!=a.numIter&&(k.MAX_ITERATIONS=j.MAX_ITERATIONS=a.numIter),null!=a.gravityRange&&(k.DEFAULT_GRAVITY_RANGE_FACTOR=j.DEFAULT_GRAVITY_RANGE_FACTOR=a.gravityRange),null!=a.gravityCompound&&(k.DEFAULT_COMPOUND_GRAVITY_STRENGTH=j.DEFAULT_COMPOUND_GRAVITY_STRENGTH=a.gravityCompound),null!=a.gravityRangeCompound&&(k.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=j.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=a.gravityRangeCompound),null!=a.initialEnergyOnIncremental&&(k.DEFAULT_COOLING_FACTOR_INCREMENTAL=j.DEFAULT_COOLING_FACTOR_INCREMENTAL=a.initialEnergyOnIncremental),null!=a.tilingCompareBy&&(k.TILING_COMPARE_BY=a.tilingCompareBy),"proof"==a.quality?i.QUALITY=2:i.QUALITY=0,k.NODE_DIMENSIONS_INCLUDE_LABELS=j.NODE_DIMENSIONS_INCLUDE_LABELS=i.NODE_DIMENSIONS_INCLUDE_LABELS=a.nodeDimensionsIncludeLabels,k.DEFAULT_INCREMENTAL=j.DEFAULT_INCREMENTAL=i.DEFAULT_INCREMENTAL=!a.randomize,k.ANIMATE=j.ANIMATE=i.ANIMATE=a.animate,k.TILE=a.tile,k.TILING_PADDING_VERTICAL="function"==typeof a.tilingPaddingVertical?a.tilingPaddingVertical.call():a.tilingPaddingVertical,k.TILING_PADDING_HORIZONTAL="function"==typeof a.tilingPaddingHorizontal?a.tilingPaddingHorizontal.call():a.tilingPaddingHorizontal,k.DEFAULT_INCREMENTAL=j.DEFAULT_INCREMENTAL=i.DEFAULT_INCREMENTAL=!0,k.PURE_INCREMENTAL=!a.randomize,i.DEFAULT_UNIFORM_LEAF_NODE_SIZES=a.uniformNodeDimensions,"transformed"==a.step&&(k.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,k.ENFORCE_CONSTRAINTS=!1,k.APPLY_LAYOUT=!1),"enforced"==a.step&&(k.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,k.ENFORCE_CONSTRAINTS=!0,k.APPLY_LAYOUT=!1),"cose"==a.step&&(k.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,k.ENFORCE_CONSTRAINTS=!1,k.APPLY_LAYOUT=!0),"all"==a.step&&(a.randomize?k.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:k.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,k.ENFORCE_CONSTRAINTS=!0,k.APPLY_LAYOUT=!0),a.fixedNodeConstraint||a.alignmentConstraint||a.relativePlacementConstraint?k.TREE_REDUCTION_ON_INCREMENTAL=!1:k.TREE_REDUCTION_ON_INCREMENTAL=!0;var v=new e,w=v.newGraphManager();return!function a(b,c,e,i){for(var j=c.length,k=0;k<j;k++){var l=c[k],m=null;0==l.intersection(u).length&&(m=l.children());var n=void 0,s=l.layoutDimensions({nodeDimensionsIncludeLabels:i.nodeDimensionsIncludeLabels});if(null!=l.outerWidth()&&null!=l.outerHeight())if(i.randomize)if(l.isParent()){var v=d.calcBoundingBox(l,p,q,o);n=0==l.intersection(u).length?b.add(new f(e.graphManager,new g(v.topLeftX,v.topLeftY),new h(v.width,v.height))):b.add(new f(e.graphManager,new g(v.topLeftX,v.topLeftY),new h(parseFloat(s.w),parseFloat(s.h))))}else n=b.add(new f(e.graphManager,new g(p[o.get(l.id())]-s.w/2,q[o.get(l.id())]-s.h/2),new h(parseFloat(s.w),parseFloat(s.h))));else n=b.add(new f(e.graphManager,new g(l.position("x")-s.w/2,l.position("y")-s.h/2),new h(parseFloat(s.w),parseFloat(s.h))));else n=b.add(new f(this.graphManager));(n.id=l.data("id"),n.nodeRepulsion=t(i.nodeRepulsion,l),n.paddingLeft=parseInt(l.css("padding")),n.paddingTop=parseInt(l.css("padding")),n.paddingRight=parseInt(l.css("padding")),n.paddingBottom=parseInt(l.css("padding")),i.nodeDimensionsIncludeLabels&&(n.labelWidth=l.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,n.labelHeight=l.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,n.labelPosVertical=l.css("text-valign"),n.labelPosHorizontal=l.css("text-halign")),r[l.data("id")]=n,isNaN(n.rect.x)&&(n.rect.x=0),isNaN(n.rect.y)&&(n.rect.y=0),null!=m&&m.length>0)&&a(e.getGraphManager().add(e.newGraph(),n),m,e,i)}}(w.addRoot(),d.getTopMostNodes(m),v,a),!function(b,c,d){for(var e=0,f=0,g=0;g<d.length;g++){var h=d[g],i=r[h.data("source")],l=r[h.data("target")];if(i&&l&&i!==l&&0==i.getEdgesBetween(l).length){var m=c.add(b.newEdge(),i,l);m.id=h.id(),m.idealLength=t(a.idealEdgeLength,h),m.edgeElasticity=t(a.edgeElasticity,h),e+=m.idealLength,f++}}null!=a.idealEdgeLength&&(f>0?k.DEFAULT_EDGE_LENGTH=j.DEFAULT_EDGE_LENGTH=e/f:s(a.idealEdgeLength)?k.DEFAULT_EDGE_LENGTH=j.DEFAULT_EDGE_LENGTH=50:k.DEFAULT_EDGE_LENGTH=j.DEFAULT_EDGE_LENGTH=a.idealEdgeLength,k.MIN_REPULSION_DIST=j.MIN_REPULSION_DIST=j.DEFAULT_EDGE_LENGTH/10,k.DEFAULT_RADIAL_SEPARATION=j.DEFAULT_EDGE_LENGTH)}(v,w,n),a.fixedNodeConstraint&&(v.constraints.fixedNodeConstraint=a.fixedNodeConstraint),a.alignmentConstraint&&(v.constraints.alignmentConstraint=a.alignmentConstraint),a.relativePlacementConstraint&&(v.constraints.relativePlacementConstraint=a.relativePlacementConstraint),v.runLayout(),r}}},212:(a,b,c)=>{var d=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),e=c(658),f=c(548),g=c(657).spectralLayout,h=c(816).coseLayout,i=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1e3,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:1e-7,nodeRepulsion:function(a){return 4500},idealEdgeLength:function(a){return 50},edgeElasticity:function(a){return .45},nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}});a.exports=function(){function a(b){if(!(this instanceof a))throw TypeError("Cannot call a class as a function");this.options=e({},i,b)}return d(a,[{key:"run",value:function(){var a=this.options,b=a.cy,c=a.eles,d=[],e=[],i=void 0,j=[];a.fixedNodeConstraint&&(!Array.isArray(a.fixedNodeConstraint)||0==a.fixedNodeConstraint.length)&&(a.fixedNodeConstraint=void 0),a.alignmentConstraint&&(a.alignmentConstraint.vertical&&(!Array.isArray(a.alignmentConstraint.vertical)||0==a.alignmentConstraint.vertical.length)&&(a.alignmentConstraint.vertical=void 0),a.alignmentConstraint.horizontal&&(!Array.isArray(a.alignmentConstraint.horizontal)||0==a.alignmentConstraint.horizontal.length)&&(a.alignmentConstraint.horizontal=void 0)),a.relativePlacementConstraint&&(!Array.isArray(a.relativePlacementConstraint)||0==a.relativePlacementConstraint.length)&&(a.relativePlacementConstraint=void 0),(a.fixedNodeConstraint||a.alignmentConstraint||a.relativePlacementConstraint)&&(a.tile=!1,a.packComponents=!1);var k=void 0,l=!1;if(b.layoutUtilities&&a.packComponents&&((k=b.layoutUtilities("get"))||(k=b.layoutUtilities()),l=!0),c.nodes().length>0)if(l){var m=f.getTopMostNodes(a.eles.nodes());if((i=f.connectComponents(b,a.eles,m)).forEach(function(a){var b=a.boundingBox();j.push({x:b.x1+b.w/2,y:b.y1+b.h/2})}),a.randomize&&i.forEach(function(b){a.eles=b,d.push(g(a))}),"default"==a.quality||"proof"==a.quality){var n=b.collection();if(a.tile){var o=new Map,p=0,q={nodeIndexes:o,xCoords:[],yCoords:[]},r=[];if(i.forEach(function(a,b){0==a.edges().length&&(a.nodes().forEach(function(b,c){n.merge(a.nodes()[c]),b.isParent()||(q.nodeIndexes.set(a.nodes()[c].id(),p++),q.xCoords.push(a.nodes()[0].position().x),q.yCoords.push(a.nodes()[0].position().y))}),r.push(b))}),n.length>1){var s=n.boundingBox();j.push({x:s.x1+s.w/2,y:s.y1+s.h/2}),i.push(n),d.push(q);for(var t=r.length-1;t>=0;t--)i.splice(r[t],1),d.splice(r[t],1),j.splice(r[t],1)}}i.forEach(function(b,c){a.eles=b,e.push(h(a,d[c])),f.relocateComponent(j[c],e[c],a)})}else i.forEach(function(b,c){f.relocateComponent(j[c],d[c],a)});var u=new Set;if(i.length>1){var v=[],w=c.filter(function(a){return"none"==a.css("display")});i.forEach(function(b,c){var g=void 0;if("draft"==a.quality&&(g=d[c].nodeIndexes),b.nodes().not(w).length>0){var h={};h.edges=[],h.nodes=[];var i=void 0;b.nodes().not(w).forEach(function(b){if("draft"==a.quality)if(b.isParent()){var j=f.calcBoundingBox(b,d[c].xCoords,d[c].yCoords,g);h.nodes.push({x:j.topLeftX,y:j.topLeftY,width:j.width,height:j.height})}else i=g.get(b.id()),h.nodes.push({x:d[c].xCoords[i]-b.boundingbox().w/2,y:d[c].yCoords[i]-b.boundingbox().h/2,width:b.boundingbox().w,height:b.boundingbox().h});else e[c][b.id()]&&h.nodes.push({x:e[c][b.id()].getLeft(),y:e[c][b.id()].getTop(),width:e[c][b.id()].getWidth(),height:e[c][b.id()].getHeight()})}),b.edges().forEach(function(b){var i=b.source(),j=b.target();if("none"!=i.css("display")&&"none"!=j.css("display"))if("draft"==a.quality){var k=g.get(i.id()),l=g.get(j.id()),m=[],n=[];if(i.isParent()){var o=f.calcBoundingBox(i,d[c].xCoords,d[c].yCoords,g);m.push(o.topLeftX+o.width/2),m.push(o.topLeftY+o.height/2)}else m.push(d[c].xCoords[k]),m.push(d[c].yCoords[k]);if(j.isParent()){var p=f.calcBoundingBox(j,d[c].xCoords,d[c].yCoords,g);n.push(p.topLeftX+p.width/2),n.push(p.topLeftY+p.height/2)}else n.push(d[c].xCoords[l]),n.push(d[c].yCoords[l]);h.edges.push({startX:m[0],startY:m[1],endX:n[0],endY:n[1]})}else e[c][i.id()]&&e[c][j.id()]&&h.edges.push({startX:e[c][i.id()].getCenterX(),startY:e[c][i.id()].getCenterY(),endX:e[c][j.id()].getCenterX(),endY:e[c][j.id()].getCenterY()})}),h.nodes.length>0&&(v.push(h),u.add(c))}});var x=k.packComponents(v,a.randomize).shifts;if("draft"==a.quality)d.forEach(function(a,b){var c=a.xCoords.map(function(a){return a+x[b].dx}),d=a.yCoords.map(function(a){return a+x[b].dy});a.xCoords=c,a.yCoords=d});else{var y=0;u.forEach(function(a){Object.keys(e[a]).forEach(function(b){var c=e[a][b];c.setCenter(c.getCenterX()+x[y].dx,c.getCenterY()+x[y].dy)}),y++})}}}else{var z=a.eles.boundingBox();if(j.push({x:z.x1+z.w/2,y:z.y1+z.h/2}),a.randomize){var A=g(a);d.push(A)}"default"==a.quality||"proof"==a.quality?(e.push(h(a,d[0])),f.relocateComponent(j[0],e[0],a)):f.relocateComponent(j[0],d[0],a)}var B=function(b,c){if("default"==a.quality||"proof"==a.quality){"number"==typeof b&&(b=c);var f=void 0,g=void 0,h=b.data("id");return e.forEach(function(a){h in a&&(f={x:a[h].getRect().getCenterX(),y:a[h].getRect().getCenterY()},g=a[h])}),a.nodeDimensionsIncludeLabels&&(g.labelWidth&&("left"==g.labelPosHorizontal?f.x+=g.labelWidth/2:"right"==g.labelPosHorizontal&&(f.x-=g.labelWidth/2)),g.labelHeight&&("top"==g.labelPosVertical?f.y+=g.labelHeight/2:"bottom"==g.labelPosVertical&&(f.y-=g.labelHeight/2))),void 0==f&&(f={x:b.position("x"),y:b.position("y")}),{x:f.x,y:f.y}}var i=void 0;return d.forEach(function(a){var c=a.nodeIndexes.get(b.id());void 0!=c&&(i={x:a.xCoords[c],y:a.yCoords[c]})}),void 0==i&&(i={x:b.position("x"),y:b.position("y")}),{x:i.x,y:i.y}};if("default"==a.quality||"proof"==a.quality||a.randomize){var C=f.calcParentsWithoutChildren(b,c),D=c.filter(function(a){return"none"==a.css("display")});a.eles=c.not(D),c.nodes().not(":parent").not(D).layoutPositions(this,a,B),C.length>0&&C.forEach(function(a){a.position(B(a))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),a}()},657:(a,b,c)=>{var d=c(548),e=c(140).layoutBase.Matrix,f=c(140).layoutBase.SVD;a.exports={spectralLayout:function(a){var b=a.cy,c=a.eles,g=c.nodes(),h=c.nodes(":parent"),i=new Map,j=new Map,k=new Map,l=[],m=[],n=[],o=[],p=[],q=[],r=[],s=[],t=void 0,u=a.piTol,v=a.samplingType,w=a.nodeSeparation,x=void 0,y=function(){for(var a=0,b=0,c=!1;b<x;){a=Math.floor(Math.random()*t),c=!1;for(var d=0;d<b;d++)if(o[d]==a){c=!0;break}!c&&(o[b]=a,b++)}},z=function(a,b,c){for(var d=[],e=0,f=0,g=0,h=void 0,i=[],k=0,m=1,n=0;n<t;n++)i[n]=1e8;for(d[f]=a,i[a]=0;f>=e;){for(var o=l[g=d[e++]],r=0;r<o.length;r++)1e8==i[h=j.get(o[r])]&&(i[h]=i[g]+1,d[++f]=h);q[g][b]=i[g]*w}if(c){for(var s=0;s<t;s++)q[s][b]<p[s]&&(p[s]=q[s][b]);for(var u=0;u<t;u++)p[u]>k&&(k=p[u],m=u)}return m};d.connectComponents(b,c,d.getTopMostNodes(g),i),h.forEach(function(a){d.connectComponents(b,c,d.getTopMostNodes(a.descendants().intersection(c)),i)});for(var A=0,B=0;B<g.length;B++)g[B].isParent()||j.set(g[B].id(),A++);var C=!0,D=!1,E=void 0;try{for(var F,G=i.keys()[Symbol.iterator]();!(C=(F=G.next()).done);C=!0){var H=F.value;j.set(H,A++)}}catch(a){D=!0,E=a}finally{try{!C&&G.return&&G.return()}finally{if(D)throw E}}for(var I=0;I<j.size;I++)l[I]=[];h.forEach(function(a){for(var b=a.children().intersection(c);0==b.nodes(":childless").length;)b=b.nodes()[0].children().intersection(c);var d=0,e=b.nodes(":childless")[0].connectedEdges().length;b.nodes(":childless").forEach(function(a,b){a.connectedEdges().length<e&&(e=a.connectedEdges().length,d=b)}),k.set(a.id(),b.nodes(":childless")[d].id())}),g.forEach(function(a){var b=void 0;b=a.isParent()?j.get(k.get(a.id())):j.get(a.id()),a.neighborhood().nodes().forEach(function(d){c.intersection(a.edgesWith(d)).length>0&&(d.isParent()?l[b].push(k.get(d.id())):l[b].push(d.id()))})});var J=function(a){var c=j.get(a),d=void 0;i.get(a).forEach(function(e){d=b.getElementById(e).isParent()?k.get(e):e,l[c].push(d),l[j.get(d)].push(a)})},K=!0,L=!1,M=void 0;try{for(var N,O=i.keys()[Symbol.iterator]();!(K=(N=O.next()).done);K=!0){var P=N.value;J(P)}}catch(a){L=!0,M=a}finally{try{!K&&O.return&&O.return()}finally{if(L)throw M}}t=j.size;if(t>2){x=t<a.sampleSize?t:a.sampleSize;for(var Q=0;Q<t;Q++)q[Q]=[];for(var R=0;R<x;R++)s[R]=[];return"draft"==a.quality||"all"==a.step?(!function(a){var b=void 0;if(a){b=Math.floor(Math.random()*t);for(var c=0;c<t;c++)p[c]=1e8;for(var d=0;d<x;d++)o[d]=b,b=z(b,d,a)}else{y();for(var e=0;e<x;e++)z(o[e],e,a,!1)}for(var f=0;f<t;f++)for(var g=0;g<x;g++)q[f][g]*=q[f][g];for(var h=0;h<x;h++)r[h]=[];for(var i=0;i<x;i++)for(var j=0;j<x;j++)r[i][j]=q[o[j]][i]}(v),!function(){for(var a=f.svd(r),b=a.S,c=a.U,d=a.V,g=b[0]*b[0]*b[0],h=[],i=0;i<x;i++){h[i]=[];for(var j=0;j<x;j++)h[i][j]=0,i==j&&(h[i][j]=b[i]/(b[i]*b[i]+g/(b[i]*b[i])))}s=e.multMat(e.multMat(d,h),e.transpose(c))}(),!function(){for(var a=void 0,b=void 0,c=[],d=[],f=[],g=[],h=0;h<t;h++)c[h]=Math.random(),d[h]=Math.random();c=e.normalize(c),d=e.normalize(d);for(var i=0,j=1e-9,k=1e-9,l=void 0;;){i++;for(var o=0;o<t;o++)f[o]=c[o];if(c=e.multGamma(e.multL(e.multGamma(f),q,s)),a=e.dotProduct(f,c),c=e.normalize(c),(l=Math.abs((j=e.dotProduct(f,c))/k))<=1+u&&l>=1)break;k=j}for(var p=0;p<t;p++)f[p]=c[p];for(i=0,k=1e-9;;){i++;for(var r=0;r<t;r++)g[r]=d[r];if(g=e.minusOp(g,e.multCons(f,e.dotProduct(f,g))),d=e.multGamma(e.multL(e.multGamma(g),q,s)),b=e.dotProduct(g,d),d=e.normalize(d),(l=Math.abs((j=e.dotProduct(g,d))/k))<=1+u&&l>=1)break;k=j}for(var v=0;v<t;v++)g[v]=d[v];m=e.multCons(f,Math.sqrt(Math.abs(a))),n=e.multCons(g,Math.sqrt(Math.abs(b)))}()):j.forEach(function(a,c){m.push(b.getElementById(c).position("x")),n.push(b.getElementById(c).position("y"))}),{nodeIndexes:j,xCoords:m,yCoords:n}}var S=j.keys(),T=b.getElementById(S.next().value),U=T.position(),V=T.outerWidth();if(m.push(U.x),n.push(U.y),2==t){var W=b.getElementById(S.next().value).outerWidth();m.push(U.x+V/2+W/2+a.idealEdgeLength),n.push(U.y)}return{nodeIndexes:j,xCoords:m,yCoords:n}}}},579:(a,b,c)=>{var d=c(212),e=function(a){a&&a("layout","fcose",d)};"u">typeof cytoscape&&e(cytoscape),a.exports=e},140:a=>{a.exports=d}},b={};return function c(d){var e=b[d];if(void 0!==e)return e.exports;var f=b[d]={exports:{}};return a[d](f,f.exports,c),f.exports}(579)})()},50980:function(a,b,c){var d;d=c(94548),a.exports=(()=>{"use strict";var a={45:(a,b,c)=>{var d={};d.layoutBase=c(551),d.CoSEConstants=c(806),d.CoSEEdge=c(767),d.CoSEGraph=c(880),d.CoSEGraphManager=c(578),d.CoSELayout=c(765),d.CoSENode=c(991),d.ConstraintHandler=c(902),a.exports=d},806:(a,b,c)=>{var d=c(551).FDLayoutConstants;function e(){}for(var f in d)e[f]=d[f];e.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,e.DEFAULT_RADIAL_SEPARATION=d.DEFAULT_EDGE_LENGTH,e.DEFAULT_COMPONENT_SEPERATION=60,e.TILE=!0,e.TILING_PADDING_VERTICAL=10,e.TILING_PADDING_HORIZONTAL=10,e.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,e.ENFORCE_CONSTRAINTS=!0,e.APPLY_LAYOUT=!0,e.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,e.TREE_REDUCTION_ON_INCREMENTAL=!0,e.PURE_INCREMENTAL=e.DEFAULT_INCREMENTAL,a.exports=e},767:(a,b,c)=>{var d=c(551).FDLayoutEdge;function e(a,b,c){d.call(this,a,b,c)}for(var f in e.prototype=Object.create(d.prototype),d)e[f]=d[f];a.exports=e},880:(a,b,c)=>{var d=c(551).LGraph;function e(a,b,c){d.call(this,a,b,c)}for(var f in e.prototype=Object.create(d.prototype),d)e[f]=d[f];a.exports=e},578:(a,b,c)=>{var d=c(551).LGraphManager;function e(a){d.call(this,a)}for(var f in e.prototype=Object.create(d.prototype),d)e[f]=d[f];a.exports=e},765:(a,b,c)=>{var d=c(551).FDLayout,e=c(578),f=c(880),g=c(991),h=c(767),i=c(806),j=c(902),k=c(551).FDLayoutConstants,l=c(551).LayoutConstants,m=c(551).Point,n=c(551).PointD,o=c(551).DimensionD,p=c(551).Layout,q=c(551).Integer,r=c(551).IGeometry,s=c(551).LGraph,t=c(551).Transform,u=c(551).LinkedList;function v(){d.call(this),this.toBeTiled={},this.constraints={}}for(var w in v.prototype=Object.create(d.prototype),d)v[w]=d[w];v.prototype.newGraphManager=function(){var a=new e(this);return this.graphManager=a,a},v.prototype.newGraph=function(a){return new f(null,this.graphManager,a)},v.prototype.newNode=function(a){return new g(this.graphManager,a)},v.prototype.newEdge=function(a){return new h(null,null,a)},v.prototype.initParameters=function(){d.prototype.initParameters.call(this,arguments),this.isSubLayout||(i.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=i.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=k.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=k.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=k.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=k.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},v.prototype.initSpringEmbedder=function(){d.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/k.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},v.prototype.layout=function(){return l.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},v.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(i.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var a=new Set(this.getAllNodes()),b=this.nodesWithGravity.filter(function(b){return a.has(b)});this.graphManager.setAllNodesToApplyGravitation(b)}}else{var c=this.getFlatForest();if(c.length>0)this.positionNodesRadially(c);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var a=new Set(this.getAllNodes()),b=this.nodesWithGravity.filter(function(b){return a.has(b)});this.graphManager.setAllNodesToApplyGravitation(b),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(j.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),i.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},v.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(!(this.prunedNodesAll.length>0))return!0;else this.isTreeGrowing=!0;if(this.totalIterations%k.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(!(this.prunedNodesAll.length>0))return!0;else this.isTreeGrowing=!0;this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(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 a=new Set(this.getAllNodes()),b=this.nodesWithGravity.filter(function(b){return a.has(b)});this.graphManager.setAllNodesToApplyGravitation(b),this.graphManager.updateBounds(),this.updateGrid(),i.PURE_INCREMENTAL?this.coolingFactor=k.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=k.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()),i.PURE_INCREMENTAL?this.coolingFactor=k.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=k.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var c=!this.isTreeGrowing&&!this.isGrowthFinished,d=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,d),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},v.prototype.getPositionsData=function(){for(var a=this.graphManager.getAllNodes(),b={},c=0;c<a.length;c++){var d=a[c].rect,e=a[c].id;b[e]={id:e,x:d.getCenterX(),y:d.getCenterY(),w:d.width,h:d.height}}return b},v.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var a=!1;if("during"===k.ANIMATE)this.emit("layoutstarted");else{for(;!a;)a=this.tick();this.graphManager.updateBounds()}},v.prototype.moveNodes=function(){for(var a,b=this.getAllNodes(),c=0;c<b.length;c++)b[c].calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(var c=0;c<b.length;c++)b[c].move()},v.prototype.initConstraintVariables=function(){var a=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var b=this.graphManager.getAllNodes(),c=0;c<b.length;c++){var d=b[c];this.idToNodeMap.set(d.id,d)}if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(b){a.fixedNodeSet.add(b.nodeId)});for(var d,b=this.graphManager.getAllNodes(),c=0;c<b.length;c++)if(null!=(d=b[c]).getChild()){var e=function b(c){for(var d,e=c.getChild().getNodes(),f=0,g=0;g<e.length;g++)null==(d=e[g]).getChild()?a.fixedNodeSet.has(d.id)&&(f+=100):f+=b(d);return f}(d);e>0&&(d.fixedNodeWeight=e)}}if(this.constraints.relativePlacementConstraint){var f=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(b){a.fixedNodesOnHorizontal.add(b),a.fixedNodesOnVertical.add(b)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var h=this.constraints.alignmentConstraint.vertical,c=0;c<h.length;c++)this.dummyToNodeForVerticalAlignment.set("dummy"+c,[]),h[c].forEach(function(b){f.set(b,"dummy"+c),a.dummyToNodeForVerticalAlignment.get("dummy"+c).push(b),a.fixedNodeSet.has(b)&&a.fixedNodesOnHorizontal.add("dummy"+c)});if(this.constraints.alignmentConstraint.horizontal)for(var j=this.constraints.alignmentConstraint.horizontal,c=0;c<j.length;c++)this.dummyToNodeForHorizontalAlignment.set("dummy"+c,[]),j[c].forEach(function(b){g.set(b,"dummy"+c),a.dummyToNodeForHorizontalAlignment.get("dummy"+c).push(b),a.fixedNodeSet.has(b)&&a.fixedNodesOnVertical.add("dummy"+c)})}if(i.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(a){var b,c,d;for(d=a.length-1;d>=2*a.length/3;d--)b=Math.floor(Math.random()*(d+1)),c=a[d],a[d]=a[b],a[b]=c;return a},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(b){if(b.left){var c=f.has(b.left)?f.get(b.left):b.left,d=f.has(b.right)?f.get(b.right):b.right;a.nodesInRelativeHorizontal.includes(c)||(a.nodesInRelativeHorizontal.push(c),a.nodeToRelativeConstraintMapHorizontal.set(c,[]),a.dummyToNodeForVerticalAlignment.has(c)?a.nodeToTempPositionMapHorizontal.set(c,a.idToNodeMap.get(a.dummyToNodeForVerticalAlignment.get(c)[0]).getCenterX()):a.nodeToTempPositionMapHorizontal.set(c,a.idToNodeMap.get(c).getCenterX())),a.nodesInRelativeHorizontal.includes(d)||(a.nodesInRelativeHorizontal.push(d),a.nodeToRelativeConstraintMapHorizontal.set(d,[]),a.dummyToNodeForVerticalAlignment.has(d)?a.nodeToTempPositionMapHorizontal.set(d,a.idToNodeMap.get(a.dummyToNodeForVerticalAlignment.get(d)[0]).getCenterX()):a.nodeToTempPositionMapHorizontal.set(d,a.idToNodeMap.get(d).getCenterX())),a.nodeToRelativeConstraintMapHorizontal.get(c).push({right:d,gap:b.gap}),a.nodeToRelativeConstraintMapHorizontal.get(d).push({left:c,gap:b.gap})}else{var e=g.has(b.top)?g.get(b.top):b.top,h=g.has(b.bottom)?g.get(b.bottom):b.bottom;a.nodesInRelativeVertical.includes(e)||(a.nodesInRelativeVertical.push(e),a.nodeToRelativeConstraintMapVertical.set(e,[]),a.dummyToNodeForHorizontalAlignment.has(e)?a.nodeToTempPositionMapVertical.set(e,a.idToNodeMap.get(a.dummyToNodeForHorizontalAlignment.get(e)[0]).getCenterY()):a.nodeToTempPositionMapVertical.set(e,a.idToNodeMap.get(e).getCenterY())),a.nodesInRelativeVertical.includes(h)||(a.nodesInRelativeVertical.push(h),a.nodeToRelativeConstraintMapVertical.set(h,[]),a.dummyToNodeForHorizontalAlignment.has(h)?a.nodeToTempPositionMapVertical.set(h,a.idToNodeMap.get(a.dummyToNodeForHorizontalAlignment.get(h)[0]).getCenterY()):a.nodeToTempPositionMapVertical.set(h,a.idToNodeMap.get(h).getCenterY())),a.nodeToRelativeConstraintMapVertical.get(e).push({bottom:h,gap:b.gap}),a.nodeToRelativeConstraintMapVertical.get(h).push({top:e,gap:b.gap})}});else{var k=new Map,l=new Map;this.constraints.relativePlacementConstraint.forEach(function(a){if(a.left){var b=f.has(a.left)?f.get(a.left):a.left,c=f.has(a.right)?f.get(a.right):a.right;k.has(b)?k.get(b).push(c):k.set(b,[c]),k.has(c)?k.get(c).push(b):k.set(c,[b])}else{var d=g.has(a.top)?g.get(a.top):a.top,e=g.has(a.bottom)?g.get(a.bottom):a.bottom;l.has(d)?l.get(d).push(e):l.set(d,[e]),l.has(e)?l.get(e).push(d):l.set(e,[d])}});var m=function(a,b){var c=[],d=[],e=new u,f=new Set,g=0;return a.forEach(function(h,i){if(!f.has(i)){c[g]=[],d[g]=!1;var j=i;for(e.push(j),f.add(j),c[g].push(j);0!=e.length;)j=e.shift(),b.has(j)&&(d[g]=!0),a.get(j).forEach(function(a){f.has(a)||(e.push(a),f.add(a),c[g].push(a))});g++}}),{components:c,isFixed:d}},n=m(k,a.fixedNodesOnHorizontal);this.componentsOnHorizontal=n.components,this.fixedComponentsOnHorizontal=n.isFixed;var o=m(l,a.fixedNodesOnVertical);this.componentsOnVertical=o.components,this.fixedComponentsOnVertical=o.isFixed}}},v.prototype.updateDisplacements=function(){var a=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(b){var c=a.idToNodeMap.get(b.nodeId);c.displacementX=0,c.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var b=this.constraints.alignmentConstraint.vertical,c=0;c<b.length;c++){for(var d=0,e=0;e<b[c].length;e++){if(this.fixedNodeSet.has(b[c][e])){d=0;break}d+=this.idToNodeMap.get(b[c][e]).displacementX}for(var f=d/b[c].length,e=0;e<b[c].length;e++)this.idToNodeMap.get(b[c][e]).displacementX=f}if(this.constraints.alignmentConstraint.horizontal)for(var g=this.constraints.alignmentConstraint.horizontal,c=0;c<g.length;c++){for(var h=0,e=0;e<g[c].length;e++){if(this.fixedNodeSet.has(g[c][e])){h=0;break}h+=this.idToNodeMap.get(g[c][e]).displacementY}for(var j=h/g[c].length,e=0;e<g[c].length;e++)this.idToNodeMap.get(g[c][e]).displacementY=j}}if(this.constraints.relativePlacementConstraint)if(i.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(b){if(!a.fixedNodesOnHorizontal.has(b)){var c=0;c=a.dummyToNodeForVerticalAlignment.has(b)?a.idToNodeMap.get(a.dummyToNodeForVerticalAlignment.get(b)[0]).displacementX:a.idToNodeMap.get(b).displacementX,a.nodeToRelativeConstraintMapHorizontal.get(b).forEach(function(d){if(d.right){var e=a.nodeToTempPositionMapHorizontal.get(d.right)-a.nodeToTempPositionMapHorizontal.get(b)-c;e<d.gap&&(c-=d.gap-e)}else{var e=a.nodeToTempPositionMapHorizontal.get(b)-a.nodeToTempPositionMapHorizontal.get(d.left)+c;e<d.gap&&(c+=d.gap-e)}}),a.nodeToTempPositionMapHorizontal.set(b,a.nodeToTempPositionMapHorizontal.get(b)+c),a.dummyToNodeForVerticalAlignment.has(b)?a.dummyToNodeForVerticalAlignment.get(b).forEach(function(b){a.idToNodeMap.get(b).displacementX=c}):a.idToNodeMap.get(b).displacementX=c}}),this.nodesInRelativeVertical.forEach(function(b){if(!a.fixedNodesOnHorizontal.has(b)){var c=0;c=a.dummyToNodeForHorizontalAlignment.has(b)?a.idToNodeMap.get(a.dummyToNodeForHorizontalAlignment.get(b)[0]).displacementY:a.idToNodeMap.get(b).displacementY,a.nodeToRelativeConstraintMapVertical.get(b).forEach(function(d){if(d.bottom){var e=a.nodeToTempPositionMapVertical.get(d.bottom)-a.nodeToTempPositionMapVertical.get(b)-c;e<d.gap&&(c-=d.gap-e)}else{var e=a.nodeToTempPositionMapVertical.get(b)-a.nodeToTempPositionMapVertical.get(d.top)+c;e<d.gap&&(c+=d.gap-e)}}),a.nodeToTempPositionMapVertical.set(b,a.nodeToTempPositionMapVertical.get(b)+c),a.dummyToNodeForHorizontalAlignment.has(b)?a.dummyToNodeForHorizontalAlignment.get(b).forEach(function(b){a.idToNodeMap.get(b).displacementY=c}):a.idToNodeMap.get(b).displacementY=c}});else{for(var c=0;c<this.componentsOnHorizontal.length;c++){var k=this.componentsOnHorizontal[c];if(this.fixedComponentsOnHorizontal[c])for(var e=0;e<k.length;e++)this.dummyToNodeForVerticalAlignment.has(k[e])?this.dummyToNodeForVerticalAlignment.get(k[e]).forEach(function(b){a.idToNodeMap.get(b).displacementX=0}):this.idToNodeMap.get(k[e]).displacementX=0;else{for(var l=0,m=0,e=0;e<k.length;e++)if(this.dummyToNodeForVerticalAlignment.has(k[e])){var n=this.dummyToNodeForVerticalAlignment.get(k[e]);l+=n.length*this.idToNodeMap.get(n[0]).displacementX,m+=n.length}else l+=this.idToNodeMap.get(k[e]).displacementX,m++;for(var o=l/m,e=0;e<k.length;e++)this.dummyToNodeForVerticalAlignment.has(k[e])?this.dummyToNodeForVerticalAlignment.get(k[e]).forEach(function(b){a.idToNodeMap.get(b).displacementX=o}):this.idToNodeMap.get(k[e]).displacementX=o}}for(var c=0;c<this.componentsOnVertical.length;c++){var k=this.componentsOnVertical[c];if(this.fixedComponentsOnVertical[c])for(var e=0;e<k.length;e++)this.dummyToNodeForHorizontalAlignment.has(k[e])?this.dummyToNodeForHorizontalAlignment.get(k[e]).forEach(function(b){a.idToNodeMap.get(b).displacementY=0}):this.idToNodeMap.get(k[e]).displacementY=0;else{for(var l=0,m=0,e=0;e<k.length;e++)if(this.dummyToNodeForHorizontalAlignment.has(k[e])){var n=this.dummyToNodeForHorizontalAlignment.get(k[e]);l+=n.length*this.idToNodeMap.get(n[0]).displacementY,m+=n.length}else l+=this.idToNodeMap.get(k[e]).displacementY,m++;for(var o=l/m,e=0;e<k.length;e++)this.dummyToNodeForHorizontalAlignment.has(k[e])?this.dummyToNodeForHorizontalAlignment.get(k[e]).forEach(function(b){a.idToNodeMap.get(b).displacementY=o}):this.idToNodeMap.get(k[e]).displacementY=o}}}},v.prototype.calculateNodesToApplyGravitationTo=function(){var a,b,c=[],d=this.graphManager.getGraphs(),e=d.length;for(b=0;b<e;b++)(a=d[b]).updateConnected(),a.isConnected||(c=c.concat(a.getNodes()));return c},v.prototype.createBendpoints=function(){var a=[];a=a.concat(this.graphManager.getAllEdges());var b=new Set;for(f=0;f<a.length;f++){var c=a[f];if(!b.has(c)){var d=c.getSource(),e=c.getTarget();if(d==e)c.getBendpoints().push(new n),c.getBendpoints().push(new n),this.createDummyNodesForBendpoints(c),b.add(c);else{var f,g,h=[];if(h=(h=h.concat(d.getEdgeListToNode(e))).concat(e.getEdgeListToNode(d)),!b.has(h[0])){if(h.length>1)for(g=0;g<h.length;g++){var i=h[g];i.getBendpoints().push(new n),this.createDummyNodesForBendpoints(i)}h.forEach(function(a){b.add(a)})}}}if(b.size==a.length)break}},v.prototype.positionNodesRadially=function(a){for(var b=new m(0,0),c=Math.ceil(Math.sqrt(a.length)),d=0,e=0,f=0,g=new n(0,0),h=0;h<a.length;h++){h%c==0&&(f=0,e=d,0!=h&&(e+=i.DEFAULT_COMPONENT_SEPERATION),d=0);var j=a[h],k=p.findCenterOfTree(j);b.x=f,b.y=e,(g=v.radialLayout(j,k,b)).y>d&&(d=Math.floor(g.y)),f=Math.floor(g.x+i.DEFAULT_COMPONENT_SEPERATION)}this.transform(new n(l.WORLD_CENTER_X-g.x/2,l.WORLD_CENTER_Y-g.y/2))},v.radialLayout=function(a,b,c){var d=Math.max(this.maxDiagonalInTree(a),i.DEFAULT_RADIAL_SEPARATION);v.branchRadialLayout(b,null,0,359,0,d);var e=s.calculateBounds(a),f=new t;f.setDeviceOrgX(e.getMinX()),f.setDeviceOrgY(e.getMinY()),f.setWorldOrgX(c.x),f.setWorldOrgY(c.y);for(var g=0;g<a.length;g++)a[g].transform(f);var h=new n(e.getMaxX(),e.getMaxY());return f.inverseTransformPoint(h)},v.branchRadialLayout=function(a,b,c,d,e,f){var g,h=(d-c+1)/2;h<0&&(h+=180);var i=(h+c)%360*r.TWO_PI/360,j=e*Math.cos(i),k=e*Math.sin(i);a.setCenter(j,k);var l=[],m=(l=l.concat(a.getEdges())).length;null!=b&&m--;for(var n=0,o=l.length,p=a.getEdgesBetween(b);p.length>1;){var q=p[0];p.splice(0,1);var s=l.indexOf(q);s>=0&&l.splice(s,1),o--,m--}g=null!=b?(l.indexOf(p[0])+1)%o:0;for(var t=Math.abs(d-c)/m,u=g;n!=m;u=++u%o){var w=l[u].getOtherEnd(a);if(w!=b){var x=(c+n*t)%360,y=(x+t)%360;v.branchRadialLayout(w,a,x,y,e+f,f),n++}}},v.maxDiagonalInTree=function(a){for(var b=q.MIN_VALUE,c=0;c<a.length;c++){var d=a[c].getDiagonal();d>b&&(b=d)}return b},v.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},v.prototype.groupZeroDegreeMembers=function(){var a=this,b={};this.memberGroups={},this.idToDummyNode={};for(var c=[],d=this.graphManager.getAllNodes(),e=0;e<d.length;e++){var f=d[e],h=f.getParent();0!==this.getNodeDegreeWithChildren(f)||void 0!=h.id&&this.getToBeTiled(h)||c.push(f)}for(var e=0;e<c.length;e++){var f=c[e],i=f.getParent().id;void 0===b[i]&&(b[i]=[]),b[i]=b[i].concat(f)}Object.keys(b).forEach(function(c){if(b[c].length>1){var d="DummyCompound_"+c;a.memberGroups[d]=b[c];var e=b[c][0].getParent(),f=new g(a.graphManager);f.id=d,f.paddingLeft=e.paddingLeft||0,f.paddingRight=e.paddingRight||0,f.paddingBottom=e.paddingBottom||0,f.paddingTop=e.paddingTop||0,a.idToDummyNode[d]=f;var h=a.getGraphManager().add(a.newGraph(),f),i=e.getChild();i.add(f);for(var j=0;j<b[c].length;j++){var k=b[c][j];i.remove(k),h.add(k)}}})},v.prototype.clearCompounds=function(){var a={},b={};this.performDFSOnCompounds();for(var c=0;c<this.compoundOrder.length;c++)b[this.compoundOrder[c].id]=this.compoundOrder[c],a[this.compoundOrder[c].id]=[].concat(this.compoundOrder[c].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[c].getChild()),this.compoundOrder[c].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(a,b)},v.prototype.clearZeroDegreeMembers=function(){var a=this,b=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(c){var d=a.idToDummyNode[c];if(b[c]=a.tileNodes(a.memberGroups[c],d.paddingLeft+d.paddingRight),d.rect.width=b[c].width,d.rect.height=b[c].height,d.setCenter(b[c].centerX,b[c].centerY),d.labelMarginLeft=0,d.labelMarginTop=0,i.NODE_DIMENSIONS_INCLUDE_LABELS){var e=d.rect.width,f=d.rect.height;d.labelWidth&&("left"==d.labelPosHorizontal?(d.rect.x-=d.labelWidth,d.setWidth(e+d.labelWidth),d.labelMarginLeft=d.labelWidth):"center"==d.labelPosHorizontal&&d.labelWidth>e?(d.rect.x-=(d.labelWidth-e)/2,d.setWidth(d.labelWidth),d.labelMarginLeft=(d.labelWidth-e)/2):"right"==d.labelPosHorizontal&&d.setWidth(e+d.labelWidth)),d.labelHeight&&("top"==d.labelPosVertical?(d.rect.y-=d.labelHeight,d.setHeight(f+d.labelHeight),d.labelMarginTop=d.labelHeight):"center"==d.labelPosVertical&&d.labelHeight>f?(d.rect.y-=(d.labelHeight-f)/2,d.setHeight(d.labelHeight),d.labelMarginTop=(d.labelHeight-f)/2):"bottom"==d.labelPosVertical&&d.setHeight(f+d.labelHeight))}})},v.prototype.repopulateCompounds=function(){for(var a=this.compoundOrder.length-1;a>=0;a--){var b=this.compoundOrder[a],c=b.id,d=b.paddingLeft,e=b.paddingTop,f=b.labelMarginLeft,g=b.labelMarginTop;this.adjustLocations(this.tiledMemberPack[c],b.rect.x,b.rect.y,d,e,f,g)}},v.prototype.repopulateZeroDegreeMembers=function(){var a=this,b=this.tiledZeroDegreePack;Object.keys(b).forEach(function(c){var d=a.idToDummyNode[c],e=d.paddingLeft,f=d.paddingTop,g=d.labelMarginLeft,h=d.labelMarginTop;a.adjustLocations(b[c],d.rect.x,d.rect.y,e,f,g,h)})},v.prototype.getToBeTiled=function(a){var b=a.id;if(null!=this.toBeTiled[b])return this.toBeTiled[b];var c=a.getChild();if(null==c)return this.toBeTiled[b]=!1,!1;for(var d=c.getNodes(),e=0;e<d.length;e++){var f=d[e];if(this.getNodeDegree(f)>0)return this.toBeTiled[b]=!1,!1;if(null==f.getChild()){this.toBeTiled[f.id]=!1;continue}if(!this.getToBeTiled(f))return this.toBeTiled[b]=!1,!1}return this.toBeTiled[b]=!0,!0},v.prototype.getNodeDegree=function(a){a.id;for(var b=a.getEdges(),c=0,d=0;d<b.length;d++){var e=b[d];e.getSource().id!==e.getTarget().id&&(c+=1)}return c},v.prototype.getNodeDegreeWithChildren=function(a){var b=this.getNodeDegree(a);if(null==a.getChild())return b;for(var c=a.getChild().getNodes(),d=0;d<c.length;d++){var e=c[d];b+=this.getNodeDegreeWithChildren(e)}return b},v.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},v.prototype.fillCompexOrderByDFS=function(a){for(var b=0;b<a.length;b++){var c=a[b];null!=c.getChild()&&this.fillCompexOrderByDFS(c.getChild().getNodes()),this.getToBeTiled(c)&&this.compoundOrder.push(c)}},v.prototype.adjustLocations=function(a,b,c,d,e,f,g){b+=d+f,c+=e+g;for(var h=b,i=0;i<a.rows.length;i++){var j=a.rows[i];b=h;for(var k=0,l=0;l<j.length;l++){var m=j[l];m.rect.x=b,m.rect.y=c,b+=m.rect.width+a.horizontalPadding,m.rect.height>k&&(k=m.rect.height)}c+=k+a.verticalPadding}},v.prototype.tileCompoundMembers=function(a,b){var c=this;this.tiledMemberPack=[],Object.keys(a).forEach(function(d){var e=b[d];if(c.tiledMemberPack[d]=c.tileNodes(a[d],e.paddingLeft+e.paddingRight),e.rect.width=c.tiledMemberPack[d].width,e.rect.height=c.tiledMemberPack[d].height,e.setCenter(c.tiledMemberPack[d].centerX,c.tiledMemberPack[d].centerY),e.labelMarginLeft=0,e.labelMarginTop=0,i.NODE_DIMENSIONS_INCLUDE_LABELS){var f=e.rect.width,g=e.rect.height;e.labelWidth&&("left"==e.labelPosHorizontal?(e.rect.x-=e.labelWidth,e.setWidth(f+e.labelWidth),e.labelMarginLeft=e.labelWidth):"center"==e.labelPosHorizontal&&e.labelWidth>f?(e.rect.x-=(e.labelWidth-f)/2,e.setWidth(e.labelWidth),e.labelMarginLeft=(e.labelWidth-f)/2):"right"==e.labelPosHorizontal&&e.setWidth(f+e.labelWidth)),e.labelHeight&&("top"==e.labelPosVertical?(e.rect.y-=e.labelHeight,e.setHeight(g+e.labelHeight),e.labelMarginTop=e.labelHeight):"center"==e.labelPosVertical&&e.labelHeight>g?(e.rect.y-=(e.labelHeight-g)/2,e.setHeight(e.labelHeight),e.labelMarginTop=(e.labelHeight-g)/2):"bottom"==e.labelPosVertical&&e.setHeight(g+e.labelHeight))}})},v.prototype.tileNodes=function(a,b){var c=this.tileNodesByFavoringDim(a,b,!0),d=this.tileNodesByFavoringDim(a,b,!1),e=this.getOrgRatio(c);return this.getOrgRatio(d)<e?d:c},v.prototype.getOrgRatio=function(a){var b=a.width/a.height;return b<1&&(b=1/b),b},v.prototype.calcIdealRowWidth=function(a,b){var c,d=i.TILING_PADDING_VERTICAL,e=i.TILING_PADDING_HORIZONTAL,f=a.length,g=0,h=0,j=0;a.forEach(function(a){g+=a.getWidth(),h+=a.getHeight(),a.getWidth()>j&&(j=a.getWidth())});var k=g/f,l=Math.pow(d-e,2)+4*(k+e)*(h/f+d)*f,m=(e-d+Math.sqrt(l))/(2*(k+e));b?(c=Math.ceil(m))==m&&c++:c=Math.floor(m);var n=c*(k+e)-e;return j>n&&(n=j),n+=2*e},v.prototype.tileNodesByFavoringDim=function(a,b,c){var d=i.TILING_PADDING_VERTICAL,e=i.TILING_PADDING_HORIZONTAL,f=i.TILING_COMPARE_BY,g={rows:[],rowWidth:[],rowHeight:[],width:0,height:b,verticalPadding:d,horizontalPadding:e,centerX:0,centerY:0};f&&(g.idealRowWidth=this.calcIdealRowWidth(a,c));var h=function(a){return a.rect.width*a.rect.height},j=function(a,b){return h(b)-h(a)};a.sort(function(a,b){var c=j;return g.idealRowWidth?(c=f)(a.id,b.id):c(a,b)});for(var k=0,l=0,m=0;m<a.length;m++){var n=a[m];k+=n.getCenterX(),l+=n.getCenterY()}g.centerX=k/a.length,g.centerY=l/a.length;for(var m=0;m<a.length;m++){var n=a[m];if(0==g.rows.length)this.insertNodeToRow(g,n,0,b);else if(this.canAddHorizontal(g,n.rect.width,n.rect.height)){var o=g.rows.length-1;g.idealRowWidth||(o=this.getShortestRowIndex(g)),this.insertNodeToRow(g,n,o,b)}else this.insertNodeToRow(g,n,g.rows.length,b);this.shiftToLastRow(g)}return g},v.prototype.insertNodeToRow=function(a,b,c,d){c==a.rows.length&&(a.rows.push([]),a.rowWidth.push(d),a.rowHeight.push(0));var e=a.rowWidth[c]+b.rect.width;a.rows[c].length>0&&(e+=a.horizontalPadding),a.rowWidth[c]=e,a.width<e&&(a.width=e);var f=b.rect.height;c>0&&(f+=a.verticalPadding);var g=0;f>a.rowHeight[c]&&(g=a.rowHeight[c],a.rowHeight[c]=f,g=a.rowHeight[c]-g),a.height+=g,a.rows[c].push(b)},v.prototype.getShortestRowIndex=function(a){for(var b=-1,c=Number.MAX_VALUE,d=0;d<a.rows.length;d++)a.rowWidth[d]<c&&(b=d,c=a.rowWidth[d]);return b},v.prototype.getLongestRowIndex=function(a){for(var b=-1,c=5e-324,d=0;d<a.rows.length;d++)a.rowWidth[d]>c&&(b=d,c=a.rowWidth[d]);return b},v.prototype.canAddHorizontal=function(a,b,c){if(a.idealRowWidth){var d,e,f=a.rows.length-1;return a.rowWidth[f]+b+a.horizontalPadding<=a.idealRowWidth}var g=this.getShortestRowIndex(a);if(g<0)return!0;var h=a.rowWidth[g];if(h+a.horizontalPadding+b<=a.width)return!0;var i=0;return a.rowHeight[g]<c&&g>0&&(i=c+a.verticalPadding-a.rowHeight[g]),d=a.width-h>=b+a.horizontalPadding?(a.height+i)/(h+b+a.horizontalPadding):(a.height+i)/a.width,i=c+a.verticalPadding,(e=a.width<b?(a.height+i)/b:(a.height+i)/a.width)<1&&(e=1/e),d<1&&(d=1/d),d<e},v.prototype.shiftToLastRow=function(a){var b=this.getLongestRowIndex(a),c=a.rowWidth.length-1,d=a.rows[b],e=d[d.length-1],f=e.width+a.horizontalPadding;if(a.width-a.rowWidth[c]>f&&b!=c){d.splice(-1,1),a.rows[c].push(e),a.rowWidth[b]=a.rowWidth[b]-f,a.rowWidth[c]=a.rowWidth[c]+f,a.width=a.rowWidth[instance.getLongestRowIndex(a)];for(var g=5e-324,h=0;h<d.length;h++)d[h].height>g&&(g=d[h].height);b>0&&(g+=a.verticalPadding);var i=a.rowHeight[b]+a.rowHeight[c];a.rowHeight[b]=g,a.rowHeight[c]<e.height+a.verticalPadding&&(a.rowHeight[c]=e.height+a.verticalPadding);var j=a.rowHeight[b]+a.rowHeight[c];a.height+=j-i,this.shiftToLastRow(a)}},v.prototype.tilingPreLayout=function(){i.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},v.prototype.tilingPostLayout=function(){i.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},v.prototype.reduceTrees=function(){for(var a,b=[],c=!0;c;){var d=this.graphManager.getAllNodes(),e=[];c=!1;for(var f=0;f<d.length;f++)if(1==(a=d[f]).getEdges().length&&!a.getEdges()[0].isInterGraph&&null==a.getChild()){if(i.PURE_INCREMENTAL){var g=a.getEdges()[0].getOtherEnd(a),h=new o(a.getCenterX()-g.getCenterX(),a.getCenterY()-g.getCenterY());e.push([a,a.getEdges()[0],a.getOwner(),h])}else e.push([a,a.getEdges()[0],a.getOwner()]);c=!0}if(!0==c){for(var j=[],k=0;k<e.length;k++)1==e[k][0].getEdges().length&&(j.push(e[k]),e[k][0].getOwner().remove(e[k][0]));b.push(j),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=b},v.prototype.growTree=function(a){for(var b,c=a.length,d=a[c-1],e=0;e<d.length;e++)b=d[e],this.findPlaceforPrunedNode(b),b[2].add(b[0]),b[2].add(b[1],b[1].source,b[1].target);a.splice(a.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},v.prototype.findPlaceforPrunedNode=function(a){var b=a[0];if(d=b==a[1].source?a[1].target:a[1].source,i.PURE_INCREMENTAL)b.setCenter(d.getCenterX()+a[3].getWidth(),d.getCenterY()+a[3].getHeight());else{var c,d,e,f,g=d.startX,h=d.finishX,j=d.startY,l=d.finishY,m=[0,0,0,0];if(j>0)for(var n=g;n<=h;n++)m[0]+=this.grid[n][j-1].length+this.grid[n][j].length-1;if(h<this.grid.length-1)for(var n=j;n<=l;n++)m[1]+=this.grid[h+1][n].length+this.grid[h][n].length-1;if(l<this.grid[0].length-1)for(var n=g;n<=h;n++)m[2]+=this.grid[n][l+1].length+this.grid[n][l].length-1;if(g>0)for(var n=j;n<=l;n++)m[3]+=this.grid[g-1][n].length+this.grid[g][n].length-1;for(var o=q.MAX_VALUE,p=0;p<m.length;p++)m[p]<o?(o=m[p],e=1,f=p):m[p]==o&&e++;if(3==e&&0==o)0==m[0]&&0==m[1]&&0==m[2]?c=1:0==m[0]&&0==m[1]&&0==m[3]?c=0:0==m[0]&&0==m[2]&&0==m[3]?c=3:0==m[1]&&0==m[2]&&0==m[3]&&(c=2);else if(2==e&&0==o){var r=Math.floor(2*Math.random());c=0==m[0]&&0==m[1]?+(0!=r):0==m[0]&&0==m[2]?2*(0!=r):0==m[0]&&0==m[3]?3*(0!=r):0==m[1]&&0==m[2]?0==r?1:2:0==m[1]&&0==m[3]?0==r?1:3:0==r?2:3}else if(4==e&&0==o){var r=Math.floor(4*Math.random());c=r}else c=f;0==c?b.setCenter(d.getCenterX(),d.getCenterY()-d.getHeight()/2-k.DEFAULT_EDGE_LENGTH-b.getHeight()/2):1==c?b.setCenter(d.getCenterX()+d.getWidth()/2+k.DEFAULT_EDGE_LENGTH+b.getWidth()/2,d.getCenterY()):2==c?b.setCenter(d.getCenterX(),d.getCenterY()+d.getHeight()/2+k.DEFAULT_EDGE_LENGTH+b.getHeight()/2):b.setCenter(d.getCenterX()-d.getWidth()/2-k.DEFAULT_EDGE_LENGTH-b.getWidth()/2,d.getCenterY())}},a.exports=v},991:(a,b,c)=>{var d=c(551).FDLayoutNode,e=c(551).IMath;function f(a,b,c,e){d.call(this,a,b,c,e)}for(var g in f.prototype=Object.create(d.prototype),d)f[g]=d[g];f.prototype.calculateDisplacement=function(){var a=this.graphManager.getLayout();null!=this.getChild()&&this.fixedNodeWeight?(this.displacementX+=a.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=a.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=a.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=a.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>a.coolingFactor*a.maxNodeDisplacement&&(this.displacementX=a.coolingFactor*a.maxNodeDisplacement*e.sign(this.displacementX)),Math.abs(this.displacementY)>a.coolingFactor*a.maxNodeDisplacement&&(this.displacementY=a.coolingFactor*a.maxNodeDisplacement*e.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},f.prototype.propogateDisplacementToChildren=function(a,b){for(var c,d=this.getChild().getNodes(),e=0;e<d.length;e++)null==(c=d[e]).getChild()?(c.displacementX+=a,c.displacementY+=b):c.propogateDisplacementToChildren(a,b)},f.prototype.move=function(){var a=this.graphManager.getLayout();(null==this.child||0==this.child.getNodes().length)&&(this.moveBy(this.displacementX,this.displacementY),a.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY)),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},f.prototype.setPred1=function(a){this.pred1=a},f.prototype.getPred1=function(){return pred1},f.prototype.getPred2=function(){return pred2},f.prototype.setNext=function(a){this.next=a},f.prototype.getNext=function(){return next},f.prototype.setProcessed=function(a){this.processed=a},f.prototype.isProcessed=function(){return processed},a.exports=f},902:(a,b,c)=>{function d(a){if(!Array.isArray(a))return Array.from(a);for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}var e=c(806),f=c(551).LinkedList,g=c(551).Matrix,h=c(551).SVD;function i(){}i.handleConstraints=function(a){var b={};b.fixedNodeConstraint=a.constraints.fixedNodeConstraint,b.alignmentConstraint=a.constraints.alignmentConstraint,b.relativePlacementConstraint=a.constraints.relativePlacementConstraint;for(var c=new Map,i=new Map,j=[],k=[],l=a.getAllNodes(),m=0,n=0;n<l.length;n++){var o=l[n];null==o.getChild()&&(i.set(o.id,m++),j.push(o.getCenterX()),k.push(o.getCenterY()),c.set(o.id,o))}b.relativePlacementConstraint&&b.relativePlacementConstraint.forEach(function(a){a.gap||0==a.gap||(a.left?a.gap=e.DEFAULT_EDGE_LENGTH+c.get(a.left).getWidth()/2+c.get(a.right).getWidth()/2:a.gap=e.DEFAULT_EDGE_LENGTH+c.get(a.top).getHeight()/2+c.get(a.bottom).getHeight()/2)});var p=function(a){var b=0,c=0;return a.forEach(function(a){b+=j[i.get(a)],c+=k[i.get(a)]}),{x:b/a.size,y:c/a.size}},q=function(a,b,c,e,g){var h=new Map;a.forEach(function(a,b){h.set(b,0)}),a.forEach(function(a,b){a.forEach(function(a){h.set(a.id,h.get(a.id)+1)})});var l=new Map,m=new Map,n=new f;for(h.forEach(function(a,d){0==a?(n.push(d),c||("horizontal"==b?l.set(d,i.has(d)?j[i.get(d)]:e.get(d)):l.set(d,i.has(d)?k[i.get(d)]:e.get(d)))):l.set(d,-1/0),c&&m.set(d,new Set([d]))}),c&&g.forEach(function(a){var d=[];if(a.forEach(function(a){c.has(a)&&d.push(a)}),d.length>0){var f=0;d.forEach(function(a){"horizontal"==b?l.set(a,i.has(a)?j[i.get(a)]:e.get(a)):l.set(a,i.has(a)?k[i.get(a)]:e.get(a)),f+=l.get(a)}),f/=d.length,a.forEach(function(a){c.has(a)||l.set(a,f)})}else{var g=0;a.forEach(function(a){"horizontal"==b?g+=i.has(a)?j[i.get(a)]:e.get(a):g+=i.has(a)?k[i.get(a)]:e.get(a)}),g/=a.length,a.forEach(function(a){l.set(a,g)})}});0!=n.length;)!function(){var d=n.shift();a.get(d).forEach(function(a){if(l.get(a.id)<l.get(d)+a.gap)if(c&&c.has(a.id)){var f=void 0;if(f="horizontal"==b?i.has(a.id)?j[i.get(a.id)]:e.get(a.id):i.has(a.id)?k[i.get(a.id)]:e.get(a.id),l.set(a.id,f),f<l.get(d)+a.gap){var g=l.get(d)+a.gap-f;m.get(d).forEach(function(a){l.set(a,l.get(a)-g)})}}else l.set(a.id,l.get(d)+a.gap);h.set(a.id,h.get(a.id)-1),0==h.get(a.id)&&n.push(a.id),c&&m.set(a.id,function(a,b){var c=new Set(a),d=!0,e=!1,f=void 0;try{for(var g,h=b[Symbol.iterator]();!(d=(g=h.next()).done);d=!0){var i=g.value;c.add(i)}}catch(a){e=!0,f=a}finally{try{!d&&h.return&&h.return()}finally{if(e)throw f}}return c}(m.get(d),m.get(a.id)))})}();if(c){var o=new Set;a.forEach(function(a,b){0==a.length&&o.add(b)});var p=[];m.forEach(function(a,b){if(o.has(b)){var e=!1,f=!0,g=!1,h=void 0;try{for(var i,j=a[Symbol.iterator]();!(f=(i=j.next()).done);f=!0){var k=i.value;c.has(k)&&(e=!0)}}catch(a){g=!0,h=a}finally{try{!f&&j.return&&j.return()}finally{if(g)throw h}}if(!e){var l=!1,m=void 0;p.forEach(function(b,c){b.has([].concat(d(a))[0])&&(l=!0,m=c)}),l?a.forEach(function(a){p[m].add(a)}):p.push(new Set(a))}}}),p.forEach(function(a,c){var d=1/0,f=1/0,g=-1/0,h=-1/0,m=!0,n=!1,o=void 0;try{for(var p,q=a[Symbol.iterator]();!(m=(p=q.next()).done);m=!0){var r=p.value,s=void 0;s="horizontal"==b?i.has(r)?j[i.get(r)]:e.get(r):i.has(r)?k[i.get(r)]:e.get(r);var t=l.get(r);s<d&&(d=s),s>g&&(g=s),t<f&&(f=t),t>h&&(h=t)}}catch(a){n=!0,o=a}finally{try{!m&&q.return&&q.return()}finally{if(n)throw o}}var u=(d+g)/2-(f+h)/2,v=!0,w=!1,x=void 0;try{for(var y,z=a[Symbol.iterator]();!(v=(y=z.next()).done);v=!0){var A=y.value;l.set(A,l.get(A)+u)}}catch(a){w=!0,x=a}finally{try{!v&&z.return&&z.return()}finally{if(w)throw x}}})}return l},r=function(a){var b=0,c=0,d=0,e=0;if(a.forEach(function(a){a.left?j[i.get(a.left)]-j[i.get(a.right)]>=0?b++:c++:k[i.get(a.top)]-k[i.get(a.bottom)]>=0?d++:e++}),b>c&&d>e)for(var f=0;f<i.size;f++)j[f]=-1*j[f],k[f]=-1*k[f];else if(b>c)for(var g=0;g<i.size;g++)j[g]=-1*j[g];else if(d>e)for(var h=0;h<i.size;h++)k[h]=-1*k[h]},s=function(a){var b=[],c=new f,d=new Set,e=0;return a.forEach(function(f,g){if(!d.has(g)){b[e]=[];var h=g;for(c.push(h),d.add(h),b[e].push(h);0!=c.length;)h=c.shift(),a.get(h).forEach(function(a){d.has(a.id)||(c.push(a.id),d.add(a.id),b[e].push(a.id))});e++}}),b},t=function(a){var b=new Map;return a.forEach(function(a,c){b.set(c,[])}),a.forEach(function(a,c){a.forEach(function(a){b.get(c).push(a),b.get(a.id).push({id:c,gap:a.gap,direction:a.direction})})}),b},u=function(a){var b=new Map;return a.forEach(function(a,c){b.set(c,[])}),a.forEach(function(a,c){a.forEach(function(a){b.get(a.id).push({id:c,gap:a.gap,direction:a.direction})})}),b},v=[],w=[],x=!1,y=!1,z=new Set,A=new Map,B=new Map,C=[];if(b.fixedNodeConstraint&&b.fixedNodeConstraint.forEach(function(a){z.add(a.nodeId)}),b.relativePlacementConstraint&&(b.relativePlacementConstraint.forEach(function(a){a.left?(A.has(a.left)?A.get(a.left).push({id:a.right,gap:a.gap,direction:"horizontal"}):A.set(a.left,[{id:a.right,gap:a.gap,direction:"horizontal"}]),A.has(a.right)||A.set(a.right,[])):(A.has(a.top)?A.get(a.top).push({id:a.bottom,gap:a.gap,direction:"vertical"}):A.set(a.top,[{id:a.bottom,gap:a.gap,direction:"vertical"}]),A.has(a.bottom)||A.set(a.bottom,[]))}),C=s(B=t(A))),e.TRANSFORM_ON_CONSTRAINT_HANDLING){if(b.fixedNodeConstraint&&b.fixedNodeConstraint.length>1)b.fixedNodeConstraint.forEach(function(a,b){v[b]=[a.position.x,a.position.y],w[b]=[j[i.get(a.nodeId)],k[i.get(a.nodeId)]]}),x=!0;else if(b.alignmentConstraint)!function(){var a=0;if(b.alignmentConstraint.vertical){for(var c=b.alignmentConstraint.vertical,e=0;e<c.length;e++)!function(b){var e=new Set;c[b].forEach(function(a){e.add(a)});var f=new Set([].concat(d(e)).filter(function(a){return z.has(a)})),g=void 0;g=f.size>0?j[i.get(f.values().next().value)]:p(e).x,c[b].forEach(function(b){v[a]=[g,k[i.get(b)]],w[a]=[j[i.get(b)],k[i.get(b)]],a++})}(e);x=!0}if(b.alignmentConstraint.horizontal){for(var f=b.alignmentConstraint.horizontal,g=0;g<f.length;g++)!function(b){var c=new Set;f[b].forEach(function(a){c.add(a)});var e=new Set([].concat(d(c)).filter(function(a){return z.has(a)})),g=void 0;g=e.size>0?j[i.get(e.values().next().value)]:p(c).y,f[b].forEach(function(b){v[a]=[j[i.get(b)],g],w[a]=[j[i.get(b)],k[i.get(b)]],a++})}(g);x=!0}b.relativePlacementConstraint&&(y=!0)}();else if(b.relativePlacementConstraint){for(var D=0,E=0,F=0;F<C.length;F++)C[F].length>D&&(D=C[F].length,E=F);if(D<B.size/2)r(b.relativePlacementConstraint),x=!1,y=!1;else{var G=new Map,H=new Map,I=[];C[E].forEach(function(a){A.get(a).forEach(function(b){"horizontal"==b.direction?(G.has(a)?G.get(a).push(b):G.set(a,[b]),G.has(b.id)||G.set(b.id,[]),I.push({left:a,right:b.id})):(H.has(a)?H.get(a).push(b):H.set(a,[b]),H.has(b.id)||H.set(b.id,[]),I.push({top:a,bottom:b.id}))})}),r(I),y=!1;var J=q(G,"horizontal"),K=q(H,"vertical");C[E].forEach(function(a,b){w[b]=[j[i.get(a)],k[i.get(a)]],v[b]=[],J.has(a)?v[b][0]=J.get(a):v[b][0]=j[i.get(a)],K.has(a)?v[b][1]=K.get(a):v[b][1]=k[i.get(a)]}),x=!0}}if(x){for(var L=void 0,M=g.transpose(v),N=g.transpose(w),O=0;O<M.length;O++)M[O]=g.multGamma(M[O]),N[O]=g.multGamma(N[O]);var P=g.multMat(M,g.transpose(N)),Q=h.svd(P);L=g.multMat(Q.V,g.transpose(Q.U));for(var R=0;R<i.size;R++){var S=[j[R],k[R]],T=[L[0][0],L[1][0]],U=[L[0][1],L[1][1]];j[R]=g.dotProduct(S,T),k[R]=g.dotProduct(S,U)}y&&r(b.relativePlacementConstraint)}}if(e.ENFORCE_CONSTRAINTS){if(b.fixedNodeConstraint&&b.fixedNodeConstraint.length>0){var V={x:0,y:0};b.fixedNodeConstraint.forEach(function(a,b){var c,d={x:j[i.get(a.nodeId)],y:k[i.get(a.nodeId)]},e=(c=a.position,{x:c.x-d.x,y:c.y-d.y});V.x+=e.x,V.y+=e.y}),V.x/=b.fixedNodeConstraint.length,V.y/=b.fixedNodeConstraint.length,j.forEach(function(a,b){j[b]+=V.x}),k.forEach(function(a,b){k[b]+=V.y}),b.fixedNodeConstraint.forEach(function(a){j[i.get(a.nodeId)]=a.position.x,k[i.get(a.nodeId)]=a.position.y})}if(b.alignmentConstraint){if(b.alignmentConstraint.vertical)for(var W=b.alignmentConstraint.vertical,X=0;X<W.length;X++)!function(a){var b=new Set;W[a].forEach(function(a){b.add(a)});var c=new Set([].concat(d(b)).filter(function(a){return z.has(a)})),e=void 0;e=c.size>0?j[i.get(c.values().next().value)]:p(b).x,b.forEach(function(a){z.has(a)||(j[i.get(a)]=e)})}(X);if(b.alignmentConstraint.horizontal)for(var Y=b.alignmentConstraint.horizontal,Z=0;Z<Y.length;Z++)!function(a){var b=new Set;Y[a].forEach(function(a){b.add(a)});var c=new Set([].concat(d(b)).filter(function(a){return z.has(a)})),e=void 0;e=c.size>0?k[i.get(c.values().next().value)]:p(b).y,b.forEach(function(a){z.has(a)||(k[i.get(a)]=e)})}(Z)}b.relativePlacementConstraint&&function(){var a=new Map,c=new Map,d=new Map,e=new Map,f=new Map,g=new Map,h=new Set,l=new Set;if(z.forEach(function(a){h.add(a),l.add(a)}),b.alignmentConstraint){if(b.alignmentConstraint.vertical)for(var m=b.alignmentConstraint.vertical,n=function(b){d.set("dummy"+b,[]),m[b].forEach(function(c){a.set(c,"dummy"+b),d.get("dummy"+b).push(c),z.has(c)&&h.add("dummy"+b)}),f.set("dummy"+b,j[i.get(m[b][0])])},o=0;o<m.length;o++)n(o);if(b.alignmentConstraint.horizontal)for(var p=b.alignmentConstraint.horizontal,r=function(a){e.set("dummy"+a,[]),p[a].forEach(function(b){c.set(b,"dummy"+a),e.get("dummy"+a).push(b),z.has(b)&&l.add("dummy"+a)}),g.set("dummy"+a,k[i.get(p[a][0])])},v=0;v<p.length;v++)r(v)}var w=new Map,x=new Map,y=function(b){A.get(b).forEach(function(d){var e=void 0,f=void 0;"horizontal"==d.direction?(e=a.get(b)?a.get(b):b,f=a.get(d.id)?{id:a.get(d.id),gap:d.gap,direction:d.direction}:d,w.has(e)?w.get(e).push(f):w.set(e,[f]),w.has(f.id)||w.set(f.id,[])):(e=c.get(b)?c.get(b):b,f=c.get(d.id)?{id:c.get(d.id),gap:d.gap,direction:d.direction}:d,x.has(e)?x.get(e).push(f):x.set(e,[f]),x.has(f.id)||x.set(f.id,[]))})},B=!0,C=!1,D=void 0;try{for(var E,F=A.keys()[Symbol.iterator]();!(B=(E=F.next()).done);B=!0){var G=E.value;y(G)}}catch(a){C=!0,D=a}finally{try{!B&&F.return&&F.return()}finally{if(C)throw D}}var H=t(w),I=t(x),J=s(H),K=s(I),L=u(w),M=u(x),N=[],O=[];J.forEach(function(a,b){N[b]=[],a.forEach(function(a){0==L.get(a).length&&N[b].push(a)})}),K.forEach(function(a,b){O[b]=[],a.forEach(function(a){0==M.get(a).length&&O[b].push(a)})});var P=q(w,"horizontal",h,f,N),Q=q(x,"vertical",l,g,O),R=function(a){d.get(a)?d.get(a).forEach(function(b){j[i.get(b)]=P.get(a)}):j[i.get(a)]=P.get(a)},S=!0,T=!1,U=void 0;try{for(var V,W=P.keys()[Symbol.iterator]();!(S=(V=W.next()).done);S=!0){var X=V.value;R(X)}}catch(a){T=!0,U=a}finally{try{!S&&W.return&&W.return()}finally{if(T)throw U}}var Y=function(a){e.get(a)?e.get(a).forEach(function(b){k[i.get(b)]=Q.get(a)}):k[i.get(a)]=Q.get(a)},Z=!0,$=!1,_=void 0;try{for(var aa,ab=Q.keys()[Symbol.iterator]();!(Z=(aa=ab.next()).done);Z=!0){var X=aa.value;Y(X)}}catch(a){$=!0,_=a}finally{try{!Z&&ab.return&&ab.return()}finally{if($)throw _}}}()}for(var $=0;$<l.length;$++){var _=l[$];null==_.getChild()&&_.setCenter(j[i.get(_.id)],k[i.get(_.id)])}},a.exports=i},551:a=>{a.exports=d}},b={};return function c(d){var e=b[d];if(void 0!==e)return e.exports;var f=b[d]={exports:{}};return a[d](f,f.exports,c),f.exports}(45)})()},78360:(a,b,c)=>{"use strict";c.d(b,{diagram:()=>Y});var d=c(47596),e=c(81856),f=c(93273),g=c(40684),h=c(46629),i=c(21143),j=c(92325),k=c(17307),l=c(18980),m=c(69085),n={L:"left",R:"right",T:"top",B:"bottom"},o={L:(0,i.K2)(a=>`${a},${a/2} 0,${a} 0,0`,"L"),R:(0,i.K2)(a=>`0,${a/2} ${a},0 ${a},${a}`,"R"),T:(0,i.K2)(a=>`0,0 ${a},0 ${a/2},${a}`,"T"),B:(0,i.K2)(a=>`${a/2},0 ${a},${a} 0,${a}`,"B")},p={L:(0,i.K2)((a,b)=>a-b+2,"L"),R:(0,i.K2)((a,b)=>a-2,"R"),T:(0,i.K2)((a,b)=>a-b+2,"T"),B:(0,i.K2)((a,b)=>a-2,"B")},q=(0,i.K2)(function(a){return s(a)?"L"===a?"R":"L":"T"===a?"B":"T"},"getOppositeArchitectureDirection"),r=(0,i.K2)(function(a){return"L"===a||"R"===a||"T"===a||"B"===a},"isArchitectureDirection"),s=(0,i.K2)(function(a){return"L"===a||"R"===a},"isArchitectureDirectionX"),t=(0,i.K2)(function(a){return"T"===a||"B"===a},"isArchitectureDirectionY"),u=(0,i.K2)(function(a,b){let c=s(a)&&t(b),d=t(a)&&s(b);return c||d},"isArchitectureDirectionXY"),v=(0,i.K2)(function(a){let b=a[0],c=a[1],d=s(b)&&t(c),e=t(b)&&s(c);return d||e},"isArchitecturePairXY"),w=(0,i.K2)(function(a){return"LL"!==a&&"RR"!==a&&"TT"!==a&&"BB"!==a},"isValidArchitectureDirectionPair"),x=(0,i.K2)(function(a,b){let c=`${a}${b}`;return w(c)?c:void 0},"getArchitectureDirectionPair"),y=(0,i.K2)(function([a,b],c){let d=c[0],e=c[1];if(s(d))if(t(e))return[a+("L"===d?-1:1),b+("T"===e?1:-1)];else return[a+("L"===d?-1:1),b];return s(e)?[a+("L"===e?1:-1),b+("T"===d?1:-1)]:[a,b+("T"===d?1:-1)]},"shiftPositionByArchitectureDirectionPair"),z=(0,i.K2)(function(a){return"LT"===a||"TL"===a?[1,1]:"BL"===a||"LB"===a?[1,-1]:"BR"===a||"RB"===a?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),A=(0,i.K2)(function(a,b){return u(a,b)?"bend":s(a)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),B=(0,i.K2)(function(a){return"service"===a.type},"isArchitectureService"),C=(0,i.K2)(function(a){return"junction"===a.type},"isArchitectureJunction"),D=(0,i.K2)(a=>a.data(),"edgeData"),E=(0,i.K2)(a=>a.data(),"nodeData"),F=h.UI.architecture,G=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=h.SV,this.getAccTitle=h.iN,this.setDiagramTitle=h.ke,this.getDiagramTitle=h.ab,this.getAccDescription=h.m7,this.setAccDescription=h.EI,this.clear()}static{(0,i.K2)(this,"ArchitectureDB")}setDiagramId(a){this.diagramId=a}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",(0,h.IU)()}addService({id:a,icon:b,in:c,title:d,iconText:e}){if(void 0!==this.registeredIds[a])throw Error(`The service id [${a}] is already in use by another ${this.registeredIds[a]}`);if(void 0!==c){if(a===c)throw Error(`The service [${a}] cannot be placed within itself`);if(void 0===this.registeredIds[c])throw Error(`The service [${a}]'s parent does not exist. Please make sure the parent is created before this service`);if("node"===this.registeredIds[c])throw Error(`The service [${a}]'s parent is not a group`)}this.registeredIds[a]="node",this.nodes[a]={id:a,type:"service",icon:b,iconText:e,title:d,edges:[],in:c}}getServices(){return Object.values(this.nodes).filter(B)}addJunction({id:a,in:b}){if(void 0!==this.registeredIds[a])throw Error(`The junction id [${a}] is already in use by another ${this.registeredIds[a]}`);if(void 0!==b){if(a===b)throw Error(`The junction [${a}] cannot be placed within itself`);if(void 0===this.registeredIds[b])throw Error(`The junction [${a}]'s parent does not exist. Please make sure the parent is created before this junction`);if("node"===this.registeredIds[b])throw Error(`The junction [${a}]'s parent is not a group`)}this.registeredIds[a]="node",this.nodes[a]={id:a,type:"junction",edges:[],in:b}}getJunctions(){return Object.values(this.nodes).filter(C)}getNodes(){return Object.values(this.nodes)}getNode(a){return this.nodes[a]??null}addGroup({id:a,icon:b,in:c,title:d}){if(this.registeredIds?.[a]!==void 0)throw Error(`The group id [${a}] is already in use by another ${this.registeredIds[a]}`);if(void 0!==c){if(a===c)throw Error(`The group [${a}] cannot be placed within itself`);if(this.registeredIds?.[c]===void 0)throw Error(`The group [${a}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[c]==="node")throw Error(`The group [${a}]'s parent is not a group`)}this.registeredIds[a]="group",this.groups[a]={id:a,icon:b,title:d,in:c}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:a,rhsId:b,lhsDir:c,rhsDir:d,lhsInto:e,rhsInto:f,lhsGroup:g,rhsGroup:h,title:i}){if(!r(c))throw Error(`Invalid direction given for left hand side of edge ${a}--${b}. Expected (L,R,T,B) got ${String(c)}`);if(!r(d))throw Error(`Invalid direction given for right hand side of edge ${a}--${b}. Expected (L,R,T,B) got ${String(d)}`);if(void 0===this.nodes[a]&&void 0===this.groups[a])throw Error(`The left-hand id [${a}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(void 0===this.nodes[b]&&void 0===this.groups[b])throw Error(`The right-hand id [${b}] does not yet exist. Please create the service/group before declaring an edge to it.`);let j=this.nodes[a].in,k=this.nodes[b].in;if(g&&j&&k&&j==k)throw Error(`The left-hand id [${a}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(h&&j&&k&&j==k)throw Error(`The right-hand id [${b}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);this.edges.push({lhsId:a,lhsDir:c,lhsInto:e,lhsGroup:g,rhsId:b,rhsDir:d,rhsInto:f,rhsGroup:h,title:i}),this.nodes[a]&&this.nodes[b]&&(this.nodes[a].edges.push(this.edges[this.edges.length-1]),this.nodes[b].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(void 0===this.dataStructures){let a={},b=Object.entries(this.nodes).reduce((b,[c,d])=>(b[c]=d.edges.reduce((b,d)=>{let e=this.getNode(d.lhsId)?.in,f=this.getNode(d.rhsId)?.in;if(e&&f&&e!==f){let b=A(d.lhsDir,d.rhsDir);"bend"!==b&&(a[e]??={},a[e][f]=b,a[f]??={},a[f][e]=b)}if(d.lhsId===c){let a=x(d.lhsDir,d.rhsDir);a&&(b[a]=d.rhsId)}else{let a=x(d.rhsDir,d.lhsDir);a&&(b[a]=d.lhsId)}return b},{}),b),{}),c=Object.keys(b)[0],d={[c]:1},e=Object.keys(b).reduce((a,b)=>b===c?a:{...a,[b]:1},{}),f=(0,i.K2)(a=>{let c={[a]:[0,0]},f=[a];for(;f.length>0;){let a=f.shift();if(a){d[a]=1,delete e[a];let g=b[a],[h,i]=c[a];Object.entries(g).forEach(([a,b])=>{d[b]||(c[b]=y([h,i],a),f.push(b))})}}return c},"BFS"),g=[f(c)];for(;Object.keys(e).length>0;)g.push(f(Object.keys(e)[0]));this.dataStructures={adjList:b,spatialMaps:g,groupAlignments:a}}return this.dataStructures}setElementForId(a,b){this.elements[a]=b}getElementById(a){return this.elements[a]}getConfig(){return(0,g.$t)({...F,...(0,h.zj)().architecture})}getConfigField(a){return this.getConfig()[a]}},H=(0,i.K2)((a,b)=>{(0,f.S)(a,b),a.groups.map(a=>b.addGroup(a)),a.services.map(a=>b.addService({...a,type:"service"})),a.junctions.map(a=>b.addJunction({...a,type:"junction"})),a.edges.map(a=>b.addEdge(a))},"populateDb"),I={parser:{yy:void 0},parse:(0,i.K2)(async a=>{let b=await (0,j.qg)("architecture",a);i.Rm.debug(b);let c=I.parser?.yy;if(!(c instanceof G))throw 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.");H(b,c)},"parse")},J=(0,i.K2)(a=>`
1
+ exports.id=8360,exports.ids=[8360],exports.modules={18980:function(a,b,c){var d;d=c(50980),a.exports=(()=>{"use strict";var a={658:a=>{a.exports=null!=Object.assign?Object.assign.bind(Object):function(a){for(var b=arguments.length,c=Array(b>1?b-1:0),d=1;d<b;d++)c[d-1]=arguments[d];return c.forEach(function(b){Object.keys(b).forEach(function(c){return a[c]=b[c]})}),a}},548:(a,b,c)=>{var d=function(a,b){if(Array.isArray(a))return a;if(Symbol.iterator in Object(a))return function(a,b){var c=[],d=!0,e=!1,f=void 0;try{for(var g,h=a[Symbol.iterator]();!(d=(g=h.next()).done)&&(c.push(g.value),!b||c.length!==b);d=!0);}catch(a){e=!0,f=a}finally{try{!d&&h.return&&h.return()}finally{if(e)throw f}}return c}(a,b);throw TypeError("Invalid attempt to destructure non-iterable instance")},e=c(140).layoutBase.LinkedList,f={};f.getTopMostNodes=function(a){for(var b={},c=0;c<a.length;c++)b[a[c].id()]=!0;return a.filter(function(a,c){"number"==typeof a&&(a=c);for(var d=a.parent()[0];null!=d;){if(b[d.id()])return!1;d=d.parent()[0]}return!0})},f.connectComponents=function(a,b,c,d){var f=new e,g=new Set,h=[],i=void 0,j=void 0,k=void 0,l=!1,m=1,n=[],o=[];do!function(){var d=a.collection();o.push(d);var e=c[0],p=a.collection();for(p.merge(e).merge(e.descendants().intersection(b)),h.push(e),p.forEach(function(a){f.push(a),g.add(a),d.merge(a)});0!=f.length;)!function(){e=f.shift();var j=a.collection();e.neighborhood().nodes().forEach(function(a){b.intersection(e.edgesWith(a)).length>0&&j.merge(a)});for(var k=0;k<j.length;k++){var l=j[k];null==(i=c.intersection(l.union(l.ancestors())))||g.has(i[0])||i.union(i.descendants()).forEach(function(a){f.push(a),g.add(a),d.merge(a),c.has(a)&&h.push(a)})}}();if(d.forEach(function(a){b.intersection(a.connectedEdges()).forEach(function(a){d.has(a.source())&&d.has(a.target())&&d.merge(a)})}),h.length==c.length&&(l=!0),!l||l&&m>1){k=(j=h[0]).connectedEdges().length,h.forEach(function(a){a.connectedEdges().length<k&&(k=a.connectedEdges().length,j=a)}),n.push(j.id());var q=a.collection();q.merge(h[0]),h.forEach(function(a){q.merge(a)}),h=[],c=c.difference(q),m++}}();while(!l);return d&&n.length>0&&d.set("dummy"+(d.size+1),n),o},f.relocateComponent=function(a,b,c){if(!c.fixedNodeConstraint){var e=1/0,f=-1/0,g=1/0,h=-1/0;if("draft"==c.quality){var i=!0,j=!1,k=void 0;try{for(var l,m=b.nodeIndexes[Symbol.iterator]();!(i=(l=m.next()).done);i=!0){var n=l.value,o=d(n,2),p=o[0],q=o[1],r=c.cy.getElementById(p);if(r){var s=r.boundingBox(),t=b.xCoords[q]-s.w/2,u=b.xCoords[q]+s.w/2,v=b.yCoords[q]-s.h/2,w=b.yCoords[q]+s.h/2;t<e&&(e=t),u>f&&(f=u),v<g&&(g=v),w>h&&(h=w)}}}catch(a){j=!0,k=a}finally{try{!i&&m.return&&m.return()}finally{if(j)throw k}}var x=a.x-(f+e)/2,y=a.y-(h+g)/2;b.xCoords=b.xCoords.map(function(a){return a+x}),b.yCoords=b.yCoords.map(function(a){return a+y})}else{Object.keys(b).forEach(function(a){var c=b[a],d=c.getRect().x,i=c.getRect().x+c.getRect().width,j=c.getRect().y,k=c.getRect().y+c.getRect().height;d<e&&(e=d),i>f&&(f=i),j<g&&(g=j),k>h&&(h=k)});var z=a.x-(f+e)/2,A=a.y-(h+g)/2;Object.keys(b).forEach(function(a){var c=b[a];c.setCenter(c.getCenterX()+z,c.getCenterY()+A)})}}},f.calcBoundingBox=function(a,b,c,d){for(var e=Number.MAX_SAFE_INTEGER,f=Number.MIN_SAFE_INTEGER,g=Number.MAX_SAFE_INTEGER,h=Number.MIN_SAFE_INTEGER,i=void 0,j=void 0,k=void 0,l=void 0,m=a.descendants().not(":parent"),n=m.length,o=0;o<n;o++){var p=m[o];i=b[d.get(p.id())]-p.width()/2,j=b[d.get(p.id())]+p.width()/2,k=c[d.get(p.id())]-p.height()/2,l=c[d.get(p.id())]+p.height()/2,e>i&&(e=i),f<j&&(f=j),g>k&&(g=k),h<l&&(h=l)}var q={};return q.topLeftX=e,q.topLeftY=g,q.width=f-e,q.height=h-g,q},f.calcParentsWithoutChildren=function(a,b){var c=a.collection();return b.nodes(":parent").forEach(function(a){var b=!1;a.children().forEach(function(a){"none"!=a.css("display")&&(b=!0)}),b||c.merge(a)}),c},a.exports=f},816:(a,b,c)=>{var d=c(548),e=c(140).CoSELayout,f=c(140).CoSENode,g=c(140).layoutBase.PointD,h=c(140).layoutBase.DimensionD,i=c(140).layoutBase.LayoutConstants,j=c(140).layoutBase.FDLayoutConstants,k=c(140).CoSEConstants;a.exports={coseLayout:function(a,b){var c=a.cy,l=a.eles,m=l.nodes(),n=l.edges(),o=void 0,p=void 0,q=void 0,r={};a.randomize&&(o=b.nodeIndexes,p=b.xCoords,q=b.yCoords);var s=function(a){return"function"==typeof a},t=function(a,b){return s(a)?a(b):a},u=d.calcParentsWithoutChildren(c,l);null!=a.nestingFactor&&(k.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=j.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=a.nestingFactor),null!=a.gravity&&(k.DEFAULT_GRAVITY_STRENGTH=j.DEFAULT_GRAVITY_STRENGTH=a.gravity),null!=a.numIter&&(k.MAX_ITERATIONS=j.MAX_ITERATIONS=a.numIter),null!=a.gravityRange&&(k.DEFAULT_GRAVITY_RANGE_FACTOR=j.DEFAULT_GRAVITY_RANGE_FACTOR=a.gravityRange),null!=a.gravityCompound&&(k.DEFAULT_COMPOUND_GRAVITY_STRENGTH=j.DEFAULT_COMPOUND_GRAVITY_STRENGTH=a.gravityCompound),null!=a.gravityRangeCompound&&(k.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=j.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=a.gravityRangeCompound),null!=a.initialEnergyOnIncremental&&(k.DEFAULT_COOLING_FACTOR_INCREMENTAL=j.DEFAULT_COOLING_FACTOR_INCREMENTAL=a.initialEnergyOnIncremental),null!=a.tilingCompareBy&&(k.TILING_COMPARE_BY=a.tilingCompareBy),"proof"==a.quality?i.QUALITY=2:i.QUALITY=0,k.NODE_DIMENSIONS_INCLUDE_LABELS=j.NODE_DIMENSIONS_INCLUDE_LABELS=i.NODE_DIMENSIONS_INCLUDE_LABELS=a.nodeDimensionsIncludeLabels,k.DEFAULT_INCREMENTAL=j.DEFAULT_INCREMENTAL=i.DEFAULT_INCREMENTAL=!a.randomize,k.ANIMATE=j.ANIMATE=i.ANIMATE=a.animate,k.TILE=a.tile,k.TILING_PADDING_VERTICAL="function"==typeof a.tilingPaddingVertical?a.tilingPaddingVertical.call():a.tilingPaddingVertical,k.TILING_PADDING_HORIZONTAL="function"==typeof a.tilingPaddingHorizontal?a.tilingPaddingHorizontal.call():a.tilingPaddingHorizontal,k.DEFAULT_INCREMENTAL=j.DEFAULT_INCREMENTAL=i.DEFAULT_INCREMENTAL=!0,k.PURE_INCREMENTAL=!a.randomize,i.DEFAULT_UNIFORM_LEAF_NODE_SIZES=a.uniformNodeDimensions,"transformed"==a.step&&(k.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,k.ENFORCE_CONSTRAINTS=!1,k.APPLY_LAYOUT=!1),"enforced"==a.step&&(k.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,k.ENFORCE_CONSTRAINTS=!0,k.APPLY_LAYOUT=!1),"cose"==a.step&&(k.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,k.ENFORCE_CONSTRAINTS=!1,k.APPLY_LAYOUT=!0),"all"==a.step&&(a.randomize?k.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:k.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,k.ENFORCE_CONSTRAINTS=!0,k.APPLY_LAYOUT=!0),a.fixedNodeConstraint||a.alignmentConstraint||a.relativePlacementConstraint?k.TREE_REDUCTION_ON_INCREMENTAL=!1:k.TREE_REDUCTION_ON_INCREMENTAL=!0;var v=new e,w=v.newGraphManager();return!function a(b,c,e,i){for(var j=c.length,k=0;k<j;k++){var l=c[k],m=null;0==l.intersection(u).length&&(m=l.children());var n=void 0,s=l.layoutDimensions({nodeDimensionsIncludeLabels:i.nodeDimensionsIncludeLabels});if(null!=l.outerWidth()&&null!=l.outerHeight())if(i.randomize)if(l.isParent()){var v=d.calcBoundingBox(l,p,q,o);n=0==l.intersection(u).length?b.add(new f(e.graphManager,new g(v.topLeftX,v.topLeftY),new h(v.width,v.height))):b.add(new f(e.graphManager,new g(v.topLeftX,v.topLeftY),new h(parseFloat(s.w),parseFloat(s.h))))}else n=b.add(new f(e.graphManager,new g(p[o.get(l.id())]-s.w/2,q[o.get(l.id())]-s.h/2),new h(parseFloat(s.w),parseFloat(s.h))));else n=b.add(new f(e.graphManager,new g(l.position("x")-s.w/2,l.position("y")-s.h/2),new h(parseFloat(s.w),parseFloat(s.h))));else n=b.add(new f(this.graphManager));(n.id=l.data("id"),n.nodeRepulsion=t(i.nodeRepulsion,l),n.paddingLeft=parseInt(l.css("padding")),n.paddingTop=parseInt(l.css("padding")),n.paddingRight=parseInt(l.css("padding")),n.paddingBottom=parseInt(l.css("padding")),i.nodeDimensionsIncludeLabels&&(n.labelWidth=l.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,n.labelHeight=l.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,n.labelPosVertical=l.css("text-valign"),n.labelPosHorizontal=l.css("text-halign")),r[l.data("id")]=n,isNaN(n.rect.x)&&(n.rect.x=0),isNaN(n.rect.y)&&(n.rect.y=0),null!=m&&m.length>0)&&a(e.getGraphManager().add(e.newGraph(),n),m,e,i)}}(w.addRoot(),d.getTopMostNodes(m),v,a),!function(b,c,d){for(var e=0,f=0,g=0;g<d.length;g++){var h=d[g],i=r[h.data("source")],l=r[h.data("target")];if(i&&l&&i!==l&&0==i.getEdgesBetween(l).length){var m=c.add(b.newEdge(),i,l);m.id=h.id(),m.idealLength=t(a.idealEdgeLength,h),m.edgeElasticity=t(a.edgeElasticity,h),e+=m.idealLength,f++}}null!=a.idealEdgeLength&&(f>0?k.DEFAULT_EDGE_LENGTH=j.DEFAULT_EDGE_LENGTH=e/f:s(a.idealEdgeLength)?k.DEFAULT_EDGE_LENGTH=j.DEFAULT_EDGE_LENGTH=50:k.DEFAULT_EDGE_LENGTH=j.DEFAULT_EDGE_LENGTH=a.idealEdgeLength,k.MIN_REPULSION_DIST=j.MIN_REPULSION_DIST=j.DEFAULT_EDGE_LENGTH/10,k.DEFAULT_RADIAL_SEPARATION=j.DEFAULT_EDGE_LENGTH)}(v,w,n),a.fixedNodeConstraint&&(v.constraints.fixedNodeConstraint=a.fixedNodeConstraint),a.alignmentConstraint&&(v.constraints.alignmentConstraint=a.alignmentConstraint),a.relativePlacementConstraint&&(v.constraints.relativePlacementConstraint=a.relativePlacementConstraint),v.runLayout(),r}}},212:(a,b,c)=>{var d=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),e=c(658),f=c(548),g=c(657).spectralLayout,h=c(816).coseLayout,i=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1e3,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:1e-7,nodeRepulsion:function(a){return 4500},idealEdgeLength:function(a){return 50},edgeElasticity:function(a){return .45},nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}});a.exports=function(){function a(b){if(!(this instanceof a))throw TypeError("Cannot call a class as a function");this.options=e({},i,b)}return d(a,[{key:"run",value:function(){var a=this.options,b=a.cy,c=a.eles,d=[],e=[],i=void 0,j=[];a.fixedNodeConstraint&&(!Array.isArray(a.fixedNodeConstraint)||0==a.fixedNodeConstraint.length)&&(a.fixedNodeConstraint=void 0),a.alignmentConstraint&&(a.alignmentConstraint.vertical&&(!Array.isArray(a.alignmentConstraint.vertical)||0==a.alignmentConstraint.vertical.length)&&(a.alignmentConstraint.vertical=void 0),a.alignmentConstraint.horizontal&&(!Array.isArray(a.alignmentConstraint.horizontal)||0==a.alignmentConstraint.horizontal.length)&&(a.alignmentConstraint.horizontal=void 0)),a.relativePlacementConstraint&&(!Array.isArray(a.relativePlacementConstraint)||0==a.relativePlacementConstraint.length)&&(a.relativePlacementConstraint=void 0),(a.fixedNodeConstraint||a.alignmentConstraint||a.relativePlacementConstraint)&&(a.tile=!1,a.packComponents=!1);var k=void 0,l=!1;if(b.layoutUtilities&&a.packComponents&&((k=b.layoutUtilities("get"))||(k=b.layoutUtilities()),l=!0),c.nodes().length>0)if(l){var m=f.getTopMostNodes(a.eles.nodes());if((i=f.connectComponents(b,a.eles,m)).forEach(function(a){var b=a.boundingBox();j.push({x:b.x1+b.w/2,y:b.y1+b.h/2})}),a.randomize&&i.forEach(function(b){a.eles=b,d.push(g(a))}),"default"==a.quality||"proof"==a.quality){var n=b.collection();if(a.tile){var o=new Map,p=0,q={nodeIndexes:o,xCoords:[],yCoords:[]},r=[];if(i.forEach(function(a,b){0==a.edges().length&&(a.nodes().forEach(function(b,c){n.merge(a.nodes()[c]),b.isParent()||(q.nodeIndexes.set(a.nodes()[c].id(),p++),q.xCoords.push(a.nodes()[0].position().x),q.yCoords.push(a.nodes()[0].position().y))}),r.push(b))}),n.length>1){var s=n.boundingBox();j.push({x:s.x1+s.w/2,y:s.y1+s.h/2}),i.push(n),d.push(q);for(var t=r.length-1;t>=0;t--)i.splice(r[t],1),d.splice(r[t],1),j.splice(r[t],1)}}i.forEach(function(b,c){a.eles=b,e.push(h(a,d[c])),f.relocateComponent(j[c],e[c],a)})}else i.forEach(function(b,c){f.relocateComponent(j[c],d[c],a)});var u=new Set;if(i.length>1){var v=[],w=c.filter(function(a){return"none"==a.css("display")});i.forEach(function(b,c){var g=void 0;if("draft"==a.quality&&(g=d[c].nodeIndexes),b.nodes().not(w).length>0){var h={};h.edges=[],h.nodes=[];var i=void 0;b.nodes().not(w).forEach(function(b){if("draft"==a.quality)if(b.isParent()){var j=f.calcBoundingBox(b,d[c].xCoords,d[c].yCoords,g);h.nodes.push({x:j.topLeftX,y:j.topLeftY,width:j.width,height:j.height})}else i=g.get(b.id()),h.nodes.push({x:d[c].xCoords[i]-b.boundingbox().w/2,y:d[c].yCoords[i]-b.boundingbox().h/2,width:b.boundingbox().w,height:b.boundingbox().h});else e[c][b.id()]&&h.nodes.push({x:e[c][b.id()].getLeft(),y:e[c][b.id()].getTop(),width:e[c][b.id()].getWidth(),height:e[c][b.id()].getHeight()})}),b.edges().forEach(function(b){var i=b.source(),j=b.target();if("none"!=i.css("display")&&"none"!=j.css("display"))if("draft"==a.quality){var k=g.get(i.id()),l=g.get(j.id()),m=[],n=[];if(i.isParent()){var o=f.calcBoundingBox(i,d[c].xCoords,d[c].yCoords,g);m.push(o.topLeftX+o.width/2),m.push(o.topLeftY+o.height/2)}else m.push(d[c].xCoords[k]),m.push(d[c].yCoords[k]);if(j.isParent()){var p=f.calcBoundingBox(j,d[c].xCoords,d[c].yCoords,g);n.push(p.topLeftX+p.width/2),n.push(p.topLeftY+p.height/2)}else n.push(d[c].xCoords[l]),n.push(d[c].yCoords[l]);h.edges.push({startX:m[0],startY:m[1],endX:n[0],endY:n[1]})}else e[c][i.id()]&&e[c][j.id()]&&h.edges.push({startX:e[c][i.id()].getCenterX(),startY:e[c][i.id()].getCenterY(),endX:e[c][j.id()].getCenterX(),endY:e[c][j.id()].getCenterY()})}),h.nodes.length>0&&(v.push(h),u.add(c))}});var x=k.packComponents(v,a.randomize).shifts;if("draft"==a.quality)d.forEach(function(a,b){var c=a.xCoords.map(function(a){return a+x[b].dx}),d=a.yCoords.map(function(a){return a+x[b].dy});a.xCoords=c,a.yCoords=d});else{var y=0;u.forEach(function(a){Object.keys(e[a]).forEach(function(b){var c=e[a][b];c.setCenter(c.getCenterX()+x[y].dx,c.getCenterY()+x[y].dy)}),y++})}}}else{var z=a.eles.boundingBox();if(j.push({x:z.x1+z.w/2,y:z.y1+z.h/2}),a.randomize){var A=g(a);d.push(A)}"default"==a.quality||"proof"==a.quality?(e.push(h(a,d[0])),f.relocateComponent(j[0],e[0],a)):f.relocateComponent(j[0],d[0],a)}var B=function(b,c){if("default"==a.quality||"proof"==a.quality){"number"==typeof b&&(b=c);var f=void 0,g=void 0,h=b.data("id");return e.forEach(function(a){h in a&&(f={x:a[h].getRect().getCenterX(),y:a[h].getRect().getCenterY()},g=a[h])}),a.nodeDimensionsIncludeLabels&&(g.labelWidth&&("left"==g.labelPosHorizontal?f.x+=g.labelWidth/2:"right"==g.labelPosHorizontal&&(f.x-=g.labelWidth/2)),g.labelHeight&&("top"==g.labelPosVertical?f.y+=g.labelHeight/2:"bottom"==g.labelPosVertical&&(f.y-=g.labelHeight/2))),void 0==f&&(f={x:b.position("x"),y:b.position("y")}),{x:f.x,y:f.y}}var i=void 0;return d.forEach(function(a){var c=a.nodeIndexes.get(b.id());void 0!=c&&(i={x:a.xCoords[c],y:a.yCoords[c]})}),void 0==i&&(i={x:b.position("x"),y:b.position("y")}),{x:i.x,y:i.y}};if("default"==a.quality||"proof"==a.quality||a.randomize){var C=f.calcParentsWithoutChildren(b,c),D=c.filter(function(a){return"none"==a.css("display")});a.eles=c.not(D),c.nodes().not(":parent").not(D).layoutPositions(this,a,B),C.length>0&&C.forEach(function(a){a.position(B(a))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),a}()},657:(a,b,c)=>{var d=c(548),e=c(140).layoutBase.Matrix,f=c(140).layoutBase.SVD;a.exports={spectralLayout:function(a){var b=a.cy,c=a.eles,g=c.nodes(),h=c.nodes(":parent"),i=new Map,j=new Map,k=new Map,l=[],m=[],n=[],o=[],p=[],q=[],r=[],s=[],t=void 0,u=a.piTol,v=a.samplingType,w=a.nodeSeparation,x=void 0,y=function(){for(var a=0,b=0,c=!1;b<x;){a=Math.floor(Math.random()*t),c=!1;for(var d=0;d<b;d++)if(o[d]==a){c=!0;break}!c&&(o[b]=a,b++)}},z=function(a,b,c){for(var d=[],e=0,f=0,g=0,h=void 0,i=[],k=0,m=1,n=0;n<t;n++)i[n]=1e8;for(d[f]=a,i[a]=0;f>=e;){for(var o=l[g=d[e++]],r=0;r<o.length;r++)1e8==i[h=j.get(o[r])]&&(i[h]=i[g]+1,d[++f]=h);q[g][b]=i[g]*w}if(c){for(var s=0;s<t;s++)q[s][b]<p[s]&&(p[s]=q[s][b]);for(var u=0;u<t;u++)p[u]>k&&(k=p[u],m=u)}return m};d.connectComponents(b,c,d.getTopMostNodes(g),i),h.forEach(function(a){d.connectComponents(b,c,d.getTopMostNodes(a.descendants().intersection(c)),i)});for(var A=0,B=0;B<g.length;B++)g[B].isParent()||j.set(g[B].id(),A++);var C=!0,D=!1,E=void 0;try{for(var F,G=i.keys()[Symbol.iterator]();!(C=(F=G.next()).done);C=!0){var H=F.value;j.set(H,A++)}}catch(a){D=!0,E=a}finally{try{!C&&G.return&&G.return()}finally{if(D)throw E}}for(var I=0;I<j.size;I++)l[I]=[];h.forEach(function(a){for(var b=a.children().intersection(c);0==b.nodes(":childless").length;)b=b.nodes()[0].children().intersection(c);var d=0,e=b.nodes(":childless")[0].connectedEdges().length;b.nodes(":childless").forEach(function(a,b){a.connectedEdges().length<e&&(e=a.connectedEdges().length,d=b)}),k.set(a.id(),b.nodes(":childless")[d].id())}),g.forEach(function(a){var b=void 0;b=a.isParent()?j.get(k.get(a.id())):j.get(a.id()),a.neighborhood().nodes().forEach(function(d){c.intersection(a.edgesWith(d)).length>0&&(d.isParent()?l[b].push(k.get(d.id())):l[b].push(d.id()))})});var J=function(a){var c=j.get(a),d=void 0;i.get(a).forEach(function(e){d=b.getElementById(e).isParent()?k.get(e):e,l[c].push(d),l[j.get(d)].push(a)})},K=!0,L=!1,M=void 0;try{for(var N,O=i.keys()[Symbol.iterator]();!(K=(N=O.next()).done);K=!0){var P=N.value;J(P)}}catch(a){L=!0,M=a}finally{try{!K&&O.return&&O.return()}finally{if(L)throw M}}t=j.size;if(t>2){x=t<a.sampleSize?t:a.sampleSize;for(var Q=0;Q<t;Q++)q[Q]=[];for(var R=0;R<x;R++)s[R]=[];return"draft"==a.quality||"all"==a.step?(!function(a){var b=void 0;if(a){b=Math.floor(Math.random()*t);for(var c=0;c<t;c++)p[c]=1e8;for(var d=0;d<x;d++)o[d]=b,b=z(b,d,a)}else{y();for(var e=0;e<x;e++)z(o[e],e,a,!1)}for(var f=0;f<t;f++)for(var g=0;g<x;g++)q[f][g]*=q[f][g];for(var h=0;h<x;h++)r[h]=[];for(var i=0;i<x;i++)for(var j=0;j<x;j++)r[i][j]=q[o[j]][i]}(v),!function(){for(var a=f.svd(r),b=a.S,c=a.U,d=a.V,g=b[0]*b[0]*b[0],h=[],i=0;i<x;i++){h[i]=[];for(var j=0;j<x;j++)h[i][j]=0,i==j&&(h[i][j]=b[i]/(b[i]*b[i]+g/(b[i]*b[i])))}s=e.multMat(e.multMat(d,h),e.transpose(c))}(),!function(){for(var a=void 0,b=void 0,c=[],d=[],f=[],g=[],h=0;h<t;h++)c[h]=Math.random(),d[h]=Math.random();c=e.normalize(c),d=e.normalize(d);for(var i=0,j=1e-9,k=1e-9,l=void 0;;){i++;for(var o=0;o<t;o++)f[o]=c[o];if(c=e.multGamma(e.multL(e.multGamma(f),q,s)),a=e.dotProduct(f,c),c=e.normalize(c),(l=Math.abs((j=e.dotProduct(f,c))/k))<=1+u&&l>=1)break;k=j}for(var p=0;p<t;p++)f[p]=c[p];for(i=0,k=1e-9;;){i++;for(var r=0;r<t;r++)g[r]=d[r];if(g=e.minusOp(g,e.multCons(f,e.dotProduct(f,g))),d=e.multGamma(e.multL(e.multGamma(g),q,s)),b=e.dotProduct(g,d),d=e.normalize(d),(l=Math.abs((j=e.dotProduct(g,d))/k))<=1+u&&l>=1)break;k=j}for(var v=0;v<t;v++)g[v]=d[v];m=e.multCons(f,Math.sqrt(Math.abs(a))),n=e.multCons(g,Math.sqrt(Math.abs(b)))}()):j.forEach(function(a,c){m.push(b.getElementById(c).position("x")),n.push(b.getElementById(c).position("y"))}),{nodeIndexes:j,xCoords:m,yCoords:n}}var S=j.keys(),T=b.getElementById(S.next().value),U=T.position(),V=T.outerWidth();if(m.push(U.x),n.push(U.y),2==t){var W=b.getElementById(S.next().value).outerWidth();m.push(U.x+V/2+W/2+a.idealEdgeLength),n.push(U.y)}return{nodeIndexes:j,xCoords:m,yCoords:n}}}},579:(a,b,c)=>{var d=c(212),e=function(a){a&&a("layout","fcose",d)};"u">typeof cytoscape&&e(cytoscape),a.exports=e},140:a=>{a.exports=d}},b={};return function c(d){var e=b[d];if(void 0!==e)return e.exports;var f=b[d]={exports:{}};return a[d](f,f.exports,c),f.exports}(579)})()},50980:function(a,b,c){var d;d=c(94548),a.exports=(()=>{"use strict";var a={45:(a,b,c)=>{var d={};d.layoutBase=c(551),d.CoSEConstants=c(806),d.CoSEEdge=c(767),d.CoSEGraph=c(880),d.CoSEGraphManager=c(578),d.CoSELayout=c(765),d.CoSENode=c(991),d.ConstraintHandler=c(902),a.exports=d},806:(a,b,c)=>{var d=c(551).FDLayoutConstants;function e(){}for(var f in d)e[f]=d[f];e.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,e.DEFAULT_RADIAL_SEPARATION=d.DEFAULT_EDGE_LENGTH,e.DEFAULT_COMPONENT_SEPERATION=60,e.TILE=!0,e.TILING_PADDING_VERTICAL=10,e.TILING_PADDING_HORIZONTAL=10,e.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,e.ENFORCE_CONSTRAINTS=!0,e.APPLY_LAYOUT=!0,e.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,e.TREE_REDUCTION_ON_INCREMENTAL=!0,e.PURE_INCREMENTAL=e.DEFAULT_INCREMENTAL,a.exports=e},767:(a,b,c)=>{var d=c(551).FDLayoutEdge;function e(a,b,c){d.call(this,a,b,c)}for(var f in e.prototype=Object.create(d.prototype),d)e[f]=d[f];a.exports=e},880:(a,b,c)=>{var d=c(551).LGraph;function e(a,b,c){d.call(this,a,b,c)}for(var f in e.prototype=Object.create(d.prototype),d)e[f]=d[f];a.exports=e},578:(a,b,c)=>{var d=c(551).LGraphManager;function e(a){d.call(this,a)}for(var f in e.prototype=Object.create(d.prototype),d)e[f]=d[f];a.exports=e},765:(a,b,c)=>{var d=c(551).FDLayout,e=c(578),f=c(880),g=c(991),h=c(767),i=c(806),j=c(902),k=c(551).FDLayoutConstants,l=c(551).LayoutConstants,m=c(551).Point,n=c(551).PointD,o=c(551).DimensionD,p=c(551).Layout,q=c(551).Integer,r=c(551).IGeometry,s=c(551).LGraph,t=c(551).Transform,u=c(551).LinkedList;function v(){d.call(this),this.toBeTiled={},this.constraints={}}for(var w in v.prototype=Object.create(d.prototype),d)v[w]=d[w];v.prototype.newGraphManager=function(){var a=new e(this);return this.graphManager=a,a},v.prototype.newGraph=function(a){return new f(null,this.graphManager,a)},v.prototype.newNode=function(a){return new g(this.graphManager,a)},v.prototype.newEdge=function(a){return new h(null,null,a)},v.prototype.initParameters=function(){d.prototype.initParameters.call(this,arguments),this.isSubLayout||(i.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=i.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=k.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=k.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=k.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=k.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},v.prototype.initSpringEmbedder=function(){d.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/k.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},v.prototype.layout=function(){return l.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},v.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(i.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var a=new Set(this.getAllNodes()),b=this.nodesWithGravity.filter(function(b){return a.has(b)});this.graphManager.setAllNodesToApplyGravitation(b)}}else{var c=this.getFlatForest();if(c.length>0)this.positionNodesRadially(c);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var a=new Set(this.getAllNodes()),b=this.nodesWithGravity.filter(function(b){return a.has(b)});this.graphManager.setAllNodesToApplyGravitation(b),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(j.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),i.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},v.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(!(this.prunedNodesAll.length>0))return!0;else this.isTreeGrowing=!0;if(this.totalIterations%k.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(!(this.prunedNodesAll.length>0))return!0;else this.isTreeGrowing=!0;this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(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 a=new Set(this.getAllNodes()),b=this.nodesWithGravity.filter(function(b){return a.has(b)});this.graphManager.setAllNodesToApplyGravitation(b),this.graphManager.updateBounds(),this.updateGrid(),i.PURE_INCREMENTAL?this.coolingFactor=k.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=k.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()),i.PURE_INCREMENTAL?this.coolingFactor=k.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=k.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var c=!this.isTreeGrowing&&!this.isGrowthFinished,d=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,d),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},v.prototype.getPositionsData=function(){for(var a=this.graphManager.getAllNodes(),b={},c=0;c<a.length;c++){var d=a[c].rect,e=a[c].id;b[e]={id:e,x:d.getCenterX(),y:d.getCenterY(),w:d.width,h:d.height}}return b},v.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var a=!1;if("during"===k.ANIMATE)this.emit("layoutstarted");else{for(;!a;)a=this.tick();this.graphManager.updateBounds()}},v.prototype.moveNodes=function(){for(var a,b=this.getAllNodes(),c=0;c<b.length;c++)b[c].calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(var c=0;c<b.length;c++)b[c].move()},v.prototype.initConstraintVariables=function(){var a=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var b=this.graphManager.getAllNodes(),c=0;c<b.length;c++){var d=b[c];this.idToNodeMap.set(d.id,d)}if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(b){a.fixedNodeSet.add(b.nodeId)});for(var d,b=this.graphManager.getAllNodes(),c=0;c<b.length;c++)if(null!=(d=b[c]).getChild()){var e=function b(c){for(var d,e=c.getChild().getNodes(),f=0,g=0;g<e.length;g++)null==(d=e[g]).getChild()?a.fixedNodeSet.has(d.id)&&(f+=100):f+=b(d);return f}(d);e>0&&(d.fixedNodeWeight=e)}}if(this.constraints.relativePlacementConstraint){var f=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(b){a.fixedNodesOnHorizontal.add(b),a.fixedNodesOnVertical.add(b)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var h=this.constraints.alignmentConstraint.vertical,c=0;c<h.length;c++)this.dummyToNodeForVerticalAlignment.set("dummy"+c,[]),h[c].forEach(function(b){f.set(b,"dummy"+c),a.dummyToNodeForVerticalAlignment.get("dummy"+c).push(b),a.fixedNodeSet.has(b)&&a.fixedNodesOnHorizontal.add("dummy"+c)});if(this.constraints.alignmentConstraint.horizontal)for(var j=this.constraints.alignmentConstraint.horizontal,c=0;c<j.length;c++)this.dummyToNodeForHorizontalAlignment.set("dummy"+c,[]),j[c].forEach(function(b){g.set(b,"dummy"+c),a.dummyToNodeForHorizontalAlignment.get("dummy"+c).push(b),a.fixedNodeSet.has(b)&&a.fixedNodesOnVertical.add("dummy"+c)})}if(i.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(a){var b,c,d;for(d=a.length-1;d>=2*a.length/3;d--)b=Math.floor(Math.random()*(d+1)),c=a[d],a[d]=a[b],a[b]=c;return a},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(b){if(b.left){var c=f.has(b.left)?f.get(b.left):b.left,d=f.has(b.right)?f.get(b.right):b.right;a.nodesInRelativeHorizontal.includes(c)||(a.nodesInRelativeHorizontal.push(c),a.nodeToRelativeConstraintMapHorizontal.set(c,[]),a.dummyToNodeForVerticalAlignment.has(c)?a.nodeToTempPositionMapHorizontal.set(c,a.idToNodeMap.get(a.dummyToNodeForVerticalAlignment.get(c)[0]).getCenterX()):a.nodeToTempPositionMapHorizontal.set(c,a.idToNodeMap.get(c).getCenterX())),a.nodesInRelativeHorizontal.includes(d)||(a.nodesInRelativeHorizontal.push(d),a.nodeToRelativeConstraintMapHorizontal.set(d,[]),a.dummyToNodeForVerticalAlignment.has(d)?a.nodeToTempPositionMapHorizontal.set(d,a.idToNodeMap.get(a.dummyToNodeForVerticalAlignment.get(d)[0]).getCenterX()):a.nodeToTempPositionMapHorizontal.set(d,a.idToNodeMap.get(d).getCenterX())),a.nodeToRelativeConstraintMapHorizontal.get(c).push({right:d,gap:b.gap}),a.nodeToRelativeConstraintMapHorizontal.get(d).push({left:c,gap:b.gap})}else{var e=g.has(b.top)?g.get(b.top):b.top,h=g.has(b.bottom)?g.get(b.bottom):b.bottom;a.nodesInRelativeVertical.includes(e)||(a.nodesInRelativeVertical.push(e),a.nodeToRelativeConstraintMapVertical.set(e,[]),a.dummyToNodeForHorizontalAlignment.has(e)?a.nodeToTempPositionMapVertical.set(e,a.idToNodeMap.get(a.dummyToNodeForHorizontalAlignment.get(e)[0]).getCenterY()):a.nodeToTempPositionMapVertical.set(e,a.idToNodeMap.get(e).getCenterY())),a.nodesInRelativeVertical.includes(h)||(a.nodesInRelativeVertical.push(h),a.nodeToRelativeConstraintMapVertical.set(h,[]),a.dummyToNodeForHorizontalAlignment.has(h)?a.nodeToTempPositionMapVertical.set(h,a.idToNodeMap.get(a.dummyToNodeForHorizontalAlignment.get(h)[0]).getCenterY()):a.nodeToTempPositionMapVertical.set(h,a.idToNodeMap.get(h).getCenterY())),a.nodeToRelativeConstraintMapVertical.get(e).push({bottom:h,gap:b.gap}),a.nodeToRelativeConstraintMapVertical.get(h).push({top:e,gap:b.gap})}});else{var k=new Map,l=new Map;this.constraints.relativePlacementConstraint.forEach(function(a){if(a.left){var b=f.has(a.left)?f.get(a.left):a.left,c=f.has(a.right)?f.get(a.right):a.right;k.has(b)?k.get(b).push(c):k.set(b,[c]),k.has(c)?k.get(c).push(b):k.set(c,[b])}else{var d=g.has(a.top)?g.get(a.top):a.top,e=g.has(a.bottom)?g.get(a.bottom):a.bottom;l.has(d)?l.get(d).push(e):l.set(d,[e]),l.has(e)?l.get(e).push(d):l.set(e,[d])}});var m=function(a,b){var c=[],d=[],e=new u,f=new Set,g=0;return a.forEach(function(h,i){if(!f.has(i)){c[g]=[],d[g]=!1;var j=i;for(e.push(j),f.add(j),c[g].push(j);0!=e.length;)j=e.shift(),b.has(j)&&(d[g]=!0),a.get(j).forEach(function(a){f.has(a)||(e.push(a),f.add(a),c[g].push(a))});g++}}),{components:c,isFixed:d}},n=m(k,a.fixedNodesOnHorizontal);this.componentsOnHorizontal=n.components,this.fixedComponentsOnHorizontal=n.isFixed;var o=m(l,a.fixedNodesOnVertical);this.componentsOnVertical=o.components,this.fixedComponentsOnVertical=o.isFixed}}},v.prototype.updateDisplacements=function(){var a=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(b){var c=a.idToNodeMap.get(b.nodeId);c.displacementX=0,c.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var b=this.constraints.alignmentConstraint.vertical,c=0;c<b.length;c++){for(var d=0,e=0;e<b[c].length;e++){if(this.fixedNodeSet.has(b[c][e])){d=0;break}d+=this.idToNodeMap.get(b[c][e]).displacementX}for(var f=d/b[c].length,e=0;e<b[c].length;e++)this.idToNodeMap.get(b[c][e]).displacementX=f}if(this.constraints.alignmentConstraint.horizontal)for(var g=this.constraints.alignmentConstraint.horizontal,c=0;c<g.length;c++){for(var h=0,e=0;e<g[c].length;e++){if(this.fixedNodeSet.has(g[c][e])){h=0;break}h+=this.idToNodeMap.get(g[c][e]).displacementY}for(var j=h/g[c].length,e=0;e<g[c].length;e++)this.idToNodeMap.get(g[c][e]).displacementY=j}}if(this.constraints.relativePlacementConstraint)if(i.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(b){if(!a.fixedNodesOnHorizontal.has(b)){var c=0;c=a.dummyToNodeForVerticalAlignment.has(b)?a.idToNodeMap.get(a.dummyToNodeForVerticalAlignment.get(b)[0]).displacementX:a.idToNodeMap.get(b).displacementX,a.nodeToRelativeConstraintMapHorizontal.get(b).forEach(function(d){if(d.right){var e=a.nodeToTempPositionMapHorizontal.get(d.right)-a.nodeToTempPositionMapHorizontal.get(b)-c;e<d.gap&&(c-=d.gap-e)}else{var e=a.nodeToTempPositionMapHorizontal.get(b)-a.nodeToTempPositionMapHorizontal.get(d.left)+c;e<d.gap&&(c+=d.gap-e)}}),a.nodeToTempPositionMapHorizontal.set(b,a.nodeToTempPositionMapHorizontal.get(b)+c),a.dummyToNodeForVerticalAlignment.has(b)?a.dummyToNodeForVerticalAlignment.get(b).forEach(function(b){a.idToNodeMap.get(b).displacementX=c}):a.idToNodeMap.get(b).displacementX=c}}),this.nodesInRelativeVertical.forEach(function(b){if(!a.fixedNodesOnHorizontal.has(b)){var c=0;c=a.dummyToNodeForHorizontalAlignment.has(b)?a.idToNodeMap.get(a.dummyToNodeForHorizontalAlignment.get(b)[0]).displacementY:a.idToNodeMap.get(b).displacementY,a.nodeToRelativeConstraintMapVertical.get(b).forEach(function(d){if(d.bottom){var e=a.nodeToTempPositionMapVertical.get(d.bottom)-a.nodeToTempPositionMapVertical.get(b)-c;e<d.gap&&(c-=d.gap-e)}else{var e=a.nodeToTempPositionMapVertical.get(b)-a.nodeToTempPositionMapVertical.get(d.top)+c;e<d.gap&&(c+=d.gap-e)}}),a.nodeToTempPositionMapVertical.set(b,a.nodeToTempPositionMapVertical.get(b)+c),a.dummyToNodeForHorizontalAlignment.has(b)?a.dummyToNodeForHorizontalAlignment.get(b).forEach(function(b){a.idToNodeMap.get(b).displacementY=c}):a.idToNodeMap.get(b).displacementY=c}});else{for(var c=0;c<this.componentsOnHorizontal.length;c++){var k=this.componentsOnHorizontal[c];if(this.fixedComponentsOnHorizontal[c])for(var e=0;e<k.length;e++)this.dummyToNodeForVerticalAlignment.has(k[e])?this.dummyToNodeForVerticalAlignment.get(k[e]).forEach(function(b){a.idToNodeMap.get(b).displacementX=0}):this.idToNodeMap.get(k[e]).displacementX=0;else{for(var l=0,m=0,e=0;e<k.length;e++)if(this.dummyToNodeForVerticalAlignment.has(k[e])){var n=this.dummyToNodeForVerticalAlignment.get(k[e]);l+=n.length*this.idToNodeMap.get(n[0]).displacementX,m+=n.length}else l+=this.idToNodeMap.get(k[e]).displacementX,m++;for(var o=l/m,e=0;e<k.length;e++)this.dummyToNodeForVerticalAlignment.has(k[e])?this.dummyToNodeForVerticalAlignment.get(k[e]).forEach(function(b){a.idToNodeMap.get(b).displacementX=o}):this.idToNodeMap.get(k[e]).displacementX=o}}for(var c=0;c<this.componentsOnVertical.length;c++){var k=this.componentsOnVertical[c];if(this.fixedComponentsOnVertical[c])for(var e=0;e<k.length;e++)this.dummyToNodeForHorizontalAlignment.has(k[e])?this.dummyToNodeForHorizontalAlignment.get(k[e]).forEach(function(b){a.idToNodeMap.get(b).displacementY=0}):this.idToNodeMap.get(k[e]).displacementY=0;else{for(var l=0,m=0,e=0;e<k.length;e++)if(this.dummyToNodeForHorizontalAlignment.has(k[e])){var n=this.dummyToNodeForHorizontalAlignment.get(k[e]);l+=n.length*this.idToNodeMap.get(n[0]).displacementY,m+=n.length}else l+=this.idToNodeMap.get(k[e]).displacementY,m++;for(var o=l/m,e=0;e<k.length;e++)this.dummyToNodeForHorizontalAlignment.has(k[e])?this.dummyToNodeForHorizontalAlignment.get(k[e]).forEach(function(b){a.idToNodeMap.get(b).displacementY=o}):this.idToNodeMap.get(k[e]).displacementY=o}}}},v.prototype.calculateNodesToApplyGravitationTo=function(){var a,b,c=[],d=this.graphManager.getGraphs(),e=d.length;for(b=0;b<e;b++)(a=d[b]).updateConnected(),a.isConnected||(c=c.concat(a.getNodes()));return c},v.prototype.createBendpoints=function(){var a=[];a=a.concat(this.graphManager.getAllEdges());var b=new Set;for(f=0;f<a.length;f++){var c=a[f];if(!b.has(c)){var d=c.getSource(),e=c.getTarget();if(d==e)c.getBendpoints().push(new n),c.getBendpoints().push(new n),this.createDummyNodesForBendpoints(c),b.add(c);else{var f,g,h=[];if(h=(h=h.concat(d.getEdgeListToNode(e))).concat(e.getEdgeListToNode(d)),!b.has(h[0])){if(h.length>1)for(g=0;g<h.length;g++){var i=h[g];i.getBendpoints().push(new n),this.createDummyNodesForBendpoints(i)}h.forEach(function(a){b.add(a)})}}}if(b.size==a.length)break}},v.prototype.positionNodesRadially=function(a){for(var b=new m(0,0),c=Math.ceil(Math.sqrt(a.length)),d=0,e=0,f=0,g=new n(0,0),h=0;h<a.length;h++){h%c==0&&(f=0,e=d,0!=h&&(e+=i.DEFAULT_COMPONENT_SEPERATION),d=0);var j=a[h],k=p.findCenterOfTree(j);b.x=f,b.y=e,(g=v.radialLayout(j,k,b)).y>d&&(d=Math.floor(g.y)),f=Math.floor(g.x+i.DEFAULT_COMPONENT_SEPERATION)}this.transform(new n(l.WORLD_CENTER_X-g.x/2,l.WORLD_CENTER_Y-g.y/2))},v.radialLayout=function(a,b,c){var d=Math.max(this.maxDiagonalInTree(a),i.DEFAULT_RADIAL_SEPARATION);v.branchRadialLayout(b,null,0,359,0,d);var e=s.calculateBounds(a),f=new t;f.setDeviceOrgX(e.getMinX()),f.setDeviceOrgY(e.getMinY()),f.setWorldOrgX(c.x),f.setWorldOrgY(c.y);for(var g=0;g<a.length;g++)a[g].transform(f);var h=new n(e.getMaxX(),e.getMaxY());return f.inverseTransformPoint(h)},v.branchRadialLayout=function(a,b,c,d,e,f){var g,h=(d-c+1)/2;h<0&&(h+=180);var i=(h+c)%360*r.TWO_PI/360,j=e*Math.cos(i),k=e*Math.sin(i);a.setCenter(j,k);var l=[],m=(l=l.concat(a.getEdges())).length;null!=b&&m--;for(var n=0,o=l.length,p=a.getEdgesBetween(b);p.length>1;){var q=p[0];p.splice(0,1);var s=l.indexOf(q);s>=0&&l.splice(s,1),o--,m--}g=null!=b?(l.indexOf(p[0])+1)%o:0;for(var t=Math.abs(d-c)/m,u=g;n!=m;u=++u%o){var w=l[u].getOtherEnd(a);if(w!=b){var x=(c+n*t)%360,y=(x+t)%360;v.branchRadialLayout(w,a,x,y,e+f,f),n++}}},v.maxDiagonalInTree=function(a){for(var b=q.MIN_VALUE,c=0;c<a.length;c++){var d=a[c].getDiagonal();d>b&&(b=d)}return b},v.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},v.prototype.groupZeroDegreeMembers=function(){var a=this,b={};this.memberGroups={},this.idToDummyNode={};for(var c=[],d=this.graphManager.getAllNodes(),e=0;e<d.length;e++){var f=d[e],h=f.getParent();0!==this.getNodeDegreeWithChildren(f)||void 0!=h.id&&this.getToBeTiled(h)||c.push(f)}for(var e=0;e<c.length;e++){var f=c[e],i=f.getParent().id;void 0===b[i]&&(b[i]=[]),b[i]=b[i].concat(f)}Object.keys(b).forEach(function(c){if(b[c].length>1){var d="DummyCompound_"+c;a.memberGroups[d]=b[c];var e=b[c][0].getParent(),f=new g(a.graphManager);f.id=d,f.paddingLeft=e.paddingLeft||0,f.paddingRight=e.paddingRight||0,f.paddingBottom=e.paddingBottom||0,f.paddingTop=e.paddingTop||0,a.idToDummyNode[d]=f;var h=a.getGraphManager().add(a.newGraph(),f),i=e.getChild();i.add(f);for(var j=0;j<b[c].length;j++){var k=b[c][j];i.remove(k),h.add(k)}}})},v.prototype.clearCompounds=function(){var a={},b={};this.performDFSOnCompounds();for(var c=0;c<this.compoundOrder.length;c++)b[this.compoundOrder[c].id]=this.compoundOrder[c],a[this.compoundOrder[c].id]=[].concat(this.compoundOrder[c].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[c].getChild()),this.compoundOrder[c].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(a,b)},v.prototype.clearZeroDegreeMembers=function(){var a=this,b=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(c){var d=a.idToDummyNode[c];if(b[c]=a.tileNodes(a.memberGroups[c],d.paddingLeft+d.paddingRight),d.rect.width=b[c].width,d.rect.height=b[c].height,d.setCenter(b[c].centerX,b[c].centerY),d.labelMarginLeft=0,d.labelMarginTop=0,i.NODE_DIMENSIONS_INCLUDE_LABELS){var e=d.rect.width,f=d.rect.height;d.labelWidth&&("left"==d.labelPosHorizontal?(d.rect.x-=d.labelWidth,d.setWidth(e+d.labelWidth),d.labelMarginLeft=d.labelWidth):"center"==d.labelPosHorizontal&&d.labelWidth>e?(d.rect.x-=(d.labelWidth-e)/2,d.setWidth(d.labelWidth),d.labelMarginLeft=(d.labelWidth-e)/2):"right"==d.labelPosHorizontal&&d.setWidth(e+d.labelWidth)),d.labelHeight&&("top"==d.labelPosVertical?(d.rect.y-=d.labelHeight,d.setHeight(f+d.labelHeight),d.labelMarginTop=d.labelHeight):"center"==d.labelPosVertical&&d.labelHeight>f?(d.rect.y-=(d.labelHeight-f)/2,d.setHeight(d.labelHeight),d.labelMarginTop=(d.labelHeight-f)/2):"bottom"==d.labelPosVertical&&d.setHeight(f+d.labelHeight))}})},v.prototype.repopulateCompounds=function(){for(var a=this.compoundOrder.length-1;a>=0;a--){var b=this.compoundOrder[a],c=b.id,d=b.paddingLeft,e=b.paddingTop,f=b.labelMarginLeft,g=b.labelMarginTop;this.adjustLocations(this.tiledMemberPack[c],b.rect.x,b.rect.y,d,e,f,g)}},v.prototype.repopulateZeroDegreeMembers=function(){var a=this,b=this.tiledZeroDegreePack;Object.keys(b).forEach(function(c){var d=a.idToDummyNode[c],e=d.paddingLeft,f=d.paddingTop,g=d.labelMarginLeft,h=d.labelMarginTop;a.adjustLocations(b[c],d.rect.x,d.rect.y,e,f,g,h)})},v.prototype.getToBeTiled=function(a){var b=a.id;if(null!=this.toBeTiled[b])return this.toBeTiled[b];var c=a.getChild();if(null==c)return this.toBeTiled[b]=!1,!1;for(var d=c.getNodes(),e=0;e<d.length;e++){var f=d[e];if(this.getNodeDegree(f)>0)return this.toBeTiled[b]=!1,!1;if(null==f.getChild()){this.toBeTiled[f.id]=!1;continue}if(!this.getToBeTiled(f))return this.toBeTiled[b]=!1,!1}return this.toBeTiled[b]=!0,!0},v.prototype.getNodeDegree=function(a){a.id;for(var b=a.getEdges(),c=0,d=0;d<b.length;d++){var e=b[d];e.getSource().id!==e.getTarget().id&&(c+=1)}return c},v.prototype.getNodeDegreeWithChildren=function(a){var b=this.getNodeDegree(a);if(null==a.getChild())return b;for(var c=a.getChild().getNodes(),d=0;d<c.length;d++){var e=c[d];b+=this.getNodeDegreeWithChildren(e)}return b},v.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},v.prototype.fillCompexOrderByDFS=function(a){for(var b=0;b<a.length;b++){var c=a[b];null!=c.getChild()&&this.fillCompexOrderByDFS(c.getChild().getNodes()),this.getToBeTiled(c)&&this.compoundOrder.push(c)}},v.prototype.adjustLocations=function(a,b,c,d,e,f,g){b+=d+f,c+=e+g;for(var h=b,i=0;i<a.rows.length;i++){var j=a.rows[i];b=h;for(var k=0,l=0;l<j.length;l++){var m=j[l];m.rect.x=b,m.rect.y=c,b+=m.rect.width+a.horizontalPadding,m.rect.height>k&&(k=m.rect.height)}c+=k+a.verticalPadding}},v.prototype.tileCompoundMembers=function(a,b){var c=this;this.tiledMemberPack=[],Object.keys(a).forEach(function(d){var e=b[d];if(c.tiledMemberPack[d]=c.tileNodes(a[d],e.paddingLeft+e.paddingRight),e.rect.width=c.tiledMemberPack[d].width,e.rect.height=c.tiledMemberPack[d].height,e.setCenter(c.tiledMemberPack[d].centerX,c.tiledMemberPack[d].centerY),e.labelMarginLeft=0,e.labelMarginTop=0,i.NODE_DIMENSIONS_INCLUDE_LABELS){var f=e.rect.width,g=e.rect.height;e.labelWidth&&("left"==e.labelPosHorizontal?(e.rect.x-=e.labelWidth,e.setWidth(f+e.labelWidth),e.labelMarginLeft=e.labelWidth):"center"==e.labelPosHorizontal&&e.labelWidth>f?(e.rect.x-=(e.labelWidth-f)/2,e.setWidth(e.labelWidth),e.labelMarginLeft=(e.labelWidth-f)/2):"right"==e.labelPosHorizontal&&e.setWidth(f+e.labelWidth)),e.labelHeight&&("top"==e.labelPosVertical?(e.rect.y-=e.labelHeight,e.setHeight(g+e.labelHeight),e.labelMarginTop=e.labelHeight):"center"==e.labelPosVertical&&e.labelHeight>g?(e.rect.y-=(e.labelHeight-g)/2,e.setHeight(e.labelHeight),e.labelMarginTop=(e.labelHeight-g)/2):"bottom"==e.labelPosVertical&&e.setHeight(g+e.labelHeight))}})},v.prototype.tileNodes=function(a,b){var c=this.tileNodesByFavoringDim(a,b,!0),d=this.tileNodesByFavoringDim(a,b,!1),e=this.getOrgRatio(c);return this.getOrgRatio(d)<e?d:c},v.prototype.getOrgRatio=function(a){var b=a.width/a.height;return b<1&&(b=1/b),b},v.prototype.calcIdealRowWidth=function(a,b){var c,d=i.TILING_PADDING_VERTICAL,e=i.TILING_PADDING_HORIZONTAL,f=a.length,g=0,h=0,j=0;a.forEach(function(a){g+=a.getWidth(),h+=a.getHeight(),a.getWidth()>j&&(j=a.getWidth())});var k=g/f,l=Math.pow(d-e,2)+4*(k+e)*(h/f+d)*f,m=(e-d+Math.sqrt(l))/(2*(k+e));b?(c=Math.ceil(m))==m&&c++:c=Math.floor(m);var n=c*(k+e)-e;return j>n&&(n=j),n+=2*e},v.prototype.tileNodesByFavoringDim=function(a,b,c){var d=i.TILING_PADDING_VERTICAL,e=i.TILING_PADDING_HORIZONTAL,f=i.TILING_COMPARE_BY,g={rows:[],rowWidth:[],rowHeight:[],width:0,height:b,verticalPadding:d,horizontalPadding:e,centerX:0,centerY:0};f&&(g.idealRowWidth=this.calcIdealRowWidth(a,c));var h=function(a){return a.rect.width*a.rect.height},j=function(a,b){return h(b)-h(a)};a.sort(function(a,b){var c=j;return g.idealRowWidth?(c=f)(a.id,b.id):c(a,b)});for(var k=0,l=0,m=0;m<a.length;m++){var n=a[m];k+=n.getCenterX(),l+=n.getCenterY()}g.centerX=k/a.length,g.centerY=l/a.length;for(var m=0;m<a.length;m++){var n=a[m];if(0==g.rows.length)this.insertNodeToRow(g,n,0,b);else if(this.canAddHorizontal(g,n.rect.width,n.rect.height)){var o=g.rows.length-1;g.idealRowWidth||(o=this.getShortestRowIndex(g)),this.insertNodeToRow(g,n,o,b)}else this.insertNodeToRow(g,n,g.rows.length,b);this.shiftToLastRow(g)}return g},v.prototype.insertNodeToRow=function(a,b,c,d){c==a.rows.length&&(a.rows.push([]),a.rowWidth.push(d),a.rowHeight.push(0));var e=a.rowWidth[c]+b.rect.width;a.rows[c].length>0&&(e+=a.horizontalPadding),a.rowWidth[c]=e,a.width<e&&(a.width=e);var f=b.rect.height;c>0&&(f+=a.verticalPadding);var g=0;f>a.rowHeight[c]&&(g=a.rowHeight[c],a.rowHeight[c]=f,g=a.rowHeight[c]-g),a.height+=g,a.rows[c].push(b)},v.prototype.getShortestRowIndex=function(a){for(var b=-1,c=Number.MAX_VALUE,d=0;d<a.rows.length;d++)a.rowWidth[d]<c&&(b=d,c=a.rowWidth[d]);return b},v.prototype.getLongestRowIndex=function(a){for(var b=-1,c=5e-324,d=0;d<a.rows.length;d++)a.rowWidth[d]>c&&(b=d,c=a.rowWidth[d]);return b},v.prototype.canAddHorizontal=function(a,b,c){if(a.idealRowWidth){var d,e,f=a.rows.length-1;return a.rowWidth[f]+b+a.horizontalPadding<=a.idealRowWidth}var g=this.getShortestRowIndex(a);if(g<0)return!0;var h=a.rowWidth[g];if(h+a.horizontalPadding+b<=a.width)return!0;var i=0;return a.rowHeight[g]<c&&g>0&&(i=c+a.verticalPadding-a.rowHeight[g]),d=a.width-h>=b+a.horizontalPadding?(a.height+i)/(h+b+a.horizontalPadding):(a.height+i)/a.width,i=c+a.verticalPadding,(e=a.width<b?(a.height+i)/b:(a.height+i)/a.width)<1&&(e=1/e),d<1&&(d=1/d),d<e},v.prototype.shiftToLastRow=function(a){var b=this.getLongestRowIndex(a),c=a.rowWidth.length-1,d=a.rows[b],e=d[d.length-1],f=e.width+a.horizontalPadding;if(a.width-a.rowWidth[c]>f&&b!=c){d.splice(-1,1),a.rows[c].push(e),a.rowWidth[b]=a.rowWidth[b]-f,a.rowWidth[c]=a.rowWidth[c]+f,a.width=a.rowWidth[instance.getLongestRowIndex(a)];for(var g=5e-324,h=0;h<d.length;h++)d[h].height>g&&(g=d[h].height);b>0&&(g+=a.verticalPadding);var i=a.rowHeight[b]+a.rowHeight[c];a.rowHeight[b]=g,a.rowHeight[c]<e.height+a.verticalPadding&&(a.rowHeight[c]=e.height+a.verticalPadding);var j=a.rowHeight[b]+a.rowHeight[c];a.height+=j-i,this.shiftToLastRow(a)}},v.prototype.tilingPreLayout=function(){i.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},v.prototype.tilingPostLayout=function(){i.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},v.prototype.reduceTrees=function(){for(var a,b=[],c=!0;c;){var d=this.graphManager.getAllNodes(),e=[];c=!1;for(var f=0;f<d.length;f++)if(1==(a=d[f]).getEdges().length&&!a.getEdges()[0].isInterGraph&&null==a.getChild()){if(i.PURE_INCREMENTAL){var g=a.getEdges()[0].getOtherEnd(a),h=new o(a.getCenterX()-g.getCenterX(),a.getCenterY()-g.getCenterY());e.push([a,a.getEdges()[0],a.getOwner(),h])}else e.push([a,a.getEdges()[0],a.getOwner()]);c=!0}if(!0==c){for(var j=[],k=0;k<e.length;k++)1==e[k][0].getEdges().length&&(j.push(e[k]),e[k][0].getOwner().remove(e[k][0]));b.push(j),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=b},v.prototype.growTree=function(a){for(var b,c=a.length,d=a[c-1],e=0;e<d.length;e++)b=d[e],this.findPlaceforPrunedNode(b),b[2].add(b[0]),b[2].add(b[1],b[1].source,b[1].target);a.splice(a.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},v.prototype.findPlaceforPrunedNode=function(a){var b=a[0];if(d=b==a[1].source?a[1].target:a[1].source,i.PURE_INCREMENTAL)b.setCenter(d.getCenterX()+a[3].getWidth(),d.getCenterY()+a[3].getHeight());else{var c,d,e,f,g=d.startX,h=d.finishX,j=d.startY,l=d.finishY,m=[0,0,0,0];if(j>0)for(var n=g;n<=h;n++)m[0]+=this.grid[n][j-1].length+this.grid[n][j].length-1;if(h<this.grid.length-1)for(var n=j;n<=l;n++)m[1]+=this.grid[h+1][n].length+this.grid[h][n].length-1;if(l<this.grid[0].length-1)for(var n=g;n<=h;n++)m[2]+=this.grid[n][l+1].length+this.grid[n][l].length-1;if(g>0)for(var n=j;n<=l;n++)m[3]+=this.grid[g-1][n].length+this.grid[g][n].length-1;for(var o=q.MAX_VALUE,p=0;p<m.length;p++)m[p]<o?(o=m[p],e=1,f=p):m[p]==o&&e++;if(3==e&&0==o)0==m[0]&&0==m[1]&&0==m[2]?c=1:0==m[0]&&0==m[1]&&0==m[3]?c=0:0==m[0]&&0==m[2]&&0==m[3]?c=3:0==m[1]&&0==m[2]&&0==m[3]&&(c=2);else if(2==e&&0==o){var r=Math.floor(2*Math.random());c=0==m[0]&&0==m[1]?+(0!=r):0==m[0]&&0==m[2]?2*(0!=r):0==m[0]&&0==m[3]?3*(0!=r):0==m[1]&&0==m[2]?0==r?1:2:0==m[1]&&0==m[3]?0==r?1:3:0==r?2:3}else if(4==e&&0==o){var r=Math.floor(4*Math.random());c=r}else c=f;0==c?b.setCenter(d.getCenterX(),d.getCenterY()-d.getHeight()/2-k.DEFAULT_EDGE_LENGTH-b.getHeight()/2):1==c?b.setCenter(d.getCenterX()+d.getWidth()/2+k.DEFAULT_EDGE_LENGTH+b.getWidth()/2,d.getCenterY()):2==c?b.setCenter(d.getCenterX(),d.getCenterY()+d.getHeight()/2+k.DEFAULT_EDGE_LENGTH+b.getHeight()/2):b.setCenter(d.getCenterX()-d.getWidth()/2-k.DEFAULT_EDGE_LENGTH-b.getWidth()/2,d.getCenterY())}},a.exports=v},991:(a,b,c)=>{var d=c(551).FDLayoutNode,e=c(551).IMath;function f(a,b,c,e){d.call(this,a,b,c,e)}for(var g in f.prototype=Object.create(d.prototype),d)f[g]=d[g];f.prototype.calculateDisplacement=function(){var a=this.graphManager.getLayout();null!=this.getChild()&&this.fixedNodeWeight?(this.displacementX+=a.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=a.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=a.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=a.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>a.coolingFactor*a.maxNodeDisplacement&&(this.displacementX=a.coolingFactor*a.maxNodeDisplacement*e.sign(this.displacementX)),Math.abs(this.displacementY)>a.coolingFactor*a.maxNodeDisplacement&&(this.displacementY=a.coolingFactor*a.maxNodeDisplacement*e.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},f.prototype.propogateDisplacementToChildren=function(a,b){for(var c,d=this.getChild().getNodes(),e=0;e<d.length;e++)null==(c=d[e]).getChild()?(c.displacementX+=a,c.displacementY+=b):c.propogateDisplacementToChildren(a,b)},f.prototype.move=function(){var a=this.graphManager.getLayout();(null==this.child||0==this.child.getNodes().length)&&(this.moveBy(this.displacementX,this.displacementY),a.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY)),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},f.prototype.setPred1=function(a){this.pred1=a},f.prototype.getPred1=function(){return pred1},f.prototype.getPred2=function(){return pred2},f.prototype.setNext=function(a){this.next=a},f.prototype.getNext=function(){return next},f.prototype.setProcessed=function(a){this.processed=a},f.prototype.isProcessed=function(){return processed},a.exports=f},902:(a,b,c)=>{function d(a){if(!Array.isArray(a))return Array.from(a);for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}var e=c(806),f=c(551).LinkedList,g=c(551).Matrix,h=c(551).SVD;function i(){}i.handleConstraints=function(a){var b={};b.fixedNodeConstraint=a.constraints.fixedNodeConstraint,b.alignmentConstraint=a.constraints.alignmentConstraint,b.relativePlacementConstraint=a.constraints.relativePlacementConstraint;for(var c=new Map,i=new Map,j=[],k=[],l=a.getAllNodes(),m=0,n=0;n<l.length;n++){var o=l[n];null==o.getChild()&&(i.set(o.id,m++),j.push(o.getCenterX()),k.push(o.getCenterY()),c.set(o.id,o))}b.relativePlacementConstraint&&b.relativePlacementConstraint.forEach(function(a){a.gap||0==a.gap||(a.left?a.gap=e.DEFAULT_EDGE_LENGTH+c.get(a.left).getWidth()/2+c.get(a.right).getWidth()/2:a.gap=e.DEFAULT_EDGE_LENGTH+c.get(a.top).getHeight()/2+c.get(a.bottom).getHeight()/2)});var p=function(a){var b=0,c=0;return a.forEach(function(a){b+=j[i.get(a)],c+=k[i.get(a)]}),{x:b/a.size,y:c/a.size}},q=function(a,b,c,e,g){var h=new Map;a.forEach(function(a,b){h.set(b,0)}),a.forEach(function(a,b){a.forEach(function(a){h.set(a.id,h.get(a.id)+1)})});var l=new Map,m=new Map,n=new f;for(h.forEach(function(a,d){0==a?(n.push(d),c||("horizontal"==b?l.set(d,i.has(d)?j[i.get(d)]:e.get(d)):l.set(d,i.has(d)?k[i.get(d)]:e.get(d)))):l.set(d,-1/0),c&&m.set(d,new Set([d]))}),c&&g.forEach(function(a){var d=[];if(a.forEach(function(a){c.has(a)&&d.push(a)}),d.length>0){var f=0;d.forEach(function(a){"horizontal"==b?l.set(a,i.has(a)?j[i.get(a)]:e.get(a)):l.set(a,i.has(a)?k[i.get(a)]:e.get(a)),f+=l.get(a)}),f/=d.length,a.forEach(function(a){c.has(a)||l.set(a,f)})}else{var g=0;a.forEach(function(a){"horizontal"==b?g+=i.has(a)?j[i.get(a)]:e.get(a):g+=i.has(a)?k[i.get(a)]:e.get(a)}),g/=a.length,a.forEach(function(a){l.set(a,g)})}});0!=n.length;)!function(){var d=n.shift();a.get(d).forEach(function(a){if(l.get(a.id)<l.get(d)+a.gap)if(c&&c.has(a.id)){var f=void 0;if(f="horizontal"==b?i.has(a.id)?j[i.get(a.id)]:e.get(a.id):i.has(a.id)?k[i.get(a.id)]:e.get(a.id),l.set(a.id,f),f<l.get(d)+a.gap){var g=l.get(d)+a.gap-f;m.get(d).forEach(function(a){l.set(a,l.get(a)-g)})}}else l.set(a.id,l.get(d)+a.gap);h.set(a.id,h.get(a.id)-1),0==h.get(a.id)&&n.push(a.id),c&&m.set(a.id,function(a,b){var c=new Set(a),d=!0,e=!1,f=void 0;try{for(var g,h=b[Symbol.iterator]();!(d=(g=h.next()).done);d=!0){var i=g.value;c.add(i)}}catch(a){e=!0,f=a}finally{try{!d&&h.return&&h.return()}finally{if(e)throw f}}return c}(m.get(d),m.get(a.id)))})}();if(c){var o=new Set;a.forEach(function(a,b){0==a.length&&o.add(b)});var p=[];m.forEach(function(a,b){if(o.has(b)){var e=!1,f=!0,g=!1,h=void 0;try{for(var i,j=a[Symbol.iterator]();!(f=(i=j.next()).done);f=!0){var k=i.value;c.has(k)&&(e=!0)}}catch(a){g=!0,h=a}finally{try{!f&&j.return&&j.return()}finally{if(g)throw h}}if(!e){var l=!1,m=void 0;p.forEach(function(b,c){b.has([].concat(d(a))[0])&&(l=!0,m=c)}),l?a.forEach(function(a){p[m].add(a)}):p.push(new Set(a))}}}),p.forEach(function(a,c){var d=1/0,f=1/0,g=-1/0,h=-1/0,m=!0,n=!1,o=void 0;try{for(var p,q=a[Symbol.iterator]();!(m=(p=q.next()).done);m=!0){var r=p.value,s=void 0;s="horizontal"==b?i.has(r)?j[i.get(r)]:e.get(r):i.has(r)?k[i.get(r)]:e.get(r);var t=l.get(r);s<d&&(d=s),s>g&&(g=s),t<f&&(f=t),t>h&&(h=t)}}catch(a){n=!0,o=a}finally{try{!m&&q.return&&q.return()}finally{if(n)throw o}}var u=(d+g)/2-(f+h)/2,v=!0,w=!1,x=void 0;try{for(var y,z=a[Symbol.iterator]();!(v=(y=z.next()).done);v=!0){var A=y.value;l.set(A,l.get(A)+u)}}catch(a){w=!0,x=a}finally{try{!v&&z.return&&z.return()}finally{if(w)throw x}}})}return l},r=function(a){var b=0,c=0,d=0,e=0;if(a.forEach(function(a){a.left?j[i.get(a.left)]-j[i.get(a.right)]>=0?b++:c++:k[i.get(a.top)]-k[i.get(a.bottom)]>=0?d++:e++}),b>c&&d>e)for(var f=0;f<i.size;f++)j[f]=-1*j[f],k[f]=-1*k[f];else if(b>c)for(var g=0;g<i.size;g++)j[g]=-1*j[g];else if(d>e)for(var h=0;h<i.size;h++)k[h]=-1*k[h]},s=function(a){var b=[],c=new f,d=new Set,e=0;return a.forEach(function(f,g){if(!d.has(g)){b[e]=[];var h=g;for(c.push(h),d.add(h),b[e].push(h);0!=c.length;)h=c.shift(),a.get(h).forEach(function(a){d.has(a.id)||(c.push(a.id),d.add(a.id),b[e].push(a.id))});e++}}),b},t=function(a){var b=new Map;return a.forEach(function(a,c){b.set(c,[])}),a.forEach(function(a,c){a.forEach(function(a){b.get(c).push(a),b.get(a.id).push({id:c,gap:a.gap,direction:a.direction})})}),b},u=function(a){var b=new Map;return a.forEach(function(a,c){b.set(c,[])}),a.forEach(function(a,c){a.forEach(function(a){b.get(a.id).push({id:c,gap:a.gap,direction:a.direction})})}),b},v=[],w=[],x=!1,y=!1,z=new Set,A=new Map,B=new Map,C=[];if(b.fixedNodeConstraint&&b.fixedNodeConstraint.forEach(function(a){z.add(a.nodeId)}),b.relativePlacementConstraint&&(b.relativePlacementConstraint.forEach(function(a){a.left?(A.has(a.left)?A.get(a.left).push({id:a.right,gap:a.gap,direction:"horizontal"}):A.set(a.left,[{id:a.right,gap:a.gap,direction:"horizontal"}]),A.has(a.right)||A.set(a.right,[])):(A.has(a.top)?A.get(a.top).push({id:a.bottom,gap:a.gap,direction:"vertical"}):A.set(a.top,[{id:a.bottom,gap:a.gap,direction:"vertical"}]),A.has(a.bottom)||A.set(a.bottom,[]))}),C=s(B=t(A))),e.TRANSFORM_ON_CONSTRAINT_HANDLING){if(b.fixedNodeConstraint&&b.fixedNodeConstraint.length>1)b.fixedNodeConstraint.forEach(function(a,b){v[b]=[a.position.x,a.position.y],w[b]=[j[i.get(a.nodeId)],k[i.get(a.nodeId)]]}),x=!0;else if(b.alignmentConstraint)!function(){var a=0;if(b.alignmentConstraint.vertical){for(var c=b.alignmentConstraint.vertical,e=0;e<c.length;e++)!function(b){var e=new Set;c[b].forEach(function(a){e.add(a)});var f=new Set([].concat(d(e)).filter(function(a){return z.has(a)})),g=void 0;g=f.size>0?j[i.get(f.values().next().value)]:p(e).x,c[b].forEach(function(b){v[a]=[g,k[i.get(b)]],w[a]=[j[i.get(b)],k[i.get(b)]],a++})}(e);x=!0}if(b.alignmentConstraint.horizontal){for(var f=b.alignmentConstraint.horizontal,g=0;g<f.length;g++)!function(b){var c=new Set;f[b].forEach(function(a){c.add(a)});var e=new Set([].concat(d(c)).filter(function(a){return z.has(a)})),g=void 0;g=e.size>0?j[i.get(e.values().next().value)]:p(c).y,f[b].forEach(function(b){v[a]=[j[i.get(b)],g],w[a]=[j[i.get(b)],k[i.get(b)]],a++})}(g);x=!0}b.relativePlacementConstraint&&(y=!0)}();else if(b.relativePlacementConstraint){for(var D=0,E=0,F=0;F<C.length;F++)C[F].length>D&&(D=C[F].length,E=F);if(D<B.size/2)r(b.relativePlacementConstraint),x=!1,y=!1;else{var G=new Map,H=new Map,I=[];C[E].forEach(function(a){A.get(a).forEach(function(b){"horizontal"==b.direction?(G.has(a)?G.get(a).push(b):G.set(a,[b]),G.has(b.id)||G.set(b.id,[]),I.push({left:a,right:b.id})):(H.has(a)?H.get(a).push(b):H.set(a,[b]),H.has(b.id)||H.set(b.id,[]),I.push({top:a,bottom:b.id}))})}),r(I),y=!1;var J=q(G,"horizontal"),K=q(H,"vertical");C[E].forEach(function(a,b){w[b]=[j[i.get(a)],k[i.get(a)]],v[b]=[],J.has(a)?v[b][0]=J.get(a):v[b][0]=j[i.get(a)],K.has(a)?v[b][1]=K.get(a):v[b][1]=k[i.get(a)]}),x=!0}}if(x){for(var L=void 0,M=g.transpose(v),N=g.transpose(w),O=0;O<M.length;O++)M[O]=g.multGamma(M[O]),N[O]=g.multGamma(N[O]);var P=g.multMat(M,g.transpose(N)),Q=h.svd(P);L=g.multMat(Q.V,g.transpose(Q.U));for(var R=0;R<i.size;R++){var S=[j[R],k[R]],T=[L[0][0],L[1][0]],U=[L[0][1],L[1][1]];j[R]=g.dotProduct(S,T),k[R]=g.dotProduct(S,U)}y&&r(b.relativePlacementConstraint)}}if(e.ENFORCE_CONSTRAINTS){if(b.fixedNodeConstraint&&b.fixedNodeConstraint.length>0){var V={x:0,y:0};b.fixedNodeConstraint.forEach(function(a,b){var c,d={x:j[i.get(a.nodeId)],y:k[i.get(a.nodeId)]},e=(c=a.position,{x:c.x-d.x,y:c.y-d.y});V.x+=e.x,V.y+=e.y}),V.x/=b.fixedNodeConstraint.length,V.y/=b.fixedNodeConstraint.length,j.forEach(function(a,b){j[b]+=V.x}),k.forEach(function(a,b){k[b]+=V.y}),b.fixedNodeConstraint.forEach(function(a){j[i.get(a.nodeId)]=a.position.x,k[i.get(a.nodeId)]=a.position.y})}if(b.alignmentConstraint){if(b.alignmentConstraint.vertical)for(var W=b.alignmentConstraint.vertical,X=0;X<W.length;X++)!function(a){var b=new Set;W[a].forEach(function(a){b.add(a)});var c=new Set([].concat(d(b)).filter(function(a){return z.has(a)})),e=void 0;e=c.size>0?j[i.get(c.values().next().value)]:p(b).x,b.forEach(function(a){z.has(a)||(j[i.get(a)]=e)})}(X);if(b.alignmentConstraint.horizontal)for(var Y=b.alignmentConstraint.horizontal,Z=0;Z<Y.length;Z++)!function(a){var b=new Set;Y[a].forEach(function(a){b.add(a)});var c=new Set([].concat(d(b)).filter(function(a){return z.has(a)})),e=void 0;e=c.size>0?k[i.get(c.values().next().value)]:p(b).y,b.forEach(function(a){z.has(a)||(k[i.get(a)]=e)})}(Z)}b.relativePlacementConstraint&&function(){var a=new Map,c=new Map,d=new Map,e=new Map,f=new Map,g=new Map,h=new Set,l=new Set;if(z.forEach(function(a){h.add(a),l.add(a)}),b.alignmentConstraint){if(b.alignmentConstraint.vertical)for(var m=b.alignmentConstraint.vertical,n=function(b){d.set("dummy"+b,[]),m[b].forEach(function(c){a.set(c,"dummy"+b),d.get("dummy"+b).push(c),z.has(c)&&h.add("dummy"+b)}),f.set("dummy"+b,j[i.get(m[b][0])])},o=0;o<m.length;o++)n(o);if(b.alignmentConstraint.horizontal)for(var p=b.alignmentConstraint.horizontal,r=function(a){e.set("dummy"+a,[]),p[a].forEach(function(b){c.set(b,"dummy"+a),e.get("dummy"+a).push(b),z.has(b)&&l.add("dummy"+a)}),g.set("dummy"+a,k[i.get(p[a][0])])},v=0;v<p.length;v++)r(v)}var w=new Map,x=new Map,y=function(b){A.get(b).forEach(function(d){var e=void 0,f=void 0;"horizontal"==d.direction?(e=a.get(b)?a.get(b):b,f=a.get(d.id)?{id:a.get(d.id),gap:d.gap,direction:d.direction}:d,w.has(e)?w.get(e).push(f):w.set(e,[f]),w.has(f.id)||w.set(f.id,[])):(e=c.get(b)?c.get(b):b,f=c.get(d.id)?{id:c.get(d.id),gap:d.gap,direction:d.direction}:d,x.has(e)?x.get(e).push(f):x.set(e,[f]),x.has(f.id)||x.set(f.id,[]))})},B=!0,C=!1,D=void 0;try{for(var E,F=A.keys()[Symbol.iterator]();!(B=(E=F.next()).done);B=!0){var G=E.value;y(G)}}catch(a){C=!0,D=a}finally{try{!B&&F.return&&F.return()}finally{if(C)throw D}}var H=t(w),I=t(x),J=s(H),K=s(I),L=u(w),M=u(x),N=[],O=[];J.forEach(function(a,b){N[b]=[],a.forEach(function(a){0==L.get(a).length&&N[b].push(a)})}),K.forEach(function(a,b){O[b]=[],a.forEach(function(a){0==M.get(a).length&&O[b].push(a)})});var P=q(w,"horizontal",h,f,N),Q=q(x,"vertical",l,g,O),R=function(a){d.get(a)?d.get(a).forEach(function(b){j[i.get(b)]=P.get(a)}):j[i.get(a)]=P.get(a)},S=!0,T=!1,U=void 0;try{for(var V,W=P.keys()[Symbol.iterator]();!(S=(V=W.next()).done);S=!0){var X=V.value;R(X)}}catch(a){T=!0,U=a}finally{try{!S&&W.return&&W.return()}finally{if(T)throw U}}var Y=function(a){e.get(a)?e.get(a).forEach(function(b){k[i.get(b)]=Q.get(a)}):k[i.get(a)]=Q.get(a)},Z=!0,$=!1,_=void 0;try{for(var aa,ab=Q.keys()[Symbol.iterator]();!(Z=(aa=ab.next()).done);Z=!0){var X=aa.value;Y(X)}}catch(a){$=!0,_=a}finally{try{!Z&&ab.return&&ab.return()}finally{if($)throw _}}}()}for(var $=0;$<l.length;$++){var _=l[$];null==_.getChild()&&_.setCenter(j[i.get(_.id)],k[i.get(_.id)])}},a.exports=i},551:a=>{a.exports=d}},b={};return function c(d){var e=b[d];if(void 0!==e)return e.exports;var f=b[d]={exports:{}};return a[d](f,f.exports,c),f.exports}(45)})()},78360:(a,b,c)=>{"use strict";c.d(b,{diagram:()=>Y});var d=c(25215),e=c(81856),f=c(93273),g=c(40684),h=c(46629),i=c(21143),j=c(92325),k=c(17307),l=c(18980),m=c(69085),n={L:"left",R:"right",T:"top",B:"bottom"},o={L:(0,i.K2)(a=>`${a},${a/2} 0,${a} 0,0`,"L"),R:(0,i.K2)(a=>`0,${a/2} ${a},0 ${a},${a}`,"R"),T:(0,i.K2)(a=>`0,0 ${a},0 ${a/2},${a}`,"T"),B:(0,i.K2)(a=>`${a/2},0 ${a},${a} 0,${a}`,"B")},p={L:(0,i.K2)((a,b)=>a-b+2,"L"),R:(0,i.K2)((a,b)=>a-2,"R"),T:(0,i.K2)((a,b)=>a-b+2,"T"),B:(0,i.K2)((a,b)=>a-2,"B")},q=(0,i.K2)(function(a){return s(a)?"L"===a?"R":"L":"T"===a?"B":"T"},"getOppositeArchitectureDirection"),r=(0,i.K2)(function(a){return"L"===a||"R"===a||"T"===a||"B"===a},"isArchitectureDirection"),s=(0,i.K2)(function(a){return"L"===a||"R"===a},"isArchitectureDirectionX"),t=(0,i.K2)(function(a){return"T"===a||"B"===a},"isArchitectureDirectionY"),u=(0,i.K2)(function(a,b){let c=s(a)&&t(b),d=t(a)&&s(b);return c||d},"isArchitectureDirectionXY"),v=(0,i.K2)(function(a){let b=a[0],c=a[1],d=s(b)&&t(c),e=t(b)&&s(c);return d||e},"isArchitecturePairXY"),w=(0,i.K2)(function(a){return"LL"!==a&&"RR"!==a&&"TT"!==a&&"BB"!==a},"isValidArchitectureDirectionPair"),x=(0,i.K2)(function(a,b){let c=`${a}${b}`;return w(c)?c:void 0},"getArchitectureDirectionPair"),y=(0,i.K2)(function([a,b],c){let d=c[0],e=c[1];if(s(d))if(t(e))return[a+("L"===d?-1:1),b+("T"===e?1:-1)];else return[a+("L"===d?-1:1),b];return s(e)?[a+("L"===e?1:-1),b+("T"===d?1:-1)]:[a,b+("T"===d?1:-1)]},"shiftPositionByArchitectureDirectionPair"),z=(0,i.K2)(function(a){return"LT"===a||"TL"===a?[1,1]:"BL"===a||"LB"===a?[1,-1]:"BR"===a||"RB"===a?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),A=(0,i.K2)(function(a,b){return u(a,b)?"bend":s(a)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),B=(0,i.K2)(function(a){return"service"===a.type},"isArchitectureService"),C=(0,i.K2)(function(a){return"junction"===a.type},"isArchitectureJunction"),D=(0,i.K2)(a=>a.data(),"edgeData"),E=(0,i.K2)(a=>a.data(),"nodeData"),F=h.UI.architecture,G=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=h.SV,this.getAccTitle=h.iN,this.setDiagramTitle=h.ke,this.getDiagramTitle=h.ab,this.getAccDescription=h.m7,this.setAccDescription=h.EI,this.clear()}static{(0,i.K2)(this,"ArchitectureDB")}setDiagramId(a){this.diagramId=a}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",(0,h.IU)()}addService({id:a,icon:b,in:c,title:d,iconText:e}){if(void 0!==this.registeredIds[a])throw Error(`The service id [${a}] is already in use by another ${this.registeredIds[a]}`);if(void 0!==c){if(a===c)throw Error(`The service [${a}] cannot be placed within itself`);if(void 0===this.registeredIds[c])throw Error(`The service [${a}]'s parent does not exist. Please make sure the parent is created before this service`);if("node"===this.registeredIds[c])throw Error(`The service [${a}]'s parent is not a group`)}this.registeredIds[a]="node",this.nodes[a]={id:a,type:"service",icon:b,iconText:e,title:d,edges:[],in:c}}getServices(){return Object.values(this.nodes).filter(B)}addJunction({id:a,in:b}){if(void 0!==this.registeredIds[a])throw Error(`The junction id [${a}] is already in use by another ${this.registeredIds[a]}`);if(void 0!==b){if(a===b)throw Error(`The junction [${a}] cannot be placed within itself`);if(void 0===this.registeredIds[b])throw Error(`The junction [${a}]'s parent does not exist. Please make sure the parent is created before this junction`);if("node"===this.registeredIds[b])throw Error(`The junction [${a}]'s parent is not a group`)}this.registeredIds[a]="node",this.nodes[a]={id:a,type:"junction",edges:[],in:b}}getJunctions(){return Object.values(this.nodes).filter(C)}getNodes(){return Object.values(this.nodes)}getNode(a){return this.nodes[a]??null}addGroup({id:a,icon:b,in:c,title:d}){if(this.registeredIds?.[a]!==void 0)throw Error(`The group id [${a}] is already in use by another ${this.registeredIds[a]}`);if(void 0!==c){if(a===c)throw Error(`The group [${a}] cannot be placed within itself`);if(this.registeredIds?.[c]===void 0)throw Error(`The group [${a}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[c]==="node")throw Error(`The group [${a}]'s parent is not a group`)}this.registeredIds[a]="group",this.groups[a]={id:a,icon:b,title:d,in:c}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:a,rhsId:b,lhsDir:c,rhsDir:d,lhsInto:e,rhsInto:f,lhsGroup:g,rhsGroup:h,title:i}){if(!r(c))throw Error(`Invalid direction given for left hand side of edge ${a}--${b}. Expected (L,R,T,B) got ${String(c)}`);if(!r(d))throw Error(`Invalid direction given for right hand side of edge ${a}--${b}. Expected (L,R,T,B) got ${String(d)}`);if(void 0===this.nodes[a]&&void 0===this.groups[a])throw Error(`The left-hand id [${a}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(void 0===this.nodes[b]&&void 0===this.groups[b])throw Error(`The right-hand id [${b}] does not yet exist. Please create the service/group before declaring an edge to it.`);let j=this.nodes[a].in,k=this.nodes[b].in;if(g&&j&&k&&j==k)throw Error(`The left-hand id [${a}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(h&&j&&k&&j==k)throw Error(`The right-hand id [${b}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);this.edges.push({lhsId:a,lhsDir:c,lhsInto:e,lhsGroup:g,rhsId:b,rhsDir:d,rhsInto:f,rhsGroup:h,title:i}),this.nodes[a]&&this.nodes[b]&&(this.nodes[a].edges.push(this.edges[this.edges.length-1]),this.nodes[b].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(void 0===this.dataStructures){let a={},b=Object.entries(this.nodes).reduce((b,[c,d])=>(b[c]=d.edges.reduce((b,d)=>{let e=this.getNode(d.lhsId)?.in,f=this.getNode(d.rhsId)?.in;if(e&&f&&e!==f){let b=A(d.lhsDir,d.rhsDir);"bend"!==b&&(a[e]??={},a[e][f]=b,a[f]??={},a[f][e]=b)}if(d.lhsId===c){let a=x(d.lhsDir,d.rhsDir);a&&(b[a]=d.rhsId)}else{let a=x(d.rhsDir,d.lhsDir);a&&(b[a]=d.lhsId)}return b},{}),b),{}),c=Object.keys(b)[0],d={[c]:1},e=Object.keys(b).reduce((a,b)=>b===c?a:{...a,[b]:1},{}),f=(0,i.K2)(a=>{let c={[a]:[0,0]},f=[a];for(;f.length>0;){let a=f.shift();if(a){d[a]=1,delete e[a];let g=b[a],[h,i]=c[a];Object.entries(g).forEach(([a,b])=>{d[b]||(c[b]=y([h,i],a),f.push(b))})}}return c},"BFS"),g=[f(c)];for(;Object.keys(e).length>0;)g.push(f(Object.keys(e)[0]));this.dataStructures={adjList:b,spatialMaps:g,groupAlignments:a}}return this.dataStructures}setElementForId(a,b){this.elements[a]=b}getElementById(a){return this.elements[a]}getConfig(){return(0,g.$t)({...F,...(0,h.zj)().architecture})}getConfigField(a){return this.getConfig()[a]}},H=(0,i.K2)((a,b)=>{(0,f.S)(a,b),a.groups.map(a=>b.addGroup(a)),a.services.map(a=>b.addService({...a,type:"service"})),a.junctions.map(a=>b.addJunction({...a,type:"junction"})),a.edges.map(a=>b.addEdge(a))},"populateDb"),I={parser:{yy:void 0},parse:(0,i.K2)(async a=>{let b=await (0,j.qg)("architecture",a);i.Rm.debug(b);let c=I.parser?.yy;if(!(c instanceof G))throw 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.");H(b,c)},"parse")},J=(0,i.K2)(a=>`
2
2
  .edge {
3
3
  stroke-width: ${a.archEdgeWidth};
4
4
  stroke: ${a.archEdgeColor};
@@ -1,4 +1,4 @@
1
- "use strict";exports.id=8469,exports.ids=[8469],exports.modules={18469:(a,b,c)=>{c.d(b,{diagram:()=>y});var d=c(47596),e=c(93273),f=c(98908),g=c(40684),h=c(46629),i=c(21143),j=c(92325),k=new f.m(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",children:[]}]})),l=(0,i.K2)(()=>{k.reset(),(0,h.IU)()},"clear"),m=(0,i.K2)(()=>k.records.stack[0],"getRoot"),n=(0,i.K2)(()=>k.records.cnt,"getCount"),o=h.UI.treeView,p=(0,i.K2)(()=>(0,g.$t)(o,(0,h.zj)().treeView),"getConfig"),q={clear:l,addNode:(0,i.K2)((a,b)=>{for(;a<=k.records.stack[k.records.stack.length-1].level;)k.records.stack.pop();let c={id:k.records.cnt++,level:a,name:b,children:[]};k.records.stack[k.records.stack.length-1].children.push(c),k.records.stack.push(c)},"addNode"),getRoot:m,getCount:n,getConfig:p,getAccTitle:h.iN,getAccDescription:h.m7,getDiagramTitle:h.ab,setAccDescription:h.EI,setAccTitle:h.SV,setDiagramTitle:h.ke},r=(0,i.K2)(a=>{(0,e.S)(a,q),a.nodes.map(a=>q.addNode(a.indent?parseInt(a.indent):0,a.name))},"populate"),s={parse:(0,i.K2)(async a=>{let b=await (0,j.qg)("treeView",a);i.Rm.debug(b),r(b)},"parse")},t=(0,i.K2)((a,b,c,d,e)=>{let f=d.append("text").text(c.name).attr("dominant-baseline","middle").attr("class","treeView-node-label"),{height:g,width:h}=f.node().getBBox(),i=g+2*e.paddingY,j=h+2*e.paddingX;f.attr("x",a+e.paddingX),f.attr("y",b+i/2),c.BBox={x:a,y:b,width:j,height:i}},"positionLabel"),u=(0,i.K2)((a,b,c,d,e,f)=>a.append("line").attr("x1",b).attr("y1",c).attr("x2",d).attr("y2",e).attr("stroke-width",f).attr("class","treeView-node-line"),"positionLine"),v=(0,i.K2)((a,b,c)=>{let d=0,e=0,f=(0,i.K2)((a,b,c,f)=>{let g=f*(c.rowIndent+c.paddingX);t(g,d,b,a,c);let{height:h,width:i}=b.BBox;u(a,g-c.rowIndent,d+h/2,g,d+h/2,c.lineThickness),e=Math.max(e,g+i),d+=h},"drawNode"),g=(0,i.K2)((b,d=0)=>{f(a,b,c,d),b.children.forEach(a=>{g(a,d+1)});let{x:e,y:h,height:i}=b.BBox;if(b.children.length){let{y:d,height:f}=b.children[b.children.length-1].BBox;u(a,e+c.paddingX,h+i,e+c.paddingX,d+f/2+c.lineThickness/2,c.lineThickness)}},"processNode");return g(b),{totalHeight:d,totalWidth:e}},"drawTree"),w=(0,i.K2)((a,b,c,e)=>{i.Rm.debug("Rendering treeView diagram\n"+a);let f=e.db,g=f.getRoot(),j=f.getConfig(),k=(0,d.D)(b),l=k.append("g");l.attr("class","tree-view");let{totalHeight:m,totalWidth:n}=v(l,g,j);k.attr("viewBox",`-${j.lineThickness/2} 0 ${n} ${m}`),(0,h.a$)(k,m,n,j.useMaxWidth)},"draw"),x={labelFontSize:"16px",labelColor:"black",lineColor:"black"},y={db:q,renderer:{draw:w},parser:s,styles:(0,i.K2)(({treeView:a})=>{let{labelFontSize:b,labelColor:c,lineColor:d}=(0,g.$t)(x,a);return`
1
+ "use strict";exports.id=8469,exports.ids=[8469],exports.modules={18469:(a,b,c)=>{c.d(b,{diagram:()=>y});var d=c(25215),e=c(93273),f=c(98908),g=c(40684),h=c(46629),i=c(21143),j=c(92325),k=new f.m(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",children:[]}]})),l=(0,i.K2)(()=>{k.reset(),(0,h.IU)()},"clear"),m=(0,i.K2)(()=>k.records.stack[0],"getRoot"),n=(0,i.K2)(()=>k.records.cnt,"getCount"),o=h.UI.treeView,p=(0,i.K2)(()=>(0,g.$t)(o,(0,h.zj)().treeView),"getConfig"),q={clear:l,addNode:(0,i.K2)((a,b)=>{for(;a<=k.records.stack[k.records.stack.length-1].level;)k.records.stack.pop();let c={id:k.records.cnt++,level:a,name:b,children:[]};k.records.stack[k.records.stack.length-1].children.push(c),k.records.stack.push(c)},"addNode"),getRoot:m,getCount:n,getConfig:p,getAccTitle:h.iN,getAccDescription:h.m7,getDiagramTitle:h.ab,setAccDescription:h.EI,setAccTitle:h.SV,setDiagramTitle:h.ke},r=(0,i.K2)(a=>{(0,e.S)(a,q),a.nodes.map(a=>q.addNode(a.indent?parseInt(a.indent):0,a.name))},"populate"),s={parse:(0,i.K2)(async a=>{let b=await (0,j.qg)("treeView",a);i.Rm.debug(b),r(b)},"parse")},t=(0,i.K2)((a,b,c,d,e)=>{let f=d.append("text").text(c.name).attr("dominant-baseline","middle").attr("class","treeView-node-label"),{height:g,width:h}=f.node().getBBox(),i=g+2*e.paddingY,j=h+2*e.paddingX;f.attr("x",a+e.paddingX),f.attr("y",b+i/2),c.BBox={x:a,y:b,width:j,height:i}},"positionLabel"),u=(0,i.K2)((a,b,c,d,e,f)=>a.append("line").attr("x1",b).attr("y1",c).attr("x2",d).attr("y2",e).attr("stroke-width",f).attr("class","treeView-node-line"),"positionLine"),v=(0,i.K2)((a,b,c)=>{let d=0,e=0,f=(0,i.K2)((a,b,c,f)=>{let g=f*(c.rowIndent+c.paddingX);t(g,d,b,a,c);let{height:h,width:i}=b.BBox;u(a,g-c.rowIndent,d+h/2,g,d+h/2,c.lineThickness),e=Math.max(e,g+i),d+=h},"drawNode"),g=(0,i.K2)((b,d=0)=>{f(a,b,c,d),b.children.forEach(a=>{g(a,d+1)});let{x:e,y:h,height:i}=b.BBox;if(b.children.length){let{y:d,height:f}=b.children[b.children.length-1].BBox;u(a,e+c.paddingX,h+i,e+c.paddingX,d+f/2+c.lineThickness/2,c.lineThickness)}},"processNode");return g(b),{totalHeight:d,totalWidth:e}},"drawTree"),w=(0,i.K2)((a,b,c,e)=>{i.Rm.debug("Rendering treeView diagram\n"+a);let f=e.db,g=f.getRoot(),j=f.getConfig(),k=(0,d.D)(b),l=k.append("g");l.attr("class","tree-view");let{totalHeight:m,totalWidth:n}=v(l,g,j);k.attr("viewBox",`-${j.lineThickness/2} 0 ${n} ${m}`),(0,h.a$)(k,m,n,j.useMaxWidth)},"draw"),x={labelFontSize:"16px",labelColor:"black",lineColor:"black"},y={db:q,renderer:{draw:w},parser:s,styles:(0,i.K2)(({treeView:a})=>{let{labelFontSize:b,labelColor:c,lineColor:d}=(0,g.$t)(x,a);return`
2
2
  .treeView-node-label {
3
3
  font-size: ${b};
4
4
  fill: ${c};
@@ -1,4 +1,4 @@
1
- "use strict";exports.id=8704,exports.ids=[8704],exports.modules={38704:(a,b,c)=>{c.d(b,{diagram:()=>aa});var d=c(47596),e=c(40684),f=c(46629),g=c(21143),h=c(69085),i=c(67821),j=c(61255),k=c(30089),l=function(){var a=(0,g.K2)(function(a,b,c,d){for(c=c||{},d=a.length;d--;c[a[d]]=b);return c},"o"),b=[6,11,13,14,15,17,19,20,23,24],c=[1,12],d=[1,13],e=[1,14],f=[1,15],h=[1,16],i=[1,19],j=[1,20],k={trace:(0,g.K2)(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:(0,g.K2)(function(a,b,c,d,e,f,g){var h=f.length-1;switch(e){case 1:return f[h-1];case 3:d.setDirection("LR");break;case 4:d.setDirection("TD");break;case 5:case 9:case 10:this.$=[];break;case 6:f[h-1].push(f[h]),this.$=f[h-1];break;case 7:case 8:this.$=f[h];break;case 11:d.getCommonDb().setDiagramTitle(f[h].substr(6)),this.$=f[h].substr(6);break;case 12:this.$=f[h].trim(),d.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=f[h].trim(),d.getCommonDb().setAccDescription(this.$);break;case 15:d.addSection(f[h].substr(8)),this.$=f[h].substr(8);break;case 18:d.addTask(f[h],0,""),this.$=f[h];break;case 19:d.addEvent(f[h].substr(2)),this.$=f[h]}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},a(b,[2,5],{5:6}),a(b,[2,2]),a(b,[2,3]),a(b,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:c,15:d,17:e,19:f,20:h,21:17,22:18,23:i,24:j},a(b,[2,10],{1:[2,1]}),a(b,[2,6]),{12:21,14:c,15:d,17:e,19:f,20:h,21:17,22:18,23:i,24:j},a(b,[2,8]),a(b,[2,9]),a(b,[2,11]),{16:[1,22]},{18:[1,23]},a(b,[2,14]),a(b,[2,15]),a(b,[2,16]),a(b,[2,17]),a(b,[2,18]),a(b,[2,19]),a(b,[2,7]),a(b,[2,12]),a(b,[2,13])],defaultActions:{},parseError:(0,g.K2)(function(a,b){if(b.recoverable)this.trace(a);else{var c=Error(a);throw c.hash=b,c}},"parseError"),parse:(0,g.K2)(function(a){var b=this,c=[0],d=[],e=[null],f=[],h=this.table,i="",j=0,k=0,l=0,m=f.slice.call(arguments,1),n=Object.create(this.lexer),o={};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(o[p]=this.yy[p]);n.setInput(a,o),o.lexer=n,o.parser=this,void 0===n.yylloc&&(n.yylloc={});var q=n.yylloc;f.push(q);var r=n.options&&n.options.ranges;function s(){var a;return"number"!=typeof(a=d.pop()||n.lex()||1)&&(a instanceof Array&&(a=(d=a).pop()),a=b.symbols_[a]||a),a}"function"==typeof o.parseError?this.parseError=o.parseError:this.parseError=Object.getPrototypeOf(this).parseError,(0,g.K2)(function(a){c.length=c.length-2*a,e.length=e.length-a,f.length=f.length-a},"popStack"),(0,g.K2)(s,"lex");for(var t,u,v,w,x,y,z,A,B,C={};;){if(v=c[c.length-1],this.defaultActions[v]?w=this.defaultActions[v]:(null==t&&(t=s()),w=h[v]&&h[v][t]),void 0===w||!w.length||!w[0]){var D="";for(y in B=[],h[v])this.terminals_[y]&&y>2&&B.push("'"+this.terminals_[y]+"'");D=n.showPosition?"Parse error on line "+(j+1)+":\n"+n.showPosition()+"\nExpecting "+B.join(", ")+", got '"+(this.terminals_[t]||t)+"'":"Parse error on line "+(j+1)+": Unexpected "+(1==t?"end of input":"'"+(this.terminals_[t]||t)+"'"),this.parseError(D,{text:n.match,token:this.terminals_[t]||t,line:n.yylineno,loc:q,expected:B})}if(w[0]instanceof Array&&w.length>1)throw Error("Parse Error: multiple actions possible at state: "+v+", token: "+t);switch(w[0]){case 1:c.push(t),e.push(n.yytext),f.push(n.yylloc),c.push(w[1]),t=null,u?(t=u,u=null):(k=n.yyleng,i=n.yytext,j=n.yylineno,q=n.yylloc,l>0&&l--);break;case 2:if(z=this.productions_[w[1]][1],C.$=e[e.length-z],C._$={first_line:f[f.length-(z||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(z||1)].first_column,last_column:f[f.length-1].last_column},r&&(C._$.range=[f[f.length-(z||1)].range[0],f[f.length-1].range[1]]),void 0!==(x=this.performAction.apply(C,[i,k,j,o,w[1],e,f].concat(m))))return x;z&&(c=c.slice(0,-1*z*2),e=e.slice(0,-1*z),f=f.slice(0,-1*z)),c.push(this.productions_[w[1]][0]),e.push(C.$),f.push(C._$),A=h[c[c.length-2]][c[c.length-1]],c.push(A);break;case 3:return!0}}return!0},"parse")};function l(){this.yy={}}return k.lexer={EOF:1,parseError:(0,g.K2)(function(a,b){if(this.yy.parser)this.yy.parser.parseError(a,b);else throw Error(a)},"parseError"),setInput:(0,g.K2)(function(a,b){return this.yy=b||this.yy||{},this._input=a,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:(0,g.K2)(function(){var a=this._input[0];return this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a,a.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},"input"),unput:(0,g.K2)(function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b),this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this.yyleng=this.yytext.length,this},"unput"),more:(0,g.K2)(function(){return this._more=!0,this},"more"),reject:(0,g.K2)(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:(0,g.K2)(function(a){this.unput(this.match.slice(a))},"less"),pastInput:(0,g.K2)(function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:(0,g.K2)(function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:(0,g.K2)(function(){var a=this.pastInput(),b=Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},"showPosition"),test_match:(0,g.K2)(function(a,b){var c,d,e;if(this.options.backtrack_lexer&&(e={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(e.yylloc.range=this.yylloc.range.slice(0))),(d=a[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(a[0].length),this.matched+=a[0],c=this.performAction.call(this,this.yy,this,b,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c)return c;if(this._backtrack)for(var f in e)this[f]=e[f];return!1},"test_match"),next:(0,g.K2)(function(){if(this.done)return this.EOF;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var a,b,c,d,e=this._currentRules(),f=0;f<e.length;f++)if((c=this._input.match(this.rules[e[f]]))&&(!b||c[0].length>b[0].length)){if(b=c,d=f,this.options.backtrack_lexer){if(!1!==(a=this.test_match(c,e[f])))return a;if(!this._backtrack)return!1;b=!1;continue}if(!this.options.flex)break}return b?!1!==(a=this.test_match(b,e[d]))&&a:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:(0,g.K2)(function(){var a=this.next();return a||this.lex()},"lex"),begin:(0,g.K2)(function(a){this.conditionStack.push(a)},"begin"),popState:(0,g.K2)(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,g.K2)(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:(0,g.K2)(function(a){return(a=this.conditionStack.length-1-Math.abs(a||0))>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:(0,g.K2)(function(a){this.begin(a)},"pushState"),stateStackSize:(0,g.K2)(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:(0,g.K2)(function(a,b,c,d){switch(c){case 0:case 1:case 3:case 4:break;case 2:return 13;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}},(0,g.K2)(l,"Parser"),l.prototype=k,k.Parser=l,new l}();l.parser=l;var m={};(0,g.VA)(m,{addEvent:()=>B,addSection:()=>x,addTask:()=>A,addTaskOrg:()=>C,clear:()=>u,default:()=>E,getCommonDb:()=>t,getDirection:()=>w,getSections:()=>y,getTasks:()=>z,setDirection:()=>v});var n="",o=0,p="LR",q=[],r=[],s=[],t=(0,g.K2)(()=>f.Wt,"getCommonDb"),u=(0,g.K2)(function(){q.length=0,r.length=0,n="",s.length=0,p="LR",(0,f.IU)()},"clear"),v=(0,g.K2)(function(a){p=a},"setDirection"),w=(0,g.K2)(function(){return p},"getDirection"),x=(0,g.K2)(function(a){n=a,q.push(a)},"addSection"),y=(0,g.K2)(function(){return q},"getSections"),z=(0,g.K2)(function(){let a=D(),b=0;for(;!a&&b<100;)a=D(),b++;return r.push(...s),r},"getTasks"),A=(0,g.K2)(function(a,b,c){let d={id:o++,section:n,type:n,task:a,score:b||0,events:c?[c]:[]};s.push(d)},"addTask"),B=(0,g.K2)(function(a){s.find(a=>a.id===o-1).events.push(a)},"addEvent"),C=(0,g.K2)(function(a){let b={section:n,type:n,description:a,task:a,classes:[]};r.push(b)},"addTaskOrg"),D=(0,g.K2)(function(){let a=(0,g.K2)(function(a){return s[a].processed},"compileTask"),b=!0;for(let[c,d]of s.entries())a(c),b=b&&d.processed;return b},"compileTasks"),E={clear:u,getCommonDb:t,getDirection:w,setDirection:v,addSection:x,getSections:y,getTasks:z,addTask:A,addTaskOrg:C,addEvent:B},F=0,G=(0,g.K2)(function(a,b){let c=a.append("rect");return c.attr("x",b.x),c.attr("y",b.y),c.attr("fill",b.fill),c.attr("stroke",b.stroke),c.attr("width",b.width),c.attr("height",b.height),c.attr("rx",b.rx),c.attr("ry",b.ry),void 0!==b.class&&c.attr("class",b.class),c},"drawRect"),H=(0,g.K2)(function(a,b){let c=a.append("circle").attr("cx",b.cx).attr("cy",b.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),d=a.append("g");function e(a){let c=(0,h.JLW)().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(15/2.2);a.append("path").attr("class","mouth").attr("d",c).attr("transform","translate("+b.cx+","+(b.cy+2)+")")}function f(a){let c=(0,h.JLW)().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(15/2.2);a.append("path").attr("class","mouth").attr("d",c).attr("transform","translate("+b.cx+","+(b.cy+7)+")")}function i(a){a.append("line").attr("class","mouth").attr("stroke",2).attr("x1",b.cx-5).attr("y1",b.cy+7).attr("x2",b.cx+5).attr("y2",b.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return d.append("circle").attr("cx",b.cx-5).attr("cy",b.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),d.append("circle").attr("cx",b.cx+5).attr("cy",b.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),(0,g.K2)(e,"smile"),(0,g.K2)(f,"sad"),(0,g.K2)(i,"ambivalent"),b.score>3?e(d):b.score<3?f(d):i(d),c},"drawFace"),I=(0,g.K2)(function(a,b){let c=b.text.replace(/<br\s*\/?>/gi," "),d=a.append("text");d.attr("x",b.x),d.attr("y",b.y),d.attr("class","legend"),d.style("text-anchor",b.anchor),void 0!==b.class&&d.attr("class",b.class);let e=d.append("tspan");return e.attr("x",b.x+2*b.textMargin),e.text(c),d},"drawText"),J=-1,K=(0,g.K2)(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),L=function(){function a(a,b,c,e,f,g,h,i){d(b.append("text").attr("x",c+f/2).attr("y",e+g/2+5).style("font-color",i).style("text-anchor","middle").text(a),h)}function b(a,b,c,e,f,g,h,i,j){let{taskFontSize:k,taskFontFamily:l}=i,m=a.split(/<br\s*\/?>/gi);for(let a=0;a<m.length;a++){let i=a*k-k*(m.length-1)/2,n=b.append("text").attr("x",c+f/2).attr("y",e).attr("fill",j).style("text-anchor","middle").style("font-size",k).style("font-family",l);n.append("tspan").attr("x",c+f/2).attr("dy",i).text(m[a]),n.attr("y",e+g/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),d(n,h)}}function c(a,c,e,f,g,h,i,j){let k=c.append("switch"),l=k.append("foreignObject").attr("x",e).attr("y",f).attr("width",g).attr("height",h).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");l.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(a),b(a,k,e,f,g,h,i,j),d(l,i)}function d(a,b){for(let c in b)c in b&&a.attr(c,b[c])}return(0,g.K2)(a,"byText"),(0,g.K2)(b,"byTspan"),(0,g.K2)(c,"byFo"),(0,g.K2)(d,"_setTextAttrs"),function(d){return"fo"===d.textPlacement?c:"old"===d.textPlacement?a:b}}(),M=(0,g.K2)(function(a,b){F=0,J=-1,a.append("defs").append("marker").attr("id",b+"-arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics");function N(a,b){a.each(function(){var a,c=(0,h.Ltv)(this),d=c.text().split(/(\s+|<br>)/).reverse(),e=[],f=c.attr("y"),g=parseFloat(c.attr("dy")),i=c.text(null).append("tspan").attr("x",0).attr("y",f).attr("dy",g+"em");for(let g=0;g<d.length;g++)a=d[d.length-1-g],e.push(a),i.text(e.join(" ").trim()),(i.node().getComputedTextLength()>b||"<br>"===a)&&(e.pop(),i.text(e.join(" ").trim()),e="<br>"===a?[""]:[a],i=c.append("tspan").attr("x",0).attr("y",f).attr("dy","1.1em").text(a))})}(0,g.K2)(N,"wrap");var O=(0,g.K2)(function(a,b,c,d,e,f=!1){let{theme:g,look:i}=d,j=g?.includes("redux"),k=c%(d?.themeVariables?.THEME_COLOR_LIMIT??12)-1,l=a.append("g");b.section=k,l.attr("class",(b.class?b.class+" ":"")+"timeline-node section-"+k);let m=l.append("g"),n=l.append("g"),o=n.append("text").text(b.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(N,b.width).node().getBBox(),p=d.fontSize?.replace?d.fontSize.replace("px",""):d.fontSize;if(b.height=o.height+1.1*p*.5+b.padding,b.height=Math.max(b.height,b.maxHeight),b.width=b.width+2*b.padding,n.attr("transform","translate("+b.width/2+", "+b.padding/2+")"),j&&n.attr("transform",`translate(${b.width/2}, ${f?b.padding/2+3:b.padding})`),Q(m,b,k,e,d),"neo"===i&&(l.attr("data-look","neo"),j)){let b=g.includes("dark"),c=a.node()?.ownerSVGElement??a.node(),d=(0,h.Ltv)(c),e=d.attr("id")??"",f=e?`${e}-drop-shadow`:"drop-shadow";if(d.select(`#${f}`).empty()){let a=d.select("defs");(a.empty()?d.append("defs"):a).append("filter").attr("id",f).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",b?"0.2":"0.06").attr("flood-color",b?"#FFFFFF":"#000000")}}return b},"drawNode"),P=(0,g.K2)(function(a,b,c){let d=a.append("g"),e=d.append("text").text(b.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(N,b.width).node().getBBox(),f=c.fontSize?.replace?c.fontSize.replace("px",""):c.fontSize;return d.remove(),e.height+1.1*f*.5+b.padding},"getVirtualNodeHeight"),Q=(0,g.K2)(function(a,b,c,d,e){let{theme:f}=e,g=5*!f?.includes("redux"),h=g>0?`M0 ${b.height-5} v${-b.height+10} q0,-${g},${g},-${g} h${b.width-10} q${g},0,${g},${g} v${b.height-5} H0 Z`:`M0 ${b.height-5} v${-(b.height-5)} h${b.width} v${b.height} H0 Z`;a.append("path").attr("id",d+"-node-"+F++).attr("class","node-bkg node-"+b.type).attr("d",h),f?.includes("redux")||a.append("line").attr("class","node-line-"+c).attr("x1",0).attr("y1",b.height).attr("x2",b.width).attr("y2",b.height)},"defaultBkg"),R=(0,g.K2)(function(a,b,c,d){let e,i=(0,f.D7)(),{look:j,theme:k,themeVariables:l}=i,{useGradient:m,gradientStart:n,gradientStop:o}=l,p=i.timeline?.leftMargin??50;g.Rm.debug("timeline",d.db);let q=i.securityLevel;"sandbox"===q&&(e=(0,h.Ltv)("#i"+b));let r=("sandbox"===q?(0,h.Ltv)(e.nodes()[0].contentDocument.body):(0,h.Ltv)("body")).select("#"+b);r.append("g");let s=d.db.getTasks(),t=d.db.getCommonDb().getDiagramTitle();g.Rm.debug("task",s),M(r,b);let u=d.db.getSections();g.Rm.debug("sections",u);let v=0,w=0,x=0,y=0,z=50+p,A=50;y=50;let B=0,C=!0;u.forEach(function(a){let b=P(r,{number:B,descr:a,section:B,width:150,padding:20,maxHeight:v},i);g.Rm.debug("sectionHeight before draw",b),v=Math.max(v,b+20)});let D=0,E=0;for(let[a,b]of(g.Rm.debug("tasks.length",s.length),s.entries())){let c=P(r,{number:a,descr:b,section:b.section,width:150,padding:20,maxHeight:w},i);g.Rm.debug("taskHeight before draw",c),w=Math.max(w,c+20),D=Math.max(D,b.events.length);let d=0;for(let a of b.events)d+=P(r,{descr:a,section:b.section,number:b.section,width:150,padding:20,maxHeight:50},i);b.events.length>0&&(d+=(b.events.length-1)*10),E=Math.max(E,d)}g.Rm.debug("maxSectionHeight before draw",v),g.Rm.debug("maxTaskHeight before draw",w),u&&u.length>0?u.forEach(a=>{let c=s.filter(b=>b.section===a),d={number:B,descr:a,section:B,width:200*Math.max(c.length,1)-50,padding:20,maxHeight:v};g.Rm.debug("sectionNode",d);let e=r.append("g"),f=O(e,d,B,i,b);g.Rm.debug("sectionNode output",f),e.attr("transform",`translate(${z}, ${y})`),A+=v+50,c.length>0&&S(r,c,B,z,A,w,i,D,E,v,!1,b),z+=200*Math.max(c.length,1),A=y,B++}):(C=!1,S(r,s,B,z,A,w,i,D,E,v,!0,b));let F=r.node().getBBox();if(g.Rm.debug("bounds",F),t&&r.append("text").text(t).attr("x","neo"===j?2*F.x+p:F.width/2-p).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),x=C?v+w+150:w+100,r.append("g").attr("class","lineWrapper").append("line").attr("x1",p).attr("y1",x).attr("x2",F.width+3*p).attr("y2",x).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${b}-arrowhead)`),"neo"===j&&m&&"neutral"!==k){let a=r.select("defs"),b=(a.empty()?r.append("defs"):a).append("linearGradient").attr("id",r.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");b.append("stop").attr("offset","0%").attr("stop-color",n).attr("stop-opacity",1),b.append("stop").attr("offset","100%").attr("stop-color",o).attr("stop-opacity",1)}(0,f.ot)(void 0,r,i.timeline?.padding??50,i.timeline?.useMaxWidth??!1)},"draw"),S=(0,g.K2)(function(a,b,c,d,e,f,h,i,j,k,l,m){for(let i of b){let b={descr:i.task,section:c,number:c,width:150,padding:20,maxHeight:f};g.Rm.debug("taskNode",b);let k=a.append("g").attr("class","taskWrapper"),n=O(k,b,c,h,m).height;if(g.Rm.debug("taskHeight after draw",n),k.attr("transform",`translate(${d}, ${e})`),f=Math.max(f,n),i.events){let b=a.append("g").attr("class","lineWrapper");e+=100,T(a,i.events,c,d,e,h,m),e-=100,b.append("line").attr("x1",d+95).attr("y1",e+f).attr("x2",d+95).attr("y2",e+f+100+j+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${m}-arrowhead)`).attr("stroke-dasharray","5,5")}d+=200,l&&!h.timeline?.disableMulticolor&&c++}},"drawTasks"),T=(0,g.K2)(function(a,b,c,d,e,f,h){let i=0,j=e;for(let j of(e+=100,b)){let b={descr:j,section:c,number:c,width:150,padding:20,maxHeight:50};g.Rm.debug("eventNode",b);let k=a.append("g").attr("class","eventWrapper"),l=O(k,b,c,f,h,!0).height;i+=l,k.attr("transform",`translate(${d}, ${e})`),e=e+10+l}return e=j,i},"drawEvents"),U={setConf:(0,g.K2)(()=>{},"setConf"),draw:R},V=(0,g.K2)(function(a,b,c,h){let i=(0,f.D7)(),j=i.timeline?.leftMargin??50;g.Rm.debug("timeline",h.db);let k=(0,d.D)(b);k.append("g");let l=h.db.getTasks(),m=h.db.getCommonDb().getDiagramTitle();g.Rm.debug("task",l),M(k);let n=h.db.getSections();g.Rm.debug("sections",n);let o=0,p=0,q=50,r=230,s=0,t=n&&n.length>0,u=50+j+r,v=Math.max(50,r+360-10);n.forEach(function(a){let b=P(k,{number:s,descr:a,section:s,width:v,padding:5,maxHeight:o},i);g.Rm.debug("sectionHeight before draw",b),o=Math.max(o,b)});let w=0;for(let[a,b]of(g.Rm.debug("tasks.length",l.length),l.entries())){let c=P(k,{number:a,descr:b,section:b.section,width:200,padding:5,maxHeight:p},i);g.Rm.debug("taskHeight before draw",c),p=Math.max(p,c);let d=0;for(let a of b.events)d+=P(k,{descr:a,section:b.section,number:b.section,width:300,padding:5,maxHeight:50},i);b.events.length>0&&(d+=(b.events.length-1)*10),w=Math.max(w,d)+0}g.Rm.debug("maxSectionHeight before draw",o),g.Rm.debug("maxTaskHeight before draw",p);let x=Math.max(p,w)+30;t?n.forEach(a=>{let b=l.filter(b=>b.section===a),c={number:s,descr:a,section:s,width:v,padding:5,maxHeight:o};g.Rm.debug("sectionNode",c);let d=k.append("g"),e=O(d,c,s,i);g.Rm.debug("sectionNode output",e);let f=u-r;d.attr("transform",`translate(${f}, ${q})`);let h=q+e.height+20;b.length>0&&W(k,b,s,u,h,p,i,x,!1);let j=b.length,m=e.height+20+x*Math.max(j,1)-60*(j>0);q+=m,s++}):W(k,l,s,u,q,p,i,x,!0);let y=k.node()?.getBBox();if(!y)throw Error("bbox not found");if(g.Rm.debug("bounds",y),m){if(k.append("text").text(m).attr("x",y.width/2-j).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),!(y=k.node()?.getBBox()))throw Error("bbox not found");g.Rm.debug("bounds after title",y)}let[z]=(0,e.I5)(i.fontSize),A=k.append("g").attr("class","lineWrapper");A.append("line").attr("x1",u).attr("y1",50-(z??16)*2).attr("x2",u).attr("y2",y.y+y.height+((z??16)*.5+20)).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),A.lower(),(0,f.ot)(void 0,k,i.timeline?.padding??50,i.timeline?.useMaxWidth??!1)},"draw"),W=(0,g.K2)(function(a,b,c,d,e,f,h,i,j){for(let k of b){let b={descr:k.task,section:c,number:c,width:200,padding:5,maxHeight:f};g.Rm.debug("taskNode",b);let l=a.append("g").attr("class","taskWrapper"),m=O(l,b,c,h),n=m.height;g.Rm.debug("taskHeight after draw",n);let o=d-20-m.width;if(l.attr("transform",`translate(${o}, ${e})`),f=Math.max(f,n),k.events&&k.events.length>0){let b=e,f=d+50;X(a,k.events,c,d,f,b,h)}e+=i,j&&!h.timeline?.disableMulticolor&&c++}},"drawTasks"),X=(0,g.K2)(function(a,b,c,d,e,f,h){let i=f;for(let f of b){let b={descr:f,section:c,number:c,width:300,padding:5,maxHeight:0};g.Rm.debug("eventNode",b);let j=a.append("g").attr("class","eventWrapper"),k=O(j,b,c,h).height;j.attr("transform",`translate(${e}, ${i})`);let l=a.append("g").attr("class","lineWrapper"),m=i+k/2;l.append("line").attr("x1",d).attr("y1",m).attr("x2",e).attr("y2",m).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),i=i+k+10}return i-f},"drawEvents"),Y={setConf:(0,g.K2)(()=>{},"setConf"),draw:V},Z=(0,g.K2)(a=>{let{theme:b}=(0,f.zj)(),c=b?.includes("dark"),d=b?.includes("color"),e=a.svgId?.replace(/^#/,"")??"",g=e?`url(#${e}-drop-shadow)`:a.dropShadow??"none",h="";for(let b=0;b<a.THEME_COLOR_LIMIT;b++){let e=`${17-3*b}`,f=d?a.borderColorArray[b]:a.mainBkg,i=d?a.borderColorArray[b]:a.nodeBorder;h+=`
1
+ "use strict";exports.id=8704,exports.ids=[8704],exports.modules={38704:(a,b,c)=>{c.d(b,{diagram:()=>aa});var d=c(25215),e=c(40684),f=c(46629),g=c(21143),h=c(69085),i=c(67821),j=c(61255),k=c(30089),l=function(){var a=(0,g.K2)(function(a,b,c,d){for(c=c||{},d=a.length;d--;c[a[d]]=b);return c},"o"),b=[6,11,13,14,15,17,19,20,23,24],c=[1,12],d=[1,13],e=[1,14],f=[1,15],h=[1,16],i=[1,19],j=[1,20],k={trace:(0,g.K2)(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:(0,g.K2)(function(a,b,c,d,e,f,g){var h=f.length-1;switch(e){case 1:return f[h-1];case 3:d.setDirection("LR");break;case 4:d.setDirection("TD");break;case 5:case 9:case 10:this.$=[];break;case 6:f[h-1].push(f[h]),this.$=f[h-1];break;case 7:case 8:this.$=f[h];break;case 11:d.getCommonDb().setDiagramTitle(f[h].substr(6)),this.$=f[h].substr(6);break;case 12:this.$=f[h].trim(),d.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=f[h].trim(),d.getCommonDb().setAccDescription(this.$);break;case 15:d.addSection(f[h].substr(8)),this.$=f[h].substr(8);break;case 18:d.addTask(f[h],0,""),this.$=f[h];break;case 19:d.addEvent(f[h].substr(2)),this.$=f[h]}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},a(b,[2,5],{5:6}),a(b,[2,2]),a(b,[2,3]),a(b,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:c,15:d,17:e,19:f,20:h,21:17,22:18,23:i,24:j},a(b,[2,10],{1:[2,1]}),a(b,[2,6]),{12:21,14:c,15:d,17:e,19:f,20:h,21:17,22:18,23:i,24:j},a(b,[2,8]),a(b,[2,9]),a(b,[2,11]),{16:[1,22]},{18:[1,23]},a(b,[2,14]),a(b,[2,15]),a(b,[2,16]),a(b,[2,17]),a(b,[2,18]),a(b,[2,19]),a(b,[2,7]),a(b,[2,12]),a(b,[2,13])],defaultActions:{},parseError:(0,g.K2)(function(a,b){if(b.recoverable)this.trace(a);else{var c=Error(a);throw c.hash=b,c}},"parseError"),parse:(0,g.K2)(function(a){var b=this,c=[0],d=[],e=[null],f=[],h=this.table,i="",j=0,k=0,l=0,m=f.slice.call(arguments,1),n=Object.create(this.lexer),o={};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(o[p]=this.yy[p]);n.setInput(a,o),o.lexer=n,o.parser=this,void 0===n.yylloc&&(n.yylloc={});var q=n.yylloc;f.push(q);var r=n.options&&n.options.ranges;function s(){var a;return"number"!=typeof(a=d.pop()||n.lex()||1)&&(a instanceof Array&&(a=(d=a).pop()),a=b.symbols_[a]||a),a}"function"==typeof o.parseError?this.parseError=o.parseError:this.parseError=Object.getPrototypeOf(this).parseError,(0,g.K2)(function(a){c.length=c.length-2*a,e.length=e.length-a,f.length=f.length-a},"popStack"),(0,g.K2)(s,"lex");for(var t,u,v,w,x,y,z,A,B,C={};;){if(v=c[c.length-1],this.defaultActions[v]?w=this.defaultActions[v]:(null==t&&(t=s()),w=h[v]&&h[v][t]),void 0===w||!w.length||!w[0]){var D="";for(y in B=[],h[v])this.terminals_[y]&&y>2&&B.push("'"+this.terminals_[y]+"'");D=n.showPosition?"Parse error on line "+(j+1)+":\n"+n.showPosition()+"\nExpecting "+B.join(", ")+", got '"+(this.terminals_[t]||t)+"'":"Parse error on line "+(j+1)+": Unexpected "+(1==t?"end of input":"'"+(this.terminals_[t]||t)+"'"),this.parseError(D,{text:n.match,token:this.terminals_[t]||t,line:n.yylineno,loc:q,expected:B})}if(w[0]instanceof Array&&w.length>1)throw Error("Parse Error: multiple actions possible at state: "+v+", token: "+t);switch(w[0]){case 1:c.push(t),e.push(n.yytext),f.push(n.yylloc),c.push(w[1]),t=null,u?(t=u,u=null):(k=n.yyleng,i=n.yytext,j=n.yylineno,q=n.yylloc,l>0&&l--);break;case 2:if(z=this.productions_[w[1]][1],C.$=e[e.length-z],C._$={first_line:f[f.length-(z||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(z||1)].first_column,last_column:f[f.length-1].last_column},r&&(C._$.range=[f[f.length-(z||1)].range[0],f[f.length-1].range[1]]),void 0!==(x=this.performAction.apply(C,[i,k,j,o,w[1],e,f].concat(m))))return x;z&&(c=c.slice(0,-1*z*2),e=e.slice(0,-1*z),f=f.slice(0,-1*z)),c.push(this.productions_[w[1]][0]),e.push(C.$),f.push(C._$),A=h[c[c.length-2]][c[c.length-1]],c.push(A);break;case 3:return!0}}return!0},"parse")};function l(){this.yy={}}return k.lexer={EOF:1,parseError:(0,g.K2)(function(a,b){if(this.yy.parser)this.yy.parser.parseError(a,b);else throw Error(a)},"parseError"),setInput:(0,g.K2)(function(a,b){return this.yy=b||this.yy||{},this._input=a,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:(0,g.K2)(function(){var a=this._input[0];return this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a,a.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},"input"),unput:(0,g.K2)(function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b),this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this.yyleng=this.yytext.length,this},"unput"),more:(0,g.K2)(function(){return this._more=!0,this},"more"),reject:(0,g.K2)(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:(0,g.K2)(function(a){this.unput(this.match.slice(a))},"less"),pastInput:(0,g.K2)(function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:(0,g.K2)(function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:(0,g.K2)(function(){var a=this.pastInput(),b=Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},"showPosition"),test_match:(0,g.K2)(function(a,b){var c,d,e;if(this.options.backtrack_lexer&&(e={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(e.yylloc.range=this.yylloc.range.slice(0))),(d=a[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(a[0].length),this.matched+=a[0],c=this.performAction.call(this,this.yy,this,b,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c)return c;if(this._backtrack)for(var f in e)this[f]=e[f];return!1},"test_match"),next:(0,g.K2)(function(){if(this.done)return this.EOF;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var a,b,c,d,e=this._currentRules(),f=0;f<e.length;f++)if((c=this._input.match(this.rules[e[f]]))&&(!b||c[0].length>b[0].length)){if(b=c,d=f,this.options.backtrack_lexer){if(!1!==(a=this.test_match(c,e[f])))return a;if(!this._backtrack)return!1;b=!1;continue}if(!this.options.flex)break}return b?!1!==(a=this.test_match(b,e[d]))&&a:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:(0,g.K2)(function(){var a=this.next();return a||this.lex()},"lex"),begin:(0,g.K2)(function(a){this.conditionStack.push(a)},"begin"),popState:(0,g.K2)(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,g.K2)(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:(0,g.K2)(function(a){return(a=this.conditionStack.length-1-Math.abs(a||0))>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:(0,g.K2)(function(a){this.begin(a)},"pushState"),stateStackSize:(0,g.K2)(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:(0,g.K2)(function(a,b,c,d){switch(c){case 0:case 1:case 3:case 4:break;case 2:return 13;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}},(0,g.K2)(l,"Parser"),l.prototype=k,k.Parser=l,new l}();l.parser=l;var m={};(0,g.VA)(m,{addEvent:()=>B,addSection:()=>x,addTask:()=>A,addTaskOrg:()=>C,clear:()=>u,default:()=>E,getCommonDb:()=>t,getDirection:()=>w,getSections:()=>y,getTasks:()=>z,setDirection:()=>v});var n="",o=0,p="LR",q=[],r=[],s=[],t=(0,g.K2)(()=>f.Wt,"getCommonDb"),u=(0,g.K2)(function(){q.length=0,r.length=0,n="",s.length=0,p="LR",(0,f.IU)()},"clear"),v=(0,g.K2)(function(a){p=a},"setDirection"),w=(0,g.K2)(function(){return p},"getDirection"),x=(0,g.K2)(function(a){n=a,q.push(a)},"addSection"),y=(0,g.K2)(function(){return q},"getSections"),z=(0,g.K2)(function(){let a=D(),b=0;for(;!a&&b<100;)a=D(),b++;return r.push(...s),r},"getTasks"),A=(0,g.K2)(function(a,b,c){let d={id:o++,section:n,type:n,task:a,score:b||0,events:c?[c]:[]};s.push(d)},"addTask"),B=(0,g.K2)(function(a){s.find(a=>a.id===o-1).events.push(a)},"addEvent"),C=(0,g.K2)(function(a){let b={section:n,type:n,description:a,task:a,classes:[]};r.push(b)},"addTaskOrg"),D=(0,g.K2)(function(){let a=(0,g.K2)(function(a){return s[a].processed},"compileTask"),b=!0;for(let[c,d]of s.entries())a(c),b=b&&d.processed;return b},"compileTasks"),E={clear:u,getCommonDb:t,getDirection:w,setDirection:v,addSection:x,getSections:y,getTasks:z,addTask:A,addTaskOrg:C,addEvent:B},F=0,G=(0,g.K2)(function(a,b){let c=a.append("rect");return c.attr("x",b.x),c.attr("y",b.y),c.attr("fill",b.fill),c.attr("stroke",b.stroke),c.attr("width",b.width),c.attr("height",b.height),c.attr("rx",b.rx),c.attr("ry",b.ry),void 0!==b.class&&c.attr("class",b.class),c},"drawRect"),H=(0,g.K2)(function(a,b){let c=a.append("circle").attr("cx",b.cx).attr("cy",b.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),d=a.append("g");function e(a){let c=(0,h.JLW)().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(15/2.2);a.append("path").attr("class","mouth").attr("d",c).attr("transform","translate("+b.cx+","+(b.cy+2)+")")}function f(a){let c=(0,h.JLW)().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(15/2.2);a.append("path").attr("class","mouth").attr("d",c).attr("transform","translate("+b.cx+","+(b.cy+7)+")")}function i(a){a.append("line").attr("class","mouth").attr("stroke",2).attr("x1",b.cx-5).attr("y1",b.cy+7).attr("x2",b.cx+5).attr("y2",b.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return d.append("circle").attr("cx",b.cx-5).attr("cy",b.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),d.append("circle").attr("cx",b.cx+5).attr("cy",b.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),(0,g.K2)(e,"smile"),(0,g.K2)(f,"sad"),(0,g.K2)(i,"ambivalent"),b.score>3?e(d):b.score<3?f(d):i(d),c},"drawFace"),I=(0,g.K2)(function(a,b){let c=b.text.replace(/<br\s*\/?>/gi," "),d=a.append("text");d.attr("x",b.x),d.attr("y",b.y),d.attr("class","legend"),d.style("text-anchor",b.anchor),void 0!==b.class&&d.attr("class",b.class);let e=d.append("tspan");return e.attr("x",b.x+2*b.textMargin),e.text(c),d},"drawText"),J=-1,K=(0,g.K2)(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),L=function(){function a(a,b,c,e,f,g,h,i){d(b.append("text").attr("x",c+f/2).attr("y",e+g/2+5).style("font-color",i).style("text-anchor","middle").text(a),h)}function b(a,b,c,e,f,g,h,i,j){let{taskFontSize:k,taskFontFamily:l}=i,m=a.split(/<br\s*\/?>/gi);for(let a=0;a<m.length;a++){let i=a*k-k*(m.length-1)/2,n=b.append("text").attr("x",c+f/2).attr("y",e).attr("fill",j).style("text-anchor","middle").style("font-size",k).style("font-family",l);n.append("tspan").attr("x",c+f/2).attr("dy",i).text(m[a]),n.attr("y",e+g/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),d(n,h)}}function c(a,c,e,f,g,h,i,j){let k=c.append("switch"),l=k.append("foreignObject").attr("x",e).attr("y",f).attr("width",g).attr("height",h).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");l.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(a),b(a,k,e,f,g,h,i,j),d(l,i)}function d(a,b){for(let c in b)c in b&&a.attr(c,b[c])}return(0,g.K2)(a,"byText"),(0,g.K2)(b,"byTspan"),(0,g.K2)(c,"byFo"),(0,g.K2)(d,"_setTextAttrs"),function(d){return"fo"===d.textPlacement?c:"old"===d.textPlacement?a:b}}(),M=(0,g.K2)(function(a,b){F=0,J=-1,a.append("defs").append("marker").attr("id",b+"-arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics");function N(a,b){a.each(function(){var a,c=(0,h.Ltv)(this),d=c.text().split(/(\s+|<br>)/).reverse(),e=[],f=c.attr("y"),g=parseFloat(c.attr("dy")),i=c.text(null).append("tspan").attr("x",0).attr("y",f).attr("dy",g+"em");for(let g=0;g<d.length;g++)a=d[d.length-1-g],e.push(a),i.text(e.join(" ").trim()),(i.node().getComputedTextLength()>b||"<br>"===a)&&(e.pop(),i.text(e.join(" ").trim()),e="<br>"===a?[""]:[a],i=c.append("tspan").attr("x",0).attr("y",f).attr("dy","1.1em").text(a))})}(0,g.K2)(N,"wrap");var O=(0,g.K2)(function(a,b,c,d,e,f=!1){let{theme:g,look:i}=d,j=g?.includes("redux"),k=c%(d?.themeVariables?.THEME_COLOR_LIMIT??12)-1,l=a.append("g");b.section=k,l.attr("class",(b.class?b.class+" ":"")+"timeline-node section-"+k);let m=l.append("g"),n=l.append("g"),o=n.append("text").text(b.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(N,b.width).node().getBBox(),p=d.fontSize?.replace?d.fontSize.replace("px",""):d.fontSize;if(b.height=o.height+1.1*p*.5+b.padding,b.height=Math.max(b.height,b.maxHeight),b.width=b.width+2*b.padding,n.attr("transform","translate("+b.width/2+", "+b.padding/2+")"),j&&n.attr("transform",`translate(${b.width/2}, ${f?b.padding/2+3:b.padding})`),Q(m,b,k,e,d),"neo"===i&&(l.attr("data-look","neo"),j)){let b=g.includes("dark"),c=a.node()?.ownerSVGElement??a.node(),d=(0,h.Ltv)(c),e=d.attr("id")??"",f=e?`${e}-drop-shadow`:"drop-shadow";if(d.select(`#${f}`).empty()){let a=d.select("defs");(a.empty()?d.append("defs"):a).append("filter").attr("id",f).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",b?"0.2":"0.06").attr("flood-color",b?"#FFFFFF":"#000000")}}return b},"drawNode"),P=(0,g.K2)(function(a,b,c){let d=a.append("g"),e=d.append("text").text(b.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(N,b.width).node().getBBox(),f=c.fontSize?.replace?c.fontSize.replace("px",""):c.fontSize;return d.remove(),e.height+1.1*f*.5+b.padding},"getVirtualNodeHeight"),Q=(0,g.K2)(function(a,b,c,d,e){let{theme:f}=e,g=5*!f?.includes("redux"),h=g>0?`M0 ${b.height-5} v${-b.height+10} q0,-${g},${g},-${g} h${b.width-10} q${g},0,${g},${g} v${b.height-5} H0 Z`:`M0 ${b.height-5} v${-(b.height-5)} h${b.width} v${b.height} H0 Z`;a.append("path").attr("id",d+"-node-"+F++).attr("class","node-bkg node-"+b.type).attr("d",h),f?.includes("redux")||a.append("line").attr("class","node-line-"+c).attr("x1",0).attr("y1",b.height).attr("x2",b.width).attr("y2",b.height)},"defaultBkg"),R=(0,g.K2)(function(a,b,c,d){let e,i=(0,f.D7)(),{look:j,theme:k,themeVariables:l}=i,{useGradient:m,gradientStart:n,gradientStop:o}=l,p=i.timeline?.leftMargin??50;g.Rm.debug("timeline",d.db);let q=i.securityLevel;"sandbox"===q&&(e=(0,h.Ltv)("#i"+b));let r=("sandbox"===q?(0,h.Ltv)(e.nodes()[0].contentDocument.body):(0,h.Ltv)("body")).select("#"+b);r.append("g");let s=d.db.getTasks(),t=d.db.getCommonDb().getDiagramTitle();g.Rm.debug("task",s),M(r,b);let u=d.db.getSections();g.Rm.debug("sections",u);let v=0,w=0,x=0,y=0,z=50+p,A=50;y=50;let B=0,C=!0;u.forEach(function(a){let b=P(r,{number:B,descr:a,section:B,width:150,padding:20,maxHeight:v},i);g.Rm.debug("sectionHeight before draw",b),v=Math.max(v,b+20)});let D=0,E=0;for(let[a,b]of(g.Rm.debug("tasks.length",s.length),s.entries())){let c=P(r,{number:a,descr:b,section:b.section,width:150,padding:20,maxHeight:w},i);g.Rm.debug("taskHeight before draw",c),w=Math.max(w,c+20),D=Math.max(D,b.events.length);let d=0;for(let a of b.events)d+=P(r,{descr:a,section:b.section,number:b.section,width:150,padding:20,maxHeight:50},i);b.events.length>0&&(d+=(b.events.length-1)*10),E=Math.max(E,d)}g.Rm.debug("maxSectionHeight before draw",v),g.Rm.debug("maxTaskHeight before draw",w),u&&u.length>0?u.forEach(a=>{let c=s.filter(b=>b.section===a),d={number:B,descr:a,section:B,width:200*Math.max(c.length,1)-50,padding:20,maxHeight:v};g.Rm.debug("sectionNode",d);let e=r.append("g"),f=O(e,d,B,i,b);g.Rm.debug("sectionNode output",f),e.attr("transform",`translate(${z}, ${y})`),A+=v+50,c.length>0&&S(r,c,B,z,A,w,i,D,E,v,!1,b),z+=200*Math.max(c.length,1),A=y,B++}):(C=!1,S(r,s,B,z,A,w,i,D,E,v,!0,b));let F=r.node().getBBox();if(g.Rm.debug("bounds",F),t&&r.append("text").text(t).attr("x","neo"===j?2*F.x+p:F.width/2-p).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),x=C?v+w+150:w+100,r.append("g").attr("class","lineWrapper").append("line").attr("x1",p).attr("y1",x).attr("x2",F.width+3*p).attr("y2",x).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${b}-arrowhead)`),"neo"===j&&m&&"neutral"!==k){let a=r.select("defs"),b=(a.empty()?r.append("defs"):a).append("linearGradient").attr("id",r.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");b.append("stop").attr("offset","0%").attr("stop-color",n).attr("stop-opacity",1),b.append("stop").attr("offset","100%").attr("stop-color",o).attr("stop-opacity",1)}(0,f.ot)(void 0,r,i.timeline?.padding??50,i.timeline?.useMaxWidth??!1)},"draw"),S=(0,g.K2)(function(a,b,c,d,e,f,h,i,j,k,l,m){for(let i of b){let b={descr:i.task,section:c,number:c,width:150,padding:20,maxHeight:f};g.Rm.debug("taskNode",b);let k=a.append("g").attr("class","taskWrapper"),n=O(k,b,c,h,m).height;if(g.Rm.debug("taskHeight after draw",n),k.attr("transform",`translate(${d}, ${e})`),f=Math.max(f,n),i.events){let b=a.append("g").attr("class","lineWrapper");e+=100,T(a,i.events,c,d,e,h,m),e-=100,b.append("line").attr("x1",d+95).attr("y1",e+f).attr("x2",d+95).attr("y2",e+f+100+j+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${m}-arrowhead)`).attr("stroke-dasharray","5,5")}d+=200,l&&!h.timeline?.disableMulticolor&&c++}},"drawTasks"),T=(0,g.K2)(function(a,b,c,d,e,f,h){let i=0,j=e;for(let j of(e+=100,b)){let b={descr:j,section:c,number:c,width:150,padding:20,maxHeight:50};g.Rm.debug("eventNode",b);let k=a.append("g").attr("class","eventWrapper"),l=O(k,b,c,f,h,!0).height;i+=l,k.attr("transform",`translate(${d}, ${e})`),e=e+10+l}return e=j,i},"drawEvents"),U={setConf:(0,g.K2)(()=>{},"setConf"),draw:R},V=(0,g.K2)(function(a,b,c,h){let i=(0,f.D7)(),j=i.timeline?.leftMargin??50;g.Rm.debug("timeline",h.db);let k=(0,d.D)(b);k.append("g");let l=h.db.getTasks(),m=h.db.getCommonDb().getDiagramTitle();g.Rm.debug("task",l),M(k);let n=h.db.getSections();g.Rm.debug("sections",n);let o=0,p=0,q=50,r=230,s=0,t=n&&n.length>0,u=50+j+r,v=Math.max(50,r+360-10);n.forEach(function(a){let b=P(k,{number:s,descr:a,section:s,width:v,padding:5,maxHeight:o},i);g.Rm.debug("sectionHeight before draw",b),o=Math.max(o,b)});let w=0;for(let[a,b]of(g.Rm.debug("tasks.length",l.length),l.entries())){let c=P(k,{number:a,descr:b,section:b.section,width:200,padding:5,maxHeight:p},i);g.Rm.debug("taskHeight before draw",c),p=Math.max(p,c);let d=0;for(let a of b.events)d+=P(k,{descr:a,section:b.section,number:b.section,width:300,padding:5,maxHeight:50},i);b.events.length>0&&(d+=(b.events.length-1)*10),w=Math.max(w,d)+0}g.Rm.debug("maxSectionHeight before draw",o),g.Rm.debug("maxTaskHeight before draw",p);let x=Math.max(p,w)+30;t?n.forEach(a=>{let b=l.filter(b=>b.section===a),c={number:s,descr:a,section:s,width:v,padding:5,maxHeight:o};g.Rm.debug("sectionNode",c);let d=k.append("g"),e=O(d,c,s,i);g.Rm.debug("sectionNode output",e);let f=u-r;d.attr("transform",`translate(${f}, ${q})`);let h=q+e.height+20;b.length>0&&W(k,b,s,u,h,p,i,x,!1);let j=b.length,m=e.height+20+x*Math.max(j,1)-60*(j>0);q+=m,s++}):W(k,l,s,u,q,p,i,x,!0);let y=k.node()?.getBBox();if(!y)throw Error("bbox not found");if(g.Rm.debug("bounds",y),m){if(k.append("text").text(m).attr("x",y.width/2-j).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),!(y=k.node()?.getBBox()))throw Error("bbox not found");g.Rm.debug("bounds after title",y)}let[z]=(0,e.I5)(i.fontSize),A=k.append("g").attr("class","lineWrapper");A.append("line").attr("x1",u).attr("y1",50-(z??16)*2).attr("x2",u).attr("y2",y.y+y.height+((z??16)*.5+20)).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),A.lower(),(0,f.ot)(void 0,k,i.timeline?.padding??50,i.timeline?.useMaxWidth??!1)},"draw"),W=(0,g.K2)(function(a,b,c,d,e,f,h,i,j){for(let k of b){let b={descr:k.task,section:c,number:c,width:200,padding:5,maxHeight:f};g.Rm.debug("taskNode",b);let l=a.append("g").attr("class","taskWrapper"),m=O(l,b,c,h),n=m.height;g.Rm.debug("taskHeight after draw",n);let o=d-20-m.width;if(l.attr("transform",`translate(${o}, ${e})`),f=Math.max(f,n),k.events&&k.events.length>0){let b=e,f=d+50;X(a,k.events,c,d,f,b,h)}e+=i,j&&!h.timeline?.disableMulticolor&&c++}},"drawTasks"),X=(0,g.K2)(function(a,b,c,d,e,f,h){let i=f;for(let f of b){let b={descr:f,section:c,number:c,width:300,padding:5,maxHeight:0};g.Rm.debug("eventNode",b);let j=a.append("g").attr("class","eventWrapper"),k=O(j,b,c,h).height;j.attr("transform",`translate(${e}, ${i})`);let l=a.append("g").attr("class","lineWrapper"),m=i+k/2;l.append("line").attr("x1",d).attr("y1",m).attr("x2",e).attr("y2",m).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),i=i+k+10}return i-f},"drawEvents"),Y={setConf:(0,g.K2)(()=>{},"setConf"),draw:V},Z=(0,g.K2)(a=>{let{theme:b}=(0,f.zj)(),c=b?.includes("dark"),d=b?.includes("color"),e=a.svgId?.replace(/^#/,"")??"",g=e?`url(#${e}-drop-shadow)`:a.dropShadow??"none",h="";for(let b=0;b<a.THEME_COLOR_LIMIT;b++){let e=`${17-3*b}`,f=d?a.borderColorArray[b]:a.mainBkg,i=d?a.borderColorArray[b]:a.nodeBorder;h+=`
2
2
  .section-${b-1} rect,
3
3
  .section-${b-1} path,
4
4
  .section-${b-1} circle {