@hpcc-js/graph 3.7.4 → 3.7.5
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.
- package/LICENSE +43 -43
- package/README.md +256 -256
- package/dist/assets/dagre-B-z4SP0u.js.map +1 -1
- package/dist/assets/graphviz-BK7FEJlA.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +7 -7
- package/src/AdjacencyGraph.ts +224 -224
- package/src/Edge.css +22 -22
- package/src/Edge.ts +257 -257
- package/src/Graph.css +18 -18
- package/src/Graph.ts +1077 -1077
- package/src/GraphData.ts +187 -187
- package/src/GraphLayouts.ts +214 -214
- package/src/Sankey.css +44 -44
- package/src/Sankey.ts +304 -304
- package/src/Subgraph.css +9 -9
- package/src/Subgraph.ts +165 -165
- package/src/Vertex.css +2 -2
- package/src/Vertex.ts +282 -282
- package/src/__package__.ts +3 -3
- package/src/__tests__/data.ts +444 -444
- package/src/__tests__/index.ts +1 -1
- package/src/__tests__/test1.ts +18 -18
- package/src/__tests__/test2.ts +80 -80
- package/src/__tests__/test3.ts +46 -46
- package/src/__tests__/test4.ts +66 -66
- package/src/__tests__/test5.ts +85 -85
- package/src/common/graphT.css +38 -38
- package/src/common/graphT.ts +1363 -1363
- package/src/common/index.ts +3 -3
- package/src/common/layouts/circle.ts +37 -37
- package/src/common/layouts/dagre.ts +145 -145
- package/src/common/layouts/dagreWorker.ts +24 -24
- package/src/common/layouts/forceDirected.ts +117 -117
- package/src/common/layouts/forceDirectedWorker.ts +22 -22
- package/src/common/layouts/geoForceDirected.ts +112 -112
- package/src/common/layouts/graphviz.ts +137 -137
- package/src/common/layouts/graphvizWorker.ts +27 -27
- package/src/common/layouts/index.ts +7 -7
- package/src/common/layouts/layout.ts +147 -147
- package/src/common/layouts/null.ts +39 -39
- package/src/common/layouts/placeholders.ts +113 -113
- package/src/common/layouts/tree.ts +326 -326
- package/src/common/layouts/workers/dagre.ts +46 -46
- package/src/common/layouts/workers/dagreOptions.ts +35 -35
- package/src/common/layouts/workers/forceDirected.ts +38 -38
- package/src/common/layouts/workers/forceDirectedOptions.ts +30 -30
- package/src/common/layouts/workers/graphviz.ts +225 -225
- package/src/common/layouts/workers/graphvizOptions.ts +70 -70
- package/src/common/liteMap.ts +72 -72
- package/src/common/liteSVGZooom.ts +61 -61
- package/src/common/sankeyGraph.css +44 -44
- package/src/common/sankeyGraph.ts +345 -345
- package/src/html/annotation.ts +71 -71
- package/src/html/component.ts +18 -18
- package/src/html/edge.ts +15 -15
- package/src/html/graphHtml.ts +11 -11
- package/src/html/graphHtmlT.ts +117 -117
- package/src/html/icon.ts +64 -64
- package/src/html/image.ts +26 -26
- package/src/html/imageChar.ts +18 -18
- package/src/html/index.ts +8 -8
- package/src/html/intersection.ts +110 -110
- package/src/html/shape.ts +141 -141
- package/src/html/text.ts +59 -59
- package/src/html/textBox.ts +45 -45
- package/src/html/vertex.ts +67 -67
- package/src/index.ts +10 -10
- package/src/react/dataGraph.ts +345 -345
- package/src/react/graphReact.ts +177 -177
- package/src/react/graphReactT.ts +44 -44
- package/src/react/index.ts +4 -4
- package/src/react/subgraph.tsx +30 -30
- package/src/react/vertex.tsx +31 -31
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var e,t,r=Object.defineProperty,n=(e,t)=>r(e,"name",{value:t,configurable:!0}),i=(e,t,n)=>((e,t,n)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);import{SVGWidget as o,TextBox as a,Platform as s,map as u,dispatch as c,Text as h,Icon as l,Palette as d,select as f,SVGZoomWidget as p,ToggleButton as _,Spacer as g,Utility as m,d3Event as y,drag as v,SVGGlowFilter as b,PropertyExt as w,sum as x,max as E,min as C,median as k,mean as D,interpolateNumberArray as O}from"@hpcc-js/common";import{hashSum as M,Graph2 as S,compare2 as F}from"@hpcc-js/util";import{IGraph as P,ITooltip as R}from"@hpcc-js/api";import{render as B,Subgraph as N,Vertex as j,Edge as I,Icons as L,Vertex3 as q,CentroidVertex3 as $,React as T,Text as Y}from"@hpcc-js/react";import{HTMLTooltip as H}from"@hpcc-js/html";const G="@hpcc-js/graph",V="3.7.
|
|
1
|
+
var e,t,r=Object.defineProperty,n=(e,t)=>r(e,"name",{value:t,configurable:!0}),i=(e,t,n)=>((e,t,n)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);import{SVGWidget as o,TextBox as a,Platform as s,map as u,dispatch as c,Text as h,Icon as l,Palette as d,select as f,SVGZoomWidget as p,ToggleButton as _,Spacer as g,Utility as m,d3Event as y,drag as v,SVGGlowFilter as b,PropertyExt as w,sum as x,max as E,min as C,median as k,mean as D,interpolateNumberArray as O}from"@hpcc-js/common";import{hashSum as M,Graph2 as S,compare2 as F}from"@hpcc-js/util";import{IGraph as P,ITooltip as R}from"@hpcc-js/api";import{render as B,Subgraph as N,Vertex as j,Edge as I,Icons as L,Vertex3 as q,CentroidVertex3 as $,React as T,Text as Y}from"@hpcc-js/react";import{HTMLTooltip as H}from"@hpcc-js/html";const G="@hpcc-js/graph",V="3.7.5",X="3.21.5";var z=Math.PI,W=2*z,Z=1e-6,U=W-Z;function K(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Q(){return new K}function J(e){/* @__PURE__ */
|
|
2
2
|
return n(function(){return e},"constant")}function A(e){this._context=e}function ee(e){return new A(e)}function te(e){return e[0]}function re(e){return e[1]}function ne(){var e=te,t=re,r=J(!0),i=null,o=ee,a=null;function s(n){var s,u,c,h=n.length,l=!1;for(null==i&&(a=o(c=Q())),s=0;s<=h;++s)!(s<h&&r(u=n[s],s,n))===l&&((l=!l)?a.lineStart():a.lineEnd()),l&&a.point(+e(u,s,n),+t(u,s,n));if(c)return a=null,c+""||null}return n(s,"line"),s.x=function(t){return arguments.length?(e="function"==typeof t?t:J(+t),s):e},s.y=function(e){return arguments.length?(t="function"==typeof e?e:J(+e),s):t},s.defined=function(e){return arguments.length?(r="function"==typeof e?e:J(!!e),s):r},s.curve=function(e){return arguments.length?(o=e,null!=i&&(a=o(i)),s):o},s.context=function(e){return arguments.length?(null==e?i=a=null:a=o(i=e),s):i},s}n(K,"Path"),n(Q,"path"),K.prototype=Q.prototype={constructor:K,moveTo:/* @__PURE__ */n(function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},"moveTo"),closePath:/* @__PURE__ */n(function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},"closePath"),lineTo:/* @__PURE__ */n(function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},"lineTo"),quadraticCurveTo:/* @__PURE__ */n(function(e,t,r,n){this._+="Q"+ +e+","+ +t+","+(this._x1=+r)+","+(this._y1=+n)},"quadraticCurveTo"),bezierCurveTo:/* @__PURE__ */n(function(e,t,r,n,i,o){this._+="C"+ +e+","+ +t+","+ +r+","+ +n+","+(this._x1=+i)+","+(this._y1=+o)},"bezierCurveTo"),arcTo:/* @__PURE__ */n(function(e,t,r,n,i){e=+e,t=+t,r=+r,n=+n,i=+i;var o=this._x1,a=this._y1,s=r-e,u=n-t,c=o-e,h=a-t,l=c*c+h*h;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(l>Z)if(Math.abs(h*s-u*c)>Z&&i){var d=r-o,f=n-a,p=s*s+u*u,_=d*d+f*f,g=Math.sqrt(p),m=Math.sqrt(l),y=i*Math.tan((z-Math.acos((p+l-_)/(2*g*m)))/2),v=y/m,b=y/g;Math.abs(v-1)>Z&&(this._+="L"+(e+v*c)+","+(t+v*h)),this._+="A"+i+","+i+",0,0,"+ +(h*d>c*f)+","+(this._x1=e+b*s)+","+(this._y1=t+b*u)}else this._+="L"+(this._x1=e)+","+(this._y1=t);else;},"arcTo"),arc:/* @__PURE__ */n(function(e,t,r,n,i,o){e=+e,t=+t,o=!!o;var a=(r=+r)*Math.cos(n),s=r*Math.sin(n),u=e+a,c=t+s,h=1^o,l=o?n-i:i-n;if(r<0)throw new Error("negative radius: "+r);null===this._x1?this._+="M"+u+","+c:(Math.abs(this._x1-u)>Z||Math.abs(this._y1-c)>Z)&&(this._+="L"+u+","+c),r&&(l<0&&(l=l%W+W),l>U?this._+="A"+r+","+r+",0,1,"+h+","+(e-a)+","+(t-s)+"A"+r+","+r+",0,1,"+h+","+(this._x1=u)+","+(this._y1=c):l>Z&&(this._+="A"+r+","+r+",0,"+ +(l>=z)+","+h+","+(this._x1=e+r*Math.cos(i))+","+(this._y1=t+r*Math.sin(i))))},"arc"),rect:/* @__PURE__ */n(function(e,t,r,n){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},"rect"),toString:/* @__PURE__ */n(function(){return this._},"toString")},n(J,"constant$2"),n(A,"Linear"),A.prototype={areaStart:/* @__PURE__ */n(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */n(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */n(function(){this._point=0},"lineStart"),lineEnd:/* @__PURE__ */n(function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */n(function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}},"point")},n(ee,"d3CurveLinear"),n(te,"x$2"),n(re,"y$2"),n(ne,"d3Line");var ie=Array.prototype.slice;function oe(e){return e.source}function ae(e){return e.target}function se(e){var t=oe,r=ae,i=te,o=re,a=null;function s(){var n,s=ie.call(arguments),u=t.apply(this,s),c=r.apply(this,s);if(a||(a=n=Q()),e(a,+i.apply(this,(s[0]=u,s)),+o.apply(this,s),+i.apply(this,(s[0]=c,s)),+o.apply(this,s)),n)return a=null,n+""||null}return n(s,"link"),s.source=function(e){return arguments.length?(t=e,s):t},s.target=function(e){return arguments.length?(r=e,s):r},s.x=function(e){return arguments.length?(i="function"==typeof e?e:J(+e),s):i},s.y=function(e){return arguments.length?(o="function"==typeof e?e:J(+e),s):o},s.context=function(e){return arguments.length?(a=null==e?null:e,s):a},s}function ue(e,t,r,n,i){e.moveTo(t,r),e.bezierCurveTo(t=(t+n)/2,r,t,i,n,i)}function ce(){return se(ue)}function he(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function le(e){this._context=e}function de(e){return new le(e)}function fe(e,t,r){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-r),e._x2,e._y2)}function pe(e,t){this._context=e,this._k=(1-t)/6}n(oe,"linkSource"),n(ae,"linkTarget"),n(se,"link"),n(ue,"curveHorizontal"),n(ce,"linkHorizontal$1"),n(he,"point$1"),n(le,"Basis"),le.prototype={areaStart:/* @__PURE__ */n(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */n(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */n(function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */n(function(){switch(this._point){case 3:he(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */n(function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:he(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t},"point")},n(de,"d3CurveBasis"),n(fe,"point"),n(pe,"Cardinal"),pe.prototype={areaStart:/* @__PURE__ */n(function(){this._line=0},"areaStart"),areaEnd:/* @__PURE__ */n(function(){this._line=NaN},"areaEnd"),lineStart:/* @__PURE__ */n(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},"lineStart"),lineEnd:/* @__PURE__ */n(function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:fe(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:/* @__PURE__ */n(function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:fe(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t},"point")};const _e=/* @__PURE__ */n(function e(t){function r(e){return new pe(e,t)}return n(r,"cardinal"),r.tension=function(t){return e(+t)},r},"custom")(0),ge=de,me=class _Edge extends o{_points;_weight;_strokeDasharray;_hidden;_textBox;_sourceVertex;_targetVertex;_elementPath;_graphID;constructor(){super(),this._points=[],this._weight=100,this._strokeDasharray=null,this._hidden=!1,this._textBox=(new a).padding(0)}graphID(e){return arguments.length?(this._graphID=e,this):this._graphID}sourceVertex(e){return arguments.length?(this._sourceVertex=e,this):this._sourceVertex}targetVertex(e){return arguments.length?(this._targetVertex=e,this):this._targetVertex}weight(e){return arguments.length?(this._weight=e,this):this._weight}points(e,t,r){return arguments.length?(this._points=e,this._elementPath&&this.update(null,this._element,t,r),this):this._points}hidden(e){return arguments.length?(this._hidden=e,this):this._hidden}text(e){return arguments.length?(this._textBox.text(e),this):this._textBox.text()}enter(e,t){super.enter(e,t),this._elementPath=t.append("path"),this._textBox.text()&&this._textBox.target(e).tooltip(this.tooltip()).render()}update(e,t,r,n){super.update(e,t);const i=this;s.svgMarkerGlitch&&!n&&t.transition().duration((r||0)+100).on("start",function(){i._pushMarkers(t)}).on("end",function(){i._popMarkers(t)});const o=i._calculateEdgePoints(this._sourceVertex,this._targetVertex,this._points),a=t.selectAll(".point2").data(this.showControlPoints()?o:[]);a.enter().append("circle").attr("class","point2").style("stroke","red").merge(a).attr("cx",e=>e.x).attr("cy",e=>e.y).attr("r",1),a.exit().remove();const u=ne().x(function(e){return e.x}).y(function(e){return e.y}).curve(ge)(o);let c=this._elementPath;r&&(c=c.transition().duration(r)),c.attr("opacity",this._hidden?0:1).attr("marker-start",s.svgMarkerGlitch&&n||!this.sourceMarker_exists()?null:"url(#"+this._graphID+"_"+this.sourceMarker()+"Foot)").attr("marker-end",s.svgMarkerGlitch&&n||!this.targetMarker_exists()?null:"url(#"+this._graphID+"_"+this.targetMarker()+"Head)").attr("stroke",this.strokeColor_exists()?this.strokeColor():null).attr("stroke-dasharray",this.strokeDasharray_exists()?this.strokeDasharray():null).attr("d",u),this._textBox.text()&&this._textBox.tooltip(this.tooltip()).move(this._findMidPoint(o),r)}exit(e,t){this._textBox&&this._textBox.target(null),super.exit(e,t)}_findMidPoint(e){const t=e.length/2;if(e.length%2)return e[Math.floor(t)];if(e.length){const r=e[t-1],n=e[t];return{x:(r.x+n.x)/2,y:(r.y+n.y)/2}}return{x:0,y:0}}_calculateEdgePoints(e,t,r){if(!e||!t)return[{x:0,y:0},{x:0,y:0}];let n=r?r.filter(r=>!e.contains(r)&&!t.contains(r)):[];const i=0===n.length?t.pos():n[0],o=0===n.length?e.pos():n[n.length-1];if(n.unshift(e.intersection(e._pos,i)),n.push(t.intersection(t._pos,o)),n[0]||(n[0]=e._pos),n[n.length-1]||(n[n.length-1]=t._pos),(!r||0===r.length)&&2===n.length&&n[0]&&n[1]){const e=n[0].x-n[1].x,t=n[0].y-n[1].y;if(Math.sqrt(e*e+t*t))if(this.showArc()){const r=(n[0].x+n[1].x)/2-t*this.arcDepth()/100,i=(n[0].y+n[1].y)/2+e*this.arcDepth()/100;n=[{x:n[0].x,y:n[0].y},{x:r,y:i},{x:n[1].x,y:n[1].y}]}else n=[{x:n[0].x,y:n[0].y},{x:n[1].x,y:n[1].y}]}return n}};n(me,"Edge");let ye=me;ye.prototype._class+=" graph_Edge",ye.prototype.publish("arcDepth",16,"number","Arc Depth",null,{tags:["Basic"]}),ye.prototype.publish("showControlPoints",!1,"boolean","Show/Hide Control Points",null,{tags:["Basic"]}),ye.prototype.publish("showArc",!0,"boolean","Show/Hide Arc",null,{tags:["Basic"]}),ye.prototype.publish("tooltip","","string","Tooltip",null,{tags:["Private"]}),ye.prototype.publish("sourceMarker","circle","set","Source Marker",["none","circle"],{optional:!0}),ye.prototype.publish("targetMarker","arrow","set","Source Marker",["none","arrow","circle"],{optional:!0}),ye.prototype.publish("strokeDasharray",null,"string","Stroke Dash Array",null,{optional:!0}),ye.prototype.publish("strokeColor",null,"html-color","Stroke Color",null,{optional:!0}),ye.prototype.publish("textColor",null,"html-color","Text Color",null,{optional:!0}),ye.prototype.publishProxy("text_shape_colorFill","_textBox","shape_colorFill"),ye.prototype.publishProxy("text_shape_colorStroke","_textBox","shape_colorStroke"),ye.prototype.publishProxy("text_text_colorFill","_textBox","text_colorFill");var ve,be,we,xe,Ee,Ce,ke,De,Oe,Me,Se,Fe,Pe,Re,Be,Ne,je,Ie,Le,qe,$e,Te,Ye,He,Ge,Ve,Xe,ze,We,Ze,Ue,Ke,Qe,Je,Ae,et,tt,rt,nt,it,ot,at,st,ut,ct,ht,lt,dt,ft,pt,_t,gt,mt,yt,vt,bt,wt,xt,Et,Ct,kt,Dt,Ot,Mt,St,Ft,Pt,Rt,Bt,Nt,jt,It,Lt,qt,$t,Tt,Yt,Ht,Gt,Vt,Xt,zt,Wt,Zt,Ut,Kt,Qt,Jt,At,er,tr,rr,nr,ir,or,ar,sr,ur,cr,hr,lr,dr,fr,pr,_r,gr,mr,yr,vr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function br(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}function wr(){if(be)return ve;function e(){this.__data__=[],this.size=0}return be=1,n(e,"listCacheClear"),ve=e}function xr(){if(xe)return we;function e(e,t){return e===t||e!=e&&t!=t}return xe=1,n(e,"eq"),we=e}function Er(){if(Ce)return Ee;Ce=1;var e=xr();function t(t,r){for(var n=t.length;n--;)if(e(t[n][0],r))return n;return-1}return n(t,"assocIndexOf"),Ee=t}function Cr(){if(De)return ke;De=1;var e=Er(),t=Array.prototype.splice;function r(r){var n=this.__data__,i=e(n,r);return!(i<0)&&(i==n.length-1?n.pop():t.call(n,i,1),--this.size,!0)}return n(r,"listCacheDelete"),ke=r}function kr(){if(Me)return Oe;Me=1;var e=Er();function t(t){var r=this.__data__,n=e(r,t);return n<0?void 0:r[n][1]}return n(t,"listCacheGet"),Oe=t}function Dr(){if(Fe)return Se;Fe=1;var e=Er();function t(t){return e(this.__data__,t)>-1}return n(t,"listCacheHas"),Se=t}function Or(){if(Re)return Pe;Re=1;var e=Er();function t(t,r){var n=this.__data__,i=e(n,t);return i<0?(++this.size,n.push([t,r])):n[i][1]=r,this}return n(t,"listCacheSet"),Pe=t}function Mr(){if(Ne)return Be;Ne=1;var e=wr(),t=Cr(),r=kr(),i=Dr(),o=Or();function a(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}return n(a,"ListCache"),a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=i,a.prototype.set=o,Be=a}function Sr(){if(Ie)return je;Ie=1;var e=Mr();function t(){this.__data__=new e,this.size=0}return n(t,"stackClear"),je=t}function Fr(){if(qe)return Le;function e(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}return qe=1,n(e,"stackDelete"),Le=e}function Pr(){if(Te)return $e;function e(e){return this.__data__.get(e)}return Te=1,n(e,"stackGet"),$e=e}function Rr(){if(He)return Ye;function e(e){return this.__data__.has(e)}return He=1,n(e,"stackHas"),Ye=e}function Br(){if(Ve)return Ge;Ve=1;var e="object"==typeof vr&&vr&&vr.Object===Object&&vr;return Ge=e}function Nr(){if(ze)return Xe;ze=1;var e=Br(),t="object"==typeof self&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return Xe=r}function jr(){if(Ze)return We;Ze=1;var e=Nr().Symbol;return We=e}function Ir(){if(Ke)return Ue;Ke=1;var e=jr(),t=Object.prototype,r=t.hasOwnProperty,i=t.toString,o=e?e.toStringTag:void 0;function a(e){var t=r.call(e,o),n=e[o];try{e[o]=void 0;var a=!0}catch(u){}var s=i.call(e);return a&&(t?e[o]=n:delete e[o]),s}return n(a,"getRawTag"),Ue=a}function Lr(){if(Je)return Qe;Je=1;var e=Object.prototype.toString;function t(t){return e.call(t)}return n(t,"objectToString"),Qe=t}function qr(){if(et)return Ae;et=1;var e=jr(),t=Ir(),r=Lr(),i=e?e.toStringTag:void 0;function o(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?t(e):r(e)}return n(o,"baseGetTag"),Ae=o}function $r(){if(rt)return tt;function e(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}return rt=1,n(e,"isObject"),tt=e}function Tr(){if(it)return nt;it=1;var e=qr(),t=$r();function r(r){if(!t(r))return!1;var n=e(r);return"[object Function]"==n||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n}return n(r,"isFunction"),nt=r}function Yr(){if(at)return ot;at=1;var e=Nr()["__core-js_shared__"];return ot=e}function Hr(){if(ut)return st;ut=1;var e,t=Yr(),r=(e=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||""))?"Symbol(src)_1."+e:"";function i(e){return!!r&&r in e}return n(i,"isMasked"),st=i}function Gr(){if(ht)return ct;ht=1;var e=Function.prototype.toString;function t(t){if(null!=t){try{return e.call(t)}catch(r){}try{return t+""}catch(r){}}return""}return n(t,"toSource"),ct=t}function Vr(){if(dt)return lt;dt=1;var e=Tr(),t=Hr(),r=$r(),i=Gr(),o=/^\[object .+?Constructor\]$/,a=Function.prototype,s=Object.prototype,u=a.toString,c=s.hasOwnProperty,h=RegExp("^"+u.call(c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function l(n){return!(!r(n)||t(n))&&(e(n)?h:o).test(i(n))}return n(l,"baseIsNative"),lt=l}function Xr(){if(pt)return ft;function e(e,t){return null==e?void 0:e[t]}return pt=1,n(e,"getValue"),ft=e}function zr(){if(gt)return _t;gt=1;var e=Vr(),t=Xr();function r(r,n){var i=t(r,n);return e(i)?i:void 0}return n(r,"getNative"),_t=r}function Wr(){if(yt)return mt;yt=1;var e=zr()(Nr(),"Map");return mt=e}function Zr(){if(bt)return vt;bt=1;var e=zr()(Object,"create");return vt=e}function Ur(){if(xt)return wt;xt=1;var e=Zr();function t(){this.__data__=e?e(null):{},this.size=0}return n(t,"hashClear"),wt=t}function Kr(){if(Ct)return Et;function e(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return Ct=1,n(e,"hashDelete"),Et=e}function Qr(){if(Dt)return kt;Dt=1;var e=Zr(),t=Object.prototype.hasOwnProperty;function r(r){var n=this.__data__;if(e){var i=n[r];return"__lodash_hash_undefined__"===i?void 0:i}return t.call(n,r)?n[r]:void 0}return n(r,"hashGet"),kt=r}function Jr(){if(Mt)return Ot;Mt=1;var e=Zr(),t=Object.prototype.hasOwnProperty;function r(r){var n=this.__data__;return e?void 0!==n[r]:t.call(n,r)}return n(r,"hashHas"),Ot=r}function Ar(){if(Ft)return St;Ft=1;var e=Zr();function t(t,r){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=e&&void 0===r?"__lodash_hash_undefined__":r,this}return n(t,"hashSet"),St=t}function en(){if(Rt)return Pt;Rt=1;var e=Ur(),t=Kr(),r=Qr(),i=Jr(),o=Ar();function a(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}return n(a,"Hash"),a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=i,a.prototype.set=o,Pt=a}function tn(){if(Nt)return Bt;Nt=1;var e=en(),t=Mr(),r=Wr();function i(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}return n(i,"mapCacheClear"),Bt=i}function rn(){if(It)return jt;function e(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}return It=1,n(e,"isKeyable"),jt=e}function nn(){if(qt)return Lt;qt=1;var e=rn();function t(t,r){var n=t.__data__;return e(r)?n["string"==typeof r?"string":"hash"]:n.map}return n(t,"getMapData"),Lt=t}function on(){if(Tt)return $t;Tt=1;var e=nn();function t(t){var r=e(this,t).delete(t);return this.size-=r?1:0,r}return n(t,"mapCacheDelete"),$t=t}function an(){if(Ht)return Yt;Ht=1;var e=nn();function t(t){return e(this,t).get(t)}return n(t,"mapCacheGet"),Yt=t}function sn(){if(Vt)return Gt;Vt=1;var e=nn();function t(t){return e(this,t).has(t)}return n(t,"mapCacheHas"),Gt=t}function un(){if(zt)return Xt;zt=1;var e=nn();function t(t,r){var n=e(this,t),i=n.size;return n.set(t,r),this.size+=n.size==i?0:1,this}return n(t,"mapCacheSet"),Xt=t}function cn(){if(Zt)return Wt;Zt=1;var e=tn(),t=on(),r=an(),i=sn(),o=un();function a(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}return n(a,"MapCache"),a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=i,a.prototype.set=o,Wt=a}function hn(){if(Kt)return Ut;Kt=1;var e=Mr(),t=Wr(),r=cn();function i(n,i){var o=this.__data__;if(o instanceof e){var a=o.__data__;if(!t||a.length<199)return a.push([n,i]),this.size=++o.size,this;o=this.__data__=new r(a)}return o.set(n,i),this.size=o.size,this}return n(i,"stackSet"),Ut=i}function ln(){if(Jt)return Qt;Jt=1;var e=Mr(),t=Sr(),r=Fr(),i=Pr(),o=Rr(),a=hn();function s(t){var r=this.__data__=new e(t);this.size=r.size}return n(s,"Stack"),s.prototype.clear=t,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=o,s.prototype.set=a,Qt=s}function dn(){if(er)return At;function e(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}return er=1,n(e,"arrayEach"),At=e}function fn(){if(rr)return tr;rr=1;var e=zr(),t=function(){try{var t=e(Object,"defineProperty");return t({},"",{}),t}catch(r){}}();return tr=t}function pn(){if(ir)return nr;ir=1;var e=fn();function t(t,r,n){"__proto__"==r&&e?e(t,r,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[r]=n}return n(t,"baseAssignValue"),nr=t}function _n(){if(ar)return or;ar=1;var e=pn(),t=xr(),r=Object.prototype.hasOwnProperty;function i(n,i,o){var a=n[i];r.call(n,i)&&t(a,o)&&(void 0!==o||i in n)||e(n,i,o)}return n(i,"assignValue"),or=i}function gn(){if(ur)return sr;ur=1;var e=_n(),t=pn();function r(r,n,i,o){var a=!i;i||(i={});for(var s=-1,u=n.length;++s<u;){var c=n[s],h=o?o(i[c],r[c],c,i,r):void 0;void 0===h&&(h=r[c]),a?t(i,c,h):e(i,c,h)}return i}return n(r,"copyObject"),sr=r}function mn(){if(hr)return cr;function e(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}return hr=1,n(e,"baseTimes"),cr=e}function yn(){if(dr)return lr;function e(e){return null!=e&&"object"==typeof e}return dr=1,n(e,"isObjectLike"),lr=e}function vn(){if(pr)return fr;pr=1;var e=qr(),t=yn();function r(r){return t(r)&&"[object Arguments]"==e(r)}return n(r,"baseIsArguments"),fr=r}function bn(){if(gr)return _r;gr=1;var e=vn(),t=yn(),r=Object.prototype,n=r.hasOwnProperty,i=r.propertyIsEnumerable,o=e(/* @__PURE__ */function(){return arguments}())?e:function(e){return t(e)&&n.call(e,"callee")&&!i.call(e,"callee")};return _r=o}function wn(){if(yr)return mr;yr=1;var e=Array.isArray;return mr=e}n(br,"commonjsRequire"),n(wr,"require_listCacheClear"),n(xr,"requireEq"),n(Er,"require_assocIndexOf"),n(Cr,"require_listCacheDelete"),n(kr,"require_listCacheGet"),n(Dr,"require_listCacheHas"),n(Or,"require_listCacheSet"),n(Mr,"require_ListCache"),n(Sr,"require_stackClear"),n(Fr,"require_stackDelete"),n(Pr,"require_stackGet"),n(Rr,"require_stackHas"),n(Br,"require_freeGlobal"),n(Nr,"require_root"),n(jr,"require_Symbol"),n(Ir,"require_getRawTag"),n(Lr,"require_objectToString"),n(qr,"require_baseGetTag"),n($r,"requireIsObject"),n(Tr,"requireIsFunction"),n(Yr,"require_coreJsData"),n(Hr,"require_isMasked"),n(Gr,"require_toSource"),n(Vr,"require_baseIsNative"),n(Xr,"require_getValue"),n(zr,"require_getNative"),n(Wr,"require_Map"),n(Zr,"require_nativeCreate"),n(Ur,"require_hashClear"),n(Kr,"require_hashDelete"),n(Qr,"require_hashGet"),n(Jr,"require_hashHas"),n(Ar,"require_hashSet"),n(en,"require_Hash"),n(tn,"require_mapCacheClear"),n(rn,"require_isKeyable"),n(nn,"require_getMapData"),n(on,"require_mapCacheDelete"),n(an,"require_mapCacheGet"),n(sn,"require_mapCacheHas"),n(un,"require_mapCacheSet"),n(cn,"require_MapCache"),n(hn,"require_stackSet"),n(ln,"require_Stack"),n(dn,"require_arrayEach"),n(fn,"require_defineProperty"),n(pn,"require_baseAssignValue"),n(_n,"require_assignValue"),n(gn,"require_copyObject"),n(mn,"require_baseTimes"),n(yn,"requireIsObjectLike"),n(vn,"require_baseIsArguments"),n(bn,"requireIsArguments"),n(wn,"requireIsArray");var xn,En,Cn,kn,Dn,On,Mn,Sn,Fn,Pn,Rn,Bn={exports:{}};function Nn(){if(En)return xn;function e(){return!1}return En=1,n(e,"stubFalse"),xn=e}function jn(){return Cn||(Cn=1,e=Bn,t=Bn.exports,r=Nr(),n=Nn(),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i?r.Buffer:void 0,s=(a?a.isBuffer:void 0)||n,e.exports=s),Bn.exports;var e,t,r,n,i,o,a,s}function In(){if(Dn)return kn;Dn=1;var e=/^(?:0|[1-9]\d*)$/;function t(t,r){var n=typeof t;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&e.test(t))&&t>-1&&t%1==0&&t<r}return n(t,"isIndex"),kn=t}function Ln(){if(Mn)return On;Mn=1;function e(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}return n(e,"isLength"),On=e}function qn(){if(Fn)return Sn;Fn=1;var e=qr(),t=Ln(),r=yn(),i={};function o(n){return r(n)&&t(n.length)&&!!i[e(n)]}return i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1,n(o,"baseIsTypedArray"),Sn=o}function $n(){if(Rn)return Pn;function e(e){return function(t){return e(t)}}return Rn=1,n(e,"baseUnary"),Pn=e}n(Nn,"requireStubFalse"),n(jn,"requireIsBuffer"),n(In,"require_isIndex"),n(Ln,"requireIsLength"),n(qn,"require_baseIsTypedArray"),n($n,"require_baseUnary");var Tn,Yn,Hn,Gn,Vn,Xn,zn,Wn,Zn,Un,Kn,Qn,Jn,An,ei,ti,ri,ni,ii,oi,ai,si,ui,ci,hi,li,di,fi={exports:{}};function pi(){return Tn||(Tn=1,e=fi,t=fi.exports,r=Br(),n=t&&!t.nodeType&&t,i=n&&e&&!e.nodeType&&e,o=i&&i.exports===n&&r.process,a=function(){try{var e=i&&i.require&&i.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(t){}}(),e.exports=a),fi.exports;var e,t,r,n,i,o,a}function _i(){if(Hn)return Yn;Hn=1;var e=qn(),t=$n(),r=pi(),n=r&&r.isTypedArray,i=n?t(n):e;return Yn=i}function gi(){if(Vn)return Gn;Vn=1;var e=mn(),t=bn(),r=wn(),i=jn(),o=In(),a=_i(),s=Object.prototype.hasOwnProperty;function u(n,u){var c=r(n),h=!c&&t(n),l=!c&&!h&&i(n),d=!c&&!h&&!l&&a(n),f=c||h||l||d,p=f?e(n.length,String):[],_=p.length;for(var g in n)!u&&!s.call(n,g)||f&&("length"==g||l&&("offset"==g||"parent"==g)||d&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||o(g,_))||p.push(g);return p}return n(u,"arrayLikeKeys"),Gn=u}function mi(){if(zn)return Xn;zn=1;var e=Object.prototype;function t(t){var r=t&&t.constructor;return t===("function"==typeof r&&r.prototype||e)}return n(t,"isPrototype"),Xn=t}function yi(){if(Zn)return Wn;function e(e,t){return function(r){return e(t(r))}}return Zn=1,n(e,"overArg"),Wn=e}function vi(){if(Kn)return Un;Kn=1;var e=yi()(Object.keys,Object);return Un=e}function bi(){if(Jn)return Qn;Jn=1;var e=mi(),t=vi(),r=Object.prototype.hasOwnProperty;function i(n){if(!e(n))return t(n);var i=[];for(var o in Object(n))r.call(n,o)&&"constructor"!=o&&i.push(o);return i}return n(i,"baseKeys"),Qn=i}function wi(){if(ei)return An;ei=1;var e=Tr(),t=Ln();function r(r){return null!=r&&t(r.length)&&!e(r)}return n(r,"isArrayLike"),An=r}function xi(){if(ri)return ti;ri=1;var e=gi(),t=bi(),r=wi();function i(n){return r(n)?e(n):t(n)}return n(i,"keys"),ti=i}function Ei(){if(ii)return ni;ii=1;var e=gn(),t=xi();function r(r,n){return r&&e(n,t(n),r)}return n(r,"baseAssign"),ni=r}function Ci(){if(ai)return oi;function e(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}return ai=1,n(e,"nativeKeysIn"),oi=e}function ki(){if(ui)return si;ui=1;var e=$r(),t=mi(),r=Ci(),i=Object.prototype.hasOwnProperty;function o(n){if(!e(n))return r(n);var o=t(n),a=[];for(var s in n)("constructor"!=s||!o&&i.call(n,s))&&a.push(s);return a}return n(o,"baseKeysIn"),si=o}function Di(){if(hi)return ci;hi=1;var e=gi(),t=ki(),r=wi();function i(n){return r(n)?e(n,!0):t(n)}return n(i,"keysIn"),ci=i}function Oi(){if(di)return li;di=1;var e=gn(),t=Di();function r(r,n){return r&&e(n,t(n),r)}return n(r,"baseAssignIn"),li=r}n(pi,"require_nodeUtil"),n(_i,"requireIsTypedArray"),n(gi,"require_arrayLikeKeys"),n(mi,"require_isPrototype"),n(yi,"require_overArg"),n(vi,"require_nativeKeys"),n(bi,"require_baseKeys"),n(wi,"requireIsArrayLike"),n(xi,"requireKeys"),n(Ei,"require_baseAssign"),n(Ci,"require_nativeKeysIn"),n(ki,"require_baseKeysIn"),n(Di,"requireKeysIn"),n(Oi,"require_baseAssignIn");var Mi,Si,Fi,Pi,Ri,Bi,Ni,ji,Ii,Li,qi,$i,Ti,Yi,Hi,Gi,Vi,Xi,zi,Wi,Zi,Ui,Ki,Qi,Ji,Ai,eo,to,ro,no,io,oo,ao,so,uo,co,ho,lo,fo,po,_o,go,mo,yo,vo,bo,wo,xo,Eo,Co,ko,Do,Oo,Mo,So,Fo,Po,Ro,Bo,No,jo,Io,Lo,qo,$o,To,Yo,Ho,Go,Vo,Xo,zo,Wo,Zo,Uo,Ko,Qo,Jo,Ao,ea,ta,ra,na,ia,oa,aa,sa,ua,ca,ha,la,da,fa,pa,_a,ga,ma,ya,va,ba,wa,xa,Ea,Ca,ka,Da,Oa,Ma,Sa,Fa,Pa,Ra,Ba,Na,ja,Ia,La,qa,$a,Ta,Ya,Ha,Ga,Va,Xa,za,Wa,Za,Ua,Ka,Qa,Ja,Aa,es,ts,rs,ns,is,os,as,ss,us,cs,hs,ls,ds,fs,ps,_s,gs,ms,ys,vs,bs,ws,xs,Es,Cs,ks,Ds,Os,Ms,Ss,Fs,Ps,Rs,Bs,Ns,js,Is,Ls,qs,$s,Ts,Ys,Hs,Gs,Vs,Xs,zs,Ws,Zs,Us,Ks,Qs,Js,As,eu,tu,ru,nu,iu,ou,au,su,uu,cu,hu,lu,du,fu,pu,_u,gu,mu,yu,vu,bu,wu,xu,Eu,Cu,ku,Du,Ou,Mu,Su,Fu,Pu,Ru,Bu,Nu,ju,Iu,Lu,qu,$u,Tu,Yu,Hu,Gu,Vu,Xu,zu,Wu,Zu,Uu,Ku,Qu,Ju,Au,ec,tc,rc,nc,ic,oc,ac,sc,uc,cc,hc,lc,dc,fc,pc,_c,gc,mc,yc,vc,bc,wc,xc,Ec,Cc,kc,Dc,Oc,Mc,Sc,Fc,Pc,Rc,Bc,Nc,jc,Ic,Lc,qc,$c,Tc,Yc,Hc,Gc,Vc,Xc,zc,Wc,Zc,Uc,Kc,Qc,Jc,Ac,eh,th,rh,nh,ih,oh,ah,sh,uh,ch,hh,lh,dh,fh,ph,_h,gh,mh,yh,vh,bh,wh,xh,Eh,Ch,kh,Dh,Oh,Mh,Sh,Fh,Ph,Rh,Bh,Nh,jh,Ih,Lh,qh,$h,Th,Yh,Hh,Gh,Vh,Xh,zh,Wh,Zh,Uh,Kh,Qh,Jh,Ah,el,tl,rl,nl,il,ol,al,sl,ul,cl,hl,ll,dl,fl,pl,_l,gl,ml,yl,vl,bl,wl,xl,El,Cl,kl,Dl,Ol,Ml,Sl,Fl,Pl,Rl,Bl,Nl,jl,Il,Ll,ql,$l,Tl,Yl,Hl,Gl,Vl,Xl,zl,Wl,Zl,Ul,Kl,Ql,Jl,Al,ed,td,rd,nd,id,od,ad,sd,ud,cd,hd,ld,dd,fd,pd,_d,gd,md,yd,vd,bd,wd,xd,Ed,Cd,kd,Dd,Od,Md={exports:{}};function Sd(){return Mi||(Mi=1,function(e,t){var r=Nr(),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;function u(e,t){if(t)return e.slice();var r=e.length,n=s?s(r):new e.constructor(r);return e.copy(n),n}n(u,"cloneBuffer"),e.exports=u}(Md,Md.exports)),Md.exports}function Fd(){if(Fi)return Si;function e(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}return Fi=1,n(e,"copyArray"),Si=e}function Pd(){if(Ri)return Pi;function e(e,t){for(var r=-1,n=null==e?0:e.length,i=0,o=[];++r<n;){var a=e[r];t(a,r,e)&&(o[i++]=a)}return o}return Ri=1,n(e,"arrayFilter"),Pi=e}function Rd(){if(Ni)return Bi;function e(){return[]}return Ni=1,n(e,"stubArray"),Bi=e}function Bd(){if(Ii)return ji;Ii=1;var e=Pd(),t=Rd(),r=Object.prototype.propertyIsEnumerable,n=Object.getOwnPropertySymbols;return ji=n?function(t){return null==t?[]:(t=Object(t),e(n(t),function(e){return r.call(t,e)}))}:t}function Nd(){if(qi)return Li;qi=1;var e=gn(),t=Bd();function r(r,n){return e(r,t(r),n)}return n(r,"copySymbols"),Li=r}function jd(){if(Ti)return $i;function e(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}return Ti=1,n(e,"arrayPush"),$i=e}function Id(){if(Hi)return Yi;Hi=1;var e=yi()(Object.getPrototypeOf,Object);return Yi=e}function Ld(){if(Vi)return Gi;Vi=1;var e=jd(),t=Id(),r=Bd(),n=Rd(),i=Object.getOwnPropertySymbols;return Gi=i?function(n){for(var i=[];n;)e(i,r(n)),n=t(n);return i}:n}function qd(){if(zi)return Xi;zi=1;var e=gn(),t=Ld();function r(r,n){return e(r,t(r),n)}return n(r,"copySymbolsIn"),Xi=r}function $d(){if(Zi)return Wi;Zi=1;var e=jd(),t=wn();function r(r,n,i){var o=n(r);return t(r)?o:e(o,i(r))}return n(r,"baseGetAllKeys"),Wi=r}function Td(){if(Ki)return Ui;Ki=1;var e=$d(),t=Bd(),r=xi();function i(n){return e(n,r,t)}return n(i,"getAllKeys"),Ui=i}function Yd(){if(Ji)return Qi;Ji=1;var e=$d(),t=Ld(),r=Di();function i(n){return e(n,r,t)}return n(i,"getAllKeysIn"),Qi=i}function Hd(){if(eo)return Ai;eo=1;var e=zr()(Nr(),"DataView");return Ai=e}function Gd(){if(ro)return to;ro=1;var e=zr()(Nr(),"Promise");return to=e}function Vd(){if(io)return no;io=1;var e=zr()(Nr(),"Set");return no=e}function Xd(){if(ao)return oo;ao=1;var e=zr()(Nr(),"WeakMap");return oo=e}function zd(){if(uo)return so;uo=1;var e=Hd(),t=Wr(),r=Gd(),i=Vd(),o=Xd(),a=qr(),s=Gr(),u="[object Map]",c="[object Promise]",h="[object Set]",l="[object WeakMap]",d="[object DataView]",f=s(e),p=s(t),_=s(r),g=s(i),m=s(o),y=a;return(e&&y(new e(new ArrayBuffer(1)))!=d||t&&y(new t)!=u||r&&y(r.resolve())!=c||i&&y(new i)!=h||o&&y(new o)!=l)&&(y=/* @__PURE__ */n(function(e){var t=a(e),r="[object Object]"==t?e.constructor:void 0,n=r?s(r):"";if(n)switch(n){case f:return d;case p:return u;case _:return c;case g:return h;case m:return l}return t},"getTag")),so=y}function Wd(){if(ho)return co;ho=1;var e=Object.prototype.hasOwnProperty;function t(t){var r=t.length,n=new t.constructor(r);return r&&"string"==typeof t[0]&&e.call(t,"index")&&(n.index=t.index,n.input=t.input),n}return n(t,"initCloneArray"),co=t}function Zd(){if(fo)return lo;fo=1;var e=Nr().Uint8Array;return lo=e}function Ud(){if(_o)return po;_o=1;var e=Zd();function t(t){var r=new t.constructor(t.byteLength);return new e(r).set(new e(t)),r}return n(t,"cloneArrayBuffer"),po=t}function Kd(){if(mo)return go;mo=1;var e=Ud();function t(t,r){var n=r?e(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}return n(t,"cloneDataView"),go=t}function Qd(){if(vo)return yo;vo=1;var e=/\w*$/;function t(t){var r=new t.constructor(t.source,e.exec(t));return r.lastIndex=t.lastIndex,r}return n(t,"cloneRegExp"),yo=t}function Jd(){if(wo)return bo;wo=1;var e=jr(),t=e?e.prototype:void 0,r=t?t.valueOf:void 0;function i(e){return r?Object(r.call(e)):{}}return n(i,"cloneSymbol"),bo=i}function Ad(){if(Eo)return xo;Eo=1;var e=Ud();function t(t,r){var n=r?e(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}return n(t,"cloneTypedArray"),xo=t}function ef(){if(ko)return Co;ko=1;var e=Ud(),t=Kd(),r=Qd(),i=Jd(),o=Ad();function a(n,a,s){var u=n.constructor;switch(a){case"[object ArrayBuffer]":return e(n);case"[object Boolean]":case"[object Date]":return new u(+n);case"[object DataView]":return t(n,s);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return o(n,s);case"[object Map]":case"[object Set]":return new u;case"[object Number]":case"[object String]":return new u(n);case"[object RegExp]":return r(n);case"[object Symbol]":return i(n)}}return n(a,"initCloneByTag"),Co=a}function tf(){if(Oo)return Do;Oo=1;var e=$r(),t=Object.create;return Do=/* @__PURE__ */function(){function r(){}return n(r,"object"),function(n){if(!e(n))return{};if(t)return t(n);r.prototype=n;var i=new r;return r.prototype=void 0,i}}()}function rf(){if(So)return Mo;So=1;var e=tf(),t=Id(),r=mi();function i(n){return"function"!=typeof n.constructor||r(n)?{}:e(t(n))}return n(i,"initCloneObject"),Mo=i}function nf(){if(Po)return Fo;Po=1;var e=zd(),t=yn();function r(r){return t(r)&&"[object Map]"==e(r)}return n(r,"baseIsMap"),Fo=r}function of(){if(Bo)return Ro;Bo=1;var e=nf(),t=$n(),r=pi(),n=r&&r.isMap,i=n?t(n):e;return Ro=i}function af(){if(jo)return No;jo=1;var e=zd(),t=yn();function r(r){return t(r)&&"[object Set]"==e(r)}return n(r,"baseIsSet"),No=r}function sf(){if(Lo)return Io;Lo=1;var e=af(),t=$n(),r=pi(),n=r&&r.isSet,i=n?t(n):e;return Io=i}function uf(){if($o)return qo;$o=1;var e=ln(),t=dn(),r=_n(),i=Ei(),o=Oi(),a=Sd(),s=Fd(),u=Nd(),c=qd(),h=Td(),l=Yd(),d=zd(),f=Wd(),p=ef(),_=rf(),g=wn(),m=jn(),y=of(),v=$r(),b=sf(),w=xi(),x=Di(),E="[object Arguments]",C="[object Function]",k="[object Object]",D={};function O(n,M,S,F,P,R){var B,N=1&M,j=2&M,I=4&M;if(S&&(B=P?S(n,F,P,R):S(n)),void 0!==B)return B;if(!v(n))return n;var L=g(n);if(L){if(B=f(n),!N)return s(n,B)}else{var q=d(n),$=q==C||"[object GeneratorFunction]"==q;if(m(n))return a(n,N);if(q==k||q==E||$&&!P){if(B=j||$?{}:_(n),!N)return j?c(n,o(B,n)):u(n,i(B,n))}else{if(!D[q])return P?n:{};B=p(n,q,N)}}R||(R=new e);var T=R.get(n);if(T)return T;R.set(n,B),b(n)?n.forEach(function(e){B.add(O(e,M,S,e,n,R))}):y(n)&&n.forEach(function(e,t){B.set(t,O(e,M,S,t,n,R))});var Y=L?void 0:(I?j?l:h:j?x:w)(n);return t(Y||n,function(e,t){Y&&(e=n[t=e]),r(B,t,O(e,M,S,t,n,R))}),B}return D[E]=D["[object Array]"]=D["[object ArrayBuffer]"]=D["[object DataView]"]=D["[object Boolean]"]=D["[object Date]"]=D["[object Float32Array]"]=D["[object Float64Array]"]=D["[object Int8Array]"]=D["[object Int16Array]"]=D["[object Int32Array]"]=D["[object Map]"]=D["[object Number]"]=D[k]=D["[object RegExp]"]=D["[object Set]"]=D["[object String]"]=D["[object Symbol]"]=D["[object Uint8Array]"]=D["[object Uint8ClampedArray]"]=D["[object Uint16Array]"]=D["[object Uint32Array]"]=!0,D["[object Error]"]=D[C]=D["[object WeakMap]"]=!1,n(O,"baseClone"),qo=O}function cf(){if(Yo)return To;Yo=1;var e=uf();function t(t){return e(t,4)}return n(t,"clone"),To=t}function hf(){if(Go)return Ho;function e(e){return function(){return e}}return Go=1,n(e,"constant"),Ho=e}function lf(){if(Xo)return Vo;function e(e){return function(t,r,n){for(var i=-1,o=Object(t),a=n(t),s=a.length;s--;){var u=a[e?s:++i];if(!1===r(o[u],u,o))break}return t}}return Xo=1,n(e,"createBaseFor"),Vo=e}function df(){if(Wo)return zo;Wo=1;var e=lf()();return zo=e}function ff(){if(Uo)return Zo;Uo=1;var e=df(),t=xi();function r(r,n){return r&&e(r,n,t)}return n(r,"baseForOwn"),Zo=r}function pf(){if(Qo)return Ko;Qo=1;var e=wi();function t(t,r){return function(n,i){if(null==n)return n;if(!e(n))return t(n,i);for(var o=n.length,a=r?o:-1,s=Object(n);(r?a--:++a<o)&&!1!==i(s[a],a,s););return n}}return n(t,"createBaseEach"),Ko=t}function _f(){if(Ao)return Jo;Ao=1;var e=ff(),t=pf()(e);return Jo=t}function gf(){if(ta)return ea;function e(e){return e}return ta=1,n(e,"identity"),ea=e}function mf(){if(na)return ra;na=1;var e=gf();function t(t){return"function"==typeof t?t:e}return n(t,"castFunction"),ra=t}function yf(){if(oa)return ia;oa=1;var e=dn(),t=_f(),r=mf(),i=wn();function o(n,o){return(i(n)?e:t)(n,r(o))}return n(o,"forEach"),ia=o}function vf(){return sa?aa:(sa=1,aa=yf())}function bf(){if(ca)return ua;ca=1;var e=_f();function t(t,r){var n=[];return e(t,function(e,t,i){r(e,t,i)&&n.push(e)}),n}return n(t,"baseFilter"),ua=t}function wf(){if(la)return ha;la=1;function e(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}return n(e,"setCacheAdd"),ha=e}function xf(){if(fa)return da;function e(e){return this.__data__.has(e)}return fa=1,n(e,"setCacheHas"),da=e}function Ef(){if(_a)return pa;_a=1;var e=cn(),t=wf(),r=xf();function i(t){var r=-1,n=null==t?0:t.length;for(this.__data__=new e;++r<n;)this.add(t[r])}return n(i,"SetCache"),i.prototype.add=i.prototype.push=t,i.prototype.has=r,pa=i}function Cf(){if(ma)return ga;function e(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}return ma=1,n(e,"arraySome"),ga=e}function kf(){if(va)return ya;function e(e,t){return e.has(t)}return va=1,n(e,"cacheHas"),ya=e}function Df(){if(wa)return ba;wa=1;var e=Ef(),t=Cf(),r=kf();function i(n,i,o,a,s,u){var c=1&o,h=n.length,l=i.length;if(h!=l&&!(c&&l>h))return!1;var d=u.get(n),f=u.get(i);if(d&&f)return d==i&&f==n;var p=-1,_=!0,g=2&o?new e:void 0;for(u.set(n,i),u.set(i,n);++p<h;){var m=n[p],y=i[p];if(a)var v=c?a(y,m,p,i,n,u):a(m,y,p,n,i,u);if(void 0!==v){if(v)continue;_=!1;break}if(g){if(!t(i,function(e,t){if(!r(g,t)&&(m===e||s(m,e,o,a,u)))return g.push(t)})){_=!1;break}}else if(m!==y&&!s(m,y,o,a,u)){_=!1;break}}return u.delete(n),u.delete(i),_}return n(i,"equalArrays"),ba=i}function Of(){if(Ea)return xa;function e(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}return Ea=1,n(e,"mapToArray"),xa=e}function Mf(){if(ka)return Ca;function e(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}return ka=1,n(e,"setToArray"),Ca=e}function Sf(){if(Oa)return Da;Oa=1;var e=jr(),t=Zd(),r=xr(),i=Df(),o=Of(),a=Mf(),s=e?e.prototype:void 0,u=s?s.valueOf:void 0;function c(e,n,s,c,h,l,d){switch(s){case"[object DataView]":if(e.byteLength!=n.byteLength||e.byteOffset!=n.byteOffset)return!1;e=e.buffer,n=n.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=n.byteLength||!l(new t(e),new t(n)));case"[object Boolean]":case"[object Date]":case"[object Number]":return r(+e,+n);case"[object Error]":return e.name==n.name&&e.message==n.message;case"[object RegExp]":case"[object String]":return e==n+"";case"[object Map]":var f=o;case"[object Set]":var p=1&c;if(f||(f=a),e.size!=n.size&&!p)return!1;var _=d.get(e);if(_)return _==n;c|=2,d.set(e,n);var g=i(f(e),f(n),c,h,l,d);return d.delete(e),g;case"[object Symbol]":if(u)return u.call(e)==u.call(n)}return!1}return n(c,"equalByTag"),Da=c}function Ff(){if(Sa)return Ma;Sa=1;var e=Td(),t=Object.prototype.hasOwnProperty;function r(r,n,i,o,a,s){var u=1&i,c=e(r),h=c.length;if(h!=e(n).length&&!u)return!1;for(var l=h;l--;){var d=c[l];if(!(u?d in n:t.call(n,d)))return!1}var f=s.get(r),p=s.get(n);if(f&&p)return f==n&&p==r;var _=!0;s.set(r,n),s.set(n,r);for(var g=u;++l<h;){var m=r[d=c[l]],y=n[d];if(o)var v=u?o(y,m,d,n,r,s):o(m,y,d,r,n,s);if(!(void 0===v?m===y||a(m,y,i,o,s):v)){_=!1;break}g||(g="constructor"==d)}if(_&&!g){var b=r.constructor,w=n.constructor;b==w||!("constructor"in r)||!("constructor"in n)||"function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w||(_=!1)}return s.delete(r),s.delete(n),_}return n(r,"equalObjects"),Ma=r}function Pf(){if(Pa)return Fa;Pa=1;var e=ln(),t=Df(),r=Sf(),i=Ff(),o=zd(),a=wn(),s=jn(),u=_i(),c="[object Arguments]",h="[object Array]",l="[object Object]",d=Object.prototype.hasOwnProperty;function f(n,f,p,_,g,m){var y=a(n),v=a(f),b=y?h:o(n),w=v?h:o(f),x=(b=b==c?l:b)==l,E=(w=w==c?l:w)==l,C=b==w;if(C&&s(n)){if(!s(f))return!1;y=!0,x=!1}if(C&&!x)return m||(m=new e),y||u(n)?t(n,f,p,_,g,m):r(n,f,b,p,_,g,m);if(!(1&p)){var k=x&&d.call(n,"__wrapped__"),D=E&&d.call(f,"__wrapped__");if(k||D){var O=k?n.value():n,M=D?f.value():f;return m||(m=new e),g(O,M,p,_,m)}}return!!C&&(m||(m=new e),i(n,f,p,_,g,m))}return n(f,"baseIsEqualDeep"),Fa=f}function Rf(){if(Ba)return Ra;Ba=1;var e=Pf(),t=yn();function r(n,i,o,a,s){return n===i||(null==n||null==i||!t(n)&&!t(i)?n!=n&&i!=i:e(n,i,o,a,r,s))}return n(r,"baseIsEqual"),Ra=r}function Bf(){if(ja)return Na;ja=1;var e=ln(),t=Rf();function r(r,n,i,o){var a=i.length,s=a,u=!o;if(null==r)return!s;for(r=Object(r);a--;){var c=i[a];if(u&&c[2]?c[1]!==r[c[0]]:!(c[0]in r))return!1}for(;++a<s;){var h=(c=i[a])[0],l=r[h],d=c[1];if(u&&c[2]){if(void 0===l&&!(h in r))return!1}else{var f=new e;if(o)var p=o(l,d,h,r,n,f);if(!(void 0===p?t(d,l,3,o,f):p))return!1}}return!0}return n(r,"baseIsMatch"),Na=r}function Nf(){if(La)return Ia;La=1;var e=$r();function t(t){return t==t&&!e(t)}return n(t,"isStrictComparable"),Ia=t}function jf(){if($a)return qa;$a=1;var e=Nf(),t=xi();function r(r){for(var n=t(r),i=n.length;i--;){var o=n[i],a=r[o];n[i]=[o,a,e(a)]}return n}return n(r,"getMatchData"),qa=r}function If(){if(Ya)return Ta;function e(e,t){return function(r){return null!=r&&(r[e]===t&&(void 0!==t||e in Object(r)))}}return Ya=1,n(e,"matchesStrictComparable"),Ta=e}function Lf(){if(Ga)return Ha;Ga=1;var e=Bf(),t=jf(),r=If();function i(n){var i=t(n);return 1==i.length&&i[0][2]?r(i[0][0],i[0][1]):function(t){return t===n||e(t,n,i)}}return n(i,"baseMatches"),Ha=i}function qf(){if(Xa)return Va;Xa=1;var e=qr(),t=yn();function r(r){return"symbol"==typeof r||t(r)&&"[object Symbol]"==e(r)}return n(r,"isSymbol"),Va=r}function $f(){if(Wa)return za;Wa=1;var e=wn(),t=qf(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,i=/^\w*$/;function o(n,o){if(e(n))return!1;var a=typeof n;return!("number"!=a&&"symbol"!=a&&"boolean"!=a&&null!=n&&!t(n))||(i.test(n)||!r.test(n)||null!=o&&n in Object(o))}return n(o,"isKey"),za=o}function Tf(){if(Ua)return Za;Ua=1;var e=cn();function t(r,i){if("function"!=typeof r||null!=i&&"function"!=typeof i)throw new TypeError("Expected a function");var o=/* @__PURE__ */n(function(){var e=arguments,t=i?i.apply(this,e):e[0],n=o.cache;if(n.has(t))return n.get(t);var a=r.apply(this,e);return o.cache=n.set(t,a)||n,a},"memoized");return o.cache=new(t.Cache||e),o}return n(t,"memoize"),t.Cache=e,Za=t}function Yf(){if(Qa)return Ka;Qa=1;var e=Tf();function t(t){var r=e(t,function(e){return 500===n.size&&n.clear(),e}),n=r.cache;return r}return n(t,"memoizeCapped"),Ka=t}function Hf(){if(Aa)return Ja;Aa=1;var e=Yf(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=e(function(e){var n=[];return 46===e.charCodeAt(0)&&n.push(""),e.replace(t,function(e,t,i,o){n.push(i?o.replace(r,"$1"):t||e)}),n});return Ja=n}function Gf(){if(ts)return es;function e(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}return ts=1,n(e,"arrayMap"),es=e}function Vf(){if(ns)return rs;ns=1;var e=jr(),t=Gf(),r=wn(),i=qf(),o=e?e.prototype:void 0,a=o?o.toString:void 0;function s(e){if("string"==typeof e)return e;if(r(e))return t(e,s)+"";if(i(e))return a?a.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n}return n(s,"baseToString"),rs=s}function Xf(){if(os)return is;os=1;var e=Vf();function t(t){return null==t?"":e(t)}return n(t,"toString"),is=t}function zf(){if(ss)return as;ss=1;var e=wn(),t=$f(),r=Hf(),i=Xf();function o(n,o){return e(n)?n:t(n,o)?[n]:r(i(n))}return n(o,"castPath"),as=o}function Wf(){if(cs)return us;cs=1;var e=qf();function t(t){if("string"==typeof t||e(t))return t;var r=t+"";return"0"==r&&1/t==-1/0?"-0":r}return n(t,"toKey"),us=t}function Zf(){if(ls)return hs;ls=1;var e=zf(),t=Wf();function r(r,n){for(var i=0,o=(n=e(n,r)).length;null!=r&&i<o;)r=r[t(n[i++])];return i&&i==o?r:void 0}return n(r,"baseGet"),hs=r}function Uf(){if(fs)return ds;fs=1;var e=Zf();function t(t,r,n){var i=null==t?void 0:e(t,r);return void 0===i?n:i}return n(t,"get"),ds=t}function Kf(){if(_s)return ps;function e(e,t){return null!=e&&t in Object(e)}return _s=1,n(e,"baseHasIn"),ps=e}function Qf(){if(ms)return gs;ms=1;var e=zf(),t=bn(),r=wn(),i=In(),o=Ln(),a=Wf();function s(n,s,u){for(var c=-1,h=(s=e(s,n)).length,l=!1;++c<h;){var d=a(s[c]);if(!(l=null!=n&&u(n,d)))break;n=n[d]}return l||++c!=h?l:!!(h=null==n?0:n.length)&&o(h)&&i(d,h)&&(r(n)||t(n))}return n(s,"hasPath"),gs=s}function Jf(){if(vs)return ys;vs=1;var e=Kf(),t=Qf();function r(r,n){return null!=r&&t(r,n,e)}return n(r,"hasIn"),ys=r}function Af(){if(ws)return bs;ws=1;var e=Rf(),t=Uf(),r=Jf(),i=$f(),o=Nf(),a=If(),s=Wf();function u(n,u){return i(n)&&o(u)?a(s(n),u):function(i){var o=t(i,n);return void 0===o&&o===u?r(i,n):e(u,o,3)}}return n(u,"baseMatchesProperty"),bs=u}function ep(){if(Es)return xs;function e(e){return function(t){return null==t?void 0:t[e]}}return Es=1,n(e,"baseProperty"),xs=e}function tp(){if(ks)return Cs;ks=1;var e=Zf();function t(t){return function(r){return e(r,t)}}return n(t,"basePropertyDeep"),Cs=t}function rp(){if(Os)return Ds;Os=1;var e=ep(),t=tp(),r=$f(),i=Wf();function o(n){return r(n)?e(i(n)):t(n)}return n(o,"property"),Ds=o}function np(){if(Ss)return Ms;Ss=1;var e=Lf(),t=Af(),r=gf(),i=wn(),o=rp();function a(n){return"function"==typeof n?n:null==n?r:"object"==typeof n?i(n)?t(n[0],n[1]):e(n):o(n)}return n(a,"baseIteratee"),Ms=a}function ip(){if(Ps)return Fs;Ps=1;var e=Pd(),t=bf(),r=np(),i=wn();function o(n,o){return(i(n)?e:t)(n,r(o,3))}return n(o,"filter"),Fs=o}function op(){if(Bs)return Rs;Bs=1;var e=Object.prototype.hasOwnProperty;function t(t,r){return null!=t&&e.call(t,r)}return n(t,"baseHas"),Rs=t}function ap(){if(js)return Ns;js=1;var e=op(),t=Qf();function r(r,n){return null!=r&&t(r,n,e)}return n(r,"has"),Ns=r}function sp(){if(Ls)return Is;Ls=1;var e=bi(),t=zd(),r=bn(),i=wn(),o=wi(),a=jn(),s=mi(),u=_i(),c=Object.prototype.hasOwnProperty;function h(n){if(null==n)return!0;if(o(n)&&(i(n)||"string"==typeof n||"function"==typeof n.splice||a(n)||u(n)||r(n)))return!n.length;var h=t(n);if("[object Map]"==h||"[object Set]"==h)return!n.size;if(s(n))return!e(n).length;for(var l in n)if(c.call(n,l))return!1;return!0}return n(h,"isEmpty"),Is=h}function up(){if($s)return qs;function e(e){return void 0===e}return $s=1,n(e,"isUndefined"),qs=e}function cp(){if(Ys)return Ts;Ys=1;var e=_f(),t=wi();function r(r,n){var i=-1,o=t(r)?Array(r.length):[];return e(r,function(e,t,r){o[++i]=n(e,t,r)}),o}return n(r,"baseMap"),Ts=r}function hp(){if(Gs)return Hs;Gs=1;var e=Gf(),t=np(),r=cp(),i=wn();function o(n,o){return(i(n)?e:r)(n,t(o,3))}return n(o,"map"),Hs=o}function lp(){if(Xs)return Vs;function e(e,t,r,n){var i=-1,o=null==e?0:e.length;for(n&&o&&(r=e[++i]);++i<o;)r=t(r,e[i],i,e);return r}return Xs=1,n(e,"arrayReduce"),Vs=e}function dp(){if(Ws)return zs;function e(e,t,r,n,i){return i(e,function(e,i,o){r=n?(n=!1,e):t(r,e,i,o)}),r}return Ws=1,n(e,"baseReduce"),zs=e}function fp(){if(Us)return Zs;Us=1;var e=lp(),t=_f(),r=np(),i=dp(),o=wn();function a(n,a,s){var u=o(n)?e:i,c=arguments.length<3;return u(n,r(a,4),s,c,t)}return n(a,"reduce"),Zs=a}function pp(){if(Qs)return Ks;Qs=1;var e=qr(),t=wn(),r=yn();function i(n){return"string"==typeof n||!t(n)&&r(n)&&"[object String]"==e(n)}return n(i,"isString"),Ks=i}function _p(){if(As)return Js;As=1;var e=ep()("length");return Js=e}function gp(){if(tu)return eu;tu=1;var e=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function t(t){return e.test(t)}return n(t,"hasUnicode"),eu=t}function mp(){if(nu)return ru;nu=1;var e="\\ud800-\\udfff",t="["+e+"]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",i="\\ud83c[\\udffb-\\udfff]",o="[^"+e+"]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",u="(?:"+r+"|"+i+")"+"?",c="[\\ufe0e\\ufe0f]?",h=c+u+("(?:\\u200d(?:"+[o,a,s].join("|")+")"+c+u+")*"),l="(?:"+[o+r+"?",r,a,s,t].join("|")+")",d=RegExp(i+"(?="+i+")|"+l+h,"g");function f(e){for(var t=d.lastIndex=0;d.test(e);)++t;return t}return n(f,"unicodeSize"),ru=f}function yp(){if(ou)return iu;ou=1;var e=_p(),t=gp(),r=mp();function i(n){return t(n)?r(n):e(n)}return n(i,"stringSize"),iu=i}function vp(){if(su)return au;su=1;var e=bi(),t=zd(),r=wi(),i=pp(),o=yp();function a(n){if(null==n)return 0;if(r(n))return i(n)?o(n):n.length;var a=t(n);return"[object Map]"==a||"[object Set]"==a?n.size:e(n).length}return n(a,"size"),au=a}function bp(){if(cu)return uu;cu=1;var e=dn(),t=tf(),r=ff(),i=np(),o=Id(),a=wn(),s=jn(),u=Tr(),c=$r(),h=_i();function l(n,l,d){var f=a(n),p=f||s(n)||h(n);if(l=i(l,4),null==d){var _=n&&n.constructor;d=p?f?new _:[]:c(n)&&u(_)?t(o(n)):{}}return(p?e:r)(n,function(e,t,r){return l(d,e,t,r)}),d}return n(l,"transform"),uu=l}function wp(){if(lu)return hu;lu=1;var e=jr(),t=bn(),r=wn(),i=e?e.isConcatSpreadable:void 0;function o(e){return r(e)||t(e)||!!(i&&e&&e[i])}return n(o,"isFlattenable"),hu=o}function xp(){if(fu)return du;fu=1;var e=jd(),t=wp();function r(n,i,o,a,s){var u=-1,c=n.length;for(o||(o=t),s||(s=[]);++u<c;){var h=n[u];i>0&&o(h)?i>1?r(h,i-1,o,a,s):e(s,h):a||(s[s.length]=h)}return s}return n(r,"baseFlatten"),du=r}function Ep(){if(_u)return pu;function e(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}return _u=1,n(e,"apply"),pu=e}function Cp(){if(mu)return gu;mu=1;var e=Ep(),t=Math.max;function r(r,n,i){return n=t(void 0===n?r.length-1:n,0),function(){for(var o=arguments,a=-1,s=t(o.length-n,0),u=Array(s);++a<s;)u[a]=o[n+a];a=-1;for(var c=Array(n+1);++a<n;)c[a]=o[a];return c[n]=i(u),e(r,this,c)}}return n(r,"overRest"),gu=r}function kp(){if(vu)return yu;vu=1;var e=hf(),t=fn(),r=gf();return yu=t?function(r,n){return t(r,"toString",{configurable:!0,enumerable:!1,value:e(n),writable:!0})}:r}function Dp(){if(wu)return bu;wu=1;var e=Date.now;function t(t){var r=0,n=0;return function(){var i=e(),o=16-(i-n);if(n=i,o>0){if(++r>=800)return arguments[0]}else r=0;return t.apply(void 0,arguments)}}return n(t,"shortOut"),bu=t}function Op(){if(Eu)return xu;Eu=1;var e=kp(),t=Dp()(e);return xu=t}function Mp(){if(ku)return Cu;ku=1;var e=gf(),t=Cp(),r=Op();function i(n,i){return r(t(n,i,e),n+"")}return n(i,"baseRest"),Cu=i}function Sp(){if(Ou)return Du;function e(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}return Ou=1,n(e,"baseFindIndex"),Du=e}function Fp(){if(Su)return Mu;function e(e){return e!=e}return Su=1,n(e,"baseIsNaN"),Mu=e}function Pp(){if(Pu)return Fu;function e(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}return Pu=1,n(e,"strictIndexOf"),Fu=e}function Rp(){if(Bu)return Ru;Bu=1;var e=Sp(),t=Fp(),r=Pp();function i(n,i,o){return i==i?r(n,i,o):e(n,t,o)}return n(i,"baseIndexOf"),Ru=i}function Bp(){if(ju)return Nu;ju=1;var e=Rp();function t(t,r){return!!(null==t?0:t.length)&&e(t,r,0)>-1}return n(t,"arrayIncludes"),Nu=t}function Np(){if(Lu)return Iu;function e(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}return Lu=1,n(e,"arrayIncludesWith"),Iu=e}function jp(){if($u)return qu;function e(){}return $u=1,n(e,"noop"),qu=e}function Ip(){if(Yu)return Tu;Yu=1;var e=Vd(),t=jp(),r=Mf(),n=e&&1/r(new e([,-0]))[1]==1/0?function(t){return new e(t)}:t;return Tu=n}function Lp(){if(Gu)return Hu;Gu=1;var e=Ef(),t=Bp(),r=Np(),i=kf(),o=Ip(),a=Mf();function s(n,s,u){var c=-1,h=t,l=n.length,d=!0,f=[],p=f;if(u)d=!1,h=r;else if(l>=200){var _=s?null:o(n);if(_)return a(_);d=!1,h=i,p=new e}else p=s?[]:f;e:for(;++c<l;){var g=n[c],m=s?s(g):g;if(g=u||0!==g?g:0,d&&m==m){for(var y=p.length;y--;)if(p[y]===m)continue e;s&&p.push(m),f.push(g)}else h(p,m,u)||(p!==f&&p.push(m),f.push(g))}return f}return n(s,"baseUniq"),Hu=s}function qp(){if(Xu)return Vu;Xu=1;var e=wi(),t=yn();function r(r){return t(r)&&e(r)}return n(r,"isArrayLikeObject"),Vu=r}function $p(){if(Wu)return zu;Wu=1;var e=xp(),t=Mp(),r=Lp(),n=qp(),i=t(function(t){return r(e(t,1,n,!0))});return zu=i}function Tp(){if(Uu)return Zu;Uu=1;var e=Gf();function t(t,r){return e(r,function(e){return t[e]})}return n(t,"baseValues"),Zu=t}function Yp(){if(Qu)return Ku;Qu=1;var e=Tp(),t=xi();function r(r){return null==r?[]:e(r,t(r))}return n(r,"values"),Ku=r}function Hp(){if(Au)return Ju;var e;Au=1;try{e={clone:cf(),constant:hf(),each:vf(),filter:ip(),has:ap(),isArray:wn(),isEmpty:sp(),isFunction:Tr(),isUndefined:up(),keys:xi(),map:hp(),reduce:fp(),size:vp(),transform:bp(),union:$p(),values:Yp()}}catch(t){}return e||(e=window._),Ju=e}function Gp(){if(tc)return ec;tc=1;var e=Hp();ec=r;var t="\0";function r(r){this._isDirected=!e.has(r,"directed")||r.directed,this._isMultigraph=!!e.has(r,"multigraph")&&r.multigraph,this._isCompound=!!e.has(r,"compound")&&r.compound,this._label=void 0,this._defaultNodeLabelFn=e.constant(void 0),this._defaultEdgeLabelFn=e.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[t]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function i(e,t){e[t]?e[t]++:e[t]=1}function o(e,t){--e[t]||delete e[t]}function a(t,r,n,i){var o=""+r,a=""+n;if(!t&&o>a){var s=o;o=a,a=s}return o+""+a+""+(e.isUndefined(i)?"\0":i)}function s(e,t,r,n){var i=""+t,o=""+r;if(!e&&i>o){var a=i;i=o,o=a}var s={v:i,w:o};return n&&(s.name=n),s}function u(e,t){return a(e,t.v,t.w,t.name)}return n(r,"Graph"),r.prototype._nodeCount=0,r.prototype._edgeCount=0,r.prototype.isDirected=function(){return this._isDirected},r.prototype.isMultigraph=function(){return this._isMultigraph},r.prototype.isCompound=function(){return this._isCompound},r.prototype.setGraph=function(e){return this._label=e,this},r.prototype.graph=function(){return this._label},r.prototype.setDefaultNodeLabel=function(t){return e.isFunction(t)||(t=e.constant(t)),this._defaultNodeLabelFn=t,this},r.prototype.nodeCount=function(){return this._nodeCount},r.prototype.nodes=function(){return e.keys(this._nodes)},r.prototype.sources=function(){var t=this;return e.filter(this.nodes(),function(r){return e.isEmpty(t._in[r])})},r.prototype.sinks=function(){var t=this;return e.filter(this.nodes(),function(r){return e.isEmpty(t._out[r])})},r.prototype.setNodes=function(t,r){var n=arguments,i=this;return e.each(t,function(e){n.length>1?i.setNode(e,r):i.setNode(e)}),this},r.prototype.setNode=function(r,n){return e.has(this._nodes,r)?(arguments.length>1&&(this._nodes[r]=n),this):(this._nodes[r]=arguments.length>1?n:this._defaultNodeLabelFn(r),this._isCompound&&(this._parent[r]=t,this._children[r]={},this._children[t][r]=!0),this._in[r]={},this._preds[r]={},this._out[r]={},this._sucs[r]={},++this._nodeCount,this)},r.prototype.node=function(e){return this._nodes[e]},r.prototype.hasNode=function(t){return e.has(this._nodes,t)},r.prototype.removeNode=function(t){var r=this;if(e.has(this._nodes,t)){var i=/* @__PURE__ */n(function(e){r.removeEdge(r._edgeObjs[e])},"removeEdge");delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],e.each(this.children(t),function(e){r.setParent(e)}),delete this._children[t]),e.each(e.keys(this._in[t]),i),delete this._in[t],delete this._preds[t],e.each(e.keys(this._out[t]),i),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},r.prototype.setParent=function(r,n){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e.isUndefined(n))n=t;else{for(var i=n+="";!e.isUndefined(i);i=this.parent(i))if(i===r)throw new Error("Setting "+n+" as parent of "+r+" would create a cycle");this.setNode(n)}return this.setNode(r),this._removeFromParentsChildList(r),this._parent[r]=n,this._children[n][r]=!0,this},r.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},r.prototype.parent=function(e){if(this._isCompound){var r=this._parent[e];if(r!==t)return r}},r.prototype.children=function(r){if(e.isUndefined(r)&&(r=t),this._isCompound){var n=this._children[r];if(n)return e.keys(n)}else{if(r===t)return this.nodes();if(this.hasNode(r))return[]}},r.prototype.predecessors=function(t){var r=this._preds[t];if(r)return e.keys(r)},r.prototype.successors=function(t){var r=this._sucs[t];if(r)return e.keys(r)},r.prototype.neighbors=function(t){var r=this.predecessors(t);if(r)return e.union(r,this.successors(t))},r.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},r.prototype.filterNodes=function(t){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var i=this;e.each(this._nodes,function(e,n){t(n)&&r.setNode(n,e)}),e.each(this._edgeObjs,function(e){r.hasNode(e.v)&&r.hasNode(e.w)&&r.setEdge(e,i.edge(e))});var o={};function a(e){var t=i.parent(e);return void 0===t||r.hasNode(t)?(o[e]=t,t):t in o?o[t]:a(t)}return n(a,"findParent"),this._isCompound&&e.each(r.nodes(),function(e){r.setParent(e,a(e))}),r},r.prototype.setDefaultEdgeLabel=function(t){return e.isFunction(t)||(t=e.constant(t)),this._defaultEdgeLabelFn=t,this},r.prototype.edgeCount=function(){return this._edgeCount},r.prototype.edges=function(){return e.values(this._edgeObjs)},r.prototype.setPath=function(t,r){var n=this,i=arguments;return e.reduce(t,function(e,t){return i.length>1?n.setEdge(e,t,r):n.setEdge(e,t),t}),this},r.prototype.setEdge=function(){var t,r,n,o,u=!1,c=arguments[0];"object"==typeof c&&null!==c&&"v"in c?(t=c.v,r=c.w,n=c.name,2===arguments.length&&(o=arguments[1],u=!0)):(t=c,r=arguments[1],n=arguments[3],arguments.length>2&&(o=arguments[2],u=!0)),t=""+t,r=""+r,e.isUndefined(n)||(n=""+n);var h=a(this._isDirected,t,r,n);if(e.has(this._edgeLabels,h))return u&&(this._edgeLabels[h]=o),this;if(!e.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(r),this._edgeLabels[h]=u?o:this._defaultEdgeLabelFn(t,r,n);var l=s(this._isDirected,t,r,n);return t=l.v,r=l.w,Object.freeze(l),this._edgeObjs[h]=l,i(this._preds[r],t),i(this._sucs[t],r),this._in[r][h]=l,this._out[t][h]=l,this._edgeCount++,this},r.prototype.edge=function(e,t,r){var n=1===arguments.length?u(this._isDirected,arguments[0]):a(this._isDirected,e,t,r);return this._edgeLabels[n]},r.prototype.hasEdge=function(t,r,n){var i=1===arguments.length?u(this._isDirected,arguments[0]):a(this._isDirected,t,r,n);return e.has(this._edgeLabels,i)},r.prototype.removeEdge=function(e,t,r){var n=1===arguments.length?u(this._isDirected,arguments[0]):a(this._isDirected,e,t,r),i=this._edgeObjs[n];return i&&(e=i.v,t=i.w,delete this._edgeLabels[n],delete this._edgeObjs[n],o(this._preds[t],e),o(this._sucs[e],t),delete this._in[t][n],delete this._out[e][n],this._edgeCount--),this},r.prototype.inEdges=function(t,r){var n=this._in[t];if(n){var i=e.values(n);return r?e.filter(i,function(e){return e.v===r}):i}},r.prototype.outEdges=function(t,r){var n=this._out[t];if(n){var i=e.values(n);return r?e.filter(i,function(e){return e.w===r}):i}},r.prototype.nodeEdges=function(e,t){var r=this.inEdges(e,t);if(r)return r.concat(this.outEdges(e,t))},n(i,"incrementOrInitEntry"),n(o,"decrementOrRemoveEntry"),n(a,"edgeArgsToId"),n(s,"edgeArgsToObj"),n(u,"edgeObjToId"),ec}function Vp(){return nc?rc:(nc=1,rc="2.1.8")}function Xp(){return oc?ic:(oc=1,ic={Graph:Gp(),version:Vp()})}function zp(){if(sc)return ac;sc=1;var e=Hp(),t=Gp();function r(t){var r={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:i(t),edges:o(t)};return e.isUndefined(t.graph())||(r.value=e.clone(t.graph())),r}function i(t){return e.map(t.nodes(),function(r){var n=t.node(r),i=t.parent(r),o={v:r};return e.isUndefined(n)||(o.value=n),e.isUndefined(i)||(o.parent=i),o})}function o(t){return e.map(t.edges(),function(r){var n=t.edge(r),i={v:r.v,w:r.w};return e.isUndefined(r.name)||(i.name=r.name),e.isUndefined(n)||(i.value=n),i})}function a(r){var n=new t(r.options).setGraph(r.value);return e.each(r.nodes,function(e){n.setNode(e.v,e.value),e.parent&&n.setParent(e.v,e.parent)}),e.each(r.edges,function(e){n.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),n}return ac={write:r,read:a},n(r,"write"),n(i,"writeNodes"),n(o,"writeEdges"),n(a,"read"),ac}function Wp(){if(cc)return uc;cc=1;var e=Hp();function t(t){var r,i={},o=[];function a(n){e.has(i,n)||(i[n]=!0,r.push(n),e.each(t.successors(n),a),e.each(t.predecessors(n),a))}return n(a,"dfs"),e.each(t.nodes(),function(e){r=[],a(e),r.length&&o.push(r)}),o}return uc=t,n(t,"components"),uc}function Zp(){if(lc)return hc;lc=1;var e=Hp();function t(){this._arr=[],this._keyIndices={}}return hc=t,n(t,"PriorityQueue"),t.prototype.size=function(){return this._arr.length},t.prototype.keys=function(){return this._arr.map(function(e){return e.key})},t.prototype.has=function(t){return e.has(this._keyIndices,t)},t.prototype.priority=function(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority},t.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},t.prototype.add=function(t,r){var n=this._keyIndices;if(t=String(t),!e.has(n,t)){var i=this._arr,o=i.length;return n[t]=o,i.push({key:t,priority:r}),this._decrease(o),!0}return!1},t.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key},t.prototype.decrease=function(e,t){var r=this._keyIndices[e];if(t>this._arr[r].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[r].priority+" New: "+t);this._arr[r].priority=t,this._decrease(r)},t.prototype._heapify=function(e){var t=this._arr,r=2*e,n=r+1,i=e;r<t.length&&(i=t[r].priority<t[i].priority?r:i,n<t.length&&(i=t[n].priority<t[i].priority?n:i),i!==e&&(this._swap(e,i),this._heapify(i)))},t.prototype._decrease=function(e){for(var t,r=this._arr,n=r[e].priority;0!==e&&!(r[t=e>>1].priority<n);)this._swap(e,t),e=t},t.prototype._swap=function(e,t){var r=this._arr,n=this._keyIndices,i=r[e],o=r[t];r[e]=o,r[t]=i,n[o.key]=e,n[i.key]=t},hc}function Up(){if(fc)return dc;fc=1;var e=Hp(),t=Zp();dc=i;var r=e.constant(1);function i(e,t,n,i){return o(e,String(t),n||r,i||function(t){return e.outEdges(t)})}function o(e,r,i,o){var a,s,u={},c=new t,h=/* @__PURE__ */n(function(e){var t=e.v!==a?e.v:e.w,r=u[t],n=i(e),o=s.distance+n;if(n<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+n);o<r.distance&&(r.distance=o,r.predecessor=a,c.decrease(t,o))},"updateNeighbors");for(e.nodes().forEach(function(e){var t=e===r?0:Number.POSITIVE_INFINITY;u[e]={distance:t},c.add(e,t)});c.size()>0&&(a=c.removeMin(),(s=u[a]).distance!==Number.POSITIVE_INFINITY);)o(a).forEach(h);return u}return n(i,"dijkstra"),n(o,"runDijkstra"),dc}function Kp(){if(_c)return pc;_c=1;var e=Up(),t=Hp();function r(r,n,i){return t.transform(r.nodes(),function(t,o){t[o]=e(r,o,n,i)},{})}return pc=r,n(r,"dijkstraAll"),pc}function Qp(){if(mc)return gc;mc=1;var e=Hp();function t(t){var r=0,i=[],o={},a=[];function s(n){var u=o[n]={onStack:!0,lowlink:r,index:r++};if(i.push(n),t.successors(n).forEach(function(t){e.has(o,t)?o[t].onStack&&(u.lowlink=Math.min(u.lowlink,o[t].index)):(s(t),u.lowlink=Math.min(u.lowlink,o[t].lowlink))}),u.lowlink===u.index){var c,h=[];do{c=i.pop(),o[c].onStack=!1,h.push(c)}while(n!==c);a.push(h)}}return n(s,"dfs"),t.nodes().forEach(function(t){e.has(o,t)||s(t)}),a}return gc=t,n(t,"tarjan"),gc}function Jp(){if(vc)return yc;vc=1;var e=Hp(),t=Qp();function r(r){return e.filter(t(r),function(e){return e.length>1||1===e.length&&r.hasEdge(e[0],e[0])})}return yc=r,n(r,"findCycles"),yc}function Ap(){if(wc)return bc;wc=1;var e=Hp();bc=r;var t=e.constant(1);function r(e,r,n){return i(e,r||t,n||function(t){return e.outEdges(t)})}function i(e,t,r){var n={},i=e.nodes();return i.forEach(function(e){n[e]={},n[e][e]={distance:0},i.forEach(function(t){e!==t&&(n[e][t]={distance:Number.POSITIVE_INFINITY})}),r(e).forEach(function(r){var i=r.v===e?r.w:r.v,o=t(r);n[e][i]={distance:o,predecessor:e}})}),i.forEach(function(e){var t=n[e];i.forEach(function(r){var o=n[r];i.forEach(function(r){var n=o[e],i=t[r],a=o[r],s=n.distance+i.distance;s<a.distance&&(a.distance=s,a.predecessor=i.predecessor)})})}),n}return n(r,"floydWarshall"),n(i,"runFloydWarshall"),bc}function e_(){if(Ec)return xc;Ec=1;var e=Hp();function t(t){var i={},o={},a=[];function s(n){if(e.has(o,n))throw new r;e.has(i,n)||(o[n]=!0,i[n]=!0,e.each(t.predecessors(n),s),delete o[n],a.push(n))}if(n(s,"visit"),e.each(t.sinks(),s),e.size(i)!==t.nodeCount())throw new r;return a}function r(){}return xc=t,t.CycleException=r,n(t,"topsort"),n(r,"CycleException"),r.prototype=new Error,xc}function t_(){if(kc)return Cc;kc=1;var e=e_();function t(t){try{e(t)}catch(r){if(r instanceof e.CycleException)return!1;throw r}return!0}return Cc=t,n(t,"isAcyclic"),Cc}function r_(){if(Oc)return Dc;Oc=1;var e=Hp();function t(t,n,i){e.isArray(n)||(n=[n]);var o=(t.isDirected()?t.successors:t.neighbors).bind(t),a=[],s={};return e.each(n,function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);r(t,e,"post"===i,s,o,a)}),a}function r(t,n,i,o,a,s){e.has(o,n)||(o[n]=!0,i||s.push(n),e.each(a(n),function(e){r(t,e,i,o,a,s)}),i&&s.push(n))}return Dc=t,n(t,"dfs"),n(r,"doDfs"),Dc}function n_(){if(Sc)return Mc;Sc=1;var e=r_();function t(t,r){return e(t,r,"post")}return Mc=t,n(t,"postorder"),Mc}function i_(){if(Pc)return Fc;Pc=1;var e=r_();function t(t,r){return e(t,r,"pre")}return Fc=t,n(t,"preorder"),Fc}function o_(){if(Bc)return Rc;Bc=1;var e=Hp(),t=Gp(),r=Zp();function i(i,o){var a,s=new t,u={},c=new r;function h(e){var t=e.v===a?e.w:e.v,r=c.priority(t);if(void 0!==r){var n=o(e);n<r&&(u[t]=a,c.decrease(t,n))}}if(n(h,"updateNeighbors"),0===i.nodeCount())return s;e.each(i.nodes(),function(e){c.add(e,Number.POSITIVE_INFINITY),s.setNode(e)}),c.decrease(i.nodes()[0],0);for(var l=!1;c.size()>0;){if(a=c.removeMin(),e.has(u,a))s.setEdge(a,u[a]);else{if(l)throw new Error("Input graph is not connected: "+i);l=!0}i.nodeEdges(a).forEach(h)}return s}return Rc=i,n(i,"prim"),Rc}function a_(){return jc?Nc:(jc=1,Nc={components:Wp(),dijkstra:Up(),dijkstraAll:Kp(),findCycles:Jp(),floydWarshall:Ap(),isAcyclic:t_(),postorder:n_(),preorder:i_(),prim:o_(),tarjan:Qp(),topsort:e_()})}function s_(){if(Lc)return Ic;Lc=1;var e=Xp();return Ic={Graph:e.Graph,json:zp(),alg:a_(),version:e.version}}function u_(){if($c)return qc;var e;$c=1;try{e=s_()}catch(t){}return e||(e=window.graphlib),qc=e}function c_(){if(Yc)return Tc;Yc=1;var e=uf();function t(t){return e(t,5)}return n(t,"cloneDeep"),Tc=t}function h_(){if(Gc)return Hc;Gc=1;var e=xr(),t=wi(),r=In(),i=$r();function o(n,o,a){if(!i(a))return!1;var s=typeof o;return!!("number"==s?t(a)&&r(o,a.length):"string"==s&&o in a)&&e(a[o],n)}return n(o,"isIterateeCall"),Hc=o}function l_(){if(Xc)return Vc;Xc=1;var e=Mp(),t=xr(),r=h_(),n=Di(),i=Object.prototype,o=i.hasOwnProperty,a=e(function(e,a){e=Object(e);var s=-1,u=a.length,c=u>2?a[2]:void 0;for(c&&r(a[0],a[1],c)&&(u=1);++s<u;)for(var h=a[s],l=n(h),d=-1,f=l.length;++d<f;){var p=l[d],_=e[p];(void 0===_||t(_,i[p])&&!o.call(e,p))&&(e[p]=h[p])}return e});return Vc=a}function d_(){if(Wc)return zc;Wc=1;var e=np(),t=wi(),r=xi();function i(i){return function(o,a,s){var u=Object(o);if(!t(o)){var c=e(a,3);o=r(o),a=/* @__PURE__ */n(function(e){return c(u[e],e,u)},"predicate")}var h=i(o,a,s);return h>-1?u[c?o[h]:h]:void 0}}return n(i,"createFind"),zc=i}function f_(){if(Uc)return Zc;Uc=1;var e=/\s/;function t(t){for(var r=t.length;r--&&e.test(t.charAt(r)););return r}return n(t,"trimmedEndIndex"),Zc=t}function p_(){if(Qc)return Kc;Qc=1;var e=f_(),t=/^\s+/;function r(r){return r?r.slice(0,e(r)+1).replace(t,""):r}return n(r,"baseTrim"),Kc=r}function __(){if(Ac)return Jc;Ac=1;var e=p_(),t=$r(),r=qf(),i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,a=/^0o[0-7]+$/i,s=parseInt;function u(n){if("number"==typeof n)return n;if(r(n))return NaN;if(t(n)){var u="function"==typeof n.valueOf?n.valueOf():n;n=t(u)?u+"":u}if("string"!=typeof n)return 0===n?n:+n;n=e(n);var c=o.test(n);return c||a.test(n)?s(n.slice(2),c?2:8):i.test(n)?NaN:+n}return n(u,"toNumber"),Jc=u}function g_(){if(th)return eh;th=1;var e=__(),t=1/0;function r(r){return r?(r=e(r))===t||r===-1/0?17976931348623157e292*(r<0?-1:1):r==r?r:0:0===r?r:0}return n(r,"toFinite"),eh=r}function m_(){if(nh)return rh;nh=1;var e=g_();function t(t){var r=e(t),n=r%1;return r==r?n?r-n:r:0}return n(t,"toInteger"),rh=t}function y_(){if(oh)return ih;oh=1;var e=Sp(),t=np(),r=m_(),i=Math.max;function o(n,o,a){var s=null==n?0:n.length;if(!s)return-1;var u=null==a?0:r(a);return u<0&&(u=i(s+u,0)),e(n,t(o,3),u)}return n(o,"findIndex"),ih=o}function v_(){if(sh)return ah;sh=1;var e=d_()(y_());return ah=e}function b_(){if(ch)return uh;ch=1;var e=xp();function t(t){return(null==t?0:t.length)?e(t,1):[]}return n(t,"flatten"),uh=t}function w_(){if(lh)return hh;lh=1;var e=df(),t=mf(),r=Di();function i(n,i){return null==n?n:e(n,t(i),r)}return n(i,"forIn"),hh=i}function x_(){if(fh)return dh;function e(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}return fh=1,n(e,"last"),dh=e}function E_(){if(_h)return ph;_h=1;var e=pn(),t=ff(),r=np();function i(n,i){var o={};return i=r(i,3),t(n,function(t,r,n){e(o,r,i(t,r,n))}),o}return n(i,"mapValues"),ph=i}function C_(){if(mh)return gh;mh=1;var e=qf();function t(t,r,n){for(var i=-1,o=t.length;++i<o;){var a=t[i],s=r(a);if(null!=s&&(void 0===u?s==s&&!e(s):n(s,u)))var u=s,c=a}return c}return n(t,"baseExtremum"),gh=t}function k_(){if(vh)return yh;function e(e,t){return e>t}return vh=1,n(e,"baseGt"),yh=e}function D_(){if(wh)return bh;wh=1;var e=C_(),t=k_(),r=gf();function i(n){return n&&n.length?e(n,r,t):void 0}return n(i,"max"),bh=i}function O_(){if(Eh)return xh;Eh=1;var e=pn(),t=xr();function r(r,n,i){(void 0!==i&&!t(r[n],i)||void 0===i&&!(n in r))&&e(r,n,i)}return n(r,"assignMergeValue"),xh=r}function M_(){if(kh)return Ch;kh=1;var e=qr(),t=Id(),r=yn(),i=Function.prototype,o=Object.prototype,a=i.toString,s=o.hasOwnProperty,u=a.call(Object);function c(n){if(!r(n)||"[object Object]"!=e(n))return!1;var i=t(n);if(null===i)return!0;var o=s.call(i,"constructor")&&i.constructor;return"function"==typeof o&&o instanceof o&&a.call(o)==u}return n(c,"isPlainObject"),Ch=c}function S_(){if(Oh)return Dh;function e(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}return Oh=1,n(e,"safeGet"),Dh=e}function F_(){if(Sh)return Mh;Sh=1;var e=gn(),t=Di();function r(r){return e(r,t(r))}return n(r,"toPlainObject"),Mh=r}function P_(){if(Ph)return Fh;Ph=1;var e=O_(),t=Sd(),r=Ad(),i=Fd(),o=rf(),a=bn(),s=wn(),u=qp(),c=jn(),h=Tr(),l=$r(),d=M_(),f=_i(),p=S_(),_=F_();function g(n,g,m,y,v,b,w){var x=p(n,m),E=p(g,m),C=w.get(E);if(C)e(n,m,C);else{var k=b?b(x,E,m+"",n,g,w):void 0,D=void 0===k;if(D){var O=s(E),M=!O&&c(E),S=!O&&!M&&f(E);k=E,O||M||S?s(x)?k=x:u(x)?k=i(x):M?(D=!1,k=t(E,!0)):S?(D=!1,k=r(E,!0)):k=[]:d(E)||a(E)?(k=x,a(x)?k=_(x):l(x)&&!h(x)||(k=o(E))):D=!1}D&&(w.set(E,k),v(k,E,y,b,w),w.delete(E)),e(n,m,k)}}return n(g,"baseMergeDeep"),Fh=g}function R_(){if(Bh)return Rh;Bh=1;var e=ln(),t=O_(),r=df(),i=P_(),o=$r(),a=Di(),s=S_();function u(n,c,h,l,d){n!==c&&r(c,function(r,a){if(d||(d=new e),o(r))i(n,c,a,h,u,l,d);else{var f=l?l(s(n,a),r,a+"",n,c,d):void 0;void 0===f&&(f=r),t(n,a,f)}},a)}return n(u,"baseMerge"),Rh=u}function B_(){if(jh)return Nh;jh=1;var e=Mp(),t=h_();function r(r){return e(function(e,n){var i=-1,o=n.length,a=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(a=r.length>3&&"function"==typeof a?(o--,a):void 0,s&&t(n[0],n[1],s)&&(a=o<3?void 0:a,o=1),e=Object(e);++i<o;){var u=n[i];u&&r(e,u,i,a)}return e})}return n(r,"createAssigner"),Nh=r}function N_(){if(Lh)return Ih;Lh=1;var e=R_(),t=B_()(function(t,r,n){e(t,r,n)});return Ih=t}function j_(){if($h)return qh;function e(e,t){return e<t}return $h=1,n(e,"baseLt"),qh=e}function I_(){if(Yh)return Th;Yh=1;var e=C_(),t=j_(),r=gf();function i(n){return n&&n.length?e(n,r,t):void 0}return n(i,"min"),Th=i}function L_(){if(Gh)return Hh;Gh=1;var e=C_(),t=np(),r=j_();function i(n,i){return n&&n.length?e(n,t(i,2),r):void 0}return n(i,"minBy"),Hh=i}function q_(){if(Xh)return Vh;Xh=1;var e=Nr();return Vh=/* @__PURE__ */n(function(){return e.Date.now()},"now")}function $_(){if(Wh)return zh;Wh=1;var e=_n(),t=zf(),r=In(),i=$r(),o=Wf();function a(n,a,s,u){if(!i(n))return n;for(var c=-1,h=(a=t(a,n)).length,l=h-1,d=n;null!=d&&++c<h;){var f=o(a[c]),p=s;if("__proto__"===f||"constructor"===f||"prototype"===f)return n;if(c!=l){var _=d[f];void 0===(p=u?u(_,f,d):void 0)&&(p=i(_)?_:r(a[c+1])?[]:{})}e(d,f,p),d=d[f]}return n}return n(a,"baseSet"),zh=a}function T_(){if(Uh)return Zh;Uh=1;var e=Zf(),t=$_(),r=zf();function i(n,i,o){for(var a=-1,s=i.length,u={};++a<s;){var c=i[a],h=e(n,c);o(h,c)&&t(u,r(c,n),h)}return u}return n(i,"basePickBy"),Zh=i}function Y_(){if(Qh)return Kh;Qh=1;var e=T_(),t=Jf();function r(r,n){return e(r,n,function(e,n){return t(r,n)})}return n(r,"basePick"),Kh=r}function H_(){if(Ah)return Jh;Ah=1;var e=b_(),t=Cp(),r=Op();function i(n){return r(t(n,void 0,e),n+"")}return n(i,"flatRest"),Jh=i}function G_(){if(tl)return el;tl=1;var e=Y_(),t=H_()(function(t,r){return null==t?{}:e(t,r)});return el=t}function V_(){if(nl)return rl;nl=1;var e=Math.ceil,t=Math.max;function r(r,n,i,o){for(var a=-1,s=t(e((n-r)/(i||1)),0),u=Array(s);s--;)u[o?s:++a]=r,r+=i;return u}return n(r,"baseRange"),rl=r}function X_(){if(ol)return il;ol=1;var e=V_(),t=h_(),r=g_();function i(n){return function(i,o,a){return a&&"number"!=typeof a&&t(i,o,a)&&(o=a=void 0),i=r(i),void 0===o?(o=i,i=0):o=r(o),a=void 0===a?i<o?1:-1:r(a),e(i,o,a,n)}}return n(i,"createRange"),il=i}function z_(){if(sl)return al;sl=1;var e=X_()();return al=e}function W_(){if(cl)return ul;function e(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}return cl=1,n(e,"baseSortBy"),ul=e}function Z_(){if(ll)return hl;ll=1;var e=qf();function t(t,r){if(t!==r){var n=void 0!==t,i=null===t,o=t==t,a=e(t),s=void 0!==r,u=null===r,c=r==r,h=e(r);if(!u&&!h&&!a&&t>r||a&&s&&c&&!u&&!h||i&&s&&c||!n&&c||!o)return 1;if(!i&&!a&&!h&&t<r||h&&n&&o&&!i&&!a||u&&n&&o||!s&&o||!c)return-1}return 0}return n(t,"compareAscending"),hl=t}function U_(){if(fl)return dl;fl=1;var e=Z_();function t(t,r,n){for(var i=-1,o=t.criteria,a=r.criteria,s=o.length,u=n.length;++i<s;){var c=e(o[i],a[i]);if(c)return i>=u?c:c*("desc"==n[i]?-1:1)}return t.index-r.index}return n(t,"compareMultiple"),dl=t}function K_(){if(_l)return pl;_l=1;var e=Gf(),t=Zf(),r=np(),i=cp(),o=W_(),a=$n(),s=U_(),u=gf(),c=wn();function h(n,h,l){h=h.length?e(h,function(e){return c(e)?function(r){return t(r,1===e.length?e[0]:e)}:e}):[u];var d=-1;h=e(h,a(r));var f=i(n,function(t,r,n){return{criteria:e(h,function(e){return e(t)}),index:++d,value:t}});return o(f,function(e,t){return s(e,t,l)})}return n(h,"baseOrderBy"),pl=h}function Q_(){if(ml)return gl;ml=1;var e=xp(),t=K_(),r=Mp(),n=h_(),i=r(function(r,i){if(null==r)return[];var o=i.length;return o>1&&n(r,i[0],i[1])?i=[]:o>2&&n(i[0],i[1],i[2])&&(i=[i[0]]),t(r,e(i,1),[])});return gl=i}function J_(){if(vl)return yl;vl=1;var e=Xf(),t=0;function r(r){var n=++t;return e(r)+n}return n(r,"uniqueId"),yl=r}function A_(){if(wl)return bl;function e(e,t,r){for(var n=-1,i=e.length,o=t.length,a={};++n<i;){var s=n<o?t[n]:void 0;r(a,e[n],s)}return a}return wl=1,n(e,"baseZipObject"),bl=e}function eg(){if(El)return xl;El=1;var e=_n(),t=A_();function r(r,n){return t(r||[],n||[],e)}return n(r,"zipObject"),xl=r}function tg(){if(kl)return Cl;var e;kl=1;try{e={cloneDeep:c_(),constant:hf(),defaults:l_(),each:vf(),filter:ip(),find:v_(),flatten:b_(),forEach:yf(),forIn:w_(),has:ap(),isUndefined:up(),last:x_(),map:hp(),mapValues:E_(),max:D_(),merge:N_(),min:I_(),minBy:L_(),now:q_(),pick:G_(),range:z_(),reduce:fp(),sortBy:Q_(),uniqueId:J_(),values:Yp(),zipObject:eg()}}catch(t){}return e||(e=window._),Cl=e}function rg(){if(Ol)return Dl;function e(){var e={};e._next=e._prev=e,this._sentinel=e}function t(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function r(e,t){if("_next"!==e&&"_prev"!==e)return t}return Ol=1,Dl=e,n(e,"List"),e.prototype.dequeue=function(){var e=this._sentinel,r=e._prev;if(r!==e)return t(r),r},e.prototype.enqueue=function(e){var r=this._sentinel;e._prev&&e._next&&t(e),e._next=r._next,r._next._prev=e,r._next=e,e._prev=r},e.prototype.toString=function(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,r)),n=n._prev;return"["+e.join(", ")+"]"},n(t,"unlink"),n(r,"filterOutLinks"),Dl}function ng(){if(Sl)return Ml;Sl=1;var e=tg(),t=u_().Graph,r=rg();Ml=o;var i=e.constant(1);function o(t,r){if(t.nodeCount()<=1)return[];var n=u(t,r||i),o=a(n.graph,n.buckets,n.zeroIdx);return e.flatten(e.map(o,function(e){return t.outEdges(e.v,e.w)}),!0)}function a(e,t,r){for(var n,i=[],o=t[t.length-1],a=t[0];e.nodeCount();){for(;n=a.dequeue();)s(e,t,r,n);for(;n=o.dequeue();)s(e,t,r,n);if(e.nodeCount())for(var u=t.length-2;u>0;--u)if(n=t[u].dequeue()){i=i.concat(s(e,t,r,n,!0));break}}return i}function s(t,r,n,i,o){var a=o?[]:void 0;return e.forEach(t.inEdges(i.v),function(e){var i=t.edge(e),s=t.node(e.v);o&&a.push({v:e.v,w:e.w}),s.out-=i,c(r,n,s)}),e.forEach(t.outEdges(i.v),function(e){var i=t.edge(e),o=e.w,a=t.node(o);a.in-=i,c(r,n,a)}),t.removeNode(i.v),a}function u(n,i){var o=new t,a=0,s=0;e.forEach(n.nodes(),function(e){o.setNode(e,{v:e,in:0,out:0})}),e.forEach(n.edges(),function(e){var t=o.edge(e.v,e.w)||0,r=i(e),n=t+r;o.setEdge(e.v,e.w,n),s=Math.max(s,o.node(e.v).out+=r),a=Math.max(a,o.node(e.w).in+=r)});var u=e.range(s+a+3).map(function(){return new r}),h=a+1;return e.forEach(o.nodes(),function(e){c(u,h,o.node(e))}),{graph:o,buckets:u,zeroIdx:h}}function c(e,t,r){r.out?r.in?e[r.out-r.in+t].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}return n(o,"greedyFAS"),n(a,"doGreedyFAS"),n(s,"removeNode"),n(u,"buildState"),n(c,"assignBucket"),Ml}function ig(){if(Pl)return Fl;Pl=1;var e=tg(),t=ng();function r(r){var o="greedy"===r.graph().acyclicer?t(r,a(r)):i(r);function a(e){return function(t){return e.edge(t).weight}}e.forEach(o,function(t){var n=r.edge(t);r.removeEdge(t),n.forwardName=t.name,n.reversed=!0,r.setEdge(t.w,t.v,n,e.uniqueId("rev"))}),n(a,"weightFn")}function i(t){var r=[],i={},o={};function a(n){e.has(o,n)||(o[n]=!0,i[n]=!0,e.forEach(t.outEdges(n),function(t){e.has(i,t.w)?r.push(t):a(t.w)}),delete i[n])}return n(a,"dfs"),e.forEach(t.nodes(),a),r}function o(t){e.forEach(t.edges(),function(e){var r=t.edge(e);if(r.reversed){t.removeEdge(e);var n=r.forwardName;delete r.reversed,delete r.forwardName,t.setEdge(e.w,e.v,r,n)}})}return Fl={run:r,undo:o},n(r,"run"),n(i,"dfsFAS"),n(o,"undo"),Fl}function og(){if(Bl)return Rl;Bl=1;var e=tg(),t=u_().Graph;function r(t,r,n,i){var o;do{o=e.uniqueId(i)}while(t.hasNode(o));return n.dummy=r,t.setNode(o,n),o}function i(r){var n=(new t).setGraph(r.graph());return e.forEach(r.nodes(),function(e){n.setNode(e,r.node(e))}),e.forEach(r.edges(),function(e){var t=n.edge(e.v,e.w)||{weight:0,minlen:1},i=r.edge(e);n.setEdge(e.v,e.w,{weight:t.weight+i.weight,minlen:Math.max(t.minlen,i.minlen)})}),n}function o(r){var n=new t({multigraph:r.isMultigraph()}).setGraph(r.graph());return e.forEach(r.nodes(),function(e){r.children(e).length||n.setNode(e,r.node(e))}),e.forEach(r.edges(),function(e){n.setEdge(e,r.edge(e))}),n}function a(t){var r=e.map(t.nodes(),function(r){var n={};return e.forEach(t.outEdges(r),function(e){n[e.w]=(n[e.w]||0)+t.edge(e).weight}),n});return e.zipObject(t.nodes(),r)}function s(t){var r=e.map(t.nodes(),function(r){var n={};return e.forEach(t.inEdges(r),function(e){n[e.v]=(n[e.v]||0)+t.edge(e).weight}),n});return e.zipObject(t.nodes(),r)}function u(e,t){var r,n,i=e.x,o=e.y,a=t.x-i,s=t.y-o,u=e.width/2,c=e.height/2;if(!a&&!s)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(s)*u>Math.abs(a)*c?(s<0&&(c=-c),r=c*a/s,n=c):(a<0&&(u=-u),r=u,n=u*s/a),{x:i+r,y:o+n}}function c(t){var r=e.map(e.range(f(t)+1),function(){return[]});return e.forEach(t.nodes(),function(n){var i=t.node(n),o=i.rank;e.isUndefined(o)||(r[o][i.order]=n)}),r}function h(t){var r=e.min(e.map(t.nodes(),function(e){return t.node(e).rank}));e.forEach(t.nodes(),function(n){var i=t.node(n);e.has(i,"rank")&&(i.rank-=r)})}function l(t){var r=e.min(e.map(t.nodes(),function(e){return t.node(e).rank})),n=[];e.forEach(t.nodes(),function(e){var i=t.node(e).rank-r;n[i]||(n[i]=[]),n[i].push(e)});var i=0,o=t.graph().nodeRankFactor;e.forEach(n,function(r,n){e.isUndefined(r)&&n%o!==0?--i:i&&e.forEach(r,function(e){t.node(e).rank+=i})})}function d(e,t,n,i){var o={width:0,height:0};return arguments.length>=4&&(o.rank=n,o.order=i),r(e,"border",o,t)}function f(t){return e.max(e.map(t.nodes(),function(r){var n=t.node(r).rank;if(!e.isUndefined(n))return n}))}function p(t,r){var n={lhs:[],rhs:[]};return e.forEach(t,function(e){r(e)?n.lhs.push(e):n.rhs.push(e)}),n}function _(t,r){var n=e.now();try{return r()}finally{console.log(t+" time: "+(e.now()-n)+"ms")}}function g(e,t){return t()}return Rl={addDummyNode:r,simplify:i,asNonCompoundGraph:o,successorWeights:a,predecessorWeights:s,intersectRect:u,buildLayerMatrix:c,normalizeRanks:h,removeEmptyRanks:l,addBorderNode:d,maxRank:f,partition:p,time:_,notime:g},n(r,"addDummyNode"),n(i,"simplify"),n(o,"asNonCompoundGraph"),n(a,"successorWeights"),n(s,"predecessorWeights"),n(u,"intersectRect"),n(c,"buildLayerMatrix"),n(h,"normalizeRanks"),n(l,"removeEmptyRanks"),n(d,"addBorderNode"),n(f,"maxRank"),n(p,"partition"),n(_,"time"),n(g,"notime"),Rl}function ag(){if(jl)return Nl;jl=1;var e=tg(),t=og();function r(t){t.graph().dummyChains=[],e.forEach(t.edges(),function(e){i(t,e)})}function i(e,r){var n=r.v,i=e.node(n).rank,o=r.w,a=e.node(o).rank,s=r.name,u=e.edge(r),c=u.labelRank;if(a!==i+1){var h,l,d;for(e.removeEdge(r),d=0,++i;i<a;++d,++i)u.points=[],l={width:0,height:0,edgeLabel:u,edgeObj:r,rank:i},h=t.addDummyNode(e,"edge",l,"_d"),i===c&&(l.width=u.width,l.height=u.height,l.dummy="edge-label",l.labelpos=u.labelpos),e.setEdge(n,h,{weight:u.weight},s),0===d&&e.graph().dummyChains.push(h),n=h;e.setEdge(n,o,{weight:u.weight},s)}}function o(t){e.forEach(t.graph().dummyChains,function(e){var r,n=t.node(e),i=n.edgeLabel;for(t.setEdge(n.edgeObj,i);n.dummy;)r=t.successors(e)[0],t.removeNode(e),i.points.push({x:n.x,y:n.y}),"edge-label"===n.dummy&&(i.x=n.x,i.y=n.y,i.width=n.width,i.height=n.height),e=r,n=t.node(e)})}return Nl={run:r,undo:o},n(r,"run"),n(i,"normalizeEdge"),n(o,"undo"),Nl}function sg(){if(Ll)return Il;Ll=1;var e=tg();function t(t){var r={};function i(n){var o=t.node(n);if(e.has(r,n))return o.rank;r[n]=!0;var a=e.min(e.map(t.outEdges(n),function(e){return i(e.w)-t.edge(e).minlen}));return a!==Number.POSITIVE_INFINITY&&null!=a||(a=0),o.rank=a}n(i,"dfs"),e.forEach(t.sources(),i)}function r(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}return Il={longestPath:t,slack:r},n(t,"longestPath"),n(r,"slack"),Il}function ug(){if($l)return ql;$l=1;var e=tg(),t=u_().Graph,r=sg().slack;function i(e){var n,i,u=new t({directed:!1}),c=e.nodes()[0],h=e.nodeCount();for(u.setNode(c,{});o(u,e)<h;)n=a(u,e),i=u.hasNode(n.v)?r(e,n):-r(e,n),s(u,e,i);return u}function o(t,i){function o(n){e.forEach(i.nodeEdges(n),function(e){var a=e.v,s=n===a?e.w:a;t.hasNode(s)||r(i,e)||(t.setNode(s,{}),t.setEdge(n,s,{}),o(s))})}return n(o,"dfs"),e.forEach(t.nodes(),o),t.nodeCount()}function a(t,n){return e.minBy(n.edges(),function(e){if(t.hasNode(e.v)!==t.hasNode(e.w))return r(n,e)})}function s(t,r,n){e.forEach(t.nodes(),function(e){r.node(e).rank+=n})}return ql=i,n(i,"feasibleTree"),n(o,"tightTree"),n(a,"findMinSlackEdge"),n(s,"shiftRanks"),ql}function cg(){if(Yl)return Tl;Yl=1;var e=tg(),t=ug(),r=sg().slack,i=sg().longestPath,o=u_().alg.preorder,a=u_().alg.postorder,s=og().simplify;function u(e){e=s(e),i(e);var r,n=t(e);for(d(n),c(n,e);r=p(n);)g(n,e,r,_(n,e,r))}function c(t,r){var n=a(t,t.nodes());n=n.slice(0,n.length-1),e.forEach(n,function(e){h(t,r,e)})}function h(e,t,r){var n=e.node(r).parent;e.edge(r,n).cutvalue=l(e,t,r)}function l(t,r,n){var i=t.node(n).parent,o=!0,a=r.edge(n,i),s=0;return a||(o=!1,a=r.edge(i,n)),s=a.weight,e.forEach(r.nodeEdges(n),function(e){var a=e.v===n,u=a?e.w:e.v;if(u!==i){var c=a===o,h=r.edge(e).weight;if(s+=c?h:-h,y(t,n,u)){var l=t.edge(n,u).cutvalue;s+=c?-l:l}}}),s}function d(e,t){arguments.length<2&&(t=e.nodes()[0]),f(e,{},1,t)}function f(t,r,n,i,o){var a=n,s=t.node(i);return r[i]=!0,e.forEach(t.neighbors(i),function(o){e.has(r,o)||(n=f(t,r,n,o,i))}),s.low=a,s.lim=n++,o?s.parent=o:delete s.parent,n}function p(t){return e.find(t.edges(),function(e){return t.edge(e).cutvalue<0})}function _(t,n,i){var o=i.v,a=i.w;n.hasEdge(o,a)||(o=i.w,a=i.v);var s=t.node(o),u=t.node(a),c=s,h=!1;s.lim>u.lim&&(c=u,h=!0);var l=e.filter(n.edges(),function(e){return h===v(t,t.node(e.v),c)&&h!==v(t,t.node(e.w),c)});return e.minBy(l,function(e){return r(n,e)})}function g(e,t,r,n){var i=r.v,o=r.w;e.removeEdge(i,o),e.setEdge(n.v,n.w,{}),d(e),c(e,t),m(e,t)}function m(t,r){var n=e.find(t.nodes(),function(e){return!r.node(e).parent}),i=o(t,n);i=i.slice(1),e.forEach(i,function(e){var n=t.node(e).parent,i=r.edge(e,n),o=!1;i||(i=r.edge(n,e),o=!0),r.node(e).rank=r.node(n).rank+(o?i.minlen:-i.minlen)})}function y(e,t,r){return e.hasEdge(t,r)}function v(e,t,r){return r.low<=t.lim&&t.lim<=r.lim}return Tl=u,u.initLowLimValues=d,u.initCutValues=c,u.calcCutValue=l,u.leaveEdge=p,u.enterEdge=_,u.exchangeEdges=g,n(u,"networkSimplex"),n(c,"initCutValues"),n(h,"assignCutValue"),n(l,"calcCutValue"),n(d,"initLowLimValues"),n(f,"dfsAssignLowLim"),n(p,"leaveEdge"),n(_,"enterEdge"),n(g,"exchangeEdges"),n(m,"updateRanks"),n(y,"isTreeEdge"),n(v,"isDescendant"),Tl}function hg(){if(Gl)return Hl;Gl=1;var e=sg().longestPath,t=ug(),r=cg();function i(e){switch(e.graph().ranker){case"network-simplex":default:s(e);break;case"tight-tree":a(e);break;case"longest-path":o(e)}}Hl=i,n(i,"rank");var o=e;function a(r){e(r),t(r)}function s(e){r(e)}return n(a,"tightTreeRanker"),n(s,"networkSimplexRanker"),Hl}function lg(){if(Xl)return Vl;Xl=1;var e=tg();function t(t){var n=i(t);e.forEach(t.graph().dummyChains,function(e){for(var i=t.node(e),o=i.edgeObj,a=r(t,n,o.v,o.w),s=a.path,u=a.lca,c=0,h=s[c],l=!0;e!==o.w;){if(i=t.node(e),l){for(;(h=s[c])!==u&&t.node(h).maxRank<i.rank;)c++;h===u&&(l=!1)}if(!l){for(;c<s.length-1&&t.node(h=s[c+1]).minRank<=i.rank;)c++;h=s[c]}t.setParent(e,h),e=t.successors(e)[0]}})}function r(e,t,r,n){var i,o,a=[],s=[],u=Math.min(t[r].low,t[n].low),c=Math.max(t[r].lim,t[n].lim);i=r;do{i=e.parent(i),a.push(i)}while(i&&(t[i].low>u||c>t[i].lim));for(o=i,i=n;(i=e.parent(i))!==o;)s.push(i);return{path:a.concat(s.reverse()),lca:o}}function i(t){var r={},i=0;function o(n){var a=i;e.forEach(t.children(n),o),r[n]={low:a,lim:i++}}return n(o,"dfs"),e.forEach(t.children(),o),r}return Vl=t,n(t,"parentDummyChains"),n(r,"findPath"),n(i,"postorder"),Vl}function dg(){if(Wl)return zl;Wl=1;var e=tg(),t=og();function r(r){var n=t.addDummyNode(r,"root",{},"_root"),s=o(r),u=e.max(e.values(s))-1,c=2*u+1;r.graph().nestingRoot=n,e.forEach(r.edges(),function(e){r.edge(e).minlen*=c});var h=a(r)+1;e.forEach(r.children(),function(e){i(r,n,c,h,u,s,e)}),r.graph().nodeRankFactor=c}function i(r,n,o,a,s,u,c){var h=r.children(c);if(h.length){var l=t.addBorderNode(r,"_bt"),d=t.addBorderNode(r,"_bb"),f=r.node(c);r.setParent(l,c),f.borderTop=l,r.setParent(d,c),f.borderBottom=d,e.forEach(h,function(e){i(r,n,o,a,s,u,e);var t=r.node(e),h=t.borderTop?t.borderTop:e,f=t.borderBottom?t.borderBottom:e,p=t.borderTop?a:2*a,_=h!==f?1:s-u[c]+1;r.setEdge(l,h,{weight:p,minlen:_,nestingEdge:!0}),r.setEdge(f,d,{weight:p,minlen:_,nestingEdge:!0})}),r.parent(c)||r.setEdge(n,l,{weight:0,minlen:s+u[c]})}else c!==n&&r.setEdge(n,c,{weight:0,minlen:o})}function o(t){var r={};function i(n,o){var a=t.children(n);a&&a.length&&e.forEach(a,function(e){i(e,o+1)}),r[n]=o}return n(i,"dfs"),e.forEach(t.children(),function(e){i(e,1)}),r}function a(t){return e.reduce(t.edges(),function(e,r){return e+t.edge(r).weight},0)}function s(t){var r=t.graph();t.removeNode(r.nestingRoot),delete r.nestingRoot,e.forEach(t.edges(),function(e){t.edge(e).nestingEdge&&t.removeEdge(e)})}return zl={run:r,cleanup:s},n(r,"run"),n(i,"dfs"),n(o,"treeDepths"),n(a,"sumWeights"),n(s,"cleanup"),zl}function fg(){if(Ul)return Zl;Ul=1;var e=tg(),t=og();function r(t){function r(n){var o=t.children(n),a=t.node(n);if(o.length&&e.forEach(o,r),e.has(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var s=a.minRank,u=a.maxRank+1;s<u;++s)i(t,"borderLeft","_bl",n,a,s),i(t,"borderRight","_br",n,a,s)}}n(r,"dfs"),e.forEach(t.children(),r)}function i(e,r,n,i,o,a){var s={width:0,height:0,rank:a,borderType:r},u=o[r][a-1],c=t.addDummyNode(e,"border",s,n);o[r][a]=c,e.setParent(c,i),u&&e.setEdge(u,c,{weight:1})}return Zl=r,n(r,"addBorderSegments"),n(i,"addBorderNode"),Zl}function pg(){if(Ql)return Kl;Ql=1;var e=tg();function t(e){var t=e.graph().rankdir.toLowerCase();"lr"!==t&&"rl"!==t||i(e)}function r(e){var t=e.graph().rankdir.toLowerCase();"bt"!==t&&"rl"!==t||a(e),"lr"!==t&&"rl"!==t||(u(e),i(e))}function i(t){e.forEach(t.nodes(),function(e){o(t.node(e))}),e.forEach(t.edges(),function(e){o(t.edge(e))})}function o(e){var t=e.width;e.width=e.height,e.height=t}function a(t){e.forEach(t.nodes(),function(e){s(t.node(e))}),e.forEach(t.edges(),function(r){var n=t.edge(r);e.forEach(n.points,s),e.has(n,"y")&&s(n)})}function s(e){e.y=-e.y}function u(t){e.forEach(t.nodes(),function(e){c(t.node(e))}),e.forEach(t.edges(),function(r){var n=t.edge(r);e.forEach(n.points,c),e.has(n,"x")&&c(n)})}function c(e){var t=e.x;e.x=e.y,e.y=t}return Kl={adjust:t,undo:r},n(t,"adjust"),n(r,"undo"),n(i,"swapWidthHeight"),n(o,"swapWidthHeightOne"),n(a,"reverseY"),n(s,"reverseYOne"),n(u,"swapXY"),n(c,"swapXYOne"),Kl}function _g(){if(Al)return Jl;Al=1;var e=tg();function t(t){var r={},i=e.filter(t.nodes(),function(e){return!t.children(e).length}),o=e.max(e.map(i,function(e){return t.node(e).rank})),a=e.map(e.range(o+1),function(){return[]});function s(n){if(!e.has(r,n)){r[n]=!0;var i=t.node(n);a[i.rank].push(n),e.forEach(t.successors(n),s)}}n(s,"dfs");var u=e.sortBy(i,function(e){return t.node(e).rank});return e.forEach(u,s),a}return Jl=t,n(t,"initOrder"),Jl}function gg(){if(td)return ed;td=1;var e=tg();function t(e,t){for(var n=0,i=1;i<t.length;++i)n+=r(e,t[i-1],t[i]);return n}function r(t,r,n){for(var i=e.zipObject(n,e.map(n,function(e,t){return t})),o=e.flatten(e.map(r,function(r){return e.sortBy(e.map(t.outEdges(r),function(e){return{pos:i[e.w],weight:t.edge(e).weight}}),"pos")}),!0),a=1;a<n.length;)a<<=1;var s=2*a-1;a-=1;var u=e.map(new Array(s),function(){return 0}),c=0;return e.forEach(o.forEach(function(e){var t=e.pos+a;u[t]+=e.weight;for(var r=0;t>0;)t%2&&(r+=u[t+1]),u[t=t-1>>1]+=e.weight;c+=e.weight*r})),c}return ed=t,n(t,"crossCount"),n(r,"twoLayerCrossCount"),ed}function mg(){if(nd)return rd;nd=1;var e=tg();function t(t,r){return e.map(r,function(r){var n=t.inEdges(r);if(n.length){var i=e.reduce(n,function(e,r){var n=t.edge(r),i=t.node(r.v);return{sum:e.sum+n.weight*i.order,weight:e.weight+n.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}return{v:r}})}return rd=t,n(t,"barycenter"),rd}function yg(){if(od)return id;od=1;var e=tg();function t(t,n){var i={};return e.forEach(t,function(t,r){var n=i[t.v]={indegree:0,in:[],out:[],vs:[t.v],i:r};e.isUndefined(t.barycenter)||(n.barycenter=t.barycenter,n.weight=t.weight)}),e.forEach(n.edges(),function(t){var r=i[t.v],n=i[t.w];e.isUndefined(r)||e.isUndefined(n)||(n.indegree++,r.out.push(i[t.w]))}),r(e.filter(i,function(e){return!e.indegree}))}function r(t){var r=[];function o(t){return function(r){r.merged||(e.isUndefined(r.barycenter)||e.isUndefined(t.barycenter)||r.barycenter>=t.barycenter)&&i(t,r)}}function a(e){return function(r){r.in.push(e),0===--r.indegree&&t.push(r)}}for(n(o,"handleIn"),n(a,"handleOut");t.length;){var s=t.pop();r.push(s),e.forEach(s.in.reverse(),o(s)),e.forEach(s.out,a(s))}return e.map(e.filter(r,function(e){return!e.merged}),function(t){return e.pick(t,["vs","i","barycenter","weight"])})}function i(e,t){var r=0,n=0;e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=r/n,e.weight=n,e.i=Math.min(t.i,e.i),t.merged=!0}return id=t,n(t,"resolveConflicts"),n(r,"doResolveConflicts"),n(i,"mergeEntries"),id}function vg(){if(sd)return ad;sd=1;var e=tg(),t=og();function r(r,n){var a=t.partition(r,function(t){return e.has(t,"barycenter")}),s=a.lhs,u=e.sortBy(a.rhs,function(e){return-e.i}),c=[],h=0,l=0,d=0;s.sort(o(!!n)),d=i(c,u,d),e.forEach(s,function(e){d+=e.vs.length,c.push(e.vs),h+=e.barycenter*e.weight,l+=e.weight,d=i(c,u,d)});var f={vs:e.flatten(c,!0)};return l&&(f.barycenter=h/l,f.weight=l),f}function i(t,r,n){for(var i;r.length&&(i=e.last(r)).i<=n;)r.pop(),t.push(i.vs),n++;return n}function o(e){return function(t,r){return t.barycenter<r.barycenter?-1:t.barycenter>r.barycenter?1:e?r.i-t.i:t.i-r.i}}return ad=r,n(r,"sort"),n(i,"consumeUnsortable"),n(o,"compareWithBias"),ad}function bg(){if(cd)return ud;cd=1;var e=tg(),t=mg(),r=yg(),i=vg();function o(n,u,c,h){var l=n.children(u),d=n.node(u),f=d?d.borderLeft:void 0,p=d?d.borderRight:void 0,_={};f&&(l=e.filter(l,function(e){return e!==f&&e!==p}));var g=t(n,l);e.forEach(g,function(t){if(n.children(t.v).length){var r=o(n,t.v,c,h);_[t.v]=r,e.has(r,"barycenter")&&s(t,r)}});var m=r(g,c);a(m,_);var y=i(m,h);if(f&&(y.vs=e.flatten([f,y.vs,p],!0),n.predecessors(f).length)){var v=n.node(n.predecessors(f)[0]),b=n.node(n.predecessors(p)[0]);e.has(y,"barycenter")||(y.barycenter=0,y.weight=0),y.barycenter=(y.barycenter*y.weight+v.order+b.order)/(y.weight+2),y.weight+=2}return y}function a(t,r){e.forEach(t,function(t){t.vs=e.flatten(t.vs.map(function(e){return r[e]?r[e].vs:e}),!0)})}function s(t,r){e.isUndefined(t.barycenter)?(t.barycenter=r.barycenter,t.weight=r.weight):(t.barycenter=(t.barycenter*t.weight+r.barycenter*r.weight)/(t.weight+r.weight),t.weight+=r.weight)}return ud=o,n(o,"sortSubgraph"),n(a,"expandSubgraphs"),n(s,"mergeBarycenters"),ud}function wg(){if(ld)return hd;ld=1;var e=tg(),t=u_().Graph;function r(r,n,o){var a=i(r),s=new t({compound:!0}).setGraph({root:a}).setDefaultNodeLabel(function(e){return r.node(e)});return e.forEach(r.nodes(),function(t){var i=r.node(t),u=r.parent(t);(i.rank===n||i.minRank<=n&&n<=i.maxRank)&&(s.setNode(t),s.setParent(t,u||a),e.forEach(r[o](t),function(n){var i=n.v===t?n.w:n.v,o=s.edge(i,t),a=e.isUndefined(o)?0:o.weight;s.setEdge(i,t,{weight:r.edge(n).weight+a})}),e.has(i,"minRank")&&s.setNode(t,{borderLeft:i.borderLeft[n],borderRight:i.borderRight[n]}))}),s}function i(t){for(var r;t.hasNode(r=e.uniqueId("_root")););return r}return hd=r,n(r,"buildLayerGraph"),n(i,"createRootNode"),hd}function xg(){if(fd)return dd;fd=1;var e=tg();function t(t,r,n){var i,o={};e.forEach(n,function(e){for(var n,a,s=t.parent(e);s;){if((n=t.parent(s))?(a=o[n],o[n]=s):(a=i,i=s),a&&a!==s)return void r.setEdge(a,s);s=n}})}return dd=t,n(t,"addSubgraphConstraints"),dd}function Eg(){if(_d)return pd;_d=1;var e=tg(),t=_g(),r=gg(),i=bg(),o=wg(),a=xg(),s=u_().Graph,u=og();function c(n){var i=u.maxRank(n),o=h(n,e.range(1,i+1),"inEdges"),a=h(n,e.range(i-1,-1,-1),"outEdges"),s=t(n);d(n,s);for(var c,f=Number.POSITIVE_INFINITY,p=0,_=0;_<4;++p,++_){l(p%2?o:a,p%4>=2),s=u.buildLayerMatrix(n);var g=r(n,s);g<f&&(_=0,c=e.cloneDeep(s),f=g)}d(n,c)}function h(t,r,n){return e.map(r,function(e){return o(t,e,n)})}function l(t,r){var n=new s;e.forEach(t,function(t){var o=t.graph().root,s=i(t,o,n,r);e.forEach(s.vs,function(e,r){t.node(e).order=r}),a(t,n,s.vs)})}function d(t,r){e.forEach(r,function(r){e.forEach(r,function(e,r){t.node(e).order=r})})}return pd=c,n(c,"order"),n(h,"buildLayerGraphs"),n(l,"sweepLayerGraphs"),n(d,"assignOrder"),pd}function Cg(){if(md)return gd;md=1;var e=tg(),t=u_().Graph,r=og();function i(t,r){var i={};function o(r,n){var o=0,u=0,c=r.length,h=e.last(n);return e.forEach(n,function(r,l){var d=a(t,r),f=d?t.node(d).order:c;(d||r===h)&&(e.forEach(n.slice(u,l+1),function(r){e.forEach(t.predecessors(r),function(e){var n=t.node(e),a=n.order;!(a<o||f<a)||n.dummy&&t.node(r).dummy||s(i,e,r)})}),u=l+1,o=f)}),n}return n(o,"visitLayer"),e.reduce(r,o),i}function o(t,r){var i={};function o(r,n,o,a,u){var c;e.forEach(e.range(n,o),function(n){c=r[n],t.node(c).dummy&&e.forEach(t.predecessors(c),function(e){var r=t.node(e);r.dummy&&(r.order<a||r.order>u)&&s(i,e,c)})})}function a(r,n){var i,a=-1,s=0;return e.forEach(n,function(e,u){if("border"===t.node(e).dummy){var c=t.predecessors(e);c.length&&(i=t.node(c[0]).order,o(n,s,u,a,i),s=u,a=i)}o(n,s,n.length,i,r.length)}),n}return n(o,"scan"),n(a,"visitLayer"),e.reduce(r,a),i}function a(t,r){if(t.node(r).dummy)return e.find(t.predecessors(r),function(e){return t.node(e).dummy})}function s(e,t,r){if(t>r){var n=t;t=r,r=n}var i=e[t];i||(e[t]=i={}),i[r]=!0}function u(t,r,n){if(r>n){var i=r;r=n,n=i}return e.has(t[r],n)}function c(t,r,n,i){var o={},a={},s={};return e.forEach(r,function(t){e.forEach(t,function(e,t){o[e]=e,a[e]=e,s[e]=t})}),e.forEach(r,function(t){var r=-1;e.forEach(t,function(t){var c=i(t);if(c.length)for(var h=((c=e.sortBy(c,function(e){return s[e]})).length-1)/2,l=Math.floor(h),d=Math.ceil(h);l<=d;++l){var f=c[l];a[t]===t&&r<s[f]&&!u(n,t,f)&&(a[f]=t,a[t]=o[t]=o[f],r=s[f])}})}),{root:o,align:a}}function h(t,r,i,o,a){var s={},u=l(t,r,i,a),c=a?"borderLeft":"borderRight";function h(e,t){for(var r=u.nodes(),n=r.pop(),i={};n;)i[n]?e(n):(i[n]=!0,r.push(n),r=r.concat(t(n))),n=r.pop()}function d(e){s[e]=u.inEdges(e).reduce(function(e,t){return Math.max(e,s[t.v]+u.edge(t))},0)}function f(e){var r=u.outEdges(e).reduce(function(e,t){return Math.min(e,s[t.w]-u.edge(t))},Number.POSITIVE_INFINITY),n=t.node(e);r!==Number.POSITIVE_INFINITY&&n.borderType!==c&&(s[e]=Math.max(s[e],r))}return n(h,"iterate"),n(d,"pass1"),n(f,"pass2"),h(d,u.predecessors.bind(u)),h(f,u.successors.bind(u)),e.forEach(o,function(e){s[e]=s[i[e]]}),s}function l(r,n,i,o){var a=new t,s=r.graph(),u=g(s.nodesep,s.edgesep,o);return e.forEach(n,function(t){var n;e.forEach(t,function(e){var t=i[e];if(a.setNode(t),n){var o=i[n],s=a.edge(o,t);a.setEdge(o,t,Math.max(u(r,e,n),s||0))}n=e})}),a}function d(t,r){return e.minBy(e.values(r),function(r){var n=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return e.forIn(r,function(e,r){var o=m(t,r)/2;n=Math.max(e+o,n),i=Math.min(e-o,i)}),n-i})}function f(t,r){var n=e.values(r),i=e.min(n),o=e.max(n);e.forEach(["u","d"],function(n){e.forEach(["l","r"],function(a){var s,u=n+a,c=t[u];if(c!==r){var h=e.values(c);(s="l"===a?i-e.min(h):o-e.max(h))&&(t[u]=e.mapValues(c,function(e){return e+s}))}})})}function p(t,r){return e.mapValues(t.ul,function(n,i){if(r)return t[r.toLowerCase()][i];var o=e.sortBy(e.map(t,i));return(o[1]+o[2])/2})}function _(t){var n,a=r.buildLayerMatrix(t),s=e.merge(i(t,a),o(t,a)),u={};e.forEach(["u","d"],function(r){n="u"===r?a:e.values(a).reverse(),e.forEach(["l","r"],function(i){"r"===i&&(n=e.map(n,function(t){return e.values(t).reverse()}));var o=("u"===r?t.predecessors:t.successors).bind(t),a=c(0,n,s,o),l=h(t,n,a.root,a.align,"r"===i);"r"===i&&(l=e.mapValues(l,function(e){return-e})),u[r+i]=l})});var l=d(t,u);return f(u,l),p(u,t.graph().align)}function g(t,r,n){return function(i,o,a){var s,u=i.node(o),c=i.node(a),h=0;if(h+=u.width/2,e.has(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":s=-u.width/2;break;case"r":s=u.width/2}if(s&&(h+=n?s:-s),s=0,h+=(u.dummy?r:t)/2,h+=(c.dummy?r:t)/2,h+=c.width/2,e.has(c,"labelpos"))switch(c.labelpos.toLowerCase()){case"l":s=c.width/2;break;case"r":s=-c.width/2}return s&&(h+=n?s:-s),s=0,h}}function m(e,t){return e.node(t).width}return gd={positionX:_,findType1Conflicts:i,findType2Conflicts:o,addConflict:s,hasConflict:u,verticalAlignment:c,horizontalCompaction:h,alignCoordinates:f,findSmallestWidthAlignment:d,balance:p},n(i,"findType1Conflicts"),n(o,"findType2Conflicts"),n(a,"findOtherInnerSegmentNode"),n(s,"addConflict"),n(u,"hasConflict"),n(c,"verticalAlignment"),n(h,"horizontalCompaction"),n(l,"buildBlockGraph"),n(d,"findSmallestWidthAlignment"),n(f,"alignCoordinates"),n(p,"balance"),n(_,"positionX"),n(g,"sep"),n(m,"width"),gd}function kg(){if(vd)return yd;vd=1;var e=tg(),t=og(),r=Cg().positionX;function i(n){o(n=t.asNonCompoundGraph(n)),e.forEach(r(n),function(e,t){n.node(t).x=e})}function o(r){var n=t.buildLayerMatrix(r),i=r.graph().ranksep,o=0;e.forEach(n,function(t){var n=e.max(e.map(t,function(e){return r.node(e).height}));e.forEach(t,function(e){r.node(e).y=o+n/2}),o+=n+i})}return yd=i,n(i,"position"),n(o,"positionY"),yd}function Dg(){if(wd)return bd;wd=1;var e=tg(),t=ig(),r=ag(),i=hg(),o=og().normalizeRanks,a=lg(),s=og().removeEmptyRanks,u=dg(),c=fg(),h=pg(),l=Eg(),d=kg(),f=og(),p=u_().Graph;function _(e,t){var r=t&&t.debugTiming?f.time:f.notime;r("layout",function(){var t=r(" buildLayoutGraph",function(){return D(e)});r(" runLayout",function(){g(t,r)}),r(" updateInputGraph",function(){m(e,t)})})}function g(e,n){n(" makeSpaceForEdgeLabels",function(){O(e)}),n(" removeSelfEdges",function(){I(e)}),n(" acyclic",function(){t.run(e)}),n(" nestingGraph.run",function(){u.run(e)}),n(" rank",function(){i(f.asNonCompoundGraph(e))}),n(" injectEdgeLabelProxies",function(){M(e)}),n(" removeEmptyRanks",function(){s(e)}),n(" nestingGraph.cleanup",function(){u.cleanup(e)}),n(" normalizeRanks",function(){o(e)}),n(" assignRankMinMax",function(){S(e)}),n(" removeEdgeLabelProxies",function(){F(e)}),n(" normalize.run",function(){r.run(e)}),n(" parentDummyChains",function(){a(e)}),n(" addBorderSegments",function(){c(e)}),n(" order",function(){l(e)}),n(" insertSelfEdges",function(){L(e)}),n(" adjustCoordinateSystem",function(){h.adjust(e)}),n(" position",function(){d(e)}),n(" positionSelfEdges",function(){q(e)}),n(" removeBorderNodes",function(){j(e)}),n(" normalize.undo",function(){r.undo(e)}),n(" fixupEdgeLabelCoords",function(){B(e)}),n(" undoCoordinateSystem",function(){h.undo(e)}),n(" translateGraph",function(){P(e)}),n(" assignNodeIntersects",function(){R(e)}),n(" reversePoints",function(){N(e)}),n(" acyclic.undo",function(){t.undo(e)})}function m(t,r){e.forEach(t.nodes(),function(e){var n=t.node(e),i=r.node(e);n&&(n.x=i.x,n.y=i.y,r.children(e).length&&(n.width=i.width,n.height=i.height))}),e.forEach(t.edges(),function(n){var i=t.edge(n),o=r.edge(n);i.points=o.points,e.has(o,"x")&&(i.x=o.x,i.y=o.y)}),t.graph().width=r.graph().width,t.graph().height=r.graph().height}bd=_,n(_,"layout"),n(g,"runLayout"),n(m,"updateInputGraph");var y=["nodesep","edgesep","ranksep","marginx","marginy"],v={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},b=["acyclicer","ranker","rankdir","align"],w=["width","height"],x={width:0,height:0},E=["minlen","weight","width","height","labeloffset"],C={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},k=["labelpos"];function D(t){var r=new p({multigraph:!0,compound:!0}),n=T(t.graph());return r.setGraph(e.merge({},v,$(n,y),e.pick(n,b))),e.forEach(t.nodes(),function(n){var i=T(t.node(n));r.setNode(n,e.defaults($(i,w),x)),r.setParent(n,t.parent(n))}),e.forEach(t.edges(),function(n){var i=T(t.edge(n));r.setEdge(n,e.merge({},C,$(i,E),e.pick(i,k)))}),r}function O(t){var r=t.graph();r.ranksep/=2,e.forEach(t.edges(),function(e){var n=t.edge(e);n.minlen*=2,"c"!==n.labelpos.toLowerCase()&&("TB"===r.rankdir||"BT"===r.rankdir?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function M(t){e.forEach(t.edges(),function(e){var r=t.edge(e);if(r.width&&r.height){var n=t.node(e.v),i={rank:(t.node(e.w).rank-n.rank)/2+n.rank,e:e};f.addDummyNode(t,"edge-proxy",i,"_ep")}})}function S(t){var r=0;e.forEach(t.nodes(),function(n){var i=t.node(n);i.borderTop&&(i.minRank=t.node(i.borderTop).rank,i.maxRank=t.node(i.borderBottom).rank,r=e.max(r,i.maxRank))}),t.graph().maxRank=r}function F(t){e.forEach(t.nodes(),function(e){var r=t.node(e);"edge-proxy"===r.dummy&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))})}function P(t){var r=Number.POSITIVE_INFINITY,i=0,o=Number.POSITIVE_INFINITY,a=0,s=t.graph(),u=s.marginx||0,c=s.marginy||0;function h(e){var t=e.x,n=e.y,s=e.width,u=e.height;r=Math.min(r,t-s/2),i=Math.max(i,t+s/2),o=Math.min(o,n-u/2),a=Math.max(a,n+u/2)}n(h,"getExtremes"),e.forEach(t.nodes(),function(e){h(t.node(e))}),e.forEach(t.edges(),function(r){var n=t.edge(r);e.has(n,"x")&&h(n)}),r-=u,o-=c,e.forEach(t.nodes(),function(e){var n=t.node(e);n.x-=r,n.y-=o}),e.forEach(t.edges(),function(n){var i=t.edge(n);e.forEach(i.points,function(e){e.x-=r,e.y-=o}),e.has(i,"x")&&(i.x-=r),e.has(i,"y")&&(i.y-=o)}),s.width=i-r+u,s.height=a-o+c}function R(t){e.forEach(t.edges(),function(e){var r,n,i=t.edge(e),o=t.node(e.v),a=t.node(e.w);i.points?(r=i.points[0],n=i.points[i.points.length-1]):(i.points=[],r=a,n=o),i.points.unshift(f.intersectRect(o,r)),i.points.push(f.intersectRect(a,n))})}function B(t){e.forEach(t.edges(),function(r){var n=t.edge(r);if(e.has(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}})}function N(t){e.forEach(t.edges(),function(e){var r=t.edge(e);r.reversed&&r.points.reverse()})}function j(t){e.forEach(t.nodes(),function(r){if(t.children(r).length){var n=t.node(r),i=t.node(n.borderTop),o=t.node(n.borderBottom),a=t.node(e.last(n.borderLeft)),s=t.node(e.last(n.borderRight));n.width=Math.abs(s.x-a.x),n.height=Math.abs(o.y-i.y),n.x=a.x+n.width/2,n.y=i.y+n.height/2}}),e.forEach(t.nodes(),function(e){"border"===t.node(e).dummy&&t.removeNode(e)})}function I(t){e.forEach(t.edges(),function(e){if(e.v===e.w){var r=t.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}})}function L(t){var r=f.buildLayerMatrix(t);e.forEach(r,function(r){var n=0;e.forEach(r,function(r,i){var o=t.node(r);o.order=i+n,e.forEach(o.selfEdges,function(e){f.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:o.rank,order:i+ ++n,e:e.e,label:e.label},"_se")}),delete o.selfEdges})})}function q(t){e.forEach(t.nodes(),function(e){var r=t.node(e);if("selfedge"===r.dummy){var n=t.node(r.e.v),i=n.x+n.width/2,o=n.y,a=r.x-i,s=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:i+2*a/3,y:o-s},{x:i+5*a/6,y:o-s},{x:i+a,y:o},{x:i+5*a/6,y:o+s},{x:i+2*a/3,y:o+s}],r.label.x=r.x,r.label.y=r.y}})}function $(t,r){return e.mapValues(e.pick(t,r),Number)}function T(t){var r={};return e.forEach(t,function(e,t){r[t.toLowerCase()]=e}),r}return n(D,"buildLayoutGraph"),n(O,"makeSpaceForEdgeLabels"),n(M,"injectEdgeLabelProxies"),n(S,"assignRankMinMax"),n(F,"removeEdgeLabelProxies"),n(P,"translateGraph"),n(R,"assignNodeIntersects"),n(B,"fixupEdgeLabelCoords"),n(N,"reversePointsForReversedEdges"),n(j,"removeBorderNodes"),n(I,"removeSelfEdges"),n(L,"insertSelfEdges"),n(q,"positionSelfEdges"),n($,"selectNumberAttrs"),n(T,"canonicalize"),bd}function Og(){if(Ed)return xd;Ed=1;var e=tg(),t=og(),r=u_().Graph;function i(n){var i=t.buildLayerMatrix(n),o=new r({compound:!0,multigraph:!0}).setGraph({});return e.forEach(n.nodes(),function(e){o.setNode(e,{label:e}),o.setParent(e,"layer"+n.node(e).rank)}),e.forEach(n.edges(),function(e){o.setEdge(e.v,e.w,{},e.name)}),e.forEach(i,function(t,r){var n="layer"+r;o.setNode(n,{rank:"same"}),e.reduce(t,function(e,t){return o.setEdge(e,t,{style:"invis"}),t})}),o}return xd={debugOrdering:i},n(i,"debugOrdering"),xd}function Mg(){return kd?Cd:(kd=1,Cd="0.8.5")}function Sg(){return Od?Dd:(Od=1,Dd={graphlib:u_(),layout:Dg(),debug:Og(),util:{time:og().time,notime:og().notime},version:Mg()})}n(Sd,"require_cloneBuffer"),n(Fd,"require_copyArray"),n(Pd,"require_arrayFilter"),n(Rd,"requireStubArray"),n(Bd,"require_getSymbols"),n(Nd,"require_copySymbols"),n(jd,"require_arrayPush"),n(Id,"require_getPrototype"),n(Ld,"require_getSymbolsIn"),n(qd,"require_copySymbolsIn"),n($d,"require_baseGetAllKeys"),n(Td,"require_getAllKeys"),n(Yd,"require_getAllKeysIn"),n(Hd,"require_DataView"),n(Gd,"require_Promise"),n(Vd,"require_Set"),n(Xd,"require_WeakMap"),n(zd,"require_getTag"),n(Wd,"require_initCloneArray"),n(Zd,"require_Uint8Array"),n(Ud,"require_cloneArrayBuffer"),n(Kd,"require_cloneDataView"),n(Qd,"require_cloneRegExp"),n(Jd,"require_cloneSymbol"),n(Ad,"require_cloneTypedArray"),n(ef,"require_initCloneByTag"),n(tf,"require_baseCreate"),n(rf,"require_initCloneObject"),n(nf,"require_baseIsMap"),n(of,"requireIsMap"),n(af,"require_baseIsSet"),n(sf,"requireIsSet"),n(uf,"require_baseClone"),n(cf,"requireClone"),n(hf,"requireConstant"),n(lf,"require_createBaseFor"),n(df,"require_baseFor"),n(ff,"require_baseForOwn"),n(pf,"require_createBaseEach"),n(_f,"require_baseEach"),n(gf,"requireIdentity"),n(mf,"require_castFunction"),n(yf,"requireForEach"),n(vf,"requireEach"),n(bf,"require_baseFilter"),n(wf,"require_setCacheAdd"),n(xf,"require_setCacheHas"),n(Ef,"require_SetCache"),n(Cf,"require_arraySome"),n(kf,"require_cacheHas"),n(Df,"require_equalArrays"),n(Of,"require_mapToArray"),n(Mf,"require_setToArray"),n(Sf,"require_equalByTag"),n(Ff,"require_equalObjects"),n(Pf,"require_baseIsEqualDeep"),n(Rf,"require_baseIsEqual"),n(Bf,"require_baseIsMatch"),n(Nf,"require_isStrictComparable"),n(jf,"require_getMatchData"),n(If,"require_matchesStrictComparable"),n(Lf,"require_baseMatches"),n(qf,"requireIsSymbol"),n($f,"require_isKey"),n(Tf,"requireMemoize"),n(Yf,"require_memoizeCapped"),n(Hf,"require_stringToPath"),n(Gf,"require_arrayMap"),n(Vf,"require_baseToString"),n(Xf,"requireToString"),n(zf,"require_castPath"),n(Wf,"require_toKey"),n(Zf,"require_baseGet"),n(Uf,"requireGet"),n(Kf,"require_baseHasIn"),n(Qf,"require_hasPath"),n(Jf,"requireHasIn"),n(Af,"require_baseMatchesProperty"),n(ep,"require_baseProperty"),n(tp,"require_basePropertyDeep"),n(rp,"requireProperty"),n(np,"require_baseIteratee"),n(ip,"requireFilter"),n(op,"require_baseHas"),n(ap,"requireHas"),n(sp,"requireIsEmpty"),n(up,"requireIsUndefined"),n(cp,"require_baseMap"),n(hp,"requireMap"),n(lp,"require_arrayReduce"),n(dp,"require_baseReduce"),n(fp,"requireReduce"),n(pp,"requireIsString"),n(_p,"require_asciiSize"),n(gp,"require_hasUnicode"),n(mp,"require_unicodeSize"),n(yp,"require_stringSize"),n(vp,"requireSize"),n(bp,"requireTransform"),n(wp,"require_isFlattenable"),n(xp,"require_baseFlatten"),n(Ep,"require_apply"),n(Cp,"require_overRest"),n(kp,"require_baseSetToString"),n(Dp,"require_shortOut"),n(Op,"require_setToString"),n(Mp,"require_baseRest"),n(Sp,"require_baseFindIndex"),n(Fp,"require_baseIsNaN"),n(Pp,"require_strictIndexOf"),n(Rp,"require_baseIndexOf"),n(Bp,"require_arrayIncludes"),n(Np,"require_arrayIncludesWith"),n(jp,"requireNoop"),n(Ip,"require_createSet"),n(Lp,"require_baseUniq"),n(qp,"requireIsArrayLikeObject"),n($p,"requireUnion"),n(Tp,"require_baseValues"),n(Yp,"requireValues"),n(Hp,"requireLodash$1"),n(Gp,"requireGraph"),n(Vp,"requireVersion$1"),n(Xp,"requireLib"),n(zp,"requireJson"),n(Wp,"requireComponents"),n(Zp,"requirePriorityQueue"),n(Up,"requireDijkstra"),n(Kp,"requireDijkstraAll"),n(Qp,"requireTarjan"),n(Jp,"requireFindCycles"),n(Ap,"requireFloydWarshall"),n(e_,"requireTopsort"),n(t_,"requireIsAcyclic"),n(r_,"requireDfs"),n(n_,"requirePostorder"),n(i_,"requirePreorder"),n(o_,"requirePrim"),n(a_,"requireAlg"),n(s_,"requireGraphlib$1"),n(u_,"requireGraphlib"),n(c_,"requireCloneDeep"),n(h_,"require_isIterateeCall"),n(l_,"requireDefaults"),n(d_,"require_createFind"),n(f_,"require_trimmedEndIndex"),n(p_,"require_baseTrim"),n(__,"requireToNumber"),n(g_,"requireToFinite"),n(m_,"requireToInteger"),n(y_,"requireFindIndex"),n(v_,"requireFind"),n(b_,"requireFlatten"),n(w_,"requireForIn"),n(x_,"requireLast"),n(E_,"requireMapValues"),n(C_,"require_baseExtremum"),n(k_,"require_baseGt"),n(D_,"requireMax"),n(O_,"require_assignMergeValue"),n(M_,"requireIsPlainObject"),n(S_,"require_safeGet"),n(F_,"requireToPlainObject"),n(P_,"require_baseMergeDeep"),n(R_,"require_baseMerge"),n(B_,"require_createAssigner"),n(N_,"requireMerge"),n(j_,"require_baseLt"),n(I_,"requireMin"),n(L_,"requireMinBy"),n(q_,"requireNow"),n($_,"require_baseSet"),n(T_,"require_basePickBy"),n(Y_,"require_basePick"),n(H_,"require_flatRest"),n(G_,"requirePick"),n(V_,"require_baseRange"),n(X_,"require_createRange"),n(z_,"requireRange"),n(W_,"require_baseSortBy"),n(Z_,"require_compareAscending"),n(U_,"require_compareMultiple"),n(K_,"require_baseOrderBy"),n(Q_,"requireSortBy"),n(J_,"requireUniqueId"),n(A_,"require_baseZipObject"),n(eg,"requireZipObject"),n(tg,"requireLodash"),n(rg,"requireList"),n(ng,"requireGreedyFas"),n(ig,"requireAcyclic"),n(og,"requireUtil$1"),n(ag,"requireNormalize"),n(sg,"requireUtil"),n(ug,"requireFeasibleTree"),n(cg,"requireNetworkSimplex"),n(hg,"requireRank"),n(lg,"requireParentDummyChains"),n(dg,"requireNestingGraph"),n(fg,"requireAddBorderSegments"),n(pg,"requireCoordinateSystem"),n(_g,"requireInitOrder"),n(gg,"requireCrossCount"),n(mg,"requireBarycenter"),n(yg,"requireResolveConflicts"),n(vg,"requireSort"),n(bg,"requireSortSubgraph"),n(wg,"requireBuildLayerGraph"),n(xg,"requireAddSubgraphConstraints"),n(Eg,"requireOrder"),n(Cg,"requireBk"),n(kg,"requirePosition"),n(Dg,"requireLayout"),n(Og,"requireDebug"),n(Mg,"requireVersion"),n(Sg,"requireDagre");var Fg=Sg();const Pg=class _GraphlibGraph extends Fg.graphlib.Graph{};n(Pg,"GraphlibGraph");let Rg=Pg;const Bg=class _GraphData{_g;constructor(){this._g=new Rg({multigraph:!0,compound:!0}),this._g.setGraph({}),this._g.setDefaultNodeLabel(function(){return{debug:"error"}}),this._g.setDefaultEdgeLabel(function(){return{debug:"error"}})}parent(e){return this._g.parent(e)}filterNodes(e){const t=[];return this.eachNode(function(r){e(r)&&t.push(r)}),t}eachNode(e){this._g.nodes().forEach(t=>{e(t,this.node(t))})}filterEdges(e){const t=[];return this.eachEdge(function(r){e(r)&&t.push(r)}),t}eachEdge(e){this._g.edges().forEach(t=>{e(t,t.v,t.w,this.edge(t))})}setData(e,t,r,n,i){const o={addedVertices:[],addedEdges:[]},a=e.concat(t);for(let s=0;s<a.length;++s){const e=a[s];i&&this._g.hasNode(e._id)||(this._g.setNode(e._id,e),o.addedVertices.push(e))}for(let s=0;s<r.length;++s){const e=r[s];i&&this._g.hasEdge(e._id)||(e._sourceVertex&&e._targetVertex?(this._g.setEdge(e._sourceVertex._id,e._targetVertex._id,e,e._id),o.addedEdges.push(e)):console.warn("Bad edge definition"))}if(n)for(let s=0;s<n.length;++s)this._g.setParent(n[s].child._id,n[s].parent._id);if(i){const e=r.map(function(e){return e._id});this.filterEdges(t=>e.indexOf(t.name)<0).forEach(e=>this._g.removeEdge(e.v,e.w));const t=a.map(function(e){return e._id});this.filterNodes(e=>t.indexOf(e)<0).forEach(e=>this._g.removeNode(e))}return o}node(e){return this._g.node(e)}nodeCount(){return this._g.nodeCount()}nodes(){return this._g.nodes().map(e=>this._g.node(e))}nodeEdges(e){return this._g.nodeEdges(e)}edge(e){return this._g.edge(e)}edges(){return this._g.edges().map(e=>this._g.edge(e))}neighbors(e){return this._g.neighbors(e).map(e=>this._g.node(e))}singleNeighbors(e){return this._g.neighbors(e).filter(e=>1===this._g.neighbors(e).length).map(e=>this._g.node(e))}gatherShortestPath(e,t){const r=[];let n=t,i=e[n];for(;i;){if(i.distance<1/0&&i.predecessor){const e=this._g.nodeEdges(n,i.predecessor)[0];r.push(this._g.edge(e))}n=i.predecessor,i=e[n]}return r}shortestPath(e,t){return this.gatherShortestPath(Fg.graphlib.alg.dijkstra(this._g,e),t)}undirectedShortestPath(e,t){return this.gatherShortestPath(Fg.graphlib.alg.dijkstra(this._g,e,null,e=>this._g.nodeEdges(e)),t)}getJSON(){const e=Fg.graphlib.json.write(this._g);return JSON.stringify(e,function(e,t){return"value"===e?t._text&&t._text._text?t._text._text:t._id:t}," ")}};n(Bg,"GraphData");let Ng=Bg;function jg(e,t){var r;function i(){var n,i,o=r.length,a=0,s=0;for(n=0;n<o;++n)a+=(i=r[n]).x,s+=i.y;for(a=a/o-e,s=s/o-t,n=0;n<o;++n)(i=r[n]).x-=a,i.y-=s}return null==e&&(e=0),null==t&&(t=0),n(i,"force"),i.initialize=function(e){r=e},i.x=function(t){return arguments.length?(e=+t,i):e},i.y=function(e){return arguments.length?(t=+e,i):t},i}function Ig(e){return function(){return e}}function Lg(){return 1e-6*(Math.random()-.5)}function qg(e){var t=+this._x.call(null,e),r=+this._y.call(null,e);return $g(this.cover(t,r),t,r,e)}function $g(e,t,r,n){if(isNaN(t)||isNaN(r))return e;var i,o,a,s,u,c,h,l,d,f=e._root,p={data:n},_=e._x0,g=e._y0,m=e._x1,y=e._y1;if(!f)return e._root=p,e;for(;f.length;)if((c=t>=(o=(_+m)/2))?_=o:m=o,(h=r>=(a=(g+y)/2))?g=a:y=a,i=f,!(f=f[l=h<<1|c]))return i[l]=p,e;if(s=+e._x.call(null,f.data),u=+e._y.call(null,f.data),t===s&&r===u)return p.next=f,i?i[l]=p:e._root=p,e;do{i=i?i[l]=new Array(4):e._root=new Array(4),(c=t>=(o=(_+m)/2))?_=o:m=o,(h=r>=(a=(g+y)/2))?g=a:y=a}while((l=h<<1|c)==(d=(u>=a)<<1|s>=o));return i[d]=f,i[l]=p,e}function Tg(e){var t,r,n,i,o=e.length,a=new Array(o),s=new Array(o),u=1/0,c=1/0,h=-1/0,l=-1/0;for(r=0;r<o;++r)isNaN(n=+this._x.call(null,t=e[r]))||isNaN(i=+this._y.call(null,t))||(a[r]=n,s[r]=i,n<u&&(u=n),n>h&&(h=n),i<c&&(c=i),i>l&&(l=i));if(u>h||c>l)return this;for(this.cover(u,c).cover(h,l),r=0;r<o;++r)$g(this,a[r],s[r],e[r]);return this}function Yg(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var r=this._x0,n=this._y0,i=this._x1,o=this._y1;if(isNaN(r))i=(r=Math.floor(e))+1,o=(n=Math.floor(t))+1;else{for(var a,s,u=i-r,c=this._root;r>e||e>=i||n>t||t>=o;)switch(s=(t<n)<<1|e<r,(a=new Array(4))[s]=c,c=a,u*=2,s){case 0:i=r+u,o=n+u;break;case 1:r=i-u,o=n+u;break;case 2:i=r+u,n=o-u;break;case 3:r=i-u,n=o-u}this._root&&this._root.length&&(this._root=c)}return this._x0=r,this._y0=n,this._x1=i,this._y1=o,this}function Hg(){var e=[];return this.visit(function(t){if(!t.length)do{e.push(t.data)}while(t=t.next)}),e}function Gg(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function Vg(e,t,r,n,i){this.node=e,this.x0=t,this.y0=r,this.x1=n,this.y1=i}function Xg(e,t,r){var n,i,o,a,s,u,c,h=this._x0,l=this._y0,d=this._x1,f=this._y1,p=[],_=this._root;for(_&&p.push(new Vg(_,h,l,d,f)),null==r?r=1/0:(h=e-r,l=t-r,d=e+r,f=t+r,r*=r);u=p.pop();)if(!(!(_=u.node)||(i=u.x0)>d||(o=u.y0)>f||(a=u.x1)<h||(s=u.y1)<l))if(_.length){var g=(i+a)/2,m=(o+s)/2;p.push(new Vg(_[3],g,m,a,s),new Vg(_[2],i,m,g,s),new Vg(_[1],g,o,a,m),new Vg(_[0],i,o,g,m)),(c=(t>=m)<<1|e>=g)&&(u=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=u)}else{var y=e-+this._x.call(null,_.data),v=t-+this._y.call(null,_.data),b=y*y+v*v;if(b<r){var w=Math.sqrt(r=b);h=e-w,l=t-w,d=e+w,f=t+w,n=_.data}}return n}function zg(e){if(isNaN(o=+this._x.call(null,e))||isNaN(a=+this._y.call(null,e)))return this;var t,r,n,i,o,a,s,u,c,h,l,d,f=this._root,p=this._x0,_=this._y0,g=this._x1,m=this._y1;if(!f)return this;if(f.length)for(;;){if((c=o>=(s=(p+g)/2))?p=s:g=s,(h=a>=(u=(_+m)/2))?_=u:m=u,t=f,!(f=f[l=h<<1|c]))return this;if(!f.length)break;(t[l+1&3]||t[l+2&3]||t[l+3&3])&&(r=t,d=l)}for(;f.data!==e;)if(n=f,!(f=f.next))return this;return(i=f.next)&&delete f.next,n?(i?n.next=i:delete n.next,this):t?(i?t[l]=i:delete t[l],(f=t[0]||t[1]||t[2]||t[3])&&f===(t[3]||t[2]||t[1]||t[0])&&!f.length&&(r?r[d]=f:this._root=f),this):(this._root=i,this)}function Wg(e){for(var t=0,r=e.length;t<r;++t)this.remove(e[t]);return this}function Zg(){return this._root}function Ug(){var e=0;return this.visit(function(t){if(!t.length)do{++e}while(t=t.next)}),e}function Kg(e){var t,r,n,i,o,a,s=[],u=this._root;for(u&&s.push(new Vg(u,this._x0,this._y0,this._x1,this._y1));t=s.pop();)if(!e(u=t.node,n=t.x0,i=t.y0,o=t.x1,a=t.y1)&&u.length){var c=(n+o)/2,h=(i+a)/2;(r=u[3])&&s.push(new Vg(r,c,h,o,a)),(r=u[2])&&s.push(new Vg(r,n,h,c,a)),(r=u[1])&&s.push(new Vg(r,c,i,o,h)),(r=u[0])&&s.push(new Vg(r,n,i,c,h))}return this}function Qg(e){var t,r=[],n=[];for(this._root&&r.push(new Vg(this._root,this._x0,this._y0,this._x1,this._y1));t=r.pop();){var i=t.node;if(i.length){var o,a=t.x0,s=t.y0,u=t.x1,c=t.y1,h=(a+u)/2,l=(s+c)/2;(o=i[0])&&r.push(new Vg(o,a,s,h,l)),(o=i[1])&&r.push(new Vg(o,h,s,u,l)),(o=i[2])&&r.push(new Vg(o,a,l,h,c)),(o=i[3])&&r.push(new Vg(o,h,l,u,c))}n.push(t)}for(;t=n.pop();)e(t.node,t.x0,t.y0,t.x1,t.y1);return this}function Jg(e){return e[0]}function Ag(e){return arguments.length?(this._x=e,this):this._x}function em(e){return e[1]}function tm(e){return arguments.length?(this._y=e,this):this._y}function rm(e,t,r){var n=new nm(null==t?Jg:t,null==r?em:r,NaN,NaN,NaN,NaN);return null==e?n:n.addAll(e)}function nm(e,t,r,n,i,o){this._x=e,this._y=t,this._x0=r,this._y0=n,this._x1=i,this._y1=o,this._root=void 0}function im(e){for(var t={data:e.data},r=t;e=e.next;)r=r.next={data:e.data};return t}n(jg,"d3ForceCenter"),n(Ig,"constant$1"),n(Lg,"jiggle"),n(qg,"tree_add"),n($g,"add"),n(Tg,"addAll"),n(Yg,"tree_cover"),n(Hg,"tree_data"),n(Gg,"tree_extent"),n(Vg,"Quad"),n(Xg,"tree_find"),n(zg,"tree_remove"),n(Wg,"removeAll"),n(Zg,"tree_root"),n(Ug,"tree_size"),n(Kg,"tree_visit"),n(Qg,"tree_visitAfter"),n(Jg,"defaultX"),n(Ag,"tree_x"),n(em,"defaultY"),n(tm,"tree_y"),n(rm,"quadtree"),n(nm,"Quadtree"),n(im,"leaf_copy");var om=rm.prototype=nm.prototype;function am(e){return e.index}function sm(e,t){var r=e.get(t);if(!r)throw new Error("missing: "+t);return r}function um(e){var t,r,i,o,a,s=am,c=d,h=Ig(30),l=1;function d(e){return 1/Math.min(o[e.source.index],o[e.target.index])}function f(n){for(var i=0,o=e.length;i<l;++i)for(var s,u,c,h,d,f,p,_=0;_<o;++_)u=(s=e[_]).source,h=(c=s.target).x+c.vx-u.x-u.vx||Lg(),d=c.y+c.vy-u.y-u.vy||Lg(),h*=f=((f=Math.sqrt(h*h+d*d))-r[_])/f*n*t[_],d*=f,c.vx-=h*(p=a[_]),c.vy-=d*p,u.vx+=h*(p=1-p),u.vy+=d*p}function p(){if(i){var n,c,h=i.length,l=e.length,d=u(i,s);for(n=0,o=new Array(h);n<l;++n)(c=e[n]).index=n,"object"!=typeof c.source&&(c.source=sm(d,c.source)),"object"!=typeof c.target&&(c.target=sm(d,c.target)),o[c.source.index]=(o[c.source.index]||0)+1,o[c.target.index]=(o[c.target.index]||0)+1;for(n=0,a=new Array(l);n<l;++n)c=e[n],a[n]=o[c.source.index]/(o[c.source.index]+o[c.target.index]);t=new Array(l),_(),r=new Array(l),g()}}function _(){if(i)for(var r=0,n=e.length;r<n;++r)t[r]=+c(e[r],r,e)}function g(){if(i)for(var t=0,n=e.length;t<n;++t)r[t]=+h(e[t],t,e)}return null==e&&(e=[]),n(d,"defaultStrength"),n(f,"force"),n(p,"initialize"),n(_,"initializeStrength"),n(g,"initializeDistance"),f.initialize=function(e){i=e,p()},f.links=function(t){return arguments.length?(e=t,p(),f):e},f.id=function(e){return arguments.length?(s=e,f):s},f.iterations=function(e){return arguments.length?(l=+e,f):l},f.strength=function(e){return arguments.length?(c="function"==typeof e?e:Ig(+e),_(),f):c},f.distance=function(e){return arguments.length?(h="function"==typeof e?e:Ig(+e),g(),f):h},f}om.copy=function(){var e,t,r=new nm(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=im(n),r;for(e=[{source:n,target:r._root=new Array(4)}];n=e.pop();)for(var i=0;i<4;++i)(t=n.source[i])&&(t.length?e.push({source:t,target:n.target[i]=new Array(4)}):n.target[i]=im(t));return r},om.add=qg,om.addAll=Tg,om.cover=Yg,om.data=Hg,om.extent=Gg,om.find=Xg,om.remove=zg,om.removeAll=Wg,om.root=Zg,om.size=Ug,om.visit=Kg,om.visitAfter=Qg,om.x=Ag,om.y=tm,n(am,"index"),n(sm,"find$1"),n(um,"d3ForceLink");var cm,hm,lm=0,dm=0,fm=0,pm=0,_m=0,gm=0,mm="object"==typeof performance&&performance.now?performance:Date,ym="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function vm(){return _m||(ym(bm),_m=mm.now()+gm)}function bm(){_m=0}function wm(){this._call=this._time=this._next=null}function xm(e,t,r){var n=new wm;return n.restart(e,t,r),n}function Em(){vm(),++lm;for(var e,t=cm;t;)(e=_m-t._time)>=0&&t._call.call(null,e),t=t._next;--lm}function Cm(){_m=(pm=mm.now())+gm,lm=dm=0;try{Em()}finally{lm=0,Dm(),_m=0}}function km(){var e=mm.now(),t=e-pm;t>1e3&&(gm-=t,pm=e)}function Dm(){for(var e,t,r=cm,n=1/0;r;)r._call?(n>r._time&&(n=r._time),e=r,r=r._next):(t=r._next,r._next=null,r=e?e._next=t:cm=t);hm=e,Om(n)}function Om(e){lm||(dm&&(dm=clearTimeout(dm)),e-_m>24?(e<1/0&&(dm=setTimeout(Cm,e-mm.now()-gm)),fm&&(fm=clearInterval(fm))):(fm||(pm=mm.now(),fm=setInterval(km,1e3)),lm=1,ym(Cm)))}function Mm(e){return e.x}function Sm(e){return e.y}n(vm,"now"),n(bm,"clearNow"),n(wm,"Timer"),wm.prototype=xm.prototype={constructor:wm,restart:/* @__PURE__ */n(function(e,t,r){if("function"!=typeof e)throw new TypeError("callback is not a function");r=(null==r?vm():+r)+(null==t?0:+t),this._next||hm===this||(hm?hm._next=this:cm=this,hm=this),this._call=e,this._time=r,Om()},"restart"),stop:/* @__PURE__ */n(function(){this._call&&(this._call=null,this._time=1/0,Om())},"stop")},n(xm,"timer"),n(Em,"timerFlush"),n(Cm,"wake"),n(km,"poke"),n(Dm,"nap"),n(Om,"sleep"),n(Mm,"x$1"),n(Sm,"y$1");var Fm=Math.PI*(3-Math.sqrt(5));function Pm(e){var t,r=1,i=.001,o=1-Math.pow(i,1/300),a=0,s=.6,h=u(),l=xm(f),d=c("tick","end");function f(){p(),d.call("tick",t),r<i&&(l.stop(),d.call("end",t))}function p(n){var i,u,c=e.length;void 0===n&&(n=1);for(var l=0;l<n;++l)for(r+=(a-r)*o,h.each(function(e){e(r)}),i=0;i<c;++i)null==(u=e[i]).fx?u.x+=u.vx*=s:(u.x=u.fx,u.vx=0),null==u.fy?u.y+=u.vy*=s:(u.y=u.fy,u.vy=0);return t}function _(){for(var t,r=0,n=e.length;r<n;++r){if((t=e[r]).index=r,null!=t.fx&&(t.x=t.fx),null!=t.fy&&(t.y=t.fy),isNaN(t.x)||isNaN(t.y)){var i=10*Math.sqrt(r),o=r*Fm;t.x=i*Math.cos(o),t.y=i*Math.sin(o)}(isNaN(t.vx)||isNaN(t.vy))&&(t.vx=t.vy=0)}}function g(t){return t.initialize&&t.initialize(e),t}return null==e&&(e=[]),n(f,"step"),n(p,"tick"),n(_,"initializeNodes"),n(g,"initializeForce"),_(),t={tick:p,restart:/* @__PURE__ */n(function(){return l.restart(f),t},"restart"),stop:/* @__PURE__ */n(function(){return l.stop(),t},"stop"),nodes:/* @__PURE__ */n(function(r){return arguments.length?(e=r,_(),h.each(g),t):e},"nodes"),alpha:/* @__PURE__ */n(function(e){return arguments.length?(r=+e,t):r},"alpha"),alphaMin:/* @__PURE__ */n(function(e){return arguments.length?(i=+e,t):i},"alphaMin"),alphaDecay:/* @__PURE__ */n(function(e){return arguments.length?(o=+e,t):+o},"alphaDecay"),alphaTarget:/* @__PURE__ */n(function(e){return arguments.length?(a=+e,t):a},"alphaTarget"),velocityDecay:/* @__PURE__ */n(function(e){return arguments.length?(s=1-e,t):1-s},"velocityDecay"),force:/* @__PURE__ */n(function(e,r){return arguments.length>1?(null==r?h.remove(e):h.set(e,g(r)),t):h.get(e)},"force"),find:/* @__PURE__ */n(function(t,r,n){var i,o,a,s,u,c=0,h=e.length;for(null==n?n=1/0:n*=n,c=0;c<h;++c)(a=(i=t-(s=e[c]).x)*i+(o=r-s.y)*o)<n&&(u=s,n=a);return u},"find"),on:/* @__PURE__ */n(function(e,r){return arguments.length>1?(d.on(e,r),t):d.on(e)},"on")}}function Rm(){var e,t,r,i,o=Ig(-30),a=1,s=1/0,u=.81;function c(n){var i,o=e.length,a=rm(e,Mm,Sm).visitAfter(l);for(r=n,i=0;i<o;++i)t=e[i],a.visit(d)}function h(){if(e){var t,r,n=e.length;for(i=new Array(n),t=0;t<n;++t)r=e[t],i[r.index]=+o(r,t,e)}}function l(e){var t,r,n,o,a,s=0,u=0;if(e.length){for(n=o=a=0;a<4;++a)(t=e[a])&&(r=Math.abs(t.value))&&(s+=t.value,u+=r,n+=r*t.x,o+=r*t.y);e.x=n/u,e.y=o/u}else{(t=e).x=t.data.x,t.y=t.data.y;do{s+=i[t.data.index]}while(t=t.next)}e.value=s}function d(e,n,o,c){if(!e.value)return!0;var h=e.x-t.x,l=e.y-t.y,d=c-n,f=h*h+l*l;if(d*d/u<f)return f<s&&(0===h&&(f+=(h=Lg())*h),0===l&&(f+=(l=Lg())*l),f<a&&(f=Math.sqrt(a*f)),t.vx+=h*e.value*r/f,t.vy+=l*e.value*r/f),!0;if(!(e.length||f>=s)){(e.data!==t||e.next)&&(0===h&&(f+=(h=Lg())*h),0===l&&(f+=(l=Lg())*l),f<a&&(f=Math.sqrt(a*f)));do{e.data!==t&&(d=i[e.data.index]*r/f,t.vx+=h*d,t.vy+=l*d)}while(e=e.next)}}return n(c,"force"),n(h,"initialize"),n(l,"accumulate"),n(d,"apply"),c.initialize=function(t){e=t,h()},c.strength=function(e){return arguments.length?(o="function"==typeof e?e:Ig(+e),h(),c):o},c.distanceMin=function(e){return arguments.length?(a=e*e,c):Math.sqrt(a)},c.distanceMax=function(e){return arguments.length?(s=e*e,c):Math.sqrt(s)},c.theta=function(e){return arguments.length?(u=e*e,c):Math.sqrt(u)},c}function Bm(e){var t,r,i,o=Ig(.1);function a(e){for(var n,o=0,a=t.length;o<a;++o)(n=t[o]).vx+=(i[o]-n.x)*r[o]*e}function s(){if(t){var n,a=t.length;for(r=new Array(a),i=new Array(a),n=0;n<a;++n)r[n]=isNaN(i[n]=+e(t[n],n,t))?0:+o(t[n],n,t)}}return"function"!=typeof e&&(e=Ig(null==e?0:+e)),n(a,"force"),n(s,"initialize"),a.initialize=function(e){t=e,s()},a.strength=function(e){return arguments.length?(o="function"==typeof e?e:Ig(+e),s(),a):o},a.x=function(t){return arguments.length?(e="function"==typeof t?t:Ig(+t),s(),a):e},a}function Nm(e){var t,r,i,o=Ig(.1);function a(e){for(var n,o=0,a=t.length;o<a;++o)(n=t[o]).vy+=(i[o]-n.y)*r[o]*e}function s(){if(t){var n,a=t.length;for(r=new Array(a),i=new Array(a),n=0;n<a;++n)r[n]=isNaN(i[n]=+e(t[n],n,t))?0:+o(t[n],n,t)}}return"function"!=typeof e&&(e=Ig(null==e?0:+e)),n(a,"force"),n(s,"initialize"),a.initialize=function(e){t=e,s()},a.strength=function(e){return arguments.length?(o="function"==typeof e?e:Ig(+e),s(),a):o},a.y=function(t){return arguments.length?(e="function"==typeof t?t:Ig(+t),s(),a):e},a}n(Pm,"d3ForceSimulation"),n(Rm,"d3ForceManyBody"),n(Bm,"d3ForceX"),n(Nm,"d3ForceY");let jm=(n(e=class{pos={};constructor(e,t,r,n){const i=this;this.pos={};n=n||(t<r?t-0:r-0)/2;const o=e.nodeCount();let a=-Math.PI/2;const s=2*Math.PI/o;e.eachNode(function(e,o){const u=o.getBBox();i.pos[e]={x:o.fixed?o.x:t/2+Math.cos(a)*(n-0),y:o.fixed?o.y:r/2+Math.sin(a)*(n-0),width:u.width,height:u.height},a+=s})}nodePos(e){return this.pos[e]}edgePoints(e){return[]}},"Circle"),e),Im=(n(t=class{pos={};vertices=[];vertexMap={};edges=[];force;constructor(e,t,r,n){n=n||{},this.pos={},this.vertices=[],this.vertexMap={},e.eachNode(t=>{const r=e.node(t),n=r.getBBox(),i={id:t,x:r.pos().x,y:r.pos().y,width:n.width,height:n.height,value:r};this.vertices.push(i),this.vertexMap[t]=i}),this.edges=[],e.eachEdge((e,t,r)=>{this.edges.push({source:t,target:r})});const i=um().id(function(e){return e.id}).distance(n.linkDistance).strength(n.linkStrength),o=Rm().strength(function(e){const t=e.value.getBBox();return n.charge*Math.max(t.width,t.height)});if(this.force=Pm().force("link",i).force("charge",o).force("center",jg(t/2,r/2)).velocityDecay(n.oneShot?.1:n.friction).nodes(this.vertices),i.links(this.edges),n.oneShot){this.force.restart();let t=e.nodeCount();t=Math.min(t*t,500);for(let e=0;e<t;++e)this.force.tick();this.force.stop()}}nodePos(e){return this.vertexMap[e]}edgePoints(e){return[]}},"ForceDirected"),t);const Lm=class _Hierarchy{digraph;dagreLayout;constructor(e,t,r,n){this.digraph=new Fg.graphlib.Graph({multigraph:!0,compound:!0}).setGraph(n).setDefaultNodeLabel(function(){return{}}).setDefaultEdgeLabel(function(){return{}}),e.eachNode(t=>{const r=e.node(t).getBBox();this.digraph.setNode(t,{width:r.width,height:r.height})}),e.eachEdge((t,r,i)=>{const o=e.edge(t);this.digraph.setEdge(r,i,{weight:o.weight()},o._id),n.digraph||this.digraph.setEdge(i,r,{weight:o.weight()},o._id)}),e.eachNode(t=>{this.digraph.setParent(t,e.parent(t))}),this.dagreLayout=Fg.layout(this.digraph,{debugTiming:!1});const i=-this.digraph.graph().width/2,o=-this.digraph.graph().height/2;this.digraph.nodes().forEach(e=>{const n=this.digraph.node(e);n.x+=i+t/2,n.y+=o+r/2}),this.digraph.edges().forEach(e=>{const n=this.digraph.edge(e);for(let a=0;a<n.points.length;++a)n.points[a].x+=i+t/2,n.points[a].y+=o+r/2}),this.digraph=this.digraph}nodePos(e){return this.digraph.node(e)}edgePoints(e){return this.digraph.edge(e._sourceVertex.id(),e._targetVertex.id(),e._id).points}};n(Lm,"Hierarchy");let qm=Lm;const $m=class _Subgraph extends o{_border;_textWidget=(new h).anchor("start").fontSize(14);_buttonMin=(new l).diameter(18).shape_colorStroke("#1f77b4").shape_colorFill("#dcf1ff").image_colorFill("#1f77b4").on("click",()=>{this.minClick()},!0).on("dblclick",()=>{},!0);_minState="normal";constructor(){super()}minState(e){return arguments.length?(this._minState=e,this):this._minState}calcIcon(){switch(this._minState){case"normal":return"";case"partial":return""}}getBBox(e=!1,t=!1){const r=this.width(),n=this.height();return{x:-r/2,y:-n/2-14,width:r,height:n}}enter(e,t){super.enter(e,t),this._border=t.append("rect").attr("class","border"),this._textWidget.target(e),this._buttonMin.target(e)}update(e,t){super.update(e,t);const r=this.getBBox();this._border.attr("x",r.x).attr("y",r.y).attr("width",r.width).attr("height",r.height).style("fill",this.border_colorFill()).style("stroke",this.border_colorStroke()),this.border_colorFill_exists()&&!this.title_colorFill_exists()&&this.title_colorFill(d.textColor(this.border_colorFill())),this._textWidget.pos({x:r.x+4,y:r.y+14}).width(this.width()-8).text(this.showTitle()?this.title():"").render(),this._buttonMin.visible(this.showMinMax()).pos({x:r.x+r.width-13,y:r.y+13}).faChar(this.calcIcon()).render()}exit(e,t){this._buttonMin.target(null),this._textWidget.target(null),this._border.remove(),super.exit(e,t)}intersection(e,t){let r=null;return[].forEach(function(e){(null===r||r.d>e.d)&&(r=e)}),r&&r.i?r.i:null}click(e){}minClick(){switch(this._minState){case"normal":this._minState="partial";break;case"partial":this._minState="normal"}this._buttonMin.faChar(this.calcIcon()).render()}};n($m,"Subgraph");let Tm=$m;Tm.prototype._class+=" graph_Subgraph",Tm.prototype.publish("border_colorStroke",null,"html-color","Stroke Color",null,{optional:!0}),Tm.prototype.publish("border_colorFill",null,"html-color","Fill Color",null,{optional:!0}),Tm.prototype.publish("showTitle",!0,"boolean","Show Title",null,{tags:["Basic"]}),Tm.prototype.publish("title","","string","Title",null,{tags:["Basic"]}),Tm.prototype.publishProxy("titleFontSize","_textWidget","fontSize"),Tm.prototype.publishProxy("title_colorFill","_textWidget","colorFill"),Tm.prototype.publish("showMinMax",!1,"boolean","Show Min/Max",null,{tags:["Basic"]});const Ym=class _Vertex extends o{_icon;_textBox;_annotationWidgets;_graphID;constructor(){super(),this._icon=new l,this._textBox=new a,this._annotationWidgets={},this.pos({x:void 0,y:void 0})}getIconBBox(){const e=this._icon.getBBox(!0),t=this._textBox.getBBox(!0);switch(this.iconAnchor()){case"start":return{x:-t.width/2+e.width/3,y:-t.height/2-e.height/3,width:e.width,height:e.height};case"middle":return{x:0,y:-t.height/2-e.height/3,width:e.width,height:e.height};case"end":return{x:t.width/2-e.width/3,y:-t.height/2-e.height/3,width:e.width,height:e.height};case"left":return{x:-t.width/2-e.width/2,y:0,width:e.width,height:e.height}}return{x:0,y:0,width:e.width,height:e.height}}getBBox(e=!1,t=!1){const r=this.getIconBBox(),n=this._textBox.getBBox(!0),i=Math.min(r.x,n.x),o=Math.min(r.y,n.y);return{x:i,y:o,width:Math.max(r.x+r.width,n.x+n.width)-i,height:Math.max(r.y+r.height,n.y+n.height)-o}}enter(e,t){super.enter(e,t),delete this._prevHash,this._icon.target(e),this._textBox.target(e),t.on("mouseover",e=>this.mouseover(e.data())).on("mouseout",e=>this.mouseout(e.data()))}_prevHash;update(e,t){super.update(e,t);const r=this.hashSum();if(this._prevHash!==r){this._prevHash=r,t.classed("centroid",this.centroid()),t.style("filter",this.centroid()?"url(#"+this._graphID+"_glow)":null),this._icon.tooltip(this.iconTooltip()?this.iconTooltip():this.tooltip()).render(),this._textBox.tooltip(this.tooltip()).render();const e=this.getIconBBox();this._icon.move(e);const n=this,i=t.selectAll(".annotation").data(this.annotationIcons()),o=i.enter().append("g").attr("class","annotation").each(function(e,t){n._annotationWidgets[t]=(new l).target(this).shape("square")}),a=this._textBox.getBBox(!0);let s=a.width/2;const u=a.height/2;o.merge(i).each(function(e,t){const r=n._annotationWidgets[t];r.diameter(n.annotationDiameter()).shape_colorFill(n.textbox_shape_colorFill()).shape_colorStroke(n.textbox_shape_colorStroke());for(const n in e)r[n]?r[n](e[n]):globalThis.__hpcc_debug&&console.warn("Invalid annotation property: "+n);r.render();const i=r.getBBox(!0);r.move({x:s-i.width/2+4,y:u+i.height/2-4}),s-=i.width+n.annotationSpacing()}),i.exit().each(function(e,t){const r=f(this);n._annotationWidgets[t].target(null),delete n._annotationWidgets[t],r.remove()})}}exit(e,t){for(const r in this._annotationWidgets)this._annotationWidgets[r].target(null);this._icon.target(null),this._textBox.target(null),super.exit(e,t)}contains(e){return this._icon.contains(e)||this._textBox.contains(e)}intersection(e,t){const r=this._icon.intersection(e,t),n=this._textBox.intersection(e,t);return r&&n?this.distance(r,t)<this.distance(n,t)?r:n:r||n}mouseover(e){}mouseout(e){}};n(Ym,"Vertex");let Hm=Ym;Hm.prototype._class+=" graph_Vertex",Hm.prototype.publishProxy("faChar","_icon"),Hm.prototype.publishProxy("imageUrl","_icon"),Hm.prototype.publishProxy("icon_diameter","_icon","diameter"),Hm.prototype.publishProxy("icon_paddingPercent","_icon","paddingPercent"),Hm.prototype.publishProxy("icon_shape_colorFill","_icon","shape_colorFill"),Hm.prototype.publishProxy("icon_shape_colorStroke","_icon","shape_colorStroke"),Hm.prototype.publishProxy("icon_image_colorFill","_icon","image_colorFill"),Hm.prototype.publishProxy("icon_fontFamily","_icon","fontFamily"),Hm.prototype.publish("centroid",!1,"boolean","Centroid Vertex"),Hm.prototype.publishProxy("text","_textBox"),Hm.prototype.publishProxy("anchor","_textBox"),Hm.prototype.publishProxy("textbox_shape_colorStroke","_textBox","shape_colorStroke"),Hm.prototype.publishProxy("textbox_shape_colorFill","_textBox","shape_colorFill"),Hm.prototype.publishProxy("textbox_text_colorFill","_textBox","text_colorFill"),Hm.prototype.publishProxy("textbox_text_fontFamily","_textBox","text_fontFamily"),Hm.prototype.publish("iconAnchor","start","set","Horizontal anchor position of icon",["","start","middle","end","left"],{tags:["Basic"]}),Hm.prototype.publish("iconTooltip","","string","iconTooltip",null,{tags:["Private"]}),Hm.prototype.publish("tooltip","","string","Tooltip",null,{tags:["Private"]}),Hm.prototype.publish("annotationDiameter",14,"number","Annotation Diameter",null,{tags:["Private"]}),Hm.prototype.publish("annotationSpacing",3,"number","Annotation Spacing",null,{tags:["Private"]}),Hm.prototype.publish("annotationIcons",[],"array","Annotations",null,{tags:["Private"]});const Gm=class _Graph extends p{_toggleHierarchy=(new _).faChar("fa-sitemap").tooltip("Hierarchy").on("click",()=>this.layoutClick("Hierarchy"));_toggleForceDirected=(new _).faChar("fa-expand").tooltip("Force Directed").on("click",()=>this.layoutClick("ForceDirected"));_toggleForceDirected2=(new _).faChar("fa-arrows").tooltip("Spring").on("click",()=>this.layoutClick("ForceDirected2"));_toggleCircle=(new _).faChar("fa-circle-o").tooltip("Circle").on("click",()=>this.layoutClick("Circle"));_graphData;highlight;_selection;_dragging;forceLayout;_d3Drag;defs;_centroidFilter;svgFragment;svg;svgC;svgE;svgV;constructor(){super(),P.call(this),R.call(this),this.tooltipHTML(function(e){let t;return e instanceof Tm?t=e.title().replace(/\n/g,"<br>"):(e instanceof Hm||e instanceof ye)&&(t=e.text().replace(/\n/g,"<br>")),t?`<p style="text-align:center">${t}</p>`:null}),this._drawStartPos="origin";const e=[this._toggleHierarchy,this._toggleForceDirected,this._toggleForceDirected2,this._toggleCircle,new g];this._iconBar.buttons(e.concat(this._iconBar.buttons())),this._graphData=new Ng,this.highlight={zoom:1.1,opacity:.33,edge:"1.25px"},this._selection=new m.Selection(this),this.zoomToFitLimit(1)}iconBarButtons(){return this._iconBar.buttons()}layoutClick(e){this.layout(e),"ForceDirected2"!==e&&this.applyScaleOnLayout(!0),this.layout(e).render(e=>{this.applyScaleOnLayout(!1)})}getOffsetPos(){return{x:0,y:0}}size(e){return super.size.apply(this,arguments)}clear(){this.data({subgraphs:[],vertices:[],edges:[],hierarchy:[]},!1)}_dataHash=0;data(e,t){const r=super.data.apply(this,arguments);if(arguments.length){t||(this._graphData=new Ng,this._renderCount=0);const r=this._graphData.setData(e.subgraphs||[],e.vertices||[],e.edges||[],e.hierarchy||[],t||!1);r.addedVertices.length&&this._dataHash++;const n=this;r.addedVertices.forEach(function(e){e._graphID=n._id}),r.addedEdges.forEach(function(e){e._graphID=n._id});const i={};this._graphData.edges().forEach(function(e){i[e._sourceVertex._id]||(i[e._sourceVertex._id]={}),i[e._sourceVertex._id][e._targetVertex._id]||(i[e._sourceVertex._id][e._targetVertex._id]=0);const t=++i[e._sourceVertex._id][e._targetVertex._id];e.arcDepth(16*t)})}return r}graphData(){return this._graphData}selection(e){return arguments.length?(this._selection.set(e),this):this._selection.get()}_linkcolor;linkcolor_default(e){return arguments.length?(this._linkcolor=e,this):this._linkcolor}_linktooltip;linktooltip_default(e){return arguments.length?(this._linktooltip=e,this):this._linktooltip}_neighborOffsets=[];dragstart(e){if(this.allowDragging()){const t=y();if(t.sourceEvent.stopPropagation(),e.__drag_dx=t.x-e.x(),e.__drag_dy=t.y-e.y(),this._dragging=!0,this.forceLayout){t.active||this.forceLayout.force.alphaTarget(.3).restart();const r=this.forceLayout.vertexMap[e.id()];r.fixed=!0,r.fx=r.x,r.fy=r.y}this._neighborOffsets=[],this.dragSingleNeighbors()&&(this._neighborOffsets=this._graphData.singleNeighbors(e.id()).map(t=>(f(t.target()).raise(),{neighbor:t,offsetX:e.x()-t.x(),offsetY:e.y()-t.y()})));const r=e.target();let n=r.nextSibling;for(;n;)r.parentNode.insertBefore(n,r),n=r.nextSibling;s.svgMarkerGlitch&&this._graphData.nodeEdges(e.id()).forEach(e=>{const t=this._graphData.edge(e);this._pushMarkers(t.element())})}}dragging(e){if(this.allowDragging()){const t=y();if(t.sourceEvent.stopPropagation(),e.move({x:t.x-e.__drag_dx,y:t.y-e.__drag_dy}),this.forceLayout){const r=this.forceLayout.vertexMap[e.id()];r.fixed=!0,r.fx=t.x-e.__drag_dx,r.fy=t.y-e.__drag_dy}this._neighborOffsets.forEach(r=>{const n=t.x-e.__drag_dx-r.offsetX,i=t.y-e.__drag_dy-r.offsetY;if(this.forceLayout){const e=this.forceLayout.vertexMap[r.neighbor.id()];e.fixed=!0,e.fx=n,e.fy=i}r.neighbor.move({x:n,y:i})}),this.refreshIncidentEdges(e,!0)}}dragend(e){if(this.allowDragging()){if(y().sourceEvent.stopPropagation(),this._dragging=!1,this.snapToGrid()){const t=e.calcSnap(this.snapToGrid());e.move(t[0]),this.refreshIncidentEdges(e,!0)}if(this.forceLayout){const t=this.forceLayout.vertexMap[e.id()];t.fixed=!1,t.fx=null,t.fy=null,this._neighborOffsets.forEach(e=>{const t=this.forceLayout.vertexMap[e.neighbor.id()];t.fixed=!1,t.fx=null,t.fy=null})}this._neighborOffsets=[],s.svgMarkerGlitch&&this._graphData.nodeEdges(e.id()).forEach(function(e){const t=this._graphData.edge(e);this._popMarkers(t.element())})}}enter(e,t){super.enter(e,t),this._zoomGrab.on("click.clear",()=>{this.selectionClearOnBackgroundClick()&&this._selection.clear()}),this._d3Drag=v().on("start",e=>this.dragstart(e)).on("end",e=>this.dragend(e)).on("drag",e=>this.dragging(e)),this.defs=this._renderElement.append("defs"),this.addMarkers(),this._centroidFilter=new b(this.defs,this._id+"_glow"),this.svg=this._renderElement.append("svg:g"),this.svgC=this.svg.append("g").attr("id",this._id+"C"),this.svgE=this.svg.append("g").attr("id",this._id+"E"),this.svgV=this.svg.append("g").attr("id",this._id+"V")}getBounds(e,t){const r=[[null,null],[null,null]];return e.forEach(function(e){const n=t?t.nodePos(e._id):{x:e.x(),y:e.y(),width:e.width(),height:e.height()},i=n.x-n.width/2,o=n.x+n.width/2,a=n.y-n.height/2,s=n.y+n.height/2;(null===r[0][0]||r[0][0]>i)&&(r[0][0]=i),(null===r[0][1]||r[0][1]>a)&&(r[0][1]=a),(null===r[1][0]||r[1][0]<o)&&(r[1][0]=o),(null===r[1][1]||r[1][1]<s)&&(r[1][1]=s)}),r}getVertexBounds(e){return this.getBounds(this._graphData.nodes(),e)}getSelectionBounds(e){return this.getBounds(this._selection.get(),e)}centerOnItem(e){const t=e.getBBox(!0),r=t.x+t.width/2,n=t.y+t.height/2,i={x:e.x()+r-t.width/2,y:e.y()+n-t.height/2,width:t.width,height:t.height};this.centerOnBBox(i)}zoomToItem(e){const t=e.getBBox(!0),r=t.x+t.width/2,n=t.y+t.height/2,i={x:e.x()+r-t.width/2,y:e.y()+n-t.height/2,width:t.width,height:t.height};this.zoomToBBox(i)}updateVertices(e,t,r){const i=this.width(),o=this.height(),a=this,s=e.selectAll("#"+this._id+t+" > .graphVertex").data(r,function(e){return e.id()});function u(e){f(this).style("cursor",a.allowDragging()?"move":"pointer"),e.target(this).pos({x:e.x()||i/2,y:e.y()||o/2}).animationFrameRender(),a.allowDragging()&&f(this).call(a._d3Drag),e.dispatch&&(e.dispatch.on("sizestart",function(e){e.allowResize(a.allowDragging()),a.allowDragging()&&(a._dragging=!0)}),e.dispatch.on("size",function(e){a.refreshIncidentEdges(e,!1)}),e.dispatch.on("sizeend",function(e){if(a._dragging=!1,a.snapToGrid()){const t=e.calcSnap(a.snapToGrid());e.pos(t[0]).size(t[1]).render(),a.refreshIncidentEdges(e,!1)}}))}function c(e){e.animationFrameRender()}s.enter().append("g").attr("class","graphVertex").style("opacity",1e-6).on("click.selectionBag",function(e){a._selection.click(e,y()),a.selectionChanged()}).on("click",function(e){const t=f(this).select(".graph_Vertex");let r=!1;t.empty()||(r=t.classed("selected")),a.vertex_click(a.rowToObj(e.data()),"",r,{vertex:e})}).on("dblclick",function(e){y().stopPropagation();const t=f(this).select(".graph_Vertex");let r=!1;t.empty()||(r=t.classed("selected")),a.vertex_dblclick(a.rowToObj(e.data()),"",r,{vertex:e})}).on("contextmenu",function(e){const t=f(this).select(".graph_Vertex");let r=!1;t.empty()||(r=t.classed("selected")),a.vertex_contextmenu(a.rowToObj(e.data()),"",r,{vertex:e})}).on("mouseout.tooltip",this.tooltip.hide).on("mousemove.tooltip",this.tooltip.show).on("mouseover",function(e){a._dragging||a.vertex_mouseover(f(this),e)}).on("mouseout",function(e){a._dragging||a.vertex_mouseout(f(this),e)}).each(u).transition().duration(750).style("opacity",1),n(u,"createV"),s.each(c),n(c,"updateV"),s.exit().each(function(e){e.target(null)}).remove(),s.order()}update(e,t){super.update(e,t),this.tooltip.hide(),this._centroidFilter.update(this.centroidColor());const r=this.layout();this._toggleHierarchy.selected("Hierarchy"===r).render(),this._toggleForceDirected.selected("ForceDirected"===r).render(),this._toggleForceDirected2.selected("ForceDirected2"===r).render(),this._toggleCircle.selected("Circle"===r).render();const i=this;this.updateVertices(this.svgC,"C",this._graphData.nodes().filter(e=>"Hierarchy"===this.layout()&&e instanceof Tm)),this.updateVertices(this.svgV,"V",this._graphData.nodes().filter(e=>!(e instanceof Tm)));const o=this.svgE.selectAll("#"+this._id+"E > .graphEdge").data(this.showEdges()?this._graphData.edges():[],function(e){return e.id()});function a(e){e.target(this).animationFrameRender()}function s(e){e.animationFrameRender()}o.enter().append("g").attr("class","graphEdge").style("opacity",1e-6).on("click.selectionBag",function(e){i._selection.click(e,y())}).on("click",function(e){const t=f(this).select(".graph_Edge");let r=!1;t.empty()||(r=t.classed("selected")),i.edge_click(i.rowToObj(e.data()),"",r,{edge:e})}).on("dblclick",function(e){const t=f(this).select(".graph_Edge");let r=!1;t.empty()||(r=t.classed("selected")),i.edge_dblclick(i.rowToObj(e.data()),"",r,{edge:e})}).on("mouseout.tooltip",this.tooltip.hide).on("mousemove.tooltip",this.tooltip.show).on("mouseover",function(e){i._dragging||i.edge_mouseover(f(this),e)}).on("mouseout",function(e){i._dragging||i.edge_mouseout(f(this),e)}).each(a).transition().duration(750).style("opacity",1),n(a,"createE"),o.each(s),n(s,"updateE"),o.exit().each(function(e){e.target(null)}).remove(),this._renderCount||(this._renderCount++,this.layout(this.layout()))}exit(e,t){this._graphData.nodes().forEach(e=>e.target(null)),this._graphData.edges().forEach(e=>e.target(null)),super.exit(e,t)}render(e){return this.progress("start"),super.render(t=>{this.doLayout().then(()=>{this.progress("end"),e&&e(t)})}),this}_prevLayout;_prevDataHash;doLayout(e=0){return new Promise((t,r)=>{requestAnimationFrame(()=>{this._prevLayout!==this.layout()||this._prevDataHash!==this._dataHash?(this._prevLayout=this.layout(),this._prevDataHash=this._dataHash,this._doLayout(e).then(()=>{t()})):t()})})}_doLayout(e=0){return new Promise((t,r)=>{this.progress("layout-start"),this.forceLayout&&(this.forceLayout.force.stop(),this.forceLayout=null);const n=this,i=this.getLayoutEngine();"ForceDirected2"===this.layout()?(this.forceLayout=i,this.forceLayout.force.on("tick",function(){n.progress("layout-tick"),i.vertices.forEach(function(e){if(e.fixed);else{const t=n._graphData.node(e.id);t&&t.move({x:e.x,y:e.y})}}),n._graphData.edges().forEach(e=>{e.points([],!1,!1)}),n.applyScaleOnLayout()}).on("end",function(){n.progress("layout-end")}),this.forceLayout.force.restart(),t()):i&&(this.forceLayout=null,n._dragging=!0,n._graphData.nodes().forEach(function(e){const t=i.nodePos(e.id());e instanceof _Graph.Subgraph?e.pos({x:t.x,y:t.y}).size({width:t.width,height:t.height}).animationFrameRender():e.move({x:t.x,y:t.y},0)}),n._graphData.edges().forEach(t=>{const r=i.edgePoints(t);t.points(r,e)}),n.applyScaleOnLayout()&&requestAnimationFrame(()=>{n.zoomToFit(),t()}),this._fixIEMarkers(),setTimeout(function(){n._dragging=!1},e?e+50:50),this.progress("layout-end"),n.applyScaleOnLayout()||t())})}getLayoutEngine(){switch(this.layout()){case"Circle":return new jm(this._graphData,this._size.width,this._size.height);case"ForceDirected":return new Im(this._graphData,this._size.width,this._size.height,{oneShot:!0,linkDistance:this.forceDirectedLinkDistance(),linkStrength:this.forceDirectedLinkStrength(),friction:this.forceDirectedFriction(),charge:this.forceDirectedCharge(),chargeDistance:this.forceDirectedChargeDistance(),theta:this.forceDirectedTheta(),gravity:this.forceDirectedGravity()});case"ForceDirected2":return new Im(this._graphData,this._size.width,this._size.height,{linkDistance:this.forceDirectedLinkDistance(),linkStrength:this.forceDirectedLinkStrength(),friction:this.forceDirectedFriction(),charge:this.forceDirectedCharge(),chargeDistance:this.forceDirectedChargeDistance(),theta:this.forceDirectedTheta(),gravity:this.forceDirectedGravity()});case"Hierarchy":return new qm(this._graphData,this._size.width,this._size.height,{rankdir:this.hierarchyRankDirection(),nodesep:this.hierarchyNodeSeparation(),edgesep:this.hierarchyEdgeSeparation(),ranksep:this.hierarchyRankSeparation(),digraph:this.hierarchyDigraph()})}return null}getNeighborMap(e){const t={},r={};if(e){const n=this._graphData.nodeEdges(e.id());for(let i=0;i<n.length;++i){const o=this._graphData.edge(n[i]);r[o.id()]=o,o._sourceVertex.id()!==e.id()&&(t[o._sourceVertex.id()]=o._sourceVertex),o._targetVertex.id()!==e.id()&&(t[o._targetVertex.id()]=o._targetVertex)}}return{vertices:t,edges:r}}highlightVerticies(e){const t=this;return this.svgV.selectAll(".graphVertex").classed("graphVertex-highlighted",t=>!e||e[t.id()]).style("filter",t=>e&&e[t.id()]?"url(#"+this.id()+"_glow)":null).transition().duration(this.transitionDuration()).on("end",function(t){e&&e[t.id()]&&t._placeholderElement.node()&&t._placeholderElement.node().parentNode&&t._placeholderElement.node().parentNode.appendChild(t._placeholderElement.node())}).style("opacity",function(r){return!e||e[r.id()]?1:t.highlight.opacity}),this}highlightEdges(e){const t=this;return this.svgE.selectAll(".graphEdge").classed("graphEdge-highlighted",function(t){return!e||e[t.id()]}).style("stroke-width",function(r){return e&&e[r.id()]?t.highlight.edge:"1px"}).transition().duration(this.transitionDuration()).style("opacity",function(r){return!e||e[r.id()]?1:t.highlight.opacity}),this}highlightVertex(e,t){if(this.highlightOnMouseOverVertex())if(t){const e=this.getNeighborMap(t);e.vertices[t.id()]=t,this.highlightVerticies(e.vertices),this.highlightEdges(e.edges)}else this.highlightVerticies(null),this.highlightEdges(null)}highlightEdge(e,t){if(this.highlightOnMouseOverEdge())if(t){const e={};e[t._sourceVertex.id()]=t._sourceVertex,e[t._targetVertex.id()]=t._targetVertex;const r={};r[t.id()]=t,this.highlightVerticies(e),this.highlightEdges(r)}else this.highlightVerticies(null),this.highlightEdges(null)}refreshIncidentEdges(e,t){this._graphData.nodeEdges(e.id()).forEach(e=>{this._graphData.edge(e).points([],!1,t)})}centroids(){return this._graphData.nodes().filter(e=>e.centroid())}selectionChanged(){if(this.highlightSelectedPathToCentroid()){const e={};this.centroids().forEach(t=>{this.selection().forEach(r=>{this._graphData.undirectedShortestPath(t.id(),r.id()).forEach(t=>{e[t.id()]=!0})})}),this.svgE.selectAll(".graphEdge").classed("shortest-path",t=>!0===e[t.id()])}}vertex_click(e,t,r,n){n&&n.vertex&&n.vertex._placeholderElement.node().parentNode.appendChild(n.vertex._placeholderElement.node()),P.prototype.vertex_click.apply(this,arguments)}vertex_dblclick(e,t,r,n){}vertex_contextmenu(e,t,r,n){}vertex_mouseover(e,t){this.highlightVertex(e,t)}vertex_mouseout(e,t){this.highlightVertex(null,null)}edge_mouseover(e,t){this.highlightEdge(e,t)}edge_mouseout(e,t){this.highlightEdge(null,null)}addMarkers(e=!1){e&&(this.defs.select("#"+this._id+"_arrowHead").remove(),this.defs.select("#"+this._id+"_circleFoot").remove(),this.defs.select("#"+this._id+"_circleHead").remove(),this.defs.select("#"+this._id+"_glow").remove()),this.defs.append("marker").attr("class","marker").attr("id",this._id+"_arrowHead").attr("viewBox","0 0 10 10").attr("refX",10).attr("refY",5).attr("markerWidth",8).attr("markerHeight",8).attr("markerUnits","strokeWidth").attr("orient","auto").append("polyline").attr("points","0,0 10,5 0,10 1,5"),this.defs.append("marker").attr("class","marker").attr("id",this._id+"_circleFoot").attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",7).attr("markerHeight",7).attr("markerUnits","strokeWidth").attr("orient","auto").append("circle").attr("cx",5).attr("cy",5).attr("r",4),this.defs.append("marker").attr("class","marker").attr("id",this._id+"_circleHead").attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",7).attr("markerHeight",7).attr("markerUnits","strokeWidth").attr("orient","auto").append("circle").attr("cx",5).attr("cy",5).attr("r",4)}progress(e){}};n(Gm,"Graph"),i(Gm,"Subgraph",Tm),i(Gm,"Vertex",Hm),i(Gm,"Edge",ye),i(Gm,"profileID",0);let Vm=Gm;Vm.prototype._class+=" graph_Graph",Vm.prototype.implements(P.prototype),Vm.prototype.implements(R.prototype),Vm.prototype.publish("allowDragging",!0,"boolean","Allow Dragging of Vertices",null,{tags:["Advanced"]}),Vm.prototype.publish("dragSingleNeighbors",!1,"boolean","Dragging a Vertex also moves its singleton neighbors",null,{tags:["Advanced"]}),Vm.prototype.publish("layout","Circle","set","Default Layout",["Circle","ForceDirected","ForceDirected2","Hierarchy","None"],{tags:["Basic"]}),Vm.prototype.publish("scale","100%","set","Zoom Level",["all","width","selection","100%","90%","75%","50%","25%","10%"],{tags:["Basic"]}),Vm.prototype.publish("applyScaleOnLayout",!1,"boolean","Shrink to fit on Layout",null,{tags:["Basic"]}),Vm.prototype.publish("highlightOnMouseOverVertex",!1,"boolean","Highlight Vertex on Mouse Over",null,{tags:["Basic"]}),Vm.prototype.publish("highlightOnMouseOverEdge",!1,"boolean","Highlight Edge on Mouse Over",null,{tags:["Basic"]}),Vm.prototype.publish("transitionDuration",250,"number","Transition Duration",null,{tags:["Intermediate"]}),Vm.prototype.publish("showEdges",!0,"boolean","Show Edges",null,{tags:["Intermediate"]}),Vm.prototype.publish("snapToGrid",0,"number","Snap to Grid",null,{tags:["Private"]}),Vm.prototype.publish("selectionClearOnBackgroundClick",!1,"boolean","Clear selection on background click"),Vm.prototype.publish("centroidColor","#00A000","html-color","Centroid Color",null,{tags:["Basic"]}),Vm.prototype.publish("highlightSelectedPathToCentroid",!1,"boolean","Highlight path to Center Vertex (for selected vertices)",null,{tags:["Basic"]}),Vm.prototype.publish("hierarchyRankDirection","TB","set","Direction for Rank Nodes",["TB","BT","LR","RL"],{tags:["Advanced"]}),Vm.prototype.publish("hierarchyNodeSeparation",50,"number","Number of pixels that separate nodes horizontally in the layout",null,{tags:["Advanced"]}),Vm.prototype.publish("hierarchyEdgeSeparation",10,"number","Number of pixels that separate edges horizontally in the layout",null,{tags:["Advanced"]}),Vm.prototype.publish("hierarchyRankSeparation",50,"number","Number of pixels between each rank in the layout",null,{tags:["Advanced"]}),Vm.prototype.publish("hierarchyDigraph",!0,"boolean","Directional Graph",null,{tags:["Advanced"]}),Vm.prototype.publish("forceDirectedLinkDistance",300,"number","Target distance between linked nodes",null,{tags:["Advanced"]}),Vm.prototype.publish("forceDirectedLinkStrength",1,"number","Strength (rigidity) of links",null,{tags:["Advanced"]}),Vm.prototype.publish("forceDirectedFriction",.9,"number","Friction coefficient",null,{tags:["Advanced"]}),Vm.prototype.publish("forceDirectedCharge",-25,"number","Charge strength ",null,{tags:["Advanced"]}),Vm.prototype.publish("forceDirectedChargeDistance",1e4,"number","Maximum distance over which charge forces are applied",null,{tags:["Advanced"]}),Vm.prototype.publish("forceDirectedTheta",.8,"number","Barnes–Hut approximation criterion",null,{tags:["Advanced"]}),Vm.prototype.publish("forceDirectedGravity",.1,"number","Gravitational strength",null,{tags:["Advanced"]});const Xm=Vm.prototype.scale;Vm.prototype.scale=function(e,t){const r=Xm.apply(this,arguments);return arguments.length&&this.zoomTo(e,t),r};const zm=class _Annotation extends w{_owner;owner(e){return arguments.length?(this._owner=e,this):this._owner}valid(){return!!this.iconColumn()}indexes(){const e=this._owner.columns();return{iconCol:e.indexOf(this.iconColumn()),iconFillCol:e.indexOf(this.iconFillColumn()),tooltipCol:e.indexOf(this.tooltipColumn()),shapeStrokeCol:e.indexOf(this.shapeStrokeColumn()),shapeFillCol:e.indexOf(this.shapeFillColumn())}}mapper(){const e=this.indexes();return t=>({faChar:t[e.iconCol],tooltip:t[e.tooltipCol],shape_colorFill:t[e.shapeFillCol]||this.shapeFillDefault(),shape_colorStroke:t[e.shapeStrokeCol]||this.shapeStrokeDefault(),image_colorFill:t[e.iconFillCol]||this.iconFillDefault()})}};n(zm,"Annotation");let Wm=zm;Wm.prototype._class+=" graph_Annotation",Wm.prototype.publish("iconColumn","","set","Icon column",function(){return this._owner.columns()},{optional:!0}),Wm.prototype.publish("iconFillDefault","white","html-color","Icon fill default color"),Wm.prototype.publish("iconFillColumn","","set","Icon fill color column",function(){return this._owner.columns()},{optional:!0}),Wm.prototype.publish("tooltipColumn","","set","Tooltip column",function(){return this._owner.columns()},{optional:!0}),Wm.prototype.publish("shapeStrokeDefault","darkred","html-color","Shape stroke default color"),Wm.prototype.publish("shapeStrokeColumn","","set","Shape stroke color column",function(){return this._owner.columns()},{optional:!0}),Wm.prototype.publish("shapeFillDefault","red","html-color","Shape fill default color"),Wm.prototype.publish("shapeFillColumn","","set","Shape fill color column",function(){return this._owner.columns()},{optional:!0});const Zm=class _AdjacencyGraph extends Vm{_vertexMap={};_edgeMap={};_prevAdjacencyDataHash;_merge=!1;_adjacencyData=[];constructor(){super()}linksColumns(){const e=this.columns().indexOf(this.linksColumn()),t=this._db.field(e);return t?t.children().map(e=>e.label()):[]}validAnnotations(){return this.annotations().filter(e=>e.valid())}updateData(){const e=M([this._adjacencyData,this.uidColumn(),this.labelColumn(),this.iconColumn(),this.linksColumn(),this.linkUidColumn(),this.linkLabelColumn(),this.validAnnotations().map(e=>e.hashSum())]);if(this._prevAdjacencyDataHash!==e){this._prevAdjacencyDataHash=e;const t=this.columns(),r=t.indexOf(this.uidColumn()),n=t.indexOf(this.labelColumn()),i=t.indexOf(this.iconColumn()),o=t.indexOf(this.linksColumn()),a=this.linksColumns(),s=a.indexOf(this.linkUidColumn()),u=a.indexOf(this.linkLabelColumn()),c=this.validAnnotations().map(e=>e.mapper()),h={},l={},d={vertices:this._adjacencyData.map(e=>{const t=e[r];if(void 0!==t){let r=h[t]||this._vertexMap[t];return r||(r=new Hm),h[t]=r,r.text(e[n]).data(e).faChar(e[i]).annotationIcons(c.map(t=>t(e))),r}}).filter(e=>!!e),edges:[]};for(const e of this._adjacencyData){const t=e[r],n=e[o];if(void 0!==t&&void 0!==n)for(const e of n){const r=e[s],n=e[u],i=`${t}->${r}`;let o=l[i]||this._edgeMap[i];o||(h[t]&&h[r]?o=(new ye).sourceVertex(h[t]).targetVertex(h[r]).data(e):console.warn("Missing vertices for edge: "+i)),o&&(o.text(n),l[i]=o,d.edges.push(o))}}this._vertexMap=h,this._edgeMap=l,super.data(d,this._merge)}}data(e,t){if(!arguments.length)return this._adjacencyData;if(e instanceof Array)return this._merge=t,this._adjacencyData=e,this;throw new Error("Invalid data shape.")}update(e,t){this.updateData(),super.update(e,t)}click(e,t,r){}};n(Zm,"AdjacencyGraph");let Um=Zm;function Km(e,t){return e.sourceLinks.length?e.depth:t-1}function Qm(e){return function(){return e}}function Jm(e,t){return ey(e.source,t.source)||e.index-t.index}function Am(e,t){return ey(e.target,t.target)||e.index-t.index}function ey(e,t){return e.y0-t.y0}function ty(e){return e.value}function ry(e){return e.index}function ny(e){return e.nodes}function iy(e){return e.links}function oy(e,t){const r=e.get(t);if(!r)throw new Error("missing: "+t);return r}function ay({nodes:e}){for(const t of e){let e=t.y0,r=e;for(const n of t.sourceLinks)n.y0=e+n.width/2,e+=n.width;for(const n of t.targetLinks)n.y1=r+n.width/2,r+=n.width}}function sy(){let e,t,r,i=0,o=0,a=1,s=1,u=24,c=8,h=ry,l=Km,d=ny,f=iy,p=6;function _(){const e={nodes:d.apply(null,arguments),links:f.apply(null,arguments)};return g(e),m(e),y(e),v(e),k(e),ay(e),e}function g({nodes:e,links:t}){for(const[r,i]of e.entries())i.index=r,i.sourceLinks=[],i.targetLinks=[];const n=new Map(e.map((t,r)=>[h(t,r,e),t]));for(const[r,i]of t.entries()){i.index=r;let{source:e,target:t}=i;"object"!=typeof e&&(e=i.source=oy(n,e)),"object"!=typeof t&&(t=i.target=oy(n,t)),e.sourceLinks.push(i),t.targetLinks.push(i)}if(null!=r)for(const{sourceLinks:i,targetLinks:o}of e)i.sort(r),o.sort(r)}function m({nodes:e}){for(const t of e)t.value=void 0===t.fixedValue?Math.max(x(t.sourceLinks,ty),x(t.targetLinks,ty)):t.fixedValue}function y({nodes:e}){const t=e.length;let r=new Set(e),n=/* @__PURE__ */new Set,i=0;for(;r.size;){for(const e of r){e.depth=i;for(const{target:t}of e.sourceLinks)n.add(t)}if(++i>t)throw new Error("circular link");r=n,n=/* @__PURE__ */new Set}}function v({nodes:e}){const t=e.length;let r=new Set(e),n=/* @__PURE__ */new Set,i=0;for(;r.size;){for(const e of r){e.height=i;for(const{source:t}of e.targetLinks)n.add(t)}if(++i>t)throw new Error("circular link");r=n,n=/* @__PURE__ */new Set}}function b({nodes:e}){const r=E(e,e=>e.depth)+1,n=(a-i-u)/(r-1),o=new Array(r);for(const t of e){const e=Math.max(0,Math.min(r-1,Math.floor(l.call(null,t,r))));t.layer=e,t.x0=i+e*n,t.x1=t.x0+u,o[e]?o[e].push(t):o[e]=[t]}if(t)for(const i of o)i.sort(t);return o}function w(t){const r=C(t,t=>(s-o-(t.length-1)*e)/x(t,ty));for(const n of t){let t=o;for(const i of n){i.y0=t,i.y1=t+i.value*r,t=i.y1+e;for(const e of i.sourceLinks)e.width=e.value*r}t=(s-t+e)/(n.length+1);for(let e=0;e<n.length;++e){const r=n[e];r.y0+=t*(e+1),r.y1+=t*(e+1)}R(n)}}function k(t){const r=b(t);e=Math.min(c,(s-o)/(E(r,e=>e.length)-1)),w(r);for(let e=0;e<p;++e){const t=Math.pow(.99,e),n=Math.max(1-t,(e+1)/p);O(r,t,n),D(r,t,n)}}function D(e,r,n){for(let i=1,o=e.length;i<o;++i){const o=e[i];for(const e of o){let t=0,n=0;for(const{source:r,value:o}of e.targetLinks){let i=o*(e.layer-r.layer);t+=B(r,e)*i,n+=i}if(!(n>0))continue;let i=(t/n-e.y0)*r;e.y0+=i,e.y1+=i,P(e)}void 0===t&&o.sort(ey),M(o,n)}}function O(e,r,n){for(let i=e.length-2;i>=0;--i){const o=e[i];for(const e of o){let t=0,n=0;for(const{target:r,value:o}of e.sourceLinks){let i=o*(r.layer-e.layer);t+=N(e,r)*i,n+=i}if(!(n>0))continue;let i=(t/n-e.y0)*r;e.y0+=i,e.y1+=i,P(e)}void 0===t&&o.sort(ey),M(o,n)}}function M(t,r){const n=t.length>>1,i=t[n];F(t,i.y0-e,n-1,r),S(t,i.y1+e,n+1,r),F(t,s,t.length-1,r),S(t,o,0,r)}function S(t,r,n,i){for(;n<t.length;++n){const o=t[n],a=(r-o.y0)*i;a>1e-6&&(o.y0+=a,o.y1+=a),r=o.y1+e}}function F(t,r,n,i){for(;n>=0;--n){const o=t[n],a=(o.y1-r)*i;a>1e-6&&(o.y0-=a,o.y1-=a),r=o.y0-e}}function P({sourceLinks:e,targetLinks:t}){if(void 0===r){for(const{source:{sourceLinks:e}}of t)e.sort(Am);for(const{target:{targetLinks:t}}of e)t.sort(Jm)}}function R(e){if(void 0===r)for(const{sourceLinks:t,targetLinks:r}of e)t.sort(Am),r.sort(Jm)}function B(t,r){let n=t.y0-(t.sourceLinks.length-1)*e/2;for(const{target:i,width:o}of t.sourceLinks){if(i===r)break;n+=o+e}for(const{source:e,width:i}of r.targetLinks){if(e===t)break;n-=i}return n}function N(t,r){let n=r.y0-(r.targetLinks.length-1)*e/2;for(const{source:i,width:o}of r.targetLinks){if(i===t)break;n+=o+e}for(const{target:e,width:i}of t.sourceLinks){if(e===r)break;n-=i}return n}return n(_,"sankey"),_.update=function(e){return ay(e),e},_.nodeId=function(e){return arguments.length?(h="function"==typeof e?e:Qm(e),_):h},_.nodeAlign=function(e){return arguments.length?(l="function"==typeof e?e:Qm(e),_):l},_.nodeSort=function(e){return arguments.length?(t=e,_):t},_.nodeWidth=function(e){return arguments.length?(u=+e,_):u},_.nodePadding=function(t){return arguments.length?(c=e=+t,_):c},_.nodes=function(e){return arguments.length?(d="function"==typeof e?e:Qm(e),_):d},_.links=function(e){return arguments.length?(f="function"==typeof e?e:Qm(e),_):f},_.linkSort=function(e){return arguments.length?(r=e,_):r},_.size=function(e){return arguments.length?(i=o=0,a=+e[0],s=+e[1],_):[a-i,s-o]},_.extent=function(e){return arguments.length?(i=+e[0][0],a=+e[1][0],o=+e[0][1],s=+e[1][1],_):[[i,o],[a,s]]},_.iterations=function(e){return arguments.length?(p=+e,_):p},n(g,"computeNodeLinks"),n(m,"computeNodeValues"),n(y,"computeNodeDepths"),n(v,"computeNodeHeights"),n(b,"computeNodeLayers"),n(w,"initializeNodeBreadths"),n(k,"computeNodeBreadths"),n(D,"relaxLeftToRight"),n(O,"relaxRightToLeft"),n(M,"resolveCollisions"),n(S,"resolveCollisionsTopToBottom"),n(F,"resolveCollisionsBottomToTop"),n(P,"reorderNodeLinks"),n(R,"reorderLinks"),n(B,"targetTop"),n(N,"sourceTop"),_}function uy(e){return[e.source.x1,e.y0]}function cy(e){return[e.target.x0,e.y1]}function hy(){return ce().source(uy).target(cy)}Um.prototype._class+=" graph_AdjacencyGraph",Um.prototype.publish("uidColumn","","set","UID column",function(){return this.columns()},{optional:!0}),Um.prototype.publish("labelColumn","","set","Label column",function(){return this.columns()},{optional:!0}),Um.prototype.publish("iconColumn","","set","Icon column",function(){return this.columns()},{optional:!0}),Um.prototype.publish("linksColumn","","set","Links column",function(){return this.columns()},{optional:!0}),Um.prototype.publish("linkUidColumn","","set","Link UID column",function(){return this.linksColumns()},{optional:!0}),Um.prototype.publish("linkLabelColumn","","set","Link Label column",function(){return this.linksColumns()},{optional:!0}),Um.prototype.publish("annotations",[],"propertyArray","Annotations",null,{autoExpand:Wm}),n(Km,"justify"),n(Qm,"constant"),n(Jm,"ascendingSourceBreadth"),n(Am,"ascendingTargetBreadth"),n(ey,"ascendingBreadth"),n(ty,"value"),n(ry,"defaultId"),n(ny,"defaultNodes"),n(iy,"defaultLinks"),n(oy,"find"),n(ay,"computeLinkBreadths"),n(sy,"Sankey$1"),n(uy,"horizontalSource"),n(cy,"horizontalTarget"),n(hy,"d3SankeyLinkHorizontal");const ly={mean:D,median:k,min:C,max:E,sum:x},dy=class _SankeyColumn extends w{_owner;constructor(){super()}owner(e){return arguments.length?(this._owner=e,this):this._owner}valid(){return!!this.column()}aggregate(e){switch(this.aggrType()){case null:case void 0:case"":return e.length;default:const t=this._owner.columns().indexOf(this.aggrColumn());return ly[this.aggrType()](e,function(e){return+e[t]})}}};n(dy,"SankeyColumn");let fy=dy;fy.prototype._class+=" graph_Sankey.SankeyColumn",fy.prototype.publish("column",null,"set","Field",function(){return this._owner?this._owner.columns():[]},{optional:!0}),fy.prototype.publish("aggrType",null,"set","Aggregation Type",[null,"mean","median","sum","min","max"],{optional:!0,disable:/* @__PURE__ */n(e=>!e._owner||0===e._owner.mappings().indexOf(e),"disable")}),fy.prototype.publish("aggrColumn",null,"set","Aggregation Field",function(){return this._owner?this._owner.columns():[]},{optional:!0,disable:/* @__PURE__ */n(e=>!e._owner||!e.aggrType()||0===e._owner.mappings().indexOf(e),"disable")});const py=class _Sankey extends o{Column;_d3Sankey;_d3SankeyPath;_selection;constructor(){super(),m.SimpleSelectionMixin.call(this,!1),this._drawStartPos="origin"}sankeyData(){const e={vertices:[],edges:[]};if(0===this.data().length)return e;const t={},r=this.mappings().filter(e=>e.valid());return r.forEach((r,n)=>{this._db.rollupView([r.column()]).entries().forEach(function(i){const o=r.column()+":"+n+":"+i.key;t[o]||(e.vertices.push({__id:o,__category:r.column(),name:i.key,origRow:i.value,value:i.value[n][2]}),t[o]=e.vertices.length-1)},this)}),r.forEach((n,i)=>{if(i<r.length-1){const o=r[i+1];this._db.rollupView([n.column(),o.column()]).entries().forEach(function(r){const a=n.column()+":"+i+":"+r.key;r.values.forEach(function(r){const n=o.column()+":"+(i+1)+":"+r.key;e.edges.push({__id:a+"_"+n,source:t[a],target:t[n],value:r.value[0][2]})})})}}),e}enter(e,t){super.enter(e,t),this._d3Sankey=new sy,this._selection.widgetElement(t)}update(e,t){super.update(e,t),this._palette=this._palette.switch(this.paletteID());const r=this.vertexStrokeWidth(),n=this.sankeyData(),i=2*r;this._d3Sankey.extent([[r,r],[this.width()-i,this.height()-i]]).nodeWidth(this.vertexWidth()).nodePadding(this.vertexPadding()),this._d3Sankey({nodes:n.vertices,links:n.edges});const o=this,a=t.selectAll(".link").data(n.edges);a.enter().append("path").attr("class","link").each(function(){f(this).append("title")}).merge(a).attr("d",hy()).style("stroke-width",function(e){return Math.max(1,e.width)}).sort(function(e,t){return t.width-e.width}).select("title").text(function(e){return e.source.name+" → "+e.target.name+"\n"+e.value}),a.exit().remove();const s=t.selectAll(".node").data(n.vertices);s.enter().append("g").attr("class","node").call(this._selection.enter.bind(this._selection)).on("click",function(e){o.click(o.rowToObj(e.origRow[0]),"",o._selection.selected(this))}).on("dblclick",function(e){o.dblclick(o.rowToObj(e.origRow[0]),"",o._selection.selected(this))}).each(function(){const e=f(this);e.append("rect"),e.append("text")}).merge(s).attr("transform",function(e){let t=0,n=0;return e.x0&&(t=e.x0),e.y0&&(n=e.y0),"translate("+(t+r)+","+(n+r)+")"}).each(function(){const e=f(this);e.select("rect").attr("height",function(e){return e.y1-e.y0}).attr("width",o._d3Sankey.nodeWidth()).style("fill",function(e){return o._palette(e.name)}).style("stroke",function(e){return o.vertexStrokeColor()}).style("stroke-width",function(e){return r}).style("cursor",o.xAxisMovement()||o.yAxisMovement()?null:"default"),e.select("text").attr("x",-6).attr("y",function(e){return(e.y1-e.y0)/2}).attr("dy",".35em").attr("text-anchor","end").attr("transform",null).text(function(e){return e.name}).filter(function(e){return e.x0<o.width()/2}).attr("x",6+o._d3Sankey.nodeWidth()).attr("text-anchor","start")}),s.exit().remove()}exit(e,t){super.exit(e,t)}click(e,t,r){}dblclick(e,t,r){}};n(py,"Sankey");let _y=py;function gy(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function my(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gy(Object(r),!0).forEach(function(t){vy(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gy(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function yy(e){return(yy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?/* @__PURE__ */n(function(e){return typeof e},"_typeof"):/* @__PURE__ */n(function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},"_typeof"))(e)}function vy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function by(){return by=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},by.apply(this,arguments)}function wy(e,t){if(e){if("string"==typeof e)return xy(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?xy(e,t):void 0}}function xy(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ey(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=wy(e))||t){r&&(e=r);var i=0,o=/* @__PURE__ */n(function(){},"F");return{s:o,n:/* @__PURE__ */n(function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},"n"),e:/* @__PURE__ */n(function(e){throw e},"e"),f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:/* @__PURE__ */n(function(){r=r.call(e)},"s"),n:/* @__PURE__ */n(function(){var e=r.next();return s=e.done,e},"n"),e:/* @__PURE__ */n(function(e){u=!0,a=e},"e"),f:/* @__PURE__ */n(function(){try{s||null==r.return||r.return()}finally{if(u)throw a}},"f")}}function Cy(e,t){var r=[],i=[];function o(e,t){if(1===e.length)r.push(e[0]),i.push(e[0]);else{for(var n=Array(e.length-1),a=0;a<n.length;a++)0===a&&r.push(e[0]),a===n.length-1&&i.push(e[a+1]),n[a]=[(1-t)*e[a][0]+t*e[a+1][0],(1-t)*e[a][1]+t*e[a+1][1]];o(n,t)}}return n(o,"decasteljauRecurse"),e.length&&o(e,t),{left:r,right:i.reverse()}}function ky(e){var t={};return 4===e.length&&(t.x2=e[2][0],t.y2=e[2][1]),e.length>=3&&(t.x1=e[1][0],t.y1=e[1][1]),t.x=e[e.length-1][0],t.y=e[e.length-1][1],4===e.length?t.type="C":3===e.length?t.type="Q":t.type="L",t}function Dy(e,t){for(var r=[],n=e,i=1/(t=t||2),o=0;o<t-1;o++){var a=Cy(n,i/(1-i*o));r.push(a.left),n=a.right}return r.push(n),r}function Oy(e,t,r){var n=[[e.x,e.y]];return null!=t.x1&&n.push([t.x1,t.y1]),null!=t.x2&&n.push([t.x2,t.y2]),n.push([t.x,t.y]),Dy(n,r).map(ky)}_y.prototype._class+=" graph_Sankey",_y.prototype.Column=fy,_y.prototype.mixin(m.SimpleSelectionMixin),_y.prototype._palette=d.ordinal("default"),_y.prototype.publish("paletteID","default","set","Color palette for this widget",_y.prototype._palette.switch()),_y.prototype.publish("mappings",[],"propertyArray","Source Columns",null,{autoExpand:fy}),_y.prototype.publish("vertexStrokeWidth",1,"number","Vertex Stroke Width"),_y.prototype.publish("vertexStrokeColor","darkgray","string","Vertex Stroke Color"),_y.prototype.publish("vertexWidth",36,"number","Vertex Width"),_y.prototype.publish("vertexPadding",40,"number","Vertex Padding"),_y.prototype.publish("xAxisMovement",!1,"boolean","Enable x-axis movement"),_y.prototype.publish("yAxisMovement",!1,"boolean","Enable y-axis movement"),n(gy,"ownKeys"),n(my,"_objectSpread2"),n(yy,"_typeof"),n(vy,"_defineProperty"),n(by,"_extends"),n(wy,"_unsupportedIterableToArray"),n(xy,"_arrayLikeToArray"),n(Ey,"_createForOfIteratorHelper"),n(Cy,"decasteljau"),n(ky,"pointsToCommand"),n(Dy,"splitCurveAsPoints"),n(Oy,"splitCurve");var My=/[MLCSTQAHVZmlcstqahv]|-?[\d.e+-]+/g,Sy={M:["x","y"],L:["x","y"],H:["x"],V:["y"],C:["x1","y1","x2","y2","x","y"],S:["x2","y2","x","y"],Q:["x1","y1","x","y"],T:["x","y"],A:["rx","ry","xAxisRotation","largeArcFlag","sweepFlag","x","y"],Z:[]};function Fy(e,t){for(var r=Array(e),n=0;n<e;n++)r[n]=t;return r}function Py(e){return"".concat(e.type).concat(Sy[e.type].map(function(t){return e[t]}).join(","))}function Ry(e,t){var r={x1:"x",y1:"y",x2:"x",y2:"y"},n=["xAxisRotation","largeArcFlag","sweepFlag"];if(e.type!==t.type&&"M"!==t.type.toUpperCase()){var i={};Object.keys(t).forEach(function(o){var a=t[o],s=e[o];void 0===s&&(n.includes(o)?s=a:(void 0===s&&r[o]&&(s=e[r[o]]),void 0===s&&(s=0))),i[o]=s}),i.type=t.type,e=i}return e}function By(e,t,r){var n=[];if("L"===t.type||"Q"===t.type||"C"===t.type)n=n.concat(Oy(e,t,r));else{var i=by({},e);"M"===i.type&&(i.type="L"),(n=n.concat(Fy(r-1).map(function(){return i}))).push(t)}return n}function Ny(e,t,r){var n=e.length-1,i=t.length-1,o=n/i,a=Fy(i).reduce(function(t,n,i){var a=Math.floor(o*i);if(r&&a<e.length-1&&r(e[a],e[a+1])){var s=o*i%1<.5;t[a]&&(s?a>0?a-=1:a<e.length-1&&(a+=1):a<e.length-1?a+=1:a>0&&(a-=1))}return t[a]=(t[a]||0)+1,t},[]).reduce(function(t,r,n){if(n===e.length-1){var i=Fy(r,by({},e[e.length-1]));return"M"===i[0].type&&i.forEach(function(e){e.type="L"}),t.concat(i)}return t.concat(By(e[n],e[n+1],r))},[]);return a.unshift(e[0]),a}function jy(e){for(var t,r,n=(e||"").match(My)||[],i=[],o=0;o<n.length;++o)if(t=Sy[n[o]]){r={type:n[o]};for(var a=0;a<t.length;++a)r[t[a]]=+n[o+a+1];o+=t.length,i.push(r)}return i}function Iy(e,t,r){var i=null==e?[]:e.slice(),o=null==t?[]:t.slice(),a="object"===yy(r)?r:{excludeSegment:r,snapEndsToInput:!0},s=a.excludeSegment,u=a.snapEndsToInput;if(!i.length&&!o.length)/* @__PURE__ */
|
|
3
3
|
return n(function(){return[]},"nullInterpolator");var c=!(0!==i.length&&"Z"!==i[i.length-1].type||0!==o.length&&"Z"!==o[o.length-1].type);i.length>0&&"Z"===i[i.length-1].type&&i.pop(),o.length>0&&"Z"===o[o.length-1].type&&o.pop(),i.length?o.length||o.push(i[0]):i.push(o[0]),0!==Math.abs(o.length-i.length)&&(o.length>i.length?i=Ny(i,o,s):o.length<i.length&&(o=Ny(o,i,s)));var h=(i=i.map(function(e,t){return Ry(e,o[t])})).map(function(e){return my({},e)});return c&&(h.push({type:"Z"}),i.push({type:"Z"})),/* @__PURE__ */n(function(e){if(1===e&&u)return null==t?[]:t;if(0===e)return i;for(var r=0;r<h.length;++r){var n,a=i[r],s=o[r],c=h[r],l=Ey(Sy[c.type]);try{for(l.s();!(n=l.n()).done;){var d=n.value;c[d]=(1-e)*a[d]+e*s[d],"largeArcFlag"!==d&&"sweepFlag"!==d||(c[d]=Math.round(c[d]))}}catch(f){l.e(f)}finally{l.f()}}return h},"pathCommandInterpolator")}function Ly(e,t,r){var i=jy(e),o=jy(t),a="object"===yy(r)?r:{excludeSegment:r,snapEndsToInput:!0},s=a.excludeSegment,u=a.snapEndsToInput;if(!i.length&&!o.length)/* @__PURE__ */
|
|
4
4
|
return n(function(){return""},"nullInterpolator");var c=Iy(i,o,{excludeSegment:s,snapEndsToInput:u});/* @__PURE__ */
|