1import{f as V,p as Lt}from"./flowDb-956e92f1-DTU9BkpK.js";import{h as S,f as tt,G as _t}from"./graph-Cx_IdfQW.js";import{d as x,l as R,c as G,K as Et,L as Y,M as z,r as et,I as rt,j as at}from"./index-DtCYZlc-.js";import{u as Tt,r as Nt,p as At,l as It,d as D}from"./layout-DWBFPJjk.js";import{b as N,c as nt,i as st,d as E,e as it,g as ot,f as Ct,a as Bt,s as Dt}from"./styles-c10674c1-9WmzaY1E.js";import{e as Mt,B as U}from"./index-_TeFN8de.js";import"./percentages-BXMCSKIN-CHDtmz9J.js";import"./index-3862675e-CooF0vi8.js";import"./clone-SfYA772Q.js";import"./edges-e0da2a9e-_kmAshGj.js";import"./createText-2e5e7dd3-C4bw6RIB.js";import"./channel-SkuVvQNA.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};r.SENTRY_RELEASE={id:"42e1da5d71a6b0e6537f761e683a2bb6ee07c48a"};var t=new r.Error().stack;t&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[t]="536cd59a-991c-4e8c-a455-679013273566",r._sentryDebugIdIdentifier="sentry-dbid-536cd59a-991c-4e8c-a455-679013273566")}catch{}})();function Rt(r){if(!r.ok)throw new Error(r.status+" "+r.statusText);return r.text()}function Gt(r,t){return fetch(r,t).then(Rt)}function Pt(r){return(t,e)=>Gt(t,e).then(n=>new DOMParser().parseFromString(n,r))}var Ut=Pt("image/svg+xml"),H={normal:Wt,vee:Vt,undirected:zt};function $t(r){H=r}function Wt(r,t,e,n){var a=r.append("marker").attr("id",t).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),s=a.append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("stroke-width",1).style("stroke-dasharray","1,0");N(s,e[n+"Style"]),e[n+"Class"]&&s.attr("class",e[n+"Class"])}function Vt(r,t,e,n){var a=r.append("marker").attr("id",t).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),s=a.append("path").attr("d","M 0 0 L 10 5 L 0 10 L 4 5 z").style("stroke-width",1).style("stroke-dasharray","1,0");N(s,e[n+"Style"]),e[n+"Class"]&&s.attr("class",e[n+"Class"])}function zt(r,t,e,n){var a=r.append("marker").attr("id",t).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),s=a.append("path").attr("d","M 0 5 L 10 5").style("stroke-width",1).style("stroke-dasharray","1,0");N(s,e[n+"Style"]),e[n+"Class"]&&s.attr("class",e[n+"Class"])}function Yt(r,t){var e=r;return e.node().appendChild(t.label),N(e,t.labelStyle),e}function Ht(r,t){for(var e=r.append("text"),n=Xt(t.label).split(` 2`),a=0;a<n.length;a++)e.append("tspan").attr("xml:space","preserve").attr("dy","1em").attr("x","1").text(n[a]);return N(e,t.labelStyle),e}function Xt(r){for(var t="",e=!1,n,a=0;a<r.length;++a)n=r[a],e?(n==="n"?t+=` 3`:t+=n,e=!1):n==="\\"?e=!0:t+=n;return t}function J(r,t,e){var n=t.label,a=r.append("g");t.labelType==="svg"?Yt(a,t):typeof n!="string"||t.labelType==="html"?nt(a,t):Ht(a,t);var s=a.node().getBBox(),i;switch(e){case"top":i=-t.height/2;break;case"bottom":i=t.height/2-s.height;break;default:i=-s.height/2}return a.attr("transform","translate("+-s.width/2+","+i+")"),a}var X=function(r,t){var e=t.nodes().filter(function(s){return st(t,s)}),n=r.selectAll("g.cluster").data(e,function(s){return s});E(n.exit(),t).style("opacity",0).remove();var a=n.enter().append("g").attr("class","cluster").attr("id",function(s){var i=t.node(s);return i.id}).style("opacity",0).each(function(s){var i=t.node(s),o=x(this);x(this).append("rect");var c=o.append("g").attr("class","label");J(c,i,i.clusterLabelPos)});return n=n.merge(a),n=E(n,t).style("opacity",1),n.selectAll("rect").each(function(s){var i=t.node(s),o=x(this);N(o,i.style)}),n};function Ft(r){X=r}let F=function(r,t){var e=r.selectAll("g.edgeLabel").data(t.edges(),function(a){return it(a)}).classed("update",!0);e.exit().remove(),e.enter().append("g").classed("edgeLabel",!0).style("opacity",0),e=r.selectAll("g.edgeLabel"),e.each(function(a){var s=x(this);s.select(".label").remove();var i=t.edge(a),o=J(s,t.edge(a),0).classed("label",!0),c=o.node().getBBox();i.labelId&&o.attr("id",i.labelId),S(i,"width")||(i.width=c.width),S(i,"height")||(i.height=c.height)});var n;return e.exit?n=e.exit():n=e.selectAll(null),E(n,t).style("opacity",0).remove(),e};function qt(r){F=r}function O(r,t){return r.intersect(t)}var q=function(r,t,e){var n=r.selectAll("g.edgePath").data(t.edges(),function(i){return it(i)}).classed("update",!0),a=Ot(n,t);jt(n,t);var s=n.merge!==void 0?n.merge(a):n;return E(s,t).style("opacity",1),s.each(function(i){var o=x(this),c=t.edge(i);c.elem=this,c.id&&o.attr("id",c.id),ot(o,c.class,(o.classed("update")?"update ":"")+"edgePath")}),s.selectAll("path.path").each(function(i){var o=t.edge(i);o.arrowheadId=Tt("arrowhead");
3var c=x(this).attr("marker-end",function(){return"url("+Qt(location.href,o.arrowheadId)+")"}).style("fill","none");E(c,t).attr("d",function(d){return Jt(t,d)}),N(c,o.style)}),s.selectAll("defs *").remove(),s.selectAll("defs").each(function(i){var o=t.edge(i),c=e[o.arrowhead];c(x(this),o.arrowheadId,o,"arrowhead")}),s};function Kt(r){q=r}function Qt(r,t){var e=r.split("#")[0];return e+"#"+t}function Jt(r,t){var e=r.edge(t),n=r.node(t.v),a=r.node(t.w),s=e.points.slice(1,e.points.length-1);return s.unshift(O(n,s[0])),s.push(O(a,s[s.length-1])),lt(e,s)}function lt(r,t){var e=(Mt||Ut.line)().x(function(n){return n.x}).y(function(n){return n.y});return(e.curve||e.interpolate)(r.curve),e(t)}function Zt(r){var t=r.getBBox(),e=r.ownerSVGElement.getScreenCTM().inverse().multiply(r.getScreenCTM()).translate(t.width/2,t.height/2);return{x:e.e,y:e.f}}function Ot(r,t){var e=r.enter().append("g").attr("class","edgePath").style("opacity",0);return e.append("path").attr("class","path").attr("d",function(n){var a=t.edge(n),s=t.node(n.v).elem,i=Nt(a.points.length).map(function(){return Zt(s)});return lt(a,i)}),e.append("defs"),e}function jt(r,t){var e=r.exit();E(e,t).style("opacity",0).remove()}var K=function(r,t,e){var n=t.nodes().filter(function(i){return!st(t,i)}),a=r.selectAll("g.node").data(n,function(i){return i}).classed("update",!0);a.exit().remove(),a.enter().append("g").attr("class","node").style("opacity",0),a=r.selectAll("g.node"),a.each(function(i){var o=t.node(i),c=x(this);ot(c,o.class,(c.classed("update")?"update ":"")+"node"),c.select("g.label").remove();var d=c.append("g").attr("class","label"),l=J(d,o),g=e[o.shape],h=At(l.node().getBBox(),"width","height");o.elem=this,o.id&&c.attr("id",o.id),o.labelId&&d.attr("id",o.labelId),S(o,"width")&&(h.width=o.width),S(o,"height")&&(h.height=o.height),h.width+=o.paddingLeft+o.paddingRight,h.height+=o.paddingTop+o.paddingBottom,d.attr("transform","translate("+(o.paddingLeft-o.paddingRight)/2+","+(o.paddingTop-o.paddingBottom)/2+")");var u=x(this);u.select(".label-container").remove();var p=g(u,h,o).classed("label-container",!0);N(p,o.style);var y=p.node().getBBox();o.width=y.width,o.height=y.height});var s;return a.exit?s=a.exit():s=a.selectAll(null),E(s,t).style("opacity",0).remove(),a};function te(r){K=r}function ee(r,t){var e=r.filter(function(){return!x(this).classed("update")});function n(a){var s=t.node(a);return"translate("+s.x+","+s.y+")"}e.attr("transform",n),E(r,t).style("opacity",1).attr("transform",n),E(e.selectAll("rect"),t).attr("width",function(a){return t.node(a).width}).attr("height",function(a){return t.node(a).height}).attr("x",function(a){var s=t.node(a);return-s.width/2}).attr("y",function(a){var s=t.node(a);return-s.height/2})}function re(r,t){var e=r.filter(function(){return!x(this).classed("update")});function n(a){var s=t.edge(a);return S(s,"x")?"translate("+s.x+","+s.y+")":""}e.attr("transform",n),E(r,t).style("opacity",1).attr("transform",n)}function ae(r,t){var e=r.filter(function(){return!x(this).classed("update")});function n(a){var s=t.node(a);return"translate("+s.x+","+s.y+")"}e.attr("transform",n),E(r,t).style("opacity",1).attr("transform",n)}function ct(r,t,e,n){var a=r.x,s=r.y,i=a-n.x,o=s-n.y,c=Math.sqrt(t*t*o*o+e*e*i*i),d=Math.abs(t*e*i/c);n.x<a&&(d=-d);var l=Math.abs(t*e*o/c);return n.y<s&&(l=-l),{x:a+d,y:s+l}}function ne(r,t,e){return ct(r,t,t,e)}function se(r,t,e,n){var a,s,i,o,c,d,l,g,h,u,p,y,f,v,k;if(a=t.y-r.y,i=r.x-t.x,c=t.x*r.y-r.x*t.y,h=a*e.x+i*e.y+c,u=a*n.x+i*n.y+c,!(h!==0&&u!==0&&j(h,u))&&(s=n.y-e.y,o=e.x-n.x,d=n.x*e.y-e.x*n.y,l=s*r.x+o*r.y+d,g=s*t.x+o*t.y+d,!(l!==0&&g!==0&&j(l,g))&&(p=a*o-s*i,p!==0)))return y=Math.abs(p/2),f=i*d-o*c,v=f<0?(f-y)/p:(f+y)/p,f=s*c-a*d,k=f<0?(f-y)/p:(f+y)/p,{x:v,y:k}}function j(r,t){return r*t>0}function T(r,t,e){var n=r.x,a=r.y,s=[],i=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;t.forEach(function(p){i=Math.min(i,p.x),o=Math.min(o,p.y)});for(var c=n-r.width/2-i,d=a-r.height/2-o,l=0;l<t.length;l++){var g=t[l],h=t[l<t.length-1?l+1:0],u=se(r,e,{x:c+g.x,y:d+g.y},{x:c+h.x,y:d+h.y});u&&s.push(u)}return s.length?(s.length>1&&s.sort(function(p,y){var f=p.x-e.x,v=p.y-e.y,k=Math.sqrt(f*f+v*v),C=y.x-e.x,_=y.y-e.y,$=Math.sqrt(C*C+_*_);return k<$?-1:k===$?0:1}),s[0]):(console.log("NO INTERSECTION FOUND, RETURN NODE CENTER",r),r)}function Z(r,t){var e=r.x,n=r.y,a=t.x-e,s=t.y-n,i=r.width/2,o=r.height/2,c,d;return Math.abs(s)*i>Math.abs(a)*o?(s<0&&(o=-o),c=s===0?0:o*a/s,d=o):(a<0&&(i=-i),c=i,d=a===0?0:i*s/a),{x:e+c,y:n+d}}var Q={rect:oe,ellipse:le,circle:ce,diamond:de};function ie(r){Q=r}function oe(r,t,e){var n=r.insert("rect",":first-child").attr("rx",e.rx).attr("ry",e.ry).attr("x",-t.width/2).attr("y",-t.height/2).attr("width",t.width).attr("height",t.height);return e.intersect=function(a){return Z(e,a)},n}
3function le(r,t,e){var n=t.width/2,a=t.height/2,s=r.insert("ellipse",":first-child").attr("x",-t.width/2).attr("y",-t.height/2).attr("rx",n).attr("ry",a);return e.intersect=function(i){return ct(e,n,a,i)},s}function ce(r,t,e){var n=Math.max(t.width,t.height)/2,a=r.insert("circle",":first-child").attr("x",-t.width/2).attr("y",-t.height/2).attr("r",n);return e.intersect=function(s){return ne(e,n,s)},a}function de(r,t,e){var n=t.width*Math.SQRT2/2,a=t.height*Math.SQRT2/2,s=[{x:0,y:-a},{x:-n,y:0},{x:0,y:a},{x:n,y:0}],i=r.insert("polygon",":first-child").attr("points",s.map(function(o){return o.x+","+o.y}).join(" "));return e.intersect=function(o){return T(e,s,o)},i}function he(){var r=function(t,e){pe(e);var n=M(t,"output"),a=M(n,"clusters"),s=M(n,"edgePaths"),i=F(M(n,"edgeLabels"),e),o=K(M(n,"nodes"),e,Q);It(e),ae(o,e),re(i,e),q(s,e,H);var c=X(a,e);ee(c,e),ge(e)};return r.createNodes=function(t){return arguments.length?(te(t),r):K},r.createClusters=function(t){return arguments.length?(Ft(t),r):X},r.createEdgeLabels=function(t){return arguments.length?(qt(t),r):F},r.createEdgePaths=function(t){return arguments.length?(Kt(t),r):q},r.shapes=function(t){return arguments.length?(ie(t),r):Q},r.arrows=function(t){return arguments.length?($t(t),r):H},r}var ue={paddingLeft:10,paddingRight:10,paddingTop:10,paddingBottom:10,rx:0,ry:0,shape:"rect"},fe={arrowhead:"normal",curve:U};function pe(r){r.nodes().forEach(function(t){var e=r.node(t);!S(e,"label")&&!r.children(t).length&&(e.label=t),S(e,"paddingX")&&D(e,{paddingLeft:e.paddingX,paddingRight:e.paddingX}),S(e,"paddingY")&&D(e,{paddingTop:e.paddingY,paddingBottom:e.paddingY}),S(e,"padding")&&D(e,{paddingLeft:e.padding,paddingRight:e.padding,paddingTop:e.padding,paddingBottom:e.padding}),D(e,ue),tt(["paddingLeft","paddingRight","paddingTop","paddingBottom"],function(n){e[n]=Number(e[n])}),S(e,"width")&&(e._prevWidth=e.width),S(e,"height")&&(e._prevHeight=e.height)}
3),r.edges().forEach(function(t){var e=r.edge(t);S(e,"label")||(e.label=""),D(e,fe)})}function ge(r){tt(r.nodes(),function(t){var e=r.node(t);S(e,"_prevWidth")?e.width=e._prevWidth:delete e.width,S(e,"_prevHeight")?e.height=e._prevHeight:delete e.height,delete e._prevWidth,delete e._prevHeight})}function M(r,t){var e=r.select("g."+t);return e.empty()&&(e=r.append("g").attr("class",t)),e}function dt(r,t,e){const n=t.width,a=t.height,s=(n+a)*.9,i=[{x:s/2,y:0},{x:s,y:-s/2},{x:s/2,y:-s},{x:0,y:-s/2}],o=A(r,s,s,i);return e.intersect=function(c){return T(e,i,c)},o}function ht(r,t,e){const a=t.height,s=a/4,i=t.width+2*s,o=[{x:s,y:0},{x:i-s,y:0},{x:i,y:-a/2},{x:i-s,y:-a},{x:s,y:-a},{x:0,y:-a/2}],c=A(r,i,a,o);return e.intersect=function(d){return T(e,o,d)},c}function ut(r,t,e){const n=t.width,a=t.height,s=[{x:-a/2,y:0},{x:n,y:0},{x:n,y:-a},{x:-a/2,y:-a},{x:0,y:-a/2}],i=A(r,n,a,s);return e.intersect=function(o){return T(e,s,o)},i}function ft(r,t,e){const n=t.width,a=t.height,s=[{x:-2*a/6,y:0},{x:n-a/6,y:0},{x:n+2*a/6,y:-a},{x:a/6,y:-a}],i=A(r,n,a,s);return e.intersect=function(o){return T(e,s,o)},i}function pt(r,t,e){const n=t.width,a=t.height,s=[{x:2*a/6,y:0},{x:n+a/6,y:0},{x:n-2*a/6,y:-a},{x:-a/6,y:-a}],i=A(r,n,a,s);return e.intersect=function(o){return T(e,s,o)},i}function gt(r,t,e){const n=t.width,a=t.height,s=[{x:-2*a/6,y:0},{x:n+2*a/6,y:0},{x:n-a/6,y:-a},{x:a/6,y:-a}],i=A(r,n,a,s);return e.intersect=function(o){return T(e,s,o)},i}function vt(r,t,e){const n=t.width,a=t.height,s=[{x:a/6,y:0},{x:n-a/6,y:0},{x:n+2*a/6,y:-a},{x:-2*a/6,y:-a}],i=A(r,n,a,s);return e.intersect=function(o){return T(e,s,o)},i}function yt(r,t,e){const n=t.width,a=t.height,s=[{x:0,y:0},{x:n+a/2,y:0},{x:n,y:-a/2},{x:n+a/2,y:-a},{x:0,y:-a}],i=A(r,n,a,s);return e.intersect=function(o){return T(e,s,o)},i}function wt(r,t,e){const n=t.height,a=t.width+n/4,s=r.insert("rect",":first-child").attr("rx",n/2).attr("ry",n/2).attr("x",-a/2).attr("y",-n/2).attr("width",a).attr("height",n);return e.intersect=function(i){return Z(e,i)},s}function mt(r,t,e){const n=t.width,a=t.height,s=[{x:0,y:0},{x:n,y:0},{x:n,y:-a},{x:0,y:-a},{x:0,y:0},{x:-8,y:0},{x:n+8,y:0},{x:n+8,y:-a},{x:-8,y:-a},{x:-8,y:0}],i=A(r,n,a,s);return e.intersect=function(o){return T(e,s,o)},i}function xt(r,t,e){const n=t.width,a=n/2,s=a/(2.5+n/50),i=t.height+s,o="M 0,"+s+" a "+a+","+s+" 0,0,0 "+n+" 0 a "+a+","+s+" 0,0,0 "+-n+" 0 l 0,"+i+" a "+a+","+s+" 0,0,0 "+n+" 0 l 0,"+-i,c=r.attr("label-offset-y",s).insert("path",":first-child").attr("d",o).attr("transform","translate("+-n/2+","+-(i/2+s)+")");return e.intersect=function(d){const l=Z(e,d),g=l.x-e.x;if(a!=0&&(Math.abs(g)<e.width/2||Math.abs(g)==e.width/2&&Math.abs(l.y-e.y)>e.height/2-s)){let h=s*s*(1-g*g/(a*a));h!=0&&(h=Math.sqrt(h)),h=s-h,d.y-e.y>0&&(h=-h),l.y+=h}return l},c}function ve(r){r.shapes().question=dt,r.shapes().hexagon=ht,r.shapes().stadium=wt,r.shapes().subroutine=mt,r.shapes().cylinder=xt,r.shapes().rect_left_inv_arrow=ut,r.shapes().lean_right=ft,r.shapes().lean_left=pt,r.shapes().trapezoid=gt,r.shapes().inv_trapezoid=vt,r.shapes().rect_right_inv_arrow=yt}function ye(r){r({question:dt}),r({hexagon:ht}),r({stadium:wt}),r({subroutine:mt}),r({cylinder:xt}),r({rect_left_inv_arrow:ut}),r({lean_right:ft}),r({lean_left:pt}),r({trapezoid:gt}),r({inv_trapezoid:vt}),r({rect_right_inv_arrow:yt})}function A(r,t,e,n){return r.insert("polygon",":first-child").attr("points",n.map(function(a){return a.x+","+a.y}).join(" ")).attr("transform","translate("+-t/2+","+e/2+")")}const we={addToRender:ve,addToRenderV2:ye},bt={},me=function(r){const t=Object.keys(r);for(const e of t)bt[e]=r[e]},kt=async function(r,t,e,n,a,s){const i=n?n.select(`[id="${e}"]`):x(`[id="${e}"]`),o=a||document,c=Object.keys(r);for(const d of c){const l=r[d];let g="default";l.classes.length>0&&(g=l.classes.join(" "));const h=Y(l.styles);let u=l.text!==void 0?l.text:l.id,p;if(et(G().flowchart.htmlLabels)){const v={label:await rt(u.replace(/fa[blrs]?:fa-[\w-]+/g,k=>`<i class='${k.replace(":"," ")}'></i>`),G())};p=nt(i,v).node(),p.parentNode.removeChild(p)}else{const v=o.createElementNS("http://www.w3.org/2000/svg","text");v.setAttribute("style",h.labelStyle.replace("color:","fill:"));const k=u.split(at.lineBreakRegex);for(const C of k){const _=o.createElementNS("http://www.w3.org/2000/svg","tspan");_.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),_.setAttribute("dy","1em"),_.setAttribute("x","1"),_.textContent=C,v.appendChild(_)}p=v}let y=0,f="";switch(l.type){case"round":y=5,f="rect";break;case"square":f="rect";break;case"diamond":f="question";break;case"hexagon":f="hexagon";break;case"odd":f="rect_left_inv_arrow";break;case"lean_right":f="lean_right";break;case"lean_left":f="lean_left";break;case"trapezoid":f="trapezoid";break;case"inv_trapezoid":f="inv_trapezoid";break;case"odd_right":f="rect_left_inv_arrow";break;case"circle":f="circle";break;case"ellipse":f="ellipse";break;case"stadium":f="stadium";break;
3case"subroutine":f="subroutine";break;case"cylinder":f="cylinder";break;case"group":f="rect";break;default:f="rect"}R.warn("Adding node",l.id,l.domId),t.setNode(s.db.lookUpDomId(l.id),{labelType:"svg",labelStyle:h.labelStyle,shape:f,label:p,rx:y,ry:y,class:g,style:h.style,id:s.db.lookUpDomId(l.id)})}},St=async function(r,t,e){let n=0,a,s;if(r.defaultStyle!==void 0){const i=Y(r.defaultStyle);a=i.style,s=i.labelStyle}for(const i of r){n++;const o="L-"+i.start+"-"+i.end,c="LS-"+i.start,d="LE-"+i.end,l={};i.type==="arrow_open"?l.arrowhead="none":l.arrowhead="normal";let g="",h="";if(i.style!==void 0){const u=Y(i.style);g=u.style,h=u.labelStyle}else switch(i.stroke){case"normal":g="fill:none",a!==void 0&&(g=a),s!==void 0&&(h=s);break;case"dotted":g="fill:none;stroke-width:2px;stroke-dasharray:3;";break;case"thick":g=" stroke-width: 3.5px;fill:none";break}l.style=g,l.labelStyle=h,i.interpolate!==void 0?l.curve=z(i.interpolate,U):r.defaultInterpolate!==void 0?l.curve=z(r.defaultInterpolate,U):l.curve=z(bt.curve,U),i.text===void 0?i.style!==void 0&&(l.arrowheadStyle="fill: #333"):(l.arrowheadStyle="fill: #333",l.labelpos="c",et(G().flowchart.htmlLabels)?(l.labelType="html",l.label=`<span id="L-${o}" class="edgeLabel L-${c}' L-${d}" style="${l.labelStyle}">${await rt(i.text.replace(/fa[blrs]?:fa-[\w-]+/g,u=>`<i class='${u.replace(":"," ")}'></i>`),G())}</span>`):(l.labelType="text",l.label=i.text.replace(at.lineBreakRegex,` 4`),i.style===void 0&&(l.style=l.style||"stroke: #333; stroke-width: 1.5px;fill:none"),l.labelStyle=l.labelStyle.replace("color:","fill:"))),l.id=o,l.class=c+" "+d,l.minlen=i.length||1,t.setEdge(e.db.lookUpDomId(i.start),e.db.lookUpDomId(i.end),l,n)}},xe=function(r,t){return R.info("Extracting classes"),t.db.getClasses()},be=async function(r,t,e,n){R.info("Drawing flowchart");const{securityLevel:a,flowchart:s}=G();let i;a==="sandbox"&&(i=x("#i"+t));const o=a==="sandbox"?x(i.nodes()[0].contentDocument.body):x("body"),c=a==="sandbox"?i.nodes()[0].contentDocument:document;let d=n.db.getDirection();d===void 0&&(d="TD");const l=s.nodeSpacing||50,g=s.rankSpacing||50,h=new _t({multigraph:!0,compound:!0}).setGraph({rankdir:d,nodesep:l,ranksep:g,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});let u;const p=n.db.getSubGraphs();for(let w=p.length-1;w>=0;w--)u=p[w],n.db.addVertex(u.id,u.title,"group",void 0,u.classes);const y=n.db.getVertices();R.warn("Get vertices",y);const f=n.db.getEdges();let v=0;for(v=p.length-1;v>=0;v--){u=p[v],Dt("cluster").append("text");for(let w=0;w<u.nodes.length;w++)R.warn("Setting subgraph",u.nodes[w],n.db.lookUpDomId(u.nodes[w]),n.db.lookUpDomId(u.id)),h.setParent(n.db.lookUpDomId(u.nodes[w]),n.db.lookUpDomId(u.id))}await kt(y,h,t,o,c,n),await St(f,h,n);const k=new he;we.addToRender(k),k.arrows().none=function(b,L,m,B){const I=b.append("marker").attr("id",L).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 0 0 L 0 0 L 0 0 z");N(I,m[B+"Style"])},k.arrows().normal=function(b,L){b.append("marker").attr("id",L).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowheadPath").style("stroke-width",1).style("stroke-dasharray","1,0")};const C=o.select(`[id="${t}"]`),_=o.select("#"+t+" g");for(k(_,h),_.selectAll("g.node").attr("title",function(){return n.db.getTooltip(this.id)}),n.db.indexNodes("subGraph"+v),v=0;v<p.length;v++)if(u=p[v],u.title!=="undefined"){const w=c.querySelectorAll("#"+t+' [id="'+n.db.lookUpDomId(u.id)+'"] rect'),b=c.querySelectorAll("#"+t+' [id="'+n.db.lookUpDomId(u.id)+'"]'),L=w[0].x.baseVal.value,m=w[0].y.baseVal.value,B=w[0].width.baseVal.value,I=x(b[0]).select(".label");I.attr("transform",`translate(${L+B/2}, ${m+14})`),I.attr("id",t+"Text");for(let W=0;W<u.classes.length;W++)b[0].classList.add(u.classes[W])}if(!s.htmlLabels){const w=c.querySelectorAll('[id="'+t+'"] .edgeLabel .label');for(const b of w){const L=b.getBBox(),m=c.createElementNS("http://www.w3.org/2000/svg","rect");m.setAttribute("rx",0),m.setAttribute("ry",0),m.setAttribute("width",L.width),m.setAttribute("height",L.height),b.insertBefore(m,b.firstChild)}}
4Et(h,C,s.diagramPadding,s.useMaxWidth),Object.keys(y).forEach(function(w){const b=y[w];if(b.link){const L=o.select("#"+t+' [id="'+n.db.lookUpDomId(w)+'"]');if(L){const m=c.createElementNS("http://www.w3.org/2000/svg","a");m.setAttributeNS("http://www.w3.org/2000/svg","class",b.classes.join(" ")),m.setAttributeNS("http://www.w3.org/2000/svg","href",b.link),m.setAttributeNS("http://www.w3.org/2000/svg","rel","noopener"),a==="sandbox"?m.setAttributeNS("http://www.w3.org/2000/svg","target","_top"):b.linkTarget&&m.setAttributeNS("http://www.w3.org/2000/svg","target",b.linkTarget);const B=L.insert(function(){return m},":first-child"),P=L.select(".label-container");P&&B.append(function(){return P.node()});const I=L.select(".label");I&&B.append(function(){return I.node()})}}})},ke={setConf:me,addVertices:kt,addEdges:St,getClasses:xe,draw:be},Re={parser:Lt,db:V,renderer:Bt,styles:Ct,init:r=>{r.flowchart||(r.flowchart={}),r.flowchart.arrowMarkerAbsolute=r.arrowMarkerAbsolute,ke.setConf(r.flowchart),V.clear(),V.setGen("gen-1")}};export{Re as diagram};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.