@hpcc-js/graph 2.74.0 → 2.78.0
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/dist/index.es6.js +2 -2
- package/dist/index.es6.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +10 -9
- package/src/__package__.ts +2 -2
- package/types/__package__.d.ts +2 -2
- package/types/__package__.d.ts.map +1 -1
- package/types-3.4/__package__.d.ts +2 -2
package/dist/index.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@hpcc-js/common"),require("@hpcc-js/util"),require("@hpcc-js/api"),require("@hpcc-js/react"),require("@hpcc-js/html")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/common","@hpcc-js/util","@hpcc-js/api","@hpcc-js/react","@hpcc-js/html"],t):t((e=e||self)["@hpcc-js/graph"]={},e["@hpcc-js/common"],e["@hpcc-js/util"],e["@hpcc-js/api"],e["@hpcc-js/react"],e["@hpcc-js/html"])}(this,function(e,t,r,n,o,i){"use strict";var a=function(e,t){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var u=function(){return(u=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function c(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}function l(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function h(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||t)}var f=Math.PI,d=2*f,p=d-1e-6;function g(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function v(){return new g}function y(e){return function(){return e}}g.prototype=v.prototype={constructor:g,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,r,n){this._+="Q"+ +e+","+ +t+","+(this._x1=+r)+","+(this._y1=+n)},bezierCurveTo:function(e,t,r,n,o,i){this._+="C"+ +e+","+ +t+","+ +r+","+ +n+","+(this._x1=+o)+","+(this._y1=+i)},arcTo:function(e,t,r,n,o){e=+e,t=+t,r=+r,n=+n,o=+o;var i=this._x1,a=this._y1,s=r-e,u=n-t,c=i-e,l=a-t,h=c*c+l*l;if(o<0)throw new Error("negative radius: "+o);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(h>1e-6)if(Math.abs(l*s-u*c)>1e-6&&o){var d=r-i,p=n-a,g=s*s+u*u,v=d*d+p*p,y=Math.sqrt(g),m=Math.sqrt(h),_=o*Math.tan((f-Math.acos((g+h-v)/(2*y*m)))/2),b=_/m,w=_/y;Math.abs(b-1)>1e-6&&(this._+="L"+(e+b*c)+","+(t+b*l)),this._+="A"+o+","+o+",0,0,"+ +(l*d>c*p)+","+(this._x1=e+w*s)+","+(this._y1=t+w*u)}else this._+="L"+(this._x1=e)+","+(this._y1=t);else;},arc:function(e,t,r,n,o,i){e=+e,t=+t,i=!!i;var a=(r=+r)*Math.cos(n),s=r*Math.sin(n),u=e+a,c=t+s,l=1^i,h=i?n-o:o-n;if(r<0)throw new Error("negative radius: "+r);null===this._x1?this._+="M"+u+","+c:(Math.abs(this._x1-u)>1e-6||Math.abs(this._y1-c)>1e-6)&&(this._+="L"+u+","+c),r&&(h<0&&(h=h%d+d),h>p?this._+="A"+r+","+r+",0,1,"+l+","+(e-a)+","+(t-s)+"A"+r+","+r+",0,1,"+l+","+(this._x1=u)+","+(this._y1=c):h>1e-6&&(this._+="A"+r+","+r+",0,"+ +(h>=f)+","+l+","+(this._x1=e+r*Math.cos(o))+","+(this._y1=t+r*Math.sin(o))))},rect:function(e,t,r,n){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}};var m=1e-12;function _(e){this._context=e}function b(e){return new _(e)}function w(e){return e[0]}function x(e){return e[1]}function E(){var e=w,t=x,r=y(!0),n=null,o=b,i=null;function a(a){var s,u,c,l=a.length,h=!1;for(null==n&&(i=o(c=v())),s=0;s<=l;++s)!(s<l&&r(u=a[s],s,a))===h&&((h=!h)?i.lineStart():i.lineEnd()),h&&i.point(+e(u,s,a),+t(u,s,a));if(c)return i=null,c+""||null}return a.x=function(t){return arguments.length?(e="function"==typeof t?t:y(+t),a):e},a.y=function(e){return arguments.length?(t="function"==typeof e?e:y(+e),a):t},a.defined=function(e){return arguments.length?(r="function"==typeof e?e:y(!!e),a):r},a.curve=function(e){return arguments.length?(o=e,null!=n&&(i=o(n)),a):o},a.context=function(e){return arguments.length?(null==e?n=i=null:i=o(n=e),a):n},a}_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point: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)}}};var k=Array.prototype.slice;function D(e){return e.source}function S(e){return e.target}function C(e,t,r,n,o){e.moveTo(t,r),e.bezierCurveTo(t=(t+n)/2,r,t,o,n,o)}function A(){return function(e){var t=D,r=S,n=w,o=x,i=null;function a(){var a,s=k.call(arguments),u=t.apply(this,s),c=r.apply(this,s);if(i||(i=a=v()),e(i,+n.apply(this,(s[0]=u,s)),+o.apply(this,s),+n.apply(this,(s[0]=c,s)),+o.apply(this,s)),a)return i=null,a+""||null}return a.source=function(e){return arguments.length?(t=e,a):t},a.target=function(e){return arguments.length?(r=e,a):r},a.x=function(e){return arguments.length?(n="function"==typeof e?e:y(+e),a):n},a.y=function(e){return arguments.length?(o="function"==typeof e?e:y(+e),a):o},a.context=function(e){return arguments.length?(i=null==e?null:e,a):i},a}(C)}function j(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 P(e){this._context=e}function F(e){return new P(e)}function M(e,t){this._basis=new P(e),this._beta=t}P.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:j(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},point: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:j(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},M.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var n,o=e[0],i=t[0],a=e[r]-o,s=t[r]-i,u=-1;++u<=r;)n=u/r,this._basis.point(this._beta*e[u]+(1-this._beta)*(o+n*a),this._beta*t[u]+(1-this._beta)*(i+n*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};(function e(t){function r(e){return 1===t?new P(e):new M(e,t)}return r.beta=function(t){return e(+t)},r})(.85);function O(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 N(e,t){this._context=e,this._k=(1-t)/6}N.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:O(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point: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:O(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}};var I=function e(t){function r(e){return new N(e,t)}return r.tension=function(t){return e(+t)},r}(0);function T(e,t){this._context=e,this._alpha=t}T.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(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;default:!function(e,t,r){var n=e._x1,o=e._y1,i=e._x2,a=e._y2;if(e._l01_a>m){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,u=3*e._l01_a*(e._l01_a+e._l12_a);n=(n*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/u,o=(o*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/u}if(e._l23_a>m){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,l=3*e._l23_a*(e._l23_a+e._l12_a);i=(i*c+e._x1*e._l23_2a-t*e._l12_2a)/l,a=(a*c+e._y1*e._l23_2a-r*e._l12_2a)/l}e._context.bezierCurveTo(n,o,i,a,e._x2,e._y2)}(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};(function e(t){function r(e){return t?new T(e,t):new N(e,0)}return r.alpha=function(t){return e(+t)},r})(.5);function L(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}L(".graph_Edge{fill:none;stroke:#656565;stroke-width:1px}.graph_Edge .common_TextBox .common_Text{fill:#000;stroke:none}.graph_Edge .common_TextBox .common_Shape{fill:#fff;stroke:none}.graph_Edge.selected{stroke:red!important}.graph_Edge.selected .common_Text{fill:red!important}");var Q=F,R=function(e){function r(){var r=e.call(this)||this;return r._points=[],r._weight=100,r._strokeDasharray=null,r._hidden=!1,r._textBox=(new t.TextBox).padding(0),r}return s(r,e),r.prototype.graphID=function(e){return arguments.length?(this._graphID=e,this):this._graphID},r.prototype.sourceVertex=function(e){return arguments.length?(this._sourceVertex=e,this):this._sourceVertex},r.prototype.targetVertex=function(e){return arguments.length?(this._targetVertex=e,this):this._targetVertex},r.prototype.weight=function(e){return arguments.length?(this._weight=e,this):this._weight},r.prototype.points=function(e,t,r){return arguments.length?(this._points=e,this._elementPath&&this.update(null,this._element,t,r),this):this._points},r.prototype.hidden=function(e){return arguments.length?(this._hidden=e,this):this._hidden},r.prototype.text=function(e){return arguments.length?(this._textBox.text(e),this):this._textBox.text()},r.prototype.enter=function(t,r){e.prototype.enter.call(this,t,r),this._elementPath=r.append("path"),this._textBox.text()&&this._textBox.target(t).tooltip(this.tooltip()).render()},r.prototype.update=function(r,n,o,i){e.prototype.update.call(this,r,n);var a=this;t.Platform.svgMarkerGlitch&&!i&&n.transition().duration((o||0)+100).on("start",function(){a._pushMarkers(n)}).on("end",function(){a._popMarkers(n)});var s=a._calculateEdgePoints(this._sourceVertex,this._targetVertex,this._points),u=n.selectAll(".point2").data(this.showControlPoints()?s:[]);u.enter().append("circle").attr("class","point2").style("stroke","red").merge(u).attr("cx",function(e){return e.x}).attr("cy",function(e){return e.y}).attr("r",1),u.exit().remove();var c=E().x(function(e){return e.x}).y(function(e){return e.y}).curve(Q)(s),l=this._elementPath;o&&(l=l.transition().duration(o)),l.attr("opacity",this._hidden?0:1).attr("marker-start",t.Platform.svgMarkerGlitch&&i||!this.sourceMarker_exists()?null:"url(#"+this._graphID+"_"+this.sourceMarker()+"Foot)").attr("marker-end",t.Platform.svgMarkerGlitch&&i||!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",c),this._textBox.text()&&this._textBox.tooltip(this.tooltip()).move(this._findMidPoint(s),o)},r.prototype.exit=function(t,r){this._textBox&&this._textBox.target(null),e.prototype.exit.call(this,t,r)},r.prototype._findMidPoint=function(e){var t=e.length/2;if(e.length%2)return e[Math.floor(t)];if(e.length){var 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}},r.prototype._calculateEdgePoints=function(e,t,r){if(!e||!t)return[{x:0,y:0},{x:0,y:0}];var n=r?r.filter(function(r){return!e.contains(r)&&!t.contains(r)}):[],o=0===n.length?t.pos():n[0],i=0===n.length?e.pos():n[n.length-1];if(n.unshift(e.intersection(e._pos,o)),n.push(t.intersection(t._pos,i)),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]){var a=n[0].x-n[1].x,s=n[0].y-n[1].y;if(Math.sqrt(a*a+s*s))if(this.showArc()){var u=(n[0].x+n[1].x)/2-s*this.arcDepth()/100,c=(n[0].y+n[1].y)/2+a*this.arcDepth()/100;n=[{x:n[0].x,y:n[0].y},{x:u,y:c},{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},r}(t.SVGWidget);R.prototype._class+=" graph_Edge",R.prototype.publish("arcDepth",16,"number","Arc Depth",null,{tags:["Basic"]}),R.prototype.publish("showControlPoints",!1,"boolean","Show/Hide Control Points",null,{tags:["Basic"]}),R.prototype.publish("showArc",!0,"boolean","Show/Hide Arc",null,{tags:["Basic"]}),R.prototype.publish("tooltip","","string","Tooltip",null,{tags:["Private"]}),R.prototype.publish("sourceMarker","circle","set","Source Marker",["none","circle"],{optional:!0}),R.prototype.publish("targetMarker","arrow","set","Source Marker",["none","arrow","circle"],{optional:!0}),R.prototype.publish("strokeDasharray",null,"string","Stroke Dash Array",null,{optional:!0}),R.prototype.publish("strokeColor",null,"html-color","Stroke Color",null,{optional:!0}),R.prototype.publish("textColor",null,"html-color","Text Color",null,{optional:!0}),R.prototype.publishProxy("text_shape_colorFill","_textBox","shape_colorFill"),R.prototype.publishProxy("text_shape_colorStroke","_textBox","shape_colorStroke"),R.prototype.publishProxy("text_text_colorFill","_textBox","text_colorFill");var B="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function z(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return V(null==t&&r.path)}},r.exports),r.exports}function V(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var G=function(){this.__data__=[],this.size=0};var H=function(e,t){return e===t||e!=e&&t!=t};var U=function(e,t){for(var r=e.length;r--;)if(H(e[r][0],t))return r;return-1},W=Array.prototype.splice;var q=function(e){var t=this.__data__,r=U(t,e);return!(r<0||(r==t.length-1?t.pop():W.call(t,r,1),--this.size,0))};var Y=function(e){var t=this.__data__,r=U(t,e);return r<0?void 0:t[r][1]};var $=function(e){return U(this.__data__,e)>-1};var X=function(e,t){var r=this.__data__,n=U(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};function J(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])}}J.prototype.clear=G,J.prototype.delete=q,J.prototype.get=Y,J.prototype.has=$,J.prototype.set=X;var K=J;var Z=function(){this.__data__=new K,this.size=0};var ee=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r};var te=function(e){return this.__data__.get(e)};var re=function(e){return this.__data__.has(e)},ne="object"==typeof B&&B&&B.Object===Object&&B,oe="object"==typeof self&&self&&self.Object===Object&&self,ie=ne||oe||Function("return this")(),ae=ie.Symbol,se=Object.prototype,ue=se.hasOwnProperty,ce=se.toString,le=ae?ae.toStringTag:void 0;var he=function(e){var t=ue.call(e,le),r=e[le];try{e[le]=void 0;var n=!0}catch(e){}var o=ce.call(e);return n&&(t?e[le]=r:delete e[le]),o},fe=Object.prototype.toString;var de=function(e){return fe.call(e)},pe="[object Null]",ge="[object Undefined]",ve=ae?ae.toStringTag:void 0;var ye=function(e){return null==e?void 0===e?ge:pe:ve&&ve in Object(e)?he(e):de(e)};var me=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},_e="[object AsyncFunction]",be="[object Function]",we="[object GeneratorFunction]",xe="[object Proxy]";var Ee,ke=function(e){if(!me(e))return!1;var t=ye(e);return t==be||t==we||t==_e||t==xe},De=ie["__core-js_shared__"],Se=(Ee=/[^.]+$/.exec(De&&De.keys&&De.keys.IE_PROTO||""))?"Symbol(src)_1."+Ee:"";var Ce=function(e){return!!Se&&Se in e},Ae=Function.prototype.toString;var je=function(e){if(null!=e){try{return Ae.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Pe=/^\[object .+?Constructor\]$/,Fe=Function.prototype,Me=Object.prototype,Oe=Fe.toString,Ne=Me.hasOwnProperty,Ie=RegExp("^"+Oe.call(Ne).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Te=function(e){return!(!me(e)||Ce(e))&&(ke(e)?Ie:Pe).test(je(e))};var Le=function(e,t){return null==e?void 0:e[t]};var Qe=function(e,t){var r=Le(e,t);return Te(r)?r:void 0},Re=Qe(ie,"Map"),Be=Qe(Object,"create");var ze=function(){this.__data__=Be?Be(null):{},this.size=0};var Ve=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ge="__lodash_hash_undefined__",He=Object.prototype.hasOwnProperty;var Ue=function(e){var t=this.__data__;if(Be){var r=t[e];return r===Ge?void 0:r}return He.call(t,e)?t[e]:void 0},We=Object.prototype.hasOwnProperty;var qe=function(e){var t=this.__data__;return Be?void 0!==t[e]:We.call(t,e)},Ye="__lodash_hash_undefined__";var $e=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Be&&void 0===t?Ye:t,this};function Xe(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])}}Xe.prototype.clear=ze,Xe.prototype.delete=Ve,Xe.prototype.get=Ue,Xe.prototype.has=qe,Xe.prototype.set=$e;var Je=Xe;var Ke=function(){this.size=0,this.__data__={hash:new Je,map:new(Re||K),string:new Je}};var Ze=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var et=function(e,t){var r=e.__data__;return Ze(t)?r["string"==typeof t?"string":"hash"]:r.map};var tt=function(e){var t=et(this,e).delete(e);return this.size-=t?1:0,t};var rt=function(e){return et(this,e).get(e)};var nt=function(e){return et(this,e).has(e)};var ot=function(e,t){var r=et(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};function it(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])}}it.prototype.clear=Ke,it.prototype.delete=tt,it.prototype.get=rt,it.prototype.has=nt,it.prototype.set=ot;var at=it,st=200;var ut=function(e,t){var r=this.__data__;if(r instanceof K){var n=r.__data__;if(!Re||n.length<st-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new at(n)}return r.set(e,t),this.size=r.size,this};function ct(e){var t=this.__data__=new K(e);this.size=t.size}ct.prototype.clear=Z,ct.prototype.delete=ee,ct.prototype.get=te,ct.prototype.has=re,ct.prototype.set=ut;var lt=ct;var ht=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e},ft=function(){try{var e=Qe(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var dt=function(e,t,r){"__proto__"==t&&ft?ft(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r},pt=Object.prototype.hasOwnProperty;var gt=function(e,t,r){var n=e[t];pt.call(e,t)&&H(n,r)&&(void 0!==r||t in e)||dt(e,t,r)};var vt=function(e,t,r,n){var o=!r;r||(r={});for(var i=-1,a=t.length;++i<a;){var s=t[i],u=n?n(r[s],e[s],s,r,e):void 0;void 0===u&&(u=e[s]),o?dt(r,s,u):gt(r,s,u)}return r};var yt=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n};var mt=function(e){return null!=e&&"object"==typeof e},_t="[object Arguments]";var bt=function(e){return mt(e)&&ye(e)==_t},wt=Object.prototype,xt=wt.hasOwnProperty,Et=wt.propertyIsEnumerable,kt=bt(function(){return arguments}())?bt:function(e){return mt(e)&&xt.call(e,"callee")&&!Et.call(e,"callee")},Dt=Array.isArray;var St=function(){return!1},Ct=z(function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r?ie.Buffer:void 0,i=(o?o.isBuffer:void 0)||St;e.exports=i}),At=9007199254740991,jt=/^(?:0|[1-9]\d*)$/;var Pt=function(e,t){var r=typeof e;return!!(t=null==t?At:t)&&("number"==r||"symbol"!=r&&jt.test(e))&&e>-1&&e%1==0&&e<t},Ft=9007199254740991;var Mt=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=Ft},Ot={};Ot["[object Float32Array]"]=Ot["[object Float64Array]"]=Ot["[object Int8Array]"]=Ot["[object Int16Array]"]=Ot["[object Int32Array]"]=Ot["[object Uint8Array]"]=Ot["[object Uint8ClampedArray]"]=Ot["[object Uint16Array]"]=Ot["[object Uint32Array]"]=!0,Ot["[object Arguments]"]=Ot["[object Array]"]=Ot["[object ArrayBuffer]"]=Ot["[object Boolean]"]=Ot["[object DataView]"]=Ot["[object Date]"]=Ot["[object Error]"]=Ot["[object Function]"]=Ot["[object Map]"]=Ot["[object Number]"]=Ot["[object Object]"]=Ot["[object RegExp]"]=Ot["[object Set]"]=Ot["[object String]"]=Ot["[object WeakMap]"]=!1;var Nt=function(e){return mt(e)&&Mt(e.length)&&!!Ot[ye(e)]};var It=function(e){return function(t){return e(t)}},Tt=z(function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r&&ne.process,i=function(){try{var e=n&&n.require&&n.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=i}),Lt=Tt&&Tt.isTypedArray,Qt=Lt?It(Lt):Nt,Rt=Object.prototype.hasOwnProperty;var Bt=function(e,t){var r=Dt(e),n=!r&&kt(e),o=!r&&!n&&Ct(e),i=!r&&!n&&!o&&Qt(e),a=r||n||o||i,s=a?yt(e.length,String):[],u=s.length;for(var c in e)!t&&!Rt.call(e,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Pt(c,u))||s.push(c);return s},zt=Object.prototype;var Vt=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||zt)};var Gt=function(e,t){return function(r){return e(t(r))}},Ht=Gt(Object.keys,Object),Ut=Object.prototype.hasOwnProperty;var Wt=function(e){if(!Vt(e))return Ht(e);var t=[];for(var r in Object(e))Ut.call(e,r)&&"constructor"!=r&&t.push(r);return t};var qt=function(e){return null!=e&&Mt(e.length)&&!ke(e)};var Yt=function(e){return qt(e)?Bt(e):Wt(e)};var $t=function(e,t){return e&&vt(t,Yt(t),e)};var Xt=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t},Jt=Object.prototype.hasOwnProperty;var Kt=function(e){if(!me(e))return Xt(e);var t=Vt(e),r=[];for(var n in e)("constructor"!=n||!t&&Jt.call(e,n))&&r.push(n);return r};var Zt=function(e){return qt(e)?Bt(e,!0):Kt(e)};var er=function(e,t){return e&&vt(t,Zt(t),e)},tr=z(function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r?ie.Buffer:void 0,i=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=i?i(r):new e.constructor(r);return e.copy(n),n}});var rr=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t};var nr=function(e,t){for(var r=-1,n=null==e?0:e.length,o=0,i=[];++r<n;){var a=e[r];t(a,r,e)&&(i[o++]=a)}return i};var or=function(){return[]},ir=Object.prototype.propertyIsEnumerable,ar=Object.getOwnPropertySymbols,sr=ar?function(e){return null==e?[]:(e=Object(e),nr(ar(e),function(t){return ir.call(e,t)}))}:or;var ur=function(e,t){return vt(e,sr(e),t)};var cr=function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e},lr=Gt(Object.getPrototypeOf,Object),hr=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)cr(t,sr(e)),e=lr(e);return t}:or;var fr=function(e,t){return vt(e,hr(e),t)};var dr=function(e,t,r){var n=t(e);return Dt(e)?n:cr(n,r(e))};var pr=function(e){return dr(e,Yt,sr)};var gr=function(e){return dr(e,Zt,hr)},vr=Qe(ie,"DataView"),yr=Qe(ie,"Promise"),mr=Qe(ie,"Set"),_r=Qe(ie,"WeakMap"),br=je(vr),wr=je(Re),xr=je(yr),Er=je(mr),kr=je(_r),Dr=ye;(vr&&"[object DataView]"!=Dr(new vr(new ArrayBuffer(1)))||Re&&"[object Map]"!=Dr(new Re)||yr&&"[object Promise]"!=Dr(yr.resolve())||mr&&"[object Set]"!=Dr(new mr)||_r&&"[object WeakMap]"!=Dr(new _r))&&(Dr=function(e){var t=ye(e),r="[object Object]"==t?e.constructor:void 0,n=r?je(r):"";if(n)switch(n){case br:return"[object DataView]";case wr:return"[object Map]";case xr:return"[object Promise]";case Er:return"[object Set]";case kr:return"[object WeakMap]"}return t});var Sr=Dr,Cr=Object.prototype.hasOwnProperty;var Ar=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&Cr.call(e,"index")&&(r.index=e.index,r.input=e.input),r},jr=ie.Uint8Array;var Pr=function(e){var t=new e.constructor(e.byteLength);return new jr(t).set(new jr(e)),t};var Fr=function(e,t){var r=t?Pr(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)},Mr=/\w*$/;var Or=function(e){var t=new e.constructor(e.source,Mr.exec(e));return t.lastIndex=e.lastIndex,t},Nr=ae?ae.prototype:void 0,Ir=Nr?Nr.valueOf:void 0;var Tr=function(e){return Ir?Object(Ir.call(e)):{}};var Lr=function(e,t){var r=t?Pr(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)},Qr="[object Boolean]",Rr="[object Date]",Br="[object Map]",zr="[object Number]",Vr="[object RegExp]",Gr="[object Set]",Hr="[object String]",Ur="[object Symbol]",Wr="[object ArrayBuffer]",qr="[object DataView]",Yr="[object Float32Array]",$r="[object Float64Array]",Xr="[object Int8Array]",Jr="[object Int16Array]",Kr="[object Int32Array]",Zr="[object Uint8Array]",en="[object Uint8ClampedArray]",tn="[object Uint16Array]",rn="[object Uint32Array]";var nn=function(e,t,r){var n=e.constructor;switch(t){case Wr:return Pr(e);case Qr:case Rr:return new n(+e);case qr:return Fr(e,r);case Yr:case $r:case Xr:case Jr:case Kr:case Zr:case en:case tn:case rn:return Lr(e,r);case Br:return new n;case zr:case Hr:return new n(e);case Vr:return Or(e);case Gr:return new n;case Ur:return Tr(e)}},on=Object.create,an=function(){function e(){}return function(t){if(!me(t))return{};if(on)return on(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();var sn=function(e){return"function"!=typeof e.constructor||Vt(e)?{}:an(lr(e))},un="[object Map]";var cn=function(e){return mt(e)&&Sr(e)==un},ln=Tt&&Tt.isMap,hn=ln?It(ln):cn,fn="[object Set]";var dn=function(e){return mt(e)&&Sr(e)==fn},pn=Tt&&Tt.isSet,gn=pn?It(pn):dn,vn=1,yn=2,mn=4,_n="[object Arguments]",bn="[object Function]",wn="[object GeneratorFunction]",xn="[object Object]",En={};En[_n]=En["[object Array]"]=En["[object ArrayBuffer]"]=En["[object DataView]"]=En["[object Boolean]"]=En["[object Date]"]=En["[object Float32Array]"]=En["[object Float64Array]"]=En["[object Int8Array]"]=En["[object Int16Array]"]=En["[object Int32Array]"]=En["[object Map]"]=En["[object Number]"]=En[xn]=En["[object RegExp]"]=En["[object Set]"]=En["[object String]"]=En["[object Symbol]"]=En["[object Uint8Array]"]=En["[object Uint8ClampedArray]"]=En["[object Uint16Array]"]=En["[object Uint32Array]"]=!0,En["[object Error]"]=En[bn]=En["[object WeakMap]"]=!1;var kn=function e(t,r,n,o,i,a){var s,u=r&vn,c=r&yn,l=r&mn;if(n&&(s=i?n(t,o,i,a):n(t)),void 0!==s)return s;if(!me(t))return t;var h=Dt(t);if(h){if(s=Ar(t),!u)return rr(t,s)}else{var f=Sr(t),d=f==bn||f==wn;if(Ct(t))return tr(t,u);if(f==xn||f==_n||d&&!i){if(s=c||d?{}:sn(t),!u)return c?fr(t,er(s,t)):ur(t,$t(s,t))}else{if(!En[f])return i?t:{};s=nn(t,f,u)}}a||(a=new lt);var p=a.get(t);if(p)return p;a.set(t,s),gn(t)?t.forEach(function(o){s.add(e(o,r,n,o,t,a))}):hn(t)&&t.forEach(function(o,i){s.set(i,e(o,r,n,i,t,a))});var g=h?void 0:(l?c?gr:pr:c?Zt:Yt)(t);return ht(g||t,function(o,i){g&&(o=t[i=o]),gt(s,i,e(o,r,n,i,t,a))}),s},Dn=4;var Sn=function(e){return kn(e,Dn)};var Cn=function(e){return function(){return e}};var An=function(e){return function(t,r,n){for(var o=-1,i=Object(t),a=n(t),s=a.length;s--;){var u=a[e?s:++o];if(!1===r(i[u],u,i))break}return t}}();var jn=function(e,t){return e&&An(e,t,Yt)};var Pn=function(e,t){return function(r,n){if(null==r)return r;if(!qt(r))return e(r,n);for(var o=r.length,i=t?o:-1,a=Object(r);(t?i--:++i<o)&&!1!==n(a[i],i,a););return r}}(jn);var Fn=function(e){return e};var Mn=function(e){return"function"==typeof e?e:Fn};var On=function(e,t){return(Dt(e)?ht:Pn)(e,Mn(t))},Nn=On;var In=function(e,t){var r=[];return Pn(e,function(e,n,o){t(e,n,o)&&r.push(e)}),r},Tn="__lodash_hash_undefined__";var Ln=function(e){return this.__data__.set(e,Tn),this};var Qn=function(e){return this.__data__.has(e)};function Rn(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new at;++t<r;)this.add(e[t])}Rn.prototype.add=Rn.prototype.push=Ln,Rn.prototype.has=Qn;var Bn=Rn;var zn=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1};var Vn=function(e,t){return e.has(t)},Gn=1,Hn=2;var Un=function(e,t,r,n,o,i){var a=r&Gn,s=e.length,u=t.length;if(s!=u&&!(a&&u>s))return!1;var c=i.get(e),l=i.get(t);if(c&&l)return c==t&&l==e;var h=-1,f=!0,d=r&Hn?new Bn:void 0;for(i.set(e,t),i.set(t,e);++h<s;){var p=e[h],g=t[h];if(n)var v=a?n(g,p,h,t,e,i):n(p,g,h,e,t,i);if(void 0!==v){if(v)continue;f=!1;break}if(d){if(!zn(t,function(e,t){if(!Vn(d,t)&&(p===e||o(p,e,r,n,i)))return d.push(t)})){f=!1;break}}else if(p!==g&&!o(p,g,r,n,i)){f=!1;break}}return i.delete(e),i.delete(t),f};var Wn=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r};var qn=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r},Yn=1,$n=2,Xn="[object Boolean]",Jn="[object Date]",Kn="[object Error]",Zn="[object Map]",eo="[object Number]",to="[object RegExp]",ro="[object Set]",no="[object String]",oo="[object Symbol]",io="[object ArrayBuffer]",ao="[object DataView]",so=ae?ae.prototype:void 0,uo=so?so.valueOf:void 0;var co=function(e,t,r,n,o,i,a){switch(r){case ao:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case io:return!(e.byteLength!=t.byteLength||!i(new jr(e),new jr(t)));case Xn:case Jn:case eo:return H(+e,+t);case Kn:return e.name==t.name&&e.message==t.message;case to:case no:return e==t+"";case Zn:var s=Wn;case ro:var u=n&Yn;if(s||(s=qn),e.size!=t.size&&!u)return!1;var c=a.get(e);if(c)return c==t;n|=$n,a.set(e,t);var l=Un(s(e),s(t),n,o,i,a);return a.delete(e),l;case oo:if(uo)return uo.call(e)==uo.call(t)}return!1},lo=1,ho=Object.prototype.hasOwnProperty;var fo=function(e,t,r,n,o,i){var a=r&lo,s=pr(e),u=s.length;if(u!=pr(t).length&&!a)return!1;for(var c=u;c--;){var l=s[c];if(!(a?l in t:ho.call(t,l)))return!1}var h=i.get(e),f=i.get(t);if(h&&f)return h==t&&f==e;var d=!0;i.set(e,t),i.set(t,e);for(var p=a;++c<u;){var g=e[l=s[c]],v=t[l];if(n)var y=a?n(v,g,l,t,e,i):n(g,v,l,e,t,i);if(!(void 0===y?g===v||o(g,v,r,n,i):y)){d=!1;break}p||(p="constructor"==l)}if(d&&!p){var m=e.constructor,_=t.constructor;m!=_&&"constructor"in e&&"constructor"in t&&!("function"==typeof m&&m instanceof m&&"function"==typeof _&&_ instanceof _)&&(d=!1)}return i.delete(e),i.delete(t),d},po=1,go="[object Arguments]",vo="[object Array]",yo="[object Object]",mo=Object.prototype.hasOwnProperty;var _o=function(e,t,r,n,o,i){var a=Dt(e),s=Dt(t),u=a?vo:Sr(e),c=s?vo:Sr(t),l=(u=u==go?yo:u)==yo,h=(c=c==go?yo:c)==yo,f=u==c;if(f&&Ct(e)){if(!Ct(t))return!1;a=!0,l=!1}if(f&&!l)return i||(i=new lt),a||Qt(e)?Un(e,t,r,n,o,i):co(e,t,u,r,n,o,i);if(!(r&po)){var d=l&&mo.call(e,"__wrapped__"),p=h&&mo.call(t,"__wrapped__");if(d||p){var g=d?e.value():e,v=p?t.value():t;return i||(i=new lt),o(g,v,r,n,i)}}return!!f&&(i||(i=new lt),fo(e,t,r,n,o,i))};var bo=function e(t,r,n,o,i){return t===r||(null==t||null==r||!mt(t)&&!mt(r)?t!=t&&r!=r:_o(t,r,n,o,e,i))},wo=1,xo=2;var Eo=function(e,t,r,n){var o=r.length,i=o,a=!n;if(null==e)return!i;for(e=Object(e);o--;){var s=r[o];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++o<i;){var u=(s=r[o])[0],c=e[u],l=s[1];if(a&&s[2]){if(void 0===c&&!(u in e))return!1}else{var h=new lt;if(n)var f=n(c,l,u,e,t,h);if(!(void 0===f?bo(l,c,wo|xo,n,h):f))return!1}}return!0};var ko=function(e){return e==e&&!me(e)};var Do=function(e){for(var t=Yt(e),r=t.length;r--;){var n=t[r],o=e[n];t[r]=[n,o,ko(o)]}return t};var So=function(e,t){return function(r){return null!=r&&r[e]===t&&(void 0!==t||e in Object(r))}};var Co=function(e){var t=Do(e);return 1==t.length&&t[0][2]?So(t[0][0],t[0][1]):function(r){return r===e||Eo(r,e,t)}},Ao="[object Symbol]";var jo=function(e){return"symbol"==typeof e||mt(e)&&ye(e)==Ao},Po=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Fo=/^\w*$/;var Mo=function(e,t){if(Dt(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!jo(e))||Fo.test(e)||!Po.test(e)||null!=t&&e in Object(t)},Oo="Expected a function";function No(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(Oo);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=e.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(No.Cache||at),r}No.Cache=at;var Io=No,To=500;var Lo=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Qo=/\\(\\)?/g,Ro=function(e){var t=Io(e,function(e){return r.size===To&&r.clear(),e}),r=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Lo,function(e,r,n,o){t.push(n?o.replace(Qo,"$1"):r||e)}),t});var Bo=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o},zo=1/0,Vo=ae?ae.prototype:void 0,Go=Vo?Vo.toString:void 0;var Ho=function e(t){if("string"==typeof t)return t;if(Dt(t))return Bo(t,e)+"";if(jo(t))return Go?Go.call(t):"";var r=t+"";return"0"==r&&1/t==-zo?"-0":r};var Uo=function(e){return null==e?"":Ho(e)};var Wo=function(e,t){return Dt(e)?e:Mo(e,t)?[e]:Ro(Uo(e))},qo=1/0;var Yo=function(e){if("string"==typeof e||jo(e))return e;var t=e+"";return"0"==t&&1/e==-qo?"-0":t};var $o=function(e,t){for(var r=0,n=(t=Wo(t,e)).length;null!=e&&r<n;)e=e[Yo(t[r++])];return r&&r==n?e:void 0};var Xo=function(e,t,r){var n=null==e?void 0:$o(e,t);return void 0===n?r:n};var Jo=function(e,t){return null!=e&&t in Object(e)};var Ko=function(e,t,r){for(var n=-1,o=(t=Wo(t,e)).length,i=!1;++n<o;){var a=Yo(t[n]);if(!(i=null!=e&&r(e,a)))break;e=e[a]}return i||++n!=o?i:!!(o=null==e?0:e.length)&&Mt(o)&&Pt(a,o)&&(Dt(e)||kt(e))};var Zo=function(e,t){return null!=e&&Ko(e,t,Jo)},ei=1,ti=2;var ri=function(e,t){return Mo(e)&&ko(t)?So(Yo(e),t):function(r){var n=Xo(r,e);return void 0===n&&n===t?Zo(r,e):bo(t,n,ei|ti)}};var ni=function(e){return function(t){return null==t?void 0:t[e]}};var oi=function(e){return function(t){return $o(t,e)}};var ii=function(e){return Mo(e)?ni(Yo(e)):oi(e)};var ai=function(e){return"function"==typeof e?e:null==e?Fn:"object"==typeof e?Dt(e)?ri(e[0],e[1]):Co(e):ii(e)};var si=function(e,t){return(Dt(e)?nr:In)(e,ai(t))},ui=Object.prototype.hasOwnProperty;var ci=function(e,t){return null!=e&&ui.call(e,t)};var li=function(e,t){return null!=e&&Ko(e,t,ci)},hi="[object Map]",fi="[object Set]",di=Object.prototype.hasOwnProperty;var pi=function(e){if(null==e)return!0;if(qt(e)&&(Dt(e)||"string"==typeof e||"function"==typeof e.splice||Ct(e)||Qt(e)||kt(e)))return!e.length;var t=Sr(e);if(t==hi||t==fi)return!e.size;if(Vt(e))return!Wt(e).length;for(var r in e)if(di.call(e,r))return!1;return!0};var gi=function(e){return void 0===e};var vi=function(e,t){var r=-1,n=qt(e)?Array(e.length):[];return Pn(e,function(e,o,i){n[++r]=t(e,o,i)}),n};var yi=function(e,t){return(Dt(e)?Bo:vi)(e,ai(t))};var mi=function(e,t,r,n){var o=-1,i=null==e?0:e.length;for(n&&i&&(r=e[++o]);++o<i;)r=t(r,e[o],o,e);return r};var _i=function(e,t,r,n,o){return o(e,function(e,o,i){r=n?(n=!1,e):t(r,e,o,i)}),r};var bi=function(e,t,r){var n=Dt(e)?mi:_i,o=arguments.length<3;return n(e,ai(t),r,o,Pn)},wi="[object String]";var xi=function(e){return"string"==typeof e||!Dt(e)&&mt(e)&&ye(e)==wi},Ei=ni("length"),ki=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var Di=function(e){return ki.test(e)},Si="[\\ud800-\\udfff]",Ci="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Ai="\\ud83c[\\udffb-\\udfff]",ji="[^\\ud800-\\udfff]",Pi="(?:\\ud83c[\\udde6-\\uddff]){2}",Fi="[\\ud800-\\udbff][\\udc00-\\udfff]",Mi="(?:"+Ci+"|"+Ai+")"+"?",Oi="[\\ufe0e\\ufe0f]?"+Mi+("(?:\\u200d(?:"+[ji,Pi,Fi].join("|")+")[\\ufe0e\\ufe0f]?"+Mi+")*"),Ni="(?:"+[ji+Ci+"?",Ci,Pi,Fi,Si].join("|")+")",Ii=RegExp(Ai+"(?="+Ai+")|"+Ni+Oi,"g");var Ti=function(e){for(var t=Ii.lastIndex=0;Ii.test(e);)++t;return t};var Li=function(e){return Di(e)?Ti(e):Ei(e)},Qi="[object Map]",Ri="[object Set]";var Bi=function(e){if(null==e)return 0;if(qt(e))return xi(e)?Li(e):e.length;var t=Sr(e);return t==Qi||t==Ri?e.size:Wt(e).length};var zi=function(e,t,r){var n=Dt(e),o=n||Ct(e)||Qt(e);if(t=ai(t),null==r){var i=e&&e.constructor;r=o?n?new i:[]:me(e)&&ke(i)?an(lr(e)):{}}return(o?ht:jn)(e,function(e,n,o){return t(r,e,n,o)}),r},Vi=ae?ae.isConcatSpreadable:void 0;var Gi=function(e){return Dt(e)||kt(e)||!!(Vi&&e&&e[Vi])};var Hi=function e(t,r,n,o,i){var a=-1,s=t.length;for(n||(n=Gi),i||(i=[]);++a<s;){var u=t[a];r>0&&n(u)?r>1?e(u,r-1,n,o,i):cr(i,u):o||(i[i.length]=u)}return i};var Ui=function(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)},Wi=Math.max;var qi=function(e,t,r){return t=Wi(void 0===t?e.length-1:t,0),function(){for(var n=arguments,o=-1,i=Wi(n.length-t,0),a=Array(i);++o<i;)a[o]=n[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=n[o];return s[t]=r(a),Ui(e,this,s)}},Yi=ft?function(e,t){return ft(e,"toString",{configurable:!0,enumerable:!1,value:Cn(t),writable:!0})}:Fn,$i=800,Xi=16,Ji=Date.now;var Ki=function(e){var t=0,r=0;return function(){var n=Ji(),o=Xi-(n-r);if(r=n,o>0){if(++t>=$i)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(Yi);var Zi=function(e,t){return Ki(qi(e,t,Fn),e+"")};var ea=function(e,t,r,n){for(var o=e.length,i=r+(n?1:-1);n?i--:++i<o;)if(t(e[i],i,e))return i;return-1};var ta=function(e){return e!=e};var ra=function(e,t,r){for(var n=r-1,o=e.length;++n<o;)if(e[n]===t)return n;return-1};var na=function(e,t,r){return t==t?ra(e,t,r):ea(e,ta,r)};var oa=function(e,t){return!(null==e||!e.length)&&na(e,t,0)>-1};var ia=function(e,t,r){for(var n=-1,o=null==e?0:e.length;++n<o;)if(r(t,e[n]))return!0;return!1};var aa=function(){},sa=mr&&1/qn(new mr([,-0]))[1]==1/0?function(e){return new mr(e)}:aa,ua=200;var ca=function(e,t,r){var n=-1,o=oa,i=e.length,a=!0,s=[],u=s;if(r)a=!1,o=ia;else if(i>=ua){var c=t?null:sa(e);if(c)return qn(c);a=!1,o=Vn,u=new Bn}else u=t?[]:s;e:for(;++n<i;){var l=e[n],h=t?t(l):l;if(l=r||0!==l?l:0,a&&h==h){for(var f=u.length;f--;)if(u[f]===h)continue e;t&&u.push(h),s.push(l)}else o(u,h,r)||(u!==s&&u.push(h),s.push(l))}return s};var la=function(e){return mt(e)&&qt(e)},ha=Zi(function(e){return ca(Hi(e,1,la,!0))});var fa=function(e,t){return Bo(t,function(t){return e[t]})};var da,pa=function(e){return null==e?[]:fa(e,Yt(e))};try{da={clone:Sn,constant:Cn,each:Nn,filter:si,has:li,isArray:Dt,isEmpty:pi,isFunction:ke,isUndefined:gi,keys:Yt,map:yi,reduce:bi,size:Bi,transform:zi,union:ha,values:pa}}catch(e){}da||(da=window._);var ga=da,va=ba,ya="\0",ma="\0",_a="";function ba(e){this._isDirected=!ga.has(e,"directed")||e.directed,this._isMultigraph=!!ga.has(e,"multigraph")&&e.multigraph,this._isCompound=!!ga.has(e,"compound")&&e.compound,this._label=void 0,this._defaultNodeLabelFn=ga.constant(void 0),this._defaultEdgeLabelFn=ga.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[ma]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function wa(e,t){e[t]?e[t]++:e[t]=1}function xa(e,t){--e[t]||delete e[t]}function Ea(e,t,r,n){var o=""+t,i=""+r;if(!e&&o>i){var a=o;o=i,i=a}return o+_a+i+_a+(ga.isUndefined(n)?ya:n)}function ka(e,t){return Ea(e,t.v,t.w,t.name)}ba.prototype._nodeCount=0,ba.prototype._edgeCount=0,ba.prototype.isDirected=function(){return this._isDirected},ba.prototype.isMultigraph=function(){return this._isMultigraph},ba.prototype.isCompound=function(){return this._isCompound},ba.prototype.setGraph=function(e){return this._label=e,this},ba.prototype.graph=function(){return this._label},ba.prototype.setDefaultNodeLabel=function(e){return ga.isFunction(e)||(e=ga.constant(e)),this._defaultNodeLabelFn=e,this},ba.prototype.nodeCount=function(){return this._nodeCount},ba.prototype.nodes=function(){return ga.keys(this._nodes)},ba.prototype.sources=function(){var e=this;return ga.filter(this.nodes(),function(t){return ga.isEmpty(e._in[t])})},ba.prototype.sinks=function(){var e=this;return ga.filter(this.nodes(),function(t){return ga.isEmpty(e._out[t])})},ba.prototype.setNodes=function(e,t){var r=arguments,n=this;return ga.each(e,function(e){r.length>1?n.setNode(e,t):n.setNode(e)}),this},ba.prototype.setNode=function(e,t){return ga.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=ma,this._children[e]={},this._children[ma][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},ba.prototype.node=function(e){return this._nodes[e]},ba.prototype.hasNode=function(e){return ga.has(this._nodes,e)},ba.prototype.removeNode=function(e){var t=this;if(ga.has(this._nodes,e)){var r=function(e){t.removeEdge(t._edgeObjs[e])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],ga.each(this.children(e),function(e){t.setParent(e)}),delete this._children[e]),ga.each(ga.keys(this._in[e]),r),delete this._in[e],delete this._preds[e],ga.each(ga.keys(this._out[e]),r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},ba.prototype.setParent=function(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(ga.isUndefined(t))t=ma;else{for(var r=t+="";!ga.isUndefined(r);r=this.parent(r))if(r===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this},ba.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},ba.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if(t!==ma)return t}},ba.prototype.children=function(e){if(ga.isUndefined(e)&&(e=ma),this._isCompound){var t=this._children[e];if(t)return ga.keys(t)}else{if(e===ma)return this.nodes();if(this.hasNode(e))return[]}},ba.prototype.predecessors=function(e){var t=this._preds[e];if(t)return ga.keys(t)},ba.prototype.successors=function(e){var t=this._sucs[e];if(t)return ga.keys(t)},ba.prototype.neighbors=function(e){var t=this.predecessors(e);if(t)return ga.union(t,this.successors(e))},ba.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},ba.prototype.filterNodes=function(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var r=this;ga.each(this._nodes,function(r,n){e(n)&&t.setNode(n,r)}),ga.each(this._edgeObjs,function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,r.edge(e))});var n={};return this._isCompound&&ga.each(t.nodes(),function(e){t.setParent(e,function e(o){var i=r.parent(o);return void 0===i||t.hasNode(i)?(n[o]=i,i):i in n?n[i]:e(i)}(e))}),t},ba.prototype.setDefaultEdgeLabel=function(e){return ga.isFunction(e)||(e=ga.constant(e)),this._defaultEdgeLabelFn=e,this},ba.prototype.edgeCount=function(){return this._edgeCount},ba.prototype.edges=function(){return ga.values(this._edgeObjs)},ba.prototype.setPath=function(e,t){var r=this,n=arguments;return ga.reduce(e,function(e,o){return n.length>1?r.setEdge(e,o,t):r.setEdge(e,o),o}),this},ba.prototype.setEdge=function(){var e,t,r,n,o=!1,i=arguments[0];"object"==typeof i&&null!==i&&"v"in i?(e=i.v,t=i.w,r=i.name,2===arguments.length&&(n=arguments[1],o=!0)):(e=i,t=arguments[1],r=arguments[3],arguments.length>2&&(n=arguments[2],o=!0)),e=""+e,t=""+t,ga.isUndefined(r)||(r=""+r);var a=Ea(this._isDirected,e,t,r);if(ga.has(this._edgeLabels,a))return o&&(this._edgeLabels[a]=n),this;if(!ga.isUndefined(r)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[a]=o?n:this._defaultEdgeLabelFn(e,t,r);var s=function(e,t,r,n){var o=""+t,i=""+r;if(!e&&o>i){var a=o;o=i,i=a}var s={v:o,w:i};n&&(s.name=n);return s}(this._isDirected,e,t,r);return e=s.v,t=s.w,Object.freeze(s),this._edgeObjs[a]=s,wa(this._preds[t],e),wa(this._sucs[e],t),this._in[t][a]=s,this._out[e][a]=s,this._edgeCount++,this},ba.prototype.edge=function(e,t,r){var n=1===arguments.length?ka(this._isDirected,arguments[0]):Ea(this._isDirected,e,t,r);return this._edgeLabels[n]},ba.prototype.hasEdge=function(e,t,r){var n=1===arguments.length?ka(this._isDirected,arguments[0]):Ea(this._isDirected,e,t,r);return ga.has(this._edgeLabels,n)},ba.prototype.removeEdge=function(e,t,r){var n=1===arguments.length?ka(this._isDirected,arguments[0]):Ea(this._isDirected,e,t,r),o=this._edgeObjs[n];return o&&(e=o.v,t=o.w,delete this._edgeLabels[n],delete this._edgeObjs[n],xa(this._preds[t],e),xa(this._sucs[e],t),delete this._in[t][n],delete this._out[e][n],this._edgeCount--),this},ba.prototype.inEdges=function(e,t){var r=this._in[e];if(r){var n=ga.values(r);return t?ga.filter(n,function(e){return e.v===t}):n}},ba.prototype.outEdges=function(e,t){var r=this._out[e];if(r){var n=ga.values(r);return t?ga.filter(n,function(e){return e.w===t}):n}},ba.prototype.nodeEdges=function(e,t){var r=this.inEdges(e,t);if(r)return r.concat(this.outEdges(e,t))};var Da={Graph:va,version:"2.1.8"},Sa={write:function(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:Ca(e),edges:Aa(e)};ga.isUndefined(e.graph())||(t.value=ga.clone(e.graph()));return t},read:function(e){var t=new va(e.options).setGraph(e.value);return ga.each(e.nodes,function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),ga.each(e.edges,function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}};function Ca(e){return ga.map(e.nodes(),function(t){var r=e.node(t),n=e.parent(t),o={v:t};return ga.isUndefined(r)||(o.value=r),ga.isUndefined(n)||(o.parent=n),o})}function Aa(e){return ga.map(e.edges(),function(t){var r=e.edge(t),n={v:t.v,w:t.w};return ga.isUndefined(t.name)||(n.name=t.name),ga.isUndefined(r)||(n.value=r),n})}var ja=function(e){var t,r={},n=[];function o(n){ga.has(r,n)||(r[n]=!0,t.push(n),ga.each(e.successors(n),o),ga.each(e.predecessors(n),o))}return ga.each(e.nodes(),function(e){t=[],o(e),t.length&&n.push(t)}),n};var Pa=Fa;function Fa(){this._arr=[],this._keyIndices={}}Fa.prototype.size=function(){return this._arr.length},Fa.prototype.keys=function(){return this._arr.map(function(e){return e.key})},Fa.prototype.has=function(e){return ga.has(this._keyIndices,e)},Fa.prototype.priority=function(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority},Fa.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},Fa.prototype.add=function(e,t){var r=this._keyIndices;if(e=String(e),!ga.has(r,e)){var n=this._arr,o=n.length;return r[e]=o,n.push({key:e,priority:t}),this._decrease(o),!0}return!1},Fa.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},Fa.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)},Fa.prototype._heapify=function(e){var t=this._arr,r=2*e,n=r+1,o=e;r<t.length&&(o=t[r].priority<t[o].priority?r:o,n<t.length&&(o=t[n].priority<t[o].priority?n:o),o!==e&&(this._swap(e,o),this._heapify(o)))},Fa.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},Fa.prototype._swap=function(e,t){var r=this._arr,n=this._keyIndices,o=r[e],i=r[t];r[e]=i,r[t]=o,n[i.key]=e,n[o.key]=t};var Ma=function(e,t,r,n){return function(e,t,r,n){var o,i,a={},s=new Pa,u=function(e){var t=e.v!==o?e.v:e.w,n=a[t],u=r(e),c=i.distance+u;if(u<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+u);c<n.distance&&(n.distance=c,n.predecessor=o,s.decrease(t,c))};e.nodes().forEach(function(e){var r=e===t?0:Number.POSITIVE_INFINITY;a[e]={distance:r},s.add(e,r)});for(;s.size()>0&&(o=s.removeMin(),(i=a[o]).distance!==Number.POSITIVE_INFINITY);)n(o).forEach(u);return a}(e,String(t),r||Oa,n||function(t){return e.outEdges(t)})},Oa=ga.constant(1);var Na=function(e,t,r){return ga.transform(e.nodes(),function(n,o){n[o]=Ma(e,o,t,r)},{})};var Ia=function(e){var t=0,r=[],n={},o=[];return e.nodes().forEach(function(i){ga.has(n,i)||function i(a){var s=n[a]={onStack:!0,lowlink:t,index:t++};if(r.push(a),e.successors(a).forEach(function(e){ga.has(n,e)?n[e].onStack&&(s.lowlink=Math.min(s.lowlink,n[e].index)):(i(e),s.lowlink=Math.min(s.lowlink,n[e].lowlink))}),s.lowlink===s.index){var u,c=[];do{u=r.pop(),n[u].onStack=!1,c.push(u)}while(a!==u);o.push(c)}}(i)}),o};var Ta=function(e){return ga.filter(Ia(e),function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])})};var La=function(e,t,r){return function(e,t,r){var n={},o=e.nodes();return o.forEach(function(e){n[e]={},n[e][e]={distance:0},o.forEach(function(t){e!==t&&(n[e][t]={distance:Number.POSITIVE_INFINITY})}),r(e).forEach(function(r){var o=r.v===e?r.w:r.v,i=t(r);n[e][o]={distance:i,predecessor:e}})}),o.forEach(function(e){var t=n[e];o.forEach(function(r){var i=n[r];o.forEach(function(r){var n=i[e],o=t[r],a=i[r],s=n.distance+o.distance;s<a.distance&&(a.distance=s,a.predecessor=o.predecessor)})})}),n}(e,t||Qa,r||function(t){return e.outEdges(t)})},Qa=ga.constant(1);var Ra=Ba;function Ba(e){var t={},r={},n=[];if(ga.each(e.sinks(),function o(i){if(ga.has(r,i))throw new za;ga.has(t,i)||(r[i]=!0,t[i]=!0,ga.each(e.predecessors(i),o),delete r[i],n.push(i))}),ga.size(t)!==e.nodeCount())throw new za;return n}function za(){}Ba.CycleException=za,za.prototype=new Error;var Va=function(e,t,r){ga.isArray(t)||(t=[t]);var n=(e.isDirected()?e.successors:e.neighbors).bind(e),o=[],i={};return ga.each(t,function(t){if(!e.hasNode(t))throw new Error("Graph does not have node: "+t);!function e(t,r,n,o,i,a){ga.has(o,r)||(o[r]=!0,n||a.push(r),ga.each(i(r),function(r){e(t,r,n,o,i,a)}),n&&a.push(r))}(e,t,"post"===r,i,n,o)}),o};var Ga,Ha={Graph:Da.Graph,json:Sa,alg:{components:ja,dijkstra:Ma,dijkstraAll:Na,findCycles:Ta,floydWarshall:La,isAcyclic:function(e){try{Ra(e)}catch(e){if(e instanceof Ra.CycleException)return!1;throw e}return!0},postorder:function(e,t){return Va(e,t,"post")},preorder:function(e,t){return Va(e,t,"pre")},prim:function(e,t){var r,n=new va,o={},i=new Pa;function a(e){var n=e.v===r?e.w:e.v,a=i.priority(n);if(void 0!==a){var s=t(e);s<a&&(o[n]=r,i.decrease(n,s))}}if(0===e.nodeCount())return n;ga.each(e.nodes(),function(e){i.add(e,Number.POSITIVE_INFINITY),n.setNode(e)}),i.decrease(e.nodes()[0],0);var s=!1;for(;i.size()>0;){if(r=i.removeMin(),ga.has(o,r))n.setEdge(r,o[r]);else{if(s)throw new Error("Input graph is not connected: "+e);s=!0}e.nodeEdges(r).forEach(a)}return n},tarjan:Ia,topsort:Ra},version:Da.version};try{Ga=Ha}catch(e){}Ga||(Ga=window.graphlib);var Ua=Ga,Wa=1,qa=4;var Ya=function(e){return kn(e,Wa|qa)};var $a=function(e,t,r){if(!me(r))return!1;var n=typeof t;return!!("number"==n?qt(r)&&Pt(t,r.length):"string"==n&&t in r)&&H(r[t],e)},Xa=Object.prototype,Ja=Xa.hasOwnProperty,Ka=Zi(function(e,t){e=Object(e);var r=-1,n=t.length,o=n>2?t[2]:void 0;for(o&&$a(t[0],t[1],o)&&(n=1);++r<n;)for(var i=t[r],a=Zt(i),s=-1,u=a.length;++s<u;){var c=a[s],l=e[c];(void 0===l||H(l,Xa[c])&&!Ja.call(e,c))&&(e[c]=i[c])}return e});var Za=function(e){return function(t,r,n){var o=Object(t);if(!qt(t)){var i=ai(r);t=Yt(t),r=function(e){return i(o[e],e,o)}}var a=e(t,r,n);return a>-1?o[i?t[a]:a]:void 0}},es=/\s/;var ts=function(e){for(var t=e.length;t--&&es.test(e.charAt(t)););return t},rs=/^\s+/;var ns=function(e){return e?e.slice(0,ts(e)+1).replace(rs,""):e},os=NaN,is=/^[-+]0x[0-9a-f]+$/i,as=/^0b[01]+$/i,ss=/^0o[0-7]+$/i,us=parseInt;var cs=function(e){if("number"==typeof e)return e;if(jo(e))return os;if(me(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=me(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=ns(e);var r=as.test(e);return r||ss.test(e)?us(e.slice(2),r?2:8):is.test(e)?os:+e},ls=1/0,hs=1.7976931348623157e308;var fs=function(e){return e?(e=cs(e))===ls||e===-ls?(e<0?-1:1)*hs:e==e?e:0:0===e?e:0};var ds=function(e){var t=fs(e),r=t%1;return t==t?r?t-r:t:0},ps=Math.max;var gs=Za(function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var o=null==r?0:ds(r);return o<0&&(o=ps(n+o,0)),ea(e,ai(t),o)});var vs=function(e){return null!=e&&e.length?Hi(e,1):[]};var ys=function(e,t){return null==e?e:An(e,Mn(t),Zt)};var ms=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0};var _s=function(e,t){var r={};return t=ai(t),jn(e,function(e,n,o){dt(r,n,t(e,n,o))}),r};var bs=function(e,t,r){for(var n=-1,o=e.length;++n<o;){var i=e[n],a=t(i);if(null!=a&&(void 0===s?a==a&&!jo(a):r(a,s)))var s=a,u=i}return u};var ws=function(e,t){return e>t};var xs=function(e){return e&&e.length?bs(e,Fn,ws):void 0};var Es=function(e,t,r){(void 0===r||H(e[t],r))&&(void 0!==r||t in e)||dt(e,t,r)},ks="[object Object]",Ds=Function.prototype,Ss=Object.prototype,Cs=Ds.toString,As=Ss.hasOwnProperty,js=Cs.call(Object);var Ps=function(e){if(!mt(e)||ye(e)!=ks)return!1;var t=lr(e);if(null===t)return!0;var r=As.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Cs.call(r)==js};var Fs=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]};var Ms=function(e){return vt(e,Zt(e))};var Os=function(e,t,r,n,o,i,a){var s=Fs(e,r),u=Fs(t,r),c=a.get(u);if(c)Es(e,r,c);else{var l=i?i(s,u,r+"",e,t,a):void 0,h=void 0===l;if(h){var f=Dt(u),d=!f&&Ct(u),p=!f&&!d&&Qt(u);l=u,f||d||p?Dt(s)?l=s:la(s)?l=rr(s):d?(h=!1,l=tr(u,!0)):p?(h=!1,l=Lr(u,!0)):l=[]:Ps(u)||kt(u)?(l=s,kt(s)?l=Ms(s):me(s)&&!ke(s)||(l=sn(u))):h=!1}h&&(a.set(u,l),o(l,u,n,i,a),a.delete(u)),Es(e,r,l)}};var Ns=function e(t,r,n,o,i){t!==r&&An(r,function(a,s){if(i||(i=new lt),me(a))Os(t,r,s,n,e,o,i);else{var u=o?o(Fs(t,s),a,s+"",t,r,i):void 0;void 0===u&&(u=a),Es(t,s,u)}},Zt)};var Is=function(e){return Zi(function(t,r){var n=-1,o=r.length,i=o>1?r[o-1]:void 0,a=o>2?r[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,a&&$a(r[0],r[1],a)&&(i=o<3?void 0:i,o=1),t=Object(t);++n<o;){var s=r[n];s&&e(t,s,n,i)}return t})}(function(e,t,r){Ns(e,t,r)});var Ts=function(e,t){return e<t};var Ls=function(e){return e&&e.length?bs(e,Fn,Ts):void 0};var Qs=function(e,t){return e&&e.length?bs(e,ai(t),Ts):void 0},Rs=function(){return ie.Date.now()};var Bs=function(e,t,r,n){if(!me(e))return e;for(var o=-1,i=(t=Wo(t,e)).length,a=i-1,s=e;null!=s&&++o<i;){var u=Yo(t[o]),c=r;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(o!=a){var l=s[u];void 0===(c=n?n(l,u,s):void 0)&&(c=me(l)?l:Pt(t[o+1])?[]:{})}gt(s,u,c),s=s[u]}return e};var zs=function(e,t,r){for(var n=-1,o=t.length,i={};++n<o;){var a=t[n],s=$o(e,a);r(s,a)&&Bs(i,Wo(a,e),s)}return i};var Vs=function(e,t){return zs(e,t,function(t,r){return Zo(e,r)})};var Gs=function(e){return Ki(qi(e,void 0,vs),e+"")}(function(e,t){return null==e?{}:Vs(e,t)}),Hs=Math.ceil,Us=Math.max;var Ws=function(e,t,r,n){for(var o=-1,i=Us(Hs((t-e)/(r||1)),0),a=Array(i);i--;)a[n?i:++o]=e,e+=r;return a};var qs=function(e){return function(t,r,n){return n&&"number"!=typeof n&&$a(t,r,n)&&(r=n=void 0),t=fs(t),void 0===r?(r=t,t=0):r=fs(r),n=void 0===n?t<r?1:-1:fs(n),Ws(t,r,n,e)}}();var Ys=function(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e};var $s=function(e,t){if(e!==t){var r=void 0!==e,n=null===e,o=e==e,i=jo(e),a=void 0!==t,s=null===t,u=t==t,c=jo(t);if(!s&&!c&&!i&&e>t||i&&a&&u&&!s&&!c||n&&a&&u||!r&&u||!o)return 1;if(!n&&!i&&!c&&e<t||c&&r&&o&&!n&&!i||s&&r&&o||!a&&o||!u)return-1}return 0};var Xs=function(e,t,r){for(var n=-1,o=e.criteria,i=t.criteria,a=o.length,s=r.length;++n<a;){var u=$s(o[n],i[n]);if(u)return n>=s?u:u*("desc"==r[n]?-1:1)}return e.index-t.index};var Js=function(e,t,r){t=t.length?Bo(t,function(e){return Dt(e)?function(t){return $o(t,1===e.length?e[0]:e)}:e}):[Fn];var n=-1;t=Bo(t,It(ai));var o=vi(e,function(e,r,o){return{criteria:Bo(t,function(t){return t(e)}),index:++n,value:e}});return Ys(o,function(e,t){return Xs(e,t,r)})},Ks=Zi(function(e,t){if(null==e)return[];var r=t.length;return r>1&&$a(e,t[0],t[1])?t=[]:r>2&&$a(t[0],t[1],t[2])&&(t=[t[0]]),Js(e,Hi(t,1),[])}),Zs=0;var eu=function(e){var t=++Zs;return Uo(e)+t};var tu=function(e,t,r){for(var n=-1,o=e.length,i=t.length,a={};++n<o;){var s=n<i?t[n]:void 0;r(a,e[n],s)}return a};var ru,nu=function(e,t){return tu(e||[],t||[],gt)};try{ru={cloneDeep:Ya,constant:Cn,defaults:Ka,each:Nn,filter:si,find:gs,flatten:vs,forEach:On,forIn:ys,has:li,isUndefined:gi,last:ms,map:yi,mapValues:_s,max:xs,merge:Is,min:Ls,minBy:Qs,now:Rs,pick:Gs,range:qs,reduce:bi,sortBy:Ks,uniqueId:eu,values:pa,zipObject:nu}}catch(e){}ru||(ru=window._);var ou=ru,iu=au;function au(){var e={};e._next=e._prev=e,this._sentinel=e}function su(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function uu(e,t){if("_next"!==e&&"_prev"!==e)return t}au.prototype.dequeue=function(){var e=this._sentinel,t=e._prev;if(t!==e)return su(t),t},au.prototype.enqueue=function(e){var t=this._sentinel;e._prev&&e._next&&su(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t},au.prototype.toString=function(){for(var e=[],t=this._sentinel,r=t._prev;r!==t;)e.push(JSON.stringify(r,uu)),r=r._prev;return"["+e.join(", ")+"]"};var cu=Ua.Graph,lu=function(e,t){if(e.nodeCount()<=1)return[];var r=function(e,t){var r=new cu,n=0,o=0;ou.forEach(e.nodes(),function(e){r.setNode(e,{v:e,in:0,out:0})}),ou.forEach(e.edges(),function(e){var i=r.edge(e.v,e.w)||0,a=t(e),s=i+a;r.setEdge(e.v,e.w,s),o=Math.max(o,r.node(e.v).out+=a),n=Math.max(n,r.node(e.w).in+=a)});var i=ou.range(o+n+3).map(function(){return new iu}),a=n+1;return ou.forEach(r.nodes(),function(e){du(i,a,r.node(e))}),{graph:r,buckets:i,zeroIdx:a}}(e,t||hu),n=function(e,t,r){var n,o=[],i=t[t.length-1],a=t[0];for(;e.nodeCount();){for(;n=a.dequeue();)fu(e,t,r,n);for(;n=i.dequeue();)fu(e,t,r,n);if(e.nodeCount())for(var s=t.length-2;s>0;--s)if(n=t[s].dequeue()){o=o.concat(fu(e,t,r,n,!0));break}}return o}(r.graph,r.buckets,r.zeroIdx);return ou.flatten(ou.map(n,function(t){return e.outEdges(t.v,t.w)}),!0)},hu=ou.constant(1);function fu(e,t,r,n,o){var i=o?[]:void 0;return ou.forEach(e.inEdges(n.v),function(n){var a=e.edge(n),s=e.node(n.v);o&&i.push({v:n.v,w:n.w}),s.out-=a,du(t,r,s)}),ou.forEach(e.outEdges(n.v),function(n){var o=e.edge(n),i=n.w,a=e.node(i);a.in-=o,du(t,r,a)}),e.removeNode(n.v),i}function du(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)}var pu={run:function(e){var t="greedy"===e.graph().acyclicer?lu(e,function(e){return function(t){return e.edge(t).weight}}(e)):function(e){var t=[],r={},n={};return ou.forEach(e.nodes(),function o(i){ou.has(n,i)||(n[i]=!0,r[i]=!0,ou.forEach(e.outEdges(i),function(e){ou.has(r,e.w)?t.push(e):o(e.w)}),delete r[i])}),t}(e);ou.forEach(t,function(t){var r=e.edge(t);e.removeEdge(t),r.forwardName=t.name,r.reversed=!0,e.setEdge(t.w,t.v,r,ou.uniqueId("rev"))})},undo:function(e){ou.forEach(e.edges(),function(t){var r=e.edge(t);if(r.reversed){e.removeEdge(t);var n=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(t.w,t.v,r,n)}})}};var gu=Ua.Graph,vu={addDummyNode:yu,simplify:function(e){var t=(new gu).setGraph(e.graph());return ou.forEach(e.nodes(),function(r){t.setNode(r,e.node(r))}),ou.forEach(e.edges(),function(r){var n=t.edge(r.v,r.w)||{weight:0,minlen:1},o=e.edge(r);t.setEdge(r.v,r.w,{weight:n.weight+o.weight,minlen:Math.max(n.minlen,o.minlen)})}),t},asNonCompoundGraph:function(e){var t=new gu({multigraph:e.isMultigraph()}).setGraph(e.graph());return ou.forEach(e.nodes(),function(r){e.children(r).length||t.setNode(r,e.node(r))}),ou.forEach(e.edges(),function(r){t.setEdge(r,e.edge(r))}),t},successorWeights:function(e){var t=ou.map(e.nodes(),function(t){var r={};return ou.forEach(e.outEdges(t),function(t){r[t.w]=(r[t.w]||0)+e.edge(t).weight}),r});return ou.zipObject(e.nodes(),t)},predecessorWeights:function(e){var t=ou.map(e.nodes(),function(t){var r={};return ou.forEach(e.inEdges(t),function(t){r[t.v]=(r[t.v]||0)+e.edge(t).weight}),r});return ou.zipObject(e.nodes(),t)},intersectRect:function(e,t){var r,n,o=e.x,i=e.y,a=t.x-o,s=t.y-i,u=e.width/2,c=e.height/2;if(!a&&!s)throw new Error("Not possible to find intersection inside of the rectangle");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);return{x:o+r,y:i+n}},buildLayerMatrix:function(e){var t=ou.map(ou.range(mu(e)+1),function(){return[]});return ou.forEach(e.nodes(),function(r){var n=e.node(r),o=n.rank;ou.isUndefined(o)||(t[o][n.order]=r)}),t},normalizeRanks:function(e){var t=ou.min(ou.map(e.nodes(),function(t){return e.node(t).rank}));ou.forEach(e.nodes(),function(r){var n=e.node(r);ou.has(n,"rank")&&(n.rank-=t)})},removeEmptyRanks:function(e){var t=ou.min(ou.map(e.nodes(),function(t){return e.node(t).rank})),r=[];ou.forEach(e.nodes(),function(n){var o=e.node(n).rank-t;r[o]||(r[o]=[]),r[o].push(n)});var n=0,o=e.graph().nodeRankFactor;ou.forEach(r,function(t,r){ou.isUndefined(t)&&r%o!=0?--n:n&&ou.forEach(t,function(t){e.node(t).rank+=n})})},addBorderNode:function(e,t,r,n){var o={width:0,height:0};arguments.length>=4&&(o.rank=r,o.order=n);return yu(e,"border",o,t)},maxRank:mu,partition:function(e,t){var r={lhs:[],rhs:[]};return ou.forEach(e,function(e){t(e)?r.lhs.push(e):r.rhs.push(e)}),r},time:function(e,t){var r=ou.now();try{return t()}finally{console.log(e+" time: "+(ou.now()-r)+"ms")}},notime:function(e,t){return t()}};function yu(e,t,r,n){var o;do{o=ou.uniqueId(n)}while(e.hasNode(o));return r.dummy=t,e.setNode(o,r),o}function mu(e){return ou.max(ou.map(e.nodes(),function(t){var r=e.node(t).rank;if(!ou.isUndefined(r))return r}))}var _u={run:function(e){e.graph().dummyChains=[],ou.forEach(e.edges(),function(t){!function(e,t){var r,n,o,i=t.v,a=e.node(i).rank,s=t.w,u=e.node(s).rank,c=t.name,l=e.edge(t),h=l.labelRank;if(u===a+1)return;for(e.removeEdge(t),o=0,++a;a<u;++o,++a)l.points=[],n={width:0,height:0,edgeLabel:l,edgeObj:t,rank:a},r=vu.addDummyNode(e,"edge",n,"_d"),a===h&&(n.width=l.width,n.height=l.height,n.dummy="edge-label",n.labelpos=l.labelpos),e.setEdge(i,r,{weight:l.weight},c),0===o&&e.graph().dummyChains.push(r),i=r;e.setEdge(i,s,{weight:l.weight},c)}(e,t)})},undo:function(e){ou.forEach(e.graph().dummyChains,function(t){var r,n=e.node(t),o=n.edgeLabel;for(e.setEdge(n.edgeObj,o);n.dummy;)r=e.successors(t)[0],e.removeNode(t),o.points.push({x:n.x,y:n.y}),"edge-label"===n.dummy&&(o.x=n.x,o.y=n.y,o.width=n.width,o.height=n.height),t=r,n=e.node(t)})}};var bu=function(e){var t={};ou.forEach(e.sources(),function r(n){var o=e.node(n);if(ou.has(t,n))return o.rank;t[n]=!0;var i=ou.min(ou.map(e.outEdges(n),function(t){return r(t.w)-e.edge(t).minlen}));i!==Number.POSITIVE_INFINITY&&null!=i||(i=0);return o.rank=i})},wu=function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen};var xu=Ua.Graph,Eu=wu,ku=function(e){var t,r,n=new xu({directed:!1}),o=e.nodes()[0],i=e.nodeCount();n.setNode(o,{});for(;Du(n,e)<i;)t=Su(n,e),r=n.hasNode(t.v)?Eu(e,t):-Eu(e,t),Cu(n,e,r);return n};function Du(e,t){return ou.forEach(e.nodes(),function r(n){ou.forEach(t.nodeEdges(n),function(o){var i=o.v,a=n===i?o.w:i;e.hasNode(a)||Eu(t,o)||(e.setNode(a,{}),e.setEdge(n,a,{}),r(a))})}),e.nodeCount()}function Su(e,t){return ou.minBy(t.edges(),function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return Eu(t,r)})}function Cu(e,t,r){ou.forEach(e.nodes(),function(e){t.node(e).rank+=r})}var Au=wu,ju=bu,Pu=Ua.alg.preorder,Fu=Ua.alg.postorder,Mu=vu.simplify,Ou=Nu;function Nu(e){e=Mu(e),ju(e);var t,r=ku(e);for(Lu(r),Iu(r,e);t=Qu(r);)Bu(r,e,t,Ru(r,e,t))}function Iu(e,t){var r=Fu(e,e.nodes());r=r.slice(0,r.length-1),ou.forEach(r,function(r){!function(e,t,r){var n=e.node(r).parent;e.edge(r,n).cutvalue=Tu(e,t,r)}(e,t,r)})}function Tu(e,t,r){var n=e.node(r).parent,o=!0,i=t.edge(r,n),a=0;return i||(o=!1,i=t.edge(n,r)),a=i.weight,ou.forEach(t.nodeEdges(r),function(i){var s=i.v===r,u=s?i.w:i.v;if(u!==n){var c=s===o,l=t.edge(i).weight;if(a+=c?l:-l,function(e,t,r){return e.hasEdge(t,r)}(e,r,u)){var h=e.edge(r,u).cutvalue;a+=c?-h:h}}}),a}function Lu(e,t){arguments.length<2&&(t=e.nodes()[0]),function e(t,r,n,o,i){var a=n;var s=t.node(o);r[o]=!0;ou.forEach(t.neighbors(o),function(i){ou.has(r,i)||(n=e(t,r,n,i,o))});s.low=a;s.lim=n++;i?s.parent=i:delete s.parent;return n}(e,{},1,t)}function Qu(e){return ou.find(e.edges(),function(t){return e.edge(t).cutvalue<0})}function Ru(e,t,r){var n=r.v,o=r.w;t.hasEdge(n,o)||(n=r.w,o=r.v);var i=e.node(n),a=e.node(o),s=i,u=!1;i.lim>a.lim&&(s=a,u=!0);var c=ou.filter(t.edges(),function(t){return u===zu(e,e.node(t.v),s)&&u!==zu(e,e.node(t.w),s)});return ou.minBy(c,function(e){return Au(t,e)})}function Bu(e,t,r,n){var o=r.v,i=r.w;e.removeEdge(o,i),e.setEdge(n.v,n.w,{}),Lu(e),Iu(e,t),function(e,t){var r=ou.find(e.nodes(),function(e){return!t.node(e).parent}),n=Pu(e,r);n=n.slice(1),ou.forEach(n,function(r){var n=e.node(r).parent,o=t.edge(r,n),i=!1;o||(o=t.edge(n,r),i=!0),t.node(r).rank=t.node(n).rank+(i?o.minlen:-o.minlen)})}(e,t)}function zu(e,t,r){return r.low<=t.lim&&t.lim<=r.lim}Nu.initLowLimValues=Lu,Nu.initCutValues=Iu,Nu.calcCutValue=Tu,Nu.leaveEdge=Qu,Nu.enterEdge=Ru,Nu.exchangeEdges=Bu;var Vu=bu,Gu=function(e){switch(e.graph().ranker){case"network-simplex":Uu(e);break;case"tight-tree":!function(e){Vu(e),ku(e)}(e);break;case"longest-path":Hu(e);break;default:Uu(e)}};var Hu=Vu;function Uu(e){Ou(e)}var Wu=function(e){var t=function(e){var t={},r=0;return ou.forEach(e.children(),function n(o){var i=r;ou.forEach(e.children(o),n),t[o]={low:i,lim:r++}}),t}(e);ou.forEach(e.graph().dummyChains,function(r){for(var n=e.node(r),o=n.edgeObj,i=function(e,t,r,n){var o,i,a=[],s=[],u=Math.min(t[r].low,t[n].low),c=Math.max(t[r].lim,t[n].lim);o=r;do{o=e.parent(o),a.push(o)}while(o&&(t[o].low>u||c>t[o].lim));i=o,o=n;for(;(o=e.parent(o))!==i;)s.push(o);return{path:a.concat(s.reverse()),lca:i}}(e,t,o.v,o.w),a=i.path,s=i.lca,u=0,c=a[u],l=!0;r!==o.w;){if(n=e.node(r),l){for(;(c=a[u])!==s&&e.node(c).maxRank<n.rank;)u++;c===s&&(l=!1)}if(!l){for(;u<a.length-1&&e.node(c=a[u+1]).minRank<=n.rank;)u++;c=a[u]}e.setParent(r,c),r=e.successors(r)[0]}})};var qu={run:function(e){var t=vu.addDummyNode(e,"root",{},"_root"),r=function(e){var t={};return ou.forEach(e.children(),function(r){!function r(n,o){var i=e.children(n);i&&i.length&&ou.forEach(i,function(e){r(e,o+1)}),t[n]=o}(r,1)}),t}(e),n=ou.max(ou.values(r))-1,o=2*n+1;e.graph().nestingRoot=t,ou.forEach(e.edges(),function(t){e.edge(t).minlen*=o});var i=function(e){return ou.reduce(e.edges(),function(t,r){return t+e.edge(r).weight},0)}(e)+1;ou.forEach(e.children(),function(a){!function e(t,r,n,o,i,a,s){var u=t.children(s);if(!u.length)return void(s!==r&&t.setEdge(r,s,{weight:0,minlen:n}));var c=vu.addBorderNode(t,"_bt");var l=vu.addBorderNode(t,"_bb");var h=t.node(s);t.setParent(c,s);h.borderTop=c;t.setParent(l,s);h.borderBottom=l;ou.forEach(u,function(u){e(t,r,n,o,i,a,u);var h=t.node(u),f=h.borderTop?h.borderTop:u,d=h.borderBottom?h.borderBottom:u,p=h.borderTop?o:2*o,g=f!==d?1:i-a[s]+1;t.setEdge(c,f,{weight:p,minlen:g,nestingEdge:!0}),t.setEdge(d,l,{weight:p,minlen:g,nestingEdge:!0})});t.parent(s)||t.setEdge(r,c,{weight:0,minlen:i+a[s]})}(e,t,o,i,n,r,a)}),e.graph().nodeRankFactor=o},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,ou.forEach(e.edges(),function(t){var r=e.edge(t);r.nestingEdge&&e.removeEdge(t)})}};var Yu=function(e){ou.forEach(e.children(),function t(r){var n=e.children(r);var o=e.node(r);n.length&&ou.forEach(n,t);if(ou.has(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var i=o.minRank,a=o.maxRank+1;i<a;++i)$u(e,"borderLeft","_bl",r,o,i),$u(e,"borderRight","_br",r,o,i)}})};function $u(e,t,r,n,o,i){var a={width:0,height:0,rank:i,borderType:t},s=o[t][i-1],u=vu.addDummyNode(e,"border",a,r);o[t][i]=u,e.setParent(u,n),s&&e.setEdge(s,u,{weight:1})}var Xu={adjust:function(e){var t=e.graph().rankdir.toLowerCase();"lr"!==t&&"rl"!==t||Ju(e)},undo:function(e){var t=e.graph().rankdir.toLowerCase();"bt"!==t&&"rl"!==t||function(e){ou.forEach(e.nodes(),function(t){Zu(e.node(t))}),ou.forEach(e.edges(),function(t){var r=e.edge(t);ou.forEach(r.points,Zu),ou.has(r,"y")&&Zu(r)})}(e);"lr"!==t&&"rl"!==t||(!function(e){ou.forEach(e.nodes(),function(t){ec(e.node(t))}),ou.forEach(e.edges(),function(t){var r=e.edge(t);ou.forEach(r.points,ec),ou.has(r,"x")&&ec(r)})}(e),Ju(e))}};function Ju(e){ou.forEach(e.nodes(),function(t){Ku(e.node(t))}),ou.forEach(e.edges(),function(t){Ku(e.edge(t))})}function Ku(e){var t=e.width;e.width=e.height,e.height=t}function Zu(e){e.y=-e.y}function ec(e){var t=e.x;e.x=e.y,e.y=t}var tc=function(e){var t={},r=ou.filter(e.nodes(),function(t){return!e.children(t).length}),n=ou.max(ou.map(r,function(t){return e.node(t).rank})),o=ou.map(ou.range(n+1),function(){return[]});var i=ou.sortBy(r,function(t){return e.node(t).rank});return ou.forEach(i,function r(n){if(!ou.has(t,n)){t[n]=!0;var i=e.node(n);o[i.rank].push(n),ou.forEach(e.successors(n),r)}}),o};var rc=function(e,t){for(var r=0,n=1;n<t.length;++n)r+=nc(e,t[n-1],t[n]);return r};function nc(e,t,r){for(var n=ou.zipObject(r,ou.map(r,function(e,t){return t})),o=ou.flatten(ou.map(t,function(t){return ou.sortBy(ou.map(e.outEdges(t),function(t){return{pos:n[t.w],weight:e.edge(t).weight}}),"pos")}),!0),i=1;i<r.length;)i<<=1;var a=2*i-1;i-=1;var s=ou.map(new Array(a),function(){return 0}),u=0;return ou.forEach(o.forEach(function(e){var t=e.pos+i;s[t]+=e.weight;for(var r=0;t>0;)t%2&&(r+=s[t+1]),s[t=t-1>>1]+=e.weight;u+=e.weight*r})),u}var oc=function(e,t){return ou.map(t,function(t){var r=e.inEdges(t);if(r.length){var n=ou.reduce(r,function(t,r){var n=e.edge(r),o=e.node(r.v);return{sum:t.sum+n.weight*o.order,weight:t.weight+n.weight}},{sum:0,weight:0});return{v:t,barycenter:n.sum/n.weight,weight:n.weight}}return{v:t}})};var ic=function(e,t){var r={};return ou.forEach(e,function(e,t){var n=r[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};ou.isUndefined(e.barycenter)||(n.barycenter=e.barycenter,n.weight=e.weight)}),ou.forEach(t.edges(),function(e){var t=r[e.v],n=r[e.w];ou.isUndefined(t)||ou.isUndefined(n)||(n.indegree++,t.out.push(r[e.w]))}),function(e){var t=[];function r(e){return function(t){var r,n,o,i;t.merged||(ou.isUndefined(t.barycenter)||ou.isUndefined(e.barycenter)||t.barycenter>=e.barycenter)&&(n=t,o=0,i=0,(r=e).weight&&(o+=r.barycenter*r.weight,i+=r.weight),n.weight&&(o+=n.barycenter*n.weight,i+=n.weight),r.vs=n.vs.concat(r.vs),r.barycenter=o/i,r.weight=i,r.i=Math.min(n.i,r.i),n.merged=!0)}}function n(t){return function(r){r.in.push(t),0==--r.indegree&&e.push(r)}}for(;e.length;){var o=e.pop();t.push(o),ou.forEach(o.in.reverse(),r(o)),ou.forEach(o.out,n(o))}return ou.map(ou.filter(t,function(e){return!e.merged}),function(e){return ou.pick(e,["vs","i","barycenter","weight"])})}(ou.filter(r,function(e){return!e.indegree}))};var ac=function(e,t){var r=vu.partition(e,function(e){return ou.has(e,"barycenter")}),n=r.lhs,o=ou.sortBy(r.rhs,function(e){return-e.i}),i=[],a=0,s=0,u=0;n.sort((c=!!t,function(e,t){return e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:c?t.i-e.i:e.i-t.i})),u=sc(i,o,u),ou.forEach(n,function(e){u+=e.vs.length,i.push(e.vs),a+=e.barycenter*e.weight,s+=e.weight,u=sc(i,o,u)});var c;var l={vs:ou.flatten(i,!0)};s&&(l.barycenter=a/s,l.weight=s);return l};function sc(e,t,r){for(var n;t.length&&(n=ou.last(t)).i<=r;)t.pop(),e.push(n.vs),r++;return r}var uc=function e(t,r,n,o){var i=t.children(r);var a=t.node(r);var s=a?a.borderLeft:void 0;var u=a?a.borderRight:void 0;var c={};s&&(i=ou.filter(i,function(e){return e!==s&&e!==u}));var l=oc(t,i);ou.forEach(l,function(r){if(t.children(r.v).length){var i=e(t,r.v,n,o);c[r.v]=i,ou.has(i,"barycenter")&&(a=r,s=i,ou.isUndefined(a.barycenter)?(a.barycenter=s.barycenter,a.weight=s.weight):(a.barycenter=(a.barycenter*a.weight+s.barycenter*s.weight)/(a.weight+s.weight),a.weight+=s.weight))}var a,s});var h=ic(l,n);!function(e,t){ou.forEach(e,function(e){e.vs=ou.flatten(e.vs.map(function(e){return t[e]?t[e].vs:e}),!0)})}(h,c);var f=ac(h,o);if(s&&(f.vs=ou.flatten([s,f.vs,u],!0),t.predecessors(s).length)){var d=t.node(t.predecessors(s)[0]),p=t.node(t.predecessors(u)[0]);ou.has(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+d.order+p.order)/(f.weight+2),f.weight+=2}return f};var cc=Ua.Graph,lc=function(e,t,r){var n=function(e){var t;for(;e.hasNode(t=ou.uniqueId("_root")););return t}(e),o=new cc({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(t){return e.node(t)});return ou.forEach(e.nodes(),function(i){var a=e.node(i),s=e.parent(i);(a.rank===t||a.minRank<=t&&t<=a.maxRank)&&(o.setNode(i),o.setParent(i,s||n),ou.forEach(e[r](i),function(t){var r=t.v===i?t.w:t.v,n=o.edge(r,i),a=ou.isUndefined(n)?0:n.weight;o.setEdge(r,i,{weight:e.edge(t).weight+a})}),ou.has(a,"minRank")&&o.setNode(i,{borderLeft:a.borderLeft[t],borderRight:a.borderRight[t]}))}),o};var hc=function(e,t,r){var n,o={};ou.forEach(r,function(r){for(var i,a,s=e.parent(r);s;){if((i=e.parent(s))?(a=o[i],o[i]=s):(a=n,n=s),a&&a!==s)return void t.setEdge(a,s);s=i}})};var fc=Ua.Graph,dc=function(e){var t=vu.maxRank(e),r=pc(e,ou.range(1,t+1),"inEdges"),n=pc(e,ou.range(t-1,-1,-1),"outEdges"),o=tc(e);vc(e,o);for(var i,a=Number.POSITIVE_INFINITY,s=0,u=0;u<4;++s,++u){gc(s%2?r:n,s%4>=2),o=vu.buildLayerMatrix(e);var c=rc(e,o);c<a&&(u=0,i=ou.cloneDeep(o),a=c)}vc(e,i)};function pc(e,t,r){return ou.map(t,function(t){return lc(e,t,r)})}function gc(e,t){var r=new fc;ou.forEach(e,function(e){var n=e.graph().root,o=uc(e,n,r,t);ou.forEach(o.vs,function(t,r){e.node(t).order=r}),hc(e,r,o.vs)})}function vc(e,t){ou.forEach(t,function(t){ou.forEach(t,function(t,r){e.node(t).order=r})})}var yc=Ua.Graph,mc=function(e){var t,r=vu.buildLayerMatrix(e),n=ou.merge(_c(e,r),bc(e,r)),o={};ou.forEach(["u","d"],function(i){t="u"===i?r:ou.values(r).reverse(),ou.forEach(["l","r"],function(r){"r"===r&&(t=ou.map(t,function(e){return ou.values(e).reverse()}));var a=("u"===i?e.predecessors:e.successors).bind(e),s=Ec(e,t,n,a),u=kc(e,t,s.root,s.align,"r"===r);"r"===r&&(u=ou.mapValues(u,function(e){return-e})),o[i+r]=u})});var i=Dc(e,o);return Sc(o,i),Cc(o,e.graph().align)};function _c(e,t){var r={};return ou.reduce(t,function(t,n){var o=0,i=0,a=t.length,s=ou.last(n);return ou.forEach(n,function(t,u){var c=function(e,t){if(e.node(t).dummy)return ou.find(e.predecessors(t),function(t){return e.node(t).dummy})}(e,t),l=c?e.node(c).order:a;(c||t===s)&&(ou.forEach(n.slice(i,u+1),function(t){ou.forEach(e.predecessors(t),function(n){var i=e.node(n),a=i.order;!(a<o||l<a)||i.dummy&&e.node(t).dummy||wc(r,n,t)})}),i=u+1,o=l)}),n}),r}function bc(e,t){var r={};function n(t,n,o,i,a){var s;ou.forEach(ou.range(n,o),function(n){s=t[n],e.node(s).dummy&&ou.forEach(e.predecessors(s),function(t){var n=e.node(t);n.dummy&&(n.order<i||n.order>a)&&wc(r,t,s)})})}return ou.reduce(t,function(t,r){var o,i=-1,a=0;return ou.forEach(r,function(s,u){if("border"===e.node(s).dummy){var c=e.predecessors(s);c.length&&(o=e.node(c[0]).order,n(r,a,u,i,o),a=u,i=o)}n(r,a,r.length,o,t.length)}),r}),r}function wc(e,t,r){if(t>r){var n=t;t=r,r=n}var o=e[t];o||(e[t]=o={}),o[r]=!0}function xc(e,t,r){if(t>r){var n=t;t=r,r=n}return ou.has(e[t],r)}function Ec(e,t,r,n){var o={},i={},a={};return ou.forEach(t,function(e){ou.forEach(e,function(e,t){o[e]=e,i[e]=e,a[e]=t})}),ou.forEach(t,function(e){var t=-1;ou.forEach(e,function(e){var s=n(e);if(s.length)for(var u=((s=ou.sortBy(s,function(e){return a[e]})).length-1)/2,c=Math.floor(u),l=Math.ceil(u);c<=l;++c){var h=s[c];i[e]===e&&t<a[h]&&!xc(r,e,h)&&(i[h]=e,i[e]=o[e]=o[h],t=a[h])}})}),{root:o,align:i}}function kc(e,t,r,n,o){var i={},a=function(e,t,r,n){var o=new yc,i=e.graph(),a=function(e,t,r){return function(n,o,i){var a,s=n.node(o),u=n.node(i),c=0;if(c+=s.width/2,ou.has(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":a=-s.width/2;break;case"r":a=s.width/2}if(a&&(c+=r?a:-a),a=0,c+=(s.dummy?t:e)/2,c+=(u.dummy?t:e)/2,c+=u.width/2,ou.has(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":a=u.width/2;break;case"r":a=-u.width/2}return a&&(c+=r?a:-a),a=0,c}}(i.nodesep,i.edgesep,n);return ou.forEach(t,function(t){var n;ou.forEach(t,function(t){var i=r[t];if(o.setNode(i),n){var s=r[n],u=o.edge(s,i);o.setEdge(s,i,Math.max(a(e,t,n),u||0))}n=t})}),o}(e,t,r,o),s=o?"borderLeft":"borderRight";function u(e,t){for(var r=a.nodes(),n=r.pop(),o={};n;)o[n]?e(n):(o[n]=!0,r.push(n),r=r.concat(t(n))),n=r.pop()}return u(function(e){i[e]=a.inEdges(e).reduce(function(e,t){return Math.max(e,i[t.v]+a.edge(t))},0)},a.predecessors.bind(a)),u(function(t){var r=a.outEdges(t).reduce(function(e,t){return Math.min(e,i[t.w]-a.edge(t))},Number.POSITIVE_INFINITY),n=e.node(t);r!==Number.POSITIVE_INFINITY&&n.borderType!==s&&(i[t]=Math.max(i[t],r))},a.successors.bind(a)),ou.forEach(n,function(e){i[e]=i[r[e]]}),i}function Dc(e,t){return ou.minBy(ou.values(t),function(t){var r=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY;return ou.forIn(t,function(t,o){var i=function(e,t){return e.node(t).width}(e,o)/2;r=Math.max(t+i,r),n=Math.min(t-i,n)}),r-n})}function Sc(e,t){var r=ou.values(t),n=ou.min(r),o=ou.max(r);ou.forEach(["u","d"],function(r){ou.forEach(["l","r"],function(i){var a,s=r+i,u=e[s];if(u!==t){var c=ou.values(u);(a="l"===i?n-ou.min(c):o-ou.max(c))&&(e[s]=ou.mapValues(u,function(e){return e+a}))}})})}function Cc(e,t){return ou.mapValues(e.ul,function(r,n){if(t)return e[t.toLowerCase()][n];var o=ou.sortBy(ou.map(e,n));return(o[1]+o[2])/2})}var Ac=mc,jc=function(e){(function(e){var t=vu.buildLayerMatrix(e),r=e.graph().ranksep,n=0;ou.forEach(t,function(t){var o=ou.max(ou.map(t,function(t){return e.node(t).height}));ou.forEach(t,function(t){e.node(t).y=n+o/2}),n+=o+r})})(e=vu.asNonCompoundGraph(e)),ou.forEach(Ac(e),function(t,r){e.node(r).x=t})};var Pc=vu.normalizeRanks,Fc=vu.removeEmptyRanks,Mc=vu,Oc=Ua.Graph,Nc=function(e,t){var r=t&&t.debugTiming?Mc.time:Mc.notime;r("layout",function(){var t=r(" buildLayoutGraph",function(){return function(e){var t=new Oc({multigraph:!0,compound:!0}),r=Hc(e.graph());return t.setGraph(ou.merge({},Tc,Gc(r,Ic),ou.pick(r,Lc))),ou.forEach(e.nodes(),function(r){var n=Hc(e.node(r));t.setNode(r,ou.defaults(Gc(n,Qc),Rc)),t.setParent(r,e.parent(r))}),ou.forEach(e.edges(),function(r){var n=Hc(e.edge(r));t.setEdge(r,ou.merge({},zc,Gc(n,Bc),ou.pick(n,Vc)))}),t}(e)});r(" runLayout",function(){!function(e,t){t(" makeSpaceForEdgeLabels",function(){!function(e){var t=e.graph();t.ranksep/=2,ou.forEach(e.edges(),function(r){var n=e.edge(r);n.minlen*=2,"c"!==n.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?n.width+=n.labeloffset:n.height+=n.labeloffset)})}(e)}),t(" removeSelfEdges",function(){!function(e){ou.forEach(e.edges(),function(t){if(t.v===t.w){var r=e.node(t.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}(e)}),t(" acyclic",function(){pu.run(e)}),t(" nestingGraph.run",function(){qu.run(e)}),t(" rank",function(){Gu(Mc.asNonCompoundGraph(e))}),t(" injectEdgeLabelProxies",function(){!function(e){ou.forEach(e.edges(),function(t){var r=e.edge(t);if(r.width&&r.height){var n=e.node(t.v),o=e.node(t.w),i={rank:(o.rank-n.rank)/2+n.rank,e:t};Mc.addDummyNode(e,"edge-proxy",i,"_ep")}})}(e)}),t(" removeEmptyRanks",function(){Fc(e)}),t(" nestingGraph.cleanup",function(){qu.cleanup(e)}),t(" normalizeRanks",function(){Pc(e)}),t(" assignRankMinMax",function(){!function(e){var t=0;ou.forEach(e.nodes(),function(r){var n=e.node(r);n.borderTop&&(n.minRank=e.node(n.borderTop).rank,n.maxRank=e.node(n.borderBottom).rank,t=ou.max(t,n.maxRank))}),e.graph().maxRank=t}(e)}),t(" removeEdgeLabelProxies",function(){!function(e){ou.forEach(e.nodes(),function(t){var r=e.node(t);"edge-proxy"===r.dummy&&(e.edge(r.e).labelRank=r.rank,e.removeNode(t))})}(e)}),t(" normalize.run",function(){_u.run(e)}),t(" parentDummyChains",function(){Wu(e)}),t(" addBorderSegments",function(){Yu(e)}),t(" order",function(){dc(e)}),t(" insertSelfEdges",function(){!function(e){var t=Mc.buildLayerMatrix(e);ou.forEach(t,function(t){var r=0;ou.forEach(t,function(t,n){var o=e.node(t);o.order=n+r,ou.forEach(o.selfEdges,function(t){Mc.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:o.rank,order:n+ ++r,e:t.e,label:t.label},"_se")}),delete o.selfEdges})})}(e)}),t(" adjustCoordinateSystem",function(){Xu.adjust(e)}),t(" position",function(){jc(e)}),t(" positionSelfEdges",function(){!function(e){ou.forEach(e.nodes(),function(t){var r=e.node(t);if("selfedge"===r.dummy){var n=e.node(r.e.v),o=n.x+n.width/2,i=n.y,a=r.x-o,s=n.height/2;e.setEdge(r.e,r.label),e.removeNode(t),r.label.points=[{x:o+2*a/3,y:i-s},{x:o+5*a/6,y:i-s},{x:o+a,y:i},{x:o+5*a/6,y:i+s},{x:o+2*a/3,y:i+s}],r.label.x=r.x,r.label.y=r.y}})}(e)}),t(" removeBorderNodes",function(){!function(e){ou.forEach(e.nodes(),function(t){if(e.children(t).length){var r=e.node(t),n=e.node(r.borderTop),o=e.node(r.borderBottom),i=e.node(ou.last(r.borderLeft)),a=e.node(ou.last(r.borderRight));r.width=Math.abs(a.x-i.x),r.height=Math.abs(o.y-n.y),r.x=i.x+r.width/2,r.y=n.y+r.height/2}}),ou.forEach(e.nodes(),function(t){"border"===e.node(t).dummy&&e.removeNode(t)})}(e)}),t(" normalize.undo",function(){_u.undo(e)}),t(" fixupEdgeLabelCoords",function(){!function(e){ou.forEach(e.edges(),function(t){var r=e.edge(t);if(ou.has(r,"x"))switch("l"!==r.labelpos&&"r"!==r.labelpos||(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset}})}(e)}),t(" undoCoordinateSystem",function(){Xu.undo(e)}),t(" translateGraph",function(){!function(e){var t=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,o=0,i=e.graph(),a=i.marginx||0,s=i.marginy||0;function u(e){var i=e.x,a=e.y,s=e.width,u=e.height;t=Math.min(t,i-s/2),r=Math.max(r,i+s/2),n=Math.min(n,a-u/2),o=Math.max(o,a+u/2)}ou.forEach(e.nodes(),function(t){u(e.node(t))}),ou.forEach(e.edges(),function(t){var r=e.edge(t);ou.has(r,"x")&&u(r)}),t-=a,n-=s,ou.forEach(e.nodes(),function(r){var o=e.node(r);o.x-=t,o.y-=n}),ou.forEach(e.edges(),function(r){var o=e.edge(r);ou.forEach(o.points,function(e){e.x-=t,e.y-=n}),ou.has(o,"x")&&(o.x-=t),ou.has(o,"y")&&(o.y-=n)}),i.width=r-t+a,i.height=o-n+s}(e)}),t(" assignNodeIntersects",function(){!function(e){ou.forEach(e.edges(),function(t){var r,n,o=e.edge(t),i=e.node(t.v),a=e.node(t.w);o.points?(r=o.points[0],n=o.points[o.points.length-1]):(o.points=[],r=a,n=i),o.points.unshift(Mc.intersectRect(i,r)),o.points.push(Mc.intersectRect(a,n))})}(e)}),t(" reversePoints",function(){!function(e){ou.forEach(e.edges(),function(t){var r=e.edge(t);r.reversed&&r.points.reverse()})}(e)}),t(" acyclic.undo",function(){pu.undo(e)})}(t,r)}),r(" updateInputGraph",function(){!function(e,t){ou.forEach(e.nodes(),function(r){var n=e.node(r),o=t.node(r);n&&(n.x=o.x,n.y=o.y,t.children(r).length&&(n.width=o.width,n.height=o.height))}),ou.forEach(e.edges(),function(r){var n=e.edge(r),o=t.edge(r);n.points=o.points,ou.has(o,"x")&&(n.x=o.x,n.y=o.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}(e,t)})})};var Ic=["nodesep","edgesep","ranksep","marginx","marginy"],Tc={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Lc=["acyclicer","ranker","rankdir","align"],Qc=["width","height"],Rc={width:0,height:0},Bc=["minlen","weight","width","height","labeloffset"],zc={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Vc=["labelpos"];function Gc(e,t){return ou.mapValues(ou.pick(e,t),Number)}function Hc(e){var t={};return ou.forEach(e,function(e,r){t[r.toLowerCase()]=e}),t}var Uc=Ua.Graph;var Wc={graphlib:Ua,layout:Nc,debug:{debugOrdering:function(e){var t=vu.buildLayerMatrix(e),r=new Uc({compound:!0,multigraph:!0}).setGraph({});return ou.forEach(e.nodes(),function(t){r.setNode(t,{label:t}),r.setParent(t,"layer"+e.node(t).rank)}),ou.forEach(e.edges(),function(e){r.setEdge(e.v,e.w,{},e.name)}),ou.forEach(t,function(e,t){var n="layer"+t;r.setNode(n,{rank:"same"}),ou.reduce(e,function(e,t){return r.setEdge(e,t,{style:"invis"}),t})}),r}},util:{time:vu.time,notime:vu.notime},version:"0.8.5"},qc=Wc.graphlib,Yc=Wc.layout,$c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t}(qc.Graph),Xc=function(){function e(){this._g=new $c({multigraph:!0,compound:!0}),this._g.setGraph({}),this._g.setDefaultNodeLabel(function(){return{debug:"error"}}),this._g.setDefaultEdgeLabel(function(){return{debug:"error"}})}return e.prototype.parent=function(e){return this._g.parent(e)},e.prototype.filterNodes=function(e){var t=[];return this.eachNode(function(r){e(r)&&t.push(r)}),t},e.prototype.eachNode=function(e){this._g.nodes().forEach(function(t){e(t,this.node(t))},this)},e.prototype.filterEdges=function(e){var t=[];return this.eachEdge(function(r){e(r)&&t.push(r)}),t},e.prototype.eachEdge=function(e){this._g.edges().forEach(function(t){e(t,t.v,t.w,this.edge(t))},this)},e.prototype.setData=function(e,t,r,n,o){for(var i=this,a={addedVertices:[],addedEdges:[]},s=e.concat(t),u=0;u<s.length;++u){var c=s[u];o&&this._g.hasNode(c._id)||(this._g.setNode(c._id,c),a.addedVertices.push(c))}for(u=0;u<r.length;++u){var l=r[u];o&&this._g.hasEdge(l._id)||(l._sourceVertex&&l._targetVertex?(this._g.setEdge(l._sourceVertex._id,l._targetVertex._id,l,l._id),a.addedEdges.push(l)):console.log("Bad edge definition"))}if(n)for(u=0;u<n.length;++u)this._g.setParent(n[u].child._id,n[u].parent._id);if(o){var h=r.map(function(e){return e._id});this.filterEdges(function(e){return h.indexOf(e.name)<0}).forEach(function(e){return i._g.removeEdge(e.v,e.w,e.name)});var f=s.map(function(e){return e._id});this.filterNodes(function(e){return f.indexOf(e)<0}).forEach(function(e){return i._g.removeNode(e)})}return a},e.prototype.node=function(e){return this._g.node(e)},e.prototype.nodeCount=function(){return this._g.nodeCount()},e.prototype.nodes=function(){var e=this;return this._g.nodes().map(function(t){return e._g.node(t)})},e.prototype.nodeEdges=function(e){return this._g.nodeEdges(e)},e.prototype.edge=function(e){return this._g.edge(e)},e.prototype.edges=function(){var e=this;return this._g.edges().map(function(t){return e._g.edge(t)})},e.prototype.neighbors=function(e){var t=this;return this._g.neighbors(e).map(function(e){return t._g.node(e)})},e.prototype.singleNeighbors=function(e){var t=this;return this._g.neighbors(e).filter(function(e){return 1===t._g.neighbors(e).length}).map(function(e){return t._g.node(e)})},e.prototype.gatherShortestPath=function(e,t){for(var r=[],n=t,o=e[n];o;){if(o.distance<1/0&&o.predecessor){var i=this._g.nodeEdges(n,o.predecessor)[0];r.push(this._g.edge(i))}o=e[n=o.predecessor]}return r},e.prototype.shortestPath=function(e,t){return this.gatherShortestPath(qc.alg.dijkstra(this._g,e),t)},e.prototype.undirectedShortestPath=function(e,t){var r=this;return this.gatherShortestPath(qc.alg.dijkstra(this._g,e,null,function(e){return r._g.nodeEdges(e)}),t)},e.prototype.getJSON=function(){var e=qc.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}," ")},e}();function Jc(e,t){var r;function n(){var n,o,i=r.length,a=0,s=0;for(n=0;n<i;++n)a+=(o=r[n]).x,s+=o.y;for(a=a/i-e,s=s/i-t,n=0;n<i;++n)(o=r[n]).x-=a,o.y-=s}return null==e&&(e=0),null==t&&(t=0),n.initialize=function(e){r=e},n.x=function(t){return arguments.length?(e=+t,n):e},n.y=function(e){return arguments.length?(t=+e,n):t},n}function Kc(e){return function(){return e}}function Zc(){return 1e-6*(Math.random()-.5)}function el(e,t,r,n){if(isNaN(t)||isNaN(r))return e;var o,i,a,s,u,c,l,h,f,d=e._root,p={data:n},g=e._x0,v=e._y0,y=e._x1,m=e._y1;if(!d)return e._root=p,e;for(;d.length;)if((c=t>=(i=(g+y)/2))?g=i:y=i,(l=r>=(a=(v+m)/2))?v=a:m=a,o=d,!(d=d[h=l<<1|c]))return o[h]=p,e;if(s=+e._x.call(null,d.data),u=+e._y.call(null,d.data),t===s&&r===u)return p.next=d,o?o[h]=p:e._root=p,e;do{o=o?o[h]=new Array(4):e._root=new Array(4),(c=t>=(i=(g+y)/2))?g=i:y=i,(l=r>=(a=(v+m)/2))?v=a:m=a}while((h=l<<1|c)==(f=(u>=a)<<1|s>=i));return o[f]=d,o[h]=p,e}function tl(e,t,r,n,o){this.node=e,this.x0=t,this.y0=r,this.x1=n,this.y1=o}function rl(e){return e[0]}function nl(e){return e[1]}function ol(e,t,r){var n=new il(null==t?rl:t,null==r?nl:r,NaN,NaN,NaN,NaN);return null==e?n:n.addAll(e)}function il(e,t,r,n,o,i){this._x=e,this._y=t,this._x0=r,this._y0=n,this._x1=o,this._y1=i,this._root=void 0}function al(e){for(var t={data:e.data},r=t;e=e.next;)r=r.next={data:e.data};return t}var sl=ol.prototype=il.prototype;function ul(e){return e.index}function cl(e,t){var r=e.get(t);if(!r)throw new Error("missing: "+t);return r}function ll(e){var r,n,o,i,a,s=ul,u=function(e){return 1/Math.min(i[e.source.index],i[e.target.index])},c=Kc(30),l=1;function h(t){for(var o=0,i=e.length;o<l;++o)for(var s,u,c,h,f,d,p,g=0;g<i;++g)u=(s=e[g]).source,h=(c=s.target).x+c.vx-u.x-u.vx||Zc(),f=c.y+c.vy-u.y-u.vy||Zc(),h*=d=((d=Math.sqrt(h*h+f*f))-n[g])/d*t*r[g],f*=d,c.vx-=h*(p=a[g]),c.vy-=f*p,u.vx+=h*(p=1-p),u.vy+=f*p}function f(){if(o){var u,c,l=o.length,h=e.length,f=t.map(o,s);for(u=0,i=new Array(l);u<h;++u)(c=e[u]).index=u,"object"!=typeof c.source&&(c.source=cl(f,c.source)),"object"!=typeof c.target&&(c.target=cl(f,c.target)),i[c.source.index]=(i[c.source.index]||0)+1,i[c.target.index]=(i[c.target.index]||0)+1;for(u=0,a=new Array(h);u<h;++u)c=e[u],a[u]=i[c.source.index]/(i[c.source.index]+i[c.target.index]);r=new Array(h),d(),n=new Array(h),p()}}function d(){if(o)for(var t=0,n=e.length;t<n;++t)r[t]=+u(e[t],t,e)}function p(){if(o)for(var t=0,r=e.length;t<r;++t)n[t]=+c(e[t],t,e)}return null==e&&(e=[]),h.initialize=function(e){o=e,f()},h.links=function(t){return arguments.length?(e=t,f(),h):e},h.id=function(e){return arguments.length?(s=e,h):s},h.iterations=function(e){return arguments.length?(l=+e,h):l},h.strength=function(e){return arguments.length?(u="function"==typeof e?e:Kc(+e),d(),h):u},h.distance=function(e){return arguments.length?(c="function"==typeof e?e:Kc(+e),p(),h):c},h}sl.copy=function(){var e,t,r=new il(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=al(n),r;for(e=[{source:n,target:r._root=new Array(4)}];n=e.pop();)for(var o=0;o<4;++o)(t=n.source[o])&&(t.length?e.push({source:t,target:n.target[o]=new Array(4)}):n.target[o]=al(t));return r},sl.add=function(e){var t=+this._x.call(null,e),r=+this._y.call(null,e);return el(this.cover(t,r),t,r,e)},sl.addAll=function(e){var t,r,n,o,i=e.length,a=new Array(i),s=new Array(i),u=1/0,c=1/0,l=-1/0,h=-1/0;for(r=0;r<i;++r)isNaN(n=+this._x.call(null,t=e[r]))||isNaN(o=+this._y.call(null,t))||(a[r]=n,s[r]=o,n<u&&(u=n),n>l&&(l=n),o<c&&(c=o),o>h&&(h=o));if(u>l||c>h)return this;for(this.cover(u,c).cover(l,h),r=0;r<i;++r)el(this,a[r],s[r],e[r]);return this},sl.cover=function(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var r=this._x0,n=this._y0,o=this._x1,i=this._y1;if(isNaN(r))o=(r=Math.floor(e))+1,i=(n=Math.floor(t))+1;else{for(var a,s,u=o-r,c=this._root;r>e||e>=o||n>t||t>=i;)switch(s=(t<n)<<1|e<r,(a=new Array(4))[s]=c,c=a,u*=2,s){case 0:o=r+u,i=n+u;break;case 1:r=o-u,i=n+u;break;case 2:o=r+u,n=i-u;break;case 3:r=o-u,n=i-u}this._root&&this._root.length&&(this._root=c)}return this._x0=r,this._y0=n,this._x1=o,this._y1=i,this},sl.data=function(){var e=[];return this.visit(function(t){if(!t.length)do{e.push(t.data)}while(t=t.next)}),e},sl.extent=function(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]]},sl.find=function(e,t,r){var n,o,i,a,s,u,c,l=this._x0,h=this._y0,f=this._x1,d=this._y1,p=[],g=this._root;for(g&&p.push(new tl(g,l,h,f,d)),null==r?r=1/0:(l=e-r,h=t-r,f=e+r,d=t+r,r*=r);u=p.pop();)if(!(!(g=u.node)||(o=u.x0)>f||(i=u.y0)>d||(a=u.x1)<l||(s=u.y1)<h))if(g.length){var v=(o+a)/2,y=(i+s)/2;p.push(new tl(g[3],v,y,a,s),new tl(g[2],o,y,v,s),new tl(g[1],v,i,a,y),new tl(g[0],o,i,v,y)),(c=(t>=y)<<1|e>=v)&&(u=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=u)}else{var m=e-+this._x.call(null,g.data),_=t-+this._y.call(null,g.data),b=m*m+_*_;if(b<r){var w=Math.sqrt(r=b);l=e-w,h=t-w,f=e+w,d=t+w,n=g.data}}return n},sl.remove=function(e){if(isNaN(i=+this._x.call(null,e))||isNaN(a=+this._y.call(null,e)))return this;var t,r,n,o,i,a,s,u,c,l,h,f,d=this._root,p=this._x0,g=this._y0,v=this._x1,y=this._y1;if(!d)return this;if(d.length)for(;;){if((c=i>=(s=(p+v)/2))?p=s:v=s,(l=a>=(u=(g+y)/2))?g=u:y=u,t=d,!(d=d[h=l<<1|c]))return this;if(!d.length)break;(t[h+1&3]||t[h+2&3]||t[h+3&3])&&(r=t,f=h)}for(;d.data!==e;)if(n=d,!(d=d.next))return this;return(o=d.next)&&delete d.next,n?(o?n.next=o:delete n.next,this):t?(o?t[h]=o:delete t[h],(d=t[0]||t[1]||t[2]||t[3])&&d===(t[3]||t[2]||t[1]||t[0])&&!d.length&&(r?r[f]=d:this._root=d),this):(this._root=o,this)},sl.removeAll=function(e){for(var t=0,r=e.length;t<r;++t)this.remove(e[t]);return this},sl.root=function(){return this._root},sl.size=function(){var e=0;return this.visit(function(t){if(!t.length)do{++e}while(t=t.next)}),e},sl.visit=function(e){var t,r,n,o,i,a,s=[],u=this._root;for(u&&s.push(new tl(u,this._x0,this._y0,this._x1,this._y1));t=s.pop();)if(!e(u=t.node,n=t.x0,o=t.y0,i=t.x1,a=t.y1)&&u.length){var c=(n+i)/2,l=(o+a)/2;(r=u[3])&&s.push(new tl(r,c,l,i,a)),(r=u[2])&&s.push(new tl(r,n,l,c,a)),(r=u[1])&&s.push(new tl(r,c,o,i,l)),(r=u[0])&&s.push(new tl(r,n,o,c,l))}return this},sl.visitAfter=function(e){var t,r=[],n=[];for(this._root&&r.push(new tl(this._root,this._x0,this._y0,this._x1,this._y1));t=r.pop();){var o=t.node;if(o.length){var i,a=t.x0,s=t.y0,u=t.x1,c=t.y1,l=(a+u)/2,h=(s+c)/2;(i=o[0])&&r.push(new tl(i,a,s,l,h)),(i=o[1])&&r.push(new tl(i,l,s,u,h)),(i=o[2])&&r.push(new tl(i,a,h,l,c)),(i=o[3])&&r.push(new tl(i,l,h,u,c))}n.push(t)}for(;t=n.pop();)e(t.node,t.x0,t.y0,t.x1,t.y1);return this},sl.x=function(e){return arguments.length?(this._x=e,this):this._x},sl.y=function(e){return arguments.length?(this._y=e,this):this._y};var hl,fl,dl=0,pl=0,gl=0,vl=1e3,yl=0,ml=0,_l=0,bl="object"==typeof performance&&performance.now?performance:Date,wl="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function xl(){return ml||(wl(El),ml=bl.now()+_l)}function El(){ml=0}function kl(){this._call=this._time=this._next=null}function Dl(e,t,r){var n=new kl;return n.restart(e,t,r),n}function Sl(){ml=(yl=bl.now())+_l,dl=pl=0;try{!function(){xl(),++dl;for(var e,t=hl;t;)(e=ml-t._time)>=0&&t._call.call(null,e),t=t._next;--dl}()}finally{dl=0,function(){var e,t,r=hl,n=1/0;for(;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:hl=t);fl=e,Al(n)}(),ml=0}}function Cl(){var e=bl.now(),t=e-yl;t>vl&&(_l-=t,yl=e)}function Al(e){dl||(pl&&(pl=clearTimeout(pl)),e-ml>24?(e<1/0&&(pl=setTimeout(Sl,e-bl.now()-_l)),gl&&(gl=clearInterval(gl))):(gl||(yl=bl.now(),gl=setInterval(Cl,vl)),dl=1,wl(Sl)))}function jl(e){return e.x}function Pl(e){return e.y}kl.prototype=Dl.prototype={constructor:kl,restart:function(e,t,r){if("function"!=typeof e)throw new TypeError("callback is not a function");r=(null==r?xl():+r)+(null==t?0:+t),this._next||fl===this||(fl?fl._next=this:hl=this,fl=this),this._call=e,this._time=r,Al()},stop:function(){this._call&&(this._call=null,this._time=1/0,Al())}};var Fl=10,Ml=Math.PI*(3-Math.sqrt(5));function Ol(e){var r,n=1,o=.001,i=1-Math.pow(o,1/300),a=0,s=.6,u=t.map(),c=Dl(h),l=t.dispatch("tick","end");function h(){f(),l.call("tick",r),n<o&&(c.stop(),l.call("end",r))}function f(t){var o,c,l=e.length;void 0===t&&(t=1);for(var h=0;h<t;++h)for(n+=(a-n)*i,u.each(function(e){e(n)}),o=0;o<l;++o)null==(c=e[o]).fx?c.x+=c.vx*=s:(c.x=c.fx,c.vx=0),null==c.fy?c.y+=c.vy*=s:(c.y=c.fy,c.vy=0);return r}function d(){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 o=Fl*Math.sqrt(r),i=r*Ml;t.x=o*Math.cos(i),t.y=o*Math.sin(i)}(isNaN(t.vx)||isNaN(t.vy))&&(t.vx=t.vy=0)}}function p(t){return t.initialize&&t.initialize(e),t}return null==e&&(e=[]),d(),r={tick:f,restart:function(){return c.restart(h),r},stop:function(){return c.stop(),r},nodes:function(t){return arguments.length?(e=t,d(),u.each(p),r):e},alpha:function(e){return arguments.length?(n=+e,r):n},alphaMin:function(e){return arguments.length?(o=+e,r):o},alphaDecay:function(e){return arguments.length?(i=+e,r):+i},alphaTarget:function(e){return arguments.length?(a=+e,r):a},velocityDecay:function(e){return arguments.length?(s=1-e,r):1-s},force:function(e,t){return arguments.length>1?(null==t?u.remove(e):u.set(e,p(t)),r):u.get(e)},find:function(t,r,n){var o,i,a,s,u,c=0,l=e.length;for(null==n?n=1/0:n*=n,c=0;c<l;++c)(a=(o=t-(s=e[c]).x)*o+(i=r-s.y)*i)<n&&(u=s,n=a);return u},on:function(e,t){return arguments.length>1?(l.on(e,t),r):l.on(e)}}}function Nl(){var e,t,r,n,o=Kc(-30),i=1,a=1/0,s=.81;function u(n){var o,i=e.length,a=ol(e,jl,Pl).visitAfter(l);for(r=n,o=0;o<i;++o)t=e[o],a.visit(h)}function c(){if(e){var t,r,i=e.length;for(n=new Array(i),t=0;t<i;++t)r=e[t],n[r.index]=+o(r,t,e)}}function l(e){var t,r,o,i,a,s=0,u=0;if(e.length){for(o=i=a=0;a<4;++a)(t=e[a])&&(r=Math.abs(t.value))&&(s+=t.value,u+=r,o+=r*t.x,i+=r*t.y);e.x=o/u,e.y=i/u}else{(t=e).x=t.data.x,t.y=t.data.y;do{s+=n[t.data.index]}while(t=t.next)}e.value=s}function h(e,o,u,c){if(!e.value)return!0;var l=e.x-t.x,h=e.y-t.y,f=c-o,d=l*l+h*h;if(f*f/s<d)return d<a&&(0===l&&(d+=(l=Zc())*l),0===h&&(d+=(h=Zc())*h),d<i&&(d=Math.sqrt(i*d)),t.vx+=l*e.value*r/d,t.vy+=h*e.value*r/d),!0;if(!(e.length||d>=a)){(e.data!==t||e.next)&&(0===l&&(d+=(l=Zc())*l),0===h&&(d+=(h=Zc())*h),d<i&&(d=Math.sqrt(i*d)));do{e.data!==t&&(f=n[e.data.index]*r/d,t.vx+=l*f,t.vy+=h*f)}while(e=e.next)}}return u.initialize=function(t){e=t,c()},u.strength=function(e){return arguments.length?(o="function"==typeof e?e:Kc(+e),c(),u):o},u.distanceMin=function(e){return arguments.length?(i=e*e,u):Math.sqrt(i)},u.distanceMax=function(e){return arguments.length?(a=e*e,u):Math.sqrt(a)},u.theta=function(e){return arguments.length?(s=e*e,u):Math.sqrt(s)},u}function Il(e,t,r,n){var o=this;this.pos={};n=n||(t<r?t-0:r-0)/2;var i=e.nodeCount(),a=-Math.PI/2,s=2*Math.PI/i;e.eachNode(function(e,i){var u=i.getBBox();o.pos[e]={x:i.fixed?i.x:t/2+Math.cos(a)*(n-0),y:i.fixed?i.y:r/2+Math.sin(a)*(n-0),width:u.width,height:u.height},a+=s})}function Tl(e,t,r,n){n=n||{};var o=this;this.pos={},this.vertices=[],this.vertexMap={},e.eachNode(function(t){var 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};o.vertices.push(i),o.vertexMap[t]=i}),this.edges=[],e.eachEdge(function(e,t,r){o.edges.push({source:t,target:r})});var i=ll().id(function(e){return e.id}).distance(n.linkDistance).strength(n.linkStrength),a=Nl().strength(function(e){var t=e.value.getBBox();return n.charge*Math.max(t.width,t.height)});if(this.force=Ol().force("link",i).force("charge",a).force("center",Jc(t/2,r/2)).velocityDecay(n.oneShot?.1:n.friction).nodes(this.vertices),i.links(this.edges),n.oneShot){this.force.restart();var s=e.nodeCount();s=Math.min(s*s,500);for(var u=0;u<s;++u)this.force.tick();this.force.stop()}}function Ll(e,t,r,n){var o=new qc.Graph({multigraph:!0,compound:!0}).setGraph(n).setDefaultNodeLabel(function(){return{}}).setDefaultEdgeLabel(function(){return{}});e.eachNode(function(t){var r=e.node(t).getBBox();o.setNode(t,{width:r.width,height:r.height})}),e.eachEdge(function(t,r,i){var a=e.edge(t);o.setEdge(r,i,{weight:a.weight()},a._id),n.digraph||o.setEdge(i,r,{weight:a.weight()},a._id)}),e.eachNode(function(t){o.setParent(t,e.parent(t))}),this.dagreLayout=Yc(o,{debugTiming:!1});var i=-o.graph().width/2,a=-o.graph().height/2;o.nodes().forEach(function(e){var n=o.node(e);n.x+=i+t/2,n.y+=a+r/2}),o.edges().forEach(function(e){for(var n=o.edge(e),s=0;s<n.points.length;++s)n.points[s].x+=i+t/2,n.points[s].y+=a+r/2}),this.digraph=o}Il.prototype.nodePos=function(e){return this.pos[e]},Il.prototype.edgePoints=function(e){return[]},Tl.prototype.nodePos=function(e){return this.vertexMap[e]},Tl.prototype.edgePoints=function(e){return[]},Ll.prototype.nodePos=function(e){return this.digraph.node(e)},Ll.prototype.edgePoints=function(e){return this.digraph.edge(e._sourceVertex.id(),e._targetVertex.id(),e._id).points};L(".graph_Subgraph .border{fill:none;stroke:#1f77b4;stroke-width:1px;pointer-events:none}.graph_Subgraph.selected>rect{stroke:red!important}");var Ql=14,Rl=18,Bl=function(e){function r(){var r=e.call(this)||this;return r._textWidget=(new t.Text).anchor("start").fontSize(Ql),r._buttonMin=(new t.Icon).diameter(Rl).shape_colorStroke("#1f77b4").shape_colorFill("#dcf1ff").image_colorFill("#1f77b4").on("click",function(){r.minClick()},!0).on("dblclick",function(){},!0),r._minState="normal",r}return s(r,e),r.prototype.minState=function(e){return arguments.length?(this._minState=e,this):this._minState},r.prototype.calcIcon=function(){switch(this._minState){case"normal":return"";case"partial":return""}},r.prototype.getBBox=function(e,t){var r=this.width(),n=this.height();return{x:-r/2,y:-n/2-Ql,width:r,height:n}},r.prototype.enter=function(t,r){e.prototype.enter.call(this,t,r),this._border=r.append("rect").attr("class","border"),this._textWidget.target(t),this._buttonMin.target(t)},r.prototype.update=function(r,n){e.prototype.update.call(this,r,n);var o=this.getBBox();this._border.attr("x",o.x).attr("y",o.y).attr("width",o.width).attr("height",o.height).style("fill",this.border_colorFill()).style("stroke",this.border_colorStroke()),this.border_colorFill_exists()&&!this.title_colorFill_exists()&&this.title_colorFill(t.Palette.textColor(this.border_colorFill())),this._textWidget.pos({x:o.x+4,y:o.y+Ql}).width(this.width()-8).text(this.showTitle()?this.title():"").render(),this._buttonMin.visible(this.showMinMax()).pos({x:o.x+o.width-(Rl/2+4),y:o.y+(Rl/2+4)}).faChar(this.calcIcon()).render()},r.prototype.exit=function(t,r){this._buttonMin.target(null),this._textWidget.target(null),this._border.remove(),e.prototype.exit.call(this,t,r)},r.prototype.intersection=function(e,t){var r=null;return[].forEach(function(e){(null===r||r.d>e.d)&&(r=e)}),r&&r.i?r.i:null},r.prototype.click=function(e){console.log("Clicked: "+e.id)},r.prototype.minClick=function(){switch(this._minState){case"normal":this._minState="partial";break;case"partial":this._minState="normal"}this._buttonMin.faChar(this.calcIcon()).render()},r}(t.SVGWidget);Bl.prototype._class+=" graph_Subgraph",Bl.prototype.publish("border_colorStroke",null,"html-color","Stroke Color",null,{optional:!0}),Bl.prototype.publish("border_colorFill",null,"html-color","Fill Color",null,{optional:!0}),Bl.prototype.publish("showTitle",!0,"boolean","Show Title",null,{tags:["Basic"]}),Bl.prototype.publish("title","","string","Title",null,{tags:["Basic"]}),Bl.prototype.publishProxy("titleFontSize","_textWidget","fontSize"),Bl.prototype.publishProxy("title_colorFill","_textWidget","colorFill"),Bl.prototype.publish("showMinMax",!1,"boolean","Show Min/Max",null,{tags:["Basic"]});L(".graph_Vertex.selected .common_Shape{stroke:red!important}");var zl=function(e){function r(){var r=e.call(this)||this;return r._icon=new t.Icon,r._textBox=new t.TextBox,r._annotationWidgets={},r.pos({x:void 0,y:void 0}),r}return s(r,e),r.prototype.getIconBBox=function(){var 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}},r.prototype.getBBox=function(e,t){var r=this.getIconBBox(),n=this._textBox.getBBox(!0),o=Math.min(r.x,n.x),i=Math.min(r.y,n.y);return{x:o,y:i,width:Math.max(r.x+r.width,n.x+n.width)-o,height:Math.max(r.y+r.height,n.y+n.height)-i}},r.prototype.enter=function(t,r){var n=this;e.prototype.enter.call(this,t,r),delete this._prevHash,this._icon.target(t),this._textBox.target(t),r.on("mouseover",function(e){return n.mouseover(e.data())}).on("mouseout",function(e){return n.mouseout(e.data())})},r.prototype.update=function(r,n){e.prototype.update.call(this,r,n);var o=this.hashSum();if(this._prevHash!==o){this._prevHash=o,n.classed("centroid",this.centroid()),n.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();var i=this.getIconBBox();this._icon.move(i);var a=this,s=n.selectAll(".annotation").data(this.annotationIcons()),u=s.enter().append("g").attr("class","annotation").each(function(e,r){a._annotationWidgets[r]=(new t.Icon).target(this).shape("square")}),c=this._textBox.getBBox(!0),l=c.width/2,h=c.height/2;u.merge(s).each(function(e,t){var r=a._annotationWidgets[t];for(var n in r.diameter(a.annotationDiameter()).shape_colorFill(a.textbox_shape_colorFill()).shape_colorStroke(a.textbox_shape_colorStroke()),e)r[n]?r[n](e[n]):window.__hpcc_debug&&console.log("Invalid annotation property: "+n);r.render();var o=r.getBBox(!0);r.move({x:l-o.width/2+4,y:h+o.height/2-4}),l-=o.width+a.annotationSpacing()}),s.exit().each(function(e,r){var n=t.select(this);a._annotationWidgets[r].target(null),delete a._annotationWidgets[r],n.remove()})}},r.prototype.exit=function(t,r){for(var n in this._annotationWidgets)this._annotationWidgets[n].target(null);this._icon.target(null),this._textBox.target(null),e.prototype.exit.call(this,t,r)},r.prototype.contains=function(e){return this._icon.contains(e)||this._textBox.contains(e)},r.prototype.intersection=function(e,t){var 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},r.prototype.mouseover=function(e){},r.prototype.mouseout=function(e){},r}(t.SVGWidget);zl.prototype._class+=" graph_Vertex",zl.prototype.publishProxy("faChar","_icon"),zl.prototype.publishProxy("imageUrl","_icon"),zl.prototype.publishProxy("icon_diameter","_icon","diameter"),zl.prototype.publishProxy("icon_paddingPercent","_icon","paddingPercent"),zl.prototype.publishProxy("icon_shape_colorFill","_icon","shape_colorFill"),zl.prototype.publishProxy("icon_shape_colorStroke","_icon","shape_colorStroke"),zl.prototype.publishProxy("icon_image_colorFill","_icon","image_colorFill"),zl.prototype.publishProxy("icon_fontFamily","_icon","fontFamily"),zl.prototype.publish("centroid",!1,"boolean","Centroid Vertex"),zl.prototype.publishProxy("text","_textBox"),zl.prototype.publishProxy("anchor","_textBox"),zl.prototype.publishProxy("textbox_shape_colorStroke","_textBox","shape_colorStroke"),zl.prototype.publishProxy("textbox_shape_colorFill","_textBox","shape_colorFill"),zl.prototype.publishProxy("textbox_text_colorFill","_textBox","text_colorFill"),zl.prototype.publishProxy("textbox_text_fontFamily","_textBox","text_fontFamily"),zl.prototype.publish("iconAnchor","start","set","Horizontal anchor position of icon",["","start","middle","end","left"],{tags:["Basic"]}),zl.prototype.publish("iconTooltip","","string","iconTooltip",null,{tags:["Private"]}),zl.prototype.publish("tooltip","","string","Tooltip",null,{tags:["Private"]}),zl.prototype.publish("annotationDiameter",14,"number","Annotation Diameter",null,{tags:["Private"]}),zl.prototype.publish("annotationSpacing",3,"number","Annotation Spacing",null,{tags:["Private"]}),zl.prototype.publish("annotationIcons",[],"array","Annotations",null,{tags:["Private"]});L(".graph_Graph .marker{fill:#656565;stroke:none;stroke-width:1px}.graph_Graph .zoom{fill:none;pointer-events:all}.graph_Graph .selectionBrush{fill:none;stroke:#a9a9a9}.graph_Graph .graphEdge.shortest-path .graph_Edge{stroke:red}");var Vl=function(e){function r(){var r=e.call(this)||this;r._toggleHierarchy=(new t.ToggleButton).faChar("fa-sitemap").tooltip("Hierarchy").on("click",function(){return r.layoutClick("Hierarchy")}),r._toggleForceDirected=(new t.ToggleButton).faChar("fa-expand").tooltip("Force Directed").on("click",function(){return r.layoutClick("ForceDirected")}),r._toggleForceDirected2=(new t.ToggleButton).faChar("fa-arrows").tooltip("Spring").on("click",function(){return r.layoutClick("ForceDirected2")}),r._toggleCircle=(new t.ToggleButton).faChar("fa-circle-o").tooltip("Circle").on("click",function(){return r.layoutClick("Circle")}),r._dataHash=0,r._neighborOffsets=[],n.IGraph.call(r),n.ITooltip.call(r),r.tooltipHTML(function(e){var t;return e instanceof Bl?t=e.title().replace(/\n/g,"<br>"):(e instanceof zl||e instanceof R)&&(t=e.text().replace(/\n/g,"<br>")),t?'<p style="text-align:center">'+t+"</p>":null}),r._drawStartPos="origin";var o=[r._toggleHierarchy,r._toggleForceDirected,r._toggleForceDirected2,r._toggleCircle,new t.Spacer];return r._iconBar.buttons(o.concat(r._iconBar.buttons())),r._graphData=new Xc,r.highlight={zoom:1.1,opacity:.33,edge:"1.25px"},r._selection=new t.Utility.Selection(r),r.zoomToFitLimit(1),r}return s(r,e),r.prototype.iconBarButtons=function(){return this._iconBar.buttons()},r.prototype.layoutClick=function(e){var t=this;this.layout(e),"ForceDirected2"!==e&&this.applyScaleOnLayout(!0),this.layout(e).render(function(e){t.applyScaleOnLayout(!1)})},r.prototype.getOffsetPos=function(){return{x:0,y:0}},r.prototype.size=function(t){return e.prototype.size.apply(this,arguments)},r.prototype.clear=function(){this.data({subgraphs:[],vertices:[],edges:[],hierarchy:[]},!1)},r.prototype.data=function(t,r){var n=e.prototype.data.apply(this,arguments);if(arguments.length){r||(this._graphData=new Xc,this._renderCount=0);var o=this._graphData.setData(t.subgraphs||[],t.vertices||[],t.edges||[],t.hierarchy||[],r||!1);o.addedVertices.length&&this._dataHash++;var i=this;o.addedVertices.forEach(function(e){e._graphID=i._id}),o.addedEdges.forEach(function(e){e._graphID=i._id});var a={};this._graphData.edges().forEach(function(e){a[e._sourceVertex._id]||(a[e._sourceVertex._id]={}),a[e._sourceVertex._id][e._targetVertex._id]||(a[e._sourceVertex._id][e._targetVertex._id]=0);var t=++a[e._sourceVertex._id][e._targetVertex._id];e.arcDepth(16*t)})}return n},r.prototype.graphData=function(){return this._graphData},r.prototype.selection=function(e){return arguments.length?(this._selection.set(e),this):this._selection.get()},r.prototype.linkcolor_default=function(e){return arguments.length?(this._linkcolor=e,this):this._linkcolor},r.prototype.linktooltip_default=function(e){return arguments.length?(this._linktooltip=e,this):this._linktooltip},r.prototype.dragstart=function(e){var r=this;if(this.allowDragging()){var n=t.d3Event();if(n.sourceEvent.stopPropagation(),e.__drag_dx=n.x-e.x(),e.__drag_dy=n.y-e.y(),this._dragging=!0,this.forceLayout){n.active||this.forceLayout.force.alphaTarget(.3).restart();var o=this.forceLayout.vertexMap[e.id()];o.fixed=!0,o.fx=o.x,o.fy=o.y}this._neighborOffsets=[],this.dragSingleNeighbors()&&(this._neighborOffsets=this._graphData.singleNeighbors(e.id()).map(function(r){return t.select(r.target()).raise(),{neighbor:r,offsetX:e.x()-r.x(),offsetY:e.y()-r.y()}}));for(var i=e.target(),a=i.nextSibling;a;)i.parentNode.insertBefore(a,i),a=i.nextSibling;t.Platform.svgMarkerGlitch&&this._graphData.nodeEdges(e.id()).forEach(function(e){var t=r._graphData.edge(e);r._pushMarkers(t.element())})}},r.prototype.dragging=function(e){var r=this;if(this.allowDragging()){var n=t.d3Event();if(n.sourceEvent.stopPropagation(),e.move({x:n.x-e.__drag_dx,y:n.y-e.__drag_dy}),this.forceLayout){var o=this.forceLayout.vertexMap[e.id()];o.fixed=!0,o.fx=n.x-e.__drag_dx,o.fy=n.y-e.__drag_dy}this._neighborOffsets.forEach(function(t){var o=n.x-e.__drag_dx-t.offsetX,i=n.y-e.__drag_dy-t.offsetY;if(r.forceLayout){var a=r.forceLayout.vertexMap[t.neighbor.id()];a.fixed=!0,a.fx=o,a.fy=i}t.neighbor.move({x:o,y:i})}),this.refreshIncidentEdges(e,!0)}},r.prototype.dragend=function(e){var r=this;if(this.allowDragging()){if(t.d3Event().sourceEvent.stopPropagation(),this._dragging=!1,this.snapToGrid()){var n=e.calcSnap(this.snapToGrid());e.move(n[0]),this.refreshIncidentEdges(e,!0)}if(this.forceLayout){var o=this.forceLayout.vertexMap[e.id()];o.fixed=!1,o.fx=null,o.fy=null,this._neighborOffsets.forEach(function(e){var t=r.forceLayout.vertexMap[e.neighbor.id()];t.fixed=!1,t.fx=null,t.fy=null})}this._neighborOffsets=[],t.Platform.svgMarkerGlitch&&this._graphData.nodeEdges(e.id()).forEach(function(e){var t=this._graphData.edge(e);this._popMarkers(t.element())})}},r.prototype.enter=function(r,n){var o=this;e.prototype.enter.call(this,r,n),this._zoomGrab.on("click.clear",function(){o.selectionClearOnBackgroundClick()&&o._selection.clear()}),this._d3Drag=t.drag().on("start",function(e){return o.dragstart(e)}).on("end",function(e){return o.dragend(e)}).on("drag",function(e){return o.dragging(e)}),this.defs=this._renderElement.append("defs"),this.addMarkers(),this._centroidFilter=new t.SVGGlowFilter(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")},r.prototype.getBounds=function(e,t){var r=[[null,null],[null,null]];return e.forEach(function(e){var n=t?t.nodePos(e._id):{x:e.x(),y:e.y(),width:e.width(),height:e.height()},o=n.x-n.width/2,i=n.x+n.width/2,a=n.y-n.height/2,s=n.y+n.height/2;(null===r[0][0]||r[0][0]>o)&&(r[0][0]=o),(null===r[0][1]||r[0][1]>a)&&(r[0][1]=a),(null===r[1][0]||r[1][0]<i)&&(r[1][0]=i),(null===r[1][1]||r[1][1]<s)&&(r[1][1]=s)}),r},r.prototype.getVertexBounds=function(e){return this.getBounds(this._graphData.nodes(),e)},r.prototype.getSelectionBounds=function(e){return this.getBounds(this._selection.get(),e)},r.prototype.centerOnItem=function(e){var t=e.getBBox(!0),r=t.x+t.width/2,n=t.y+t.height/2,o={x:e.x()+r-t.width/2,y:e.y()+n-t.height/2,width:t.width,height:t.height};this.centerOnBBox(o)},r.prototype.zoomToItem=function(e){var t=e.getBBox(!0),r=t.x+t.width/2,n=t.y+t.height/2,o={x:e.x()+r-t.width/2,y:e.y()+n-t.height/2,width:t.width,height:t.height};this.zoomToBBox(o)},r.prototype.updateVertices=function(e,r,n){var o=this.width(),i=this.height(),a=this,s=e.selectAll("#"+this._id+r+" > .graphVertex").data(n,function(e){return e.id()});s.enter().append("g").attr("class","graphVertex").style("opacity",1e-6).on("click.selectionBag",function(e){a._selection.click(e,t.d3Event()),a.selectionChanged()}).on("click",function(e){var r=t.select(this).select(".graph_Vertex"),n=!1;r.empty()||(n=r.classed("selected")),a.vertex_click(a.rowToObj(e.data()),"",n,{vertex:e})}).on("dblclick",function(e){t.d3Event().stopPropagation();var r=t.select(this).select(".graph_Vertex"),n=!1;r.empty()||(n=r.classed("selected")),a.vertex_dblclick(a.rowToObj(e.data()),"",n,{vertex:e})}).on("contextmenu",function(e){var r=t.select(this).select(".graph_Vertex"),n=!1;r.empty()||(n=r.classed("selected")),a.vertex_contextmenu(a.rowToObj(e.data()),"",n,{vertex:e})}).on("mouseout.tooltip",this.tooltip.hide).on("mousemove.tooltip",this.tooltip.show).on("mouseover",function(e){a._dragging||a.vertex_mouseover(t.select(this),e)}).on("mouseout",function(e){a._dragging||a.vertex_mouseout(t.select(this),e)}).each(function(e){t.select(this).style("cursor",a.allowDragging()?"move":"pointer"),e.target(this).pos({x:e.x()||o/2,y:e.y()||i/2}).animationFrameRender(),a.allowDragging()&&t.select(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()){var t=e.calcSnap(a.snapToGrid());e.pos(t[0]).size(t[1]).render(),a.refreshIncidentEdges(e,!1)}}))}).transition().duration(750).style("opacity",1),s.each(function(e){e.animationFrameRender()}),s.exit().each(function(e){e.target(null)}).remove(),s.order()},r.prototype.update=function(r,n){var o=this;e.prototype.update.call(this,r,n),this.tooltip.hide(),this._centroidFilter.update(this.centroidColor());var i=this.layout();this._toggleHierarchy.selected("Hierarchy"===i).render(),this._toggleForceDirected.selected("ForceDirected"===i).render(),this._toggleForceDirected2.selected("ForceDirected2"===i).render(),this._toggleCircle.selected("Circle"===i).render();var a=this;this.updateVertices(this.svgC,"C",this._graphData.nodes().filter(function(e){return"Hierarchy"===o.layout()&&e instanceof Bl})),this.updateVertices(this.svgV,"V",this._graphData.nodes().filter(function(e){return!(e instanceof Bl)}));var s=this.svgE.selectAll("#"+this._id+"E > .graphEdge").data(this.showEdges()?this._graphData.edges():[],function(e){return e.id()});s.enter().append("g").attr("class","graphEdge").style("opacity",1e-6).on("click.selectionBag",function(e){a._selection.click(e,t.d3Event())}).on("click",function(e){var r=t.select(this).select(".graph_Edge"),n=!1;r.empty()||(n=r.classed("selected")),a.edge_click(a.rowToObj(e.data()),"",n,{edge:e})}).on("dblclick",function(e){var r=t.select(this).select(".graph_Edge"),n=!1;r.empty()||(n=r.classed("selected")),a.edge_dblclick(a.rowToObj(e.data()),"",n,{edge:e})}).on("mouseout.tooltip",this.tooltip.hide).on("mousemove.tooltip",this.tooltip.show).on("mouseover",function(e){a._dragging||a.edge_mouseover(t.select(this),e)}).on("mouseout",function(e){a._dragging||a.edge_mouseout(t.select(this),e)}).each(function(e){e.target(this).animationFrameRender()}).transition().duration(750).style("opacity",1),s.each(function(e){e.animationFrameRender()}),s.exit().each(function(e){e.target(null)}).remove(),this._renderCount||(this._renderCount++,this.layout(this.layout()))},r.prototype.exit=function(t,r){this._graphData.nodes().forEach(function(e){return e.target(null)}),this._graphData.edges().forEach(function(e){return e.target(null)}),e.prototype.exit.call(this,t,r)},r.prototype.render=function(t){var r=this;return this.progress("start"),e.prototype.render.call(this,function(e){r.doLayout().then(function(){r.progress("end"),t&&t(e)})}),this},r.prototype.doLayout=function(e){var t=this;return void 0===e&&(e=0),new Promise(function(r,n){requestAnimationFrame(function(){t._prevLayout!==t.layout()||t._prevDataHash!==t._dataHash?(t._prevLayout=t.layout(),t._prevDataHash=t._dataHash,t._doLayout(e).then(function(){r()})):r()})})},r.prototype._doLayout=function(e){var t=this;return void 0===e&&(e=0),new Promise(function(n,o){t.progress("layout-start"),t.forceLayout&&(t.forceLayout.force.stop(),t.forceLayout=null);var i=t,a=t.getLayoutEngine();if("ForceDirected2"===t.layout()){var s=0,u=0;t.forceLayout=a,t.forceLayout.force.on("tick",function(){var e=performance.now();i.progress("layout-tick"),a.vertices.forEach(function(e){if(e.fixed);else{var t=i._graphData.node(e.id);t&&t.move({x:e.x,y:e.y})}}),i._graphData.edges().forEach(function(e){e.points([],!1,!1)}),i.applyScaleOnLayout(),s+=performance.now()-e,++u,console.log("tick:"+s/u)}).on("end",function(){i.progress("layout-end")}),t.forceLayout.force.restart(),n()}else a&&(t.forceLayout=null,i._dragging=!0,i._graphData.nodes().forEach(function(e){var t=a.nodePos(e._id);e instanceof r.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)}),i._graphData.edges().forEach(function(t){var r=a.edgePoints(t);t.points(r,e)}),i.applyScaleOnLayout()&&requestAnimationFrame(function(){i.zoomToFit(),n()}),t._fixIEMarkers(),setTimeout(function(){i._dragging=!1},e?e+50:50),t.progress("layout-end"),i.applyScaleOnLayout()||n())})},r.prototype.getLayoutEngine=function(){switch(this.layout()){case"Circle":return new Il(this._graphData,this._size.width,this._size.height);case"ForceDirected":return new Tl(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 Tl(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 Ll(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},r.prototype.getNeighborMap=function(e){var t={},r={};if(e)for(var n=this._graphData.nodeEdges(e.id()),o=0;o<n.length;++o){var i=this._graphData.edge(n[o]);r[i.id()]=i,i._sourceVertex.id()!==e.id()&&(t[i._sourceVertex.id()]=i._sourceVertex),i._targetVertex.id()!==e.id()&&(t[i._targetVertex.id()]=i._targetVertex)}return{vertices:t,edges:r}},r.prototype.highlightVerticies=function(e){var t=this,r=this;return this.svgV.selectAll(".graphVertex").classed("graphVertex-highlighted",function(t){return!e||e[t.id()]}).style("filter",function(r){return e&&e[r.id()]?"url(#"+t.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(t){return!e||e[t.id()]?1:r.highlight.opacity}),this},r.prototype.highlightEdges=function(e){var 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},r.prototype.highlightVertex=function(e,t){if(this.highlightOnMouseOverVertex())if(t){var r=this.getNeighborMap(t);r.vertices[t.id()]=t,this.highlightVerticies(r.vertices),this.highlightEdges(r.edges)}else this.highlightVerticies(null),this.highlightEdges(null)},r.prototype.highlightEdge=function(e,t){if(this.highlightOnMouseOverEdge())if(t){var r={};r[t._sourceVertex.id()]=t._sourceVertex,r[t._targetVertex.id()]=t._targetVertex;var n={};n[t.id()]=t,this.highlightVerticies(r),this.highlightEdges(n)}else this.highlightVerticies(null),this.highlightEdges(null)},r.prototype.refreshIncidentEdges=function(e,t){var r=this;this._graphData.nodeEdges(e.id()).forEach(function(e){r._graphData.edge(e).points([],!1,t)})},r.prototype.centroids=function(){return this._graphData.nodes().filter(function(e){return e.centroid()})},r.prototype.selectionChanged=function(){var e=this;if(this.highlightSelectedPathToCentroid()){var t={};this.centroids().forEach(function(r){e.selection().forEach(function(n){e._graphData.undirectedShortestPath(r.id(),n.id()).forEach(function(e){t[e.id()]=!0})})}),this.svgE.selectAll(".graphEdge").classed("shortest-path",function(e){return!0===t[e.id()]})}},r.prototype.vertex_click=function(e,t,r,o){o&&o.vertex&&o.vertex._placeholderElement.node().parentNode.appendChild(o.vertex._placeholderElement.node()),n.IGraph.prototype.vertex_click.apply(this,arguments)},r.prototype.vertex_dblclick=function(e,t,r,n){},r.prototype.vertex_contextmenu=function(e,t,r,n){},r.prototype.vertex_mouseover=function(e,t){this.highlightVertex(e,t)},r.prototype.vertex_mouseout=function(e,t){this.highlightVertex(null,null)},r.prototype.edge_mouseover=function(e,t){this.highlightEdge(e,t)},r.prototype.edge_mouseout=function(e,t){this.highlightEdge(null,null)},r.prototype.addMarkers=function(e){void 0===e&&(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)},r.prototype.progress=function(e){},r.Subgraph=Bl,r.Vertex=zl,r.Edge=R,r.profileID=0,r}(t.SVGZoomWidget);Vl.prototype._class+=" graph_Graph",Vl.prototype.implements(n.IGraph.prototype),Vl.prototype.implements(n.ITooltip.prototype),Vl.prototype.publish("allowDragging",!0,"boolean","Allow Dragging of Vertices",null,{tags:["Advanced"]}),Vl.prototype.publish("dragSingleNeighbors",!1,"boolean","Dragging a Vertex also moves its singleton neighbors",null,{tags:["Advanced"]}),Vl.prototype.publish("layout","Circle","set","Default Layout",["Circle","ForceDirected","ForceDirected2","Hierarchy","None"],{tags:["Basic"]}),Vl.prototype.publish("scale","100%","set","Zoom Level",["all","width","selection","100%","90%","75%","50%","25%","10%"],{tags:["Basic"]}),Vl.prototype.publish("applyScaleOnLayout",!1,"boolean","Shrink to fit on Layout",null,{tags:["Basic"]}),Vl.prototype.publish("highlightOnMouseOverVertex",!1,"boolean","Highlight Vertex on Mouse Over",null,{tags:["Basic"]}),Vl.prototype.publish("highlightOnMouseOverEdge",!1,"boolean","Highlight Edge on Mouse Over",null,{tags:["Basic"]}),Vl.prototype.publish("transitionDuration",250,"number","Transition Duration",null,{tags:["Intermediate"]}),Vl.prototype.publish("showEdges",!0,"boolean","Show Edges",null,{tags:["Intermediate"]}),Vl.prototype.publish("snapToGrid",0,"number","Snap to Grid",null,{tags:["Private"]}),Vl.prototype.publish("selectionClearOnBackgroundClick",!1,"boolean","Clear selection on background click"),Vl.prototype.publish("centroidColor","#00A000","html-color","Centroid Color",null,{tags:["Basic"]}),Vl.prototype.publish("highlightSelectedPathToCentroid",!1,"boolean","Highlight path to Center Vertex (for selected vertices)",null,{tags:["Basic"]}),Vl.prototype.publish("hierarchyRankDirection","TB","set","Direction for Rank Nodes",["TB","BT","LR","RL"],{tags:["Advanced"]}),Vl.prototype.publish("hierarchyNodeSeparation",50,"number","Number of pixels that separate nodes horizontally in the layout",null,{tags:["Advanced"]}),Vl.prototype.publish("hierarchyEdgeSeparation",10,"number","Number of pixels that separate edges horizontally in the layout",null,{tags:["Advanced"]}),Vl.prototype.publish("hierarchyRankSeparation",50,"number","Number of pixels between each rank in the layout",null,{tags:["Advanced"]}),Vl.prototype.publish("hierarchyDigraph",!0,"boolean","Directional Graph",null,{tags:["Advanced"]}),Vl.prototype.publish("forceDirectedLinkDistance",300,"number","Target distance between linked nodes",null,{tags:["Advanced"]}),Vl.prototype.publish("forceDirectedLinkStrength",1,"number","Strength (rigidity) of links",null,{tags:["Advanced"]}),Vl.prototype.publish("forceDirectedFriction",.9,"number","Friction coefficient",null,{tags:["Advanced"]}),Vl.prototype.publish("forceDirectedCharge",-25,"number","Charge strength ",null,{tags:["Advanced"]}),Vl.prototype.publish("forceDirectedChargeDistance",1e4,"number","Maximum distance over which charge forces are applied",null,{tags:["Advanced"]}),Vl.prototype.publish("forceDirectedTheta",.8,"number","Barnes–Hut approximation criterion",null,{tags:["Advanced"]}),Vl.prototype.publish("forceDirectedGravity",.1,"number","Gravitational strength",null,{tags:["Advanced"]});var Gl=Vl.prototype.scale;Vl.prototype.scale=function(e,t){var r=Gl.apply(this,arguments);return arguments.length&&this.zoomTo(e,t),r};var Hl=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t.prototype.owner=function(e){return arguments.length?(this._owner=e,this):this._owner},t.prototype.valid=function(){return!!this.iconColumn()},t.prototype.indexes=function(){var 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())}},t.prototype.mapper=function(){var e=this,t=this.indexes();return function(r){return{faChar:r[t.iconCol],tooltip:r[t.tooltipCol],shape_colorFill:r[t.shapeFillCol]||e.shapeFillDefault(),shape_colorStroke:r[t.shapeStrokeCol]||e.shapeStrokeDefault(),image_colorFill:r[t.iconFillCol]||e.iconFillDefault()}}},t}(t.PropertyExt);Hl.prototype._class+=" graph_Annotation",Hl.prototype.publish("iconColumn","","set","Icon column",function(){return this._owner.columns()},{optional:!0}),Hl.prototype.publish("iconFillDefault","white","html-color","Icon fill default color"),Hl.prototype.publish("iconFillColumn","","set","Icon fill color column",function(){return this._owner.columns()},{optional:!0}),Hl.prototype.publish("tooltipColumn","","set","Tooltip column",function(){return this._owner.columns()},{optional:!0}),Hl.prototype.publish("shapeStrokeDefault","darkred","html-color","Shape stroke default color"),Hl.prototype.publish("shapeStrokeColumn","","set","Shape stroke color column",function(){return this._owner.columns()},{optional:!0}),Hl.prototype.publish("shapeFillDefault","red","html-color","Shape fill default color"),Hl.prototype.publish("shapeFillColumn","","set","Shape fill color column",function(){return this._owner.columns()},{optional:!0});var Ul=function(e){function t(){var t=e.call(this)||this;return t._vertexMap={},t._edgeMap={},t._merge=!1,t._adjacencyData=[],t}return s(t,e),t.prototype.linksColumns=function(){var e=this.columns().indexOf(this.linksColumn()),t=this._db.field(e);return t?t.children().map(function(e){return e.label()}):[]},t.prototype.validAnnotations=function(){return this.annotations().filter(function(e){return e.valid()})},t.prototype.updateData=function(){var t=this,n=r.hashSum([this._adjacencyData,this.uidColumn(),this.labelColumn(),this.iconColumn(),this.linksColumn(),this.linkUidColumn(),this.linkLabelColumn(),this.validAnnotations().map(function(e){return e.hashSum()})]);if(this._prevAdjacencyDataHash!==n){this._prevAdjacencyDataHash=n;for(var o=this.columns(),i=o.indexOf(this.uidColumn()),a=o.indexOf(this.labelColumn()),s=o.indexOf(this.iconColumn()),u=o.indexOf(this.linksColumn()),c=this.linksColumns(),l=c.indexOf(this.linkUidColumn()),h=c.indexOf(this.linkLabelColumn()),f=this.validAnnotations().map(function(e){return e.mapper()}),d={},p={},g={vertices:this._adjacencyData.map(function(e){var r=e[i];if(void 0!==r){var n=d[r]||t._vertexMap[r];return n||(n=new zl),d[r]=n,n.text(e[a]).data(e).faChar(e[s]).annotationIcons(f.map(function(t){return t(e)})),n}}).filter(function(e){return!!e}),edges:[]},v=0,y=this._adjacencyData;v<y.length;v++){var m=y[v],_=m[i],b=m[u];if(void 0!==_&&void 0!==b)for(var w=0,x=b;w<x.length;w++){var E=x[w],k=E[l],D=E[h],S=_+"->"+k,C=p[S]||this._edgeMap[S];C||(d[_]&&d[k]?C=(new R).sourceVertex(d[_]).targetVertex(d[k]).data(E):console.log("Missing vertices for edge: "+S)),C&&(C.text(D),p[S]=C,g.edges.push(C))}}this._vertexMap=d,this._edgeMap=p,e.prototype.data.call(this,g,this._merge)}},t.prototype.data=function(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.")},t.prototype.update=function(t,r){this.updateData(),e.prototype.update.call(this,t,r)},t.prototype.click=function(e,t,r){console.log("click")},t}(Vl);function Wl(e,t){return e.sourceLinks.length?e.depth:t-1}function ql(e){return function(){return e}}function Yl(e,t){return Xl(e.source,t.source)||e.index-t.index}function $l(e,t){return Xl(e.target,t.target)||e.index-t.index}function Xl(e,t){return e.y0-t.y0}function Jl(e){return e.value}function Kl(e){return e.index}function Zl(e){return e.nodes}function eh(e){return e.links}function th(e,t){const r=e.get(t);if(!r)throw new Error("missing: "+t);return r}function rh({nodes:e}){for(const t of e){let e=t.y0,r=e;for(const r of t.sourceLinks)r.y0=e+r.width/2,e+=r.width;for(const e of t.targetLinks)e.y1=r+e.width/2,r+=e.width}}function nh(){let e,r,n,o=0,i=0,a=1,s=1,u=24,c=8,l=Kl,h=Wl,f=Zl,d=eh,p=6;function g(){const g={nodes:f.apply(null,arguments),links:d.apply(null,arguments)};return function({nodes:e,links:t}){for(const[t,r]of e.entries())r.index=t,r.sourceLinks=[],r.targetLinks=[];const r=new Map(e.map((t,r)=>[l(t,r,e),t]));for(const[e,n]of t.entries()){n.index=e;let{source:t,target:o}=n;"object"!=typeof t&&(t=n.source=th(r,t)),"object"!=typeof o&&(o=n.target=th(r,o)),t.sourceLinks.push(n),o.targetLinks.push(n)}if(null!=n)for(const{sourceLinks:t,targetLinks:r}of e)t.sort(n),r.sort(n)}(g),function({nodes:e}){for(const r of e)r.value=void 0===r.fixedValue?Math.max(t.sum(r.sourceLinks,Jl),t.sum(r.targetLinks,Jl)):r.fixedValue}(g),function({nodes:e}){const t=e.length;let r=new Set(e),n=new Set,o=0;for(;r.size;){for(const e of r){e.depth=o;for(const{target:t}of e.sourceLinks)n.add(t)}if(++o>t)throw new Error("circular link");r=n,n=new Set}}(g),function({nodes:e}){const t=e.length;let r=new Set(e),n=new Set,o=0;for(;r.size;){for(const e of r){e.height=o;for(const{source:t}of e.targetLinks)n.add(t)}if(++o>t)throw new Error("circular link");r=n,n=new Set}}(g),function(n){const l=function({nodes:e}){const n=t.max(e,e=>e.depth)+1,i=(a-o-u)/(n-1),s=new Array(n);for(const t of e){const e=Math.max(0,Math.min(n-1,Math.floor(h.call(null,t,n))));t.layer=e,t.x0=o+e*i,t.x1=t.x0+u,s[e]?s[e].push(t):s[e]=[t]}if(r)for(const e of s)e.sort(r);return s}(n);e=Math.min(c,(s-i)/(t.max(l,e=>e.length)-1)),function(r){const n=t.min(r,r=>(s-i-(r.length-1)*e)/t.sum(r,Jl));for(const t of r){let r=i;for(const o of t){o.y0=r,o.y1=r+o.value*n,r=o.y1+e;for(const e of o.sourceLinks)e.width=e.value*n}r=(s-r+e)/(t.length+1);for(let e=0;e<t.length;++e){const n=t[e];n.y0+=r*(e+1),n.y1+=r*(e+1)}x(t)}}(l);for(let e=0;e<p;++e){const t=Math.pow(.99,e),r=Math.max(1-t,(e+1)/p);y(l,t,r),v(l,t,r)}}(g),rh(g),g}function v(e,t,n){for(let o=1,i=e.length;o<i;++o){const i=e[o];for(const e of i){let r=0,n=0;for(const{source:t,value:o}of e.targetLinks){let i=o*(e.layer-t.layer);r+=E(t,e)*i,n+=i}if(!(n>0))continue;let o=(r/n-e.y0)*t;e.y0+=o,e.y1+=o,w(e)}void 0===r&&i.sort(Xl),m(i,n)}}function y(e,t,n){for(let o=e.length-2;o>=0;--o){const i=e[o];for(const e of i){let r=0,n=0;for(const{target:t,value:o}of e.sourceLinks){let i=o*(t.layer-e.layer);r+=k(e,t)*i,n+=i}if(!(n>0))continue;let o=(r/n-e.y0)*t;e.y0+=o,e.y1+=o,w(e)}void 0===r&&i.sort(Xl),m(i,n)}}function m(t,r){const n=t.length>>1,o=t[n];b(t,o.y0-e,n-1,r),_(t,o.y1+e,n+1,r),b(t,s,t.length-1,r),_(t,i,0,r)}function _(t,r,n,o){for(;n<t.length;++n){const i=t[n],a=(r-i.y0)*o;a>1e-6&&(i.y0+=a,i.y1+=a),r=i.y1+e}}function b(t,r,n,o){for(;n>=0;--n){const i=t[n],a=(i.y1-r)*o;a>1e-6&&(i.y0-=a,i.y1-=a),r=i.y0-e}}function w({sourceLinks:e,targetLinks:t}){if(void 0===n){for(const{source:{sourceLinks:e}}of t)e.sort($l);for(const{target:{targetLinks:t}}of e)t.sort(Yl)}}function x(e){if(void 0===n)for(const{sourceLinks:t,targetLinks:r}of e)t.sort($l),r.sort(Yl)}function E(t,r){let n=t.y0-(t.sourceLinks.length-1)*e/2;for(const{target:o,width:i}of t.sourceLinks){if(o===r)break;n+=i+e}for(const{source:e,width:o}of r.targetLinks){if(e===t)break;n-=o}return n}function k(t,r){let n=r.y0-(r.targetLinks.length-1)*e/2;for(const{source:o,width:i}of r.targetLinks){if(o===t)break;n+=i+e}for(const{target:e,width:o}of t.sourceLinks){if(e===r)break;n-=o}return n}return g.update=function(e){return rh(e),e},g.nodeId=function(e){return arguments.length?(l="function"==typeof e?e:ql(e),g):l},g.nodeAlign=function(e){return arguments.length?(h="function"==typeof e?e:ql(e),g):h},g.nodeSort=function(e){return arguments.length?(r=e,g):r},g.nodeWidth=function(e){return arguments.length?(u=+e,g):u},g.nodePadding=function(t){return arguments.length?(c=e=+t,g):c},g.nodes=function(e){return arguments.length?(f="function"==typeof e?e:ql(e),g):f},g.links=function(e){return arguments.length?(d="function"==typeof e?e:ql(e),g):d},g.linkSort=function(e){return arguments.length?(n=e,g):n},g.size=function(e){return arguments.length?(o=i=0,a=+e[0],s=+e[1],g):[a-o,s-i]},g.extent=function(e){return arguments.length?(o=+e[0][0],a=+e[1][0],i=+e[0][1],s=+e[1][1],g):[[o,i],[a,s]]},g.iterations=function(e){return arguments.length?(p=+e,g):p},g}function oh(e){return[e.source.x1,e.y0]}function ih(e){return[e.target.x0,e.y1]}function ah(){return A().source(oh).target(ih)}Ul.prototype._class+=" graph_AdjacencyGraph",Ul.prototype.publish("uidColumn","","set","UID column",function(){return this.columns()},{optional:!0}),Ul.prototype.publish("labelColumn","","set","Label column",function(){return this.columns()},{optional:!0}),Ul.prototype.publish("iconColumn","","set","Icon column",function(){return this.columns()},{optional:!0}),Ul.prototype.publish("linksColumn","","set","Links column",function(){return this.columns()},{optional:!0}),Ul.prototype.publish("linkUidColumn","","set","Link UID column",function(){return this.linksColumns()},{optional:!0}),Ul.prototype.publish("linkLabelColumn","","set","Link Label column",function(){return this.linksColumns()},{optional:!0}),Ul.prototype.publish("annotations",[],"propertyArray","Annotations",null,{autoExpand:Hl});L(".graph_Sankey .node rect{cursor:move;fill-opacity:.9;shape-rendering:crispEdges;stroke:#a9a9a9}.graph_Sankey .node.selected rect{stroke:red}.graph_Sankey .node.over rect{stroke:orange}.graph_Sankey .node.selected.over rect{stroke:red}.graph_Sankey .node text{pointer-events:none;text-shadow:0 1px 0 #fff}.graph_Sankey .node.selected text{fill:red}.graph_Sankey .node.over text{fill:orange}.graph_Sankey .node.selected.over text{fill:red}.graph_Sankey .link{fill:none;stroke:#000;stroke-opacity:.2}.graph_Sankey .link:hover{stroke-opacity:.5}");var sh={mean:t.mean,median:t.median,min:t.min,max:t.max,sum:t.sum},uh=function(e){function t(){return e.call(this)||this}return s(t,e),t.prototype.owner=function(e){return arguments.length?(this._owner=e,this):this._owner},t.prototype.valid=function(){return!!this.column()},t.prototype.aggregate=function(e){switch(this.aggrType()){case null:case void 0:case"":return e.length;default:var t=this._owner.columns().indexOf(this.aggrColumn());return sh[this.aggrType()](e,function(e){return+e[t]})}},t}(t.PropertyExt);uh.prototype._class+=" graph_Sankey.SankeyColumn",uh.prototype.publish("column",null,"set","Field",function(){return this._owner?this._owner.columns():[]},{optional:!0}),uh.prototype.publish("aggrType",null,"set","Aggregation Type",[null,"mean","median","sum","min","max"],{optional:!0,disable:function(e){return!e._owner||0===e._owner.mappings().indexOf(e)}}),uh.prototype.publish("aggrColumn",null,"set","Aggregation Field",function(){return this._owner?this._owner.columns():[]},{optional:!0,disable:function(e){return!e._owner||!e.aggrType()||0===e._owner.mappings().indexOf(e)}});var ch=function(e){function r(){var r=e.call(this)||this;return t.Utility.SimpleSelectionMixin.call(r),r._drawStartPos="origin",r}return s(r,e),r.prototype.sankeyData=function(){var e={vertices:[],edges:[]};if(0===this.data().length)return e;var t={},r=this.mappings().filter(function(e){return e.valid()});return r.forEach(function(r,n){this._db.rollupView([r.column()]).entries().forEach(function(o){var i=r.column()+":"+n+":"+o.key;t[i]||(e.vertices.push({__id:i,__category:r.column(),name:o.key,origRow:o.value,value:o.value[n][2]}),t[i]=e.vertices.length-1)},this)},this),r.forEach(function(n,o){if(o<r.length-1){var i=r[o+1];this._db.rollupView([n.column(),i.column()]).entries().forEach(function(r){var a=n.column()+":"+o+":"+r.key;r.values.forEach(function(r){var n=i.column()+":"+(o+1)+":"+r.key;e.edges.push({__id:a+"_"+n,source:t[a],target:t[n],value:r.value[0][2]})})})}},this),e},r.prototype.enter=function(t,r){e.prototype.enter.call(this,t,r),this._d3Sankey=new nh,this._selection.widgetElement(r)},r.prototype.update=function(r,n){e.prototype.update.call(this,r,n),this._palette=this._palette.switch(this.paletteID());var o=this.vertexStrokeWidth(),i=this.sankeyData(),a=2*o;this._d3Sankey.extent([[o,o],[this.width()-a,this.height()-a]]).nodeWidth(this.vertexWidth()).nodePadding(this.vertexPadding()),this._d3Sankey({nodes:i.vertices,links:i.edges});var s=this,u=n.selectAll(".link").data(i.edges);u.enter().append("path").attr("class","link").each(function(){t.select(this).append("title")}).merge(u).attr("d",ah()).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}),u.exit().remove();var c=n.selectAll(".node").data(i.vertices);c.enter().append("g").attr("class","node").call(this._selection.enter.bind(this._selection)).on("click",function(e){s.click(s.rowToObj(e.origRow[0]),"",s._selection.selected(this))}).on("dblclick",function(e){s.dblclick(s.rowToObj(e.origRow[0]),"",s._selection.selected(this))}).each(function(){var e=t.select(this);e.append("rect"),e.append("text")}).merge(c).attr("transform",function(e){var t=0,r=0;return e.x0&&(t=e.x0),e.y0&&(r=e.y0),"translate("+(t+o)+","+(r+o)+")"}).each(function(){var e=t.select(this);e.select("rect").attr("height",function(e){return e.y1-e.y0}).attr("width",s._d3Sankey.nodeWidth()).style("fill",function(e){return s._palette(e.name)}).style("stroke",function(e){return s.vertexStrokeColor()}).style("stroke-width",function(e){return o}).style("cursor",s.xAxisMovement()||s.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<s.width()/2}).attr("x",6+s._d3Sankey.nodeWidth()).attr("text-anchor","start")}),c.exit().remove()},r.prototype.exit=function(t,r){e.prototype.exit.call(this,t,r)},r.prototype.click=function(e,t,r){console.log("Click: "+JSON.stringify(e)+", "+t+","+r)},r.prototype.dblclick=function(e,t,r){console.log("Double Click: "+JSON.stringify(e)+", "+t+","+r)},r}(t.SVGWidget);ch.prototype._class+=" graph_Sankey",ch.prototype.Column=uh,ch.prototype.mixin(t.Utility.SimpleSelectionMixin),ch.prototype._palette=t.Palette.ordinal("default"),ch.prototype.publish("paletteID","default","set","Color palette for this widget",ch.prototype._palette.switch()),ch.prototype.publish("mappings",[],"propertyArray","Source Columns",null,{autoExpand:uh}),ch.prototype.publish("vertexStrokeWidth",1,"number","Vertex Stroke Width"),ch.prototype.publish("vertexStrokeColor","darkgray","string","Vertex Stroke Color"),ch.prototype.publish("vertexWidth",36,"number","Vertex Width"),ch.prototype.publish("vertexPadding",40,"number","Vertex Padding"),ch.prototype.publish("xAxisMovement",!1,"boolean","Enable x-axis movement"),ch.prototype.publish("yAxisMovement",!1,"boolean","Enable y-axis movement");var lh=E().x(function(e){return e[0]}).y(function(e){return e[1]}).curve(F),hh=E().x(function(e){return e[0]}).y(function(e){return e[1]}).curve(I),fh=function(){function e(e){this._running=!1,this._graph=e}return e.prototype.start=function(){return this._running=!0,this._graph.progress("layout-start"),Promise.resolve(this)},e.prototype.stop=function(){return this._running=!1,this._graph.progress("layout-stop"),this},e.prototype.running=function(){return this._running},e.prototype.center=function(e){if(e.length%2==1)return e[Math.floor(e.length/2)];var t=e[e.length/2-1],r=e[e.length/2];return[(t[0]+r[0])/2,(t[1]+r[1])/2]},e.prototype.edgePath=function(e,t){var r=this._graph.projectPlacholder(e.source),n=this._graph.projectPlacholder(e.target),o=[[r.x,r.y],[n.x,n.y]];if(t){var i=o[0][0]-o[1][0],a=o[0][1]-o[1][1];if(Math.sqrt(i*i+a*a)){var s=(o[0][0]+o[1][0])/2-a*t/100,u=(o[0][1]+o[1][1])/2+i*t/100;return{path:hh([o[0],[s,u],o[1]]),labelPos:[s,u]}}}return{path:lh(o),labelPos:this.center(o)}},e}(),dh=function(e){return e*Math.PI/180},ph=function(e){function t(t,r){void 0===r&&(r=60);var n=e.call(this,t)||this;return n.sideLength=r,n}return s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then(function(){var e=t._graph.size(),r=t._graph.graphData(),n=r.allVertices();r.allEdges().forEach(function(e){return delete e.points});var o,i=(o=n.length,t.sideLength/(2*Math.sin(dh(180/o)))),a=360/n.length;return n.forEach(function(t,r){delete t.fx,delete t.fy,t.x=e.width/2+Math.cos(dh(r*a))*i,t.y=e.height/2+Math.sin(dh(r*a))*i}),t._graph.moveVertices(!0).moveEdges(!0),t.stop(),t._running=!1,t})},t}(fh);var gh=E().x(function(e){return e[0]}).y(function(e){return e[1]}).curve(F),vh=function(e){return"cluster_"+e};function yh(e,t,r,n){var o=e-r,i=t-n;return Math.sqrt(o*o+i*i)}var mh=function(e){function t(t,r){var n=e.call(this,t)||this;return n._options=r,n}return s(t,e),t.prototype.start=function(){var t=this;e.prototype.start.call(this);var r=this._graph.size(),n=this._graph.graphData();return function(e,t){var r=new Blob(['!function(){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e,n,t){return e(t={path:n,exports:{},require:function(e,n){return r(null==n&&t.path)}},t.exports),t.exports}function r(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var t=function(){this.__data__=[],this.size=0};var o=function(e,n){return e===n||e!=e&&n!=n};var i=function(e,n){for(var r=e.length;r--;)if(o(e[r][0],n))return r;return-1},a=Array.prototype.splice;var u=function(e){var n=this.__data__,r=i(n,e);return!(r<0||(r==n.length-1?n.pop():a.call(n,r,1),--this.size,0))};var c=function(e){var n=this.__data__,r=i(n,e);return r<0?void 0:n[r][1]};var s=function(e){return i(this.__data__,e)>-1};var f=function(e,n){var r=this.__data__,t=i(r,e);return t<0?(++this.size,r.push([e,n])):r[t][1]=n,this};function d(e){var n=-1,r=null==e?0:e.length;for(this.clear();++n<r;){var t=e[n];this.set(t[0],t[1])}}d.prototype.clear=t,d.prototype.delete=u,d.prototype.get=c,d.prototype.has=s,d.prototype.set=f;var h=d;var v=function(){this.__data__=new h,this.size=0};var l=function(e){var n=this.__data__,r=n.delete(e);return this.size=n.size,r};var p=function(e){return this.__data__.get(e)};var g=function(e){return this.__data__.has(e)},y="object"==typeof e&&e&&e.Object===Object&&e,b="object"==typeof self&&self&&self.Object===Object&&self,_=y||b||Function("return this")(),m=_.Symbol,w=Object.prototype,E=w.hasOwnProperty,j=w.toString,k=m?m.toStringTag:void 0;var x=function(e){var n=E.call(e,k),r=e[k];try{e[k]=void 0;var t=!0}catch(e){}var o=j.call(e);return t&&(n?e[k]=r:delete e[k]),o},N=Object.prototype.toString;var O=function(e){return N.call(e)},I="[object Null]",A="[object Undefined]",C=m?m.toStringTag:void 0;var M=function(e){return null==e?void 0===e?A:I:C&&C in Object(e)?x(e):O(e)};var S=function(e){var n=typeof e;return null!=e&&("object"==n||"function"==n)},P="[object AsyncFunction]",L="[object Function]",T="[object GeneratorFunction]",F="[object Proxy]";var R,z=function(e){if(!S(e))return!1;var n=M(e);return n==L||n==T||n==P||n==F},D=_["__core-js_shared__"],U=(R=/[^.]+$/.exec(D&&D.keys&&D.keys.IE_PROTO||""))?"Symbol(src)_1."+R:"";var B=function(e){return!!U&&U in e},G=Function.prototype.toString;var V=function(e){if(null!=e){try{return G.call(e)}catch(e){}try{return e+""}catch(e){}}return""},q=/^\\[object .+?Constructor\\]$/,Y=Function.prototype,$=Object.prototype,W=Y.toString,K=$.hasOwnProperty,J=RegExp("^"+W.call(K).replace(/[\\\\^$.*+?()[\\]{}|]/g,"\\\\$&").replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g,"$1.*?")+"$");var Q=function(e){return!(!S(e)||B(e))&&(z(e)?J:q).test(V(e))};var H=function(e,n){return null==e?void 0:e[n]};var X=function(e,n){var r=H(e,n);return Q(r)?r:void 0},Z=X(_,"Map"),ee=X(Object,"create");var ne=function(){this.__data__=ee?ee(null):{},this.size=0};var re=function(e){var n=this.has(e)&&delete this.__data__[e];return this.size-=n?1:0,n},te="__lodash_hash_undefined__",oe=Object.prototype.hasOwnProperty;var ie=function(e){var n=this.__data__;if(ee){var r=n[e];return r===te?void 0:r}return oe.call(n,e)?n[e]:void 0},ae=Object.prototype.hasOwnProperty;var ue=function(e){var n=this.__data__;return ee?void 0!==n[e]:ae.call(n,e)},ce="__lodash_hash_undefined__";var se=function(e,n){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=ee&&void 0===n?ce:n,this};function fe(e){var n=-1,r=null==e?0:e.length;for(this.clear();++n<r;){var t=e[n];this.set(t[0],t[1])}}fe.prototype.clear=ne,fe.prototype.delete=re,fe.prototype.get=ie,fe.prototype.has=ue,fe.prototype.set=se;var de=fe;var he=function(){this.size=0,this.__data__={hash:new de,map:new(Z||h),string:new de}};var ve=function(e){var n=typeof e;return"string"==n||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==e:null===e};var le=function(e,n){var r=e.__data__;return ve(n)?r["string"==typeof n?"string":"hash"]:r.map};var pe=function(e){var n=le(this,e).delete(e);return this.size-=n?1:0,n};var ge=function(e){return le(this,e).get(e)};var ye=function(e){return le(this,e).has(e)};var be=function(e,n){var r=le(this,e),t=r.size;return r.set(e,n),this.size+=r.size==t?0:1,this};function _e(e){var n=-1,r=null==e?0:e.length;for(this.clear();++n<r;){var t=e[n];this.set(t[0],t[1])}}_e.prototype.clear=he,_e.prototype.delete=pe,_e.prototype.get=ge,_e.prototype.has=ye,_e.prototype.set=be;var me=_e,we=200;var Ee=function(e,n){var r=this.__data__;if(r instanceof h){var t=r.__data__;if(!Z||t.length<we-1)return t.push([e,n]),this.size=++r.size,this;r=this.__data__=new me(t)}return r.set(e,n),this.size=r.size,this};function je(e){var n=this.__data__=new h(e);this.size=n.size}je.prototype.clear=v,je.prototype.delete=l,je.prototype.get=p,je.prototype.has=g,je.prototype.set=Ee;var ke=je;var xe=function(e,n){for(var r=-1,t=null==e?0:e.length;++r<t&&!1!==n(e[r],r,e););return e},Ne=function(){try{var e=X(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var Oe=function(e,n,r){"__proto__"==n&&Ne?Ne(e,n,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[n]=r},Ie=Object.prototype.hasOwnProperty;var Ae=function(e,n,r){var t=e[n];Ie.call(e,n)&&o(t,r)&&(void 0!==r||n in e)||Oe(e,n,r)};var Ce=function(e,n,r,t){var o=!r;r||(r={});for(var i=-1,a=n.length;++i<a;){var u=n[i],c=t?t(r[u],e[u],u,r,e):void 0;void 0===c&&(c=e[u]),o?Oe(r,u,c):Ae(r,u,c)}return r};var Me=function(e,n){for(var r=-1,t=Array(e);++r<e;)t[r]=n(r);return t};var Se=function(e){return null!=e&&"object"==typeof e},Pe="[object Arguments]";var Le=function(e){return Se(e)&&M(e)==Pe},Te=Object.prototype,Fe=Te.hasOwnProperty,Re=Te.propertyIsEnumerable,ze=Le(function(){return arguments}())?Le:function(e){return Se(e)&&Fe.call(e,"callee")&&!Re.call(e,"callee")},De=Array.isArray;var Ue=function(){return!1},Be=n(function(e,n){var r=n&&!n.nodeType&&n,t=r&&e&&!e.nodeType&&e,o=t&&t.exports===r?_.Buffer:void 0,i=(o?o.isBuffer:void 0)||Ue;e.exports=i}),Ge=9007199254740991,Ve=/^(?:0|[1-9]\\d*)$/;var qe=function(e,n){var r=typeof e;return!!(n=null==n?Ge:n)&&("number"==r||"symbol"!=r&&Ve.test(e))&&e>-1&&e%1==0&&e<n},Ye=9007199254740991;var $e=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=Ye},We={};We["[object Float32Array]"]=We["[object Float64Array]"]=We["[object Int8Array]"]=We["[object Int16Array]"]=We["[object Int32Array]"]=We["[object Uint8Array]"]=We["[object Uint8ClampedArray]"]=We["[object Uint16Array]"]=We["[object Uint32Array]"]=!0,We["[object Arguments]"]=We["[object Array]"]=We["[object ArrayBuffer]"]=We["[object Boolean]"]=We["[object DataView]"]=We["[object Date]"]=We["[object Error]"]=We["[object Function]"]=We["[object Map]"]=We["[object Number]"]=We["[object Object]"]=We["[object RegExp]"]=We["[object Set]"]=We["[object String]"]=We["[object WeakMap]"]=!1;var Ke=function(e){return Se(e)&&$e(e.length)&&!!We[M(e)]};var Je=function(e){return function(n){return e(n)}},Qe=n(function(e,n){var r=n&&!n.nodeType&&n,t=r&&e&&!e.nodeType&&e,o=t&&t.exports===r&&y.process,i=function(){try{var e=t&&t.require&&t.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=i}),He=Qe&&Qe.isTypedArray,Xe=He?Je(He):Ke,Ze=Object.prototype.hasOwnProperty;var en=function(e,n){var r=De(e),t=!r&&ze(e),o=!r&&!t&&Be(e),i=!r&&!t&&!o&&Xe(e),a=r||t||o||i,u=a?Me(e.length,String):[],c=u.length;for(var s in e)!n&&!Ze.call(e,s)||a&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||qe(s,c))||u.push(s);return u},nn=Object.prototype;var rn=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||nn)};var tn=function(e,n){return function(r){return e(n(r))}},on=tn(Object.keys,Object),an=Object.prototype.hasOwnProperty;var un=function(e){if(!rn(e))return on(e);var n=[];for(var r in Object(e))an.call(e,r)&&"constructor"!=r&&n.push(r);return n};var cn=function(e){return null!=e&&$e(e.length)&&!z(e)};var sn=function(e){return cn(e)?en(e):un(e)};var fn=function(e,n){return e&&Ce(n,sn(n),e)};var dn=function(e){var n=[];if(null!=e)for(var r in Object(e))n.push(r);return n},hn=Object.prototype.hasOwnProperty;var vn=function(e){if(!S(e))return dn(e);var n=rn(e),r=[];for(var t in e)("constructor"!=t||!n&&hn.call(e,t))&&r.push(t);return r};var ln=function(e){return cn(e)?en(e,!0):vn(e)};var pn=function(e,n){return e&&Ce(n,ln(n),e)},gn=n(function(e,n){var r=n&&!n.nodeType&&n,t=r&&e&&!e.nodeType&&e,o=t&&t.exports===r?_.Buffer:void 0,i=o?o.allocUnsafe:void 0;e.exports=function(e,n){if(n)return e.slice();var r=e.length,t=i?i(r):new e.constructor(r);return e.copy(t),t}});var yn=function(e,n){var r=-1,t=e.length;for(n||(n=Array(t));++r<t;)n[r]=e[r];return n};var bn=function(e,n){for(var r=-1,t=null==e?0:e.length,o=0,i=[];++r<t;){var a=e[r];n(a,r,e)&&(i[o++]=a)}return i};var _n=function(){return[]},mn=Object.prototype.propertyIsEnumerable,wn=Object.getOwnPropertySymbols,En=wn?function(e){return null==e?[]:(e=Object(e),bn(wn(e),function(n){return mn.call(e,n)}))}:_n;var jn=function(e,n){return Ce(e,En(e),n)};var kn=function(e,n){for(var r=-1,t=n.length,o=e.length;++r<t;)e[o+r]=n[r];return e},xn=tn(Object.getPrototypeOf,Object),Nn=Object.getOwnPropertySymbols?function(e){for(var n=[];e;)kn(n,En(e)),e=xn(e);return n}:_n;var On=function(e,n){return Ce(e,Nn(e),n)};var In=function(e,n,r){var t=n(e);return De(e)?t:kn(t,r(e))};var An=function(e){return In(e,sn,En)};var Cn=function(e){return In(e,ln,Nn)},Mn=X(_,"DataView"),Sn=X(_,"Promise"),Pn=X(_,"Set"),Ln=X(_,"WeakMap"),Tn=V(Mn),Fn=V(Z),Rn=V(Sn),zn=V(Pn),Dn=V(Ln),Un=M;(Mn&&"[object DataView]"!=Un(new Mn(new ArrayBuffer(1)))||Z&&"[object Map]"!=Un(new Z)||Sn&&"[object Promise]"!=Un(Sn.resolve())||Pn&&"[object Set]"!=Un(new Pn)||Ln&&"[object WeakMap]"!=Un(new Ln))&&(Un=function(e){var n=M(e),r="[object Object]"==n?e.constructor:void 0,t=r?V(r):"";if(t)switch(t){case Tn:return"[object DataView]";case Fn:return"[object Map]";case Rn:return"[object Promise]";case zn:return"[object Set]";case Dn:return"[object WeakMap]"}return n});var Bn=Un,Gn=Object.prototype.hasOwnProperty;var Vn=function(e){var n=e.length,r=new e.constructor(n);return n&&"string"==typeof e[0]&&Gn.call(e,"index")&&(r.index=e.index,r.input=e.input),r},qn=_.Uint8Array;var Yn=function(e){var n=new e.constructor(e.byteLength);return new qn(n).set(new qn(e)),n};var $n=function(e,n){var r=n?Yn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)},Wn=/\\w*$/;var Kn=function(e){var n=new e.constructor(e.source,Wn.exec(e));return n.lastIndex=e.lastIndex,n},Jn=m?m.prototype:void 0,Qn=Jn?Jn.valueOf:void 0;var Hn=function(e){return Qn?Object(Qn.call(e)):{}};var Xn=function(e,n){var r=n?Yn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)},Zn="[object Boolean]",er="[object Date]",nr="[object Map]",rr="[object Number]",tr="[object RegExp]",or="[object Set]",ir="[object String]",ar="[object Symbol]",ur="[object ArrayBuffer]",cr="[object DataView]",sr="[object Float32Array]",fr="[object Float64Array]",dr="[object Int8Array]",hr="[object Int16Array]",vr="[object Int32Array]",lr="[object Uint8Array]",pr="[object Uint8ClampedArray]",gr="[object Uint16Array]",yr="[object Uint32Array]";var br=function(e,n,r){var t=e.constructor;switch(n){case ur:return Yn(e);case Zn:case er:return new t(+e);case cr:return $n(e,r);case sr:case fr:case dr:case hr:case vr:case lr:case pr:case gr:case yr:return Xn(e,r);case nr:return new t;case rr:case ir:return new t(e);case tr:return Kn(e);case or:return new t;case ar:return Hn(e)}},_r=Object.create,mr=function(){function e(){}return function(n){if(!S(n))return{};if(_r)return _r(n);e.prototype=n;var r=new e;return e.prototype=void 0,r}}();var wr=function(e){return"function"!=typeof e.constructor||rn(e)?{}:mr(xn(e))},Er="[object Map]";var jr=function(e){return Se(e)&&Bn(e)==Er},kr=Qe&&Qe.isMap,xr=kr?Je(kr):jr,Nr="[object Set]";var Or=function(e){return Se(e)&&Bn(e)==Nr},Ir=Qe&&Qe.isSet,Ar=Ir?Je(Ir):Or,Cr=1,Mr=2,Sr=4,Pr="[object Arguments]",Lr="[object Function]",Tr="[object GeneratorFunction]",Fr="[object Object]",Rr={};Rr[Pr]=Rr["[object Array]"]=Rr["[object ArrayBuffer]"]=Rr["[object DataView]"]=Rr["[object Boolean]"]=Rr["[object Date]"]=Rr["[object Float32Array]"]=Rr["[object Float64Array]"]=Rr["[object Int8Array]"]=Rr["[object Int16Array]"]=Rr["[object Int32Array]"]=Rr["[object Map]"]=Rr["[object Number]"]=Rr[Fr]=Rr["[object RegExp]"]=Rr["[object Set]"]=Rr["[object String]"]=Rr["[object Symbol]"]=Rr["[object Uint8Array]"]=Rr["[object Uint8ClampedArray]"]=Rr["[object Uint16Array]"]=Rr["[object Uint32Array]"]=!0,Rr["[object Error]"]=Rr[Lr]=Rr["[object WeakMap]"]=!1;var zr=function e(n,r,t,o,i,a){var u,c=r&Cr,s=r&Mr,f=r&Sr;if(t&&(u=i?t(n,o,i,a):t(n)),void 0!==u)return u;if(!S(n))return n;var d=De(n);if(d){if(u=Vn(n),!c)return yn(n,u)}else{var h=Bn(n),v=h==Lr||h==Tr;if(Be(n))return gn(n,c);if(h==Fr||h==Pr||v&&!i){if(u=s||v?{}:wr(n),!c)return s?On(n,pn(u,n)):jn(n,fn(u,n))}else{if(!Rr[h])return i?n:{};u=br(n,h,c)}}a||(a=new ke);var l=a.get(n);if(l)return l;a.set(n,u),Ar(n)?n.forEach(function(o){u.add(e(o,r,t,o,n,a))}):xr(n)&&n.forEach(function(o,i){u.set(i,e(o,r,t,i,n,a))});var p=d?void 0:(f?s?Cn:An:s?ln:sn)(n);return xe(p||n,function(o,i){p&&(o=n[i=o]),Ae(u,i,e(o,r,t,i,n,a))}),u},Dr=4;var Ur=function(e){return zr(e,Dr)};var Br=function(e){return function(){return e}};var Gr=function(e){return function(n,r,t){for(var o=-1,i=Object(n),a=t(n),u=a.length;u--;){var c=a[e?u:++o];if(!1===r(i[c],c,i))break}return n}}();var Vr=function(e,n){return e&&Gr(e,n,sn)};var qr=function(e,n){return function(r,t){if(null==r)return r;if(!cn(r))return e(r,t);for(var o=r.length,i=n?o:-1,a=Object(r);(n?i--:++i<o)&&!1!==t(a[i],i,a););return r}}(Vr);var Yr=function(e){return e};var $r=function(e){return"function"==typeof e?e:Yr};var Wr=function(e,n){return(De(e)?xe:qr)(e,$r(n))},Kr=Wr;var Jr=function(e,n){var r=[];return qr(e,function(e,t,o){n(e,t,o)&&r.push(e)}),r},Qr="__lodash_hash_undefined__";var Hr=function(e){return this.__data__.set(e,Qr),this};var Xr=function(e){return this.__data__.has(e)};function Zr(e){var n=-1,r=null==e?0:e.length;for(this.__data__=new me;++n<r;)this.add(e[n])}Zr.prototype.add=Zr.prototype.push=Hr,Zr.prototype.has=Xr;var et=Zr;var nt=function(e,n){for(var r=-1,t=null==e?0:e.length;++r<t;)if(n(e[r],r,e))return!0;return!1};var rt=function(e,n){return e.has(n)},tt=1,ot=2;var it=function(e,n,r,t,o,i){var a=r&tt,u=e.length,c=n.length;if(u!=c&&!(a&&c>u))return!1;var s=i.get(e),f=i.get(n);if(s&&f)return s==n&&f==e;var d=-1,h=!0,v=r&ot?new et:void 0;for(i.set(e,n),i.set(n,e);++d<u;){var l=e[d],p=n[d];if(t)var g=a?t(p,l,d,n,e,i):t(l,p,d,e,n,i);if(void 0!==g){if(g)continue;h=!1;break}if(v){if(!nt(n,function(e,n){if(!rt(v,n)&&(l===e||o(l,e,r,t,i)))return v.push(n)})){h=!1;break}}else if(l!==p&&!o(l,p,r,t,i)){h=!1;break}}return i.delete(e),i.delete(n),h};var at=function(e){var n=-1,r=Array(e.size);return e.forEach(function(e,t){r[++n]=[t,e]}),r};var ut=function(e){var n=-1,r=Array(e.size);return e.forEach(function(e){r[++n]=e}),r},ct=1,st=2,ft="[object Boolean]",dt="[object Date]",ht="[object Error]",vt="[object Map]",lt="[object Number]",pt="[object RegExp]",gt="[object Set]",yt="[object String]",bt="[object Symbol]",_t="[object ArrayBuffer]",mt="[object DataView]",wt=m?m.prototype:void 0,Et=wt?wt.valueOf:void 0;var jt=function(e,n,r,t,i,a,u){switch(r){case mt:if(e.byteLength!=n.byteLength||e.byteOffset!=n.byteOffset)return!1;e=e.buffer,n=n.buffer;case _t:return!(e.byteLength!=n.byteLength||!a(new qn(e),new qn(n)));case ft:case dt:case lt:return o(+e,+n);case ht:return e.name==n.name&&e.message==n.message;case pt:case yt:return e==n+"";case vt:var c=at;case gt:var s=t&ct;if(c||(c=ut),e.size!=n.size&&!s)return!1;var f=u.get(e);if(f)return f==n;t|=st,u.set(e,n);var d=it(c(e),c(n),t,i,a,u);return u.delete(e),d;case bt:if(Et)return Et.call(e)==Et.call(n)}return!1},kt=1,xt=Object.prototype.hasOwnProperty;var Nt=function(e,n,r,t,o,i){var a=r&kt,u=An(e),c=u.length;if(c!=An(n).length&&!a)return!1;for(var s=c;s--;){var f=u[s];if(!(a?f in n:xt.call(n,f)))return!1}var d=i.get(e),h=i.get(n);if(d&&h)return d==n&&h==e;var v=!0;i.set(e,n),i.set(n,e);for(var l=a;++s<c;){var p=e[f=u[s]],g=n[f];if(t)var y=a?t(g,p,f,n,e,i):t(p,g,f,e,n,i);if(!(void 0===y?p===g||o(p,g,r,t,i):y)){v=!1;break}l||(l="constructor"==f)}if(v&&!l){var b=e.constructor,_=n.constructor;b!=_&&"constructor"in e&&"constructor"in n&&!("function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _)&&(v=!1)}return i.delete(e),i.delete(n),v},Ot=1,It="[object Arguments]",At="[object Array]",Ct="[object Object]",Mt=Object.prototype.hasOwnProperty;var St=function(e,n,r,t,o,i){var a=De(e),u=De(n),c=a?At:Bn(e),s=u?At:Bn(n),f=(c=c==It?Ct:c)==Ct,d=(s=s==It?Ct:s)==Ct,h=c==s;if(h&&Be(e)){if(!Be(n))return!1;a=!0,f=!1}if(h&&!f)return i||(i=new ke),a||Xe(e)?it(e,n,r,t,o,i):jt(e,n,c,r,t,o,i);if(!(r&Ot)){var v=f&&Mt.call(e,"__wrapped__"),l=d&&Mt.call(n,"__wrapped__");if(v||l){var p=v?e.value():e,g=l?n.value():n;return i||(i=new ke),o(p,g,r,t,i)}}return!!h&&(i||(i=new ke),Nt(e,n,r,t,o,i))};var Pt=function e(n,r,t,o,i){return n===r||(null==n||null==r||!Se(n)&&!Se(r)?n!=n&&r!=r:St(n,r,t,o,e,i))},Lt=1,Tt=2;var Ft=function(e,n,r,t){var o=r.length,i=o,a=!t;if(null==e)return!i;for(e=Object(e);o--;){var u=r[o];if(a&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++o<i;){var c=(u=r[o])[0],s=e[c],f=u[1];if(a&&u[2]){if(void 0===s&&!(c in e))return!1}else{var d=new ke;if(t)var h=t(s,f,c,e,n,d);if(!(void 0===h?Pt(f,s,Lt|Tt,t,d):h))return!1}}return!0};var Rt=function(e){return e==e&&!S(e)};var zt=function(e){for(var n=sn(e),r=n.length;r--;){var t=n[r],o=e[t];n[r]=[t,o,Rt(o)]}return n};var Dt=function(e,n){return function(r){return null!=r&&r[e]===n&&(void 0!==n||e in Object(r))}};var Ut=function(e){var n=zt(e);return 1==n.length&&n[0][2]?Dt(n[0][0],n[0][1]):function(r){return r===e||Ft(r,e,n)}},Bt="[object Symbol]";var Gt=function(e){return"symbol"==typeof e||Se(e)&&M(e)==Bt},Vt=/\\.|\\[(?:[^[\\]]*|(["\'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,qt=/^\\w*$/;var Yt=function(e,n){if(De(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!Gt(e))||qt.test(e)||!Vt.test(e)||null!=n&&e in Object(n)},$t="Expected a function";function Wt(e,n){if("function"!=typeof e||null!=n&&"function"!=typeof n)throw new TypeError($t);var r=function(){var t=arguments,o=n?n.apply(this,t):t[0],i=r.cache;if(i.has(o))return i.get(o);var a=e.apply(this,t);return r.cache=i.set(o,a)||i,a};return r.cache=new(Wt.Cache||me),r}Wt.Cache=me;var Kt=Wt,Jt=500;var Qt=/[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["\'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g,Ht=/\\\\(\\\\)?/g,Xt=function(e){var n=Kt(e,function(e){return r.size===Jt&&r.clear(),e}),r=n.cache;return n}(function(e){var n=[];return 46===e.charCodeAt(0)&&n.push(""),e.replace(Qt,function(e,r,t,o){n.push(t?o.replace(Ht,"$1"):r||e)}),n});var Zt=function(e,n){for(var r=-1,t=null==e?0:e.length,o=Array(t);++r<t;)o[r]=n(e[r],r,e);return o},eo=1/0,no=m?m.prototype:void 0,ro=no?no.toString:void 0;var to=function e(n){if("string"==typeof n)return n;if(De(n))return Zt(n,e)+"";if(Gt(n))return ro?ro.call(n):"";var r=n+"";return"0"==r&&1/n==-eo?"-0":r};var oo=function(e){return null==e?"":to(e)};var io=function(e,n){return De(e)?e:Yt(e,n)?[e]:Xt(oo(e))},ao=1/0;var uo=function(e){if("string"==typeof e||Gt(e))return e;var n=e+"";return"0"==n&&1/e==-ao?"-0":n};var co=function(e,n){for(var r=0,t=(n=io(n,e)).length;null!=e&&r<t;)e=e[uo(n[r++])];return r&&r==t?e:void 0};var so=function(e,n,r){var t=null==e?void 0:co(e,n);return void 0===t?r:t};var fo=function(e,n){return null!=e&&n in Object(e)};var ho=function(e,n,r){for(var t=-1,o=(n=io(n,e)).length,i=!1;++t<o;){var a=uo(n[t]);if(!(i=null!=e&&r(e,a)))break;e=e[a]}return i||++t!=o?i:!!(o=null==e?0:e.length)&&$e(o)&&qe(a,o)&&(De(e)||ze(e))};var vo=function(e,n){return null!=e&&ho(e,n,fo)},lo=1,po=2;var go=function(e,n){return Yt(e)&&Rt(n)?Dt(uo(e),n):function(r){var t=so(r,e);return void 0===t&&t===n?vo(r,e):Pt(n,t,lo|po)}};var yo=function(e){return function(n){return null==n?void 0:n[e]}};var bo=function(e){return function(n){return co(n,e)}};var _o=function(e){return Yt(e)?yo(uo(e)):bo(e)};var mo=function(e){return"function"==typeof e?e:null==e?Yr:"object"==typeof e?De(e)?go(e[0],e[1]):Ut(e):_o(e)};var wo=function(e,n){return(De(e)?bn:Jr)(e,mo(n))},Eo=Object.prototype.hasOwnProperty;var jo=function(e,n){return null!=e&&Eo.call(e,n)};var ko=function(e,n){return null!=e&&ho(e,n,jo)},xo="[object Map]",No="[object Set]",Oo=Object.prototype.hasOwnProperty;var Io=function(e){if(null==e)return!0;if(cn(e)&&(De(e)||"string"==typeof e||"function"==typeof e.splice||Be(e)||Xe(e)||ze(e)))return!e.length;var n=Bn(e);if(n==xo||n==No)return!e.size;if(rn(e))return!un(e).length;for(var r in e)if(Oo.call(e,r))return!1;return!0};var Ao=function(e){return void 0===e};var Co=function(e,n){var r=-1,t=cn(e)?Array(e.length):[];return qr(e,function(e,o,i){t[++r]=n(e,o,i)}),t};var Mo=function(e,n){return(De(e)?Zt:Co)(e,mo(n))};var So=function(e,n,r,t){var o=-1,i=null==e?0:e.length;for(t&&i&&(r=e[++o]);++o<i;)r=n(r,e[o],o,e);return r};var Po=function(e,n,r,t,o){return o(e,function(e,o,i){r=t?(t=!1,e):n(r,e,o,i)}),r};var Lo=function(e,n,r){var t=De(e)?So:Po,o=arguments.length<3;return t(e,mo(n),r,o,qr)},To="[object String]";var Fo=function(e){return"string"==typeof e||!De(e)&&Se(e)&&M(e)==To},Ro=yo("length"),zo=RegExp("[\\\\u200d\\\\ud800-\\\\udfff\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff\\\\ufe0e\\\\ufe0f]");var Do=function(e){return zo.test(e)},Uo="[\\\\ud800-\\\\udfff]",Bo="[\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff]",Go="\\\\ud83c[\\\\udffb-\\\\udfff]",Vo="[^\\\\ud800-\\\\udfff]",qo="(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}",Yo="[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]",$o="(?:"+Bo+"|"+Go+")"+"?",Wo="[\\\\ufe0e\\\\ufe0f]?"+$o+("(?:\\\\u200d(?:"+[Vo,qo,Yo].join("|")+")[\\\\ufe0e\\\\ufe0f]?"+$o+")*"),Ko="(?:"+[Vo+Bo+"?",Bo,qo,Yo,Uo].join("|")+")",Jo=RegExp(Go+"(?="+Go+")|"+Ko+Wo,"g");var Qo=function(e){for(var n=Jo.lastIndex=0;Jo.test(e);)++n;return n};var Ho=function(e){return Do(e)?Qo(e):Ro(e)},Xo="[object Map]",Zo="[object Set]";var ei=function(e){if(null==e)return 0;if(cn(e))return Fo(e)?Ho(e):e.length;var n=Bn(e);return n==Xo||n==Zo?e.size:un(e).length};var ni=function(e,n,r){var t=De(e),o=t||Be(e)||Xe(e);if(n=mo(n),null==r){var i=e&&e.constructor;r=o?t?new i:[]:S(e)&&z(i)?mr(xn(e)):{}}return(o?xe:Vr)(e,function(e,t,o){return n(r,e,t,o)}),r},ri=m?m.isConcatSpreadable:void 0;var ti=function(e){return De(e)||ze(e)||!!(ri&&e&&e[ri])};var oi=function e(n,r,t,o,i){var a=-1,u=n.length;for(t||(t=ti),i||(i=[]);++a<u;){var c=n[a];r>0&&t(c)?r>1?e(c,r-1,t,o,i):kn(i,c):o||(i[i.length]=c)}return i};var ii=function(e,n,r){switch(r.length){case 0:return e.call(n);case 1:return e.call(n,r[0]);case 2:return e.call(n,r[0],r[1]);case 3:return e.call(n,r[0],r[1],r[2])}return e.apply(n,r)},ai=Math.max;var ui=function(e,n,r){return n=ai(void 0===n?e.length-1:n,0),function(){for(var t=arguments,o=-1,i=ai(t.length-n,0),a=Array(i);++o<i;)a[o]=t[n+o];o=-1;for(var u=Array(n+1);++o<n;)u[o]=t[o];return u[n]=r(a),ii(e,this,u)}},ci=Ne?function(e,n){return Ne(e,"toString",{configurable:!0,enumerable:!1,value:Br(n),writable:!0})}:Yr,si=800,fi=16,di=Date.now;var hi=function(e){var n=0,r=0;return function(){var t=di(),o=fi-(t-r);if(r=t,o>0){if(++n>=si)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}(ci);var vi=function(e,n){return hi(ui(e,n,Yr),e+"")};var li=function(e,n,r,t){for(var o=e.length,i=r+(t?1:-1);t?i--:++i<o;)if(n(e[i],i,e))return i;return-1};var pi=function(e){return e!=e};var gi=function(e,n,r){for(var t=r-1,o=e.length;++t<o;)if(e[t]===n)return t;return-1};var yi=function(e,n,r){return n==n?gi(e,n,r):li(e,pi,r)};var bi=function(e,n){return!(null==e||!e.length)&&yi(e,n,0)>-1};var _i=function(e,n,r){for(var t=-1,o=null==e?0:e.length;++t<o;)if(r(n,e[t]))return!0;return!1};var mi=function(){},wi=Pn&&1/ut(new Pn([,-0]))[1]==1/0?function(e){return new Pn(e)}:mi,Ei=200;var ji=function(e,n,r){var t=-1,o=bi,i=e.length,a=!0,u=[],c=u;if(r)a=!1,o=_i;else if(i>=Ei){var s=n?null:wi(e);if(s)return ut(s);a=!1,o=rt,c=new et}else c=n?[]:u;e:for(;++t<i;){var f=e[t],d=n?n(f):f;if(f=r||0!==f?f:0,a&&d==d){for(var h=c.length;h--;)if(c[h]===d)continue e;n&&c.push(d),u.push(f)}else o(c,d,r)||(c!==u&&c.push(d),u.push(f))}return u};var ki=function(e){return Se(e)&&cn(e)},xi=vi(function(e){return ji(oi(e,1,ki,!0))});var Ni=function(e,n){return Zt(n,function(n){return e[n]})};var Oi,Ii=function(e){return null==e?[]:Ni(e,sn(e))};try{Oi={clone:Ur,constant:Br,each:Kr,filter:wo,has:ko,isArray:De,isEmpty:Io,isFunction:z,isUndefined:Ao,keys:sn,map:Mo,reduce:Lo,size:ei,transform:ni,union:xi,values:Ii}}catch(e){}Oi||(Oi=window._);var Ai=Oi,Ci=Li,Mi="\\0",Si="\\0",Pi="";function Li(e){this._isDirected=!Ai.has(e,"directed")||e.directed,this._isMultigraph=!!Ai.has(e,"multigraph")&&e.multigraph,this._isCompound=!!Ai.has(e,"compound")&&e.compound,this._label=void 0,this._defaultNodeLabelFn=Ai.constant(void 0),this._defaultEdgeLabelFn=Ai.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[Si]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function Ti(e,n){e[n]?e[n]++:e[n]=1}function Fi(e,n){--e[n]||delete e[n]}function Ri(e,n,r,t){var o=""+n,i=""+r;if(!e&&o>i){var a=o;o=i,i=a}return o+Pi+i+Pi+(Ai.isUndefined(t)?Mi:t)}function zi(e,n){return Ri(e,n.v,n.w,n.name)}Li.prototype._nodeCount=0,Li.prototype._edgeCount=0,Li.prototype.isDirected=function(){return this._isDirected},Li.prototype.isMultigraph=function(){return this._isMultigraph},Li.prototype.isCompound=function(){return this._isCompound},Li.prototype.setGraph=function(e){return this._label=e,this},Li.prototype.graph=function(){return this._label},Li.prototype.setDefaultNodeLabel=function(e){return Ai.isFunction(e)||(e=Ai.constant(e)),this._defaultNodeLabelFn=e,this},Li.prototype.nodeCount=function(){return this._nodeCount},Li.prototype.nodes=function(){return Ai.keys(this._nodes)},Li.prototype.sources=function(){var e=this;return Ai.filter(this.nodes(),function(n){return Ai.isEmpty(e._in[n])})},Li.prototype.sinks=function(){var e=this;return Ai.filter(this.nodes(),function(n){return Ai.isEmpty(e._out[n])})},Li.prototype.setNodes=function(e,n){var r=arguments,t=this;return Ai.each(e,function(e){r.length>1?t.setNode(e,n):t.setNode(e)}),this},Li.prototype.setNode=function(e,n){return Ai.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=n),this):(this._nodes[e]=arguments.length>1?n:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=Si,this._children[e]={},this._children[Si][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},Li.prototype.node=function(e){return this._nodes[e]},Li.prototype.hasNode=function(e){return Ai.has(this._nodes,e)},Li.prototype.removeNode=function(e){var n=this;if(Ai.has(this._nodes,e)){var r=function(e){n.removeEdge(n._edgeObjs[e])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],Ai.each(this.children(e),function(e){n.setParent(e)}),delete this._children[e]),Ai.each(Ai.keys(this._in[e]),r),delete this._in[e],delete this._preds[e],Ai.each(Ai.keys(this._out[e]),r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},Li.prototype.setParent=function(e,n){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(Ai.isUndefined(n))n=Si;else{for(var r=n+="";!Ai.isUndefined(r);r=this.parent(r))if(r===e)throw new Error("Setting "+n+" as parent of "+e+" would create a cycle");this.setNode(n)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=n,this._children[n][e]=!0,this},Li.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},Li.prototype.parent=function(e){if(this._isCompound){var n=this._parent[e];if(n!==Si)return n}},Li.prototype.children=function(e){if(Ai.isUndefined(e)&&(e=Si),this._isCompound){var n=this._children[e];if(n)return Ai.keys(n)}else{if(e===Si)return this.nodes();if(this.hasNode(e))return[]}},Li.prototype.predecessors=function(e){var n=this._preds[e];if(n)return Ai.keys(n)},Li.prototype.successors=function(e){var n=this._sucs[e];if(n)return Ai.keys(n)},Li.prototype.neighbors=function(e){var n=this.predecessors(e);if(n)return Ai.union(n,this.successors(e))},Li.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},Li.prototype.filterNodes=function(e){var n=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});n.setGraph(this.graph());var r=this;Ai.each(this._nodes,function(r,t){e(t)&&n.setNode(t,r)}),Ai.each(this._edgeObjs,function(e){n.hasNode(e.v)&&n.hasNode(e.w)&&n.setEdge(e,r.edge(e))});var t={};return this._isCompound&&Ai.each(n.nodes(),function(e){n.setParent(e,function e(o){var i=r.parent(o);return void 0===i||n.hasNode(i)?(t[o]=i,i):i in t?t[i]:e(i)}(e))}),n},Li.prototype.setDefaultEdgeLabel=function(e){return Ai.isFunction(e)||(e=Ai.constant(e)),this._defaultEdgeLabelFn=e,this},Li.prototype.edgeCount=function(){return this._edgeCount},Li.prototype.edges=function(){return Ai.values(this._edgeObjs)},Li.prototype.setPath=function(e,n){var r=this,t=arguments;return Ai.reduce(e,function(e,o){return t.length>1?r.setEdge(e,o,n):r.setEdge(e,o),o}),this},Li.prototype.setEdge=function(){var e,n,r,t,o=!1,i=arguments[0];"object"==typeof i&&null!==i&&"v"in i?(e=i.v,n=i.w,r=i.name,2===arguments.length&&(t=arguments[1],o=!0)):(e=i,n=arguments[1],r=arguments[3],arguments.length>2&&(t=arguments[2],o=!0)),e=""+e,n=""+n,Ai.isUndefined(r)||(r=""+r);var a=Ri(this._isDirected,e,n,r);if(Ai.has(this._edgeLabels,a))return o&&(this._edgeLabels[a]=t),this;if(!Ai.isUndefined(r)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(n),this._edgeLabels[a]=o?t:this._defaultEdgeLabelFn(e,n,r);var u=function(e,n,r,t){var o=""+n,i=""+r;if(!e&&o>i){var a=o;o=i,i=a}var u={v:o,w:i};t&&(u.name=t);return u}(this._isDirected,e,n,r);return e=u.v,n=u.w,Object.freeze(u),this._edgeObjs[a]=u,Ti(this._preds[n],e),Ti(this._sucs[e],n),this._in[n][a]=u,this._out[e][a]=u,this._edgeCount++,this},Li.prototype.edge=function(e,n,r){var t=1===arguments.length?zi(this._isDirected,arguments[0]):Ri(this._isDirected,e,n,r);return this._edgeLabels[t]},Li.prototype.hasEdge=function(e,n,r){var t=1===arguments.length?zi(this._isDirected,arguments[0]):Ri(this._isDirected,e,n,r);return Ai.has(this._edgeLabels,t)},Li.prototype.removeEdge=function(e,n,r){var t=1===arguments.length?zi(this._isDirected,arguments[0]):Ri(this._isDirected,e,n,r),o=this._edgeObjs[t];return o&&(e=o.v,n=o.w,delete this._edgeLabels[t],delete this._edgeObjs[t],Fi(this._preds[n],e),Fi(this._sucs[e],n),delete this._in[n][t],delete this._out[e][t],this._edgeCount--),this},Li.prototype.inEdges=function(e,n){var r=this._in[e];if(r){var t=Ai.values(r);return n?Ai.filter(t,function(e){return e.v===n}):t}},Li.prototype.outEdges=function(e,n){var r=this._out[e];if(r){var t=Ai.values(r);return n?Ai.filter(t,function(e){return e.w===n}):t}},Li.prototype.nodeEdges=function(e,n){var r=this.inEdges(e,n);if(r)return r.concat(this.outEdges(e,n))};var Di={Graph:Ci,version:"2.1.8"},Ui={write:function(e){var n={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:Bi(e),edges:Gi(e)};Ai.isUndefined(e.graph())||(n.value=Ai.clone(e.graph()));return n},read:function(e){var n=new Ci(e.options).setGraph(e.value);return Ai.each(e.nodes,function(e){n.setNode(e.v,e.value),e.parent&&n.setParent(e.v,e.parent)}),Ai.each(e.edges,function(e){n.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),n}};function Bi(e){return Ai.map(e.nodes(),function(n){var r=e.node(n),t=e.parent(n),o={v:n};return Ai.isUndefined(r)||(o.value=r),Ai.isUndefined(t)||(o.parent=t),o})}function Gi(e){return Ai.map(e.edges(),function(n){var r=e.edge(n),t={v:n.v,w:n.w};return Ai.isUndefined(n.name)||(t.name=n.name),Ai.isUndefined(r)||(t.value=r),t})}var Vi=function(e){var n,r={},t=[];function o(t){Ai.has(r,t)||(r[t]=!0,n.push(t),Ai.each(e.successors(t),o),Ai.each(e.predecessors(t),o))}return Ai.each(e.nodes(),function(e){n=[],o(e),n.length&&t.push(n)}),t};var qi=Yi;function Yi(){this._arr=[],this._keyIndices={}}Yi.prototype.size=function(){return this._arr.length},Yi.prototype.keys=function(){return this._arr.map(function(e){return e.key})},Yi.prototype.has=function(e){return Ai.has(this._keyIndices,e)},Yi.prototype.priority=function(e){var n=this._keyIndices[e];if(void 0!==n)return this._arr[n].priority},Yi.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},Yi.prototype.add=function(e,n){var r=this._keyIndices;if(e=String(e),!Ai.has(r,e)){var t=this._arr,o=t.length;return r[e]=o,t.push({key:e,priority:n}),this._decrease(o),!0}return!1},Yi.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},Yi.prototype.decrease=function(e,n){var r=this._keyIndices[e];if(n>this._arr[r].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[r].priority+" New: "+n);this._arr[r].priority=n,this._decrease(r)},Yi.prototype._heapify=function(e){var n=this._arr,r=2*e,t=r+1,o=e;r<n.length&&(o=n[r].priority<n[o].priority?r:o,t<n.length&&(o=n[t].priority<n[o].priority?t:o),o!==e&&(this._swap(e,o),this._heapify(o)))},Yi.prototype._decrease=function(e){for(var n,r=this._arr,t=r[e].priority;0!==e&&!(r[n=e>>1].priority<t);)this._swap(e,n),e=n},Yi.prototype._swap=function(e,n){var r=this._arr,t=this._keyIndices,o=r[e],i=r[n];r[e]=i,r[n]=o,t[i.key]=e,t[o.key]=n};var $i=function(e,n,r,t){return function(e,n,r,t){var o,i,a={},u=new qi,c=function(e){var n=e.v!==o?e.v:e.w,t=a[n],c=r(e),s=i.distance+c;if(c<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+c);s<t.distance&&(t.distance=s,t.predecessor=o,u.decrease(n,s))};e.nodes().forEach(function(e){var r=e===n?0:Number.POSITIVE_INFINITY;a[e]={distance:r},u.add(e,r)});for(;u.size()>0&&(o=u.removeMin(),(i=a[o]).distance!==Number.POSITIVE_INFINITY);)t(o).forEach(c);return a}(e,String(n),r||Wi,t||function(n){return e.outEdges(n)})},Wi=Ai.constant(1);var Ki=function(e,n,r){return Ai.transform(e.nodes(),function(t,o){t[o]=$i(e,o,n,r)},{})};var Ji=function(e){var n=0,r=[],t={},o=[];return e.nodes().forEach(function(i){Ai.has(t,i)||function i(a){var u=t[a]={onStack:!0,lowlink:n,index:n++};if(r.push(a),e.successors(a).forEach(function(e){Ai.has(t,e)?t[e].onStack&&(u.lowlink=Math.min(u.lowlink,t[e].index)):(i(e),u.lowlink=Math.min(u.lowlink,t[e].lowlink))}),u.lowlink===u.index){var c,s=[];do{c=r.pop(),t[c].onStack=!1,s.push(c)}while(a!==c);o.push(s)}}(i)}),o};var Qi=function(e){return Ai.filter(Ji(e),function(n){return n.length>1||1===n.length&&e.hasEdge(n[0],n[0])})};var Hi=function(e,n,r){return function(e,n,r){var t={},o=e.nodes();return o.forEach(function(e){t[e]={},t[e][e]={distance:0},o.forEach(function(n){e!==n&&(t[e][n]={distance:Number.POSITIVE_INFINITY})}),r(e).forEach(function(r){var o=r.v===e?r.w:r.v,i=n(r);t[e][o]={distance:i,predecessor:e}})}),o.forEach(function(e){var n=t[e];o.forEach(function(r){var i=t[r];o.forEach(function(r){var t=i[e],o=n[r],a=i[r],u=t.distance+o.distance;u<a.distance&&(a.distance=u,a.predecessor=o.predecessor)})})}),t}(e,n||Xi,r||function(n){return e.outEdges(n)})},Xi=Ai.constant(1);var Zi=ea;function ea(e){var n={},r={},t=[];if(Ai.each(e.sinks(),function o(i){if(Ai.has(r,i))throw new na;Ai.has(n,i)||(r[i]=!0,n[i]=!0,Ai.each(e.predecessors(i),o),delete r[i],t.push(i))}),Ai.size(n)!==e.nodeCount())throw new na;return t}function na(){}ea.CycleException=na,na.prototype=new Error;var ra=function(e,n,r){Ai.isArray(n)||(n=[n]);var t=(e.isDirected()?e.successors:e.neighbors).bind(e),o=[],i={};return Ai.each(n,function(n){if(!e.hasNode(n))throw new Error("Graph does not have node: "+n);!function e(n,r,t,o,i,a){Ai.has(o,r)||(o[r]=!0,t||a.push(r),Ai.each(i(r),function(r){e(n,r,t,o,i,a)}),t&&a.push(r))}(e,n,"post"===r,i,t,o)}),o};var ta,oa={Graph:Di.Graph,json:Ui,alg:{components:Vi,dijkstra:$i,dijkstraAll:Ki,findCycles:Qi,floydWarshall:Hi,isAcyclic:function(e){try{Zi(e)}catch(e){if(e instanceof Zi.CycleException)return!1;throw e}return!0},postorder:function(e,n){return ra(e,n,"post")},preorder:function(e,n){return ra(e,n,"pre")},prim:function(e,n){var r,t=new Ci,o={},i=new qi;function a(e){var t=e.v===r?e.w:e.v,a=i.priority(t);if(void 0!==a){var u=n(e);u<a&&(o[t]=r,i.decrease(t,u))}}if(0===e.nodeCount())return t;Ai.each(e.nodes(),function(e){i.add(e,Number.POSITIVE_INFINITY),t.setNode(e)}),i.decrease(e.nodes()[0],0);var u=!1;for(;i.size()>0;){if(r=i.removeMin(),Ai.has(o,r))t.setEdge(r,o[r]);else{if(u)throw new Error("Input graph is not connected: "+e);u=!0}e.nodeEdges(r).forEach(a)}return t},tarjan:Ji,topsort:Zi},version:Di.version};try{ta=oa}catch(e){}ta||(ta=window.graphlib);var ia=ta,aa=1,ua=4;var ca=function(e){return zr(e,aa|ua)};var sa=function(e,n,r){if(!S(r))return!1;var t=typeof n;return!!("number"==t?cn(r)&&qe(n,r.length):"string"==t&&n in r)&&o(r[n],e)},fa=Object.prototype,da=fa.hasOwnProperty,ha=vi(function(e,n){e=Object(e);var r=-1,t=n.length,i=t>2?n[2]:void 0;for(i&&sa(n[0],n[1],i)&&(t=1);++r<t;)for(var a=n[r],u=ln(a),c=-1,s=u.length;++c<s;){var f=u[c],d=e[f];(void 0===d||o(d,fa[f])&&!da.call(e,f))&&(e[f]=a[f])}return e});var va=function(e){return function(n,r,t){var o=Object(n);if(!cn(n)){var i=mo(r);n=sn(n),r=function(e){return i(o[e],e,o)}}var a=e(n,r,t);return a>-1?o[i?n[a]:a]:void 0}},la=/\\s/;var pa=function(e){for(var n=e.length;n--&&la.test(e.charAt(n)););return n},ga=/^\\s+/;var ya=function(e){return e?e.slice(0,pa(e)+1).replace(ga,""):e},ba=NaN,_a=/^[-+]0x[0-9a-f]+$/i,ma=/^0b[01]+$/i,wa=/^0o[0-7]+$/i,Ea=parseInt;var ja=function(e){if("number"==typeof e)return e;if(Gt(e))return ba;if(S(e)){var n="function"==typeof e.valueOf?e.valueOf():e;e=S(n)?n+"":n}if("string"!=typeof e)return 0===e?e:+e;e=ya(e);var r=ma.test(e);return r||wa.test(e)?Ea(e.slice(2),r?2:8):_a.test(e)?ba:+e},ka=1/0,xa=1.7976931348623157e308;var Na=function(e){return e?(e=ja(e))===ka||e===-ka?(e<0?-1:1)*xa:e==e?e:0:0===e?e:0};var Oa=function(e){var n=Na(e),r=n%1;return n==n?r?n-r:n:0},Ia=Math.max;var Aa=va(function(e,n,r){var t=null==e?0:e.length;if(!t)return-1;var o=null==r?0:Oa(r);return o<0&&(o=Ia(t+o,0)),li(e,mo(n),o)});var Ca=function(e){return null!=e&&e.length?oi(e,1):[]};var Ma=function(e,n){return null==e?e:Gr(e,$r(n),ln)};var Sa=function(e){var n=null==e?0:e.length;return n?e[n-1]:void 0};var Pa=function(e,n){var r={};return n=mo(n),Vr(e,function(e,t,o){Oe(r,t,n(e,t,o))}),r};var La=function(e,n,r){for(var t=-1,o=e.length;++t<o;){var i=e[t],a=n(i);if(null!=a&&(void 0===u?a==a&&!Gt(a):r(a,u)))var u=a,c=i}return c};var Ta=function(e,n){return e>n};var Fa=function(e){return e&&e.length?La(e,Yr,Ta):void 0};var Ra=function(e,n,r){(void 0===r||o(e[n],r))&&(void 0!==r||n in e)||Oe(e,n,r)},za="[object Object]",Da=Function.prototype,Ua=Object.prototype,Ba=Da.toString,Ga=Ua.hasOwnProperty,Va=Ba.call(Object);var qa=function(e){if(!Se(e)||M(e)!=za)return!1;var n=xn(e);if(null===n)return!0;var r=Ga.call(n,"constructor")&&n.constructor;return"function"==typeof r&&r instanceof r&&Ba.call(r)==Va};var Ya=function(e,n){if(("constructor"!==n||"function"!=typeof e[n])&&"__proto__"!=n)return e[n]};var $a=function(e){return Ce(e,ln(e))};var Wa=function(e,n,r,t,o,i,a){var u=Ya(e,r),c=Ya(n,r),s=a.get(c);if(s)Ra(e,r,s);else{var f=i?i(u,c,r+"",e,n,a):void 0,d=void 0===f;if(d){var h=De(c),v=!h&&Be(c),l=!h&&!v&&Xe(c);f=c,h||v||l?De(u)?f=u:ki(u)?f=yn(u):v?(d=!1,f=gn(c,!0)):l?(d=!1,f=Xn(c,!0)):f=[]:qa(c)||ze(c)?(f=u,ze(u)?f=$a(u):S(u)&&!z(u)||(f=wr(c))):d=!1}d&&(a.set(c,f),o(f,c,t,i,a),a.delete(c)),Ra(e,r,f)}};var Ka=function e(n,r,t,o,i){n!==r&&Gr(r,function(a,u){if(i||(i=new ke),S(a))Wa(n,r,u,t,e,o,i);else{var c=o?o(Ya(n,u),a,u+"",n,r,i):void 0;void 0===c&&(c=a),Ra(n,u,c)}},ln)};var Ja=function(e){return vi(function(n,r){var t=-1,o=r.length,i=o>1?r[o-1]:void 0,a=o>2?r[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,a&&sa(r[0],r[1],a)&&(i=o<3?void 0:i,o=1),n=Object(n);++t<o;){var u=r[t];u&&e(n,u,t,i)}return n})}(function(e,n,r){Ka(e,n,r)});var Qa=function(e,n){return e<n};var Ha=function(e){return e&&e.length?La(e,Yr,Qa):void 0};var Xa=function(e,n){return e&&e.length?La(e,mo(n),Qa):void 0},Za=function(){return _.Date.now()};var eu=function(e,n,r,t){if(!S(e))return e;for(var o=-1,i=(n=io(n,e)).length,a=i-1,u=e;null!=u&&++o<i;){var c=uo(n[o]),s=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=a){var f=u[c];void 0===(s=t?t(f,c,u):void 0)&&(s=S(f)?f:qe(n[o+1])?[]:{})}Ae(u,c,s),u=u[c]}return e};var nu=function(e,n,r){for(var t=-1,o=n.length,i={};++t<o;){var a=n[t],u=co(e,a);r(u,a)&&eu(i,io(a,e),u)}return i};var ru=function(e,n){return nu(e,n,function(n,r){return vo(e,r)})};var tu=function(e){return hi(ui(e,void 0,Ca),e+"")}(function(e,n){return null==e?{}:ru(e,n)}),ou=Math.ceil,iu=Math.max;var au=function(e,n,r,t){for(var o=-1,i=iu(ou((n-e)/(r||1)),0),a=Array(i);i--;)a[t?i:++o]=e,e+=r;return a};var uu=function(e){return function(n,r,t){return t&&"number"!=typeof t&&sa(n,r,t)&&(r=t=void 0),n=Na(n),void 0===r?(r=n,n=0):r=Na(r),t=void 0===t?n<r?1:-1:Na(t),au(n,r,t,e)}}();var cu=function(e,n){var r=e.length;for(e.sort(n);r--;)e[r]=e[r].value;return e};var su=function(e,n){if(e!==n){var r=void 0!==e,t=null===e,o=e==e,i=Gt(e),a=void 0!==n,u=null===n,c=n==n,s=Gt(n);if(!u&&!s&&!i&&e>n||i&&a&&c&&!u&&!s||t&&a&&c||!r&&c||!o)return 1;if(!t&&!i&&!s&&e<n||s&&r&&o&&!t&&!i||u&&r&&o||!a&&o||!c)return-1}return 0};var fu=function(e,n,r){for(var t=-1,o=e.criteria,i=n.criteria,a=o.length,u=r.length;++t<a;){var c=su(o[t],i[t]);if(c)return t>=u?c:c*("desc"==r[t]?-1:1)}return e.index-n.index};var du=function(e,n,r){n=n.length?Zt(n,function(e){return De(e)?function(n){return co(n,1===e.length?e[0]:e)}:e}):[Yr];var t=-1;n=Zt(n,Je(mo));var o=Co(e,function(e,r,o){return{criteria:Zt(n,function(n){return n(e)}),index:++t,value:e}});return cu(o,function(e,n){return fu(e,n,r)})},hu=vi(function(e,n){if(null==e)return[];var r=n.length;return r>1&&sa(e,n[0],n[1])?n=[]:r>2&&sa(n[0],n[1],n[2])&&(n=[n[0]]),du(e,oi(n,1),[])}),vu=0;var lu=function(e){var n=++vu;return oo(e)+n};var pu=function(e,n,r){for(var t=-1,o=e.length,i=n.length,a={};++t<o;){var u=t<i?n[t]:void 0;r(a,e[t],u)}return a};var gu,yu=function(e,n){return pu(e||[],n||[],Ae)};try{gu={cloneDeep:ca,constant:Br,defaults:ha,each:Kr,filter:wo,find:Aa,flatten:Ca,forEach:Wr,forIn:Ma,has:ko,isUndefined:Ao,last:Sa,map:Mo,mapValues:Pa,max:Fa,merge:Ja,min:Ha,minBy:Xa,now:Za,pick:tu,range:uu,reduce:Lo,sortBy:hu,uniqueId:lu,values:Ii,zipObject:yu}}catch(e){}gu||(gu=window._);var bu=gu,_u=mu;function mu(){var e={};e._next=e._prev=e,this._sentinel=e}function wu(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Eu(e,n){if("_next"!==e&&"_prev"!==e)return n}mu.prototype.dequeue=function(){var e=this._sentinel,n=e._prev;if(n!==e)return wu(n),n},mu.prototype.enqueue=function(e){var n=this._sentinel;e._prev&&e._next&&wu(e),e._next=n._next,n._next._prev=e,n._next=e,e._prev=n},mu.prototype.toString=function(){for(var e=[],n=this._sentinel,r=n._prev;r!==n;)e.push(JSON.stringify(r,Eu)),r=r._prev;return"["+e.join(", ")+"]"};var ju=ia.Graph,ku=function(e,n){if(e.nodeCount()<=1)return[];var r=function(e,n){var r=new ju,t=0,o=0;bu.forEach(e.nodes(),function(e){r.setNode(e,{v:e,in:0,out:0})}),bu.forEach(e.edges(),function(e){var i=r.edge(e.v,e.w)||0,a=n(e),u=i+a;r.setEdge(e.v,e.w,u),o=Math.max(o,r.node(e.v).out+=a),t=Math.max(t,r.node(e.w).in+=a)});var i=bu.range(o+t+3).map(function(){return new _u}),a=t+1;return bu.forEach(r.nodes(),function(e){Ou(i,a,r.node(e))}),{graph:r,buckets:i,zeroIdx:a}}(e,n||xu),t=function(e,n,r){var t,o=[],i=n[n.length-1],a=n[0];for(;e.nodeCount();){for(;t=a.dequeue();)Nu(e,n,r,t);for(;t=i.dequeue();)Nu(e,n,r,t);if(e.nodeCount())for(var u=n.length-2;u>0;--u)if(t=n[u].dequeue()){o=o.concat(Nu(e,n,r,t,!0));break}}return o}(r.graph,r.buckets,r.zeroIdx);return bu.flatten(bu.map(t,function(n){return e.outEdges(n.v,n.w)}),!0)},xu=bu.constant(1);function Nu(e,n,r,t,o){var i=o?[]:void 0;return bu.forEach(e.inEdges(t.v),function(t){var a=e.edge(t),u=e.node(t.v);o&&i.push({v:t.v,w:t.w}),u.out-=a,Ou(n,r,u)}),bu.forEach(e.outEdges(t.v),function(t){var o=e.edge(t),i=t.w,a=e.node(i);a.in-=o,Ou(n,r,a)}),e.removeNode(t.v),i}function Ou(e,n,r){r.out?r.in?e[r.out-r.in+n].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}var Iu={run:function(e){var n="greedy"===e.graph().acyclicer?ku(e,function(e){return function(n){return e.edge(n).weight}}(e)):function(e){var n=[],r={},t={};return bu.forEach(e.nodes(),function o(i){bu.has(t,i)||(t[i]=!0,r[i]=!0,bu.forEach(e.outEdges(i),function(e){bu.has(r,e.w)?n.push(e):o(e.w)}),delete r[i])}),n}(e);bu.forEach(n,function(n){var r=e.edge(n);e.removeEdge(n),r.forwardName=n.name,r.reversed=!0,e.setEdge(n.w,n.v,r,bu.uniqueId("rev"))})},undo:function(e){bu.forEach(e.edges(),function(n){var r=e.edge(n);if(r.reversed){e.removeEdge(n);var t=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(n.w,n.v,r,t)}})}};var Au=ia.Graph,Cu={addDummyNode:Mu,simplify:function(e){var n=(new Au).setGraph(e.graph());return bu.forEach(e.nodes(),function(r){n.setNode(r,e.node(r))}),bu.forEach(e.edges(),function(r){var t=n.edge(r.v,r.w)||{weight:0,minlen:1},o=e.edge(r);n.setEdge(r.v,r.w,{weight:t.weight+o.weight,minlen:Math.max(t.minlen,o.minlen)})}),n},asNonCompoundGraph:function(e){var n=new Au({multigraph:e.isMultigraph()}).setGraph(e.graph());return bu.forEach(e.nodes(),function(r){e.children(r).length||n.setNode(r,e.node(r))}),bu.forEach(e.edges(),function(r){n.setEdge(r,e.edge(r))}),n},successorWeights:function(e){var n=bu.map(e.nodes(),function(n){var r={};return bu.forEach(e.outEdges(n),function(n){r[n.w]=(r[n.w]||0)+e.edge(n).weight}),r});return bu.zipObject(e.nodes(),n)},predecessorWeights:function(e){var n=bu.map(e.nodes(),function(n){var r={};return bu.forEach(e.inEdges(n),function(n){r[n.v]=(r[n.v]||0)+e.edge(n).weight}),r});return bu.zipObject(e.nodes(),n)},intersectRect:function(e,n){var r,t,o=e.x,i=e.y,a=n.x-o,u=n.y-i,c=e.width/2,s=e.height/2;if(!a&&!u)throw new Error("Not possible to find intersection inside of the rectangle");Math.abs(u)*c>Math.abs(a)*s?(u<0&&(s=-s),r=s*a/u,t=s):(a<0&&(c=-c),r=c,t=c*u/a);return{x:o+r,y:i+t}},buildLayerMatrix:function(e){var n=bu.map(bu.range(Su(e)+1),function(){return[]});return bu.forEach(e.nodes(),function(r){var t=e.node(r),o=t.rank;bu.isUndefined(o)||(n[o][t.order]=r)}),n},normalizeRanks:function(e){var n=bu.min(bu.map(e.nodes(),function(n){return e.node(n).rank}));bu.forEach(e.nodes(),function(r){var t=e.node(r);bu.has(t,"rank")&&(t.rank-=n)})},removeEmptyRanks:function(e){var n=bu.min(bu.map(e.nodes(),function(n){return e.node(n).rank})),r=[];bu.forEach(e.nodes(),function(t){var o=e.node(t).rank-n;r[o]||(r[o]=[]),r[o].push(t)});var t=0,o=e.graph().nodeRankFactor;bu.forEach(r,function(n,r){bu.isUndefined(n)&&r%o!=0?--t:t&&bu.forEach(n,function(n){e.node(n).rank+=t})})},addBorderNode:function(e,n,r,t){var o={width:0,height:0};arguments.length>=4&&(o.rank=r,o.order=t);return Mu(e,"border",o,n)},maxRank:Su,partition:function(e,n){var r={lhs:[],rhs:[]};return bu.forEach(e,function(e){n(e)?r.lhs.push(e):r.rhs.push(e)}),r},time:function(e,n){var r=bu.now();try{return n()}finally{console.log(e+" time: "+(bu.now()-r)+"ms")}},notime:function(e,n){return n()}};function Mu(e,n,r,t){var o;do{o=bu.uniqueId(t)}while(e.hasNode(o));return r.dummy=n,e.setNode(o,r),o}function Su(e){return bu.max(bu.map(e.nodes(),function(n){var r=e.node(n).rank;if(!bu.isUndefined(r))return r}))}var Pu={run:function(e){e.graph().dummyChains=[],bu.forEach(e.edges(),function(n){!function(e,n){var r,t,o,i=n.v,a=e.node(i).rank,u=n.w,c=e.node(u).rank,s=n.name,f=e.edge(n),d=f.labelRank;if(c===a+1)return;for(e.removeEdge(n),o=0,++a;a<c;++o,++a)f.points=[],t={width:0,height:0,edgeLabel:f,edgeObj:n,rank:a},r=Cu.addDummyNode(e,"edge",t,"_d"),a===d&&(t.width=f.width,t.height=f.height,t.dummy="edge-label",t.labelpos=f.labelpos),e.setEdge(i,r,{weight:f.weight},s),0===o&&e.graph().dummyChains.push(r),i=r;e.setEdge(i,u,{weight:f.weight},s)}(e,n)})},undo:function(e){bu.forEach(e.graph().dummyChains,function(n){var r,t=e.node(n),o=t.edgeLabel;for(e.setEdge(t.edgeObj,o);t.dummy;)r=e.successors(n)[0],e.removeNode(n),o.points.push({x:t.x,y:t.y}),"edge-label"===t.dummy&&(o.x=t.x,o.y=t.y,o.width=t.width,o.height=t.height),n=r,t=e.node(n)})}};var Lu=function(e){var n={};bu.forEach(e.sources(),function r(t){var o=e.node(t);if(bu.has(n,t))return o.rank;n[t]=!0;var i=bu.min(bu.map(e.outEdges(t),function(n){return r(n.w)-e.edge(n).minlen}));i!==Number.POSITIVE_INFINITY&&null!=i||(i=0);return o.rank=i})},Tu=function(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen};var Fu=ia.Graph,Ru=Tu,zu=function(e){var n,r,t=new Fu({directed:!1}),o=e.nodes()[0],i=e.nodeCount();t.setNode(o,{});for(;Du(t,e)<i;)n=Uu(t,e),r=t.hasNode(n.v)?Ru(e,n):-Ru(e,n),Bu(t,e,r);return t};function Du(e,n){return bu.forEach(e.nodes(),function r(t){bu.forEach(n.nodeEdges(t),function(o){var i=o.v,a=t===i?o.w:i;e.hasNode(a)||Ru(n,o)||(e.setNode(a,{}),e.setEdge(t,a,{}),r(a))})}),e.nodeCount()}function Uu(e,n){return bu.minBy(n.edges(),function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return Ru(n,r)})}function Bu(e,n,r){bu.forEach(e.nodes(),function(e){n.node(e).rank+=r})}var Gu=Tu,Vu=Lu,qu=ia.alg.preorder,Yu=ia.alg.postorder,$u=Cu.simplify,Wu=Ku;function Ku(e){e=$u(e),Vu(e);var n,r=zu(e);for(Hu(r),Ju(r,e);n=Xu(r);)ec(r,e,n,Zu(r,e,n))}function Ju(e,n){var r=Yu(e,e.nodes());r=r.slice(0,r.length-1),bu.forEach(r,function(r){!function(e,n,r){var t=e.node(r).parent;e.edge(r,t).cutvalue=Qu(e,n,r)}(e,n,r)})}function Qu(e,n,r){var t=e.node(r).parent,o=!0,i=n.edge(r,t),a=0;return i||(o=!1,i=n.edge(t,r)),a=i.weight,bu.forEach(n.nodeEdges(r),function(i){var u,c,s=i.v===r,f=s?i.w:i.v;if(f!==t){var d=s===o,h=n.edge(i).weight;if(a+=d?h:-h,u=r,c=f,e.hasEdge(u,c)){var v=e.edge(r,f).cutvalue;a+=d?-v:v}}}),a}function Hu(e,n){arguments.length<2&&(n=e.nodes()[0]),function e(n,r,t,o,i){var a=t;var u=n.node(o);r[o]=!0;bu.forEach(n.neighbors(o),function(i){bu.has(r,i)||(t=e(n,r,t,i,o))});u.low=a;u.lim=t++;i?u.parent=i:delete u.parent;return t}(e,{},1,n)}function Xu(e){return bu.find(e.edges(),function(n){return e.edge(n).cutvalue<0})}function Zu(e,n,r){var t=r.v,o=r.w;n.hasEdge(t,o)||(t=r.w,o=r.v);var i=e.node(t),a=e.node(o),u=i,c=!1;i.lim>a.lim&&(u=a,c=!0);var s=bu.filter(n.edges(),function(n){return c===nc(e,e.node(n.v),u)&&c!==nc(e,e.node(n.w),u)});return bu.minBy(s,function(e){return Gu(n,e)})}function ec(e,n,r,t){var o=r.v,i=r.w;e.removeEdge(o,i),e.setEdge(t.v,t.w,{}),Hu(e),Ju(e,n),function(e,n){var r=bu.find(e.nodes(),function(e){return!n.node(e).parent}),t=qu(e,r);t=t.slice(1),bu.forEach(t,function(r){var t=e.node(r).parent,o=n.edge(r,t),i=!1;o||(o=n.edge(t,r),i=!0),n.node(r).rank=n.node(t).rank+(i?o.minlen:-o.minlen)})}(e,n)}function nc(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}Ku.initLowLimValues=Hu,Ku.initCutValues=Ju,Ku.calcCutValue=Qu,Ku.leaveEdge=Xu,Ku.enterEdge=Zu,Ku.exchangeEdges=ec;var rc=Lu,tc=function(e){switch(e.graph().ranker){case"network-simplex":ic(e);break;case"tight-tree":!function(e){rc(e),zu(e)}(e);break;case"longest-path":oc(e);break;default:ic(e)}};var oc=rc;function ic(e){Wu(e)}var ac=function(e){var n=function(e){var n={},r=0;return bu.forEach(e.children(),function t(o){var i=r;bu.forEach(e.children(o),t),n[o]={low:i,lim:r++}}),n}(e);bu.forEach(e.graph().dummyChains,function(r){for(var t=e.node(r),o=t.edgeObj,i=function(e,n,r,t){var o,i,a=[],u=[],c=Math.min(n[r].low,n[t].low),s=Math.max(n[r].lim,n[t].lim);o=r;do{o=e.parent(o),a.push(o)}while(o&&(n[o].low>c||s>n[o].lim));i=o,o=t;for(;(o=e.parent(o))!==i;)u.push(o);return{path:a.concat(u.reverse()),lca:i}}(e,n,o.v,o.w),a=i.path,u=i.lca,c=0,s=a[c],f=!0;r!==o.w;){if(t=e.node(r),f){for(;(s=a[c])!==u&&e.node(s).maxRank<t.rank;)c++;s===u&&(f=!1)}if(!f){for(;c<a.length-1&&e.node(s=a[c+1]).minRank<=t.rank;)c++;s=a[c]}e.setParent(r,s),r=e.successors(r)[0]}})};var uc={run:function(e){var n=Cu.addDummyNode(e,"root",{},"_root"),r=function(e){var n={};return bu.forEach(e.children(),function(r){!function r(t,o){var i=e.children(t);i&&i.length&&bu.forEach(i,function(e){r(e,o+1)}),n[t]=o}(r,1)}),n}(e),t=bu.max(bu.values(r))-1,o=2*t+1;e.graph().nestingRoot=n,bu.forEach(e.edges(),function(n){e.edge(n).minlen*=o});var i=function(e){return bu.reduce(e.edges(),function(n,r){return n+e.edge(r).weight},0)}(e)+1;bu.forEach(e.children(),function(a){!function e(n,r,t,o,i,a,u){var c=n.children(u);if(!c.length)return void(u!==r&&n.setEdge(r,u,{weight:0,minlen:t}));var s=Cu.addBorderNode(n,"_bt");var f=Cu.addBorderNode(n,"_bb");var d=n.node(u);n.setParent(s,u);d.borderTop=s;n.setParent(f,u);d.borderBottom=f;bu.forEach(c,function(c){e(n,r,t,o,i,a,c);var d=n.node(c),h=d.borderTop?d.borderTop:c,v=d.borderBottom?d.borderBottom:c,l=d.borderTop?o:2*o,p=h!==v?1:i-a[u]+1;n.setEdge(s,h,{weight:l,minlen:p,nestingEdge:!0}),n.setEdge(v,f,{weight:l,minlen:p,nestingEdge:!0})});n.parent(u)||n.setEdge(r,s,{weight:0,minlen:i+a[u]})}(e,n,o,i,t,r,a)}),e.graph().nodeRankFactor=o},cleanup:function(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,bu.forEach(e.edges(),function(n){var r=e.edge(n);r.nestingEdge&&e.removeEdge(n)})}};var cc=function(e){bu.forEach(e.children(),function n(r){var t=e.children(r);var o=e.node(r);t.length&&bu.forEach(t,n);if(bu.has(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var i=o.minRank,a=o.maxRank+1;i<a;++i)sc(e,"borderLeft","_bl",r,o,i),sc(e,"borderRight","_br",r,o,i)}})};function sc(e,n,r,t,o,i){var a={width:0,height:0,rank:i,borderType:n},u=o[n][i-1],c=Cu.addDummyNode(e,"border",a,r);o[n][i]=c,e.setParent(c,t),u&&e.setEdge(u,c,{weight:1})}var fc={adjust:function(e){var n=e.graph().rankdir.toLowerCase();"lr"!==n&&"rl"!==n||dc(e)},undo:function(e){var n=e.graph().rankdir.toLowerCase();"bt"!==n&&"rl"!==n||function(e){bu.forEach(e.nodes(),function(n){vc(e.node(n))}),bu.forEach(e.edges(),function(n){var r=e.edge(n);bu.forEach(r.points,vc),bu.has(r,"y")&&vc(r)})}(e);"lr"!==n&&"rl"!==n||(!function(e){bu.forEach(e.nodes(),function(n){lc(e.node(n))}),bu.forEach(e.edges(),function(n){var r=e.edge(n);bu.forEach(r.points,lc),bu.has(r,"x")&&lc(r)})}(e),dc(e))}};function dc(e){bu.forEach(e.nodes(),function(n){hc(e.node(n))}),bu.forEach(e.edges(),function(n){hc(e.edge(n))})}function hc(e){var n=e.width;e.width=e.height,e.height=n}function vc(e){e.y=-e.y}function lc(e){var n=e.x;e.x=e.y,e.y=n}var pc=function(e){var n={},r=bu.filter(e.nodes(),function(n){return!e.children(n).length}),t=bu.max(bu.map(r,function(n){return e.node(n).rank})),o=bu.map(bu.range(t+1),function(){return[]});var i=bu.sortBy(r,function(n){return e.node(n).rank});return bu.forEach(i,function r(t){if(!bu.has(n,t)){n[t]=!0;var i=e.node(t);o[i.rank].push(t),bu.forEach(e.successors(t),r)}}),o};var gc=function(e,n){for(var r=0,t=1;t<n.length;++t)r+=yc(e,n[t-1],n[t]);return r};function yc(e,n,r){for(var t=bu.zipObject(r,bu.map(r,function(e,n){return n})),o=bu.flatten(bu.map(n,function(n){return bu.sortBy(bu.map(e.outEdges(n),function(n){return{pos:t[n.w],weight:e.edge(n).weight}}),"pos")}),!0),i=1;i<r.length;)i<<=1;var a=2*i-1;i-=1;var u=bu.map(new Array(a),function(){return 0}),c=0;return bu.forEach(o.forEach(function(e){var n=e.pos+i;u[n]+=e.weight;for(var r=0;n>0;)n%2&&(r+=u[n+1]),u[n=n-1>>1]+=e.weight;c+=e.weight*r})),c}var bc=function(e,n){return bu.map(n,function(n){var r=e.inEdges(n);if(r.length){var t=bu.reduce(r,function(n,r){var t=e.edge(r),o=e.node(r.v);return{sum:n.sum+t.weight*o.order,weight:n.weight+t.weight}},{sum:0,weight:0});return{v:n,barycenter:t.sum/t.weight,weight:t.weight}}return{v:n}})};var _c=function(e,n){var r={};return bu.forEach(e,function(e,n){var t=r[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:n};bu.isUndefined(e.barycenter)||(t.barycenter=e.barycenter,t.weight=e.weight)}),bu.forEach(n.edges(),function(e){var n=r[e.v],t=r[e.w];bu.isUndefined(n)||bu.isUndefined(t)||(t.indegree++,n.out.push(r[e.w]))}),function(e){var n=[];function r(e){return function(n){var r,t,o,i;n.merged||(bu.isUndefined(n.barycenter)||bu.isUndefined(e.barycenter)||n.barycenter>=e.barycenter)&&(t=n,o=0,i=0,(r=e).weight&&(o+=r.barycenter*r.weight,i+=r.weight),t.weight&&(o+=t.barycenter*t.weight,i+=t.weight),r.vs=t.vs.concat(r.vs),r.barycenter=o/i,r.weight=i,r.i=Math.min(t.i,r.i),t.merged=!0)}}function t(n){return function(r){r.in.push(n),0==--r.indegree&&e.push(r)}}for(;e.length;){var o=e.pop();n.push(o),bu.forEach(o.in.reverse(),r(o)),bu.forEach(o.out,t(o))}return bu.map(bu.filter(n,function(e){return!e.merged}),function(e){return bu.pick(e,["vs","i","barycenter","weight"])})}(bu.filter(r,function(e){return!e.indegree}))};var mc=function(e,n){var r=Cu.partition(e,function(e){return bu.has(e,"barycenter")}),t=r.lhs,o=bu.sortBy(r.rhs,function(e){return-e.i}),i=[],a=0,u=0,c=0;t.sort((s=!!n,function(e,n){return e.barycenter<n.barycenter?-1:e.barycenter>n.barycenter?1:s?n.i-e.i:e.i-n.i})),c=wc(i,o,c),bu.forEach(t,function(e){c+=e.vs.length,i.push(e.vs),a+=e.barycenter*e.weight,u+=e.weight,c=wc(i,o,c)});var s;var f={vs:bu.flatten(i,!0)};u&&(f.barycenter=a/u,f.weight=u);return f};function wc(e,n,r){for(var t;n.length&&(t=bu.last(n)).i<=r;)n.pop(),e.push(t.vs),r++;return r}var Ec=function e(n,r,t,o){var i=n.children(r);var a=n.node(r);var u=a?a.borderLeft:void 0;var c=a?a.borderRight:void 0;var s={};u&&(i=bu.filter(i,function(e){return e!==u&&e!==c}));var f=bc(n,i);bu.forEach(f,function(r){if(n.children(r.v).length){var i=e(n,r.v,t,o);s[r.v]=i,bu.has(i,"barycenter")&&(a=r,u=i,bu.isUndefined(a.barycenter)?(a.barycenter=u.barycenter,a.weight=u.weight):(a.barycenter=(a.barycenter*a.weight+u.barycenter*u.weight)/(a.weight+u.weight),a.weight+=u.weight))}var a,u});var d=_c(f,t);!function(e,n){bu.forEach(e,function(e){e.vs=bu.flatten(e.vs.map(function(e){return n[e]?n[e].vs:e}),!0)})}(d,s);var h=mc(d,o);if(u&&(h.vs=bu.flatten([u,h.vs,c],!0),n.predecessors(u).length)){var v=n.node(n.predecessors(u)[0]),l=n.node(n.predecessors(c)[0]);bu.has(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+v.order+l.order)/(h.weight+2),h.weight+=2}return h};var jc=ia.Graph,kc=function(e,n,r){var t=function(e){var n;for(;e.hasNode(n=bu.uniqueId("_root")););return n}(e),o=new jc({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(n){return e.node(n)});return bu.forEach(e.nodes(),function(i){var a=e.node(i),u=e.parent(i);(a.rank===n||a.minRank<=n&&n<=a.maxRank)&&(o.setNode(i),o.setParent(i,u||t),bu.forEach(e[r](i),function(n){var r=n.v===i?n.w:n.v,t=o.edge(r,i),a=bu.isUndefined(t)?0:t.weight;o.setEdge(r,i,{weight:e.edge(n).weight+a})}),bu.has(a,"minRank")&&o.setNode(i,{borderLeft:a.borderLeft[n],borderRight:a.borderRight[n]}))}),o};var xc=function(e,n,r){var t,o={};bu.forEach(r,function(r){for(var i,a,u=e.parent(r);u;){if((i=e.parent(u))?(a=o[i],o[i]=u):(a=t,t=u),a&&a!==u)return void n.setEdge(a,u);u=i}})};var Nc=ia.Graph,Oc=function(e){var n=Cu.maxRank(e),r=Ic(e,bu.range(1,n+1),"inEdges"),t=Ic(e,bu.range(n-1,-1,-1),"outEdges"),o=pc(e);Cc(e,o);for(var i,a=Number.POSITIVE_INFINITY,u=0,c=0;c<4;++u,++c){Ac(u%2?r:t,u%4>=2),o=Cu.buildLayerMatrix(e);var s=gc(e,o);s<a&&(c=0,i=bu.cloneDeep(o),a=s)}Cc(e,i)};function Ic(e,n,r){return bu.map(n,function(n){return kc(e,n,r)})}function Ac(e,n){var r=new Nc;bu.forEach(e,function(e){var t=e.graph().root,o=Ec(e,t,r,n);bu.forEach(o.vs,function(n,r){e.node(n).order=r}),xc(e,r,o.vs)})}function Cc(e,n){bu.forEach(n,function(n){bu.forEach(n,function(n,r){e.node(n).order=r})})}var Mc=ia.Graph,Sc=function(e){var n,r=Cu.buildLayerMatrix(e),t=bu.merge(Pc(e,r),Lc(e,r)),o={};bu.forEach(["u","d"],function(i){n="u"===i?r:bu.values(r).reverse(),bu.forEach(["l","r"],function(r){"r"===r&&(n=bu.map(n,function(e){return bu.values(e).reverse()}));var a=("u"===i?e.predecessors:e.successors).bind(e),u=Rc(e,n,t,a),c=zc(e,n,u.root,u.align,"r"===r);"r"===r&&(c=bu.mapValues(c,function(e){return-e})),o[i+r]=c})});var i=Dc(e,o);return Uc(o,i),Bc(o,e.graph().align)};function Pc(e,n){var r={};return bu.reduce(n,function(n,t){var o=0,i=0,a=n.length,u=bu.last(t);return bu.forEach(t,function(n,c){var s=function(e,n){if(e.node(n).dummy)return bu.find(e.predecessors(n),function(n){return e.node(n).dummy})}(e,n),f=s?e.node(s).order:a;(s||n===u)&&(bu.forEach(t.slice(i,c+1),function(n){bu.forEach(e.predecessors(n),function(t){var i=e.node(t),a=i.order;!(a<o||f<a)||i.dummy&&e.node(n).dummy||Tc(r,t,n)})}),i=c+1,o=f)}),t}),r}function Lc(e,n){var r={};function t(n,t,o,i,a){var u;bu.forEach(bu.range(t,o),function(t){u=n[t],e.node(u).dummy&&bu.forEach(e.predecessors(u),function(n){var t=e.node(n);t.dummy&&(t.order<i||t.order>a)&&Tc(r,n,u)})})}return bu.reduce(n,function(n,r){var o,i=-1,a=0;return bu.forEach(r,function(u,c){if("border"===e.node(u).dummy){var s=e.predecessors(u);s.length&&(o=e.node(s[0]).order,t(r,a,c,i,o),a=c,i=o)}t(r,a,r.length,o,n.length)}),r}),r}function Tc(e,n,r){if(n>r){var t=n;n=r,r=t}var o=e[n];o||(e[n]=o={}),o[r]=!0}function Fc(e,n,r){if(n>r){var t=n;n=r,r=t}return bu.has(e[n],r)}function Rc(e,n,r,t){var o={},i={},a={};return bu.forEach(n,function(e){bu.forEach(e,function(e,n){o[e]=e,i[e]=e,a[e]=n})}),bu.forEach(n,function(e){var n=-1;bu.forEach(e,function(e){var u=t(e);if(u.length)for(var c=((u=bu.sortBy(u,function(e){return a[e]})).length-1)/2,s=Math.floor(c),f=Math.ceil(c);s<=f;++s){var d=u[s];i[e]===e&&n<a[d]&&!Fc(r,e,d)&&(i[d]=e,i[e]=o[e]=o[d],n=a[d])}})}),{root:o,align:i}}function zc(e,n,r,t,o){var i={},a=function(e,n,r,t){var o=new Mc,i=e.graph(),a=function(e,n,r){return function(t,o,i){var a,u=t.node(o),c=t.node(i),s=0;if(s+=u.width/2,bu.has(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":a=-u.width/2;break;case"r":a=u.width/2}if(a&&(s+=r?a:-a),a=0,s+=(u.dummy?n:e)/2,s+=(c.dummy?n:e)/2,s+=c.width/2,bu.has(c,"labelpos"))switch(c.labelpos.toLowerCase()){case"l":a=c.width/2;break;case"r":a=-c.width/2}return a&&(s+=r?a:-a),a=0,s}}(i.nodesep,i.edgesep,t);return bu.forEach(n,function(n){var t;bu.forEach(n,function(n){var i=r[n];if(o.setNode(i),t){var u=r[t],c=o.edge(u,i);o.setEdge(u,i,Math.max(a(e,n,t),c||0))}t=n})}),o}(e,n,r,o),u=o?"borderLeft":"borderRight";function c(e,n){for(var r=a.nodes(),t=r.pop(),o={};t;)o[t]?e(t):(o[t]=!0,r.push(t),r=r.concat(n(t))),t=r.pop()}return c(function(e){i[e]=a.inEdges(e).reduce(function(e,n){return Math.max(e,i[n.v]+a.edge(n))},0)},a.predecessors.bind(a)),c(function(n){var r=a.outEdges(n).reduce(function(e,n){return Math.min(e,i[n.w]-a.edge(n))},Number.POSITIVE_INFINITY),t=e.node(n);r!==Number.POSITIVE_INFINITY&&t.borderType!==u&&(i[n]=Math.max(i[n],r))},a.successors.bind(a)),bu.forEach(t,function(e){i[e]=i[r[e]]}),i}function Dc(e,n){return bu.minBy(bu.values(n),function(n){var r=Number.NEGATIVE_INFINITY,t=Number.POSITIVE_INFINITY;return bu.forIn(n,function(n,o){var i=function(e,n){return e.node(n).width}(e,o)/2;r=Math.max(n+i,r),t=Math.min(n-i,t)}),r-t})}function Uc(e,n){var r=bu.values(n),t=bu.min(r),o=bu.max(r);bu.forEach(["u","d"],function(r){bu.forEach(["l","r"],function(i){var a,u=r+i,c=e[u];if(c!==n){var s=bu.values(c);(a="l"===i?t-bu.min(s):o-bu.max(s))&&(e[u]=bu.mapValues(c,function(e){return e+a}))}})})}function Bc(e,n){return bu.mapValues(e.ul,function(r,t){if(n)return e[n.toLowerCase()][t];var o=bu.sortBy(bu.map(e,t));return(o[1]+o[2])/2})}var Gc=Sc,Vc=function(e){(function(e){var n=Cu.buildLayerMatrix(e),r=e.graph().ranksep,t=0;bu.forEach(n,function(n){var o=bu.max(bu.map(n,function(n){return e.node(n).height}));bu.forEach(n,function(n){e.node(n).y=t+o/2}),t+=o+r})})(e=Cu.asNonCompoundGraph(e)),bu.forEach(Gc(e),function(n,r){e.node(r).x=n})};var qc=Cu.normalizeRanks,Yc=Cu.removeEmptyRanks,$c=Cu,Wc=ia.Graph,Kc=function(e,n){var r=n&&n.debugTiming?$c.time:$c.notime;r("layout",function(){var n=r(" buildLayoutGraph",function(){return function(e){var n=new Wc({multigraph:!0,compound:!0}),r=os(e.graph());return n.setGraph(bu.merge({},Qc,ts(r,Jc),bu.pick(r,Hc))),bu.forEach(e.nodes(),function(r){var t=os(e.node(r));n.setNode(r,bu.defaults(ts(t,Xc),Zc)),n.setParent(r,e.parent(r))}),bu.forEach(e.edges(),function(r){var t=os(e.edge(r));n.setEdge(r,bu.merge({},ns,ts(t,es),bu.pick(t,rs)))}),n}(e)});r(" runLayout",function(){!function(e,n){n(" makeSpaceForEdgeLabels",function(){!function(e){var n=e.graph();n.ranksep/=2,bu.forEach(e.edges(),function(r){var t=e.edge(r);t.minlen*=2,"c"!==t.labelpos.toLowerCase()&&("TB"===n.rankdir||"BT"===n.rankdir?t.width+=t.labeloffset:t.height+=t.labeloffset)})}(e)}),n(" removeSelfEdges",function(){!function(e){bu.forEach(e.edges(),function(n){if(n.v===n.w){var r=e.node(n.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}})}(e)}),n(" acyclic",function(){Iu.run(e)}),n(" nestingGraph.run",function(){uc.run(e)}),n(" rank",function(){tc($c.asNonCompoundGraph(e))}),n(" injectEdgeLabelProxies",function(){!function(e){bu.forEach(e.edges(),function(n){var r=e.edge(n);if(r.width&&r.height){var t=e.node(n.v),o=e.node(n.w),i={rank:(o.rank-t.rank)/2+t.rank,e:n};$c.addDummyNode(e,"edge-proxy",i,"_ep")}})}(e)}),n(" removeEmptyRanks",function(){Yc(e)}),n(" nestingGraph.cleanup",function(){uc.cleanup(e)}),n(" normalizeRanks",function(){qc(e)}),n(" assignRankMinMax",function(){!function(e){var n=0;bu.forEach(e.nodes(),function(r){var t=e.node(r);t.borderTop&&(t.minRank=e.node(t.borderTop).rank,t.maxRank=e.node(t.borderBottom).rank,n=bu.max(n,t.maxRank))}),e.graph().maxRank=n}(e)}),n(" removeEdgeLabelProxies",function(){!function(e){bu.forEach(e.nodes(),function(n){var r=e.node(n);"edge-proxy"===r.dummy&&(e.edge(r.e).labelRank=r.rank,e.removeNode(n))})}(e)}),n(" normalize.run",function(){Pu.run(e)}),n(" parentDummyChains",function(){ac(e)}),n(" addBorderSegments",function(){cc(e)}),n(" order",function(){Oc(e)}),n(" insertSelfEdges",function(){!function(e){var n=$c.buildLayerMatrix(e);bu.forEach(n,function(n){var r=0;bu.forEach(n,function(n,t){var o=e.node(n);o.order=t+r,bu.forEach(o.selfEdges,function(n){$c.addDummyNode(e,"selfedge",{width:n.label.width,height:n.label.height,rank:o.rank,order:t+ ++r,e:n.e,label:n.label},"_se")}),delete o.selfEdges})})}(e)}),n(" adjustCoordinateSystem",function(){fc.adjust(e)}),n(" position",function(){Vc(e)}),n(" positionSelfEdges",function(){!function(e){bu.forEach(e.nodes(),function(n){var r=e.node(n);if("selfedge"===r.dummy){var t=e.node(r.e.v),o=t.x+t.width/2,i=t.y,a=r.x-o,u=t.height/2;e.setEdge(r.e,r.label),e.removeNode(n),r.label.points=[{x:o+2*a/3,y:i-u},{x:o+5*a/6,y:i-u},{x:o+a,y:i},{x:o+5*a/6,y:i+u},{x:o+2*a/3,y:i+u}],r.label.x=r.x,r.label.y=r.y}})}(e)}),n(" removeBorderNodes",function(){!function(e){bu.forEach(e.nodes(),function(n){if(e.children(n).length){var r=e.node(n),t=e.node(r.borderTop),o=e.node(r.borderBottom),i=e.node(bu.last(r.borderLeft)),a=e.node(bu.last(r.borderRight));r.width=Math.abs(a.x-i.x),r.height=Math.abs(o.y-t.y),r.x=i.x+r.width/2,r.y=t.y+r.height/2}}),bu.forEach(e.nodes(),function(n){"border"===e.node(n).dummy&&e.removeNode(n)})}(e)}),n(" normalize.undo",function(){Pu.undo(e)}),n(" fixupEdgeLabelCoords",function(){!function(e){bu.forEach(e.edges(),function(n){var r=e.edge(n);if(bu.has(r,"x"))switch("l"!==r.labelpos&&"r"!==r.labelpos||(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset}})}(e)}),n(" undoCoordinateSystem",function(){fc.undo(e)}),n(" translateGraph",function(){!function(e){var n=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,o=0,i=e.graph(),a=i.marginx||0,u=i.marginy||0;function c(e){var i=e.x,a=e.y,u=e.width,c=e.height;n=Math.min(n,i-u/2),r=Math.max(r,i+u/2),t=Math.min(t,a-c/2),o=Math.max(o,a+c/2)}bu.forEach(e.nodes(),function(n){c(e.node(n))}),bu.forEach(e.edges(),function(n){var r=e.edge(n);bu.has(r,"x")&&c(r)}),n-=a,t-=u,bu.forEach(e.nodes(),function(r){var o=e.node(r);o.x-=n,o.y-=t}),bu.forEach(e.edges(),function(r){var o=e.edge(r);bu.forEach(o.points,function(e){e.x-=n,e.y-=t}),bu.has(o,"x")&&(o.x-=n),bu.has(o,"y")&&(o.y-=t)}),i.width=r-n+a,i.height=o-t+u}(e)}),n(" assignNodeIntersects",function(){!function(e){bu.forEach(e.edges(),function(n){var r,t,o=e.edge(n),i=e.node(n.v),a=e.node(n.w);o.points?(r=o.points[0],t=o.points[o.points.length-1]):(o.points=[],r=a,t=i),o.points.unshift($c.intersectRect(i,r)),o.points.push($c.intersectRect(a,t))})}(e)}),n(" reversePoints",function(){!function(e){bu.forEach(e.edges(),function(n){var r=e.edge(n);r.reversed&&r.points.reverse()})}(e)}),n(" acyclic.undo",function(){Iu.undo(e)})}(n,r)}),r(" updateInputGraph",function(){!function(e,n){bu.forEach(e.nodes(),function(r){var t=e.node(r),o=n.node(r);t&&(t.x=o.x,t.y=o.y,n.children(r).length&&(t.width=o.width,t.height=o.height))}),bu.forEach(e.edges(),function(r){var t=e.edge(r),o=n.edge(r);t.points=o.points,bu.has(o,"x")&&(t.x=o.x,t.y=o.y)}),e.graph().width=n.graph().width,e.graph().height=n.graph().height}(e,n)})})};var Jc=["nodesep","edgesep","ranksep","marginx","marginy"],Qc={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Hc=["acyclicer","ranker","rankdir","align"],Xc=["width","height"],Zc={width:0,height:0},es=["minlen","weight","width","height","labeloffset"],ns={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},rs=["labelpos"];function ts(e,n){return bu.mapValues(bu.pick(e,n),Number)}function os(e){var n={};return bu.forEach(e,function(e,r){n[r.toLowerCase()]=e}),n}var is=ia.Graph;var as={graphlib:ia,layout:Kc,debug:{debugOrdering:function(e){var n=Cu.buildLayerMatrix(e),r=new is({compound:!0,multigraph:!0}).setGraph({});return bu.forEach(e.nodes(),function(n){r.setNode(n,{label:n}),r.setParent(n,"layer"+e.node(n).rank)}),bu.forEach(e.edges(),function(e){r.setEdge(e.v,e.w,{},e.name)}),bu.forEach(n,function(e,n){var t="layer"+n;r.setNode(t,{rank:"same"}),bu.reduce(e,function(e,n){return r.setEdge(e,n,{style:"invis"}),n})}),r}},util:{time:Cu.time,notime:Cu.notime},version:"0.8.5"},us=as.graphlib,cs=as.layout;n(function(n,r){n.exports=function(){function n(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},t=0,o=void 0,i=void 0,a=function(e,n){v[t]=e,v[t+1]=n,2===(t+=2)&&(i?i(l):_())},u="undefined"!=typeof window?window:void 0,c=u||{},s=c.MutationObserver||c.WebKitMutationObserver,f="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),d="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function h(){var e=setTimeout;return function(){return e(l,1)}}var v=new Array(1e3);function l(){for(var e=0;e<t;e+=2){var n=v[e],r=v[e+1];n(r),v[e]=void 0,v[e+1]=void 0}t=0}var p,g,y,b,_=void 0;function m(e,n){var r=this,t=new this.constructor(j);void 0===t[E]&&F(t);var o=r._state;if(o){var i=arguments[o-1];a(function(){return L(o,t,i,r._result)})}else S(r,t,e,n);return t}function w(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var n=new this(j);return I(n,e),n}f?_=function(){return process.nextTick(l)}:s?(g=0,y=new s(l),b=document.createTextNode(""),y.observe(b,{characterData:!0}),_=function(){b.data=g=++g%2}):d?((p=new MessageChannel).port1.onmessage=l,_=function(){return p.port2.postMessage(0)}):_=void 0===u?function(){try{var e=Function("return this")().require("vertx");return void 0!==(o=e.runOnLoop||e.runOnContext)?function(){o(l)}:h()}catch(e){return h()}}():h();var E=Math.random().toString(36).substring(2);function j(){}var k=void 0,x=1,N=2;function O(e,r,t){r.constructor===e.constructor&&t===m&&r.constructor.resolve===w?function(e,n){n._state===x?C(e,n._result):n._state===N?M(e,n._result):S(n,void 0,function(n){return I(e,n)},function(n){return M(e,n)})}(e,r):void 0===t?C(e,r):n(t)?function(e,n,r){a(function(e){var t=!1,o=function(e,n,r,t){try{e.call(n,r,t)}catch(e){return e}}(r,n,function(r){t||(t=!0,n!==r?I(e,r):C(e,r))},function(n){t||(t=!0,M(e,n))},e._label);!t&&o&&(t=!0,M(e,o))},e)}(e,r,t):C(e,r)}function I(e,n){if(e===n)M(e,new TypeError("You cannot resolve a promise with itself"));else if(o=typeof(t=n),null===t||"object"!==o&&"function"!==o)C(e,n);else{var r=void 0;try{r=n.then}catch(n){return void M(e,n)}O(e,n,r)}var t,o}function A(e){e._onerror&&e._onerror(e._result),P(e)}function C(e,n){e._state===k&&(e._result=n,e._state=x,0!==e._subscribers.length&&a(P,e))}function M(e,n){e._state===k&&(e._state=N,e._result=n,a(A,e))}function S(e,n,r,t){var o=e._subscribers,i=o.length;e._onerror=null,o[i]=n,o[i+x]=r,o[i+N]=t,0===i&&e._state&&a(P,e)}function P(e){var n=e._subscribers,r=e._state;if(0!==n.length){for(var t=void 0,o=void 0,i=e._result,a=0;a<n.length;a+=3)t=n[a],o=n[a+r],t?L(r,t,o,i):o(i);e._subscribers.length=0}}function L(e,r,t,o){var i=n(t),a=void 0,u=void 0,c=!0;if(i){try{a=t(o)}catch(e){c=!1,u=e}if(r===a)return void M(r,new TypeError("A promises callback cannot return that same promise."))}else a=o;r._state!==k||(i&&c?I(r,a):!1===c?M(r,u):e===x?C(r,a):e===N&&M(r,a))}var T=0;function F(e){e[E]=T++,e._state=void 0,e._result=void 0,e._subscribers=[]}var R=function(){function e(e,n){this._instanceConstructor=e,this.promise=new e(j),this.promise[E]||F(this.promise),r(n)?(this.length=n.length,this._remaining=n.length,this._result=new Array(this.length),0===this.length?C(this.promise,this._result):(this.length=this.length||0,this._enumerate(n),0===this._remaining&&C(this.promise,this._result))):M(this.promise,new Error("Array Methods must be provided an Array"))}return e.prototype._enumerate=function(e){for(var n=0;this._state===k&&n<e.length;n++)this._eachEntry(e[n],n)},e.prototype._eachEntry=function(e,n){var r=this._instanceConstructor,t=r.resolve;if(t===w){var o=void 0,i=void 0,a=!1;try{o=e.then}catch(e){a=!0,i=e}if(o===m&&e._state!==k)this._settledAt(e._state,n,e._result);else if("function"!=typeof o)this._remaining--,this._result[n]=e;else if(r===z){var u=new r(j);a?M(u,i):O(u,e,o),this._willSettleAt(u,n)}else this._willSettleAt(new r(function(n){return n(e)}),n)}else this._willSettleAt(t(e),n)},e.prototype._settledAt=function(e,n,r){var t=this.promise;t._state===k&&(this._remaining--,e===N?M(t,r):this._result[n]=r),0===this._remaining&&C(t,this._result)},e.prototype._willSettleAt=function(e,n){var r=this;S(e,void 0,function(e){return r._settledAt(x,n,e)},function(e){return r._settledAt(N,n,e)})},e}(),z=function(){function e(n){this[E]=T++,this._result=this._state=void 0,this._subscribers=[],j!==n&&("function"!=typeof n&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(e,n){try{n(function(n){I(e,n)},function(n){M(e,n)})}catch(n){M(e,n)}}(this,n):function(){throw new TypeError("Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(e){return this.then(null,e)},e.prototype.finally=function(e){var r=this.constructor;return n(e)?this.then(function(n){return r.resolve(e()).then(function(){return n})},function(n){return r.resolve(e()).then(function(){throw n})}):this.then(e,e)},e}();return z.prototype.then=m,z.all=function(e){return new R(this,e).promise},z.race=function(e){var n=this;return r(e)?new n(function(r,t){for(var o=e.length,i=0;i<o;i++)n.resolve(e[i]).then(r,t)}):new n(function(e,n){return n(new TypeError("You must pass an array to race."))})},z.resolve=w,z.reject=function(e){var n=new this(j);return M(n,e),n},z._setScheduler=function(e){i=e},z._setAsap=function(e){a=e},z._asap=a,z.polyfill=function(){var n=void 0;if(void 0!==e)n=e;else if("undefined"!=typeof self)n=self;else try{n=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var r=n.Promise;if(r){var t=null;try{t=Object.prototype.toString.call(r.resolve())}catch(e){}if("[object Promise]"===t&&!r.cast)return}n.Promise=z},z.Promise=z,z}()}).polyfill();self.onmessage=function(e){var n=function(e,n){var r=e.subgraphs,t=e.nodes,o=e.links,i=e.hierarchy,a=new us.Graph({multigraph:!0,compound:!0,directed:!1!==n.digraph}).setGraph(n).setDefaultNodeLabel(function(){return{}}).setDefaultEdgeLabel(function(){return{}});r.forEach(function(e){a.setNode(e.id,e)}),t.forEach(function(e){a.setNode(e.id,e)}),o.forEach(function(e){a.setEdge(e.source.id,e.target.id,e,e.id)}),i.forEach(function(e){a.setParent(e.child,e.parent)}),cs(a,{debugTiming:!1});var u=-a.graph().width/2||0,c=-a.graph().height/2;return a.nodes().forEach(function(e){var n=a.node(e);n.x+=u,n.y+=c}),a.edges().forEach(function(e){var n=a.edge(e);n.points=n.points.map(function(e){return[e.x+u,e.y+c]})}),{subgraphs:r,nodes:t,links:o}}.apply(void 0,e.data);self.postMessage(n)}}();'],{type:"application/javascript"}),n=URL.createObjectURL(r),o=new Worker(n);return{terminate:function(){return o.terminate()},response:new Promise(function(r){o.onmessage=function(e){r(e.data),o.terminate(),URL.revokeObjectURL(n)},o.postMessage([e,t])})}}({subgraphs:n.allSubgraphs().map(function(e){return u(u({},e.props),{id:vh(e.id)})}),nodes:n.allVertices().map(function(e){delete e.fx,delete e.fy;var t=e.element.node().getBBox();return u({width:t.width,height:t.height},e.props)}),links:n.allEdges().map(function(e){return e.props}),hierarchy:h(h([],n.allSubgraphs().filter(function(e){return!!n.subgraphParent(e.id)}).map(function(e){return{parent:vh(n.subgraphParent(e.id).props.id),child:vh(e.id)}})),n.allVertices().filter(function(e){return void 0!==n.vertexParent(e.id)}).map(function(e){return{parent:vh(n.vertexParent(e.id).props.id),child:e.id}}))},this._options).response.then(function(e){return t.running()&&(e.subgraphs.forEach(function(e){var t=n.subgraph(e.id.substring(8));t.x=e.x+r.width/2,t.y=e.y+r.height/2,t.props.width=e.width,t.props.height=e.height}),e.nodes.forEach(function(e){var t=n.vertex(e.id);t.x=e.x+r.width/2,t.y=e.y+r.height/2}),e.links.forEach(function(e){var t=n.edge(e.id),o=yh(t.source.x,t.source.y,e.points[0][0]+r.width/2,e.points[0][1]+r.height/2),i=yh(t.target.x,t.target.y,e.points[0][0]+r.width/2,e.points[0][1]+r.height/2);t.points=h(h([o<i?[t.source.x,t.source.y]:[t.target.x,t.target.y]],e.points.map(function(e){return[e[0]+r.width/2,e[1]+r.height/2]})),[o<i?[t.target.x,t.target.y]:[t.source.x,t.source.y]])}),t._graph.moveVertices(!0).moveSubgraphs(!0).moveEdges(!0),t.stop()),t})},t.prototype.edgePath=function(t,r){var n=this,o=[],i=!1;return t.points&&(o=t.points.map(function(e){var t=n._graph.project(e[0],!1),r=n._graph.project(e[1],!1);return(isNaN(t)||isNaN(r))&&(i=!0),[t,r]})),i||o.length<2?e.prototype.edgePath.call(this,t,r):{path:gh(o),labelPos:this.center(o)}},t}(fh),_h=function(e){function t(t,r){var n=e.call(this,t)||this;return n._options=r,n}return s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then(function(){var e=t._graph.size(),r=t._graph.graphData(),n=r.allVertices(),o=r.allEdges();o.forEach(function(e){return delete e.points}),t._links=ll(o).id(function(e){return e.id}).distance(t._options.linkDistance).strength(t._options.linkStrength),t._charge=Nl().strength(t._options.repulsionStrength).distanceMin(t._options.distanceMin).distanceMax(t._options.distanceMax),t._center=Jc(e.width/2,e.height/2);var i=function(e){var t,r,n,o=Kc(.1);function i(e){for(var o,i=0,a=t.length;i<a;++i)(o=t[i]).vx+=(n[i]-o.x)*r[i]*e}function a(){if(t){var i,a=t.length;for(r=new Array(a),n=new Array(a),i=0;i<a;++i)r[i]=isNaN(n[i]=+e(t[i],i,t))?0:+o(t[i],i,t)}}return"function"!=typeof e&&(e=Kc(null==e?0:+e)),i.initialize=function(e){t=e,a()},i.strength=function(e){return arguments.length?(o="function"==typeof e?e:Kc(+e),a(),i):o},i.x=function(t){return arguments.length?(e="function"==typeof t?t:Kc(+t),a(),i):e},i}().strength(t._options.forceStrength),a=function(e){var t,r,n,o=Kc(.1);function i(e){for(var o,i=0,a=t.length;i<a;++i)(o=t[i]).vy+=(n[i]-o.y)*r[i]*e}function a(){if(t){var i,a=t.length;for(r=new Array(a),n=new Array(a),i=0;i<a;++i)r[i]=isNaN(n[i]=+e(t[i],i,t))?0:+o(t[i],i,t)}}return"function"!=typeof e&&(e=Kc(null==e?0:+e)),i.initialize=function(e){t=e,a()},i.strength=function(e){return arguments.length?(o="function"==typeof e?e:Kc(+e),a(),i):o},i.y=function(t){return arguments.length?(e="function"==typeof t?t:Kc(+t),a(),i):e},i}().strength(t._options.forceStrength);return t._simulation=Ol(n.map(function(r){var n=r.element.node().getBBox(),o=n.width,i=n.height;return r.fx=t._options.pinCentroid&&r.centroid?e.width/2:void 0,r.fy=t._options.pinCentroid&&r.centroid?e.height/2:void 0,r.width=o,r.height=i,r})).force("link",t._links).force("charge",t._charge).force("center",t._center).force("x",i).force("y",a).alpha(t._options.alpha/2).alphaMin(t._options.alphaMin).alphaDecay(t._options.alphaDecay).velocityDecay(t._options.velocityDecay).stop(),t})},t.prototype.stop=function(){return this._simulation.stop(),e.prototype.stop.call(this)},t}(fh),bh=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then(function(){return t._simulation.tick(t._options.iterations),t.stop(),t._graph.moveVertices(!1).moveEdges(!1),t})},t}(_h),wh=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then(function(){return new Promise(function(e){t._simulation.on("tick",function(){t._graph.moveVertices(!1).moveEdges(!1),t._graph.progress("layout-tick")}).on("end",function(){t._running=!1,e(t)}).restart()})})},t}(_h);function xh(e,t){var r=new Blob(['!function(){"use strict";function r(r,e,t){if(t||2===arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return r.concat(n||e)}var e,t,n;e={exports:{}},t="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,n=function(r){var e,n,o=void 0!==(r=r||{})?r:{};o.ready=new Promise(function(r,t){e=r,n=t});var i,a={};for(i in o)o.hasOwnProperty(i)&&(a[i]=o[i]);var s,u,c,f="./this.program",l=!0,d="";"undefined"!=typeof document&&document.currentScript&&(d=document.currentScript.src),t&&(d=t),d=0!==d.indexOf("blob:")?d.substr(0,d.lastIndexOf("/")+1):"",s=function(r){var e=new XMLHttpRequest;return e.open("GET",r,!1),e.send(null),e.responseText},u=function(r,e,t){var n=new XMLHttpRequest;n.open("GET",r,!0),n.responseType="arraybuffer",n.onload=function(){200==n.status||0==n.status&&n.response?e(n.response):t()},n.onerror=t,n.send(null)};var p,h,m=o.print||console.log.bind(console),v=o.printErr||console.warn.bind(console);for(i in a)a.hasOwnProperty(i)&&(o[i]=a[i]);a=null,o.arguments,o.thisProgram&&(f=o.thisProgram),o.quit,o.wasmBinary&&(p=o.wasmBinary),o.noExitRuntime,"object"!=typeof WebAssembly&&O("no native wasm support detected");var w=!1;function _(r,e){r||O("Assertion failed: "+e)}var y,g,E,b,k,D,S="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function P(r,e,t){for(var n=e+t,o=e;r[o]&&!(o>=n);)++o;if(o-e>16&&r.subarray&&S)return S.decode(r.subarray(e,o));for(var i="";e<o;){var a=r[e++];if(128&a){var s=63&r[e++];if(192!=(224&a)){var u=63&r[e++];if((a=224==(240&a)?(15&a)<<12|s<<6|u:(7&a)<<18|s<<12|u<<6|63&r[e++])<65536)i+=String.fromCharCode(a);else{var c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function F(r,e){return r?P(E,r,e):""}function x(r,e,t,n){if(!(n>0))return 0;for(var o=t,i=t+n-1,a=0;a<r.length;++a){var s=r.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&r.charCodeAt(++a)),s<=127){if(t>=i)break;e[t++]=s}else if(s<=2047){if(t+1>=i)break;e[t++]=192|s>>6,e[t++]=128|63&s}else if(s<=65535){if(t+2>=i)break;e[t++]=224|s>>12,e[t++]=128|s>>6&63,e[t++]=128|63&s}else{if(t+3>=i)break;e[t++]=240|s>>18,e[t++]=128|s>>12&63,e[t++]=128|s>>6&63,e[t++]=128|63&s}}return e[t]=0,t-o}function A(r){for(var e=0,t=0;t<r.length;++t){var n=r.charCodeAt(t);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&r.charCodeAt(++t)),n<=127?++e:e+=n<=2047?2:n<=65535?3:4}return e}function M(r){y=r,o.HEAP8=g=new Int8Array(r),o.HEAP16=new Int16Array(r),o.HEAP32=b=new Int32Array(r),o.HEAPU8=E=new Uint8Array(r),o.HEAPU16=new Uint16Array(r),o.HEAPU32=new Uint32Array(r),o.HEAPF32=new Float32Array(r),o.HEAPF64=k=new Float64Array(r)}o.INITIAL_MEMORY;var R=[],C=[],z=[],j=0,T=null;function B(r){j++,o.monitorRunDependencies&&o.monitorRunDependencies(j)}function N(r){if(j--,o.monitorRunDependencies&&o.monitorRunDependencies(j),0==j&&T){var e=T;T=null,e()}}function O(r){o.onAbort&&o.onAbort(r),v(r+=""),w=!0,r="abort("+r+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(r);throw n(e),e}o.preloadedImages={},o.preloadedAudios={};var L,I,U,H,W="data:application/octet-stream;base64,";function q(r){return r.startsWith(W)}function G(r){try{if(r==L&&p)return new Uint8Array(p);if(!c)throw"both async and sync fetching of the wasm failed"}catch(r){O(r)}}q(L="expatlib.wasm")||(I=L,L=o.locateFile?o.locateFile(I,d):d+I);var V={11922:function(r){var e=o.getCache(o.CExpatJS)[r];if(!e.hasOwnProperty("startElement"))throw"a JSImplementation must implement all functions, you forgot CExpatJS::startElement.";e.startElement()},12140:function(r){var e=o.getCache(o.CExpatJS)[r];if(!e.hasOwnProperty("endElement"))throw"a JSImplementation must implement all functions, you forgot CExpatJS::endElement.";e.endElement()},12352:function(r){var e=o.getCache(o.CExpatJS)[r];if(!e.hasOwnProperty("characterData"))throw"a JSImplementation must implement all functions, you forgot CExpatJS::characterData.";e.characterData()}};function J(r){for(;r.length>0;){var e=r.shift();if("function"!=typeof e){var t=e.func;"number"==typeof t?void 0===e.arg?D.get(t)():D.get(t)(e.arg):t(void 0===e.arg?null:e.arg)}else e(o)}}var X={splitPath:function(r){return/^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/.exec(r).slice(1)},normalizeArray:function(r,e){for(var t=0,n=r.length-1;n>=0;n--){var o=r[n];"."===o?r.splice(n,1):".."===o?(r.splice(n,1),t++):t&&(r.splice(n,1),t--)}if(e)for(;t;t--)r.unshift("..");return r},normalize:function(r){var e="/"===r.charAt(0),t="/"===r.substr(-1);return(r=X.normalizeArray(r.split("/").filter(function(r){return!!r}),!e).join("/"))||e||(r="."),r&&t&&(r+="/"),(e?"/":"")+r},dirname:function(r){var e=X.splitPath(r),t=e[0],n=e[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:function(r){if("/"===r)return"/";var e=(r=(r=X.normalize(r)).replace(/\\/$/,"")).lastIndexOf("/");return-1===e?r:r.substr(e+1)},extname:function(r){return X.splitPath(r)[3]},join:function(){var r=Array.prototype.slice.call(arguments,0);return X.normalize(r.join("/"))},join2:function(r,e){return X.normalize(r+"/"+e)}},Y={resolve:function(){for(var r="",e=!1,t=arguments.length-1;t>=-1&&!e;t--){var n=t>=0?arguments[t]:Q.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";r=n+"/"+r,e="/"===n.charAt(0)}return(e?"/":"")+(r=X.normalizeArray(r.split("/").filter(function(r){return!!r}),!e).join("/"))||"."},relative:function(r,e){function t(r){for(var e=0;e<r.length&&""===r[e];e++);for(var t=r.length-1;t>=0&&""===r[t];t--);return e>t?[]:r.slice(e,t-e+1)}r=Y.resolve(r).substr(1),e=Y.resolve(e).substr(1);for(var n=t(r.split("/")),o=t(e.split("/")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var u=[];for(s=a;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(a))).join("/")}},K={ttys:[],init:function(){},shutdown:function(){},register:function(r,e){K.ttys[r]={input:[],output:[],ops:e},Q.registerDevice(r,K.stream_ops)},stream_ops:{open:function(r){var e=K.ttys[r.node.rdev];if(!e)throw new Q.ErrnoError(43);r.tty=e,r.seekable=!1},close:function(r){r.tty.ops.flush(r.tty)},flush:function(r){r.tty.ops.flush(r.tty)},read:function(r,e,t,n,o){if(!r.tty||!r.tty.ops.get_char)throw new Q.ErrnoError(60);for(var i=0,a=0;a<n;a++){var s;try{s=r.tty.ops.get_char(r.tty)}catch(r){throw new Q.ErrnoError(29)}if(void 0===s&&0===i)throw new Q.ErrnoError(6);if(null==s)break;i++,e[t+a]=s}return i&&(r.node.timestamp=Date.now()),i},write:function(r,e,t,n,o){if(!r.tty||!r.tty.ops.put_char)throw new Q.ErrnoError(60);try{for(var i=0;i<n;i++)r.tty.ops.put_char(r.tty,e[t+i])}catch(r){throw new Q.ErrnoError(29)}return n&&(r.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(r){if(!r.input.length){var e=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\\n"),!e)return null;r.input=ir(e,!0)}return r.input.shift()},put_char:function(r,e){null===e||10===e?(m(P(r.output,0)),r.output=[]):0!=e&&r.output.push(e)},flush:function(r){r.output&&r.output.length>0&&(m(P(r.output,0)),r.output=[])}},default_tty1_ops:{put_char:function(r,e){null===e||10===e?(v(P(r.output,0)),r.output=[]):0!=e&&r.output.push(e)},flush:function(r){r.output&&r.output.length>0&&(v(P(r.output,0)),r.output=[])}}},$={ops_table:null,mount:function(r){return $.createNode(null,"/",16895,0)},createNode:function(r,e,t,n){if(Q.isBlkdev(t)||Q.isFIFO(t))throw new Q.ErrnoError(63);$.ops_table||($.ops_table={dir:{node:{getattr:$.node_ops.getattr,setattr:$.node_ops.setattr,lookup:$.node_ops.lookup,mknod:$.node_ops.mknod,rename:$.node_ops.rename,unlink:$.node_ops.unlink,rmdir:$.node_ops.rmdir,readdir:$.node_ops.readdir,symlink:$.node_ops.symlink},stream:{llseek:$.stream_ops.llseek}},file:{node:{getattr:$.node_ops.getattr,setattr:$.node_ops.setattr},stream:{llseek:$.stream_ops.llseek,read:$.stream_ops.read,write:$.stream_ops.write,allocate:$.stream_ops.allocate,mmap:$.stream_ops.mmap,msync:$.stream_ops.msync}},link:{node:{getattr:$.node_ops.getattr,setattr:$.node_ops.setattr,readlink:$.node_ops.readlink},stream:{}},chrdev:{node:{getattr:$.node_ops.getattr,setattr:$.node_ops.setattr},stream:Q.chrdev_stream_ops}});var o=Q.createNode(r,e,t,n);return Q.isDir(o.mode)?(o.node_ops=$.ops_table.dir.node,o.stream_ops=$.ops_table.dir.stream,o.contents={}):Q.isFile(o.mode)?(o.node_ops=$.ops_table.file.node,o.stream_ops=$.ops_table.file.stream,o.usedBytes=0,o.contents=null):Q.isLink(o.mode)?(o.node_ops=$.ops_table.link.node,o.stream_ops=$.ops_table.link.stream):Q.isChrdev(o.mode)&&(o.node_ops=$.ops_table.chrdev.node,o.stream_ops=$.ops_table.chrdev.stream),o.timestamp=Date.now(),r&&(r.contents[e]=o,r.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(r){return r.contents?r.contents.subarray?r.contents.subarray(0,r.usedBytes):new Uint8Array(r.contents):new Uint8Array(0)},expandFileStorage:function(r,e){var t=r.contents?r.contents.length:0;if(!(t>=e)){e=Math.max(e,t*(t<1048576?2:1.125)>>>0),0!=t&&(e=Math.max(e,256));var n=r.contents;r.contents=new Uint8Array(e),r.usedBytes>0&&r.contents.set(n.subarray(0,r.usedBytes),0)}},resizeFileStorage:function(r,e){if(r.usedBytes!=e)if(0==e)r.contents=null,r.usedBytes=0;else{var t=r.contents;r.contents=new Uint8Array(e),t&&r.contents.set(t.subarray(0,Math.min(e,r.usedBytes))),r.usedBytes=e}},node_ops:{getattr:function(r){var e={};return e.dev=Q.isChrdev(r.mode)?r.id:1,e.ino=r.id,e.mode=r.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=r.rdev,Q.isDir(r.mode)?e.size=4096:Q.isFile(r.mode)?e.size=r.usedBytes:Q.isLink(r.mode)?e.size=r.link.length:e.size=0,e.atime=new Date(r.timestamp),e.mtime=new Date(r.timestamp),e.ctime=new Date(r.timestamp),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr:function(r,e){void 0!==e.mode&&(r.mode=e.mode),void 0!==e.timestamp&&(r.timestamp=e.timestamp),void 0!==e.size&&$.resizeFileStorage(r,e.size)},lookup:function(r,e){throw Q.genericErrors[44]},mknod:function(r,e,t,n){return $.createNode(r,e,t,n)},rename:function(r,e,t){if(Q.isDir(r.mode)){var n;try{n=Q.lookupNode(e,t)}catch(r){}if(n)for(var o in n.contents)throw new Q.ErrnoError(55)}delete r.parent.contents[r.name],r.parent.timestamp=Date.now(),r.name=t,e.contents[t]=r,e.timestamp=r.parent.timestamp,r.parent=e},unlink:function(r,e){delete r.contents[e],r.timestamp=Date.now()},rmdir:function(r,e){var t=Q.lookupNode(r,e);for(var n in t.contents)throw new Q.ErrnoError(55);delete r.contents[e],r.timestamp=Date.now()},readdir:function(r){var e=[".",".."];for(var t in r.contents)r.contents.hasOwnProperty(t)&&e.push(t);return e},symlink:function(r,e,t){var n=$.createNode(r,e,41471,0);return n.link=t,n},readlink:function(r){if(!Q.isLink(r.mode))throw new Q.ErrnoError(28);return r.link}},stream_ops:{read:function(r,e,t,n,o){var i=r.node.contents;if(o>=r.node.usedBytes)return 0;var a=Math.min(r.node.usedBytes-o,n);if(a>8&&i.subarray)e.set(i.subarray(o,o+a),t);else for(var s=0;s<a;s++)e[t+s]=i[o+s];return a},write:function(r,e,t,n,o,i){if(e.buffer===g.buffer&&(i=!1),!n)return 0;var a=r.node;if(a.timestamp=Date.now(),e.subarray&&(!a.contents||a.contents.subarray)){if(i)return a.contents=e.subarray(t,t+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=e.slice(t,t+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(e.subarray(t,t+n),o),n}if($.expandFileStorage(a,o+n),a.contents.subarray&&e.subarray)a.contents.set(e.subarray(t,t+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=e[t+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek:function(r,e,t){var n=e;if(1===t?n+=r.position:2===t&&Q.isFile(r.node.mode)&&(n+=r.node.usedBytes),n<0)throw new Q.ErrnoError(28);return n},allocate:function(r,e,t){$.expandFileStorage(r.node,e+t),r.node.usedBytes=Math.max(r.node.usedBytes,e+t)},mmap:function(r,e,t,n,o,i){if(0!==e)throw new Q.ErrnoError(28);if(!Q.isFile(r.node.mode))throw new Q.ErrnoError(43);var a,s,u=r.node.contents;if(2&i||u.buffer!==y){if((n>0||n+t<u.length)&&(u=u.subarray?u.subarray(n,n+t):Array.prototype.slice.call(u,n,n+t)),s=!0,!(a=void O()))throw new Q.ErrnoError(48);g.set(u,a)}else s=!1,a=u.byteOffset;return{ptr:a,allocated:s}},msync:function(r,e,t,n,o){if(!Q.isFile(r.node.mode))throw new Q.ErrnoError(43);return 2&o?0:($.stream_ops.write(r,e,0,n,t,!1),0)}}},Q={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:function(r,e){if(e=e||{},!(r=Y.resolve(Q.cwd(),r)))return{path:"",node:null};var t={follow_mount:!0,recurse_count:0};for(var n in t)void 0===e[n]&&(e[n]=t[n]);if(e.recurse_count>8)throw new Q.ErrnoError(32);for(var o=X.normalizeArray(r.split("/").filter(function(r){return!!r}),!1),i=Q.root,a="/",s=0;s<o.length;s++){var u=s===o.length-1;if(u&&e.parent)break;if(i=Q.lookupNode(i,o[s]),a=X.join2(a,o[s]),Q.isMountpoint(i)&&(!u||u&&e.follow_mount)&&(i=i.mounted.root),!u||e.follow)for(var c=0;Q.isLink(i.mode);){var f=Q.readlink(a);if(a=Y.resolve(X.dirname(a),f),i=Q.lookupPath(a,{recurse_count:e.recurse_count}).node,c++>40)throw new Q.ErrnoError(32)}}return{path:a,node:i}},getPath:function(r){for(var e;;){if(Q.isRoot(r)){var t=r.mount.mountpoint;return e?"/"!==t[t.length-1]?t+"/"+e:t+e:t}e=e?r.name+"/"+e:r.name,r=r.parent}},hashName:function(r,e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return(r+t>>>0)%Q.nameTable.length},hashAddNode:function(r){var e=Q.hashName(r.parent.id,r.name);r.name_next=Q.nameTable[e],Q.nameTable[e]=r},hashRemoveNode:function(r){var e=Q.hashName(r.parent.id,r.name);if(Q.nameTable[e]===r)Q.nameTable[e]=r.name_next;else for(var t=Q.nameTable[e];t;){if(t.name_next===r){t.name_next=r.name_next;break}t=t.name_next}},lookupNode:function(r,e){var t=Q.mayLookup(r);if(t)throw new Q.ErrnoError(t,r);for(var n=Q.hashName(r.id,e),o=Q.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===r.id&&i===e)return o}return Q.lookup(r,e)},createNode:function(r,e,t,n){var o=new Q.FSNode(r,e,t,n);return Q.hashAddNode(o),o},destroyNode:function(r){Q.hashRemoveNode(r)},isRoot:function(r){return r===r.parent},isMountpoint:function(r){return!!r.mounted},isFile:function(r){return 32768==(61440&r)},isDir:function(r){return 16384==(61440&r)},isLink:function(r){return 40960==(61440&r)},isChrdev:function(r){return 8192==(61440&r)},isBlkdev:function(r){return 24576==(61440&r)},isFIFO:function(r){return 4096==(61440&r)},isSocket:function(r){return 49152==(49152&r)},flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:function(r){var e=Q.flagModes[r];if(void 0===e)throw new Error("Unknown file open mode: "+r);return e},flagsToPermissionString:function(r){var e=["r","w","rw"][3&r];return 512&r&&(e+="w"),e},nodePermissions:function(r,e){return Q.ignorePermissions?0:(!e.includes("r")||292&r.mode)&&(!e.includes("w")||146&r.mode)&&(!e.includes("x")||73&r.mode)?0:2},mayLookup:function(r){var e=Q.nodePermissions(r,"x");return e||(r.node_ops.lookup?0:2)},mayCreate:function(r,e){try{return Q.lookupNode(r,e),20}catch(r){}return Q.nodePermissions(r,"wx")},mayDelete:function(r,e,t){var n;try{n=Q.lookupNode(r,e)}catch(r){return r.errno}var o=Q.nodePermissions(r,"wx");if(o)return o;if(t){if(!Q.isDir(n.mode))return 54;if(Q.isRoot(n)||Q.getPath(n)===Q.cwd())return 10}else if(Q.isDir(n.mode))return 31;return 0},mayOpen:function(r,e){return r?Q.isLink(r.mode)?32:Q.isDir(r.mode)&&("r"!==Q.flagsToPermissionString(e)||512&e)?31:Q.nodePermissions(r,Q.flagsToPermissionString(e)):44},MAX_OPEN_FDS:4096,nextfd:function(r,e){r=r||0,e=e||Q.MAX_OPEN_FDS;for(var t=r;t<=e;t++)if(!Q.streams[t])return t;throw new Q.ErrnoError(33)},getStream:function(r){return Q.streams[r]},createStream:function(r,e,t){Q.FSStream||(Q.FSStream=function(){},Q.FSStream.prototype={object:{get:function(){return this.node},set:function(r){this.node=r}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}});var n=new Q.FSStream;for(var o in r)n[o]=r[o];r=n;var i=Q.nextfd(e,t);return r.fd=i,Q.streams[i]=r,r},closeStream:function(r){Q.streams[r]=null},chrdev_stream_ops:{open:function(r){var e=Q.getDevice(r.node.rdev);r.stream_ops=e.stream_ops,r.stream_ops.open&&r.stream_ops.open(r)},llseek:function(){throw new Q.ErrnoError(70)}},major:function(r){return r>>8},minor:function(r){return 255&r},makedev:function(r,e){return r<<8|e},registerDevice:function(r,e){Q.devices[r]={stream_ops:e}},getDevice:function(r){return Q.devices[r]},getMounts:function(r){for(var e=[],t=[r];t.length;){var n=t.pop();e.push(n),t.push.apply(t,n.mounts)}return e},syncfs:function(r,e){"function"==typeof r&&(e=r,r=!1),Q.syncFSRequests++,Q.syncFSRequests>1&&v("warning: "+Q.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var t=Q.getMounts(Q.root.mount),n=0;function o(r){return Q.syncFSRequests--,e(r)}function i(r){if(r)return i.errored?void 0:(i.errored=!0,o(r));++n>=t.length&&o(null)}t.forEach(function(e){if(!e.type.syncfs)return i(null);e.type.syncfs(e,r,i)})},mount:function(r,e,t){var n,o="/"===t,i=!t;if(o&&Q.root)throw new Q.ErrnoError(10);if(!o&&!i){var a=Q.lookupPath(t,{follow_mount:!1});if(t=a.path,n=a.node,Q.isMountpoint(n))throw new Q.ErrnoError(10);if(!Q.isDir(n.mode))throw new Q.ErrnoError(54)}var s={type:r,opts:e,mountpoint:t,mounts:[]},u=r.mount(s);return u.mount=s,s.root=u,o?Q.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:function(r){var e=Q.lookupPath(r,{follow_mount:!1});if(!Q.isMountpoint(e.node))throw new Q.ErrnoError(28);var t=e.node,n=t.mounted,o=Q.getMounts(n);Object.keys(Q.nameTable).forEach(function(r){for(var e=Q.nameTable[r];e;){var t=e.name_next;o.includes(e.mount)&&Q.destroyNode(e),e=t}}),t.mounted=null;var i=t.mount.mounts.indexOf(n);t.mount.mounts.splice(i,1)},lookup:function(r,e){return r.node_ops.lookup(r,e)},mknod:function(r,e,t){var n=Q.lookupPath(r,{parent:!0}).node,o=X.basename(r);if(!o||"."===o||".."===o)throw new Q.ErrnoError(28);var i=Q.mayCreate(n,o);if(i)throw new Q.ErrnoError(i);if(!n.node_ops.mknod)throw new Q.ErrnoError(63);return n.node_ops.mknod(n,o,e,t)},create:function(r,e){return e=void 0!==e?e:438,e&=4095,e|=32768,Q.mknod(r,e,0)},mkdir:function(r,e){return e=void 0!==e?e:511,e&=1023,e|=16384,Q.mknod(r,e,0)},mkdirTree:function(r,e){for(var t=r.split("/"),n="",o=0;o<t.length;++o)if(t[o]){n+="/"+t[o];try{Q.mkdir(n,e)}catch(r){if(20!=r.errno)throw r}}},mkdev:function(r,e,t){return void 0===t&&(t=e,e=438),e|=8192,Q.mknod(r,e,t)},symlink:function(r,e){if(!Y.resolve(r))throw new Q.ErrnoError(44);var t=Q.lookupPath(e,{parent:!0}).node;if(!t)throw new Q.ErrnoError(44);var n=X.basename(e),o=Q.mayCreate(t,n);if(o)throw new Q.ErrnoError(o);if(!t.node_ops.symlink)throw new Q.ErrnoError(63);return t.node_ops.symlink(t,n,r)},rename:function(r,e){var t,n,o=X.dirname(r),i=X.dirname(e),a=X.basename(r),s=X.basename(e);if(t=Q.lookupPath(r,{parent:!0}).node,n=Q.lookupPath(e,{parent:!0}).node,!t||!n)throw new Q.ErrnoError(44);if(t.mount!==n.mount)throw new Q.ErrnoError(75);var u,c=Q.lookupNode(t,a),f=Y.relative(r,i);if("."!==f.charAt(0))throw new Q.ErrnoError(28);if("."!==(f=Y.relative(e,o)).charAt(0))throw new Q.ErrnoError(55);try{u=Q.lookupNode(n,s)}catch(r){}if(c!==u){var l=Q.isDir(c.mode),d=Q.mayDelete(t,a,l);if(d)throw new Q.ErrnoError(d);if(d=u?Q.mayDelete(n,s,l):Q.mayCreate(n,s))throw new Q.ErrnoError(d);if(!t.node_ops.rename)throw new Q.ErrnoError(63);if(Q.isMountpoint(c)||u&&Q.isMountpoint(u))throw new Q.ErrnoError(10);if(n!==t&&(d=Q.nodePermissions(t,"w")))throw new Q.ErrnoError(d);try{Q.trackingDelegate.willMovePath}catch(t){v("FS.trackingDelegate[\'willMovePath\'](\'"+r+"\', \'"+e+"\') threw an exception: "+t.message)}Q.hashRemoveNode(c);try{t.node_ops.rename(c,n,s)}catch(r){throw r}finally{Q.hashAddNode(c)}try{Q.trackingDelegate.onMovePath}catch(t){v("FS.trackingDelegate[\'onMovePath\'](\'"+r+"\', \'"+e+"\') threw an exception: "+t.message)}}},rmdir:function(r){var e=Q.lookupPath(r,{parent:!0}).node,t=X.basename(r),n=Q.lookupNode(e,t),o=Q.mayDelete(e,t,!0);if(o)throw new Q.ErrnoError(o);if(!e.node_ops.rmdir)throw new Q.ErrnoError(63);if(Q.isMountpoint(n))throw new Q.ErrnoError(10);try{Q.trackingDelegate.willDeletePath}catch(e){v("FS.trackingDelegate[\'willDeletePath\'](\'"+r+"\') threw an exception: "+e.message)}e.node_ops.rmdir(e,t),Q.destroyNode(n);try{Q.trackingDelegate.onDeletePath}catch(e){v("FS.trackingDelegate[\'onDeletePath\'](\'"+r+"\') threw an exception: "+e.message)}},readdir:function(r){var e=Q.lookupPath(r,{follow:!0}).node;if(!e.node_ops.readdir)throw new Q.ErrnoError(54);return e.node_ops.readdir(e)},unlink:function(r){var e=Q.lookupPath(r,{parent:!0}).node,t=X.basename(r),n=Q.lookupNode(e,t),o=Q.mayDelete(e,t,!1);if(o)throw new Q.ErrnoError(o);if(!e.node_ops.unlink)throw new Q.ErrnoError(63);if(Q.isMountpoint(n))throw new Q.ErrnoError(10);try{Q.trackingDelegate.willDeletePath}catch(e){v("FS.trackingDelegate[\'willDeletePath\'](\'"+r+"\') threw an exception: "+e.message)}e.node_ops.unlink(e,t),Q.destroyNode(n);try{Q.trackingDelegate.onDeletePath}catch(e){v("FS.trackingDelegate[\'onDeletePath\'](\'"+r+"\') threw an exception: "+e.message)}},readlink:function(r){var e=Q.lookupPath(r).node;if(!e)throw new Q.ErrnoError(44);if(!e.node_ops.readlink)throw new Q.ErrnoError(28);return Y.resolve(Q.getPath(e.parent),e.node_ops.readlink(e))},stat:function(r,e){var t=Q.lookupPath(r,{follow:!e}).node;if(!t)throw new Q.ErrnoError(44);if(!t.node_ops.getattr)throw new Q.ErrnoError(63);return t.node_ops.getattr(t)},lstat:function(r){return Q.stat(r,!0)},chmod:function(r,e,t){var n;if(!(n="string"==typeof r?Q.lookupPath(r,{follow:!t}).node:r).node_ops.setattr)throw new Q.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&e|-4096&n.mode,timestamp:Date.now()})},lchmod:function(r,e){Q.chmod(r,e,!0)},fchmod:function(r,e){var t=Q.getStream(r);if(!t)throw new Q.ErrnoError(8);Q.chmod(t.node,e)},chown:function(r,e,t,n){var o;if(!(o="string"==typeof r?Q.lookupPath(r,{follow:!n}).node:r).node_ops.setattr)throw new Q.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:function(r,e,t){Q.chown(r,e,t,!0)},fchown:function(r,e,t){var n=Q.getStream(r);if(!n)throw new Q.ErrnoError(8);Q.chown(n.node,e,t)},truncate:function(r,e){if(e<0)throw new Q.ErrnoError(28);var t;if(!(t="string"==typeof r?Q.lookupPath(r,{follow:!0}).node:r).node_ops.setattr)throw new Q.ErrnoError(63);if(Q.isDir(t.mode))throw new Q.ErrnoError(31);if(!Q.isFile(t.mode))throw new Q.ErrnoError(28);var n=Q.nodePermissions(t,"w");if(n)throw new Q.ErrnoError(n);t.node_ops.setattr(t,{size:e,timestamp:Date.now()})},ftruncate:function(r,e){var t=Q.getStream(r);if(!t)throw new Q.ErrnoError(8);if(0==(2097155&t.flags))throw new Q.ErrnoError(28);Q.truncate(t.node,e)},utime:function(r,e,t){var n=Q.lookupPath(r,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(e,t)})},open:function(r,e,t,n,i){if(""===r)throw new Q.ErrnoError(44);var a;if(t=void 0===t?438:t,t=64&(e="string"==typeof e?Q.modeStringToFlags(e):e)?4095&t|32768:0,"object"==typeof r)a=r;else{r=X.normalize(r);try{a=Q.lookupPath(r,{follow:!(131072&e)}).node}catch(r){}}var s=!1;if(64&e)if(a){if(128&e)throw new Q.ErrnoError(20)}else a=Q.mknod(r,t,0),s=!0;if(!a)throw new Q.ErrnoError(44);if(Q.isChrdev(a.mode)&&(e&=-513),65536&e&&!Q.isDir(a.mode))throw new Q.ErrnoError(54);if(!s){var u=Q.mayOpen(a,e);if(u)throw new Q.ErrnoError(u)}512&e&&Q.truncate(a,0),e&=-131713;var c=Q.createStream({node:a,path:Q.getPath(a),flags:e,seekable:!0,position:0,stream_ops:a.stream_ops,ungotten:[],error:!1},n,i);c.stream_ops.open&&c.stream_ops.open(c),!o.logReadFiles||1&e||(Q.readFiles||(Q.readFiles={}),r in Q.readFiles||(Q.readFiles[r]=1,v("FS.trackingDelegate error on read file: "+r)));try{Q.trackingDelegate.onOpenFile}catch(e){v("FS.trackingDelegate[\'onOpenFile\'](\'"+r+"\', flags) threw an exception: "+e.message)}return c},close:function(r){if(Q.isClosed(r))throw new Q.ErrnoError(8);r.getdents&&(r.getdents=null);try{r.stream_ops.close&&r.stream_ops.close(r)}catch(r){throw r}finally{Q.closeStream(r.fd)}r.fd=null},isClosed:function(r){return null===r.fd},llseek:function(r,e,t){if(Q.isClosed(r))throw new Q.ErrnoError(8);if(!r.seekable||!r.stream_ops.llseek)throw new Q.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new Q.ErrnoError(28);return r.position=r.stream_ops.llseek(r,e,t),r.ungotten=[],r.position},read:function(r,e,t,n,o){if(n<0||o<0)throw new Q.ErrnoError(28);if(Q.isClosed(r))throw new Q.ErrnoError(8);if(1==(2097155&r.flags))throw new Q.ErrnoError(8);if(Q.isDir(r.node.mode))throw new Q.ErrnoError(31);if(!r.stream_ops.read)throw new Q.ErrnoError(28);var i=void 0!==o;if(i){if(!r.seekable)throw new Q.ErrnoError(70)}else o=r.position;var a=r.stream_ops.read(r,e,t,n,o);return i||(r.position+=a),a},write:function(r,e,t,n,o,i){if(n<0||o<0)throw new Q.ErrnoError(28);if(Q.isClosed(r))throw new Q.ErrnoError(8);if(0==(2097155&r.flags))throw new Q.ErrnoError(8);if(Q.isDir(r.node.mode))throw new Q.ErrnoError(31);if(!r.stream_ops.write)throw new Q.ErrnoError(28);r.seekable&&1024&r.flags&&Q.llseek(r,0,2);var a=void 0!==o;if(a){if(!r.seekable)throw new Q.ErrnoError(70)}else o=r.position;var s=r.stream_ops.write(r,e,t,n,o,i);a||(r.position+=s);try{r.path&&Q.trackingDelegate.onWriteToFile&&Q.trackingDelegate.onWriteToFile(r.path)}catch(e){v("FS.trackingDelegate[\'onWriteToFile\'](\'"+r.path+"\') threw an exception: "+e.message)}return s},allocate:function(r,e,t){if(Q.isClosed(r))throw new Q.ErrnoError(8);if(e<0||t<=0)throw new Q.ErrnoError(28);if(0==(2097155&r.flags))throw new Q.ErrnoError(8);if(!Q.isFile(r.node.mode)&&!Q.isDir(r.node.mode))throw new Q.ErrnoError(43);if(!r.stream_ops.allocate)throw new Q.ErrnoError(138);r.stream_ops.allocate(r,e,t)},mmap:function(r,e,t,n,o,i){if(0!=(2&o)&&0==(2&i)&&2!=(2097155&r.flags))throw new Q.ErrnoError(2);if(1==(2097155&r.flags))throw new Q.ErrnoError(2);if(!r.stream_ops.mmap)throw new Q.ErrnoError(43);return r.stream_ops.mmap(r,e,t,n,o,i)},msync:function(r,e,t,n,o){return r&&r.stream_ops.msync?r.stream_ops.msync(r,e,t,n,o):0},munmap:function(r){return 0},ioctl:function(r,e,t){if(!r.stream_ops.ioctl)throw new Q.ErrnoError(59);return r.stream_ops.ioctl(r,e,t)},readFile:function(r,e){if((e=e||{}).flags=e.flags||0,e.encoding=e.encoding||"binary","utf8"!==e.encoding&&"binary"!==e.encoding)throw new Error(\'Invalid encoding type "\'+e.encoding+\'"\');var t,n=Q.open(r,e.flags),o=Q.stat(r).size,i=new Uint8Array(o);return Q.read(n,i,0,o,0),"utf8"===e.encoding?t=P(i,0):"binary"===e.encoding&&(t=i),Q.close(n),t},writeFile:function(r,e,t){(t=t||{}).flags=t.flags||577;var n=Q.open(r,t.flags,t.mode);if("string"==typeof e){var o=new Uint8Array(A(e)+1),i=x(e,o,0,o.length);Q.write(n,o,0,i,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(e))throw new Error("Unsupported data type");Q.write(n,e,0,e.byteLength,void 0,t.canOwn)}Q.close(n)},cwd:function(){return Q.currentPath},chdir:function(r){var e=Q.lookupPath(r,{follow:!0});if(null===e.node)throw new Q.ErrnoError(44);if(!Q.isDir(e.node.mode))throw new Q.ErrnoError(54);var t=Q.nodePermissions(e.node,"x");if(t)throw new Q.ErrnoError(t);Q.currentPath=e.path},createDefaultDirectories:function(){Q.mkdir("/tmp"),Q.mkdir("/home"),Q.mkdir("/home/web_user")},createDefaultDevices:function(){Q.mkdir("/dev"),Q.registerDevice(Q.makedev(1,3),{read:function(){return 0},write:function(r,e,t,n,o){return n}}),Q.mkdev("/dev/null",Q.makedev(1,3)),K.register(Q.makedev(5,0),K.default_tty_ops),K.register(Q.makedev(6,0),K.default_tty1_ops),Q.mkdev("/dev/tty",Q.makedev(5,0)),Q.mkdev("/dev/tty1",Q.makedev(6,0));var r=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var r=new Uint8Array(1);return function(){return crypto.getRandomValues(r),r[0]}}return function(){O("randomDevice")}}();Q.createDevice("/dev","random",r),Q.createDevice("/dev","urandom",r),Q.mkdir("/dev/shm"),Q.mkdir("/dev/shm/tmp")},createSpecialDirectories:function(){Q.mkdir("/proc");var r=Q.mkdir("/proc/self");Q.mkdir("/proc/self/fd"),Q.mount({mount:function(){var e=Q.createNode(r,"fd",16895,73);return e.node_ops={lookup:function(r,e){var t=+e,n=Q.getStream(t);if(!n)throw new Q.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:function(){return n.path}}};return o.parent=o,o}},e}},{},"/proc/self/fd")},createStandardStreams:function(){o.stdin?Q.createDevice("/dev","stdin",o.stdin):Q.symlink("/dev/tty","/dev/stdin"),o.stdout?Q.createDevice("/dev","stdout",null,o.stdout):Q.symlink("/dev/tty","/dev/stdout"),o.stderr?Q.createDevice("/dev","stderr",null,o.stderr):Q.symlink("/dev/tty1","/dev/stderr"),Q.open("/dev/stdin",0),Q.open("/dev/stdout",1),Q.open("/dev/stderr",1)},ensureErrnoError:function(){Q.ErrnoError||(Q.ErrnoError=function(r,e){this.node=e,this.setErrno=function(r){this.errno=r},this.setErrno(r),this.message="FS error"},Q.ErrnoError.prototype=new Error,Q.ErrnoError.prototype.constructor=Q.ErrnoError,[44].forEach(function(r){Q.genericErrors[r]=new Q.ErrnoError(r),Q.genericErrors[r].stack="<generic error, no stack>"}))},staticInit:function(){Q.ensureErrnoError(),Q.nameTable=new Array(4096),Q.mount($,{},"/"),Q.createDefaultDirectories(),Q.createDefaultDevices(),Q.createSpecialDirectories(),Q.filesystems={MEMFS:$}},init:function(r,e,t){Q.init.initialized=!0,Q.ensureErrnoError(),o.stdin=r||o.stdin,o.stdout=e||o.stdout,o.stderr=t||o.stderr,Q.createStandardStreams()},quit:function(){Q.init.initialized=!1;var r=o._fflush;r&&r(0);for(var e=0;e<Q.streams.length;e++){var t=Q.streams[e];t&&Q.close(t)}},getMode:function(r,e){var t=0;return r&&(t|=365),e&&(t|=146),t},findObject:function(r,e){var t=Q.analyzePath(r,e);return t.exists?t.object:null},analyzePath:function(r,e){try{r=(n=Q.lookupPath(r,{follow:!e})).path}catch(r){}var t={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=Q.lookupPath(r,{parent:!0});t.parentExists=!0,t.parentPath=n.path,t.parentObject=n.node,t.name=X.basename(r),n=Q.lookupPath(r,{follow:!e}),t.exists=!0,t.path=n.path,t.object=n.node,t.name=n.node.name,t.isRoot="/"===n.path}catch(r){t.error=r.errno}return t},createPath:function(r,e,t,n){r="string"==typeof r?r:Q.getPath(r);for(var o=e.split("/").reverse();o.length;){var i=o.pop();if(i){var a=X.join2(r,i);try{Q.mkdir(a)}catch(r){}r=a}}return a},createFile:function(r,e,t,n,o){var i=X.join2("string"==typeof r?r:Q.getPath(r),e),a=Q.getMode(n,o);return Q.create(i,a)},createDataFile:function(r,e,t,n,o,i){var a=e?X.join2("string"==typeof r?r:Q.getPath(r),e):r,s=Q.getMode(n,o),u=Q.create(a,s);if(t){if("string"==typeof t){for(var c=new Array(t.length),f=0,l=t.length;f<l;++f)c[f]=t.charCodeAt(f);t=c}Q.chmod(u,146|s);var d=Q.open(u,577);Q.write(d,t,0,t.length,0,i),Q.close(d),Q.chmod(u,s)}return u},createDevice:function(r,e,t,n){var o=X.join2("string"==typeof r?r:Q.getPath(r),e),i=Q.getMode(!!t,!!n);Q.createDevice.major||(Q.createDevice.major=64);var a=Q.makedev(Q.createDevice.major++,0);return Q.registerDevice(a,{open:function(r){r.seekable=!1},close:function(r){n&&n.buffer&&n.buffer.length&&n(10)},read:function(r,e,n,o,i){for(var a=0,s=0;s<o;s++){var u;try{u=t()}catch(r){throw new Q.ErrnoError(29)}if(void 0===u&&0===a)throw new Q.ErrnoError(6);if(null==u)break;a++,e[n+s]=u}return a&&(r.node.timestamp=Date.now()),a},write:function(r,e,t,o,i){for(var a=0;a<o;a++)try{n(e[t+a])}catch(r){throw new Q.ErrnoError(29)}return o&&(r.node.timestamp=Date.now()),a}}),Q.mkdev(o,i,a)},forceLoadFile:function(r){if(r.isDevice||r.isFolder||r.link||r.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!s)throw new Error("Cannot load without read() or XMLHttpRequest.");try{r.contents=ir(s(r.url),!0),r.usedBytes=r.contents.length}catch(r){throw new Q.ErrnoError(29)}},createLazyFile:function(r,e,t,n,o){function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(r){if(!(r>this.length-1||r<0)){var e=r%this.chunkSize,t=r/this.chunkSize|0;return this.getter(t)[e]}},i.prototype.setDataGetter=function(r){this.getter=r},i.prototype.cacheLength=function(){var r=new XMLHttpRequest;if(r.open("HEAD",t,!1),r.send(null),!(r.status>=200&&r.status<300||304===r.status))throw new Error("Couldn\'t load "+t+". Status: "+r.status);var e,n=Number(r.getResponseHeader("Content-length")),o=(e=r.getResponseHeader("Accept-Ranges"))&&"bytes"===e,i=(e=r.getResponseHeader("Content-Encoding"))&&"gzip"===e,a=1048576;o||(a=n);var s=this;s.setDataGetter(function(r){var e=r*a,o=(r+1)*a-1;if(o=Math.min(o,n-1),void 0===s.chunks[r]&&(s.chunks[r]=function(r,e){if(r>e)throw new Error("invalid range ("+r+", "+e+") or no bytes requested!");if(e>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",t,!1),n!==a&&o.setRequestHeader("Range","bytes="+r+"-"+e),"undefined"!=typeof Uint8Array&&(o.responseType="arraybuffer"),o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn\'t load "+t+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):ir(o.responseText||"",!0)}(e,o)),void 0===s.chunks[r])throw new Error("doXHR failed!");return s.chunks[r]}),!i&&n||(a=n=1,n=this.getter(0).length,a=n,m("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a={isDevice:!1,url:t},s=Q.createFile(r,e,a,n,o);a.contents?s.contents=a.contents:a.url&&(s.contents=null,s.url=a.url),Object.defineProperties(s,{usedBytes:{get:function(){return this.contents.length}}});var u={};return Object.keys(s.stream_ops).forEach(function(r){var e=s.stream_ops[r];u[r]=function(){return Q.forceLoadFile(s),e.apply(null,arguments)}}),u.read=function(r,e,t,n,o){Q.forceLoadFile(s);var i=r.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var u=0;u<a;u++)e[t+u]=i[o+u];else for(u=0;u<a;u++)e[t+u]=i.get(o+u);return a},s.stream_ops=u,s},createPreloadedFile:function(r,e,t,n,i,a,s,c,f,l){Browser.init();var d=e?Y.resolve(X.join2(r,e)):r;function p(t){function u(t){l&&l(),c||Q.createDataFile(r,e,t,n,i,f),a&&a(),N()}var p=!1;o.preloadPlugins.forEach(function(r){p||r.canHandle(d)&&(r.handle(t,d,u,function(){s&&s(),N()}),p=!0)}),p||u(t)}B(),"string"==typeof t?function(r,e,t,n){var o=n?"":"al "+r;u(r,function(t){_(t,\'Loading data file "\'+r+\'" failed (no arrayBuffer).\'),e(new Uint8Array(t)),o&&N()},function(e){if(!t)throw\'Loading data file "\'+r+\'" failed.\';t()}),o&&B()}(t,function(r){p(r)},s):p(t)},indexedDB:function(){return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB},DB_NAME:function(){return"EM_FS_"+window.location.pathname},DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:function(r,e,t){e=e||function(){},t=t||function(){};var n=Q.indexedDB();try{var o=n.open(Q.DB_NAME(),Q.DB_VERSION)}catch(r){return t(r)}o.onupgradeneeded=function(){m("creating db"),o.result.createObjectStore(Q.DB_STORE_NAME)},o.onsuccess=function(){var n=o.result.transaction([Q.DB_STORE_NAME],"readwrite"),i=n.objectStore(Q.DB_STORE_NAME),a=0,s=0,u=r.length;function c(){0==s?e():t()}r.forEach(function(r){var e=i.put(Q.analyzePath(r).object.contents,r);e.onsuccess=function(){++a+s==u&&c()},e.onerror=function(){a+ ++s==u&&c()}}),n.onerror=t},o.onerror=t},loadFilesFromDB:function(r,e,t){e=e||function(){},t=t||function(){};var n=Q.indexedDB();try{var o=n.open(Q.DB_NAME(),Q.DB_VERSION)}catch(r){return t(r)}o.onupgradeneeded=t,o.onsuccess=function(){var n=o.result;try{var i=n.transaction([Q.DB_STORE_NAME],"readonly")}catch(r){return void t(r)}var a=i.objectStore(Q.DB_STORE_NAME),s=0,u=0,c=r.length;function f(){0==u?e():t()}r.forEach(function(r){var e=a.get(r);e.onsuccess=function(){Q.analyzePath(r).exists&&Q.unlink(r),Q.createDataFile(X.dirname(r),X.basename(r),e.result,!0,!0,!0),++s+u==c&&f()},e.onerror=function(){s+ ++u==c&&f()}}),i.onerror=t},o.onerror=t}},Z={mappings:{},DEFAULT_POLLMASK:5,umask:511,calculateAt:function(r,e,t){if("/"===e[0])return e;var n;if(-100===r)n=Q.cwd();else{var o=Q.getStream(r);if(!o)throw new Q.ErrnoError(8);n=o.path}if(0==e.length){if(!t)throw new Q.ErrnoError(44);return n}return X.join2(n,e)},doStat:function(r,e,t){try{var n=r(e)}catch(r){if(r&&r.node&&X.normalize(e)!==X.normalize(Q.getPath(r.node)))return-54;throw r}return b[t>>2]=n.dev,b[t+4>>2]=0,b[t+8>>2]=n.ino,b[t+12>>2]=n.mode,b[t+16>>2]=n.nlink,b[t+20>>2]=n.uid,b[t+24>>2]=n.gid,b[t+28>>2]=n.rdev,b[t+32>>2]=0,H=[n.size>>>0,(U=n.size,+Math.abs(U)>=1?U>0?(0|Math.min(+Math.floor(U/4294967296),4294967295))>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],b[t+40>>2]=H[0],b[t+44>>2]=H[1],b[t+48>>2]=4096,b[t+52>>2]=n.blocks,b[t+56>>2]=n.atime.getTime()/1e3|0,b[t+60>>2]=0,b[t+64>>2]=n.mtime.getTime()/1e3|0,b[t+68>>2]=0,b[t+72>>2]=n.ctime.getTime()/1e3|0,b[t+76>>2]=0,H=[n.ino>>>0,(U=n.ino,+Math.abs(U)>=1?U>0?(0|Math.min(+Math.floor(U/4294967296),4294967295))>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],b[t+80>>2]=H[0],b[t+84>>2]=H[1],0},doMsync:function(r,e,t,n,o){var i=E.slice(r,r+t);Q.msync(e,i,o,t,n)},doMkdir:function(r,e){return"/"===(r=X.normalize(r))[r.length-1]&&(r=r.substr(0,r.length-1)),Q.mkdir(r,e,0),0},doMknod:function(r,e,t){switch(61440&e){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return Q.mknod(r,e,t),0},doReadlink:function(r,e,t){if(t<=0)return-28;var n=Q.readlink(r),o=Math.min(t,A(n)),i=g[e+o];return x(n,E,e,t+1),g[e+o]=i,o},doAccess:function(r,e){if(-8&e)return-28;var t;if(!(t=Q.lookupPath(r,{follow:!0}).node))return-44;var n="";return 4&e&&(n+="r"),2&e&&(n+="w"),1&e&&(n+="x"),n&&Q.nodePermissions(t,n)?-2:0},doDup:function(r,e,t){var n=Q.getStream(t);return n&&Q.close(n),Q.open(r,e,0,t,t).fd},doReadv:function(r,e,t,n){for(var o=0,i=0;i<t;i++){var a=b[e+8*i>>2],s=b[e+(8*i+4)>>2],u=Q.read(r,g,a,s,n);if(u<0)return-1;if(o+=u,u<s)break}return o},doWritev:function(r,e,t,n){for(var o=0,i=0;i<t;i++){var a=b[e+8*i>>2],s=b[e+(8*i+4)>>2],u=Q.write(r,g,a,s,n);if(u<0)return-1;o+=u}return o},varargs:void 0,get:function(){return Z.varargs+=4,b[Z.varargs-4>>2]},getStr:function(r){return F(r)},getStreamFromFD:function(r){var e=Q.getStream(r);if(!e)throw new Q.ErrnoError(8);return e},get64:function(r,e){return r}},rr=[];function er(r){try{return h.grow(r-y.byteLength+65535>>>16),M(h.buffer),1}catch(r){}}var tr={};function nr(){if(!nr.strings){var r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:f||"./this.program"};for(var e in tr)void 0===tr[e]?delete r[e]:r[e]=tr[e];var t=[];for(var e in r)t.push(e+"="+r[e]);nr.strings=t}return nr.strings}var or=function(r,e,t,n){r||(r=this),this.parent=r,this.mount=r.mount,this.mounted=null,this.id=Q.nextInode++,this.name=e,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n};function ir(r,e,t){var n=t>0?t:A(r)+1,o=new Array(n),i=x(r,o,0,o.length);return e&&(o.length=i),o}Object.defineProperties(or.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(r){r?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(r){r?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return Q.isDir(this.mode)}},isDevice:{get:function(){return Q.isChrdev(this.mode)}}}),Q.FSNode=or,Q.staticInit();var ar={g:function(){return 42},i:function(r,e,t){Z.varargs=t;try{var n=Z.getStr(r),o=t?Z.get():0;return Q.open(n,e,o).fd}catch(r){return void 0!==Q&&r instanceof Q.ErrnoError||O(r),-r.errno}},b:function(){O()},a:function(r,e,t){var n=function(r,e){var t;for(rr.length=0,e>>=2;t=E[r++];){var n=t<105;n&&1&e&&e++,rr.push(n?k[e++>>1]:b[e]),++e}return rr}(e,t);return V[r].apply(null,n)},k:function(r,e,t){E.copyWithin(r,e,e+t)},l:function(r){var e,t,n=E.length;if((r>>>=0)>2147483648)return!1;for(var o=1;o<=4;o*=2){var i=n*(1+.2/o);if(i=Math.min(i,r+100663296),er(Math.min(2147483648,((e=Math.max(r,i))%(t=65536)>0&&(e+=t-e%t),e))))return!0}return!1},e:function(r,e){try{var t=0;return nr().forEach(function(n,o){var i=e+t;b[r+4*o>>2]=i,function(r,e,t){for(var n=0;n<r.length;++n)g[e++>>0]=r.charCodeAt(n);t||(g[e>>0]=0)}(n,i),t+=n.length+1}),0}catch(r){return void 0!==Q&&r instanceof Q.ErrnoError||O(r),r.errno}},f:function(r,e){try{var t=nr();b[r>>2]=t.length;var n=0;return t.forEach(function(r){n+=r.length+1}),b[e>>2]=n,0}catch(r){return void 0!==Q&&r instanceof Q.ErrnoError||O(r),r.errno}},c:function(r){try{var e=Z.getStreamFromFD(r);return Q.close(e),0}catch(r){return void 0!==Q&&r instanceof Q.ErrnoError||O(r),r.errno}},h:function(r,e,t,n){try{var o=Z.getStreamFromFD(r),i=Z.doReadv(o,e,t);return b[n>>2]=i,0}catch(r){return void 0!==Q&&r instanceof Q.ErrnoError||O(r),r.errno}},j:function(r,e,t,n,o){try{var i=Z.getStreamFromFD(r),a=4294967296*t+(e>>>0);return a<=-9007199254740992||a>=9007199254740992?-61:(Q.llseek(i,a,n),H=[i.position>>>0,(U=i.position,+Math.abs(U)>=1?U>0?(0|Math.min(+Math.floor(U/4294967296),4294967295))>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],b[o>>2]=H[0],b[o+4>>2]=H[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0)}catch(r){return void 0!==Q&&r instanceof Q.ErrnoError||O(r),r.errno}},d:function(r,e,t,n){try{var o=Z.getStreamFromFD(r),i=Z.doWritev(o,e,t);return b[n>>2]=i,0}catch(r){return void 0!==Q&&r instanceof Q.ErrnoError||O(r),r.errno}},m:function(r){var e=Date.now();return b[r>>2]=e/1e3|0,b[r+4>>2]=e%1e3*1e3|0,0}};!function(){var r={a:ar};function e(r,e){var t,n=r.exports;o.asm=n,M((h=o.asm.n).buffer),D=o.asm.H,t=o.asm.o,C.unshift(t),N()}function t(r){e(r.instance)}function i(e){return(!p&&l&&"function"==typeof fetch?fetch(L,{credentials:"same-origin"}).then(function(r){if(!r.ok)throw"failed to load wasm binary file at \'"+L+"\'";return r.arrayBuffer()}).catch(function(){return G(L)}):Promise.resolve().then(function(){return G(L)})).then(function(e){return WebAssembly.instantiate(e,r)}).then(e,function(r){v("failed to asynchronously prepare wasm: "+r),O(r)})}if(B(),o.instantiateWasm)try{return o.instantiateWasm(r,e)}catch(r){return v("Module.instantiateWasm callback failed with error: "+r),!1}(p||"function"!=typeof WebAssembly.instantiateStreaming||q(L)||"function"!=typeof fetch?i(t):fetch(L,{credentials:"same-origin"}).then(function(e){return WebAssembly.instantiateStreaming(e,r).then(t,function(r){return v("wasm streaming compile failed: "+r),v("falling back to ArrayBuffer instantiation"),i(t)})})).catch(n)}(),o.___wasm_call_ctors=function(){return(o.___wasm_call_ctors=o.asm.o).apply(null,arguments)};var sr,ur=o._emscripten_bind_CExpat_CExpat_0=function(){return(ur=o._emscripten_bind_CExpat_CExpat_0=o.asm.p).apply(null,arguments)},cr=o._emscripten_bind_CExpat_version_0=function(){return(cr=o._emscripten_bind_CExpat_version_0=o.asm.q).apply(null,arguments)},fr=o._emscripten_bind_CExpat_create_0=function(){return(fr=o._emscripten_bind_CExpat_create_0=o.asm.r).apply(null,arguments)},lr=o._emscripten_bind_CExpat_destroy_0=function(){return(lr=o._emscripten_bind_CExpat_destroy_0=o.asm.s).apply(null,arguments)},dr=o._emscripten_bind_CExpat_parse_1=function(){return(dr=o._emscripten_bind_CExpat_parse_1=o.asm.t).apply(null,arguments)},pr=o._emscripten_bind_CExpat_tag_0=function(){return(pr=o._emscripten_bind_CExpat_tag_0=o.asm.u).apply(null,arguments)},hr=o._emscripten_bind_CExpat_attrs_0=function(){return(hr=o._emscripten_bind_CExpat_attrs_0=o.asm.v).apply(null,arguments)},mr=o._emscripten_bind_CExpat_content_0=function(){return(mr=o._emscripten_bind_CExpat_content_0=o.asm.w).apply(null,arguments)},vr=o._emscripten_bind_CExpat_startElement_0=function(){return(vr=o._emscripten_bind_CExpat_startElement_0=o.asm.x).apply(null,arguments)},wr=o._emscripten_bind_CExpat_endElement_0=function(){return(wr=o._emscripten_bind_CExpat_endElement_0=o.asm.y).apply(null,arguments)},_r=o._emscripten_bind_CExpat_characterData_0=function(){return(_r=o._emscripten_bind_CExpat_characterData_0=o.asm.z).apply(null,arguments)},yr=o._emscripten_bind_CExpat___destroy___0=function(){return(yr=o._emscripten_bind_CExpat___destroy___0=o.asm.A).apply(null,arguments)},gr=o._emscripten_bind_VoidPtr___destroy___0=function(){return(gr=o._emscripten_bind_VoidPtr___destroy___0=o.asm.B).apply(null,arguments)},Er=o._emscripten_bind_CExpatJS_CExpatJS_0=function(){return(Er=o._emscripten_bind_CExpatJS_CExpatJS_0=o.asm.C).apply(null,arguments)},br=o._emscripten_bind_CExpatJS_startElement_0=function(){return(br=o._emscripten_bind_CExpatJS_startElement_0=o.asm.D).apply(null,arguments)},kr=o._emscripten_bind_CExpatJS_endElement_0=function(){return(kr=o._emscripten_bind_CExpatJS_endElement_0=o.asm.E).apply(null,arguments)},Dr=o._emscripten_bind_CExpatJS_characterData_0=function(){return(Dr=o._emscripten_bind_CExpatJS_characterData_0=o.asm.F).apply(null,arguments)},Sr=o._emscripten_bind_CExpatJS___destroy___0=function(){return(Sr=o._emscripten_bind_CExpatJS___destroy___0=o.asm.G).apply(null,arguments)};function Pr(r){function t(){sr||(sr=!0,o.calledRun=!0,w||(o.noFSInit||Q.init.initialized||Q.init(),Q.ignorePermissions=!1,J(C),e(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),function(){if(o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)r=o.postRun.shift(),z.unshift(r);var r;J(z)}()))}j>0||(function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)r=o.preRun.shift(),R.unshift(r);var r;J(R)}(),j>0||(o.setStatus?(o.setStatus("Running..."),setTimeout(function(){setTimeout(function(){o.setStatus("")},1),t()},1)):t()))}if(o._malloc=function(){return(o._malloc=o.asm.I).apply(null,arguments)},T=function r(){sr||Pr(),sr||(T=r)},o.run=Pr,o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();function Fr(){}function xr(r){return(r||Fr).__cache__}function Ar(r,e){var t=xr(e),n=t[r];return n||((n=Object.create((e||Fr).prototype)).ptr=r,t[r]=n)}Pr(),Fr.prototype=Object.create(Fr.prototype),Fr.prototype.constructor=Fr,Fr.prototype.__class__=Fr,Fr.__cache__={},o.WrapperObject=Fr,o.getCache=xr,o.wrapPointer=Ar,o.castObject=function(r,e){return Ar(r.ptr,e)},o.NULL=Ar(0),o.destroy=function(r){if(!r.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";r.__destroy__(),delete xr(r.__class__)[r.ptr]},o.compare=function(r,e){return r.ptr===e.ptr},o.getPointer=function(r){return r.ptr},o.getClass=function(r){return r.__class__};var Mr={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(Mr.needed){for(var r=0;r<Mr.temps.length;r++)o._free(Mr.temps[r]);Mr.temps.length=0,o._free(Mr.buffer),Mr.buffer=0,Mr.size+=Mr.needed,Mr.needed=0}Mr.buffer||(Mr.size+=128,Mr.buffer=o._malloc(Mr.size),_(Mr.buffer)),Mr.pos=0},alloc:function(r,e){_(Mr.buffer);var t,n=e.BYTES_PER_ELEMENT,i=r.length*n;return i=i+7&-8,Mr.pos+i>=Mr.size?(_(i>0),Mr.needed+=i,t=o._malloc(i),Mr.temps.push(t)):(t=Mr.buffer+Mr.pos,Mr.pos+=i),t},copy:function(r,e,t){switch(t>>>=0,e.BYTES_PER_ELEMENT){case 2:t>>>=1;break;case 4:t>>>=2;break;case 8:t>>>=3}for(var n=0;n<r.length;n++)e[t+n]=r[n]}};function Rr(){this.ptr=ur(),xr(Rr)[this.ptr]=this}function Cr(){throw"cannot construct a VoidPtr, no constructor in IDL"}function zr(){this.ptr=Er(),xr(zr)[this.ptr]=this}return Rr.prototype=Object.create(Fr.prototype),Rr.prototype.constructor=Rr,Rr.prototype.__class__=Rr,Rr.__cache__={},o.CExpat=Rr,Rr.prototype.version=Rr.prototype.version=function(){var r=this.ptr;return F(cr(r))},Rr.prototype.create=Rr.prototype.create=function(){var r=this.ptr;return!!fr(r)},Rr.prototype.destroy=Rr.prototype.destroy=function(){var r=this.ptr;lr(r)},Rr.prototype.parse=Rr.prototype.parse=function(r){var e=this.ptr;return Mr.prepare(),r=r&&"object"==typeof r?r.ptr:function(r){if("string"==typeof r){var e=ir(r),t=Mr.alloc(e,g);return Mr.copy(e,g,t),t}return r}(r),!!dr(e,r)},Rr.prototype.tag=Rr.prototype.tag=function(){var r=this.ptr;return F(pr(r))},Rr.prototype.attrs=Rr.prototype.attrs=function(){var r=this.ptr;return F(hr(r))},Rr.prototype.content=Rr.prototype.content=function(){var r=this.ptr;return F(mr(r))},Rr.prototype.startElement=Rr.prototype.startElement=function(){var r=this.ptr;vr(r)},Rr.prototype.endElement=Rr.prototype.endElement=function(){var r=this.ptr;wr(r)},Rr.prototype.characterData=Rr.prototype.characterData=function(){var r=this.ptr;_r(r)},Rr.prototype.__destroy__=Rr.prototype.__destroy__=function(){var r=this.ptr;yr(r)},Cr.prototype=Object.create(Fr.prototype),Cr.prototype.constructor=Cr,Cr.prototype.__class__=Cr,Cr.__cache__={},o.VoidPtr=Cr,Cr.prototype.__destroy__=Cr.prototype.__destroy__=function(){var r=this.ptr;gr(r)},zr.prototype=Object.create(Rr.prototype),zr.prototype.constructor=zr,zr.prototype.__class__=zr,zr.__cache__={},o.CExpatJS=zr,zr.prototype.startElement=zr.prototype.startElement=function(){var r=this.ptr;br(r)},zr.prototype.endElement=zr.prototype.endElement=function(){var r=this.ptr;kr(r)},zr.prototype.characterData=zr.prototype.characterData=function(){var r=this.ptr;Dr(r)},zr.prototype.__destroy__=zr.prototype.__destroy__=function(){var r=this.ptr;Sr(r)},r.ready},e.exports=n;var o=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}().__hpcc_wasmFolder||void 0;function i(r,e,t){var n=r.default||r;return n.__hpcc_promise||(n.__hpcc_promise=n({wasmBinary:t,locateFile:function(r,t){return function(r,e){for(;r.charAt(r.length-1)===e;)r=r.substring(0,r.length-1);return r}(e||function(r){if(!arguments.length)return o;var e=o;return o=r,e}()||t||".","/")+"/"+function(r,e){for(;r.charAt(0)===e;)r=r.substring(1);return r}(r,"/")}})),n.__hpcc_promise}!function(){function r(r,e){this.tag=r,this.attrs=e,this._content=""}Object.defineProperty(r.prototype,"content",{get:function(){return this._content},enumerable:!1,configurable:!0}),r.prototype.appendContent=function(r){this._content+=r}}();var a={exports:{}};!function(r,e){var t=function(){var r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0;return function(e){var t,n,o=void 0!==(e=e||{})?e:{};o.ready=new Promise(function(r,e){t=r,n=e});var i,a={};for(i in o)o.hasOwnProperty(i)&&(a[i]=o[i]);var s,u,c,f="./this.program",l=function(r,e){throw e},d=!0,p="";"undefined"!=typeof document&&document.currentScript&&(p=document.currentScript.src),r&&(p=r),p=0!==p.indexOf("blob:")?p.substr(0,p.lastIndexOf("/")+1):"",s=function(r){var e=new XMLHttpRequest;return e.open("GET",r,!1),e.send(null),e.responseText},u=function(r,e,t){var n=new XMLHttpRequest;n.open("GET",r,!0),n.responseType="arraybuffer",n.onload=function(){200==n.status||0==n.status&&n.response?e(n.response):t()},n.onerror=t,n.send(null)};var h=o.print||console.log.bind(console),m=o.printErr||console.warn.bind(console);for(i in a)a.hasOwnProperty(i)&&(o[i]=a[i]);a=null,o.arguments,o.thisProgram&&(f=o.thisProgram),o.quit&&(l=o.quit);var v=16;var w,_=0,y=function(r){_=r},g=function(){return _};o.wasmBinary&&(w=o.wasmBinary);var E,b=o.noExitRuntime||!0;"object"!=typeof WebAssembly&&V("no native wasm support detected");var k=!1;function D(r,e){r||V("Assertion failed: "+e)}var S,P,F,x,A,M,R,C="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function z(r,e,t){for(var n=e+t,o=e;r[o]&&!(o>=n);)++o;if(o-e>16&&r.subarray&&C)return C.decode(r.subarray(e,o));for(var i="";e<o;){var a=r[e++];if(128&a){var s=63&r[e++];if(192!=(224&a)){var u=63&r[e++];if((a=224==(240&a)?(15&a)<<12|s<<6|u:(7&a)<<18|s<<12|u<<6|63&r[e++])<65536)i+=String.fromCharCode(a);else{var c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function j(r,e){return r?z(F,r,e):""}function T(r,e,t,n){if(!(n>0))return 0;for(var o=t,i=t+n-1,a=0;a<r.length;++a){var s=r.charCodeAt(a);if(s>=55296&&s<=57343)s=65536+((1023&s)<<10)|1023&r.charCodeAt(++a);if(s<=127){if(t>=i)break;e[t++]=s}else if(s<=2047){if(t+1>=i)break;e[t++]=192|s>>6,e[t++]=128|63&s}else if(s<=65535){if(t+2>=i)break;e[t++]=224|s>>12,e[t++]=128|s>>6&63,e[t++]=128|63&s}else{if(t+3>=i)break;e[t++]=240|s>>18,e[t++]=128|s>>12&63,e[t++]=128|s>>6&63,e[t++]=128|63&s}}return e[t]=0,t-o}function B(r){for(var e=0,t=0;t<r.length;++t){var n=r.charCodeAt(t);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&r.charCodeAt(++t)),n<=127?++e:e+=n<=2047?2:n<=65535?3:4}return e}function N(r){S=r,o.HEAP8=P=new Int8Array(r),o.HEAP16=x=new Int16Array(r),o.HEAP32=A=new Int32Array(r),o.HEAPU8=F=new Uint8Array(r),o.HEAPU16=new Uint16Array(r),o.HEAPU32=new Uint32Array(r),o.HEAPF32=new Float32Array(r),o.HEAPF64=M=new Float64Array(r)}o.INITIAL_MEMORY;var O=[],L=[],I=[],U=0;var H=0,W=null;function q(r){H++,o.monitorRunDependencies&&o.monitorRunDependencies(H)}function G(r){if(H--,o.monitorRunDependencies&&o.monitorRunDependencies(H),0==H&&W){var e=W;W=null,e()}}function V(r){o.onAbort&&o.onAbort(r),m(r+=""),k=!0,r="abort("+r+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(r);throw n(e),e}o.preloadedImages={},o.preloadedAudios={};var J,X,Y,K,$="data:application/octet-stream;base64,";function Q(r){return r.startsWith($)}function Z(r){try{if(r==J&&w)return new Uint8Array(w);if(!c)throw"both async and sync fetching of the wasm failed"}catch(r){V(r)}}Q(J="graphvizlib.wasm")||(X=J,J=o.locateFile?o.locateFile(X,p):p+X);var rr,er={141888:function(r,e){var t=j(r),n=j(e);lr.createPath("/",ir.dirname(t)),lr.writeFile(ir.join("/",t),n)}};function tr(r){for(;r.length>0;){var e=r.shift();if("function"!=typeof e){var t=e.func;"number"==typeof t?void 0===e.arg?R.get(t)():R.get(t)(e.arg):t(void 0===e.arg?null:e.arg)}else e(o)}}rr=function(){return performance.now()};var nr=!0;function or(r){return A[Ar()>>2]=r,r}var ir={splitPath:function(r){return/^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/.exec(r).slice(1)},normalizeArray:function(r,e){for(var t=0,n=r.length-1;n>=0;n--){var o=r[n];"."===o?r.splice(n,1):".."===o?(r.splice(n,1),t++):t&&(r.splice(n,1),t--)}if(e)for(;t;t--)r.unshift("..");return r},normalize:function(r){var e="/"===r.charAt(0),t="/"===r.substr(-1);return(r=ir.normalizeArray(r.split("/").filter(function(r){return!!r}),!e).join("/"))||e||(r="."),r&&t&&(r+="/"),(e?"/":"")+r},dirname:function(r){var e=ir.splitPath(r),t=e[0],n=e[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:function(r){if("/"===r)return"/";var e=(r=(r=ir.normalize(r)).replace(/\\/$/,"")).lastIndexOf("/");return-1===e?r:r.substr(e+1)},extname:function(r){return ir.splitPath(r)[3]},join:function(){var r=Array.prototype.slice.call(arguments,0);return ir.normalize(r.join("/"))},join2:function(r,e){return ir.normalize(r+"/"+e)}};var ar={resolve:function(){for(var r="",e=!1,t=arguments.length-1;t>=-1&&!e;t--){var n=t>=0?arguments[t]:lr.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";r=n+"/"+r,e="/"===n.charAt(0)}return(e?"/":"")+(r=ir.normalizeArray(r.split("/").filter(function(r){return!!r}),!e).join("/"))||"."},relative:function(r,e){function t(r){for(var e=0;e<r.length&&""===r[e];e++);for(var t=r.length-1;t>=0&&""===r[t];t--);return e>t?[]:r.slice(e,t-e+1)}r=ar.resolve(r).substr(1),e=ar.resolve(e).substr(1);for(var n=t(r.split("/")),o=t(e.split("/")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var u=[];for(s=a;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(a))).join("/")}},sr={ttys:[],init:function(){},shutdown:function(){},register:function(r,e){sr.ttys[r]={input:[],output:[],ops:e},lr.registerDevice(r,sr.stream_ops)},stream_ops:{open:function(r){var e=sr.ttys[r.node.rdev];if(!e)throw new lr.ErrnoError(43);r.tty=e,r.seekable=!1},close:function(r){r.tty.ops.flush(r.tty)},flush:function(r){r.tty.ops.flush(r.tty)},read:function(r,e,t,n,o){if(!r.tty||!r.tty.ops.get_char)throw new lr.ErrnoError(60);for(var i=0,a=0;a<n;a++){var s;try{s=r.tty.ops.get_char(r.tty)}catch(r){throw new lr.ErrnoError(29)}if(void 0===s&&0===i)throw new lr.ErrnoError(6);if(null==s)break;i++,e[t+a]=s}return i&&(r.node.timestamp=Date.now()),i},write:function(r,e,t,n,o){if(!r.tty||!r.tty.ops.put_char)throw new lr.ErrnoError(60);try{for(var i=0;i<n;i++)r.tty.ops.put_char(r.tty,e[t+i])}catch(r){throw new lr.ErrnoError(29)}return n&&(r.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(r){if(!r.input.length){var e=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\\n"),!e)return null;r.input=_r(e,!0)}return r.input.shift()},put_char:function(r,e){null===e||10===e?(h(z(r.output,0)),r.output=[]):0!=e&&r.output.push(e)},flush:function(r){r.output&&r.output.length>0&&(h(z(r.output,0)),r.output=[])}},default_tty1_ops:{put_char:function(r,e){null===e||10===e?(m(z(r.output,0)),r.output=[]):0!=e&&r.output.push(e)},flush:function(r){r.output&&r.output.length>0&&(m(z(r.output,0)),r.output=[])}}};function ur(r,e){F.fill(0,r,r+e)}function cr(r){r=function(r,e){return e||(e=v),Math.ceil(r/e)*e}(r,65536);var e=zr(65536,r);return e?(ur(e,r),e):0}var fr={ops_table:null,mount:function(r){return fr.createNode(null,"/",16895,0)},createNode:function(r,e,t,n){if(lr.isBlkdev(t)||lr.isFIFO(t))throw new lr.ErrnoError(63);fr.ops_table||(fr.ops_table={dir:{node:{getattr:fr.node_ops.getattr,setattr:fr.node_ops.setattr,lookup:fr.node_ops.lookup,mknod:fr.node_ops.mknod,rename:fr.node_ops.rename,unlink:fr.node_ops.unlink,rmdir:fr.node_ops.rmdir,readdir:fr.node_ops.readdir,symlink:fr.node_ops.symlink},stream:{llseek:fr.stream_ops.llseek}},file:{node:{getattr:fr.node_ops.getattr,setattr:fr.node_ops.setattr},stream:{llseek:fr.stream_ops.llseek,read:fr.stream_ops.read,write:fr.stream_ops.write,allocate:fr.stream_ops.allocate,mmap:fr.stream_ops.mmap,msync:fr.stream_ops.msync}},link:{node:{getattr:fr.node_ops.getattr,setattr:fr.node_ops.setattr,readlink:fr.node_ops.readlink},stream:{}},chrdev:{node:{getattr:fr.node_ops.getattr,setattr:fr.node_ops.setattr},stream:lr.chrdev_stream_ops}});var o=lr.createNode(r,e,t,n);return lr.isDir(o.mode)?(o.node_ops=fr.ops_table.dir.node,o.stream_ops=fr.ops_table.dir.stream,o.contents={}):lr.isFile(o.mode)?(o.node_ops=fr.ops_table.file.node,o.stream_ops=fr.ops_table.file.stream,o.usedBytes=0,o.contents=null):lr.isLink(o.mode)?(o.node_ops=fr.ops_table.link.node,o.stream_ops=fr.ops_table.link.stream):lr.isChrdev(o.mode)&&(o.node_ops=fr.ops_table.chrdev.node,o.stream_ops=fr.ops_table.chrdev.stream),o.timestamp=Date.now(),r&&(r.contents[e]=o,r.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(r){return r.contents?r.contents.subarray?r.contents.subarray(0,r.usedBytes):new Uint8Array(r.contents):new Uint8Array(0)},expandFileStorage:function(r,e){var t=r.contents?r.contents.length:0;if(!(t>=e)){e=Math.max(e,t*(t<1048576?2:1.125)>>>0),0!=t&&(e=Math.max(e,256));var n=r.contents;r.contents=new Uint8Array(e),r.usedBytes>0&&r.contents.set(n.subarray(0,r.usedBytes),0)}},resizeFileStorage:function(r,e){if(r.usedBytes!=e)if(0==e)r.contents=null,r.usedBytes=0;else{var t=r.contents;r.contents=new Uint8Array(e),t&&r.contents.set(t.subarray(0,Math.min(e,r.usedBytes))),r.usedBytes=e}},node_ops:{getattr:function(r){var e={};return e.dev=lr.isChrdev(r.mode)?r.id:1,e.ino=r.id,e.mode=r.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=r.rdev,lr.isDir(r.mode)?e.size=4096:lr.isFile(r.mode)?e.size=r.usedBytes:lr.isLink(r.mode)?e.size=r.link.length:e.size=0,e.atime=new Date(r.timestamp),e.mtime=new Date(r.timestamp),e.ctime=new Date(r.timestamp),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr:function(r,e){void 0!==e.mode&&(r.mode=e.mode),void 0!==e.timestamp&&(r.timestamp=e.timestamp),void 0!==e.size&&fr.resizeFileStorage(r,e.size)},lookup:function(r,e){throw lr.genericErrors[44]},mknod:function(r,e,t,n){return fr.createNode(r,e,t,n)},rename:function(r,e,t){if(lr.isDir(r.mode)){var n;try{n=lr.lookupNode(e,t)}catch(r){}if(n)for(var o in n.contents)throw new lr.ErrnoError(55)}delete r.parent.contents[r.name],r.parent.timestamp=Date.now(),r.name=t,e.contents[t]=r,e.timestamp=r.parent.timestamp,r.parent=e},unlink:function(r,e){delete r.contents[e],r.timestamp=Date.now()},rmdir:function(r,e){var t=lr.lookupNode(r,e);for(var n in t.contents)throw new lr.ErrnoError(55);delete r.contents[e],r.timestamp=Date.now()},readdir:function(r){var e=[".",".."];for(var t in r.contents)r.contents.hasOwnProperty(t)&&e.push(t);return e},symlink:function(r,e,t){var n=fr.createNode(r,e,41471,0);return n.link=t,n},readlink:function(r){if(!lr.isLink(r.mode))throw new lr.ErrnoError(28);return r.link}},stream_ops:{read:function(r,e,t,n,o){var i=r.node.contents;if(o>=r.node.usedBytes)return 0;var a=Math.min(r.node.usedBytes-o,n);if(a>8&&i.subarray)e.set(i.subarray(o,o+a),t);else for(var s=0;s<a;s++)e[t+s]=i[o+s];return a},write:function(r,e,t,n,o,i){if(e.buffer===P.buffer&&(i=!1),!n)return 0;var a=r.node;if(a.timestamp=Date.now(),e.subarray&&(!a.contents||a.contents.subarray)){if(i)return a.contents=e.subarray(t,t+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=e.slice(t,t+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(e.subarray(t,t+n),o),n}if(fr.expandFileStorage(a,o+n),a.contents.subarray&&e.subarray)a.contents.set(e.subarray(t,t+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=e[t+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek:function(r,e,t){var n=e;if(1===t?n+=r.position:2===t&&lr.isFile(r.node.mode)&&(n+=r.node.usedBytes),n<0)throw new lr.ErrnoError(28);return n},allocate:function(r,e,t){fr.expandFileStorage(r.node,e+t),r.node.usedBytes=Math.max(r.node.usedBytes,e+t)},mmap:function(r,e,t,n,o,i){if(0!==e)throw new lr.ErrnoError(28);if(!lr.isFile(r.node.mode))throw new lr.ErrnoError(43);var a,s,u=r.node.contents;if(2&i||u.buffer!==S){if((n>0||n+t<u.length)&&(u=u.subarray?u.subarray(n,n+t):Array.prototype.slice.call(u,n,n+t)),s=!0,!(a=cr(t)))throw new lr.ErrnoError(48);P.set(u,a)}else s=!1,a=u.byteOffset;return{ptr:a,allocated:s}},msync:function(r,e,t,n,o){if(!lr.isFile(r.node.mode))throw new lr.ErrnoError(43);return 2&o?0:(fr.stream_ops.write(r,e,0,n,t,!1),0)}}};var lr={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:function(r,e){if(e=e||{},!(r=ar.resolve(lr.cwd(),r)))return{path:"",node:null};var t={follow_mount:!0,recurse_count:0};for(var n in t)void 0===e[n]&&(e[n]=t[n]);if(e.recurse_count>8)throw new lr.ErrnoError(32);for(var o=ir.normalizeArray(r.split("/").filter(function(r){return!!r}),!1),i=lr.root,a="/",s=0;s<o.length;s++){var u=s===o.length-1;if(u&&e.parent)break;if(i=lr.lookupNode(i,o[s]),a=ir.join2(a,o[s]),lr.isMountpoint(i)&&(!u||u&&e.follow_mount)&&(i=i.mounted.root),!u||e.follow)for(var c=0;lr.isLink(i.mode);){var f=lr.readlink(a);if(a=ar.resolve(ir.dirname(a),f),i=lr.lookupPath(a,{recurse_count:e.recurse_count}).node,c++>40)throw new lr.ErrnoError(32)}}return{path:a,node:i}},getPath:function(r){for(var e;;){if(lr.isRoot(r)){var t=r.mount.mountpoint;return e?"/"!==t[t.length-1]?t+"/"+e:t+e:t}e=e?r.name+"/"+e:r.name,r=r.parent}},hashName:function(r,e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return(r+t>>>0)%lr.nameTable.length},hashAddNode:function(r){var e=lr.hashName(r.parent.id,r.name);r.name_next=lr.nameTable[e],lr.nameTable[e]=r},hashRemoveNode:function(r){var e=lr.hashName(r.parent.id,r.name);if(lr.nameTable[e]===r)lr.nameTable[e]=r.name_next;else for(var t=lr.nameTable[e];t;){if(t.name_next===r){t.name_next=r.name_next;break}t=t.name_next}},lookupNode:function(r,e){var t=lr.mayLookup(r);if(t)throw new lr.ErrnoError(t,r);for(var n=lr.hashName(r.id,e),o=lr.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===r.id&&i===e)return o}return lr.lookup(r,e)},createNode:function(r,e,t,n){var o=new lr.FSNode(r,e,t,n);return lr.hashAddNode(o),o},destroyNode:function(r){lr.hashRemoveNode(r)},isRoot:function(r){return r===r.parent},isMountpoint:function(r){return!!r.mounted},isFile:function(r){return 32768==(61440&r)},isDir:function(r){return 16384==(61440&r)},isLink:function(r){return 40960==(61440&r)},isChrdev:function(r){return 8192==(61440&r)},isBlkdev:function(r){return 24576==(61440&r)},isFIFO:function(r){return 4096==(61440&r)},isSocket:function(r){return 49152==(49152&r)},flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:function(r){var e=lr.flagModes[r];if(void 0===e)throw new Error("Unknown file open mode: "+r);return e},flagsToPermissionString:function(r){var e=["r","w","rw"][3&r];return 512&r&&(e+="w"),e},nodePermissions:function(r,e){return lr.ignorePermissions?0:(!e.includes("r")||292&r.mode)&&(!e.includes("w")||146&r.mode)&&(!e.includes("x")||73&r.mode)?0:2},mayLookup:function(r){var e=lr.nodePermissions(r,"x");return e||(r.node_ops.lookup?0:2)},mayCreate:function(r,e){try{lr.lookupNode(r,e);return 20}catch(r){}return lr.nodePermissions(r,"wx")},mayDelete:function(r,e,t){var n;try{n=lr.lookupNode(r,e)}catch(r){return r.errno}var o=lr.nodePermissions(r,"wx");if(o)return o;if(t){if(!lr.isDir(n.mode))return 54;if(lr.isRoot(n)||lr.getPath(n)===lr.cwd())return 10}else if(lr.isDir(n.mode))return 31;return 0},mayOpen:function(r,e){return r?lr.isLink(r.mode)?32:lr.isDir(r.mode)&&("r"!==lr.flagsToPermissionString(e)||512&e)?31:lr.nodePermissions(r,lr.flagsToPermissionString(e)):44},MAX_OPEN_FDS:4096,nextfd:function(r,e){r=r||0,e=e||lr.MAX_OPEN_FDS;for(var t=r;t<=e;t++)if(!lr.streams[t])return t;throw new lr.ErrnoError(33)},getStream:function(r){return lr.streams[r]},createStream:function(r,e,t){lr.FSStream||(lr.FSStream=function(){},lr.FSStream.prototype={object:{get:function(){return this.node},set:function(r){this.node=r}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}});var n=new lr.FSStream;for(var o in r)n[o]=r[o];r=n;var i=lr.nextfd(e,t);return r.fd=i,lr.streams[i]=r,r},closeStream:function(r){lr.streams[r]=null},chrdev_stream_ops:{open:function(r){var e=lr.getDevice(r.node.rdev);r.stream_ops=e.stream_ops,r.stream_ops.open&&r.stream_ops.open(r)},llseek:function(){throw new lr.ErrnoError(70)}},major:function(r){return r>>8},minor:function(r){return 255&r},makedev:function(r,e){return r<<8|e},registerDevice:function(r,e){lr.devices[r]={stream_ops:e}},getDevice:function(r){return lr.devices[r]},getMounts:function(r){for(var e=[],t=[r];t.length;){var n=t.pop();e.push(n),t.push.apply(t,n.mounts)}return e},syncfs:function(r,e){"function"==typeof r&&(e=r,r=!1),lr.syncFSRequests++,lr.syncFSRequests>1&&m("warning: "+lr.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var t=lr.getMounts(lr.root.mount),n=0;function o(r){return lr.syncFSRequests--,e(r)}function i(r){if(r)return i.errored?void 0:(i.errored=!0,o(r));++n>=t.length&&o(null)}t.forEach(function(e){if(!e.type.syncfs)return i(null);e.type.syncfs(e,r,i)})},mount:function(r,e,t){var n,o="/"===t,i=!t;if(o&&lr.root)throw new lr.ErrnoError(10);if(!o&&!i){var a=lr.lookupPath(t,{follow_mount:!1});if(t=a.path,n=a.node,lr.isMountpoint(n))throw new lr.ErrnoError(10);if(!lr.isDir(n.mode))throw new lr.ErrnoError(54)}var s={type:r,opts:e,mountpoint:t,mounts:[]},u=r.mount(s);return u.mount=s,s.root=u,o?lr.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:function(r){var e=lr.lookupPath(r,{follow_mount:!1});if(!lr.isMountpoint(e.node))throw new lr.ErrnoError(28);var t=e.node,n=t.mounted,o=lr.getMounts(n);Object.keys(lr.nameTable).forEach(function(r){for(var e=lr.nameTable[r];e;){var t=e.name_next;o.includes(e.mount)&&lr.destroyNode(e),e=t}}),t.mounted=null;var i=t.mount.mounts.indexOf(n);t.mount.mounts.splice(i,1)},lookup:function(r,e){return r.node_ops.lookup(r,e)},mknod:function(r,e,t){var n=lr.lookupPath(r,{parent:!0}).node,o=ir.basename(r);if(!o||"."===o||".."===o)throw new lr.ErrnoError(28);var i=lr.mayCreate(n,o);if(i)throw new lr.ErrnoError(i);if(!n.node_ops.mknod)throw new lr.ErrnoError(63);return n.node_ops.mknod(n,o,e,t)},create:function(r,e){return e=void 0!==e?e:438,e&=4095,e|=32768,lr.mknod(r,e,0)},mkdir:function(r,e){return e=void 0!==e?e:511,e&=1023,e|=16384,lr.mknod(r,e,0)},mkdirTree:function(r,e){for(var t=r.split("/"),n="",o=0;o<t.length;++o)if(t[o]){n+="/"+t[o];try{lr.mkdir(n,e)}catch(r){if(20!=r.errno)throw r}}},mkdev:function(r,e,t){return void 0===t&&(t=e,e=438),e|=8192,lr.mknod(r,e,t)},symlink:function(r,e){if(!ar.resolve(r))throw new lr.ErrnoError(44);var t=lr.lookupPath(e,{parent:!0}).node;if(!t)throw new lr.ErrnoError(44);var n=ir.basename(e),o=lr.mayCreate(t,n);if(o)throw new lr.ErrnoError(o);if(!t.node_ops.symlink)throw new lr.ErrnoError(63);return t.node_ops.symlink(t,n,r)},rename:function(r,e){var t,n,o=ir.dirname(r),i=ir.dirname(e),a=ir.basename(r),s=ir.basename(e);if(t=lr.lookupPath(r,{parent:!0}).node,n=lr.lookupPath(e,{parent:!0}).node,!t||!n)throw new lr.ErrnoError(44);if(t.mount!==n.mount)throw new lr.ErrnoError(75);var u,c=lr.lookupNode(t,a),f=ar.relative(r,i);if("."!==f.charAt(0))throw new lr.ErrnoError(28);if("."!==(f=ar.relative(e,o)).charAt(0))throw new lr.ErrnoError(55);try{u=lr.lookupNode(n,s)}catch(r){}if(c!==u){var l=lr.isDir(c.mode),d=lr.mayDelete(t,a,l);if(d)throw new lr.ErrnoError(d);if(d=u?lr.mayDelete(n,s,l):lr.mayCreate(n,s))throw new lr.ErrnoError(d);if(!t.node_ops.rename)throw new lr.ErrnoError(63);if(lr.isMountpoint(c)||u&&lr.isMountpoint(u))throw new lr.ErrnoError(10);if(n!==t&&(d=lr.nodePermissions(t,"w")))throw new lr.ErrnoError(d);try{lr.trackingDelegate.willMovePath}catch(t){m("FS.trackingDelegate[\'willMovePath\'](\'"+r+"\', \'"+e+"\') threw an exception: "+t.message)}lr.hashRemoveNode(c);try{t.node_ops.rename(c,n,s)}catch(r){throw r}finally{lr.hashAddNode(c)}try{lr.trackingDelegate.onMovePath}catch(t){m("FS.trackingDelegate[\'onMovePath\'](\'"+r+"\', \'"+e+"\') threw an exception: "+t.message)}}},rmdir:function(r){var e=lr.lookupPath(r,{parent:!0}).node,t=ir.basename(r),n=lr.lookupNode(e,t),o=lr.mayDelete(e,t,!0);if(o)throw new lr.ErrnoError(o);if(!e.node_ops.rmdir)throw new lr.ErrnoError(63);if(lr.isMountpoint(n))throw new lr.ErrnoError(10);try{lr.trackingDelegate.willDeletePath}catch(e){m("FS.trackingDelegate[\'willDeletePath\'](\'"+r+"\') threw an exception: "+e.message)}e.node_ops.rmdir(e,t),lr.destroyNode(n);try{lr.trackingDelegate.onDeletePath}catch(e){m("FS.trackingDelegate[\'onDeletePath\'](\'"+r+"\') threw an exception: "+e.message)}},readdir:function(r){var e=lr.lookupPath(r,{follow:!0}).node;if(!e.node_ops.readdir)throw new lr.ErrnoError(54);return e.node_ops.readdir(e)},unlink:function(r){var e=lr.lookupPath(r,{parent:!0}).node,t=ir.basename(r),n=lr.lookupNode(e,t),o=lr.mayDelete(e,t,!1);if(o)throw new lr.ErrnoError(o);if(!e.node_ops.unlink)throw new lr.ErrnoError(63);if(lr.isMountpoint(n))throw new lr.ErrnoError(10);try{lr.trackingDelegate.willDeletePath}catch(e){m("FS.trackingDelegate[\'willDeletePath\'](\'"+r+"\') threw an exception: "+e.message)}e.node_ops.unlink(e,t),lr.destroyNode(n);try{lr.trackingDelegate.onDeletePath}catch(e){m("FS.trackingDelegate[\'onDeletePath\'](\'"+r+"\') threw an exception: "+e.message)}},readlink:function(r){var e=lr.lookupPath(r).node;if(!e)throw new lr.ErrnoError(44);if(!e.node_ops.readlink)throw new lr.ErrnoError(28);return ar.resolve(lr.getPath(e.parent),e.node_ops.readlink(e))},stat:function(r,e){var t=lr.lookupPath(r,{follow:!e}).node;if(!t)throw new lr.ErrnoError(44);if(!t.node_ops.getattr)throw new lr.ErrnoError(63);return t.node_ops.getattr(t)},lstat:function(r){return lr.stat(r,!0)},chmod:function(r,e,t){var n;"string"==typeof r?n=lr.lookupPath(r,{follow:!t}).node:n=r;if(!n.node_ops.setattr)throw new lr.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&e|-4096&n.mode,timestamp:Date.now()})},lchmod:function(r,e){lr.chmod(r,e,!0)},fchmod:function(r,e){var t=lr.getStream(r);if(!t)throw new lr.ErrnoError(8);lr.chmod(t.node,e)},chown:function(r,e,t,n){var o;"string"==typeof r?o=lr.lookupPath(r,{follow:!n}).node:o=r;if(!o.node_ops.setattr)throw new lr.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:function(r,e,t){lr.chown(r,e,t,!0)},fchown:function(r,e,t){var n=lr.getStream(r);if(!n)throw new lr.ErrnoError(8);lr.chown(n.node,e,t)},truncate:function(r,e){if(e<0)throw new lr.ErrnoError(28);var t;"string"==typeof r?t=lr.lookupPath(r,{follow:!0}).node:t=r;if(!t.node_ops.setattr)throw new lr.ErrnoError(63);if(lr.isDir(t.mode))throw new lr.ErrnoError(31);if(!lr.isFile(t.mode))throw new lr.ErrnoError(28);var n=lr.nodePermissions(t,"w");if(n)throw new lr.ErrnoError(n);t.node_ops.setattr(t,{size:e,timestamp:Date.now()})},ftruncate:function(r,e){var t=lr.getStream(r);if(!t)throw new lr.ErrnoError(8);if(0==(2097155&t.flags))throw new lr.ErrnoError(28);lr.truncate(t.node,e)},utime:function(r,e,t){var n=lr.lookupPath(r,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(e,t)})},open:function(r,e,t,n,i){if(""===r)throw new lr.ErrnoError(44);var a;if(t=void 0===t?438:t,t=64&(e="string"==typeof e?lr.modeStringToFlags(e):e)?4095&t|32768:0,"object"==typeof r)a=r;else{r=ir.normalize(r);try{a=lr.lookupPath(r,{follow:!(131072&e)}).node}catch(r){}}var s=!1;if(64&e)if(a){if(128&e)throw new lr.ErrnoError(20)}else a=lr.mknod(r,t,0),s=!0;if(!a)throw new lr.ErrnoError(44);if(lr.isChrdev(a.mode)&&(e&=-513),65536&e&&!lr.isDir(a.mode))throw new lr.ErrnoError(54);if(!s){var u=lr.mayOpen(a,e);if(u)throw new lr.ErrnoError(u)}512&e&&lr.truncate(a,0),e&=-131713;var c=lr.createStream({node:a,path:lr.getPath(a),flags:e,seekable:!0,position:0,stream_ops:a.stream_ops,ungotten:[],error:!1},n,i);c.stream_ops.open&&c.stream_ops.open(c),!o.logReadFiles||1&e||(lr.readFiles||(lr.readFiles={}),r in lr.readFiles||(lr.readFiles[r]=1,m("FS.trackingDelegate error on read file: "+r)));try{lr.trackingDelegate.onOpenFile}catch(e){m("FS.trackingDelegate[\'onOpenFile\'](\'"+r+"\', flags) threw an exception: "+e.message)}return c},close:function(r){if(lr.isClosed(r))throw new lr.ErrnoError(8);r.getdents&&(r.getdents=null);try{r.stream_ops.close&&r.stream_ops.close(r)}catch(r){throw r}finally{lr.closeStream(r.fd)}r.fd=null},isClosed:function(r){return null===r.fd},llseek:function(r,e,t){if(lr.isClosed(r))throw new lr.ErrnoError(8);if(!r.seekable||!r.stream_ops.llseek)throw new lr.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new lr.ErrnoError(28);return r.position=r.stream_ops.llseek(r,e,t),r.ungotten=[],r.position},read:function(r,e,t,n,o){if(n<0||o<0)throw new lr.ErrnoError(28);if(lr.isClosed(r))throw new lr.ErrnoError(8);if(1==(2097155&r.flags))throw new lr.ErrnoError(8);if(lr.isDir(r.node.mode))throw new lr.ErrnoError(31);if(!r.stream_ops.read)throw new lr.ErrnoError(28);var i=void 0!==o;if(i){if(!r.seekable)throw new lr.ErrnoError(70)}else o=r.position;var a=r.stream_ops.read(r,e,t,n,o);return i||(r.position+=a),a},write:function(r,e,t,n,o,i){if(n<0||o<0)throw new lr.ErrnoError(28);if(lr.isClosed(r))throw new lr.ErrnoError(8);if(0==(2097155&r.flags))throw new lr.ErrnoError(8);if(lr.isDir(r.node.mode))throw new lr.ErrnoError(31);if(!r.stream_ops.write)throw new lr.ErrnoError(28);r.seekable&&1024&r.flags&&lr.llseek(r,0,2);var a=void 0!==o;if(a){if(!r.seekable)throw new lr.ErrnoError(70)}else o=r.position;var s=r.stream_ops.write(r,e,t,n,o,i);a||(r.position+=s);try{r.path&&lr.trackingDelegate.onWriteToFile&&lr.trackingDelegate.onWriteToFile(r.path)}catch(e){m("FS.trackingDelegate[\'onWriteToFile\'](\'"+r.path+"\') threw an exception: "+e.message)}return s},allocate:function(r,e,t){if(lr.isClosed(r))throw new lr.ErrnoError(8);if(e<0||t<=0)throw new lr.ErrnoError(28);if(0==(2097155&r.flags))throw new lr.ErrnoError(8);if(!lr.isFile(r.node.mode)&&!lr.isDir(r.node.mode))throw new lr.ErrnoError(43);if(!r.stream_ops.allocate)throw new lr.ErrnoError(138);r.stream_ops.allocate(r,e,t)},mmap:function(r,e,t,n,o,i){if(0!=(2&o)&&0==(2&i)&&2!=(2097155&r.flags))throw new lr.ErrnoError(2);if(1==(2097155&r.flags))throw new lr.ErrnoError(2);if(!r.stream_ops.mmap)throw new lr.ErrnoError(43);return r.stream_ops.mmap(r,e,t,n,o,i)},msync:function(r,e,t,n,o){return r&&r.stream_ops.msync?r.stream_ops.msync(r,e,t,n,o):0},munmap:function(r){return 0},ioctl:function(r,e,t){if(!r.stream_ops.ioctl)throw new lr.ErrnoError(59);return r.stream_ops.ioctl(r,e,t)},readFile:function(r,e){if((e=e||{}).flags=e.flags||0,e.encoding=e.encoding||"binary","utf8"!==e.encoding&&"binary"!==e.encoding)throw new Error(\'Invalid encoding type "\'+e.encoding+\'"\');var t,n=lr.open(r,e.flags),o=lr.stat(r).size,i=new Uint8Array(o);return lr.read(n,i,0,o,0),"utf8"===e.encoding?t=z(i,0):"binary"===e.encoding&&(t=i),lr.close(n),t},writeFile:function(r,e,t){(t=t||{}).flags=t.flags||577;var n=lr.open(r,t.flags,t.mode);if("string"==typeof e){var o=new Uint8Array(B(e)+1),i=T(e,o,0,o.length);lr.write(n,o,0,i,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(e))throw new Error("Unsupported data type");lr.write(n,e,0,e.byteLength,void 0,t.canOwn)}lr.close(n)},cwd:function(){return lr.currentPath},chdir:function(r){var e=lr.lookupPath(r,{follow:!0});if(null===e.node)throw new lr.ErrnoError(44);if(!lr.isDir(e.node.mode))throw new lr.ErrnoError(54);var t=lr.nodePermissions(e.node,"x");if(t)throw new lr.ErrnoError(t);lr.currentPath=e.path},createDefaultDirectories:function(){lr.mkdir("/tmp"),lr.mkdir("/home"),lr.mkdir("/home/web_user")},createDefaultDevices:function(){lr.mkdir("/dev"),lr.registerDevice(lr.makedev(1,3),{read:function(){return 0},write:function(r,e,t,n,o){return n}}),lr.mkdev("/dev/null",lr.makedev(1,3)),sr.register(lr.makedev(5,0),sr.default_tty_ops),sr.register(lr.makedev(6,0),sr.default_tty1_ops),lr.mkdev("/dev/tty",lr.makedev(5,0)),lr.mkdev("/dev/tty1",lr.makedev(6,0));var r=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var r=new Uint8Array(1);return function(){return crypto.getRandomValues(r),r[0]}}return function(){V("randomDevice")}}();lr.createDevice("/dev","random",r),lr.createDevice("/dev","urandom",r),lr.mkdir("/dev/shm"),lr.mkdir("/dev/shm/tmp")},createSpecialDirectories:function(){lr.mkdir("/proc");var r=lr.mkdir("/proc/self");lr.mkdir("/proc/self/fd"),lr.mount({mount:function(){var e=lr.createNode(r,"fd",16895,73);return e.node_ops={lookup:function(r,e){var t=+e,n=lr.getStream(t);if(!n)throw new lr.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:function(){return n.path}}};return o.parent=o,o}},e}},{},"/proc/self/fd")},createStandardStreams:function(){o.stdin?lr.createDevice("/dev","stdin",o.stdin):lr.symlink("/dev/tty","/dev/stdin"),o.stdout?lr.createDevice("/dev","stdout",null,o.stdout):lr.symlink("/dev/tty","/dev/stdout"),o.stderr?lr.createDevice("/dev","stderr",null,o.stderr):lr.symlink("/dev/tty1","/dev/stderr"),lr.open("/dev/stdin",0),lr.open("/dev/stdout",1),lr.open("/dev/stderr",1)},ensureErrnoError:function(){lr.ErrnoError||(lr.ErrnoError=function(r,e){this.node=e,this.setErrno=function(r){this.errno=r},this.setErrno(r),this.message="FS error"},lr.ErrnoError.prototype=new Error,lr.ErrnoError.prototype.constructor=lr.ErrnoError,[44].forEach(function(r){lr.genericErrors[r]=new lr.ErrnoError(r),lr.genericErrors[r].stack="<generic error, no stack>"}))},staticInit:function(){lr.ensureErrnoError(),lr.nameTable=new Array(4096),lr.mount(fr,{},"/"),lr.createDefaultDirectories(),lr.createDefaultDevices(),lr.createSpecialDirectories(),lr.filesystems={MEMFS:fr}},init:function(r,e,t){lr.init.initialized=!0,lr.ensureErrnoError(),o.stdin=r||o.stdin,o.stdout=e||o.stdout,o.stderr=t||o.stderr,lr.createStandardStreams()},quit:function(){lr.init.initialized=!1;var r=o._fflush;r&&r(0);for(var e=0;e<lr.streams.length;e++){var t=lr.streams[e];t&&lr.close(t)}},getMode:function(r,e){var t=0;return r&&(t|=365),e&&(t|=146),t},findObject:function(r,e){var t=lr.analyzePath(r,e);return t.exists?t.object:null},analyzePath:function(r,e){try{r=(n=lr.lookupPath(r,{follow:!e})).path}catch(r){}var t={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=lr.lookupPath(r,{parent:!0});t.parentExists=!0,t.parentPath=n.path,t.parentObject=n.node,t.name=ir.basename(r),n=lr.lookupPath(r,{follow:!e}),t.exists=!0,t.path=n.path,t.object=n.node,t.name=n.node.name,t.isRoot="/"===n.path}catch(r){t.error=r.errno}return t},createPath:function(r,e,t,n){r="string"==typeof r?r:lr.getPath(r);for(var o=e.split("/").reverse();o.length;){var i=o.pop();if(i){var a=ir.join2(r,i);try{lr.mkdir(a)}catch(r){}r=a}}return a},createFile:function(r,e,t,n,o){var i=ir.join2("string"==typeof r?r:lr.getPath(r),e),a=lr.getMode(n,o);return lr.create(i,a)},createDataFile:function(r,e,t,n,o,i){var a=e?ir.join2("string"==typeof r?r:lr.getPath(r),e):r,s=lr.getMode(n,o),u=lr.create(a,s);if(t){if("string"==typeof t){for(var c=new Array(t.length),f=0,l=t.length;f<l;++f)c[f]=t.charCodeAt(f);t=c}lr.chmod(u,146|s);var d=lr.open(u,577);lr.write(d,t,0,t.length,0,i),lr.close(d),lr.chmod(u,s)}return u},createDevice:function(r,e,t,n){var o=ir.join2("string"==typeof r?r:lr.getPath(r),e),i=lr.getMode(!!t,!!n);lr.createDevice.major||(lr.createDevice.major=64);var a=lr.makedev(lr.createDevice.major++,0);return lr.registerDevice(a,{open:function(r){r.seekable=!1},close:function(r){n&&n.buffer&&n.buffer.length&&n(10)},read:function(r,e,n,o,i){for(var a=0,s=0;s<o;s++){var u;try{u=t()}catch(r){throw new lr.ErrnoError(29)}if(void 0===u&&0===a)throw new lr.ErrnoError(6);if(null==u)break;a++,e[n+s]=u}return a&&(r.node.timestamp=Date.now()),a},write:function(r,e,t,o,i){for(var a=0;a<o;a++)try{n(e[t+a])}catch(r){throw new lr.ErrnoError(29)}return o&&(r.node.timestamp=Date.now()),a}}),lr.mkdev(o,i,a)},forceLoadFile:function(r){if(r.isDevice||r.isFolder||r.link||r.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!s)throw new Error("Cannot load without read() or XMLHttpRequest.");try{r.contents=_r(s(r.url),!0),r.usedBytes=r.contents.length}catch(r){throw new lr.ErrnoError(29)}},createLazyFile:function(r,e,t,n,o){function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(r){if(!(r>this.length-1||r<0)){var e=r%this.chunkSize,t=r/this.chunkSize|0;return this.getter(t)[e]}},i.prototype.setDataGetter=function(r){this.getter=r},i.prototype.cacheLength=function(){var r=new XMLHttpRequest;if(r.open("HEAD",t,!1),r.send(null),!(r.status>=200&&r.status<300||304===r.status))throw new Error("Couldn\'t load "+t+". Status: "+r.status);var e,n=Number(r.getResponseHeader("Content-length")),o=(e=r.getResponseHeader("Accept-Ranges"))&&"bytes"===e,i=(e=r.getResponseHeader("Content-Encoding"))&&"gzip"===e,a=1048576;o||(a=n);var s=this;s.setDataGetter(function(r){var e=r*a,o=(r+1)*a-1;if(o=Math.min(o,n-1),void 0===s.chunks[r]&&(s.chunks[r]=function(r,e){if(r>e)throw new Error("invalid range ("+r+", "+e+") or no bytes requested!");if(e>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",t,!1),n!==a&&o.setRequestHeader("Range","bytes="+r+"-"+e),"undefined"!=typeof Uint8Array&&(o.responseType="arraybuffer"),o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn\'t load "+t+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):_r(o.responseText||"",!0)}(e,o)),void 0===s.chunks[r])throw new Error("doXHR failed!");return s.chunks[r]}),!i&&n||(a=n=1,n=this.getter(0).length,a=n,h("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a={isDevice:!1,url:t},s=lr.createFile(r,e,a,n,o);a.contents?s.contents=a.contents:a.url&&(s.contents=null,s.url=a.url),Object.defineProperties(s,{usedBytes:{get:function(){return this.contents.length}}});var u={};return Object.keys(s.stream_ops).forEach(function(r){var e=s.stream_ops[r];u[r]=function(){return lr.forceLoadFile(s),e.apply(null,arguments)}}),u.read=function(r,e,t,n,o){lr.forceLoadFile(s);var i=r.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var u=0;u<a;u++)e[t+u]=i[o+u];else for(u=0;u<a;u++)e[t+u]=i.get(o+u);return a},s.stream_ops=u,s},createPreloadedFile:function(r,e,t,n,i,a,s,c,f,l){Browser.init();var d=e?ar.resolve(ir.join2(r,e)):r;function p(t){function u(t){l&&l(),c||lr.createDataFile(r,e,t,n,i,f),a&&a(),G()}var p=!1;o.preloadPlugins.forEach(function(r){p||r.canHandle(d)&&(r.handle(t,d,u,function(){s&&s(),G()}),p=!0)}),p||u(t)}q(),"string"==typeof t?function(r,e,t,n){var o=n?"":"al "+r;u(r,function(t){D(t,\'Loading data file "\'+r+\'" failed (no arrayBuffer).\'),e(new Uint8Array(t)),o&&G()},function(e){if(!t)throw\'Loading data file "\'+r+\'" failed.\';t()}),o&&q()}(t,function(r){p(r)},s):p(t)},indexedDB:function(){return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB},DB_NAME:function(){return"EM_FS_"+window.location.pathname},DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:function(r,e,t){e=e||function(){},t=t||function(){};var n=lr.indexedDB();try{var o=n.open(lr.DB_NAME(),lr.DB_VERSION)}catch(r){return t(r)}o.onupgradeneeded=function(){h("creating db"),o.result.createObjectStore(lr.DB_STORE_NAME)},o.onsuccess=function(){var n=o.result.transaction([lr.DB_STORE_NAME],"readwrite"),i=n.objectStore(lr.DB_STORE_NAME),a=0,s=0,u=r.length;function c(){0==s?e():t()}r.forEach(function(r){var e=i.put(lr.analyzePath(r).object.contents,r);e.onsuccess=function(){++a+s==u&&c()},e.onerror=function(){a+ ++s==u&&c()}}),n.onerror=t},o.onerror=t},loadFilesFromDB:function(r,e,t){e=e||function(){},t=t||function(){};var n=lr.indexedDB();try{var o=n.open(lr.DB_NAME(),lr.DB_VERSION)}catch(r){return t(r)}o.onupgradeneeded=t,o.onsuccess=function(){var n=o.result;try{var i=n.transaction([lr.DB_STORE_NAME],"readonly")}catch(r){return void t(r)}var a=i.objectStore(lr.DB_STORE_NAME),s=0,u=0,c=r.length;function f(){0==u?e():t()}r.forEach(function(r){var e=a.get(r);e.onsuccess=function(){lr.analyzePath(r).exists&&lr.unlink(r),lr.createDataFile(ir.dirname(r),ir.basename(r),e.result,!0,!0,!0),++s+u==c&&f()},e.onerror=function(){s+ ++u==c&&f()}}),i.onerror=t},o.onerror=t}},dr={mappings:{},DEFAULT_POLLMASK:5,umask:511,calculateAt:function(r,e,t){if("/"===e[0])return e;var n;if(-100===r)n=lr.cwd();else{var o=lr.getStream(r);if(!o)throw new lr.ErrnoError(8);n=o.path}if(0==e.length){if(!t)throw new lr.ErrnoError(44);return n}return ir.join2(n,e)},doStat:function(r,e,t){try{var n=r(e)}catch(r){if(r&&r.node&&ir.normalize(e)!==ir.normalize(lr.getPath(r.node)))return-54;throw r}return A[t>>2]=n.dev,A[t+4>>2]=0,A[t+8>>2]=n.ino,A[t+12>>2]=n.mode,A[t+16>>2]=n.nlink,A[t+20>>2]=n.uid,A[t+24>>2]=n.gid,A[t+28>>2]=n.rdev,A[t+32>>2]=0,K=[n.size>>>0,(Y=n.size,+Math.abs(Y)>=1?Y>0?(0|Math.min(+Math.floor(Y/4294967296),4294967295))>>>0:~~+Math.ceil((Y-+(~~Y>>>0))/4294967296)>>>0:0)],A[t+40>>2]=K[0],A[t+44>>2]=K[1],A[t+48>>2]=4096,A[t+52>>2]=n.blocks,A[t+56>>2]=n.atime.getTime()/1e3|0,A[t+60>>2]=0,A[t+64>>2]=n.mtime.getTime()/1e3|0,A[t+68>>2]=0,A[t+72>>2]=n.ctime.getTime()/1e3|0,A[t+76>>2]=0,K=[n.ino>>>0,(Y=n.ino,+Math.abs(Y)>=1?Y>0?(0|Math.min(+Math.floor(Y/4294967296),4294967295))>>>0:~~+Math.ceil((Y-+(~~Y>>>0))/4294967296)>>>0:0)],A[t+80>>2]=K[0],A[t+84>>2]=K[1],0},doMsync:function(r,e,t,n,o){var i=F.slice(r,r+t);lr.msync(e,i,o,t,n)},doMkdir:function(r,e){return"/"===(r=ir.normalize(r))[r.length-1]&&(r=r.substr(0,r.length-1)),lr.mkdir(r,e,0),0},doMknod:function(r,e,t){switch(61440&e){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return lr.mknod(r,e,t),0},doReadlink:function(r,e,t){if(t<=0)return-28;var n=lr.readlink(r),o=Math.min(t,B(n)),i=P[e+o];return T(n,F,e,t+1),P[e+o]=i,o},doAccess:function(r,e){if(-8&e)return-28;var t;if(!(t=lr.lookupPath(r,{follow:!0}).node))return-44;var n="";return 4&e&&(n+="r"),2&e&&(n+="w"),1&e&&(n+="x"),n&&lr.nodePermissions(t,n)?-2:0},doDup:function(r,e,t){var n=lr.getStream(t);return n&&lr.close(n),lr.open(r,e,0,t,t).fd},doReadv:function(r,e,t,n){for(var o=0,i=0;i<t;i++){var a=A[e+8*i>>2],s=A[e+(8*i+4)>>2],u=lr.read(r,P,a,s,n);if(u<0)return-1;if(o+=u,u<s)break}return o},doWritev:function(r,e,t,n){for(var o=0,i=0;i<t;i++){var a=A[e+8*i>>2],s=A[e+(8*i+4)>>2],u=lr.write(r,P,a,s,n);if(u<0)return-1;o+=u}return o},varargs:void 0,get:function(){return dr.varargs+=4,A[dr.varargs-4>>2]},getStr:function(r){return j(r)},getStreamFromFD:function(r){var e=lr.getStream(r);if(!e)throw new lr.ErrnoError(8);return e},get64:function(r,e){return r}};var pr=[];function hr(r){try{return E.grow(r-S.byteLength+65535>>>16),N(E.buffer),1}catch(r){}}var mr={};function vr(){if(!vr.strings){var r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:f||"./this.program"};for(var e in mr)void 0===mr[e]?delete r[e]:r[e]=mr[e];var t=[];for(var e in r)t.push(e+"="+r[e]);vr.strings=t}return vr.strings}var wr=function(r,e,t,n){r||(r=this),this.parent=r,this.mount=r.mount,this.mounted=null,this.id=lr.nextInode++,this.name=e,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n};function _r(r,e,t){var n=t>0?t:B(r)+1,o=new Array(n),i=T(r,o,0,o.length);return e&&(o.length=i),o}Object.defineProperties(wr.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(r){r?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(r){r?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return lr.isDir(this.mode)}},isDevice:{get:function(){return lr.isChrdev(this.mode)}}}),lr.FSNode=wr,lr.staticInit();var yr={z:function(r,e){return function(r,e){var t;if(0===r)t=Date.now();else{if(1!==r&&4!==r||!nr)return or(28),-1;t=rr()}return A[e>>2]=t/1e3|0,A[e+4>>2]=t%1e3*1e3*1e3|0,0}(r,e)},A:function(r,e){try{return r=dr.getStr(r),dr.doAccess(r,e)}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),-r.errno}},i:function(r,e,t){dr.varargs=t;try{var n=dr.getStreamFromFD(r);switch(e){case 0:return(o=dr.get())<0?-28:lr.open(n.path,n.flags,0,o).fd;case 1:case 2:return 0;case 3:return n.flags;case 4:var o=dr.get();return n.flags|=o,0;case 12:return o=dr.get(),x[o+0>>1]=2,0;case 13:case 14:return 0;case 16:case 8:return-28;case 9:return or(28),-1;default:return-28}}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),-r.errno}},l:function(r,e){try{var t=dr.getStreamFromFD(r);return dr.doStat(lr.stat,t.path,e)}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),-r.errno}},e:function(){return 42},B:function(r,e,t){dr.varargs=t;try{var n=dr.getStreamFromFD(r);switch(e){case 21509:case 21505:return n.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return n.tty?0:-59;case 21519:if(!n.tty)return-59;var o=dr.get();return A[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:return o=dr.get(),lr.ioctl(n,e,o);case 21523:case 21524:return n.tty?0:-59;default:V("bad ioctl syscall "+e)}}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),-r.errno}},y:function(r,e,t,n,o,i){try{return function(r,e,t,n,o,i){var a;i<<=12;var s=!1;if(0!=(16&n)&&r%65536!=0)return-28;if(0!=(32&n)){if(!(a=cr(e)))return-48;s=!0}else{var u=lr.getStream(o);if(!u)return-8;var c=lr.mmap(u,r,e,i,t,n);a=c.ptr,s=c.allocated}return dr.mappings[a]={malloc:a,len:e,allocated:s,fd:o,prot:t,flags:n,offset:i},a}(r,e,t,n,o,i)}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),-r.errno}},x:function(r,e){try{return function(r,e){var t=dr.mappings[r];if(0===e||!t)return-28;if(e===t.len){var n=lr.getStream(t.fd);n&&2&t.prot&&dr.doMsync(r,n,e,t.flags,t.offset),dr.mappings[r]=null,t.allocated&&xr(t.malloc)}return 0}(r,e)}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),-r.errno}},f:function(r,e,t){dr.varargs=t;try{var n=dr.getStr(r),o=t?dr.get():0;return lr.open(n,e,o).fd}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),-r.errno}},D:function(r,e){try{return r=dr.getStr(r),dr.doStat(lr.stat,r,e)}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),-r.errno}},C:function(r){try{return r=dr.getStr(r),lr.unlink(r),0}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),-r.errno}},t:function(){throw"longjmp"},s:function(){V()},E:function(r,e,t){var n=function(r,e){var t;for(pr.length=0,e>>=2;t=F[r++];){var n=t<105;n&&1&e&&e++,pr.push(n?M[e++>>1]:A[e]),++e}return pr}(e,t);return er[r].apply(null,n)},q:function(r,e,t){F.copyWithin(r,e,e+t)},r:function(r){var e,t,n=F.length;if((r>>>=0)>2147483648)return!1;for(var o=1;o<=4;o*=2){var i=n*(1+.2/o);if(i=Math.min(i,r+100663296),hr(Math.min(2147483648,((e=Math.max(r,i))%(t=65536)>0&&(e+=t-e%t),e))))return!0}return!1},v:function(r,e){try{var t=0;return vr().forEach(function(n,o){var i=e+t;A[r+4*o>>2]=i,function(r,e,t){for(var n=0;n<r.length;++n)P[e++>>0]=r.charCodeAt(n);t||(P[e>>0]=0)}(n,i),t+=n.length+1}),0}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),r.errno}},w:function(r,e){try{var t=vr();A[r>>2]=t.length;var n=0;return t.forEach(function(r){n+=r.length+1}),A[e>>2]=n,0}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),r.errno}},a:function(r){!function(r,e){b||U>0||(o.onExit&&o.onExit(r),k=!0),l(r,new jr(r))}(r)},d:function(r){try{var e=dr.getStreamFromFD(r);return lr.close(e),0}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),r.errno}},u:function(r,e){try{var t=dr.getStreamFromFD(r),n=t.tty?2:lr.isDir(t.mode)?3:lr.isLink(t.mode)?7:4;return P[e>>0]=n,0}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),r.errno}},k:function(r,e,t,n){try{var o=dr.getStreamFromFD(r),i=dr.doReadv(o,e,t);return A[n>>2]=i,0}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),r.errno}},o:function(r,e,t,n,o){try{var i=dr.getStreamFromFD(r),a=4294967296*t+(e>>>0);return a<=-9007199254740992||a>=9007199254740992?-61:(lr.llseek(i,a,n),K=[i.position>>>0,(Y=i.position,+Math.abs(Y)>=1?Y>0?(0|Math.min(+Math.floor(Y/4294967296),4294967295))>>>0:~~+Math.ceil((Y-+(~~Y>>>0))/4294967296)>>>0:0)],A[o>>2]=K[0],A[o+4>>2]=K[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0)}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),r.errno}},j:function(r,e,t,n){try{var o=dr.getStreamFromFD(r),i=dr.doWritev(o,e,t);return A[n>>2]=i,0}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),r.errno}},c:function(){return g()},p:function(r){var e=Date.now();return A[r>>2]=e/1e3|0,A[r+4>>2]=e%1e3*1e3|0,0},m:function(r,e,t,n,o,i,a){var s=Mr();try{return R.get(r)(e,t,n,o,i,a)}catch(r){if(Rr(s),r!==r+0&&"longjmp"!==r)throw r;Cr(1,0)}},n:function(r,e){var t=Mr();try{R.get(r)(e)}catch(r){if(Rr(t),r!==r+0&&"longjmp"!==r)throw r;Cr(1,0)}},b:function(r){y(r)},g:function(r){var e=Date.now()/1e3|0;return r&&(A[r>>2]=e),e},h:function(r){return 0!==r&&ur(r,16),0}};!function(){var r={a:yr};function e(r,e){var t,n=r.exports;o.asm=n,N((E=o.asm.F).buffer),R=o.asm.O,t=o.asm.G,L.unshift(t),G()}function t(r){e(r.instance)}function i(e){return(!w&&d&&"function"==typeof fetch?fetch(J,{credentials:"same-origin"}).then(function(r){if(!r.ok)throw"failed to load wasm binary file at \'"+J+"\'";return r.arrayBuffer()}).catch(function(){return Z(J)}):Promise.resolve().then(function(){return Z(J)})).then(function(e){return WebAssembly.instantiate(e,r)}).then(e,function(r){m("failed to asynchronously prepare wasm: "+r),V(r)})}if(q(),o.instantiateWasm)try{return o.instantiateWasm(r,e)}catch(r){return m("Module.instantiateWasm callback failed with error: "+r),!1}(w||"function"!=typeof WebAssembly.instantiateStreaming||Q(J)||"function"!=typeof fetch?i(t):fetch(J,{credentials:"same-origin"}).then(function(e){return WebAssembly.instantiateStreaming(e,r).then(t,function(r){return m("wasm streaming compile failed: "+r),m("falling back to ArrayBuffer instantiation"),i(t)})})).catch(n)}(),o.___wasm_call_ctors=function(){return(o.___wasm_call_ctors=o.asm.G).apply(null,arguments)};var gr=o._emscripten_bind_VoidPtr___destroy___0=function(){return(gr=o._emscripten_bind_VoidPtr___destroy___0=o.asm.H).apply(null,arguments)},Er=o._emscripten_bind_Graphviz_Graphviz_2=function(){return(Er=o._emscripten_bind_Graphviz_Graphviz_2=o.asm.I).apply(null,arguments)},br=o._emscripten_bind_Graphviz_version_0=function(){return(br=o._emscripten_bind_Graphviz_version_0=o.asm.J).apply(null,arguments)},kr=o._emscripten_bind_Graphviz_lastError_0=function(){return(kr=o._emscripten_bind_Graphviz_lastError_0=o.asm.K).apply(null,arguments)},Dr=o._emscripten_bind_Graphviz_layout_3=function(){return(Dr=o._emscripten_bind_Graphviz_layout_3=o.asm.L).apply(null,arguments)},Sr=o._emscripten_bind_Graphviz_createFile_2=function(){return(Sr=o._emscripten_bind_Graphviz_createFile_2=o.asm.M).apply(null,arguments)},Pr=o._emscripten_bind_Graphviz___destroy___0=function(){return(Pr=o._emscripten_bind_Graphviz___destroy___0=o.asm.N).apply(null,arguments)};o._malloc=function(){return(o._malloc=o.asm.P).apply(null,arguments)};var Fr,xr=o._free=function(){return(xr=o._free=o.asm.Q).apply(null,arguments)},Ar=o.___errno_location=function(){return(Ar=o.___errno_location=o.asm.R).apply(null,arguments)},Mr=o.stackSave=function(){return(Mr=o.stackSave=o.asm.S).apply(null,arguments)},Rr=o.stackRestore=function(){return(Rr=o.stackRestore=o.asm.T).apply(null,arguments)},Cr=o._setThrew=function(){return(Cr=o._setThrew=o.asm.U).apply(null,arguments)},zr=o._memalign=function(){return(zr=o._memalign=o.asm.V).apply(null,arguments)};function jr(r){this.name="ExitStatus",this.message="Program terminated with exit("+r+")",this.status=r}function Tr(r){function e(){Fr||(Fr=!0,o.calledRun=!0,k||(o.noFSInit||lr.init.initialized||lr.init(),lr.ignorePermissions=!1,tr(L),t(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),function(){if(o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)r=o.postRun.shift(),I.unshift(r);var r;tr(I)}()))}H>0||(!function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)r=o.preRun.shift(),O.unshift(r);var r;tr(O)}(),H>0||(o.setStatus?(o.setStatus("Running..."),setTimeout(function(){setTimeout(function(){o.setStatus("")},1),e()},1)):e()))}if(W=function r(){Fr||Tr(),Fr||(W=r)},o.run=Tr,o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();function Br(){}function Nr(r){return(r||Br).__cache__}function Or(r,e){var t=Nr(e),n=t[r];return n||((n=Object.create((e||Br).prototype)).ptr=r,t[r]=n)}Tr(),Br.prototype=Object.create(Br.prototype),Br.prototype.constructor=Br,Br.prototype.__class__=Br,Br.__cache__={},o.WrapperObject=Br,o.getCache=Nr,o.wrapPointer=Or,o.castObject=function(r,e){return Or(r.ptr,e)},o.NULL=Or(0),o.destroy=function(r){if(!r.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";r.__destroy__(),delete Nr(r.__class__)[r.ptr]},o.compare=function(r,e){return r.ptr===e.ptr},o.getPointer=function(r){return r.ptr},o.getClass=function(r){return r.__class__};var Lr={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(Lr.needed){for(var r=0;r<Lr.temps.length;r++)o._free(Lr.temps[r]);Lr.temps.length=0,o._free(Lr.buffer),Lr.buffer=0,Lr.size+=Lr.needed,Lr.needed=0}Lr.buffer||(Lr.size+=128,Lr.buffer=o._malloc(Lr.size),D(Lr.buffer)),Lr.pos=0},alloc:function(r,e){D(Lr.buffer);var t,n=e.BYTES_PER_ELEMENT,i=r.length*n;return i=i+7&-8,Lr.pos+i>=Lr.size?(D(i>0),Lr.needed+=i,t=o._malloc(i),Lr.temps.push(t)):(t=Lr.buffer+Lr.pos,Lr.pos+=i),t},copy:function(r,e,t){switch(t>>>=0,e.BYTES_PER_ELEMENT){case 2:t>>>=1;break;case 4:t>>>=2;break;case 8:t>>>=3}for(var n=0;n<r.length;n++)e[t+n]=r[n]}};function Ir(r){if("string"==typeof r){var e=_r(r),t=Lr.alloc(e,P);return Lr.copy(e,P,t),t}return r}function Ur(){throw"cannot construct a VoidPtr, no constructor in IDL"}function Hr(r,e){r&&"object"==typeof r&&(r=r.ptr),e&&"object"==typeof e&&(e=e.ptr),this.ptr=Er(r,e),Nr(Hr)[this.ptr]=this}return Ur.prototype=Object.create(Br.prototype),Ur.prototype.constructor=Ur,Ur.prototype.__class__=Ur,Ur.__cache__={},o.VoidPtr=Ur,Ur.prototype.__destroy__=Ur.prototype.__destroy__=function(){var r=this.ptr;gr(r)},Hr.prototype=Object.create(Br.prototype),Hr.prototype.constructor=Hr,Hr.prototype.__class__=Hr,Hr.__cache__={},o.Graphviz=Hr,Hr.prototype.version=Hr.prototype.version=function(){var r=this.ptr;return j(br(r))},Hr.prototype.lastError=Hr.prototype.lastError=function(){var r=this.ptr;return j(kr(r))},Hr.prototype.layout=Hr.prototype.layout=function(r,e,t){var n=this.ptr;return Lr.prepare(),r=r&&"object"==typeof r?r.ptr:Ir(r),e=e&&"object"==typeof e?e.ptr:Ir(e),t=t&&"object"==typeof t?t.ptr:Ir(t),j(Dr(n,r,e,t))},Hr.prototype.createFile=Hr.prototype.createFile=function(r,e){var t=this.ptr;Lr.prepare(),r=r&&"object"==typeof r?r.ptr:Ir(r),e=e&&"object"==typeof e?e.ptr:Ir(e),Sr(t,r,e)},Hr.prototype.__destroy__=Hr.prototype.__destroy__=function(){var r=this.ptr;Pr(r)},e.ready}}();r.exports=t}(a);var s=a.exports,u=Object.freeze(Object.assign(Object.create(null),a.exports,{default:s})),c=function(){return(c=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r}).apply(this,arguments)},f=function(r,e){for(var t=0,n=e.length,o=r.length;t<n;t++,o++)r[o]=e[t];return r};function l(r){return{path:r.path,data:\'<?xml version="1.0" encoding="UTF-8" standalone="no"?>\\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\\n<svg width="\'+r.width+\'" height="\'+r.height+\'"></svg>\'}}function d(r,e){var t,n=c({images:[],files:[]},e);f(f([],n.files),(t=n.images,t.map(l))).forEach(function(e){return r.createFile(e.path,e.data)})}var p={layout:function(r,e,t,n){return void 0===e&&(e="svg"),void 0===t&&(t="dot"),r?i(u,null==n?void 0:n.wasmFolder,null==n?void 0:n.wasmBinary).then(function(o){var i=new o.Graphviz(void 0!==(null==n?void 0:n.yInvert)&&(null==n?void 0:n.yInvert),void 0!==(null==n?void 0:n.nop)?null==n?void 0:n.nop:0);d(i,n);var a=i.layout(r,e,t);if(o.destroy(i),!a)throw new Error(o.Graphviz.prototype.lastError());return a}):Promise.resolve("")},circo:function(r,e,t){return void 0===e&&(e="svg"),this.layout(r,e,"circo",t)},dot:function(r,e,t){return void 0===e&&(e="svg"),this.layout(r,e,"dot",t)},fdp:function(r,e,t){return void 0===e&&(e="svg"),this.layout(r,e,"fdp",t)},sfdp:function(r,e,t){return void 0===e&&(e="svg"),this.layout(r,e,"sfdp",t)},neato:function(r,e,t){return void 0===e&&(e="svg"),this.layout(r,e,"neato",t)},osage:function(r,e,t){return void 0===e&&(e="svg"),this.layout(r,e,"osage",t)},patchwork:function(r,e,t){return void 0===e&&(e="svg"),this.layout(r,e,"patchwork",t)},twopi:function(r,e,t){return void 0===e&&(e="svg"),this.layout(r,e,"twopi",t)}},h="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function m(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(function(r,e,t){return r(t={path:e,exports:{},require:function(r,e){return m(null==e&&t.path)}},t.exports),t.exports})(function(r,e){r.exports=function(){function r(r){return"function"==typeof r}var e=Array.isArray?Array.isArray:function(r){return"[object Array]"===Object.prototype.toString.call(r)},t=0,n=void 0,o=void 0,i=function(r,e){d[t]=r,d[t+1]=e,2===(t+=2)&&(o?o(p):y())},a="undefined"!=typeof window?window:void 0,s=a||{},u=s.MutationObserver||s.WebKitMutationObserver,c="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),f="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function l(){var r=setTimeout;return function(){return r(p,1)}}var d=new Array(1e3);function p(){for(var r=0;r<t;r+=2){var e=d[r],n=d[r+1];e(n),d[r]=void 0,d[r+1]=void 0}t=0}var m,v,w,_,y=void 0;function g(r,e){var t=this,n=new this.constructor(k);void 0===n[b]&&B(n);var o=t._state;if(o){var a=arguments[o-1];i(function(){return j(o,n,a,t._result)})}else C(t,n,r,e);return n}function E(r){if(r&&"object"==typeof r&&r.constructor===this)return r;var e=new this(k);return x(e,r),e}c?y=function(){return process.nextTick(p)}:u?(v=0,w=new u(p),_=document.createTextNode(""),w.observe(_,{characterData:!0}),y=function(){_.data=v=++v%2}):f?((m=new MessageChannel).port1.onmessage=p,y=function(){return m.port2.postMessage(0)}):y=void 0===a?function(){try{var r=Function("return this")().require("vertx");return void 0!==(n=r.runOnLoop||r.runOnContext)?function(){n(p)}:l()}catch(r){return l()}}():l();var b=Math.random().toString(36).substring(2);function k(){}var D=void 0,S=1,P=2;function F(e,t,n){t.constructor===e.constructor&&n===g&&t.constructor.resolve===E?function(r,e){e._state===S?M(r,e._result):e._state===P?R(r,e._result):C(e,void 0,function(e){return x(r,e)},function(e){return R(r,e)})}(e,t):void 0===n?M(e,t):r(n)?function(r,e,t){i(function(r){var n=!1,o=function(r,e,t,n){try{r.call(e,t,n)}catch(r){return r}}(t,e,function(t){n||(n=!0,e!==t?x(r,t):M(r,t))},function(e){n||(n=!0,R(r,e))},r._label);!n&&o&&(n=!0,R(r,o))},r)}(e,t,n):M(e,t)}function x(r,e){if(r===e)R(r,new TypeError("You cannot resolve a promise with itself"));else if(o=typeof(n=e),null===n||"object"!==o&&"function"!==o)M(r,e);else{var t=void 0;try{t=e.then}catch(e){return void R(r,e)}F(r,e,t)}var n,o}function A(r){r._onerror&&r._onerror(r._result),z(r)}function M(r,e){r._state===D&&(r._result=e,r._state=S,0!==r._subscribers.length&&i(z,r))}function R(r,e){r._state===D&&(r._state=P,r._result=e,i(A,r))}function C(r,e,t,n){var o=r._subscribers,a=o.length;r._onerror=null,o[a]=e,o[a+S]=t,o[a+P]=n,0===a&&r._state&&i(z,r)}function z(r){var e=r._subscribers,t=r._state;if(0!==e.length){for(var n=void 0,o=void 0,i=r._result,a=0;a<e.length;a+=3)n=e[a],o=e[a+t],n?j(t,n,o,i):o(i);r._subscribers.length=0}}function j(e,t,n,o){var i=r(n),a=void 0,s=void 0,u=!0;if(i){try{a=n(o)}catch(r){u=!1,s=r}if(t===a)return void R(t,new TypeError("A promises callback cannot return that same promise."))}else a=o;t._state!==D||(i&&u?x(t,a):!1===u?R(t,s):e===S?M(t,a):e===P&&R(t,a))}var T=0;function B(r){r[b]=T++,r._state=void 0,r._result=void 0,r._subscribers=[]}var N=function(){function r(r,t){this._instanceConstructor=r,this.promise=new r(k),this.promise[b]||B(this.promise),e(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?M(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&M(this.promise,this._result))):R(this.promise,new Error("Array Methods must be provided an Array"))}return r.prototype._enumerate=function(r){for(var e=0;this._state===D&&e<r.length;e++)this._eachEntry(r[e],e)},r.prototype._eachEntry=function(r,e){var t=this._instanceConstructor,n=t.resolve;if(n===E){var o=void 0,i=void 0,a=!1;try{o=r.then}catch(r){a=!0,i=r}if(o===g&&r._state!==D)this._settledAt(r._state,e,r._result);else if("function"!=typeof o)this._remaining--,this._result[e]=r;else if(t===O){var s=new t(k);a?R(s,i):F(s,r,o),this._willSettleAt(s,e)}else this._willSettleAt(new t(function(e){return e(r)}),e)}else this._willSettleAt(n(r),e)},r.prototype._settledAt=function(r,e,t){var n=this.promise;n._state===D&&(this._remaining--,r===P?R(n,t):this._result[e]=t),0===this._remaining&&M(n,this._result)},r.prototype._willSettleAt=function(r,e){var t=this;C(r,void 0,function(r){return t._settledAt(S,e,r)},function(r){return t._settledAt(P,e,r)})},r}(),O=function(){function e(r){this[b]=T++,this._result=this._state=void 0,this._subscribers=[],k!==r&&("function"!=typeof r&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(r,e){try{e(function(e){x(r,e)},function(e){R(r,e)})}catch(e){R(r,e)}}(this,r):function(){throw new TypeError("Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(r){return this.then(null,r)},e.prototype.finally=function(e){var t=this.constructor;return r(e)?this.then(function(r){return t.resolve(e()).then(function(){return r})},function(r){return t.resolve(e()).then(function(){throw r})}):this.then(e,e)},e}();return O.prototype.then=g,O.all=function(r){return new N(this,r).promise},O.race=function(r){var t=this;return e(r)?new t(function(e,n){for(var o=r.length,i=0;i<o;i++)t.resolve(r[i]).then(e,n)}):new t(function(r,e){return e(new TypeError("You must pass an array to race."))})},O.resolve=E,O.reject=function(r){var e=new this(k);return R(e,r),e},O._setScheduler=function(r){o=r},O._setAsap=function(r){i=r},O._asap=i,O.polyfill=function(){var r=void 0;if(void 0!==h)r=h;else if("undefined"!=typeof self)r=self;else try{r=Function("return this")()}catch(r){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=r.Promise;if(e){var t=null;try{t=Object.prototype.toString.call(e.resolve())}catch(r){}if("[object Promise]"===t&&!e.cast)return}r.Promise=O},O.Promise=O,O}()}).polyfill();function v(r){return void 0!==r.children}var w=function(r){var e=[];return r.children.forEach(function(r){v(r)?e.push(w(r)):e.push(_(r))}),"subgraph cluster_"+r.id+\' {\\nid="\'+r.id+\'";\\nlabel="\'+r.text+\'";\\nmargin=16;\\n\'+e.join("\\n")+"\\n}"},_=function(r){return r.id+\' [id="\'+r.id+\'" label="\'+r.text+\'" width=\'+b(r.width)+" height="+b(r.height)+"]"},y=function(r,e,t,n){return r+" -> "+e+\' [id="\'+t+\'", label="\'+n+\'"]\'},g=function(r){return 96*r/72},E=function(r){return 96*r},b=function(r){return r/96};function k(r){var e=r?r.split(",").map(function(r){return g(+r)}):[0,0,0,0],t=e[0],n=e[1],o=e[2]-t,i=e[3]-n;return{x:t-o/2,y:n-i/2,width:o,height:i}}function D(r,e){var t=r.split(",").map(function(r){return g(+r)}),n=t[0],o=t[1];return{x:-n+e.width,y:-o+e.height}}function S(r,e,t){return void 0===t&&(t="json"),p[r](e,t).then(function(r){return"json"===t?JSON.parse(r):r})}function P(e,t){if(self.document=self.document||{currentScript:{src:t.wasmFolder+"/dummy.js"}},e.raw)return S(t.engine,e.raw,"svg");var n={},o=[],i=[],a={},s=[],u=[],c={},f=[],l=[];return e.items.forEach(function(r){return function r(e,t){v(e)?(n[e.id]=e,o.push(e),e.children.forEach(function(e){return r(e,!1)}),t&&i.push(w(e))):(a[e.id]=e,s.push(e),t&&u.push(_(e)))}(r,!0)}),e.links.forEach(function(r){c[r.id]=r,f.push(r),l.push(y(r.source.id,r.target.id,r.id,r.text))}),S(t.engine,"digraph G {\\n graph [fontname=Verdana,fontsize=11.0];\\n graph [rankdir=TB];\\n node [shape=rect,fontname=Verdana,fontsize=11.0,fixedsize=true];\\n edge [fontname=Verdana,fontsize=11.0];\\n\\n"+i.join("\\n")+"\\n\\n"+l.join("\\n")+"\\n\\n"+u.join("\\n")+"\\n}").then(function(e){var t=k(e.bb);return e.objects&&e.objects.forEach(function(r){if(r.nodes){var e=function(r,e){var t=k(r);return{x:-t.x+e.width,y:-t.y+e.height,width:t.width,height:t.height}}(r.bb,t),o=n[r.id];o.x=e.x-t.width/2,o.y=e.y-t.height/2,o.width=e.width,o.height=e.height}else{var i=(u=r.pos,c=r.width,f=r.height,l=D(u,t),d=E(+c),p=E(+f),{x:l.x,y:l.y,width:d,height:p}),s=a[r.id];s&&(s.x=i.x-t.width/2,s.y=i.y-t.height/2)}var u,c,f,l,d,p}),e.edges&&e.edges.forEach(function(e){var n=c[e.id];n&&(n.points=function(e,t){if(e.pos){var n=e.pos.substr(2).split(" ").map(function(r){return D(r,t)}).map(function(r){return[r.x-t.width/2,r.y-t.height/2]}),o=n.shift();return r(r([],n),[o])}return[]}(e,t))}),{clusters:o,nodes:s,links:f}})}self.onmessage=function(r){P.apply(void 0,r.data).then(function(r){self.postMessage(r)})}}();'],{type:"application/javascript"}),n=URL.createObjectURL(r),o=new Worker(n);return{terminate:function(){return o.terminate()},response:new Promise(function(r){o.onmessage=function(e){r(e.data),o.terminate(),URL.revokeObjectURL(n)},o.postMessage([e,t])})}}var Eh=E().x(function(e){return e[0]}).y(function(e){return e[1]}).curve(F),kh=function(e){function t(t,r,n){var o=e.call(this,t)||this;return o._engine=r,o._wasmFolder=n,o}return s(t,e),t.prototype.start=function(){var t=this;e.prototype.start.call(this);var r=this._graph.size(),n=this._graph.graphData(),o={};return xh({items:n.hierarchy(function(e,t,r){switch(e){case"subgraph":return{id:t.id,text:t.props.text,children:r};case"vertex":delete t.fx,delete t.fy;var n=t.element.node().getBBox(),i={id:t.id,text:t.props.text,width:n.width,height:n.height};return o[i.id]=i,i}}),links:n.allEdges().map(function(e){return{id:e.props.id,source:o[e.source.id],target:o[e.target.id],text:e.props.label||""}}),raw:""},{engine:this._engine,wasmFolder:this._wasmFolder}).response.then(function(e){return t.running()&&(e.clusters.forEach(function(e){var t=n.subgraph(e.id);t.x=e.x+r.width/2-e.width,t.y=e.y+r.height/2-e.height,t.props.width=e.width,t.props.height=e.height}),e.nodes.forEach(function(e){var t=n.vertex(e.id);t.x=e.x+r.width/2,t.y=e.y+r.height/2}),e.links.forEach(function(e){var t=n.edge(e.id);t.points=h(h([[t.source.x,t.source.y]],void 0!==e.points?e.points.map(function(e){return[e[0]+r.width/2,e[1]+r.height/2]}):[]),[[t.target.x,t.target.y]])}),t._graph.moveSubgraphs(!0).moveVertices(!0).moveEdges(!0),t.stop()),t})},t.prototype.edgePath=function(t,r){var n=this,o=[],i=!1;return t.points&&(o=t.points.map(function(e){var t=n._graph.project(e[0],!1),r=n._graph.project(e[1],!1);return(isNaN(t)||isNaN(r))&&(i=!0),[t,r]})),i||o.length<2?e.prototype.edgePath.call(this,t,r):{path:Eh(o),labelPos:this.center(o)}},t}(fh),Dh=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then(function(){return t.stop(),t})},t}(fh);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then(function(){var e=t._graph.size(),r=t._graph.graphData();return r.allEdges().forEach(function(e){return delete e.points}),r.allVertices().forEach(function(t){delete t.fx,delete t.fy,t.x=e.width/2+5*Math.random()-2.5,t.y=e.height/2+5*Math.random()-2.5}),t._graph.moveVertices(!0).moveEdges(!0),t.stop(),t})}}(fh);function Sh(e,t){return e.parent===t.parent?1:2}function Ch(e,t){return e+t.x}function Ah(e,t){return Math.max(e,t.y)}function jh(){var e=Sh,t=1,r=1,n=!1;function o(o){var i,a=0;o.eachAfter(function(t){var r=t.children;r?(t.x=function(e){return e.reduce(Ch,0)/e.length}(r),t.y=function(e){return 1+e.reduce(Ah,0)}(r)):(t.x=i?a+=e(t,i):0,t.y=0,i=t)});var s=function(e){for(var t;t=e.children;)e=t[0];return e}(o),u=function(e){for(var t;t=e.children;)e=t[t.length-1];return e}(o),c=s.x-e(s,u)/2,l=u.x+e(u,s)/2;return o.eachAfter(n?function(e){e.x=(e.x-o.x)*t,e.y=(o.y-e.y)*r}:function(e){e.x=(e.x-c)/(l-c)*t,e.y=(1-(o.y?e.y/o.y:1))*r})}return o.separation=function(t){return arguments.length?(e=t,o):e},o.size=function(e){return arguments.length?(n=!1,t=+e[0],r=+e[1],o):n?null:[t,r]},o.nodeSize=function(e){return arguments.length?(n=!0,t=+e[0],r=+e[1],o):n?[t,r]:null},o}function Ph(e){var t=0,r=e.children,n=r&&r.length;if(n)for(;--n>=0;)t+=r[n].value;else t=1;e.value=t}function Fh(e,t){var r,n,o,i,a,s=new Ih(e),u=+e.value&&(s.value=e.value),c=[s];for(null==t&&(t=Mh);r=c.pop();)if(u&&(r.value=+r.data.value),(o=t(r.data))&&(a=o.length))for(r.children=new Array(a),i=a-1;i>=0;--i)c.push(n=r.children[i]=new Ih(o[i])),n.parent=r,n.depth=r.depth+1;return s.eachBefore(Nh)}function Mh(e){return e.children}function Oh(e){e.data=e.data.data}function Nh(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Ih(e){this.data=e,this.depth=this.height=0,this.parent=null}function Th(e,t){return e.parent===t.parent?1:2}function Lh(e){var t=e.children;return t?t[0]:e.t}function Qh(e){var t=e.children;return t?t[t.length-1]:e.t}function Rh(e,t,r){var n=r/(t.i-e.i);t.c-=n,t.s+=r,e.c+=n,t.z+=r,t.m+=r}function Bh(e,t,r){return e.a.parent===t.parent?e.a:r}function zh(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}function Vh(){var e=Th,t=1,r=1,n=null;function o(o){var u=function(e){for(var t,r,n,o,i,a=new zh(e,0),s=[a];t=s.pop();)if(n=t._.children)for(t.children=new Array(i=n.length),o=i-1;o>=0;--o)s.push(r=t.children[o]=new zh(n[o],o)),r.parent=t;return(a.parent=new zh(null,0)).children=[a],a}(o);if(u.eachAfter(i),u.parent.m=-u.z,u.eachBefore(a),n)o.eachBefore(s);else{var c=o,l=o,h=o;o.eachBefore(function(e){e.x<c.x&&(c=e),e.x>l.x&&(l=e),e.depth>h.depth&&(h=e)});var f=c===l?1:e(c,l)/2,d=f-c.x,p=t/(l.x+f+d),g=r/(h.depth||1);o.eachBefore(function(e){e.x=(e.x+d)*p,e.y=e.depth*g})}return o}function i(t){var r=t.children,n=t.parent.children,o=t.i?n[t.i-1]:null;if(r){!function(e){for(var t,r=0,n=0,o=e.children,i=o.length;--i>=0;)(t=o[i]).z+=r,t.m+=r,r+=t.s+(n+=t.c)}(t);var i=(r[0].z+r[r.length-1].z)/2;o?(t.z=o.z+e(t._,o._),t.m=t.z-i):t.z=i}else o&&(t.z=o.z+e(t._,o._));t.parent.A=function(t,r,n){if(r){for(var o,i=t,a=t,s=r,u=i.parent.children[0],c=i.m,l=a.m,h=s.m,f=u.m;s=Qh(s),i=Lh(i),s&&i;)u=Lh(u),(a=Qh(a)).a=t,(o=s.z+h-i.z-c+e(s._,i._))>0&&(Rh(Bh(s,t,n),t,o),c+=o,l+=o),h+=s.m,c+=i.m,f+=u.m,l+=a.m;s&&!Qh(a)&&(a.t=s,a.m+=h-l),i&&!Lh(u)&&(u.t=i,u.m+=c-f,n=t)}return n}(t,o,t.parent.A||n[0])}function a(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function s(e){e.x*=t,e.y=e.depth*r}return o.separation=function(t){return arguments.length?(e=t,o):e},o.size=function(e){return arguments.length?(n=!1,t=+e[0],r=+e[1],o):n?null:[t,r]},o.nodeSize=function(e){return arguments.length?(n=!0,t=+e[0],r=+e[1],o):n?[t,r]:null},o}Ih.prototype=Fh.prototype={constructor:Ih,count:function(){return this.eachAfter(Ph)},each:function(e){var t,r,n,o,i=this,a=[i];do{for(t=a.reverse(),a=[];i=t.pop();)if(e(i),r=i.children)for(n=0,o=r.length;n<o;++n)a.push(r[n])}while(a.length);return this},eachAfter:function(e){for(var t,r,n,o=this,i=[o],a=[];o=i.pop();)if(a.push(o),t=o.children)for(r=0,n=t.length;r<n;++r)i.push(t[r]);for(;o=a.pop();)e(o);return this},eachBefore:function(e){for(var t,r,n=this,o=[n];n=o.pop();)if(e(n),t=n.children)for(r=t.length-1;r>=0;--r)o.push(t[r]);return this},sum:function(e){return this.eachAfter(function(t){for(var r=+e(t.data)||0,n=t.children,o=n&&n.length;--o>=0;)r+=n[o].value;t.value=r})},sort:function(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})},path:function(e){for(var t=this,r=function(e,t){if(e===t)return e;var r=e.ancestors(),n=t.ancestors(),o=null;for(e=r.pop(),t=n.pop();e===t;)o=e,e=r.pop(),t=n.pop();return o}(t,e),n=[t];t!==r;)t=t.parent,n.push(t);for(var o=n.length;e!==r;)n.splice(o,0,e),e=e.parent;return n},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){var e=[];return this.each(function(t){e.push(t)}),e},leaves:function(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e},links:function(){var e=this,t=[];return e.each(function(r){r!==e&&t.push({source:r.parent,target:r})}),t},copy:function(){return Fh(this).eachBefore(Oh)}},zh.prototype=Object.create(Ih.prototype);var Gh=A().x(function(e){return e.x}).y(function(e){return e.y}),Hh=function(){function e(e,t,r,n){void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=e),void 0===n&&(n=t),this.x1=e,this.y1=t,this.x2=r,this.y2=n}return Object.defineProperty(e.prototype,"x",{get:function(){return this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.x2-this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.y2-this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"center",{get:function(){return{x:this.x1+this.width/2,y:this.y1+this.height/2}},enumerable:!1,configurable:!0}),e.prototype.reset=function(e,t){this.x1=e,this.x2=e,this.y1=t,this.y2=t},e.prototype.expand=function(e,t){this.x1>e?this.x1=e:this.x2<e&&(this.x2=e),this.y1>t?this.y1=t:this.y2<t&&(this.y2=t)},e}(),Uh=function(e){function t(t,r){var n=e.call(this,t)||this;return n.options=r,n._visited={},n}return s(t,e),t.prototype.sortTree=function(e,t){var r=this;t||(t=this._tree),t.children.sort(function(t,r){return e.neighbors(r.origData.id).length-e.neighbors(t.origData.id).length});var n=[];t.children.forEach(function(e,t){t%2==0?n.push(e):n.unshift(e)}),t.children=n,t.children.forEach(function(t){return r.sortTree(e,t)})},t.prototype.depthFirst=function(e,t,r){var n=this;if(void 0===r&&(this._visited={},this._tree=void 0),!this._visited[t.id]){this._visited[t.id]=t;var o={origData:t,children:[]};void 0===r?this._tree=o:r.children.push(o),e.neighbors(t.id).forEach(function(t){return n.depthFirst(e,t,o)})}},t.prototype.breadthFirst=function(e,t){var r=this;this._visited={},this._visited[t.id]=t,this._tree={origData:t,children:[]};var n=[];n.push(this._tree);for(var o=function(){var t=n.shift();e.neighbors(t.origData.id).forEach(function(e){if(!r._visited[e.id]){r._visited[e.id]=e;var o={origData:e,children:[]};t.children.push(o),n.push(o)}})};n.length;)o();this.sortTree(e)},t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then(function(){for(var e,r=t._graph.graphData(),n=0,o=r.allVertices();n<o.length;n++){var i=o[n];if(delete i.fx,delete i.fy,void 0===e&&(e=i),i.centroid){e=i;break}}return r.allEdges().forEach(function(e){return delete e.points}),t.breadthFirst(r,e),t._d3Hierarchy=Fh(t._tree),t})},t.prototype.finalize=function(e){var t=this._graph.size(),r=new Hh;e.forEach(function(e,t){0===t?r.reset(e.origData.x,e.origData.y):r.expand(e.origData.x,e.origData.y)});var n=t.width/2-r.center.x,o=t.height/2-r.center.y;e.forEach(function(e){e.origData.x+=n,e.origData.y+=o}),this._graph.moveVertices(!0).moveEdges(!0),this.stop()},t}(fh),Wh=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.options=r,n}return s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then(function(){var e=Vh().nodeSize(["TB"===t.options.rankdir?200:100,"TB"===t.options.rankdir?100:200])(t._d3Hierarchy).descendants().map(function(e){return e.data.origData.x="TB"===t.options.rankdir?e.x:e.y,e.data.origData.y="TB"===t.options.rankdir?e.y:e.x,e.data});return t.finalize(e),t})},t.prototype.edgePath=function(e,t){var r=this._graph.projectPlacholder(e.source),n=this._graph.projectPlacholder(e.target);return{path:Gh({source:r,target:n}),labelPos:this.center([[r.x,r.y],[n.x,n.y]])}},t}(Uh),qh=function(e){function t(t){return e.call(this,t,{})||this}return s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then(function(){var e=Vh().size([2*Math.PI,512]).separation(function(e,t){return(e.parent==t.parent?1:2)/e.depth})(t._d3Hierarchy).descendants().map(function(e){return e.data.origData.angle=e.x,e.data.origData.radius=e.y,e.data.origData.x=Math.sin(e.x)*e.y,e.data.origData.y=Math.cos(e.x)*e.y,e.data});return t.finalize(e),t})},t}(Uh),Yh=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.options=r,n}return s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then(function(){var e=jh().nodeSize(["TB"===t.options.rankdir?200:100,"TB"===t.options.rankdir?100:200])(t._d3Hierarchy).descendants().map(function(e){return e.data.origData.x="TB"===t.options.rankdir?e.x:e.y,e.data.origData.y="TB"===t.options.rankdir?e.y:e.x,e.data});return t.finalize(e),t})},t.prototype.edgePath=function(e,t){var r=this._graph.projectPlacholder(e.source),n=this._graph.projectPlacholder(e.target);return{path:Gh({source:r,target:n}),labelPos:this.center([[r.x,r.y],[n.x,n.y]])}},t}(Uh),$h=function(e){function t(t){return e.call(this,t,{})||this}return s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then(function(){var e=jh().size([2*Math.PI,512]).separation(function(e,t){return(e.parent==t.parent?1:2)/e.depth})(t._d3Hierarchy).descendants().map(function(e){return e.data.origData.x=Math.sin(e.x)*e.y,e.data.origData.y=Math.cos(e.x)*e.y,e.data});return t.finalize(e),t})},t}(Uh);L(".graph_Graph2 .allowDragging .graphVertex,.graph_Graph2 .graphVertex{cursor:pointer}.graph_Graph2 .allowDragging .graphVertex.grabbed{cursor:grabbing}.graph_Graph2 .graphEdge{stroke:#a9a9a9;fill:none}.graph_Graph2 .graphEdge>text{stroke:none;fill:#000}.graph_Graph2 .graphEdge.hide-text>text{display:none}.graph_Graph2 g.selected circle,.graph_Graph2 g.selected rect{stroke:red!important}");var Xh=(r.getScriptSrc("/graph/lib-umd/graph2/graph")||r.getScriptSrc("/graph/dist/index")||".")+"/graph/dist",Jh=function(e){e.fx=e.sx=e.x,e.fy=e.sy=e.y},Kh=function(e,t){e.fx=e.sx+t.fx-t.sx,e.fy=e.sy+t.fy-t.sy},Zh=function(e){e.x=e.fx,e.y=e.fy,e.fx=e.sx=void 0,e.fy=e.sy=void 0},ef=function(e){function n(){var n=e.call(this)||this;n._toggleHierarchy=(new t.ToggleButton).faChar("fa-sitemap").tooltip("Hierarchy").on("click",function(){return n.layoutClick("Hierarchy")}),n._toggleForceDirected=(new t.ToggleButton).faChar("fa-expand").tooltip("Force Directed").on("click",function(){return n.layoutClick("ForceDirected")}),n._toggleForceDirected2=(new t.ToggleButton).faChar("fa-arrows").tooltip("Spring").on("click",function(){return n.layoutClick("ForceDirected2")}),n._toggleCircle=(new t.ToggleButton).faChar("fa-circle-o").tooltip("Circle").on("click",function(){return n.layoutClick("Circle")}),n._toggleDot=(new t.ToggleButton).faChar("fa-angle-double-down").tooltip("DOT").on("click",function(){return n.layoutClick("DOT")}),n._toggleNeato=(new t.ToggleButton).faChar("fa-sun-o").tooltip("Neato").on("click",function(){return n.layoutClick("Neato")}),n._toggleFDP=(new t.ToggleButton).faChar("fa-asterisk").tooltip("FDP").on("click",function(){return n.layoutClick("FDP")}),n._toggleTwoPI=(new t.ToggleButton).faChar("fa-bullseye").tooltip("TwoPI").on("click",function(){return n.layoutClick("TwoPI")}),n._toggleCirco=(new t.ToggleButton).faChar("fa-cogs").tooltip("Circo").on("click",function(){return n.layoutClick("Circo")}),n._toggleT=(new t.ToggleButton).faChar("fa-sitemap fa-rotate-270").tooltip("Tree").on("click",function(){return n.layoutClick("Tree")}),n._toggleRT=(new t.ToggleButton).faChar("fa-sun-o").tooltip("Radial Tree").on("click",function(){return n.layoutClick("RadialTree")}),n._toggleD=(new t.ToggleButton).faChar("fa-sitemap fa-rotate-270").tooltip("Dendrogram").on("click",function(){return n.layoutClick("Dendrogram")}),n._toggleRD=(new t.ToggleButton).faChar("fa-asterisk").tooltip("Radial Dendrogram").on("click",function(){return n.layoutClick("RadialDendrogram")}),n._graphData=(new r.Graph2).idFunc(function(e){return e.id}).sourceFunc(function(e){return e.source.id}).targetFunc(function(e){return e.target.id}).updateFunc(function(e,t){return e.props=t.props,e}),n._prevDoClickTime=0,n._tooltip=new i.HTMLTooltip,n._selection=new t.Utility.Selection(n),n._dragHandler=t.drag(),n._catPalette=t.Palette.ordinal("hpcc10"),n._categories=[],n._annotations=[],n._origData={subgraphs:[],vertices:[],edges:[],hierarchy:[]},n._layoutAlgo=new Dh(n),n.highlight={zoom:1.1,opacity:.33,edge:"1.25px"},n._centroidRenderer=o.Vertex,n._vertexRenderer=o.Vertex,n._transformScale=1;var a=n;n._drawStartPos="origin";var s=[n._toggleHierarchy,n._toggleForceDirected,n._toggleForceDirected2,n._toggleCircle,new t.Spacer,n._toggleDot,n._toggleNeato,n._toggleFDP,n._toggleTwoPI,n._toggleCirco,new t.Spacer,n._toggleT,n._toggleRT,n._toggleD,n._toggleRD,new t.Spacer];return n._iconBar.buttons(s.concat(n._iconBar.buttons())),n._dragHandler.on("start",function(e){if(a.allowDragging()){t.select(this).classed("grabbed",!0),Jh(e),t.Utility.safeRaise(this),a.moveVertexPlaceholder(e,!1,!0);var r=a.selection();a.selected(e.props,r)?r.filter(function(t){return t.id!==e.props.id}).forEach(function(e){var t=a._graphData.vertex(e.id);Jh(t)}):a.dragSingleNeighbors()&&a._graphData.singleNeighbors(e.id).forEach(function(e){Jh(e)})}}).on("drag",function(e){if(a.allowDragging()){e.fx=e.sx+a.rproject(t.d3Event().x-e.sx),e.fy=e.sy+a.rproject(t.d3Event().y-e.sy),a._graphData.vertexEdges(e.id).forEach(function(e){return delete e.points}),a.moveVertexPlaceholder(e,!1,!0);var r=a.selection();a.selected(e.props,r)?r.filter(function(t){return t.id!==e.props.id}).forEach(function(t){var r=a._graphData.vertex(t.id);Kh(r,e),a.moveVertexPlaceholder(r,!1,!0)}):a.dragSingleNeighbors()&&a._graphData.singleNeighbors(e.id).forEach(function(t){Kh(t,e),a.moveVertexPlaceholder(t,!1,!0)})}}).on("end",function(e){var r=!0;if(a.allowDragging()){r=Math.abs(e.sx-e.fx)<1&&Math.abs(e.sy-e.fy)<1,Zh(e);var n=a.selection();a.selected(e.props,n)?n.filter(function(t){return t.id!==e.props.id}).forEach(function(e){var t=a._graphData.vertex(e.id);Zh(t)}):a.dragSingleNeighbors()&&a._graphData.singleNeighbors(e.id).forEach(Zh),t.select(this).classed("grabbed",!1)}if(r){a._selection.click({_id:e.id,element:function(){return e.element}},t.d3Event().sourceEvent),a.selectionChanged();var o=e.element.classed("selected");a.vertex_click(e.props.origData||e.props,"",o);var i=Date.now();i-a._prevDoClickTime<a.doubleClickMaxDelay()&&a.vertex_dblclick(e.props.origData||e.props,"",o),a._prevDoClickTime=i}}).filter(function(){return!0}),n.zoomToFitLimit(1),n}return s(n,e),n.prototype.iconBarButtons=function(){return this._iconBar.buttons()},n.prototype.categories=function(e){return void 0===e?this._categories:(this._categories=e,this)},n.prototype.annotations=function(e){return void 0===e?this._annotations:(this._annotations=e,this)},n.prototype.data=function(e,t){var r=this;return void 0===e?this._origData:(this._origData=e,this._graphData.mergeSubgraphs((e.subgraphs||[]).map(function(e){return{id:e.id,props:e}})),this._graphData.mergeVertices((e.vertices||[]).map(function(e){return{id:e.id,centroid:e.centroid,props:e}})),this._graphData.mergeEdges((e.edges||[]).filter(function(e){return r._graphData.vertexExists(e.source.id)&&r._graphData.vertexExists(e.target.id)}).map(function(e){return{id:e.id,props:e,source:r._graphData.vertex(e.source.id),target:r._graphData.vertex(e.target.id)}})),this._graphData.clearParents(),(e.hierarchy?e.hierarchy:[]).forEach(function(e){r._graphData.subgraphExists(e.child.id)?r._graphData.subgraphParent(e.child.id,e.parent.id):r._graphData.vertexExists(e.child.id)&&r._graphData.vertexParent(e.child.id,e.parent.id)}),this)},n.prototype.selected=function(e,t){return(t||this.selection()).some(function(t){return t.id===e.id})},n.prototype.selection=function(e){var t=this;return arguments.length?(this._selection.set(e.map(function(e){var r=t._graphData.item(e.id);return{_id:r.id,element:function(){return r.element}}})),this):this._selection.get().map(function(e){return t._graphData.item(e._id).props})},n.prototype.graphData=function(){return this._graphData},n.prototype.resetLayout=function(){return delete this._prevLayout,this},n.prototype.layoutRunning=function(){return this._layoutAlgo&&this._layoutAlgo.running()},n.prototype.layoutAlgo=function(e){var t=this;return this._layoutAlgo&&this._layoutAlgo.stop(),this._layoutAlgo=e,this._layoutAlgo.start().then(function(){t.updateIconBar(),t.applyScaleOnLayout()&&setTimeout(function(){t.zoomToFit()},t.transitionDuration())})},n.prototype.layoutClick=function(e){this.layoutRunning()?(this._layoutAlgo.stop(),this.updateIconBar()):(delete this._prevLayout,this.layout(e).render())},n.prototype.updateIconBarItem=function(e,t){var r=this.layout(),n=this._layoutAlgo&&this._layoutAlgo.running();e.enabled(!n||r===t).selected(n&&r===t).render()},n.prototype.updateIconBar=function(){e.prototype.updateIconBar.call(this),this.updateIconBarItem(this._toggleHierarchy,"Hierarchy"),this.updateIconBarItem(this._toggleDot,"DOT"),this.updateIconBarItem(this._toggleForceDirected,"ForceDirected"),this.updateIconBarItem(this._toggleNeato,"Neato"),this.updateIconBarItem(this._toggleFDP,"FDP"),this.updateIconBarItem(this._toggleForceDirected2,"ForceDirected2"),this.updateIconBarItem(this._toggleCircle,"Circle"),this.updateIconBarItem(this._toggleTwoPI,"TwoPI"),this.updateIconBarItem(this._toggleCirco,"Circo"),this.updateIconBarItem(this._toggleT,"Tree"),this.updateIconBarItem(this._toggleRT,"RadialTree"),this.updateIconBarItem(this._toggleD,"Dendrogram"),this.updateIconBarItem(this._toggleRD,"RadialDendrogram")},n.prototype.getNeighborMap=function(e){var t={},r={};if(e)for(var n=this._graphData.vertexEdges(e.id),o=0;o<n.length;++o){var i=this._graphData.edge(n[o].id);r[i.id]=i,i.source.id!==e.id&&(t[i.source.id]=i.source),i.target.id!==e.id&&(t[i.target.id]=i.target)}return{vertices:t,edges:r}},n.prototype.centerOnItem=function(e){var t,r,n,o=this._graphData.item(e);if((this._graphData.isSubgraph(o)||this._graphData.isVertex(o))&&(r=o.x,n=o.y),this._graphData.isEdge(o)&&(r=(t=[0,0])[0],n=t[1]),void 0!==r&&void 0!==n){var i=o.element.node().getBBox();if(this._graphData.isVertex(o)){var a=this.projectPlacholder(o);r=a.x,n=a.y}else this._graphData.isSubgraph(o)&&(r=this.project(o.x),n=this.project(o.y));var s=i.x+i.width/2,u=i.y+i.height/2,c={x:r+s-i.width/2,y:n+u-i.height/2,width:i.width,height:i.height};this.centerOnBBox(c)}},n.prototype.hideVertex=function(e){var t=this._graphData.item(e);return this._graphData.isVertex(t)&&(t.props.hidden=!0),this},n.prototype.showVertex=function(e){var t=this._graphData.item(e);return this._graphData.isVertex(t)&&(t.props.hidden=!1),this},n.prototype.highlightVerticies=function(e){var t=this,r=this,n=this._vertexG.selectAll(".graphVertex"),i=!r.showVertexLabels()&&r.showVertexLabelsOnHighlight();return n.classed("graphVertex-highlighted",function(t){return!e||e[t.id]}).style("filter",function(r){return e&&e[r.id]?"url(#"+t.id()+"_glow)":null}).each(function(t){if(i){var n=r.calcProps(t.centroid,u({showLabel:!(!e||!e[t.id])},r.vertexMapper(t.props,t.props.origData)));o.render(t.centroid?r._centroidRenderer:r._vertexRenderer,n,this)}}).transition().duration(this.transitionDuration()).on("end",function(t){e&&e[t.id]&&t.element.node()&&t.element.node().parentNode&&t.element.node().parentNode.appendChild(t.element.node())}).style("opacity",function(t){return t.props.hidden?0:!e||e[t.id]?1:r.highlight.opacity}),this},n.prototype.highlightEdges=function(e){var t=this;return this._edgeG.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:t.edgeStrokeWidth()+"px"}).transition().duration(this.transitionDuration()).style("opacity",function(r){return r.source.props.hidden||r.target.props.hidden?0:!e||e[r.id]?1:t.highlight.opacity}),this},n.prototype.highlightVertex=function(e,t){if(this.highlightOnMouseOverVertex())if(t){var r=this.getNeighborMap(t);r.vertices[t.id]=t,this.highlightVerticies(r.vertices),this.highlightEdges(r.edges)}else this.highlightVerticies(null),this.highlightEdges(null)},n.prototype.highlightEdge=function(e,t){if(this.highlightOnMouseOverEdge())if(t){var r={};r[t.source.id]=t.source,r[t.target.id]=t.target;var n={};n[t.id]=t,this.highlightVerticies(r),this.highlightEdges(n)}else this.highlightVerticies(null),this.highlightEdges(null)},n.prototype.moveSubgraphPlaceholder=function(e,t){var r=this.project(e.x),n=this.project(e.y),i=this.project(e.props.width,!0),a=this.project(e.props.height,!0);return e.element&&(t?e.element.transition():e.element).attr("transform","translate("+r+" "+n+")").each(function(e){o.render(o.Subgraph,u(u({},e.props),{width:i,height:a}),this)}),this},n.prototype.moveEdgePlaceholder=function(e,t){var r,n,o=this._layoutAlgo.edgePath(e,this.edgeArcDepth());if(e.elementPath&&(t?e.elementPath.transition():e.elementPath).attr("d",o.path).attr("stroke-dasharray",function(e){return e.props.strokeDasharray}),e.elementText){var i=null!==(n=null===(r=e.props.label)||void 0===r?void 0:r.split("\n"))&&void 0!==n?n:[];e.elementText.selectAll(".textLine").data(i,function(e){return e}).join(function(e){return e.append("tspan").attr("class","textLine").attr("x",0)},function(e){return e.attr("dy",function(e,t){return t+"em"}).text(function(e){return e})},function(e){return e.remove()}),(t?e.elementText.transition():e.elementText).attr("transform","translate("+o.labelPos[0]+" "+o.labelPos[1]+")").attr("font-family",function(e){return e.props.fontFamily||null})}return this},n.prototype.moveVertexPlaceholder=function(e,t,r){var n=this,o=this.projectPlacholder(e),i=o.x,a=o.y;return e.element&&(t?e.element.transition():e.element).attr("transform","translate("+i+" "+a+")"),r&&this._graphData.vertexEdges(e.id).forEach(function(e){return n.moveEdgePlaceholder(e,t)}),this},n.prototype.moveSubgraphs=function(e){var t=this;return this._graphData.allSubgraphs().forEach(function(r){return t.moveSubgraphPlaceholder(r,e)}),this},n.prototype.moveEdges=function(e){var t=this;return this._graphData.allEdges().forEach(function(r){return t.moveEdgePlaceholder(r,e)}),this},n.prototype.moveVertices=function(e){var t=this;return this._graphData.allVertices().forEach(function(r){return t.moveVertexPlaceholder(r,e,!1)}),this},n.prototype.project=function(e,t){void 0===t&&(t=!1);e=void 0!==e?e:0;var r=this._transformScale;return t&&(this._transformScale>this.maxScale()+(this._transformScale-this.maxScale())/2?r=this.maxScale()+(this._transformScale-this.maxScale())/2:(this._transformScale,this.minScale(),this._transformScale,this.minScale())),Math.round(e*r*10)/10},n.prototype.rproject=function(e){return e=void 0!==e?e:0,Math.round(e/this._transformScale*10)/10},n.prototype.projectPlacholder=function(e){return{x:this.project(void 0!==e.fx?e.fx:e.x),y:this.project(void 0!==e.fy?e.fy:e.y)}},n.prototype.categoryID=function(e,t){return void 0===t&&(t="cat"),void 0===e||""===e?"":""+t+this.id()+"_"+e},n.prototype.updateCategories=function(){var e=this;o.render(o.Icons,{icons:this._categories.map(function(t){return u(u({},t),{id:e.categoryID(t.id),fill:t.fill||"transparent",imageCharFill:t.imageCharFill||e._catPalette(t.id)})})},this._svgDefsCat.node())},n.prototype.updateAnnotations=function(){var e=this;o.render(o.Icons,{icons:this._annotations.map(function(t){return u(u({},t),{id:e.categoryID(t.id,"ann"),shape:t.shape||"square",height:t.height||12,fill:t.fill||e._catPalette(t.id)})})},this._svgDefsAnn.node())},n.prototype.updateEdges=function(){var e=this,r=this;return this._edgeG.selectAll(".graphEdge").data(this._graphData.allEdges(),function(e){return e.id}).join(function(e){return e.append("g").attr("class","graphEdge").on("click.selectionBag",function(e){r._selection.click({_id:e.id,element:function(){return e.element}},t.d3Event()),r.selectionChanged()}).on("click",function(e){var t=e.element.classed("selected");r.edge_click(e.props.origData||e.props,"",t)}).on("mouseover",function(e){t.Utility.safeRaise(this),r.edge_mouseover(t.select(this),e)}).on("mouseout",function(e){r.edge_mouseout(t.select(this),e)}).each(function(e){e.element=t.select(this),e.elementPath=e.element.append("path"),e.elementText=e.element.append("text").attr("text-anchor","middle")})},function(e){return e.attr("opacity",function(e){return e.source.props.hidden||e.target.props.hidden?0:1}).classed("hide-text",!r.showEdgeLabels())},function(e){return e.each(function(e){delete e.element}).remove()}).style("stroke",function(t){var r,n;return null!==(n=null===(r=t.props)||void 0===r?void 0:r.color)&&void 0!==n?n:e.edgeColor()}).style("stroke-width",this.edgeStrokeWidth()+"px"),this},n.prototype.centroidRenderer=function(e){return arguments.length?(this._centroidRenderer=e,this):this._centroidRenderer},n.prototype.vertexRenderer=function(e){return arguments.length?(this._vertexRenderer=e,this):this._vertexRenderer},n.prototype.vertexMapper=function(e,t){var r=this;return u(u({},e),{categoryID:this.categoryID(e.categoryID),annotationIDs:e.annotationIDs?e.annotationIDs.map(function(e){return r.categoryID(e,"ann")}):[]})},n.prototype.updateVertices=function(){var e=this,r=this;return this._vertexG.selectAll(".graphVertex").data(this._graphData.allVertices(),function(e){return e.id}).join(function(n){return n.append("g").attr("class","graphVertex").on("dblclick",function(e){t.d3Event().stopPropagation()}).on("mousein",function(e){t.Utility.safeRaise(this),r.highlightVertex(t.select(this),e);var n=e.element.classed("selected");r.vertex_mousein(e.props.origData||e.props,"",n)}).on("mouseover",function(e){t.Utility.safeRaise(this),r.highlightVertex(t.select(this),e);var n=e.element.classed("selected");e.props.tooltip&&r._tooltip.tooltipHTML(r.tooltipHTML.bind(r)).triggerElement(e.element).tooltipWidth(r.tooltipWidth()).tooltipHeight(r.tooltipHeight()).enablePointerEvents(r.enableTooltipPointerEvents()).closeDelay(r.tooltipCloseDelay()).direction("n").data(e).visible(!0).render(),r.vertex_mouseover(e.props.origData||e.props,"",n)}).on("mouseout",function(e){r.highlightVertex(null,null);var t=e.element.classed("selected");r.vertex_mouseout(e.props.origData||e.props,"",t),e.props.tooltip&&r._tooltip.mouseout()}).call(e._dragHandler).each(function(e){e.element=t.select(this)})},function(e){return e},function(e){return e.each(function(e){delete e.element}).remove()}).classed("centroid",function(e){return e.centroid}).attr("opacity",function(e){return e.props.hidden?0:1}).attr("filter",function(t){return t.centroid?"url(#"+e.id()+"_glow)":null}).each(function(e){var t=r.calcProps(e.centroid,u({showLabel:r.showVertexLabels()},r.vertexMapper(e.props,e.props.origData)));o.render(e.centroid?r._centroidRenderer:r._vertexRenderer,t,this)}),this},n.prototype.calcProps=function(e,t){t.icon||(t.icon={}),e?(t.textHeight=t.textHeight?t.textHeight:this.centroidTextHeight()*this.centroidScale(),t.textPadding=t.textPadding?t.textPadding:this.centroidTextPadding()*this.centroidScale(),t.textFontFamily=t.textFontFamily?t.textFontFamily:this.centroidLabelFontFamily(),t.icon.height=t.icon.height?t.icon.height:this.centroidIconHeight()*this.centroidScale(),t.icon.padding=t.icon.padding?t.icon.padding:this.centroidIconPadding()*this.centroidScale(),t.icon.strokeWidth=t.icon.strokeWidth?t.icon.strokeWidth:this.centroidIconStrokeWidth(),t.icon.imageFontFamily=t.icon.imageFontFamily?t.icon.imageFontFamily:this.centroidIconFontFamily()):(t.textHeight=t.textHeight?t.textHeight:this.vertexTextHeight(),t.textPadding=t.textPadding?t.textPadding:this.vertexTextPadding(),t.textFontFamily=t.textFontFamily?t.textFontFamily:this.vertexLabelFontFamily(),t.icon.height=t.icon.height?t.icon.height:this.vertexIconHeight(),t.icon.padding=t.icon.padding?t.icon.padding:this.vertexIconPadding(),t.icon.strokeWidth=t.icon.strokeWidth?t.icon.strokeWidth:this.vertexIconStrokeWidth(),t.icon.imageFontFamily=t.icon.imageFontFamily?t.icon.imageFontFamily:this.vertexIconFontFamily());var r=t.icon.imageChar,n=t.icon.imageFontFamily,o=t.icon.height-t.icon.padding,i=this.textRect(r,n,o);return t.icon.yOffset=-(i.top-o/2)-i.height/2+(t.icon.padding>0?o/t.icon.padding/2:0),t},n.prototype.hasSubgraphs=function(){switch(this.layout()){case"DOT":case"Hierarchy":return!0}return!1},n.prototype.updateSubgraphs=function(){var e=this;return this._subgraphG.selectAll(".subgraphPlaceholder").data(this.hasSubgraphs()?this._graphData.allSubgraphs():[],function(e){return e.id}).join(function(r){return r.append("g").attr("class","subgraphPlaceholder").on("click.selectionBag",function(r){e._selection.click({_id:r.id,element:function(){return r.element}},t.d3Event()),e.selectionChanged()}).on("click",function(t){var r=t.element.classed("selected");e.subgraph_click(t.props.origData||t.props,"",r)}).on("mouseover",function(){t.Utility.safeRaise(this)}).each(function(e){e.element=t.select(this)})},function(e){return e},function(e){return e.each(function(e){delete e.element}).transition().style("opacity",0).remove()}).each(function(t){e.moveSubgraphPlaceholder(t,!1)}),this},n.prototype.enter=function(r,n){var o=this;e.prototype.enter.call(this,r,n);var i=this.locateSVGNode(r);this._svgDefs=t.select(i).select("defs"),this._centroidFilter=new t.SVGGlowFilter(this._svgDefs,this._id+"_glow"),this._svgDefsCat=this._svgDefs.append("g"),this._svgDefsAnn=this._svgDefs.append("g"),this._subgraphG=this._renderElement.append("g"),this._edgeG=this._renderElement.append("g"),this._vertexG=this._renderElement.append("g"),this._tooltip.target(r),this.on("startMarqueeSelection",function(){}).on("updateMarqueeSelection",function(e){var t=o._graphData.allVertices().filter(function(t){return t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height});o.selection(t.map(function(e){return e.props}))}).on("endMarqueeSelection",function(){o.selectionChanged()})},n.prototype.forceDirectedOptions=function(){return{alpha:this.forceDirectedAlpha(),alphaMin:this.forceDirectedAlphaMin(),alphaDecay:this.forceDirectedAlphaDecay(),velocityDecay:this.forceDirectedVelocityDecay(),repulsionStrength:this.forceDirectedRepulsionStrength(),iterations:this.forceDirectedIterations(),linkDistance:this.forceDirectedLinkDistance(),linkStrength:this.forceDirectedLinkStrength(),pinCentroid:this.forceDirectedPinCentroid(),forceStrength:this.forceDirectedForceStrength(),distanceMin:this.forceDirectedMinDistance(),distanceMax:this.forceDirectedMaxDistance()}},n.prototype.layoutOptions=function(e){switch(e){case"ForceDirected":case"ForceDirected2":case"ForceDirectedHybrid":return this.forceDirectedOptions();case"Hierarchy":return{rankdir:this.hierarchyRankDirection(),nodesep:this.hierarchyNodeSeparation(),edgesep:this.hierarchyEdgeSeparation(),ranksep:this.hierarchyRankSeparation(),digraph:this.hierarchyDigraph()};case"Tree":case"Dendrogram":return{rankdir:this.treeRankDirection()};case"DOT":case"Neato":case"FDP":case"TwoPI":case"Circo":return this.wasmFolder()||Xh;case"None":case"Circle":case"RadialTree":case"RadialDendrogram":default:return}},n.prototype.updateLayout=function(){var e=this,t=this.layout(),n=this.layoutOptions(t),o=r.hashSum([t,n]);if(this._prevLayout!==o)switch(this._prevLayout=o,t){case"None":this.layoutAlgo(new Dh(this));break;case"Circle":this.layoutAlgo(new ph(this));break;case"ForceDirected":this.layoutAlgo(new bh(this,n));break;case"ForceDirected2":this.layoutAlgo(new wh(this,n));break;case"ForceDirectedHybrid":this.layoutAlgo(new bh(this,n)).then(function(){e.layoutAlgo(new wh(e,n))});break;case"Hierarchy":this.layoutAlgo(new mh(this,n));break;case"DOT":this.layoutAlgo(new kh(this,"dot",n));break;case"Tree":this.layoutAlgo(new Wh(this,n));break;case"RadialTree":this.layoutAlgo(new qh(this));break;case"Dendrogram":this.layoutAlgo(new Yh(this,n));break;case"RadialDendrogram":this.layoutAlgo(new $h(this));break;case"Neato":this.layoutAlgo(new kh(this,"neato",n));break;case"FDP":this.layoutAlgo(new kh(this,"fdp",n));break;case"TwoPI":this.layoutAlgo(new kh(this,"twopi",n));break;case"Circo":this.layoutAlgo(new kh(this,"circo",n))}},n.prototype.update=function(t,r){e.prototype.update.call(this,t,r),this._centroidFilter.update(this.centroidColor()),this._renderElement.classed("allowDragging",this.allowDragging()),this.updateCategories(),this.updateAnnotations(),this.updateSubgraphs(),this.updateVertices(),this.updateEdges(),this.updateLayout(),this.updateIconBar()},n.prototype.exit=function(t,r){e.prototype.exit.call(this,t,r),this._tooltip.target(null)},n.prototype.render=function(t){var r=this;return this.progress("start"),e.prototype.render.call(this,function(e){r.progress("stop"),t&&t(e)}),this},n.prototype.zoomed=function(t){e.prototype.zoomed.call(this,t);var r=this.size(),n=r.width,o=r.height;t.k<this.minScale()?(this._edgeG.attr("transform","scale("+this.minScale()/t.k+")"),this._subgraphG.attr("transform","scale("+this.minScale()/t.k+")"),this._vertexG.attr("transform","scale("+this.minScale()/t.k+")"),this._transformScale=t.k/this.minScale()):t.k>this.maxScale()?(this._edgeG.attr("transform","scale("+this.maxScale()/t.k+")"),this._subgraphG.attr("transform","scale("+this.maxScale()/t.k+")"),this._vertexG.attr("transform","scale("+this.maxScale()/t.k+")"),this._transformScale=t.k/this.maxScale()):(this._transformScale=1,this._edgeG.attr("transform",null),this._subgraphG.attr("transform",null),this._vertexG.attr("transform",null)),this._prevTransformScale===this._transformScale&&this._prevWidth===n&&this._prevHeight===o||(this._prevTransformScale=this._transformScale,this._prevWidth=n,this._prevHeight=o,this.moveSubgraphs(!1).moveVertices(!1).moveEdges(!1))},n.prototype.centroids=function(){return this._graphData.allVertices().filter(function(e){return!!e.centroid})},n.prototype.selectionChanged=function(){var e=this;if(this.highlightSelectedPathToCentroid()){var t={};this.centroids().forEach(function(r){e.selection().forEach(function(n){var o=e._graphData.dijkstra(r.id,n.id),i=o.ids;o.len&&i.forEach(function(e){t[e]=!0})})}),this._edgeG.selectAll(".graphEdge")}},n.prototype.tooltipHTML=function(e){return e.props.tooltip},n.prototype.subgraph_click=function(e,t,r){},n.prototype.vertex_click=function(e,t,r){},n.prototype.vertex_dblclick=function(e,t,r){},n.prototype.vertex_mousein=function(e,t,r){},n.prototype.vertex_mouseover=function(e,t,r){},n.prototype.vertex_mouseout=function(e,t,r){},n.prototype.edge_click=function(e,t,r){},n.prototype.edge_mouseover=function(e,t){this.highlightEdge(e,t)},n.prototype.edge_mouseout=function(e,t){this.highlightEdge(null,null)},n.prototype.progress=function(e){},n}(t.SVGZoomWidget);ef.prototype._class+=" graph_Graph2",ef.prototype.publish("allowDragging",!0,"boolean","Allow Dragging of Vertices"),ef.prototype.publish("dragSingleNeighbors",!0,"boolean","Dragging a Vertex also moves its singleton neighbors"),ef.prototype.publish("layout","ForceDirectedHybrid","set","Default Layout",["Hierarchy","DOT","Tree","Dendrogram","RadialTree","RadialDendrogram","ForceDirected","ForceDirected2","ForceDirectedHybrid","Neato","FDP","Circle","TwoPI","Circo","None"]),ef.prototype.publish("scale","100%","set","Zoom Level",["all","width","selection","100%","90%","75%","50%","25%","10%"]),ef.prototype.publish("applyScaleOnLayout",!1,"boolean","Shrink to fit on Layout"),ef.prototype.publish("highlightOnMouseOverVertex",!0,"boolean","Highlight Vertex on Mouse Over"),ef.prototype.publish("highlightOnMouseOverEdge",!0,"boolean","Highlight Edge on Mouse Over"),ef.prototype.publish("transitionDuration",250,"number","Transition Duration"),ef.prototype.publish("showEdges",!0,"boolean","Show Edges"),ef.prototype.publish("showEdgeLabels",!0,"boolean","Show Edge labels"),ef.prototype.publish("showEdgeLabelsOnHighlight",!0,"boolean","Show Edge labels when highlighted"),ef.prototype.publish("showVertexLabels",!0,"boolean","Show Vertex labels"),ef.prototype.publish("showVertexLabelsOnHighlight",!0,"boolean","Show Vertex labels when highlighted"),ef.prototype.publish("snapToGrid",0,"number","Snap to Grid"),ef.prototype.publish("selectionClearOnBackgroundClick",!1,"boolean","Clear selection on background click"),ef.prototype.publish("edgeArcDepth",8,"number","Edge Arc Depth"),ef.prototype.publish("edgeColor",null,"html-color","Edge line stroke color",null,{optional:!0}),ef.prototype.publish("edgeStrokeWidth",1,"number","Edge line stroke width (pixels)"),ef.prototype.publish("minScale",.6,"number","Min scale size for text"),ef.prototype.publish("maxScale",1,"number","Max scale size for text"),ef.prototype.publish("tooltipWidth",256,"number","Tooltip width (pixels)"),ef.prototype.publish("tooltipHeight",128,"number","Tooltip width (pixels)"),ef.prototype.publish("enableTooltipPointerEvents",!1,"boolean","If true, tooltip will use the style: 'pointer-events: all'"),ef.prototype.publish("tooltipCloseDelay",0,"number","Number of milliseconds to wait before closing tooltip (cancelled on tooltip mouseover event)"),ef.prototype.publish("doubleClickMaxDelay",300,"number","Number of milliseconds to wait before a subsequent click is not considered a double click"),ef.prototype.publish("centroidColor","#00A000","html-color","Centroid Glow Color"),ef.prototype.publish("centroidScale",1,"number","Centroid Scale"),ef.prototype.publish("centroidTextHeight",12,"number","Centroid Text Height"),ef.prototype.publish("centroidTextPadding",4,"number","Centroid Text Padding"),ef.prototype.publish("centroidIconHeight",50,"number","Centroid Icon Height"),ef.prototype.publish("centroidIconPadding",10,"number","Centroid Icon Padding"),ef.prototype.publish("centroidIconStrokeWidth",4,"number","Centroid Icon Stroke Width"),ef.prototype.publish("centroidIconFontFamily","FontAwesome","string","Centroid Icon Font Family"),ef.prototype.publish("centroidLabelFontFamily","FontAwesome","string","Centroid Label Font Family"),ef.prototype.publish("vertexTextHeight",10,"number","Vertex Text Height"),ef.prototype.publish("vertexTextPadding",4,"number","Vertex Text Padding"),ef.prototype.publish("vertexIconHeight",50,"number","Vertex Icon Height"),ef.prototype.publish("vertexIconPadding",10,"number","Vertex Icon Padding"),ef.prototype.publish("vertexIconStrokeWidth",0,"number","Vertex Icon Stroke Width"),ef.prototype.publish("vertexIconFontFamily","FontAwesome","string","Vertex Icon Font Family"),ef.prototype.publish("vertexLabelFontFamily","FontAwesome","string","Vertex Label Font Family"),ef.prototype.publish("highlightSelectedPathToCentroid",!0,"boolean","Highlight path to Center Vertex (for selected vertices)"),ef.prototype.publish("hierarchyRankDirection","TB","set","Direction for Rank Nodes",["TB","BT","LR","RL"],{disable:function(e){return"Hierarchy"!==e.layout()}}),ef.prototype.publish("hierarchyNodeSeparation",50,"number","Number of pixels that separate nodes horizontally in the layout",null,{disable:function(e){return"Hierarchy"!==e.layout()}}),ef.prototype.publish("hierarchyEdgeSeparation",10,"number","Number of pixels that separate edges horizontally in the layout",null,{disable:function(e){return"Hierarchy"!==e.layout()}}),ef.prototype.publish("hierarchyRankSeparation",50,"number","Number of pixels between each rank in the layout",null,{disable:function(e){return"Hierarchy"!==e.layout()}}),ef.prototype.publish("hierarchyDigraph",!0,"boolean","Directional Graph2",null,{disable:function(e){return"Hierarchy"!==e.layout()}}),ef.prototype.publish("forceDirectedAlpha",1,"number","Alpha",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),ef.prototype.publish("forceDirectedAlphaMin",.001,"number","Min Alpha",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),ef.prototype.publish("forceDirectedAlphaDecay",.0228,"number","Defaults to 1 - pow(alphaMin, 1 / 300)",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),ef.prototype.publish("forceDirectedRepulsionStrength",-350,"number","Charge strength ",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),ef.prototype.publish("forceDirectedVelocityDecay",.4,"number","Velocity Decay ",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),ef.prototype.publish("forceDirectedIterations",300,"number","Iterations",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),ef.prototype.publish("forceDirectedLinkDistance",300,"number","Target distance between linked nodes",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),ef.prototype.publish("forceDirectedLinkStrength",1,"number","Strength (rigidity) of links",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),ef.prototype.publish("forceDirectedPinCentroid",!1,"boolean","Pin centroid to center",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),ef.prototype.publish("forceDirectedForceStrength",0,"number","Strength of center force",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),ef.prototype.publish("forceDirectedMinDistance",1,"number","Min distance between nodes",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),ef.prototype.publish("forceDirectedMaxDistance",1/0,"number","Max distance between nodes",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),ef.prototype.publish("treeRankDirection","LR","set","Direction for Rank Nodes",["TB","LR"],{disable:function(e){return"Tree"!==e.layout()&&"Dendrogram"!==e.layout()}}),ef.prototype.publish("wasmFolder",null,"string","WASM Folder",null,{optional:!0,disable:function(e){return["DOT","Neato","FDP","TwoPI","Circo"].indexOf(e.layout())<0}});var tf=ef.prototype.scale;function rf(e,t){var r={};return t.forEach(function(t,n){return r[t]=e[n]}),r}ef.prototype.scale=function(e,t){var r=tf.apply(this,arguments);return arguments.length&&this.zoomTo(e,t),r};var nf=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return s(r,e),r.prototype.owner=function(e){return arguments.length?(this._owner=e,this):this._owner},r.prototype.valid=function(){return!!this.columnID()},c([t.publish("","set","Annotation column (boolean)",function(){return this._owner.vertexColumns()}),l("design:type",Function)],r.prototype,"columnID",void 0),c([t.publish("","string","Annotation ID"),l("design:type",Function)],r.prototype,"annotationID",void 0),r}(t.PropertyExt);nf.prototype._class+=" graph_AnnotationColumn";var of=function(e){function n(){var t=e.call(this)||this;return t._prevSubgraphs=[],t._masterSubgraphs=[],t._masterSubgraphsMap={},t._prevVertices=[],t._masterVertices=[],t._masterVerticesMap={},t._prevEdges=[],t._masterEdges=[],t._masterEdgesMap={},t._prevHierarchy=[],t._masterHierarchy=[],t._masterHierarchyMap={},t.vertexRenderer(o.Vertex3).centroidRenderer(o.CentroidVertex3).edgeColor("#287EC4").edgeStrokeWidth(2).edgeArcDepth(0),t}return s(n,e),n.prototype.clear=function(){this._prevSubgraphs=[],this._masterSubgraphs=[],this._masterSubgraphsMap={},this._prevVertices=[],this._masterVertices=[],this._masterVerticesMap={},this._prevEdges=[],this._masterEdges=[],this._prevHierarchy=[],this._masterHierarchy=[],this._masterHierarchyMap={},this._graphData.clear(),this.resetLayout()},n.prototype.indexOf=function(e,t,r){void 0===r&&(r="");var n=e.indexOf(t);return n>=0?n:e.indexOf(r)},n.prototype.mergeSubgraphs=function(){var e=this,t=this.subgraphColumns(),n=this.indexOf(t,this.subgraphIDColumn(),"id"),o=this.indexOf(t,this.subgraphLabelColumn(),"label"),i=this.subgraphs().map(function(e){return{id:""+e[n],text:""+e[o],origData:rf(e,t)}}),a=r.compare2(this._prevSubgraphs,i,function(e){return e.id});a.exit.forEach(function(t){e._masterSubgraphs=e._masterSubgraphs.filter(function(e){return e.id!==t.id}),delete e._masterSubgraphsMap[t.id]}),a.enter.forEach(function(t){e._masterSubgraphs.push(t),e._masterSubgraphsMap[t.id]=t}),a.update.forEach(function(t){e._masterSubgraphsMap[t.id].origData=t.origData}),this._prevSubgraphs=i},n.prototype.mergeVertices=function(){var e=this,t=this.vertexColumns(),n=this.vertexAnnotationColumns(),o=this.indexOf(t,this.vertexCategoryColumn(),"category"),i=this.indexOf(t,this.vertexIDColumn(),"id"),a=this.indexOf(t,this.vertexLabelColumn(),"label"),s=this.indexOf(t,this.vertexCentroidColumn(),"centroid"),u=this.indexOf(t,this.vertexFACharColumn(),"faChar"),c=this.indexOf(t,this.vertexTooltipColumn(),"tooltip"),l=n.map(function(r){return e.indexOf(t,r.columnID(),"")}),h=this.vertices().map(function(r){return{categoryID:""+r[o],id:""+r[i],text:""+r[a],tooltip:""+r[c],origData:rf(r,t),centroid:!!r[s],icon:{imageChar:""+(r[u]||e.vertexFAChar())},annotationIDs:l.map(function(e,t){return r[e]?n[t].annotationID():void 0}).filter(function(e){return!!e})}}),f=r.compare2(this._prevVertices,h,function(e){return e.id});f.exit.forEach(function(t){e._masterVertices=e._masterVertices.filter(function(e){return e.id!==t.id}),delete e._masterVerticesMap[t.id]}),f.enter.forEach(function(t){e._masterVertices.push(t),e._masterVerticesMap[t.id]=t}),f.update.forEach(function(t){e._masterVerticesMap[t.id].origData=t.origData}),this._prevVertices=h},n.prototype.mergeEdges=function(){var e=this,t=this.edgeColumns(),n=this.indexOf(t,this.edgeIDColumn(),"id"),o=this.indexOf(t,this.edgeSourceColumn(),"source"),i=this.indexOf(t,this.edgeTargetColumn(),"target"),a=this.indexOf(t,this.edgeLabelColumn(),"label"),s=this.indexOf(t,this.edgeWeightColumn(),"weight"),u=this.indexOf(t,this.edgeColorColumn(),"color"),c=this.edges().map(function(r){var c=e._masterVerticesMap[""+r[o]];c||console.error('Invalid edge source entity "'+r[o]+'" does not exist.');var l=e._masterVerticesMap[""+r[i]];return l||console.error('Invalid edge target entity "'+r[i]+'" does not exist.'),{type:"edge",id:n>=0?""+r[n]:r[o]+"->"+r[i],source:c,target:l,weight:+r[s]||1,color:r[u],label:a>=0?""+r[a]:"",origData:rf(r,t)}}).filter(function(e){return e.source&&e.target}),l=r.compare2(this._masterEdges,c,function(e){return e.id});l.exit.forEach(function(t){e._masterEdges=e._masterEdges.filter(function(e){return e.id!==t.id}),delete e._masterEdgesMap[t.id]}),l.enter.forEach(function(t){e._masterEdges.push(t),e._masterEdgesMap[t.id]=t}),l.update.forEach(function(t){e._masterEdgesMap[t.id].origData=t.origData}),this._prevEdges=c},n.prototype.mergeHierarchy=function(){var e=this,t=this.hierarchyColumns(),n=this.indexOf(t,this.hierarchyParentIDColumn(),"parentID"),o=this.indexOf(t,this.hierarchyChildIDColumn(),"childID"),i=this.hierarchy().map(function(t){return{id:t[n]+"=>"+t[o],parent:e._masterSubgraphsMap[""+t[n]],child:e._masterSubgraphsMap[""+t[o]]||e._masterVerticesMap[""+t[o]]}}),a=r.compare2(this._prevHierarchy,i,function(e){return e.id});a.exit.forEach(function(t){e._masterHierarchy=e._masterHierarchy.filter(function(e){return e.id!==t.id}),delete e._masterHierarchyMap[t.id]}),a.enter.forEach(function(t){e._masterHierarchy.push(t),e._masterHierarchyMap[t.id]=t}),this._prevHierarchy=i},n.prototype.update=function(t,r){this.mergeSubgraphs(),this.mergeVertices(),this.mergeEdges(),this.mergeHierarchy(),this.data({subgraphs:this._masterSubgraphs,vertices:this._masterVertices,edges:this._masterEdges,hierarchy:this._masterHierarchy}),e.prototype.update.call(this,t,r)},n.prototype.render=function(t){return e.prototype.render.call(this,function(e){t&&t(e)}),this},c([t.publish([],"any","Subgraph Columns",null,{internal:!0}),l("design:type",Function)],n.prototype,"subgraphColumns",void 0),c([t.publish([],"any","Subgraphs",null,{internal:!0}),l("design:type",Function)],n.prototype,"subgraphs",void 0),c([t.publish("","string","Subgraph ID column"),l("design:type",Function)],n.prototype,"subgraphIDColumn",void 0),c([t.publish("","string","Subgraph Label column"),l("design:type",Function)],n.prototype,"subgraphLabelColumn",void 0),c([t.publish([],"any","Vertex Columns",null,{internal:!0}),l("design:type",Function)],n.prototype,"vertexColumns",void 0),c([t.publish([],"any","Vertices (Nodes)",null,{internal:!0}),l("design:type",Function)],n.prototype,"vertices",void 0),c([t.publish("","set","Vertex Category ID column",function(){return this.vertexColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"vertexCategoryColumn",void 0),c([t.publish("","set","Vertex ID column",function(){return this.vertexColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"vertexIDColumn",void 0),c([t.publish("","set","Vertex label column",function(){return this.vertexColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"vertexLabelColumn",void 0),c([t.publish("","set","Vertex centroid column (boolean)",function(){return this.vertexColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"vertexCentroidColumn",void 0),c([t.publish("?","string","Vertex default FAChar"),l("design:type",Function)],n.prototype,"vertexFAChar",void 0),c([t.publish("","set","Vertex FAChar column",function(){return this.vertexColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"vertexFACharColumn",void 0),c([t.publish("","set","Vertex tooltip column",function(){return this.vertexColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"vertexTooltipColumn",void 0),c([t.publish([],"propertyArray","Annotations",null,{autoExpand:nf}),l("design:type",Function)],n.prototype,"vertexAnnotationColumns",void 0),c([t.publish([],"any","Edge columns",null,{internal:!0}),l("design:type",Function)],n.prototype,"edgeColumns",void 0),c([t.publish([],"any","Edges (Edges)",null,{internal:!0}),l("design:type",Function)],n.prototype,"edges",void 0),c([t.publish("","set","Edge ID column",function(){return this.edgeColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"edgeIDColumn",void 0),c([t.publish("","set","Edge label column",function(){return this.edgeColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"edgeLabelColumn",void 0),c([t.publish("","set","Edge source ID column",function(){return this.edgeColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"edgeSourceColumn",void 0),c([t.publish("","set","Edge target ID column",function(){return this.edgeColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"edgeTargetColumn",void 0),c([t.publish("","set","Edge weight column",function(){return this.edgeColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"edgeWeightColumn",void 0),c([t.publish("","set","Edge color column",function(){return this.edgeColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"edgeColorColumn",void 0),c([t.publish([],"any","Subgraph Columns"),l("design:type",Function)],n.prototype,"hierarchyColumns",void 0),c([t.publish([],"any","Subgraphs"),l("design:type",Function)],n.prototype,"hierarchy",void 0),c([t.publish("","string","Subgraph ID column"),l("design:type",Function)],n.prototype,"hierarchyParentIDColumn",void 0),c([t.publish("","string","Subgraph Label column"),l("design:type",Function)],n.prototype,"hierarchyChildIDColumn",void 0),n}(ef);of.prototype._class+=" graph_DataGraph";L(".graph_SankeyGraph .node rect{cursor:move;fill-opacity:.9;shape-rendering:crispEdges;stroke:#a9a9a9}.graph_SankeyGraph .node.selected rect{stroke:red}.graph_SankeyGraph .node.over rect{stroke:orange}.graph_SankeyGraph .node.selected.over rect{stroke:red}.graph_SankeyGraph .node text{pointer-events:none;text-shadow:0 1px 0 #fff}.graph_SankeyGraph .node.selected text{fill:red}.graph_SankeyGraph .node.over text{fill:orange}.graph_SankeyGraph .node.selected.over text{fill:red}.graph_SankeyGraph .link{fill:none;stroke:#000;stroke-opacity:.2}.graph_SankeyGraph .link:hover{stroke-opacity:.5}");var af=function(e){function n(){var r=e.call(this)||this;return r._prevVertices=[],r._masterVertices=[],r._masterVerticesMap={},r._prevEdges=[],r._masterEdges=[],t.Utility.SimpleSelectionMixin.call(r),r._drawStartPos="origin",r}return s(n,e),n.prototype.mergeVertices=function(){var e=this,t=this.vertexColumns(),n=this.vertexAnnotationColumns(),o=this.indexOf(t,this.vertexCategoryColumn(),"category"),i=this.indexOf(t,this.vertexIDColumn(),"id"),a=this.indexOf(t,this.vertexLabelColumn(),"label"),s=this.indexOf(t,this.vertexCentroidColumn(),"centroid"),u=this.indexOf(t,this.vertexFACharColumn(),"faChar"),c=this.indexOf(t,this.vertexTooltipColumn(),"tooltip"),l=n.map(function(r){return e.indexOf(t,r.columnID(),"")}),h=this.vertices().map(function(r){return{categoryID:""+r[o],id:""+r[i],text:""+r[a],tooltip:""+r[c],origData:rf(r,t),centroid:!!r[s],icon:{imageChar:""+(r[u]||e.vertexFAChar())},annotationIDs:l.map(function(e,t){return r[e]?n[t].annotationID():void 0}).filter(function(e){return!!e})}}),f=r.compare2(this._prevVertices,h,function(e){return e.id});f.exit.forEach(function(t){e._masterVertices=e._masterVertices.filter(function(e){return e.id!==t.id})}),f.enter.forEach(function(t){e._masterVertices.push(t),e._masterVerticesMap[t.id]=t}),this._prevVertices=h},n.prototype.indexOf=function(e,t,r){void 0===r&&(r="");var n=e.indexOf(t);return n>=0?n:e.indexOf(r)},n.prototype.mergeEdges=function(){var e=this,t=this.edgeColumns(),n=this.indexOf(t,this.edgeIDColumn(),"id"),o=this.indexOf(t,this.edgeSourceColumn(),"source"),i=this.indexOf(t,this.edgeTargetColumn(),"target"),a=this.indexOf(t,this.edgeLabelColumn(),"label"),s=this.indexOf(t,this.edgeWeightColumn(),"weight"),u=this.edges().map(function(r){var u=e._masterVerticesMap[""+r[o]];u||console.error('Invalid edge source entity "'+r[o]+'" does not exist.');var c=e._masterVerticesMap[""+r[i]];return c||console.error('Invalid edge target entity "'+r[i]+'" does not exist.'),{type:"edge",id:n>=0?""+r[n]:r[o]+"->"+r[i],source:u,target:c,value:+r[s]||0,label:a>=0?""+r[a]:"",origData:rf(r,t)}}).filter(function(e){return e.source&&e.target}),c=r.compare2(this._masterEdges,u,function(e){return e.id});c.exit.forEach(function(t){e._masterEdges=e._masterEdges.filter(function(e){return e.id!==t.id})}),c.enter.forEach(function(t){e._masterEdges.push(t)}),this._prevEdges=u},n.prototype.sankeyData=function(){return this.mergeVertices(),this.mergeEdges(),{vertices:this._masterVertices,edges:this._masterEdges}},n.prototype.enter=function(t,r){e.prototype.enter.call(this,t,r),this._d3Sankey=nh(),this._selection.widgetElement(r)},n.prototype.update=function(r,n){e.prototype.update.call(this,r,n),this._palette=this._palette.switch(this.paletteID());var o=this.vertexStrokeWidth(),i=this.sankeyData();this._d3Sankey.nodeId(function(e){return e.id}).extent([[0,0],[this.width(),this.height()]]),i.vertices.length>0&&this._d3Sankey({nodes:i.vertices,links:i.edges});var a=this,s=n.selectAll(".link").data(i.edges);s.enter().append("path").attr("class","link").each(function(){t.select(this).append("title")}).merge(s).attr("d",ah()).style("stroke-width",function(e){return Math.max(1,e.width)}).select("title").text(function(e){return e.source.text+" → "+e.target.text+"\n"+e.value}),s.exit().remove();var u=n.selectAll(".node").data(i.vertices);u.enter().append("g").attr("class","node").call(this._selection.enter.bind(this._selection)).on("click",function(e){a.click(e.origData,"",a._selection.selected(this))}).on("dblclick",function(e){a.dblclick(e.origData,"",a._selection.selected(this))}).each(function(){var e=t.select(this);e.append("rect"),e.append("text")}).merge(u).attr("transform",function(e){var t=0,r=0;return e.x0&&(t=e.x0),e.y0&&(r=e.y0),"translate("+(t+o)+","+(r+o)+")"}).each(function(){var e=t.select(this);e.select("rect").attr("height",function(e){return e.y1-e.y0}).attr("width",function(e){return e.x1-e.x0}).style("fill",function(e){return a._palette(e.categoryID)}).style("stroke",function(e){return a.vertexStrokeColor()}).style("stroke-width",function(e){return o}).style("cursor",a.xAxisMovement()||a.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.text}).filter(function(e){return e.x0<a.width()/2}).attr("x",6+a._d3Sankey.nodeWidth()).attr("text-anchor","start")}),u.exit().remove()},n.prototype.exit=function(t,r){e.prototype.exit.call(this,t,r)},n.prototype.click=function(e,t,r){console.log("Click: "+JSON.stringify(e)+", "+t+","+r)},n.prototype.dblclick=function(e,t,r){console.log("Double Click: "+JSON.stringify(e)+", "+t+","+r)},c([t.publish([],"any","Vertex Columns",null,{internal:!0}),l("design:type",Function)],n.prototype,"vertexColumns",void 0),c([t.publish([],"any","Vertices (Nodes)",null,{internal:!0}),l("design:type",Function)],n.prototype,"vertices",void 0),c([t.publish("","set","Vertex Category ID column",function(){return this.vertexColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"vertexCategoryColumn",void 0),c([t.publish("","set","Vertex ID column",function(){return this.vertexColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"vertexIDColumn",void 0),c([t.publish("","set","Vertex label column",function(){return this.vertexColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"vertexLabelColumn",void 0),c([t.publish("","set","Vertex centroid column (boolean)",function(){return this.vertexColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"vertexCentroidColumn",void 0),c([t.publish("?","string","Vertex default FAChar"),l("design:type",Function)],n.prototype,"vertexFAChar",void 0),c([t.publish("","set","Vertex FAChar column",function(){return this.vertexColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"vertexFACharColumn",void 0),c([t.publish("","set","Vertex tooltip column",function(){return this.vertexColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"vertexTooltipColumn",void 0),c([t.publish([],"propertyArray","Annotations",null,{autoExpand:nf}),l("design:type",Function)],n.prototype,"vertexAnnotationColumns",void 0),c([t.publish([],"any","Edge columns",null,{internal:!0}),l("design:type",Function)],n.prototype,"edgeColumns",void 0),c([t.publish([],"any","Edges (Edges)",null,{internal:!0}),l("design:type",Function)],n.prototype,"edges",void 0),c([t.publish("","set","Edge ID column",function(){return this.edgeColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"edgeIDColumn",void 0),c([t.publish("","set","Edge label column",function(){return this.edgeColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"edgeLabelColumn",void 0),c([t.publish("","set","Edge source ID column",function(){return this.edgeColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"edgeSourceColumn",void 0),c([t.publish("","set","Edge target ID column",function(){return this.edgeColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"edgeTargetColumn",void 0),c([t.publish("","set","Edge target ID column",function(){return this.edgeColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"edgeWeightColumn",void 0),n}(t.SVGWidget);af.prototype._class+=" graph_SankeyGraph",af.prototype.mixin(t.Utility.SimpleSelectionMixin),af.prototype._palette=t.Palette.ordinal("category10"),af.prototype.publish("paletteID","category10","set","Color palette for this widget",af.prototype._palette.switch()),af.prototype.publish("vertexStrokeWidth",1,"number","Vertex Stroke Width"),af.prototype.publish("vertexStrokeColor","darkgray","string","Vertex Stroke Color"),af.prototype.publish("vertexWidth",36,"number","Vertex Width"),af.prototype.publish("vertexPadding",20,"number","Vertex Padding"),af.prototype.publish("xAxisMovement",!1,"boolean","Enable x-axis movement"),af.prototype.publish("yAxisMovement",!1,"boolean","Enable y-axis movement"),e.AdjacencyGraph=Ul,e.Annotation=Hl,e.AnnotationColumn=nf,e.BUILD_VERSION="2.95.0",e.DataGraph=of,e.Edge=R,e.Graph=Vl,e.Graph2=ef,e.PKG_NAME="@hpcc-js/graph",e.PKG_VERSION="2.74.0",e.Sankey=ch,e.SankeyColumn=uh,e.SankeyGraph=af,e.Subgraph=Bl,e.Vertex=zl,e.graphviz=function(e,t,r){return void 0===t&&(t="dot"),void 0===r&&(r=Xh),xh({items:[],links:[],raw:e},{engine:t,wasmFolder:r})},e.toJsonObj=rf,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@hpcc-js/common"),require("@hpcc-js/util"),require("@hpcc-js/api"),require("@hpcc-js/react"),require("@hpcc-js/html")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/common","@hpcc-js/util","@hpcc-js/api","@hpcc-js/react","@hpcc-js/html"],t):t((e=e||self)["@hpcc-js/graph"]={},e["@hpcc-js/common"],e["@hpcc-js/util"],e["@hpcc-js/api"],e["@hpcc-js/react"],e["@hpcc-js/html"])}(this,function(e,t,r,n,o,i){"use strict";var a=function(e,t){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var u=function(){return(u=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function c(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}function l(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function h(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||t)}var f=Math.PI,d=2*f,p=d-1e-6;function g(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function v(){return new g}function y(e){return function(){return e}}g.prototype=v.prototype={constructor:g,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,r,n){this._+="Q"+ +e+","+ +t+","+(this._x1=+r)+","+(this._y1=+n)},bezierCurveTo:function(e,t,r,n,o,i){this._+="C"+ +e+","+ +t+","+ +r+","+ +n+","+(this._x1=+o)+","+(this._y1=+i)},arcTo:function(e,t,r,n,o){e=+e,t=+t,r=+r,n=+n,o=+o;var i=this._x1,a=this._y1,s=r-e,u=n-t,c=i-e,l=a-t,h=c*c+l*l;if(o<0)throw new Error("negative radius: "+o);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(h>1e-6)if(Math.abs(l*s-u*c)>1e-6&&o){var d=r-i,p=n-a,g=s*s+u*u,v=d*d+p*p,y=Math.sqrt(g),m=Math.sqrt(h),_=o*Math.tan((f-Math.acos((g+h-v)/(2*y*m)))/2),b=_/m,w=_/y;Math.abs(b-1)>1e-6&&(this._+="L"+(e+b*c)+","+(t+b*l)),this._+="A"+o+","+o+",0,0,"+ +(l*d>c*p)+","+(this._x1=e+w*s)+","+(this._y1=t+w*u)}else this._+="L"+(this._x1=e)+","+(this._y1=t);else;},arc:function(e,t,r,n,o,i){e=+e,t=+t,i=!!i;var a=(r=+r)*Math.cos(n),s=r*Math.sin(n),u=e+a,c=t+s,l=1^i,h=i?n-o:o-n;if(r<0)throw new Error("negative radius: "+r);null===this._x1?this._+="M"+u+","+c:(Math.abs(this._x1-u)>1e-6||Math.abs(this._y1-c)>1e-6)&&(this._+="L"+u+","+c),r&&(h<0&&(h=h%d+d),h>p?this._+="A"+r+","+r+",0,1,"+l+","+(e-a)+","+(t-s)+"A"+r+","+r+",0,1,"+l+","+(this._x1=u)+","+(this._y1=c):h>1e-6&&(this._+="A"+r+","+r+",0,"+ +(h>=f)+","+l+","+(this._x1=e+r*Math.cos(o))+","+(this._y1=t+r*Math.sin(o))))},rect:function(e,t,r,n){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}};var m=1e-12;function _(e){this._context=e}function b(e){return new _(e)}function w(e){return e[0]}function x(e){return e[1]}function E(){var e=w,t=x,r=y(!0),n=null,o=b,i=null;function a(a){var s,u,c,l=a.length,h=!1;for(null==n&&(i=o(c=v())),s=0;s<=l;++s)!(s<l&&r(u=a[s],s,a))===h&&((h=!h)?i.lineStart():i.lineEnd()),h&&i.point(+e(u,s,a),+t(u,s,a));if(c)return i=null,c+""||null}return a.x=function(t){return arguments.length?(e="function"==typeof t?t:y(+t),a):e},a.y=function(e){return arguments.length?(t="function"==typeof e?e:y(+e),a):t},a.defined=function(e){return arguments.length?(r="function"==typeof e?e:y(!!e),a):r},a.curve=function(e){return arguments.length?(o=e,null!=n&&(i=o(n)),a):o},a.context=function(e){return arguments.length?(null==e?n=i=null:i=o(n=e),a):n},a}_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point: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)}}};var k=Array.prototype.slice;function D(e){return e.source}function S(e){return e.target}function C(e,t,r,n,o){e.moveTo(t,r),e.bezierCurveTo(t=(t+n)/2,r,t,o,n,o)}function A(){return function(e){var t=D,r=S,n=w,o=x,i=null;function a(){var a,s=k.call(arguments),u=t.apply(this,s),c=r.apply(this,s);if(i||(i=a=v()),e(i,+n.apply(this,(s[0]=u,s)),+o.apply(this,s),+n.apply(this,(s[0]=c,s)),+o.apply(this,s)),a)return i=null,a+""||null}return a.source=function(e){return arguments.length?(t=e,a):t},a.target=function(e){return arguments.length?(r=e,a):r},a.x=function(e){return arguments.length?(n="function"==typeof e?e:y(+e),a):n},a.y=function(e){return arguments.length?(o="function"==typeof e?e:y(+e),a):o},a.context=function(e){return arguments.length?(i=null==e?null:e,a):i},a}(C)}function j(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 P(e){this._context=e}function F(e){return new P(e)}function M(e,t){this._basis=new P(e),this._beta=t}P.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:j(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},point: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:j(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},M.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var n,o=e[0],i=t[0],a=e[r]-o,s=t[r]-i,u=-1;++u<=r;)n=u/r,this._basis.point(this._beta*e[u]+(1-this._beta)*(o+n*a),this._beta*t[u]+(1-this._beta)*(i+n*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};(function e(t){function r(e){return 1===t?new P(e):new M(e,t)}return r.beta=function(t){return e(+t)},r})(.85);function O(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 N(e,t){this._context=e,this._k=(1-t)/6}N.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:O(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point: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:O(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}};var I=function e(t){function r(e){return new N(e,t)}return r.tension=function(t){return e(+t)},r}(0);function T(e,t){this._context=e,this._alpha=t}T.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(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;default:!function(e,t,r){var n=e._x1,o=e._y1,i=e._x2,a=e._y2;if(e._l01_a>m){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,u=3*e._l01_a*(e._l01_a+e._l12_a);n=(n*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/u,o=(o*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/u}if(e._l23_a>m){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,l=3*e._l23_a*(e._l23_a+e._l12_a);i=(i*c+e._x1*e._l23_2a-t*e._l12_2a)/l,a=(a*c+e._y1*e._l23_2a-r*e._l12_2a)/l}e._context.bezierCurveTo(n,o,i,a,e._x2,e._y2)}(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};(function e(t){function r(e){return t?new T(e,t):new N(e,0)}return r.alpha=function(t){return e(+t)},r})(.5);function L(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}L(".graph_Edge{fill:none;stroke:#656565;stroke-width:1px}.graph_Edge .common_TextBox .common_Text{fill:#000;stroke:none}.graph_Edge .common_TextBox .common_Shape{fill:#fff;stroke:none}.graph_Edge.selected{stroke:red!important}.graph_Edge.selected .common_Text{fill:red!important}");var Q=F,R=function(e){function r(){var r=e.call(this)||this;return r._points=[],r._weight=100,r._strokeDasharray=null,r._hidden=!1,r._textBox=(new t.TextBox).padding(0),r}return s(r,e),r.prototype.graphID=function(e){return arguments.length?(this._graphID=e,this):this._graphID},r.prototype.sourceVertex=function(e){return arguments.length?(this._sourceVertex=e,this):this._sourceVertex},r.prototype.targetVertex=function(e){return arguments.length?(this._targetVertex=e,this):this._targetVertex},r.prototype.weight=function(e){return arguments.length?(this._weight=e,this):this._weight},r.prototype.points=function(e,t,r){return arguments.length?(this._points=e,this._elementPath&&this.update(null,this._element,t,r),this):this._points},r.prototype.hidden=function(e){return arguments.length?(this._hidden=e,this):this._hidden},r.prototype.text=function(e){return arguments.length?(this._textBox.text(e),this):this._textBox.text()},r.prototype.enter=function(t,r){e.prototype.enter.call(this,t,r),this._elementPath=r.append("path"),this._textBox.text()&&this._textBox.target(t).tooltip(this.tooltip()).render()},r.prototype.update=function(r,n,o,i){e.prototype.update.call(this,r,n);var a=this;t.Platform.svgMarkerGlitch&&!i&&n.transition().duration((o||0)+100).on("start",function(){a._pushMarkers(n)}).on("end",function(){a._popMarkers(n)});var s=a._calculateEdgePoints(this._sourceVertex,this._targetVertex,this._points),u=n.selectAll(".point2").data(this.showControlPoints()?s:[]);u.enter().append("circle").attr("class","point2").style("stroke","red").merge(u).attr("cx",function(e){return e.x}).attr("cy",function(e){return e.y}).attr("r",1),u.exit().remove();var c=E().x(function(e){return e.x}).y(function(e){return e.y}).curve(Q)(s),l=this._elementPath;o&&(l=l.transition().duration(o)),l.attr("opacity",this._hidden?0:1).attr("marker-start",t.Platform.svgMarkerGlitch&&i||!this.sourceMarker_exists()?null:"url(#"+this._graphID+"_"+this.sourceMarker()+"Foot)").attr("marker-end",t.Platform.svgMarkerGlitch&&i||!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",c),this._textBox.text()&&this._textBox.tooltip(this.tooltip()).move(this._findMidPoint(s),o)},r.prototype.exit=function(t,r){this._textBox&&this._textBox.target(null),e.prototype.exit.call(this,t,r)},r.prototype._findMidPoint=function(e){var t=e.length/2;if(e.length%2)return e[Math.floor(t)];if(e.length){var 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}},r.prototype._calculateEdgePoints=function(e,t,r){if(!e||!t)return[{x:0,y:0},{x:0,y:0}];var n=r?r.filter(function(r){return!e.contains(r)&&!t.contains(r)}):[],o=0===n.length?t.pos():n[0],i=0===n.length?e.pos():n[n.length-1];if(n.unshift(e.intersection(e._pos,o)),n.push(t.intersection(t._pos,i)),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]){var a=n[0].x-n[1].x,s=n[0].y-n[1].y;if(Math.sqrt(a*a+s*s))if(this.showArc()){var u=(n[0].x+n[1].x)/2-s*this.arcDepth()/100,c=(n[0].y+n[1].y)/2+a*this.arcDepth()/100;n=[{x:n[0].x,y:n[0].y},{x:u,y:c},{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},r}(t.SVGWidget);R.prototype._class+=" graph_Edge",R.prototype.publish("arcDepth",16,"number","Arc Depth",null,{tags:["Basic"]}),R.prototype.publish("showControlPoints",!1,"boolean","Show/Hide Control Points",null,{tags:["Basic"]}),R.prototype.publish("showArc",!0,"boolean","Show/Hide Arc",null,{tags:["Basic"]}),R.prototype.publish("tooltip","","string","Tooltip",null,{tags:["Private"]}),R.prototype.publish("sourceMarker","circle","set","Source Marker",["none","circle"],{optional:!0}),R.prototype.publish("targetMarker","arrow","set","Source Marker",["none","arrow","circle"],{optional:!0}),R.prototype.publish("strokeDasharray",null,"string","Stroke Dash Array",null,{optional:!0}),R.prototype.publish("strokeColor",null,"html-color","Stroke Color",null,{optional:!0}),R.prototype.publish("textColor",null,"html-color","Text Color",null,{optional:!0}),R.prototype.publishProxy("text_shape_colorFill","_textBox","shape_colorFill"),R.prototype.publishProxy("text_shape_colorStroke","_textBox","shape_colorStroke"),R.prototype.publishProxy("text_text_colorFill","_textBox","text_colorFill");var B="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function z(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return V(null==t&&r.path)}},r.exports),r.exports}function V(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var G=function(){this.__data__=[],this.size=0};var H=function(e,t){return e===t||e!=e&&t!=t};var U=function(e,t){for(var r=e.length;r--;)if(H(e[r][0],t))return r;return-1},W=Array.prototype.splice;var q=function(e){var t=this.__data__,r=U(t,e);return!(r<0||(r==t.length-1?t.pop():W.call(t,r,1),--this.size,0))};var Y=function(e){var t=this.__data__,r=U(t,e);return r<0?void 0:t[r][1]};var $=function(e){return U(this.__data__,e)>-1};var X=function(e,t){var r=this.__data__,n=U(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};function J(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])}}J.prototype.clear=G,J.prototype.delete=q,J.prototype.get=Y,J.prototype.has=$,J.prototype.set=X;var K=J;var Z=function(){this.__data__=new K,this.size=0};var ee=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r};var te=function(e){return this.__data__.get(e)};var re=function(e){return this.__data__.has(e)},ne="object"==typeof B&&B&&B.Object===Object&&B,oe="object"==typeof self&&self&&self.Object===Object&&self,ie=ne||oe||Function("return this")(),ae=ie.Symbol,se=Object.prototype,ue=se.hasOwnProperty,ce=se.toString,le=ae?ae.toStringTag:void 0;var he=function(e){var t=ue.call(e,le),r=e[le];try{e[le]=void 0;var n=!0}catch(e){}var o=ce.call(e);return n&&(t?e[le]=r:delete e[le]),o},fe=Object.prototype.toString;var de=function(e){return fe.call(e)},pe="[object Null]",ge="[object Undefined]",ve=ae?ae.toStringTag:void 0;var ye=function(e){return null==e?void 0===e?ge:pe:ve&&ve in Object(e)?he(e):de(e)};var me=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},_e="[object AsyncFunction]",be="[object Function]",we="[object GeneratorFunction]",xe="[object Proxy]";var Ee,ke=function(e){if(!me(e))return!1;var t=ye(e);return t==be||t==we||t==_e||t==xe},De=ie["__core-js_shared__"],Se=(Ee=/[^.]+$/.exec(De&&De.keys&&De.keys.IE_PROTO||""))?"Symbol(src)_1."+Ee:"";var Ce=function(e){return!!Se&&Se in e},Ae=Function.prototype.toString;var je=function(e){if(null!=e){try{return Ae.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Pe=/^\[object .+?Constructor\]$/,Fe=Function.prototype,Me=Object.prototype,Oe=Fe.toString,Ne=Me.hasOwnProperty,Ie=RegExp("^"+Oe.call(Ne).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Te=function(e){return!(!me(e)||Ce(e))&&(ke(e)?Ie:Pe).test(je(e))};var Le=function(e,t){return null==e?void 0:e[t]};var Qe=function(e,t){var r=Le(e,t);return Te(r)?r:void 0},Re=Qe(ie,"Map"),Be=Qe(Object,"create");var ze=function(){this.__data__=Be?Be(null):{},this.size=0};var Ve=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ge="__lodash_hash_undefined__",He=Object.prototype.hasOwnProperty;var Ue=function(e){var t=this.__data__;if(Be){var r=t[e];return r===Ge?void 0:r}return He.call(t,e)?t[e]:void 0},We=Object.prototype.hasOwnProperty;var qe=function(e){var t=this.__data__;return Be?void 0!==t[e]:We.call(t,e)},Ye="__lodash_hash_undefined__";var $e=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Be&&void 0===t?Ye:t,this};function Xe(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])}}Xe.prototype.clear=ze,Xe.prototype.delete=Ve,Xe.prototype.get=Ue,Xe.prototype.has=qe,Xe.prototype.set=$e;var Je=Xe;var Ke=function(){this.size=0,this.__data__={hash:new Je,map:new(Re||K),string:new Je}};var Ze=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var et=function(e,t){var r=e.__data__;return Ze(t)?r["string"==typeof t?"string":"hash"]:r.map};var tt=function(e){var t=et(this,e).delete(e);return this.size-=t?1:0,t};var rt=function(e){return et(this,e).get(e)};var nt=function(e){return et(this,e).has(e)};var ot=function(e,t){var r=et(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};function it(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])}}it.prototype.clear=Ke,it.prototype.delete=tt,it.prototype.get=rt,it.prototype.has=nt,it.prototype.set=ot;var at=it,st=200;var ut=function(e,t){var r=this.__data__;if(r instanceof K){var n=r.__data__;if(!Re||n.length<st-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new at(n)}return r.set(e,t),this.size=r.size,this};function ct(e){var t=this.__data__=new K(e);this.size=t.size}ct.prototype.clear=Z,ct.prototype.delete=ee,ct.prototype.get=te,ct.prototype.has=re,ct.prototype.set=ut;var lt=ct;var ht=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e},ft=function(){try{var e=Qe(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var dt=function(e,t,r){"__proto__"==t&&ft?ft(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r},pt=Object.prototype.hasOwnProperty;var gt=function(e,t,r){var n=e[t];pt.call(e,t)&&H(n,r)&&(void 0!==r||t in e)||dt(e,t,r)};var vt=function(e,t,r,n){var o=!r;r||(r={});for(var i=-1,a=t.length;++i<a;){var s=t[i],u=n?n(r[s],e[s],s,r,e):void 0;void 0===u&&(u=e[s]),o?dt(r,s,u):gt(r,s,u)}return r};var yt=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n};var mt=function(e){return null!=e&&"object"==typeof e},_t="[object Arguments]";var bt=function(e){return mt(e)&&ye(e)==_t},wt=Object.prototype,xt=wt.hasOwnProperty,Et=wt.propertyIsEnumerable,kt=bt(function(){return arguments}())?bt:function(e){return mt(e)&&xt.call(e,"callee")&&!Et.call(e,"callee")},Dt=Array.isArray;var St=function(){return!1},Ct=z(function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r?ie.Buffer:void 0,i=(o?o.isBuffer:void 0)||St;e.exports=i}),At=9007199254740991,jt=/^(?:0|[1-9]\d*)$/;var Pt=function(e,t){var r=typeof e;return!!(t=null==t?At:t)&&("number"==r||"symbol"!=r&&jt.test(e))&&e>-1&&e%1==0&&e<t},Ft=9007199254740991;var Mt=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=Ft},Ot={};Ot["[object Float32Array]"]=Ot["[object Float64Array]"]=Ot["[object Int8Array]"]=Ot["[object Int16Array]"]=Ot["[object Int32Array]"]=Ot["[object Uint8Array]"]=Ot["[object Uint8ClampedArray]"]=Ot["[object Uint16Array]"]=Ot["[object Uint32Array]"]=!0,Ot["[object Arguments]"]=Ot["[object Array]"]=Ot["[object ArrayBuffer]"]=Ot["[object Boolean]"]=Ot["[object DataView]"]=Ot["[object Date]"]=Ot["[object Error]"]=Ot["[object Function]"]=Ot["[object Map]"]=Ot["[object Number]"]=Ot["[object Object]"]=Ot["[object RegExp]"]=Ot["[object Set]"]=Ot["[object String]"]=Ot["[object WeakMap]"]=!1;var Nt=function(e){return mt(e)&&Mt(e.length)&&!!Ot[ye(e)]};var It=function(e){return function(t){return e(t)}},Tt=z(function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r&&ne.process,i=function(){try{var e=n&&n.require&&n.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=i}),Lt=Tt&&Tt.isTypedArray,Qt=Lt?It(Lt):Nt,Rt=Object.prototype.hasOwnProperty;var Bt=function(e,t){var r=Dt(e),n=!r&&kt(e),o=!r&&!n&&Ct(e),i=!r&&!n&&!o&&Qt(e),a=r||n||o||i,s=a?yt(e.length,String):[],u=s.length;for(var c in e)!t&&!Rt.call(e,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Pt(c,u))||s.push(c);return s},zt=Object.prototype;var Vt=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||zt)};var Gt=function(e,t){return function(r){return e(t(r))}},Ht=Gt(Object.keys,Object),Ut=Object.prototype.hasOwnProperty;var Wt=function(e){if(!Vt(e))return Ht(e);var t=[];for(var r in Object(e))Ut.call(e,r)&&"constructor"!=r&&t.push(r);return t};var qt=function(e){return null!=e&&Mt(e.length)&&!ke(e)};var Yt=function(e){return qt(e)?Bt(e):Wt(e)};var $t=function(e,t){return e&&vt(t,Yt(t),e)};var Xt=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t},Jt=Object.prototype.hasOwnProperty;var Kt=function(e){if(!me(e))return Xt(e);var t=Vt(e),r=[];for(var n in e)("constructor"!=n||!t&&Jt.call(e,n))&&r.push(n);return r};var Zt=function(e){return qt(e)?Bt(e,!0):Kt(e)};var er=function(e,t){return e&&vt(t,Zt(t),e)},tr=z(function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r?ie.Buffer:void 0,i=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=i?i(r):new e.constructor(r);return e.copy(n),n}});var rr=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t};var nr=function(e,t){for(var r=-1,n=null==e?0:e.length,o=0,i=[];++r<n;){var a=e[r];t(a,r,e)&&(i[o++]=a)}return i};var or=function(){return[]},ir=Object.prototype.propertyIsEnumerable,ar=Object.getOwnPropertySymbols,sr=ar?function(e){return null==e?[]:(e=Object(e),nr(ar(e),function(t){return ir.call(e,t)}))}:or;var ur=function(e,t){return vt(e,sr(e),t)};var cr=function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e},lr=Gt(Object.getPrototypeOf,Object),hr=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)cr(t,sr(e)),e=lr(e);return t}:or;var fr=function(e,t){return vt(e,hr(e),t)};var dr=function(e,t,r){var n=t(e);return Dt(e)?n:cr(n,r(e))};var pr=function(e){return dr(e,Yt,sr)};var gr=function(e){return dr(e,Zt,hr)},vr=Qe(ie,"DataView"),yr=Qe(ie,"Promise"),mr=Qe(ie,"Set"),_r=Qe(ie,"WeakMap"),br=je(vr),wr=je(Re),xr=je(yr),Er=je(mr),kr=je(_r),Dr=ye;(vr&&"[object DataView]"!=Dr(new vr(new ArrayBuffer(1)))||Re&&"[object Map]"!=Dr(new Re)||yr&&"[object Promise]"!=Dr(yr.resolve())||mr&&"[object Set]"!=Dr(new mr)||_r&&"[object WeakMap]"!=Dr(new _r))&&(Dr=function(e){var t=ye(e),r="[object Object]"==t?e.constructor:void 0,n=r?je(r):"";if(n)switch(n){case br:return"[object DataView]";case wr:return"[object Map]";case xr:return"[object Promise]";case Er:return"[object Set]";case kr:return"[object WeakMap]"}return t});var Sr=Dr,Cr=Object.prototype.hasOwnProperty;var Ar=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&Cr.call(e,"index")&&(r.index=e.index,r.input=e.input),r},jr=ie.Uint8Array;var Pr=function(e){var t=new e.constructor(e.byteLength);return new jr(t).set(new jr(e)),t};var Fr=function(e,t){var r=t?Pr(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)},Mr=/\w*$/;var Or=function(e){var t=new e.constructor(e.source,Mr.exec(e));return t.lastIndex=e.lastIndex,t},Nr=ae?ae.prototype:void 0,Ir=Nr?Nr.valueOf:void 0;var Tr=function(e){return Ir?Object(Ir.call(e)):{}};var Lr=function(e,t){var r=t?Pr(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)},Qr="[object Boolean]",Rr="[object Date]",Br="[object Map]",zr="[object Number]",Vr="[object RegExp]",Gr="[object Set]",Hr="[object String]",Ur="[object Symbol]",Wr="[object ArrayBuffer]",qr="[object DataView]",Yr="[object Float32Array]",$r="[object Float64Array]",Xr="[object Int8Array]",Jr="[object Int16Array]",Kr="[object Int32Array]",Zr="[object Uint8Array]",en="[object Uint8ClampedArray]",tn="[object Uint16Array]",rn="[object Uint32Array]";var nn=function(e,t,r){var n=e.constructor;switch(t){case Wr:return Pr(e);case Qr:case Rr:return new n(+e);case qr:return Fr(e,r);case Yr:case $r:case Xr:case Jr:case Kr:case Zr:case en:case tn:case rn:return Lr(e,r);case Br:return new n;case zr:case Hr:return new n(e);case Vr:return Or(e);case Gr:return new n;case Ur:return Tr(e)}},on=Object.create,an=function(){function e(){}return function(t){if(!me(t))return{};if(on)return on(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();var sn=function(e){return"function"!=typeof e.constructor||Vt(e)?{}:an(lr(e))},un="[object Map]";var cn=function(e){return mt(e)&&Sr(e)==un},ln=Tt&&Tt.isMap,hn=ln?It(ln):cn,fn="[object Set]";var dn=function(e){return mt(e)&&Sr(e)==fn},pn=Tt&&Tt.isSet,gn=pn?It(pn):dn,vn=1,yn=2,mn=4,_n="[object Arguments]",bn="[object Function]",wn="[object GeneratorFunction]",xn="[object Object]",En={};En[_n]=En["[object Array]"]=En["[object ArrayBuffer]"]=En["[object DataView]"]=En["[object Boolean]"]=En["[object Date]"]=En["[object Float32Array]"]=En["[object Float64Array]"]=En["[object Int8Array]"]=En["[object Int16Array]"]=En["[object Int32Array]"]=En["[object Map]"]=En["[object Number]"]=En[xn]=En["[object RegExp]"]=En["[object Set]"]=En["[object String]"]=En["[object Symbol]"]=En["[object Uint8Array]"]=En["[object Uint8ClampedArray]"]=En["[object Uint16Array]"]=En["[object Uint32Array]"]=!0,En["[object Error]"]=En[bn]=En["[object WeakMap]"]=!1;var kn=function e(t,r,n,o,i,a){var s,u=r&vn,c=r&yn,l=r&mn;if(n&&(s=i?n(t,o,i,a):n(t)),void 0!==s)return s;if(!me(t))return t;var h=Dt(t);if(h){if(s=Ar(t),!u)return rr(t,s)}else{var f=Sr(t),d=f==bn||f==wn;if(Ct(t))return tr(t,u);if(f==xn||f==_n||d&&!i){if(s=c||d?{}:sn(t),!u)return c?fr(t,er(s,t)):ur(t,$t(s,t))}else{if(!En[f])return i?t:{};s=nn(t,f,u)}}a||(a=new lt);var p=a.get(t);if(p)return p;a.set(t,s),gn(t)?t.forEach(function(o){s.add(e(o,r,n,o,t,a))}):hn(t)&&t.forEach(function(o,i){s.set(i,e(o,r,n,i,t,a))});var g=h?void 0:(l?c?gr:pr:c?Zt:Yt)(t);return ht(g||t,function(o,i){g&&(o=t[i=o]),gt(s,i,e(o,r,n,i,t,a))}),s},Dn=4;var Sn=function(e){return kn(e,Dn)};var Cn=function(e){return function(){return e}};var An=function(e){return function(t,r,n){for(var o=-1,i=Object(t),a=n(t),s=a.length;s--;){var u=a[e?s:++o];if(!1===r(i[u],u,i))break}return t}}();var jn=function(e,t){return e&&An(e,t,Yt)};var Pn=function(e,t){return function(r,n){if(null==r)return r;if(!qt(r))return e(r,n);for(var o=r.length,i=t?o:-1,a=Object(r);(t?i--:++i<o)&&!1!==n(a[i],i,a););return r}}(jn);var Fn=function(e){return e};var Mn=function(e){return"function"==typeof e?e:Fn};var On=function(e,t){return(Dt(e)?ht:Pn)(e,Mn(t))},Nn=On;var In=function(e,t){var r=[];return Pn(e,function(e,n,o){t(e,n,o)&&r.push(e)}),r},Tn="__lodash_hash_undefined__";var Ln=function(e){return this.__data__.set(e,Tn),this};var Qn=function(e){return this.__data__.has(e)};function Rn(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new at;++t<r;)this.add(e[t])}Rn.prototype.add=Rn.prototype.push=Ln,Rn.prototype.has=Qn;var Bn=Rn;var zn=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1};var Vn=function(e,t){return e.has(t)},Gn=1,Hn=2;var Un=function(e,t,r,n,o,i){var a=r&Gn,s=e.length,u=t.length;if(s!=u&&!(a&&u>s))return!1;var c=i.get(e),l=i.get(t);if(c&&l)return c==t&&l==e;var h=-1,f=!0,d=r&Hn?new Bn:void 0;for(i.set(e,t),i.set(t,e);++h<s;){var p=e[h],g=t[h];if(n)var v=a?n(g,p,h,t,e,i):n(p,g,h,e,t,i);if(void 0!==v){if(v)continue;f=!1;break}if(d){if(!zn(t,function(e,t){if(!Vn(d,t)&&(p===e||o(p,e,r,n,i)))return d.push(t)})){f=!1;break}}else if(p!==g&&!o(p,g,r,n,i)){f=!1;break}}return i.delete(e),i.delete(t),f};var Wn=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r};var qn=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r},Yn=1,$n=2,Xn="[object Boolean]",Jn="[object Date]",Kn="[object Error]",Zn="[object Map]",eo="[object Number]",to="[object RegExp]",ro="[object Set]",no="[object String]",oo="[object Symbol]",io="[object ArrayBuffer]",ao="[object DataView]",so=ae?ae.prototype:void 0,uo=so?so.valueOf:void 0;var co=function(e,t,r,n,o,i,a){switch(r){case ao:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case io:return!(e.byteLength!=t.byteLength||!i(new jr(e),new jr(t)));case Xn:case Jn:case eo:return H(+e,+t);case Kn:return e.name==t.name&&e.message==t.message;case to:case no:return e==t+"";case Zn:var s=Wn;case ro:var u=n&Yn;if(s||(s=qn),e.size!=t.size&&!u)return!1;var c=a.get(e);if(c)return c==t;n|=$n,a.set(e,t);var l=Un(s(e),s(t),n,o,i,a);return a.delete(e),l;case oo:if(uo)return uo.call(e)==uo.call(t)}return!1},lo=1,ho=Object.prototype.hasOwnProperty;var fo=function(e,t,r,n,o,i){var a=r&lo,s=pr(e),u=s.length;if(u!=pr(t).length&&!a)return!1;for(var c=u;c--;){var l=s[c];if(!(a?l in t:ho.call(t,l)))return!1}var h=i.get(e),f=i.get(t);if(h&&f)return h==t&&f==e;var d=!0;i.set(e,t),i.set(t,e);for(var p=a;++c<u;){var g=e[l=s[c]],v=t[l];if(n)var y=a?n(v,g,l,t,e,i):n(g,v,l,e,t,i);if(!(void 0===y?g===v||o(g,v,r,n,i):y)){d=!1;break}p||(p="constructor"==l)}if(d&&!p){var m=e.constructor,_=t.constructor;m!=_&&"constructor"in e&&"constructor"in t&&!("function"==typeof m&&m instanceof m&&"function"==typeof _&&_ instanceof _)&&(d=!1)}return i.delete(e),i.delete(t),d},po=1,go="[object Arguments]",vo="[object Array]",yo="[object Object]",mo=Object.prototype.hasOwnProperty;var _o=function(e,t,r,n,o,i){var a=Dt(e),s=Dt(t),u=a?vo:Sr(e),c=s?vo:Sr(t),l=(u=u==go?yo:u)==yo,h=(c=c==go?yo:c)==yo,f=u==c;if(f&&Ct(e)){if(!Ct(t))return!1;a=!0,l=!1}if(f&&!l)return i||(i=new lt),a||Qt(e)?Un(e,t,r,n,o,i):co(e,t,u,r,n,o,i);if(!(r&po)){var d=l&&mo.call(e,"__wrapped__"),p=h&&mo.call(t,"__wrapped__");if(d||p){var g=d?e.value():e,v=p?t.value():t;return i||(i=new lt),o(g,v,r,n,i)}}return!!f&&(i||(i=new lt),fo(e,t,r,n,o,i))};var bo=function e(t,r,n,o,i){return t===r||(null==t||null==r||!mt(t)&&!mt(r)?t!=t&&r!=r:_o(t,r,n,o,e,i))},wo=1,xo=2;var Eo=function(e,t,r,n){var o=r.length,i=o,a=!n;if(null==e)return!i;for(e=Object(e);o--;){var s=r[o];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++o<i;){var u=(s=r[o])[0],c=e[u],l=s[1];if(a&&s[2]){if(void 0===c&&!(u in e))return!1}else{var h=new lt;if(n)var f=n(c,l,u,e,t,h);if(!(void 0===f?bo(l,c,wo|xo,n,h):f))return!1}}return!0};var ko=function(e){return e==e&&!me(e)};var Do=function(e){for(var t=Yt(e),r=t.length;r--;){var n=t[r],o=e[n];t[r]=[n,o,ko(o)]}return t};var So=function(e,t){return function(r){return null!=r&&r[e]===t&&(void 0!==t||e in Object(r))}};var Co=function(e){var t=Do(e);return 1==t.length&&t[0][2]?So(t[0][0],t[0][1]):function(r){return r===e||Eo(r,e,t)}},Ao="[object Symbol]";var jo=function(e){return"symbol"==typeof e||mt(e)&&ye(e)==Ao},Po=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Fo=/^\w*$/;var Mo=function(e,t){if(Dt(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!jo(e))||Fo.test(e)||!Po.test(e)||null!=t&&e in Object(t)},Oo="Expected a function";function No(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(Oo);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=e.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(No.Cache||at),r}No.Cache=at;var Io=No,To=500;var Lo=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Qo=/\\(\\)?/g,Ro=function(e){var t=Io(e,function(e){return r.size===To&&r.clear(),e}),r=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Lo,function(e,r,n,o){t.push(n?o.replace(Qo,"$1"):r||e)}),t});var Bo=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o},zo=1/0,Vo=ae?ae.prototype:void 0,Go=Vo?Vo.toString:void 0;var Ho=function e(t){if("string"==typeof t)return t;if(Dt(t))return Bo(t,e)+"";if(jo(t))return Go?Go.call(t):"";var r=t+"";return"0"==r&&1/t==-zo?"-0":r};var Uo=function(e){return null==e?"":Ho(e)};var Wo=function(e,t){return Dt(e)?e:Mo(e,t)?[e]:Ro(Uo(e))},qo=1/0;var Yo=function(e){if("string"==typeof e||jo(e))return e;var t=e+"";return"0"==t&&1/e==-qo?"-0":t};var $o=function(e,t){for(var r=0,n=(t=Wo(t,e)).length;null!=e&&r<n;)e=e[Yo(t[r++])];return r&&r==n?e:void 0};var Xo=function(e,t,r){var n=null==e?void 0:$o(e,t);return void 0===n?r:n};var Jo=function(e,t){return null!=e&&t in Object(e)};var Ko=function(e,t,r){for(var n=-1,o=(t=Wo(t,e)).length,i=!1;++n<o;){var a=Yo(t[n]);if(!(i=null!=e&&r(e,a)))break;e=e[a]}return i||++n!=o?i:!!(o=null==e?0:e.length)&&Mt(o)&&Pt(a,o)&&(Dt(e)||kt(e))};var Zo=function(e,t){return null!=e&&Ko(e,t,Jo)},ei=1,ti=2;var ri=function(e,t){return Mo(e)&&ko(t)?So(Yo(e),t):function(r){var n=Xo(r,e);return void 0===n&&n===t?Zo(r,e):bo(t,n,ei|ti)}};var ni=function(e){return function(t){return null==t?void 0:t[e]}};var oi=function(e){return function(t){return $o(t,e)}};var ii=function(e){return Mo(e)?ni(Yo(e)):oi(e)};var ai=function(e){return"function"==typeof e?e:null==e?Fn:"object"==typeof e?Dt(e)?ri(e[0],e[1]):Co(e):ii(e)};var si=function(e,t){return(Dt(e)?nr:In)(e,ai(t))},ui=Object.prototype.hasOwnProperty;var ci=function(e,t){return null!=e&&ui.call(e,t)};var li=function(e,t){return null!=e&&Ko(e,t,ci)},hi="[object Map]",fi="[object Set]",di=Object.prototype.hasOwnProperty;var pi=function(e){if(null==e)return!0;if(qt(e)&&(Dt(e)||"string"==typeof e||"function"==typeof e.splice||Ct(e)||Qt(e)||kt(e)))return!e.length;var t=Sr(e);if(t==hi||t==fi)return!e.size;if(Vt(e))return!Wt(e).length;for(var r in e)if(di.call(e,r))return!1;return!0};var gi=function(e){return void 0===e};var vi=function(e,t){var r=-1,n=qt(e)?Array(e.length):[];return Pn(e,function(e,o,i){n[++r]=t(e,o,i)}),n};var yi=function(e,t){return(Dt(e)?Bo:vi)(e,ai(t))};var mi=function(e,t,r,n){var o=-1,i=null==e?0:e.length;for(n&&i&&(r=e[++o]);++o<i;)r=t(r,e[o],o,e);return r};var _i=function(e,t,r,n,o){return o(e,function(e,o,i){r=n?(n=!1,e):t(r,e,o,i)}),r};var bi=function(e,t,r){var n=Dt(e)?mi:_i,o=arguments.length<3;return n(e,ai(t),r,o,Pn)},wi="[object String]";var xi=function(e){return"string"==typeof e||!Dt(e)&&mt(e)&&ye(e)==wi},Ei=ni("length"),ki=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var Di=function(e){return ki.test(e)},Si="[\\ud800-\\udfff]",Ci="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Ai="\\ud83c[\\udffb-\\udfff]",ji="[^\\ud800-\\udfff]",Pi="(?:\\ud83c[\\udde6-\\uddff]){2}",Fi="[\\ud800-\\udbff][\\udc00-\\udfff]",Mi="(?:"+Ci+"|"+Ai+")"+"?",Oi="[\\ufe0e\\ufe0f]?"+Mi+("(?:\\u200d(?:"+[ji,Pi,Fi].join("|")+")[\\ufe0e\\ufe0f]?"+Mi+")*"),Ni="(?:"+[ji+Ci+"?",Ci,Pi,Fi,Si].join("|")+")",Ii=RegExp(Ai+"(?="+Ai+")|"+Ni+Oi,"g");var Ti=function(e){for(var t=Ii.lastIndex=0;Ii.test(e);)++t;return t};var Li=function(e){return Di(e)?Ti(e):Ei(e)},Qi="[object Map]",Ri="[object Set]";var Bi=function(e){if(null==e)return 0;if(qt(e))return xi(e)?Li(e):e.length;var t=Sr(e);return t==Qi||t==Ri?e.size:Wt(e).length};var zi=function(e,t,r){var n=Dt(e),o=n||Ct(e)||Qt(e);if(t=ai(t),null==r){var i=e&&e.constructor;r=o?n?new i:[]:me(e)&&ke(i)?an(lr(e)):{}}return(o?ht:jn)(e,function(e,n,o){return t(r,e,n,o)}),r},Vi=ae?ae.isConcatSpreadable:void 0;var Gi=function(e){return Dt(e)||kt(e)||!!(Vi&&e&&e[Vi])};var Hi=function e(t,r,n,o,i){var a=-1,s=t.length;for(n||(n=Gi),i||(i=[]);++a<s;){var u=t[a];r>0&&n(u)?r>1?e(u,r-1,n,o,i):cr(i,u):o||(i[i.length]=u)}return i};var Ui=function(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)},Wi=Math.max;var qi=function(e,t,r){return t=Wi(void 0===t?e.length-1:t,0),function(){for(var n=arguments,o=-1,i=Wi(n.length-t,0),a=Array(i);++o<i;)a[o]=n[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=n[o];return s[t]=r(a),Ui(e,this,s)}},Yi=ft?function(e,t){return ft(e,"toString",{configurable:!0,enumerable:!1,value:Cn(t),writable:!0})}:Fn,$i=800,Xi=16,Ji=Date.now;var Ki=function(e){var t=0,r=0;return function(){var n=Ji(),o=Xi-(n-r);if(r=n,o>0){if(++t>=$i)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(Yi);var Zi=function(e,t){return Ki(qi(e,t,Fn),e+"")};var ea=function(e,t,r,n){for(var o=e.length,i=r+(n?1:-1);n?i--:++i<o;)if(t(e[i],i,e))return i;return-1};var ta=function(e){return e!=e};var ra=function(e,t,r){for(var n=r-1,o=e.length;++n<o;)if(e[n]===t)return n;return-1};var na=function(e,t,r){return t==t?ra(e,t,r):ea(e,ta,r)};var oa=function(e,t){return!(null==e||!e.length)&&na(e,t,0)>-1};var ia=function(e,t,r){for(var n=-1,o=null==e?0:e.length;++n<o;)if(r(t,e[n]))return!0;return!1};var aa=function(){},sa=mr&&1/qn(new mr([,-0]))[1]==1/0?function(e){return new mr(e)}:aa,ua=200;var ca=function(e,t,r){var n=-1,o=oa,i=e.length,a=!0,s=[],u=s;if(r)a=!1,o=ia;else if(i>=ua){var c=t?null:sa(e);if(c)return qn(c);a=!1,o=Vn,u=new Bn}else u=t?[]:s;e:for(;++n<i;){var l=e[n],h=t?t(l):l;if(l=r||0!==l?l:0,a&&h==h){for(var f=u.length;f--;)if(u[f]===h)continue e;t&&u.push(h),s.push(l)}else o(u,h,r)||(u!==s&&u.push(h),s.push(l))}return s};var la=function(e){return mt(e)&&qt(e)},ha=Zi(function(e){return ca(Hi(e,1,la,!0))});var fa=function(e,t){return Bo(t,function(t){return e[t]})};var da,pa=function(e){return null==e?[]:fa(e,Yt(e))};try{da={clone:Sn,constant:Cn,each:Nn,filter:si,has:li,isArray:Dt,isEmpty:pi,isFunction:ke,isUndefined:gi,keys:Yt,map:yi,reduce:bi,size:Bi,transform:zi,union:ha,values:pa}}catch(e){}da||(da=window._);var ga=da,va=ba,ya="\0",ma="\0",_a="";function ba(e){this._isDirected=!ga.has(e,"directed")||e.directed,this._isMultigraph=!!ga.has(e,"multigraph")&&e.multigraph,this._isCompound=!!ga.has(e,"compound")&&e.compound,this._label=void 0,this._defaultNodeLabelFn=ga.constant(void 0),this._defaultEdgeLabelFn=ga.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[ma]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function wa(e,t){e[t]?e[t]++:e[t]=1}function xa(e,t){--e[t]||delete e[t]}function Ea(e,t,r,n){var o=""+t,i=""+r;if(!e&&o>i){var a=o;o=i,i=a}return o+_a+i+_a+(ga.isUndefined(n)?ya:n)}function ka(e,t){return Ea(e,t.v,t.w,t.name)}ba.prototype._nodeCount=0,ba.prototype._edgeCount=0,ba.prototype.isDirected=function(){return this._isDirected},ba.prototype.isMultigraph=function(){return this._isMultigraph},ba.prototype.isCompound=function(){return this._isCompound},ba.prototype.setGraph=function(e){return this._label=e,this},ba.prototype.graph=function(){return this._label},ba.prototype.setDefaultNodeLabel=function(e){return ga.isFunction(e)||(e=ga.constant(e)),this._defaultNodeLabelFn=e,this},ba.prototype.nodeCount=function(){return this._nodeCount},ba.prototype.nodes=function(){return ga.keys(this._nodes)},ba.prototype.sources=function(){var e=this;return ga.filter(this.nodes(),function(t){return ga.isEmpty(e._in[t])})},ba.prototype.sinks=function(){var e=this;return ga.filter(this.nodes(),function(t){return ga.isEmpty(e._out[t])})},ba.prototype.setNodes=function(e,t){var r=arguments,n=this;return ga.each(e,function(e){r.length>1?n.setNode(e,t):n.setNode(e)}),this},ba.prototype.setNode=function(e,t){return ga.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=ma,this._children[e]={},this._children[ma][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},ba.prototype.node=function(e){return this._nodes[e]},ba.prototype.hasNode=function(e){return ga.has(this._nodes,e)},ba.prototype.removeNode=function(e){var t=this;if(ga.has(this._nodes,e)){var r=function(e){t.removeEdge(t._edgeObjs[e])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],ga.each(this.children(e),function(e){t.setParent(e)}),delete this._children[e]),ga.each(ga.keys(this._in[e]),r),delete this._in[e],delete this._preds[e],ga.each(ga.keys(this._out[e]),r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},ba.prototype.setParent=function(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(ga.isUndefined(t))t=ma;else{for(var r=t+="";!ga.isUndefined(r);r=this.parent(r))if(r===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this},ba.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},ba.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if(t!==ma)return t}},ba.prototype.children=function(e){if(ga.isUndefined(e)&&(e=ma),this._isCompound){var t=this._children[e];if(t)return ga.keys(t)}else{if(e===ma)return this.nodes();if(this.hasNode(e))return[]}},ba.prototype.predecessors=function(e){var t=this._preds[e];if(t)return ga.keys(t)},ba.prototype.successors=function(e){var t=this._sucs[e];if(t)return ga.keys(t)},ba.prototype.neighbors=function(e){var t=this.predecessors(e);if(t)return ga.union(t,this.successors(e))},ba.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},ba.prototype.filterNodes=function(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var r=this;ga.each(this._nodes,function(r,n){e(n)&&t.setNode(n,r)}),ga.each(this._edgeObjs,function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,r.edge(e))});var n={};return this._isCompound&&ga.each(t.nodes(),function(e){t.setParent(e,function e(o){var i=r.parent(o);return void 0===i||t.hasNode(i)?(n[o]=i,i):i in n?n[i]:e(i)}(e))}),t},ba.prototype.setDefaultEdgeLabel=function(e){return ga.isFunction(e)||(e=ga.constant(e)),this._defaultEdgeLabelFn=e,this},ba.prototype.edgeCount=function(){return this._edgeCount},ba.prototype.edges=function(){return ga.values(this._edgeObjs)},ba.prototype.setPath=function(e,t){var r=this,n=arguments;return ga.reduce(e,function(e,o){return n.length>1?r.setEdge(e,o,t):r.setEdge(e,o),o}),this},ba.prototype.setEdge=function(){var e,t,r,n,o=!1,i=arguments[0];"object"==typeof i&&null!==i&&"v"in i?(e=i.v,t=i.w,r=i.name,2===arguments.length&&(n=arguments[1],o=!0)):(e=i,t=arguments[1],r=arguments[3],arguments.length>2&&(n=arguments[2],o=!0)),e=""+e,t=""+t,ga.isUndefined(r)||(r=""+r);var a=Ea(this._isDirected,e,t,r);if(ga.has(this._edgeLabels,a))return o&&(this._edgeLabels[a]=n),this;if(!ga.isUndefined(r)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[a]=o?n:this._defaultEdgeLabelFn(e,t,r);var s=function(e,t,r,n){var o=""+t,i=""+r;if(!e&&o>i){var a=o;o=i,i=a}var s={v:o,w:i};n&&(s.name=n);return s}(this._isDirected,e,t,r);return e=s.v,t=s.w,Object.freeze(s),this._edgeObjs[a]=s,wa(this._preds[t],e),wa(this._sucs[e],t),this._in[t][a]=s,this._out[e][a]=s,this._edgeCount++,this},ba.prototype.edge=function(e,t,r){var n=1===arguments.length?ka(this._isDirected,arguments[0]):Ea(this._isDirected,e,t,r);return this._edgeLabels[n]},ba.prototype.hasEdge=function(e,t,r){var n=1===arguments.length?ka(this._isDirected,arguments[0]):Ea(this._isDirected,e,t,r);return ga.has(this._edgeLabels,n)},ba.prototype.removeEdge=function(e,t,r){var n=1===arguments.length?ka(this._isDirected,arguments[0]):Ea(this._isDirected,e,t,r),o=this._edgeObjs[n];return o&&(e=o.v,t=o.w,delete this._edgeLabels[n],delete this._edgeObjs[n],xa(this._preds[t],e),xa(this._sucs[e],t),delete this._in[t][n],delete this._out[e][n],this._edgeCount--),this},ba.prototype.inEdges=function(e,t){var r=this._in[e];if(r){var n=ga.values(r);return t?ga.filter(n,function(e){return e.v===t}):n}},ba.prototype.outEdges=function(e,t){var r=this._out[e];if(r){var n=ga.values(r);return t?ga.filter(n,function(e){return e.w===t}):n}},ba.prototype.nodeEdges=function(e,t){var r=this.inEdges(e,t);if(r)return r.concat(this.outEdges(e,t))};var Da={Graph:va,version:"2.1.8"},Sa={write:function(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:Ca(e),edges:Aa(e)};ga.isUndefined(e.graph())||(t.value=ga.clone(e.graph()));return t},read:function(e){var t=new va(e.options).setGraph(e.value);return ga.each(e.nodes,function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),ga.each(e.edges,function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}};function Ca(e){return ga.map(e.nodes(),function(t){var r=e.node(t),n=e.parent(t),o={v:t};return ga.isUndefined(r)||(o.value=r),ga.isUndefined(n)||(o.parent=n),o})}function Aa(e){return ga.map(e.edges(),function(t){var r=e.edge(t),n={v:t.v,w:t.w};return ga.isUndefined(t.name)||(n.name=t.name),ga.isUndefined(r)||(n.value=r),n})}var ja=function(e){var t,r={},n=[];function o(n){ga.has(r,n)||(r[n]=!0,t.push(n),ga.each(e.successors(n),o),ga.each(e.predecessors(n),o))}return ga.each(e.nodes(),function(e){t=[],o(e),t.length&&n.push(t)}),n};var Pa=Fa;function Fa(){this._arr=[],this._keyIndices={}}Fa.prototype.size=function(){return this._arr.length},Fa.prototype.keys=function(){return this._arr.map(function(e){return e.key})},Fa.prototype.has=function(e){return ga.has(this._keyIndices,e)},Fa.prototype.priority=function(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority},Fa.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},Fa.prototype.add=function(e,t){var r=this._keyIndices;if(e=String(e),!ga.has(r,e)){var n=this._arr,o=n.length;return r[e]=o,n.push({key:e,priority:t}),this._decrease(o),!0}return!1},Fa.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},Fa.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)},Fa.prototype._heapify=function(e){var t=this._arr,r=2*e,n=r+1,o=e;r<t.length&&(o=t[r].priority<t[o].priority?r:o,n<t.length&&(o=t[n].priority<t[o].priority?n:o),o!==e&&(this._swap(e,o),this._heapify(o)))},Fa.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},Fa.prototype._swap=function(e,t){var r=this._arr,n=this._keyIndices,o=r[e],i=r[t];r[e]=i,r[t]=o,n[i.key]=e,n[o.key]=t};var Ma=function(e,t,r,n){return function(e,t,r,n){var o,i,a={},s=new Pa,u=function(e){var t=e.v!==o?e.v:e.w,n=a[t],u=r(e),c=i.distance+u;if(u<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+u);c<n.distance&&(n.distance=c,n.predecessor=o,s.decrease(t,c))};e.nodes().forEach(function(e){var r=e===t?0:Number.POSITIVE_INFINITY;a[e]={distance:r},s.add(e,r)});for(;s.size()>0&&(o=s.removeMin(),(i=a[o]).distance!==Number.POSITIVE_INFINITY);)n(o).forEach(u);return a}(e,String(t),r||Oa,n||function(t){return e.outEdges(t)})},Oa=ga.constant(1);var Na=function(e,t,r){return ga.transform(e.nodes(),function(n,o){n[o]=Ma(e,o,t,r)},{})};var Ia=function(e){var t=0,r=[],n={},o=[];return e.nodes().forEach(function(i){ga.has(n,i)||function i(a){var s=n[a]={onStack:!0,lowlink:t,index:t++};if(r.push(a),e.successors(a).forEach(function(e){ga.has(n,e)?n[e].onStack&&(s.lowlink=Math.min(s.lowlink,n[e].index)):(i(e),s.lowlink=Math.min(s.lowlink,n[e].lowlink))}),s.lowlink===s.index){var u,c=[];do{u=r.pop(),n[u].onStack=!1,c.push(u)}while(a!==u);o.push(c)}}(i)}),o};var Ta=function(e){return ga.filter(Ia(e),function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])})};var La=function(e,t,r){return function(e,t,r){var n={},o=e.nodes();return o.forEach(function(e){n[e]={},n[e][e]={distance:0},o.forEach(function(t){e!==t&&(n[e][t]={distance:Number.POSITIVE_INFINITY})}),r(e).forEach(function(r){var o=r.v===e?r.w:r.v,i=t(r);n[e][o]={distance:i,predecessor:e}})}),o.forEach(function(e){var t=n[e];o.forEach(function(r){var i=n[r];o.forEach(function(r){var n=i[e],o=t[r],a=i[r],s=n.distance+o.distance;s<a.distance&&(a.distance=s,a.predecessor=o.predecessor)})})}),n}(e,t||Qa,r||function(t){return e.outEdges(t)})},Qa=ga.constant(1);var Ra=Ba;function Ba(e){var t={},r={},n=[];if(ga.each(e.sinks(),function o(i){if(ga.has(r,i))throw new za;ga.has(t,i)||(r[i]=!0,t[i]=!0,ga.each(e.predecessors(i),o),delete r[i],n.push(i))}),ga.size(t)!==e.nodeCount())throw new za;return n}function za(){}Ba.CycleException=za,za.prototype=new Error;var Va=function(e,t,r){ga.isArray(t)||(t=[t]);var n=(e.isDirected()?e.successors:e.neighbors).bind(e),o=[],i={};return ga.each(t,function(t){if(!e.hasNode(t))throw new Error("Graph does not have node: "+t);!function e(t,r,n,o,i,a){ga.has(o,r)||(o[r]=!0,n||a.push(r),ga.each(i(r),function(r){e(t,r,n,o,i,a)}),n&&a.push(r))}(e,t,"post"===r,i,n,o)}),o};var Ga,Ha={Graph:Da.Graph,json:Sa,alg:{components:ja,dijkstra:Ma,dijkstraAll:Na,findCycles:Ta,floydWarshall:La,isAcyclic:function(e){try{Ra(e)}catch(e){if(e instanceof Ra.CycleException)return!1;throw e}return!0},postorder:function(e,t){return Va(e,t,"post")},preorder:function(e,t){return Va(e,t,"pre")},prim:function(e,t){var r,n=new va,o={},i=new Pa;function a(e){var n=e.v===r?e.w:e.v,a=i.priority(n);if(void 0!==a){var s=t(e);s<a&&(o[n]=r,i.decrease(n,s))}}if(0===e.nodeCount())return n;ga.each(e.nodes(),function(e){i.add(e,Number.POSITIVE_INFINITY),n.setNode(e)}),i.decrease(e.nodes()[0],0);var s=!1;for(;i.size()>0;){if(r=i.removeMin(),ga.has(o,r))n.setEdge(r,o[r]);else{if(s)throw new Error("Input graph is not connected: "+e);s=!0}e.nodeEdges(r).forEach(a)}return n},tarjan:Ia,topsort:Ra},version:Da.version};try{Ga=Ha}catch(e){}Ga||(Ga=window.graphlib);var Ua=Ga,Wa=1,qa=4;var Ya=function(e){return kn(e,Wa|qa)};var $a=function(e,t,r){if(!me(r))return!1;var n=typeof t;return!!("number"==n?qt(r)&&Pt(t,r.length):"string"==n&&t in r)&&H(r[t],e)},Xa=Object.prototype,Ja=Xa.hasOwnProperty,Ka=Zi(function(e,t){e=Object(e);var r=-1,n=t.length,o=n>2?t[2]:void 0;for(o&&$a(t[0],t[1],o)&&(n=1);++r<n;)for(var i=t[r],a=Zt(i),s=-1,u=a.length;++s<u;){var c=a[s],l=e[c];(void 0===l||H(l,Xa[c])&&!Ja.call(e,c))&&(e[c]=i[c])}return e});var Za=function(e){return function(t,r,n){var o=Object(t);if(!qt(t)){var i=ai(r);t=Yt(t),r=function(e){return i(o[e],e,o)}}var a=e(t,r,n);return a>-1?o[i?t[a]:a]:void 0}},es=/\s/;var ts=function(e){for(var t=e.length;t--&&es.test(e.charAt(t)););return t},rs=/^\s+/;var ns=function(e){return e?e.slice(0,ts(e)+1).replace(rs,""):e},os=NaN,is=/^[-+]0x[0-9a-f]+$/i,as=/^0b[01]+$/i,ss=/^0o[0-7]+$/i,us=parseInt;var cs=function(e){if("number"==typeof e)return e;if(jo(e))return os;if(me(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=me(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=ns(e);var r=as.test(e);return r||ss.test(e)?us(e.slice(2),r?2:8):is.test(e)?os:+e},ls=1/0,hs=1.7976931348623157e308;var fs=function(e){return e?(e=cs(e))===ls||e===-ls?(e<0?-1:1)*hs:e==e?e:0:0===e?e:0};var ds=function(e){var t=fs(e),r=t%1;return t==t?r?t-r:t:0},ps=Math.max;var gs=Za(function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var o=null==r?0:ds(r);return o<0&&(o=ps(n+o,0)),ea(e,ai(t),o)});var vs=function(e){return null!=e&&e.length?Hi(e,1):[]};var ys=function(e,t){return null==e?e:An(e,Mn(t),Zt)};var ms=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0};var _s=function(e,t){var r={};return t=ai(t),jn(e,function(e,n,o){dt(r,n,t(e,n,o))}),r};var bs=function(e,t,r){for(var n=-1,o=e.length;++n<o;){var i=e[n],a=t(i);if(null!=a&&(void 0===s?a==a&&!jo(a):r(a,s)))var s=a,u=i}return u};var ws=function(e,t){return e>t};var xs=function(e){return e&&e.length?bs(e,Fn,ws):void 0};var Es=function(e,t,r){(void 0===r||H(e[t],r))&&(void 0!==r||t in e)||dt(e,t,r)},ks="[object Object]",Ds=Function.prototype,Ss=Object.prototype,Cs=Ds.toString,As=Ss.hasOwnProperty,js=Cs.call(Object);var Ps=function(e){if(!mt(e)||ye(e)!=ks)return!1;var t=lr(e);if(null===t)return!0;var r=As.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Cs.call(r)==js};var Fs=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]};var Ms=function(e){return vt(e,Zt(e))};var Os=function(e,t,r,n,o,i,a){var s=Fs(e,r),u=Fs(t,r),c=a.get(u);if(c)Es(e,r,c);else{var l=i?i(s,u,r+"",e,t,a):void 0,h=void 0===l;if(h){var f=Dt(u),d=!f&&Ct(u),p=!f&&!d&&Qt(u);l=u,f||d||p?Dt(s)?l=s:la(s)?l=rr(s):d?(h=!1,l=tr(u,!0)):p?(h=!1,l=Lr(u,!0)):l=[]:Ps(u)||kt(u)?(l=s,kt(s)?l=Ms(s):me(s)&&!ke(s)||(l=sn(u))):h=!1}h&&(a.set(u,l),o(l,u,n,i,a),a.delete(u)),Es(e,r,l)}};var Ns=function e(t,r,n,o,i){t!==r&&An(r,function(a,s){if(i||(i=new lt),me(a))Os(t,r,s,n,e,o,i);else{var u=o?o(Fs(t,s),a,s+"",t,r,i):void 0;void 0===u&&(u=a),Es(t,s,u)}},Zt)};var Is=function(e){return Zi(function(t,r){var n=-1,o=r.length,i=o>1?r[o-1]:void 0,a=o>2?r[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,a&&$a(r[0],r[1],a)&&(i=o<3?void 0:i,o=1),t=Object(t);++n<o;){var s=r[n];s&&e(t,s,n,i)}return t})}(function(e,t,r){Ns(e,t,r)});var Ts=function(e,t){return e<t};var Ls=function(e){return e&&e.length?bs(e,Fn,Ts):void 0};var Qs=function(e,t){return e&&e.length?bs(e,ai(t),Ts):void 0},Rs=function(){return ie.Date.now()};var Bs=function(e,t,r,n){if(!me(e))return e;for(var o=-1,i=(t=Wo(t,e)).length,a=i-1,s=e;null!=s&&++o<i;){var u=Yo(t[o]),c=r;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(o!=a){var l=s[u];void 0===(c=n?n(l,u,s):void 0)&&(c=me(l)?l:Pt(t[o+1])?[]:{})}gt(s,u,c),s=s[u]}return e};var zs=function(e,t,r){for(var n=-1,o=t.length,i={};++n<o;){var a=t[n],s=$o(e,a);r(s,a)&&Bs(i,Wo(a,e),s)}return i};var Vs=function(e,t){return zs(e,t,function(t,r){return Zo(e,r)})};var Gs=function(e){return Ki(qi(e,void 0,vs),e+"")}(function(e,t){return null==e?{}:Vs(e,t)}),Hs=Math.ceil,Us=Math.max;var Ws=function(e,t,r,n){for(var o=-1,i=Us(Hs((t-e)/(r||1)),0),a=Array(i);i--;)a[n?i:++o]=e,e+=r;return a};var qs=function(e){return function(t,r,n){return n&&"number"!=typeof n&&$a(t,r,n)&&(r=n=void 0),t=fs(t),void 0===r?(r=t,t=0):r=fs(r),n=void 0===n?t<r?1:-1:fs(n),Ws(t,r,n,e)}}();var Ys=function(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e};var $s=function(e,t){if(e!==t){var r=void 0!==e,n=null===e,o=e==e,i=jo(e),a=void 0!==t,s=null===t,u=t==t,c=jo(t);if(!s&&!c&&!i&&e>t||i&&a&&u&&!s&&!c||n&&a&&u||!r&&u||!o)return 1;if(!n&&!i&&!c&&e<t||c&&r&&o&&!n&&!i||s&&r&&o||!a&&o||!u)return-1}return 0};var Xs=function(e,t,r){for(var n=-1,o=e.criteria,i=t.criteria,a=o.length,s=r.length;++n<a;){var u=$s(o[n],i[n]);if(u)return n>=s?u:u*("desc"==r[n]?-1:1)}return e.index-t.index};var Js=function(e,t,r){t=t.length?Bo(t,function(e){return Dt(e)?function(t){return $o(t,1===e.length?e[0]:e)}:e}):[Fn];var n=-1;t=Bo(t,It(ai));var o=vi(e,function(e,r,o){return{criteria:Bo(t,function(t){return t(e)}),index:++n,value:e}});return Ys(o,function(e,t){return Xs(e,t,r)})},Ks=Zi(function(e,t){if(null==e)return[];var r=t.length;return r>1&&$a(e,t[0],t[1])?t=[]:r>2&&$a(t[0],t[1],t[2])&&(t=[t[0]]),Js(e,Hi(t,1),[])}),Zs=0;var eu=function(e){var t=++Zs;return Uo(e)+t};var tu=function(e,t,r){for(var n=-1,o=e.length,i=t.length,a={};++n<o;){var s=n<i?t[n]:void 0;r(a,e[n],s)}return a};var ru,nu=function(e,t){return tu(e||[],t||[],gt)};try{ru={cloneDeep:Ya,constant:Cn,defaults:Ka,each:Nn,filter:si,find:gs,flatten:vs,forEach:On,forIn:ys,has:li,isUndefined:gi,last:ms,map:yi,mapValues:_s,max:xs,merge:Is,min:Ls,minBy:Qs,now:Rs,pick:Gs,range:qs,reduce:bi,sortBy:Ks,uniqueId:eu,values:pa,zipObject:nu}}catch(e){}ru||(ru=window._);var ou=ru,iu=au;function au(){var e={};e._next=e._prev=e,this._sentinel=e}function su(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function uu(e,t){if("_next"!==e&&"_prev"!==e)return t}au.prototype.dequeue=function(){var e=this._sentinel,t=e._prev;if(t!==e)return su(t),t},au.prototype.enqueue=function(e){var t=this._sentinel;e._prev&&e._next&&su(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t},au.prototype.toString=function(){for(var e=[],t=this._sentinel,r=t._prev;r!==t;)e.push(JSON.stringify(r,uu)),r=r._prev;return"["+e.join(", ")+"]"};var cu=Ua.Graph,lu=function(e,t){if(e.nodeCount()<=1)return[];var r=function(e,t){var r=new cu,n=0,o=0;ou.forEach(e.nodes(),function(e){r.setNode(e,{v:e,in:0,out:0})}),ou.forEach(e.edges(),function(e){var i=r.edge(e.v,e.w)||0,a=t(e),s=i+a;r.setEdge(e.v,e.w,s),o=Math.max(o,r.node(e.v).out+=a),n=Math.max(n,r.node(e.w).in+=a)});var i=ou.range(o+n+3).map(function(){return new iu}),a=n+1;return ou.forEach(r.nodes(),function(e){du(i,a,r.node(e))}),{graph:r,buckets:i,zeroIdx:a}}(e,t||hu),n=function(e,t,r){var n,o=[],i=t[t.length-1],a=t[0];for(;e.nodeCount();){for(;n=a.dequeue();)fu(e,t,r,n);for(;n=i.dequeue();)fu(e,t,r,n);if(e.nodeCount())for(var s=t.length-2;s>0;--s)if(n=t[s].dequeue()){o=o.concat(fu(e,t,r,n,!0));break}}return o}(r.graph,r.buckets,r.zeroIdx);return ou.flatten(ou.map(n,function(t){return e.outEdges(t.v,t.w)}),!0)},hu=ou.constant(1);function fu(e,t,r,n,o){var i=o?[]:void 0;return ou.forEach(e.inEdges(n.v),function(n){var a=e.edge(n),s=e.node(n.v);o&&i.push({v:n.v,w:n.w}),s.out-=a,du(t,r,s)}),ou.forEach(e.outEdges(n.v),function(n){var o=e.edge(n),i=n.w,a=e.node(i);a.in-=o,du(t,r,a)}),e.removeNode(n.v),i}function du(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)}var pu={run:function(e){var t="greedy"===e.graph().acyclicer?lu(e,function(e){return function(t){return e.edge(t).weight}}(e)):function(e){var t=[],r={},n={};return ou.forEach(e.nodes(),function o(i){ou.has(n,i)||(n[i]=!0,r[i]=!0,ou.forEach(e.outEdges(i),function(e){ou.has(r,e.w)?t.push(e):o(e.w)}),delete r[i])}),t}(e);ou.forEach(t,function(t){var r=e.edge(t);e.removeEdge(t),r.forwardName=t.name,r.reversed=!0,e.setEdge(t.w,t.v,r,ou.uniqueId("rev"))})},undo:function(e){ou.forEach(e.edges(),function(t){var r=e.edge(t);if(r.reversed){e.removeEdge(t);var n=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(t.w,t.v,r,n)}})}};var gu=Ua.Graph,vu={addDummyNode:yu,simplify:function(e){var t=(new gu).setGraph(e.graph());return ou.forEach(e.nodes(),function(r){t.setNode(r,e.node(r))}),ou.forEach(e.edges(),function(r){var n=t.edge(r.v,r.w)||{weight:0,minlen:1},o=e.edge(r);t.setEdge(r.v,r.w,{weight:n.weight+o.weight,minlen:Math.max(n.minlen,o.minlen)})}),t},asNonCompoundGraph:function(e){var t=new gu({multigraph:e.isMultigraph()}).setGraph(e.graph());return ou.forEach(e.nodes(),function(r){e.children(r).length||t.setNode(r,e.node(r))}),ou.forEach(e.edges(),function(r){t.setEdge(r,e.edge(r))}),t},successorWeights:function(e){var t=ou.map(e.nodes(),function(t){var r={};return ou.forEach(e.outEdges(t),function(t){r[t.w]=(r[t.w]||0)+e.edge(t).weight}),r});return ou.zipObject(e.nodes(),t)},predecessorWeights:function(e){var t=ou.map(e.nodes(),function(t){var r={};return ou.forEach(e.inEdges(t),function(t){r[t.v]=(r[t.v]||0)+e.edge(t).weight}),r});return ou.zipObject(e.nodes(),t)},intersectRect:function(e,t){var r,n,o=e.x,i=e.y,a=t.x-o,s=t.y-i,u=e.width/2,c=e.height/2;if(!a&&!s)throw new Error("Not possible to find intersection inside of the rectangle");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);return{x:o+r,y:i+n}},buildLayerMatrix:function(e){var t=ou.map(ou.range(mu(e)+1),function(){return[]});return ou.forEach(e.nodes(),function(r){var n=e.node(r),o=n.rank;ou.isUndefined(o)||(t[o][n.order]=r)}),t},normalizeRanks:function(e){var t=ou.min(ou.map(e.nodes(),function(t){return e.node(t).rank}));ou.forEach(e.nodes(),function(r){var n=e.node(r);ou.has(n,"rank")&&(n.rank-=t)})},removeEmptyRanks:function(e){var t=ou.min(ou.map(e.nodes(),function(t){return e.node(t).rank})),r=[];ou.forEach(e.nodes(),function(n){var o=e.node(n).rank-t;r[o]||(r[o]=[]),r[o].push(n)});var n=0,o=e.graph().nodeRankFactor;ou.forEach(r,function(t,r){ou.isUndefined(t)&&r%o!=0?--n:n&&ou.forEach(t,function(t){e.node(t).rank+=n})})},addBorderNode:function(e,t,r,n){var o={width:0,height:0};arguments.length>=4&&(o.rank=r,o.order=n);return yu(e,"border",o,t)},maxRank:mu,partition:function(e,t){var r={lhs:[],rhs:[]};return ou.forEach(e,function(e){t(e)?r.lhs.push(e):r.rhs.push(e)}),r},time:function(e,t){var r=ou.now();try{return t()}finally{console.log(e+" time: "+(ou.now()-r)+"ms")}},notime:function(e,t){return t()}};function yu(e,t,r,n){var o;do{o=ou.uniqueId(n)}while(e.hasNode(o));return r.dummy=t,e.setNode(o,r),o}function mu(e){return ou.max(ou.map(e.nodes(),function(t){var r=e.node(t).rank;if(!ou.isUndefined(r))return r}))}var _u={run:function(e){e.graph().dummyChains=[],ou.forEach(e.edges(),function(t){!function(e,t){var r,n,o,i=t.v,a=e.node(i).rank,s=t.w,u=e.node(s).rank,c=t.name,l=e.edge(t),h=l.labelRank;if(u===a+1)return;for(e.removeEdge(t),o=0,++a;a<u;++o,++a)l.points=[],n={width:0,height:0,edgeLabel:l,edgeObj:t,rank:a},r=vu.addDummyNode(e,"edge",n,"_d"),a===h&&(n.width=l.width,n.height=l.height,n.dummy="edge-label",n.labelpos=l.labelpos),e.setEdge(i,r,{weight:l.weight},c),0===o&&e.graph().dummyChains.push(r),i=r;e.setEdge(i,s,{weight:l.weight},c)}(e,t)})},undo:function(e){ou.forEach(e.graph().dummyChains,function(t){var r,n=e.node(t),o=n.edgeLabel;for(e.setEdge(n.edgeObj,o);n.dummy;)r=e.successors(t)[0],e.removeNode(t),o.points.push({x:n.x,y:n.y}),"edge-label"===n.dummy&&(o.x=n.x,o.y=n.y,o.width=n.width,o.height=n.height),t=r,n=e.node(t)})}};var bu=function(e){var t={};ou.forEach(e.sources(),function r(n){var o=e.node(n);if(ou.has(t,n))return o.rank;t[n]=!0;var i=ou.min(ou.map(e.outEdges(n),function(t){return r(t.w)-e.edge(t).minlen}));i!==Number.POSITIVE_INFINITY&&null!=i||(i=0);return o.rank=i})},wu=function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen};var xu=Ua.Graph,Eu=wu,ku=function(e){var t,r,n=new xu({directed:!1}),o=e.nodes()[0],i=e.nodeCount();n.setNode(o,{});for(;Du(n,e)<i;)t=Su(n,e),r=n.hasNode(t.v)?Eu(e,t):-Eu(e,t),Cu(n,e,r);return n};function Du(e,t){return ou.forEach(e.nodes(),function r(n){ou.forEach(t.nodeEdges(n),function(o){var i=o.v,a=n===i?o.w:i;e.hasNode(a)||Eu(t,o)||(e.setNode(a,{}),e.setEdge(n,a,{}),r(a))})}),e.nodeCount()}function Su(e,t){return ou.minBy(t.edges(),function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return Eu(t,r)})}function Cu(e,t,r){ou.forEach(e.nodes(),function(e){t.node(e).rank+=r})}var Au=wu,ju=bu,Pu=Ua.alg.preorder,Fu=Ua.alg.postorder,Mu=vu.simplify,Ou=Nu;function Nu(e){e=Mu(e),ju(e);var t,r=ku(e);for(Lu(r),Iu(r,e);t=Qu(r);)Bu(r,e,t,Ru(r,e,t))}function Iu(e,t){var r=Fu(e,e.nodes());r=r.slice(0,r.length-1),ou.forEach(r,function(r){!function(e,t,r){var n=e.node(r).parent;e.edge(r,n).cutvalue=Tu(e,t,r)}(e,t,r)})}function Tu(e,t,r){var n=e.node(r).parent,o=!0,i=t.edge(r,n),a=0;return i||(o=!1,i=t.edge(n,r)),a=i.weight,ou.forEach(t.nodeEdges(r),function(i){var s=i.v===r,u=s?i.w:i.v;if(u!==n){var c=s===o,l=t.edge(i).weight;if(a+=c?l:-l,function(e,t,r){return e.hasEdge(t,r)}(e,r,u)){var h=e.edge(r,u).cutvalue;a+=c?-h:h}}}),a}function Lu(e,t){arguments.length<2&&(t=e.nodes()[0]),function e(t,r,n,o,i){var a=n;var s=t.node(o);r[o]=!0;ou.forEach(t.neighbors(o),function(i){ou.has(r,i)||(n=e(t,r,n,i,o))});s.low=a;s.lim=n++;i?s.parent=i:delete s.parent;return n}(e,{},1,t)}function Qu(e){return ou.find(e.edges(),function(t){return e.edge(t).cutvalue<0})}function Ru(e,t,r){var n=r.v,o=r.w;t.hasEdge(n,o)||(n=r.w,o=r.v);var i=e.node(n),a=e.node(o),s=i,u=!1;i.lim>a.lim&&(s=a,u=!0);var c=ou.filter(t.edges(),function(t){return u===zu(e,e.node(t.v),s)&&u!==zu(e,e.node(t.w),s)});return ou.minBy(c,function(e){return Au(t,e)})}function Bu(e,t,r,n){var o=r.v,i=r.w;e.removeEdge(o,i),e.setEdge(n.v,n.w,{}),Lu(e),Iu(e,t),function(e,t){var r=ou.find(e.nodes(),function(e){return!t.node(e).parent}),n=Pu(e,r);n=n.slice(1),ou.forEach(n,function(r){var n=e.node(r).parent,o=t.edge(r,n),i=!1;o||(o=t.edge(n,r),i=!0),t.node(r).rank=t.node(n).rank+(i?o.minlen:-o.minlen)})}(e,t)}function zu(e,t,r){return r.low<=t.lim&&t.lim<=r.lim}Nu.initLowLimValues=Lu,Nu.initCutValues=Iu,Nu.calcCutValue=Tu,Nu.leaveEdge=Qu,Nu.enterEdge=Ru,Nu.exchangeEdges=Bu;var Vu=bu,Gu=function(e){switch(e.graph().ranker){case"network-simplex":Uu(e);break;case"tight-tree":!function(e){Vu(e),ku(e)}(e);break;case"longest-path":Hu(e);break;default:Uu(e)}};var Hu=Vu;function Uu(e){Ou(e)}var Wu=function(e){var t=function(e){var t={},r=0;return ou.forEach(e.children(),function n(o){var i=r;ou.forEach(e.children(o),n),t[o]={low:i,lim:r++}}),t}(e);ou.forEach(e.graph().dummyChains,function(r){for(var n=e.node(r),o=n.edgeObj,i=function(e,t,r,n){var o,i,a=[],s=[],u=Math.min(t[r].low,t[n].low),c=Math.max(t[r].lim,t[n].lim);o=r;do{o=e.parent(o),a.push(o)}while(o&&(t[o].low>u||c>t[o].lim));i=o,o=n;for(;(o=e.parent(o))!==i;)s.push(o);return{path:a.concat(s.reverse()),lca:i}}(e,t,o.v,o.w),a=i.path,s=i.lca,u=0,c=a[u],l=!0;r!==o.w;){if(n=e.node(r),l){for(;(c=a[u])!==s&&e.node(c).maxRank<n.rank;)u++;c===s&&(l=!1)}if(!l){for(;u<a.length-1&&e.node(c=a[u+1]).minRank<=n.rank;)u++;c=a[u]}e.setParent(r,c),r=e.successors(r)[0]}})};var qu={run:function(e){var t=vu.addDummyNode(e,"root",{},"_root"),r=function(e){var t={};return ou.forEach(e.children(),function(r){!function r(n,o){var i=e.children(n);i&&i.length&&ou.forEach(i,function(e){r(e,o+1)}),t[n]=o}(r,1)}),t}(e),n=ou.max(ou.values(r))-1,o=2*n+1;e.graph().nestingRoot=t,ou.forEach(e.edges(),function(t){e.edge(t).minlen*=o});var i=function(e){return ou.reduce(e.edges(),function(t,r){return t+e.edge(r).weight},0)}(e)+1;ou.forEach(e.children(),function(a){!function e(t,r,n,o,i,a,s){var u=t.children(s);if(!u.length)return void(s!==r&&t.setEdge(r,s,{weight:0,minlen:n}));var c=vu.addBorderNode(t,"_bt");var l=vu.addBorderNode(t,"_bb");var h=t.node(s);t.setParent(c,s);h.borderTop=c;t.setParent(l,s);h.borderBottom=l;ou.forEach(u,function(u){e(t,r,n,o,i,a,u);var h=t.node(u),f=h.borderTop?h.borderTop:u,d=h.borderBottom?h.borderBottom:u,p=h.borderTop?o:2*o,g=f!==d?1:i-a[s]+1;t.setEdge(c,f,{weight:p,minlen:g,nestingEdge:!0}),t.setEdge(d,l,{weight:p,minlen:g,nestingEdge:!0})});t.parent(s)||t.setEdge(r,c,{weight:0,minlen:i+a[s]})}(e,t,o,i,n,r,a)}),e.graph().nodeRankFactor=o},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,ou.forEach(e.edges(),function(t){var r=e.edge(t);r.nestingEdge&&e.removeEdge(t)})}};var Yu=function(e){ou.forEach(e.children(),function t(r){var n=e.children(r);var o=e.node(r);n.length&&ou.forEach(n,t);if(ou.has(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var i=o.minRank,a=o.maxRank+1;i<a;++i)$u(e,"borderLeft","_bl",r,o,i),$u(e,"borderRight","_br",r,o,i)}})};function $u(e,t,r,n,o,i){var a={width:0,height:0,rank:i,borderType:t},s=o[t][i-1],u=vu.addDummyNode(e,"border",a,r);o[t][i]=u,e.setParent(u,n),s&&e.setEdge(s,u,{weight:1})}var Xu={adjust:function(e){var t=e.graph().rankdir.toLowerCase();"lr"!==t&&"rl"!==t||Ju(e)},undo:function(e){var t=e.graph().rankdir.toLowerCase();"bt"!==t&&"rl"!==t||function(e){ou.forEach(e.nodes(),function(t){Zu(e.node(t))}),ou.forEach(e.edges(),function(t){var r=e.edge(t);ou.forEach(r.points,Zu),ou.has(r,"y")&&Zu(r)})}(e);"lr"!==t&&"rl"!==t||(!function(e){ou.forEach(e.nodes(),function(t){ec(e.node(t))}),ou.forEach(e.edges(),function(t){var r=e.edge(t);ou.forEach(r.points,ec),ou.has(r,"x")&&ec(r)})}(e),Ju(e))}};function Ju(e){ou.forEach(e.nodes(),function(t){Ku(e.node(t))}),ou.forEach(e.edges(),function(t){Ku(e.edge(t))})}function Ku(e){var t=e.width;e.width=e.height,e.height=t}function Zu(e){e.y=-e.y}function ec(e){var t=e.x;e.x=e.y,e.y=t}var tc=function(e){var t={},r=ou.filter(e.nodes(),function(t){return!e.children(t).length}),n=ou.max(ou.map(r,function(t){return e.node(t).rank})),o=ou.map(ou.range(n+1),function(){return[]});var i=ou.sortBy(r,function(t){return e.node(t).rank});return ou.forEach(i,function r(n){if(!ou.has(t,n)){t[n]=!0;var i=e.node(n);o[i.rank].push(n),ou.forEach(e.successors(n),r)}}),o};var rc=function(e,t){for(var r=0,n=1;n<t.length;++n)r+=nc(e,t[n-1],t[n]);return r};function nc(e,t,r){for(var n=ou.zipObject(r,ou.map(r,function(e,t){return t})),o=ou.flatten(ou.map(t,function(t){return ou.sortBy(ou.map(e.outEdges(t),function(t){return{pos:n[t.w],weight:e.edge(t).weight}}),"pos")}),!0),i=1;i<r.length;)i<<=1;var a=2*i-1;i-=1;var s=ou.map(new Array(a),function(){return 0}),u=0;return ou.forEach(o.forEach(function(e){var t=e.pos+i;s[t]+=e.weight;for(var r=0;t>0;)t%2&&(r+=s[t+1]),s[t=t-1>>1]+=e.weight;u+=e.weight*r})),u}var oc=function(e,t){return ou.map(t,function(t){var r=e.inEdges(t);if(r.length){var n=ou.reduce(r,function(t,r){var n=e.edge(r),o=e.node(r.v);return{sum:t.sum+n.weight*o.order,weight:t.weight+n.weight}},{sum:0,weight:0});return{v:t,barycenter:n.sum/n.weight,weight:n.weight}}return{v:t}})};var ic=function(e,t){var r={};return ou.forEach(e,function(e,t){var n=r[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};ou.isUndefined(e.barycenter)||(n.barycenter=e.barycenter,n.weight=e.weight)}),ou.forEach(t.edges(),function(e){var t=r[e.v],n=r[e.w];ou.isUndefined(t)||ou.isUndefined(n)||(n.indegree++,t.out.push(r[e.w]))}),function(e){var t=[];function r(e){return function(t){var r,n,o,i;t.merged||(ou.isUndefined(t.barycenter)||ou.isUndefined(e.barycenter)||t.barycenter>=e.barycenter)&&(n=t,o=0,i=0,(r=e).weight&&(o+=r.barycenter*r.weight,i+=r.weight),n.weight&&(o+=n.barycenter*n.weight,i+=n.weight),r.vs=n.vs.concat(r.vs),r.barycenter=o/i,r.weight=i,r.i=Math.min(n.i,r.i),n.merged=!0)}}function n(t){return function(r){r.in.push(t),0==--r.indegree&&e.push(r)}}for(;e.length;){var o=e.pop();t.push(o),ou.forEach(o.in.reverse(),r(o)),ou.forEach(o.out,n(o))}return ou.map(ou.filter(t,function(e){return!e.merged}),function(e){return ou.pick(e,["vs","i","barycenter","weight"])})}(ou.filter(r,function(e){return!e.indegree}))};var ac=function(e,t){var r=vu.partition(e,function(e){return ou.has(e,"barycenter")}),n=r.lhs,o=ou.sortBy(r.rhs,function(e){return-e.i}),i=[],a=0,s=0,u=0;n.sort((c=!!t,function(e,t){return e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:c?t.i-e.i:e.i-t.i})),u=sc(i,o,u),ou.forEach(n,function(e){u+=e.vs.length,i.push(e.vs),a+=e.barycenter*e.weight,s+=e.weight,u=sc(i,o,u)});var c;var l={vs:ou.flatten(i,!0)};s&&(l.barycenter=a/s,l.weight=s);return l};function sc(e,t,r){for(var n;t.length&&(n=ou.last(t)).i<=r;)t.pop(),e.push(n.vs),r++;return r}var uc=function e(t,r,n,o){var i=t.children(r);var a=t.node(r);var s=a?a.borderLeft:void 0;var u=a?a.borderRight:void 0;var c={};s&&(i=ou.filter(i,function(e){return e!==s&&e!==u}));var l=oc(t,i);ou.forEach(l,function(r){if(t.children(r.v).length){var i=e(t,r.v,n,o);c[r.v]=i,ou.has(i,"barycenter")&&(a=r,s=i,ou.isUndefined(a.barycenter)?(a.barycenter=s.barycenter,a.weight=s.weight):(a.barycenter=(a.barycenter*a.weight+s.barycenter*s.weight)/(a.weight+s.weight),a.weight+=s.weight))}var a,s});var h=ic(l,n);!function(e,t){ou.forEach(e,function(e){e.vs=ou.flatten(e.vs.map(function(e){return t[e]?t[e].vs:e}),!0)})}(h,c);var f=ac(h,o);if(s&&(f.vs=ou.flatten([s,f.vs,u],!0),t.predecessors(s).length)){var d=t.node(t.predecessors(s)[0]),p=t.node(t.predecessors(u)[0]);ou.has(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+d.order+p.order)/(f.weight+2),f.weight+=2}return f};var cc=Ua.Graph,lc=function(e,t,r){var n=function(e){var t;for(;e.hasNode(t=ou.uniqueId("_root")););return t}(e),o=new cc({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(t){return e.node(t)});return ou.forEach(e.nodes(),function(i){var a=e.node(i),s=e.parent(i);(a.rank===t||a.minRank<=t&&t<=a.maxRank)&&(o.setNode(i),o.setParent(i,s||n),ou.forEach(e[r](i),function(t){var r=t.v===i?t.w:t.v,n=o.edge(r,i),a=ou.isUndefined(n)?0:n.weight;o.setEdge(r,i,{weight:e.edge(t).weight+a})}),ou.has(a,"minRank")&&o.setNode(i,{borderLeft:a.borderLeft[t],borderRight:a.borderRight[t]}))}),o};var hc=function(e,t,r){var n,o={};ou.forEach(r,function(r){for(var i,a,s=e.parent(r);s;){if((i=e.parent(s))?(a=o[i],o[i]=s):(a=n,n=s),a&&a!==s)return void t.setEdge(a,s);s=i}})};var fc=Ua.Graph,dc=function(e){var t=vu.maxRank(e),r=pc(e,ou.range(1,t+1),"inEdges"),n=pc(e,ou.range(t-1,-1,-1),"outEdges"),o=tc(e);vc(e,o);for(var i,a=Number.POSITIVE_INFINITY,s=0,u=0;u<4;++s,++u){gc(s%2?r:n,s%4>=2),o=vu.buildLayerMatrix(e);var c=rc(e,o);c<a&&(u=0,i=ou.cloneDeep(o),a=c)}vc(e,i)};function pc(e,t,r){return ou.map(t,function(t){return lc(e,t,r)})}function gc(e,t){var r=new fc;ou.forEach(e,function(e){var n=e.graph().root,o=uc(e,n,r,t);ou.forEach(o.vs,function(t,r){e.node(t).order=r}),hc(e,r,o.vs)})}function vc(e,t){ou.forEach(t,function(t){ou.forEach(t,function(t,r){e.node(t).order=r})})}var yc=Ua.Graph,mc=function(e){var t,r=vu.buildLayerMatrix(e),n=ou.merge(_c(e,r),bc(e,r)),o={};ou.forEach(["u","d"],function(i){t="u"===i?r:ou.values(r).reverse(),ou.forEach(["l","r"],function(r){"r"===r&&(t=ou.map(t,function(e){return ou.values(e).reverse()}));var a=("u"===i?e.predecessors:e.successors).bind(e),s=Ec(e,t,n,a),u=kc(e,t,s.root,s.align,"r"===r);"r"===r&&(u=ou.mapValues(u,function(e){return-e})),o[i+r]=u})});var i=Dc(e,o);return Sc(o,i),Cc(o,e.graph().align)};function _c(e,t){var r={};return ou.reduce(t,function(t,n){var o=0,i=0,a=t.length,s=ou.last(n);return ou.forEach(n,function(t,u){var c=function(e,t){if(e.node(t).dummy)return ou.find(e.predecessors(t),function(t){return e.node(t).dummy})}(e,t),l=c?e.node(c).order:a;(c||t===s)&&(ou.forEach(n.slice(i,u+1),function(t){ou.forEach(e.predecessors(t),function(n){var i=e.node(n),a=i.order;!(a<o||l<a)||i.dummy&&e.node(t).dummy||wc(r,n,t)})}),i=u+1,o=l)}),n}),r}function bc(e,t){var r={};function n(t,n,o,i,a){var s;ou.forEach(ou.range(n,o),function(n){s=t[n],e.node(s).dummy&&ou.forEach(e.predecessors(s),function(t){var n=e.node(t);n.dummy&&(n.order<i||n.order>a)&&wc(r,t,s)})})}return ou.reduce(t,function(t,r){var o,i=-1,a=0;return ou.forEach(r,function(s,u){if("border"===e.node(s).dummy){var c=e.predecessors(s);c.length&&(o=e.node(c[0]).order,n(r,a,u,i,o),a=u,i=o)}n(r,a,r.length,o,t.length)}),r}),r}function wc(e,t,r){if(t>r){var n=t;t=r,r=n}var o=e[t];o||(e[t]=o={}),o[r]=!0}function xc(e,t,r){if(t>r){var n=t;t=r,r=n}return ou.has(e[t],r)}function Ec(e,t,r,n){var o={},i={},a={};return ou.forEach(t,function(e){ou.forEach(e,function(e,t){o[e]=e,i[e]=e,a[e]=t})}),ou.forEach(t,function(e){var t=-1;ou.forEach(e,function(e){var s=n(e);if(s.length)for(var u=((s=ou.sortBy(s,function(e){return a[e]})).length-1)/2,c=Math.floor(u),l=Math.ceil(u);c<=l;++c){var h=s[c];i[e]===e&&t<a[h]&&!xc(r,e,h)&&(i[h]=e,i[e]=o[e]=o[h],t=a[h])}})}),{root:o,align:i}}function kc(e,t,r,n,o){var i={},a=function(e,t,r,n){var o=new yc,i=e.graph(),a=function(e,t,r){return function(n,o,i){var a,s=n.node(o),u=n.node(i),c=0;if(c+=s.width/2,ou.has(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":a=-s.width/2;break;case"r":a=s.width/2}if(a&&(c+=r?a:-a),a=0,c+=(s.dummy?t:e)/2,c+=(u.dummy?t:e)/2,c+=u.width/2,ou.has(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":a=u.width/2;break;case"r":a=-u.width/2}return a&&(c+=r?a:-a),a=0,c}}(i.nodesep,i.edgesep,n);return ou.forEach(t,function(t){var n;ou.forEach(t,function(t){var i=r[t];if(o.setNode(i),n){var s=r[n],u=o.edge(s,i);o.setEdge(s,i,Math.max(a(e,t,n),u||0))}n=t})}),o}(e,t,r,o),s=o?"borderLeft":"borderRight";function u(e,t){for(var r=a.nodes(),n=r.pop(),o={};n;)o[n]?e(n):(o[n]=!0,r.push(n),r=r.concat(t(n))),n=r.pop()}return u(function(e){i[e]=a.inEdges(e).reduce(function(e,t){return Math.max(e,i[t.v]+a.edge(t))},0)},a.predecessors.bind(a)),u(function(t){var r=a.outEdges(t).reduce(function(e,t){return Math.min(e,i[t.w]-a.edge(t))},Number.POSITIVE_INFINITY),n=e.node(t);r!==Number.POSITIVE_INFINITY&&n.borderType!==s&&(i[t]=Math.max(i[t],r))},a.successors.bind(a)),ou.forEach(n,function(e){i[e]=i[r[e]]}),i}function Dc(e,t){return ou.minBy(ou.values(t),function(t){var r=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY;return ou.forIn(t,function(t,o){var i=function(e,t){return e.node(t).width}(e,o)/2;r=Math.max(t+i,r),n=Math.min(t-i,n)}),r-n})}function Sc(e,t){var r=ou.values(t),n=ou.min(r),o=ou.max(r);ou.forEach(["u","d"],function(r){ou.forEach(["l","r"],function(i){var a,s=r+i,u=e[s];if(u!==t){var c=ou.values(u);(a="l"===i?n-ou.min(c):o-ou.max(c))&&(e[s]=ou.mapValues(u,function(e){return e+a}))}})})}function Cc(e,t){return ou.mapValues(e.ul,function(r,n){if(t)return e[t.toLowerCase()][n];var o=ou.sortBy(ou.map(e,n));return(o[1]+o[2])/2})}var Ac=mc,jc=function(e){(function(e){var t=vu.buildLayerMatrix(e),r=e.graph().ranksep,n=0;ou.forEach(t,function(t){var o=ou.max(ou.map(t,function(t){return e.node(t).height}));ou.forEach(t,function(t){e.node(t).y=n+o/2}),n+=o+r})})(e=vu.asNonCompoundGraph(e)),ou.forEach(Ac(e),function(t,r){e.node(r).x=t})};var Pc=vu.normalizeRanks,Fc=vu.removeEmptyRanks,Mc=vu,Oc=Ua.Graph,Nc=function(e,t){var r=t&&t.debugTiming?Mc.time:Mc.notime;r("layout",function(){var t=r(" buildLayoutGraph",function(){return function(e){var t=new Oc({multigraph:!0,compound:!0}),r=Hc(e.graph());return t.setGraph(ou.merge({},Tc,Gc(r,Ic),ou.pick(r,Lc))),ou.forEach(e.nodes(),function(r){var n=Hc(e.node(r));t.setNode(r,ou.defaults(Gc(n,Qc),Rc)),t.setParent(r,e.parent(r))}),ou.forEach(e.edges(),function(r){var n=Hc(e.edge(r));t.setEdge(r,ou.merge({},zc,Gc(n,Bc),ou.pick(n,Vc)))}),t}(e)});r(" runLayout",function(){!function(e,t){t(" makeSpaceForEdgeLabels",function(){!function(e){var t=e.graph();t.ranksep/=2,ou.forEach(e.edges(),function(r){var n=e.edge(r);n.minlen*=2,"c"!==n.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?n.width+=n.labeloffset:n.height+=n.labeloffset)})}(e)}),t(" removeSelfEdges",function(){!function(e){ou.forEach(e.edges(),function(t){if(t.v===t.w){var r=e.node(t.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}(e)}),t(" acyclic",function(){pu.run(e)}),t(" nestingGraph.run",function(){qu.run(e)}),t(" rank",function(){Gu(Mc.asNonCompoundGraph(e))}),t(" injectEdgeLabelProxies",function(){!function(e){ou.forEach(e.edges(),function(t){var r=e.edge(t);if(r.width&&r.height){var n=e.node(t.v),o=e.node(t.w),i={rank:(o.rank-n.rank)/2+n.rank,e:t};Mc.addDummyNode(e,"edge-proxy",i,"_ep")}})}(e)}),t(" removeEmptyRanks",function(){Fc(e)}),t(" nestingGraph.cleanup",function(){qu.cleanup(e)}),t(" normalizeRanks",function(){Pc(e)}),t(" assignRankMinMax",function(){!function(e){var t=0;ou.forEach(e.nodes(),function(r){var n=e.node(r);n.borderTop&&(n.minRank=e.node(n.borderTop).rank,n.maxRank=e.node(n.borderBottom).rank,t=ou.max(t,n.maxRank))}),e.graph().maxRank=t}(e)}),t(" removeEdgeLabelProxies",function(){!function(e){ou.forEach(e.nodes(),function(t){var r=e.node(t);"edge-proxy"===r.dummy&&(e.edge(r.e).labelRank=r.rank,e.removeNode(t))})}(e)}),t(" normalize.run",function(){_u.run(e)}),t(" parentDummyChains",function(){Wu(e)}),t(" addBorderSegments",function(){Yu(e)}),t(" order",function(){dc(e)}),t(" insertSelfEdges",function(){!function(e){var t=Mc.buildLayerMatrix(e);ou.forEach(t,function(t){var r=0;ou.forEach(t,function(t,n){var o=e.node(t);o.order=n+r,ou.forEach(o.selfEdges,function(t){Mc.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:o.rank,order:n+ ++r,e:t.e,label:t.label},"_se")}),delete o.selfEdges})})}(e)}),t(" adjustCoordinateSystem",function(){Xu.adjust(e)}),t(" position",function(){jc(e)}),t(" positionSelfEdges",function(){!function(e){ou.forEach(e.nodes(),function(t){var r=e.node(t);if("selfedge"===r.dummy){var n=e.node(r.e.v),o=n.x+n.width/2,i=n.y,a=r.x-o,s=n.height/2;e.setEdge(r.e,r.label),e.removeNode(t),r.label.points=[{x:o+2*a/3,y:i-s},{x:o+5*a/6,y:i-s},{x:o+a,y:i},{x:o+5*a/6,y:i+s},{x:o+2*a/3,y:i+s}],r.label.x=r.x,r.label.y=r.y}})}(e)}),t(" removeBorderNodes",function(){!function(e){ou.forEach(e.nodes(),function(t){if(e.children(t).length){var r=e.node(t),n=e.node(r.borderTop),o=e.node(r.borderBottom),i=e.node(ou.last(r.borderLeft)),a=e.node(ou.last(r.borderRight));r.width=Math.abs(a.x-i.x),r.height=Math.abs(o.y-n.y),r.x=i.x+r.width/2,r.y=n.y+r.height/2}}),ou.forEach(e.nodes(),function(t){"border"===e.node(t).dummy&&e.removeNode(t)})}(e)}),t(" normalize.undo",function(){_u.undo(e)}),t(" fixupEdgeLabelCoords",function(){!function(e){ou.forEach(e.edges(),function(t){var r=e.edge(t);if(ou.has(r,"x"))switch("l"!==r.labelpos&&"r"!==r.labelpos||(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset}})}(e)}),t(" undoCoordinateSystem",function(){Xu.undo(e)}),t(" translateGraph",function(){!function(e){var t=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,o=0,i=e.graph(),a=i.marginx||0,s=i.marginy||0;function u(e){var i=e.x,a=e.y,s=e.width,u=e.height;t=Math.min(t,i-s/2),r=Math.max(r,i+s/2),n=Math.min(n,a-u/2),o=Math.max(o,a+u/2)}ou.forEach(e.nodes(),function(t){u(e.node(t))}),ou.forEach(e.edges(),function(t){var r=e.edge(t);ou.has(r,"x")&&u(r)}),t-=a,n-=s,ou.forEach(e.nodes(),function(r){var o=e.node(r);o.x-=t,o.y-=n}),ou.forEach(e.edges(),function(r){var o=e.edge(r);ou.forEach(o.points,function(e){e.x-=t,e.y-=n}),ou.has(o,"x")&&(o.x-=t),ou.has(o,"y")&&(o.y-=n)}),i.width=r-t+a,i.height=o-n+s}(e)}),t(" assignNodeIntersects",function(){!function(e){ou.forEach(e.edges(),function(t){var r,n,o=e.edge(t),i=e.node(t.v),a=e.node(t.w);o.points?(r=o.points[0],n=o.points[o.points.length-1]):(o.points=[],r=a,n=i),o.points.unshift(Mc.intersectRect(i,r)),o.points.push(Mc.intersectRect(a,n))})}(e)}),t(" reversePoints",function(){!function(e){ou.forEach(e.edges(),function(t){var r=e.edge(t);r.reversed&&r.points.reverse()})}(e)}),t(" acyclic.undo",function(){pu.undo(e)})}(t,r)}),r(" updateInputGraph",function(){!function(e,t){ou.forEach(e.nodes(),function(r){var n=e.node(r),o=t.node(r);n&&(n.x=o.x,n.y=o.y,t.children(r).length&&(n.width=o.width,n.height=o.height))}),ou.forEach(e.edges(),function(r){var n=e.edge(r),o=t.edge(r);n.points=o.points,ou.has(o,"x")&&(n.x=o.x,n.y=o.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}(e,t)})})};var Ic=["nodesep","edgesep","ranksep","marginx","marginy"],Tc={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Lc=["acyclicer","ranker","rankdir","align"],Qc=["width","height"],Rc={width:0,height:0},Bc=["minlen","weight","width","height","labeloffset"],zc={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Vc=["labelpos"];function Gc(e,t){return ou.mapValues(ou.pick(e,t),Number)}function Hc(e){var t={};return ou.forEach(e,function(e,r){t[r.toLowerCase()]=e}),t}var Uc=Ua.Graph;var Wc={graphlib:Ua,layout:Nc,debug:{debugOrdering:function(e){var t=vu.buildLayerMatrix(e),r=new Uc({compound:!0,multigraph:!0}).setGraph({});return ou.forEach(e.nodes(),function(t){r.setNode(t,{label:t}),r.setParent(t,"layer"+e.node(t).rank)}),ou.forEach(e.edges(),function(e){r.setEdge(e.v,e.w,{},e.name)}),ou.forEach(t,function(e,t){var n="layer"+t;r.setNode(n,{rank:"same"}),ou.reduce(e,function(e,t){return r.setEdge(e,t,{style:"invis"}),t})}),r}},util:{time:vu.time,notime:vu.notime},version:"0.8.5"},qc=Wc.graphlib,Yc=Wc.layout,$c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t}(qc.Graph),Xc=function(){function e(){this._g=new $c({multigraph:!0,compound:!0}),this._g.setGraph({}),this._g.setDefaultNodeLabel(function(){return{debug:"error"}}),this._g.setDefaultEdgeLabel(function(){return{debug:"error"}})}return e.prototype.parent=function(e){return this._g.parent(e)},e.prototype.filterNodes=function(e){var t=[];return this.eachNode(function(r){e(r)&&t.push(r)}),t},e.prototype.eachNode=function(e){this._g.nodes().forEach(function(t){e(t,this.node(t))},this)},e.prototype.filterEdges=function(e){var t=[];return this.eachEdge(function(r){e(r)&&t.push(r)}),t},e.prototype.eachEdge=function(e){this._g.edges().forEach(function(t){e(t,t.v,t.w,this.edge(t))},this)},e.prototype.setData=function(e,t,r,n,o){for(var i=this,a={addedVertices:[],addedEdges:[]},s=e.concat(t),u=0;u<s.length;++u){var c=s[u];o&&this._g.hasNode(c._id)||(this._g.setNode(c._id,c),a.addedVertices.push(c))}for(u=0;u<r.length;++u){var l=r[u];o&&this._g.hasEdge(l._id)||(l._sourceVertex&&l._targetVertex?(this._g.setEdge(l._sourceVertex._id,l._targetVertex._id,l,l._id),a.addedEdges.push(l)):console.log("Bad edge definition"))}if(n)for(u=0;u<n.length;++u)this._g.setParent(n[u].child._id,n[u].parent._id);if(o){var h=r.map(function(e){return e._id});this.filterEdges(function(e){return h.indexOf(e.name)<0}).forEach(function(e){return i._g.removeEdge(e.v,e.w,e.name)});var f=s.map(function(e){return e._id});this.filterNodes(function(e){return f.indexOf(e)<0}).forEach(function(e){return i._g.removeNode(e)})}return a},e.prototype.node=function(e){return this._g.node(e)},e.prototype.nodeCount=function(){return this._g.nodeCount()},e.prototype.nodes=function(){var e=this;return this._g.nodes().map(function(t){return e._g.node(t)})},e.prototype.nodeEdges=function(e){return this._g.nodeEdges(e)},e.prototype.edge=function(e){return this._g.edge(e)},e.prototype.edges=function(){var e=this;return this._g.edges().map(function(t){return e._g.edge(t)})},e.prototype.neighbors=function(e){var t=this;return this._g.neighbors(e).map(function(e){return t._g.node(e)})},e.prototype.singleNeighbors=function(e){var t=this;return this._g.neighbors(e).filter(function(e){return 1===t._g.neighbors(e).length}).map(function(e){return t._g.node(e)})},e.prototype.gatherShortestPath=function(e,t){for(var r=[],n=t,o=e[n];o;){if(o.distance<1/0&&o.predecessor){var i=this._g.nodeEdges(n,o.predecessor)[0];r.push(this._g.edge(i))}o=e[n=o.predecessor]}return r},e.prototype.shortestPath=function(e,t){return this.gatherShortestPath(qc.alg.dijkstra(this._g,e),t)},e.prototype.undirectedShortestPath=function(e,t){var r=this;return this.gatherShortestPath(qc.alg.dijkstra(this._g,e,null,function(e){return r._g.nodeEdges(e)}),t)},e.prototype.getJSON=function(){var e=qc.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}," ")},e}();function Jc(e,t){var r;function n(){var n,o,i=r.length,a=0,s=0;for(n=0;n<i;++n)a+=(o=r[n]).x,s+=o.y;for(a=a/i-e,s=s/i-t,n=0;n<i;++n)(o=r[n]).x-=a,o.y-=s}return null==e&&(e=0),null==t&&(t=0),n.initialize=function(e){r=e},n.x=function(t){return arguments.length?(e=+t,n):e},n.y=function(e){return arguments.length?(t=+e,n):t},n}function Kc(e){return function(){return e}}function Zc(){return 1e-6*(Math.random()-.5)}function el(e,t,r,n){if(isNaN(t)||isNaN(r))return e;var o,i,a,s,u,c,l,h,f,d=e._root,p={data:n},g=e._x0,v=e._y0,y=e._x1,m=e._y1;if(!d)return e._root=p,e;for(;d.length;)if((c=t>=(i=(g+y)/2))?g=i:y=i,(l=r>=(a=(v+m)/2))?v=a:m=a,o=d,!(d=d[h=l<<1|c]))return o[h]=p,e;if(s=+e._x.call(null,d.data),u=+e._y.call(null,d.data),t===s&&r===u)return p.next=d,o?o[h]=p:e._root=p,e;do{o=o?o[h]=new Array(4):e._root=new Array(4),(c=t>=(i=(g+y)/2))?g=i:y=i,(l=r>=(a=(v+m)/2))?v=a:m=a}while((h=l<<1|c)==(f=(u>=a)<<1|s>=i));return o[f]=d,o[h]=p,e}function tl(e,t,r,n,o){this.node=e,this.x0=t,this.y0=r,this.x1=n,this.y1=o}function rl(e){return e[0]}function nl(e){return e[1]}function ol(e,t,r){var n=new il(null==t?rl:t,null==r?nl:r,NaN,NaN,NaN,NaN);return null==e?n:n.addAll(e)}function il(e,t,r,n,o,i){this._x=e,this._y=t,this._x0=r,this._y0=n,this._x1=o,this._y1=i,this._root=void 0}function al(e){for(var t={data:e.data},r=t;e=e.next;)r=r.next={data:e.data};return t}var sl=ol.prototype=il.prototype;function ul(e){return e.index}function cl(e,t){var r=e.get(t);if(!r)throw new Error("missing: "+t);return r}function ll(e){var r,n,o,i,a,s=ul,u=function(e){return 1/Math.min(i[e.source.index],i[e.target.index])},c=Kc(30),l=1;function h(t){for(var o=0,i=e.length;o<l;++o)for(var s,u,c,h,f,d,p,g=0;g<i;++g)u=(s=e[g]).source,h=(c=s.target).x+c.vx-u.x-u.vx||Zc(),f=c.y+c.vy-u.y-u.vy||Zc(),h*=d=((d=Math.sqrt(h*h+f*f))-n[g])/d*t*r[g],f*=d,c.vx-=h*(p=a[g]),c.vy-=f*p,u.vx+=h*(p=1-p),u.vy+=f*p}function f(){if(o){var u,c,l=o.length,h=e.length,f=t.map(o,s);for(u=0,i=new Array(l);u<h;++u)(c=e[u]).index=u,"object"!=typeof c.source&&(c.source=cl(f,c.source)),"object"!=typeof c.target&&(c.target=cl(f,c.target)),i[c.source.index]=(i[c.source.index]||0)+1,i[c.target.index]=(i[c.target.index]||0)+1;for(u=0,a=new Array(h);u<h;++u)c=e[u],a[u]=i[c.source.index]/(i[c.source.index]+i[c.target.index]);r=new Array(h),d(),n=new Array(h),p()}}function d(){if(o)for(var t=0,n=e.length;t<n;++t)r[t]=+u(e[t],t,e)}function p(){if(o)for(var t=0,r=e.length;t<r;++t)n[t]=+c(e[t],t,e)}return null==e&&(e=[]),h.initialize=function(e){o=e,f()},h.links=function(t){return arguments.length?(e=t,f(),h):e},h.id=function(e){return arguments.length?(s=e,h):s},h.iterations=function(e){return arguments.length?(l=+e,h):l},h.strength=function(e){return arguments.length?(u="function"==typeof e?e:Kc(+e),d(),h):u},h.distance=function(e){return arguments.length?(c="function"==typeof e?e:Kc(+e),p(),h):c},h}sl.copy=function(){var e,t,r=new il(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=al(n),r;for(e=[{source:n,target:r._root=new Array(4)}];n=e.pop();)for(var o=0;o<4;++o)(t=n.source[o])&&(t.length?e.push({source:t,target:n.target[o]=new Array(4)}):n.target[o]=al(t));return r},sl.add=function(e){var t=+this._x.call(null,e),r=+this._y.call(null,e);return el(this.cover(t,r),t,r,e)},sl.addAll=function(e){var t,r,n,o,i=e.length,a=new Array(i),s=new Array(i),u=1/0,c=1/0,l=-1/0,h=-1/0;for(r=0;r<i;++r)isNaN(n=+this._x.call(null,t=e[r]))||isNaN(o=+this._y.call(null,t))||(a[r]=n,s[r]=o,n<u&&(u=n),n>l&&(l=n),o<c&&(c=o),o>h&&(h=o));if(u>l||c>h)return this;for(this.cover(u,c).cover(l,h),r=0;r<i;++r)el(this,a[r],s[r],e[r]);return this},sl.cover=function(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var r=this._x0,n=this._y0,o=this._x1,i=this._y1;if(isNaN(r))o=(r=Math.floor(e))+1,i=(n=Math.floor(t))+1;else{for(var a,s,u=o-r,c=this._root;r>e||e>=o||n>t||t>=i;)switch(s=(t<n)<<1|e<r,(a=new Array(4))[s]=c,c=a,u*=2,s){case 0:o=r+u,i=n+u;break;case 1:r=o-u,i=n+u;break;case 2:o=r+u,n=i-u;break;case 3:r=o-u,n=i-u}this._root&&this._root.length&&(this._root=c)}return this._x0=r,this._y0=n,this._x1=o,this._y1=i,this},sl.data=function(){var e=[];return this.visit(function(t){if(!t.length)do{e.push(t.data)}while(t=t.next)}),e},sl.extent=function(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]]},sl.find=function(e,t,r){var n,o,i,a,s,u,c,l=this._x0,h=this._y0,f=this._x1,d=this._y1,p=[],g=this._root;for(g&&p.push(new tl(g,l,h,f,d)),null==r?r=1/0:(l=e-r,h=t-r,f=e+r,d=t+r,r*=r);u=p.pop();)if(!(!(g=u.node)||(o=u.x0)>f||(i=u.y0)>d||(a=u.x1)<l||(s=u.y1)<h))if(g.length){var v=(o+a)/2,y=(i+s)/2;p.push(new tl(g[3],v,y,a,s),new tl(g[2],o,y,v,s),new tl(g[1],v,i,a,y),new tl(g[0],o,i,v,y)),(c=(t>=y)<<1|e>=v)&&(u=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=u)}else{var m=e-+this._x.call(null,g.data),_=t-+this._y.call(null,g.data),b=m*m+_*_;if(b<r){var w=Math.sqrt(r=b);l=e-w,h=t-w,f=e+w,d=t+w,n=g.data}}return n},sl.remove=function(e){if(isNaN(i=+this._x.call(null,e))||isNaN(a=+this._y.call(null,e)))return this;var t,r,n,o,i,a,s,u,c,l,h,f,d=this._root,p=this._x0,g=this._y0,v=this._x1,y=this._y1;if(!d)return this;if(d.length)for(;;){if((c=i>=(s=(p+v)/2))?p=s:v=s,(l=a>=(u=(g+y)/2))?g=u:y=u,t=d,!(d=d[h=l<<1|c]))return this;if(!d.length)break;(t[h+1&3]||t[h+2&3]||t[h+3&3])&&(r=t,f=h)}for(;d.data!==e;)if(n=d,!(d=d.next))return this;return(o=d.next)&&delete d.next,n?(o?n.next=o:delete n.next,this):t?(o?t[h]=o:delete t[h],(d=t[0]||t[1]||t[2]||t[3])&&d===(t[3]||t[2]||t[1]||t[0])&&!d.length&&(r?r[f]=d:this._root=d),this):(this._root=o,this)},sl.removeAll=function(e){for(var t=0,r=e.length;t<r;++t)this.remove(e[t]);return this},sl.root=function(){return this._root},sl.size=function(){var e=0;return this.visit(function(t){if(!t.length)do{++e}while(t=t.next)}),e},sl.visit=function(e){var t,r,n,o,i,a,s=[],u=this._root;for(u&&s.push(new tl(u,this._x0,this._y0,this._x1,this._y1));t=s.pop();)if(!e(u=t.node,n=t.x0,o=t.y0,i=t.x1,a=t.y1)&&u.length){var c=(n+i)/2,l=(o+a)/2;(r=u[3])&&s.push(new tl(r,c,l,i,a)),(r=u[2])&&s.push(new tl(r,n,l,c,a)),(r=u[1])&&s.push(new tl(r,c,o,i,l)),(r=u[0])&&s.push(new tl(r,n,o,c,l))}return this},sl.visitAfter=function(e){var t,r=[],n=[];for(this._root&&r.push(new tl(this._root,this._x0,this._y0,this._x1,this._y1));t=r.pop();){var o=t.node;if(o.length){var i,a=t.x0,s=t.y0,u=t.x1,c=t.y1,l=(a+u)/2,h=(s+c)/2;(i=o[0])&&r.push(new tl(i,a,s,l,h)),(i=o[1])&&r.push(new tl(i,l,s,u,h)),(i=o[2])&&r.push(new tl(i,a,h,l,c)),(i=o[3])&&r.push(new tl(i,l,h,u,c))}n.push(t)}for(;t=n.pop();)e(t.node,t.x0,t.y0,t.x1,t.y1);return this},sl.x=function(e){return arguments.length?(this._x=e,this):this._x},sl.y=function(e){return arguments.length?(this._y=e,this):this._y};var hl,fl,dl=0,pl=0,gl=0,vl=1e3,yl=0,ml=0,_l=0,bl="object"==typeof performance&&performance.now?performance:Date,wl="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function xl(){return ml||(wl(El),ml=bl.now()+_l)}function El(){ml=0}function kl(){this._call=this._time=this._next=null}function Dl(e,t,r){var n=new kl;return n.restart(e,t,r),n}function Sl(){ml=(yl=bl.now())+_l,dl=pl=0;try{!function(){xl(),++dl;for(var e,t=hl;t;)(e=ml-t._time)>=0&&t._call.call(null,e),t=t._next;--dl}()}finally{dl=0,function(){var e,t,r=hl,n=1/0;for(;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:hl=t);fl=e,Al(n)}(),ml=0}}function Cl(){var e=bl.now(),t=e-yl;t>vl&&(_l-=t,yl=e)}function Al(e){dl||(pl&&(pl=clearTimeout(pl)),e-ml>24?(e<1/0&&(pl=setTimeout(Sl,e-bl.now()-_l)),gl&&(gl=clearInterval(gl))):(gl||(yl=bl.now(),gl=setInterval(Cl,vl)),dl=1,wl(Sl)))}function jl(e){return e.x}function Pl(e){return e.y}kl.prototype=Dl.prototype={constructor:kl,restart:function(e,t,r){if("function"!=typeof e)throw new TypeError("callback is not a function");r=(null==r?xl():+r)+(null==t?0:+t),this._next||fl===this||(fl?fl._next=this:hl=this,fl=this),this._call=e,this._time=r,Al()},stop:function(){this._call&&(this._call=null,this._time=1/0,Al())}};var Fl=10,Ml=Math.PI*(3-Math.sqrt(5));function Ol(e){var r,n=1,o=.001,i=1-Math.pow(o,1/300),a=0,s=.6,u=t.map(),c=Dl(h),l=t.dispatch("tick","end");function h(){f(),l.call("tick",r),n<o&&(c.stop(),l.call("end",r))}function f(t){var o,c,l=e.length;void 0===t&&(t=1);for(var h=0;h<t;++h)for(n+=(a-n)*i,u.each(function(e){e(n)}),o=0;o<l;++o)null==(c=e[o]).fx?c.x+=c.vx*=s:(c.x=c.fx,c.vx=0),null==c.fy?c.y+=c.vy*=s:(c.y=c.fy,c.vy=0);return r}function d(){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 o=Fl*Math.sqrt(r),i=r*Ml;t.x=o*Math.cos(i),t.y=o*Math.sin(i)}(isNaN(t.vx)||isNaN(t.vy))&&(t.vx=t.vy=0)}}function p(t){return t.initialize&&t.initialize(e),t}return null==e&&(e=[]),d(),r={tick:f,restart:function(){return c.restart(h),r},stop:function(){return c.stop(),r},nodes:function(t){return arguments.length?(e=t,d(),u.each(p),r):e},alpha:function(e){return arguments.length?(n=+e,r):n},alphaMin:function(e){return arguments.length?(o=+e,r):o},alphaDecay:function(e){return arguments.length?(i=+e,r):+i},alphaTarget:function(e){return arguments.length?(a=+e,r):a},velocityDecay:function(e){return arguments.length?(s=1-e,r):1-s},force:function(e,t){return arguments.length>1?(null==t?u.remove(e):u.set(e,p(t)),r):u.get(e)},find:function(t,r,n){var o,i,a,s,u,c=0,l=e.length;for(null==n?n=1/0:n*=n,c=0;c<l;++c)(a=(o=t-(s=e[c]).x)*o+(i=r-s.y)*i)<n&&(u=s,n=a);return u},on:function(e,t){return arguments.length>1?(l.on(e,t),r):l.on(e)}}}function Nl(){var e,t,r,n,o=Kc(-30),i=1,a=1/0,s=.81;function u(n){var o,i=e.length,a=ol(e,jl,Pl).visitAfter(l);for(r=n,o=0;o<i;++o)t=e[o],a.visit(h)}function c(){if(e){var t,r,i=e.length;for(n=new Array(i),t=0;t<i;++t)r=e[t],n[r.index]=+o(r,t,e)}}function l(e){var t,r,o,i,a,s=0,u=0;if(e.length){for(o=i=a=0;a<4;++a)(t=e[a])&&(r=Math.abs(t.value))&&(s+=t.value,u+=r,o+=r*t.x,i+=r*t.y);e.x=o/u,e.y=i/u}else{(t=e).x=t.data.x,t.y=t.data.y;do{s+=n[t.data.index]}while(t=t.next)}e.value=s}function h(e,o,u,c){if(!e.value)return!0;var l=e.x-t.x,h=e.y-t.y,f=c-o,d=l*l+h*h;if(f*f/s<d)return d<a&&(0===l&&(d+=(l=Zc())*l),0===h&&(d+=(h=Zc())*h),d<i&&(d=Math.sqrt(i*d)),t.vx+=l*e.value*r/d,t.vy+=h*e.value*r/d),!0;if(!(e.length||d>=a)){(e.data!==t||e.next)&&(0===l&&(d+=(l=Zc())*l),0===h&&(d+=(h=Zc())*h),d<i&&(d=Math.sqrt(i*d)));do{e.data!==t&&(f=n[e.data.index]*r/d,t.vx+=l*f,t.vy+=h*f)}while(e=e.next)}}return u.initialize=function(t){e=t,c()},u.strength=function(e){return arguments.length?(o="function"==typeof e?e:Kc(+e),c(),u):o},u.distanceMin=function(e){return arguments.length?(i=e*e,u):Math.sqrt(i)},u.distanceMax=function(e){return arguments.length?(a=e*e,u):Math.sqrt(a)},u.theta=function(e){return arguments.length?(s=e*e,u):Math.sqrt(s)},u}function Il(e,t,r,n){var o=this;this.pos={};n=n||(t<r?t-0:r-0)/2;var i=e.nodeCount(),a=-Math.PI/2,s=2*Math.PI/i;e.eachNode(function(e,i){var u=i.getBBox();o.pos[e]={x:i.fixed?i.x:t/2+Math.cos(a)*(n-0),y:i.fixed?i.y:r/2+Math.sin(a)*(n-0),width:u.width,height:u.height},a+=s})}function Tl(e,t,r,n){n=n||{};var o=this;this.pos={},this.vertices=[],this.vertexMap={},e.eachNode(function(t){var 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};o.vertices.push(i),o.vertexMap[t]=i}),this.edges=[],e.eachEdge(function(e,t,r){o.edges.push({source:t,target:r})});var i=ll().id(function(e){return e.id}).distance(n.linkDistance).strength(n.linkStrength),a=Nl().strength(function(e){var t=e.value.getBBox();return n.charge*Math.max(t.width,t.height)});if(this.force=Ol().force("link",i).force("charge",a).force("center",Jc(t/2,r/2)).velocityDecay(n.oneShot?.1:n.friction).nodes(this.vertices),i.links(this.edges),n.oneShot){this.force.restart();var s=e.nodeCount();s=Math.min(s*s,500);for(var u=0;u<s;++u)this.force.tick();this.force.stop()}}function Ll(e,t,r,n){var o=new qc.Graph({multigraph:!0,compound:!0}).setGraph(n).setDefaultNodeLabel(function(){return{}}).setDefaultEdgeLabel(function(){return{}});e.eachNode(function(t){var r=e.node(t).getBBox();o.setNode(t,{width:r.width,height:r.height})}),e.eachEdge(function(t,r,i){var a=e.edge(t);o.setEdge(r,i,{weight:a.weight()},a._id),n.digraph||o.setEdge(i,r,{weight:a.weight()},a._id)}),e.eachNode(function(t){o.setParent(t,e.parent(t))}),this.dagreLayout=Yc(o,{debugTiming:!1});var i=-o.graph().width/2,a=-o.graph().height/2;o.nodes().forEach(function(e){var n=o.node(e);n.x+=i+t/2,n.y+=a+r/2}),o.edges().forEach(function(e){for(var n=o.edge(e),s=0;s<n.points.length;++s)n.points[s].x+=i+t/2,n.points[s].y+=a+r/2}),this.digraph=o}Il.prototype.nodePos=function(e){return this.pos[e]},Il.prototype.edgePoints=function(e){return[]},Tl.prototype.nodePos=function(e){return this.vertexMap[e]},Tl.prototype.edgePoints=function(e){return[]},Ll.prototype.nodePos=function(e){return this.digraph.node(e)},Ll.prototype.edgePoints=function(e){return this.digraph.edge(e._sourceVertex.id(),e._targetVertex.id(),e._id).points};L(".graph_Subgraph .border{fill:none;stroke:#1f77b4;stroke-width:1px;pointer-events:none}.graph_Subgraph.selected>rect{stroke:red!important}");var Ql=14,Rl=18,Bl=function(e){function r(){var r=e.call(this)||this;return r._textWidget=(new t.Text).anchor("start").fontSize(Ql),r._buttonMin=(new t.Icon).diameter(Rl).shape_colorStroke("#1f77b4").shape_colorFill("#dcf1ff").image_colorFill("#1f77b4").on("click",function(){r.minClick()},!0).on("dblclick",function(){},!0),r._minState="normal",r}return s(r,e),r.prototype.minState=function(e){return arguments.length?(this._minState=e,this):this._minState},r.prototype.calcIcon=function(){switch(this._minState){case"normal":return"";case"partial":return""}},r.prototype.getBBox=function(e,t){var r=this.width(),n=this.height();return{x:-r/2,y:-n/2-Ql,width:r,height:n}},r.prototype.enter=function(t,r){e.prototype.enter.call(this,t,r),this._border=r.append("rect").attr("class","border"),this._textWidget.target(t),this._buttonMin.target(t)},r.prototype.update=function(r,n){e.prototype.update.call(this,r,n);var o=this.getBBox();this._border.attr("x",o.x).attr("y",o.y).attr("width",o.width).attr("height",o.height).style("fill",this.border_colorFill()).style("stroke",this.border_colorStroke()),this.border_colorFill_exists()&&!this.title_colorFill_exists()&&this.title_colorFill(t.Palette.textColor(this.border_colorFill())),this._textWidget.pos({x:o.x+4,y:o.y+Ql}).width(this.width()-8).text(this.showTitle()?this.title():"").render(),this._buttonMin.visible(this.showMinMax()).pos({x:o.x+o.width-(Rl/2+4),y:o.y+(Rl/2+4)}).faChar(this.calcIcon()).render()},r.prototype.exit=function(t,r){this._buttonMin.target(null),this._textWidget.target(null),this._border.remove(),e.prototype.exit.call(this,t,r)},r.prototype.intersection=function(e,t){var r=null;return[].forEach(function(e){(null===r||r.d>e.d)&&(r=e)}),r&&r.i?r.i:null},r.prototype.click=function(e){console.log("Clicked: "+e.id)},r.prototype.minClick=function(){switch(this._minState){case"normal":this._minState="partial";break;case"partial":this._minState="normal"}this._buttonMin.faChar(this.calcIcon()).render()},r}(t.SVGWidget);Bl.prototype._class+=" graph_Subgraph",Bl.prototype.publish("border_colorStroke",null,"html-color","Stroke Color",null,{optional:!0}),Bl.prototype.publish("border_colorFill",null,"html-color","Fill Color",null,{optional:!0}),Bl.prototype.publish("showTitle",!0,"boolean","Show Title",null,{tags:["Basic"]}),Bl.prototype.publish("title","","string","Title",null,{tags:["Basic"]}),Bl.prototype.publishProxy("titleFontSize","_textWidget","fontSize"),Bl.prototype.publishProxy("title_colorFill","_textWidget","colorFill"),Bl.prototype.publish("showMinMax",!1,"boolean","Show Min/Max",null,{tags:["Basic"]});L(".graph_Vertex.selected .common_Shape{stroke:red!important}");var zl=function(e){function r(){var r=e.call(this)||this;return r._icon=new t.Icon,r._textBox=new t.TextBox,r._annotationWidgets={},r.pos({x:void 0,y:void 0}),r}return s(r,e),r.prototype.getIconBBox=function(){var 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}},r.prototype.getBBox=function(e,t){var r=this.getIconBBox(),n=this._textBox.getBBox(!0),o=Math.min(r.x,n.x),i=Math.min(r.y,n.y);return{x:o,y:i,width:Math.max(r.x+r.width,n.x+n.width)-o,height:Math.max(r.y+r.height,n.y+n.height)-i}},r.prototype.enter=function(t,r){var n=this;e.prototype.enter.call(this,t,r),delete this._prevHash,this._icon.target(t),this._textBox.target(t),r.on("mouseover",function(e){return n.mouseover(e.data())}).on("mouseout",function(e){return n.mouseout(e.data())})},r.prototype.update=function(r,n){e.prototype.update.call(this,r,n);var o=this.hashSum();if(this._prevHash!==o){this._prevHash=o,n.classed("centroid",this.centroid()),n.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();var i=this.getIconBBox();this._icon.move(i);var a=this,s=n.selectAll(".annotation").data(this.annotationIcons()),u=s.enter().append("g").attr("class","annotation").each(function(e,r){a._annotationWidgets[r]=(new t.Icon).target(this).shape("square")}),c=this._textBox.getBBox(!0),l=c.width/2,h=c.height/2;u.merge(s).each(function(e,t){var r=a._annotationWidgets[t];for(var n in r.diameter(a.annotationDiameter()).shape_colorFill(a.textbox_shape_colorFill()).shape_colorStroke(a.textbox_shape_colorStroke()),e)r[n]?r[n](e[n]):window.__hpcc_debug&&console.log("Invalid annotation property: "+n);r.render();var o=r.getBBox(!0);r.move({x:l-o.width/2+4,y:h+o.height/2-4}),l-=o.width+a.annotationSpacing()}),s.exit().each(function(e,r){var n=t.select(this);a._annotationWidgets[r].target(null),delete a._annotationWidgets[r],n.remove()})}},r.prototype.exit=function(t,r){for(var n in this._annotationWidgets)this._annotationWidgets[n].target(null);this._icon.target(null),this._textBox.target(null),e.prototype.exit.call(this,t,r)},r.prototype.contains=function(e){return this._icon.contains(e)||this._textBox.contains(e)},r.prototype.intersection=function(e,t){var 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},r.prototype.mouseover=function(e){},r.prototype.mouseout=function(e){},r}(t.SVGWidget);zl.prototype._class+=" graph_Vertex",zl.prototype.publishProxy("faChar","_icon"),zl.prototype.publishProxy("imageUrl","_icon"),zl.prototype.publishProxy("icon_diameter","_icon","diameter"),zl.prototype.publishProxy("icon_paddingPercent","_icon","paddingPercent"),zl.prototype.publishProxy("icon_shape_colorFill","_icon","shape_colorFill"),zl.prototype.publishProxy("icon_shape_colorStroke","_icon","shape_colorStroke"),zl.prototype.publishProxy("icon_image_colorFill","_icon","image_colorFill"),zl.prototype.publishProxy("icon_fontFamily","_icon","fontFamily"),zl.prototype.publish("centroid",!1,"boolean","Centroid Vertex"),zl.prototype.publishProxy("text","_textBox"),zl.prototype.publishProxy("anchor","_textBox"),zl.prototype.publishProxy("textbox_shape_colorStroke","_textBox","shape_colorStroke"),zl.prototype.publishProxy("textbox_shape_colorFill","_textBox","shape_colorFill"),zl.prototype.publishProxy("textbox_text_colorFill","_textBox","text_colorFill"),zl.prototype.publishProxy("textbox_text_fontFamily","_textBox","text_fontFamily"),zl.prototype.publish("iconAnchor","start","set","Horizontal anchor position of icon",["","start","middle","end","left"],{tags:["Basic"]}),zl.prototype.publish("iconTooltip","","string","iconTooltip",null,{tags:["Private"]}),zl.prototype.publish("tooltip","","string","Tooltip",null,{tags:["Private"]}),zl.prototype.publish("annotationDiameter",14,"number","Annotation Diameter",null,{tags:["Private"]}),zl.prototype.publish("annotationSpacing",3,"number","Annotation Spacing",null,{tags:["Private"]}),zl.prototype.publish("annotationIcons",[],"array","Annotations",null,{tags:["Private"]});L(".graph_Graph .marker{fill:#656565;stroke:none;stroke-width:1px}.graph_Graph .zoom{fill:none;pointer-events:all}.graph_Graph .selectionBrush{fill:none;stroke:#a9a9a9}.graph_Graph .graphEdge.shortest-path .graph_Edge{stroke:red}");var Vl=function(e){function r(){var r=e.call(this)||this;r._toggleHierarchy=(new t.ToggleButton).faChar("fa-sitemap").tooltip("Hierarchy").on("click",function(){return r.layoutClick("Hierarchy")}),r._toggleForceDirected=(new t.ToggleButton).faChar("fa-expand").tooltip("Force Directed").on("click",function(){return r.layoutClick("ForceDirected")}),r._toggleForceDirected2=(new t.ToggleButton).faChar("fa-arrows").tooltip("Spring").on("click",function(){return r.layoutClick("ForceDirected2")}),r._toggleCircle=(new t.ToggleButton).faChar("fa-circle-o").tooltip("Circle").on("click",function(){return r.layoutClick("Circle")}),r._dataHash=0,r._neighborOffsets=[],n.IGraph.call(r),n.ITooltip.call(r),r.tooltipHTML(function(e){var t;return e instanceof Bl?t=e.title().replace(/\n/g,"<br>"):(e instanceof zl||e instanceof R)&&(t=e.text().replace(/\n/g,"<br>")),t?'<p style="text-align:center">'+t+"</p>":null}),r._drawStartPos="origin";var o=[r._toggleHierarchy,r._toggleForceDirected,r._toggleForceDirected2,r._toggleCircle,new t.Spacer];return r._iconBar.buttons(o.concat(r._iconBar.buttons())),r._graphData=new Xc,r.highlight={zoom:1.1,opacity:.33,edge:"1.25px"},r._selection=new t.Utility.Selection(r),r.zoomToFitLimit(1),r}return s(r,e),r.prototype.iconBarButtons=function(){return this._iconBar.buttons()},r.prototype.layoutClick=function(e){var t=this;this.layout(e),"ForceDirected2"!==e&&this.applyScaleOnLayout(!0),this.layout(e).render(function(e){t.applyScaleOnLayout(!1)})},r.prototype.getOffsetPos=function(){return{x:0,y:0}},r.prototype.size=function(t){return e.prototype.size.apply(this,arguments)},r.prototype.clear=function(){this.data({subgraphs:[],vertices:[],edges:[],hierarchy:[]},!1)},r.prototype.data=function(t,r){var n=e.prototype.data.apply(this,arguments);if(arguments.length){r||(this._graphData=new Xc,this._renderCount=0);var o=this._graphData.setData(t.subgraphs||[],t.vertices||[],t.edges||[],t.hierarchy||[],r||!1);o.addedVertices.length&&this._dataHash++;var i=this;o.addedVertices.forEach(function(e){e._graphID=i._id}),o.addedEdges.forEach(function(e){e._graphID=i._id});var a={};this._graphData.edges().forEach(function(e){a[e._sourceVertex._id]||(a[e._sourceVertex._id]={}),a[e._sourceVertex._id][e._targetVertex._id]||(a[e._sourceVertex._id][e._targetVertex._id]=0);var t=++a[e._sourceVertex._id][e._targetVertex._id];e.arcDepth(16*t)})}return n},r.prototype.graphData=function(){return this._graphData},r.prototype.selection=function(e){return arguments.length?(this._selection.set(e),this):this._selection.get()},r.prototype.linkcolor_default=function(e){return arguments.length?(this._linkcolor=e,this):this._linkcolor},r.prototype.linktooltip_default=function(e){return arguments.length?(this._linktooltip=e,this):this._linktooltip},r.prototype.dragstart=function(e){var r=this;if(this.allowDragging()){var n=t.d3Event();if(n.sourceEvent.stopPropagation(),e.__drag_dx=n.x-e.x(),e.__drag_dy=n.y-e.y(),this._dragging=!0,this.forceLayout){n.active||this.forceLayout.force.alphaTarget(.3).restart();var o=this.forceLayout.vertexMap[e.id()];o.fixed=!0,o.fx=o.x,o.fy=o.y}this._neighborOffsets=[],this.dragSingleNeighbors()&&(this._neighborOffsets=this._graphData.singleNeighbors(e.id()).map(function(r){return t.select(r.target()).raise(),{neighbor:r,offsetX:e.x()-r.x(),offsetY:e.y()-r.y()}}));for(var i=e.target(),a=i.nextSibling;a;)i.parentNode.insertBefore(a,i),a=i.nextSibling;t.Platform.svgMarkerGlitch&&this._graphData.nodeEdges(e.id()).forEach(function(e){var t=r._graphData.edge(e);r._pushMarkers(t.element())})}},r.prototype.dragging=function(e){var r=this;if(this.allowDragging()){var n=t.d3Event();if(n.sourceEvent.stopPropagation(),e.move({x:n.x-e.__drag_dx,y:n.y-e.__drag_dy}),this.forceLayout){var o=this.forceLayout.vertexMap[e.id()];o.fixed=!0,o.fx=n.x-e.__drag_dx,o.fy=n.y-e.__drag_dy}this._neighborOffsets.forEach(function(t){var o=n.x-e.__drag_dx-t.offsetX,i=n.y-e.__drag_dy-t.offsetY;if(r.forceLayout){var a=r.forceLayout.vertexMap[t.neighbor.id()];a.fixed=!0,a.fx=o,a.fy=i}t.neighbor.move({x:o,y:i})}),this.refreshIncidentEdges(e,!0)}},r.prototype.dragend=function(e){var r=this;if(this.allowDragging()){if(t.d3Event().sourceEvent.stopPropagation(),this._dragging=!1,this.snapToGrid()){var n=e.calcSnap(this.snapToGrid());e.move(n[0]),this.refreshIncidentEdges(e,!0)}if(this.forceLayout){var o=this.forceLayout.vertexMap[e.id()];o.fixed=!1,o.fx=null,o.fy=null,this._neighborOffsets.forEach(function(e){var t=r.forceLayout.vertexMap[e.neighbor.id()];t.fixed=!1,t.fx=null,t.fy=null})}this._neighborOffsets=[],t.Platform.svgMarkerGlitch&&this._graphData.nodeEdges(e.id()).forEach(function(e){var t=this._graphData.edge(e);this._popMarkers(t.element())})}},r.prototype.enter=function(r,n){var o=this;e.prototype.enter.call(this,r,n),this._zoomGrab.on("click.clear",function(){o.selectionClearOnBackgroundClick()&&o._selection.clear()}),this._d3Drag=t.drag().on("start",function(e){return o.dragstart(e)}).on("end",function(e){return o.dragend(e)}).on("drag",function(e){return o.dragging(e)}),this.defs=this._renderElement.append("defs"),this.addMarkers(),this._centroidFilter=new t.SVGGlowFilter(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")},r.prototype.getBounds=function(e,t){var r=[[null,null],[null,null]];return e.forEach(function(e){var n=t?t.nodePos(e._id):{x:e.x(),y:e.y(),width:e.width(),height:e.height()},o=n.x-n.width/2,i=n.x+n.width/2,a=n.y-n.height/2,s=n.y+n.height/2;(null===r[0][0]||r[0][0]>o)&&(r[0][0]=o),(null===r[0][1]||r[0][1]>a)&&(r[0][1]=a),(null===r[1][0]||r[1][0]<i)&&(r[1][0]=i),(null===r[1][1]||r[1][1]<s)&&(r[1][1]=s)}),r},r.prototype.getVertexBounds=function(e){return this.getBounds(this._graphData.nodes(),e)},r.prototype.getSelectionBounds=function(e){return this.getBounds(this._selection.get(),e)},r.prototype.centerOnItem=function(e){var t=e.getBBox(!0),r=t.x+t.width/2,n=t.y+t.height/2,o={x:e.x()+r-t.width/2,y:e.y()+n-t.height/2,width:t.width,height:t.height};this.centerOnBBox(o)},r.prototype.zoomToItem=function(e){var t=e.getBBox(!0),r=t.x+t.width/2,n=t.y+t.height/2,o={x:e.x()+r-t.width/2,y:e.y()+n-t.height/2,width:t.width,height:t.height};this.zoomToBBox(o)},r.prototype.updateVertices=function(e,r,n){var o=this.width(),i=this.height(),a=this,s=e.selectAll("#"+this._id+r+" > .graphVertex").data(n,function(e){return e.id()});s.enter().append("g").attr("class","graphVertex").style("opacity",1e-6).on("click.selectionBag",function(e){a._selection.click(e,t.d3Event()),a.selectionChanged()}).on("click",function(e){var r=t.select(this).select(".graph_Vertex"),n=!1;r.empty()||(n=r.classed("selected")),a.vertex_click(a.rowToObj(e.data()),"",n,{vertex:e})}).on("dblclick",function(e){t.d3Event().stopPropagation();var r=t.select(this).select(".graph_Vertex"),n=!1;r.empty()||(n=r.classed("selected")),a.vertex_dblclick(a.rowToObj(e.data()),"",n,{vertex:e})}).on("contextmenu",function(e){var r=t.select(this).select(".graph_Vertex"),n=!1;r.empty()||(n=r.classed("selected")),a.vertex_contextmenu(a.rowToObj(e.data()),"",n,{vertex:e})}).on("mouseout.tooltip",this.tooltip.hide).on("mousemove.tooltip",this.tooltip.show).on("mouseover",function(e){a._dragging||a.vertex_mouseover(t.select(this),e)}).on("mouseout",function(e){a._dragging||a.vertex_mouseout(t.select(this),e)}).each(function(e){t.select(this).style("cursor",a.allowDragging()?"move":"pointer"),e.target(this).pos({x:e.x()||o/2,y:e.y()||i/2}).animationFrameRender(),a.allowDragging()&&t.select(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()){var t=e.calcSnap(a.snapToGrid());e.pos(t[0]).size(t[1]).render(),a.refreshIncidentEdges(e,!1)}}))}).transition().duration(750).style("opacity",1),s.each(function(e){e.animationFrameRender()}),s.exit().each(function(e){e.target(null)}).remove(),s.order()},r.prototype.update=function(r,n){var o=this;e.prototype.update.call(this,r,n),this.tooltip.hide(),this._centroidFilter.update(this.centroidColor());var i=this.layout();this._toggleHierarchy.selected("Hierarchy"===i).render(),this._toggleForceDirected.selected("ForceDirected"===i).render(),this._toggleForceDirected2.selected("ForceDirected2"===i).render(),this._toggleCircle.selected("Circle"===i).render();var a=this;this.updateVertices(this.svgC,"C",this._graphData.nodes().filter(function(e){return"Hierarchy"===o.layout()&&e instanceof Bl})),this.updateVertices(this.svgV,"V",this._graphData.nodes().filter(function(e){return!(e instanceof Bl)}));var s=this.svgE.selectAll("#"+this._id+"E > .graphEdge").data(this.showEdges()?this._graphData.edges():[],function(e){return e.id()});s.enter().append("g").attr("class","graphEdge").style("opacity",1e-6).on("click.selectionBag",function(e){a._selection.click(e,t.d3Event())}).on("click",function(e){var r=t.select(this).select(".graph_Edge"),n=!1;r.empty()||(n=r.classed("selected")),a.edge_click(a.rowToObj(e.data()),"",n,{edge:e})}).on("dblclick",function(e){var r=t.select(this).select(".graph_Edge"),n=!1;r.empty()||(n=r.classed("selected")),a.edge_dblclick(a.rowToObj(e.data()),"",n,{edge:e})}).on("mouseout.tooltip",this.tooltip.hide).on("mousemove.tooltip",this.tooltip.show).on("mouseover",function(e){a._dragging||a.edge_mouseover(t.select(this),e)}).on("mouseout",function(e){a._dragging||a.edge_mouseout(t.select(this),e)}).each(function(e){e.target(this).animationFrameRender()}).transition().duration(750).style("opacity",1),s.each(function(e){e.animationFrameRender()}),s.exit().each(function(e){e.target(null)}).remove(),this._renderCount||(this._renderCount++,this.layout(this.layout()))},r.prototype.exit=function(t,r){this._graphData.nodes().forEach(function(e){return e.target(null)}),this._graphData.edges().forEach(function(e){return e.target(null)}),e.prototype.exit.call(this,t,r)},r.prototype.render=function(t){var r=this;return this.progress("start"),e.prototype.render.call(this,function(e){r.doLayout().then(function(){r.progress("end"),t&&t(e)})}),this},r.prototype.doLayout=function(e){var t=this;return void 0===e&&(e=0),new Promise(function(r,n){requestAnimationFrame(function(){t._prevLayout!==t.layout()||t._prevDataHash!==t._dataHash?(t._prevLayout=t.layout(),t._prevDataHash=t._dataHash,t._doLayout(e).then(function(){r()})):r()})})},r.prototype._doLayout=function(e){var t=this;return void 0===e&&(e=0),new Promise(function(n,o){t.progress("layout-start"),t.forceLayout&&(t.forceLayout.force.stop(),t.forceLayout=null);var i=t,a=t.getLayoutEngine();if("ForceDirected2"===t.layout()){var s=0,u=0;t.forceLayout=a,t.forceLayout.force.on("tick",function(){var e=performance.now();i.progress("layout-tick"),a.vertices.forEach(function(e){if(e.fixed);else{var t=i._graphData.node(e.id);t&&t.move({x:e.x,y:e.y})}}),i._graphData.edges().forEach(function(e){e.points([],!1,!1)}),i.applyScaleOnLayout(),s+=performance.now()-e,++u,console.log("tick:"+s/u)}).on("end",function(){i.progress("layout-end")}),t.forceLayout.force.restart(),n()}else a&&(t.forceLayout=null,i._dragging=!0,i._graphData.nodes().forEach(function(e){var t=a.nodePos(e._id);e instanceof r.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)}),i._graphData.edges().forEach(function(t){var r=a.edgePoints(t);t.points(r,e)}),i.applyScaleOnLayout()&&requestAnimationFrame(function(){i.zoomToFit(),n()}),t._fixIEMarkers(),setTimeout(function(){i._dragging=!1},e?e+50:50),t.progress("layout-end"),i.applyScaleOnLayout()||n())})},r.prototype.getLayoutEngine=function(){switch(this.layout()){case"Circle":return new Il(this._graphData,this._size.width,this._size.height);case"ForceDirected":return new Tl(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 Tl(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 Ll(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},r.prototype.getNeighborMap=function(e){var t={},r={};if(e)for(var n=this._graphData.nodeEdges(e.id()),o=0;o<n.length;++o){var i=this._graphData.edge(n[o]);r[i.id()]=i,i._sourceVertex.id()!==e.id()&&(t[i._sourceVertex.id()]=i._sourceVertex),i._targetVertex.id()!==e.id()&&(t[i._targetVertex.id()]=i._targetVertex)}return{vertices:t,edges:r}},r.prototype.highlightVerticies=function(e){var t=this,r=this;return this.svgV.selectAll(".graphVertex").classed("graphVertex-highlighted",function(t){return!e||e[t.id()]}).style("filter",function(r){return e&&e[r.id()]?"url(#"+t.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(t){return!e||e[t.id()]?1:r.highlight.opacity}),this},r.prototype.highlightEdges=function(e){var 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},r.prototype.highlightVertex=function(e,t){if(this.highlightOnMouseOverVertex())if(t){var r=this.getNeighborMap(t);r.vertices[t.id()]=t,this.highlightVerticies(r.vertices),this.highlightEdges(r.edges)}else this.highlightVerticies(null),this.highlightEdges(null)},r.prototype.highlightEdge=function(e,t){if(this.highlightOnMouseOverEdge())if(t){var r={};r[t._sourceVertex.id()]=t._sourceVertex,r[t._targetVertex.id()]=t._targetVertex;var n={};n[t.id()]=t,this.highlightVerticies(r),this.highlightEdges(n)}else this.highlightVerticies(null),this.highlightEdges(null)},r.prototype.refreshIncidentEdges=function(e,t){var r=this;this._graphData.nodeEdges(e.id()).forEach(function(e){r._graphData.edge(e).points([],!1,t)})},r.prototype.centroids=function(){return this._graphData.nodes().filter(function(e){return e.centroid()})},r.prototype.selectionChanged=function(){var e=this;if(this.highlightSelectedPathToCentroid()){var t={};this.centroids().forEach(function(r){e.selection().forEach(function(n){e._graphData.undirectedShortestPath(r.id(),n.id()).forEach(function(e){t[e.id()]=!0})})}),this.svgE.selectAll(".graphEdge").classed("shortest-path",function(e){return!0===t[e.id()]})}},r.prototype.vertex_click=function(e,t,r,o){o&&o.vertex&&o.vertex._placeholderElement.node().parentNode.appendChild(o.vertex._placeholderElement.node()),n.IGraph.prototype.vertex_click.apply(this,arguments)},r.prototype.vertex_dblclick=function(e,t,r,n){},r.prototype.vertex_contextmenu=function(e,t,r,n){},r.prototype.vertex_mouseover=function(e,t){this.highlightVertex(e,t)},r.prototype.vertex_mouseout=function(e,t){this.highlightVertex(null,null)},r.prototype.edge_mouseover=function(e,t){this.highlightEdge(e,t)},r.prototype.edge_mouseout=function(e,t){this.highlightEdge(null,null)},r.prototype.addMarkers=function(e){void 0===e&&(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)},r.prototype.progress=function(e){},r.Subgraph=Bl,r.Vertex=zl,r.Edge=R,r.profileID=0,r}(t.SVGZoomWidget);Vl.prototype._class+=" graph_Graph",Vl.prototype.implements(n.IGraph.prototype),Vl.prototype.implements(n.ITooltip.prototype),Vl.prototype.publish("allowDragging",!0,"boolean","Allow Dragging of Vertices",null,{tags:["Advanced"]}),Vl.prototype.publish("dragSingleNeighbors",!1,"boolean","Dragging a Vertex also moves its singleton neighbors",null,{tags:["Advanced"]}),Vl.prototype.publish("layout","Circle","set","Default Layout",["Circle","ForceDirected","ForceDirected2","Hierarchy","None"],{tags:["Basic"]}),Vl.prototype.publish("scale","100%","set","Zoom Level",["all","width","selection","100%","90%","75%","50%","25%","10%"],{tags:["Basic"]}),Vl.prototype.publish("applyScaleOnLayout",!1,"boolean","Shrink to fit on Layout",null,{tags:["Basic"]}),Vl.prototype.publish("highlightOnMouseOverVertex",!1,"boolean","Highlight Vertex on Mouse Over",null,{tags:["Basic"]}),Vl.prototype.publish("highlightOnMouseOverEdge",!1,"boolean","Highlight Edge on Mouse Over",null,{tags:["Basic"]}),Vl.prototype.publish("transitionDuration",250,"number","Transition Duration",null,{tags:["Intermediate"]}),Vl.prototype.publish("showEdges",!0,"boolean","Show Edges",null,{tags:["Intermediate"]}),Vl.prototype.publish("snapToGrid",0,"number","Snap to Grid",null,{tags:["Private"]}),Vl.prototype.publish("selectionClearOnBackgroundClick",!1,"boolean","Clear selection on background click"),Vl.prototype.publish("centroidColor","#00A000","html-color","Centroid Color",null,{tags:["Basic"]}),Vl.prototype.publish("highlightSelectedPathToCentroid",!1,"boolean","Highlight path to Center Vertex (for selected vertices)",null,{tags:["Basic"]}),Vl.prototype.publish("hierarchyRankDirection","TB","set","Direction for Rank Nodes",["TB","BT","LR","RL"],{tags:["Advanced"]}),Vl.prototype.publish("hierarchyNodeSeparation",50,"number","Number of pixels that separate nodes horizontally in the layout",null,{tags:["Advanced"]}),Vl.prototype.publish("hierarchyEdgeSeparation",10,"number","Number of pixels that separate edges horizontally in the layout",null,{tags:["Advanced"]}),Vl.prototype.publish("hierarchyRankSeparation",50,"number","Number of pixels between each rank in the layout",null,{tags:["Advanced"]}),Vl.prototype.publish("hierarchyDigraph",!0,"boolean","Directional Graph",null,{tags:["Advanced"]}),Vl.prototype.publish("forceDirectedLinkDistance",300,"number","Target distance between linked nodes",null,{tags:["Advanced"]}),Vl.prototype.publish("forceDirectedLinkStrength",1,"number","Strength (rigidity) of links",null,{tags:["Advanced"]}),Vl.prototype.publish("forceDirectedFriction",.9,"number","Friction coefficient",null,{tags:["Advanced"]}),Vl.prototype.publish("forceDirectedCharge",-25,"number","Charge strength ",null,{tags:["Advanced"]}),Vl.prototype.publish("forceDirectedChargeDistance",1e4,"number","Maximum distance over which charge forces are applied",null,{tags:["Advanced"]}),Vl.prototype.publish("forceDirectedTheta",.8,"number","Barnes–Hut approximation criterion",null,{tags:["Advanced"]}),Vl.prototype.publish("forceDirectedGravity",.1,"number","Gravitational strength",null,{tags:["Advanced"]});var Gl=Vl.prototype.scale;Vl.prototype.scale=function(e,t){var r=Gl.apply(this,arguments);return arguments.length&&this.zoomTo(e,t),r};var Hl=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t.prototype.owner=function(e){return arguments.length?(this._owner=e,this):this._owner},t.prototype.valid=function(){return!!this.iconColumn()},t.prototype.indexes=function(){var 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())}},t.prototype.mapper=function(){var e=this,t=this.indexes();return function(r){return{faChar:r[t.iconCol],tooltip:r[t.tooltipCol],shape_colorFill:r[t.shapeFillCol]||e.shapeFillDefault(),shape_colorStroke:r[t.shapeStrokeCol]||e.shapeStrokeDefault(),image_colorFill:r[t.iconFillCol]||e.iconFillDefault()}}},t}(t.PropertyExt);Hl.prototype._class+=" graph_Annotation",Hl.prototype.publish("iconColumn","","set","Icon column",function(){return this._owner.columns()},{optional:!0}),Hl.prototype.publish("iconFillDefault","white","html-color","Icon fill default color"),Hl.prototype.publish("iconFillColumn","","set","Icon fill color column",function(){return this._owner.columns()},{optional:!0}),Hl.prototype.publish("tooltipColumn","","set","Tooltip column",function(){return this._owner.columns()},{optional:!0}),Hl.prototype.publish("shapeStrokeDefault","darkred","html-color","Shape stroke default color"),Hl.prototype.publish("shapeStrokeColumn","","set","Shape stroke color column",function(){return this._owner.columns()},{optional:!0}),Hl.prototype.publish("shapeFillDefault","red","html-color","Shape fill default color"),Hl.prototype.publish("shapeFillColumn","","set","Shape fill color column",function(){return this._owner.columns()},{optional:!0});var Ul=function(e){function t(){var t=e.call(this)||this;return t._vertexMap={},t._edgeMap={},t._merge=!1,t._adjacencyData=[],t}return s(t,e),t.prototype.linksColumns=function(){var e=this.columns().indexOf(this.linksColumn()),t=this._db.field(e);return t?t.children().map(function(e){return e.label()}):[]},t.prototype.validAnnotations=function(){return this.annotations().filter(function(e){return e.valid()})},t.prototype.updateData=function(){var t=this,n=r.hashSum([this._adjacencyData,this.uidColumn(),this.labelColumn(),this.iconColumn(),this.linksColumn(),this.linkUidColumn(),this.linkLabelColumn(),this.validAnnotations().map(function(e){return e.hashSum()})]);if(this._prevAdjacencyDataHash!==n){this._prevAdjacencyDataHash=n;for(var o=this.columns(),i=o.indexOf(this.uidColumn()),a=o.indexOf(this.labelColumn()),s=o.indexOf(this.iconColumn()),u=o.indexOf(this.linksColumn()),c=this.linksColumns(),l=c.indexOf(this.linkUidColumn()),h=c.indexOf(this.linkLabelColumn()),f=this.validAnnotations().map(function(e){return e.mapper()}),d={},p={},g={vertices:this._adjacencyData.map(function(e){var r=e[i];if(void 0!==r){var n=d[r]||t._vertexMap[r];return n||(n=new zl),d[r]=n,n.text(e[a]).data(e).faChar(e[s]).annotationIcons(f.map(function(t){return t(e)})),n}}).filter(function(e){return!!e}),edges:[]},v=0,y=this._adjacencyData;v<y.length;v++){var m=y[v],_=m[i],b=m[u];if(void 0!==_&&void 0!==b)for(var w=0,x=b;w<x.length;w++){var E=x[w],k=E[l],D=E[h],S=_+"->"+k,C=p[S]||this._edgeMap[S];C||(d[_]&&d[k]?C=(new R).sourceVertex(d[_]).targetVertex(d[k]).data(E):console.log("Missing vertices for edge: "+S)),C&&(C.text(D),p[S]=C,g.edges.push(C))}}this._vertexMap=d,this._edgeMap=p,e.prototype.data.call(this,g,this._merge)}},t.prototype.data=function(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.")},t.prototype.update=function(t,r){this.updateData(),e.prototype.update.call(this,t,r)},t.prototype.click=function(e,t,r){console.log("click")},t}(Vl);function Wl(e,t){return e.sourceLinks.length?e.depth:t-1}function ql(e){return function(){return e}}function Yl(e,t){return Xl(e.source,t.source)||e.index-t.index}function $l(e,t){return Xl(e.target,t.target)||e.index-t.index}function Xl(e,t){return e.y0-t.y0}function Jl(e){return e.value}function Kl(e){return e.index}function Zl(e){return e.nodes}function eh(e){return e.links}function th(e,t){const r=e.get(t);if(!r)throw new Error("missing: "+t);return r}function rh({nodes:e}){for(const t of e){let e=t.y0,r=e;for(const r of t.sourceLinks)r.y0=e+r.width/2,e+=r.width;for(const e of t.targetLinks)e.y1=r+e.width/2,r+=e.width}}function nh(){let e,r,n,o=0,i=0,a=1,s=1,u=24,c=8,l=Kl,h=Wl,f=Zl,d=eh,p=6;function g(){const g={nodes:f.apply(null,arguments),links:d.apply(null,arguments)};return function({nodes:e,links:t}){for(const[t,r]of e.entries())r.index=t,r.sourceLinks=[],r.targetLinks=[];const r=new Map(e.map((t,r)=>[l(t,r,e),t]));for(const[e,n]of t.entries()){n.index=e;let{source:t,target:o}=n;"object"!=typeof t&&(t=n.source=th(r,t)),"object"!=typeof o&&(o=n.target=th(r,o)),t.sourceLinks.push(n),o.targetLinks.push(n)}if(null!=n)for(const{sourceLinks:t,targetLinks:r}of e)t.sort(n),r.sort(n)}(g),function({nodes:e}){for(const r of e)r.value=void 0===r.fixedValue?Math.max(t.sum(r.sourceLinks,Jl),t.sum(r.targetLinks,Jl)):r.fixedValue}(g),function({nodes:e}){const t=e.length;let r=new Set(e),n=new Set,o=0;for(;r.size;){for(const e of r){e.depth=o;for(const{target:t}of e.sourceLinks)n.add(t)}if(++o>t)throw new Error("circular link");r=n,n=new Set}}(g),function({nodes:e}){const t=e.length;let r=new Set(e),n=new Set,o=0;for(;r.size;){for(const e of r){e.height=o;for(const{source:t}of e.targetLinks)n.add(t)}if(++o>t)throw new Error("circular link");r=n,n=new Set}}(g),function(n){const l=function({nodes:e}){const n=t.max(e,e=>e.depth)+1,i=(a-o-u)/(n-1),s=new Array(n);for(const t of e){const e=Math.max(0,Math.min(n-1,Math.floor(h.call(null,t,n))));t.layer=e,t.x0=o+e*i,t.x1=t.x0+u,s[e]?s[e].push(t):s[e]=[t]}if(r)for(const e of s)e.sort(r);return s}(n);e=Math.min(c,(s-i)/(t.max(l,e=>e.length)-1)),function(r){const n=t.min(r,r=>(s-i-(r.length-1)*e)/t.sum(r,Jl));for(const t of r){let r=i;for(const o of t){o.y0=r,o.y1=r+o.value*n,r=o.y1+e;for(const e of o.sourceLinks)e.width=e.value*n}r=(s-r+e)/(t.length+1);for(let e=0;e<t.length;++e){const n=t[e];n.y0+=r*(e+1),n.y1+=r*(e+1)}x(t)}}(l);for(let e=0;e<p;++e){const t=Math.pow(.99,e),r=Math.max(1-t,(e+1)/p);y(l,t,r),v(l,t,r)}}(g),rh(g),g}function v(e,t,n){for(let o=1,i=e.length;o<i;++o){const i=e[o];for(const e of i){let r=0,n=0;for(const{source:t,value:o}of e.targetLinks){let i=o*(e.layer-t.layer);r+=E(t,e)*i,n+=i}if(!(n>0))continue;let o=(r/n-e.y0)*t;e.y0+=o,e.y1+=o,w(e)}void 0===r&&i.sort(Xl),m(i,n)}}function y(e,t,n){for(let o=e.length-2;o>=0;--o){const i=e[o];for(const e of i){let r=0,n=0;for(const{target:t,value:o}of e.sourceLinks){let i=o*(t.layer-e.layer);r+=k(e,t)*i,n+=i}if(!(n>0))continue;let o=(r/n-e.y0)*t;e.y0+=o,e.y1+=o,w(e)}void 0===r&&i.sort(Xl),m(i,n)}}function m(t,r){const n=t.length>>1,o=t[n];b(t,o.y0-e,n-1,r),_(t,o.y1+e,n+1,r),b(t,s,t.length-1,r),_(t,i,0,r)}function _(t,r,n,o){for(;n<t.length;++n){const i=t[n],a=(r-i.y0)*o;a>1e-6&&(i.y0+=a,i.y1+=a),r=i.y1+e}}function b(t,r,n,o){for(;n>=0;--n){const i=t[n],a=(i.y1-r)*o;a>1e-6&&(i.y0-=a,i.y1-=a),r=i.y0-e}}function w({sourceLinks:e,targetLinks:t}){if(void 0===n){for(const{source:{sourceLinks:e}}of t)e.sort($l);for(const{target:{targetLinks:t}}of e)t.sort(Yl)}}function x(e){if(void 0===n)for(const{sourceLinks:t,targetLinks:r}of e)t.sort($l),r.sort(Yl)}function E(t,r){let n=t.y0-(t.sourceLinks.length-1)*e/2;for(const{target:o,width:i}of t.sourceLinks){if(o===r)break;n+=i+e}for(const{source:e,width:o}of r.targetLinks){if(e===t)break;n-=o}return n}function k(t,r){let n=r.y0-(r.targetLinks.length-1)*e/2;for(const{source:o,width:i}of r.targetLinks){if(o===t)break;n+=i+e}for(const{target:e,width:o}of t.sourceLinks){if(e===r)break;n-=o}return n}return g.update=function(e){return rh(e),e},g.nodeId=function(e){return arguments.length?(l="function"==typeof e?e:ql(e),g):l},g.nodeAlign=function(e){return arguments.length?(h="function"==typeof e?e:ql(e),g):h},g.nodeSort=function(e){return arguments.length?(r=e,g):r},g.nodeWidth=function(e){return arguments.length?(u=+e,g):u},g.nodePadding=function(t){return arguments.length?(c=e=+t,g):c},g.nodes=function(e){return arguments.length?(f="function"==typeof e?e:ql(e),g):f},g.links=function(e){return arguments.length?(d="function"==typeof e?e:ql(e),g):d},g.linkSort=function(e){return arguments.length?(n=e,g):n},g.size=function(e){return arguments.length?(o=i=0,a=+e[0],s=+e[1],g):[a-o,s-i]},g.extent=function(e){return arguments.length?(o=+e[0][0],a=+e[1][0],i=+e[0][1],s=+e[1][1],g):[[o,i],[a,s]]},g.iterations=function(e){return arguments.length?(p=+e,g):p},g}function oh(e){return[e.source.x1,e.y0]}function ih(e){return[e.target.x0,e.y1]}function ah(){return A().source(oh).target(ih)}Ul.prototype._class+=" graph_AdjacencyGraph",Ul.prototype.publish("uidColumn","","set","UID column",function(){return this.columns()},{optional:!0}),Ul.prototype.publish("labelColumn","","set","Label column",function(){return this.columns()},{optional:!0}),Ul.prototype.publish("iconColumn","","set","Icon column",function(){return this.columns()},{optional:!0}),Ul.prototype.publish("linksColumn","","set","Links column",function(){return this.columns()},{optional:!0}),Ul.prototype.publish("linkUidColumn","","set","Link UID column",function(){return this.linksColumns()},{optional:!0}),Ul.prototype.publish("linkLabelColumn","","set","Link Label column",function(){return this.linksColumns()},{optional:!0}),Ul.prototype.publish("annotations",[],"propertyArray","Annotations",null,{autoExpand:Hl});L(".graph_Sankey .node rect{cursor:move;fill-opacity:.9;shape-rendering:crispEdges;stroke:#a9a9a9}.graph_Sankey .node.selected rect{stroke:red}.graph_Sankey .node.over rect{stroke:orange}.graph_Sankey .node.selected.over rect{stroke:red}.graph_Sankey .node text{pointer-events:none;text-shadow:0 1px 0 #fff}.graph_Sankey .node.selected text{fill:red}.graph_Sankey .node.over text{fill:orange}.graph_Sankey .node.selected.over text{fill:red}.graph_Sankey .link{fill:none;stroke:#000;stroke-opacity:.2}.graph_Sankey .link:hover{stroke-opacity:.5}");var sh={mean:t.mean,median:t.median,min:t.min,max:t.max,sum:t.sum},uh=function(e){function t(){return e.call(this)||this}return s(t,e),t.prototype.owner=function(e){return arguments.length?(this._owner=e,this):this._owner},t.prototype.valid=function(){return!!this.column()},t.prototype.aggregate=function(e){switch(this.aggrType()){case null:case void 0:case"":return e.length;default:var t=this._owner.columns().indexOf(this.aggrColumn());return sh[this.aggrType()](e,function(e){return+e[t]})}},t}(t.PropertyExt);uh.prototype._class+=" graph_Sankey.SankeyColumn",uh.prototype.publish("column",null,"set","Field",function(){return this._owner?this._owner.columns():[]},{optional:!0}),uh.prototype.publish("aggrType",null,"set","Aggregation Type",[null,"mean","median","sum","min","max"],{optional:!0,disable:function(e){return!e._owner||0===e._owner.mappings().indexOf(e)}}),uh.prototype.publish("aggrColumn",null,"set","Aggregation Field",function(){return this._owner?this._owner.columns():[]},{optional:!0,disable:function(e){return!e._owner||!e.aggrType()||0===e._owner.mappings().indexOf(e)}});var ch=function(e){function r(){var r=e.call(this)||this;return t.Utility.SimpleSelectionMixin.call(r),r._drawStartPos="origin",r}return s(r,e),r.prototype.sankeyData=function(){var e={vertices:[],edges:[]};if(0===this.data().length)return e;var t={},r=this.mappings().filter(function(e){return e.valid()});return r.forEach(function(r,n){this._db.rollupView([r.column()]).entries().forEach(function(o){var i=r.column()+":"+n+":"+o.key;t[i]||(e.vertices.push({__id:i,__category:r.column(),name:o.key,origRow:o.value,value:o.value[n][2]}),t[i]=e.vertices.length-1)},this)},this),r.forEach(function(n,o){if(o<r.length-1){var i=r[o+1];this._db.rollupView([n.column(),i.column()]).entries().forEach(function(r){var a=n.column()+":"+o+":"+r.key;r.values.forEach(function(r){var n=i.column()+":"+(o+1)+":"+r.key;e.edges.push({__id:a+"_"+n,source:t[a],target:t[n],value:r.value[0][2]})})})}},this),e},r.prototype.enter=function(t,r){e.prototype.enter.call(this,t,r),this._d3Sankey=new nh,this._selection.widgetElement(r)},r.prototype.update=function(r,n){e.prototype.update.call(this,r,n),this._palette=this._palette.switch(this.paletteID());var o=this.vertexStrokeWidth(),i=this.sankeyData(),a=2*o;this._d3Sankey.extent([[o,o],[this.width()-a,this.height()-a]]).nodeWidth(this.vertexWidth()).nodePadding(this.vertexPadding()),this._d3Sankey({nodes:i.vertices,links:i.edges});var s=this,u=n.selectAll(".link").data(i.edges);u.enter().append("path").attr("class","link").each(function(){t.select(this).append("title")}).merge(u).attr("d",ah()).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}),u.exit().remove();var c=n.selectAll(".node").data(i.vertices);c.enter().append("g").attr("class","node").call(this._selection.enter.bind(this._selection)).on("click",function(e){s.click(s.rowToObj(e.origRow[0]),"",s._selection.selected(this))}).on("dblclick",function(e){s.dblclick(s.rowToObj(e.origRow[0]),"",s._selection.selected(this))}).each(function(){var e=t.select(this);e.append("rect"),e.append("text")}).merge(c).attr("transform",function(e){var t=0,r=0;return e.x0&&(t=e.x0),e.y0&&(r=e.y0),"translate("+(t+o)+","+(r+o)+")"}).each(function(){var e=t.select(this);e.select("rect").attr("height",function(e){return e.y1-e.y0}).attr("width",s._d3Sankey.nodeWidth()).style("fill",function(e){return s._palette(e.name)}).style("stroke",function(e){return s.vertexStrokeColor()}).style("stroke-width",function(e){return o}).style("cursor",s.xAxisMovement()||s.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<s.width()/2}).attr("x",6+s._d3Sankey.nodeWidth()).attr("text-anchor","start")}),c.exit().remove()},r.prototype.exit=function(t,r){e.prototype.exit.call(this,t,r)},r.prototype.click=function(e,t,r){console.log("Click: "+JSON.stringify(e)+", "+t+","+r)},r.prototype.dblclick=function(e,t,r){console.log("Double Click: "+JSON.stringify(e)+", "+t+","+r)},r}(t.SVGWidget);ch.prototype._class+=" graph_Sankey",ch.prototype.Column=uh,ch.prototype.mixin(t.Utility.SimpleSelectionMixin),ch.prototype._palette=t.Palette.ordinal("default"),ch.prototype.publish("paletteID","default","set","Color palette for this widget",ch.prototype._palette.switch()),ch.prototype.publish("mappings",[],"propertyArray","Source Columns",null,{autoExpand:uh}),ch.prototype.publish("vertexStrokeWidth",1,"number","Vertex Stroke Width"),ch.prototype.publish("vertexStrokeColor","darkgray","string","Vertex Stroke Color"),ch.prototype.publish("vertexWidth",36,"number","Vertex Width"),ch.prototype.publish("vertexPadding",40,"number","Vertex Padding"),ch.prototype.publish("xAxisMovement",!1,"boolean","Enable x-axis movement"),ch.prototype.publish("yAxisMovement",!1,"boolean","Enable y-axis movement");var lh=E().x(function(e){return e[0]}).y(function(e){return e[1]}).curve(F),hh=E().x(function(e){return e[0]}).y(function(e){return e[1]}).curve(I),fh=function(){function e(e){this._running=!1,this._graph=e}return e.prototype.start=function(){return this._running=!0,this._graph.progress("layout-start"),Promise.resolve(this)},e.prototype.stop=function(){return this._running=!1,this._graph.progress("layout-stop"),this},e.prototype.running=function(){return this._running},e.prototype.center=function(e){if(e.length%2==1)return e[Math.floor(e.length/2)];var t=e[e.length/2-1],r=e[e.length/2];return[(t[0]+r[0])/2,(t[1]+r[1])/2]},e.prototype.edgePath=function(e,t){var r=this._graph.projectPlacholder(e.source),n=this._graph.projectPlacholder(e.target),o=[[r.x,r.y],[n.x,n.y]];if(t){var i=o[0][0]-o[1][0],a=o[0][1]-o[1][1];if(Math.sqrt(i*i+a*a)){var s=(o[0][0]+o[1][0])/2-a*t/100,u=(o[0][1]+o[1][1])/2+i*t/100;return{path:hh([o[0],[s,u],o[1]]),labelPos:[s,u]}}}return{path:lh(o),labelPos:this.center(o)}},e}(),dh=function(e){return e*Math.PI/180},ph=function(e){function t(t,r){void 0===r&&(r=60);var n=e.call(this,t)||this;return n.sideLength=r,n}return s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then(function(){var e=t._graph.size(),r=t._graph.graphData(),n=r.allVertices();r.allEdges().forEach(function(e){return delete e.points});var o,i=(o=n.length,t.sideLength/(2*Math.sin(dh(180/o)))),a=360/n.length;return n.forEach(function(t,r){delete t.fx,delete t.fy,t.x=e.width/2+Math.cos(dh(r*a))*i,t.y=e.height/2+Math.sin(dh(r*a))*i}),t._graph.moveVertices(!0).moveEdges(!0),t.stop(),t._running=!1,t})},t}(fh);var gh=E().x(function(e){return e[0]}).y(function(e){return e[1]}).curve(F),vh=function(e){return"cluster_"+e};function yh(e,t,r,n){var o=e-r,i=t-n;return Math.sqrt(o*o+i*i)}var mh=function(e){function t(t,r){var n=e.call(this,t)||this;return n._options=r,n}return s(t,e),t.prototype.start=function(){var t=this;e.prototype.start.call(this);var r=this._graph.size(),n=this._graph.graphData();return function(e,t){var r=new Blob(['!function(){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e,n,t){return e(t={path:n,exports:{},require:function(e,n){return r(null==n&&t.path)}},t.exports),t.exports}function r(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var t=function(){this.__data__=[],this.size=0};var o=function(e,n){return e===n||e!=e&&n!=n};var i=function(e,n){for(var r=e.length;r--;)if(o(e[r][0],n))return r;return-1},a=Array.prototype.splice;var u=function(e){var n=this.__data__,r=i(n,e);return!(r<0||(r==n.length-1?n.pop():a.call(n,r,1),--this.size,0))};var c=function(e){var n=this.__data__,r=i(n,e);return r<0?void 0:n[r][1]};var s=function(e){return i(this.__data__,e)>-1};var f=function(e,n){var r=this.__data__,t=i(r,e);return t<0?(++this.size,r.push([e,n])):r[t][1]=n,this};function d(e){var n=-1,r=null==e?0:e.length;for(this.clear();++n<r;){var t=e[n];this.set(t[0],t[1])}}d.prototype.clear=t,d.prototype.delete=u,d.prototype.get=c,d.prototype.has=s,d.prototype.set=f;var h=d;var v=function(){this.__data__=new h,this.size=0};var l=function(e){var n=this.__data__,r=n.delete(e);return this.size=n.size,r};var p=function(e){return this.__data__.get(e)};var g=function(e){return this.__data__.has(e)},y="object"==typeof e&&e&&e.Object===Object&&e,b="object"==typeof self&&self&&self.Object===Object&&self,_=y||b||Function("return this")(),m=_.Symbol,w=Object.prototype,E=w.hasOwnProperty,j=w.toString,k=m?m.toStringTag:void 0;var x=function(e){var n=E.call(e,k),r=e[k];try{e[k]=void 0;var t=!0}catch(e){}var o=j.call(e);return t&&(n?e[k]=r:delete e[k]),o},N=Object.prototype.toString;var O=function(e){return N.call(e)},I="[object Null]",A="[object Undefined]",C=m?m.toStringTag:void 0;var M=function(e){return null==e?void 0===e?A:I:C&&C in Object(e)?x(e):O(e)};var S=function(e){var n=typeof e;return null!=e&&("object"==n||"function"==n)},P="[object AsyncFunction]",L="[object Function]",T="[object GeneratorFunction]",F="[object Proxy]";var R,z=function(e){if(!S(e))return!1;var n=M(e);return n==L||n==T||n==P||n==F},D=_["__core-js_shared__"],U=(R=/[^.]+$/.exec(D&&D.keys&&D.keys.IE_PROTO||""))?"Symbol(src)_1."+R:"";var B=function(e){return!!U&&U in e},G=Function.prototype.toString;var V=function(e){if(null!=e){try{return G.call(e)}catch(e){}try{return e+""}catch(e){}}return""},q=/^\\[object .+?Constructor\\]$/,Y=Function.prototype,$=Object.prototype,W=Y.toString,K=$.hasOwnProperty,J=RegExp("^"+W.call(K).replace(/[\\\\^$.*+?()[\\]{}|]/g,"\\\\$&").replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g,"$1.*?")+"$");var Q=function(e){return!(!S(e)||B(e))&&(z(e)?J:q).test(V(e))};var H=function(e,n){return null==e?void 0:e[n]};var X=function(e,n){var r=H(e,n);return Q(r)?r:void 0},Z=X(_,"Map"),ee=X(Object,"create");var ne=function(){this.__data__=ee?ee(null):{},this.size=0};var re=function(e){var n=this.has(e)&&delete this.__data__[e];return this.size-=n?1:0,n},te="__lodash_hash_undefined__",oe=Object.prototype.hasOwnProperty;var ie=function(e){var n=this.__data__;if(ee){var r=n[e];return r===te?void 0:r}return oe.call(n,e)?n[e]:void 0},ae=Object.prototype.hasOwnProperty;var ue=function(e){var n=this.__data__;return ee?void 0!==n[e]:ae.call(n,e)},ce="__lodash_hash_undefined__";var se=function(e,n){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=ee&&void 0===n?ce:n,this};function fe(e){var n=-1,r=null==e?0:e.length;for(this.clear();++n<r;){var t=e[n];this.set(t[0],t[1])}}fe.prototype.clear=ne,fe.prototype.delete=re,fe.prototype.get=ie,fe.prototype.has=ue,fe.prototype.set=se;var de=fe;var he=function(){this.size=0,this.__data__={hash:new de,map:new(Z||h),string:new de}};var ve=function(e){var n=typeof e;return"string"==n||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==e:null===e};var le=function(e,n){var r=e.__data__;return ve(n)?r["string"==typeof n?"string":"hash"]:r.map};var pe=function(e){var n=le(this,e).delete(e);return this.size-=n?1:0,n};var ge=function(e){return le(this,e).get(e)};var ye=function(e){return le(this,e).has(e)};var be=function(e,n){var r=le(this,e),t=r.size;return r.set(e,n),this.size+=r.size==t?0:1,this};function _e(e){var n=-1,r=null==e?0:e.length;for(this.clear();++n<r;){var t=e[n];this.set(t[0],t[1])}}_e.prototype.clear=he,_e.prototype.delete=pe,_e.prototype.get=ge,_e.prototype.has=ye,_e.prototype.set=be;var me=_e,we=200;var Ee=function(e,n){var r=this.__data__;if(r instanceof h){var t=r.__data__;if(!Z||t.length<we-1)return t.push([e,n]),this.size=++r.size,this;r=this.__data__=new me(t)}return r.set(e,n),this.size=r.size,this};function je(e){var n=this.__data__=new h(e);this.size=n.size}je.prototype.clear=v,je.prototype.delete=l,je.prototype.get=p,je.prototype.has=g,je.prototype.set=Ee;var ke=je;var xe=function(e,n){for(var r=-1,t=null==e?0:e.length;++r<t&&!1!==n(e[r],r,e););return e},Ne=function(){try{var e=X(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var Oe=function(e,n,r){"__proto__"==n&&Ne?Ne(e,n,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[n]=r},Ie=Object.prototype.hasOwnProperty;var Ae=function(e,n,r){var t=e[n];Ie.call(e,n)&&o(t,r)&&(void 0!==r||n in e)||Oe(e,n,r)};var Ce=function(e,n,r,t){var o=!r;r||(r={});for(var i=-1,a=n.length;++i<a;){var u=n[i],c=t?t(r[u],e[u],u,r,e):void 0;void 0===c&&(c=e[u]),o?Oe(r,u,c):Ae(r,u,c)}return r};var Me=function(e,n){for(var r=-1,t=Array(e);++r<e;)t[r]=n(r);return t};var Se=function(e){return null!=e&&"object"==typeof e},Pe="[object Arguments]";var Le=function(e){return Se(e)&&M(e)==Pe},Te=Object.prototype,Fe=Te.hasOwnProperty,Re=Te.propertyIsEnumerable,ze=Le(function(){return arguments}())?Le:function(e){return Se(e)&&Fe.call(e,"callee")&&!Re.call(e,"callee")},De=Array.isArray;var Ue=function(){return!1},Be=n(function(e,n){var r=n&&!n.nodeType&&n,t=r&&e&&!e.nodeType&&e,o=t&&t.exports===r?_.Buffer:void 0,i=(o?o.isBuffer:void 0)||Ue;e.exports=i}),Ge=9007199254740991,Ve=/^(?:0|[1-9]\\d*)$/;var qe=function(e,n){var r=typeof e;return!!(n=null==n?Ge:n)&&("number"==r||"symbol"!=r&&Ve.test(e))&&e>-1&&e%1==0&&e<n},Ye=9007199254740991;var $e=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=Ye},We={};We["[object Float32Array]"]=We["[object Float64Array]"]=We["[object Int8Array]"]=We["[object Int16Array]"]=We["[object Int32Array]"]=We["[object Uint8Array]"]=We["[object Uint8ClampedArray]"]=We["[object Uint16Array]"]=We["[object Uint32Array]"]=!0,We["[object Arguments]"]=We["[object Array]"]=We["[object ArrayBuffer]"]=We["[object Boolean]"]=We["[object DataView]"]=We["[object Date]"]=We["[object Error]"]=We["[object Function]"]=We["[object Map]"]=We["[object Number]"]=We["[object Object]"]=We["[object RegExp]"]=We["[object Set]"]=We["[object String]"]=We["[object WeakMap]"]=!1;var Ke=function(e){return Se(e)&&$e(e.length)&&!!We[M(e)]};var Je=function(e){return function(n){return e(n)}},Qe=n(function(e,n){var r=n&&!n.nodeType&&n,t=r&&e&&!e.nodeType&&e,o=t&&t.exports===r&&y.process,i=function(){try{var e=t&&t.require&&t.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=i}),He=Qe&&Qe.isTypedArray,Xe=He?Je(He):Ke,Ze=Object.prototype.hasOwnProperty;var en=function(e,n){var r=De(e),t=!r&&ze(e),o=!r&&!t&&Be(e),i=!r&&!t&&!o&&Xe(e),a=r||t||o||i,u=a?Me(e.length,String):[],c=u.length;for(var s in e)!n&&!Ze.call(e,s)||a&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||qe(s,c))||u.push(s);return u},nn=Object.prototype;var rn=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||nn)};var tn=function(e,n){return function(r){return e(n(r))}},on=tn(Object.keys,Object),an=Object.prototype.hasOwnProperty;var un=function(e){if(!rn(e))return on(e);var n=[];for(var r in Object(e))an.call(e,r)&&"constructor"!=r&&n.push(r);return n};var cn=function(e){return null!=e&&$e(e.length)&&!z(e)};var sn=function(e){return cn(e)?en(e):un(e)};var fn=function(e,n){return e&&Ce(n,sn(n),e)};var dn=function(e){var n=[];if(null!=e)for(var r in Object(e))n.push(r);return n},hn=Object.prototype.hasOwnProperty;var vn=function(e){if(!S(e))return dn(e);var n=rn(e),r=[];for(var t in e)("constructor"!=t||!n&&hn.call(e,t))&&r.push(t);return r};var ln=function(e){return cn(e)?en(e,!0):vn(e)};var pn=function(e,n){return e&&Ce(n,ln(n),e)},gn=n(function(e,n){var r=n&&!n.nodeType&&n,t=r&&e&&!e.nodeType&&e,o=t&&t.exports===r?_.Buffer:void 0,i=o?o.allocUnsafe:void 0;e.exports=function(e,n){if(n)return e.slice();var r=e.length,t=i?i(r):new e.constructor(r);return e.copy(t),t}});var yn=function(e,n){var r=-1,t=e.length;for(n||(n=Array(t));++r<t;)n[r]=e[r];return n};var bn=function(e,n){for(var r=-1,t=null==e?0:e.length,o=0,i=[];++r<t;){var a=e[r];n(a,r,e)&&(i[o++]=a)}return i};var _n=function(){return[]},mn=Object.prototype.propertyIsEnumerable,wn=Object.getOwnPropertySymbols,En=wn?function(e){return null==e?[]:(e=Object(e),bn(wn(e),function(n){return mn.call(e,n)}))}:_n;var jn=function(e,n){return Ce(e,En(e),n)};var kn=function(e,n){for(var r=-1,t=n.length,o=e.length;++r<t;)e[o+r]=n[r];return e},xn=tn(Object.getPrototypeOf,Object),Nn=Object.getOwnPropertySymbols?function(e){for(var n=[];e;)kn(n,En(e)),e=xn(e);return n}:_n;var On=function(e,n){return Ce(e,Nn(e),n)};var In=function(e,n,r){var t=n(e);return De(e)?t:kn(t,r(e))};var An=function(e){return In(e,sn,En)};var Cn=function(e){return In(e,ln,Nn)},Mn=X(_,"DataView"),Sn=X(_,"Promise"),Pn=X(_,"Set"),Ln=X(_,"WeakMap"),Tn=V(Mn),Fn=V(Z),Rn=V(Sn),zn=V(Pn),Dn=V(Ln),Un=M;(Mn&&"[object DataView]"!=Un(new Mn(new ArrayBuffer(1)))||Z&&"[object Map]"!=Un(new Z)||Sn&&"[object Promise]"!=Un(Sn.resolve())||Pn&&"[object Set]"!=Un(new Pn)||Ln&&"[object WeakMap]"!=Un(new Ln))&&(Un=function(e){var n=M(e),r="[object Object]"==n?e.constructor:void 0,t=r?V(r):"";if(t)switch(t){case Tn:return"[object DataView]";case Fn:return"[object Map]";case Rn:return"[object Promise]";case zn:return"[object Set]";case Dn:return"[object WeakMap]"}return n});var Bn=Un,Gn=Object.prototype.hasOwnProperty;var Vn=function(e){var n=e.length,r=new e.constructor(n);return n&&"string"==typeof e[0]&&Gn.call(e,"index")&&(r.index=e.index,r.input=e.input),r},qn=_.Uint8Array;var Yn=function(e){var n=new e.constructor(e.byteLength);return new qn(n).set(new qn(e)),n};var $n=function(e,n){var r=n?Yn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)},Wn=/\\w*$/;var Kn=function(e){var n=new e.constructor(e.source,Wn.exec(e));return n.lastIndex=e.lastIndex,n},Jn=m?m.prototype:void 0,Qn=Jn?Jn.valueOf:void 0;var Hn=function(e){return Qn?Object(Qn.call(e)):{}};var Xn=function(e,n){var r=n?Yn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)},Zn="[object Boolean]",er="[object Date]",nr="[object Map]",rr="[object Number]",tr="[object RegExp]",or="[object Set]",ir="[object String]",ar="[object Symbol]",ur="[object ArrayBuffer]",cr="[object DataView]",sr="[object Float32Array]",fr="[object Float64Array]",dr="[object Int8Array]",hr="[object Int16Array]",vr="[object Int32Array]",lr="[object Uint8Array]",pr="[object Uint8ClampedArray]",gr="[object Uint16Array]",yr="[object Uint32Array]";var br=function(e,n,r){var t=e.constructor;switch(n){case ur:return Yn(e);case Zn:case er:return new t(+e);case cr:return $n(e,r);case sr:case fr:case dr:case hr:case vr:case lr:case pr:case gr:case yr:return Xn(e,r);case nr:return new t;case rr:case ir:return new t(e);case tr:return Kn(e);case or:return new t;case ar:return Hn(e)}},_r=Object.create,mr=function(){function e(){}return function(n){if(!S(n))return{};if(_r)return _r(n);e.prototype=n;var r=new e;return e.prototype=void 0,r}}();var wr=function(e){return"function"!=typeof e.constructor||rn(e)?{}:mr(xn(e))},Er="[object Map]";var jr=function(e){return Se(e)&&Bn(e)==Er},kr=Qe&&Qe.isMap,xr=kr?Je(kr):jr,Nr="[object Set]";var Or=function(e){return Se(e)&&Bn(e)==Nr},Ir=Qe&&Qe.isSet,Ar=Ir?Je(Ir):Or,Cr=1,Mr=2,Sr=4,Pr="[object Arguments]",Lr="[object Function]",Tr="[object GeneratorFunction]",Fr="[object Object]",Rr={};Rr[Pr]=Rr["[object Array]"]=Rr["[object ArrayBuffer]"]=Rr["[object DataView]"]=Rr["[object Boolean]"]=Rr["[object Date]"]=Rr["[object Float32Array]"]=Rr["[object Float64Array]"]=Rr["[object Int8Array]"]=Rr["[object Int16Array]"]=Rr["[object Int32Array]"]=Rr["[object Map]"]=Rr["[object Number]"]=Rr[Fr]=Rr["[object RegExp]"]=Rr["[object Set]"]=Rr["[object String]"]=Rr["[object Symbol]"]=Rr["[object Uint8Array]"]=Rr["[object Uint8ClampedArray]"]=Rr["[object Uint16Array]"]=Rr["[object Uint32Array]"]=!0,Rr["[object Error]"]=Rr[Lr]=Rr["[object WeakMap]"]=!1;var zr=function e(n,r,t,o,i,a){var u,c=r&Cr,s=r&Mr,f=r&Sr;if(t&&(u=i?t(n,o,i,a):t(n)),void 0!==u)return u;if(!S(n))return n;var d=De(n);if(d){if(u=Vn(n),!c)return yn(n,u)}else{var h=Bn(n),v=h==Lr||h==Tr;if(Be(n))return gn(n,c);if(h==Fr||h==Pr||v&&!i){if(u=s||v?{}:wr(n),!c)return s?On(n,pn(u,n)):jn(n,fn(u,n))}else{if(!Rr[h])return i?n:{};u=br(n,h,c)}}a||(a=new ke);var l=a.get(n);if(l)return l;a.set(n,u),Ar(n)?n.forEach(function(o){u.add(e(o,r,t,o,n,a))}):xr(n)&&n.forEach(function(o,i){u.set(i,e(o,r,t,i,n,a))});var p=d?void 0:(f?s?Cn:An:s?ln:sn)(n);return xe(p||n,function(o,i){p&&(o=n[i=o]),Ae(u,i,e(o,r,t,i,n,a))}),u},Dr=4;var Ur=function(e){return zr(e,Dr)};var Br=function(e){return function(){return e}};var Gr=function(e){return function(n,r,t){for(var o=-1,i=Object(n),a=t(n),u=a.length;u--;){var c=a[e?u:++o];if(!1===r(i[c],c,i))break}return n}}();var Vr=function(e,n){return e&&Gr(e,n,sn)};var qr=function(e,n){return function(r,t){if(null==r)return r;if(!cn(r))return e(r,t);for(var o=r.length,i=n?o:-1,a=Object(r);(n?i--:++i<o)&&!1!==t(a[i],i,a););return r}}(Vr);var Yr=function(e){return e};var $r=function(e){return"function"==typeof e?e:Yr};var Wr=function(e,n){return(De(e)?xe:qr)(e,$r(n))},Kr=Wr;var Jr=function(e,n){var r=[];return qr(e,function(e,t,o){n(e,t,o)&&r.push(e)}),r},Qr="__lodash_hash_undefined__";var Hr=function(e){return this.__data__.set(e,Qr),this};var Xr=function(e){return this.__data__.has(e)};function Zr(e){var n=-1,r=null==e?0:e.length;for(this.__data__=new me;++n<r;)this.add(e[n])}Zr.prototype.add=Zr.prototype.push=Hr,Zr.prototype.has=Xr;var et=Zr;var nt=function(e,n){for(var r=-1,t=null==e?0:e.length;++r<t;)if(n(e[r],r,e))return!0;return!1};var rt=function(e,n){return e.has(n)},tt=1,ot=2;var it=function(e,n,r,t,o,i){var a=r&tt,u=e.length,c=n.length;if(u!=c&&!(a&&c>u))return!1;var s=i.get(e),f=i.get(n);if(s&&f)return s==n&&f==e;var d=-1,h=!0,v=r&ot?new et:void 0;for(i.set(e,n),i.set(n,e);++d<u;){var l=e[d],p=n[d];if(t)var g=a?t(p,l,d,n,e,i):t(l,p,d,e,n,i);if(void 0!==g){if(g)continue;h=!1;break}if(v){if(!nt(n,function(e,n){if(!rt(v,n)&&(l===e||o(l,e,r,t,i)))return v.push(n)})){h=!1;break}}else if(l!==p&&!o(l,p,r,t,i)){h=!1;break}}return i.delete(e),i.delete(n),h};var at=function(e){var n=-1,r=Array(e.size);return e.forEach(function(e,t){r[++n]=[t,e]}),r};var ut=function(e){var n=-1,r=Array(e.size);return e.forEach(function(e){r[++n]=e}),r},ct=1,st=2,ft="[object Boolean]",dt="[object Date]",ht="[object Error]",vt="[object Map]",lt="[object Number]",pt="[object RegExp]",gt="[object Set]",yt="[object String]",bt="[object Symbol]",_t="[object ArrayBuffer]",mt="[object DataView]",wt=m?m.prototype:void 0,Et=wt?wt.valueOf:void 0;var jt=function(e,n,r,t,i,a,u){switch(r){case mt:if(e.byteLength!=n.byteLength||e.byteOffset!=n.byteOffset)return!1;e=e.buffer,n=n.buffer;case _t:return!(e.byteLength!=n.byteLength||!a(new qn(e),new qn(n)));case ft:case dt:case lt:return o(+e,+n);case ht:return e.name==n.name&&e.message==n.message;case pt:case yt:return e==n+"";case vt:var c=at;case gt:var s=t&ct;if(c||(c=ut),e.size!=n.size&&!s)return!1;var f=u.get(e);if(f)return f==n;t|=st,u.set(e,n);var d=it(c(e),c(n),t,i,a,u);return u.delete(e),d;case bt:if(Et)return Et.call(e)==Et.call(n)}return!1},kt=1,xt=Object.prototype.hasOwnProperty;var Nt=function(e,n,r,t,o,i){var a=r&kt,u=An(e),c=u.length;if(c!=An(n).length&&!a)return!1;for(var s=c;s--;){var f=u[s];if(!(a?f in n:xt.call(n,f)))return!1}var d=i.get(e),h=i.get(n);if(d&&h)return d==n&&h==e;var v=!0;i.set(e,n),i.set(n,e);for(var l=a;++s<c;){var p=e[f=u[s]],g=n[f];if(t)var y=a?t(g,p,f,n,e,i):t(p,g,f,e,n,i);if(!(void 0===y?p===g||o(p,g,r,t,i):y)){v=!1;break}l||(l="constructor"==f)}if(v&&!l){var b=e.constructor,_=n.constructor;b!=_&&"constructor"in e&&"constructor"in n&&!("function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _)&&(v=!1)}return i.delete(e),i.delete(n),v},Ot=1,It="[object Arguments]",At="[object Array]",Ct="[object Object]",Mt=Object.prototype.hasOwnProperty;var St=function(e,n,r,t,o,i){var a=De(e),u=De(n),c=a?At:Bn(e),s=u?At:Bn(n),f=(c=c==It?Ct:c)==Ct,d=(s=s==It?Ct:s)==Ct,h=c==s;if(h&&Be(e)){if(!Be(n))return!1;a=!0,f=!1}if(h&&!f)return i||(i=new ke),a||Xe(e)?it(e,n,r,t,o,i):jt(e,n,c,r,t,o,i);if(!(r&Ot)){var v=f&&Mt.call(e,"__wrapped__"),l=d&&Mt.call(n,"__wrapped__");if(v||l){var p=v?e.value():e,g=l?n.value():n;return i||(i=new ke),o(p,g,r,t,i)}}return!!h&&(i||(i=new ke),Nt(e,n,r,t,o,i))};var Pt=function e(n,r,t,o,i){return n===r||(null==n||null==r||!Se(n)&&!Se(r)?n!=n&&r!=r:St(n,r,t,o,e,i))},Lt=1,Tt=2;var Ft=function(e,n,r,t){var o=r.length,i=o,a=!t;if(null==e)return!i;for(e=Object(e);o--;){var u=r[o];if(a&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++o<i;){var c=(u=r[o])[0],s=e[c],f=u[1];if(a&&u[2]){if(void 0===s&&!(c in e))return!1}else{var d=new ke;if(t)var h=t(s,f,c,e,n,d);if(!(void 0===h?Pt(f,s,Lt|Tt,t,d):h))return!1}}return!0};var Rt=function(e){return e==e&&!S(e)};var zt=function(e){for(var n=sn(e),r=n.length;r--;){var t=n[r],o=e[t];n[r]=[t,o,Rt(o)]}return n};var Dt=function(e,n){return function(r){return null!=r&&r[e]===n&&(void 0!==n||e in Object(r))}};var Ut=function(e){var n=zt(e);return 1==n.length&&n[0][2]?Dt(n[0][0],n[0][1]):function(r){return r===e||Ft(r,e,n)}},Bt="[object Symbol]";var Gt=function(e){return"symbol"==typeof e||Se(e)&&M(e)==Bt},Vt=/\\.|\\[(?:[^[\\]]*|(["\'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,qt=/^\\w*$/;var Yt=function(e,n){if(De(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!Gt(e))||qt.test(e)||!Vt.test(e)||null!=n&&e in Object(n)},$t="Expected a function";function Wt(e,n){if("function"!=typeof e||null!=n&&"function"!=typeof n)throw new TypeError($t);var r=function(){var t=arguments,o=n?n.apply(this,t):t[0],i=r.cache;if(i.has(o))return i.get(o);var a=e.apply(this,t);return r.cache=i.set(o,a)||i,a};return r.cache=new(Wt.Cache||me),r}Wt.Cache=me;var Kt=Wt,Jt=500;var Qt=/[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["\'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g,Ht=/\\\\(\\\\)?/g,Xt=function(e){var n=Kt(e,function(e){return r.size===Jt&&r.clear(),e}),r=n.cache;return n}(function(e){var n=[];return 46===e.charCodeAt(0)&&n.push(""),e.replace(Qt,function(e,r,t,o){n.push(t?o.replace(Ht,"$1"):r||e)}),n});var Zt=function(e,n){for(var r=-1,t=null==e?0:e.length,o=Array(t);++r<t;)o[r]=n(e[r],r,e);return o},eo=1/0,no=m?m.prototype:void 0,ro=no?no.toString:void 0;var to=function e(n){if("string"==typeof n)return n;if(De(n))return Zt(n,e)+"";if(Gt(n))return ro?ro.call(n):"";var r=n+"";return"0"==r&&1/n==-eo?"-0":r};var oo=function(e){return null==e?"":to(e)};var io=function(e,n){return De(e)?e:Yt(e,n)?[e]:Xt(oo(e))},ao=1/0;var uo=function(e){if("string"==typeof e||Gt(e))return e;var n=e+"";return"0"==n&&1/e==-ao?"-0":n};var co=function(e,n){for(var r=0,t=(n=io(n,e)).length;null!=e&&r<t;)e=e[uo(n[r++])];return r&&r==t?e:void 0};var so=function(e,n,r){var t=null==e?void 0:co(e,n);return void 0===t?r:t};var fo=function(e,n){return null!=e&&n in Object(e)};var ho=function(e,n,r){for(var t=-1,o=(n=io(n,e)).length,i=!1;++t<o;){var a=uo(n[t]);if(!(i=null!=e&&r(e,a)))break;e=e[a]}return i||++t!=o?i:!!(o=null==e?0:e.length)&&$e(o)&&qe(a,o)&&(De(e)||ze(e))};var vo=function(e,n){return null!=e&&ho(e,n,fo)},lo=1,po=2;var go=function(e,n){return Yt(e)&&Rt(n)?Dt(uo(e),n):function(r){var t=so(r,e);return void 0===t&&t===n?vo(r,e):Pt(n,t,lo|po)}};var yo=function(e){return function(n){return null==n?void 0:n[e]}};var bo=function(e){return function(n){return co(n,e)}};var _o=function(e){return Yt(e)?yo(uo(e)):bo(e)};var mo=function(e){return"function"==typeof e?e:null==e?Yr:"object"==typeof e?De(e)?go(e[0],e[1]):Ut(e):_o(e)};var wo=function(e,n){return(De(e)?bn:Jr)(e,mo(n))},Eo=Object.prototype.hasOwnProperty;var jo=function(e,n){return null!=e&&Eo.call(e,n)};var ko=function(e,n){return null!=e&&ho(e,n,jo)},xo="[object Map]",No="[object Set]",Oo=Object.prototype.hasOwnProperty;var Io=function(e){if(null==e)return!0;if(cn(e)&&(De(e)||"string"==typeof e||"function"==typeof e.splice||Be(e)||Xe(e)||ze(e)))return!e.length;var n=Bn(e);if(n==xo||n==No)return!e.size;if(rn(e))return!un(e).length;for(var r in e)if(Oo.call(e,r))return!1;return!0};var Ao=function(e){return void 0===e};var Co=function(e,n){var r=-1,t=cn(e)?Array(e.length):[];return qr(e,function(e,o,i){t[++r]=n(e,o,i)}),t};var Mo=function(e,n){return(De(e)?Zt:Co)(e,mo(n))};var So=function(e,n,r,t){var o=-1,i=null==e?0:e.length;for(t&&i&&(r=e[++o]);++o<i;)r=n(r,e[o],o,e);return r};var Po=function(e,n,r,t,o){return o(e,function(e,o,i){r=t?(t=!1,e):n(r,e,o,i)}),r};var Lo=function(e,n,r){var t=De(e)?So:Po,o=arguments.length<3;return t(e,mo(n),r,o,qr)},To="[object String]";var Fo=function(e){return"string"==typeof e||!De(e)&&Se(e)&&M(e)==To},Ro=yo("length"),zo=RegExp("[\\\\u200d\\\\ud800-\\\\udfff\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff\\\\ufe0e\\\\ufe0f]");var Do=function(e){return zo.test(e)},Uo="[\\\\ud800-\\\\udfff]",Bo="[\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff]",Go="\\\\ud83c[\\\\udffb-\\\\udfff]",Vo="[^\\\\ud800-\\\\udfff]",qo="(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}",Yo="[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]",$o="(?:"+Bo+"|"+Go+")"+"?",Wo="[\\\\ufe0e\\\\ufe0f]?"+$o+("(?:\\\\u200d(?:"+[Vo,qo,Yo].join("|")+")[\\\\ufe0e\\\\ufe0f]?"+$o+")*"),Ko="(?:"+[Vo+Bo+"?",Bo,qo,Yo,Uo].join("|")+")",Jo=RegExp(Go+"(?="+Go+")|"+Ko+Wo,"g");var Qo=function(e){for(var n=Jo.lastIndex=0;Jo.test(e);)++n;return n};var Ho=function(e){return Do(e)?Qo(e):Ro(e)},Xo="[object Map]",Zo="[object Set]";var ei=function(e){if(null==e)return 0;if(cn(e))return Fo(e)?Ho(e):e.length;var n=Bn(e);return n==Xo||n==Zo?e.size:un(e).length};var ni=function(e,n,r){var t=De(e),o=t||Be(e)||Xe(e);if(n=mo(n),null==r){var i=e&&e.constructor;r=o?t?new i:[]:S(e)&&z(i)?mr(xn(e)):{}}return(o?xe:Vr)(e,function(e,t,o){return n(r,e,t,o)}),r},ri=m?m.isConcatSpreadable:void 0;var ti=function(e){return De(e)||ze(e)||!!(ri&&e&&e[ri])};var oi=function e(n,r,t,o,i){var a=-1,u=n.length;for(t||(t=ti),i||(i=[]);++a<u;){var c=n[a];r>0&&t(c)?r>1?e(c,r-1,t,o,i):kn(i,c):o||(i[i.length]=c)}return i};var ii=function(e,n,r){switch(r.length){case 0:return e.call(n);case 1:return e.call(n,r[0]);case 2:return e.call(n,r[0],r[1]);case 3:return e.call(n,r[0],r[1],r[2])}return e.apply(n,r)},ai=Math.max;var ui=function(e,n,r){return n=ai(void 0===n?e.length-1:n,0),function(){for(var t=arguments,o=-1,i=ai(t.length-n,0),a=Array(i);++o<i;)a[o]=t[n+o];o=-1;for(var u=Array(n+1);++o<n;)u[o]=t[o];return u[n]=r(a),ii(e,this,u)}},ci=Ne?function(e,n){return Ne(e,"toString",{configurable:!0,enumerable:!1,value:Br(n),writable:!0})}:Yr,si=800,fi=16,di=Date.now;var hi=function(e){var n=0,r=0;return function(){var t=di(),o=fi-(t-r);if(r=t,o>0){if(++n>=si)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}(ci);var vi=function(e,n){return hi(ui(e,n,Yr),e+"")};var li=function(e,n,r,t){for(var o=e.length,i=r+(t?1:-1);t?i--:++i<o;)if(n(e[i],i,e))return i;return-1};var pi=function(e){return e!=e};var gi=function(e,n,r){for(var t=r-1,o=e.length;++t<o;)if(e[t]===n)return t;return-1};var yi=function(e,n,r){return n==n?gi(e,n,r):li(e,pi,r)};var bi=function(e,n){return!(null==e||!e.length)&&yi(e,n,0)>-1};var _i=function(e,n,r){for(var t=-1,o=null==e?0:e.length;++t<o;)if(r(n,e[t]))return!0;return!1};var mi=function(){},wi=Pn&&1/ut(new Pn([,-0]))[1]==1/0?function(e){return new Pn(e)}:mi,Ei=200;var ji=function(e,n,r){var t=-1,o=bi,i=e.length,a=!0,u=[],c=u;if(r)a=!1,o=_i;else if(i>=Ei){var s=n?null:wi(e);if(s)return ut(s);a=!1,o=rt,c=new et}else c=n?[]:u;e:for(;++t<i;){var f=e[t],d=n?n(f):f;if(f=r||0!==f?f:0,a&&d==d){for(var h=c.length;h--;)if(c[h]===d)continue e;n&&c.push(d),u.push(f)}else o(c,d,r)||(c!==u&&c.push(d),u.push(f))}return u};var ki=function(e){return Se(e)&&cn(e)},xi=vi(function(e){return ji(oi(e,1,ki,!0))});var Ni=function(e,n){return Zt(n,function(n){return e[n]})};var Oi,Ii=function(e){return null==e?[]:Ni(e,sn(e))};try{Oi={clone:Ur,constant:Br,each:Kr,filter:wo,has:ko,isArray:De,isEmpty:Io,isFunction:z,isUndefined:Ao,keys:sn,map:Mo,reduce:Lo,size:ei,transform:ni,union:xi,values:Ii}}catch(e){}Oi||(Oi=window._);var Ai=Oi,Ci=Li,Mi="\\0",Si="\\0",Pi="";function Li(e){this._isDirected=!Ai.has(e,"directed")||e.directed,this._isMultigraph=!!Ai.has(e,"multigraph")&&e.multigraph,this._isCompound=!!Ai.has(e,"compound")&&e.compound,this._label=void 0,this._defaultNodeLabelFn=Ai.constant(void 0),this._defaultEdgeLabelFn=Ai.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[Si]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function Ti(e,n){e[n]?e[n]++:e[n]=1}function Fi(e,n){--e[n]||delete e[n]}function Ri(e,n,r,t){var o=""+n,i=""+r;if(!e&&o>i){var a=o;o=i,i=a}return o+Pi+i+Pi+(Ai.isUndefined(t)?Mi:t)}function zi(e,n){return Ri(e,n.v,n.w,n.name)}Li.prototype._nodeCount=0,Li.prototype._edgeCount=0,Li.prototype.isDirected=function(){return this._isDirected},Li.prototype.isMultigraph=function(){return this._isMultigraph},Li.prototype.isCompound=function(){return this._isCompound},Li.prototype.setGraph=function(e){return this._label=e,this},Li.prototype.graph=function(){return this._label},Li.prototype.setDefaultNodeLabel=function(e){return Ai.isFunction(e)||(e=Ai.constant(e)),this._defaultNodeLabelFn=e,this},Li.prototype.nodeCount=function(){return this._nodeCount},Li.prototype.nodes=function(){return Ai.keys(this._nodes)},Li.prototype.sources=function(){var e=this;return Ai.filter(this.nodes(),function(n){return Ai.isEmpty(e._in[n])})},Li.prototype.sinks=function(){var e=this;return Ai.filter(this.nodes(),function(n){return Ai.isEmpty(e._out[n])})},Li.prototype.setNodes=function(e,n){var r=arguments,t=this;return Ai.each(e,function(e){r.length>1?t.setNode(e,n):t.setNode(e)}),this},Li.prototype.setNode=function(e,n){return Ai.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=n),this):(this._nodes[e]=arguments.length>1?n:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=Si,this._children[e]={},this._children[Si][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},Li.prototype.node=function(e){return this._nodes[e]},Li.prototype.hasNode=function(e){return Ai.has(this._nodes,e)},Li.prototype.removeNode=function(e){var n=this;if(Ai.has(this._nodes,e)){var r=function(e){n.removeEdge(n._edgeObjs[e])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],Ai.each(this.children(e),function(e){n.setParent(e)}),delete this._children[e]),Ai.each(Ai.keys(this._in[e]),r),delete this._in[e],delete this._preds[e],Ai.each(Ai.keys(this._out[e]),r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},Li.prototype.setParent=function(e,n){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(Ai.isUndefined(n))n=Si;else{for(var r=n+="";!Ai.isUndefined(r);r=this.parent(r))if(r===e)throw new Error("Setting "+n+" as parent of "+e+" would create a cycle");this.setNode(n)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=n,this._children[n][e]=!0,this},Li.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},Li.prototype.parent=function(e){if(this._isCompound){var n=this._parent[e];if(n!==Si)return n}},Li.prototype.children=function(e){if(Ai.isUndefined(e)&&(e=Si),this._isCompound){var n=this._children[e];if(n)return Ai.keys(n)}else{if(e===Si)return this.nodes();if(this.hasNode(e))return[]}},Li.prototype.predecessors=function(e){var n=this._preds[e];if(n)return Ai.keys(n)},Li.prototype.successors=function(e){var n=this._sucs[e];if(n)return Ai.keys(n)},Li.prototype.neighbors=function(e){var n=this.predecessors(e);if(n)return Ai.union(n,this.successors(e))},Li.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},Li.prototype.filterNodes=function(e){var n=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});n.setGraph(this.graph());var r=this;Ai.each(this._nodes,function(r,t){e(t)&&n.setNode(t,r)}),Ai.each(this._edgeObjs,function(e){n.hasNode(e.v)&&n.hasNode(e.w)&&n.setEdge(e,r.edge(e))});var t={};return this._isCompound&&Ai.each(n.nodes(),function(e){n.setParent(e,function e(o){var i=r.parent(o);return void 0===i||n.hasNode(i)?(t[o]=i,i):i in t?t[i]:e(i)}(e))}),n},Li.prototype.setDefaultEdgeLabel=function(e){return Ai.isFunction(e)||(e=Ai.constant(e)),this._defaultEdgeLabelFn=e,this},Li.prototype.edgeCount=function(){return this._edgeCount},Li.prototype.edges=function(){return Ai.values(this._edgeObjs)},Li.prototype.setPath=function(e,n){var r=this,t=arguments;return Ai.reduce(e,function(e,o){return t.length>1?r.setEdge(e,o,n):r.setEdge(e,o),o}),this},Li.prototype.setEdge=function(){var e,n,r,t,o=!1,i=arguments[0];"object"==typeof i&&null!==i&&"v"in i?(e=i.v,n=i.w,r=i.name,2===arguments.length&&(t=arguments[1],o=!0)):(e=i,n=arguments[1],r=arguments[3],arguments.length>2&&(t=arguments[2],o=!0)),e=""+e,n=""+n,Ai.isUndefined(r)||(r=""+r);var a=Ri(this._isDirected,e,n,r);if(Ai.has(this._edgeLabels,a))return o&&(this._edgeLabels[a]=t),this;if(!Ai.isUndefined(r)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(n),this._edgeLabels[a]=o?t:this._defaultEdgeLabelFn(e,n,r);var u=function(e,n,r,t){var o=""+n,i=""+r;if(!e&&o>i){var a=o;o=i,i=a}var u={v:o,w:i};t&&(u.name=t);return u}(this._isDirected,e,n,r);return e=u.v,n=u.w,Object.freeze(u),this._edgeObjs[a]=u,Ti(this._preds[n],e),Ti(this._sucs[e],n),this._in[n][a]=u,this._out[e][a]=u,this._edgeCount++,this},Li.prototype.edge=function(e,n,r){var t=1===arguments.length?zi(this._isDirected,arguments[0]):Ri(this._isDirected,e,n,r);return this._edgeLabels[t]},Li.prototype.hasEdge=function(e,n,r){var t=1===arguments.length?zi(this._isDirected,arguments[0]):Ri(this._isDirected,e,n,r);return Ai.has(this._edgeLabels,t)},Li.prototype.removeEdge=function(e,n,r){var t=1===arguments.length?zi(this._isDirected,arguments[0]):Ri(this._isDirected,e,n,r),o=this._edgeObjs[t];return o&&(e=o.v,n=o.w,delete this._edgeLabels[t],delete this._edgeObjs[t],Fi(this._preds[n],e),Fi(this._sucs[e],n),delete this._in[n][t],delete this._out[e][t],this._edgeCount--),this},Li.prototype.inEdges=function(e,n){var r=this._in[e];if(r){var t=Ai.values(r);return n?Ai.filter(t,function(e){return e.v===n}):t}},Li.prototype.outEdges=function(e,n){var r=this._out[e];if(r){var t=Ai.values(r);return n?Ai.filter(t,function(e){return e.w===n}):t}},Li.prototype.nodeEdges=function(e,n){var r=this.inEdges(e,n);if(r)return r.concat(this.outEdges(e,n))};var Di={Graph:Ci,version:"2.1.8"},Ui={write:function(e){var n={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:Bi(e),edges:Gi(e)};Ai.isUndefined(e.graph())||(n.value=Ai.clone(e.graph()));return n},read:function(e){var n=new Ci(e.options).setGraph(e.value);return Ai.each(e.nodes,function(e){n.setNode(e.v,e.value),e.parent&&n.setParent(e.v,e.parent)}),Ai.each(e.edges,function(e){n.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),n}};function Bi(e){return Ai.map(e.nodes(),function(n){var r=e.node(n),t=e.parent(n),o={v:n};return Ai.isUndefined(r)||(o.value=r),Ai.isUndefined(t)||(o.parent=t),o})}function Gi(e){return Ai.map(e.edges(),function(n){var r=e.edge(n),t={v:n.v,w:n.w};return Ai.isUndefined(n.name)||(t.name=n.name),Ai.isUndefined(r)||(t.value=r),t})}var Vi=function(e){var n,r={},t=[];function o(t){Ai.has(r,t)||(r[t]=!0,n.push(t),Ai.each(e.successors(t),o),Ai.each(e.predecessors(t),o))}return Ai.each(e.nodes(),function(e){n=[],o(e),n.length&&t.push(n)}),t};var qi=Yi;function Yi(){this._arr=[],this._keyIndices={}}Yi.prototype.size=function(){return this._arr.length},Yi.prototype.keys=function(){return this._arr.map(function(e){return e.key})},Yi.prototype.has=function(e){return Ai.has(this._keyIndices,e)},Yi.prototype.priority=function(e){var n=this._keyIndices[e];if(void 0!==n)return this._arr[n].priority},Yi.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},Yi.prototype.add=function(e,n){var r=this._keyIndices;if(e=String(e),!Ai.has(r,e)){var t=this._arr,o=t.length;return r[e]=o,t.push({key:e,priority:n}),this._decrease(o),!0}return!1},Yi.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},Yi.prototype.decrease=function(e,n){var r=this._keyIndices[e];if(n>this._arr[r].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[r].priority+" New: "+n);this._arr[r].priority=n,this._decrease(r)},Yi.prototype._heapify=function(e){var n=this._arr,r=2*e,t=r+1,o=e;r<n.length&&(o=n[r].priority<n[o].priority?r:o,t<n.length&&(o=n[t].priority<n[o].priority?t:o),o!==e&&(this._swap(e,o),this._heapify(o)))},Yi.prototype._decrease=function(e){for(var n,r=this._arr,t=r[e].priority;0!==e&&!(r[n=e>>1].priority<t);)this._swap(e,n),e=n},Yi.prototype._swap=function(e,n){var r=this._arr,t=this._keyIndices,o=r[e],i=r[n];r[e]=i,r[n]=o,t[i.key]=e,t[o.key]=n};var $i=function(e,n,r,t){return function(e,n,r,t){var o,i,a={},u=new qi,c=function(e){var n=e.v!==o?e.v:e.w,t=a[n],c=r(e),s=i.distance+c;if(c<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+c);s<t.distance&&(t.distance=s,t.predecessor=o,u.decrease(n,s))};e.nodes().forEach(function(e){var r=e===n?0:Number.POSITIVE_INFINITY;a[e]={distance:r},u.add(e,r)});for(;u.size()>0&&(o=u.removeMin(),(i=a[o]).distance!==Number.POSITIVE_INFINITY);)t(o).forEach(c);return a}(e,String(n),r||Wi,t||function(n){return e.outEdges(n)})},Wi=Ai.constant(1);var Ki=function(e,n,r){return Ai.transform(e.nodes(),function(t,o){t[o]=$i(e,o,n,r)},{})};var Ji=function(e){var n=0,r=[],t={},o=[];return e.nodes().forEach(function(i){Ai.has(t,i)||function i(a){var u=t[a]={onStack:!0,lowlink:n,index:n++};if(r.push(a),e.successors(a).forEach(function(e){Ai.has(t,e)?t[e].onStack&&(u.lowlink=Math.min(u.lowlink,t[e].index)):(i(e),u.lowlink=Math.min(u.lowlink,t[e].lowlink))}),u.lowlink===u.index){var c,s=[];do{c=r.pop(),t[c].onStack=!1,s.push(c)}while(a!==c);o.push(s)}}(i)}),o};var Qi=function(e){return Ai.filter(Ji(e),function(n){return n.length>1||1===n.length&&e.hasEdge(n[0],n[0])})};var Hi=function(e,n,r){return function(e,n,r){var t={},o=e.nodes();return o.forEach(function(e){t[e]={},t[e][e]={distance:0},o.forEach(function(n){e!==n&&(t[e][n]={distance:Number.POSITIVE_INFINITY})}),r(e).forEach(function(r){var o=r.v===e?r.w:r.v,i=n(r);t[e][o]={distance:i,predecessor:e}})}),o.forEach(function(e){var n=t[e];o.forEach(function(r){var i=t[r];o.forEach(function(r){var t=i[e],o=n[r],a=i[r],u=t.distance+o.distance;u<a.distance&&(a.distance=u,a.predecessor=o.predecessor)})})}),t}(e,n||Xi,r||function(n){return e.outEdges(n)})},Xi=Ai.constant(1);var Zi=ea;function ea(e){var n={},r={},t=[];if(Ai.each(e.sinks(),function o(i){if(Ai.has(r,i))throw new na;Ai.has(n,i)||(r[i]=!0,n[i]=!0,Ai.each(e.predecessors(i),o),delete r[i],t.push(i))}),Ai.size(n)!==e.nodeCount())throw new na;return t}function na(){}ea.CycleException=na,na.prototype=new Error;var ra=function(e,n,r){Ai.isArray(n)||(n=[n]);var t=(e.isDirected()?e.successors:e.neighbors).bind(e),o=[],i={};return Ai.each(n,function(n){if(!e.hasNode(n))throw new Error("Graph does not have node: "+n);!function e(n,r,t,o,i,a){Ai.has(o,r)||(o[r]=!0,t||a.push(r),Ai.each(i(r),function(r){e(n,r,t,o,i,a)}),t&&a.push(r))}(e,n,"post"===r,i,t,o)}),o};var ta,oa={Graph:Di.Graph,json:Ui,alg:{components:Vi,dijkstra:$i,dijkstraAll:Ki,findCycles:Qi,floydWarshall:Hi,isAcyclic:function(e){try{Zi(e)}catch(e){if(e instanceof Zi.CycleException)return!1;throw e}return!0},postorder:function(e,n){return ra(e,n,"post")},preorder:function(e,n){return ra(e,n,"pre")},prim:function(e,n){var r,t=new Ci,o={},i=new qi;function a(e){var t=e.v===r?e.w:e.v,a=i.priority(t);if(void 0!==a){var u=n(e);u<a&&(o[t]=r,i.decrease(t,u))}}if(0===e.nodeCount())return t;Ai.each(e.nodes(),function(e){i.add(e,Number.POSITIVE_INFINITY),t.setNode(e)}),i.decrease(e.nodes()[0],0);var u=!1;for(;i.size()>0;){if(r=i.removeMin(),Ai.has(o,r))t.setEdge(r,o[r]);else{if(u)throw new Error("Input graph is not connected: "+e);u=!0}e.nodeEdges(r).forEach(a)}return t},tarjan:Ji,topsort:Zi},version:Di.version};try{ta=oa}catch(e){}ta||(ta=window.graphlib);var ia=ta,aa=1,ua=4;var ca=function(e){return zr(e,aa|ua)};var sa=function(e,n,r){if(!S(r))return!1;var t=typeof n;return!!("number"==t?cn(r)&&qe(n,r.length):"string"==t&&n in r)&&o(r[n],e)},fa=Object.prototype,da=fa.hasOwnProperty,ha=vi(function(e,n){e=Object(e);var r=-1,t=n.length,i=t>2?n[2]:void 0;for(i&&sa(n[0],n[1],i)&&(t=1);++r<t;)for(var a=n[r],u=ln(a),c=-1,s=u.length;++c<s;){var f=u[c],d=e[f];(void 0===d||o(d,fa[f])&&!da.call(e,f))&&(e[f]=a[f])}return e});var va=function(e){return function(n,r,t){var o=Object(n);if(!cn(n)){var i=mo(r);n=sn(n),r=function(e){return i(o[e],e,o)}}var a=e(n,r,t);return a>-1?o[i?n[a]:a]:void 0}},la=/\\s/;var pa=function(e){for(var n=e.length;n--&&la.test(e.charAt(n)););return n},ga=/^\\s+/;var ya=function(e){return e?e.slice(0,pa(e)+1).replace(ga,""):e},ba=NaN,_a=/^[-+]0x[0-9a-f]+$/i,ma=/^0b[01]+$/i,wa=/^0o[0-7]+$/i,Ea=parseInt;var ja=function(e){if("number"==typeof e)return e;if(Gt(e))return ba;if(S(e)){var n="function"==typeof e.valueOf?e.valueOf():e;e=S(n)?n+"":n}if("string"!=typeof e)return 0===e?e:+e;e=ya(e);var r=ma.test(e);return r||wa.test(e)?Ea(e.slice(2),r?2:8):_a.test(e)?ba:+e},ka=1/0,xa=1.7976931348623157e308;var Na=function(e){return e?(e=ja(e))===ka||e===-ka?(e<0?-1:1)*xa:e==e?e:0:0===e?e:0};var Oa=function(e){var n=Na(e),r=n%1;return n==n?r?n-r:n:0},Ia=Math.max;var Aa=va(function(e,n,r){var t=null==e?0:e.length;if(!t)return-1;var o=null==r?0:Oa(r);return o<0&&(o=Ia(t+o,0)),li(e,mo(n),o)});var Ca=function(e){return null!=e&&e.length?oi(e,1):[]};var Ma=function(e,n){return null==e?e:Gr(e,$r(n),ln)};var Sa=function(e){var n=null==e?0:e.length;return n?e[n-1]:void 0};var Pa=function(e,n){var r={};return n=mo(n),Vr(e,function(e,t,o){Oe(r,t,n(e,t,o))}),r};var La=function(e,n,r){for(var t=-1,o=e.length;++t<o;){var i=e[t],a=n(i);if(null!=a&&(void 0===u?a==a&&!Gt(a):r(a,u)))var u=a,c=i}return c};var Ta=function(e,n){return e>n};var Fa=function(e){return e&&e.length?La(e,Yr,Ta):void 0};var Ra=function(e,n,r){(void 0===r||o(e[n],r))&&(void 0!==r||n in e)||Oe(e,n,r)},za="[object Object]",Da=Function.prototype,Ua=Object.prototype,Ba=Da.toString,Ga=Ua.hasOwnProperty,Va=Ba.call(Object);var qa=function(e){if(!Se(e)||M(e)!=za)return!1;var n=xn(e);if(null===n)return!0;var r=Ga.call(n,"constructor")&&n.constructor;return"function"==typeof r&&r instanceof r&&Ba.call(r)==Va};var Ya=function(e,n){if(("constructor"!==n||"function"!=typeof e[n])&&"__proto__"!=n)return e[n]};var $a=function(e){return Ce(e,ln(e))};var Wa=function(e,n,r,t,o,i,a){var u=Ya(e,r),c=Ya(n,r),s=a.get(c);if(s)Ra(e,r,s);else{var f=i?i(u,c,r+"",e,n,a):void 0,d=void 0===f;if(d){var h=De(c),v=!h&&Be(c),l=!h&&!v&&Xe(c);f=c,h||v||l?De(u)?f=u:ki(u)?f=yn(u):v?(d=!1,f=gn(c,!0)):l?(d=!1,f=Xn(c,!0)):f=[]:qa(c)||ze(c)?(f=u,ze(u)?f=$a(u):S(u)&&!z(u)||(f=wr(c))):d=!1}d&&(a.set(c,f),o(f,c,t,i,a),a.delete(c)),Ra(e,r,f)}};var Ka=function e(n,r,t,o,i){n!==r&&Gr(r,function(a,u){if(i||(i=new ke),S(a))Wa(n,r,u,t,e,o,i);else{var c=o?o(Ya(n,u),a,u+"",n,r,i):void 0;void 0===c&&(c=a),Ra(n,u,c)}},ln)};var Ja=function(e){return vi(function(n,r){var t=-1,o=r.length,i=o>1?r[o-1]:void 0,a=o>2?r[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,a&&sa(r[0],r[1],a)&&(i=o<3?void 0:i,o=1),n=Object(n);++t<o;){var u=r[t];u&&e(n,u,t,i)}return n})}(function(e,n,r){Ka(e,n,r)});var Qa=function(e,n){return e<n};var Ha=function(e){return e&&e.length?La(e,Yr,Qa):void 0};var Xa=function(e,n){return e&&e.length?La(e,mo(n),Qa):void 0},Za=function(){return _.Date.now()};var eu=function(e,n,r,t){if(!S(e))return e;for(var o=-1,i=(n=io(n,e)).length,a=i-1,u=e;null!=u&&++o<i;){var c=uo(n[o]),s=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=a){var f=u[c];void 0===(s=t?t(f,c,u):void 0)&&(s=S(f)?f:qe(n[o+1])?[]:{})}Ae(u,c,s),u=u[c]}return e};var nu=function(e,n,r){for(var t=-1,o=n.length,i={};++t<o;){var a=n[t],u=co(e,a);r(u,a)&&eu(i,io(a,e),u)}return i};var ru=function(e,n){return nu(e,n,function(n,r){return vo(e,r)})};var tu=function(e){return hi(ui(e,void 0,Ca),e+"")}(function(e,n){return null==e?{}:ru(e,n)}),ou=Math.ceil,iu=Math.max;var au=function(e,n,r,t){for(var o=-1,i=iu(ou((n-e)/(r||1)),0),a=Array(i);i--;)a[t?i:++o]=e,e+=r;return a};var uu=function(e){return function(n,r,t){return t&&"number"!=typeof t&&sa(n,r,t)&&(r=t=void 0),n=Na(n),void 0===r?(r=n,n=0):r=Na(r),t=void 0===t?n<r?1:-1:Na(t),au(n,r,t,e)}}();var cu=function(e,n){var r=e.length;for(e.sort(n);r--;)e[r]=e[r].value;return e};var su=function(e,n){if(e!==n){var r=void 0!==e,t=null===e,o=e==e,i=Gt(e),a=void 0!==n,u=null===n,c=n==n,s=Gt(n);if(!u&&!s&&!i&&e>n||i&&a&&c&&!u&&!s||t&&a&&c||!r&&c||!o)return 1;if(!t&&!i&&!s&&e<n||s&&r&&o&&!t&&!i||u&&r&&o||!a&&o||!c)return-1}return 0};var fu=function(e,n,r){for(var t=-1,o=e.criteria,i=n.criteria,a=o.length,u=r.length;++t<a;){var c=su(o[t],i[t]);if(c)return t>=u?c:c*("desc"==r[t]?-1:1)}return e.index-n.index};var du=function(e,n,r){n=n.length?Zt(n,function(e){return De(e)?function(n){return co(n,1===e.length?e[0]:e)}:e}):[Yr];var t=-1;n=Zt(n,Je(mo));var o=Co(e,function(e,r,o){return{criteria:Zt(n,function(n){return n(e)}),index:++t,value:e}});return cu(o,function(e,n){return fu(e,n,r)})},hu=vi(function(e,n){if(null==e)return[];var r=n.length;return r>1&&sa(e,n[0],n[1])?n=[]:r>2&&sa(n[0],n[1],n[2])&&(n=[n[0]]),du(e,oi(n,1),[])}),vu=0;var lu=function(e){var n=++vu;return oo(e)+n};var pu=function(e,n,r){for(var t=-1,o=e.length,i=n.length,a={};++t<o;){var u=t<i?n[t]:void 0;r(a,e[t],u)}return a};var gu,yu=function(e,n){return pu(e||[],n||[],Ae)};try{gu={cloneDeep:ca,constant:Br,defaults:ha,each:Kr,filter:wo,find:Aa,flatten:Ca,forEach:Wr,forIn:Ma,has:ko,isUndefined:Ao,last:Sa,map:Mo,mapValues:Pa,max:Fa,merge:Ja,min:Ha,minBy:Xa,now:Za,pick:tu,range:uu,reduce:Lo,sortBy:hu,uniqueId:lu,values:Ii,zipObject:yu}}catch(e){}gu||(gu=window._);var bu=gu,_u=mu;function mu(){var e={};e._next=e._prev=e,this._sentinel=e}function wu(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Eu(e,n){if("_next"!==e&&"_prev"!==e)return n}mu.prototype.dequeue=function(){var e=this._sentinel,n=e._prev;if(n!==e)return wu(n),n},mu.prototype.enqueue=function(e){var n=this._sentinel;e._prev&&e._next&&wu(e),e._next=n._next,n._next._prev=e,n._next=e,e._prev=n},mu.prototype.toString=function(){for(var e=[],n=this._sentinel,r=n._prev;r!==n;)e.push(JSON.stringify(r,Eu)),r=r._prev;return"["+e.join(", ")+"]"};var ju=ia.Graph,ku=function(e,n){if(e.nodeCount()<=1)return[];var r=function(e,n){var r=new ju,t=0,o=0;bu.forEach(e.nodes(),function(e){r.setNode(e,{v:e,in:0,out:0})}),bu.forEach(e.edges(),function(e){var i=r.edge(e.v,e.w)||0,a=n(e),u=i+a;r.setEdge(e.v,e.w,u),o=Math.max(o,r.node(e.v).out+=a),t=Math.max(t,r.node(e.w).in+=a)});var i=bu.range(o+t+3).map(function(){return new _u}),a=t+1;return bu.forEach(r.nodes(),function(e){Ou(i,a,r.node(e))}),{graph:r,buckets:i,zeroIdx:a}}(e,n||xu),t=function(e,n,r){var t,o=[],i=n[n.length-1],a=n[0];for(;e.nodeCount();){for(;t=a.dequeue();)Nu(e,n,r,t);for(;t=i.dequeue();)Nu(e,n,r,t);if(e.nodeCount())for(var u=n.length-2;u>0;--u)if(t=n[u].dequeue()){o=o.concat(Nu(e,n,r,t,!0));break}}return o}(r.graph,r.buckets,r.zeroIdx);return bu.flatten(bu.map(t,function(n){return e.outEdges(n.v,n.w)}),!0)},xu=bu.constant(1);function Nu(e,n,r,t,o){var i=o?[]:void 0;return bu.forEach(e.inEdges(t.v),function(t){var a=e.edge(t),u=e.node(t.v);o&&i.push({v:t.v,w:t.w}),u.out-=a,Ou(n,r,u)}),bu.forEach(e.outEdges(t.v),function(t){var o=e.edge(t),i=t.w,a=e.node(i);a.in-=o,Ou(n,r,a)}),e.removeNode(t.v),i}function Ou(e,n,r){r.out?r.in?e[r.out-r.in+n].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}var Iu={run:function(e){var n="greedy"===e.graph().acyclicer?ku(e,function(e){return function(n){return e.edge(n).weight}}(e)):function(e){var n=[],r={},t={};return bu.forEach(e.nodes(),function o(i){bu.has(t,i)||(t[i]=!0,r[i]=!0,bu.forEach(e.outEdges(i),function(e){bu.has(r,e.w)?n.push(e):o(e.w)}),delete r[i])}),n}(e);bu.forEach(n,function(n){var r=e.edge(n);e.removeEdge(n),r.forwardName=n.name,r.reversed=!0,e.setEdge(n.w,n.v,r,bu.uniqueId("rev"))})},undo:function(e){bu.forEach(e.edges(),function(n){var r=e.edge(n);if(r.reversed){e.removeEdge(n);var t=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(n.w,n.v,r,t)}})}};var Au=ia.Graph,Cu={addDummyNode:Mu,simplify:function(e){var n=(new Au).setGraph(e.graph());return bu.forEach(e.nodes(),function(r){n.setNode(r,e.node(r))}),bu.forEach(e.edges(),function(r){var t=n.edge(r.v,r.w)||{weight:0,minlen:1},o=e.edge(r);n.setEdge(r.v,r.w,{weight:t.weight+o.weight,minlen:Math.max(t.minlen,o.minlen)})}),n},asNonCompoundGraph:function(e){var n=new Au({multigraph:e.isMultigraph()}).setGraph(e.graph());return bu.forEach(e.nodes(),function(r){e.children(r).length||n.setNode(r,e.node(r))}),bu.forEach(e.edges(),function(r){n.setEdge(r,e.edge(r))}),n},successorWeights:function(e){var n=bu.map(e.nodes(),function(n){var r={};return bu.forEach(e.outEdges(n),function(n){r[n.w]=(r[n.w]||0)+e.edge(n).weight}),r});return bu.zipObject(e.nodes(),n)},predecessorWeights:function(e){var n=bu.map(e.nodes(),function(n){var r={};return bu.forEach(e.inEdges(n),function(n){r[n.v]=(r[n.v]||0)+e.edge(n).weight}),r});return bu.zipObject(e.nodes(),n)},intersectRect:function(e,n){var r,t,o=e.x,i=e.y,a=n.x-o,u=n.y-i,c=e.width/2,s=e.height/2;if(!a&&!u)throw new Error("Not possible to find intersection inside of the rectangle");Math.abs(u)*c>Math.abs(a)*s?(u<0&&(s=-s),r=s*a/u,t=s):(a<0&&(c=-c),r=c,t=c*u/a);return{x:o+r,y:i+t}},buildLayerMatrix:function(e){var n=bu.map(bu.range(Su(e)+1),function(){return[]});return bu.forEach(e.nodes(),function(r){var t=e.node(r),o=t.rank;bu.isUndefined(o)||(n[o][t.order]=r)}),n},normalizeRanks:function(e){var n=bu.min(bu.map(e.nodes(),function(n){return e.node(n).rank}));bu.forEach(e.nodes(),function(r){var t=e.node(r);bu.has(t,"rank")&&(t.rank-=n)})},removeEmptyRanks:function(e){var n=bu.min(bu.map(e.nodes(),function(n){return e.node(n).rank})),r=[];bu.forEach(e.nodes(),function(t){var o=e.node(t).rank-n;r[o]||(r[o]=[]),r[o].push(t)});var t=0,o=e.graph().nodeRankFactor;bu.forEach(r,function(n,r){bu.isUndefined(n)&&r%o!=0?--t:t&&bu.forEach(n,function(n){e.node(n).rank+=t})})},addBorderNode:function(e,n,r,t){var o={width:0,height:0};arguments.length>=4&&(o.rank=r,o.order=t);return Mu(e,"border",o,n)},maxRank:Su,partition:function(e,n){var r={lhs:[],rhs:[]};return bu.forEach(e,function(e){n(e)?r.lhs.push(e):r.rhs.push(e)}),r},time:function(e,n){var r=bu.now();try{return n()}finally{console.log(e+" time: "+(bu.now()-r)+"ms")}},notime:function(e,n){return n()}};function Mu(e,n,r,t){var o;do{o=bu.uniqueId(t)}while(e.hasNode(o));return r.dummy=n,e.setNode(o,r),o}function Su(e){return bu.max(bu.map(e.nodes(),function(n){var r=e.node(n).rank;if(!bu.isUndefined(r))return r}))}var Pu={run:function(e){e.graph().dummyChains=[],bu.forEach(e.edges(),function(n){!function(e,n){var r,t,o,i=n.v,a=e.node(i).rank,u=n.w,c=e.node(u).rank,s=n.name,f=e.edge(n),d=f.labelRank;if(c===a+1)return;for(e.removeEdge(n),o=0,++a;a<c;++o,++a)f.points=[],t={width:0,height:0,edgeLabel:f,edgeObj:n,rank:a},r=Cu.addDummyNode(e,"edge",t,"_d"),a===d&&(t.width=f.width,t.height=f.height,t.dummy="edge-label",t.labelpos=f.labelpos),e.setEdge(i,r,{weight:f.weight},s),0===o&&e.graph().dummyChains.push(r),i=r;e.setEdge(i,u,{weight:f.weight},s)}(e,n)})},undo:function(e){bu.forEach(e.graph().dummyChains,function(n){var r,t=e.node(n),o=t.edgeLabel;for(e.setEdge(t.edgeObj,o);t.dummy;)r=e.successors(n)[0],e.removeNode(n),o.points.push({x:t.x,y:t.y}),"edge-label"===t.dummy&&(o.x=t.x,o.y=t.y,o.width=t.width,o.height=t.height),n=r,t=e.node(n)})}};var Lu=function(e){var n={};bu.forEach(e.sources(),function r(t){var o=e.node(t);if(bu.has(n,t))return o.rank;n[t]=!0;var i=bu.min(bu.map(e.outEdges(t),function(n){return r(n.w)-e.edge(n).minlen}));i!==Number.POSITIVE_INFINITY&&null!=i||(i=0);return o.rank=i})},Tu=function(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen};var Fu=ia.Graph,Ru=Tu,zu=function(e){var n,r,t=new Fu({directed:!1}),o=e.nodes()[0],i=e.nodeCount();t.setNode(o,{});for(;Du(t,e)<i;)n=Uu(t,e),r=t.hasNode(n.v)?Ru(e,n):-Ru(e,n),Bu(t,e,r);return t};function Du(e,n){return bu.forEach(e.nodes(),function r(t){bu.forEach(n.nodeEdges(t),function(o){var i=o.v,a=t===i?o.w:i;e.hasNode(a)||Ru(n,o)||(e.setNode(a,{}),e.setEdge(t,a,{}),r(a))})}),e.nodeCount()}function Uu(e,n){return bu.minBy(n.edges(),function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return Ru(n,r)})}function Bu(e,n,r){bu.forEach(e.nodes(),function(e){n.node(e).rank+=r})}var Gu=Tu,Vu=Lu,qu=ia.alg.preorder,Yu=ia.alg.postorder,$u=Cu.simplify,Wu=Ku;function Ku(e){e=$u(e),Vu(e);var n,r=zu(e);for(Hu(r),Ju(r,e);n=Xu(r);)ec(r,e,n,Zu(r,e,n))}function Ju(e,n){var r=Yu(e,e.nodes());r=r.slice(0,r.length-1),bu.forEach(r,function(r){!function(e,n,r){var t=e.node(r).parent;e.edge(r,t).cutvalue=Qu(e,n,r)}(e,n,r)})}function Qu(e,n,r){var t=e.node(r).parent,o=!0,i=n.edge(r,t),a=0;return i||(o=!1,i=n.edge(t,r)),a=i.weight,bu.forEach(n.nodeEdges(r),function(i){var u,c,s=i.v===r,f=s?i.w:i.v;if(f!==t){var d=s===o,h=n.edge(i).weight;if(a+=d?h:-h,u=r,c=f,e.hasEdge(u,c)){var v=e.edge(r,f).cutvalue;a+=d?-v:v}}}),a}function Hu(e,n){arguments.length<2&&(n=e.nodes()[0]),function e(n,r,t,o,i){var a=t;var u=n.node(o);r[o]=!0;bu.forEach(n.neighbors(o),function(i){bu.has(r,i)||(t=e(n,r,t,i,o))});u.low=a;u.lim=t++;i?u.parent=i:delete u.parent;return t}(e,{},1,n)}function Xu(e){return bu.find(e.edges(),function(n){return e.edge(n).cutvalue<0})}function Zu(e,n,r){var t=r.v,o=r.w;n.hasEdge(t,o)||(t=r.w,o=r.v);var i=e.node(t),a=e.node(o),u=i,c=!1;i.lim>a.lim&&(u=a,c=!0);var s=bu.filter(n.edges(),function(n){return c===nc(e,e.node(n.v),u)&&c!==nc(e,e.node(n.w),u)});return bu.minBy(s,function(e){return Gu(n,e)})}function ec(e,n,r,t){var o=r.v,i=r.w;e.removeEdge(o,i),e.setEdge(t.v,t.w,{}),Hu(e),Ju(e,n),function(e,n){var r=bu.find(e.nodes(),function(e){return!n.node(e).parent}),t=qu(e,r);t=t.slice(1),bu.forEach(t,function(r){var t=e.node(r).parent,o=n.edge(r,t),i=!1;o||(o=n.edge(t,r),i=!0),n.node(r).rank=n.node(t).rank+(i?o.minlen:-o.minlen)})}(e,n)}function nc(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}Ku.initLowLimValues=Hu,Ku.initCutValues=Ju,Ku.calcCutValue=Qu,Ku.leaveEdge=Xu,Ku.enterEdge=Zu,Ku.exchangeEdges=ec;var rc=Lu,tc=function(e){switch(e.graph().ranker){case"network-simplex":ic(e);break;case"tight-tree":!function(e){rc(e),zu(e)}(e);break;case"longest-path":oc(e);break;default:ic(e)}};var oc=rc;function ic(e){Wu(e)}var ac=function(e){var n=function(e){var n={},r=0;return bu.forEach(e.children(),function t(o){var i=r;bu.forEach(e.children(o),t),n[o]={low:i,lim:r++}}),n}(e);bu.forEach(e.graph().dummyChains,function(r){for(var t=e.node(r),o=t.edgeObj,i=function(e,n,r,t){var o,i,a=[],u=[],c=Math.min(n[r].low,n[t].low),s=Math.max(n[r].lim,n[t].lim);o=r;do{o=e.parent(o),a.push(o)}while(o&&(n[o].low>c||s>n[o].lim));i=o,o=t;for(;(o=e.parent(o))!==i;)u.push(o);return{path:a.concat(u.reverse()),lca:i}}(e,n,o.v,o.w),a=i.path,u=i.lca,c=0,s=a[c],f=!0;r!==o.w;){if(t=e.node(r),f){for(;(s=a[c])!==u&&e.node(s).maxRank<t.rank;)c++;s===u&&(f=!1)}if(!f){for(;c<a.length-1&&e.node(s=a[c+1]).minRank<=t.rank;)c++;s=a[c]}e.setParent(r,s),r=e.successors(r)[0]}})};var uc={run:function(e){var n=Cu.addDummyNode(e,"root",{},"_root"),r=function(e){var n={};return bu.forEach(e.children(),function(r){!function r(t,o){var i=e.children(t);i&&i.length&&bu.forEach(i,function(e){r(e,o+1)}),n[t]=o}(r,1)}),n}(e),t=bu.max(bu.values(r))-1,o=2*t+1;e.graph().nestingRoot=n,bu.forEach(e.edges(),function(n){e.edge(n).minlen*=o});var i=function(e){return bu.reduce(e.edges(),function(n,r){return n+e.edge(r).weight},0)}(e)+1;bu.forEach(e.children(),function(a){!function e(n,r,t,o,i,a,u){var c=n.children(u);if(!c.length)return void(u!==r&&n.setEdge(r,u,{weight:0,minlen:t}));var s=Cu.addBorderNode(n,"_bt");var f=Cu.addBorderNode(n,"_bb");var d=n.node(u);n.setParent(s,u);d.borderTop=s;n.setParent(f,u);d.borderBottom=f;bu.forEach(c,function(c){e(n,r,t,o,i,a,c);var d=n.node(c),h=d.borderTop?d.borderTop:c,v=d.borderBottom?d.borderBottom:c,l=d.borderTop?o:2*o,p=h!==v?1:i-a[u]+1;n.setEdge(s,h,{weight:l,minlen:p,nestingEdge:!0}),n.setEdge(v,f,{weight:l,minlen:p,nestingEdge:!0})});n.parent(u)||n.setEdge(r,s,{weight:0,minlen:i+a[u]})}(e,n,o,i,t,r,a)}),e.graph().nodeRankFactor=o},cleanup:function(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,bu.forEach(e.edges(),function(n){var r=e.edge(n);r.nestingEdge&&e.removeEdge(n)})}};var cc=function(e){bu.forEach(e.children(),function n(r){var t=e.children(r);var o=e.node(r);t.length&&bu.forEach(t,n);if(bu.has(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var i=o.minRank,a=o.maxRank+1;i<a;++i)sc(e,"borderLeft","_bl",r,o,i),sc(e,"borderRight","_br",r,o,i)}})};function sc(e,n,r,t,o,i){var a={width:0,height:0,rank:i,borderType:n},u=o[n][i-1],c=Cu.addDummyNode(e,"border",a,r);o[n][i]=c,e.setParent(c,t),u&&e.setEdge(u,c,{weight:1})}var fc={adjust:function(e){var n=e.graph().rankdir.toLowerCase();"lr"!==n&&"rl"!==n||dc(e)},undo:function(e){var n=e.graph().rankdir.toLowerCase();"bt"!==n&&"rl"!==n||function(e){bu.forEach(e.nodes(),function(n){vc(e.node(n))}),bu.forEach(e.edges(),function(n){var r=e.edge(n);bu.forEach(r.points,vc),bu.has(r,"y")&&vc(r)})}(e);"lr"!==n&&"rl"!==n||(!function(e){bu.forEach(e.nodes(),function(n){lc(e.node(n))}),bu.forEach(e.edges(),function(n){var r=e.edge(n);bu.forEach(r.points,lc),bu.has(r,"x")&&lc(r)})}(e),dc(e))}};function dc(e){bu.forEach(e.nodes(),function(n){hc(e.node(n))}),bu.forEach(e.edges(),function(n){hc(e.edge(n))})}function hc(e){var n=e.width;e.width=e.height,e.height=n}function vc(e){e.y=-e.y}function lc(e){var n=e.x;e.x=e.y,e.y=n}var pc=function(e){var n={},r=bu.filter(e.nodes(),function(n){return!e.children(n).length}),t=bu.max(bu.map(r,function(n){return e.node(n).rank})),o=bu.map(bu.range(t+1),function(){return[]});var i=bu.sortBy(r,function(n){return e.node(n).rank});return bu.forEach(i,function r(t){if(!bu.has(n,t)){n[t]=!0;var i=e.node(t);o[i.rank].push(t),bu.forEach(e.successors(t),r)}}),o};var gc=function(e,n){for(var r=0,t=1;t<n.length;++t)r+=yc(e,n[t-1],n[t]);return r};function yc(e,n,r){for(var t=bu.zipObject(r,bu.map(r,function(e,n){return n})),o=bu.flatten(bu.map(n,function(n){return bu.sortBy(bu.map(e.outEdges(n),function(n){return{pos:t[n.w],weight:e.edge(n).weight}}),"pos")}),!0),i=1;i<r.length;)i<<=1;var a=2*i-1;i-=1;var u=bu.map(new Array(a),function(){return 0}),c=0;return bu.forEach(o.forEach(function(e){var n=e.pos+i;u[n]+=e.weight;for(var r=0;n>0;)n%2&&(r+=u[n+1]),u[n=n-1>>1]+=e.weight;c+=e.weight*r})),c}var bc=function(e,n){return bu.map(n,function(n){var r=e.inEdges(n);if(r.length){var t=bu.reduce(r,function(n,r){var t=e.edge(r),o=e.node(r.v);return{sum:n.sum+t.weight*o.order,weight:n.weight+t.weight}},{sum:0,weight:0});return{v:n,barycenter:t.sum/t.weight,weight:t.weight}}return{v:n}})};var _c=function(e,n){var r={};return bu.forEach(e,function(e,n){var t=r[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:n};bu.isUndefined(e.barycenter)||(t.barycenter=e.barycenter,t.weight=e.weight)}),bu.forEach(n.edges(),function(e){var n=r[e.v],t=r[e.w];bu.isUndefined(n)||bu.isUndefined(t)||(t.indegree++,n.out.push(r[e.w]))}),function(e){var n=[];function r(e){return function(n){var r,t,o,i;n.merged||(bu.isUndefined(n.barycenter)||bu.isUndefined(e.barycenter)||n.barycenter>=e.barycenter)&&(t=n,o=0,i=0,(r=e).weight&&(o+=r.barycenter*r.weight,i+=r.weight),t.weight&&(o+=t.barycenter*t.weight,i+=t.weight),r.vs=t.vs.concat(r.vs),r.barycenter=o/i,r.weight=i,r.i=Math.min(t.i,r.i),t.merged=!0)}}function t(n){return function(r){r.in.push(n),0==--r.indegree&&e.push(r)}}for(;e.length;){var o=e.pop();n.push(o),bu.forEach(o.in.reverse(),r(o)),bu.forEach(o.out,t(o))}return bu.map(bu.filter(n,function(e){return!e.merged}),function(e){return bu.pick(e,["vs","i","barycenter","weight"])})}(bu.filter(r,function(e){return!e.indegree}))};var mc=function(e,n){var r=Cu.partition(e,function(e){return bu.has(e,"barycenter")}),t=r.lhs,o=bu.sortBy(r.rhs,function(e){return-e.i}),i=[],a=0,u=0,c=0;t.sort((s=!!n,function(e,n){return e.barycenter<n.barycenter?-1:e.barycenter>n.barycenter?1:s?n.i-e.i:e.i-n.i})),c=wc(i,o,c),bu.forEach(t,function(e){c+=e.vs.length,i.push(e.vs),a+=e.barycenter*e.weight,u+=e.weight,c=wc(i,o,c)});var s;var f={vs:bu.flatten(i,!0)};u&&(f.barycenter=a/u,f.weight=u);return f};function wc(e,n,r){for(var t;n.length&&(t=bu.last(n)).i<=r;)n.pop(),e.push(t.vs),r++;return r}var Ec=function e(n,r,t,o){var i=n.children(r);var a=n.node(r);var u=a?a.borderLeft:void 0;var c=a?a.borderRight:void 0;var s={};u&&(i=bu.filter(i,function(e){return e!==u&&e!==c}));var f=bc(n,i);bu.forEach(f,function(r){if(n.children(r.v).length){var i=e(n,r.v,t,o);s[r.v]=i,bu.has(i,"barycenter")&&(a=r,u=i,bu.isUndefined(a.barycenter)?(a.barycenter=u.barycenter,a.weight=u.weight):(a.barycenter=(a.barycenter*a.weight+u.barycenter*u.weight)/(a.weight+u.weight),a.weight+=u.weight))}var a,u});var d=_c(f,t);!function(e,n){bu.forEach(e,function(e){e.vs=bu.flatten(e.vs.map(function(e){return n[e]?n[e].vs:e}),!0)})}(d,s);var h=mc(d,o);if(u&&(h.vs=bu.flatten([u,h.vs,c],!0),n.predecessors(u).length)){var v=n.node(n.predecessors(u)[0]),l=n.node(n.predecessors(c)[0]);bu.has(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+v.order+l.order)/(h.weight+2),h.weight+=2}return h};var jc=ia.Graph,kc=function(e,n,r){var t=function(e){var n;for(;e.hasNode(n=bu.uniqueId("_root")););return n}(e),o=new jc({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(n){return e.node(n)});return bu.forEach(e.nodes(),function(i){var a=e.node(i),u=e.parent(i);(a.rank===n||a.minRank<=n&&n<=a.maxRank)&&(o.setNode(i),o.setParent(i,u||t),bu.forEach(e[r](i),function(n){var r=n.v===i?n.w:n.v,t=o.edge(r,i),a=bu.isUndefined(t)?0:t.weight;o.setEdge(r,i,{weight:e.edge(n).weight+a})}),bu.has(a,"minRank")&&o.setNode(i,{borderLeft:a.borderLeft[n],borderRight:a.borderRight[n]}))}),o};var xc=function(e,n,r){var t,o={};bu.forEach(r,function(r){for(var i,a,u=e.parent(r);u;){if((i=e.parent(u))?(a=o[i],o[i]=u):(a=t,t=u),a&&a!==u)return void n.setEdge(a,u);u=i}})};var Nc=ia.Graph,Oc=function(e){var n=Cu.maxRank(e),r=Ic(e,bu.range(1,n+1),"inEdges"),t=Ic(e,bu.range(n-1,-1,-1),"outEdges"),o=pc(e);Cc(e,o);for(var i,a=Number.POSITIVE_INFINITY,u=0,c=0;c<4;++u,++c){Ac(u%2?r:t,u%4>=2),o=Cu.buildLayerMatrix(e);var s=gc(e,o);s<a&&(c=0,i=bu.cloneDeep(o),a=s)}Cc(e,i)};function Ic(e,n,r){return bu.map(n,function(n){return kc(e,n,r)})}function Ac(e,n){var r=new Nc;bu.forEach(e,function(e){var t=e.graph().root,o=Ec(e,t,r,n);bu.forEach(o.vs,function(n,r){e.node(n).order=r}),xc(e,r,o.vs)})}function Cc(e,n){bu.forEach(n,function(n){bu.forEach(n,function(n,r){e.node(n).order=r})})}var Mc=ia.Graph,Sc=function(e){var n,r=Cu.buildLayerMatrix(e),t=bu.merge(Pc(e,r),Lc(e,r)),o={};bu.forEach(["u","d"],function(i){n="u"===i?r:bu.values(r).reverse(),bu.forEach(["l","r"],function(r){"r"===r&&(n=bu.map(n,function(e){return bu.values(e).reverse()}));var a=("u"===i?e.predecessors:e.successors).bind(e),u=Rc(e,n,t,a),c=zc(e,n,u.root,u.align,"r"===r);"r"===r&&(c=bu.mapValues(c,function(e){return-e})),o[i+r]=c})});var i=Dc(e,o);return Uc(o,i),Bc(o,e.graph().align)};function Pc(e,n){var r={};return bu.reduce(n,function(n,t){var o=0,i=0,a=n.length,u=bu.last(t);return bu.forEach(t,function(n,c){var s=function(e,n){if(e.node(n).dummy)return bu.find(e.predecessors(n),function(n){return e.node(n).dummy})}(e,n),f=s?e.node(s).order:a;(s||n===u)&&(bu.forEach(t.slice(i,c+1),function(n){bu.forEach(e.predecessors(n),function(t){var i=e.node(t),a=i.order;!(a<o||f<a)||i.dummy&&e.node(n).dummy||Tc(r,t,n)})}),i=c+1,o=f)}),t}),r}function Lc(e,n){var r={};function t(n,t,o,i,a){var u;bu.forEach(bu.range(t,o),function(t){u=n[t],e.node(u).dummy&&bu.forEach(e.predecessors(u),function(n){var t=e.node(n);t.dummy&&(t.order<i||t.order>a)&&Tc(r,n,u)})})}return bu.reduce(n,function(n,r){var o,i=-1,a=0;return bu.forEach(r,function(u,c){if("border"===e.node(u).dummy){var s=e.predecessors(u);s.length&&(o=e.node(s[0]).order,t(r,a,c,i,o),a=c,i=o)}t(r,a,r.length,o,n.length)}),r}),r}function Tc(e,n,r){if(n>r){var t=n;n=r,r=t}var o=e[n];o||(e[n]=o={}),o[r]=!0}function Fc(e,n,r){if(n>r){var t=n;n=r,r=t}return bu.has(e[n],r)}function Rc(e,n,r,t){var o={},i={},a={};return bu.forEach(n,function(e){bu.forEach(e,function(e,n){o[e]=e,i[e]=e,a[e]=n})}),bu.forEach(n,function(e){var n=-1;bu.forEach(e,function(e){var u=t(e);if(u.length)for(var c=((u=bu.sortBy(u,function(e){return a[e]})).length-1)/2,s=Math.floor(c),f=Math.ceil(c);s<=f;++s){var d=u[s];i[e]===e&&n<a[d]&&!Fc(r,e,d)&&(i[d]=e,i[e]=o[e]=o[d],n=a[d])}})}),{root:o,align:i}}function zc(e,n,r,t,o){var i={},a=function(e,n,r,t){var o=new Mc,i=e.graph(),a=function(e,n,r){return function(t,o,i){var a,u=t.node(o),c=t.node(i),s=0;if(s+=u.width/2,bu.has(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":a=-u.width/2;break;case"r":a=u.width/2}if(a&&(s+=r?a:-a),a=0,s+=(u.dummy?n:e)/2,s+=(c.dummy?n:e)/2,s+=c.width/2,bu.has(c,"labelpos"))switch(c.labelpos.toLowerCase()){case"l":a=c.width/2;break;case"r":a=-c.width/2}return a&&(s+=r?a:-a),a=0,s}}(i.nodesep,i.edgesep,t);return bu.forEach(n,function(n){var t;bu.forEach(n,function(n){var i=r[n];if(o.setNode(i),t){var u=r[t],c=o.edge(u,i);o.setEdge(u,i,Math.max(a(e,n,t),c||0))}t=n})}),o}(e,n,r,o),u=o?"borderLeft":"borderRight";function c(e,n){for(var r=a.nodes(),t=r.pop(),o={};t;)o[t]?e(t):(o[t]=!0,r.push(t),r=r.concat(n(t))),t=r.pop()}return c(function(e){i[e]=a.inEdges(e).reduce(function(e,n){return Math.max(e,i[n.v]+a.edge(n))},0)},a.predecessors.bind(a)),c(function(n){var r=a.outEdges(n).reduce(function(e,n){return Math.min(e,i[n.w]-a.edge(n))},Number.POSITIVE_INFINITY),t=e.node(n);r!==Number.POSITIVE_INFINITY&&t.borderType!==u&&(i[n]=Math.max(i[n],r))},a.successors.bind(a)),bu.forEach(t,function(e){i[e]=i[r[e]]}),i}function Dc(e,n){return bu.minBy(bu.values(n),function(n){var r=Number.NEGATIVE_INFINITY,t=Number.POSITIVE_INFINITY;return bu.forIn(n,function(n,o){var i=function(e,n){return e.node(n).width}(e,o)/2;r=Math.max(n+i,r),t=Math.min(n-i,t)}),r-t})}function Uc(e,n){var r=bu.values(n),t=bu.min(r),o=bu.max(r);bu.forEach(["u","d"],function(r){bu.forEach(["l","r"],function(i){var a,u=r+i,c=e[u];if(c!==n){var s=bu.values(c);(a="l"===i?t-bu.min(s):o-bu.max(s))&&(e[u]=bu.mapValues(c,function(e){return e+a}))}})})}function Bc(e,n){return bu.mapValues(e.ul,function(r,t){if(n)return e[n.toLowerCase()][t];var o=bu.sortBy(bu.map(e,t));return(o[1]+o[2])/2})}var Gc=Sc,Vc=function(e){(function(e){var n=Cu.buildLayerMatrix(e),r=e.graph().ranksep,t=0;bu.forEach(n,function(n){var o=bu.max(bu.map(n,function(n){return e.node(n).height}));bu.forEach(n,function(n){e.node(n).y=t+o/2}),t+=o+r})})(e=Cu.asNonCompoundGraph(e)),bu.forEach(Gc(e),function(n,r){e.node(r).x=n})};var qc=Cu.normalizeRanks,Yc=Cu.removeEmptyRanks,$c=Cu,Wc=ia.Graph,Kc=function(e,n){var r=n&&n.debugTiming?$c.time:$c.notime;r("layout",function(){var n=r(" buildLayoutGraph",function(){return function(e){var n=new Wc({multigraph:!0,compound:!0}),r=os(e.graph());return n.setGraph(bu.merge({},Qc,ts(r,Jc),bu.pick(r,Hc))),bu.forEach(e.nodes(),function(r){var t=os(e.node(r));n.setNode(r,bu.defaults(ts(t,Xc),Zc)),n.setParent(r,e.parent(r))}),bu.forEach(e.edges(),function(r){var t=os(e.edge(r));n.setEdge(r,bu.merge({},ns,ts(t,es),bu.pick(t,rs)))}),n}(e)});r(" runLayout",function(){!function(e,n){n(" makeSpaceForEdgeLabels",function(){!function(e){var n=e.graph();n.ranksep/=2,bu.forEach(e.edges(),function(r){var t=e.edge(r);t.minlen*=2,"c"!==t.labelpos.toLowerCase()&&("TB"===n.rankdir||"BT"===n.rankdir?t.width+=t.labeloffset:t.height+=t.labeloffset)})}(e)}),n(" removeSelfEdges",function(){!function(e){bu.forEach(e.edges(),function(n){if(n.v===n.w){var r=e.node(n.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}})}(e)}),n(" acyclic",function(){Iu.run(e)}),n(" nestingGraph.run",function(){uc.run(e)}),n(" rank",function(){tc($c.asNonCompoundGraph(e))}),n(" injectEdgeLabelProxies",function(){!function(e){bu.forEach(e.edges(),function(n){var r=e.edge(n);if(r.width&&r.height){var t=e.node(n.v),o=e.node(n.w),i={rank:(o.rank-t.rank)/2+t.rank,e:n};$c.addDummyNode(e,"edge-proxy",i,"_ep")}})}(e)}),n(" removeEmptyRanks",function(){Yc(e)}),n(" nestingGraph.cleanup",function(){uc.cleanup(e)}),n(" normalizeRanks",function(){qc(e)}),n(" assignRankMinMax",function(){!function(e){var n=0;bu.forEach(e.nodes(),function(r){var t=e.node(r);t.borderTop&&(t.minRank=e.node(t.borderTop).rank,t.maxRank=e.node(t.borderBottom).rank,n=bu.max(n,t.maxRank))}),e.graph().maxRank=n}(e)}),n(" removeEdgeLabelProxies",function(){!function(e){bu.forEach(e.nodes(),function(n){var r=e.node(n);"edge-proxy"===r.dummy&&(e.edge(r.e).labelRank=r.rank,e.removeNode(n))})}(e)}),n(" normalize.run",function(){Pu.run(e)}),n(" parentDummyChains",function(){ac(e)}),n(" addBorderSegments",function(){cc(e)}),n(" order",function(){Oc(e)}),n(" insertSelfEdges",function(){!function(e){var n=$c.buildLayerMatrix(e);bu.forEach(n,function(n){var r=0;bu.forEach(n,function(n,t){var o=e.node(n);o.order=t+r,bu.forEach(o.selfEdges,function(n){$c.addDummyNode(e,"selfedge",{width:n.label.width,height:n.label.height,rank:o.rank,order:t+ ++r,e:n.e,label:n.label},"_se")}),delete o.selfEdges})})}(e)}),n(" adjustCoordinateSystem",function(){fc.adjust(e)}),n(" position",function(){Vc(e)}),n(" positionSelfEdges",function(){!function(e){bu.forEach(e.nodes(),function(n){var r=e.node(n);if("selfedge"===r.dummy){var t=e.node(r.e.v),o=t.x+t.width/2,i=t.y,a=r.x-o,u=t.height/2;e.setEdge(r.e,r.label),e.removeNode(n),r.label.points=[{x:o+2*a/3,y:i-u},{x:o+5*a/6,y:i-u},{x:o+a,y:i},{x:o+5*a/6,y:i+u},{x:o+2*a/3,y:i+u}],r.label.x=r.x,r.label.y=r.y}})}(e)}),n(" removeBorderNodes",function(){!function(e){bu.forEach(e.nodes(),function(n){if(e.children(n).length){var r=e.node(n),t=e.node(r.borderTop),o=e.node(r.borderBottom),i=e.node(bu.last(r.borderLeft)),a=e.node(bu.last(r.borderRight));r.width=Math.abs(a.x-i.x),r.height=Math.abs(o.y-t.y),r.x=i.x+r.width/2,r.y=t.y+r.height/2}}),bu.forEach(e.nodes(),function(n){"border"===e.node(n).dummy&&e.removeNode(n)})}(e)}),n(" normalize.undo",function(){Pu.undo(e)}),n(" fixupEdgeLabelCoords",function(){!function(e){bu.forEach(e.edges(),function(n){var r=e.edge(n);if(bu.has(r,"x"))switch("l"!==r.labelpos&&"r"!==r.labelpos||(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset}})}(e)}),n(" undoCoordinateSystem",function(){fc.undo(e)}),n(" translateGraph",function(){!function(e){var n=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,o=0,i=e.graph(),a=i.marginx||0,u=i.marginy||0;function c(e){var i=e.x,a=e.y,u=e.width,c=e.height;n=Math.min(n,i-u/2),r=Math.max(r,i+u/2),t=Math.min(t,a-c/2),o=Math.max(o,a+c/2)}bu.forEach(e.nodes(),function(n){c(e.node(n))}),bu.forEach(e.edges(),function(n){var r=e.edge(n);bu.has(r,"x")&&c(r)}),n-=a,t-=u,bu.forEach(e.nodes(),function(r){var o=e.node(r);o.x-=n,o.y-=t}),bu.forEach(e.edges(),function(r){var o=e.edge(r);bu.forEach(o.points,function(e){e.x-=n,e.y-=t}),bu.has(o,"x")&&(o.x-=n),bu.has(o,"y")&&(o.y-=t)}),i.width=r-n+a,i.height=o-t+u}(e)}),n(" assignNodeIntersects",function(){!function(e){bu.forEach(e.edges(),function(n){var r,t,o=e.edge(n),i=e.node(n.v),a=e.node(n.w);o.points?(r=o.points[0],t=o.points[o.points.length-1]):(o.points=[],r=a,t=i),o.points.unshift($c.intersectRect(i,r)),o.points.push($c.intersectRect(a,t))})}(e)}),n(" reversePoints",function(){!function(e){bu.forEach(e.edges(),function(n){var r=e.edge(n);r.reversed&&r.points.reverse()})}(e)}),n(" acyclic.undo",function(){Iu.undo(e)})}(n,r)}),r(" updateInputGraph",function(){!function(e,n){bu.forEach(e.nodes(),function(r){var t=e.node(r),o=n.node(r);t&&(t.x=o.x,t.y=o.y,n.children(r).length&&(t.width=o.width,t.height=o.height))}),bu.forEach(e.edges(),function(r){var t=e.edge(r),o=n.edge(r);t.points=o.points,bu.has(o,"x")&&(t.x=o.x,t.y=o.y)}),e.graph().width=n.graph().width,e.graph().height=n.graph().height}(e,n)})})};var Jc=["nodesep","edgesep","ranksep","marginx","marginy"],Qc={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Hc=["acyclicer","ranker","rankdir","align"],Xc=["width","height"],Zc={width:0,height:0},es=["minlen","weight","width","height","labeloffset"],ns={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},rs=["labelpos"];function ts(e,n){return bu.mapValues(bu.pick(e,n),Number)}function os(e){var n={};return bu.forEach(e,function(e,r){n[r.toLowerCase()]=e}),n}var is=ia.Graph;var as={graphlib:ia,layout:Kc,debug:{debugOrdering:function(e){var n=Cu.buildLayerMatrix(e),r=new is({compound:!0,multigraph:!0}).setGraph({});return bu.forEach(e.nodes(),function(n){r.setNode(n,{label:n}),r.setParent(n,"layer"+e.node(n).rank)}),bu.forEach(e.edges(),function(e){r.setEdge(e.v,e.w,{},e.name)}),bu.forEach(n,function(e,n){var t="layer"+n;r.setNode(t,{rank:"same"}),bu.reduce(e,function(e,n){return r.setEdge(e,n,{style:"invis"}),n})}),r}},util:{time:Cu.time,notime:Cu.notime},version:"0.8.5"},us=as.graphlib,cs=as.layout;n(function(n,r){n.exports=function(){function n(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},t=0,o=void 0,i=void 0,a=function(e,n){v[t]=e,v[t+1]=n,2===(t+=2)&&(i?i(l):_())},u="undefined"!=typeof window?window:void 0,c=u||{},s=c.MutationObserver||c.WebKitMutationObserver,f="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),d="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function h(){var e=setTimeout;return function(){return e(l,1)}}var v=new Array(1e3);function l(){for(var e=0;e<t;e+=2){var n=v[e],r=v[e+1];n(r),v[e]=void 0,v[e+1]=void 0}t=0}var p,g,y,b,_=void 0;function m(e,n){var r=this,t=new this.constructor(j);void 0===t[E]&&F(t);var o=r._state;if(o){var i=arguments[o-1];a(function(){return L(o,t,i,r._result)})}else S(r,t,e,n);return t}function w(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var n=new this(j);return I(n,e),n}f?_=function(){return process.nextTick(l)}:s?(g=0,y=new s(l),b=document.createTextNode(""),y.observe(b,{characterData:!0}),_=function(){b.data=g=++g%2}):d?((p=new MessageChannel).port1.onmessage=l,_=function(){return p.port2.postMessage(0)}):_=void 0===u?function(){try{var e=Function("return this")().require("vertx");return void 0!==(o=e.runOnLoop||e.runOnContext)?function(){o(l)}:h()}catch(e){return h()}}():h();var E=Math.random().toString(36).substring(2);function j(){}var k=void 0,x=1,N=2;function O(e,r,t){r.constructor===e.constructor&&t===m&&r.constructor.resolve===w?function(e,n){n._state===x?C(e,n._result):n._state===N?M(e,n._result):S(n,void 0,function(n){return I(e,n)},function(n){return M(e,n)})}(e,r):void 0===t?C(e,r):n(t)?function(e,n,r){a(function(e){var t=!1,o=function(e,n,r,t){try{e.call(n,r,t)}catch(e){return e}}(r,n,function(r){t||(t=!0,n!==r?I(e,r):C(e,r))},function(n){t||(t=!0,M(e,n))},e._label);!t&&o&&(t=!0,M(e,o))},e)}(e,r,t):C(e,r)}function I(e,n){if(e===n)M(e,new TypeError("You cannot resolve a promise with itself"));else if(o=typeof(t=n),null===t||"object"!==o&&"function"!==o)C(e,n);else{var r=void 0;try{r=n.then}catch(n){return void M(e,n)}O(e,n,r)}var t,o}function A(e){e._onerror&&e._onerror(e._result),P(e)}function C(e,n){e._state===k&&(e._result=n,e._state=x,0!==e._subscribers.length&&a(P,e))}function M(e,n){e._state===k&&(e._state=N,e._result=n,a(A,e))}function S(e,n,r,t){var o=e._subscribers,i=o.length;e._onerror=null,o[i]=n,o[i+x]=r,o[i+N]=t,0===i&&e._state&&a(P,e)}function P(e){var n=e._subscribers,r=e._state;if(0!==n.length){for(var t=void 0,o=void 0,i=e._result,a=0;a<n.length;a+=3)t=n[a],o=n[a+r],t?L(r,t,o,i):o(i);e._subscribers.length=0}}function L(e,r,t,o){var i=n(t),a=void 0,u=void 0,c=!0;if(i){try{a=t(o)}catch(e){c=!1,u=e}if(r===a)return void M(r,new TypeError("A promises callback cannot return that same promise."))}else a=o;r._state!==k||(i&&c?I(r,a):!1===c?M(r,u):e===x?C(r,a):e===N&&M(r,a))}var T=0;function F(e){e[E]=T++,e._state=void 0,e._result=void 0,e._subscribers=[]}var R=function(){function e(e,n){this._instanceConstructor=e,this.promise=new e(j),this.promise[E]||F(this.promise),r(n)?(this.length=n.length,this._remaining=n.length,this._result=new Array(this.length),0===this.length?C(this.promise,this._result):(this.length=this.length||0,this._enumerate(n),0===this._remaining&&C(this.promise,this._result))):M(this.promise,new Error("Array Methods must be provided an Array"))}return e.prototype._enumerate=function(e){for(var n=0;this._state===k&&n<e.length;n++)this._eachEntry(e[n],n)},e.prototype._eachEntry=function(e,n){var r=this._instanceConstructor,t=r.resolve;if(t===w){var o=void 0,i=void 0,a=!1;try{o=e.then}catch(e){a=!0,i=e}if(o===m&&e._state!==k)this._settledAt(e._state,n,e._result);else if("function"!=typeof o)this._remaining--,this._result[n]=e;else if(r===z){var u=new r(j);a?M(u,i):O(u,e,o),this._willSettleAt(u,n)}else this._willSettleAt(new r(function(n){return n(e)}),n)}else this._willSettleAt(t(e),n)},e.prototype._settledAt=function(e,n,r){var t=this.promise;t._state===k&&(this._remaining--,e===N?M(t,r):this._result[n]=r),0===this._remaining&&C(t,this._result)},e.prototype._willSettleAt=function(e,n){var r=this;S(e,void 0,function(e){return r._settledAt(x,n,e)},function(e){return r._settledAt(N,n,e)})},e}(),z=function(){function e(n){this[E]=T++,this._result=this._state=void 0,this._subscribers=[],j!==n&&("function"!=typeof n&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(e,n){try{n(function(n){I(e,n)},function(n){M(e,n)})}catch(n){M(e,n)}}(this,n):function(){throw new TypeError("Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(e){return this.then(null,e)},e.prototype.finally=function(e){var r=this.constructor;return n(e)?this.then(function(n){return r.resolve(e()).then(function(){return n})},function(n){return r.resolve(e()).then(function(){throw n})}):this.then(e,e)},e}();return z.prototype.then=m,z.all=function(e){return new R(this,e).promise},z.race=function(e){var n=this;return r(e)?new n(function(r,t){for(var o=e.length,i=0;i<o;i++)n.resolve(e[i]).then(r,t)}):new n(function(e,n){return n(new TypeError("You must pass an array to race."))})},z.resolve=w,z.reject=function(e){var n=new this(j);return M(n,e),n},z._setScheduler=function(e){i=e},z._setAsap=function(e){a=e},z._asap=a,z.polyfill=function(){var n=void 0;if(void 0!==e)n=e;else if("undefined"!=typeof self)n=self;else try{n=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var r=n.Promise;if(r){var t=null;try{t=Object.prototype.toString.call(r.resolve())}catch(e){}if("[object Promise]"===t&&!r.cast)return}n.Promise=z},z.Promise=z,z}()}).polyfill();self.onmessage=function(e){var n=function(e,n){var r=e.subgraphs,t=e.nodes,o=e.links,i=e.hierarchy,a=new us.Graph({multigraph:!0,compound:!0,directed:!1!==n.digraph}).setGraph(n).setDefaultNodeLabel(function(){return{}}).setDefaultEdgeLabel(function(){return{}});r.forEach(function(e){a.setNode(e.id,e)}),t.forEach(function(e){a.setNode(e.id,e)}),o.forEach(function(e){a.setEdge(e.source.id,e.target.id,e,e.id)}),i.forEach(function(e){a.setParent(e.child,e.parent)}),cs(a,{debugTiming:!1});var u=-a.graph().width/2||0,c=-a.graph().height/2;return a.nodes().forEach(function(e){var n=a.node(e);n.x+=u,n.y+=c}),a.edges().forEach(function(e){var n=a.edge(e);n.points=n.points.map(function(e){return[e.x+u,e.y+c]})}),{subgraphs:r,nodes:t,links:o}}.apply(void 0,e.data);self.postMessage(n)}}();'],{type:"application/javascript"}),n=URL.createObjectURL(r),o=new Worker(n);return{terminate:function(){return o.terminate()},response:new Promise(function(r){o.onmessage=function(e){r(e.data),o.terminate(),URL.revokeObjectURL(n)},o.postMessage([e,t])})}}({subgraphs:n.allSubgraphs().map(function(e){return u(u({},e.props),{id:vh(e.id)})}),nodes:n.allVertices().map(function(e){delete e.fx,delete e.fy;var t=e.element.node().getBBox();return u({width:t.width,height:t.height},e.props)}),links:n.allEdges().map(function(e){return e.props}),hierarchy:h(h([],n.allSubgraphs().filter(function(e){return!!n.subgraphParent(e.id)}).map(function(e){return{parent:vh(n.subgraphParent(e.id).props.id),child:vh(e.id)}})),n.allVertices().filter(function(e){return void 0!==n.vertexParent(e.id)}).map(function(e){return{parent:vh(n.vertexParent(e.id).props.id),child:e.id}}))},this._options).response.then(function(e){return t.running()&&(e.subgraphs.forEach(function(e){var t=n.subgraph(e.id.substring(8));t.x=e.x+r.width/2,t.y=e.y+r.height/2,t.props.width=e.width,t.props.height=e.height}),e.nodes.forEach(function(e){var t=n.vertex(e.id);t.x=e.x+r.width/2,t.y=e.y+r.height/2}),e.links.forEach(function(e){var t=n.edge(e.id),o=yh(t.source.x,t.source.y,e.points[0][0]+r.width/2,e.points[0][1]+r.height/2),i=yh(t.target.x,t.target.y,e.points[0][0]+r.width/2,e.points[0][1]+r.height/2);t.points=h(h([o<i?[t.source.x,t.source.y]:[t.target.x,t.target.y]],e.points.map(function(e){return[e[0]+r.width/2,e[1]+r.height/2]})),[o<i?[t.target.x,t.target.y]:[t.source.x,t.source.y]])}),t._graph.moveVertices(!0).moveSubgraphs(!0).moveEdges(!0),t.stop()),t})},t.prototype.edgePath=function(t,r){var n=this,o=[],i=!1;return t.points&&(o=t.points.map(function(e){var t=n._graph.project(e[0],!1),r=n._graph.project(e[1],!1);return(isNaN(t)||isNaN(r))&&(i=!0),[t,r]})),i||o.length<2?e.prototype.edgePath.call(this,t,r):{path:gh(o),labelPos:this.center(o)}},t}(fh),_h=function(e){function t(t,r){var n=e.call(this,t)||this;return n._options=r,n}return s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then(function(){var e=t._graph.size(),r=t._graph.graphData(),n=r.allVertices(),o=r.allEdges();o.forEach(function(e){return delete e.points}),t._links=ll(o).id(function(e){return e.id}).distance(t._options.linkDistance).strength(t._options.linkStrength),t._charge=Nl().strength(t._options.repulsionStrength).distanceMin(t._options.distanceMin).distanceMax(t._options.distanceMax),t._center=Jc(e.width/2,e.height/2);var i=function(e){var t,r,n,o=Kc(.1);function i(e){for(var o,i=0,a=t.length;i<a;++i)(o=t[i]).vx+=(n[i]-o.x)*r[i]*e}function a(){if(t){var i,a=t.length;for(r=new Array(a),n=new Array(a),i=0;i<a;++i)r[i]=isNaN(n[i]=+e(t[i],i,t))?0:+o(t[i],i,t)}}return"function"!=typeof e&&(e=Kc(null==e?0:+e)),i.initialize=function(e){t=e,a()},i.strength=function(e){return arguments.length?(o="function"==typeof e?e:Kc(+e),a(),i):o},i.x=function(t){return arguments.length?(e="function"==typeof t?t:Kc(+t),a(),i):e},i}().strength(t._options.forceStrength),a=function(e){var t,r,n,o=Kc(.1);function i(e){for(var o,i=0,a=t.length;i<a;++i)(o=t[i]).vy+=(n[i]-o.y)*r[i]*e}function a(){if(t){var i,a=t.length;for(r=new Array(a),n=new Array(a),i=0;i<a;++i)r[i]=isNaN(n[i]=+e(t[i],i,t))?0:+o(t[i],i,t)}}return"function"!=typeof e&&(e=Kc(null==e?0:+e)),i.initialize=function(e){t=e,a()},i.strength=function(e){return arguments.length?(o="function"==typeof e?e:Kc(+e),a(),i):o},i.y=function(t){return arguments.length?(e="function"==typeof t?t:Kc(+t),a(),i):e},i}().strength(t._options.forceStrength);return t._simulation=Ol(n.map(function(r){var n=r.element.node().getBBox(),o=n.width,i=n.height;return r.fx=t._options.pinCentroid&&r.centroid?e.width/2:void 0,r.fy=t._options.pinCentroid&&r.centroid?e.height/2:void 0,r.width=o,r.height=i,r})).force("link",t._links).force("charge",t._charge).force("center",t._center).force("x",i).force("y",a).alpha(t._options.alpha/2).alphaMin(t._options.alphaMin).alphaDecay(t._options.alphaDecay).velocityDecay(t._options.velocityDecay).stop(),t})},t.prototype.stop=function(){return this._simulation.stop(),e.prototype.stop.call(this)},t}(fh),bh=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then(function(){return t._simulation.tick(t._options.iterations),t.stop(),t._graph.moveVertices(!1).moveEdges(!1),t})},t}(_h),wh=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then(function(){return new Promise(function(e){t._simulation.on("tick",function(){t._graph.moveVertices(!1).moveEdges(!1),t._graph.progress("layout-tick")}).on("end",function(){t._running=!1,e(t)}).restart()})})},t}(_h);function xh(e,t){var r=new Blob(['!function(){"use strict";function r(r,e,t){if(t||2===arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return r.concat(n||e)}var e,t,n;e={exports:{}},t="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,n=function(r){var e,n,o=void 0!==(r=r||{})?r:{};o.ready=new Promise(function(r,t){e=r,n=t});var i,a={};for(i in o)o.hasOwnProperty(i)&&(a[i]=o[i]);var s,u,c,f="./this.program",l=!0,d="";"undefined"!=typeof document&&document.currentScript&&(d=document.currentScript.src),t&&(d=t),d=0!==d.indexOf("blob:")?d.substr(0,d.lastIndexOf("/")+1):"",s=function(r){var e=new XMLHttpRequest;return e.open("GET",r,!1),e.send(null),e.responseText},u=function(r,e,t){var n=new XMLHttpRequest;n.open("GET",r,!0),n.responseType="arraybuffer",n.onload=function(){200==n.status||0==n.status&&n.response?e(n.response):t()},n.onerror=t,n.send(null)};var p,h,m=o.print||console.log.bind(console),v=o.printErr||console.warn.bind(console);for(i in a)a.hasOwnProperty(i)&&(o[i]=a[i]);a=null,o.arguments,o.thisProgram&&(f=o.thisProgram),o.quit,o.wasmBinary&&(p=o.wasmBinary),o.noExitRuntime,"object"!=typeof WebAssembly&&O("no native wasm support detected");var w=!1;function _(r,e){r||O("Assertion failed: "+e)}var y,g,E,b,k,D,S="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function P(r,e,t){for(var n=e+t,o=e;r[o]&&!(o>=n);)++o;if(o-e>16&&r.subarray&&S)return S.decode(r.subarray(e,o));for(var i="";e<o;){var a=r[e++];if(128&a){var s=63&r[e++];if(192!=(224&a)){var u=63&r[e++];if((a=224==(240&a)?(15&a)<<12|s<<6|u:(7&a)<<18|s<<12|u<<6|63&r[e++])<65536)i+=String.fromCharCode(a);else{var c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function F(r,e){return r?P(E,r,e):""}function x(r,e,t,n){if(!(n>0))return 0;for(var o=t,i=t+n-1,a=0;a<r.length;++a){var s=r.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&r.charCodeAt(++a)),s<=127){if(t>=i)break;e[t++]=s}else if(s<=2047){if(t+1>=i)break;e[t++]=192|s>>6,e[t++]=128|63&s}else if(s<=65535){if(t+2>=i)break;e[t++]=224|s>>12,e[t++]=128|s>>6&63,e[t++]=128|63&s}else{if(t+3>=i)break;e[t++]=240|s>>18,e[t++]=128|s>>12&63,e[t++]=128|s>>6&63,e[t++]=128|63&s}}return e[t]=0,t-o}function A(r){for(var e=0,t=0;t<r.length;++t){var n=r.charCodeAt(t);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&r.charCodeAt(++t)),n<=127?++e:e+=n<=2047?2:n<=65535?3:4}return e}function M(r){y=r,o.HEAP8=g=new Int8Array(r),o.HEAP16=new Int16Array(r),o.HEAP32=b=new Int32Array(r),o.HEAPU8=E=new Uint8Array(r),o.HEAPU16=new Uint16Array(r),o.HEAPU32=new Uint32Array(r),o.HEAPF32=new Float32Array(r),o.HEAPF64=k=new Float64Array(r)}o.INITIAL_MEMORY;var R=[],C=[],z=[],j=0,T=null;function B(r){j++,o.monitorRunDependencies&&o.monitorRunDependencies(j)}function N(r){if(j--,o.monitorRunDependencies&&o.monitorRunDependencies(j),0==j&&T){var e=T;T=null,e()}}function O(r){o.onAbort&&o.onAbort(r),v(r+=""),w=!0,r="abort("+r+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(r);throw n(e),e}o.preloadedImages={},o.preloadedAudios={};var L,I,U,H,W="data:application/octet-stream;base64,";function q(r){return r.startsWith(W)}function G(r){try{if(r==L&&p)return new Uint8Array(p);if(!c)throw"both async and sync fetching of the wasm failed"}catch(r){O(r)}}q(L="expatlib.wasm")||(I=L,L=o.locateFile?o.locateFile(I,d):d+I);var V={11922:function(r){var e=o.getCache(o.CExpatJS)[r];if(!e.hasOwnProperty("startElement"))throw"a JSImplementation must implement all functions, you forgot CExpatJS::startElement.";e.startElement()},12140:function(r){var e=o.getCache(o.CExpatJS)[r];if(!e.hasOwnProperty("endElement"))throw"a JSImplementation must implement all functions, you forgot CExpatJS::endElement.";e.endElement()},12352:function(r){var e=o.getCache(o.CExpatJS)[r];if(!e.hasOwnProperty("characterData"))throw"a JSImplementation must implement all functions, you forgot CExpatJS::characterData.";e.characterData()}};function J(r){for(;r.length>0;){var e=r.shift();if("function"!=typeof e){var t=e.func;"number"==typeof t?void 0===e.arg?D.get(t)():D.get(t)(e.arg):t(void 0===e.arg?null:e.arg)}else e(o)}}var X={splitPath:function(r){return/^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/.exec(r).slice(1)},normalizeArray:function(r,e){for(var t=0,n=r.length-1;n>=0;n--){var o=r[n];"."===o?r.splice(n,1):".."===o?(r.splice(n,1),t++):t&&(r.splice(n,1),t--)}if(e)for(;t;t--)r.unshift("..");return r},normalize:function(r){var e="/"===r.charAt(0),t="/"===r.substr(-1);return(r=X.normalizeArray(r.split("/").filter(function(r){return!!r}),!e).join("/"))||e||(r="."),r&&t&&(r+="/"),(e?"/":"")+r},dirname:function(r){var e=X.splitPath(r),t=e[0],n=e[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:function(r){if("/"===r)return"/";var e=(r=(r=X.normalize(r)).replace(/\\/$/,"")).lastIndexOf("/");return-1===e?r:r.substr(e+1)},extname:function(r){return X.splitPath(r)[3]},join:function(){var r=Array.prototype.slice.call(arguments,0);return X.normalize(r.join("/"))},join2:function(r,e){return X.normalize(r+"/"+e)}},Y={resolve:function(){for(var r="",e=!1,t=arguments.length-1;t>=-1&&!e;t--){var n=t>=0?arguments[t]:Q.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";r=n+"/"+r,e="/"===n.charAt(0)}return(e?"/":"")+(r=X.normalizeArray(r.split("/").filter(function(r){return!!r}),!e).join("/"))||"."},relative:function(r,e){function t(r){for(var e=0;e<r.length&&""===r[e];e++);for(var t=r.length-1;t>=0&&""===r[t];t--);return e>t?[]:r.slice(e,t-e+1)}r=Y.resolve(r).substr(1),e=Y.resolve(e).substr(1);for(var n=t(r.split("/")),o=t(e.split("/")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var u=[];for(s=a;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(a))).join("/")}},K={ttys:[],init:function(){},shutdown:function(){},register:function(r,e){K.ttys[r]={input:[],output:[],ops:e},Q.registerDevice(r,K.stream_ops)},stream_ops:{open:function(r){var e=K.ttys[r.node.rdev];if(!e)throw new Q.ErrnoError(43);r.tty=e,r.seekable=!1},close:function(r){r.tty.ops.flush(r.tty)},flush:function(r){r.tty.ops.flush(r.tty)},read:function(r,e,t,n,o){if(!r.tty||!r.tty.ops.get_char)throw new Q.ErrnoError(60);for(var i=0,a=0;a<n;a++){var s;try{s=r.tty.ops.get_char(r.tty)}catch(r){throw new Q.ErrnoError(29)}if(void 0===s&&0===i)throw new Q.ErrnoError(6);if(null==s)break;i++,e[t+a]=s}return i&&(r.node.timestamp=Date.now()),i},write:function(r,e,t,n,o){if(!r.tty||!r.tty.ops.put_char)throw new Q.ErrnoError(60);try{for(var i=0;i<n;i++)r.tty.ops.put_char(r.tty,e[t+i])}catch(r){throw new Q.ErrnoError(29)}return n&&(r.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(r){if(!r.input.length){var e=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\\n"),!e)return null;r.input=ir(e,!0)}return r.input.shift()},put_char:function(r,e){null===e||10===e?(m(P(r.output,0)),r.output=[]):0!=e&&r.output.push(e)},flush:function(r){r.output&&r.output.length>0&&(m(P(r.output,0)),r.output=[])}},default_tty1_ops:{put_char:function(r,e){null===e||10===e?(v(P(r.output,0)),r.output=[]):0!=e&&r.output.push(e)},flush:function(r){r.output&&r.output.length>0&&(v(P(r.output,0)),r.output=[])}}},$={ops_table:null,mount:function(r){return $.createNode(null,"/",16895,0)},createNode:function(r,e,t,n){if(Q.isBlkdev(t)||Q.isFIFO(t))throw new Q.ErrnoError(63);$.ops_table||($.ops_table={dir:{node:{getattr:$.node_ops.getattr,setattr:$.node_ops.setattr,lookup:$.node_ops.lookup,mknod:$.node_ops.mknod,rename:$.node_ops.rename,unlink:$.node_ops.unlink,rmdir:$.node_ops.rmdir,readdir:$.node_ops.readdir,symlink:$.node_ops.symlink},stream:{llseek:$.stream_ops.llseek}},file:{node:{getattr:$.node_ops.getattr,setattr:$.node_ops.setattr},stream:{llseek:$.stream_ops.llseek,read:$.stream_ops.read,write:$.stream_ops.write,allocate:$.stream_ops.allocate,mmap:$.stream_ops.mmap,msync:$.stream_ops.msync}},link:{node:{getattr:$.node_ops.getattr,setattr:$.node_ops.setattr,readlink:$.node_ops.readlink},stream:{}},chrdev:{node:{getattr:$.node_ops.getattr,setattr:$.node_ops.setattr},stream:Q.chrdev_stream_ops}});var o=Q.createNode(r,e,t,n);return Q.isDir(o.mode)?(o.node_ops=$.ops_table.dir.node,o.stream_ops=$.ops_table.dir.stream,o.contents={}):Q.isFile(o.mode)?(o.node_ops=$.ops_table.file.node,o.stream_ops=$.ops_table.file.stream,o.usedBytes=0,o.contents=null):Q.isLink(o.mode)?(o.node_ops=$.ops_table.link.node,o.stream_ops=$.ops_table.link.stream):Q.isChrdev(o.mode)&&(o.node_ops=$.ops_table.chrdev.node,o.stream_ops=$.ops_table.chrdev.stream),o.timestamp=Date.now(),r&&(r.contents[e]=o,r.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(r){return r.contents?r.contents.subarray?r.contents.subarray(0,r.usedBytes):new Uint8Array(r.contents):new Uint8Array(0)},expandFileStorage:function(r,e){var t=r.contents?r.contents.length:0;if(!(t>=e)){e=Math.max(e,t*(t<1048576?2:1.125)>>>0),0!=t&&(e=Math.max(e,256));var n=r.contents;r.contents=new Uint8Array(e),r.usedBytes>0&&r.contents.set(n.subarray(0,r.usedBytes),0)}},resizeFileStorage:function(r,e){if(r.usedBytes!=e)if(0==e)r.contents=null,r.usedBytes=0;else{var t=r.contents;r.contents=new Uint8Array(e),t&&r.contents.set(t.subarray(0,Math.min(e,r.usedBytes))),r.usedBytes=e}},node_ops:{getattr:function(r){var e={};return e.dev=Q.isChrdev(r.mode)?r.id:1,e.ino=r.id,e.mode=r.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=r.rdev,Q.isDir(r.mode)?e.size=4096:Q.isFile(r.mode)?e.size=r.usedBytes:Q.isLink(r.mode)?e.size=r.link.length:e.size=0,e.atime=new Date(r.timestamp),e.mtime=new Date(r.timestamp),e.ctime=new Date(r.timestamp),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr:function(r,e){void 0!==e.mode&&(r.mode=e.mode),void 0!==e.timestamp&&(r.timestamp=e.timestamp),void 0!==e.size&&$.resizeFileStorage(r,e.size)},lookup:function(r,e){throw Q.genericErrors[44]},mknod:function(r,e,t,n){return $.createNode(r,e,t,n)},rename:function(r,e,t){if(Q.isDir(r.mode)){var n;try{n=Q.lookupNode(e,t)}catch(r){}if(n)for(var o in n.contents)throw new Q.ErrnoError(55)}delete r.parent.contents[r.name],r.parent.timestamp=Date.now(),r.name=t,e.contents[t]=r,e.timestamp=r.parent.timestamp,r.parent=e},unlink:function(r,e){delete r.contents[e],r.timestamp=Date.now()},rmdir:function(r,e){var t=Q.lookupNode(r,e);for(var n in t.contents)throw new Q.ErrnoError(55);delete r.contents[e],r.timestamp=Date.now()},readdir:function(r){var e=[".",".."];for(var t in r.contents)r.contents.hasOwnProperty(t)&&e.push(t);return e},symlink:function(r,e,t){var n=$.createNode(r,e,41471,0);return n.link=t,n},readlink:function(r){if(!Q.isLink(r.mode))throw new Q.ErrnoError(28);return r.link}},stream_ops:{read:function(r,e,t,n,o){var i=r.node.contents;if(o>=r.node.usedBytes)return 0;var a=Math.min(r.node.usedBytes-o,n);if(a>8&&i.subarray)e.set(i.subarray(o,o+a),t);else for(var s=0;s<a;s++)e[t+s]=i[o+s];return a},write:function(r,e,t,n,o,i){if(e.buffer===g.buffer&&(i=!1),!n)return 0;var a=r.node;if(a.timestamp=Date.now(),e.subarray&&(!a.contents||a.contents.subarray)){if(i)return a.contents=e.subarray(t,t+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=e.slice(t,t+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(e.subarray(t,t+n),o),n}if($.expandFileStorage(a,o+n),a.contents.subarray&&e.subarray)a.contents.set(e.subarray(t,t+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=e[t+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek:function(r,e,t){var n=e;if(1===t?n+=r.position:2===t&&Q.isFile(r.node.mode)&&(n+=r.node.usedBytes),n<0)throw new Q.ErrnoError(28);return n},allocate:function(r,e,t){$.expandFileStorage(r.node,e+t),r.node.usedBytes=Math.max(r.node.usedBytes,e+t)},mmap:function(r,e,t,n,o,i){if(0!==e)throw new Q.ErrnoError(28);if(!Q.isFile(r.node.mode))throw new Q.ErrnoError(43);var a,s,u=r.node.contents;if(2&i||u.buffer!==y){if((n>0||n+t<u.length)&&(u=u.subarray?u.subarray(n,n+t):Array.prototype.slice.call(u,n,n+t)),s=!0,!(a=void O()))throw new Q.ErrnoError(48);g.set(u,a)}else s=!1,a=u.byteOffset;return{ptr:a,allocated:s}},msync:function(r,e,t,n,o){if(!Q.isFile(r.node.mode))throw new Q.ErrnoError(43);return 2&o?0:($.stream_ops.write(r,e,0,n,t,!1),0)}}},Q={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:function(r,e){if(e=e||{},!(r=Y.resolve(Q.cwd(),r)))return{path:"",node:null};var t={follow_mount:!0,recurse_count:0};for(var n in t)void 0===e[n]&&(e[n]=t[n]);if(e.recurse_count>8)throw new Q.ErrnoError(32);for(var o=X.normalizeArray(r.split("/").filter(function(r){return!!r}),!1),i=Q.root,a="/",s=0;s<o.length;s++){var u=s===o.length-1;if(u&&e.parent)break;if(i=Q.lookupNode(i,o[s]),a=X.join2(a,o[s]),Q.isMountpoint(i)&&(!u||u&&e.follow_mount)&&(i=i.mounted.root),!u||e.follow)for(var c=0;Q.isLink(i.mode);){var f=Q.readlink(a);if(a=Y.resolve(X.dirname(a),f),i=Q.lookupPath(a,{recurse_count:e.recurse_count}).node,c++>40)throw new Q.ErrnoError(32)}}return{path:a,node:i}},getPath:function(r){for(var e;;){if(Q.isRoot(r)){var t=r.mount.mountpoint;return e?"/"!==t[t.length-1]?t+"/"+e:t+e:t}e=e?r.name+"/"+e:r.name,r=r.parent}},hashName:function(r,e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return(r+t>>>0)%Q.nameTable.length},hashAddNode:function(r){var e=Q.hashName(r.parent.id,r.name);r.name_next=Q.nameTable[e],Q.nameTable[e]=r},hashRemoveNode:function(r){var e=Q.hashName(r.parent.id,r.name);if(Q.nameTable[e]===r)Q.nameTable[e]=r.name_next;else for(var t=Q.nameTable[e];t;){if(t.name_next===r){t.name_next=r.name_next;break}t=t.name_next}},lookupNode:function(r,e){var t=Q.mayLookup(r);if(t)throw new Q.ErrnoError(t,r);for(var n=Q.hashName(r.id,e),o=Q.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===r.id&&i===e)return o}return Q.lookup(r,e)},createNode:function(r,e,t,n){var o=new Q.FSNode(r,e,t,n);return Q.hashAddNode(o),o},destroyNode:function(r){Q.hashRemoveNode(r)},isRoot:function(r){return r===r.parent},isMountpoint:function(r){return!!r.mounted},isFile:function(r){return 32768==(61440&r)},isDir:function(r){return 16384==(61440&r)},isLink:function(r){return 40960==(61440&r)},isChrdev:function(r){return 8192==(61440&r)},isBlkdev:function(r){return 24576==(61440&r)},isFIFO:function(r){return 4096==(61440&r)},isSocket:function(r){return 49152==(49152&r)},flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:function(r){var e=Q.flagModes[r];if(void 0===e)throw new Error("Unknown file open mode: "+r);return e},flagsToPermissionString:function(r){var e=["r","w","rw"][3&r];return 512&r&&(e+="w"),e},nodePermissions:function(r,e){return Q.ignorePermissions?0:(!e.includes("r")||292&r.mode)&&(!e.includes("w")||146&r.mode)&&(!e.includes("x")||73&r.mode)?0:2},mayLookup:function(r){var e=Q.nodePermissions(r,"x");return e||(r.node_ops.lookup?0:2)},mayCreate:function(r,e){try{return Q.lookupNode(r,e),20}catch(r){}return Q.nodePermissions(r,"wx")},mayDelete:function(r,e,t){var n;try{n=Q.lookupNode(r,e)}catch(r){return r.errno}var o=Q.nodePermissions(r,"wx");if(o)return o;if(t){if(!Q.isDir(n.mode))return 54;if(Q.isRoot(n)||Q.getPath(n)===Q.cwd())return 10}else if(Q.isDir(n.mode))return 31;return 0},mayOpen:function(r,e){return r?Q.isLink(r.mode)?32:Q.isDir(r.mode)&&("r"!==Q.flagsToPermissionString(e)||512&e)?31:Q.nodePermissions(r,Q.flagsToPermissionString(e)):44},MAX_OPEN_FDS:4096,nextfd:function(r,e){r=r||0,e=e||Q.MAX_OPEN_FDS;for(var t=r;t<=e;t++)if(!Q.streams[t])return t;throw new Q.ErrnoError(33)},getStream:function(r){return Q.streams[r]},createStream:function(r,e,t){Q.FSStream||(Q.FSStream=function(){},Q.FSStream.prototype={object:{get:function(){return this.node},set:function(r){this.node=r}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}});var n=new Q.FSStream;for(var o in r)n[o]=r[o];r=n;var i=Q.nextfd(e,t);return r.fd=i,Q.streams[i]=r,r},closeStream:function(r){Q.streams[r]=null},chrdev_stream_ops:{open:function(r){var e=Q.getDevice(r.node.rdev);r.stream_ops=e.stream_ops,r.stream_ops.open&&r.stream_ops.open(r)},llseek:function(){throw new Q.ErrnoError(70)}},major:function(r){return r>>8},minor:function(r){return 255&r},makedev:function(r,e){return r<<8|e},registerDevice:function(r,e){Q.devices[r]={stream_ops:e}},getDevice:function(r){return Q.devices[r]},getMounts:function(r){for(var e=[],t=[r];t.length;){var n=t.pop();e.push(n),t.push.apply(t,n.mounts)}return e},syncfs:function(r,e){"function"==typeof r&&(e=r,r=!1),Q.syncFSRequests++,Q.syncFSRequests>1&&v("warning: "+Q.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var t=Q.getMounts(Q.root.mount),n=0;function o(r){return Q.syncFSRequests--,e(r)}function i(r){if(r)return i.errored?void 0:(i.errored=!0,o(r));++n>=t.length&&o(null)}t.forEach(function(e){if(!e.type.syncfs)return i(null);e.type.syncfs(e,r,i)})},mount:function(r,e,t){var n,o="/"===t,i=!t;if(o&&Q.root)throw new Q.ErrnoError(10);if(!o&&!i){var a=Q.lookupPath(t,{follow_mount:!1});if(t=a.path,n=a.node,Q.isMountpoint(n))throw new Q.ErrnoError(10);if(!Q.isDir(n.mode))throw new Q.ErrnoError(54)}var s={type:r,opts:e,mountpoint:t,mounts:[]},u=r.mount(s);return u.mount=s,s.root=u,o?Q.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:function(r){var e=Q.lookupPath(r,{follow_mount:!1});if(!Q.isMountpoint(e.node))throw new Q.ErrnoError(28);var t=e.node,n=t.mounted,o=Q.getMounts(n);Object.keys(Q.nameTable).forEach(function(r){for(var e=Q.nameTable[r];e;){var t=e.name_next;o.includes(e.mount)&&Q.destroyNode(e),e=t}}),t.mounted=null;var i=t.mount.mounts.indexOf(n);t.mount.mounts.splice(i,1)},lookup:function(r,e){return r.node_ops.lookup(r,e)},mknod:function(r,e,t){var n=Q.lookupPath(r,{parent:!0}).node,o=X.basename(r);if(!o||"."===o||".."===o)throw new Q.ErrnoError(28);var i=Q.mayCreate(n,o);if(i)throw new Q.ErrnoError(i);if(!n.node_ops.mknod)throw new Q.ErrnoError(63);return n.node_ops.mknod(n,o,e,t)},create:function(r,e){return e=void 0!==e?e:438,e&=4095,e|=32768,Q.mknod(r,e,0)},mkdir:function(r,e){return e=void 0!==e?e:511,e&=1023,e|=16384,Q.mknod(r,e,0)},mkdirTree:function(r,e){for(var t=r.split("/"),n="",o=0;o<t.length;++o)if(t[o]){n+="/"+t[o];try{Q.mkdir(n,e)}catch(r){if(20!=r.errno)throw r}}},mkdev:function(r,e,t){return void 0===t&&(t=e,e=438),e|=8192,Q.mknod(r,e,t)},symlink:function(r,e){if(!Y.resolve(r))throw new Q.ErrnoError(44);var t=Q.lookupPath(e,{parent:!0}).node;if(!t)throw new Q.ErrnoError(44);var n=X.basename(e),o=Q.mayCreate(t,n);if(o)throw new Q.ErrnoError(o);if(!t.node_ops.symlink)throw new Q.ErrnoError(63);return t.node_ops.symlink(t,n,r)},rename:function(r,e){var t,n,o=X.dirname(r),i=X.dirname(e),a=X.basename(r),s=X.basename(e);if(t=Q.lookupPath(r,{parent:!0}).node,n=Q.lookupPath(e,{parent:!0}).node,!t||!n)throw new Q.ErrnoError(44);if(t.mount!==n.mount)throw new Q.ErrnoError(75);var u,c=Q.lookupNode(t,a),f=Y.relative(r,i);if("."!==f.charAt(0))throw new Q.ErrnoError(28);if("."!==(f=Y.relative(e,o)).charAt(0))throw new Q.ErrnoError(55);try{u=Q.lookupNode(n,s)}catch(r){}if(c!==u){var l=Q.isDir(c.mode),d=Q.mayDelete(t,a,l);if(d)throw new Q.ErrnoError(d);if(d=u?Q.mayDelete(n,s,l):Q.mayCreate(n,s))throw new Q.ErrnoError(d);if(!t.node_ops.rename)throw new Q.ErrnoError(63);if(Q.isMountpoint(c)||u&&Q.isMountpoint(u))throw new Q.ErrnoError(10);if(n!==t&&(d=Q.nodePermissions(t,"w")))throw new Q.ErrnoError(d);try{Q.trackingDelegate.willMovePath}catch(t){v("FS.trackingDelegate[\'willMovePath\'](\'"+r+"\', \'"+e+"\') threw an exception: "+t.message)}Q.hashRemoveNode(c);try{t.node_ops.rename(c,n,s)}catch(r){throw r}finally{Q.hashAddNode(c)}try{Q.trackingDelegate.onMovePath}catch(t){v("FS.trackingDelegate[\'onMovePath\'](\'"+r+"\', \'"+e+"\') threw an exception: "+t.message)}}},rmdir:function(r){var e=Q.lookupPath(r,{parent:!0}).node,t=X.basename(r),n=Q.lookupNode(e,t),o=Q.mayDelete(e,t,!0);if(o)throw new Q.ErrnoError(o);if(!e.node_ops.rmdir)throw new Q.ErrnoError(63);if(Q.isMountpoint(n))throw new Q.ErrnoError(10);try{Q.trackingDelegate.willDeletePath}catch(e){v("FS.trackingDelegate[\'willDeletePath\'](\'"+r+"\') threw an exception: "+e.message)}e.node_ops.rmdir(e,t),Q.destroyNode(n);try{Q.trackingDelegate.onDeletePath}catch(e){v("FS.trackingDelegate[\'onDeletePath\'](\'"+r+"\') threw an exception: "+e.message)}},readdir:function(r){var e=Q.lookupPath(r,{follow:!0}).node;if(!e.node_ops.readdir)throw new Q.ErrnoError(54);return e.node_ops.readdir(e)},unlink:function(r){var e=Q.lookupPath(r,{parent:!0}).node,t=X.basename(r),n=Q.lookupNode(e,t),o=Q.mayDelete(e,t,!1);if(o)throw new Q.ErrnoError(o);if(!e.node_ops.unlink)throw new Q.ErrnoError(63);if(Q.isMountpoint(n))throw new Q.ErrnoError(10);try{Q.trackingDelegate.willDeletePath}catch(e){v("FS.trackingDelegate[\'willDeletePath\'](\'"+r+"\') threw an exception: "+e.message)}e.node_ops.unlink(e,t),Q.destroyNode(n);try{Q.trackingDelegate.onDeletePath}catch(e){v("FS.trackingDelegate[\'onDeletePath\'](\'"+r+"\') threw an exception: "+e.message)}},readlink:function(r){var e=Q.lookupPath(r).node;if(!e)throw new Q.ErrnoError(44);if(!e.node_ops.readlink)throw new Q.ErrnoError(28);return Y.resolve(Q.getPath(e.parent),e.node_ops.readlink(e))},stat:function(r,e){var t=Q.lookupPath(r,{follow:!e}).node;if(!t)throw new Q.ErrnoError(44);if(!t.node_ops.getattr)throw new Q.ErrnoError(63);return t.node_ops.getattr(t)},lstat:function(r){return Q.stat(r,!0)},chmod:function(r,e,t){var n;if(!(n="string"==typeof r?Q.lookupPath(r,{follow:!t}).node:r).node_ops.setattr)throw new Q.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&e|-4096&n.mode,timestamp:Date.now()})},lchmod:function(r,e){Q.chmod(r,e,!0)},fchmod:function(r,e){var t=Q.getStream(r);if(!t)throw new Q.ErrnoError(8);Q.chmod(t.node,e)},chown:function(r,e,t,n){var o;if(!(o="string"==typeof r?Q.lookupPath(r,{follow:!n}).node:r).node_ops.setattr)throw new Q.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:function(r,e,t){Q.chown(r,e,t,!0)},fchown:function(r,e,t){var n=Q.getStream(r);if(!n)throw new Q.ErrnoError(8);Q.chown(n.node,e,t)},truncate:function(r,e){if(e<0)throw new Q.ErrnoError(28);var t;if(!(t="string"==typeof r?Q.lookupPath(r,{follow:!0}).node:r).node_ops.setattr)throw new Q.ErrnoError(63);if(Q.isDir(t.mode))throw new Q.ErrnoError(31);if(!Q.isFile(t.mode))throw new Q.ErrnoError(28);var n=Q.nodePermissions(t,"w");if(n)throw new Q.ErrnoError(n);t.node_ops.setattr(t,{size:e,timestamp:Date.now()})},ftruncate:function(r,e){var t=Q.getStream(r);if(!t)throw new Q.ErrnoError(8);if(0==(2097155&t.flags))throw new Q.ErrnoError(28);Q.truncate(t.node,e)},utime:function(r,e,t){var n=Q.lookupPath(r,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(e,t)})},open:function(r,e,t,n,i){if(""===r)throw new Q.ErrnoError(44);var a;if(t=void 0===t?438:t,t=64&(e="string"==typeof e?Q.modeStringToFlags(e):e)?4095&t|32768:0,"object"==typeof r)a=r;else{r=X.normalize(r);try{a=Q.lookupPath(r,{follow:!(131072&e)}).node}catch(r){}}var s=!1;if(64&e)if(a){if(128&e)throw new Q.ErrnoError(20)}else a=Q.mknod(r,t,0),s=!0;if(!a)throw new Q.ErrnoError(44);if(Q.isChrdev(a.mode)&&(e&=-513),65536&e&&!Q.isDir(a.mode))throw new Q.ErrnoError(54);if(!s){var u=Q.mayOpen(a,e);if(u)throw new Q.ErrnoError(u)}512&e&&Q.truncate(a,0),e&=-131713;var c=Q.createStream({node:a,path:Q.getPath(a),flags:e,seekable:!0,position:0,stream_ops:a.stream_ops,ungotten:[],error:!1},n,i);c.stream_ops.open&&c.stream_ops.open(c),!o.logReadFiles||1&e||(Q.readFiles||(Q.readFiles={}),r in Q.readFiles||(Q.readFiles[r]=1,v("FS.trackingDelegate error on read file: "+r)));try{Q.trackingDelegate.onOpenFile}catch(e){v("FS.trackingDelegate[\'onOpenFile\'](\'"+r+"\', flags) threw an exception: "+e.message)}return c},close:function(r){if(Q.isClosed(r))throw new Q.ErrnoError(8);r.getdents&&(r.getdents=null);try{r.stream_ops.close&&r.stream_ops.close(r)}catch(r){throw r}finally{Q.closeStream(r.fd)}r.fd=null},isClosed:function(r){return null===r.fd},llseek:function(r,e,t){if(Q.isClosed(r))throw new Q.ErrnoError(8);if(!r.seekable||!r.stream_ops.llseek)throw new Q.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new Q.ErrnoError(28);return r.position=r.stream_ops.llseek(r,e,t),r.ungotten=[],r.position},read:function(r,e,t,n,o){if(n<0||o<0)throw new Q.ErrnoError(28);if(Q.isClosed(r))throw new Q.ErrnoError(8);if(1==(2097155&r.flags))throw new Q.ErrnoError(8);if(Q.isDir(r.node.mode))throw new Q.ErrnoError(31);if(!r.stream_ops.read)throw new Q.ErrnoError(28);var i=void 0!==o;if(i){if(!r.seekable)throw new Q.ErrnoError(70)}else o=r.position;var a=r.stream_ops.read(r,e,t,n,o);return i||(r.position+=a),a},write:function(r,e,t,n,o,i){if(n<0||o<0)throw new Q.ErrnoError(28);if(Q.isClosed(r))throw new Q.ErrnoError(8);if(0==(2097155&r.flags))throw new Q.ErrnoError(8);if(Q.isDir(r.node.mode))throw new Q.ErrnoError(31);if(!r.stream_ops.write)throw new Q.ErrnoError(28);r.seekable&&1024&r.flags&&Q.llseek(r,0,2);var a=void 0!==o;if(a){if(!r.seekable)throw new Q.ErrnoError(70)}else o=r.position;var s=r.stream_ops.write(r,e,t,n,o,i);a||(r.position+=s);try{r.path&&Q.trackingDelegate.onWriteToFile&&Q.trackingDelegate.onWriteToFile(r.path)}catch(e){v("FS.trackingDelegate[\'onWriteToFile\'](\'"+r.path+"\') threw an exception: "+e.message)}return s},allocate:function(r,e,t){if(Q.isClosed(r))throw new Q.ErrnoError(8);if(e<0||t<=0)throw new Q.ErrnoError(28);if(0==(2097155&r.flags))throw new Q.ErrnoError(8);if(!Q.isFile(r.node.mode)&&!Q.isDir(r.node.mode))throw new Q.ErrnoError(43);if(!r.stream_ops.allocate)throw new Q.ErrnoError(138);r.stream_ops.allocate(r,e,t)},mmap:function(r,e,t,n,o,i){if(0!=(2&o)&&0==(2&i)&&2!=(2097155&r.flags))throw new Q.ErrnoError(2);if(1==(2097155&r.flags))throw new Q.ErrnoError(2);if(!r.stream_ops.mmap)throw new Q.ErrnoError(43);return r.stream_ops.mmap(r,e,t,n,o,i)},msync:function(r,e,t,n,o){return r&&r.stream_ops.msync?r.stream_ops.msync(r,e,t,n,o):0},munmap:function(r){return 0},ioctl:function(r,e,t){if(!r.stream_ops.ioctl)throw new Q.ErrnoError(59);return r.stream_ops.ioctl(r,e,t)},readFile:function(r,e){if((e=e||{}).flags=e.flags||0,e.encoding=e.encoding||"binary","utf8"!==e.encoding&&"binary"!==e.encoding)throw new Error(\'Invalid encoding type "\'+e.encoding+\'"\');var t,n=Q.open(r,e.flags),o=Q.stat(r).size,i=new Uint8Array(o);return Q.read(n,i,0,o,0),"utf8"===e.encoding?t=P(i,0):"binary"===e.encoding&&(t=i),Q.close(n),t},writeFile:function(r,e,t){(t=t||{}).flags=t.flags||577;var n=Q.open(r,t.flags,t.mode);if("string"==typeof e){var o=new Uint8Array(A(e)+1),i=x(e,o,0,o.length);Q.write(n,o,0,i,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(e))throw new Error("Unsupported data type");Q.write(n,e,0,e.byteLength,void 0,t.canOwn)}Q.close(n)},cwd:function(){return Q.currentPath},chdir:function(r){var e=Q.lookupPath(r,{follow:!0});if(null===e.node)throw new Q.ErrnoError(44);if(!Q.isDir(e.node.mode))throw new Q.ErrnoError(54);var t=Q.nodePermissions(e.node,"x");if(t)throw new Q.ErrnoError(t);Q.currentPath=e.path},createDefaultDirectories:function(){Q.mkdir("/tmp"),Q.mkdir("/home"),Q.mkdir("/home/web_user")},createDefaultDevices:function(){Q.mkdir("/dev"),Q.registerDevice(Q.makedev(1,3),{read:function(){return 0},write:function(r,e,t,n,o){return n}}),Q.mkdev("/dev/null",Q.makedev(1,3)),K.register(Q.makedev(5,0),K.default_tty_ops),K.register(Q.makedev(6,0),K.default_tty1_ops),Q.mkdev("/dev/tty",Q.makedev(5,0)),Q.mkdev("/dev/tty1",Q.makedev(6,0));var r=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var r=new Uint8Array(1);return function(){return crypto.getRandomValues(r),r[0]}}return function(){O("randomDevice")}}();Q.createDevice("/dev","random",r),Q.createDevice("/dev","urandom",r),Q.mkdir("/dev/shm"),Q.mkdir("/dev/shm/tmp")},createSpecialDirectories:function(){Q.mkdir("/proc");var r=Q.mkdir("/proc/self");Q.mkdir("/proc/self/fd"),Q.mount({mount:function(){var e=Q.createNode(r,"fd",16895,73);return e.node_ops={lookup:function(r,e){var t=+e,n=Q.getStream(t);if(!n)throw new Q.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:function(){return n.path}}};return o.parent=o,o}},e}},{},"/proc/self/fd")},createStandardStreams:function(){o.stdin?Q.createDevice("/dev","stdin",o.stdin):Q.symlink("/dev/tty","/dev/stdin"),o.stdout?Q.createDevice("/dev","stdout",null,o.stdout):Q.symlink("/dev/tty","/dev/stdout"),o.stderr?Q.createDevice("/dev","stderr",null,o.stderr):Q.symlink("/dev/tty1","/dev/stderr"),Q.open("/dev/stdin",0),Q.open("/dev/stdout",1),Q.open("/dev/stderr",1)},ensureErrnoError:function(){Q.ErrnoError||(Q.ErrnoError=function(r,e){this.node=e,this.setErrno=function(r){this.errno=r},this.setErrno(r),this.message="FS error"},Q.ErrnoError.prototype=new Error,Q.ErrnoError.prototype.constructor=Q.ErrnoError,[44].forEach(function(r){Q.genericErrors[r]=new Q.ErrnoError(r),Q.genericErrors[r].stack="<generic error, no stack>"}))},staticInit:function(){Q.ensureErrnoError(),Q.nameTable=new Array(4096),Q.mount($,{},"/"),Q.createDefaultDirectories(),Q.createDefaultDevices(),Q.createSpecialDirectories(),Q.filesystems={MEMFS:$}},init:function(r,e,t){Q.init.initialized=!0,Q.ensureErrnoError(),o.stdin=r||o.stdin,o.stdout=e||o.stdout,o.stderr=t||o.stderr,Q.createStandardStreams()},quit:function(){Q.init.initialized=!1;var r=o._fflush;r&&r(0);for(var e=0;e<Q.streams.length;e++){var t=Q.streams[e];t&&Q.close(t)}},getMode:function(r,e){var t=0;return r&&(t|=365),e&&(t|=146),t},findObject:function(r,e){var t=Q.analyzePath(r,e);return t.exists?t.object:null},analyzePath:function(r,e){try{r=(n=Q.lookupPath(r,{follow:!e})).path}catch(r){}var t={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=Q.lookupPath(r,{parent:!0});t.parentExists=!0,t.parentPath=n.path,t.parentObject=n.node,t.name=X.basename(r),n=Q.lookupPath(r,{follow:!e}),t.exists=!0,t.path=n.path,t.object=n.node,t.name=n.node.name,t.isRoot="/"===n.path}catch(r){t.error=r.errno}return t},createPath:function(r,e,t,n){r="string"==typeof r?r:Q.getPath(r);for(var o=e.split("/").reverse();o.length;){var i=o.pop();if(i){var a=X.join2(r,i);try{Q.mkdir(a)}catch(r){}r=a}}return a},createFile:function(r,e,t,n,o){var i=X.join2("string"==typeof r?r:Q.getPath(r),e),a=Q.getMode(n,o);return Q.create(i,a)},createDataFile:function(r,e,t,n,o,i){var a=e?X.join2("string"==typeof r?r:Q.getPath(r),e):r,s=Q.getMode(n,o),u=Q.create(a,s);if(t){if("string"==typeof t){for(var c=new Array(t.length),f=0,l=t.length;f<l;++f)c[f]=t.charCodeAt(f);t=c}Q.chmod(u,146|s);var d=Q.open(u,577);Q.write(d,t,0,t.length,0,i),Q.close(d),Q.chmod(u,s)}return u},createDevice:function(r,e,t,n){var o=X.join2("string"==typeof r?r:Q.getPath(r),e),i=Q.getMode(!!t,!!n);Q.createDevice.major||(Q.createDevice.major=64);var a=Q.makedev(Q.createDevice.major++,0);return Q.registerDevice(a,{open:function(r){r.seekable=!1},close:function(r){n&&n.buffer&&n.buffer.length&&n(10)},read:function(r,e,n,o,i){for(var a=0,s=0;s<o;s++){var u;try{u=t()}catch(r){throw new Q.ErrnoError(29)}if(void 0===u&&0===a)throw new Q.ErrnoError(6);if(null==u)break;a++,e[n+s]=u}return a&&(r.node.timestamp=Date.now()),a},write:function(r,e,t,o,i){for(var a=0;a<o;a++)try{n(e[t+a])}catch(r){throw new Q.ErrnoError(29)}return o&&(r.node.timestamp=Date.now()),a}}),Q.mkdev(o,i,a)},forceLoadFile:function(r){if(r.isDevice||r.isFolder||r.link||r.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!s)throw new Error("Cannot load without read() or XMLHttpRequest.");try{r.contents=ir(s(r.url),!0),r.usedBytes=r.contents.length}catch(r){throw new Q.ErrnoError(29)}},createLazyFile:function(r,e,t,n,o){function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(r){if(!(r>this.length-1||r<0)){var e=r%this.chunkSize,t=r/this.chunkSize|0;return this.getter(t)[e]}},i.prototype.setDataGetter=function(r){this.getter=r},i.prototype.cacheLength=function(){var r=new XMLHttpRequest;if(r.open("HEAD",t,!1),r.send(null),!(r.status>=200&&r.status<300||304===r.status))throw new Error("Couldn\'t load "+t+". Status: "+r.status);var e,n=Number(r.getResponseHeader("Content-length")),o=(e=r.getResponseHeader("Accept-Ranges"))&&"bytes"===e,i=(e=r.getResponseHeader("Content-Encoding"))&&"gzip"===e,a=1048576;o||(a=n);var s=this;s.setDataGetter(function(r){var e=r*a,o=(r+1)*a-1;if(o=Math.min(o,n-1),void 0===s.chunks[r]&&(s.chunks[r]=function(r,e){if(r>e)throw new Error("invalid range ("+r+", "+e+") or no bytes requested!");if(e>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",t,!1),n!==a&&o.setRequestHeader("Range","bytes="+r+"-"+e),"undefined"!=typeof Uint8Array&&(o.responseType="arraybuffer"),o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn\'t load "+t+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):ir(o.responseText||"",!0)}(e,o)),void 0===s.chunks[r])throw new Error("doXHR failed!");return s.chunks[r]}),!i&&n||(a=n=1,n=this.getter(0).length,a=n,m("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a={isDevice:!1,url:t},s=Q.createFile(r,e,a,n,o);a.contents?s.contents=a.contents:a.url&&(s.contents=null,s.url=a.url),Object.defineProperties(s,{usedBytes:{get:function(){return this.contents.length}}});var u={};return Object.keys(s.stream_ops).forEach(function(r){var e=s.stream_ops[r];u[r]=function(){return Q.forceLoadFile(s),e.apply(null,arguments)}}),u.read=function(r,e,t,n,o){Q.forceLoadFile(s);var i=r.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var u=0;u<a;u++)e[t+u]=i[o+u];else for(u=0;u<a;u++)e[t+u]=i.get(o+u);return a},s.stream_ops=u,s},createPreloadedFile:function(r,e,t,n,i,a,s,c,f,l){Browser.init();var d=e?Y.resolve(X.join2(r,e)):r;function p(t){function u(t){l&&l(),c||Q.createDataFile(r,e,t,n,i,f),a&&a(),N()}var p=!1;o.preloadPlugins.forEach(function(r){p||r.canHandle(d)&&(r.handle(t,d,u,function(){s&&s(),N()}),p=!0)}),p||u(t)}B(),"string"==typeof t?function(r,e,t,n){var o=n?"":"al "+r;u(r,function(t){_(t,\'Loading data file "\'+r+\'" failed (no arrayBuffer).\'),e(new Uint8Array(t)),o&&N()},function(e){if(!t)throw\'Loading data file "\'+r+\'" failed.\';t()}),o&&B()}(t,function(r){p(r)},s):p(t)},indexedDB:function(){return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB},DB_NAME:function(){return"EM_FS_"+window.location.pathname},DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:function(r,e,t){e=e||function(){},t=t||function(){};var n=Q.indexedDB();try{var o=n.open(Q.DB_NAME(),Q.DB_VERSION)}catch(r){return t(r)}o.onupgradeneeded=function(){m("creating db"),o.result.createObjectStore(Q.DB_STORE_NAME)},o.onsuccess=function(){var n=o.result.transaction([Q.DB_STORE_NAME],"readwrite"),i=n.objectStore(Q.DB_STORE_NAME),a=0,s=0,u=r.length;function c(){0==s?e():t()}r.forEach(function(r){var e=i.put(Q.analyzePath(r).object.contents,r);e.onsuccess=function(){++a+s==u&&c()},e.onerror=function(){a+ ++s==u&&c()}}),n.onerror=t},o.onerror=t},loadFilesFromDB:function(r,e,t){e=e||function(){},t=t||function(){};var n=Q.indexedDB();try{var o=n.open(Q.DB_NAME(),Q.DB_VERSION)}catch(r){return t(r)}o.onupgradeneeded=t,o.onsuccess=function(){var n=o.result;try{var i=n.transaction([Q.DB_STORE_NAME],"readonly")}catch(r){return void t(r)}var a=i.objectStore(Q.DB_STORE_NAME),s=0,u=0,c=r.length;function f(){0==u?e():t()}r.forEach(function(r){var e=a.get(r);e.onsuccess=function(){Q.analyzePath(r).exists&&Q.unlink(r),Q.createDataFile(X.dirname(r),X.basename(r),e.result,!0,!0,!0),++s+u==c&&f()},e.onerror=function(){s+ ++u==c&&f()}}),i.onerror=t},o.onerror=t}},Z={mappings:{},DEFAULT_POLLMASK:5,umask:511,calculateAt:function(r,e,t){if("/"===e[0])return e;var n;if(-100===r)n=Q.cwd();else{var o=Q.getStream(r);if(!o)throw new Q.ErrnoError(8);n=o.path}if(0==e.length){if(!t)throw new Q.ErrnoError(44);return n}return X.join2(n,e)},doStat:function(r,e,t){try{var n=r(e)}catch(r){if(r&&r.node&&X.normalize(e)!==X.normalize(Q.getPath(r.node)))return-54;throw r}return b[t>>2]=n.dev,b[t+4>>2]=0,b[t+8>>2]=n.ino,b[t+12>>2]=n.mode,b[t+16>>2]=n.nlink,b[t+20>>2]=n.uid,b[t+24>>2]=n.gid,b[t+28>>2]=n.rdev,b[t+32>>2]=0,H=[n.size>>>0,(U=n.size,+Math.abs(U)>=1?U>0?(0|Math.min(+Math.floor(U/4294967296),4294967295))>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],b[t+40>>2]=H[0],b[t+44>>2]=H[1],b[t+48>>2]=4096,b[t+52>>2]=n.blocks,b[t+56>>2]=n.atime.getTime()/1e3|0,b[t+60>>2]=0,b[t+64>>2]=n.mtime.getTime()/1e3|0,b[t+68>>2]=0,b[t+72>>2]=n.ctime.getTime()/1e3|0,b[t+76>>2]=0,H=[n.ino>>>0,(U=n.ino,+Math.abs(U)>=1?U>0?(0|Math.min(+Math.floor(U/4294967296),4294967295))>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],b[t+80>>2]=H[0],b[t+84>>2]=H[1],0},doMsync:function(r,e,t,n,o){var i=E.slice(r,r+t);Q.msync(e,i,o,t,n)},doMkdir:function(r,e){return"/"===(r=X.normalize(r))[r.length-1]&&(r=r.substr(0,r.length-1)),Q.mkdir(r,e,0),0},doMknod:function(r,e,t){switch(61440&e){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return Q.mknod(r,e,t),0},doReadlink:function(r,e,t){if(t<=0)return-28;var n=Q.readlink(r),o=Math.min(t,A(n)),i=g[e+o];return x(n,E,e,t+1),g[e+o]=i,o},doAccess:function(r,e){if(-8&e)return-28;var t;if(!(t=Q.lookupPath(r,{follow:!0}).node))return-44;var n="";return 4&e&&(n+="r"),2&e&&(n+="w"),1&e&&(n+="x"),n&&Q.nodePermissions(t,n)?-2:0},doDup:function(r,e,t){var n=Q.getStream(t);return n&&Q.close(n),Q.open(r,e,0,t,t).fd},doReadv:function(r,e,t,n){for(var o=0,i=0;i<t;i++){var a=b[e+8*i>>2],s=b[e+(8*i+4)>>2],u=Q.read(r,g,a,s,n);if(u<0)return-1;if(o+=u,u<s)break}return o},doWritev:function(r,e,t,n){for(var o=0,i=0;i<t;i++){var a=b[e+8*i>>2],s=b[e+(8*i+4)>>2],u=Q.write(r,g,a,s,n);if(u<0)return-1;o+=u}return o},varargs:void 0,get:function(){return Z.varargs+=4,b[Z.varargs-4>>2]},getStr:function(r){return F(r)},getStreamFromFD:function(r){var e=Q.getStream(r);if(!e)throw new Q.ErrnoError(8);return e},get64:function(r,e){return r}},rr=[];function er(r){try{return h.grow(r-y.byteLength+65535>>>16),M(h.buffer),1}catch(r){}}var tr={};function nr(){if(!nr.strings){var r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:f||"./this.program"};for(var e in tr)void 0===tr[e]?delete r[e]:r[e]=tr[e];var t=[];for(var e in r)t.push(e+"="+r[e]);nr.strings=t}return nr.strings}var or=function(r,e,t,n){r||(r=this),this.parent=r,this.mount=r.mount,this.mounted=null,this.id=Q.nextInode++,this.name=e,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n};function ir(r,e,t){var n=t>0?t:A(r)+1,o=new Array(n),i=x(r,o,0,o.length);return e&&(o.length=i),o}Object.defineProperties(or.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(r){r?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(r){r?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return Q.isDir(this.mode)}},isDevice:{get:function(){return Q.isChrdev(this.mode)}}}),Q.FSNode=or,Q.staticInit();var ar={g:function(){return 42},i:function(r,e,t){Z.varargs=t;try{var n=Z.getStr(r),o=t?Z.get():0;return Q.open(n,e,o).fd}catch(r){return void 0!==Q&&r instanceof Q.ErrnoError||O(r),-r.errno}},b:function(){O()},a:function(r,e,t){var n=function(r,e){var t;for(rr.length=0,e>>=2;t=E[r++];){var n=t<105;n&&1&e&&e++,rr.push(n?k[e++>>1]:b[e]),++e}return rr}(e,t);return V[r].apply(null,n)},k:function(r,e,t){E.copyWithin(r,e,e+t)},l:function(r){var e,t,n=E.length;if((r>>>=0)>2147483648)return!1;for(var o=1;o<=4;o*=2){var i=n*(1+.2/o);if(i=Math.min(i,r+100663296),er(Math.min(2147483648,((e=Math.max(r,i))%(t=65536)>0&&(e+=t-e%t),e))))return!0}return!1},e:function(r,e){try{var t=0;return nr().forEach(function(n,o){var i=e+t;b[r+4*o>>2]=i,function(r,e,t){for(var n=0;n<r.length;++n)g[e++>>0]=r.charCodeAt(n);t||(g[e>>0]=0)}(n,i),t+=n.length+1}),0}catch(r){return void 0!==Q&&r instanceof Q.ErrnoError||O(r),r.errno}},f:function(r,e){try{var t=nr();b[r>>2]=t.length;var n=0;return t.forEach(function(r){n+=r.length+1}),b[e>>2]=n,0}catch(r){return void 0!==Q&&r instanceof Q.ErrnoError||O(r),r.errno}},c:function(r){try{var e=Z.getStreamFromFD(r);return Q.close(e),0}catch(r){return void 0!==Q&&r instanceof Q.ErrnoError||O(r),r.errno}},h:function(r,e,t,n){try{var o=Z.getStreamFromFD(r),i=Z.doReadv(o,e,t);return b[n>>2]=i,0}catch(r){return void 0!==Q&&r instanceof Q.ErrnoError||O(r),r.errno}},j:function(r,e,t,n,o){try{var i=Z.getStreamFromFD(r),a=4294967296*t+(e>>>0);return a<=-9007199254740992||a>=9007199254740992?-61:(Q.llseek(i,a,n),H=[i.position>>>0,(U=i.position,+Math.abs(U)>=1?U>0?(0|Math.min(+Math.floor(U/4294967296),4294967295))>>>0:~~+Math.ceil((U-+(~~U>>>0))/4294967296)>>>0:0)],b[o>>2]=H[0],b[o+4>>2]=H[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0)}catch(r){return void 0!==Q&&r instanceof Q.ErrnoError||O(r),r.errno}},d:function(r,e,t,n){try{var o=Z.getStreamFromFD(r),i=Z.doWritev(o,e,t);return b[n>>2]=i,0}catch(r){return void 0!==Q&&r instanceof Q.ErrnoError||O(r),r.errno}},m:function(r){var e=Date.now();return b[r>>2]=e/1e3|0,b[r+4>>2]=e%1e3*1e3|0,0}};!function(){var r={a:ar};function e(r,e){var t,n=r.exports;o.asm=n,M((h=o.asm.n).buffer),D=o.asm.H,t=o.asm.o,C.unshift(t),N()}function t(r){e(r.instance)}function i(e){return(!p&&l&&"function"==typeof fetch?fetch(L,{credentials:"same-origin"}).then(function(r){if(!r.ok)throw"failed to load wasm binary file at \'"+L+"\'";return r.arrayBuffer()}).catch(function(){return G(L)}):Promise.resolve().then(function(){return G(L)})).then(function(e){return WebAssembly.instantiate(e,r)}).then(e,function(r){v("failed to asynchronously prepare wasm: "+r),O(r)})}if(B(),o.instantiateWasm)try{return o.instantiateWasm(r,e)}catch(r){return v("Module.instantiateWasm callback failed with error: "+r),!1}(p||"function"!=typeof WebAssembly.instantiateStreaming||q(L)||"function"!=typeof fetch?i(t):fetch(L,{credentials:"same-origin"}).then(function(e){return WebAssembly.instantiateStreaming(e,r).then(t,function(r){return v("wasm streaming compile failed: "+r),v("falling back to ArrayBuffer instantiation"),i(t)})})).catch(n)}(),o.___wasm_call_ctors=function(){return(o.___wasm_call_ctors=o.asm.o).apply(null,arguments)};var sr,ur=o._emscripten_bind_CExpat_CExpat_0=function(){return(ur=o._emscripten_bind_CExpat_CExpat_0=o.asm.p).apply(null,arguments)},cr=o._emscripten_bind_CExpat_version_0=function(){return(cr=o._emscripten_bind_CExpat_version_0=o.asm.q).apply(null,arguments)},fr=o._emscripten_bind_CExpat_create_0=function(){return(fr=o._emscripten_bind_CExpat_create_0=o.asm.r).apply(null,arguments)},lr=o._emscripten_bind_CExpat_destroy_0=function(){return(lr=o._emscripten_bind_CExpat_destroy_0=o.asm.s).apply(null,arguments)},dr=o._emscripten_bind_CExpat_parse_1=function(){return(dr=o._emscripten_bind_CExpat_parse_1=o.asm.t).apply(null,arguments)},pr=o._emscripten_bind_CExpat_tag_0=function(){return(pr=o._emscripten_bind_CExpat_tag_0=o.asm.u).apply(null,arguments)},hr=o._emscripten_bind_CExpat_attrs_0=function(){return(hr=o._emscripten_bind_CExpat_attrs_0=o.asm.v).apply(null,arguments)},mr=o._emscripten_bind_CExpat_content_0=function(){return(mr=o._emscripten_bind_CExpat_content_0=o.asm.w).apply(null,arguments)},vr=o._emscripten_bind_CExpat_startElement_0=function(){return(vr=o._emscripten_bind_CExpat_startElement_0=o.asm.x).apply(null,arguments)},wr=o._emscripten_bind_CExpat_endElement_0=function(){return(wr=o._emscripten_bind_CExpat_endElement_0=o.asm.y).apply(null,arguments)},_r=o._emscripten_bind_CExpat_characterData_0=function(){return(_r=o._emscripten_bind_CExpat_characterData_0=o.asm.z).apply(null,arguments)},yr=o._emscripten_bind_CExpat___destroy___0=function(){return(yr=o._emscripten_bind_CExpat___destroy___0=o.asm.A).apply(null,arguments)},gr=o._emscripten_bind_VoidPtr___destroy___0=function(){return(gr=o._emscripten_bind_VoidPtr___destroy___0=o.asm.B).apply(null,arguments)},Er=o._emscripten_bind_CExpatJS_CExpatJS_0=function(){return(Er=o._emscripten_bind_CExpatJS_CExpatJS_0=o.asm.C).apply(null,arguments)},br=o._emscripten_bind_CExpatJS_startElement_0=function(){return(br=o._emscripten_bind_CExpatJS_startElement_0=o.asm.D).apply(null,arguments)},kr=o._emscripten_bind_CExpatJS_endElement_0=function(){return(kr=o._emscripten_bind_CExpatJS_endElement_0=o.asm.E).apply(null,arguments)},Dr=o._emscripten_bind_CExpatJS_characterData_0=function(){return(Dr=o._emscripten_bind_CExpatJS_characterData_0=o.asm.F).apply(null,arguments)},Sr=o._emscripten_bind_CExpatJS___destroy___0=function(){return(Sr=o._emscripten_bind_CExpatJS___destroy___0=o.asm.G).apply(null,arguments)};function Pr(r){function t(){sr||(sr=!0,o.calledRun=!0,w||(o.noFSInit||Q.init.initialized||Q.init(),Q.ignorePermissions=!1,J(C),e(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),function(){if(o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)r=o.postRun.shift(),z.unshift(r);var r;J(z)}()))}j>0||(function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)r=o.preRun.shift(),R.unshift(r);var r;J(R)}(),j>0||(o.setStatus?(o.setStatus("Running..."),setTimeout(function(){setTimeout(function(){o.setStatus("")},1),t()},1)):t()))}if(o._malloc=function(){return(o._malloc=o.asm.I).apply(null,arguments)},T=function r(){sr||Pr(),sr||(T=r)},o.run=Pr,o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();function Fr(){}function xr(r){return(r||Fr).__cache__}function Ar(r,e){var t=xr(e),n=t[r];return n||((n=Object.create((e||Fr).prototype)).ptr=r,t[r]=n)}Pr(),Fr.prototype=Object.create(Fr.prototype),Fr.prototype.constructor=Fr,Fr.prototype.__class__=Fr,Fr.__cache__={},o.WrapperObject=Fr,o.getCache=xr,o.wrapPointer=Ar,o.castObject=function(r,e){return Ar(r.ptr,e)},o.NULL=Ar(0),o.destroy=function(r){if(!r.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";r.__destroy__(),delete xr(r.__class__)[r.ptr]},o.compare=function(r,e){return r.ptr===e.ptr},o.getPointer=function(r){return r.ptr},o.getClass=function(r){return r.__class__};var Mr={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(Mr.needed){for(var r=0;r<Mr.temps.length;r++)o._free(Mr.temps[r]);Mr.temps.length=0,o._free(Mr.buffer),Mr.buffer=0,Mr.size+=Mr.needed,Mr.needed=0}Mr.buffer||(Mr.size+=128,Mr.buffer=o._malloc(Mr.size),_(Mr.buffer)),Mr.pos=0},alloc:function(r,e){_(Mr.buffer);var t,n=e.BYTES_PER_ELEMENT,i=r.length*n;return i=i+7&-8,Mr.pos+i>=Mr.size?(_(i>0),Mr.needed+=i,t=o._malloc(i),Mr.temps.push(t)):(t=Mr.buffer+Mr.pos,Mr.pos+=i),t},copy:function(r,e,t){switch(t>>>=0,e.BYTES_PER_ELEMENT){case 2:t>>>=1;break;case 4:t>>>=2;break;case 8:t>>>=3}for(var n=0;n<r.length;n++)e[t+n]=r[n]}};function Rr(){this.ptr=ur(),xr(Rr)[this.ptr]=this}function Cr(){throw"cannot construct a VoidPtr, no constructor in IDL"}function zr(){this.ptr=Er(),xr(zr)[this.ptr]=this}return Rr.prototype=Object.create(Fr.prototype),Rr.prototype.constructor=Rr,Rr.prototype.__class__=Rr,Rr.__cache__={},o.CExpat=Rr,Rr.prototype.version=Rr.prototype.version=function(){var r=this.ptr;return F(cr(r))},Rr.prototype.create=Rr.prototype.create=function(){var r=this.ptr;return!!fr(r)},Rr.prototype.destroy=Rr.prototype.destroy=function(){var r=this.ptr;lr(r)},Rr.prototype.parse=Rr.prototype.parse=function(r){var e=this.ptr;return Mr.prepare(),r=r&&"object"==typeof r?r.ptr:function(r){if("string"==typeof r){var e=ir(r),t=Mr.alloc(e,g);return Mr.copy(e,g,t),t}return r}(r),!!dr(e,r)},Rr.prototype.tag=Rr.prototype.tag=function(){var r=this.ptr;return F(pr(r))},Rr.prototype.attrs=Rr.prototype.attrs=function(){var r=this.ptr;return F(hr(r))},Rr.prototype.content=Rr.prototype.content=function(){var r=this.ptr;return F(mr(r))},Rr.prototype.startElement=Rr.prototype.startElement=function(){var r=this.ptr;vr(r)},Rr.prototype.endElement=Rr.prototype.endElement=function(){var r=this.ptr;wr(r)},Rr.prototype.characterData=Rr.prototype.characterData=function(){var r=this.ptr;_r(r)},Rr.prototype.__destroy__=Rr.prototype.__destroy__=function(){var r=this.ptr;yr(r)},Cr.prototype=Object.create(Fr.prototype),Cr.prototype.constructor=Cr,Cr.prototype.__class__=Cr,Cr.__cache__={},o.VoidPtr=Cr,Cr.prototype.__destroy__=Cr.prototype.__destroy__=function(){var r=this.ptr;gr(r)},zr.prototype=Object.create(Rr.prototype),zr.prototype.constructor=zr,zr.prototype.__class__=zr,zr.__cache__={},o.CExpatJS=zr,zr.prototype.startElement=zr.prototype.startElement=function(){var r=this.ptr;br(r)},zr.prototype.endElement=zr.prototype.endElement=function(){var r=this.ptr;kr(r)},zr.prototype.characterData=zr.prototype.characterData=function(){var r=this.ptr;Dr(r)},zr.prototype.__destroy__=zr.prototype.__destroy__=function(){var r=this.ptr;Sr(r)},r.ready},e.exports=n;var o=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}().__hpcc_wasmFolder||void 0;function i(r,e,t){var n=r.default||r;return n.__hpcc_promise||(n.__hpcc_promise=n({wasmBinary:t,locateFile:function(r,t){return function(r,e){for(;r.charAt(r.length-1)===e;)r=r.substring(0,r.length-1);return r}(e||function(r){if(!arguments.length)return o;var e=o;return o=r,e}()||t||".","/")+"/"+function(r,e){for(;r.charAt(0)===e;)r=r.substring(1);return r}(r,"/")}})),n.__hpcc_promise}!function(){function r(r,e){this.tag=r,this.attrs=e,this._content=""}Object.defineProperty(r.prototype,"content",{get:function(){return this._content},enumerable:!1,configurable:!0}),r.prototype.appendContent=function(r){this._content+=r}}();var a={exports:{}};!function(r,e){var t=function(){var r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0;return function(e){var t,n,o=void 0!==(e=e||{})?e:{};o.ready=new Promise(function(r,e){t=r,n=e});var i,a={};for(i in o)o.hasOwnProperty(i)&&(a[i]=o[i]);var s,u,c,f="./this.program",l=function(r,e){throw e},d=!0,p="";"undefined"!=typeof document&&document.currentScript&&(p=document.currentScript.src),r&&(p=r),p=0!==p.indexOf("blob:")?p.substr(0,p.lastIndexOf("/")+1):"",s=function(r){var e=new XMLHttpRequest;return e.open("GET",r,!1),e.send(null),e.responseText},u=function(r,e,t){var n=new XMLHttpRequest;n.open("GET",r,!0),n.responseType="arraybuffer",n.onload=function(){200==n.status||0==n.status&&n.response?e(n.response):t()},n.onerror=t,n.send(null)};var h=o.print||console.log.bind(console),m=o.printErr||console.warn.bind(console);for(i in a)a.hasOwnProperty(i)&&(o[i]=a[i]);a=null,o.arguments,o.thisProgram&&(f=o.thisProgram),o.quit&&(l=o.quit);var v=16;var w,_=0,y=function(r){_=r},g=function(){return _};o.wasmBinary&&(w=o.wasmBinary);var E,b=o.noExitRuntime||!0;"object"!=typeof WebAssembly&&V("no native wasm support detected");var k=!1;function D(r,e){r||V("Assertion failed: "+e)}var S,P,F,x,A,M,R,C="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function z(r,e,t){for(var n=e+t,o=e;r[o]&&!(o>=n);)++o;if(o-e>16&&r.subarray&&C)return C.decode(r.subarray(e,o));for(var i="";e<o;){var a=r[e++];if(128&a){var s=63&r[e++];if(192!=(224&a)){var u=63&r[e++];if((a=224==(240&a)?(15&a)<<12|s<<6|u:(7&a)<<18|s<<12|u<<6|63&r[e++])<65536)i+=String.fromCharCode(a);else{var c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function j(r,e){return r?z(F,r,e):""}function T(r,e,t,n){if(!(n>0))return 0;for(var o=t,i=t+n-1,a=0;a<r.length;++a){var s=r.charCodeAt(a);if(s>=55296&&s<=57343)s=65536+((1023&s)<<10)|1023&r.charCodeAt(++a);if(s<=127){if(t>=i)break;e[t++]=s}else if(s<=2047){if(t+1>=i)break;e[t++]=192|s>>6,e[t++]=128|63&s}else if(s<=65535){if(t+2>=i)break;e[t++]=224|s>>12,e[t++]=128|s>>6&63,e[t++]=128|63&s}else{if(t+3>=i)break;e[t++]=240|s>>18,e[t++]=128|s>>12&63,e[t++]=128|s>>6&63,e[t++]=128|63&s}}return e[t]=0,t-o}function B(r){for(var e=0,t=0;t<r.length;++t){var n=r.charCodeAt(t);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&r.charCodeAt(++t)),n<=127?++e:e+=n<=2047?2:n<=65535?3:4}return e}function N(r){S=r,o.HEAP8=P=new Int8Array(r),o.HEAP16=x=new Int16Array(r),o.HEAP32=A=new Int32Array(r),o.HEAPU8=F=new Uint8Array(r),o.HEAPU16=new Uint16Array(r),o.HEAPU32=new Uint32Array(r),o.HEAPF32=new Float32Array(r),o.HEAPF64=M=new Float64Array(r)}o.INITIAL_MEMORY;var O=[],L=[],I=[],U=0;var H=0,W=null;function q(r){H++,o.monitorRunDependencies&&o.monitorRunDependencies(H)}function G(r){if(H--,o.monitorRunDependencies&&o.monitorRunDependencies(H),0==H&&W){var e=W;W=null,e()}}function V(r){o.onAbort&&o.onAbort(r),m(r+=""),k=!0,r="abort("+r+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(r);throw n(e),e}o.preloadedImages={},o.preloadedAudios={};var J,X,Y,K,$="data:application/octet-stream;base64,";function Q(r){return r.startsWith($)}function Z(r){try{if(r==J&&w)return new Uint8Array(w);if(!c)throw"both async and sync fetching of the wasm failed"}catch(r){V(r)}}Q(J="graphvizlib.wasm")||(X=J,J=o.locateFile?o.locateFile(X,p):p+X);var rr,er={141888:function(r,e){var t=j(r),n=j(e);lr.createPath("/",ir.dirname(t)),lr.writeFile(ir.join("/",t),n)}};function tr(r){for(;r.length>0;){var e=r.shift();if("function"!=typeof e){var t=e.func;"number"==typeof t?void 0===e.arg?R.get(t)():R.get(t)(e.arg):t(void 0===e.arg?null:e.arg)}else e(o)}}rr=function(){return performance.now()};var nr=!0;function or(r){return A[Ar()>>2]=r,r}var ir={splitPath:function(r){return/^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/.exec(r).slice(1)},normalizeArray:function(r,e){for(var t=0,n=r.length-1;n>=0;n--){var o=r[n];"."===o?r.splice(n,1):".."===o?(r.splice(n,1),t++):t&&(r.splice(n,1),t--)}if(e)for(;t;t--)r.unshift("..");return r},normalize:function(r){var e="/"===r.charAt(0),t="/"===r.substr(-1);return(r=ir.normalizeArray(r.split("/").filter(function(r){return!!r}),!e).join("/"))||e||(r="."),r&&t&&(r+="/"),(e?"/":"")+r},dirname:function(r){var e=ir.splitPath(r),t=e[0],n=e[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:function(r){if("/"===r)return"/";var e=(r=(r=ir.normalize(r)).replace(/\\/$/,"")).lastIndexOf("/");return-1===e?r:r.substr(e+1)},extname:function(r){return ir.splitPath(r)[3]},join:function(){var r=Array.prototype.slice.call(arguments,0);return ir.normalize(r.join("/"))},join2:function(r,e){return ir.normalize(r+"/"+e)}};var ar={resolve:function(){for(var r="",e=!1,t=arguments.length-1;t>=-1&&!e;t--){var n=t>=0?arguments[t]:lr.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";r=n+"/"+r,e="/"===n.charAt(0)}return(e?"/":"")+(r=ir.normalizeArray(r.split("/").filter(function(r){return!!r}),!e).join("/"))||"."},relative:function(r,e){function t(r){for(var e=0;e<r.length&&""===r[e];e++);for(var t=r.length-1;t>=0&&""===r[t];t--);return e>t?[]:r.slice(e,t-e+1)}r=ar.resolve(r).substr(1),e=ar.resolve(e).substr(1);for(var n=t(r.split("/")),o=t(e.split("/")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var u=[];for(s=a;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(a))).join("/")}},sr={ttys:[],init:function(){},shutdown:function(){},register:function(r,e){sr.ttys[r]={input:[],output:[],ops:e},lr.registerDevice(r,sr.stream_ops)},stream_ops:{open:function(r){var e=sr.ttys[r.node.rdev];if(!e)throw new lr.ErrnoError(43);r.tty=e,r.seekable=!1},close:function(r){r.tty.ops.flush(r.tty)},flush:function(r){r.tty.ops.flush(r.tty)},read:function(r,e,t,n,o){if(!r.tty||!r.tty.ops.get_char)throw new lr.ErrnoError(60);for(var i=0,a=0;a<n;a++){var s;try{s=r.tty.ops.get_char(r.tty)}catch(r){throw new lr.ErrnoError(29)}if(void 0===s&&0===i)throw new lr.ErrnoError(6);if(null==s)break;i++,e[t+a]=s}return i&&(r.node.timestamp=Date.now()),i},write:function(r,e,t,n,o){if(!r.tty||!r.tty.ops.put_char)throw new lr.ErrnoError(60);try{for(var i=0;i<n;i++)r.tty.ops.put_char(r.tty,e[t+i])}catch(r){throw new lr.ErrnoError(29)}return n&&(r.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(r){if(!r.input.length){var e=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\\n"),!e)return null;r.input=_r(e,!0)}return r.input.shift()},put_char:function(r,e){null===e||10===e?(h(z(r.output,0)),r.output=[]):0!=e&&r.output.push(e)},flush:function(r){r.output&&r.output.length>0&&(h(z(r.output,0)),r.output=[])}},default_tty1_ops:{put_char:function(r,e){null===e||10===e?(m(z(r.output,0)),r.output=[]):0!=e&&r.output.push(e)},flush:function(r){r.output&&r.output.length>0&&(m(z(r.output,0)),r.output=[])}}};function ur(r,e){F.fill(0,r,r+e)}function cr(r){r=function(r,e){return e||(e=v),Math.ceil(r/e)*e}(r,65536);var e=zr(65536,r);return e?(ur(e,r),e):0}var fr={ops_table:null,mount:function(r){return fr.createNode(null,"/",16895,0)},createNode:function(r,e,t,n){if(lr.isBlkdev(t)||lr.isFIFO(t))throw new lr.ErrnoError(63);fr.ops_table||(fr.ops_table={dir:{node:{getattr:fr.node_ops.getattr,setattr:fr.node_ops.setattr,lookup:fr.node_ops.lookup,mknod:fr.node_ops.mknod,rename:fr.node_ops.rename,unlink:fr.node_ops.unlink,rmdir:fr.node_ops.rmdir,readdir:fr.node_ops.readdir,symlink:fr.node_ops.symlink},stream:{llseek:fr.stream_ops.llseek}},file:{node:{getattr:fr.node_ops.getattr,setattr:fr.node_ops.setattr},stream:{llseek:fr.stream_ops.llseek,read:fr.stream_ops.read,write:fr.stream_ops.write,allocate:fr.stream_ops.allocate,mmap:fr.stream_ops.mmap,msync:fr.stream_ops.msync}},link:{node:{getattr:fr.node_ops.getattr,setattr:fr.node_ops.setattr,readlink:fr.node_ops.readlink},stream:{}},chrdev:{node:{getattr:fr.node_ops.getattr,setattr:fr.node_ops.setattr},stream:lr.chrdev_stream_ops}});var o=lr.createNode(r,e,t,n);return lr.isDir(o.mode)?(o.node_ops=fr.ops_table.dir.node,o.stream_ops=fr.ops_table.dir.stream,o.contents={}):lr.isFile(o.mode)?(o.node_ops=fr.ops_table.file.node,o.stream_ops=fr.ops_table.file.stream,o.usedBytes=0,o.contents=null):lr.isLink(o.mode)?(o.node_ops=fr.ops_table.link.node,o.stream_ops=fr.ops_table.link.stream):lr.isChrdev(o.mode)&&(o.node_ops=fr.ops_table.chrdev.node,o.stream_ops=fr.ops_table.chrdev.stream),o.timestamp=Date.now(),r&&(r.contents[e]=o,r.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(r){return r.contents?r.contents.subarray?r.contents.subarray(0,r.usedBytes):new Uint8Array(r.contents):new Uint8Array(0)},expandFileStorage:function(r,e){var t=r.contents?r.contents.length:0;if(!(t>=e)){e=Math.max(e,t*(t<1048576?2:1.125)>>>0),0!=t&&(e=Math.max(e,256));var n=r.contents;r.contents=new Uint8Array(e),r.usedBytes>0&&r.contents.set(n.subarray(0,r.usedBytes),0)}},resizeFileStorage:function(r,e){if(r.usedBytes!=e)if(0==e)r.contents=null,r.usedBytes=0;else{var t=r.contents;r.contents=new Uint8Array(e),t&&r.contents.set(t.subarray(0,Math.min(e,r.usedBytes))),r.usedBytes=e}},node_ops:{getattr:function(r){var e={};return e.dev=lr.isChrdev(r.mode)?r.id:1,e.ino=r.id,e.mode=r.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=r.rdev,lr.isDir(r.mode)?e.size=4096:lr.isFile(r.mode)?e.size=r.usedBytes:lr.isLink(r.mode)?e.size=r.link.length:e.size=0,e.atime=new Date(r.timestamp),e.mtime=new Date(r.timestamp),e.ctime=new Date(r.timestamp),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr:function(r,e){void 0!==e.mode&&(r.mode=e.mode),void 0!==e.timestamp&&(r.timestamp=e.timestamp),void 0!==e.size&&fr.resizeFileStorage(r,e.size)},lookup:function(r,e){throw lr.genericErrors[44]},mknod:function(r,e,t,n){return fr.createNode(r,e,t,n)},rename:function(r,e,t){if(lr.isDir(r.mode)){var n;try{n=lr.lookupNode(e,t)}catch(r){}if(n)for(var o in n.contents)throw new lr.ErrnoError(55)}delete r.parent.contents[r.name],r.parent.timestamp=Date.now(),r.name=t,e.contents[t]=r,e.timestamp=r.parent.timestamp,r.parent=e},unlink:function(r,e){delete r.contents[e],r.timestamp=Date.now()},rmdir:function(r,e){var t=lr.lookupNode(r,e);for(var n in t.contents)throw new lr.ErrnoError(55);delete r.contents[e],r.timestamp=Date.now()},readdir:function(r){var e=[".",".."];for(var t in r.contents)r.contents.hasOwnProperty(t)&&e.push(t);return e},symlink:function(r,e,t){var n=fr.createNode(r,e,41471,0);return n.link=t,n},readlink:function(r){if(!lr.isLink(r.mode))throw new lr.ErrnoError(28);return r.link}},stream_ops:{read:function(r,e,t,n,o){var i=r.node.contents;if(o>=r.node.usedBytes)return 0;var a=Math.min(r.node.usedBytes-o,n);if(a>8&&i.subarray)e.set(i.subarray(o,o+a),t);else for(var s=0;s<a;s++)e[t+s]=i[o+s];return a},write:function(r,e,t,n,o,i){if(e.buffer===P.buffer&&(i=!1),!n)return 0;var a=r.node;if(a.timestamp=Date.now(),e.subarray&&(!a.contents||a.contents.subarray)){if(i)return a.contents=e.subarray(t,t+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=e.slice(t,t+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(e.subarray(t,t+n),o),n}if(fr.expandFileStorage(a,o+n),a.contents.subarray&&e.subarray)a.contents.set(e.subarray(t,t+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=e[t+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek:function(r,e,t){var n=e;if(1===t?n+=r.position:2===t&&lr.isFile(r.node.mode)&&(n+=r.node.usedBytes),n<0)throw new lr.ErrnoError(28);return n},allocate:function(r,e,t){fr.expandFileStorage(r.node,e+t),r.node.usedBytes=Math.max(r.node.usedBytes,e+t)},mmap:function(r,e,t,n,o,i){if(0!==e)throw new lr.ErrnoError(28);if(!lr.isFile(r.node.mode))throw new lr.ErrnoError(43);var a,s,u=r.node.contents;if(2&i||u.buffer!==S){if((n>0||n+t<u.length)&&(u=u.subarray?u.subarray(n,n+t):Array.prototype.slice.call(u,n,n+t)),s=!0,!(a=cr(t)))throw new lr.ErrnoError(48);P.set(u,a)}else s=!1,a=u.byteOffset;return{ptr:a,allocated:s}},msync:function(r,e,t,n,o){if(!lr.isFile(r.node.mode))throw new lr.ErrnoError(43);return 2&o?0:(fr.stream_ops.write(r,e,0,n,t,!1),0)}}};var lr={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:function(r,e){if(e=e||{},!(r=ar.resolve(lr.cwd(),r)))return{path:"",node:null};var t={follow_mount:!0,recurse_count:0};for(var n in t)void 0===e[n]&&(e[n]=t[n]);if(e.recurse_count>8)throw new lr.ErrnoError(32);for(var o=ir.normalizeArray(r.split("/").filter(function(r){return!!r}),!1),i=lr.root,a="/",s=0;s<o.length;s++){var u=s===o.length-1;if(u&&e.parent)break;if(i=lr.lookupNode(i,o[s]),a=ir.join2(a,o[s]),lr.isMountpoint(i)&&(!u||u&&e.follow_mount)&&(i=i.mounted.root),!u||e.follow)for(var c=0;lr.isLink(i.mode);){var f=lr.readlink(a);if(a=ar.resolve(ir.dirname(a),f),i=lr.lookupPath(a,{recurse_count:e.recurse_count}).node,c++>40)throw new lr.ErrnoError(32)}}return{path:a,node:i}},getPath:function(r){for(var e;;){if(lr.isRoot(r)){var t=r.mount.mountpoint;return e?"/"!==t[t.length-1]?t+"/"+e:t+e:t}e=e?r.name+"/"+e:r.name,r=r.parent}},hashName:function(r,e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return(r+t>>>0)%lr.nameTable.length},hashAddNode:function(r){var e=lr.hashName(r.parent.id,r.name);r.name_next=lr.nameTable[e],lr.nameTable[e]=r},hashRemoveNode:function(r){var e=lr.hashName(r.parent.id,r.name);if(lr.nameTable[e]===r)lr.nameTable[e]=r.name_next;else for(var t=lr.nameTable[e];t;){if(t.name_next===r){t.name_next=r.name_next;break}t=t.name_next}},lookupNode:function(r,e){var t=lr.mayLookup(r);if(t)throw new lr.ErrnoError(t,r);for(var n=lr.hashName(r.id,e),o=lr.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===r.id&&i===e)return o}return lr.lookup(r,e)},createNode:function(r,e,t,n){var o=new lr.FSNode(r,e,t,n);return lr.hashAddNode(o),o},destroyNode:function(r){lr.hashRemoveNode(r)},isRoot:function(r){return r===r.parent},isMountpoint:function(r){return!!r.mounted},isFile:function(r){return 32768==(61440&r)},isDir:function(r){return 16384==(61440&r)},isLink:function(r){return 40960==(61440&r)},isChrdev:function(r){return 8192==(61440&r)},isBlkdev:function(r){return 24576==(61440&r)},isFIFO:function(r){return 4096==(61440&r)},isSocket:function(r){return 49152==(49152&r)},flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:function(r){var e=lr.flagModes[r];if(void 0===e)throw new Error("Unknown file open mode: "+r);return e},flagsToPermissionString:function(r){var e=["r","w","rw"][3&r];return 512&r&&(e+="w"),e},nodePermissions:function(r,e){return lr.ignorePermissions?0:(!e.includes("r")||292&r.mode)&&(!e.includes("w")||146&r.mode)&&(!e.includes("x")||73&r.mode)?0:2},mayLookup:function(r){var e=lr.nodePermissions(r,"x");return e||(r.node_ops.lookup?0:2)},mayCreate:function(r,e){try{lr.lookupNode(r,e);return 20}catch(r){}return lr.nodePermissions(r,"wx")},mayDelete:function(r,e,t){var n;try{n=lr.lookupNode(r,e)}catch(r){return r.errno}var o=lr.nodePermissions(r,"wx");if(o)return o;if(t){if(!lr.isDir(n.mode))return 54;if(lr.isRoot(n)||lr.getPath(n)===lr.cwd())return 10}else if(lr.isDir(n.mode))return 31;return 0},mayOpen:function(r,e){return r?lr.isLink(r.mode)?32:lr.isDir(r.mode)&&("r"!==lr.flagsToPermissionString(e)||512&e)?31:lr.nodePermissions(r,lr.flagsToPermissionString(e)):44},MAX_OPEN_FDS:4096,nextfd:function(r,e){r=r||0,e=e||lr.MAX_OPEN_FDS;for(var t=r;t<=e;t++)if(!lr.streams[t])return t;throw new lr.ErrnoError(33)},getStream:function(r){return lr.streams[r]},createStream:function(r,e,t){lr.FSStream||(lr.FSStream=function(){},lr.FSStream.prototype={object:{get:function(){return this.node},set:function(r){this.node=r}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}});var n=new lr.FSStream;for(var o in r)n[o]=r[o];r=n;var i=lr.nextfd(e,t);return r.fd=i,lr.streams[i]=r,r},closeStream:function(r){lr.streams[r]=null},chrdev_stream_ops:{open:function(r){var e=lr.getDevice(r.node.rdev);r.stream_ops=e.stream_ops,r.stream_ops.open&&r.stream_ops.open(r)},llseek:function(){throw new lr.ErrnoError(70)}},major:function(r){return r>>8},minor:function(r){return 255&r},makedev:function(r,e){return r<<8|e},registerDevice:function(r,e){lr.devices[r]={stream_ops:e}},getDevice:function(r){return lr.devices[r]},getMounts:function(r){for(var e=[],t=[r];t.length;){var n=t.pop();e.push(n),t.push.apply(t,n.mounts)}return e},syncfs:function(r,e){"function"==typeof r&&(e=r,r=!1),lr.syncFSRequests++,lr.syncFSRequests>1&&m("warning: "+lr.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var t=lr.getMounts(lr.root.mount),n=0;function o(r){return lr.syncFSRequests--,e(r)}function i(r){if(r)return i.errored?void 0:(i.errored=!0,o(r));++n>=t.length&&o(null)}t.forEach(function(e){if(!e.type.syncfs)return i(null);e.type.syncfs(e,r,i)})},mount:function(r,e,t){var n,o="/"===t,i=!t;if(o&&lr.root)throw new lr.ErrnoError(10);if(!o&&!i){var a=lr.lookupPath(t,{follow_mount:!1});if(t=a.path,n=a.node,lr.isMountpoint(n))throw new lr.ErrnoError(10);if(!lr.isDir(n.mode))throw new lr.ErrnoError(54)}var s={type:r,opts:e,mountpoint:t,mounts:[]},u=r.mount(s);return u.mount=s,s.root=u,o?lr.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:function(r){var e=lr.lookupPath(r,{follow_mount:!1});if(!lr.isMountpoint(e.node))throw new lr.ErrnoError(28);var t=e.node,n=t.mounted,o=lr.getMounts(n);Object.keys(lr.nameTable).forEach(function(r){for(var e=lr.nameTable[r];e;){var t=e.name_next;o.includes(e.mount)&&lr.destroyNode(e),e=t}}),t.mounted=null;var i=t.mount.mounts.indexOf(n);t.mount.mounts.splice(i,1)},lookup:function(r,e){return r.node_ops.lookup(r,e)},mknod:function(r,e,t){var n=lr.lookupPath(r,{parent:!0}).node,o=ir.basename(r);if(!o||"."===o||".."===o)throw new lr.ErrnoError(28);var i=lr.mayCreate(n,o);if(i)throw new lr.ErrnoError(i);if(!n.node_ops.mknod)throw new lr.ErrnoError(63);return n.node_ops.mknod(n,o,e,t)},create:function(r,e){return e=void 0!==e?e:438,e&=4095,e|=32768,lr.mknod(r,e,0)},mkdir:function(r,e){return e=void 0!==e?e:511,e&=1023,e|=16384,lr.mknod(r,e,0)},mkdirTree:function(r,e){for(var t=r.split("/"),n="",o=0;o<t.length;++o)if(t[o]){n+="/"+t[o];try{lr.mkdir(n,e)}catch(r){if(20!=r.errno)throw r}}},mkdev:function(r,e,t){return void 0===t&&(t=e,e=438),e|=8192,lr.mknod(r,e,t)},symlink:function(r,e){if(!ar.resolve(r))throw new lr.ErrnoError(44);var t=lr.lookupPath(e,{parent:!0}).node;if(!t)throw new lr.ErrnoError(44);var n=ir.basename(e),o=lr.mayCreate(t,n);if(o)throw new lr.ErrnoError(o);if(!t.node_ops.symlink)throw new lr.ErrnoError(63);return t.node_ops.symlink(t,n,r)},rename:function(r,e){var t,n,o=ir.dirname(r),i=ir.dirname(e),a=ir.basename(r),s=ir.basename(e);if(t=lr.lookupPath(r,{parent:!0}).node,n=lr.lookupPath(e,{parent:!0}).node,!t||!n)throw new lr.ErrnoError(44);if(t.mount!==n.mount)throw new lr.ErrnoError(75);var u,c=lr.lookupNode(t,a),f=ar.relative(r,i);if("."!==f.charAt(0))throw new lr.ErrnoError(28);if("."!==(f=ar.relative(e,o)).charAt(0))throw new lr.ErrnoError(55);try{u=lr.lookupNode(n,s)}catch(r){}if(c!==u){var l=lr.isDir(c.mode),d=lr.mayDelete(t,a,l);if(d)throw new lr.ErrnoError(d);if(d=u?lr.mayDelete(n,s,l):lr.mayCreate(n,s))throw new lr.ErrnoError(d);if(!t.node_ops.rename)throw new lr.ErrnoError(63);if(lr.isMountpoint(c)||u&&lr.isMountpoint(u))throw new lr.ErrnoError(10);if(n!==t&&(d=lr.nodePermissions(t,"w")))throw new lr.ErrnoError(d);try{lr.trackingDelegate.willMovePath}catch(t){m("FS.trackingDelegate[\'willMovePath\'](\'"+r+"\', \'"+e+"\') threw an exception: "+t.message)}lr.hashRemoveNode(c);try{t.node_ops.rename(c,n,s)}catch(r){throw r}finally{lr.hashAddNode(c)}try{lr.trackingDelegate.onMovePath}catch(t){m("FS.trackingDelegate[\'onMovePath\'](\'"+r+"\', \'"+e+"\') threw an exception: "+t.message)}}},rmdir:function(r){var e=lr.lookupPath(r,{parent:!0}).node,t=ir.basename(r),n=lr.lookupNode(e,t),o=lr.mayDelete(e,t,!0);if(o)throw new lr.ErrnoError(o);if(!e.node_ops.rmdir)throw new lr.ErrnoError(63);if(lr.isMountpoint(n))throw new lr.ErrnoError(10);try{lr.trackingDelegate.willDeletePath}catch(e){m("FS.trackingDelegate[\'willDeletePath\'](\'"+r+"\') threw an exception: "+e.message)}e.node_ops.rmdir(e,t),lr.destroyNode(n);try{lr.trackingDelegate.onDeletePath}catch(e){m("FS.trackingDelegate[\'onDeletePath\'](\'"+r+"\') threw an exception: "+e.message)}},readdir:function(r){var e=lr.lookupPath(r,{follow:!0}).node;if(!e.node_ops.readdir)throw new lr.ErrnoError(54);return e.node_ops.readdir(e)},unlink:function(r){var e=lr.lookupPath(r,{parent:!0}).node,t=ir.basename(r),n=lr.lookupNode(e,t),o=lr.mayDelete(e,t,!1);if(o)throw new lr.ErrnoError(o);if(!e.node_ops.unlink)throw new lr.ErrnoError(63);if(lr.isMountpoint(n))throw new lr.ErrnoError(10);try{lr.trackingDelegate.willDeletePath}catch(e){m("FS.trackingDelegate[\'willDeletePath\'](\'"+r+"\') threw an exception: "+e.message)}e.node_ops.unlink(e,t),lr.destroyNode(n);try{lr.trackingDelegate.onDeletePath}catch(e){m("FS.trackingDelegate[\'onDeletePath\'](\'"+r+"\') threw an exception: "+e.message)}},readlink:function(r){var e=lr.lookupPath(r).node;if(!e)throw new lr.ErrnoError(44);if(!e.node_ops.readlink)throw new lr.ErrnoError(28);return ar.resolve(lr.getPath(e.parent),e.node_ops.readlink(e))},stat:function(r,e){var t=lr.lookupPath(r,{follow:!e}).node;if(!t)throw new lr.ErrnoError(44);if(!t.node_ops.getattr)throw new lr.ErrnoError(63);return t.node_ops.getattr(t)},lstat:function(r){return lr.stat(r,!0)},chmod:function(r,e,t){var n;"string"==typeof r?n=lr.lookupPath(r,{follow:!t}).node:n=r;if(!n.node_ops.setattr)throw new lr.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&e|-4096&n.mode,timestamp:Date.now()})},lchmod:function(r,e){lr.chmod(r,e,!0)},fchmod:function(r,e){var t=lr.getStream(r);if(!t)throw new lr.ErrnoError(8);lr.chmod(t.node,e)},chown:function(r,e,t,n){var o;"string"==typeof r?o=lr.lookupPath(r,{follow:!n}).node:o=r;if(!o.node_ops.setattr)throw new lr.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:function(r,e,t){lr.chown(r,e,t,!0)},fchown:function(r,e,t){var n=lr.getStream(r);if(!n)throw new lr.ErrnoError(8);lr.chown(n.node,e,t)},truncate:function(r,e){if(e<0)throw new lr.ErrnoError(28);var t;"string"==typeof r?t=lr.lookupPath(r,{follow:!0}).node:t=r;if(!t.node_ops.setattr)throw new lr.ErrnoError(63);if(lr.isDir(t.mode))throw new lr.ErrnoError(31);if(!lr.isFile(t.mode))throw new lr.ErrnoError(28);var n=lr.nodePermissions(t,"w");if(n)throw new lr.ErrnoError(n);t.node_ops.setattr(t,{size:e,timestamp:Date.now()})},ftruncate:function(r,e){var t=lr.getStream(r);if(!t)throw new lr.ErrnoError(8);if(0==(2097155&t.flags))throw new lr.ErrnoError(28);lr.truncate(t.node,e)},utime:function(r,e,t){var n=lr.lookupPath(r,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(e,t)})},open:function(r,e,t,n,i){if(""===r)throw new lr.ErrnoError(44);var a;if(t=void 0===t?438:t,t=64&(e="string"==typeof e?lr.modeStringToFlags(e):e)?4095&t|32768:0,"object"==typeof r)a=r;else{r=ir.normalize(r);try{a=lr.lookupPath(r,{follow:!(131072&e)}).node}catch(r){}}var s=!1;if(64&e)if(a){if(128&e)throw new lr.ErrnoError(20)}else a=lr.mknod(r,t,0),s=!0;if(!a)throw new lr.ErrnoError(44);if(lr.isChrdev(a.mode)&&(e&=-513),65536&e&&!lr.isDir(a.mode))throw new lr.ErrnoError(54);if(!s){var u=lr.mayOpen(a,e);if(u)throw new lr.ErrnoError(u)}512&e&&lr.truncate(a,0),e&=-131713;var c=lr.createStream({node:a,path:lr.getPath(a),flags:e,seekable:!0,position:0,stream_ops:a.stream_ops,ungotten:[],error:!1},n,i);c.stream_ops.open&&c.stream_ops.open(c),!o.logReadFiles||1&e||(lr.readFiles||(lr.readFiles={}),r in lr.readFiles||(lr.readFiles[r]=1,m("FS.trackingDelegate error on read file: "+r)));try{lr.trackingDelegate.onOpenFile}catch(e){m("FS.trackingDelegate[\'onOpenFile\'](\'"+r+"\', flags) threw an exception: "+e.message)}return c},close:function(r){if(lr.isClosed(r))throw new lr.ErrnoError(8);r.getdents&&(r.getdents=null);try{r.stream_ops.close&&r.stream_ops.close(r)}catch(r){throw r}finally{lr.closeStream(r.fd)}r.fd=null},isClosed:function(r){return null===r.fd},llseek:function(r,e,t){if(lr.isClosed(r))throw new lr.ErrnoError(8);if(!r.seekable||!r.stream_ops.llseek)throw new lr.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new lr.ErrnoError(28);return r.position=r.stream_ops.llseek(r,e,t),r.ungotten=[],r.position},read:function(r,e,t,n,o){if(n<0||o<0)throw new lr.ErrnoError(28);if(lr.isClosed(r))throw new lr.ErrnoError(8);if(1==(2097155&r.flags))throw new lr.ErrnoError(8);if(lr.isDir(r.node.mode))throw new lr.ErrnoError(31);if(!r.stream_ops.read)throw new lr.ErrnoError(28);var i=void 0!==o;if(i){if(!r.seekable)throw new lr.ErrnoError(70)}else o=r.position;var a=r.stream_ops.read(r,e,t,n,o);return i||(r.position+=a),a},write:function(r,e,t,n,o,i){if(n<0||o<0)throw new lr.ErrnoError(28);if(lr.isClosed(r))throw new lr.ErrnoError(8);if(0==(2097155&r.flags))throw new lr.ErrnoError(8);if(lr.isDir(r.node.mode))throw new lr.ErrnoError(31);if(!r.stream_ops.write)throw new lr.ErrnoError(28);r.seekable&&1024&r.flags&&lr.llseek(r,0,2);var a=void 0!==o;if(a){if(!r.seekable)throw new lr.ErrnoError(70)}else o=r.position;var s=r.stream_ops.write(r,e,t,n,o,i);a||(r.position+=s);try{r.path&&lr.trackingDelegate.onWriteToFile&&lr.trackingDelegate.onWriteToFile(r.path)}catch(e){m("FS.trackingDelegate[\'onWriteToFile\'](\'"+r.path+"\') threw an exception: "+e.message)}return s},allocate:function(r,e,t){if(lr.isClosed(r))throw new lr.ErrnoError(8);if(e<0||t<=0)throw new lr.ErrnoError(28);if(0==(2097155&r.flags))throw new lr.ErrnoError(8);if(!lr.isFile(r.node.mode)&&!lr.isDir(r.node.mode))throw new lr.ErrnoError(43);if(!r.stream_ops.allocate)throw new lr.ErrnoError(138);r.stream_ops.allocate(r,e,t)},mmap:function(r,e,t,n,o,i){if(0!=(2&o)&&0==(2&i)&&2!=(2097155&r.flags))throw new lr.ErrnoError(2);if(1==(2097155&r.flags))throw new lr.ErrnoError(2);if(!r.stream_ops.mmap)throw new lr.ErrnoError(43);return r.stream_ops.mmap(r,e,t,n,o,i)},msync:function(r,e,t,n,o){return r&&r.stream_ops.msync?r.stream_ops.msync(r,e,t,n,o):0},munmap:function(r){return 0},ioctl:function(r,e,t){if(!r.stream_ops.ioctl)throw new lr.ErrnoError(59);return r.stream_ops.ioctl(r,e,t)},readFile:function(r,e){if((e=e||{}).flags=e.flags||0,e.encoding=e.encoding||"binary","utf8"!==e.encoding&&"binary"!==e.encoding)throw new Error(\'Invalid encoding type "\'+e.encoding+\'"\');var t,n=lr.open(r,e.flags),o=lr.stat(r).size,i=new Uint8Array(o);return lr.read(n,i,0,o,0),"utf8"===e.encoding?t=z(i,0):"binary"===e.encoding&&(t=i),lr.close(n),t},writeFile:function(r,e,t){(t=t||{}).flags=t.flags||577;var n=lr.open(r,t.flags,t.mode);if("string"==typeof e){var o=new Uint8Array(B(e)+1),i=T(e,o,0,o.length);lr.write(n,o,0,i,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(e))throw new Error("Unsupported data type");lr.write(n,e,0,e.byteLength,void 0,t.canOwn)}lr.close(n)},cwd:function(){return lr.currentPath},chdir:function(r){var e=lr.lookupPath(r,{follow:!0});if(null===e.node)throw new lr.ErrnoError(44);if(!lr.isDir(e.node.mode))throw new lr.ErrnoError(54);var t=lr.nodePermissions(e.node,"x");if(t)throw new lr.ErrnoError(t);lr.currentPath=e.path},createDefaultDirectories:function(){lr.mkdir("/tmp"),lr.mkdir("/home"),lr.mkdir("/home/web_user")},createDefaultDevices:function(){lr.mkdir("/dev"),lr.registerDevice(lr.makedev(1,3),{read:function(){return 0},write:function(r,e,t,n,o){return n}}),lr.mkdev("/dev/null",lr.makedev(1,3)),sr.register(lr.makedev(5,0),sr.default_tty_ops),sr.register(lr.makedev(6,0),sr.default_tty1_ops),lr.mkdev("/dev/tty",lr.makedev(5,0)),lr.mkdev("/dev/tty1",lr.makedev(6,0));var r=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var r=new Uint8Array(1);return function(){return crypto.getRandomValues(r),r[0]}}return function(){V("randomDevice")}}();lr.createDevice("/dev","random",r),lr.createDevice("/dev","urandom",r),lr.mkdir("/dev/shm"),lr.mkdir("/dev/shm/tmp")},createSpecialDirectories:function(){lr.mkdir("/proc");var r=lr.mkdir("/proc/self");lr.mkdir("/proc/self/fd"),lr.mount({mount:function(){var e=lr.createNode(r,"fd",16895,73);return e.node_ops={lookup:function(r,e){var t=+e,n=lr.getStream(t);if(!n)throw new lr.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:function(){return n.path}}};return o.parent=o,o}},e}},{},"/proc/self/fd")},createStandardStreams:function(){o.stdin?lr.createDevice("/dev","stdin",o.stdin):lr.symlink("/dev/tty","/dev/stdin"),o.stdout?lr.createDevice("/dev","stdout",null,o.stdout):lr.symlink("/dev/tty","/dev/stdout"),o.stderr?lr.createDevice("/dev","stderr",null,o.stderr):lr.symlink("/dev/tty1","/dev/stderr"),lr.open("/dev/stdin",0),lr.open("/dev/stdout",1),lr.open("/dev/stderr",1)},ensureErrnoError:function(){lr.ErrnoError||(lr.ErrnoError=function(r,e){this.node=e,this.setErrno=function(r){this.errno=r},this.setErrno(r),this.message="FS error"},lr.ErrnoError.prototype=new Error,lr.ErrnoError.prototype.constructor=lr.ErrnoError,[44].forEach(function(r){lr.genericErrors[r]=new lr.ErrnoError(r),lr.genericErrors[r].stack="<generic error, no stack>"}))},staticInit:function(){lr.ensureErrnoError(),lr.nameTable=new Array(4096),lr.mount(fr,{},"/"),lr.createDefaultDirectories(),lr.createDefaultDevices(),lr.createSpecialDirectories(),lr.filesystems={MEMFS:fr}},init:function(r,e,t){lr.init.initialized=!0,lr.ensureErrnoError(),o.stdin=r||o.stdin,o.stdout=e||o.stdout,o.stderr=t||o.stderr,lr.createStandardStreams()},quit:function(){lr.init.initialized=!1;var r=o._fflush;r&&r(0);for(var e=0;e<lr.streams.length;e++){var t=lr.streams[e];t&&lr.close(t)}},getMode:function(r,e){var t=0;return r&&(t|=365),e&&(t|=146),t},findObject:function(r,e){var t=lr.analyzePath(r,e);return t.exists?t.object:null},analyzePath:function(r,e){try{r=(n=lr.lookupPath(r,{follow:!e})).path}catch(r){}var t={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=lr.lookupPath(r,{parent:!0});t.parentExists=!0,t.parentPath=n.path,t.parentObject=n.node,t.name=ir.basename(r),n=lr.lookupPath(r,{follow:!e}),t.exists=!0,t.path=n.path,t.object=n.node,t.name=n.node.name,t.isRoot="/"===n.path}catch(r){t.error=r.errno}return t},createPath:function(r,e,t,n){r="string"==typeof r?r:lr.getPath(r);for(var o=e.split("/").reverse();o.length;){var i=o.pop();if(i){var a=ir.join2(r,i);try{lr.mkdir(a)}catch(r){}r=a}}return a},createFile:function(r,e,t,n,o){var i=ir.join2("string"==typeof r?r:lr.getPath(r),e),a=lr.getMode(n,o);return lr.create(i,a)},createDataFile:function(r,e,t,n,o,i){var a=e?ir.join2("string"==typeof r?r:lr.getPath(r),e):r,s=lr.getMode(n,o),u=lr.create(a,s);if(t){if("string"==typeof t){for(var c=new Array(t.length),f=0,l=t.length;f<l;++f)c[f]=t.charCodeAt(f);t=c}lr.chmod(u,146|s);var d=lr.open(u,577);lr.write(d,t,0,t.length,0,i),lr.close(d),lr.chmod(u,s)}return u},createDevice:function(r,e,t,n){var o=ir.join2("string"==typeof r?r:lr.getPath(r),e),i=lr.getMode(!!t,!!n);lr.createDevice.major||(lr.createDevice.major=64);var a=lr.makedev(lr.createDevice.major++,0);return lr.registerDevice(a,{open:function(r){r.seekable=!1},close:function(r){n&&n.buffer&&n.buffer.length&&n(10)},read:function(r,e,n,o,i){for(var a=0,s=0;s<o;s++){var u;try{u=t()}catch(r){throw new lr.ErrnoError(29)}if(void 0===u&&0===a)throw new lr.ErrnoError(6);if(null==u)break;a++,e[n+s]=u}return a&&(r.node.timestamp=Date.now()),a},write:function(r,e,t,o,i){for(var a=0;a<o;a++)try{n(e[t+a])}catch(r){throw new lr.ErrnoError(29)}return o&&(r.node.timestamp=Date.now()),a}}),lr.mkdev(o,i,a)},forceLoadFile:function(r){if(r.isDevice||r.isFolder||r.link||r.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!s)throw new Error("Cannot load without read() or XMLHttpRequest.");try{r.contents=_r(s(r.url),!0),r.usedBytes=r.contents.length}catch(r){throw new lr.ErrnoError(29)}},createLazyFile:function(r,e,t,n,o){function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(r){if(!(r>this.length-1||r<0)){var e=r%this.chunkSize,t=r/this.chunkSize|0;return this.getter(t)[e]}},i.prototype.setDataGetter=function(r){this.getter=r},i.prototype.cacheLength=function(){var r=new XMLHttpRequest;if(r.open("HEAD",t,!1),r.send(null),!(r.status>=200&&r.status<300||304===r.status))throw new Error("Couldn\'t load "+t+". Status: "+r.status);var e,n=Number(r.getResponseHeader("Content-length")),o=(e=r.getResponseHeader("Accept-Ranges"))&&"bytes"===e,i=(e=r.getResponseHeader("Content-Encoding"))&&"gzip"===e,a=1048576;o||(a=n);var s=this;s.setDataGetter(function(r){var e=r*a,o=(r+1)*a-1;if(o=Math.min(o,n-1),void 0===s.chunks[r]&&(s.chunks[r]=function(r,e){if(r>e)throw new Error("invalid range ("+r+", "+e+") or no bytes requested!");if(e>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",t,!1),n!==a&&o.setRequestHeader("Range","bytes="+r+"-"+e),"undefined"!=typeof Uint8Array&&(o.responseType="arraybuffer"),o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn\'t load "+t+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):_r(o.responseText||"",!0)}(e,o)),void 0===s.chunks[r])throw new Error("doXHR failed!");return s.chunks[r]}),!i&&n||(a=n=1,n=this.getter(0).length,a=n,h("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a={isDevice:!1,url:t},s=lr.createFile(r,e,a,n,o);a.contents?s.contents=a.contents:a.url&&(s.contents=null,s.url=a.url),Object.defineProperties(s,{usedBytes:{get:function(){return this.contents.length}}});var u={};return Object.keys(s.stream_ops).forEach(function(r){var e=s.stream_ops[r];u[r]=function(){return lr.forceLoadFile(s),e.apply(null,arguments)}}),u.read=function(r,e,t,n,o){lr.forceLoadFile(s);var i=r.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var u=0;u<a;u++)e[t+u]=i[o+u];else for(u=0;u<a;u++)e[t+u]=i.get(o+u);return a},s.stream_ops=u,s},createPreloadedFile:function(r,e,t,n,i,a,s,c,f,l){Browser.init();var d=e?ar.resolve(ir.join2(r,e)):r;function p(t){function u(t){l&&l(),c||lr.createDataFile(r,e,t,n,i,f),a&&a(),G()}var p=!1;o.preloadPlugins.forEach(function(r){p||r.canHandle(d)&&(r.handle(t,d,u,function(){s&&s(),G()}),p=!0)}),p||u(t)}q(),"string"==typeof t?function(r,e,t,n){var o=n?"":"al "+r;u(r,function(t){D(t,\'Loading data file "\'+r+\'" failed (no arrayBuffer).\'),e(new Uint8Array(t)),o&&G()},function(e){if(!t)throw\'Loading data file "\'+r+\'" failed.\';t()}),o&&q()}(t,function(r){p(r)},s):p(t)},indexedDB:function(){return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB},DB_NAME:function(){return"EM_FS_"+window.location.pathname},DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:function(r,e,t){e=e||function(){},t=t||function(){};var n=lr.indexedDB();try{var o=n.open(lr.DB_NAME(),lr.DB_VERSION)}catch(r){return t(r)}o.onupgradeneeded=function(){h("creating db"),o.result.createObjectStore(lr.DB_STORE_NAME)},o.onsuccess=function(){var n=o.result.transaction([lr.DB_STORE_NAME],"readwrite"),i=n.objectStore(lr.DB_STORE_NAME),a=0,s=0,u=r.length;function c(){0==s?e():t()}r.forEach(function(r){var e=i.put(lr.analyzePath(r).object.contents,r);e.onsuccess=function(){++a+s==u&&c()},e.onerror=function(){a+ ++s==u&&c()}}),n.onerror=t},o.onerror=t},loadFilesFromDB:function(r,e,t){e=e||function(){},t=t||function(){};var n=lr.indexedDB();try{var o=n.open(lr.DB_NAME(),lr.DB_VERSION)}catch(r){return t(r)}o.onupgradeneeded=t,o.onsuccess=function(){var n=o.result;try{var i=n.transaction([lr.DB_STORE_NAME],"readonly")}catch(r){return void t(r)}var a=i.objectStore(lr.DB_STORE_NAME),s=0,u=0,c=r.length;function f(){0==u?e():t()}r.forEach(function(r){var e=a.get(r);e.onsuccess=function(){lr.analyzePath(r).exists&&lr.unlink(r),lr.createDataFile(ir.dirname(r),ir.basename(r),e.result,!0,!0,!0),++s+u==c&&f()},e.onerror=function(){s+ ++u==c&&f()}}),i.onerror=t},o.onerror=t}},dr={mappings:{},DEFAULT_POLLMASK:5,umask:511,calculateAt:function(r,e,t){if("/"===e[0])return e;var n;if(-100===r)n=lr.cwd();else{var o=lr.getStream(r);if(!o)throw new lr.ErrnoError(8);n=o.path}if(0==e.length){if(!t)throw new lr.ErrnoError(44);return n}return ir.join2(n,e)},doStat:function(r,e,t){try{var n=r(e)}catch(r){if(r&&r.node&&ir.normalize(e)!==ir.normalize(lr.getPath(r.node)))return-54;throw r}return A[t>>2]=n.dev,A[t+4>>2]=0,A[t+8>>2]=n.ino,A[t+12>>2]=n.mode,A[t+16>>2]=n.nlink,A[t+20>>2]=n.uid,A[t+24>>2]=n.gid,A[t+28>>2]=n.rdev,A[t+32>>2]=0,K=[n.size>>>0,(Y=n.size,+Math.abs(Y)>=1?Y>0?(0|Math.min(+Math.floor(Y/4294967296),4294967295))>>>0:~~+Math.ceil((Y-+(~~Y>>>0))/4294967296)>>>0:0)],A[t+40>>2]=K[0],A[t+44>>2]=K[1],A[t+48>>2]=4096,A[t+52>>2]=n.blocks,A[t+56>>2]=n.atime.getTime()/1e3|0,A[t+60>>2]=0,A[t+64>>2]=n.mtime.getTime()/1e3|0,A[t+68>>2]=0,A[t+72>>2]=n.ctime.getTime()/1e3|0,A[t+76>>2]=0,K=[n.ino>>>0,(Y=n.ino,+Math.abs(Y)>=1?Y>0?(0|Math.min(+Math.floor(Y/4294967296),4294967295))>>>0:~~+Math.ceil((Y-+(~~Y>>>0))/4294967296)>>>0:0)],A[t+80>>2]=K[0],A[t+84>>2]=K[1],0},doMsync:function(r,e,t,n,o){var i=F.slice(r,r+t);lr.msync(e,i,o,t,n)},doMkdir:function(r,e){return"/"===(r=ir.normalize(r))[r.length-1]&&(r=r.substr(0,r.length-1)),lr.mkdir(r,e,0),0},doMknod:function(r,e,t){switch(61440&e){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return lr.mknod(r,e,t),0},doReadlink:function(r,e,t){if(t<=0)return-28;var n=lr.readlink(r),o=Math.min(t,B(n)),i=P[e+o];return T(n,F,e,t+1),P[e+o]=i,o},doAccess:function(r,e){if(-8&e)return-28;var t;if(!(t=lr.lookupPath(r,{follow:!0}).node))return-44;var n="";return 4&e&&(n+="r"),2&e&&(n+="w"),1&e&&(n+="x"),n&&lr.nodePermissions(t,n)?-2:0},doDup:function(r,e,t){var n=lr.getStream(t);return n&&lr.close(n),lr.open(r,e,0,t,t).fd},doReadv:function(r,e,t,n){for(var o=0,i=0;i<t;i++){var a=A[e+8*i>>2],s=A[e+(8*i+4)>>2],u=lr.read(r,P,a,s,n);if(u<0)return-1;if(o+=u,u<s)break}return o},doWritev:function(r,e,t,n){for(var o=0,i=0;i<t;i++){var a=A[e+8*i>>2],s=A[e+(8*i+4)>>2],u=lr.write(r,P,a,s,n);if(u<0)return-1;o+=u}return o},varargs:void 0,get:function(){return dr.varargs+=4,A[dr.varargs-4>>2]},getStr:function(r){return j(r)},getStreamFromFD:function(r){var e=lr.getStream(r);if(!e)throw new lr.ErrnoError(8);return e},get64:function(r,e){return r}};var pr=[];function hr(r){try{return E.grow(r-S.byteLength+65535>>>16),N(E.buffer),1}catch(r){}}var mr={};function vr(){if(!vr.strings){var r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:f||"./this.program"};for(var e in mr)void 0===mr[e]?delete r[e]:r[e]=mr[e];var t=[];for(var e in r)t.push(e+"="+r[e]);vr.strings=t}return vr.strings}var wr=function(r,e,t,n){r||(r=this),this.parent=r,this.mount=r.mount,this.mounted=null,this.id=lr.nextInode++,this.name=e,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n};function _r(r,e,t){var n=t>0?t:B(r)+1,o=new Array(n),i=T(r,o,0,o.length);return e&&(o.length=i),o}Object.defineProperties(wr.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(r){r?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(r){r?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return lr.isDir(this.mode)}},isDevice:{get:function(){return lr.isChrdev(this.mode)}}}),lr.FSNode=wr,lr.staticInit();var yr={z:function(r,e){return function(r,e){var t;if(0===r)t=Date.now();else{if(1!==r&&4!==r||!nr)return or(28),-1;t=rr()}return A[e>>2]=t/1e3|0,A[e+4>>2]=t%1e3*1e3*1e3|0,0}(r,e)},A:function(r,e){try{return r=dr.getStr(r),dr.doAccess(r,e)}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),-r.errno}},i:function(r,e,t){dr.varargs=t;try{var n=dr.getStreamFromFD(r);switch(e){case 0:return(o=dr.get())<0?-28:lr.open(n.path,n.flags,0,o).fd;case 1:case 2:return 0;case 3:return n.flags;case 4:var o=dr.get();return n.flags|=o,0;case 12:return o=dr.get(),x[o+0>>1]=2,0;case 13:case 14:return 0;case 16:case 8:return-28;case 9:return or(28),-1;default:return-28}}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),-r.errno}},l:function(r,e){try{var t=dr.getStreamFromFD(r);return dr.doStat(lr.stat,t.path,e)}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),-r.errno}},e:function(){return 42},B:function(r,e,t){dr.varargs=t;try{var n=dr.getStreamFromFD(r);switch(e){case 21509:case 21505:return n.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return n.tty?0:-59;case 21519:if(!n.tty)return-59;var o=dr.get();return A[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:return o=dr.get(),lr.ioctl(n,e,o);case 21523:case 21524:return n.tty?0:-59;default:V("bad ioctl syscall "+e)}}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),-r.errno}},y:function(r,e,t,n,o,i){try{return function(r,e,t,n,o,i){var a;i<<=12;var s=!1;if(0!=(16&n)&&r%65536!=0)return-28;if(0!=(32&n)){if(!(a=cr(e)))return-48;s=!0}else{var u=lr.getStream(o);if(!u)return-8;var c=lr.mmap(u,r,e,i,t,n);a=c.ptr,s=c.allocated}return dr.mappings[a]={malloc:a,len:e,allocated:s,fd:o,prot:t,flags:n,offset:i},a}(r,e,t,n,o,i)}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),-r.errno}},x:function(r,e){try{return function(r,e){var t=dr.mappings[r];if(0===e||!t)return-28;if(e===t.len){var n=lr.getStream(t.fd);n&&2&t.prot&&dr.doMsync(r,n,e,t.flags,t.offset),dr.mappings[r]=null,t.allocated&&xr(t.malloc)}return 0}(r,e)}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),-r.errno}},f:function(r,e,t){dr.varargs=t;try{var n=dr.getStr(r),o=t?dr.get():0;return lr.open(n,e,o).fd}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),-r.errno}},D:function(r,e){try{return r=dr.getStr(r),dr.doStat(lr.stat,r,e)}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),-r.errno}},C:function(r){try{return r=dr.getStr(r),lr.unlink(r),0}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),-r.errno}},t:function(){throw"longjmp"},s:function(){V()},E:function(r,e,t){var n=function(r,e){var t;for(pr.length=0,e>>=2;t=F[r++];){var n=t<105;n&&1&e&&e++,pr.push(n?M[e++>>1]:A[e]),++e}return pr}(e,t);return er[r].apply(null,n)},q:function(r,e,t){F.copyWithin(r,e,e+t)},r:function(r){var e,t,n=F.length;if((r>>>=0)>2147483648)return!1;for(var o=1;o<=4;o*=2){var i=n*(1+.2/o);if(i=Math.min(i,r+100663296),hr(Math.min(2147483648,((e=Math.max(r,i))%(t=65536)>0&&(e+=t-e%t),e))))return!0}return!1},v:function(r,e){try{var t=0;return vr().forEach(function(n,o){var i=e+t;A[r+4*o>>2]=i,function(r,e,t){for(var n=0;n<r.length;++n)P[e++>>0]=r.charCodeAt(n);t||(P[e>>0]=0)}(n,i),t+=n.length+1}),0}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),r.errno}},w:function(r,e){try{var t=vr();A[r>>2]=t.length;var n=0;return t.forEach(function(r){n+=r.length+1}),A[e>>2]=n,0}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),r.errno}},a:function(r){!function(r,e){b||U>0||(o.onExit&&o.onExit(r),k=!0),l(r,new jr(r))}(r)},d:function(r){try{var e=dr.getStreamFromFD(r);return lr.close(e),0}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),r.errno}},u:function(r,e){try{var t=dr.getStreamFromFD(r),n=t.tty?2:lr.isDir(t.mode)?3:lr.isLink(t.mode)?7:4;return P[e>>0]=n,0}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),r.errno}},k:function(r,e,t,n){try{var o=dr.getStreamFromFD(r),i=dr.doReadv(o,e,t);return A[n>>2]=i,0}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),r.errno}},o:function(r,e,t,n,o){try{var i=dr.getStreamFromFD(r),a=4294967296*t+(e>>>0);return a<=-9007199254740992||a>=9007199254740992?-61:(lr.llseek(i,a,n),K=[i.position>>>0,(Y=i.position,+Math.abs(Y)>=1?Y>0?(0|Math.min(+Math.floor(Y/4294967296),4294967295))>>>0:~~+Math.ceil((Y-+(~~Y>>>0))/4294967296)>>>0:0)],A[o>>2]=K[0],A[o+4>>2]=K[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0)}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),r.errno}},j:function(r,e,t,n){try{var o=dr.getStreamFromFD(r),i=dr.doWritev(o,e,t);return A[n>>2]=i,0}catch(r){return void 0!==lr&&r instanceof lr.ErrnoError||V(r),r.errno}},c:function(){return g()},p:function(r){var e=Date.now();return A[r>>2]=e/1e3|0,A[r+4>>2]=e%1e3*1e3|0,0},m:function(r,e,t,n,o,i,a){var s=Mr();try{return R.get(r)(e,t,n,o,i,a)}catch(r){if(Rr(s),r!==r+0&&"longjmp"!==r)throw r;Cr(1,0)}},n:function(r,e){var t=Mr();try{R.get(r)(e)}catch(r){if(Rr(t),r!==r+0&&"longjmp"!==r)throw r;Cr(1,0)}},b:function(r){y(r)},g:function(r){var e=Date.now()/1e3|0;return r&&(A[r>>2]=e),e},h:function(r){return 0!==r&&ur(r,16),0}};!function(){var r={a:yr};function e(r,e){var t,n=r.exports;o.asm=n,N((E=o.asm.F).buffer),R=o.asm.O,t=o.asm.G,L.unshift(t),G()}function t(r){e(r.instance)}function i(e){return(!w&&d&&"function"==typeof fetch?fetch(J,{credentials:"same-origin"}).then(function(r){if(!r.ok)throw"failed to load wasm binary file at \'"+J+"\'";return r.arrayBuffer()}).catch(function(){return Z(J)}):Promise.resolve().then(function(){return Z(J)})).then(function(e){return WebAssembly.instantiate(e,r)}).then(e,function(r){m("failed to asynchronously prepare wasm: "+r),V(r)})}if(q(),o.instantiateWasm)try{return o.instantiateWasm(r,e)}catch(r){return m("Module.instantiateWasm callback failed with error: "+r),!1}(w||"function"!=typeof WebAssembly.instantiateStreaming||Q(J)||"function"!=typeof fetch?i(t):fetch(J,{credentials:"same-origin"}).then(function(e){return WebAssembly.instantiateStreaming(e,r).then(t,function(r){return m("wasm streaming compile failed: "+r),m("falling back to ArrayBuffer instantiation"),i(t)})})).catch(n)}(),o.___wasm_call_ctors=function(){return(o.___wasm_call_ctors=o.asm.G).apply(null,arguments)};var gr=o._emscripten_bind_VoidPtr___destroy___0=function(){return(gr=o._emscripten_bind_VoidPtr___destroy___0=o.asm.H).apply(null,arguments)},Er=o._emscripten_bind_Graphviz_Graphviz_2=function(){return(Er=o._emscripten_bind_Graphviz_Graphviz_2=o.asm.I).apply(null,arguments)},br=o._emscripten_bind_Graphviz_version_0=function(){return(br=o._emscripten_bind_Graphviz_version_0=o.asm.J).apply(null,arguments)},kr=o._emscripten_bind_Graphviz_lastError_0=function(){return(kr=o._emscripten_bind_Graphviz_lastError_0=o.asm.K).apply(null,arguments)},Dr=o._emscripten_bind_Graphviz_layout_3=function(){return(Dr=o._emscripten_bind_Graphviz_layout_3=o.asm.L).apply(null,arguments)},Sr=o._emscripten_bind_Graphviz_createFile_2=function(){return(Sr=o._emscripten_bind_Graphviz_createFile_2=o.asm.M).apply(null,arguments)},Pr=o._emscripten_bind_Graphviz___destroy___0=function(){return(Pr=o._emscripten_bind_Graphviz___destroy___0=o.asm.N).apply(null,arguments)};o._malloc=function(){return(o._malloc=o.asm.P).apply(null,arguments)};var Fr,xr=o._free=function(){return(xr=o._free=o.asm.Q).apply(null,arguments)},Ar=o.___errno_location=function(){return(Ar=o.___errno_location=o.asm.R).apply(null,arguments)},Mr=o.stackSave=function(){return(Mr=o.stackSave=o.asm.S).apply(null,arguments)},Rr=o.stackRestore=function(){return(Rr=o.stackRestore=o.asm.T).apply(null,arguments)},Cr=o._setThrew=function(){return(Cr=o._setThrew=o.asm.U).apply(null,arguments)},zr=o._memalign=function(){return(zr=o._memalign=o.asm.V).apply(null,arguments)};function jr(r){this.name="ExitStatus",this.message="Program terminated with exit("+r+")",this.status=r}function Tr(r){function e(){Fr||(Fr=!0,o.calledRun=!0,k||(o.noFSInit||lr.init.initialized||lr.init(),lr.ignorePermissions=!1,tr(L),t(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),function(){if(o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)r=o.postRun.shift(),I.unshift(r);var r;tr(I)}()))}H>0||(!function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)r=o.preRun.shift(),O.unshift(r);var r;tr(O)}(),H>0||(o.setStatus?(o.setStatus("Running..."),setTimeout(function(){setTimeout(function(){o.setStatus("")},1),e()},1)):e()))}if(W=function r(){Fr||Tr(),Fr||(W=r)},o.run=Tr,o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();function Br(){}function Nr(r){return(r||Br).__cache__}function Or(r,e){var t=Nr(e),n=t[r];return n||((n=Object.create((e||Br).prototype)).ptr=r,t[r]=n)}Tr(),Br.prototype=Object.create(Br.prototype),Br.prototype.constructor=Br,Br.prototype.__class__=Br,Br.__cache__={},o.WrapperObject=Br,o.getCache=Nr,o.wrapPointer=Or,o.castObject=function(r,e){return Or(r.ptr,e)},o.NULL=Or(0),o.destroy=function(r){if(!r.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";r.__destroy__(),delete Nr(r.__class__)[r.ptr]},o.compare=function(r,e){return r.ptr===e.ptr},o.getPointer=function(r){return r.ptr},o.getClass=function(r){return r.__class__};var Lr={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(Lr.needed){for(var r=0;r<Lr.temps.length;r++)o._free(Lr.temps[r]);Lr.temps.length=0,o._free(Lr.buffer),Lr.buffer=0,Lr.size+=Lr.needed,Lr.needed=0}Lr.buffer||(Lr.size+=128,Lr.buffer=o._malloc(Lr.size),D(Lr.buffer)),Lr.pos=0},alloc:function(r,e){D(Lr.buffer);var t,n=e.BYTES_PER_ELEMENT,i=r.length*n;return i=i+7&-8,Lr.pos+i>=Lr.size?(D(i>0),Lr.needed+=i,t=o._malloc(i),Lr.temps.push(t)):(t=Lr.buffer+Lr.pos,Lr.pos+=i),t},copy:function(r,e,t){switch(t>>>=0,e.BYTES_PER_ELEMENT){case 2:t>>>=1;break;case 4:t>>>=2;break;case 8:t>>>=3}for(var n=0;n<r.length;n++)e[t+n]=r[n]}};function Ir(r){if("string"==typeof r){var e=_r(r),t=Lr.alloc(e,P);return Lr.copy(e,P,t),t}return r}function Ur(){throw"cannot construct a VoidPtr, no constructor in IDL"}function Hr(r,e){r&&"object"==typeof r&&(r=r.ptr),e&&"object"==typeof e&&(e=e.ptr),this.ptr=Er(r,e),Nr(Hr)[this.ptr]=this}return Ur.prototype=Object.create(Br.prototype),Ur.prototype.constructor=Ur,Ur.prototype.__class__=Ur,Ur.__cache__={},o.VoidPtr=Ur,Ur.prototype.__destroy__=Ur.prototype.__destroy__=function(){var r=this.ptr;gr(r)},Hr.prototype=Object.create(Br.prototype),Hr.prototype.constructor=Hr,Hr.prototype.__class__=Hr,Hr.__cache__={},o.Graphviz=Hr,Hr.prototype.version=Hr.prototype.version=function(){var r=this.ptr;return j(br(r))},Hr.prototype.lastError=Hr.prototype.lastError=function(){var r=this.ptr;return j(kr(r))},Hr.prototype.layout=Hr.prototype.layout=function(r,e,t){var n=this.ptr;return Lr.prepare(),r=r&&"object"==typeof r?r.ptr:Ir(r),e=e&&"object"==typeof e?e.ptr:Ir(e),t=t&&"object"==typeof t?t.ptr:Ir(t),j(Dr(n,r,e,t))},Hr.prototype.createFile=Hr.prototype.createFile=function(r,e){var t=this.ptr;Lr.prepare(),r=r&&"object"==typeof r?r.ptr:Ir(r),e=e&&"object"==typeof e?e.ptr:Ir(e),Sr(t,r,e)},Hr.prototype.__destroy__=Hr.prototype.__destroy__=function(){var r=this.ptr;Pr(r)},e.ready}}();r.exports=t}(a);var s=a.exports,u=Object.freeze(Object.assign(Object.create(null),a.exports,{default:s})),c=function(){return(c=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r}).apply(this,arguments)},f=function(r,e){for(var t=0,n=e.length,o=r.length;t<n;t++,o++)r[o]=e[t];return r};function l(r){return{path:r.path,data:\'<?xml version="1.0" encoding="UTF-8" standalone="no"?>\\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\\n<svg width="\'+r.width+\'" height="\'+r.height+\'"></svg>\'}}function d(r,e){var t,n=c({images:[],files:[]},e);f(f([],n.files),(t=n.images,t.map(l))).forEach(function(e){return r.createFile(e.path,e.data)})}var p={layout:function(r,e,t,n){return void 0===e&&(e="svg"),void 0===t&&(t="dot"),r?i(u,null==n?void 0:n.wasmFolder,null==n?void 0:n.wasmBinary).then(function(o){var i=new o.Graphviz(void 0!==(null==n?void 0:n.yInvert)&&(null==n?void 0:n.yInvert),void 0!==(null==n?void 0:n.nop)?null==n?void 0:n.nop:0);d(i,n);var a=i.layout(r,e,t);if(o.destroy(i),!a)throw new Error(o.Graphviz.prototype.lastError());return a}):Promise.resolve("")},circo:function(r,e,t){return void 0===e&&(e="svg"),this.layout(r,e,"circo",t)},dot:function(r,e,t){return void 0===e&&(e="svg"),this.layout(r,e,"dot",t)},fdp:function(r,e,t){return void 0===e&&(e="svg"),this.layout(r,e,"fdp",t)},sfdp:function(r,e,t){return void 0===e&&(e="svg"),this.layout(r,e,"sfdp",t)},neato:function(r,e,t){return void 0===e&&(e="svg"),this.layout(r,e,"neato",t)},osage:function(r,e,t){return void 0===e&&(e="svg"),this.layout(r,e,"osage",t)},patchwork:function(r,e,t){return void 0===e&&(e="svg"),this.layout(r,e,"patchwork",t)},twopi:function(r,e,t){return void 0===e&&(e="svg"),this.layout(r,e,"twopi",t)}},h="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function m(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(function(r,e,t){return r(t={path:e,exports:{},require:function(r,e){return m(null==e&&t.path)}},t.exports),t.exports})(function(r,e){r.exports=function(){function r(r){return"function"==typeof r}var e=Array.isArray?Array.isArray:function(r){return"[object Array]"===Object.prototype.toString.call(r)},t=0,n=void 0,o=void 0,i=function(r,e){d[t]=r,d[t+1]=e,2===(t+=2)&&(o?o(p):y())},a="undefined"!=typeof window?window:void 0,s=a||{},u=s.MutationObserver||s.WebKitMutationObserver,c="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),f="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function l(){var r=setTimeout;return function(){return r(p,1)}}var d=new Array(1e3);function p(){for(var r=0;r<t;r+=2){var e=d[r],n=d[r+1];e(n),d[r]=void 0,d[r+1]=void 0}t=0}var m,v,w,_,y=void 0;function g(r,e){var t=this,n=new this.constructor(k);void 0===n[b]&&B(n);var o=t._state;if(o){var a=arguments[o-1];i(function(){return j(o,n,a,t._result)})}else C(t,n,r,e);return n}function E(r){if(r&&"object"==typeof r&&r.constructor===this)return r;var e=new this(k);return x(e,r),e}c?y=function(){return process.nextTick(p)}:u?(v=0,w=new u(p),_=document.createTextNode(""),w.observe(_,{characterData:!0}),y=function(){_.data=v=++v%2}):f?((m=new MessageChannel).port1.onmessage=p,y=function(){return m.port2.postMessage(0)}):y=void 0===a?function(){try{var r=Function("return this")().require("vertx");return void 0!==(n=r.runOnLoop||r.runOnContext)?function(){n(p)}:l()}catch(r){return l()}}():l();var b=Math.random().toString(36).substring(2);function k(){}var D=void 0,S=1,P=2;function F(e,t,n){t.constructor===e.constructor&&n===g&&t.constructor.resolve===E?function(r,e){e._state===S?M(r,e._result):e._state===P?R(r,e._result):C(e,void 0,function(e){return x(r,e)},function(e){return R(r,e)})}(e,t):void 0===n?M(e,t):r(n)?function(r,e,t){i(function(r){var n=!1,o=function(r,e,t,n){try{r.call(e,t,n)}catch(r){return r}}(t,e,function(t){n||(n=!0,e!==t?x(r,t):M(r,t))},function(e){n||(n=!0,R(r,e))},r._label);!n&&o&&(n=!0,R(r,o))},r)}(e,t,n):M(e,t)}function x(r,e){if(r===e)R(r,new TypeError("You cannot resolve a promise with itself"));else if(o=typeof(n=e),null===n||"object"!==o&&"function"!==o)M(r,e);else{var t=void 0;try{t=e.then}catch(e){return void R(r,e)}F(r,e,t)}var n,o}function A(r){r._onerror&&r._onerror(r._result),z(r)}function M(r,e){r._state===D&&(r._result=e,r._state=S,0!==r._subscribers.length&&i(z,r))}function R(r,e){r._state===D&&(r._state=P,r._result=e,i(A,r))}function C(r,e,t,n){var o=r._subscribers,a=o.length;r._onerror=null,o[a]=e,o[a+S]=t,o[a+P]=n,0===a&&r._state&&i(z,r)}function z(r){var e=r._subscribers,t=r._state;if(0!==e.length){for(var n=void 0,o=void 0,i=r._result,a=0;a<e.length;a+=3)n=e[a],o=e[a+t],n?j(t,n,o,i):o(i);r._subscribers.length=0}}function j(e,t,n,o){var i=r(n),a=void 0,s=void 0,u=!0;if(i){try{a=n(o)}catch(r){u=!1,s=r}if(t===a)return void R(t,new TypeError("A promises callback cannot return that same promise."))}else a=o;t._state!==D||(i&&u?x(t,a):!1===u?R(t,s):e===S?M(t,a):e===P&&R(t,a))}var T=0;function B(r){r[b]=T++,r._state=void 0,r._result=void 0,r._subscribers=[]}var N=function(){function r(r,t){this._instanceConstructor=r,this.promise=new r(k),this.promise[b]||B(this.promise),e(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?M(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&M(this.promise,this._result))):R(this.promise,new Error("Array Methods must be provided an Array"))}return r.prototype._enumerate=function(r){for(var e=0;this._state===D&&e<r.length;e++)this._eachEntry(r[e],e)},r.prototype._eachEntry=function(r,e){var t=this._instanceConstructor,n=t.resolve;if(n===E){var o=void 0,i=void 0,a=!1;try{o=r.then}catch(r){a=!0,i=r}if(o===g&&r._state!==D)this._settledAt(r._state,e,r._result);else if("function"!=typeof o)this._remaining--,this._result[e]=r;else if(t===O){var s=new t(k);a?R(s,i):F(s,r,o),this._willSettleAt(s,e)}else this._willSettleAt(new t(function(e){return e(r)}),e)}else this._willSettleAt(n(r),e)},r.prototype._settledAt=function(r,e,t){var n=this.promise;n._state===D&&(this._remaining--,r===P?R(n,t):this._result[e]=t),0===this._remaining&&M(n,this._result)},r.prototype._willSettleAt=function(r,e){var t=this;C(r,void 0,function(r){return t._settledAt(S,e,r)},function(r){return t._settledAt(P,e,r)})},r}(),O=function(){function e(r){this[b]=T++,this._result=this._state=void 0,this._subscribers=[],k!==r&&("function"!=typeof r&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(r,e){try{e(function(e){x(r,e)},function(e){R(r,e)})}catch(e){R(r,e)}}(this,r):function(){throw new TypeError("Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(r){return this.then(null,r)},e.prototype.finally=function(e){var t=this.constructor;return r(e)?this.then(function(r){return t.resolve(e()).then(function(){return r})},function(r){return t.resolve(e()).then(function(){throw r})}):this.then(e,e)},e}();return O.prototype.then=g,O.all=function(r){return new N(this,r).promise},O.race=function(r){var t=this;return e(r)?new t(function(e,n){for(var o=r.length,i=0;i<o;i++)t.resolve(r[i]).then(e,n)}):new t(function(r,e){return e(new TypeError("You must pass an array to race."))})},O.resolve=E,O.reject=function(r){var e=new this(k);return R(e,r),e},O._setScheduler=function(r){o=r},O._setAsap=function(r){i=r},O._asap=i,O.polyfill=function(){var r=void 0;if(void 0!==h)r=h;else if("undefined"!=typeof self)r=self;else try{r=Function("return this")()}catch(r){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=r.Promise;if(e){var t=null;try{t=Object.prototype.toString.call(e.resolve())}catch(r){}if("[object Promise]"===t&&!e.cast)return}r.Promise=O},O.Promise=O,O}()}).polyfill();function v(r){return void 0!==r.children}var w=function(r){var e=[];return r.children.forEach(function(r){v(r)?e.push(w(r)):e.push(_(r))}),"subgraph cluster_"+r.id+\' {\\nid="\'+r.id+\'";\\nlabel="\'+r.text+\'";\\nmargin=16;\\n\'+e.join("\\n")+"\\n}"},_=function(r){return r.id+\' [id="\'+r.id+\'" label="\'+r.text+\'" width=\'+b(r.width)+" height="+b(r.height)+"]"},y=function(r,e,t,n){return r+" -> "+e+\' [id="\'+t+\'", label="\'+n+\'"]\'},g=function(r){return 96*r/72},E=function(r){return 96*r},b=function(r){return r/96};function k(r){var e=r?r.split(",").map(function(r){return g(+r)}):[0,0,0,0],t=e[0],n=e[1],o=e[2]-t,i=e[3]-n;return{x:t-o/2,y:n-i/2,width:o,height:i}}function D(r,e){var t=r.split(",").map(function(r){return g(+r)}),n=t[0],o=t[1];return{x:-n+e.width,y:-o+e.height}}function S(r,e,t){return void 0===t&&(t="json"),p[r](e,t).then(function(r){return"json"===t?JSON.parse(r):r})}function P(e,t){if(self.document=self.document||{currentScript:{src:t.wasmFolder+"/dummy.js"}},e.raw)return S(t.engine,e.raw,"svg");var n={},o=[],i=[],a={},s=[],u=[],c={},f=[],l=[];return e.items.forEach(function(r){return function r(e,t){v(e)?(n[e.id]=e,o.push(e),e.children.forEach(function(e){return r(e,!1)}),t&&i.push(w(e))):(a[e.id]=e,s.push(e),t&&u.push(_(e)))}(r,!0)}),e.links.forEach(function(r){c[r.id]=r,f.push(r),l.push(y(r.source.id,r.target.id,r.id,r.text))}),S(t.engine,"digraph G {\\n graph [fontname=Verdana,fontsize=11.0];\\n graph [rankdir=TB];\\n node [shape=rect,fontname=Verdana,fontsize=11.0,fixedsize=true];\\n edge [fontname=Verdana,fontsize=11.0];\\n\\n"+i.join("\\n")+"\\n\\n"+l.join("\\n")+"\\n\\n"+u.join("\\n")+"\\n}").then(function(e){var t=k(e.bb);return e.objects&&e.objects.forEach(function(r){if(r.nodes){var e=function(r,e){var t=k(r);return{x:-t.x+e.width,y:-t.y+e.height,width:t.width,height:t.height}}(r.bb,t),o=n[r.id];o.x=e.x-t.width/2,o.y=e.y-t.height/2,o.width=e.width,o.height=e.height}else{var i=(u=r.pos,c=r.width,f=r.height,l=D(u,t),d=E(+c),p=E(+f),{x:l.x,y:l.y,width:d,height:p}),s=a[r.id];s&&(s.x=i.x-t.width/2,s.y=i.y-t.height/2)}var u,c,f,l,d,p}),e.edges&&e.edges.forEach(function(e){var n=c[e.id];n&&(n.points=function(e,t){if(e.pos){var n=e.pos.substr(2).split(" ").map(function(r){return D(r,t)}).map(function(r){return[r.x-t.width/2,r.y-t.height/2]}),o=n.shift();return r(r([],n),[o])}return[]}(e,t))}),{clusters:o,nodes:s,links:f}})}self.onmessage=function(r){P.apply(void 0,r.data).then(function(r){self.postMessage(r)})}}();'],{type:"application/javascript"}),n=URL.createObjectURL(r),o=new Worker(n);return{terminate:function(){return o.terminate()},response:new Promise(function(r){o.onmessage=function(e){r(e.data),o.terminate(),URL.revokeObjectURL(n)},o.postMessage([e,t])})}}var Eh=E().x(function(e){return e[0]}).y(function(e){return e[1]}).curve(F),kh=function(e){function t(t,r,n){var o=e.call(this,t)||this;return o._engine=r,o._wasmFolder=n,o}return s(t,e),t.prototype.start=function(){var t=this;e.prototype.start.call(this);var r=this._graph.size(),n=this._graph.graphData(),o={};return xh({items:n.hierarchy(function(e,t,r){switch(e){case"subgraph":return{id:t.id,text:t.props.text,children:r};case"vertex":delete t.fx,delete t.fy;var n=t.element.node().getBBox(),i={id:t.id,text:t.props.text,width:n.width,height:n.height};return o[i.id]=i,i}}),links:n.allEdges().map(function(e){return{id:e.props.id,source:o[e.source.id],target:o[e.target.id],text:e.props.label||""}}),raw:""},{engine:this._engine,wasmFolder:this._wasmFolder}).response.then(function(e){return t.running()&&(e.clusters.forEach(function(e){var t=n.subgraph(e.id);t.x=e.x+r.width/2-e.width,t.y=e.y+r.height/2-e.height,t.props.width=e.width,t.props.height=e.height}),e.nodes.forEach(function(e){var t=n.vertex(e.id);t.x=e.x+r.width/2,t.y=e.y+r.height/2}),e.links.forEach(function(e){var t=n.edge(e.id);t.points=h(h([[t.source.x,t.source.y]],void 0!==e.points?e.points.map(function(e){return[e[0]+r.width/2,e[1]+r.height/2]}):[]),[[t.target.x,t.target.y]])}),t._graph.moveSubgraphs(!0).moveVertices(!0).moveEdges(!0),t.stop()),t})},t.prototype.edgePath=function(t,r){var n=this,o=[],i=!1;return t.points&&(o=t.points.map(function(e){var t=n._graph.project(e[0],!1),r=n._graph.project(e[1],!1);return(isNaN(t)||isNaN(r))&&(i=!0),[t,r]})),i||o.length<2?e.prototype.edgePath.call(this,t,r):{path:Eh(o),labelPos:this.center(o)}},t}(fh),Dh=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then(function(){return t.stop(),t})},t}(fh);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then(function(){var e=t._graph.size(),r=t._graph.graphData();return r.allEdges().forEach(function(e){return delete e.points}),r.allVertices().forEach(function(t){delete t.fx,delete t.fy,t.x=e.width/2+5*Math.random()-2.5,t.y=e.height/2+5*Math.random()-2.5}),t._graph.moveVertices(!0).moveEdges(!0),t.stop(),t})}}(fh);function Sh(e,t){return e.parent===t.parent?1:2}function Ch(e,t){return e+t.x}function Ah(e,t){return Math.max(e,t.y)}function jh(){var e=Sh,t=1,r=1,n=!1;function o(o){var i,a=0;o.eachAfter(function(t){var r=t.children;r?(t.x=function(e){return e.reduce(Ch,0)/e.length}(r),t.y=function(e){return 1+e.reduce(Ah,0)}(r)):(t.x=i?a+=e(t,i):0,t.y=0,i=t)});var s=function(e){for(var t;t=e.children;)e=t[0];return e}(o),u=function(e){for(var t;t=e.children;)e=t[t.length-1];return e}(o),c=s.x-e(s,u)/2,l=u.x+e(u,s)/2;return o.eachAfter(n?function(e){e.x=(e.x-o.x)*t,e.y=(o.y-e.y)*r}:function(e){e.x=(e.x-c)/(l-c)*t,e.y=(1-(o.y?e.y/o.y:1))*r})}return o.separation=function(t){return arguments.length?(e=t,o):e},o.size=function(e){return arguments.length?(n=!1,t=+e[0],r=+e[1],o):n?null:[t,r]},o.nodeSize=function(e){return arguments.length?(n=!0,t=+e[0],r=+e[1],o):n?[t,r]:null},o}function Ph(e){var t=0,r=e.children,n=r&&r.length;if(n)for(;--n>=0;)t+=r[n].value;else t=1;e.value=t}function Fh(e,t){var r,n,o,i,a,s=new Ih(e),u=+e.value&&(s.value=e.value),c=[s];for(null==t&&(t=Mh);r=c.pop();)if(u&&(r.value=+r.data.value),(o=t(r.data))&&(a=o.length))for(r.children=new Array(a),i=a-1;i>=0;--i)c.push(n=r.children[i]=new Ih(o[i])),n.parent=r,n.depth=r.depth+1;return s.eachBefore(Nh)}function Mh(e){return e.children}function Oh(e){e.data=e.data.data}function Nh(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Ih(e){this.data=e,this.depth=this.height=0,this.parent=null}function Th(e,t){return e.parent===t.parent?1:2}function Lh(e){var t=e.children;return t?t[0]:e.t}function Qh(e){var t=e.children;return t?t[t.length-1]:e.t}function Rh(e,t,r){var n=r/(t.i-e.i);t.c-=n,t.s+=r,e.c+=n,t.z+=r,t.m+=r}function Bh(e,t,r){return e.a.parent===t.parent?e.a:r}function zh(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}function Vh(){var e=Th,t=1,r=1,n=null;function o(o){var u=function(e){for(var t,r,n,o,i,a=new zh(e,0),s=[a];t=s.pop();)if(n=t._.children)for(t.children=new Array(i=n.length),o=i-1;o>=0;--o)s.push(r=t.children[o]=new zh(n[o],o)),r.parent=t;return(a.parent=new zh(null,0)).children=[a],a}(o);if(u.eachAfter(i),u.parent.m=-u.z,u.eachBefore(a),n)o.eachBefore(s);else{var c=o,l=o,h=o;o.eachBefore(function(e){e.x<c.x&&(c=e),e.x>l.x&&(l=e),e.depth>h.depth&&(h=e)});var f=c===l?1:e(c,l)/2,d=f-c.x,p=t/(l.x+f+d),g=r/(h.depth||1);o.eachBefore(function(e){e.x=(e.x+d)*p,e.y=e.depth*g})}return o}function i(t){var r=t.children,n=t.parent.children,o=t.i?n[t.i-1]:null;if(r){!function(e){for(var t,r=0,n=0,o=e.children,i=o.length;--i>=0;)(t=o[i]).z+=r,t.m+=r,r+=t.s+(n+=t.c)}(t);var i=(r[0].z+r[r.length-1].z)/2;o?(t.z=o.z+e(t._,o._),t.m=t.z-i):t.z=i}else o&&(t.z=o.z+e(t._,o._));t.parent.A=function(t,r,n){if(r){for(var o,i=t,a=t,s=r,u=i.parent.children[0],c=i.m,l=a.m,h=s.m,f=u.m;s=Qh(s),i=Lh(i),s&&i;)u=Lh(u),(a=Qh(a)).a=t,(o=s.z+h-i.z-c+e(s._,i._))>0&&(Rh(Bh(s,t,n),t,o),c+=o,l+=o),h+=s.m,c+=i.m,f+=u.m,l+=a.m;s&&!Qh(a)&&(a.t=s,a.m+=h-l),i&&!Lh(u)&&(u.t=i,u.m+=c-f,n=t)}return n}(t,o,t.parent.A||n[0])}function a(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function s(e){e.x*=t,e.y=e.depth*r}return o.separation=function(t){return arguments.length?(e=t,o):e},o.size=function(e){return arguments.length?(n=!1,t=+e[0],r=+e[1],o):n?null:[t,r]},o.nodeSize=function(e){return arguments.length?(n=!0,t=+e[0],r=+e[1],o):n?[t,r]:null},o}Ih.prototype=Fh.prototype={constructor:Ih,count:function(){return this.eachAfter(Ph)},each:function(e){var t,r,n,o,i=this,a=[i];do{for(t=a.reverse(),a=[];i=t.pop();)if(e(i),r=i.children)for(n=0,o=r.length;n<o;++n)a.push(r[n])}while(a.length);return this},eachAfter:function(e){for(var t,r,n,o=this,i=[o],a=[];o=i.pop();)if(a.push(o),t=o.children)for(r=0,n=t.length;r<n;++r)i.push(t[r]);for(;o=a.pop();)e(o);return this},eachBefore:function(e){for(var t,r,n=this,o=[n];n=o.pop();)if(e(n),t=n.children)for(r=t.length-1;r>=0;--r)o.push(t[r]);return this},sum:function(e){return this.eachAfter(function(t){for(var r=+e(t.data)||0,n=t.children,o=n&&n.length;--o>=0;)r+=n[o].value;t.value=r})},sort:function(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})},path:function(e){for(var t=this,r=function(e,t){if(e===t)return e;var r=e.ancestors(),n=t.ancestors(),o=null;for(e=r.pop(),t=n.pop();e===t;)o=e,e=r.pop(),t=n.pop();return o}(t,e),n=[t];t!==r;)t=t.parent,n.push(t);for(var o=n.length;e!==r;)n.splice(o,0,e),e=e.parent;return n},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){var e=[];return this.each(function(t){e.push(t)}),e},leaves:function(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e},links:function(){var e=this,t=[];return e.each(function(r){r!==e&&t.push({source:r.parent,target:r})}),t},copy:function(){return Fh(this).eachBefore(Oh)}},zh.prototype=Object.create(Ih.prototype);var Gh=A().x(function(e){return e.x}).y(function(e){return e.y}),Hh=function(){function e(e,t,r,n){void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=e),void 0===n&&(n=t),this.x1=e,this.y1=t,this.x2=r,this.y2=n}return Object.defineProperty(e.prototype,"x",{get:function(){return this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.x2-this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.y2-this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"center",{get:function(){return{x:this.x1+this.width/2,y:this.y1+this.height/2}},enumerable:!1,configurable:!0}),e.prototype.reset=function(e,t){this.x1=e,this.x2=e,this.y1=t,this.y2=t},e.prototype.expand=function(e,t){this.x1>e?this.x1=e:this.x2<e&&(this.x2=e),this.y1>t?this.y1=t:this.y2<t&&(this.y2=t)},e}(),Uh=function(e){function t(t,r){var n=e.call(this,t)||this;return n.options=r,n._visited={},n}return s(t,e),t.prototype.sortTree=function(e,t){var r=this;t||(t=this._tree),t.children.sort(function(t,r){return e.neighbors(r.origData.id).length-e.neighbors(t.origData.id).length});var n=[];t.children.forEach(function(e,t){t%2==0?n.push(e):n.unshift(e)}),t.children=n,t.children.forEach(function(t){return r.sortTree(e,t)})},t.prototype.depthFirst=function(e,t,r){var n=this;if(void 0===r&&(this._visited={},this._tree=void 0),!this._visited[t.id]){this._visited[t.id]=t;var o={origData:t,children:[]};void 0===r?this._tree=o:r.children.push(o),e.neighbors(t.id).forEach(function(t){return n.depthFirst(e,t,o)})}},t.prototype.breadthFirst=function(e,t){var r=this;this._visited={},this._visited[t.id]=t,this._tree={origData:t,children:[]};var n=[];n.push(this._tree);for(var o=function(){var t=n.shift();e.neighbors(t.origData.id).forEach(function(e){if(!r._visited[e.id]){r._visited[e.id]=e;var o={origData:e,children:[]};t.children.push(o),n.push(o)}})};n.length;)o();this.sortTree(e)},t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then(function(){for(var e,r=t._graph.graphData(),n=0,o=r.allVertices();n<o.length;n++){var i=o[n];if(delete i.fx,delete i.fy,void 0===e&&(e=i),i.centroid){e=i;break}}return r.allEdges().forEach(function(e){return delete e.points}),t.breadthFirst(r,e),t._d3Hierarchy=Fh(t._tree),t})},t.prototype.finalize=function(e){var t=this._graph.size(),r=new Hh;e.forEach(function(e,t){0===t?r.reset(e.origData.x,e.origData.y):r.expand(e.origData.x,e.origData.y)});var n=t.width/2-r.center.x,o=t.height/2-r.center.y;e.forEach(function(e){e.origData.x+=n,e.origData.y+=o}),this._graph.moveVertices(!0).moveEdges(!0),this.stop()},t}(fh),Wh=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.options=r,n}return s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then(function(){var e=Vh().nodeSize(["TB"===t.options.rankdir?200:100,"TB"===t.options.rankdir?100:200])(t._d3Hierarchy).descendants().map(function(e){return e.data.origData.x="TB"===t.options.rankdir?e.x:e.y,e.data.origData.y="TB"===t.options.rankdir?e.y:e.x,e.data});return t.finalize(e),t})},t.prototype.edgePath=function(e,t){var r=this._graph.projectPlacholder(e.source),n=this._graph.projectPlacholder(e.target);return{path:Gh({source:r,target:n}),labelPos:this.center([[r.x,r.y],[n.x,n.y]])}},t}(Uh),qh=function(e){function t(t){return e.call(this,t,{})||this}return s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then(function(){var e=Vh().size([2*Math.PI,512]).separation(function(e,t){return(e.parent==t.parent?1:2)/e.depth})(t._d3Hierarchy).descendants().map(function(e){return e.data.origData.angle=e.x,e.data.origData.radius=e.y,e.data.origData.x=Math.sin(e.x)*e.y,e.data.origData.y=Math.cos(e.x)*e.y,e.data});return t.finalize(e),t})},t}(Uh),Yh=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.options=r,n}return s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then(function(){var e=jh().nodeSize(["TB"===t.options.rankdir?200:100,"TB"===t.options.rankdir?100:200])(t._d3Hierarchy).descendants().map(function(e){return e.data.origData.x="TB"===t.options.rankdir?e.x:e.y,e.data.origData.y="TB"===t.options.rankdir?e.y:e.x,e.data});return t.finalize(e),t})},t.prototype.edgePath=function(e,t){var r=this._graph.projectPlacholder(e.source),n=this._graph.projectPlacholder(e.target);return{path:Gh({source:r,target:n}),labelPos:this.center([[r.x,r.y],[n.x,n.y]])}},t}(Uh),$h=function(e){function t(t){return e.call(this,t,{})||this}return s(t,e),t.prototype.start=function(){var t=this;return e.prototype.start.call(this).then(function(){var e=jh().size([2*Math.PI,512]).separation(function(e,t){return(e.parent==t.parent?1:2)/e.depth})(t._d3Hierarchy).descendants().map(function(e){return e.data.origData.x=Math.sin(e.x)*e.y,e.data.origData.y=Math.cos(e.x)*e.y,e.data});return t.finalize(e),t})},t}(Uh);L(".graph_Graph2 .allowDragging .graphVertex,.graph_Graph2 .graphVertex{cursor:pointer}.graph_Graph2 .allowDragging .graphVertex.grabbed{cursor:grabbing}.graph_Graph2 .graphEdge{stroke:#a9a9a9;fill:none}.graph_Graph2 .graphEdge>text{stroke:none;fill:#000}.graph_Graph2 .graphEdge.hide-text>text{display:none}.graph_Graph2 g.selected circle,.graph_Graph2 g.selected rect{stroke:red!important}");var Xh=(r.getScriptSrc("/graph/lib-umd/graph2/graph")||r.getScriptSrc("/graph/dist/index")||".")+"/graph/dist",Jh=function(e){e.fx=e.sx=e.x,e.fy=e.sy=e.y},Kh=function(e,t){e.fx=e.sx+t.fx-t.sx,e.fy=e.sy+t.fy-t.sy},Zh=function(e){e.x=e.fx,e.y=e.fy,e.fx=e.sx=void 0,e.fy=e.sy=void 0},ef=function(e){function n(){var n=e.call(this)||this;n._toggleHierarchy=(new t.ToggleButton).faChar("fa-sitemap").tooltip("Hierarchy").on("click",function(){return n.layoutClick("Hierarchy")}),n._toggleForceDirected=(new t.ToggleButton).faChar("fa-expand").tooltip("Force Directed").on("click",function(){return n.layoutClick("ForceDirected")}),n._toggleForceDirected2=(new t.ToggleButton).faChar("fa-arrows").tooltip("Spring").on("click",function(){return n.layoutClick("ForceDirected2")}),n._toggleCircle=(new t.ToggleButton).faChar("fa-circle-o").tooltip("Circle").on("click",function(){return n.layoutClick("Circle")}),n._toggleDot=(new t.ToggleButton).faChar("fa-angle-double-down").tooltip("DOT").on("click",function(){return n.layoutClick("DOT")}),n._toggleNeato=(new t.ToggleButton).faChar("fa-sun-o").tooltip("Neato").on("click",function(){return n.layoutClick("Neato")}),n._toggleFDP=(new t.ToggleButton).faChar("fa-asterisk").tooltip("FDP").on("click",function(){return n.layoutClick("FDP")}),n._toggleTwoPI=(new t.ToggleButton).faChar("fa-bullseye").tooltip("TwoPI").on("click",function(){return n.layoutClick("TwoPI")}),n._toggleCirco=(new t.ToggleButton).faChar("fa-cogs").tooltip("Circo").on("click",function(){return n.layoutClick("Circo")}),n._toggleT=(new t.ToggleButton).faChar("fa-sitemap fa-rotate-270").tooltip("Tree").on("click",function(){return n.layoutClick("Tree")}),n._toggleRT=(new t.ToggleButton).faChar("fa-sun-o").tooltip("Radial Tree").on("click",function(){return n.layoutClick("RadialTree")}),n._toggleD=(new t.ToggleButton).faChar("fa-sitemap fa-rotate-270").tooltip("Dendrogram").on("click",function(){return n.layoutClick("Dendrogram")}),n._toggleRD=(new t.ToggleButton).faChar("fa-asterisk").tooltip("Radial Dendrogram").on("click",function(){return n.layoutClick("RadialDendrogram")}),n._graphData=(new r.Graph2).idFunc(function(e){return e.id}).sourceFunc(function(e){return e.source.id}).targetFunc(function(e){return e.target.id}).updateFunc(function(e,t){return e.props=t.props,e}),n._prevDoClickTime=0,n._tooltip=new i.HTMLTooltip,n._selection=new t.Utility.Selection(n),n._dragHandler=t.drag(),n._catPalette=t.Palette.ordinal("hpcc10"),n._categories=[],n._annotations=[],n._origData={subgraphs:[],vertices:[],edges:[],hierarchy:[]},n._layoutAlgo=new Dh(n),n.highlight={zoom:1.1,opacity:.33,edge:"1.25px"},n._centroidRenderer=o.Vertex,n._vertexRenderer=o.Vertex,n._transformScale=1;var a=n;n._drawStartPos="origin";var s=[n._toggleHierarchy,n._toggleForceDirected,n._toggleForceDirected2,n._toggleCircle,new t.Spacer,n._toggleDot,n._toggleNeato,n._toggleFDP,n._toggleTwoPI,n._toggleCirco,new t.Spacer,n._toggleT,n._toggleRT,n._toggleD,n._toggleRD,new t.Spacer];return n._iconBar.buttons(s.concat(n._iconBar.buttons())),n._dragHandler.on("start",function(e){if(a.allowDragging()){t.select(this).classed("grabbed",!0),Jh(e),t.Utility.safeRaise(this),a.moveVertexPlaceholder(e,!1,!0);var r=a.selection();a.selected(e.props,r)?r.filter(function(t){return t.id!==e.props.id}).forEach(function(e){var t=a._graphData.vertex(e.id);Jh(t)}):a.dragSingleNeighbors()&&a._graphData.singleNeighbors(e.id).forEach(function(e){Jh(e)})}}).on("drag",function(e){if(a.allowDragging()){e.fx=e.sx+a.rproject(t.d3Event().x-e.sx),e.fy=e.sy+a.rproject(t.d3Event().y-e.sy),a._graphData.vertexEdges(e.id).forEach(function(e){return delete e.points}),a.moveVertexPlaceholder(e,!1,!0);var r=a.selection();a.selected(e.props,r)?r.filter(function(t){return t.id!==e.props.id}).forEach(function(t){var r=a._graphData.vertex(t.id);Kh(r,e),a.moveVertexPlaceholder(r,!1,!0)}):a.dragSingleNeighbors()&&a._graphData.singleNeighbors(e.id).forEach(function(t){Kh(t,e),a.moveVertexPlaceholder(t,!1,!0)})}}).on("end",function(e){var r=!0;if(a.allowDragging()){r=Math.abs(e.sx-e.fx)<1&&Math.abs(e.sy-e.fy)<1,Zh(e);var n=a.selection();a.selected(e.props,n)?n.filter(function(t){return t.id!==e.props.id}).forEach(function(e){var t=a._graphData.vertex(e.id);Zh(t)}):a.dragSingleNeighbors()&&a._graphData.singleNeighbors(e.id).forEach(Zh),t.select(this).classed("grabbed",!1)}if(r){a._selection.click({_id:e.id,element:function(){return e.element}},t.d3Event().sourceEvent),a.selectionChanged();var o=e.element.classed("selected");a.vertex_click(e.props.origData||e.props,"",o);var i=Date.now();i-a._prevDoClickTime<a.doubleClickMaxDelay()&&a.vertex_dblclick(e.props.origData||e.props,"",o),a._prevDoClickTime=i}}).filter(function(){return!0}),n.zoomToFitLimit(1),n}return s(n,e),n.prototype.iconBarButtons=function(){return this._iconBar.buttons()},n.prototype.categories=function(e){return void 0===e?this._categories:(this._categories=e,this)},n.prototype.annotations=function(e){return void 0===e?this._annotations:(this._annotations=e,this)},n.prototype.data=function(e,t){var r=this;return void 0===e?this._origData:(this._origData=e,this._graphData.mergeSubgraphs((e.subgraphs||[]).map(function(e){return{id:e.id,props:e}})),this._graphData.mergeVertices((e.vertices||[]).map(function(e){return{id:e.id,centroid:e.centroid,props:e}})),this._graphData.mergeEdges((e.edges||[]).filter(function(e){return r._graphData.vertexExists(e.source.id)&&r._graphData.vertexExists(e.target.id)}).map(function(e){return{id:e.id,props:e,source:r._graphData.vertex(e.source.id),target:r._graphData.vertex(e.target.id)}})),this._graphData.clearParents(),(e.hierarchy?e.hierarchy:[]).forEach(function(e){r._graphData.subgraphExists(e.child.id)?r._graphData.subgraphParent(e.child.id,e.parent.id):r._graphData.vertexExists(e.child.id)&&r._graphData.vertexParent(e.child.id,e.parent.id)}),this)},n.prototype.selected=function(e,t){return(t||this.selection()).some(function(t){return t.id===e.id})},n.prototype.selection=function(e){var t=this;return arguments.length?(this._selection.set(e.map(function(e){var r=t._graphData.item(e.id);return{_id:r.id,element:function(){return r.element}}})),this):this._selection.get().map(function(e){return t._graphData.item(e._id).props})},n.prototype.graphData=function(){return this._graphData},n.prototype.resetLayout=function(){return delete this._prevLayout,this},n.prototype.layoutRunning=function(){return this._layoutAlgo&&this._layoutAlgo.running()},n.prototype.layoutAlgo=function(e){var t=this;return this._layoutAlgo&&this._layoutAlgo.stop(),this._layoutAlgo=e,this._layoutAlgo.start().then(function(){t.updateIconBar(),t.applyScaleOnLayout()&&setTimeout(function(){t.zoomToFit()},t.transitionDuration())})},n.prototype.layoutClick=function(e){this.layoutRunning()?(this._layoutAlgo.stop(),this.updateIconBar()):(delete this._prevLayout,this.layout(e).render())},n.prototype.updateIconBarItem=function(e,t){var r=this.layout(),n=this._layoutAlgo&&this._layoutAlgo.running();e.enabled(!n||r===t).selected(n&&r===t).render()},n.prototype.updateIconBar=function(){e.prototype.updateIconBar.call(this),this.updateIconBarItem(this._toggleHierarchy,"Hierarchy"),this.updateIconBarItem(this._toggleDot,"DOT"),this.updateIconBarItem(this._toggleForceDirected,"ForceDirected"),this.updateIconBarItem(this._toggleNeato,"Neato"),this.updateIconBarItem(this._toggleFDP,"FDP"),this.updateIconBarItem(this._toggleForceDirected2,"ForceDirected2"),this.updateIconBarItem(this._toggleCircle,"Circle"),this.updateIconBarItem(this._toggleTwoPI,"TwoPI"),this.updateIconBarItem(this._toggleCirco,"Circo"),this.updateIconBarItem(this._toggleT,"Tree"),this.updateIconBarItem(this._toggleRT,"RadialTree"),this.updateIconBarItem(this._toggleD,"Dendrogram"),this.updateIconBarItem(this._toggleRD,"RadialDendrogram")},n.prototype.getNeighborMap=function(e){var t={},r={};if(e)for(var n=this._graphData.vertexEdges(e.id),o=0;o<n.length;++o){var i=this._graphData.edge(n[o].id);r[i.id]=i,i.source.id!==e.id&&(t[i.source.id]=i.source),i.target.id!==e.id&&(t[i.target.id]=i.target)}return{vertices:t,edges:r}},n.prototype.centerOnItem=function(e){var t,r,n,o=this._graphData.item(e);if((this._graphData.isSubgraph(o)||this._graphData.isVertex(o))&&(r=o.x,n=o.y),this._graphData.isEdge(o)&&(r=(t=[0,0])[0],n=t[1]),void 0!==r&&void 0!==n){var i=o.element.node().getBBox();if(this._graphData.isVertex(o)){var a=this.projectPlacholder(o);r=a.x,n=a.y}else this._graphData.isSubgraph(o)&&(r=this.project(o.x),n=this.project(o.y));var s=i.x+i.width/2,u=i.y+i.height/2,c={x:r+s-i.width/2,y:n+u-i.height/2,width:i.width,height:i.height};this.centerOnBBox(c)}},n.prototype.hideVertex=function(e){var t=this._graphData.item(e);return this._graphData.isVertex(t)&&(t.props.hidden=!0),this},n.prototype.showVertex=function(e){var t=this._graphData.item(e);return this._graphData.isVertex(t)&&(t.props.hidden=!1),this},n.prototype.highlightVerticies=function(e){var t=this,r=this,n=this._vertexG.selectAll(".graphVertex"),i=!r.showVertexLabels()&&r.showVertexLabelsOnHighlight();return n.classed("graphVertex-highlighted",function(t){return!e||e[t.id]}).style("filter",function(r){return e&&e[r.id]?"url(#"+t.id()+"_glow)":null}).each(function(t){if(i){var n=r.calcProps(t.centroid,u({showLabel:!(!e||!e[t.id])},r.vertexMapper(t.props,t.props.origData)));o.render(t.centroid?r._centroidRenderer:r._vertexRenderer,n,this)}}).transition().duration(this.transitionDuration()).on("end",function(t){e&&e[t.id]&&t.element.node()&&t.element.node().parentNode&&t.element.node().parentNode.appendChild(t.element.node())}).style("opacity",function(t){return t.props.hidden?0:!e||e[t.id]?1:r.highlight.opacity}),this},n.prototype.highlightEdges=function(e){var t=this;return this._edgeG.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:t.edgeStrokeWidth()+"px"}).transition().duration(this.transitionDuration()).style("opacity",function(r){return r.source.props.hidden||r.target.props.hidden?0:!e||e[r.id]?1:t.highlight.opacity}),this},n.prototype.highlightVertex=function(e,t){if(this.highlightOnMouseOverVertex())if(t){var r=this.getNeighborMap(t);r.vertices[t.id]=t,this.highlightVerticies(r.vertices),this.highlightEdges(r.edges)}else this.highlightVerticies(null),this.highlightEdges(null)},n.prototype.highlightEdge=function(e,t){if(this.highlightOnMouseOverEdge())if(t){var r={};r[t.source.id]=t.source,r[t.target.id]=t.target;var n={};n[t.id]=t,this.highlightVerticies(r),this.highlightEdges(n)}else this.highlightVerticies(null),this.highlightEdges(null)},n.prototype.moveSubgraphPlaceholder=function(e,t){var r=this.project(e.x),n=this.project(e.y),i=this.project(e.props.width,!0),a=this.project(e.props.height,!0);return e.element&&(t?e.element.transition():e.element).attr("transform","translate("+r+" "+n+")").each(function(e){o.render(o.Subgraph,u(u({},e.props),{width:i,height:a}),this)}),this},n.prototype.moveEdgePlaceholder=function(e,t){var r,n,o=this._layoutAlgo.edgePath(e,this.edgeArcDepth());if(e.elementPath&&(t?e.elementPath.transition():e.elementPath).attr("d",o.path).attr("stroke-dasharray",function(e){return e.props.strokeDasharray}),e.elementText){var i=null!==(n=null===(r=e.props.label)||void 0===r?void 0:r.split("\n"))&&void 0!==n?n:[];e.elementText.selectAll(".textLine").data(i,function(e){return e}).join(function(e){return e.append("tspan").attr("class","textLine").attr("x",0)},function(e){return e.attr("dy",function(e,t){return t+"em"}).text(function(e){return e})},function(e){return e.remove()}),(t?e.elementText.transition():e.elementText).attr("transform","translate("+o.labelPos[0]+" "+o.labelPos[1]+")").attr("font-family",function(e){return e.props.fontFamily||null})}return this},n.prototype.moveVertexPlaceholder=function(e,t,r){var n=this,o=this.projectPlacholder(e),i=o.x,a=o.y;return e.element&&(t?e.element.transition():e.element).attr("transform","translate("+i+" "+a+")"),r&&this._graphData.vertexEdges(e.id).forEach(function(e){return n.moveEdgePlaceholder(e,t)}),this},n.prototype.moveSubgraphs=function(e){var t=this;return this._graphData.allSubgraphs().forEach(function(r){return t.moveSubgraphPlaceholder(r,e)}),this},n.prototype.moveEdges=function(e){var t=this;return this._graphData.allEdges().forEach(function(r){return t.moveEdgePlaceholder(r,e)}),this},n.prototype.moveVertices=function(e){var t=this;return this._graphData.allVertices().forEach(function(r){return t.moveVertexPlaceholder(r,e,!1)}),this},n.prototype.project=function(e,t){void 0===t&&(t=!1);e=void 0!==e?e:0;var r=this._transformScale;return t&&(this._transformScale>this.maxScale()+(this._transformScale-this.maxScale())/2?r=this.maxScale()+(this._transformScale-this.maxScale())/2:(this._transformScale,this.minScale(),this._transformScale,this.minScale())),Math.round(e*r*10)/10},n.prototype.rproject=function(e){return e=void 0!==e?e:0,Math.round(e/this._transformScale*10)/10},n.prototype.projectPlacholder=function(e){return{x:this.project(void 0!==e.fx?e.fx:e.x),y:this.project(void 0!==e.fy?e.fy:e.y)}},n.prototype.categoryID=function(e,t){return void 0===t&&(t="cat"),void 0===e||""===e?"":""+t+this.id()+"_"+e},n.prototype.updateCategories=function(){var e=this;o.render(o.Icons,{icons:this._categories.map(function(t){return u(u({},t),{id:e.categoryID(t.id),fill:t.fill||"transparent",imageCharFill:t.imageCharFill||e._catPalette(t.id)})})},this._svgDefsCat.node())},n.prototype.updateAnnotations=function(){var e=this;o.render(o.Icons,{icons:this._annotations.map(function(t){return u(u({},t),{id:e.categoryID(t.id,"ann"),shape:t.shape||"square",height:t.height||12,fill:t.fill||e._catPalette(t.id)})})},this._svgDefsAnn.node())},n.prototype.updateEdges=function(){var e=this,r=this;return this._edgeG.selectAll(".graphEdge").data(this._graphData.allEdges(),function(e){return e.id}).join(function(e){return e.append("g").attr("class","graphEdge").on("click.selectionBag",function(e){r._selection.click({_id:e.id,element:function(){return e.element}},t.d3Event()),r.selectionChanged()}).on("click",function(e){var t=e.element.classed("selected");r.edge_click(e.props.origData||e.props,"",t)}).on("mouseover",function(e){t.Utility.safeRaise(this),r.edge_mouseover(t.select(this),e)}).on("mouseout",function(e){r.edge_mouseout(t.select(this),e)}).each(function(e){e.element=t.select(this),e.elementPath=e.element.append("path"),e.elementText=e.element.append("text").attr("text-anchor","middle")})},function(e){return e.attr("opacity",function(e){return e.source.props.hidden||e.target.props.hidden?0:1}).classed("hide-text",!r.showEdgeLabels())},function(e){return e.each(function(e){delete e.element}).remove()}).style("stroke",function(t){var r,n;return null!==(n=null===(r=t.props)||void 0===r?void 0:r.color)&&void 0!==n?n:e.edgeColor()}).style("stroke-width",this.edgeStrokeWidth()+"px"),this},n.prototype.centroidRenderer=function(e){return arguments.length?(this._centroidRenderer=e,this):this._centroidRenderer},n.prototype.vertexRenderer=function(e){return arguments.length?(this._vertexRenderer=e,this):this._vertexRenderer},n.prototype.vertexMapper=function(e,t){var r=this;return u(u({},e),{categoryID:this.categoryID(e.categoryID),annotationIDs:e.annotationIDs?e.annotationIDs.map(function(e){return r.categoryID(e,"ann")}):[]})},n.prototype.updateVertices=function(){var e=this,r=this;return this._vertexG.selectAll(".graphVertex").data(this._graphData.allVertices(),function(e){return e.id}).join(function(n){return n.append("g").attr("class","graphVertex").on("dblclick",function(e){t.d3Event().stopPropagation()}).on("mousein",function(e){t.Utility.safeRaise(this),r.highlightVertex(t.select(this),e);var n=e.element.classed("selected");r.vertex_mousein(e.props.origData||e.props,"",n)}).on("mouseover",function(e){t.Utility.safeRaise(this),r.highlightVertex(t.select(this),e);var n=e.element.classed("selected");e.props.tooltip&&r._tooltip.tooltipHTML(r.tooltipHTML.bind(r)).triggerElement(e.element).tooltipWidth(r.tooltipWidth()).tooltipHeight(r.tooltipHeight()).enablePointerEvents(r.enableTooltipPointerEvents()).closeDelay(r.tooltipCloseDelay()).direction("n").data(e).visible(!0).render(),r.vertex_mouseover(e.props.origData||e.props,"",n)}).on("mouseout",function(e){r.highlightVertex(null,null);var t=e.element.classed("selected");r.vertex_mouseout(e.props.origData||e.props,"",t),e.props.tooltip&&r._tooltip.mouseout()}).call(e._dragHandler).each(function(e){e.element=t.select(this)})},function(e){return e},function(e){return e.each(function(e){delete e.element}).remove()}).classed("centroid",function(e){return e.centroid}).attr("opacity",function(e){return e.props.hidden?0:1}).attr("filter",function(t){return t.centroid?"url(#"+e.id()+"_glow)":null}).each(function(e){var t=r.calcProps(e.centroid,u({showLabel:r.showVertexLabels()},r.vertexMapper(e.props,e.props.origData)));o.render(e.centroid?r._centroidRenderer:r._vertexRenderer,t,this)}),this},n.prototype.calcProps=function(e,t){t.icon||(t.icon={}),e?(t.textHeight=t.textHeight?t.textHeight:this.centroidTextHeight()*this.centroidScale(),t.textPadding=t.textPadding?t.textPadding:this.centroidTextPadding()*this.centroidScale(),t.textFontFamily=t.textFontFamily?t.textFontFamily:this.centroidLabelFontFamily(),t.icon.height=t.icon.height?t.icon.height:this.centroidIconHeight()*this.centroidScale(),t.icon.padding=t.icon.padding?t.icon.padding:this.centroidIconPadding()*this.centroidScale(),t.icon.strokeWidth=t.icon.strokeWidth?t.icon.strokeWidth:this.centroidIconStrokeWidth(),t.icon.imageFontFamily=t.icon.imageFontFamily?t.icon.imageFontFamily:this.centroidIconFontFamily()):(t.textHeight=t.textHeight?t.textHeight:this.vertexTextHeight(),t.textPadding=t.textPadding?t.textPadding:this.vertexTextPadding(),t.textFontFamily=t.textFontFamily?t.textFontFamily:this.vertexLabelFontFamily(),t.icon.height=t.icon.height?t.icon.height:this.vertexIconHeight(),t.icon.padding=t.icon.padding?t.icon.padding:this.vertexIconPadding(),t.icon.strokeWidth=t.icon.strokeWidth?t.icon.strokeWidth:this.vertexIconStrokeWidth(),t.icon.imageFontFamily=t.icon.imageFontFamily?t.icon.imageFontFamily:this.vertexIconFontFamily());var r=t.icon.imageChar,n=t.icon.imageFontFamily,o=t.icon.height-t.icon.padding,i=this.textRect(r,n,o);return t.icon.yOffset=-(i.top-o/2)-i.height/2+(t.icon.padding>0?o/t.icon.padding/2:0),t},n.prototype.hasSubgraphs=function(){switch(this.layout()){case"DOT":case"Hierarchy":return!0}return!1},n.prototype.updateSubgraphs=function(){var e=this;return this._subgraphG.selectAll(".subgraphPlaceholder").data(this.hasSubgraphs()?this._graphData.allSubgraphs():[],function(e){return e.id}).join(function(r){return r.append("g").attr("class","subgraphPlaceholder").on("click.selectionBag",function(r){e._selection.click({_id:r.id,element:function(){return r.element}},t.d3Event()),e.selectionChanged()}).on("click",function(t){var r=t.element.classed("selected");e.subgraph_click(t.props.origData||t.props,"",r)}).on("mouseover",function(){t.Utility.safeRaise(this)}).each(function(e){e.element=t.select(this)})},function(e){return e},function(e){return e.each(function(e){delete e.element}).transition().style("opacity",0).remove()}).each(function(t){e.moveSubgraphPlaceholder(t,!1)}),this},n.prototype.enter=function(r,n){var o=this;e.prototype.enter.call(this,r,n);var i=this.locateSVGNode(r);this._svgDefs=t.select(i).select("defs"),this._centroidFilter=new t.SVGGlowFilter(this._svgDefs,this._id+"_glow"),this._svgDefsCat=this._svgDefs.append("g"),this._svgDefsAnn=this._svgDefs.append("g"),this._subgraphG=this._renderElement.append("g"),this._edgeG=this._renderElement.append("g"),this._vertexG=this._renderElement.append("g"),this._tooltip.target(r),this.on("startMarqueeSelection",function(){}).on("updateMarqueeSelection",function(e){var t=o._graphData.allVertices().filter(function(t){return t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height});o.selection(t.map(function(e){return e.props}))}).on("endMarqueeSelection",function(){o.selectionChanged()})},n.prototype.forceDirectedOptions=function(){return{alpha:this.forceDirectedAlpha(),alphaMin:this.forceDirectedAlphaMin(),alphaDecay:this.forceDirectedAlphaDecay(),velocityDecay:this.forceDirectedVelocityDecay(),repulsionStrength:this.forceDirectedRepulsionStrength(),iterations:this.forceDirectedIterations(),linkDistance:this.forceDirectedLinkDistance(),linkStrength:this.forceDirectedLinkStrength(),pinCentroid:this.forceDirectedPinCentroid(),forceStrength:this.forceDirectedForceStrength(),distanceMin:this.forceDirectedMinDistance(),distanceMax:this.forceDirectedMaxDistance()}},n.prototype.layoutOptions=function(e){switch(e){case"ForceDirected":case"ForceDirected2":case"ForceDirectedHybrid":return this.forceDirectedOptions();case"Hierarchy":return{rankdir:this.hierarchyRankDirection(),nodesep:this.hierarchyNodeSeparation(),edgesep:this.hierarchyEdgeSeparation(),ranksep:this.hierarchyRankSeparation(),digraph:this.hierarchyDigraph()};case"Tree":case"Dendrogram":return{rankdir:this.treeRankDirection()};case"DOT":case"Neato":case"FDP":case"TwoPI":case"Circo":return this.wasmFolder()||Xh;case"None":case"Circle":case"RadialTree":case"RadialDendrogram":default:return}},n.prototype.updateLayout=function(){var e=this,t=this.layout(),n=this.layoutOptions(t),o=r.hashSum([t,n]);if(this._prevLayout!==o)switch(this._prevLayout=o,t){case"None":this.layoutAlgo(new Dh(this));break;case"Circle":this.layoutAlgo(new ph(this));break;case"ForceDirected":this.layoutAlgo(new bh(this,n));break;case"ForceDirected2":this.layoutAlgo(new wh(this,n));break;case"ForceDirectedHybrid":this.layoutAlgo(new bh(this,n)).then(function(){e.layoutAlgo(new wh(e,n))});break;case"Hierarchy":this.layoutAlgo(new mh(this,n));break;case"DOT":this.layoutAlgo(new kh(this,"dot",n));break;case"Tree":this.layoutAlgo(new Wh(this,n));break;case"RadialTree":this.layoutAlgo(new qh(this));break;case"Dendrogram":this.layoutAlgo(new Yh(this,n));break;case"RadialDendrogram":this.layoutAlgo(new $h(this));break;case"Neato":this.layoutAlgo(new kh(this,"neato",n));break;case"FDP":this.layoutAlgo(new kh(this,"fdp",n));break;case"TwoPI":this.layoutAlgo(new kh(this,"twopi",n));break;case"Circo":this.layoutAlgo(new kh(this,"circo",n))}},n.prototype.update=function(t,r){e.prototype.update.call(this,t,r),this._centroidFilter.update(this.centroidColor()),this._renderElement.classed("allowDragging",this.allowDragging()),this.updateCategories(),this.updateAnnotations(),this.updateSubgraphs(),this.updateVertices(),this.updateEdges(),this.updateLayout(),this.updateIconBar()},n.prototype.exit=function(t,r){e.prototype.exit.call(this,t,r),this._tooltip.target(null)},n.prototype.render=function(t){var r=this;return this.progress("start"),e.prototype.render.call(this,function(e){r.progress("stop"),t&&t(e)}),this},n.prototype.zoomed=function(t){e.prototype.zoomed.call(this,t);var r=this.size(),n=r.width,o=r.height;t.k<this.minScale()?(this._edgeG.attr("transform","scale("+this.minScale()/t.k+")"),this._subgraphG.attr("transform","scale("+this.minScale()/t.k+")"),this._vertexG.attr("transform","scale("+this.minScale()/t.k+")"),this._transformScale=t.k/this.minScale()):t.k>this.maxScale()?(this._edgeG.attr("transform","scale("+this.maxScale()/t.k+")"),this._subgraphG.attr("transform","scale("+this.maxScale()/t.k+")"),this._vertexG.attr("transform","scale("+this.maxScale()/t.k+")"),this._transformScale=t.k/this.maxScale()):(this._transformScale=1,this._edgeG.attr("transform",null),this._subgraphG.attr("transform",null),this._vertexG.attr("transform",null)),this._prevTransformScale===this._transformScale&&this._prevWidth===n&&this._prevHeight===o||(this._prevTransformScale=this._transformScale,this._prevWidth=n,this._prevHeight=o,this.moveSubgraphs(!1).moveVertices(!1).moveEdges(!1))},n.prototype.centroids=function(){return this._graphData.allVertices().filter(function(e){return!!e.centroid})},n.prototype.selectionChanged=function(){var e=this;if(this.highlightSelectedPathToCentroid()){var t={};this.centroids().forEach(function(r){e.selection().forEach(function(n){var o=e._graphData.dijkstra(r.id,n.id),i=o.ids;o.len&&i.forEach(function(e){t[e]=!0})})}),this._edgeG.selectAll(".graphEdge")}},n.prototype.tooltipHTML=function(e){return e.props.tooltip},n.prototype.subgraph_click=function(e,t,r){},n.prototype.vertex_click=function(e,t,r){},n.prototype.vertex_dblclick=function(e,t,r){},n.prototype.vertex_mousein=function(e,t,r){},n.prototype.vertex_mouseover=function(e,t,r){},n.prototype.vertex_mouseout=function(e,t,r){},n.prototype.edge_click=function(e,t,r){},n.prototype.edge_mouseover=function(e,t){this.highlightEdge(e,t)},n.prototype.edge_mouseout=function(e,t){this.highlightEdge(null,null)},n.prototype.progress=function(e){},n}(t.SVGZoomWidget);ef.prototype._class+=" graph_Graph2",ef.prototype.publish("allowDragging",!0,"boolean","Allow Dragging of Vertices"),ef.prototype.publish("dragSingleNeighbors",!0,"boolean","Dragging a Vertex also moves its singleton neighbors"),ef.prototype.publish("layout","ForceDirectedHybrid","set","Default Layout",["Hierarchy","DOT","Tree","Dendrogram","RadialTree","RadialDendrogram","ForceDirected","ForceDirected2","ForceDirectedHybrid","Neato","FDP","Circle","TwoPI","Circo","None"]),ef.prototype.publish("scale","100%","set","Zoom Level",["all","width","selection","100%","90%","75%","50%","25%","10%"]),ef.prototype.publish("applyScaleOnLayout",!1,"boolean","Shrink to fit on Layout"),ef.prototype.publish("highlightOnMouseOverVertex",!0,"boolean","Highlight Vertex on Mouse Over"),ef.prototype.publish("highlightOnMouseOverEdge",!0,"boolean","Highlight Edge on Mouse Over"),ef.prototype.publish("transitionDuration",250,"number","Transition Duration"),ef.prototype.publish("showEdges",!0,"boolean","Show Edges"),ef.prototype.publish("showEdgeLabels",!0,"boolean","Show Edge labels"),ef.prototype.publish("showEdgeLabelsOnHighlight",!0,"boolean","Show Edge labels when highlighted"),ef.prototype.publish("showVertexLabels",!0,"boolean","Show Vertex labels"),ef.prototype.publish("showVertexLabelsOnHighlight",!0,"boolean","Show Vertex labels when highlighted"),ef.prototype.publish("snapToGrid",0,"number","Snap to Grid"),ef.prototype.publish("selectionClearOnBackgroundClick",!1,"boolean","Clear selection on background click"),ef.prototype.publish("edgeArcDepth",8,"number","Edge Arc Depth"),ef.prototype.publish("edgeColor",null,"html-color","Edge line stroke color",null,{optional:!0}),ef.prototype.publish("edgeStrokeWidth",1,"number","Edge line stroke width (pixels)"),ef.prototype.publish("minScale",.6,"number","Min scale size for text"),ef.prototype.publish("maxScale",1,"number","Max scale size for text"),ef.prototype.publish("tooltipWidth",256,"number","Tooltip width (pixels)"),ef.prototype.publish("tooltipHeight",128,"number","Tooltip width (pixels)"),ef.prototype.publish("enableTooltipPointerEvents",!1,"boolean","If true, tooltip will use the style: 'pointer-events: all'"),ef.prototype.publish("tooltipCloseDelay",0,"number","Number of milliseconds to wait before closing tooltip (cancelled on tooltip mouseover event)"),ef.prototype.publish("doubleClickMaxDelay",300,"number","Number of milliseconds to wait before a subsequent click is not considered a double click"),ef.prototype.publish("centroidColor","#00A000","html-color","Centroid Glow Color"),ef.prototype.publish("centroidScale",1,"number","Centroid Scale"),ef.prototype.publish("centroidTextHeight",12,"number","Centroid Text Height"),ef.prototype.publish("centroidTextPadding",4,"number","Centroid Text Padding"),ef.prototype.publish("centroidIconHeight",50,"number","Centroid Icon Height"),ef.prototype.publish("centroidIconPadding",10,"number","Centroid Icon Padding"),ef.prototype.publish("centroidIconStrokeWidth",4,"number","Centroid Icon Stroke Width"),ef.prototype.publish("centroidIconFontFamily","FontAwesome","string","Centroid Icon Font Family"),ef.prototype.publish("centroidLabelFontFamily","FontAwesome","string","Centroid Label Font Family"),ef.prototype.publish("vertexTextHeight",10,"number","Vertex Text Height"),ef.prototype.publish("vertexTextPadding",4,"number","Vertex Text Padding"),ef.prototype.publish("vertexIconHeight",50,"number","Vertex Icon Height"),ef.prototype.publish("vertexIconPadding",10,"number","Vertex Icon Padding"),ef.prototype.publish("vertexIconStrokeWidth",0,"number","Vertex Icon Stroke Width"),ef.prototype.publish("vertexIconFontFamily","FontAwesome","string","Vertex Icon Font Family"),ef.prototype.publish("vertexLabelFontFamily","FontAwesome","string","Vertex Label Font Family"),ef.prototype.publish("highlightSelectedPathToCentroid",!0,"boolean","Highlight path to Center Vertex (for selected vertices)"),ef.prototype.publish("hierarchyRankDirection","TB","set","Direction for Rank Nodes",["TB","BT","LR","RL"],{disable:function(e){return"Hierarchy"!==e.layout()}}),ef.prototype.publish("hierarchyNodeSeparation",50,"number","Number of pixels that separate nodes horizontally in the layout",null,{disable:function(e){return"Hierarchy"!==e.layout()}}),ef.prototype.publish("hierarchyEdgeSeparation",10,"number","Number of pixels that separate edges horizontally in the layout",null,{disable:function(e){return"Hierarchy"!==e.layout()}}),ef.prototype.publish("hierarchyRankSeparation",50,"number","Number of pixels between each rank in the layout",null,{disable:function(e){return"Hierarchy"!==e.layout()}}),ef.prototype.publish("hierarchyDigraph",!0,"boolean","Directional Graph2",null,{disable:function(e){return"Hierarchy"!==e.layout()}}),ef.prototype.publish("forceDirectedAlpha",1,"number","Alpha",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),ef.prototype.publish("forceDirectedAlphaMin",.001,"number","Min Alpha",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),ef.prototype.publish("forceDirectedAlphaDecay",.0228,"number","Defaults to 1 - pow(alphaMin, 1 / 300)",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),ef.prototype.publish("forceDirectedRepulsionStrength",-350,"number","Charge strength ",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),ef.prototype.publish("forceDirectedVelocityDecay",.4,"number","Velocity Decay ",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),ef.prototype.publish("forceDirectedIterations",300,"number","Iterations",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),ef.prototype.publish("forceDirectedLinkDistance",300,"number","Target distance between linked nodes",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),ef.prototype.publish("forceDirectedLinkStrength",1,"number","Strength (rigidity) of links",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),ef.prototype.publish("forceDirectedPinCentroid",!1,"boolean","Pin centroid to center",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),ef.prototype.publish("forceDirectedForceStrength",0,"number","Strength of center force",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),ef.prototype.publish("forceDirectedMinDistance",1,"number","Min distance between nodes",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),ef.prototype.publish("forceDirectedMaxDistance",1/0,"number","Max distance between nodes",null,{disable:function(e){return 0!==e.layout().indexOf("ForceDirected")}}),ef.prototype.publish("treeRankDirection","LR","set","Direction for Rank Nodes",["TB","LR"],{disable:function(e){return"Tree"!==e.layout()&&"Dendrogram"!==e.layout()}}),ef.prototype.publish("wasmFolder",null,"string","WASM Folder",null,{optional:!0,disable:function(e){return["DOT","Neato","FDP","TwoPI","Circo"].indexOf(e.layout())<0}});var tf=ef.prototype.scale;function rf(e,t){var r={};return t.forEach(function(t,n){return r[t]=e[n]}),r}ef.prototype.scale=function(e,t){var r=tf.apply(this,arguments);return arguments.length&&this.zoomTo(e,t),r};var nf=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return s(r,e),r.prototype.owner=function(e){return arguments.length?(this._owner=e,this):this._owner},r.prototype.valid=function(){return!!this.columnID()},c([t.publish("","set","Annotation column (boolean)",function(){return this._owner.vertexColumns()}),l("design:type",Function)],r.prototype,"columnID",void 0),c([t.publish("","string","Annotation ID"),l("design:type",Function)],r.prototype,"annotationID",void 0),r}(t.PropertyExt);nf.prototype._class+=" graph_AnnotationColumn";var of=function(e){function n(){var t=e.call(this)||this;return t._prevSubgraphs=[],t._masterSubgraphs=[],t._masterSubgraphsMap={},t._prevVertices=[],t._masterVertices=[],t._masterVerticesMap={},t._prevEdges=[],t._masterEdges=[],t._masterEdgesMap={},t._prevHierarchy=[],t._masterHierarchy=[],t._masterHierarchyMap={},t.vertexRenderer(o.Vertex3).centroidRenderer(o.CentroidVertex3).edgeColor("#287EC4").edgeStrokeWidth(2).edgeArcDepth(0),t}return s(n,e),n.prototype.clear=function(){this._prevSubgraphs=[],this._masterSubgraphs=[],this._masterSubgraphsMap={},this._prevVertices=[],this._masterVertices=[],this._masterVerticesMap={},this._prevEdges=[],this._masterEdges=[],this._prevHierarchy=[],this._masterHierarchy=[],this._masterHierarchyMap={},this._graphData.clear(),this.resetLayout()},n.prototype.indexOf=function(e,t,r){void 0===r&&(r="");var n=e.indexOf(t);return n>=0?n:e.indexOf(r)},n.prototype.mergeSubgraphs=function(){var e=this,t=this.subgraphColumns(),n=this.indexOf(t,this.subgraphIDColumn(),"id"),o=this.indexOf(t,this.subgraphLabelColumn(),"label"),i=this.subgraphs().map(function(e){return{id:""+e[n],text:""+e[o],origData:rf(e,t)}}),a=r.compare2(this._prevSubgraphs,i,function(e){return e.id});a.exit.forEach(function(t){e._masterSubgraphs=e._masterSubgraphs.filter(function(e){return e.id!==t.id}),delete e._masterSubgraphsMap[t.id]}),a.enter.forEach(function(t){e._masterSubgraphs.push(t),e._masterSubgraphsMap[t.id]=t}),a.update.forEach(function(t){e._masterSubgraphsMap[t.id].origData=t.origData}),this._prevSubgraphs=i},n.prototype.mergeVertices=function(){var e=this,t=this.vertexColumns(),n=this.vertexAnnotationColumns(),o=this.indexOf(t,this.vertexCategoryColumn(),"category"),i=this.indexOf(t,this.vertexIDColumn(),"id"),a=this.indexOf(t,this.vertexLabelColumn(),"label"),s=this.indexOf(t,this.vertexCentroidColumn(),"centroid"),u=this.indexOf(t,this.vertexFACharColumn(),"faChar"),c=this.indexOf(t,this.vertexTooltipColumn(),"tooltip"),l=n.map(function(r){return e.indexOf(t,r.columnID(),"")}),h=this.vertices().map(function(r){return{categoryID:""+r[o],id:""+r[i],text:""+r[a],tooltip:""+r[c],origData:rf(r,t),centroid:!!r[s],icon:{imageChar:""+(r[u]||e.vertexFAChar())},annotationIDs:l.map(function(e,t){return r[e]?n[t].annotationID():void 0}).filter(function(e){return!!e})}}),f=r.compare2(this._prevVertices,h,function(e){return e.id});f.exit.forEach(function(t){e._masterVertices=e._masterVertices.filter(function(e){return e.id!==t.id}),delete e._masterVerticesMap[t.id]}),f.enter.forEach(function(t){e._masterVertices.push(t),e._masterVerticesMap[t.id]=t}),f.update.forEach(function(t){e._masterVerticesMap[t.id].origData=t.origData}),this._prevVertices=h},n.prototype.mergeEdges=function(){var e=this,t=this.edgeColumns(),n=this.indexOf(t,this.edgeIDColumn(),"id"),o=this.indexOf(t,this.edgeSourceColumn(),"source"),i=this.indexOf(t,this.edgeTargetColumn(),"target"),a=this.indexOf(t,this.edgeLabelColumn(),"label"),s=this.indexOf(t,this.edgeWeightColumn(),"weight"),u=this.indexOf(t,this.edgeColorColumn(),"color"),c=this.edges().map(function(r){var c=e._masterVerticesMap[""+r[o]];c||console.error('Invalid edge source entity "'+r[o]+'" does not exist.');var l=e._masterVerticesMap[""+r[i]];return l||console.error('Invalid edge target entity "'+r[i]+'" does not exist.'),{type:"edge",id:n>=0?""+r[n]:r[o]+"->"+r[i],source:c,target:l,weight:+r[s]||1,color:r[u],label:a>=0?""+r[a]:"",origData:rf(r,t)}}).filter(function(e){return e.source&&e.target}),l=r.compare2(this._masterEdges,c,function(e){return e.id});l.exit.forEach(function(t){e._masterEdges=e._masterEdges.filter(function(e){return e.id!==t.id}),delete e._masterEdgesMap[t.id]}),l.enter.forEach(function(t){e._masterEdges.push(t),e._masterEdgesMap[t.id]=t}),l.update.forEach(function(t){e._masterEdgesMap[t.id].origData=t.origData}),this._prevEdges=c},n.prototype.mergeHierarchy=function(){var e=this,t=this.hierarchyColumns(),n=this.indexOf(t,this.hierarchyParentIDColumn(),"parentID"),o=this.indexOf(t,this.hierarchyChildIDColumn(),"childID"),i=this.hierarchy().map(function(t){return{id:t[n]+"=>"+t[o],parent:e._masterSubgraphsMap[""+t[n]],child:e._masterSubgraphsMap[""+t[o]]||e._masterVerticesMap[""+t[o]]}}),a=r.compare2(this._prevHierarchy,i,function(e){return e.id});a.exit.forEach(function(t){e._masterHierarchy=e._masterHierarchy.filter(function(e){return e.id!==t.id}),delete e._masterHierarchyMap[t.id]}),a.enter.forEach(function(t){e._masterHierarchy.push(t),e._masterHierarchyMap[t.id]=t}),this._prevHierarchy=i},n.prototype.update=function(t,r){this.mergeSubgraphs(),this.mergeVertices(),this.mergeEdges(),this.mergeHierarchy(),this.data({subgraphs:this._masterSubgraphs,vertices:this._masterVertices,edges:this._masterEdges,hierarchy:this._masterHierarchy}),e.prototype.update.call(this,t,r)},n.prototype.render=function(t){return e.prototype.render.call(this,function(e){t&&t(e)}),this},c([t.publish([],"any","Subgraph Columns",null,{internal:!0}),l("design:type",Function)],n.prototype,"subgraphColumns",void 0),c([t.publish([],"any","Subgraphs",null,{internal:!0}),l("design:type",Function)],n.prototype,"subgraphs",void 0),c([t.publish("","string","Subgraph ID column"),l("design:type",Function)],n.prototype,"subgraphIDColumn",void 0),c([t.publish("","string","Subgraph Label column"),l("design:type",Function)],n.prototype,"subgraphLabelColumn",void 0),c([t.publish([],"any","Vertex Columns",null,{internal:!0}),l("design:type",Function)],n.prototype,"vertexColumns",void 0),c([t.publish([],"any","Vertices (Nodes)",null,{internal:!0}),l("design:type",Function)],n.prototype,"vertices",void 0),c([t.publish("","set","Vertex Category ID column",function(){return this.vertexColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"vertexCategoryColumn",void 0),c([t.publish("","set","Vertex ID column",function(){return this.vertexColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"vertexIDColumn",void 0),c([t.publish("","set","Vertex label column",function(){return this.vertexColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"vertexLabelColumn",void 0),c([t.publish("","set","Vertex centroid column (boolean)",function(){return this.vertexColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"vertexCentroidColumn",void 0),c([t.publish("?","string","Vertex default FAChar"),l("design:type",Function)],n.prototype,"vertexFAChar",void 0),c([t.publish("","set","Vertex FAChar column",function(){return this.vertexColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"vertexFACharColumn",void 0),c([t.publish("","set","Vertex tooltip column",function(){return this.vertexColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"vertexTooltipColumn",void 0),c([t.publish([],"propertyArray","Annotations",null,{autoExpand:nf}),l("design:type",Function)],n.prototype,"vertexAnnotationColumns",void 0),c([t.publish([],"any","Edge columns",null,{internal:!0}),l("design:type",Function)],n.prototype,"edgeColumns",void 0),c([t.publish([],"any","Edges (Edges)",null,{internal:!0}),l("design:type",Function)],n.prototype,"edges",void 0),c([t.publish("","set","Edge ID column",function(){return this.edgeColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"edgeIDColumn",void 0),c([t.publish("","set","Edge label column",function(){return this.edgeColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"edgeLabelColumn",void 0),c([t.publish("","set","Edge source ID column",function(){return this.edgeColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"edgeSourceColumn",void 0),c([t.publish("","set","Edge target ID column",function(){return this.edgeColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"edgeTargetColumn",void 0),c([t.publish("","set","Edge weight column",function(){return this.edgeColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"edgeWeightColumn",void 0),c([t.publish("","set","Edge color column",function(){return this.edgeColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"edgeColorColumn",void 0),c([t.publish([],"any","Subgraph Columns"),l("design:type",Function)],n.prototype,"hierarchyColumns",void 0),c([t.publish([],"any","Subgraphs"),l("design:type",Function)],n.prototype,"hierarchy",void 0),c([t.publish("","string","Subgraph ID column"),l("design:type",Function)],n.prototype,"hierarchyParentIDColumn",void 0),c([t.publish("","string","Subgraph Label column"),l("design:type",Function)],n.prototype,"hierarchyChildIDColumn",void 0),n}(ef);of.prototype._class+=" graph_DataGraph";L(".graph_SankeyGraph .node rect{cursor:move;fill-opacity:.9;shape-rendering:crispEdges;stroke:#a9a9a9}.graph_SankeyGraph .node.selected rect{stroke:red}.graph_SankeyGraph .node.over rect{stroke:orange}.graph_SankeyGraph .node.selected.over rect{stroke:red}.graph_SankeyGraph .node text{pointer-events:none;text-shadow:0 1px 0 #fff}.graph_SankeyGraph .node.selected text{fill:red}.graph_SankeyGraph .node.over text{fill:orange}.graph_SankeyGraph .node.selected.over text{fill:red}.graph_SankeyGraph .link{fill:none;stroke:#000;stroke-opacity:.2}.graph_SankeyGraph .link:hover{stroke-opacity:.5}");var af=function(e){function n(){var r=e.call(this)||this;return r._prevVertices=[],r._masterVertices=[],r._masterVerticesMap={},r._prevEdges=[],r._masterEdges=[],t.Utility.SimpleSelectionMixin.call(r),r._drawStartPos="origin",r}return s(n,e),n.prototype.mergeVertices=function(){var e=this,t=this.vertexColumns(),n=this.vertexAnnotationColumns(),o=this.indexOf(t,this.vertexCategoryColumn(),"category"),i=this.indexOf(t,this.vertexIDColumn(),"id"),a=this.indexOf(t,this.vertexLabelColumn(),"label"),s=this.indexOf(t,this.vertexCentroidColumn(),"centroid"),u=this.indexOf(t,this.vertexFACharColumn(),"faChar"),c=this.indexOf(t,this.vertexTooltipColumn(),"tooltip"),l=n.map(function(r){return e.indexOf(t,r.columnID(),"")}),h=this.vertices().map(function(r){return{categoryID:""+r[o],id:""+r[i],text:""+r[a],tooltip:""+r[c],origData:rf(r,t),centroid:!!r[s],icon:{imageChar:""+(r[u]||e.vertexFAChar())},annotationIDs:l.map(function(e,t){return r[e]?n[t].annotationID():void 0}).filter(function(e){return!!e})}}),f=r.compare2(this._prevVertices,h,function(e){return e.id});f.exit.forEach(function(t){e._masterVertices=e._masterVertices.filter(function(e){return e.id!==t.id})}),f.enter.forEach(function(t){e._masterVertices.push(t),e._masterVerticesMap[t.id]=t}),this._prevVertices=h},n.prototype.indexOf=function(e,t,r){void 0===r&&(r="");var n=e.indexOf(t);return n>=0?n:e.indexOf(r)},n.prototype.mergeEdges=function(){var e=this,t=this.edgeColumns(),n=this.indexOf(t,this.edgeIDColumn(),"id"),o=this.indexOf(t,this.edgeSourceColumn(),"source"),i=this.indexOf(t,this.edgeTargetColumn(),"target"),a=this.indexOf(t,this.edgeLabelColumn(),"label"),s=this.indexOf(t,this.edgeWeightColumn(),"weight"),u=this.edges().map(function(r){var u=e._masterVerticesMap[""+r[o]];u||console.error('Invalid edge source entity "'+r[o]+'" does not exist.');var c=e._masterVerticesMap[""+r[i]];return c||console.error('Invalid edge target entity "'+r[i]+'" does not exist.'),{type:"edge",id:n>=0?""+r[n]:r[o]+"->"+r[i],source:u,target:c,value:+r[s]||0,label:a>=0?""+r[a]:"",origData:rf(r,t)}}).filter(function(e){return e.source&&e.target}),c=r.compare2(this._masterEdges,u,function(e){return e.id});c.exit.forEach(function(t){e._masterEdges=e._masterEdges.filter(function(e){return e.id!==t.id})}),c.enter.forEach(function(t){e._masterEdges.push(t)}),this._prevEdges=u},n.prototype.sankeyData=function(){return this.mergeVertices(),this.mergeEdges(),{vertices:this._masterVertices,edges:this._masterEdges}},n.prototype.enter=function(t,r){e.prototype.enter.call(this,t,r),this._d3Sankey=nh(),this._selection.widgetElement(r)},n.prototype.update=function(r,n){e.prototype.update.call(this,r,n),this._palette=this._palette.switch(this.paletteID());var o=this.vertexStrokeWidth(),i=this.sankeyData();this._d3Sankey.nodeId(function(e){return e.id}).extent([[0,0],[this.width(),this.height()]]),i.vertices.length>0&&this._d3Sankey({nodes:i.vertices,links:i.edges});var a=this,s=n.selectAll(".link").data(i.edges);s.enter().append("path").attr("class","link").each(function(){t.select(this).append("title")}).merge(s).attr("d",ah()).style("stroke-width",function(e){return Math.max(1,e.width)}).select("title").text(function(e){return e.source.text+" → "+e.target.text+"\n"+e.value}),s.exit().remove();var u=n.selectAll(".node").data(i.vertices);u.enter().append("g").attr("class","node").call(this._selection.enter.bind(this._selection)).on("click",function(e){a.click(e.origData,"",a._selection.selected(this))}).on("dblclick",function(e){a.dblclick(e.origData,"",a._selection.selected(this))}).each(function(){var e=t.select(this);e.append("rect"),e.append("text")}).merge(u).attr("transform",function(e){var t=0,r=0;return e.x0&&(t=e.x0),e.y0&&(r=e.y0),"translate("+(t+o)+","+(r+o)+")"}).each(function(){var e=t.select(this);e.select("rect").attr("height",function(e){return e.y1-e.y0}).attr("width",function(e){return e.x1-e.x0}).style("fill",function(e){return a._palette(e.categoryID)}).style("stroke",function(e){return a.vertexStrokeColor()}).style("stroke-width",function(e){return o}).style("cursor",a.xAxisMovement()||a.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.text}).filter(function(e){return e.x0<a.width()/2}).attr("x",6+a._d3Sankey.nodeWidth()).attr("text-anchor","start")}),u.exit().remove()},n.prototype.exit=function(t,r){e.prototype.exit.call(this,t,r)},n.prototype.click=function(e,t,r){console.log("Click: "+JSON.stringify(e)+", "+t+","+r)},n.prototype.dblclick=function(e,t,r){console.log("Double Click: "+JSON.stringify(e)+", "+t+","+r)},c([t.publish([],"any","Vertex Columns",null,{internal:!0}),l("design:type",Function)],n.prototype,"vertexColumns",void 0),c([t.publish([],"any","Vertices (Nodes)",null,{internal:!0}),l("design:type",Function)],n.prototype,"vertices",void 0),c([t.publish("","set","Vertex Category ID column",function(){return this.vertexColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"vertexCategoryColumn",void 0),c([t.publish("","set","Vertex ID column",function(){return this.vertexColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"vertexIDColumn",void 0),c([t.publish("","set","Vertex label column",function(){return this.vertexColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"vertexLabelColumn",void 0),c([t.publish("","set","Vertex centroid column (boolean)",function(){return this.vertexColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"vertexCentroidColumn",void 0),c([t.publish("?","string","Vertex default FAChar"),l("design:type",Function)],n.prototype,"vertexFAChar",void 0),c([t.publish("","set","Vertex FAChar column",function(){return this.vertexColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"vertexFACharColumn",void 0),c([t.publish("","set","Vertex tooltip column",function(){return this.vertexColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"vertexTooltipColumn",void 0),c([t.publish([],"propertyArray","Annotations",null,{autoExpand:nf}),l("design:type",Function)],n.prototype,"vertexAnnotationColumns",void 0),c([t.publish([],"any","Edge columns",null,{internal:!0}),l("design:type",Function)],n.prototype,"edgeColumns",void 0),c([t.publish([],"any","Edges (Edges)",null,{internal:!0}),l("design:type",Function)],n.prototype,"edges",void 0),c([t.publish("","set","Edge ID column",function(){return this.edgeColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"edgeIDColumn",void 0),c([t.publish("","set","Edge label column",function(){return this.edgeColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"edgeLabelColumn",void 0),c([t.publish("","set","Edge source ID column",function(){return this.edgeColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"edgeSourceColumn",void 0),c([t.publish("","set","Edge target ID column",function(){return this.edgeColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"edgeTargetColumn",void 0),c([t.publish("","set","Edge target ID column",function(){return this.edgeColumns()},{optional:!0}),l("design:type",Function)],n.prototype,"edgeWeightColumn",void 0),n}(t.SVGWidget);af.prototype._class+=" graph_SankeyGraph",af.prototype.mixin(t.Utility.SimpleSelectionMixin),af.prototype._palette=t.Palette.ordinal("category10"),af.prototype.publish("paletteID","category10","set","Color palette for this widget",af.prototype._palette.switch()),af.prototype.publish("vertexStrokeWidth",1,"number","Vertex Stroke Width"),af.prototype.publish("vertexStrokeColor","darkgray","string","Vertex Stroke Color"),af.prototype.publish("vertexWidth",36,"number","Vertex Width"),af.prototype.publish("vertexPadding",20,"number","Vertex Padding"),af.prototype.publish("xAxisMovement",!1,"boolean","Enable x-axis movement"),af.prototype.publish("yAxisMovement",!1,"boolean","Enable y-axis movement"),e.AdjacencyGraph=Ul,e.Annotation=Hl,e.AnnotationColumn=nf,e.BUILD_VERSION="2.101.0",e.DataGraph=of,e.Edge=R,e.Graph=Vl,e.Graph2=ef,e.PKG_NAME="@hpcc-js/graph",e.PKG_VERSION="2.78.0",e.Sankey=ch,e.SankeyColumn=uh,e.SankeyGraph=af,e.Subgraph=Bl,e.Vertex=zl,e.graphviz=function(e,t,r){return void 0===t&&(t="dot"),void 0===r&&(r=Xh),xh({items:[],links:[],raw:e},{engine:t,wasmFolder:r})},e.toJsonObj=rf,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
2
2
|
//# sourceMappingURL=index.min.js.map
|