landscape-widget 0.3.2-rc.0 → 0.3.2-rc.1
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.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
define("landscape-widget",["@jupyter-widgets/base"],(t=>(()=>{var e={889:(t,e,n)=>{(e=n(352)(!1)).push([t.id,".custom-widget {\n padding: 5px;\n}\n\n.landscape-container {\n height: 100%;\n width: 100%;\n}\n",""]),t.exports=e},134:(t,e,n)=>{(e=n(352)(!1)).push([t.id,".graph-container .controls-container>button{display:flex;justify-content:center;align-items:center;border-radius:4px;border:none;margin:0 4px 0 0;padding:0;background-color:#e2e4e7}.graph-container .controls-container>button:hover{background-color:#cbcdd0}.graph-container .controls-container>button.active{background-color:#bddde8}.graph-container .controls-container>button[data-tooltip]:before{position:absolute;display:none;pointer-events:none;transition:opacity .3s;content:attr(data-tooltip);background-color:#33455f;color:#fff;font-size:1rem;line-height:1.4;border-radius:4px;padding:4px 8px;max-width:300px;margin-bottom:14px;white-space:nowrap;font-weight:500;bottom:100%}.graph-container .controls-container>button[data-tooltip]:hover:before{display:block}.graph-container .controls-container>button[data-tooltip]:last-of-type:before{left:100%;transform:translateX(-100%)}.graph-container .webgl-overlay{font-size:20px;text-align:center;opacity:.9}.graph-container .webgl-overlay>button{font-size:16px;background-color:#007bff;color:#fff;border:none;border-radius:4px}.slider-container{position:absolute;top:0;width:490px;display:flex;border:1px solid #d3d3d3;border-radius:4px;height:40px;box-sizing:border-box}.slider-container .slider-wrapper{display:flex;align-items:center;padding:0 5px}.slider-container .slider-wrapper .slider-label{margin:0;font-size:14px}.slider-container .slider-wrapper .slider{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:110px;height:4px;margin-right:10px;margin-left:5px;border-radius:4px;background:#2196f3;outline:none;cursor:pointer}.slider-container .slider-wrapper .slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:16px;height:16px;background:#2196f3;border-radius:50%}.slider-container .slider-wrapper .slider::-moz-range-thumb{width:16px;height:16px;background:#2196f3;border-radius:50%;border:none}.slider-container .slider-wrapper .slider:hover::-webkit-slider-thumb{background:#1976d2}.slider-container .slider-wrapper .slider:hover::-moz-range-thumb{background:#1976d2}.slider-container .slider-wrapper .slider:hover::-ms-thumb{background:#1976d2}.slider-container .slider-wrapper .slider:active::-webkit-slider-thumb{background:#0d47a1}.slider-container .slider-wrapper .slider:active::-moz-range-thumb{background:#0d47a1}.slider-container .slider-wrapper .slider:active::-ms-thumb{background:#0d47a1}.slider-container .slider-wrapper .slider-value{min-width:20px;text-align:center}\n",""]),t.exports=e},916:function(t){var e;e=()=>(()=>{var t={796:t=>{t.exports=function(t,e){var n=e.length;if(0!==n){var r=t.length;t.length+=n;for(var i=0;i<n;i++)t[r+i]=e[i]}}},187:t=>{"use strict";var e,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};e=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var i=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(n,r){function i(n){t.removeListener(e,o),r(n)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",i),n([].slice.call(arguments))}g(t,e,o,{once:!0}),"error"!==e&&function(t,e,n){"function"==typeof t.on&&g(t,"error",e,{once:!0})}(t,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function s(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function h(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function u(t,e,n,r){var i,o,a,u;if(s(n),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),o=t._events),a=o[e]),void 0===a)a=o[e]=n,++t._eventsCount;else if("function"==typeof a?a=o[e]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(i=h(t))>0&&a.length>i&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=a.length,u=c,console&&console.warn&&console.warn(u)}return t}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=c.bind(r);return i.listener=n,r.wrapFn=i,i}function l(t,e,n){var r=t._events;if(void 0===r)return[];var i=r[e];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(i):f(i,i.length)}function p(t){var e=this._events;if(void 0!==e){var n=e[t];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function f(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}function g(t,e,n,r){if("function"==typeof t.on)r.once?t.once(e,n):t.on(e,n);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function i(o){r.once&&t.removeEventListener(e,i),n(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(t){if("number"!=typeof t||t<0||i(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");a=t}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||i(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},o.prototype.getMaxListeners=function(){return h(this)},o.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var i="error"===t,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var a;if(e.length>0&&(a=e[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var h=o[t];if(void 0===h)return!1;if("function"==typeof h)r(h,this,e);else{var u=h.length,c=f(h,u);for(n=0;n<u;++n)r(c[n],this,e)}return!0},o.prototype.addListener=function(t,e){return u(this,t,e,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(t,e){return u(this,t,e,!0)},o.prototype.once=function(t,e){return s(e),this.on(t,d(this,t,e)),this},o.prototype.prependOnceListener=function(t,e){return s(e),this.prependListener(t,d(this,t,e)),this},o.prototype.removeListener=function(t,e){var n,r,i,o,a;if(s(e),void 0===(r=this._events))return this;if(void 0===(n=r[t]))return this;if(n===e||n.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===e||n[o].listener===e){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(n,i),1===n.length&&(r[t]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",t,a||e)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(t){var e,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[t]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(void 0!==e)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},o.prototype.listeners=function(t){return l(this,t,!0)},o.prototype.rawListeners=function(t){return l(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):p.call(t,e)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},803:(t,e,n)=>{var r=n(186),i=(n(212).B,n(325).De,n(341));e.kS=function(t){var e=[];return function(t,e){if(!r(t))throw new Error("graphology-components: the given graph is not a valid graphology instance.");if(t.order){var n=new i(t),o=n.push.bind(n);n.forEachNodeYetUnseen((function(r){var i,a=[];for(n.push(r);0!==n.size;)i=n.pop(),a.push(i),t.forEachNeighbor(i,o);e(a)}))}}(t,(function(t){e.push(t)})),e}},341:t=>{function e(t){this.graph=t,this.stack=new Array(t.order),this.seen=new Set,this.size=0}e.prototype.hasAlreadySeenEverything=function(){return this.seen.size===this.graph.order},e.prototype.countUnseenNodes=function(){return this.graph.order-this.seen.size},e.prototype.forEachNodeYetUnseen=function(t){var e=this.seen,n=this.graph;n.someNode((function(r,i){return e.size===n.order||!e.has(r)&&!!t(r,i)}))},e.prototype.has=function(t){return this.seen.has(t)},e.prototype.push=function(t){var e=this.seen.size;return this.seen.add(t),e!==this.seen.size&&(this.stack[this.size++]=t,!0)},e.prototype.pushWith=function(t,e){var n=this.seen.size;return this.seen.add(t),n!==this.seen.size&&(this.stack[this.size++]=e,!0)},e.prototype.pop=function(){if(0!==this.size)return this.stack[--this.size]},t.exports=e},847:t=>{t.exports={linLogMode:!1,outboundAttractionDistribution:!1,adjustSizes:!1,edgeWeightInfluence:1,scalingRatio:1,strongGravityMode:!1,gravity:1,slowDown:1,barnesHutOptimize:!1,barnesHutTheta:.5}},739:(t,e)=>{e.assign=function(t){t=t||{};var e,n,r,i=Array.prototype.slice.call(arguments).slice(1);for(e=0,r=i.length;e<r;e++)if(i[e])for(n in i[e])t[n]=i[e][n];return t},e.validateSettings=function(t){return"linLogMode"in t&&"boolean"!=typeof t.linLogMode?{message:"the `linLogMode` setting should be a boolean."}:"outboundAttractionDistribution"in t&&"boolean"!=typeof t.outboundAttractionDistribution?{message:"the `outboundAttractionDistribution` setting should be a boolean."}:"adjustSizes"in t&&"boolean"!=typeof t.adjustSizes?{message:"the `adjustSizes` setting should be a boolean."}:"edgeWeightInfluence"in t&&"number"!=typeof t.edgeWeightInfluence?{message:"the `edgeWeightInfluence` setting should be a number."}:!("scalingRatio"in t)||"number"==typeof t.scalingRatio&&t.scalingRatio>=0?"strongGravityMode"in t&&"boolean"!=typeof t.strongGravityMode?{message:"the `strongGravityMode` setting should be a boolean."}:!("gravity"in t)||"number"==typeof t.gravity&&t.gravity>=0?"slowDown"in t&&!("number"==typeof t.slowDown||t.slowDown>=0)?{message:"the `slowDown` setting should be a number >= 0."}:"barnesHutOptimize"in t&&"boolean"!=typeof t.barnesHutOptimize?{message:"the `barnesHutOptimize` setting should be a boolean."}:!("barnesHutTheta"in t)||"number"==typeof t.barnesHutTheta&&t.barnesHutTheta>=0?null:{message:"the `barnesHutTheta` setting should be a number >= 0."}:{message:"the `gravity` setting should be a number >= 0."}:{message:"the `scalingRatio` setting should be a number >= 0."}},e.graphToByteArrays=function(t,e){var n,r=t.order,i=t.size,o={},a=new Float32Array(10*r),s=new Float32Array(3*i);return n=0,t.forEachNode((function(t,e){o[t]=n,a[n]=e.x,a[n+1]=e.y,a[n+2]=0,a[n+3]=0,a[n+4]=0,a[n+5]=0,a[n+6]=1,a[n+7]=1,a[n+8]=e.size||1,a[n+9]=e.fixed?1:0,n+=10})),n=0,t.forEachEdge((function(t,r,i,h,u,c,d){var l=o[i],p=o[h],f=e(t,r,i,h,u,c,d);a[l+6]+=f,a[p+6]+=f,s[n]=l,s[n+1]=p,s[n+2]=f,n+=3})),{nodes:a,edges:s}},e.assignLayoutChanges=function(t,e,n){var r=0;t.updateEachNodeAttributes((function(t,i){return i.x=e[r],i.y=e[r+1],r+=10,n?n(t,i):i}))},e.readGraphPositions=function(t,e){var n=0;t.forEachNode((function(t,r){e[n]=r.x,e[n+1]=r.y,n+=10}))},e.collectLayoutChanges=function(t,e,n){for(var r=t.nodes(),i={},o=0,a=0,s=e.length;o<s;o+=10){if(n){var h=Object.assign({},t.getNodeAttributes(r[a]));h.x=e[o],h.y=e[o+1],h=n(r[a],h),i[r[a]]={x:h.x,y:h.y}}else i[r[a]]={x:e[o],y:e[o+1]};a++}return i},e.createWorker=function(t){var e=window.URL||window.webkitURL,n=t.toString(),r=e.createObjectURL(new Blob(["("+n+").call(this);"],{type:"text/javascript"})),i=new Worker(r);return e.revokeObjectURL(r),i}},404:(t,e,n)=>{var r=n(186),i=n(308).Q6,o=n(810),a=n(739),s=n(847);function h(t,e,n){if(!r(e))throw new Error("graphology-layout-forceatlas2: the given graph is not a valid graphology instance.");"number"==typeof n&&(n={iterations:n});var h=n.iterations;if("number"!=typeof h)throw new Error("graphology-layout-forceatlas2: invalid number of iterations.");if(h<=0)throw new Error("graphology-layout-forceatlas2: you should provide a positive number of iterations.");var u=i("getEdgeWeight"in n?n.getEdgeWeight:"weight").fromEntry,c="function"==typeof n.outputReducer?n.outputReducer:null,d=a.assign({},s,n.settings),l=a.validateSettings(d);if(l)throw new Error("graphology-layout-forceatlas2: "+l.message);var p,f=a.graphToByteArrays(e,u);for(p=0;p<h;p++)o(d,f.nodes,f.edges);if(!t)return a.collectLayoutChanges(e,f.nodes);a.assignLayoutChanges(e,f.nodes,c)}var u=h.bind(null,!1);u.assign=h.bind(null,!0),u.inferSettings=function(t){var e="number"==typeof t?t:t.order;return{barnesHutOptimize:e>2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(e)}},t.exports=u},810:t=>{var e=10;t.exports=function(t,n,r){var i,o,a,s,h,u,c,d,l,p,f,g,v,y,m,b,w,_,x,C,E,L,S,M=n.length,A=r.length,N=t.adjustSizes,k=t.barnesHutTheta*t.barnesHutTheta,P=[];for(a=0;a<M;a+=e)n[a+4]=n[a+2],n[a+5]=n[a+3],n[a+2]=0,n[a+3]=0;if(t.outboundAttractionDistribution){for(f=0,a=0;a<M;a+=e)f+=n[a+6];f/=M/e}if(t.barnesHutOptimize){var D,G,F,O=1/0,T=-1/0,R=1/0,j=-1/0;for(a=0;a<M;a+=e)O=Math.min(O,n[a+0]),T=Math.max(T,n[a+0]),R=Math.min(R,n[a+1]),j=Math.max(j,n[a+1]);var z=T-O,B=j-R;for(z>B?j=(R-=(z-B)/2)+z:T=(O-=(B-z)/2)+B,P[0]=-1,P[1]=(O+T)/2,P[2]=(R+j)/2,P[3]=Math.max(T-O,j-R),P[4]=-1,P[5]=-1,P[6]=0,P[7]=0,P[8]=0,i=1,a=0;a<M;a+=e)for(o=0,F=3;;){if(!(P[o+5]>=0)){if(P[o+0]<0){P[o+0]=a;break}if(P[o+5]=9*i,d=P[o+3]/2,P[(l=P[o+5])+0]=-1,P[l+1]=P[o+1]-d,P[l+2]=P[o+2]-d,P[l+3]=d,P[l+4]=l+9,P[l+5]=-1,P[l+6]=0,P[l+7]=0,P[l+8]=0,P[(l+=9)+0]=-1,P[l+1]=P[o+1]-d,P[l+2]=P[o+2]+d,P[l+3]=d,P[l+4]=l+9,P[l+5]=-1,P[l+6]=0,P[l+7]=0,P[l+8]=0,P[(l+=9)+0]=-1,P[l+1]=P[o+1]+d,P[l+2]=P[o+2]-d,P[l+3]=d,P[l+4]=l+9,P[l+5]=-1,P[l+6]=0,P[l+7]=0,P[l+8]=0,P[(l+=9)+0]=-1,P[l+1]=P[o+1]+d,P[l+2]=P[o+2]+d,P[l+3]=d,P[l+4]=P[o+4],P[l+5]=-1,P[l+6]=0,P[l+7]=0,P[l+8]=0,i+=4,D=n[P[o+0]+0]<P[o+1]?n[P[o+0]+1]<P[o+2]?P[o+5]:P[o+5]+9:n[P[o+0]+1]<P[o+2]?P[o+5]+18:P[o+5]+27,P[o+6]=n[P[o+0]+6],P[o+7]=n[P[o+0]+0],P[o+8]=n[P[o+0]+1],P[D+0]=P[o+0],P[o+0]=-1,D===(G=n[a+0]<P[o+1]?n[a+1]<P[o+2]?P[o+5]:P[o+5]+9:n[a+1]<P[o+2]?P[o+5]+18:P[o+5]+27)){if(F--){o=D;continue}F=3;break}P[G+0]=a;break}D=n[a+0]<P[o+1]?n[a+1]<P[o+2]?P[o+5]:P[o+5]+9:n[a+1]<P[o+2]?P[o+5]+18:P[o+5]+27,P[o+7]=(P[o+7]*P[o+6]+n[a+0]*n[a+6])/(P[o+6]+n[a+6]),P[o+8]=(P[o+8]*P[o+6]+n[a+1]*n[a+6])/(P[o+6]+n[a+6]),P[o+6]+=n[a+6],o=D}}if(t.barnesHutOptimize){for(g=t.scalingRatio,a=0;a<M;a+=e)for(o=0;;)if(P[o+5]>=0){if(b=Math.pow(n[a+0]-P[o+7],2)+Math.pow(n[a+1]-P[o+8],2),4*(p=P[o+3])*p/b<k){if(v=n[a+0]-P[o+7],y=n[a+1]-P[o+8],!0===N?b>0?(w=g*n[a+6]*P[o+6]/b,n[a+2]+=v*w,n[a+3]+=y*w):b<0&&(w=-g*n[a+6]*P[o+6]/Math.sqrt(b),n[a+2]+=v*w,n[a+3]+=y*w):b>0&&(w=g*n[a+6]*P[o+6]/b,n[a+2]+=v*w,n[a+3]+=y*w),(o=P[o+4])<0)break;continue}o=P[o+5]}else if((u=P[o+0])>=0&&u!==a&&(b=(v=n[a+0]-n[u+0])*v+(y=n[a+1]-n[u+1])*y,!0===N?b>0?(w=g*n[a+6]*n[u+6]/b,n[a+2]+=v*w,n[a+3]+=y*w):b<0&&(w=-g*n[a+6]*n[u+6]/Math.sqrt(b),n[a+2]+=v*w,n[a+3]+=y*w):b>0&&(w=g*n[a+6]*n[u+6]/b,n[a+2]+=v*w,n[a+3]+=y*w)),(o=P[o+4])<0)break}else for(g=t.scalingRatio,s=0;s<M;s+=e)for(h=0;h<s;h+=e)v=n[s+0]-n[h+0],y=n[s+1]-n[h+1],!0===N?(b=Math.sqrt(v*v+y*y)-n[s+8]-n[h+8])>0?(w=g*n[s+6]*n[h+6]/b/b,n[s+2]+=v*w,n[s+3]+=y*w,n[h+2]-=v*w,n[h+3]-=y*w):b<0&&(w=100*g*n[s+6]*n[h+6],n[s+2]+=v*w,n[s+3]+=y*w,n[h+2]-=v*w,n[h+3]-=y*w):(b=Math.sqrt(v*v+y*y))>0&&(w=g*n[s+6]*n[h+6]/b/b,n[s+2]+=v*w,n[s+3]+=y*w,n[h+2]-=v*w,n[h+3]-=y*w);for(l=t.gravity/t.scalingRatio,g=t.scalingRatio,a=0;a<M;a+=e)w=0,v=n[a+0],y=n[a+1],b=Math.sqrt(Math.pow(v,2)+Math.pow(y,2)),t.strongGravityMode?b>0&&(w=g*n[a+6]*l):b>0&&(w=g*n[a+6]*l/b),n[a+2]-=v*w,n[a+3]-=y*w;for(g=1*(t.outboundAttractionDistribution?f:1),c=0;c<A;c+=3)s=r[c+0],h=r[c+1],d=r[c+2],m=Math.pow(d,t.edgeWeightInfluence),v=n[s+0]-n[h+0],y=n[s+1]-n[h+1],!0===N?(b=Math.sqrt(v*v+y*y)-n[s+8]-n[h+8],t.linLogMode?t.outboundAttractionDistribution?b>0&&(w=-g*m*Math.log(1+b)/b/n[s+6]):b>0&&(w=-g*m*Math.log(1+b)/b):t.outboundAttractionDistribution?b>0&&(w=-g*m/n[s+6]):b>0&&(w=-g*m)):(b=Math.sqrt(Math.pow(v,2)+Math.pow(y,2)),t.linLogMode?t.outboundAttractionDistribution?b>0&&(w=-g*m*Math.log(1+b)/b/n[s+6]):b>0&&(w=-g*m*Math.log(1+b)/b):t.outboundAttractionDistribution?(b=1,w=-g*m/n[s+6]):(b=1,w=-g*m)),b>0&&(n[s+2]+=v*w,n[s+3]+=y*w,n[h+2]-=v*w,n[h+3]-=y*w);if(!0===N)for(a=0;a<M;a+=e)1!==n[a+9]&&((_=Math.sqrt(Math.pow(n[a+2],2)+Math.pow(n[a+3],2)))>10&&(n[a+2]=10*n[a+2]/_,n[a+3]=10*n[a+3]/_),x=n[a+6]*Math.sqrt((n[a+4]-n[a+2])*(n[a+4]-n[a+2])+(n[a+5]-n[a+3])*(n[a+5]-n[a+3])),C=Math.sqrt((n[a+4]+n[a+2])*(n[a+4]+n[a+2])+(n[a+5]+n[a+3])*(n[a+5]+n[a+3]))/2,E=.1*Math.log(1+C)/(1+Math.sqrt(x)),L=n[a+0]+n[a+2]*(E/t.slowDown),n[a+0]=L,S=n[a+1]+n[a+3]*(E/t.slowDown),n[a+1]=S);else for(a=0;a<M;a+=e)1!==n[a+9]&&(x=n[a+6]*Math.sqrt((n[a+4]-n[a+2])*(n[a+4]-n[a+2])+(n[a+5]-n[a+3])*(n[a+5]-n[a+3])),C=Math.sqrt((n[a+4]+n[a+2])*(n[a+4]+n[a+2])+(n[a+5]+n[a+3])*(n[a+5]+n[a+3]))/2,E=n[a+7]*Math.log(1+C)/(1+Math.sqrt(x)),n[a+7]=Math.min(1,Math.sqrt(E*(Math.pow(n[a+2],2)+Math.pow(n[a+3],2))/(1+Math.sqrt(x)))),L=n[a+0]+n[a+2]*(E/t.slowDown),n[a+0]=L,S=n[a+1]+n[a+3]*(E/t.slowDown),n[a+1]=S);return{}}},325:(t,e)=>{e.De=function(t,e,n,r,i,o){return o=Object.assign({},o),e?null==n?t.addUndirectedEdge(r,i,o):t.addUndirectedEdgeWithKey(n,r,i,o):null==n?t.addDirectedEdge(r,i,o):t.addDirectedEdgeWithKey(n,r,i,o)}},212:(t,e)=>{e.B=function(t,e,n){return n=Object.assign({},n),t.addNode(e,n)}},308:(t,e)=>{function n(t){return"number"!=typeof t||isNaN(t)?1:t}e.Q6=function(t){return function(t,e){var n={},r=function(t){return void 0===t?e:t};"function"==typeof e&&(r=e);var i=function(e){return r(e[t])},o=function(){return r(void 0)};return"string"==typeof t?(n.fromAttributes=i,n.fromGraph=function(t,e){return i(t.getEdgeAttributes(e))},n.fromEntry=function(t,e){return i(e)},n.fromPartialEntry=n.fromEntry,n.fromMinimalEntry=n.fromEntry):"function"==typeof t?(n.fromAttributes=function(){throw new Error("graphology-utils/getters/createEdgeValueGetter: irrelevant usage.")},n.fromGraph=function(e,n){var i=e.extremities(n);return r(t(n,e.getEdgeAttributes(n),i[0],i[1],e.getNodeAttributes(i[0]),e.getNodeAttributes(i[1]),e.isUndirected(n)))},n.fromEntry=function(e,n,i,o,a,s,h){return r(t(e,n,i,o,a,s,h))},n.fromPartialEntry=function(e,n,i,o){return r(t(e,n,i,o))},n.fromMinimalEntry=function(e,n){return r(t(e,n))}):(n.fromAttributes=o,n.fromGraph=o,n.fromEntry=o,n.fromMinimalEntry=o),n}(t,n)}},186:t=>{t.exports=function(t){return null!==t&&"object"==typeof t&&"function"==typeof t.addUndirectedEdgeWithKey&&"function"==typeof t.dropNode&&"boolean"==typeof t.multi}},698:function(t){t.exports=function(){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,r(t,e)}function n(t){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},n(t)}function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}function i(t,e,n){return i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}()?Reflect.construct.bind():function(t,e,n){var i=[null];i.push.apply(i,e);var o=new(Function.bind.apply(t,i));return n&&r(o,n.prototype),o},i.apply(null,arguments)}function o(t){var e="function"==typeof Map?new Map:void 0;return o=function(t){if(null===t||(o=t,-1===Function.toString.call(o).indexOf("[native code]")))return t;var o;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,a)}function a(){return i(t,arguments,n(this).constructor)}return a.prototype=Object.create(t.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),r(a,t)},o(t)}function a(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var s=function(){for(var t=arguments[0],e=1,n=arguments.length;e<n;e++)if(arguments[e])for(var r in arguments[e])t[r]=arguments[e][r];return t};function h(t,e,n,r){var i=t._nodes.get(e),o=null;return i?o="mixed"===r?i.out&&i.out[n]||i.undirected&&i.undirected[n]:"directed"===r?i.out&&i.out[n]:i.undirected&&i.undirected[n]:o}function u(e){return"object"===t(e)&&null!==e}function c(t){var e;for(e in t)return!1;return!0}function d(t,e,n){Object.defineProperty(t,e,{enumerable:!1,configurable:!1,writable:!0,value:n})}function l(t,e,n){var r={enumerable:!0,configurable:!0};"function"==typeof n?r.get=n:(r.value=n,r.writable=!1),Object.defineProperty(t,e,r)}function p(t){return!(!u(t)||t.attributes&&!Array.isArray(t.attributes))}"function"==typeof Object.assign&&(s=Object.assign);var f,g={exports:{}},v="object"==typeof Reflect?Reflect:null,y=v&&"function"==typeof v.apply?v.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};f=v&&"function"==typeof v.ownKeys?v.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var m=Number.isNaN||function(t){return t!=t};function b(){b.init.call(this)}g.exports=b,g.exports.once=function(t,e){return new Promise((function(n,r){function i(n){t.removeListener(e,o),r(n)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",i),n([].slice.call(arguments))}N(t,e,o,{once:!0}),"error"!==e&&function(t,e,n){"function"==typeof t.on&&N(t,"error",e,{once:!0})}(t,i)}))},b.EventEmitter=b,b.prototype._events=void 0,b.prototype._eventsCount=0,b.prototype._maxListeners=void 0;var w=10;function _(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function x(t){return void 0===t._maxListeners?b.defaultMaxListeners:t._maxListeners}function C(t,e,n,r){var i,o,a,s;if(_(n),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),o=t._events),a=o[e]),void 0===a)a=o[e]=n,++t._eventsCount;else if("function"==typeof a?a=o[e]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(i=x(t))>0&&a.length>i&&!a.warned){a.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=t,h.type=e,h.count=a.length,s=h,console&&console.warn&&console.warn(s)}return t}function E(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function L(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=E.bind(r);return i.listener=n,r.wrapFn=i,i}function S(t,e,n){var r=t._events;if(void 0===r)return[];var i=r[e];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(i):A(i,i.length)}function M(t){var e=this._events;if(void 0!==e){var n=e[t];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function A(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}function N(t,e,n,r){if("function"==typeof t.on)r.once?t.once(e,n):t.on(e,n);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function i(o){r.once&&t.removeEventListener(e,i),n(o)}))}}function k(t){if("function"!=typeof t)throw new Error("obliterator/iterator: expecting a function!");this.next=t}Object.defineProperty(b,"defaultMaxListeners",{enumerable:!0,get:function(){return w},set:function(t){if("number"!=typeof t||t<0||m(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");w=t}}),b.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},b.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||m(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},b.prototype.getMaxListeners=function(){return x(this)},b.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var r="error"===t,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var s=i[t];if(void 0===s)return!1;if("function"==typeof s)y(s,this,e);else{var h=s.length,u=A(s,h);for(n=0;n<h;++n)y(u[n],this,e)}return!0},b.prototype.addListener=function(t,e){return C(this,t,e,!1)},b.prototype.on=b.prototype.addListener,b.prototype.prependListener=function(t,e){return C(this,t,e,!0)},b.prototype.once=function(t,e){return _(e),this.on(t,L(this,t,e)),this},b.prototype.prependOnceListener=function(t,e){return _(e),this.prependListener(t,L(this,t,e)),this},b.prototype.removeListener=function(t,e){var n,r,i,o,a;if(_(e),void 0===(r=this._events))return this;if(void 0===(n=r[t]))return this;if(n===e||n.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===e||n[o].listener===e){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(n,i),1===n.length&&(r[t]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",t,a||e)}return this},b.prototype.off=b.prototype.removeListener,b.prototype.removeAllListeners=function(t){var e,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[t]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(void 0!==e)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},b.prototype.listeners=function(t){return S(this,t,!0)},b.prototype.rawListeners=function(t){return S(this,t,!1)},b.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):M.call(t,e)},b.prototype.listenerCount=M,b.prototype.eventNames=function(){return this._eventsCount>0?f(this._events):[]},"undefined"!=typeof Symbol&&(k.prototype[Symbol.iterator]=function(){return this}),k.of=function(){var t=arguments,e=t.length,n=0;return new k((function(){return n>=e?{done:!0}:{done:!1,value:t[n++]}}))},k.empty=function(){return new k((function(){return{done:!0}}))},k.fromSequence=function(t){var e=0,n=t.length;return new k((function(){return e>=n?{done:!0}:{done:!1,value:t[e++]}}))},k.is=function(t){return t instanceof k||"object"==typeof t&&null!==t&&"function"==typeof t.next};var P=k,D={};D.ARRAY_BUFFER_SUPPORT="undefined"!=typeof ArrayBuffer,D.SYMBOL_SUPPORT="undefined"!=typeof Symbol;var G=P,F=D,O=F.ARRAY_BUFFER_SUPPORT,T=F.SYMBOL_SUPPORT,R=function(t){var e=function(t){return"string"==typeof t||Array.isArray(t)||O&&ArrayBuffer.isView(t)?G.fromSequence(t):"object"!=typeof t||null===t?null:T&&"function"==typeof t[Symbol.iterator]?t[Symbol.iterator]():"function"==typeof t.next?t:null}(t);if(!e)throw new Error("obliterator: target is not iterable nor a valid iterator.");return e},j=R,z=function(t,e){for(var n,r=arguments.length>1?e:1/0,i=r!==1/0?new Array(r):[],o=0,a=j(t);;){if(o===r)return i;if((n=a.next()).done)return o!==e&&(i.length=o),i;i[o++]=n.value}},B=function(t){function n(e){var n;return(n=t.call(this)||this).name="GraphError",n.message=e,n}return e(n,t),n}(o(Error)),U=function(t){function n(e){var r;return(r=t.call(this,e)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(a(r),n.prototype.constructor),r}return e(n,t),n}(B),I=function(t){function n(e){var r;return(r=t.call(this,e)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(a(r),n.prototype.constructor),r}return e(n,t),n}(B),H=function(t){function n(e){var r;return(r=t.call(this,e)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(a(r),n.prototype.constructor),r}return e(n,t),n}(B);function W(t,e){this.key=t,this.attributes=e,this.clear()}function V(t,e){this.key=t,this.attributes=e,this.clear()}function q(t,e){this.key=t,this.attributes=e,this.clear()}function Z(t,e,n,r,i){this.key=e,this.attributes=i,this.undirected=t,this.source=n,this.target=r}function Y(t,e,n,r,i,o,a){var s,h,u,c;if(r=""+r,0===n){if(!(s=t._nodes.get(r)))throw new I("Graph.".concat(e,': could not find the "').concat(r,'" node in the graph.'));u=i,c=o}else if(3===n){if(i=""+i,!(h=t._edges.get(i)))throw new I("Graph.".concat(e,': could not find the "').concat(i,'" edge in the graph.'));var d=h.source.key,l=h.target.key;if(r===d)s=h.target;else{if(r!==l)throw new I("Graph.".concat(e,': the "').concat(r,'" node is not attached to the "').concat(i,'" edge (').concat(d,", ").concat(l,")."));s=h.source}u=o,c=a}else{if(!(h=t._edges.get(r)))throw new I("Graph.".concat(e,': could not find the "').concat(r,'" edge in the graph.'));s=1===n?h.source:h.target,u=i,c=o}return[s,u,c]}W.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}},V.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}},q.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}},Z.prototype.attach=function(){var t="out",e="in";this.undirected&&(t=e="undirected");var n=this.source.key,r=this.target.key;this.source[t][r]=this,this.undirected&&n===r||(this.target[e][n]=this)},Z.prototype.attachMulti=function(){var t="out",e="in",n=this.source.key,r=this.target.key;this.undirected&&(t=e="undirected");var i=this.source[t],o=i[r];if(void 0===o)return i[r]=this,void(this.undirected&&n===r||(this.target[e][n]=this));o.previous=this,this.next=o,i[r]=this,this.target[e][n]=this},Z.prototype.detach=function(){var t=this.source.key,e=this.target.key,n="out",r="in";this.undirected&&(n=r="undirected"),delete this.source[n][e],delete this.target[r][t]},Z.prototype.detachMulti=function(){var t=this.source.key,e=this.target.key,n="out",r="in";this.undirected&&(n=r="undirected"),void 0===this.previous?void 0===this.next?(delete this.source[n][e],delete this.target[r][t]):(this.next.previous=void 0,this.source[n][e]=this.next,this.target[r][t]=this.next):(this.previous.next=this.next,void 0!==this.next&&(this.next.previous=this.previous))};var K=[{name:function(t){return"get".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o=Y(this,e,n,t,r,i),a=o[0],s=o[1];return a.attributes[s]}}},{name:function(t){return"get".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,r){return Y(this,e,n,t,r)[0].attributes}}},{name:function(t){return"has".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o=Y(this,e,n,t,r,i),a=o[0],s=o[1];return a.attributes.hasOwnProperty(s)}}},{name:function(t){return"set".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i,o){var a=Y(this,e,n,t,r,i,o),s=a[0],h=a[1],u=a[2];return s.attributes[h]=u,this.emit("nodeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:h}),this}}},{name:function(t){return"update".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i,o){var a=Y(this,e,n,t,r,i,o),s=a[0],h=a[1],u=a[2];if("function"!=typeof u)throw new U("Graph.".concat(e,": updater should be a function."));var c=s.attributes,d=u(c[h]);return c[h]=d,this.emit("nodeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:h}),this}}},{name:function(t){return"remove".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o=Y(this,e,n,t,r,i),a=o[0],s=o[1];return delete a.attributes[s],this.emit("nodeAttributesUpdated",{key:a.key,type:"remove",attributes:a.attributes,name:s}),this}}},{name:function(t){return"replace".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o=Y(this,e,n,t,r,i),a=o[0],s=o[1];if(!u(s))throw new U("Graph.".concat(e,": provided attributes are not a plain object."));return a.attributes=s,this.emit("nodeAttributesUpdated",{key:a.key,type:"replace",attributes:a.attributes}),this}}},{name:function(t){return"merge".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o=Y(this,e,n,t,r,i),a=o[0],h=o[1];if(!u(h))throw new U("Graph.".concat(e,": provided attributes are not a plain object."));return s(a.attributes,h),this.emit("nodeAttributesUpdated",{key:a.key,type:"merge",attributes:a.attributes,data:h}),this}}},{name:function(t){return"update".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o=Y(this,e,n,t,r,i),a=o[0],s=o[1];if("function"!=typeof s)throw new U("Graph.".concat(e,": provided updater is not a function."));return a.attributes=s(a.attributes),this.emit("nodeAttributesUpdated",{key:a.key,type:"update",attributes:a.attributes}),this}}}],X=[{name:function(t){return"get".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new H("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new H("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+r;if(r=arguments[2],!(i=h(this,o,a,n)))throw new I("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else{if("mixed"!==n)throw new H("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(i=this._edges.get(t)))throw new I("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}return i.attributes[r]}}},{name:function(t){return"get".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new H("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new H("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var i=""+t,o=""+arguments[1];if(!(r=h(this,i,o,n)))throw new I("Graph.".concat(e,': could not find an edge for the given path ("').concat(i,'" - "').concat(o,'").'))}else{if("mixed"!==n)throw new H("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(r=this._edges.get(t)))throw new I("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}return r.attributes}}},{name:function(t){return"has".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new H("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new H("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+r;if(r=arguments[2],!(i=h(this,o,a,n)))throw new I("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else{if("mixed"!==n)throw new H("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(i=this._edges.get(t)))throw new I("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}return i.attributes.hasOwnProperty(r)}}},{name:function(t){return"set".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new H("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new H("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+t,s=""+r;if(r=arguments[2],i=arguments[3],!(o=h(this,a,s,n)))throw new I("Graph.".concat(e,': could not find an edge for the given path ("').concat(a,'" - "').concat(s,'").'))}else{if("mixed"!==n)throw new H("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(o=this._edges.get(t)))throw new I("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}return o.attributes[r]=i,this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:r}),this}}},{name:function(t){return"update".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new H("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new H("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+t,s=""+r;if(r=arguments[2],i=arguments[3],!(o=h(this,a,s,n)))throw new I("Graph.".concat(e,': could not find an edge for the given path ("').concat(a,'" - "').concat(s,'").'))}else{if("mixed"!==n)throw new H("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(o=this._edges.get(t)))throw new I("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}if("function"!=typeof i)throw new U("Graph.".concat(e,": updater should be a function."));return o.attributes[r]=i(o.attributes[r]),this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:r}),this}}},{name:function(t){return"remove".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new H("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new H("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+r;if(r=arguments[2],!(i=h(this,o,a,n)))throw new I("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else{if("mixed"!==n)throw new H("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(i=this._edges.get(t)))throw new I("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}return delete i.attributes[r],this.emit("edgeAttributesUpdated",{key:i.key,type:"remove",attributes:i.attributes,name:r}),this}}},{name:function(t){return"replace".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new H("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new H("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+r;if(r=arguments[2],!(i=h(this,o,a,n)))throw new I("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else{if("mixed"!==n)throw new H("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(i=this._edges.get(t)))throw new I("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}if(!u(r))throw new U("Graph.".concat(e,": provided attributes are not a plain object."));return i.attributes=r,this.emit("edgeAttributesUpdated",{key:i.key,type:"replace",attributes:i.attributes}),this}}},{name:function(t){return"merge".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new H("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new H("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+r;if(r=arguments[2],!(i=h(this,o,a,n)))throw new I("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else{if("mixed"!==n)throw new H("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(i=this._edges.get(t)))throw new I("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}if(!u(r))throw new U("Graph.".concat(e,": provided attributes are not a plain object."));return s(i.attributes,r),this.emit("edgeAttributesUpdated",{key:i.key,type:"merge",attributes:i.attributes,data:r}),this}}},{name:function(t){return"update".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new H("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new H("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+r;if(r=arguments[2],!(i=h(this,o,a,n)))throw new I("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else{if("mixed"!==n)throw new H("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(i=this._edges.get(t)))throw new I("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}if("function"!=typeof r)throw new U("Graph.".concat(e,": provided updater is not a function."));return i.attributes=r(i.attributes),this.emit("edgeAttributesUpdated",{key:i.key,type:"update",attributes:i.attributes}),this}}}],Q=P,J=R,$=function(){var t=arguments,e=null,n=-1;return new Q((function(){for(var r=null;;){if(null===e){if(++n>=t.length)return{done:!0};e=J(t[n])}if(!0!==(r=e.next()).done)break;e=null}return r}))},tt=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function et(t,e,n,r){var i=!1;for(var o in e)if(o!==r){var a=e[o];if(i=n(a.key,a.attributes,a.source.key,a.target.key,a.source.attributes,a.target.attributes,a.undirected),t&&i)return a.key}}function nt(t,e,n,r){var i,o,a,s=!1;for(var h in e)if(h!==r){i=e[h];do{if(o=i.source,a=i.target,s=n(i.key,i.attributes,o.key,a.key,o.attributes,a.attributes,i.undirected),t&&s)return i.key;i=i.next}while(void 0!==i)}}function rt(t,e){var n,r=Object.keys(t),i=r.length,o=0;return new P((function(){do{if(n)n=n.next;else{if(o>=i)return{done:!0};var a=r[o++];if(a===e){n=void 0;continue}n=t[a]}}while(!n);return{done:!1,value:{edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected}}}))}function it(t,e,n,r){var i=e[n];if(i){var o=i.source,a=i.target;return r(i.key,i.attributes,o.key,a.key,o.attributes,a.attributes,i.undirected)&&t?i.key:void 0}}function ot(t,e,n,r){var i=e[n];if(i){var o=!1;do{if(o=r(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected),t&&o)return i.key;i=i.next}while(void 0!==i)}}function at(t,e){var n=t[e];return void 0!==n.next?new P((function(){if(!n)return{done:!0};var t={edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected};return n=n.next,{done:!1,value:t}})):P.of({edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected})}function st(t,e,n,r){if(0!==e.size)for(var i,o,a="mixed"!==n&&n!==e.type,s="undirected"===n,h=!1,u=e._edges.values();!0!==(i=u.next()).done;)if(o=i.value,!a||o.undirected===s){var c=o,d=c.key,l=c.attributes,p=c.source,f=c.target;if(h=r(d,l,p.key,f.key,p.attributes,f.attributes,o.undirected),t&&h)return d}}function ht(t,e,n,r,i,o){var a,s=e?nt:et;if("undirected"!==n){if("out"!==r&&(a=s(t,i.in,o),t&&a))return a;if("in"!==r&&(a=s(t,i.out,o,r?void 0:i.key),t&&a))return a}if("directed"!==n&&(a=s(t,i.undirected,o),t&&a))return a}function ut(t,e,n,r,i,o,a){var s,h=n?ot:it;if("undirected"!==e){if(void 0!==i.in&&"out"!==r&&(s=h(t,i.in,o,a),t&&s))return s;if(void 0!==i.out&&"in"!==r&&(r||i.key!==o)&&(s=h(t,i.out,o,a),t&&s))return s}if("directed"!==e&&void 0!==i.undirected&&(s=h(t,i.undirected,o,a),t&&s))return s}var ct=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function dt(){this.A=null,this.B=null}function lt(t,e,n,r,i){for(var o in r){var a=r[o],s=a.source,h=a.target,u=s===n?h:s;if(!e||!e.has(u.key)){var c=i(u.key,u.attributes);if(t&&c)return u.key}}}function pt(t,e,n,r,i){if("mixed"!==e){if("undirected"===e)return lt(t,null,r,r.undirected,i);if("string"==typeof n)return lt(t,null,r,r[n],i)}var o,a=new dt;if("undirected"!==e){if("out"!==n){if(o=lt(t,null,r,r.in,i),t&&o)return o;a.wrap(r.in)}if("in"!==n){if(o=lt(t,a,r,r.out,i),t&&o)return o;a.wrap(r.out)}}if("directed"!==e&&(o=lt(t,a,r,r.undirected,i),t&&o))return o}function ft(t,e,n){var r=Object.keys(n),i=r.length,o=0;return new P((function(){var a=null;do{if(o>=i)return t&&t.wrap(n),{done:!0};var s=n[r[o++]],h=s.source,u=s.target;a=h===e?u:h,t&&t.has(a.key)&&(a=null)}while(null===a);return{done:!1,value:{neighbor:a.key,attributes:a.attributes}}}))}function gt(t,e,n,r,i){for(var o,a,s,h,u,c,d,l=r._nodes.values(),p=r.type;!0!==(o=l.next()).done;){var f=!1;if(a=o.value,"undirected"!==p)for(s in h=a.out){u=h[s];do{if(c=u.target,f=!0,d=i(a.key,c.key,a.attributes,c.attributes,u.key,u.attributes,u.undirected),t&&d)return u;u=u.next}while(u)}if("directed"!==p)for(s in h=a.undirected)if(!(e&&a.key>s)){u=h[s];do{if((c=u.target).key!==s&&(c=u.source),f=!0,d=i(a.key,c.key,a.attributes,c.attributes,u.key,u.attributes,u.undirected),t&&d)return u;u=u.next}while(u)}if(n&&!f&&(d=i(a.key,null,a.attributes,null,null,null,null),t&&d))return null}}function vt(t){if(!u(t))throw new U('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in t))throw new U("Graph.import: serialized node is missing its key.");if("attributes"in t&&(!u(t.attributes)||null===t.attributes))throw new U("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function yt(t){if(!u(t))throw new U('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in t))throw new U("Graph.import: serialized edge is missing its source.");if(!("target"in t))throw new U("Graph.import: serialized edge is missing its target.");if("attributes"in t&&(!u(t.attributes)||null===t.attributes))throw new U("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in t&&"boolean"!=typeof t.undirected)throw new U("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}dt.prototype.wrap=function(t){null===this.A?this.A=t:null===this.B&&(this.B=t)},dt.prototype.has=function(t){return null!==this.A&&t in this.A||null!==this.B&&t in this.B};var mt,bt=(mt=255&Math.floor(256*Math.random()),function(){return mt++}),wt=new Set(["directed","undirected","mixed"]),_t=new Set(["domain","_events","_eventsCount","_maxListeners"]),xt={allowSelfLoops:!0,multi:!1,type:"mixed"};function Ct(t,e,n){var r=new t.NodeDataClass(e,n);return t._nodes.set(e,r),t.emit("nodeAdded",{key:e,attributes:n}),r}function Et(t,e,n,r,i,o,a,s){if(!r&&"undirected"===t.type)throw new H("Graph.".concat(e,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(r&&"directed"===t.type)throw new H("Graph.".concat(e,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(s&&!u(s))throw new U("Graph.".concat(e,': invalid attributes. Expecting an object but got "').concat(s,'"'));if(o=""+o,a=""+a,s=s||{},!t.allowSelfLoops&&o===a)throw new H("Graph.".concat(e,': source & target are the same ("').concat(o,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var h=t._nodes.get(o),c=t._nodes.get(a);if(!h)throw new I("Graph.".concat(e,': source node "').concat(o,'" not found.'));if(!c)throw new I("Graph.".concat(e,': target node "').concat(a,'" not found.'));var d={key:null,undirected:r,source:o,target:a,attributes:s};if(n)i=t._edgeKeyGenerator();else if(i=""+i,t._edges.has(i))throw new H("Graph.".concat(e,': the "').concat(i,'" edge already exists in the graph.'));if(!t.multi&&(r?void 0!==h.undirected[a]:void 0!==h.out[a]))throw new H("Graph.".concat(e,': an edge linking "').concat(o,'" to "').concat(a,"\" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option."));var l=new Z(r,i,h,c,s);t._edges.set(i,l);var p=o===a;return r?(h.undirectedDegree++,c.undirectedDegree++,p&&(h.undirectedLoops++,t._undirectedSelfLoopCount++)):(h.outDegree++,c.inDegree++,p&&(h.directedLoops++,t._directedSelfLoopCount++)),t.multi?l.attachMulti():l.attach(),r?t._undirectedSize++:t._directedSize++,d.key=i,t.emit("edgeAdded",d),i}function Lt(t,e,n,r,i,o,a,h,c){if(!r&&"undirected"===t.type)throw new H("Graph.".concat(e,": you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead."));if(r&&"directed"===t.type)throw new H("Graph.".concat(e,": you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead."));if(h)if(c){if("function"!=typeof h)throw new U("Graph.".concat(e,': invalid updater function. Expecting a function but got "').concat(h,'"'))}else if(!u(h))throw new U("Graph.".concat(e,': invalid attributes. Expecting an object but got "').concat(h,'"'));var d;if(o=""+o,a=""+a,c&&(d=h,h=void 0),!t.allowSelfLoops&&o===a)throw new H("Graph.".concat(e,': source & target are the same ("').concat(o,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var l,p,f=t._nodes.get(o),g=t._nodes.get(a);if(!n&&(l=t._edges.get(i))){if(!(l.source.key===o&&l.target.key===a||r&&l.source.key===a&&l.target.key===o))throw new H("Graph.".concat(e,': inconsistency detected when attempting to merge the "').concat(i,'" edge with "').concat(o,'" source & "').concat(a,'" target vs. ("').concat(l.source.key,'", "').concat(l.target.key,'").'));p=l}if(p||t.multi||!f||(p=r?f.undirected[a]:f.out[a]),p){var v=[p.key,!1,!1,!1];if(c?!d:!h)return v;if(c){var y=p.attributes;p.attributes=d(y),t.emit("edgeAttributesUpdated",{type:"replace",key:p.key,attributes:p.attributes})}else s(p.attributes,h),t.emit("edgeAttributesUpdated",{type:"merge",key:p.key,attributes:p.attributes,data:h});return v}h=h||{},c&&d&&(h=d(h));var m={key:null,undirected:r,source:o,target:a,attributes:h};if(n)i=t._edgeKeyGenerator();else if(i=""+i,t._edges.has(i))throw new H("Graph.".concat(e,': the "').concat(i,'" edge already exists in the graph.'));var b=!1,w=!1;f||(f=Ct(t,o,{}),b=!0,o===a&&(g=f,w=!0)),g||(g=Ct(t,a,{}),w=!0),l=new Z(r,i,f,g,h),t._edges.set(i,l);var _=o===a;return r?(f.undirectedDegree++,g.undirectedDegree++,_&&(f.undirectedLoops++,t._undirectedSelfLoopCount++)):(f.outDegree++,g.inDegree++,_&&(f.directedLoops++,t._directedSelfLoopCount++)),t.multi?l.attachMulti():l.attach(),r?t._undirectedSize++:t._directedSize++,m.key=i,t.emit("edgeAdded",m),[i,!0,b,w]}function St(t,e){t._edges.delete(e.key);var n=e.source,r=e.target,i=e.attributes,o=e.undirected,a=n===r;o?(n.undirectedDegree--,r.undirectedDegree--,a&&(n.undirectedLoops--,t._undirectedSelfLoopCount--)):(n.outDegree--,r.inDegree--,a&&(n.directedLoops--,t._directedSelfLoopCount--)),t.multi?e.detachMulti():e.detach(),o?t._undirectedSize--:t._directedSize--,t.emit("edgeDropped",{key:e.key,attributes:i,source:n.key,target:r.key,undirected:o})}var Mt=function(n){function r(t){var e;if(e=n.call(this)||this,"boolean"!=typeof(t=s({},xt,t)).multi)throw new U("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(t.multi,'".'));if(!wt.has(t.type))throw new U('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(t.type,'".'));if("boolean"!=typeof t.allowSelfLoops)throw new U("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(t.allowSelfLoops,'".'));var r="mixed"===t.type?W:"directed"===t.type?V:q;d(a(e),"NodeDataClass",r);var i="geid_"+bt()+"_",o=0;return d(a(e),"_attributes",{}),d(a(e),"_nodes",new Map),d(a(e),"_edges",new Map),d(a(e),"_directedSize",0),d(a(e),"_undirectedSize",0),d(a(e),"_directedSelfLoopCount",0),d(a(e),"_undirectedSelfLoopCount",0),d(a(e),"_edgeKeyGenerator",(function(){var t;do{t=i+o++}while(e._edges.has(t));return t})),d(a(e),"_options",t),_t.forEach((function(t){return d(a(e),t,e[t])})),l(a(e),"order",(function(){return e._nodes.size})),l(a(e),"size",(function(){return e._edges.size})),l(a(e),"directedSize",(function(){return e._directedSize})),l(a(e),"undirectedSize",(function(){return e._undirectedSize})),l(a(e),"selfLoopCount",(function(){return e._directedSelfLoopCount+e._undirectedSelfLoopCount})),l(a(e),"directedSelfLoopCount",(function(){return e._directedSelfLoopCount})),l(a(e),"undirectedSelfLoopCount",(function(){return e._undirectedSelfLoopCount})),l(a(e),"multi",e._options.multi),l(a(e),"type",e._options.type),l(a(e),"allowSelfLoops",e._options.allowSelfLoops),l(a(e),"implementation",(function(){return"graphology"})),e}e(r,n);var i=r.prototype;return i._resetInstanceCounters=function(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0},i.hasNode=function(t){return this._nodes.has(""+t)},i.hasDirectedEdge=function(t,e){if("undirected"===this.type)return!1;if(1===arguments.length){var n=""+t,r=this._edges.get(n);return!!r&&!r.undirected}if(2===arguments.length){t=""+t,e=""+e;var i=this._nodes.get(t);return!!i&&i.out.hasOwnProperty(e)}throw new U("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.hasUndirectedEdge=function(t,e){if("directed"===this.type)return!1;if(1===arguments.length){var n=""+t,r=this._edges.get(n);return!!r&&r.undirected}if(2===arguments.length){t=""+t,e=""+e;var i=this._nodes.get(t);return!!i&&i.undirected.hasOwnProperty(e)}throw new U("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.hasEdge=function(t,e){if(1===arguments.length){var n=""+t;return this._edges.has(n)}if(2===arguments.length){t=""+t,e=""+e;var r=this._nodes.get(t);return!!r&&(void 0!==r.out&&r.out.hasOwnProperty(e)||void 0!==r.undirected&&r.undirected.hasOwnProperty(e))}throw new U("Graph.hasEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.directedEdge=function(t,e){if("undirected"!==this.type){if(t=""+t,e=""+e,this.multi)throw new H("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var n=this._nodes.get(t);if(!n)throw new I('Graph.directedEdge: could not find the "'.concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new I('Graph.directedEdge: could not find the "'.concat(e,'" target node in the graph.'));var r=n.out&&n.out[e]||void 0;return r?r.key:void 0}},i.undirectedEdge=function(t,e){if("directed"!==this.type){if(t=""+t,e=""+e,this.multi)throw new H("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var n=this._nodes.get(t);if(!n)throw new I('Graph.undirectedEdge: could not find the "'.concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new I('Graph.undirectedEdge: could not find the "'.concat(e,'" target node in the graph.'));var r=n.undirected&&n.undirected[e]||void 0;return r?r.key:void 0}},i.edge=function(t,e){if(this.multi)throw new H("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new I('Graph.edge: could not find the "'.concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new I('Graph.edge: could not find the "'.concat(e,'" target node in the graph.'));var r=n.out&&n.out[e]||n.undirected&&n.undirected[e]||void 0;if(r)return r.key},i.areDirectedNeighbors=function(t,e){t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new I('Graph.areDirectedNeighbors: could not find the "'.concat(t,'" node in the graph.'));return"undirected"!==this.type&&(e in n.in||e in n.out)},i.areOutNeighbors=function(t,e){t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new I('Graph.areOutNeighbors: could not find the "'.concat(t,'" node in the graph.'));return"undirected"!==this.type&&e in n.out},i.areInNeighbors=function(t,e){t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new I('Graph.areInNeighbors: could not find the "'.concat(t,'" node in the graph.'));return"undirected"!==this.type&&e in n.in},i.areUndirectedNeighbors=function(t,e){t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new I('Graph.areUndirectedNeighbors: could not find the "'.concat(t,'" node in the graph.'));return"directed"!==this.type&&e in n.undirected},i.areNeighbors=function(t,e){t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new I('Graph.areNeighbors: could not find the "'.concat(t,'" node in the graph.'));return"undirected"!==this.type&&(e in n.in||e in n.out)||"directed"!==this.type&&e in n.undirected},i.areInboundNeighbors=function(t,e){t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new I('Graph.areInboundNeighbors: could not find the "'.concat(t,'" node in the graph.'));return"undirected"!==this.type&&e in n.in||"directed"!==this.type&&e in n.undirected},i.areOutboundNeighbors=function(t,e){t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new I('Graph.areOutboundNeighbors: could not find the "'.concat(t,'" node in the graph.'));return"undirected"!==this.type&&e in n.out||"directed"!==this.type&&e in n.undirected},i.inDegree=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new I('Graph.inDegree: could not find the "'.concat(t,'" node in the graph.'));return"undirected"===this.type?0:e.inDegree},i.outDegree=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new I('Graph.outDegree: could not find the "'.concat(t,'" node in the graph.'));return"undirected"===this.type?0:e.outDegree},i.directedDegree=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new I('Graph.directedDegree: could not find the "'.concat(t,'" node in the graph.'));return"undirected"===this.type?0:e.inDegree+e.outDegree},i.undirectedDegree=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new I('Graph.undirectedDegree: could not find the "'.concat(t,'" node in the graph.'));return"directed"===this.type?0:e.undirectedDegree},i.inboundDegree=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new I('Graph.inboundDegree: could not find the "'.concat(t,'" node in the graph.'));var n=0;return"directed"!==this.type&&(n+=e.undirectedDegree),"undirected"!==this.type&&(n+=e.inDegree),n},i.outboundDegree=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new I('Graph.outboundDegree: could not find the "'.concat(t,'" node in the graph.'));var n=0;return"directed"!==this.type&&(n+=e.undirectedDegree),"undirected"!==this.type&&(n+=e.outDegree),n},i.degree=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new I('Graph.degree: could not find the "'.concat(t,'" node in the graph.'));var n=0;return"directed"!==this.type&&(n+=e.undirectedDegree),"undirected"!==this.type&&(n+=e.inDegree+e.outDegree),n},i.inDegreeWithoutSelfLoops=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new I('Graph.inDegreeWithoutSelfLoops: could not find the "'.concat(t,'" node in the graph.'));return"undirected"===this.type?0:e.inDegree-e.directedLoops},i.outDegreeWithoutSelfLoops=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new I('Graph.outDegreeWithoutSelfLoops: could not find the "'.concat(t,'" node in the graph.'));return"undirected"===this.type?0:e.outDegree-e.directedLoops},i.directedDegreeWithoutSelfLoops=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new I('Graph.directedDegreeWithoutSelfLoops: could not find the "'.concat(t,'" node in the graph.'));return"undirected"===this.type?0:e.inDegree+e.outDegree-2*e.directedLoops},i.undirectedDegreeWithoutSelfLoops=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new I('Graph.undirectedDegreeWithoutSelfLoops: could not find the "'.concat(t,'" node in the graph.'));return"directed"===this.type?0:e.undirectedDegree-2*e.undirectedLoops},i.inboundDegreeWithoutSelfLoops=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new I('Graph.inboundDegreeWithoutSelfLoops: could not find the "'.concat(t,'" node in the graph.'));var n=0,r=0;return"directed"!==this.type&&(n+=e.undirectedDegree,r+=2*e.undirectedLoops),"undirected"!==this.type&&(n+=e.inDegree,r+=e.directedLoops),n-r},i.outboundDegreeWithoutSelfLoops=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new I('Graph.outboundDegreeWithoutSelfLoops: could not find the "'.concat(t,'" node in the graph.'));var n=0,r=0;return"directed"!==this.type&&(n+=e.undirectedDegree,r+=2*e.undirectedLoops),"undirected"!==this.type&&(n+=e.outDegree,r+=e.directedLoops),n-r},i.degreeWithoutSelfLoops=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new I('Graph.degreeWithoutSelfLoops: could not find the "'.concat(t,'" node in the graph.'));var n=0,r=0;return"directed"!==this.type&&(n+=e.undirectedDegree,r+=2*e.undirectedLoops),"undirected"!==this.type&&(n+=e.inDegree+e.outDegree,r+=2*e.directedLoops),n-r},i.source=function(t){t=""+t;var e=this._edges.get(t);if(!e)throw new I('Graph.source: could not find the "'.concat(t,'" edge in the graph.'));return e.source.key},i.target=function(t){t=""+t;var e=this._edges.get(t);if(!e)throw new I('Graph.target: could not find the "'.concat(t,'" edge in the graph.'));return e.target.key},i.extremities=function(t){t=""+t;var e=this._edges.get(t);if(!e)throw new I('Graph.extremities: could not find the "'.concat(t,'" edge in the graph.'));return[e.source.key,e.target.key]},i.opposite=function(t,e){t=""+t,e=""+e;var n=this._edges.get(e);if(!n)throw new I('Graph.opposite: could not find the "'.concat(e,'" edge in the graph.'));var r=n.source.key,i=n.target.key;if(t===r)return i;if(t===i)return r;throw new I('Graph.opposite: the "'.concat(t,'" node is not attached to the "').concat(e,'" edge (').concat(r,", ").concat(i,")."))},i.hasExtremity=function(t,e){t=""+t,e=""+e;var n=this._edges.get(t);if(!n)throw new I('Graph.hasExtremity: could not find the "'.concat(t,'" edge in the graph.'));return n.source.key===e||n.target.key===e},i.isUndirected=function(t){t=""+t;var e=this._edges.get(t);if(!e)throw new I('Graph.isUndirected: could not find the "'.concat(t,'" edge in the graph.'));return e.undirected},i.isDirected=function(t){t=""+t;var e=this._edges.get(t);if(!e)throw new I('Graph.isDirected: could not find the "'.concat(t,'" edge in the graph.'));return!e.undirected},i.isSelfLoop=function(t){t=""+t;var e=this._edges.get(t);if(!e)throw new I('Graph.isSelfLoop: could not find the "'.concat(t,'" edge in the graph.'));return e.source===e.target},i.addNode=function(t,e){var n=function(t,e,n){if(n&&!u(n))throw new U('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(n,'"'));if(e=""+e,n=n||{},t._nodes.has(e))throw new H('Graph.addNode: the "'.concat(e,'" node already exist in the graph.'));var r=new t.NodeDataClass(e,n);return t._nodes.set(e,r),t.emit("nodeAdded",{key:e,attributes:n}),r}(this,t,e);return n.key},i.mergeNode=function(t,e){if(e&&!u(e))throw new U('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(e,'"'));t=""+t,e=e||{};var n=this._nodes.get(t);return n?(e&&(s(n.attributes,e),this.emit("nodeAttributesUpdated",{type:"merge",key:t,attributes:n.attributes,data:e})),[t,!1]):(n=new this.NodeDataClass(t,e),this._nodes.set(t,n),this.emit("nodeAdded",{key:t,attributes:e}),[t,!0])},i.updateNode=function(t,e){if(e&&"function"!=typeof e)throw new U('Graph.updateNode: invalid updater function. Expecting a function but got "'.concat(e,'"'));t=""+t;var n=this._nodes.get(t);if(n){if(e){var r=n.attributes;n.attributes=e(r),this.emit("nodeAttributesUpdated",{type:"replace",key:t,attributes:n.attributes})}return[t,!1]}var i=e?e({}):{};return n=new this.NodeDataClass(t,i),this._nodes.set(t,n),this.emit("nodeAdded",{key:t,attributes:i}),[t,!0]},i.dropNode=function(t){t=""+t;var e,n=this._nodes.get(t);if(!n)throw new I('Graph.dropNode: could not find the "'.concat(t,'" node in the graph.'));if("undirected"!==this.type){for(var r in n.out){e=n.out[r];do{St(this,e),e=e.next}while(e)}for(var i in n.in){e=n.in[i];do{St(this,e),e=e.next}while(e)}}if("directed"!==this.type)for(var o in n.undirected){e=n.undirected[o];do{St(this,e),e=e.next}while(e)}this._nodes.delete(t),this.emit("nodeDropped",{key:t,attributes:n.attributes})},i.dropEdge=function(t){var e;if(arguments.length>1){var n=""+arguments[0],r=""+arguments[1];if(!(e=h(this,n,r,this.type)))throw new I('Graph.dropEdge: could not find the "'.concat(n,'" -> "').concat(r,'" edge in the graph.'))}else if(t=""+t,!(e=this._edges.get(t)))throw new I('Graph.dropEdge: could not find the "'.concat(t,'" edge in the graph.'));return St(this,e),this},i.dropDirectedEdge=function(t,e){if(arguments.length<2)throw new H("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new H("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");var n=h(this,t=""+t,e=""+e,"directed");if(!n)throw new I('Graph.dropDirectedEdge: could not find a "'.concat(t,'" -> "').concat(e,'" edge in the graph.'));return St(this,n),this},i.dropUndirectedEdge=function(t,e){if(arguments.length<2)throw new H("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new H("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");var n=h(this,t,e,"undirected");if(!n)throw new I('Graph.dropUndirectedEdge: could not find a "'.concat(t,'" -> "').concat(e,'" edge in the graph.'));return St(this,n),this},i.clear=function(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")},i.clearEdges=function(){for(var t,e=this._nodes.values();!0!==(t=e.next()).done;)t.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")},i.getAttribute=function(t){return this._attributes[t]},i.getAttributes=function(){return this._attributes},i.hasAttribute=function(t){return this._attributes.hasOwnProperty(t)},i.setAttribute=function(t,e){return this._attributes[t]=e,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this},i.updateAttribute=function(t,e){if("function"!=typeof e)throw new U("Graph.updateAttribute: updater should be a function.");var n=this._attributes[t];return this._attributes[t]=e(n),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this},i.removeAttribute=function(t){return delete this._attributes[t],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:t}),this},i.replaceAttributes=function(t){if(!u(t))throw new U("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=t,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this},i.mergeAttributes=function(t){if(!u(t))throw new U("Graph.mergeAttributes: provided attributes are not a plain object.");return s(this._attributes,t),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:t}),this},i.updateAttributes=function(t){if("function"!=typeof t)throw new U("Graph.updateAttributes: provided updater is not a function.");return this._attributes=t(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this},i.updateEachNodeAttributes=function(t,e){if("function"!=typeof t)throw new U("Graph.updateEachNodeAttributes: expecting an updater function.");if(e&&!p(e))throw new U("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var n,r,i=this._nodes.values();!0!==(n=i.next()).done;)(r=n.value).attributes=t(r.key,r.attributes);this.emit("eachNodeAttributesUpdated",{hints:e||null})},i.updateEachEdgeAttributes=function(t,e){if("function"!=typeof t)throw new U("Graph.updateEachEdgeAttributes: expecting an updater function.");if(e&&!p(e))throw new U("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var n,r,i,o,a=this._edges.values();!0!==(n=a.next()).done;)i=(r=n.value).source,o=r.target,r.attributes=t(r.key,r.attributes,i.key,o.key,i.attributes,o.attributes,r.undirected);this.emit("eachEdgeAttributesUpdated",{hints:e||null})},i.forEachAdjacencyEntry=function(t){if("function"!=typeof t)throw new U("Graph.forEachAdjacencyEntry: expecting a callback.");gt(!1,!1,!1,this,t)},i.forEachAdjacencyEntryWithOrphans=function(t){if("function"!=typeof t)throw new U("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");gt(!1,!1,!0,this,t)},i.forEachAssymetricAdjacencyEntry=function(t){if("function"!=typeof t)throw new U("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");gt(!1,!0,!1,this,t)},i.forEachAssymetricAdjacencyEntryWithOrphans=function(t){if("function"!=typeof t)throw new U("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");gt(!1,!0,!0,this,t)},i.nodes=function(){return"function"==typeof Array.from?Array.from(this._nodes.keys()):z(this._nodes.keys(),this._nodes.size)},i.forEachNode=function(t){if("function"!=typeof t)throw new U("Graph.forEachNode: expecting a callback.");for(var e,n,r=this._nodes.values();!0!==(e=r.next()).done;)t((n=e.value).key,n.attributes)},i.findNode=function(t){if("function"!=typeof t)throw new U("Graph.findNode: expecting a callback.");for(var e,n,r=this._nodes.values();!0!==(e=r.next()).done;)if(t((n=e.value).key,n.attributes))return n.key},i.mapNodes=function(t){if("function"!=typeof t)throw new U("Graph.mapNode: expecting a callback.");for(var e,n,r=this._nodes.values(),i=new Array(this.order),o=0;!0!==(e=r.next()).done;)n=e.value,i[o++]=t(n.key,n.attributes);return i},i.someNode=function(t){if("function"!=typeof t)throw new U("Graph.someNode: expecting a callback.");for(var e,n,r=this._nodes.values();!0!==(e=r.next()).done;)if(t((n=e.value).key,n.attributes))return!0;return!1},i.everyNode=function(t){if("function"!=typeof t)throw new U("Graph.everyNode: expecting a callback.");for(var e,n,r=this._nodes.values();!0!==(e=r.next()).done;)if(!t((n=e.value).key,n.attributes))return!1;return!0},i.filterNodes=function(t){if("function"!=typeof t)throw new U("Graph.filterNodes: expecting a callback.");for(var e,n,r=this._nodes.values(),i=[];!0!==(e=r.next()).done;)t((n=e.value).key,n.attributes)&&i.push(n.key);return i},i.reduceNodes=function(t,e){if("function"!=typeof t)throw new U("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new U("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");for(var n,r,i=e,o=this._nodes.values();!0!==(n=o.next()).done;)i=t(i,(r=n.value).key,r.attributes);return i},i.nodeEntries=function(){var t=this._nodes.values();return new P((function(){var e=t.next();if(e.done)return e;var n=e.value;return{value:{node:n.key,attributes:n.attributes},done:!1}}))},i.export=function(){var t=this,e=new Array(this._nodes.size),n=0;this._nodes.forEach((function(t,r){e[n++]=function(t,e){var n={key:t};return c(e.attributes)||(n.attributes=s({},e.attributes)),n}(r,t)}));var r=new Array(this._edges.size);return n=0,this._edges.forEach((function(e,i){r[n++]=function(t,e,n){var r={key:e,source:n.source.key,target:n.target.key};return c(n.attributes)||(r.attributes=s({},n.attributes)),"mixed"===t&&n.undirected&&(r.undirected=!0),r}(t.type,i,e)})),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:e,edges:r}},i.import=function(t){var e,n,i,o,a,s=this,h=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t instanceof r)return t.forEachNode((function(t,e){h?s.mergeNode(t,e):s.addNode(t,e)})),t.forEachEdge((function(t,e,n,r,i,o,a){h?a?s.mergeUndirectedEdgeWithKey(t,n,r,e):s.mergeDirectedEdgeWithKey(t,n,r,e):a?s.addUndirectedEdgeWithKey(t,n,r,e):s.addDirectedEdgeWithKey(t,n,r,e)})),this;if(!u(t))throw new U("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(t.attributes){if(!u(t.attributes))throw new U("Graph.import: invalid attributes. Expecting a plain object.");h?this.mergeAttributes(t.attributes):this.replaceAttributes(t.attributes)}if(t.nodes){if(i=t.nodes,!Array.isArray(i))throw new U("Graph.import: invalid nodes. Expecting an array.");for(e=0,n=i.length;e<n;e++){vt(o=i[e]);var c=o,d=c.key,l=c.attributes;h?this.mergeNode(d,l):this.addNode(d,l)}}if(t.edges){var p=!1;if("undirected"===this.type&&(p=!0),i=t.edges,!Array.isArray(i))throw new U("Graph.import: invalid edges. Expecting an array.");for(e=0,n=i.length;e<n;e++){yt(a=i[e]);var f=a,g=f.source,v=f.target,y=f.attributes,m=f.undirected,b=void 0===m?p:m;"key"in a?(h?b?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:b?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,a.key,g,v,y):(h?b?this.mergeUndirectedEdge:this.mergeDirectedEdge:b?this.addUndirectedEdge:this.addDirectedEdge).call(this,g,v,y)}}return this},i.nullCopy=function(t){var e=new r(s({},this._options,t));return e.replaceAttributes(s({},this.getAttributes())),e},i.emptyCopy=function(t){var e=this.nullCopy(t);return this._nodes.forEach((function(t,n){var r=s({},t.attributes);t=new e.NodeDataClass(n,r),e._nodes.set(n,t)})),e},i.copy=function(t){if("string"==typeof(t=t||{}).type&&t.type!==this.type&&"mixed"!==t.type)throw new H('Graph.copy: cannot create an incompatible copy from "'.concat(this.type,'" type to "').concat(t.type,'" because this would mean losing information about the current graph.'));if("boolean"==typeof t.multi&&t.multi!==this.multi&&!0!==t.multi)throw new H("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if("boolean"==typeof t.allowSelfLoops&&t.allowSelfLoops!==this.allowSelfLoops&&!0!==t.allowSelfLoops)throw new H("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");for(var e,n,r=this.emptyCopy(t),i=this._edges.values();!0!==(e=i.next()).done;)Et(r,"copy",!1,(n=e.value).undirected,n.key,n.source.key,n.target.key,s({},n.attributes));return r},i.toJSON=function(){return this.export()},i.toString=function(){return"[object Graph]"},i.inspect=function(){var e=this,n={};this._nodes.forEach((function(t,e){n[e]=t.attributes}));var r={},i={};this._edges.forEach((function(t,n){var o,a=t.undirected?"--":"->",s="",h=t.source.key,u=t.target.key;t.undirected&&h>u&&(o=h,h=u,u=o);var c="(".concat(h,")").concat(a,"(").concat(u,")");n.startsWith("geid_")?e.multi&&(void 0===i[c]?i[c]=0:i[c]++,s+="".concat(i[c],". ")):s+="[".concat(n,"]: "),r[s+=c]=t.attributes}));var o={};for(var a in this)this.hasOwnProperty(a)&&!_t.has(a)&&"function"!=typeof this[a]&&"symbol"!==t(a)&&(o[a]=this[a]);return o.attributes=this._attributes,o.nodes=n,o.edges=r,d(o,"constructor",this.constructor),o},r}(g.exports.EventEmitter);"undefined"!=typeof Symbol&&(Mt.prototype[Symbol.for("nodejs.util.inspect.custom")]=Mt.prototype.inspect),[{name:function(t){return"".concat(t,"Edge")},generateKey:!0},{name:function(t){return"".concat(t,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(t){return"".concat(t,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(t){return"".concat(t,"EdgeWithKey")}},{name:function(t){return"".concat(t,"DirectedEdgeWithKey")},type:"directed"},{name:function(t){return"".concat(t,"UndirectedEdgeWithKey")},type:"undirected"}].forEach((function(t){["add","merge","update"].forEach((function(e){var n=t.name(e),r="add"===e?Et:Lt;t.generateKey?Mt.prototype[n]=function(i,o,a){return r(this,n,!0,"undirected"===(t.type||this.type),null,i,o,a,"update"===e)}:Mt.prototype[n]=function(i,o,a,s){return r(this,n,!1,"undirected"===(t.type||this.type),i,o,a,s,"update"===e)}}))})),function(t){K.forEach((function(e){var n=e.name,r=e.attacher;r(t,n("Node"),0),r(t,n("Source"),1),r(t,n("Target"),2),r(t,n("Opposite"),3)}))}(Mt),function(t){X.forEach((function(e){var n=e.name,r=e.attacher;r(t,n("Edge"),"mixed"),r(t,n("DirectedEdge"),"directed"),r(t,n("UndirectedEdge"),"undirected")}))}(Mt),function(t){tt.forEach((function(e){!function(t,e){var n=e.name,r=e.type,i=e.direction;t.prototype[n]=function(t,e){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return[];if(!arguments.length)return function(t,e){if(0===t.size)return[];if("mixed"===e||e===t.type)return"function"==typeof Array.from?Array.from(t._edges.keys()):z(t._edges.keys(),t._edges.size);for(var n,r,i="undirected"===e?t.undirectedSize:t.directedSize,o=new Array(i),a="undirected"===e,s=t._edges.values(),h=0;!0!==(n=s.next()).done;)(r=n.value).undirected===a&&(o[h++]=r.key);return o}(this,r);if(1===arguments.length){t=""+t;var o=this._nodes.get(t);if(void 0===o)throw new I("Graph.".concat(n,': could not find the "').concat(t,'" node in the graph.'));return function(t,e,n,r){var i=[];return ht(!1,t,e,n,r,(function(t){i.push(t)})),i}(this.multi,"mixed"===r?this.type:r,i,o)}if(2===arguments.length){t=""+t,e=""+e;var a=this._nodes.get(t);if(!a)throw new I("Graph.".concat(n,': could not find the "').concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new I("Graph.".concat(n,': could not find the "').concat(e,'" target node in the graph.'));return function(t,e,n,r,i){var o=[];return ut(!1,t,e,n,r,i,(function(t){o.push(t)})),o}(r,this.multi,i,a,e)}throw new U("Graph.".concat(n,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(t,e),function(t,e){var n=e.name,r=e.type,i=e.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[o]=function(t,e,n){if("mixed"===r||"mixed"===this.type||r===this.type){if(1===arguments.length)return st(!1,this,r,n=t);if(2===arguments.length){t=""+t,n=e;var a=this._nodes.get(t);if(void 0===a)throw new I("Graph.".concat(o,': could not find the "').concat(t,'" node in the graph.'));return ht(!1,this.multi,"mixed"===r?this.type:r,i,a,n)}if(3===arguments.length){t=""+t,e=""+e;var s=this._nodes.get(t);if(!s)throw new I("Graph.".concat(o,': could not find the "').concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new I("Graph.".concat(o,': could not find the "').concat(e,'" target node in the graph.'));return ut(!1,r,this.multi,i,s,e,n)}throw new U("Graph.".concat(o,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}};var a="map"+n[0].toUpperCase()+n.slice(1);t.prototype[a]=function(){var t,e=Array.prototype.slice.call(arguments),n=e.pop();if(0===e.length){var i=0;"directed"!==r&&(i+=this.undirectedSize),"undirected"!==r&&(i+=this.directedSize),t=new Array(i);var a=0;e.push((function(e,r,i,o,s,h,u){t[a++]=n(e,r,i,o,s,h,u)}))}else t=[],e.push((function(e,r,i,o,a,s,h){t.push(n(e,r,i,o,a,s,h))}));return this[o].apply(this,e),t};var s="filter"+n[0].toUpperCase()+n.slice(1);t.prototype[s]=function(){var t=Array.prototype.slice.call(arguments),e=t.pop(),n=[];return t.push((function(t,r,i,o,a,s,h){e(t,r,i,o,a,s,h)&&n.push(t)})),this[o].apply(this,t),n};var h="reduce"+n[0].toUpperCase()+n.slice(1);t.prototype[h]=function(){var t,e,n=Array.prototype.slice.call(arguments);if(n.length<2||n.length>4)throw new U("Graph.".concat(h,": invalid number of arguments (expecting 2, 3 or 4 and got ").concat(n.length,")."));if("function"==typeof n[n.length-1]&&"function"!=typeof n[n.length-2])throw new U("Graph.".concat(h,": missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array."));2===n.length?(t=n[0],e=n[1],n=[]):3===n.length?(t=n[1],e=n[2],n=[n[0]]):4===n.length&&(t=n[2],e=n[3],n=[n[0],n[1]]);var r=e;return n.push((function(e,n,i,o,a,s,h){r=t(r,e,n,i,o,a,s,h)})),this[o].apply(this,n),r}}(t,e),function(t,e){var n=e.name,r=e.type,i=e.direction,o="find"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[o]=function(t,e,n){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return!1;if(1===arguments.length)return st(!0,this,r,n=t);if(2===arguments.length){t=""+t,n=e;var a=this._nodes.get(t);if(void 0===a)throw new I("Graph.".concat(o,': could not find the "').concat(t,'" node in the graph.'));return ht(!0,this.multi,"mixed"===r?this.type:r,i,a,n)}if(3===arguments.length){t=""+t,e=""+e;var s=this._nodes.get(t);if(!s)throw new I("Graph.".concat(o,': could not find the "').concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new I("Graph.".concat(o,': could not find the "').concat(e,'" target node in the graph.'));return ut(!0,r,this.multi,i,s,e,n)}throw new U("Graph.".concat(o,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))};var a="some"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[a]=function(){var t=Array.prototype.slice.call(arguments),e=t.pop();return t.push((function(t,n,r,i,o,a,s){return e(t,n,r,i,o,a,s)})),!!this[o].apply(this,t)};var s="every"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[s]=function(){var t=Array.prototype.slice.call(arguments),e=t.pop();return t.push((function(t,n,r,i,o,a,s){return!e(t,n,r,i,o,a,s)})),!this[o].apply(this,t)}}(t,e),function(t,e){var n=e.name,r=e.type,i=e.direction,o=n.slice(0,-1)+"Entries";t.prototype[o]=function(t,e){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return P.empty();if(!arguments.length)return function(t,e){if(0===t.size)return P.empty();var n="mixed"!==e&&e!==t.type,r="undirected"===e,i=t._edges.values();return new P((function(){for(var t,e;;){if((t=i.next()).done)return t;if(e=t.value,!n||e.undirected===r)break}return{value:{edge:e.key,attributes:e.attributes,source:e.source.key,target:e.target.key,sourceAttributes:e.source.attributes,targetAttributes:e.target.attributes,undirected:e.undirected},done:!1}}))}(this,r);if(1===arguments.length){t=""+t;var n=this._nodes.get(t);if(!n)throw new I("Graph.".concat(o,': could not find the "').concat(t,'" node in the graph.'));return function(t,e,n){var r=P.empty();return"undirected"!==t&&("out"!==e&&void 0!==n.in&&(r=$(r,rt(n.in))),"in"!==e&&void 0!==n.out&&(r=$(r,rt(n.out,e?void 0:n.key)))),"directed"!==t&&void 0!==n.undirected&&(r=$(r,rt(n.undirected))),r}(r,i,n)}if(2===arguments.length){t=""+t,e=""+e;var a=this._nodes.get(t);if(!a)throw new I("Graph.".concat(o,': could not find the "').concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new I("Graph.".concat(o,': could not find the "').concat(e,'" target node in the graph.'));return function(t,e,n,r){var i=P.empty();return"undirected"!==t&&(void 0!==n.in&&"out"!==e&&r in n.in&&(i=$(i,at(n.in,r))),void 0!==n.out&&"in"!==e&&r in n.out&&(e||n.key!==r)&&(i=$(i,at(n.out,r)))),"directed"!==t&&void 0!==n.undirected&&r in n.undirected&&(i=$(i,at(n.undirected,r))),i}(r,i,a,e)}throw new U("Graph.".concat(o,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(t,e)}))}(Mt),function(t){ct.forEach((function(e){(function(t,e){var n=e.name,r=e.type,i=e.direction;t.prototype[n]=function(t){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return[];t=""+t;var e=this._nodes.get(t);if(void 0===e)throw new I("Graph.".concat(n,': could not find the "').concat(t,'" node in the graph.'));return function(t,e,n){if("mixed"!==t){if("undirected"===t)return Object.keys(n.undirected);if("string"==typeof e)return Object.keys(n[e])}var r=[];return pt(!1,t,e,n,(function(t){r.push(t)})),r}("mixed"===r?this.type:r,i,e)}})(t,e),function(t,e){var n=e.name,r=e.type,i=e.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[o]=function(t,e){if("mixed"===r||"mixed"===this.type||r===this.type){t=""+t;var n=this._nodes.get(t);if(void 0===n)throw new I("Graph.".concat(o,': could not find the "').concat(t,'" node in the graph.'));pt(!1,"mixed"===r?this.type:r,i,n,e)}};var a="map"+n[0].toUpperCase()+n.slice(1);t.prototype[a]=function(t,e){var n=[];return this[o](t,(function(t,r){n.push(e(t,r))})),n};var s="filter"+n[0].toUpperCase()+n.slice(1);t.prototype[s]=function(t,e){var n=[];return this[o](t,(function(t,r){e(t,r)&&n.push(t)})),n};var h="reduce"+n[0].toUpperCase()+n.slice(1);t.prototype[h]=function(t,e,n){if(arguments.length<3)throw new U("Graph.".concat(h,": missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array."));var r=n;return this[o](t,(function(t,n){r=e(r,t,n)})),r}}(t,e),function(t,e){var n=e.name,r=e.type,i=e.direction,o=n[0].toUpperCase()+n.slice(1,-1),a="find"+o;t.prototype[a]=function(t,e){if("mixed"===r||"mixed"===this.type||r===this.type){t=""+t;var n=this._nodes.get(t);if(void 0===n)throw new I("Graph.".concat(a,': could not find the "').concat(t,'" node in the graph.'));return pt(!0,"mixed"===r?this.type:r,i,n,e)}};var s="some"+o;t.prototype[s]=function(t,e){return!!this[a](t,e)};var h="every"+o;t.prototype[h]=function(t,e){return!this[a](t,(function(t,n){return!e(t,n)}))}}(t,e),function(t,e){var n=e.name,r=e.type,i=e.direction,o=n.slice(0,-1)+"Entries";t.prototype[o]=function(t){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return P.empty();t=""+t;var e=this._nodes.get(t);if(void 0===e)throw new I("Graph.".concat(o,': could not find the "').concat(t,'" node in the graph.'));return function(t,e,n){if("mixed"!==t){if("undirected"===t)return ft(null,n,n.undirected);if("string"==typeof e)return ft(null,n,n[e])}var r=P.empty(),i=new dt;return"undirected"!==t&&("out"!==e&&(r=$(r,ft(i,n,n.in))),"in"!==e&&(r=$(r,ft(i,n,n.out)))),"directed"!==t&&(r=$(r,ft(i,n,n.undirected))),r}("mixed"===r?this.type:r,i,e)}}(t,e)}))}(Mt);var At=function(t){function n(e){var n=s({type:"directed"},e);if("multi"in n&&!1!==n.multi)throw new U("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("directed"!==n.type)throw new U('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return t.call(this,n)||this}return e(n,t),n}(Mt),Nt=function(t){function n(e){var n=s({type:"undirected"},e);if("multi"in n&&!1!==n.multi)throw new U("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("undirected"!==n.type)throw new U('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return t.call(this,n)||this}return e(n,t),n}(Mt),kt=function(t){function n(e){var n=s({multi:!0},e);if("multi"in n&&!0!==n.multi)throw new U("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");return t.call(this,n)||this}return e(n,t),n}(Mt),Pt=function(t){function n(e){var n=s({type:"directed",multi:!0},e);if("multi"in n&&!0!==n.multi)throw new U("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("directed"!==n.type)throw new U('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return t.call(this,n)||this}return e(n,t),n}(Mt),Dt=function(t){function n(e){var n=s({type:"undirected",multi:!0},e);if("multi"in n&&!0!==n.multi)throw new U("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("undirected"!==n.type)throw new U('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return t.call(this,n)||this}return e(n,t),n}(Mt);function Gt(t){t.from=function(e,n){var r=s({},e.options,n),i=new t(r);return i.import(e),i}}return Gt(Mt),Gt(At),Gt(Nt),Gt(kt),Gt(Pt),Gt(Dt),Mt.Graph=Mt,Mt.DirectedGraph=At,Mt.UndirectedGraph=Nt,Mt.MultiGraph=kt,Mt.MultiDirectedGraph=Pt,Mt.MultiUndirectedGraph=Dt,Mt.InvalidArgumentsGraphError=U,Mt.NotFoundGraphError=I,Mt.UsageGraphError=H,Mt}()},554:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=n(227),s=o(n(941)),h=n(524),u=n(291),c=1.5,d=function(t){function e(){var e=t.call(this)||this;return e.x=.5,e.y=.5,e.angle=0,e.ratio=1,e.minRatio=null,e.maxRatio=null,e.nextFrame=null,e.previousState=null,e.enabled=!0,e.previousState=e.getState(),e}return i(e,t),e.from=function(t){return(new e).setState(t)},e.prototype.enable=function(){return this.enabled=!0,this},e.prototype.disable=function(){return this.enabled=!1,this},e.prototype.getState=function(){return{x:this.x,y:this.y,angle:this.angle,ratio:this.ratio}},e.prototype.hasState=function(t){return this.x===t.x&&this.y===t.y&&this.ratio===t.ratio&&this.angle===t.angle},e.prototype.getPreviousState=function(){var t=this.previousState;return t?{x:t.x,y:t.y,angle:t.angle,ratio:t.ratio}:null},e.prototype.getBoundedRatio=function(t){var e=t;return"number"==typeof this.minRatio&&(e=Math.max(e,this.minRatio)),"number"==typeof this.maxRatio&&(e=Math.min(e,this.maxRatio)),e},e.prototype.validateState=function(t){var e={};return"number"==typeof t.x&&(e.x=t.x),"number"==typeof t.y&&(e.y=t.y),"number"==typeof t.angle&&(e.angle=t.angle),"number"==typeof t.ratio&&(e.ratio=this.getBoundedRatio(t.ratio)),e},e.prototype.isAnimated=function(){return!!this.nextFrame},e.prototype.setState=function(t){if(!this.enabled)return this;this.previousState=this.getState();var e=this.validateState(t);return"number"==typeof e.x&&(this.x=e.x),"number"==typeof e.y&&(this.y=e.y),"number"==typeof e.angle&&(this.angle=e.angle),"number"==typeof e.ratio&&(this.ratio=e.ratio),this.hasState(this.previousState)||this.emit("updated",this.getState()),this},e.prototype.updateState=function(t){return this.setState(t(this.getState())),this},e.prototype.animate=function(t,e,n){var r=this;if(this.enabled){var i=Object.assign({},a.ANIMATE_DEFAULTS,e),o=this.validateState(t),u="function"==typeof i.easing?i.easing:s.default[i.easing],c=Date.now(),d=this.getState(),l=function(){var t=(Date.now()-c)/i.duration;if(t>=1)return r.nextFrame=null,r.setState(o),void(r.animationCallback&&(r.animationCallback.call(null),r.animationCallback=void 0));var e=u(t),n={};"number"==typeof o.x&&(n.x=d.x+(o.x-d.x)*e),"number"==typeof o.y&&(n.y=d.y+(o.y-d.y)*e),"number"==typeof o.angle&&(n.angle=d.angle+(o.angle-d.angle)*e),"number"==typeof o.ratio&&(n.ratio=d.ratio+(o.ratio-d.ratio)*e),r.setState(n),r.nextFrame=(0,h.requestFrame)(l)};this.nextFrame?((0,h.cancelFrame)(this.nextFrame),this.animationCallback&&this.animationCallback.call(null),this.nextFrame=(0,h.requestFrame)(l)):l(),this.animationCallback=n}},e.prototype.animatedZoom=function(t){if(t){if("number"==typeof t)return this.animate({ratio:this.ratio/t});this.animate({ratio:this.ratio/(t.factor||c)},t)}else this.animate({ratio:this.ratio/c})},e.prototype.animatedUnzoom=function(t){if(t){if("number"==typeof t)return this.animate({ratio:this.ratio*t});this.animate({ratio:this.ratio*(t.factor||c)},t)}else this.animate({ratio:this.ratio*c})},e.prototype.animatedReset=function(t){this.animate({x:.5,y:.5,ratio:1,angle:0},t)},e.prototype.copy=function(){return e.from(this.getState())},e}(u.TypedEventEmitter);e.default=d},760:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__assign||function(){return o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},o.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.getWheelDelta=e.getTouchCoords=e.getTouchesArray=e.getWheelCoords=e.getMouseCoords=e.getPosition=void 0;var a=n(291);function s(t,e){var n=e.getBoundingClientRect();return{x:t.clientX-n.left,y:t.clientY-n.top}}function h(t,e){var n=o(o({},s(t,e)),{sigmaDefaultPrevented:!1,preventSigmaDefault:function(){n.sigmaDefaultPrevented=!0},original:t});return n}function u(t){for(var e=[],n=0,r=Math.min(t.length,2);n<r;n++)e.push(t[n]);return e}function c(t){if(void 0!==t.deltaY)return-3*t.deltaY/360;if(void 0!==t.detail)return t.detail/-9;throw new Error("Captor: could not extract delta from event.")}e.getPosition=s,e.getMouseCoords=h,e.getWheelCoords=function(t,e){return o(o({},h(t,e)),{delta:c(t)})},e.getTouchesArray=u,e.getTouchCoords=function(t,e){return{touches:u(t.touches).map((function(t){return s(t,e)})),original:t}},e.getWheelDelta=c;var d=function(t){function e(e,n){var r=t.call(this)||this;return r.container=e,r.renderer=n,r}return i(e,t),e}(a.TypedEventEmitter);e.default=d},886:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),a=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&o(e,t,n);return a(e,t),e};Object.defineProperty(e,"__esModule",{value:!0});var h=s(n(760)),u=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.enabled=!0,r.draggedEvents=0,r.downStartTime=null,r.lastMouseX=null,r.lastMouseY=null,r.isMouseDown=!1,r.isMoving=!1,r.movingTimeout=null,r.startCameraState=null,r.clicks=0,r.doubleClickTimeout=null,r.currentWheelDirection=0,r.handleClick=r.handleClick.bind(r),r.handleRightClick=r.handleRightClick.bind(r),r.handleDown=r.handleDown.bind(r),r.handleUp=r.handleUp.bind(r),r.handleMove=r.handleMove.bind(r),r.handleWheel=r.handleWheel.bind(r),r.handleOut=r.handleOut.bind(r),e.addEventListener("click",r.handleClick,!1),e.addEventListener("contextmenu",r.handleRightClick,!1),e.addEventListener("mousedown",r.handleDown,!1),e.addEventListener("wheel",r.handleWheel,!1),e.addEventListener("mouseout",r.handleOut,!1),document.addEventListener("mousemove",r.handleMove,!1),document.addEventListener("mouseup",r.handleUp,!1),r}return i(e,t),e.prototype.kill=function(){var t=this.container;t.removeEventListener("click",this.handleClick),t.removeEventListener("contextmenu",this.handleRightClick),t.removeEventListener("mousedown",this.handleDown),t.removeEventListener("wheel",this.handleWheel),t.removeEventListener("mouseout",this.handleOut),document.removeEventListener("mousemove",this.handleMove),document.removeEventListener("mouseup",this.handleUp)},e.prototype.handleClick=function(t){var e=this;if(this.enabled){if(this.clicks++,2===this.clicks)return this.clicks=0,"number"==typeof this.doubleClickTimeout&&(clearTimeout(this.doubleClickTimeout),this.doubleClickTimeout=null),this.handleDoubleClick(t);setTimeout((function(){e.clicks=0,e.doubleClickTimeout=null}),300),this.draggedEvents<3&&this.emit("click",(0,h.getMouseCoords)(t,this.container))}},e.prototype.handleRightClick=function(t){this.enabled&&this.emit("rightClick",(0,h.getMouseCoords)(t,this.container))},e.prototype.handleDoubleClick=function(t){if(this.enabled){t.preventDefault(),t.stopPropagation();var e=(0,h.getMouseCoords)(t,this.container);if(this.emit("doubleClick",e),!e.sigmaDefaultPrevented){var n=this.renderer.getCamera(),r=n.getBoundedRatio(n.getState().ratio/2.2);n.animate(this.renderer.getViewportZoomedState((0,h.getPosition)(t,this.container),r),{easing:"quadraticInOut",duration:200})}}},e.prototype.handleDown=function(t){if(this.enabled){if(0===t.button){this.startCameraState=this.renderer.getCamera().getState();var e=(0,h.getPosition)(t,this.container),n=e.x,r=e.y;this.lastMouseX=n,this.lastMouseY=r,this.draggedEvents=0,this.downStartTime=Date.now(),this.isMouseDown=!0}this.emit("mousedown",(0,h.getMouseCoords)(t,this.container))}},e.prototype.handleUp=function(t){var e=this;if(this.enabled&&this.isMouseDown){var n=this.renderer.getCamera();this.isMouseDown=!1,"number"==typeof this.movingTimeout&&(clearTimeout(this.movingTimeout),this.movingTimeout=null);var r=(0,h.getPosition)(t,this.container),i=r.x,o=r.y,a=n.getState(),s=n.getPreviousState()||{x:0,y:0};this.isMoving?n.animate({x:a.x+3*(a.x-s.x),y:a.y+3*(a.y-s.y)},{duration:200,easing:"quadraticOut"}):this.lastMouseX===i&&this.lastMouseY===o||n.setState({x:a.x,y:a.y}),this.isMoving=!1,setTimeout((function(){e.draggedEvents=0,e.renderer.refresh()}),0),this.emit("mouseup",(0,h.getMouseCoords)(t,this.container))}},e.prototype.handleMove=function(t){var e=this;if(this.enabled){var n=(0,h.getMouseCoords)(t,this.container);if(this.emit("mousemovebody",n),t.target===this.container&&this.emit("mousemove",n),!n.sigmaDefaultPrevented&&this.isMouseDown){this.isMoving=!0,this.draggedEvents++,"number"==typeof this.movingTimeout&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout((function(){e.movingTimeout=null,e.isMoving=!1}),100);var r=this.renderer.getCamera(),i=(0,h.getPosition)(t,this.container),o=i.x,a=i.y,s=this.renderer.viewportToFramedGraph({x:this.lastMouseX,y:this.lastMouseY}),u=this.renderer.viewportToFramedGraph({x:o,y:a}),c=s.x-u.x,d=s.y-u.y,l=r.getState(),p=l.x+c,f=l.y+d;r.setState({x:p,y:f}),this.lastMouseX=o,this.lastMouseY=a,t.preventDefault(),t.stopPropagation()}}},e.prototype.handleWheel=function(t){var e=this;if(this.enabled){t.preventDefault(),t.stopPropagation();var n=(0,h.getWheelDelta)(t);if(n){var r=(0,h.getWheelCoords)(t,this.container);if(this.emit("wheel",r),!r.sigmaDefaultPrevented){var i=n>0?1/1.7:1.7,o=this.renderer.getCamera(),a=o.getBoundedRatio(o.getState().ratio*i),s=n>0?1:-1,u=Date.now();this.currentWheelDirection===s&&this.lastWheelTriggerTime&&u-this.lastWheelTriggerTime<50||(o.animate(this.renderer.getViewportZoomedState((0,h.getPosition)(t,this.container),a),{easing:"quadraticOut",duration:250},(function(){e.currentWheelDirection=0})),this.currentWheelDirection=s,this.lastWheelTriggerTime=u)}}}},e.prototype.handleOut=function(){},e}(h.default);e.default=u},311:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),a=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&o(e,t,n);return a(e,t),e},h=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a};Object.defineProperty(e,"__esModule",{value:!0});var u=s(n(760)),c=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.enabled=!0,r.isMoving=!1,r.hasMoved=!1,r.touchMode=0,r.startTouchesPositions=[],r.handleStart=r.handleStart.bind(r),r.handleLeave=r.handleLeave.bind(r),r.handleMove=r.handleMove.bind(r),e.addEventListener("touchstart",r.handleStart,!1),e.addEventListener("touchend",r.handleLeave,!1),e.addEventListener("touchcancel",r.handleLeave,!1),e.addEventListener("touchmove",r.handleMove,!1),r}return i(e,t),e.prototype.kill=function(){var t=this.container;t.removeEventListener("touchstart",this.handleStart),t.removeEventListener("touchend",this.handleLeave),t.removeEventListener("touchcancel",this.handleLeave),t.removeEventListener("touchmove",this.handleMove)},e.prototype.getDimensions=function(){return{width:this.container.offsetWidth,height:this.container.offsetHeight}},e.prototype.dispatchRelatedMouseEvent=function(t,e,n,r){var i=n||e.touches[0],o=new MouseEvent(t,{clientX:i.clientX,clientY:i.clientY,altKey:e.altKey,ctrlKey:e.ctrlKey});o.isFakeSigmaMouseEvent=!0,(r||this.container).dispatchEvent(o)},e.prototype.handleStart=function(t){var e=this;if(this.enabled){t.preventDefault(),1===t.touches.length&&this.dispatchRelatedMouseEvent("mousedown",t);var n=(0,u.getTouchesArray)(t.touches);if(this.touchMode=n.length,this.startCameraState=this.renderer.getCamera().getState(),this.startTouchesPositions=n.map((function(t){return(0,u.getPosition)(t,e.container)})),this.lastTouches=n,this.lastTouchesPositions=this.startTouchesPositions,2===this.touchMode){var r=h(this.startTouchesPositions,2),i=r[0],o=i.x,a=i.y,s=r[1],c=s.x,d=s.y;this.startTouchesAngle=Math.atan2(d-a,c-o),this.startTouchesDistance=Math.sqrt(Math.pow(c-o,2)+Math.pow(d-a,2))}this.emit("touchdown",(0,u.getTouchCoords)(t,this.container))}},e.prototype.handleLeave=function(t){if(this.enabled){switch(t.preventDefault(),0===t.touches.length&&this.lastTouches&&this.lastTouches.length&&(this.dispatchRelatedMouseEvent("mouseup",t,this.lastTouches[0],document),this.hasMoved||this.dispatchRelatedMouseEvent("click",t,this.lastTouches[0])),this.movingTimeout&&(this.isMoving=!1,clearTimeout(this.movingTimeout)),this.touchMode){case 2:if(1===t.touches.length){this.handleStart(t),t.preventDefault();break}case 1:if(this.isMoving){var e=this.renderer.getCamera(),n=e.getState(),r=e.getPreviousState()||{x:0,y:0};e.animate({x:n.x+3*(n.x-r.x),y:n.y+3*(n.y-r.y)},{duration:200,easing:"quadraticOut"})}this.hasMoved=!1,this.isMoving=!1,this.touchMode=0}this.emit("touchup",(0,u.getTouchCoords)(t,this.container))}},e.prototype.handleMove=function(t){var e,n=this;if(this.enabled){t.preventDefault(),1===t.touches.length&&this.dispatchRelatedMouseEvent("mousemove",t);var r=(0,u.getTouchesArray)(t.touches),i=r.map((function(t){return(0,u.getPosition)(t,n.container)}));if(this.lastTouches=r,this.lastTouchesPositions=i,this.hasMoved||(this.hasMoved=i.some((function(t,e){var r=n.startTouchesPositions[e];return t.x!==r.x||t.y!==r.y}))),this.hasMoved){this.isMoving=!0,this.movingTimeout&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout((function(){n.isMoving=!1}),200);var o=this.renderer.getCamera(),a=this.startCameraState;switch(this.touchMode){case 1:var s=this.renderer.viewportToFramedGraph((this.startTouchesPositions||[])[0]),c=s.x,d=s.y,l=this.renderer.viewportToFramedGraph(i[0]),p=l.x,f=l.y;o.setState({x:a.x+c-p,y:a.y+d-f});break;case 2:var g={},v=i[0],y=v.x,m=v.y,b=i[1],w=b.x,_=b.y,x=Math.atan2(_-m,w-y)-this.startTouchesAngle,C=Math.hypot(_-m,w-y)/this.startTouchesDistance,E=o.getBoundedRatio(a.ratio/C);g.ratio=E,g.angle=a.angle+x;var L=this.getDimensions(),S=this.renderer.viewportToFramedGraph((this.startTouchesPositions||[])[0],{cameraState:a}),M=Math.min(L.width,L.height),A=M/L.width,N=E/M;f=m-M/2/(M/L.height),p=(e=h([(p=y-M/2/A)*Math.cos(-g.angle)-f*Math.sin(-g.angle),f*Math.cos(-g.angle)+p*Math.sin(-g.angle)],2))[0],f=e[1],g.x=S.x-p*N,g.y=S.y+f*N,o.setState(g)}this.emit("touchmove",(0,u.getTouchCoords)(t,this.container))}}},e}(u.default);e.default=c},98:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.edgeLabelsToDisplayFromNodes=e.LabelGrid=void 0;var n=function(){function t(t,e){this.key=t,this.size=e}return t.compare=function(t,e){return t.size>e.size?-1:t.size<e.size||t.key>e.key?1:-1},t}(),r=function(){function t(){this.width=0,this.height=0,this.cellSize=0,this.columns=0,this.rows=0,this.cells={}}return t.prototype.resizeAndClear=function(t,e){this.width=t.width,this.height=t.height,this.cellSize=e,this.columns=Math.ceil(t.width/e),this.rows=Math.ceil(t.height/e),this.cells={}},t.prototype.getIndex=function(t){var e=Math.floor(t.x/this.cellSize);return Math.floor(t.y/this.cellSize)*this.columns+e},t.prototype.add=function(t,e,r){var i=new n(t,e),o=this.getIndex(r),a=this.cells[o];a||(a=[],this.cells[o]=a),a.push(i)},t.prototype.organize=function(){for(var t in this.cells)this.cells[t].sort(n.compare)},t.prototype.getLabelsToDisplay=function(t,e){var n=this.cellSize*this.cellSize,r=n/t/t*e/n,i=Math.ceil(r),o=[];for(var a in this.cells)for(var s=this.cells[a],h=0;h<Math.min(i,s.length);h++)o.push(s[h].key);return o},t}();e.LabelGrid=r,e.edgeLabelsToDisplayFromNodes=function(t){var e=t.graph,n=t.hoveredNode,r=t.highlightedNodes,i=t.displayedNodeLabels,o=[];return e.forEachEdge((function(t,e,a,s){(a===n||s===n||r.has(a)||r.has(s)||i.has(a)&&i.has(s))&&o.push(t)})),o}},461:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.rectangleCollidesWithQuad=e.squareCollidesWithQuad=e.getCircumscribedAlignedRectangle=e.isRectangleAligned=void 0;var i=r(n(796)),o=!1;function a(t){return t.x1===t.x2||t.y1===t.y2}function s(t){var e=Math.sqrt(Math.pow(t.x2-t.x1,2)+Math.pow(t.y2-t.y1,2)),n=(t.y1-t.y2)*t.height/e,r=(t.x2-t.x1)*t.height/e,i={x:t.x1,y:t.y1},o={x:t.x2,y:t.y2},a={x:t.x1+n,y:t.y1+r},s={x:t.x2+n,y:t.y2+r},h=Math.min(i.x,o.x,a.x,s.x),u=Math.max(i.x,o.x,a.x,s.x),c=Math.min(i.y,o.y,a.y,s.y);return{x1:h,y1:c,x2:u,y2:c,height:Math.max(i.y,o.y,a.y,s.y)-c}}function h(t,e,n,r,i,o,a){return t<r+o&&t+n>r&&e<i+a&&e+n>i}function u(t,e,n,r,i,o,a,s){return t<i+a&&t+n>i&&e<o+s&&e+r>o}function c(t,e,n,r,i,o){var a=t<n+i/2;return e<r+o/2?a?1:2:a?3:4}e.isRectangleAligned=a,e.getCircumscribedAlignedRectangle=s,e.squareCollidesWithQuad=h,e.rectangleCollidesWithQuad=u;var d=function(){function t(t){var e;void 0===t&&(t={}),this.containers=((e={})[5460]=[],e),this.cache=null,this.lastRectangle=null;var n=Math.pow(4,5);this.data=new Float32Array((4*n-1)/3*4),t.boundaries?this.resize(t.boundaries):this.resize({x:0,y:0,width:1,height:1})}return t.prototype.add=function(t,e,n,r){return function(t,e,n,r,i,a,s){for(var u=i-s,c=a-s,d=2*s,l=0,p=0;;){if(l>=5)return n[p]=n[p]||[],void n[p].push(r);var f=4*p+4,g=4*p+8,v=4*p+12,y=4*p+16,m=h(u,c,d,e[f+0],e[f+1],e[f+2],e[f+3]),b=h(u,c,d,e[g+0],e[g+1],e[g+2],e[g+3]),w=h(u,c,d,e[v+0],e[v+1],e[v+2],e[v+3]),_=h(u,c,d,e[y+0],e[y+1],e[y+2],e[y+3]),x=[m,b,w,_].reduce((function(t,e){return e?t+1:t}),0);if(0===x&&0===l)return n[5460].push(r),void(!o&&n[5460].length>=5&&(o=!0,console.warn("sigma/quadtree.insertNode: At least 5 nodes are outside the global quadtree zone. You might have a problem with the normalization function or the custom bounding box.")));if(0===x)throw new Error("sigma/quadtree.insertNode: no collision (level: ".concat(l,", key: ").concat(r,", x: ").concat(i,", y: ").concat(a,", size: ").concat(s,")."));if(3===x)throw new Error("sigma/quadtree.insertNode: 3 impossible collisions (level: ".concat(l,", key: ").concat(r,", x: ").concat(i,", y: ").concat(a,", size: ").concat(s,")."));if(x>1)return n[p]=n[p]||[],void n[p].push(r);l++,m&&(p=f),b&&(p=g),w&&(p=v),_&&(p=y)}}(0,this.data,this.containers,t,e,n,r),this},t.prototype.resize=function(t){this.clear(),this.data[0]=t.x,this.data[1]=t.y,this.data[2]=t.width,this.data[3]=t.height,function(t,e){for(var n=[0,0];n.length;){var r=n.pop(),i=n.pop(),o=4*i+4,a=4*i+8,s=4*i+12,h=4*i+16,u=e[i+0],c=e[i+1],d=e[i+2]/2,l=e[i+3]/2;e[o+0]=u,e[o+1]=c,e[o+2]=d,e[o+3]=l,e[a+0]=u+d,e[a+1]=c,e[a+2]=d,e[a+3]=l,e[s+0]=u,e[s+1]=c+l,e[s+2]=d,e[s+3]=l,e[h+0]=u+d,e[h+1]=c+l,e[h+2]=d,e[h+3]=l,r<4&&(n.push(h,r+1),n.push(s,r+1),n.push(a,r+1),n.push(o,r+1))}}(0,this.data)},t.prototype.clear=function(){var t;return this.containers=((t={})[5460]=[],t),this},t.prototype.point=function(t,e){var n=this.containers[5460].slice(),r=0,o=0;do{this.containers[r]&&(0,i.default)(n,this.containers[r]),r=4*r+4*c(t,e,this.data[r+0],this.data[r+1],this.data[r+2],this.data[r+3]),o++}while(o<=5);return n},t.prototype.rectangle=function(t,e,n,r,o){var h=this.lastRectangle;return h&&t===h.x1&&n===h.x2&&e===h.y1&&r===h.y2&&o===h.height||(this.lastRectangle={x1:t,y1:e,x2:n,y2:r,height:o},a(this.lastRectangle)||(this.lastRectangle=s(this.lastRectangle)),this.cache=function(t,e,n,r,o,a,s){for(var h,c=[0,0],d=[];c.length;){var l=c.pop(),p=c.pop();if((h=n[p])&&(0,i.default)(d,h),!(l>=5)){var f=4*p+4,g=4*p+8,v=4*p+12,y=4*p+16,m=u(r,o,a,s,e[f+0],e[f+1],e[f+2],e[f+3]),b=u(r,o,a,s,e[g+0],e[g+1],e[g+2],e[g+3]),w=u(r,o,a,s,e[v+0],e[v+1],e[v+2],e[v+3]),_=u(r,o,a,s,e[y+0],e[y+1],e[y+2],e[y+3]);m&&c.push(f,l+1),b&&c.push(g,l+1),w&&c.push(v,l+1),_&&c.push(y,l+1)}}return d}(0,this.data,this.containers,t,e,Math.abs(t-n)||Math.abs(e-r),o),(0,i.default)(this.cache,this.containers[5460])),this.cache},t}();e.default=d},26:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Sigma=e.MouseCaptor=e.QuadTree=e.Camera=void 0;var i=r(n(248));e.Sigma=i.default;var o=r(n(554));e.Camera=o.default;var a=r(n(461));e.QuadTree=a.default;var s=r(n(886));e.MouseCaptor=s.default,e.default=i.default},294:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,n,r,i){var o=i.edgeLabelSize,a=i.edgeLabelFont,s=i.edgeLabelWeight,h=i.edgeLabelColor.attribute?e[i.edgeLabelColor.attribute]||i.edgeLabelColor.color||"#000":i.edgeLabelColor.color,u=e.label;if(u){t.fillStyle=h,t.font="".concat(s," ").concat(o,"px ").concat(a);var c,d,l=n.size,p=r.size,f=n.x,g=n.y,v=r.x,y=r.y,m=v-f,b=y-g,w=Math.sqrt(m*m+b*b);if(!(w<l+p)){c=((f+=m*l/w)+(v-=m*p/w))/2,d=((g+=b*l/w)+(y-=b*p/w))/2,m=v-f,b=y-g,w=Math.sqrt(m*m+b*b);var _,x=t.measureText(u).width;if(x>w){for(u+="…",x=t.measureText(u).width;x>w&&u.length>1;)u=u.slice(0,-2)+"…",x=t.measureText(u).width;if(u.length<4)return}_=m>0?b>0?Math.acos(m/w):Math.asin(b/w):b>0?Math.acos(m/w)+Math.PI:Math.asin(m/w)+Math.PI/2,t.save(),t.translate(c,d),t.rotate(_),t.fillText(u,-x/2,e.size/2+o),t.restore()}}}},607:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(577));e.default=function(t,e,n){var r=n.labelSize,o=n.labelFont,a=n.labelWeight;if(t.font="".concat(a," ").concat(r,"px ").concat(o),t.fillStyle="#FFF",t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=8,t.shadowColor="#000","string"==typeof e.label){var s=t.measureText(e.label).width,h=Math.round(s+5),u=Math.round(r+4),c=Math.max(e.size,r/2)+2,d=Math.asin(u/2/c),l=Math.sqrt(Math.abs(Math.pow(c,2)-Math.pow(u/2,2)));t.beginPath(),t.moveTo(e.x+l,e.y+u/2),t.lineTo(e.x+c+h,e.y+u/2),t.lineTo(e.x+c+h,e.y-u/2),t.lineTo(e.x+l,e.y-u/2),t.arc(e.x,e.y,c,d,-d),t.closePath(),t.fill()}else t.beginPath(),t.arc(e.x,e.y,e.size+2,0,2*Math.PI),t.closePath(),t.fill();t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=0,(0,i.default)(t,e,n)}},577:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,n){if(e.label){var r=n.labelSize,i=n.labelFont,o=n.labelWeight,a=n.labelColor.attribute?e[n.labelColor.attribute]||n.labelColor.color||"#000":n.labelColor.color;t.fillStyle=a,t.font="".concat(o," ").concat(r,"px ").concat(i),t.fillText(e.label,e.x+e.size+3,e.y+r/3)}}},917:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.createEdgeCompoundProgram=e.AbstractEdgeProgram=void 0;var o=function(t){function e(e,n,r,i,o){return t.call(this,e,n,r,i,o)||this}return i(e,t),e}(n(973).AbstractProgram);e.AbstractEdgeProgram=o,e.createEdgeCompoundProgram=function(t){return function(){function e(e,n){this.programs=t.map((function(t){return new t(e,n)}))}return e.prototype.bufferData=function(){this.programs.forEach((function(t){return t.bufferData()}))},e.prototype.allocate=function(t){this.programs.forEach((function(e){return e.allocate(t)}))},e.prototype.bind=function(){},e.prototype.computeIndices=function(){this.programs.forEach((function(t){return t.computeIndices()}))},e.prototype.render=function(t){this.programs.forEach((function(e){e.bind(),e.bufferData(),e.render(t)}))},e.prototype.process=function(t,e,n,r,i){this.programs.forEach((function(o){return o.process(t,e,n,r,i)}))},e}()}},533:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.createNodeCompoundProgram=e.AbstractNodeProgram=void 0;var o=function(t){function e(e,n,r,i,o){var a=t.call(this,e,n,r,i,o)||this;a.positionLocation=e.getAttribLocation(a.program,"a_position"),a.sizeLocation=e.getAttribLocation(a.program,"a_size"),a.colorLocation=e.getAttribLocation(a.program,"a_color");var s=e.getUniformLocation(a.program,"u_matrix");if(null===s)throw new Error("AbstractNodeProgram: error while getting matrixLocation");a.matrixLocation=s;var h=e.getUniformLocation(a.program,"u_ratio");if(null===h)throw new Error("AbstractNodeProgram: error while getting ratioLocation");a.ratioLocation=h;var u=e.getUniformLocation(a.program,"u_scale");if(null===u)throw new Error("AbstractNodeProgram: error while getting scaleLocation");return a.scaleLocation=u,a}return i(e,t),e.prototype.bind=function(){var t=this.gl;t.enableVertexAttribArray(this.positionLocation),t.enableVertexAttribArray(this.sizeLocation),t.enableVertexAttribArray(this.colorLocation),t.vertexAttribPointer(this.positionLocation,2,t.FLOAT,!1,this.attributes*Float32Array.BYTES_PER_ELEMENT,0),t.vertexAttribPointer(this.sizeLocation,1,t.FLOAT,!1,this.attributes*Float32Array.BYTES_PER_ELEMENT,8),t.vertexAttribPointer(this.colorLocation,4,t.UNSIGNED_BYTE,!0,this.attributes*Float32Array.BYTES_PER_ELEMENT,12)},e}(n(973).AbstractProgram);e.AbstractNodeProgram=o,e.createNodeCompoundProgram=function(t){return function(){function e(e,n){this.programs=t.map((function(t){return new t(e,n)}))}return e.prototype.bufferData=function(){this.programs.forEach((function(t){return t.bufferData()}))},e.prototype.allocate=function(t){this.programs.forEach((function(e){return e.allocate(t)}))},e.prototype.bind=function(){},e.prototype.render=function(t){this.programs.forEach((function(e){e.bind(),e.bufferData(),e.render(t)}))},e.prototype.process=function(t,e,n){this.programs.forEach((function(r){return r.process(t,e,n)}))},e}()}},973:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractProgram=void 0;var r=n(538),i=function(){function t(t,e,n,i,o){this.array=new Float32Array,this.points=i,this.attributes=o,this.gl=t,this.vertexShaderSource=e,this.fragmentShaderSource=n;var a=t.createBuffer();if(null===a)throw new Error("AbstractProgram: error while creating the buffer");this.buffer=a,t.bindBuffer(t.ARRAY_BUFFER,this.buffer),this.vertexShader=(0,r.loadVertexShader)(t,this.vertexShaderSource),this.fragmentShader=(0,r.loadFragmentShader)(t,this.fragmentShaderSource),this.program=(0,r.loadProgram)(t,[this.vertexShader,this.fragmentShader])}return t.prototype.bufferData=function(){var t=this.gl;t.bufferData(t.ARRAY_BUFFER,this.array,t.DYNAMIC_DRAW)},t.prototype.allocate=function(t){this.array=new Float32Array(this.points*this.attributes*t)},t.prototype.hasNothingToRender=function(){return 0===this.array.length},t}();e.AbstractProgram=i},638:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(917),o=r(n(747)),a=r(n(874)),s=(0,i.createEdgeCompoundProgram)([a.default,o.default]);e.default=s},747:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=n(524),s=o(n(191)),h=o(n(83)),u=function(t){function e(e){var n=t.call(this,e,s.default,h.default,3,9)||this;n.positionLocation=e.getAttribLocation(n.program,"a_position"),n.colorLocation=e.getAttribLocation(n.program,"a_color"),n.normalLocation=e.getAttribLocation(n.program,"a_normal"),n.radiusLocation=e.getAttribLocation(n.program,"a_radius"),n.barycentricLocation=e.getAttribLocation(n.program,"a_barycentric");var r=e.getUniformLocation(n.program,"u_matrix");if(null===r)throw new Error("EdgeArrowHeadProgram: error while getting matrixLocation");n.matrixLocation=r;var i=e.getUniformLocation(n.program,"u_sqrtZoomRatio");if(null===i)throw new Error("EdgeArrowHeadProgram: error while getting sqrtZoomRatioLocation");n.sqrtZoomRatioLocation=i;var o=e.getUniformLocation(n.program,"u_correctionRatio");if(null===o)throw new Error("EdgeArrowHeadProgram: error while getting correctionRatioLocation");return n.correctionRatioLocation=o,n.bind(),n}return i(e,t),e.prototype.bind=function(){var t=this.gl;t.enableVertexAttribArray(this.positionLocation),t.enableVertexAttribArray(this.normalLocation),t.enableVertexAttribArray(this.radiusLocation),t.enableVertexAttribArray(this.colorLocation),t.enableVertexAttribArray(this.barycentricLocation),t.vertexAttribPointer(this.positionLocation,2,t.FLOAT,!1,9*Float32Array.BYTES_PER_ELEMENT,0),t.vertexAttribPointer(this.normalLocation,2,t.FLOAT,!1,9*Float32Array.BYTES_PER_ELEMENT,8),t.vertexAttribPointer(this.radiusLocation,1,t.FLOAT,!1,9*Float32Array.BYTES_PER_ELEMENT,16),t.vertexAttribPointer(this.colorLocation,4,t.UNSIGNED_BYTE,!0,9*Float32Array.BYTES_PER_ELEMENT,20),t.vertexAttribPointer(this.barycentricLocation,3,t.FLOAT,!1,9*Float32Array.BYTES_PER_ELEMENT,24)},e.prototype.computeIndices=function(){},e.prototype.process=function(t,e,n,r,i){if(r)for(var o=27*i,s=o+27;o<s;o++)this.array[o]=0;else{var h=n.size||1,u=e.size||1,c=t.x,d=t.y,l=e.x,p=e.y,f=(0,a.floatColor)(n.color),g=l-c,v=p-d,y=g*g+v*v,m=0,b=0;y&&(m=-v*(y=1/Math.sqrt(y))*h,b=g*y*h);var w=27*i,_=this.array;_[w++]=l,_[w++]=p,_[w++]=-m,_[w++]=-b,_[w++]=u,_[w++]=f,_[w++]=1,_[w++]=0,_[w++]=0,_[w++]=l,_[w++]=p,_[w++]=-m,_[w++]=-b,_[w++]=u,_[w++]=f,_[w++]=0,_[w++]=1,_[w++]=0,_[w++]=l,_[w++]=p,_[w++]=-m,_[w++]=-b,_[w++]=u,_[w++]=f,_[w++]=0,_[w++]=0,_[w]=1}},e.prototype.render=function(t){if(!this.hasNothingToRender()){var e=this.gl,n=this.program;e.useProgram(n),e.uniformMatrix3fv(this.matrixLocation,!1,t.matrix),e.uniform1f(this.sqrtZoomRatioLocation,Math.sqrt(t.ratio)),e.uniform1f(this.correctionRatioLocation,t.correctionRatio),e.drawArrays(e.TRIANGLES,0,this.array.length/9)}},e}(n(917).AbstractEdgeProgram);e.default=u},874:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=n(917),s=n(524),h=o(n(73)),u=o(n(879)),c=function(t){function e(e){var n=t.call(this,e,h.default,u.default,4,6)||this,r=e.createBuffer();if(null===r)throw new Error("EdgeClampedProgram: error while getting resolutionLocation");n.indicesBuffer=r,n.positionLocation=e.getAttribLocation(n.program,"a_position"),n.colorLocation=e.getAttribLocation(n.program,"a_color"),n.normalLocation=e.getAttribLocation(n.program,"a_normal"),n.radiusLocation=e.getAttribLocation(n.program,"a_radius");var i=e.getUniformLocation(n.program,"u_matrix");if(null===i)throw new Error("EdgeClampedProgram: error while getting matrixLocation");n.matrixLocation=i;var o=e.getUniformLocation(n.program,"u_sqrtZoomRatio");if(null===o)throw new Error("EdgeClampedProgram: error while getting cameraRatioLocation");n.sqrtZoomRatioLocation=o;var a=e.getUniformLocation(n.program,"u_correctionRatio");if(null===a)throw new Error("EdgeClampedProgram: error while getting viewportRatioLocation");return n.correctionRatioLocation=a,n.canUse32BitsIndices=(0,s.canUse32BitsIndices)(e),n.IndicesArray=n.canUse32BitsIndices?Uint32Array:Uint16Array,n.indicesArray=new n.IndicesArray,n.indicesType=n.canUse32BitsIndices?e.UNSIGNED_INT:e.UNSIGNED_SHORT,n.bind(),n}return i(e,t),e.prototype.bind=function(){var t=this.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indicesBuffer),t.enableVertexAttribArray(this.positionLocation),t.enableVertexAttribArray(this.normalLocation),t.enableVertexAttribArray(this.colorLocation),t.enableVertexAttribArray(this.radiusLocation),t.vertexAttribPointer(this.positionLocation,2,t.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,0),t.vertexAttribPointer(this.normalLocation,2,t.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,8),t.vertexAttribPointer(this.colorLocation,4,t.UNSIGNED_BYTE,!0,6*Float32Array.BYTES_PER_ELEMENT,16),t.vertexAttribPointer(this.radiusLocation,1,t.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,20)},e.prototype.process=function(t,e,n,r,i){if(r)for(var o=24*i,a=o+24;o<a;o++)this.array[o]=0;else{var h=n.size||1,u=t.x,c=t.y,d=e.x,l=e.y,p=e.size||1,f=(0,s.floatColor)(n.color),g=d-u,v=l-c,y=g*g+v*v,m=0,b=0;y&&(m=-v*(y=1/Math.sqrt(y))*h,b=g*y*h);var w=24*i,_=this.array;_[w++]=u,_[w++]=c,_[w++]=m,_[w++]=b,_[w++]=f,_[w++]=0,_[w++]=u,_[w++]=c,_[w++]=-m,_[w++]=-b,_[w++]=f,_[w++]=0,_[w++]=d,_[w++]=l,_[w++]=m,_[w++]=b,_[w++]=f,_[w++]=p,_[w++]=d,_[w++]=l,_[w++]=-m,_[w++]=-b,_[w++]=f,_[w]=-p}},e.prototype.computeIndices=function(){for(var t=this.array.length/6,e=t+t/2,n=new this.IndicesArray(e),r=0,i=0;r<t;r+=4)n[i++]=r,n[i++]=r+1,n[i++]=r+2,n[i++]=r+2,n[i++]=r+1,n[i++]=r+3;this.indicesArray=n},e.prototype.bufferData=function(){t.prototype.bufferData.call(this);var e=this.gl;e.bufferData(e.ELEMENT_ARRAY_BUFFER,this.indicesArray,e.STATIC_DRAW)},e.prototype.render=function(t){if(!this.hasNothingToRender()){var e=this.gl,n=this.program;e.useProgram(n),e.uniformMatrix3fv(this.matrixLocation,!1,t.matrix),e.uniform1f(this.sqrtZoomRatioLocation,Math.sqrt(t.ratio)),e.uniform1f(this.correctionRatioLocation,t.correctionRatio),e.drawElements(e.TRIANGLES,this.indicesArray.length,this.indicesType,0)}},e}(a.AbstractEdgeProgram);e.default=c},857:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=n(524),s=o(n(372)),h=o(n(879)),u=function(t){function e(e){var n=t.call(this,e,s.default,h.default,4,5)||this,r=e.createBuffer();if(null===r)throw new Error("EdgeProgram: error while creating indicesBuffer");n.indicesBuffer=r,n.positionLocation=e.getAttribLocation(n.program,"a_position"),n.colorLocation=e.getAttribLocation(n.program,"a_color"),n.normalLocation=e.getAttribLocation(n.program,"a_normal");var i=e.getUniformLocation(n.program,"u_matrix");if(null===i)throw new Error("EdgeProgram: error while getting matrixLocation");n.matrixLocation=i;var o=e.getUniformLocation(n.program,"u_correctionRatio");if(null===o)throw new Error("EdgeProgram: error while getting correctionRatioLocation");n.correctionRatioLocation=o;var u=e.getUniformLocation(n.program,"u_sqrtZoomRatio");if(null===u)throw new Error("EdgeProgram: error while getting sqrtZoomRatioLocation");return n.sqrtZoomRatioLocation=u,n.canUse32BitsIndices=(0,a.canUse32BitsIndices)(e),n.IndicesArray=n.canUse32BitsIndices?Uint32Array:Uint16Array,n.indicesArray=new n.IndicesArray,n.indicesType=n.canUse32BitsIndices?e.UNSIGNED_INT:e.UNSIGNED_SHORT,n.bind(),n}return i(e,t),e.prototype.bind=function(){var t=this.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indicesBuffer),t.enableVertexAttribArray(this.positionLocation),t.enableVertexAttribArray(this.normalLocation),t.enableVertexAttribArray(this.colorLocation),t.vertexAttribPointer(this.positionLocation,2,t.FLOAT,!1,5*Float32Array.BYTES_PER_ELEMENT,0),t.vertexAttribPointer(this.normalLocation,2,t.FLOAT,!1,5*Float32Array.BYTES_PER_ELEMENT,8),t.vertexAttribPointer(this.colorLocation,4,t.UNSIGNED_BYTE,!0,5*Float32Array.BYTES_PER_ELEMENT,16)},e.prototype.computeIndices=function(){for(var t=this.array.length/5,e=t+t/2,n=new this.IndicesArray(e),r=0,i=0;r<t;r+=4)n[i++]=r,n[i++]=r+1,n[i++]=r+2,n[i++]=r+2,n[i++]=r+1,n[i++]=r+3;this.indicesArray=n},e.prototype.bufferData=function(){t.prototype.bufferData.call(this);var e=this.gl;e.bufferData(e.ELEMENT_ARRAY_BUFFER,this.indicesArray,e.STATIC_DRAW)},e.prototype.process=function(t,e,n,r,i){if(r)for(var o=20*i,s=o+20;o<s;o++)this.array[o]=0;else{var h=n.size||1,u=t.x,c=t.y,d=e.x,l=e.y,p=(0,a.floatColor)(n.color),f=d-u,g=l-c,v=f*f+g*g,y=0,m=0;v&&(y=-g*(v=1/Math.sqrt(v))*h,m=f*v*h);var b=20*i,w=this.array;w[b++]=u,w[b++]=c,w[b++]=y,w[b++]=m,w[b++]=p,w[b++]=u,w[b++]=c,w[b++]=-y,w[b++]=-m,w[b++]=p,w[b++]=d,w[b++]=l,w[b++]=y,w[b++]=m,w[b++]=p,w[b++]=d,w[b++]=l,w[b++]=-y,w[b++]=-m,w[b]=p}},e.prototype.render=function(t){if(!this.hasNothingToRender()){var e=this.gl,n=this.program;e.useProgram(n),e.uniformMatrix3fv(this.matrixLocation,!1,t.matrix),e.uniform1f(this.sqrtZoomRatioLocation,Math.sqrt(t.ratio)),e.uniform1f(this.correctionRatioLocation,t.correctionRatio),e.drawElements(e.TRIANGLES,this.indicesArray.length,this.indicesType,0)}},e}(n(917).AbstractEdgeProgram);e.default=u},37:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=n(524),s=o(n(146)),h=o(n(546)),u=function(t){function e(e){var n=t.call(this,e,s.default,h.default,1,4)||this;return n.bind(),n}return i(e,t),e.prototype.process=function(t,e,n){var r=this.array,i=1*n*4;if(e)return r[i++]=0,r[i++]=0,r[i++]=0,void(r[i++]=0);var o=(0,a.floatColor)(t.color);r[i++]=t.x,r[i++]=t.y,r[i++]=t.size,r[i]=o},e.prototype.render=function(t){if(!this.hasNothingToRender()){var e=this.gl,n=this.program;e.useProgram(n),e.uniform1f(this.ratioLocation,1/Math.sqrt(t.ratio)),e.uniform1f(this.scaleLocation,t.scalingRatio),e.uniformMatrix3fv(this.matrixLocation,!1,t.matrix),e.drawArrays(e.POINTS,0,this.array.length/4)}},e}(n(533).AbstractNodeProgram);e.default=u},83:t=>{(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{default:()=>r});const r="precision mediump float;\n\nvarying vec4 v_color;\n\nvoid main(void) {\n gl_FragColor = v_color;\n}\n";t.exports=n})()},191:t=>{(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{default:()=>r});const r="attribute vec2 a_position;\nattribute vec2 a_normal;\nattribute float a_radius;\nattribute vec4 a_color;\nattribute vec3 a_barycentric;\n\nuniform mat3 u_matrix;\nuniform float u_sqrtZoomRatio;\nuniform float u_correctionRatio;\n\nvarying vec4 v_color;\n\nconst float minThickness = 1.7;\nconst float bias = 255.0 / 254.0;\nconst float arrowHeadWidthLengthRatio = 0.66;\nconst float arrowHeadLengthThicknessRatio = 2.5;\n\nvoid main() {\n float normalLength = length(a_normal);\n vec2 unitNormal = a_normal / normalLength;\n\n // These first computations are taken from edge.vert.glsl and\n // edge.clamped.vert.glsl. Please read it to get better comments on what's\n // happening:\n float pixelsThickness = max(normalLength, minThickness * u_sqrtZoomRatio);\n float webGLThickness = pixelsThickness * u_correctionRatio;\n float adaptedWebGLThickness = webGLThickness * u_sqrtZoomRatio;\n float adaptedWebGLNodeRadius = a_radius * 2.0 * u_correctionRatio * u_sqrtZoomRatio;\n float adaptedWebGLArrowHeadLength = adaptedWebGLThickness * 2.0 * arrowHeadLengthThicknessRatio;\n float adaptedWebGLArrowHeadHalfWidth = adaptedWebGLArrowHeadLength * arrowHeadWidthLengthRatio / 2.0;\n\n float da = a_barycentric.x;\n float db = a_barycentric.y;\n float dc = a_barycentric.z;\n\n vec2 delta = vec2(\n da * (adaptedWebGLNodeRadius * unitNormal.y)\n + db * ((adaptedWebGLNodeRadius + adaptedWebGLArrowHeadLength) * unitNormal.y + adaptedWebGLArrowHeadHalfWidth * unitNormal.x)\n + dc * ((adaptedWebGLNodeRadius + adaptedWebGLArrowHeadLength) * unitNormal.y - adaptedWebGLArrowHeadHalfWidth * unitNormal.x),\n\n da * (-adaptedWebGLNodeRadius * unitNormal.x)\n + db * (-(adaptedWebGLNodeRadius + adaptedWebGLArrowHeadLength) * unitNormal.x + adaptedWebGLArrowHeadHalfWidth * unitNormal.y)\n + dc * (-(adaptedWebGLNodeRadius + adaptedWebGLArrowHeadLength) * unitNormal.x - adaptedWebGLArrowHeadHalfWidth * unitNormal.y)\n );\n\n vec2 position = (u_matrix * vec3(a_position + delta, 1)).xy;\n\n gl_Position = vec4(position, 0, 1);\n\n // Extract the color:\n v_color = a_color;\n v_color.a *= bias;\n}\n";t.exports=n})()},73:t=>{(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{default:()=>r});const r="attribute vec4 a_color;\nattribute vec2 a_normal;\nattribute vec2 a_position;\nattribute float a_radius;\n\nuniform mat3 u_matrix;\nuniform float u_sqrtZoomRatio;\nuniform float u_correctionRatio;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_thickness;\n\nconst float minThickness = 1.7;\nconst float bias = 255.0 / 254.0;\nconst float arrowHeadLengthThicknessRatio = 2.5;\n\nvoid main() {\n float normalLength = length(a_normal);\n vec2 unitNormal = a_normal / normalLength;\n\n // These first computations are taken from edge.vert.glsl. Please read it to\n // get better comments on what's happening:\n float pixelsThickness = max(normalLength, minThickness * u_sqrtZoomRatio);\n float webGLThickness = pixelsThickness * u_correctionRatio;\n float adaptedWebGLThickness = webGLThickness * u_sqrtZoomRatio;\n\n // Here, we move the point to leave space for the arrow head:\n float direction = sign(a_radius);\n float adaptedWebGLNodeRadius = direction * a_radius * 2.0 * u_correctionRatio * u_sqrtZoomRatio;\n float adaptedWebGLArrowHeadLength = adaptedWebGLThickness * 2.0 * arrowHeadLengthThicknessRatio;\n\n vec2 compensationVector = vec2(-direction * unitNormal.y, direction * unitNormal.x) * (adaptedWebGLNodeRadius + adaptedWebGLArrowHeadLength);\n\n // Here is the proper position of the vertex\n gl_Position = vec4((u_matrix * vec3(a_position + unitNormal * adaptedWebGLThickness + compensationVector, 1)).xy, 0, 1);\n\n v_thickness = webGLThickness / u_sqrtZoomRatio;\n\n v_normal = unitNormal;\n v_color = a_color;\n v_color.a *= bias;\n}\n";t.exports=n})()},879:t=>{(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{default:()=>r});const r="precision mediump float;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_thickness;\n\nconst float feather = 0.001;\nconst vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);\n\nvoid main(void) {\n float dist = length(v_normal) * v_thickness;\n\n float t = smoothstep(\n v_thickness - feather,\n v_thickness,\n dist\n );\n\n gl_FragColor = mix(v_color, transparent, t);\n}\n";t.exports=n})()},372:t=>{(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{default:()=>r});const r='attribute vec4 a_color;\nattribute vec2 a_normal;\nattribute vec2 a_position;\n\nuniform mat3 u_matrix;\nuniform float u_sqrtZoomRatio;\nuniform float u_correctionRatio;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_thickness;\n\nconst float minThickness = 1.7;\nconst float bias = 255.0 / 254.0;\n\nvoid main() {\n float normalLength = length(a_normal);\n vec2 unitNormal = a_normal / normalLength;\n\n // We require edges to be at least `minThickness` pixels thick *on screen*\n // (so we need to compensate the SQRT zoom ratio):\n float pixelsThickness = max(normalLength, minThickness * u_sqrtZoomRatio);\n\n // Then, we need to retrieve the normalized thickness of the edge in the WebGL\n // referential (in a ([0, 1], [0, 1]) space), using our "magic" correction\n // ratio:\n float webGLThickness = pixelsThickness * u_correctionRatio;\n\n // Finally, we adapt the edge thickness to the "SQRT rule" in sigma (so that\n // items are not too big when zoomed in, and not too small when zoomed out).\n // The exact computation should be `adapted = value * zoom / sqrt(zoom)`, but\n // it\'s simpler like this:\n float adaptedWebGLThickness = webGLThickness * u_sqrtZoomRatio;\n\n // Here is the proper position of the vertex\n gl_Position = vec4((u_matrix * vec3(a_position + unitNormal * adaptedWebGLThickness, 1)).xy, 0, 1);\n\n // For the fragment shader though, we need a thickness that takes the "magic"\n // correction ratio into account (as in webGLThickness), but so that the\n // antialiasing effect does not depend on the zoom level. So here\'s yet\n // another thickness version:\n v_thickness = webGLThickness / u_sqrtZoomRatio;\n\n v_normal = unitNormal;\n v_color = a_color;\n v_color.a *= bias;\n}\n';t.exports=n})()},546:t=>{(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{default:()=>r});const r="precision mediump float;\n\nvarying vec4 v_color;\nvarying float v_border;\n\nconst float radius = 0.5;\nconst vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);\n\nvoid main(void) {\n vec2 m = gl_PointCoord - vec2(0.5, 0.5);\n float dist = radius - length(m);\n\n float t = 0.0;\n if (dist > v_border)\n t = 1.0;\n else if (dist > 0.0)\n t = dist / v_border;\n\n gl_FragColor = mix(transparent, v_color, t);\n}\n";t.exports=n})()},146:t=>{(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{default:()=>r});const r="attribute vec2 a_position;\nattribute float a_size;\nattribute vec4 a_color;\n\nuniform float u_ratio;\nuniform float u_scale;\nuniform mat3 u_matrix;\n\nvarying vec4 v_color;\nvarying float v_border;\n\nconst float bias = 255.0 / 254.0;\n\nvoid main() {\n gl_Position = vec4(\n (u_matrix * vec3(a_position, 1)).xy,\n 0,\n 1\n );\n\n // Multiply the point size twice:\n // - x SCALING_RATIO to correct the canvas scaling\n // - x 2 to correct the formulae\n gl_PointSize = a_size * u_ratio * u_scale * 2.0;\n\n v_border = (1.0 / u_ratio) * (0.5 / a_size);\n\n // Extract the color:\n v_color = a_color;\n v_color.a *= bias;\n}\n";t.exports=n})()},538:(t,e)=>{"use strict";function n(t,e,n){var r="VERTEX"===t?e.VERTEX_SHADER:e.FRAGMENT_SHADER,i=e.createShader(r);if(null===i)throw new Error("loadShader: error while creating the shader");if(e.shaderSource(i,n),e.compileShader(i),!e.getShaderParameter(i,e.COMPILE_STATUS)){var o=e.getShaderInfoLog(i);throw e.deleteShader(i),new Error("loadShader: error while compiling the shader:\n".concat(o,"\n").concat(n))}return i}Object.defineProperty(e,"__esModule",{value:!0}),e.loadProgram=e.loadFragmentShader=e.loadVertexShader=void 0,e.loadVertexShader=function(t,e){return n("VERTEX",t,e)},e.loadFragmentShader=function(t,e){return n("FRAGMENT",t,e)},e.loadProgram=function(t,e){var n,r,i=t.createProgram();if(null===i)throw new Error("loadProgram: error while creating the program.");for(n=0,r=e.length;n<r;n++)t.attachShader(i,e[n]);if(t.linkProgram(i),!t.getProgramParameter(i,t.LINK_STATUS))throw t.deleteProgram(i),new Error("loadProgram: error while linking the program.");return i}},482:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSettings=e.validateSettings=e.DEFAULT_EDGE_PROGRAM_CLASSES=e.DEFAULT_NODE_PROGRAM_CLASSES=e.DEFAULT_SETTINGS=void 0;var i=n(524),o=r(n(577)),a=r(n(607)),s=r(n(294)),h=r(n(37)),u=r(n(857)),c=r(n(638));e.DEFAULT_SETTINGS={hideEdgesOnMove:!1,hideLabelsOnMove:!1,renderLabels:!0,renderEdgeLabels:!1,enableEdgeClickEvents:!1,enableEdgeWheelEvents:!1,enableEdgeHoverEvents:!1,defaultNodeColor:"#999",defaultNodeType:"circle",defaultEdgeColor:"#ccc",defaultEdgeType:"line",labelFont:"Arial",labelSize:14,labelWeight:"normal",labelColor:{color:"#000"},edgeLabelFont:"Arial",edgeLabelSize:14,edgeLabelWeight:"normal",edgeLabelColor:{attribute:"color"},stagePadding:30,labelDensity:1,labelGridCellSize:100,labelRenderedSizeThreshold:6,nodeReducer:null,edgeReducer:null,zIndex:!1,minCameraRatio:null,maxCameraRatio:null,labelRenderer:o.default,hoverRenderer:a.default,edgeLabelRenderer:s.default,allowInvalidContainer:!1,nodeProgramClasses:{},nodeHoverProgramClasses:{},edgeProgramClasses:{}},e.DEFAULT_NODE_PROGRAM_CLASSES={circle:h.default},e.DEFAULT_EDGE_PROGRAM_CLASSES={arrow:c.default,line:u.default},e.validateSettings=function(t){if("number"!=typeof t.labelDensity||t.labelDensity<0)throw new Error("Settings: invalid `labelDensity`. Expecting a positive number.");var e=t.minCameraRatio,n=t.maxCameraRatio;if("number"==typeof e&&"number"==typeof n&&n<e)throw new Error("Settings: invalid camera ratio boundaries. Expecting `maxCameraRatio` to be greater than `minCameraRatio`.")},e.resolveSettings=function(t){var n=(0,i.assign)({},e.DEFAULT_SETTINGS,t);return n.nodeProgramClasses=(0,i.assign)({},e.DEFAULT_NODE_PROGRAM_CLASSES,n.nodeProgramClasses),n.edgeProgramClasses=(0,i.assign)({},e.DEFAULT_EDGE_PROGRAM_CLASSES,n.edgeProgramClasses),n}},248:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__assign||function(){return o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},o.apply(this,arguments)},a=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var h=s(n(796)),u=s(n(554)),c=s(n(886)),d=s(n(461)),l=n(291),p=n(524),f=n(98),g=n(482),v=s(n(311)),y=n(132),m=n(822);function b(t,e,n){if(!n.hasOwnProperty("x")||!n.hasOwnProperty("y"))throw new Error('Sigma: could not find a valid position (x, y) for node "'.concat(e,'". All your nodes must have a number "x" and "y". Maybe your forgot to apply a layout or your "nodeReducer" is not returning the correct data?'));return n.color||(n.color=t.defaultNodeColor),n.label||""===n.label||(n.label=null),void 0!==n.label&&null!==n.label?n.label=""+n.label:n.label=null,n.size||(n.size=2),n.hasOwnProperty("hidden")||(n.hidden=!1),n.hasOwnProperty("highlighted")||(n.highlighted=!1),n.hasOwnProperty("forceLabel")||(n.forceLabel=!1),n.type&&""!==n.type||(n.type=t.defaultNodeType),n.zIndex||(n.zIndex=0),n}function w(t,e,n){return n.color||(n.color=t.defaultEdgeColor),n.label||(n.label=""),n.size||(n.size=.5),n.hasOwnProperty("hidden")||(n.hidden=!1),n.hasOwnProperty("forceLabel")||(n.forceLabel=!1),n.type&&""!==n.type||(n.type=t.defaultEdgeType),n.zIndex||(n.zIndex=0),n}var _=function(t){function e(e,n,r){void 0===r&&(r={});var i=t.call(this)||this;if(i.elements={},i.canvasContexts={},i.webGLContexts={},i.activeListeners={},i.quadtree=new d.default,i.labelGrid=new f.LabelGrid,i.nodeDataCache={},i.edgeDataCache={},i.nodesWithForcedLabels=[],i.edgesWithForcedLabels=[],i.nodeExtent={x:[0,1],y:[0,1]},i.matrix=(0,y.identity)(),i.invMatrix=(0,y.identity)(),i.correctionRatio=1,i.customBBox=null,i.normalizationFunction=(0,p.createNormalizationFunction)({x:[0,1],y:[0,1]}),i.cameraSizeRatio=1,i.width=0,i.height=0,i.pixelRatio=(0,p.getPixelRatio)(),i.displayedLabels=new Set,i.highlightedNodes=new Set,i.hoveredNode=null,i.hoveredEdge=null,i.renderFrame=null,i.renderHighlightedNodesFrame=null,i.needToProcess=!1,i.needToSoftProcess=!1,i.checkEdgesEventsFrame=null,i.nodePrograms={},i.nodeHoverPrograms={},i.edgePrograms={},i.settings=(0,g.resolveSettings)(r),(0,g.validateSettings)(i.settings),(0,p.validateGraph)(e),!(n instanceof HTMLElement))throw new Error("Sigma: container should be an html element.");for(var o in i.graph=e,i.container=n,i.createWebGLContext("edges",{preserveDrawingBuffer:!0}),i.createCanvasContext("edgeLabels"),i.createWebGLContext("nodes"),i.createCanvasContext("labels"),i.createCanvasContext("hovers"),i.createWebGLContext("hoverNodes"),i.createCanvasContext("mouse"),i.webGLContexts){var a=i.webGLContexts[o];a.blendFunc(a.ONE,a.ONE_MINUS_SRC_ALPHA),a.enable(a.BLEND)}for(var s in i.settings.nodeProgramClasses){var h=i.settings.nodeProgramClasses[s];i.nodePrograms[s]=new h(i.webGLContexts.nodes,i);var l=h;s in i.settings.nodeHoverProgramClasses&&(l=i.settings.nodeHoverProgramClasses[s]),i.nodeHoverPrograms[s]=new l(i.webGLContexts.hoverNodes,i)}for(var s in i.settings.edgeProgramClasses){var m=i.settings.edgeProgramClasses[s];i.edgePrograms[s]=new m(i.webGLContexts.edges,i)}return i.resize(),i.camera=new u.default,i.bindCameraHandlers(),i.mouseCaptor=new c.default(i.elements.mouse,i),i.touchCaptor=new v.default(i.elements.mouse,i),i.bindEventHandlers(),i.bindGraphHandlers(),i.handleSettingsUpdate(),i.process(),i.render(),i}return i(e,t),e.prototype.createCanvas=function(t){var e=(0,p.createElement)("canvas",{position:"absolute"},{class:"sigma-".concat(t)});return this.elements[t]=e,this.container.appendChild(e),e},e.prototype.createCanvasContext=function(t){var e=this.createCanvas(t);return this.canvasContexts[t]=e.getContext("2d",{preserveDrawingBuffer:!1,antialias:!1}),this},e.prototype.createWebGLContext=function(t,e){var n,r=this.createCanvas(t),i=o({preserveDrawingBuffer:!1,antialias:!1},e||{});return(n=r.getContext("webgl2",i))||(n=r.getContext("webgl",i)),n||(n=r.getContext("experimental-webgl",i)),this.webGLContexts[t]=n,this},e.prototype.bindCameraHandlers=function(){var t=this;return this.activeListeners.camera=function(){t._scheduleRefresh()},this.camera.on("updated",this.activeListeners.camera),this},e.prototype.mouseIsOnNode=function(t,e,n){var r=t.x,i=t.y,o=e.x,a=e.y;return r>o-n&&r<o+n&&i>a-n&&i<a+n&&Math.sqrt(Math.pow(r-o,2)+Math.pow(i-a,2))<n},e.prototype.getQuadNodes=function(t){var e=this.viewportToFramedGraph(t);return this.quadtree.point(e.x,1-e.y)},e.prototype.getNodeAtPosition=function(t){for(var e=t.x,n=t.y,r=this.getQuadNodes(t),i=1/0,o=null,a=0,s=r.length;a<s;a++){var h=r[a],u=this.nodeDataCache[h],c=this.framedGraphToViewport(u),d=this.scaleSize(u.size);if(!u.hidden&&this.mouseIsOnNode(t,c,d)){var l=Math.sqrt(Math.pow(e-c.x,2)+Math.pow(n-c.y,2));l<i&&(i=l,o=h)}}return o},e.prototype.bindEventHandlers=function(){var t=this;this.activeListeners.handleResize=function(){t.needToSoftProcess=!0,t._scheduleRefresh()},window.addEventListener("resize",this.activeListeners.handleResize),this.activeListeners.handleMove=function(e){var n={event:e,preventSigmaDefault:function(){e.preventSigmaDefault()}},r=t.getNodeAtPosition(e);if(r&&t.hoveredNode!==r&&!t.nodeDataCache[r].hidden)return t.hoveredNode&&t.emit("leaveNode",o(o({},n),{node:t.hoveredNode})),t.hoveredNode=r,t.emit("enterNode",o(o({},n),{node:r})),void t.scheduleHighlightedNodesRender();if(t.hoveredNode){var i=t.nodeDataCache[t.hoveredNode],a=t.framedGraphToViewport(i),s=t.scaleSize(i.size);if(!t.mouseIsOnNode(e,a,s)){var h=t.hoveredNode;return t.hoveredNode=null,t.emit("leaveNode",o(o({},n),{node:h})),void t.scheduleHighlightedNodesRender()}}!0===t.settings.enableEdgeHoverEvents?t.checkEdgeHoverEvents(n):"debounce"===t.settings.enableEdgeHoverEvents&&(t.checkEdgesEventsFrame||(t.checkEdgesEventsFrame=(0,p.requestFrame)((function(){t.checkEdgeHoverEvents(n),t.checkEdgesEventsFrame=null}))))};var e=function(e){return function(n){var r={event:n,preventSigmaDefault:function(){n.preventSigmaDefault()}},i=n.original.isFakeSigmaMouseEvent?t.getNodeAtPosition(n):t.hoveredNode;if(i)return t.emit("".concat(e,"Node"),o(o({},r),{node:i}));if("wheel"===e?t.settings.enableEdgeWheelEvents:t.settings.enableEdgeClickEvents){var a=t.getEdgeAtPoint(n.x,n.y);if(a)return t.emit("".concat(e,"Edge"),o(o({},r),{edge:a}))}return t.emit("".concat(e,"Stage"),r)}};return this.activeListeners.handleClick=e("click"),this.activeListeners.handleRightClick=e("rightClick"),this.activeListeners.handleDoubleClick=e("doubleClick"),this.activeListeners.handleWheel=e("wheel"),this.activeListeners.handleDown=e("down"),this.mouseCaptor.on("mousemove",this.activeListeners.handleMove),this.mouseCaptor.on("click",this.activeListeners.handleClick),this.mouseCaptor.on("rightClick",this.activeListeners.handleRightClick),this.mouseCaptor.on("doubleClick",this.activeListeners.handleDoubleClick),this.mouseCaptor.on("wheel",this.activeListeners.handleWheel),this.mouseCaptor.on("mousedown",this.activeListeners.handleDown),this},e.prototype.bindGraphHandlers=function(){var t=this,e=this.graph;return this.activeListeners.graphUpdate=function(){t.needToProcess=!0,t._scheduleRefresh()},this.activeListeners.softGraphUpdate=function(){t.needToSoftProcess=!0,t._scheduleRefresh()},this.activeListeners.dropNodeGraphUpdate=function(e){delete t.nodeDataCache[e.key],t.hoveredNode===e.key&&(t.hoveredNode=null),t.activeListeners.graphUpdate()},this.activeListeners.dropEdgeGraphUpdate=function(e){delete t.edgeDataCache[e.key],t.hoveredEdge===e.key&&(t.hoveredEdge=null),t.activeListeners.graphUpdate()},this.activeListeners.clearEdgesGraphUpdate=function(){t.edgeDataCache={},t.hoveredEdge=null,t.activeListeners.graphUpdate()},this.activeListeners.clearGraphUpdate=function(){t.nodeDataCache={},t.hoveredNode=null,t.activeListeners.clearEdgesGraphUpdate()},e.on("nodeAdded",this.activeListeners.graphUpdate),e.on("nodeDropped",this.activeListeners.dropNodeGraphUpdate),e.on("nodeAttributesUpdated",this.activeListeners.softGraphUpdate),e.on("eachNodeAttributesUpdated",this.activeListeners.graphUpdate),e.on("edgeAdded",this.activeListeners.graphUpdate),e.on("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),e.on("edgeAttributesUpdated",this.activeListeners.softGraphUpdate),e.on("eachEdgeAttributesUpdated",this.activeListeners.graphUpdate),e.on("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),e.on("cleared",this.activeListeners.clearGraphUpdate),this},e.prototype.unbindGraphHandlers=function(){var t=this.graph;t.removeListener("nodeAdded",this.activeListeners.graphUpdate),t.removeListener("nodeDropped",this.activeListeners.dropNodeGraphUpdate),t.removeListener("nodeAttributesUpdated",this.activeListeners.softGraphUpdate),t.removeListener("eachNodeAttributesUpdated",this.activeListeners.graphUpdate),t.removeListener("edgeAdded",this.activeListeners.graphUpdate),t.removeListener("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),t.removeListener("edgeAttributesUpdated",this.activeListeners.softGraphUpdate),t.removeListener("eachEdgeAttributesUpdated",this.activeListeners.graphUpdate),t.removeListener("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),t.removeListener("cleared",this.activeListeners.clearGraphUpdate)},e.prototype.checkEdgeHoverEvents=function(t){var e=this.hoveredNode?null:this.getEdgeAtPoint(t.event.x,t.event.y);return e!==this.hoveredEdge&&(this.hoveredEdge&&this.emit("leaveEdge",o(o({},t),{edge:this.hoveredEdge})),e&&this.emit("enterEdge",o(o({},t),{edge:e})),this.hoveredEdge=e),this},e.prototype.getEdgeAtPoint=function(t,e){var n,r,i=this,o=this.edgeDataCache,s=this.nodeDataCache;if(!(0,m.isPixelColored)(this.webGLContexts.edges,t*this.pixelRatio,e*this.pixelRatio))return null;var h=this.viewportToGraph({x:t,y:e}),u=h.x,c=h.y,d=0;if(this.graph.someEdge((function(t,e,n,r,a,h){var u=a.x,c=a.y,l=h.x,p=h.y;if(o[t].hidden||s[n].hidden||s[r].hidden)return!1;if(u!==l||c!==p){var f=Math.sqrt(Math.pow(l-u,2)+Math.pow(p-c,2)),g=i.graphToViewport({x:u,y:c}),v=g.x,y=g.y,m=i.graphToViewport({x:l,y:p}),b=m.x,w=m.y,_=Math.sqrt(Math.pow(b-v,2)+Math.pow(w-y,2));return d=f/_,!0}})),!d)return null;var l=this.graph.filterEdges((function(t,e,n,r,a,h){return!(o[t].hidden||s[n].hidden||s[r].hidden)&&(!!(0,m.doEdgeCollideWithPoint)(u,c,a.x,a.y,h.x,h.y,o[t].size*d/i.cameraSizeRatio)||void 0)}));if(0===l.length)return null;var p=l[l.length-1],f=-1/0;try{for(var g=a(l),v=g.next();!v.done;v=g.next()){var y=v.value,b=this.graph.getEdgeAttribute(y,"zIndex");b>=f&&(p=y,f=b)}}catch(t){n={error:t}}finally{try{v&&!v.done&&(r=g.return)&&r.call(g)}finally{if(n)throw n.error}}return p},e.prototype.process=function(t){var e=this;void 0===t&&(t=!1);var n=this.graph,r=this.settings,i=this.getDimensions(),o=[1/0,-1/0],a=[1/0,-1/0];this.quadtree.clear(),this.labelGrid.resizeAndClear(i,r.labelGridCellSize),this.highlightedNodes=new Set,this.nodeExtent=(0,p.graphExtent)(n),this.nodesWithForcedLabels=[],this.edgesWithForcedLabels=[];var s=new u.default,h=(0,p.matrixFromCamera)(s.getState(),this.getDimensions(),this.getGraphDimensions(),this.getSetting("stagePadding")||0);this.normalizationFunction=(0,p.createNormalizationFunction)(this.customBBox||this.nodeExtent);for(var c={},d=n.nodes(),l=0,f=d.length;l<f;l++){var g=d[l],v=Object.assign({},n.getNodeAttributes(g));r.nodeReducer&&(v=r.nodeReducer(g,v)),c[(m=b(this.settings,g,v)).type]=(c[m.type]||0)+1,this.nodeDataCache[g]=m,this.normalizationFunction.applyTo(m),m.forceLabel&&this.nodesWithForcedLabels.push(g),this.settings.zIndex&&(m.zIndex<o[0]&&(o[0]=m.zIndex),m.zIndex>o[1]&&(o[1]=m.zIndex))}for(var y in this.nodePrograms){if(!this.nodePrograms.hasOwnProperty(y))throw new Error('Sigma: could not find a suitable program for node type "'.concat(y,'"!'));t||this.nodePrograms[y].allocate(c[y]||0),c[y]=0}for(this.settings.zIndex&&o[0]!==o[1]&&(d=(0,p.zIndexOrdering)(o,(function(t){return e.nodeDataCache[t].zIndex}),d)),l=0,f=d.length;l<f;l++){g=d[l];var m=this.nodeDataCache[g];this.quadtree.add(g,m.x,1-m.y,m.size/this.width),"string"!=typeof m.label||m.hidden||this.labelGrid.add(g,m.size,this.framedGraphToViewport(m,{matrix:h}));var _=this.nodePrograms[m.type];if(!_)throw new Error('Sigma: could not find a suitable program for node type "'.concat(m.type,'"!'));_.process(m,m.hidden,c[m.type]++),m.highlighted&&!m.hidden&&this.highlightedNodes.add(g)}this.labelGrid.organize();var x={},C=n.edges();for(l=0,f=C.length;l<f;l++){var E=C[l];v=Object.assign({},n.getEdgeAttributes(E)),r.edgeReducer&&(v=r.edgeReducer(E,v)),x[(m=w(this.settings,0,v)).type]=(x[m.type]||0)+1,this.edgeDataCache[E]=m,m.forceLabel&&!m.hidden&&this.edgesWithForcedLabels.push(E),this.settings.zIndex&&(m.zIndex<a[0]&&(a[0]=m.zIndex),m.zIndex>a[1]&&(a[1]=m.zIndex))}for(var y in this.edgePrograms){if(!this.edgePrograms.hasOwnProperty(y))throw new Error('Sigma: could not find a suitable program for edge type "'.concat(y,'"!'));t||this.edgePrograms[y].allocate(x[y]||0),x[y]=0}for(this.settings.zIndex&&a[0]!==a[1]&&(C=(0,p.zIndexOrdering)(a,(function(t){return e.edgeDataCache[t].zIndex}),C)),l=0,f=C.length;l<f;l++){E=C[l],m=this.edgeDataCache[E];var L=n.extremities(E),S=this.nodeDataCache[L[0]],M=this.nodeDataCache[L[1]],A=m.hidden||S.hidden||M.hidden;this.edgePrograms[m.type].process(S,M,m,A,x[m.type]++)}for(var y in this.edgePrograms){var N=this.edgePrograms[y];t||"function"!=typeof N.computeIndices||N.computeIndices()}return this},e.prototype.handleSettingsUpdate=function(){return this.camera.minRatio=this.settings.minCameraRatio,this.camera.maxRatio=this.settings.maxCameraRatio,this.camera.setState(this.camera.validateState(this.camera.getState())),this},e.prototype._refresh=function(){return this.needToProcess?this.process():this.needToSoftProcess&&this.process(!0),this.needToProcess=!1,this.needToSoftProcess=!1,this.render(),this},e.prototype._scheduleRefresh=function(){var t=this;return this.renderFrame||(this.renderFrame=(0,p.requestFrame)((function(){t._refresh(),t.renderFrame=null}))),this},e.prototype.renderLabels=function(){if(!this.settings.renderLabels)return this;var t=this.camera.getState(),e=this.labelGrid.getLabelsToDisplay(t.ratio,this.settings.labelDensity);(0,h.default)(e,this.nodesWithForcedLabels),this.displayedLabels=new Set;for(var n=this.canvasContexts.labels,r=0,i=e.length;r<i;r++){var a=e[r],s=this.nodeDataCache[a];if(!this.displayedLabels.has(a)&&!s.hidden){var u=this.framedGraphToViewport(s),c=u.x,d=u.y,l=this.scaleSize(s.size);!s.forceLabel&&l<this.settings.labelRenderedSizeThreshold||c<-150||c>this.width+150||d<-50||d>this.height+50||(this.displayedLabels.add(a),this.settings.labelRenderer(n,o(o({key:a},s),{size:l,x:c,y:d}),this.settings))}}return this},e.prototype.renderEdgeLabels=function(){if(!this.settings.renderEdgeLabels)return this;var t=this.canvasContexts.edgeLabels;t.clearRect(0,0,this.width,this.height);for(var e=(0,f.edgeLabelsToDisplayFromNodes)({graph:this.graph,hoveredNode:this.hoveredNode,displayedNodeLabels:this.displayedLabels,highlightedNodes:this.highlightedNodes}).concat(this.edgesWithForcedLabels),n=new Set,r=0,i=e.length;r<i;r++){var a=e[r],s=this.graph.extremities(a),h=this.nodeDataCache[s[0]],u=this.nodeDataCache[s[1]],c=this.edgeDataCache[a];n.has(a)||c.hidden||h.hidden||u.hidden||(this.settings.edgeLabelRenderer(t,o(o({key:a},c),{size:this.scaleSize(c.size)}),o(o(o({key:s[0]},h),this.framedGraphToViewport(h)),{size:this.scaleSize(h.size)}),o(o(o({key:s[1]},u),this.framedGraphToViewport(u)),{size:this.scaleSize(u.size)}),this.settings),n.add(a))}return this},e.prototype.renderHighlightedNodes=function(){var t=this,e=this.canvasContexts.hovers;e.clearRect(0,0,this.width,this.height);var n=[];this.hoveredNode&&!this.nodeDataCache[this.hoveredNode].hidden&&n.push(this.hoveredNode),this.highlightedNodes.forEach((function(e){e!==t.hoveredNode&&n.push(e)})),n.forEach((function(n){return function(n){var r=t.nodeDataCache[n],i=t.framedGraphToViewport(r),a=i.x,s=i.y,h=t.scaleSize(r.size);t.settings.hoverRenderer(e,o(o({key:n},r),{size:h,x:a,y:s}),t.settings)}(n)}));var r={};for(var i in n.forEach((function(e){var n=t.nodeDataCache[e].type;r[n]=(r[n]||0)+1})),this.nodeHoverPrograms)this.nodeHoverPrograms[i].allocate(r[i]||0),r[i]=0;for(var i in n.forEach((function(e){var n=t.nodeDataCache[e];t.nodeHoverPrograms[n.type].process(n,n.hidden,r[n.type]++)})),this.webGLContexts.hoverNodes.clear(this.webGLContexts.hoverNodes.COLOR_BUFFER_BIT),this.nodeHoverPrograms){var a=this.nodeHoverPrograms[i];a.bind(),a.bufferData(),a.render({matrix:this.matrix,width:this.width,height:this.height,ratio:this.camera.ratio,correctionRatio:this.correctionRatio/this.camera.ratio,scalingRatio:this.pixelRatio})}},e.prototype.scheduleHighlightedNodesRender=function(){var t=this;this.renderHighlightedNodesFrame||this.renderFrame||(this.renderHighlightedNodesFrame=(0,p.requestFrame)((function(){t.renderHighlightedNodesFrame=null,t.renderHighlightedNodes(),t.renderEdgeLabels()})))},e.prototype.render=function(){var t=this;this.emit("beforeRender");var e=function(){return t.emit("afterRender"),t};if(this.renderFrame&&((0,p.cancelFrame)(this.renderFrame),this.renderFrame=null,this.needToProcess=!1,this.needToSoftProcess=!1),this.resize(),this.clear(),this.updateCachedValues(),!this.graph.order)return e();var n=this.mouseCaptor,r=this.camera.isAnimated()||n.isMoving||n.draggedEvents||n.currentWheelDirection,i=this.camera.getState(),o=this.getDimensions(),a=this.getGraphDimensions(),s=this.getSetting("stagePadding")||0;for(var h in this.matrix=(0,p.matrixFromCamera)(i,o,a,s),this.invMatrix=(0,p.matrixFromCamera)(i,o,a,s,!0),this.correctionRatio=(0,p.getMatrixImpact)(this.matrix,i,o),this.nodePrograms)(u=this.nodePrograms[h]).bind(),u.bufferData(),u.render({matrix:this.matrix,width:this.width,height:this.height,ratio:i.ratio,correctionRatio:this.correctionRatio/i.ratio,scalingRatio:this.pixelRatio});if(!this.settings.hideEdgesOnMove||!r)for(var h in this.edgePrograms){var u;(u=this.edgePrograms[h]).bind(),u.bufferData(),u.render({matrix:this.matrix,width:this.width,height:this.height,ratio:i.ratio,correctionRatio:this.correctionRatio/i.ratio,scalingRatio:this.pixelRatio})}return this.settings.hideLabelsOnMove&&r||(this.renderLabels(),this.renderEdgeLabels(),this.renderHighlightedNodes()),e()},e.prototype.updateCachedValues=function(){var t=this.camera.getState().ratio;this.cameraSizeRatio=Math.sqrt(t)},e.prototype.getCamera=function(){return this.camera},e.prototype.getContainer=function(){return this.container},e.prototype.getGraph=function(){return this.graph},e.prototype.setGraph=function(t){t!==this.graph&&(this.unbindGraphHandlers(),this.nodeDataCache={},this.edgeDataCache={},this.displayedLabels.clear(),this.highlightedNodes.clear(),this.hoveredNode=null,this.hoveredEdge=null,this.nodesWithForcedLabels.length=0,this.edgesWithForcedLabels.length=0,null!==this.checkEdgesEventsFrame&&((0,p.cancelFrame)(this.checkEdgesEventsFrame),this.checkEdgesEventsFrame=null),this.graph=t,this.bindGraphHandlers(),this.process(),this.render())},e.prototype.getMouseCaptor=function(){return this.mouseCaptor},e.prototype.getTouchCaptor=function(){return this.touchCaptor},e.prototype.getDimensions=function(){return{width:this.width,height:this.height}},e.prototype.getGraphDimensions=function(){var t=this.customBBox||this.nodeExtent;return{width:t.x[1]-t.x[0]||1,height:t.y[1]-t.y[0]||1}},e.prototype.getNodeDisplayData=function(t){var e=this.nodeDataCache[t];return e?Object.assign({},e):void 0},e.prototype.getEdgeDisplayData=function(t){var e=this.edgeDataCache[t];return e?Object.assign({},e):void 0},e.prototype.getSettings=function(){return o({},this.settings)},e.prototype.getSetting=function(t){return this.settings[t]},e.prototype.setSetting=function(t,e){return this.settings[t]=e,(0,g.validateSettings)(this.settings),this.handleSettingsUpdate(),this.needToProcess=!0,this._scheduleRefresh(),this},e.prototype.updateSetting=function(t,e){return this.settings[t]=e(this.settings[t]),(0,g.validateSettings)(this.settings),this.handleSettingsUpdate(),this.needToProcess=!0,this._scheduleRefresh(),this},e.prototype.resize=function(){var t=this.width,e=this.height;if(this.width=this.container.offsetWidth,this.height=this.container.offsetHeight,this.pixelRatio=(0,p.getPixelRatio)(),0===this.width){if(!this.settings.allowInvalidContainer)throw new Error("Sigma: Container has no width. You can set the allowInvalidContainer setting to true to stop seeing this error.");this.width=1}if(0===this.height){if(!this.settings.allowInvalidContainer)throw new Error("Sigma: Container has no height. You can set the allowInvalidContainer setting to true to stop seeing this error.");this.height=1}if(t===this.width&&e===this.height)return this;for(var n in this.emit("resize"),this.elements){var r=this.elements[n];r.style.width=this.width+"px",r.style.height=this.height+"px"}for(var n in this.canvasContexts)this.elements[n].setAttribute("width",this.width*this.pixelRatio+"px"),this.elements[n].setAttribute("height",this.height*this.pixelRatio+"px"),1!==this.pixelRatio&&this.canvasContexts[n].scale(this.pixelRatio,this.pixelRatio);for(var n in this.webGLContexts)this.elements[n].setAttribute("width",this.width*this.pixelRatio+"px"),this.elements[n].setAttribute("height",this.height*this.pixelRatio+"px"),this.webGLContexts[n].viewport(0,0,this.width*this.pixelRatio,this.height*this.pixelRatio);return this},e.prototype.clear=function(){return this.webGLContexts.nodes.clear(this.webGLContexts.nodes.COLOR_BUFFER_BIT),this.webGLContexts.edges.clear(this.webGLContexts.edges.COLOR_BUFFER_BIT),this.webGLContexts.hoverNodes.clear(this.webGLContexts.hoverNodes.COLOR_BUFFER_BIT),this.canvasContexts.labels.clearRect(0,0,this.width,this.height),this.canvasContexts.hovers.clearRect(0,0,this.width,this.height),this.canvasContexts.edgeLabels.clearRect(0,0,this.width,this.height),this},e.prototype.refresh=function(){return this.needToProcess=!0,this._refresh(),this},e.prototype.scheduleRefresh=function(){return this.needToProcess=!0,this._scheduleRefresh(),this},e.prototype.getViewportZoomedState=function(t,e){var n=this.camera.getState(),r=n.ratio,i=n.angle,o=n.x,a=n.y,s=e/r,h={x:this.width/2,y:this.height/2},u=this.viewportToFramedGraph(t),c=this.viewportToFramedGraph(h);return{angle:i,x:(u.x-c.x)*(1-s)+o,y:(u.y-c.y)*(1-s)+a,ratio:e}},e.prototype.viewRectangle=function(){var t=0*this.width/8,e=0*this.height/8,n=this.viewportToFramedGraph({x:0-t,y:0-e}),r=this.viewportToFramedGraph({x:this.width+t,y:0-e}),i=this.viewportToFramedGraph({x:0,y:this.height+e});return{x1:n.x,y1:n.y,x2:r.x,y2:r.y,height:r.y-i.y}},e.prototype.framedGraphToViewport=function(t,e){void 0===e&&(e={});var n=!!e.cameraState||!!e.viewportDimensions||!!e.graphDimensions,r=e.matrix?e.matrix:n?(0,p.matrixFromCamera)(e.cameraState||this.camera.getState(),e.viewportDimensions||this.getDimensions(),e.graphDimensions||this.getGraphDimensions(),e.padding||this.getSetting("stagePadding")||0):this.matrix,i=(0,y.multiplyVec2)(r,t);return{x:(1+i.x)*this.width/2,y:(1-i.y)*this.height/2}},e.prototype.viewportToFramedGraph=function(t,e){void 0===e&&(e={});var n=!!e.cameraState||!!e.viewportDimensions||!e.graphDimensions,r=e.matrix?e.matrix:n?(0,p.matrixFromCamera)(e.cameraState||this.camera.getState(),e.viewportDimensions||this.getDimensions(),e.graphDimensions||this.getGraphDimensions(),e.padding||this.getSetting("stagePadding")||0,!0):this.invMatrix,i=(0,y.multiplyVec2)(r,{x:t.x/this.width*2-1,y:1-t.y/this.height*2});return isNaN(i.x)&&(i.x=0),isNaN(i.y)&&(i.y=0),i},e.prototype.viewportToGraph=function(t,e){return void 0===e&&(e={}),this.normalizationFunction.inverse(this.viewportToFramedGraph(t,e))},e.prototype.graphToViewport=function(t,e){return void 0===e&&(e={}),this.framedGraphToViewport(this.normalizationFunction(t),e)},e.prototype.getBBox=function(){return(0,p.graphExtent)(this.graph)},e.prototype.getCustomBBox=function(){return this.customBBox},e.prototype.setCustomBBox=function(t){return this.customBBox=t,this._scheduleRefresh(),this},e.prototype.kill=function(){this.emit("kill"),this.removeAllListeners(),this.camera.removeListener("updated",this.activeListeners.camera),window.removeEventListener("resize",this.activeListeners.handleResize),this.mouseCaptor.kill(),this.touchCaptor.kill(),this.unbindGraphHandlers(),this.quadtree=new d.default,this.nodeDataCache={},this.edgeDataCache={},this.nodesWithForcedLabels=[],this.edgesWithForcedLabels=[],this.highlightedNodes.clear(),this.renderFrame&&((0,p.cancelFrame)(this.renderFrame),this.renderFrame=null),this.renderHighlightedNodesFrame&&((0,p.cancelFrame)(this.renderHighlightedNodesFrame),this.renderHighlightedNodesFrame=null);for(var t=this.container;t.firstChild;)t.removeChild(t.firstChild)},e.prototype.scaleSize=function(t){return t/this.cameraSizeRatio},e.prototype.getCanvases=function(){return o({},this.elements)},e}(l.TypedEventEmitter);e.default=_},291:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.TypedEventEmitter=void 0;var o=function(t){function e(){var e=t.call(this)||this;return e.rawEmitter=e,e}return i(e,t),e}(n(187).EventEmitter);e.TypedEventEmitter=o},227:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.animateNodes=e.ANIMATE_DEFAULTS=void 0;var i=n(524),o=r(n(941));e.ANIMATE_DEFAULTS={easing:"quadraticInOut",duration:150},e.animateNodes=function(t,n,r,a){var s=Object.assign({},e.ANIMATE_DEFAULTS,r),h="function"==typeof s.easing?s.easing:o.default[s.easing],u=Date.now(),c={};for(var d in n){var l=n[d];for(var p in c[d]={},l)c[d][p]=t.getNodeAttribute(d,p)}var f=null,g=function(){f=null;var e=(Date.now()-u)/s.duration;if(e>=1){for(var r in n){var o=n[r];for(var d in o)t.setNodeAttribute(r,d,o[d])}"function"==typeof a&&a()}else{for(var r in e=h(e),n){o=n[r];var l=c[r];for(var d in o)t.setNodeAttribute(r,d,o[d]*e+l[d]*(1-e))}f=(0,i.requestFrame)(g)}};return g(),function(){f&&(0,i.cancelFrame)(f)}}},109:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HTML_COLORS=void 0,e.HTML_COLORS={black:"#000000",silver:"#C0C0C0",gray:"#808080",grey:"#808080",white:"#FFFFFF",maroon:"#800000",red:"#FF0000",purple:"#800080",fuchsia:"#FF00FF",green:"#008000",lime:"#00FF00",olive:"#808000",yellow:"#FFFF00",navy:"#000080",blue:"#0000FF",teal:"#008080",aqua:"#00FFFF",darkblue:"#00008B",mediumblue:"#0000CD",darkgreen:"#006400",darkcyan:"#008B8B",deepskyblue:"#00BFFF",darkturquoise:"#00CED1",mediumspringgreen:"#00FA9A",springgreen:"#00FF7F",cyan:"#00FFFF",midnightblue:"#191970",dodgerblue:"#1E90FF",lightseagreen:"#20B2AA",forestgreen:"#228B22",seagreen:"#2E8B57",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",limegreen:"#32CD32",mediumseagreen:"#3CB371",turquoise:"#40E0D0",royalblue:"#4169E1",steelblue:"#4682B4",darkslateblue:"#483D8B",mediumturquoise:"#48D1CC",indigo:"#4B0082",darkolivegreen:"#556B2F",cadetblue:"#5F9EA0",cornflowerblue:"#6495ED",rebeccapurple:"#663399",mediumaquamarine:"#66CDAA",dimgray:"#696969",dimgrey:"#696969",slateblue:"#6A5ACD",olivedrab:"#6B8E23",slategray:"#708090",slategrey:"#708090",lightslategray:"#778899",lightslategrey:"#778899",mediumslateblue:"#7B68EE",lawngreen:"#7CFC00",chartreuse:"#7FFF00",aquamarine:"#7FFFD4",skyblue:"#87CEEB",lightskyblue:"#87CEFA",blueviolet:"#8A2BE2",darkred:"#8B0000",darkmagenta:"#8B008B",saddlebrown:"#8B4513",darkseagreen:"#8FBC8F",lightgreen:"#90EE90",mediumpurple:"#9370DB",darkviolet:"#9400D3",palegreen:"#98FB98",darkorchid:"#9932CC",yellowgreen:"#9ACD32",sienna:"#A0522D",brown:"#A52A2A",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",lightblue:"#ADD8E6",greenyellow:"#ADFF2F",paleturquoise:"#AFEEEE",lightsteelblue:"#B0C4DE",powderblue:"#B0E0E6",firebrick:"#B22222",darkgoldenrod:"#B8860B",mediumorchid:"#BA55D3",rosybrown:"#BC8F8F",darkkhaki:"#BDB76B",mediumvioletred:"#C71585",indianred:"#CD5C5C",peru:"#CD853F",chocolate:"#D2691E",tan:"#D2B48C",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",thistle:"#D8BFD8",orchid:"#DA70D6",goldenrod:"#DAA520",palevioletred:"#DB7093",crimson:"#DC143C",gainsboro:"#DCDCDC",plum:"#DDA0DD",burlywood:"#DEB887",lightcyan:"#E0FFFF",lavender:"#E6E6FA",darksalmon:"#E9967A",violet:"#EE82EE",palegoldenrod:"#EEE8AA",lightcoral:"#F08080",khaki:"#F0E68C",aliceblue:"#F0F8FF",honeydew:"#F0FFF0",azure:"#F0FFFF",sandybrown:"#F4A460",wheat:"#F5DEB3",beige:"#F5F5DC",whitesmoke:"#F5F5F5",mintcream:"#F5FFFA",ghostwhite:"#F8F8FF",salmon:"#FA8072",antiquewhite:"#FAEBD7",linen:"#FAF0E6",lightgoldenrodyellow:"#FAFAD2",oldlace:"#FDF5E6",magenta:"#FF00FF",deeppink:"#FF1493",orangered:"#FF4500",tomato:"#FF6347",hotpink:"#FF69B4",coral:"#FF7F50",darkorange:"#FF8C00",lightsalmon:"#FFA07A",orange:"#FFA500",lightpink:"#FFB6C1",pink:"#FFC0CB",gold:"#FFD700",peachpuff:"#FFDAB9",navajowhite:"#FFDEAD",moccasin:"#FFE4B5",bisque:"#FFE4C4",mistyrose:"#FFE4E1",blanchedalmond:"#FFEBCD",papayawhip:"#FFEFD5",lavenderblush:"#FFF0F5",seashell:"#FFF5EE",cornsilk:"#FFF8DC",lemonchiffon:"#FFFACD",floralwhite:"#FFFAF0",snow:"#FFFAFA",lightyellow:"#FFFFE0",ivory:"#FFFFF0"}},941:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.cubicInOut=e.cubicOut=e.cubicIn=e.quadraticInOut=e.quadraticOut=e.quadraticIn=e.linear=void 0,e.linear=function(t){return t},e.quadraticIn=function(t){return t*t},e.quadraticOut=function(t){return t*(2-t)},e.quadraticInOut=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},e.cubicIn=function(t){return t*t*t},e.cubicOut=function(t){return--t*t*t+1},e.cubicInOut=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)};var n={linear:e.linear,quadraticIn:e.quadraticIn,quadraticOut:e.quadraticOut,quadraticInOut:e.quadraticInOut,cubicIn:e.cubicIn,cubicOut:e.cubicOut,cubicInOut:e.cubicInOut};e.default=n},822:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.doEdgeCollideWithPoint=e.isPixelColored=void 0,e.isPixelColored=function(t,e,n){var r=new Uint8Array(4);return t.readPixels(e,t.drawingBufferHeight-n,1,1,t.RGBA,t.UNSIGNED_BYTE,r),r[3]>0},e.doEdgeCollideWithPoint=function(t,e,n,r,i,o,a){return!(t<n-a&&t<i-a||e<r-a&&e<o-a||t>n+a&&t>i+a||e>r+a&&e>o+a||!(Math.abs((i-n)*(r-e)-(n-t)*(o-r))/Math.sqrt(Math.pow(i-n,2)+Math.pow(o-r,2))<a/2))}},524:function(t,e,n){"use strict";var r=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.validateGraph=e.canUse32BitsIndices=e.extractPixel=e.getMatrixImpact=e.matrixFromCamera=e.getCorrectionRatio=e.floatColor=e.floatArrayColor=e.parseColor=e.zIndexOrdering=e.createNormalizationFunction=e.graphExtent=e.getPixelRatio=e.createElement=e.cancelFrame=e.requestFrame=e.assignDeep=e.assign=e.isPlainObject=void 0;var o=i(n(186)),a=n(132),s=n(109);function h(t){return"object"==typeof t&&null!==t&&t.constructor===Object}e.isPlainObject=h,e.assign=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];t=t||{};for(var r=0,i=e.length;r<i;r++){var o=e[r];o&&Object.assign(t,o)}return t},e.assignDeep=function t(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];e=e||{};for(var i=0,o=n.length;i<o;i++){var a=n[i];if(a)for(var s in a)h(a[s])?e[s]=t(e[s],a[s]):e[s]=a[s]}return e},e.requestFrame="undefined"!=typeof requestAnimationFrame?function(t){return requestAnimationFrame(t)}:function(t){return setTimeout(t,0)},e.cancelFrame="undefined"!=typeof cancelAnimationFrame?function(t){return cancelAnimationFrame(t)}:function(t){return clearTimeout(t)},e.createElement=function(t,e,n){var r=document.createElement(t);if(e)for(var i in e)r.style[i]=e[i];if(n)for(var i in n)r.setAttribute(i,n[i]);return r},e.getPixelRatio=function(){return void 0!==window.devicePixelRatio?window.devicePixelRatio:1},e.graphExtent=function(t){if(!t.order)return{x:[0,1],y:[0,1]};var e=1/0,n=-1/0,r=1/0,i=-1/0;return t.forEachNode((function(t,o){var a=o.x,s=o.y;a<e&&(e=a),a>n&&(n=a),s<r&&(r=s),s>i&&(i=s)})),{x:[e,n],y:[r,i]}},e.createNormalizationFunction=function(t){var e=r(t.x,2),n=e[0],i=e[1],o=r(t.y,2),a=o[0],s=o[1],h=Math.max(i-n,s-a),u=(i+n)/2,c=(s+a)/2;(0===h||Math.abs(h)===1/0||isNaN(h))&&(h=1),isNaN(u)&&(u=0),isNaN(c)&&(c=0);var d=function(t){return{x:.5+(t.x-u)/h,y:.5+(t.y-c)/h}};return d.applyTo=function(t){t.x=.5+(t.x-u)/h,t.y=.5+(t.y-c)/h},d.inverse=function(t){return{x:u+h*(t.x-.5),y:c+h*(t.y-.5)}},d.ratio=h,d},e.zIndexOrdering=function(t,e,n){return n.sort((function(t,n){var r=e(t)||0,i=e(n)||0;return r<i?-1:r>i?1:0}))};var u=new Int8Array(4),c=new Int32Array(u.buffer,0,1),d=new Float32Array(u.buffer,0,1),l=/^\s*rgba?\s*\(/,p=/^\s*rgba?\s*\(\s*([0-9]*)\s*,\s*([0-9]*)\s*,\s*([0-9]*)(?:\s*,\s*(.*)?)?\)\s*$/;function f(t){var e=0,n=0,r=0,i=1;if("#"===t[0])4===t.length?(e=parseInt(t.charAt(1)+t.charAt(1),16),n=parseInt(t.charAt(2)+t.charAt(2),16),r=parseInt(t.charAt(3)+t.charAt(3),16)):(e=parseInt(t.charAt(1)+t.charAt(2),16),n=parseInt(t.charAt(3)+t.charAt(4),16),r=parseInt(t.charAt(5)+t.charAt(6),16)),9===t.length&&(i=parseInt(t.charAt(7)+t.charAt(8),16)/255);else if(l.test(t)){var o=t.match(p);o&&(e=+o[1],n=+o[2],r=+o[3],o[4]&&(i=+o[4]))}return{r:e,g:n,b:r,a:i}}e.parseColor=f;var g={};for(var v in s.HTML_COLORS)g[v]=y(s.HTML_COLORS[v]),g[s.HTML_COLORS[v]]=g[v];function y(t){if(void 0!==g[t])return g[t];var e=f(t),n=e.r,r=e.g,i=e.b,o=e.a;o=255*o|0,c[0]=4278190079&(o<<24|i<<16|r<<8|n);var a=d[0];return g[t]=a,a}function m(t,e){var n=t.height/t.width,r=e.height/e.width;return n<1&&r>1||n>1&&r<1?1:Math.min(Math.max(r,1/r),Math.max(1/n,n))}e.floatArrayColor=function(t){var e=f(t=s.HTML_COLORS[t]||t),n=e.r,r=e.g,i=e.b,o=e.a;return new Float32Array([n/255,r/255,i/255,o])},e.floatColor=y,e.getCorrectionRatio=m,e.matrixFromCamera=function(t,e,n,r,i){var o=t.angle,s=t.ratio,h=t.x,u=t.y,c=e.width,d=e.height,l=(0,a.identity)(),p=Math.min(c,d)-2*r,f=m(e,n);return i?((0,a.multiply)(l,(0,a.translate)((0,a.identity)(),h,u)),(0,a.multiply)(l,(0,a.scale)((0,a.identity)(),s)),(0,a.multiply)(l,(0,a.rotate)((0,a.identity)(),o)),(0,a.multiply)(l,(0,a.scale)((0,a.identity)(),c/p/2/f,d/p/2/f))):((0,a.multiply)(l,(0,a.scale)((0,a.identity)(),p/c*2*f,p/d*2*f)),(0,a.multiply)(l,(0,a.rotate)((0,a.identity)(),-o)),(0,a.multiply)(l,(0,a.scale)((0,a.identity)(),1/s)),(0,a.multiply)(l,(0,a.translate)((0,a.identity)(),-h,-u))),l},e.getMatrixImpact=function(t,e,n){var r=(0,a.multiplyVec2)(t,{x:Math.cos(e.angle),y:Math.sin(e.angle)},0),i=r.x,o=r.y;return 1/Math.sqrt(Math.pow(i,2)+Math.pow(o,2))/n.width},e.extractPixel=function(t,e,n,r){var i=r||new Uint8Array(4);return t.readPixels(e,n,1,1,t.RGBA,t.UNSIGNED_BYTE,i),i},e.canUse32BitsIndices=function(t){return"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||!!t.getExtension("OES_element_index_uint")},e.validateGraph=function(t){if(!(0,o.default)(t))throw new Error("Sigma: invalid graph instance.");t.forEachNode((function(t,e){if(!Number.isFinite(e.x)||!Number.isFinite(e.y))throw new Error("Sigma: Coordinates of node ".concat(t," are invalid. A node must have a numeric 'x' and 'y' attribute."))}))}},132:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.multiplyVec2=e.multiply=e.translate=e.rotate=e.scale=e.identity=void 0,e.identity=function(){return Float32Array.of(1,0,0,0,1,0,0,0,1)},e.scale=function(t,e,n){return t[0]=e,t[4]="number"==typeof n?n:e,t},e.rotate=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[3]=-n,t[4]=r,t},e.translate=function(t,e,n){return t[6]=e,t[7]=n,t},e.multiply=function(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],h=t[6],u=t[7],c=t[8],d=e[0],l=e[1],p=e[2],f=e[3],g=e[4],v=e[5],y=e[6],m=e[7],b=e[8];return t[0]=d*n+l*o+p*h,t[1]=d*r+l*a+p*u,t[2]=d*i+l*s+p*c,t[3]=f*n+g*o+v*h,t[4]=f*r+g*a+v*u,t[5]=f*i+g*s+v*c,t[6]=y*n+m*o+b*h,t[7]=y*r+m*a+b*u,t[8]=y*i+m*s+b*c,t},e.multiplyVec2=function(t,e,n){void 0===n&&(n=1);var r=t[0],i=t[1],o=t[3],a=t[4],s=t[6],h=t[7],u=e.x,c=e.y;return{x:u*r+c*o+s*n,y:u*i+c*a+h*n}}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r].call(o.exports,o,o.exports,n),o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{ForceAtlasAnimator:()=>rt,GraphManager:()=>ye,GraphView:()=>xe,LinearAnimator:()=>be,MultiResolutionGraph:()=>Fe,NodeBorderProgram:()=>je,defaultSettings:()=>nt,initialGraphLayout:()=>te,iterateNoIntercomponentRepel:()=>J,relativeComponentLayout:()=>Qt});var t,e=n(26),i=n(404),o=n.n(i),a=n(308),s=n(803),h=0,u=1,c=2,d=3,l=4,p=5,f=6,g=7,v=8,y=9,m=10,b=3,w=0,_=1,x=2;class C{static _xfnv1a(t){let e=2166136261;for(let n=0;n<t.length;n++)e=Math.imul(e^t.charCodeAt(n),16777619);return()=>(e+=e<<13,e^=e>>>7,e+=e<<3,e^=e>>>17,(e+=e<<5)>>>0)}}class E extends C{constructor(t){super(),Object.defineProperty(this,"a",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.a=E._xfnv1a(t)()}next(){let t=this.a+=1831565813;return t=Math.imul(t^t>>>15,1|t),t^=t+Math.imul(t^t>>>7,61|t),((t^t>>>14)>>>0)/4294967296}}class L extends C{constructor(t){super(),Object.defineProperty(this,"a",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"b",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"c",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"d",{enumerable:!0,configurable:!0,writable:!0,value:void 0});const e=L._xfnv1a(t);this.a=e(),this.b=e(),this.c=e(),this.d=e()}next(){this.a>>>=0,this.b>>>=0,this.c>>>=0,this.d>>>=0;let t=this.a+this.b|0;return this.a=this.b^this.b>>>9,this.b=this.c+(this.c<<3)|0,this.c=this.c<<21|this.c>>>11,this.d=this.d+1|0,t=t+this.d|0,this.c=this.c+t|0,(t>>>0)/4294967296}}class S extends C{constructor(t){super(),Object.defineProperty(this,"a",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"b",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"c",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"d",{enumerable:!0,configurable:!0,writable:!0,value:void 0});const e=S._xfnv1a(t);this.a=e(),this.b=e(),this.c=e(),this.d=e()}next(){const t=this.b<<9;let e=5*this.b;return e=9*(e<<7|e>>>25),this.c^=this.a,this.d^=this.b,this.b^=this.c,this.a^=this.d,this.c^=t,this.d=this.d<<11|this.d>>>21,(e>>>0)/4294967296}}!function(t){t.sfc32="sfc32",t.mulberry32="mulberry32",t.xoshiro128ss="xoshiro128ss"}(t||(t={}));class M{constructor(e,n=t.sfc32){Object.defineProperty(this,"str",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"prng",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"generator",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.str=e,this.prng=n,this.generator=this._initializeGenerator()}next(){return this.generator.next()}_initializeGenerator(){if((t=>null===t)(t=this.str)||(t=>void 0===t)(t))return this.wrap();var t;switch(this.prng){case"sfc32":return new L(this.str);case"mulberry32":return new E(this.str);case"xoshiro128ss":return new S(this.str);default:return this.wrap()}}wrap(){return{next:()=>Math.random()}}}var A=0,N=1,k=2,P=3,D=4,G=5,F=6,O=7,T=8,R=9,j=3,z=10,B=function(t,e){var n=function(t,e){var n=Array.from({length:t},(function(t,e){return e}));return function(t,e){for(var n=new M(e||"permutation"+t.length),r=0;r<t.length-1;r++){var i=Math.floor(n.next()*(t.length-r-1))+r,o=t[r];t[r]=t[i],t[i]=o}}(n,e),n}(t-1,e);return n.push(t-1),n};function U(t,e,n,r){t[e+c]+=r,t[n+c]-=r}function I(t,e,n,r){t[e+d]+=r,t[n+d]-=r}function H(t,e,n,r){var i=t[e+h]-t[n+h],o=t[e+u]-t[n+u],a=Math.sqrt(i*i+o*o)-t[e+v]-t[n+v],s=Math.pow(a,2),c=a>0?r*t[e+f]*t[n+f]/s:100*r*t[e+f]*t[n+f];U(t,e,n,i*c),I(t,e,n,o*c)}function W(t,e,n,r,i){void 0===i&&(i=2);var o=t[e+h]-t[n+h],a=t[e+u]-t[n+u],s=o*o+a*a;if(s>0){var c=Math.sqrt(s),d=r*t[e+f]*t[n+f]/Math.pow(c,i);U(t,e,n,o*d),I(t,e,n,a*d)}}function V(t,e,n){var r=t.scalingRatio,i=t.adjustSizes,o=t.barnesHutThreshold,a=t.barnesHutTheta,s=i?H:W;n.forEach((function(t){t.length>=o?function(t,e,n,r,i){e.length;var o=function(t,e){var n,r,i,o=[],a=1/0,s=-1/0,c=1/0,d=-1/0;e.forEach((function(e){var n=Number(e)*m;a=Math.min(a,t[n+h]),s=Math.max(s,t[n+h]),c=Math.min(c,t[n+u]),d=Math.max(d,t[n+u])}));var l=s-a,p=d-c;l>p?d=(c-=(l-p)/2)+l:s=(a-=(p-l)/2)+p,o[0+A]=-1,o[0+N]=(a+s)/2,o[0+k]=(c+d)/2,o[0+P]=Math.max(s-a,d-c),o[0+D]=-1,o[0+G]=-1,o[0+F]=0,o[0+O]=0,o[0+T]=0;var g=1;return e.forEach((function(e){var a=Number(e)*m,s=0;for(i=j;;){if(!(o[s+G]>=0)){if(o[s+A]<0){o[s+A]=a;break}o[s+G]=g*R;var c=o[s+P]/2,d=o[s+G];if(o[d+A]=-1,o[d+N]=o[s+N]-c,o[d+k]=o[s+k]-c,o[d+P]=c,o[d+D]=d+R,o[d+G]=-1,o[d+F]=0,o[d+O]=0,o[d+T]=0,o[(d+=R)+A]=-1,o[d+N]=o[s+N]-c,o[d+k]=o[s+k]+c,o[d+P]=c,o[d+D]=d+R,o[d+G]=-1,o[d+F]=0,o[d+O]=0,o[d+T]=0,o[(d+=R)+A]=-1,o[d+N]=o[s+N]+c,o[d+k]=o[s+k]-c,o[d+P]=c,o[d+D]=d+R,o[d+G]=-1,o[d+F]=0,o[d+O]=0,o[d+T]=0,o[(d+=R)+A]=-1,o[d+N]=o[s+N]+c,o[d+k]=o[s+k]+c,o[d+P]=c,o[d+D]=o[s+D],o[d+G]=-1,o[d+F]=0,o[d+O]=0,o[d+T]=0,g+=4,n=t[o[s+A]+h]<o[s+N]?t[o[s+A]+u]<o[s+k]?o[s+G]:o[s+G]+R:t[o[s+A]+u]<o[s+k]?o[s+G]+2*R:o[s+G]+3*R,o[s+F]=t[o[s+A]+f],o[s+O]=t[o[s+A]+h],o[s+T]=t[o[s+A]+u],o[n+A]=o[s+A],o[s+A]=-1,r=t[a+h]<o[s+N]?t[a+u]<o[s+k]?o[s+G]:o[s+G]+R:t[a+u]<o[s+k]?o[s+G]+2*R:o[s+G]+3*R,n===r){if(i--){s=n;continue}i=j;break}o[r+A]=a;break}n=t[a+h]<o[s+N]?t[a+u]<o[s+k]?o[s+G]:o[s+G]+R:t[a+u]<o[s+k]?o[s+G]+2*R:o[s+G]+3*R,o[s+O]=(o[s+O]*o[s+F]+t[a+h]*t[a+f])/(o[s+F]+t[a+f]),o[s+T]=(o[s+T]*o[s+F]+t[a+u]*t[a+f])/(o[s+F]+t[a+f]),o[s+F]+=t[a+f],s=n}})),o}(t,e);e.forEach((function(e){for(var a=Number(e)*m,s=0;;)if(o[s+G]>=0){var l=Math.pow(t[a+h]-o[s+O],2)+Math.pow(t[a+u]-o[s+T],2),p=o[s+P];if(4*p*p/l<i){var g=t[a+h]-o[s+O],v=t[a+u]-o[s+T],y=void 0;if(!0===r?l>0?(y=n*t[a+f]*o[s+F]/l,t[a+c]+=g*y,t[a+d]+=v*y):l<0&&(y=-n*t[a+f]*o[s+F]/Math.sqrt(l),t[a+c]+=g*y,t[a+d]+=v*y):l>0&&(y=n*t[a+f]*o[s+F]/l,t[a+c]+=g*y,t[a+d]+=v*y),(s=o[s+D])<0)break;continue}s=o[s+G]}else{var b=o[s+A];if(b>=0&&b!==a&&(l=(g=t[a+h]-t[b+h])*g+(v=t[a+u]-t[b+u])*v,y=void 0,!0===r?l>0?(y=n*t[a+f]*t[b+f]/l,t[a+c]+=g*y,t[a+d]+=v*y):l<0&&(y=-n*t[a+f]*t[b+f]/Math.sqrt(l),t[a+c]+=g*y,t[a+d]+=v*y):l>0&&(y=n*t[a+f]*t[b+f]/l,t[a+c]+=g*y,t[a+d]+=v*y)),(s=o[s+D])<0)break}}))}(e,t,r,i,Math.pow(a,2)):function(t,e,n,r){for(var i=0;i<e.length;i+=1)for(var o=Number(e[i])*m,a=0;a<i;a+=1)r(t,o,Number(e[a])*m,n)}(e,t,r,s)}))}function q(t,e,n,r){var i=t[e+h]-t[n+h],o=t[e+u]-t[n+u],a=-r;U(t,e,n,i*a),I(t,e,n,o*a)}function Z(t,e,n,r){var i=t[e+h]-t[n+h],o=t[e+u]-t[n+u],a=-r;Math.sqrt(i*i+o*o)-t[e+v]-t[n+v]>0&&(U(t,e,n,i*a),I(t,e,n,o*a))}function Y(t,e,n,r){var i=t[e+h]-t[n+h],o=t[e+u]-t[n+u],a=Math.sqrt(i*i+o*o);if(a>0){var s=-r*Math.log(1+a)/a;U(t,e,n,i*s),I(t,e,n,o*s)}}function K(t,e,n,r){var i=t[e+h]-t[n+h],o=t[e+u]-t[n+u],a=Math.sqrt(i*i+o*o)-t[e+v]-t[n+v];if(a>0){var s=-r*Math.log(1+a)/a;U(t,e,n,i*s),I(t,e,n,o*s)}}function X(t,e){var n=t[e+l]-t[e+c],r=t[e+p]-t[e+d];return t[e+f]*Math.sqrt(Math.pow(n,2)+Math.pow(r,2))}function Q(t,e){var n=t[e+l]+t[e+c],r=t[e+p]+t[e+d];return Math.sqrt(Math.pow(n,2)+Math.pow(r,2))/2}function J(t,e,n,r){for(var i=t.adjustSizes,o=t.nRepulsiveCycles,a=0;a<e.length;a+=m)e[a+l]=e[a+c],e[a+p]=e[a+d],e[a+c]=0,e[a+d]=0;if(o){var s=r.map((function(t){return Array.from({length:o},(function(){return B(t.length)}))}));!function(t,e,n,r){var i=t.scalingRatio,o=t.adjustSizes?H:W;n.forEach((function(t,n){!function(t,e,n,r,i){var o=r,a=e.length*(e.length-1)/2/(e.length*o.length);o.forEach((function(r){for(var o=0;o<r.length;o+=1){var s=void 0,h=void 0;o<r.length-1?(s=Number(e[r[o]])*m,h=Number(e[r[o+1]])*m):(s=Number(e[r[o]])*m,h=Number(e[r[0]])*m),i(t,s,h,n*a)}}))}(e,t,i,r[n],o)}))}(t,e,r,s)}else V(t,e,r);for(var f=n.length,v=0;v<f;v+=b){var C=n[v+w],E=n[v+_],L=n[v+x];!0===i?t.linLogMode?K(e,C,E,L):Z(e,C,E,L):t.linLogMode?Y(e,C,E,L):q(e,C,E,L)}if(!0===i){for(a=0;a<e.length;a+=m)if(1!==e[a+y]){var S=Math.sqrt(Math.pow(e[a+c],2)+Math.pow(e[a+d],2));S>z&&(e[a+c]=e[a+c]*z/S,e[a+d]=e[a+d]*z/S);var M=X(e,a),A=Q(e,a),N=1+Math.sqrt(M),k=(P=.1*Math.log(1+A)/N)/t.slowDown;e[a+h]+=e[a+c]*k,e[a+u]+=e[a+d]*k}}else for(a=0;a<e.length;a+=m)if(1!==e[a+y]){M=X(e,a),A=Q(e,a),N=1+Math.sqrt(M);var P=e[a+g]*Math.log(1+A)/N;e[a+g]=Math.min(1,Math.sqrt(P*(Math.pow(e[a+c],2)+Math.pow(e[a+d],2))/N)),k=P/t.slowDown,e[a+h]+=e[a+c]*k,e[a+u]+=e[a+d]*k}return{}}var $=n(739),tt=$.assignLayoutChanges,et=$.graphToByteArrays,nt={linLogMode:!1,adjustSizes:!1,scalingRatio:1,slowDown:1,barnesHutTheta:.7,barnesHutThreshold:1e3},rt=function(){function t(t,e,n){this.graph=t,this.graph_components=(0,s.kS)(t),this.params=e,this.frameID=null,this.running=!1,this.getEdgeWeight=(0,a.Q6)(void 0).fromEntry,this.graphArrays=et(t,this.getEdgeWeight),this.outputReducer=null,this.niters=0,this.maxiters=n.maxiters,this.miniters=n.miniters,this.convergenceThreshold=n.convergenceThreshold}return t.prototype.isRunning=function(){return this.running},t.prototype.resetNIters=function(){this.niters=0},t.prototype.updateNodePropsArrays=function(t){var e=0,n=t;return this.graph.forEachNode((function(t,r){r.fixed&&(n.nodes[e+h]=r.x,n.nodes[e+u]=r.y,n.nodes[e+c]=0,n.nodes[e+d]=0,n.nodes[e+l]=0,n.nodes[e+p]=0),n.nodes[e+y]=r.fixed?1:0,e+=m})),n},t.prototype.forceNodePositionUpdate=function(){var t=this.graphArrays;if(t){var e=0;this.graph.forEachNode((function(n,r){t.nodes[e+h]=r.x,t.nodes[e+u]=r.y,t.nodes[e+c]=0,t.nodes[e+d]=0,t.nodes[e+l]=0,t.nodes[e+p]=0,e+=m}))}},t.prototype.hasConverged=function(){var t=0;if(!this.graphArrays)return!1;for(t=0;t<this.graphArrays.nodes.length;t+=m)if(this.graphArrays.nodes[t+7]>this.convergenceThreshold)return!1;return!0},t.prototype.runFrame=function(){var t,e=this;this.graphArrays?t=this.updateNodePropsArrays(this.graphArrays):(t=et(this.graph,this.getEdgeWeight),this.graphArrays=t),void 0!==this.params.settings?(J(this.params.settings,t.nodes,t.edges,this.graph_components),tt(this.graph,t.nodes,this.outputReducer),this.niters+=1,this.niters>this.maxiters||this.niters>this.miniters&&this.hasConverged()?this.stop():this.frameID=window.requestAnimationFrame((function(){return e.runFrame()}))):(console.error("No Settings Provided"),this.stop())},t.prototype.stop=function(){return this.running=!1,this.resetNIters(),null!==this.frameID&&(window.cancelAnimationFrame(this.frameID),this.frameID=null),this},t.prototype.start=function(){this.running||(this.running=!0,this.runFrame())},t.prototype.kill=function(){this.stop(),delete this.graphArrays},t}(),it=n(186),ot=n.n(it);function at(){var t=0,e=1,n=2,r=3,i=4,o=5,a=6,s=8,h=10,u=0,c=1,d=2,l=3,p=4,f=5,g=6,v=7,y=8,m=9,b=3;function w(t,e,r,i){t[e+n]+=i,t[r+n]-=i}function _(t,e,n,i){t[e+r]+=i,t[n+r]-=i}function x(n,r,i,o){var h=n[r+t]-n[i+t],u=n[r+e]-n[i+e],c=Math.sqrt(h*h+u*u)-n[r+s]-n[i+s],d=Math.pow(c,2),l=c>0?o*n[r+a]*n[i+a]/d:100*o*n[r+a]*n[i+a];w(n,r,i,h*l),_(n,r,i,u*l)}function C(n,r,i,o,s){void 0===s&&(s=2);var h=n[r+t]-n[i+t],u=n[r+e]-n[i+e],c=h*h+u*u;if(c>0){var d=Math.sqrt(c),l=o*n[r+a]*n[i+a]/Math.pow(d,s);w(n,r,i,h*l),_(n,r,i,u*l)}}function E(i,o,s){var w=i.scalingRatio,_=i.adjustSizes,E=i.barnesHutThreshold,L=i.barnesHutTheta,S=_?x:C;s.forEach((function(i){i.length>=E?function(i,o,s,w,_){o.length;var x=function(n,r){var i,o,s,w=[],_=1/0,x=-1/0,C=1/0,E=-1/0;r.forEach((function(r){var i=Number(r)*h;_=Math.min(_,n[i+t]),x=Math.max(x,n[i+t]),C=Math.min(C,n[i+e]),E=Math.max(E,n[i+e])}));var L=x-_,S=E-C;L>S?E=(C-=(L-S)/2)+L:x=(_-=(S-L)/2)+S,w[0+u]=-1,w[0+c]=(_+x)/2,w[0+d]=(C+E)/2,w[0+l]=Math.max(x-_,E-C),w[0+p]=-1,w[0+f]=-1,w[0+g]=0,w[0+v]=0,w[0+y]=0;var M=1;return r.forEach((function(r){var _=Number(r)*h,x=0;for(s=b;;){if(!(w[x+f]>=0)){if(w[x+u]<0){w[x+u]=_;break}w[x+f]=M*m;var C=w[x+l]/2,E=w[x+f];if(w[E+u]=-1,w[E+c]=w[x+c]-C,w[E+d]=w[x+d]-C,w[E+l]=C,w[E+p]=E+m,w[E+f]=-1,w[E+g]=0,w[E+v]=0,w[E+y]=0,w[(E+=m)+u]=-1,w[E+c]=w[x+c]-C,w[E+d]=w[x+d]+C,w[E+l]=C,w[E+p]=E+m,w[E+f]=-1,w[E+g]=0,w[E+v]=0,w[E+y]=0,w[(E+=m)+u]=-1,w[E+c]=w[x+c]+C,w[E+d]=w[x+d]-C,w[E+l]=C,w[E+p]=E+m,w[E+f]=-1,w[E+g]=0,w[E+v]=0,w[E+y]=0,w[(E+=m)+u]=-1,w[E+c]=w[x+c]+C,w[E+d]=w[x+d]+C,w[E+l]=C,w[E+p]=w[x+p],w[E+f]=-1,w[E+g]=0,w[E+v]=0,w[E+y]=0,M+=4,i=n[w[x+u]+t]<w[x+c]?n[w[x+u]+e]<w[x+d]?w[x+f]:w[x+f]+m:n[w[x+u]+e]<w[x+d]?w[x+f]+2*m:w[x+f]+3*m,w[x+g]=n[w[x+u]+a],w[x+v]=n[w[x+u]+t],w[x+y]=n[w[x+u]+e],w[i+u]=w[x+u],w[x+u]=-1,o=n[_+t]<w[x+c]?n[_+e]<w[x+d]?w[x+f]:w[x+f]+m:n[_+e]<w[x+d]?w[x+f]+2*m:w[x+f]+3*m,i===o){if(s--){x=i;continue}s=b;break}w[o+u]=_;break}i=n[_+t]<w[x+c]?n[_+e]<w[x+d]?w[x+f]:w[x+f]+m:n[_+e]<w[x+d]?w[x+f]+2*m:w[x+f]+3*m,w[x+v]=(w[x+v]*w[x+g]+n[_+t]*n[_+a])/(w[x+g]+n[_+a]),w[x+y]=(w[x+y]*w[x+g]+n[_+e]*n[_+a])/(w[x+g]+n[_+a]),w[x+g]+=n[_+a],x=i}})),w}(i,o);o.forEach((function(o){for(var c=Number(o)*h,d=0;;)if(x[d+f]>=0){var m=Math.pow(i[c+t]-x[d+v],2)+Math.pow(i[c+e]-x[d+y],2),b=x[d+l];if(4*b*b/m<_){var C=i[c+t]-x[d+v],E=i[c+e]-x[d+y],L=void 0;if(!0===w?m>0?(L=s*i[c+a]*x[d+g]/m,i[c+n]+=C*L,i[c+r]+=E*L):m<0&&(L=-s*i[c+a]*x[d+g]/Math.sqrt(m),i[c+n]+=C*L,i[c+r]+=E*L):m>0&&(L=s*i[c+a]*x[d+g]/m,i[c+n]+=C*L,i[c+r]+=E*L),(d=x[d+p])<0)break;continue}d=x[d+f]}else{var S=x[d+u];if(S>=0&&S!==c&&(m=(C=i[c+t]-i[S+t])*C+(E=i[c+e]-i[S+e])*E,L=void 0,!0===w?m>0?(L=s*i[c+a]*i[S+a]/m,i[c+n]+=C*L,i[c+r]+=E*L):m<0&&(L=-s*i[c+a]*i[S+a]/Math.sqrt(m),i[c+n]+=C*L,i[c+r]+=E*L):m>0&&(L=s*i[c+a]*i[S+a]/m,i[c+n]+=C*L,i[c+r]+=E*L)),(d=x[d+p])<0)break}}))}(o,i,w,_,Math.pow(L,2)):function(t,e,n,r){for(var i=0;i<e.length;i+=1)for(var o=Number(e[i])*h,a=0;a<i;a+=1)r(t,o,Number(e[a])*h,n)}(o,i,w,S)}))}function L(n,r,i,o){var a=n[r+t]-n[i+t],s=n[r+e]-n[i+e],h=-o;w(n,r,i,a*h),_(n,r,i,s*h)}function S(n,r,i,o){var a=n[r+t]-n[i+t],h=n[r+e]-n[i+e],u=-o;Math.sqrt(a*a+h*h)-n[r+s]-n[i+s]>0&&(w(n,r,i,a*u),_(n,r,i,h*u))}function M(n,r,i,o){var a=n[r+t]-n[i+t],s=n[r+e]-n[i+e],h=Math.sqrt(a*a+s*s);if(h>0){var u=-o*Math.log(1+h)/h;w(n,r,i,a*u),_(n,r,i,s*u)}}function A(n,r,i,o){var a=n[r+t]-n[i+t],h=n[r+e]-n[i+e],u=Math.sqrt(a*a+h*h)-n[r+s]-n[i+s];if(u>0){var c=-o*Math.log(1+u)/u;w(n,r,i,a*c),_(n,r,i,h*c)}}function N(t,e){var s=t[e+i]-t[e+n],h=t[e+o]-t[e+r];return t[e+a]*Math.sqrt(Math.pow(s,2)+Math.pow(h,2))}function k(t,e){var a=t[e+i]+t[e+n],s=t[e+o]+t[e+r];return Math.sqrt(Math.pow(a,2)+Math.pow(s,2))/2}function P(a,s,u,c){for(var d=a.adjustSizes,l=0;l<s.length;l+=h)s[l+i]=s[l+n],s[l+o]=s[l+r],s[l+n]=0,s[l+r]=0;E(a,s,c);for(var p=u.length,f=0;f<p;f+=3){var g=u[f+0],v=u[f+1],y=u[f+2];!0===d?a.linLogMode?A(s,g,v,y):S(s,g,v,y):a.linLogMode?M(s,g,v,y):L(s,g,v,y)}if(!0===d){for(l=0;l<s.length;l+=h)if(1!==s[l+9]){var m=Math.sqrt(Math.pow(s[l+n],2)+Math.pow(s[l+r],2));m>10&&(s[l+n]=10*s[l+n]/m,s[l+r]=10*s[l+r]/m);var b=N(s,l),w=k(s,l),_=1+Math.sqrt(b),x=(C=.1*Math.log(1+w)/_)/a.slowDown;s[l+t]+=s[l+n]*x,s[l+e]+=s[l+r]*x}}else for(l=0;l<s.length;l+=h)if(1!==s[l+9]){b=N(s,l),w=k(s,l),_=1+Math.sqrt(b);var C=s[l+7]*Math.log(1+w)/_;s[l+7]=Math.min(1,Math.sqrt(C*(Math.pow(s[l+n],2)+Math.pow(s[l+r],2))/_)),x=C/a.slowDown,s[l+t]+=s[l+n]*x,s[l+e]+=s[l+r]*x}return{}}self.onmessage=function(t){for(var e=t.data,n=new Float32Array(e.nodes),r=new Float32Array(e.edges),i=0;i<e.iterations;i++)P(e.settings,n,r,e.components);self.postMessage({nodes:n.buffer,edges:r.buffer,__messageId:e.__messageId},[n.buffer,r.buffer])}}var st={value:()=>{}};function ht(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new ut(r)}function ut(t){this._=t}function ct(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function dt(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=st,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}ut.prototype=ht.prototype={constructor:ut,on:function(t,e){var n,r,i=this._,o=(r=i,(t+"").trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),a=-1,s=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a<s;)if(n=(t=o[a]).type)i[n]=dt(i[n],t.name,e);else if(null==e)for(n in i)i[n]=dt(i[n],t.name,null);return this}for(;++a<s;)if((n=(t=o[a]).type)&&(n=ct(i[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new ut(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(r=this._[t]).length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};const lt=ht;var pt,ft,gt=0,vt=0,yt=0,mt=1e3,bt=0,wt=0,_t=0,xt="object"==typeof performance&&performance.now?performance:Date,Ct="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Et(){return wt||(Ct(Lt),wt=xt.now()+_t)}function Lt(){wt=0}function St(){this._call=this._time=this._next=null}function Mt(t,e,n){var r=new St;return r.restart(t,e,n),r}function At(){wt=(bt=xt.now())+_t,gt=vt=0;try{!function(){Et(),++gt;for(var t,e=pt;e;)(t=wt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--gt}()}finally{gt=0,function(){for(var t,e,n=pt,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:pt=e);ft=t,kt(r)}(),wt=0}}function Nt(){var t=xt.now(),e=t-bt;e>mt&&(_t-=e,bt=t)}function kt(t){gt||(vt&&(vt=clearTimeout(vt)),t-wt>24?(t<1/0&&(vt=setTimeout(At,t-xt.now()-_t)),yt&&(yt=clearInterval(yt))):(yt||(bt=xt.now(),yt=setInterval(Nt,mt)),gt=1,Ct(At)))}St.prototype=Mt.prototype={constructor:St,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Et():+n)+(null==e?0:+e),this._next||ft===this||(ft?ft._next=this:pt=this,ft=this),this._call=t,this._time=n,kt()},stop:function(){this._call&&(this._call=null,this._time=1/0,kt())}};const Pt=4294967296;function Dt(t){return t.x}function Gt(t){return t.y}var Ft=Math.PI*(3-Math.sqrt(5));function Ot(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,o,a,s,h,u,c,d,l,p=t._root,f={data:r},g=t._x0,v=t._y0,y=t._x1,m=t._y1;if(!p)return t._root=f,t;for(;p.length;)if((u=e>=(o=(g+y)/2))?g=o:y=o,(c=n>=(a=(v+m)/2))?v=a:m=a,i=p,!(p=p[d=c<<1|u]))return i[d]=f,t;if(s=+t._x.call(null,p.data),h=+t._y.call(null,p.data),e===s&&n===h)return f.next=p,i?i[d]=f:t._root=f,t;do{i=i?i[d]=new Array(4):t._root=new Array(4),(u=e>=(o=(g+y)/2))?g=o:y=o,(c=n>=(a=(v+m)/2))?v=a:m=a}while((d=c<<1|u)==(l=(h>=a)<<1|s>=o));return i[l]=p,i[d]=f,t}function Tt(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function Rt(t){return t[0]}function jt(t){return t[1]}function zt(t,e,n){var r=new Bt(null==e?Rt:e,null==n?jt:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function Bt(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function Ut(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var It=zt.prototype=Bt.prototype;function Ht(t){return function(){return t}}function Wt(t){return 1e-6*(t()-.5)}function Vt(t){return t.x+t.vx}function qt(t){return t.y+t.vy}function Zt(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(e[1]-t[1])*(n[0]-t[0])}function Yt(t,e){return t[0]-e[0]||t[1]-e[1]}function Kt(t){const e=t.length,n=[0,1];let r,i=2;for(r=2;r<e;++r){for(;i>1&&Zt(t[n[i-2]],t[n[i-1]],t[r])<=0;)--i;n[i++]=r}return n.slice(0,i)}function Xt(t,e,n){var r={};t.forEach((function(t,e){t.forEach((function(t){var n=Number(t);r[n]=e}))}));var i=t.map((function(t){return t.map((function(t){var n=Number(t)*m;return[e[n+h],e[n+u]]}))})),o=i.map((function(t){return function(t){if((n=t.length)<3)return null;var e,n,r=new Array(n),i=new Array(n);for(e=0;e<n;++e)r[e]=[+t[e][0],+t[e][1],e];for(r.sort(Yt),e=0;e<n;++e)i[e]=[r[e][0],-r[e][1]];var o=Kt(r),a=Kt(i),s=a[0]===o[0],h=a[a.length-1]===o[o.length-1],u=[];for(e=o.length-1;e>=0;--e)u.push(t[r[o[e]][2]]);for(e=+s;e<a.length-h;++e)u.push(t[r[a[e]][2]]);return u}(t)})),a=o.map((function(t,e){if(null===t){var n=i[e];return 1===n.length?n[0]:[(n[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2]}return function(t){for(var e,n,r=-1,i=t.length,o=0,a=0,s=t[i-1],h=0;++r<i;)e=s,s=t[r],h+=n=e[0]*s[1]-s[0]*e[1],o+=(e[0]+s[0])*n,a+=(e[1]+s[1])*n;return[o/(h*=3),a/h]}(t)})),s=o.map((function(t,e){var n=a[e],r=0;if(null===t){var o=i[e];if(1===o.length)r=5;else{var s=o[1][0]-o[0][0],h=o[1][1]-o[0][1];r=Math.sqrt(Math.pow(s,2)+Math.pow(h,2))/2}}else for(var u=0;u<t.length;u+=1){var c=t[u],d=(s=c[0]-n[0],h=c[1]-n[1],Math.sqrt(Math.pow(s,2)+Math.pow(h,2)));r=Math.max(d,r)}return r})),c=t.map((function(t,e){var n=Object.create(t);return n.radius=s[e],n})),d=function(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,h=Mt(d),u=lt("tick","end"),c=function(){let t=1;return()=>(t=(1664525*t+1013904223)%Pt)/Pt}();function d(){l(),u.call("tick",e),n<r&&(h.stop(),u.call("end",e))}function l(r){var h,u,c=t.length;void 0===r&&(r=1);for(var d=0;d<r;++d)for(n+=(o-n)*i,s.forEach((function(t){t(n)})),h=0;h<c;++h)null==(u=t[h]).fx?u.x+=u.vx*=a:(u.x=u.fx,u.vx=0),null==u.fy?u.y+=u.vy*=a:(u.y=u.fy,u.vy=0);return e}function p(){for(var e,n=0,r=t.length;n<r;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var i=10*Math.sqrt(.5+n),o=n*Ft;e.x=i*Math.cos(o),e.y=i*Math.sin(o)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function f(e){return e.initialize&&e.initialize(t,c),e}return null==t&&(t=[]),p(),e={tick:l,restart:function(){return h.restart(d),e},stop:function(){return h.stop(),e},nodes:function(n){return arguments.length?(t=n,p(),s.forEach(f),e):t},alpha:function(t){return arguments.length?(n=+t,e):n},alphaMin:function(t){return arguments.length?(r=+t,e):r},alphaDecay:function(t){return arguments.length?(i=+t,e):+i},alphaTarget:function(t){return arguments.length?(o=+t,e):o},velocityDecay:function(t){return arguments.length?(a=1-t,e):1-a},randomSource:function(t){return arguments.length?(c=t,s.forEach(f),e):c},force:function(t,n){return arguments.length>1?(null==n?s.delete(t):s.set(t,f(n)),e):s.get(t)},find:function(e,n,r){var i,o,a,s,h,u=0,c=t.length;for(null==r?r=1/0:r*=r,u=0;u<c;++u)(a=(i=e-(s=t[u]).x)*i+(o=n-s.y)*o)<r&&(h=s,r=a);return h},on:function(t,n){return arguments.length>1?(u.on(t,n),e):u.on(t)}}}(c).force("charge",function(){var t,e,n,r,i,o=Ht(-30),a=1,s=1/0,h=.81;function u(n){var i,o=t.length,a=zt(t,Dt,Gt).visitAfter(d);for(r=n,i=0;i<o;++i)e=t[i],a.visit(l)}function c(){if(t){var e,n,r=t.length;for(i=new Array(r),e=0;e<r;++e)n=t[e],i[n.index]=+o(n,e,t)}}function d(t){var e,n,r,o,a,s=0,h=0;if(t.length){for(r=o=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(s+=e.value,h+=n,r+=n*e.x,o+=n*e.y);t.x=r/h,t.y=o/h}else{(e=t).x=e.data.x,e.y=e.data.y;do{s+=i[e.data.index]}while(e=e.next)}t.value=s}function l(t,o,u,c){if(!t.value)return!0;var d=t.x-e.x,l=t.y-e.y,p=c-o,f=d*d+l*l;if(p*p/h<f)return f<s&&(0===d&&(f+=(d=Wt(n))*d),0===l&&(f+=(l=Wt(n))*l),f<a&&(f=Math.sqrt(a*f)),e.vx+=d*t.value*r/f,e.vy+=l*t.value*r/f),!0;if(!(t.length||f>=s)){(t.data!==e||t.next)&&(0===d&&(f+=(d=Wt(n))*d),0===l&&(f+=(l=Wt(n))*l),f<a&&(f=Math.sqrt(a*f)));do{t.data!==e&&(p=i[t.data.index]*r/f,e.vx+=d*p,e.vy+=l*p)}while(t=t.next)}}return u.initialize=function(e,r){t=e,n=r,c()},u.strength=function(t){return arguments.length?(o="function"==typeof t?t:Ht(+t),c(),u):o},u.distanceMin=function(t){return arguments.length?(a=t*t,u):Math.sqrt(a)},u.distanceMax=function(t){return arguments.length?(s=t*t,u):Math.sqrt(s)},u.theta=function(t){return arguments.length?(h=t*t,u):Math.sqrt(h)},u}()).force("center",function(t,e){var n,r=1;function i(){var i,o,a=n.length,s=0,h=0;for(i=0;i<a;++i)s+=(o=n[i]).x,h+=o.y;for(s=(s/a-t)*r,h=(h/a-e)*r,i=0;i<a;++i)(o=n[i]).x-=s,o.y-=h}return null==t&&(t=0),null==e&&(e=0),i.initialize=function(t){n=t},i.x=function(e){return arguments.length?(t=+e,i):t},i.y=function(t){return arguments.length?(e=+t,i):e},i.strength=function(t){return arguments.length?(r=+t,i):r},i}(0,0)).force("collision",function(t){var e,n,r,i=1,o=1;function a(){for(var t,a,h,u,c,d,l,p=e.length,f=0;f<o;++f)for(a=zt(e,Vt,qt).visitAfter(s),t=0;t<p;++t)h=e[t],d=n[h.index],l=d*d,u=h.x+h.vx,c=h.y+h.vy,a.visit(g);function g(t,e,n,o,a){var s=t.data,p=t.r,f=d+p;if(!s)return e>u+f||o<u-f||n>c+f||a<c-f;if(s.index>h.index){var g=u-s.x-s.vx,v=c-s.y-s.vy,y=g*g+v*v;y<f*f&&(0===g&&(y+=(g=Wt(r))*g),0===v&&(y+=(v=Wt(r))*v),y=(f-(y=Math.sqrt(y)))/y*i,h.vx+=(g*=y)*(f=(p*=p)/(l+p)),h.vy+=(v*=y)*f,s.vx-=g*(f=1-f),s.vy-=v*f)}}}function s(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function h(){if(e){var r,i,o=e.length;for(n=new Array(o),r=0;r<o;++r)i=e[r],n[i.index]=+t(i,r,e)}}return"function"!=typeof t&&(t=Ht(null==t?1:+t)),a.initialize=function(t,n){e=t,r=n,h()},a.iterations=function(t){return arguments.length?(o=+t,a):o},a.strength=function(t){return arguments.length?(i=+t,a):i},a.radius=function(e){return arguments.length?(t="function"==typeof e?e:Ht(+e),h(),a):t},a}().radius((function(t){return t.radius})));return d.stop(),d.tick(n),{vertices:t.map((function(t){return t.map((function(t){return Number(t)}))})).flat(),node_to_component_id:r,components_to_circle_pack:c,polygon_centroids_initial:a}}It.copy=function(){var t,e,n=new Bt(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=Ut(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=Ut(e));return n},It.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return Ot(this.cover(e,n),e,n,t)},It.addAll=function(t){var e,n,r,i,o=t.length,a=new Array(o),s=new Array(o),h=1/0,u=1/0,c=-1/0,d=-1/0;for(n=0;n<o;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(i=+this._y.call(null,e))||(a[n]=r,s[n]=i,r<h&&(h=r),r>c&&(c=r),i<u&&(u=i),i>d&&(d=i));if(h>c||u>d)return this;for(this.cover(h,u).cover(c,d),n=0;n<o;++n)Ot(this,a[n],s[n],t[n]);return this},It.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,o=(r=Math.floor(e))+1;else{for(var a,s,h=i-n||1,u=this._root;n>t||t>=i||r>e||e>=o;)switch(s=(e<r)<<1|t<n,(a=new Array(4))[s]=u,u=a,h*=2,s){case 0:i=n+h,o=r+h;break;case 1:n=i-h,o=r+h;break;case 2:i=n+h,r=o-h;break;case 3:n=i-h,r=o-h}this._root&&this._root.length&&(this._root=u)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this},It.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},It.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},It.find=function(t,e,n){var r,i,o,a,s,h,u,c=this._x0,d=this._y0,l=this._x1,p=this._y1,f=[],g=this._root;for(g&&f.push(new Tt(g,c,d,l,p)),null==n?n=1/0:(c=t-n,d=e-n,l=t+n,p=e+n,n*=n);h=f.pop();)if(!(!(g=h.node)||(i=h.x0)>l||(o=h.y0)>p||(a=h.x1)<c||(s=h.y1)<d))if(g.length){var v=(i+a)/2,y=(o+s)/2;f.push(new Tt(g[3],v,y,a,s),new Tt(g[2],i,y,v,s),new Tt(g[1],v,o,a,y),new Tt(g[0],i,o,v,y)),(u=(e>=y)<<1|t>=v)&&(h=f[f.length-1],f[f.length-1]=f[f.length-1-u],f[f.length-1-u]=h)}else{var m=t-+this._x.call(null,g.data),b=e-+this._y.call(null,g.data),w=m*m+b*b;if(w<n){var _=Math.sqrt(n=w);c=t-_,d=e-_,l=t+_,p=e+_,r=g.data}}return r},It.remove=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t)))return this;var e,n,r,i,o,a,s,h,u,c,d,l,p=this._root,f=this._x0,g=this._y0,v=this._x1,y=this._y1;if(!p)return this;if(p.length)for(;;){if((u=o>=(s=(f+v)/2))?f=s:v=s,(c=a>=(h=(g+y)/2))?g=h:y=h,e=p,!(p=p[d=c<<1|u]))return this;if(!p.length)break;(e[d+1&3]||e[d+2&3]||e[d+3&3])&&(n=e,l=d)}for(;p.data!==t;)if(r=p,!(p=p.next))return this;return(i=p.next)&&delete p.next,r?(i?r.next=i:delete r.next,this):e?(i?e[d]=i:delete e[d],(p=e[0]||e[1]||e[2]||e[3])&&p===(e[3]||e[2]||e[1]||e[0])&&!p.length&&(n?n[l]=p:this._root=p),this):(this._root=i,this)},It.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},It.root=function(){return this._root},It.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},It.visit=function(t){var e,n,r,i,o,a,s=[],h=this._root;for(h&&s.push(new Tt(h,this._x0,this._y0,this._x1,this._y1));e=s.pop();)if(!t(h=e.node,r=e.x0,i=e.y0,o=e.x1,a=e.y1)&&h.length){var u=(r+o)/2,c=(i+a)/2;(n=h[3])&&s.push(new Tt(n,u,c,o,a)),(n=h[2])&&s.push(new Tt(n,r,c,u,a)),(n=h[1])&&s.push(new Tt(n,u,i,o,c)),(n=h[0])&&s.push(new Tt(n,r,i,u,c))}return this},It.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new Tt(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var o,a=e.x0,s=e.y0,h=e.x1,u=e.y1,c=(a+h)/2,d=(s+u)/2;(o=i[0])&&n.push(new Tt(o,a,s,c,d)),(o=i[1])&&n.push(new Tt(o,c,s,h,d)),(o=i[2])&&n.push(new Tt(o,a,d,c,u)),(o=i[3])&&n.push(new Tt(o,c,d,h,u))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},It.x=function(t){return arguments.length?(this._x=t,this):this._x},It.y=function(t){return arguments.length?(this._y=t,this):this._y};var Qt=function(t,e,n){var r=e.filter((function(t){return t.length>1})),i=e.filter((function(t){return 1===t.length})),o=Xt(r,t,n),a=Number.MAX_VALUE,s=Number.MIN_VALUE,c=Number.MAX_VALUE,d=Number.MIN_VALUE;o.vertices.forEach((function(e){var n=o.node_to_component_id[e],r=o.polygon_centroids_initial[n],i=o.components_to_circle_pack[n].x+t[e*m+h]-r[0],l=o.components_to_circle_pack[n].y+t[e*m+u]-r[1];t[e*m+h]=i,t[e*m+u]=l;var p=t[e*m+v];s=Math.max(s,i+p),a=Math.min(a,i-p),d=Math.max(d,l+p),c=Math.min(c,l-p)}));var l=Xt(i,t,n),p=Number.MAX_VALUE,f=Number.MIN_VALUE,g=Number.MAX_VALUE,y=Number.MIN_VALUE,b=r.reduce((function(t,e){return t+e.length}),0);if(l.vertices.forEach((function(e){var n=l.node_to_component_id[e],r=l.components_to_circle_pack[n].x,i=l.components_to_circle_pack[n].y,o=t[e*m+v];f=Math.max(r+o,f),p=Math.min(r-o,p),y=Math.max(i+o,y),g=Math.min(i-o,g)})),0===b)l.vertices.forEach((function(e){var n=l.node_to_component_id[e],r=l.components_to_circle_pack[n].x,i=l.components_to_circle_pack[n].y;t[e*m+h]=r,t[e*m+u]=i}));else{var w=(d+c)/2,_=(s-a)*(d-c),x=(f-p)*(y-g),C=i.length/b,E=Math.sqrt(C*_/x);f=-1/0,p=1/0,l.vertices.forEach((function(e){var n=l.node_to_component_id[e],r=l.components_to_circle_pack[n].x,i=l.components_to_circle_pack[n].y;t[e*m+h]=a-r*E,t[e*m+u]=w+i*E;var o=t[e*m+v];f=Math.max(a-r*E+o,f),p=Math.min(a-r*E-o,p)}));var L=f-a,S=.1*Math.max(f-p,s-a);l.vertices.forEach((function(e){t[e*m+h]-=L+S}))}},Jt=n(847),$t=n(739),te=function(t,e,n,r){return void 0===n&&(n=!0),void 0===r&&(r=!1),o=function(){var i,o,h,u,c,d,l,p,f,g,v;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(h){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,h])}}}(this,(function(y){switch(y.label){case 0:if(!ot()(t))throw new Error("graphology-layout-forceatlas2: the given graph is not a valid graphology instance.");if(i=e.iterations,o=(0,s.kS)(t),"number"!=typeof i)throw new Error("graphology-layout-forceatlas2: invalid number of iterations.");if(i<=0)throw new Error("graphology-layout-forceatlas2: you should provide a positive number of iterations.");if(h=(0,a.Q6)("getEdgeWeight"in e?e.getEdgeWeight:"weight").fromEntry,u="function"==typeof e.outputReducer?e.outputReducer:null,c=$t.assign({},Jt,e.settings),d=$t.validateSettings(c))throw new Error("graphology-layout-forceatlas2: ".concat(d.message));return l=$t.graphToByteArrays(t,h),n?(f=$t.createWorker(at),g={iterations:i,settings:c,nodes:l.nodes.buffer,edges:l.edges.buffer,components:o,__messageId:"initialGraphLayout"},f.postMessage(g,[l.nodes.buffer,l.edges.buffer]),[4,new Promise((function(t){f.onmessage=function(e){t(new Float32Array(e.data.nodes)),f.terminate()}}))]):[3,2];case 1:return p=y.sent(),[3,3];case 2:if(r){for(v=0;v<.9*i;v++)c.nRepulsiveCycles=v%5==0?null:40,c.randomSeed="iteration".concat(v),J(c,l.nodes,l.edges,o);for(c.nRepulsiveCycles=null,v=.1*i;v<i;v++)J(c,l.nodes,l.edges,o)}else for(v=0;v<i;v++)J(c,l.nodes,l.edges,o);p=l.nodes,y.label=3;case 3:return Qt(p,o,100),$t.assignLayoutChanges(t,p,u),[2]}}))},new((i=void 0)||(i=Promise))((function(t,e){function n(t){try{a(o.next(t))}catch(t){e(t)}}function r(t){try{a(o.throw(t))}catch(t){e(t)}}function a(e){var o;e.done?t(e.value):(o=e.value,o instanceof i?o:new i((function(t){t(o)}))).then(n,r)}a((o=o.apply(void 0,[])).next())}));var i,o},ee=function(){return ee=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},ee.apply(this,arguments)},ne=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{h(r.next(t))}catch(t){o(t)}}function s(t){try{h(r.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}h((r=r.apply(t,e||[])).next())}))},re=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(h){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,h])}}},ie=function(){function t(t,e,n){this.zoomFactor=1.5,this.zoomDuration=200,this.sigma=t,this.graph=e,this.animator=n}return t.prototype.getFramedGraphBounds=function(){var t=this.sigma.getBBox(),e=t.x,n=e[0],r=e[1],i=t.y,o=i[0],a=i[1];return[this.sigma.viewportToFramedGraph(this.sigma.graphToViewport({x:n,y:o})),this.sigma.viewportToFramedGraph(this.sigma.graphToViewport({x:r,y:a}))]},t.prototype.getFramedGraphZoomRatio=function(t,e){var n=this.sigma.getDimensions(),r=n.width,i=n.height,o=Math.max(r,i),a=o/r,s=o/i;return Math.max((e.x-t.x)*a,(e.y-t.y)*s)},t.prototype.applyInitialLayout=function(t){return ne(this,void 0,void 0,(function(){return re(this,(function(e){switch(e.label){case 0:return[4,te(this.graph,t)];case 1:return e.sent(),this.animator.forceNodePositionUpdate(),[2]}}))}))},t.prototype.zoomIn=function(){this.sigma.getCamera().animatedZoom({duration:this.zoomDuration,factor:this.zoomFactor})},t.prototype.zoomOut=function(){this.sigma.getCamera().animatedUnzoom({duration:this.zoomDuration,factor:this.zoomFactor})},t.prototype.resetView=function(){return ne(this,void 0,void 0,(function(){var t,e,n,r,i,a,s;return re(this,(function(h){switch(h.label){case 0:return t=ee(ee({},nt),o().inferSettings(this.graph)),e={iterations:300,settings:t},this.animator.stop(),this.sigma.getCustomBBox()||this.sigma.setCustomBBox(this.sigma.getBBox()),[4,this.applyInitialLayout(e)];case 1:return h.sent(),n=this.getFramedGraphBounds(),r=n[0],i=n[1],a={x:(i.x+r.x)/2,y:(i.y+r.y)/2},s=this.getFramedGraphZoomRatio(r,i),this.sigma.getCamera().animate(ee(ee({},a),{ratio:s,angle:0}),{duration:this.zoomDuration}),this.animator.start(),[2]}}))}))},t}(),oe="\n <svg\n width='32'\n height='32'\n viewBox='0 0 32 32'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n >\n <g clip-path='url(#clip0_9590_459423)'>\n <path\n d='M14.9999 15.9987C15.2448 15.9987 15.4812 16.0887 15.6643 16.2514C15.8473 16.4142 15.9642 16.6384 15.9929 16.8817L15.9999 16.9987V21.9987C15.9996 22.2536 15.902 22.4987 15.727 22.6841C15.5521 22.8694 15.3129 22.9809 15.0585 22.9959C14.804 23.0108 14.5535 22.928 14.3581 22.7644C14.1626 22.6008 14.037 22.3688 14.0069 22.1157L13.9999 21.9987V19.4127L8.70688 24.7057C8.52693 24.885 8.28545 24.9892 8.0315 24.9969C7.77755 25.0047 7.53017 24.9155 7.33961 24.7474C7.14904 24.5794 7.02958 24.3451 7.00549 24.0922C6.98139 23.8393 7.05447 23.5867 7.20988 23.3857L7.29288 23.2917L12.5859 17.9987H9.99988C9.745 17.9984 9.49985 17.9008 9.31452 17.7258C9.12918 17.5509 9.01765 17.3117 9.00271 17.0573C8.98778 16.8029 9.07056 16.5523 9.23415 16.3569C9.39774 16.1614 9.62979 16.0358 9.88288 16.0057L9.99988 15.9987H14.9999ZM23.2929 7.29169C23.4728 7.11235 23.7143 7.00822 23.9683 7.00047C24.2222 6.99271 24.4696 7.08191 24.6602 7.24994C24.8507 7.41798 24.9702 7.65225 24.9943 7.90517C25.0184 8.15809 24.9453 8.4107 24.7899 8.61169L24.7069 8.70569L19.4139 13.9987H21.9999C22.2548 13.999 22.4999 14.0966 22.6853 14.2715C22.8706 14.4465 22.9821 14.6856 22.9971 14.9401C23.012 15.1945 22.9292 15.4451 22.7656 15.6405C22.602 15.836 22.37 15.9616 22.1169 15.9917L21.9999 15.9987H16.9999C16.755 15.9987 16.5185 15.9087 16.3355 15.746C16.1525 15.5832 16.0355 15.3589 16.0069 15.1157L15.9999 14.9987V9.99869C16.0002 9.74381 16.0978 9.49866 16.2727 9.31333C16.4477 9.12799 16.6868 9.01646 16.9413 9.00152C17.1957 8.98659 17.4463 9.06937 17.6417 9.23296C17.8372 9.39655 17.9628 9.6286 17.9929 9.88169L17.9999 9.99869V12.5847L23.2929 7.29169Z'\n fill='black'\n />\n </g>\n <defs>\n <clip-path id='clip0_9590_459423'>\n <rect width='24' height='24' fill='white' transform='translate(4 4)' />\n </clip-path>\n </defs>\n </svg>\n",ae="\n<svg\n width='32'\n height='32'\n viewBox='0 0 32 32'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n >\n <g clip-path='url(#clip0_9590_459383)'>\n <path\n d='M13.793 16.793C13.973 16.6137 14.2144 16.5095 14.4684 16.5018C14.7223 16.494 14.9697 16.5832 15.1603 16.7512C15.3508 16.9193 15.4703 17.1536 15.4944 17.4065C15.5185 17.6594 15.4454 17.912 15.29 18.113L15.207 18.207L10.414 23H13C13.2549 23.0003 13.5 23.0979 13.6854 23.2728C13.8707 23.4478 13.9822 23.687 13.9972 23.9414C14.0121 24.1958 13.9293 24.4464 13.7657 24.6418C13.6021 24.8373 13.3701 24.9629 13.117 24.993L13 25H8C7.75507 25 7.51866 24.91 7.33563 24.7473C7.15259 24.5845 7.03566 24.3603 7.007 24.117L7 24V19C7.00028 18.7451 7.09788 18.5 7.27285 18.3146C7.44782 18.1293 7.68695 18.0178 7.94139 18.0028C8.19584 17.9879 8.44638 18.0707 8.64183 18.2343C8.83729 18.3979 8.9629 18.6299 8.993 18.883L9 19V21.586L13.793 16.793ZM24 7C24.2449 7.00003 24.4813 7.08996 24.6644 7.25272C24.8474 7.41547 24.9643 7.63975 24.993 7.883L25 8V13C24.9997 13.2549 24.9021 13.5 24.7272 13.6854C24.5522 13.8707 24.313 13.9822 24.0586 13.9972C23.8042 14.0121 23.5536 13.9293 23.3582 13.7657C23.1627 13.6021 23.0371 13.3701 23.007 13.117L23 13V10.414L18.207 15.207C18.027 15.3863 17.7856 15.4905 17.5316 15.4982C17.2777 15.506 17.0303 15.4168 16.8397 15.2488C16.6492 15.0807 16.5297 14.8464 16.5056 14.5935C16.4815 14.3406 16.5546 14.088 16.71 13.887L16.793 13.793L21.586 9H19C18.7451 8.99972 18.5 8.90212 18.3146 8.72715C18.1293 8.55218 18.0178 8.31305 18.0028 8.05861C17.9879 7.80416 18.0707 7.55362 18.2343 7.35817C18.3979 7.16271 18.6299 7.0371 18.883 7.007L19 7H24Z'\n fill='black'\n />\n </g>\n <defs>\n <clip-path id='clip0_9590_459383'>\n <rect width='24' height='24' fill='white' transform='translate(4 4)' />\n </clip-path>\n </defs>\n </svg>\n",se='\n<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 8L24 16L12 24V8Z" fill="#122239" stroke="#122239" stroke-linejoin="round" stroke-width="2" stroke-linecap="round" />\n</svg>\n',he='\n<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">\n <rect x="10" y="8" width="4" height="16" fill="#122239" stroke="#122239" stroke-width="2"/>\n <rect x="18" y="8" width="4" height="16" fill="#122239" stroke="#122239" stroke-width="2"/>\n</svg>\n',ue=function(){function t(t){var e,n=t.isFullScreen,r=t.animate,i=t.onZoomIn,o=t.onZoomOut,a=t.onResetView,s=t.onToggleFullScreen,h=t.onToggleLassoSelect,u=t.onToggleBoxSelect,c=t.onClearSelection,d=t.onInvertSelection,l=t.onTogglePlayPause;this.controlsContainer=((e=document.createElement("div")).className="controls-container",e.style.position="absolute",e.style.display="flex",e.style.bottom="10px",e.style.right="10px",e.style.zIndex="10",e),this.zoomInButton=ce("\n<svg\n width='32'\n height='32'\n viewBox='0 0 32 32'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n>\n <path d='M9 16H23' stroke='#122239' stroke-width='2' stroke-linecap='round' />\n <path d='M16 9L16 23' stroke='#122239' stroke-width='2' stroke-linecap='round' />\n</svg>\n",i,"Zoom In"),this.zoomOutButton=ce("\n<svg width='32' height='32' viewBox='0 0 32 32' fill='none' xmlns='http://www.w3.org/2000/svg'>\n <path\n d='M9 16H23'\n stroke='#122239'\n stroke-width='2'\n stroke-linecap='round'\n stroke-linejoin='round'\n />\n</svg>",o,"Zoom Out"),this.resetButton=ce("\n<svg\n width='32'\n height='32'\n viewBox='0 0 32 32'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n>\n <path\n d='M25.295 18C25.388 17.9999 25.48 18.0181 25.5659 18.0538C25.6517 18.0894 25.7297 18.1417 25.7952 18.2076C25.8608 18.2735 25.9126 18.3518 25.9478 18.4378C25.9829 18.5239 26.0007 18.616 26 18.709V21.913C26.0007 22.0055 25.9831 22.0973 25.9482 22.183C25.9134 22.2688 25.862 22.3468 25.797 22.4126C25.732 22.4785 25.6546 22.5309 25.5694 22.5668C25.4841 22.6027 25.3925 22.6215 25.3 22.622C25.2075 22.6215 25.116 22.6027 25.0307 22.5668C24.9454 22.5309 24.868 22.4785 24.803 22.4126C24.738 22.3468 24.6866 22.2688 24.6518 22.183C24.6169 22.0973 24.5994 22.0055 24.6 21.913V20.788C22.779 23.844 19.399 26 15.757 26C11.347 26 7.65102 23.279 6.04802 19.085C5.98071 18.9103 5.98495 18.716 6.05982 18.5444C6.13469 18.3728 6.27416 18.2375 6.44802 18.168C6.80802 18.027 7.21402 18.208 7.35402 18.573C8.75402 22.235 11.942 24.583 15.757 24.583C19.128 24.583 22.277 22.401 23.744 19.429L22.273 19.439C22.1805 19.4391 22.0888 19.421 22.0033 19.3857C21.9178 19.3504 21.84 19.2985 21.7746 19.2332C21.7091 19.1678 21.6571 19.0901 21.6217 19.0046C21.5863 18.9192 21.568 18.8275 21.568 18.735C21.5656 18.5482 21.6375 18.3681 21.7678 18.2342C21.8981 18.1003 22.0762 18.0236 22.263 18.021L25.295 18ZM16.245 6C20.653 6 24.35 8.721 25.953 12.915C26.0203 13.0897 26.0161 13.284 25.9412 13.4556C25.8663 13.6272 25.7269 13.7625 25.553 13.832C25.467 13.8655 25.3752 13.8817 25.2829 13.8794C25.1906 13.8772 25.0996 13.8566 25.0153 13.8189C24.931 13.7813 24.8551 13.7272 24.7918 13.6599C24.7286 13.5926 24.6794 13.5135 24.647 13.427C23.247 9.765 20.059 7.417 16.244 7.417C12.873 7.417 9.72402 9.599 8.25702 12.571L9.72802 12.561C9.82055 12.5609 9.9122 12.579 9.99773 12.6143C10.0833 12.6496 10.161 12.7015 10.2265 12.7668C10.2919 12.8322 10.3439 12.9099 10.3793 12.9954C10.4148 13.0808 10.433 13.1725 10.433 13.265C10.4354 13.4518 10.3636 13.6319 10.2333 13.7658C10.1029 13.8997 9.92483 13.9764 9.73802 13.979L6.70502 14C6.61206 14.0001 6.52 13.9819 6.43414 13.9462C6.34828 13.9106 6.27033 13.8583 6.20479 13.7924C6.13925 13.7265 6.08741 13.6482 6.05226 13.5622C6.01711 13.4761 5.99936 13.384 6.00002 13.291V10.087C6.00002 9.695 6.31302 9.378 6.70002 9.378C7.08602 9.378 7.40002 9.695 7.40002 10.087V11.212C9.22102 8.156 12.601 6 16.243 6H16.245Z'\n fill='#122239'\n stroke='#122239'\n stroke-width='0.5'\n />\n <circle cx='16' cy='16' r='3' fill='#122239' />\n</svg>\n",a,"Reset View"),this.fullScreenButton=ce(n?oe:ae,s,n?"Scale back":"Expand"),this.lassoSelectButton=ce("\n<svg\n width='32'\n height='32'\n viewBox='0 0 32 32'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n >\n <path\n d='M11 26C10.379 25.5343 9.875 24.9303 9.52786 24.2361C9.18073 23.5418 9 22.7762 9 22M7.3 18C6.45485 16.8376 5.99974 15.4372 6 14C6 9.6 10.5 6 16 6C21.5 6 26 9.6 26 14C26 18.4 21.5 22 16 22C14.2809 22.0287 12.5758 21.6877 11 21'\n stroke='#122239'\n stroke-width='2'\n stroke-linecap='round'\n stroke-linejoin='round'\n />\n <path\n d='M9 22C9.53043 22 10.0391 21.7893 10.4142 21.4142C10.7893 21.0391 11 20.5304 11 20C11 19.4696 10.7893 18.9609 10.4142 18.5858C10.0391 18.2107 9.53043 18 9 18C8.46957 18 7.96086 18.2107 7.58579 18.5858C7.21071 18.9609 7 19.4696 7 20C7 20.5304 7.21071 21.0391 7.58579 21.4142C7.96086 21.7893 8.46957 22 9 22V22Z'\n stroke='#122239'\n stroke-width='1.5'\n stroke-linecap='round'\n stroke-linejoin='round'\n />\n </svg>\n",h,"Lasso Select"),this.boxSelectButton=ce("\n<svg width='32' height='32' viewBox='0 0 32 32' fill='none' xmlns='http://www.w3.org/2000/svg'>\n <path\n d='M6 17.6667V14.3333C6 14.1123 6.0878 13.9004 6.24408 13.7441C6.40036 13.5878 6.61232 13.5 6.83333 13.5C7.05435 13.5 7.26631 13.5878 7.42259 13.7441C7.57887 13.9004 7.66667 14.1123 7.66667 14.3333V17.6667C7.66667 17.8877 7.57887 18.0996 7.42259 18.2559C7.26631 18.4122 7.05435 18.5 6.83333 18.5C6.61232 18.5 6.40036 18.4122 6.24408 18.2559C6.0878 18.0996 6 17.8877 6 17.6667ZM10.1667 6H7.66667C7.22464 6 6.80072 6.17559 6.48816 6.48816C6.17559 6.80072 6 7.22464 6 7.66667V10.1667C6 10.3877 6.0878 10.5996 6.24408 10.7559C6.40036 10.9122 6.61232 11 6.83333 11C7.05435 11 7.26631 10.9122 7.42259 10.7559C7.57887 10.5996 7.66667 10.3877 7.66667 10.1667V7.66667H10.1667C10.3877 7.66667 10.5996 7.57887 10.7559 7.42259C10.9122 7.26631 11 7.05435 11 6.83333C11 6.61232 10.9122 6.40036 10.7559 6.24408C10.5996 6.0878 10.3877 6 10.1667 6ZM10.1667 24.3333H7.66667V21.8333C7.66667 21.6123 7.57887 21.4004 7.42259 21.2441C7.26631 21.0878 7.05435 21 6.83333 21C6.61232 21 6.40036 21.0878 6.24408 21.2441C6.0878 21.4004 6 21.6123 6 21.8333V24.3333C6 24.7754 6.17559 25.1993 6.48816 25.5118C6.80072 25.8244 7.22464 26 7.66667 26H10.1667C10.3877 26 10.5996 25.9122 10.7559 25.7559C10.9122 25.5996 11 25.3877 11 25.1667C11 24.9457 10.9122 24.7337 10.7559 24.5774C10.5996 24.4211 10.3877 24.3333 10.1667 24.3333ZM17.6667 24.3333H14.3333C14.1123 24.3333 13.9004 24.4211 13.7441 24.5774C13.5878 24.7337 13.5 24.9457 13.5 25.1667C13.5 25.3877 13.5878 25.5996 13.7441 25.7559C13.9004 25.9122 14.1123 26 14.3333 26H17.6667C17.8877 26 18.0996 25.9122 18.2559 25.7559C18.4122 25.5996 18.5 25.3877 18.5 25.1667C18.5 24.9457 18.4122 24.7337 18.2559 24.5774C18.0996 24.4211 17.8877 24.3333 17.6667 24.3333ZM25.1667 13.5C24.9457 13.5 24.7337 13.5878 24.5774 13.7441C24.4211 13.9004 24.3333 14.1123 24.3333 14.3333V17.6667C24.3333 17.8877 24.4211 18.0996 24.5774 18.2559C24.7337 18.4122 24.9457 18.5 25.1667 18.5C25.3877 18.5 25.5996 18.4122 25.7559 18.2559C25.9122 18.0996 26 17.8877 26 17.6667V14.3333C26 14.1123 25.9122 13.9004 25.7559 13.7441C25.5996 13.5878 25.3877 13.5 25.1667 13.5ZM24.3333 6H21.8333C21.6123 6 21.4004 6.0878 21.2441 6.24408C21.0878 6.40036 21 6.61232 21 6.83333C21 7.05435 21.0878 7.26631 21.2441 7.42259C21.4004 7.57887 21.6123 7.66667 21.8333 7.66667H24.3333V10.1667C24.3333 10.3877 24.4211 10.5996 24.5774 10.7559C24.7337 10.9122 24.9457 11 25.1667 11C25.3877 11 25.5996 10.9122 25.7559 10.7559C25.9122 10.5996 26 10.3877 26 10.1667V7.66667C26 7.22464 25.8244 6.80072 25.5118 6.48816C25.1993 6.17559 24.7754 6 24.3333 6ZM17.6667 6H14.3333C14.1123 6 13.9004 6.0878 13.7441 6.24408C13.5878 6.40036 13.5 6.61232 13.5 6.83333C13.5 7.05435 13.5878 7.26631 13.7441 7.42259C13.9004 7.57887 14.1123 7.66667 14.3333 7.66667H17.6667C17.8877 7.66667 18.0996 7.57887 18.2559 7.42259C18.4122 7.26631 18.5 7.05435 18.5 6.83333C18.5 6.61232 18.4122 6.40036 18.2559 6.24408C18.0996 6.0878 17.8877 6 17.6667 6ZM25.1667 21C24.9457 21 24.7337 21.0878 24.5774 21.2441C24.4211 21.4004 24.3333 21.6123 24.3333 21.8333V24.3333H21.8333C21.6123 24.3333 21.4004 24.4211 21.2441 24.5774C21.0878 24.7337 21 24.9457 21 25.1667C21 25.3877 21.0878 25.5996 21.2441 25.7559C21.4004 25.9122 21.6123 26 21.8333 26H24.3333C24.7754 26 25.1993 25.8244 25.5118 25.5118C25.8244 25.1993 26 24.7754 26 24.3333V21.8333C26 21.6123 25.9122 21.4004 25.7559 21.2441C25.5996 21.0878 25.3877 21 25.1667 21Z'\n fill='#122239'\n stroke='#122239'\n stroke-width='0.5'\n />\n</svg>\n",u,"Box Select"),this.clearSelectionButton=ce("<svg\n width='32'\n height='32'\n viewBox='0 0 32 32'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n>\n <path\n d='M6 17.6667V14.3333C6 14.1123 6.0878 13.9004 6.24408 13.7441C6.40036 13.5878 6.61232 13.5 6.83333 13.5C7.05435 13.5 7.26631 13.5878 7.42259 13.7441C7.57887 13.9004 7.66667 14.1123 7.66667 14.3333V17.6667C7.66667 17.8877 7.57887 18.0996 7.42259 18.2559C7.26631 18.4122 7.05435 18.5 6.83333 18.5C6.61232 18.5 6.40036 18.4122 6.24408 18.2559C6.0878 18.0996 6 17.8877 6 17.6667ZM10.1667 6H7.66667C7.22464 6 6.80072 6.17559 6.48816 6.48816C6.17559 6.80072 6 7.22464 6 7.66667V10.1667C6 10.3877 6.0878 10.5996 6.24408 10.7559C6.40036 10.9122 6.61232 11 6.83333 11C7.05435 11 7.26631 10.9122 7.42259 10.7559C7.57887 10.5996 7.66667 10.3877 7.66667 10.1667V7.66667H10.1667C10.3877 7.66667 10.5996 7.57887 10.7559 7.42259C10.9122 7.26631 11 7.05435 11 6.83333C11 6.61232 10.9122 6.40036 10.7559 6.24408C10.5996 6.0878 10.3877 6 10.1667 6ZM10.1667 24.3333H7.66667V21.8333C7.66667 21.6123 7.57887 21.4004 7.42259 21.2441C7.26631 21.0878 7.05435 21 6.83333 21C6.61232 21 6.40036 21.0878 6.24408 21.2441C6.0878 21.4004 6 21.6123 6 21.8333V24.3333C6 24.7754 6.17559 25.1993 6.48816 25.5118C6.80072 25.8244 7.22464 26 7.66667 26H10.1667C10.3877 26 10.5996 25.9122 10.7559 25.7559C10.9122 25.5996 11 25.3877 11 25.1667C11 24.9457 10.9122 24.7337 10.7559 24.5774C10.5996 24.4211 10.3877 24.3333 10.1667 24.3333ZM17.6667 24.3333H14.3333C14.1123 24.3333 13.9004 24.4211 13.7441 24.5774C13.5878 24.7337 13.5 24.9457 13.5 25.1667C13.5 25.3877 13.5878 25.5996 13.7441 25.7559C13.9004 25.9122 14.1123 26 14.3333 26H17.6667C17.8877 26 18.0996 25.9122 18.2559 25.7559C18.4122 25.5996 18.5 25.3877 18.5 25.1667C18.5 24.9457 18.4122 24.7337 18.2559 24.5774C18.0996 24.4211 17.8877 24.3333 17.6667 24.3333ZM25.1667 13.5C24.9457 13.5 24.7337 13.5878 24.5774 13.7441C24.4211 13.9004 24.3333 14.1123 24.3333 14.3333V17.6667C24.3333 17.8877 24.4211 18.0996 24.5774 18.2559C24.7337 18.4122 24.9457 18.5 25.1667 18.5C25.3877 18.5 25.5996 18.4122 25.7559 18.2559C25.9122 18.0996 26 17.8877 26 17.6667V14.3333C26 14.1123 25.9122 13.9004 25.7559 13.7441C25.5996 13.5878 25.3877 13.5 25.1667 13.5ZM24.3333 6H21.8333C21.6123 6 21.4004 6.0878 21.2441 6.24408C21.0878 6.40036 21 6.61232 21 6.83333C21 7.05435 21.0878 7.26631 21.2441 7.42259C21.4004 7.57887 21.6123 7.66667 21.8333 7.66667H24.3333V10.1667C24.3333 10.3877 24.4211 10.5996 24.5774 10.7559C24.7337 10.9122 24.9457 11 25.1667 11C25.3877 11 25.5996 10.9122 25.7559 10.7559C25.9122 10.5996 26 10.3877 26 10.1667V7.66667C26 7.22464 25.8244 6.80072 25.5118 6.48816C25.1993 6.17559 24.7754 6 24.3333 6ZM17.6667 6H14.3333C14.1123 6 13.9004 6.0878 13.7441 6.24408C13.5878 6.40036 13.5 6.61232 13.5 6.83333C13.5 7.05435 13.5878 7.26631 13.7441 7.42259C13.9004 7.57887 14.1123 7.66667 14.3333 7.66667H17.6667C17.8877 7.66667 18.0996 7.57887 18.2559 7.42259C18.4122 7.26631 18.5 7.05435 18.5 6.83333C18.5 6.61232 18.4122 6.40036 18.2559 6.24408C18.0996 6.0878 17.8877 6 17.6667 6ZM25.1667 21C24.9457 21 24.7337 21.0878 24.5774 21.2441C24.4211 21.4004 24.3333 21.6123 24.3333 21.8333V24.3333H21.8333C21.6123 24.3333 21.4004 24.4211 21.2441 24.5774C21.0878 24.7337 21 24.9457 21 25.1667C21 25.3877 21.0878 25.5996 21.2441 25.7559C21.4004 25.9122 21.6123 26 21.8333 26H24.3333C24.7754 26 25.1993 25.8244 25.5118 25.5118C25.8244 25.1993 26 24.7754 26 24.3333V21.8333C26 21.6123 25.9122 21.4004 25.7559 21.2441C25.5996 21.0878 25.3877 21 25.1667 21Z'\n fill='#122239'\n stroke='#122239'\n stroke-width='0.5'\n />\n <path\n d='M19.8225 12.1835C19.5859 11.9469 19.2036 11.9469 18.967 12.1835L16 15.1445L13.033 12.1775C12.7964 11.9408 12.4141 11.9408 12.1775 12.1775C11.9408 12.4141 11.9408 12.7964 12.1775 13.033L15.1445 16L12.1775 18.967C11.9408 19.2036 11.9408 19.5859 12.1775 19.8225C12.4141 20.0592 12.7964 20.0592 13.033 19.8225L16 16.8555L18.967 19.8225C19.2036 20.0592 19.5859 20.0592 19.8225 19.8225C20.0592 19.5859 20.0592 19.2036 19.8225 18.967L16.8555 16L19.8225 13.033C20.0531 12.8024 20.0531 12.4141 19.8225 12.1835V12.1835Z'\n fill='#122239'\n stroke='#122239'\n stroke-width='0.5'\n />\n</svg>\n",c,"Clear Selection"),this.invertSelectionButton=ce("<svg width='32'\n height='32'\n viewBox='0 0 32 32'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n>\n <path\n fill-rule='evenodd'\n clip-rule='evenodd'\n d='M16 6C10.4772 6 6 10.4772 6 16C6 21.5228 10.4772 26 16 26C21.5228 26 26 21.5228 26 16C26 10.4772 21.5228 6 16 6ZM7.53846 16C7.53846 11.3268 11.3268 7.53846 16 7.53846C16.0002 7.53846 15.9998 7.53846 16 7.53846L16.0006 12.4497C15.059 12.4497 14.156 12.8238 13.4902 13.4896C12.8244 14.1554 12.4503 15.0584 12.4503 16C12.4503 16.9416 12.8244 17.8446 13.4902 18.5104C14.156 19.1762 15.059 19.5503 16.0006 19.5503V24.4615C16.0004 24.4615 16.0008 24.4615 16.0006 24.4615C11.3274 24.4615 7.53846 20.6732 7.53846 16ZM16.0006 19.5503C16.9422 19.5503 17.8452 19.1762 18.5111 18.5104C19.1769 17.8446 19.5509 16.9416 19.5509 16C19.5509 15.0584 19.1769 14.1554 18.5111 13.4896C17.8452 12.8238 16.9422 12.4497 16.0006 12.4497V19.5503Z'\n fill='#122239'\n />\n <path\n d='M16 7.53846C11.3268 7.53846 7.53846 11.3268 7.53846 16C7.53846 20.6732 11.3274 24.4615 16.0006 24.4615M16 7.53846C15.9998 7.53846 16.0002 7.53846 16 7.53846ZM16 7.53846L16.0006 12.4497M16.0006 12.4497C15.059 12.4497 14.156 12.8238 13.4902 13.4896C12.8244 14.1554 12.4503 15.0584 12.4503 16C12.4503 16.9416 12.8244 17.8446 13.4902 18.5104C14.156 19.1762 15.059 19.5503 16.0006 19.5503M16.0006 12.4497C16.9422 12.4497 17.8452 12.8238 18.5111 13.4896C19.1769 14.1554 19.5509 15.0584 19.5509 16C19.5509 16.9416 19.1769 17.8446 18.5111 18.5104C17.8452 19.1762 16.9422 19.5503 16.0006 19.5503M16.0006 12.4497V19.5503M16.0006 19.5503V24.4615M16.0006 24.4615C16.0008 24.4615 16.0004 24.4615 16.0006 24.4615ZM6 16C6 10.4772 10.4772 6 16 6C21.5228 6 26 10.4772 26 16C26 21.5228 21.5228 26 16 26C10.4772 26 6 21.5228 6 16Z'\n stroke='#122239'\n stroke-width='0.5'\n />\n</svg>\n",d,"Invert Selection"),this.playPauseButton=ce(r?he:se,l,r?"Pause Animation":"Play Animation"),this.controlsContainer.append(this.zoomInButton,this.zoomOutButton,this.resetButton,this.fullScreenButton,this.lassoSelectButton,this.boxSelectButton,this.clearSelectionButton,this.invertSelectionButton,this.playPauseButton)}return t.prototype.updateFullScreenButton=function(t){this.fullScreenButton.innerHTML=t?oe:ae,this.fullScreenButton.setAttribute("data-tooltip",t?"Scale back":"Expand")},t.prototype.updatePlayPauseButton=function(t){this.playPauseButton.innerHTML=t?he:se,this.playPauseButton.setAttribute("data-tooltip",t?"Pause Animation":"Play Animation")},t.prototype.highlightLassoSelectButton=function(t){this.lassoSelectButton.classList.toggle("active",t)},t.prototype.highlightBoxSelectButton=function(t){this.boxSelectButton.classList.toggle("active",t)},t.prototype.getControlsContainer=function(){return this.controlsContainer},t}();function ce(t,e,n,r){var i=document.createElement("button");return i.setAttribute("data-tooltip",n),i.innerHTML=t,r&&(i.className=r),i.addEventListener("click",e),i}var de=function(){function t(t,e,n,r){this.selectionCanvas=null,this.sigma=t,this.mode=e,this.addSelectedNodes=n,this.updateSelectedNodes=r,this.isDrawing=!1,this.lassoDrawnPoints=[],this.boxInitialPoint=null,this.selectionCanvas=null}return t.prototype.getNormalizedPosition=function(t){var e=this.selectionCanvas.getBoundingClientRect();return{x:t.clientX-e.left,y:t.clientY-e.top}},t.prototype.drawSmoothFilledPath=function(t){var e=this.selectionCanvas.getContext("2d");le(e);var n,r,i=t[0],o=t[1],a=t.length;e.beginPath(),e.moveTo(i.x,i.y);for(var s=1;s<a;s+=1){var h=(r=o,{x:(n=i).x+(r.x-n.x)/2,y:n.y+(r.y-n.y)/2});e.quadraticCurveTo(i.x,i.y,h.x,h.y),i=t[s],o=t[s+1]}e.lineTo(i.x,i.y),e.stroke(),e.fill()},t.prototype.getGraphNodesInCurrentPath=function(){var t=this,e=this.sigma.viewRectangle(),n=this.sigma.getGraph(),r=this.sigma.quadtree.rectangle(e.x1,1-e.y1,e.x2,1-e.y2,e.height),i=Array.from(new Set(r)),o=this.selectionCanvas.getContext("2d"),a=[];return i.forEach((function(e){var r=Number(e),i=n.getNodeAttributes(r),s=i.x,h=i.y,u=t.sigma.graphToViewport({x:s,y:h});o.isPointInPath(u.x,u.y)&&a.push(r)})),a},t.prototype.onDrawingStart=function(t){if(t.preventDefault(),this.mode!==pe.inactive){this.isDrawing=!0;var e=this.getNormalizedPosition(t);this.mode===pe.lasso&&(this.lassoDrawnPoints=[],this.lassoDrawnPoints.push(e)),this.mode===pe.box&&(this.boxInitialPoint=e),t.stopPropagation()}},t.prototype.onDrawing=function(t){if(this.mode!==pe.inactive&&this.isDrawing){var e=this.getNormalizedPosition(t),n=this.selectionCanvas.getContext("2d");if(le(n),n.clearRect(0,0,n.canvas.width,n.canvas.height),this.mode===pe.lasso&&(this.lassoDrawnPoints.push(e),this.drawSmoothFilledPath(this.lassoDrawnPoints)),this.mode===pe.box&&this.boxInitialPoint){n.beginPath();var r=e.x-this.boxInitialPoint.x,i=e.y-this.boxInitialPoint.y;n.rect(this.boxInitialPoint.x,this.boxInitialPoint.y,r,i),n.fill()}t.stopPropagation()}},t.prototype.onDrawingEnd=function(t){if(this.mode!==pe.inactive){var e=this.getGraphNodesInCurrentPath();this.isDrawing=!1,t.shiftKey?this.addSelectedNodes(e):this.updateSelectedNodes(e);var n=this.selectionCanvas.getContext("2d");n.clearRect(0,0,this.selectionCanvas.width,this.selectionCanvas.height),n.beginPath(),this.mode===pe.lasso&&(this.lassoDrawnPoints=[]),this.mode===pe.box&&(this.boxInitialPoint=null),t.stopPropagation()}},t.prototype.onSelectScroll=function(t){this.sigma.getMouseCaptor().handleWheel(t)},t.prototype.setMode=function(t){this.mode=t},t.prototype.createDrawingCanvas=function(){this.selectionCanvas||(this.selectionCanvas=function(t){var e=t.offsetWidth,n=t.offsetHeight,r=document.createElement("canvas");return r.width=e,r.height=n,r.style.position="absolute",r.style.top="0px",r.style.cursor="crosshair",r}({offsetWidth:this.sigma.getContainer().offsetWidth,offsetHeight:this.sigma.getContainer().offsetHeight}),this.selectionCanvas.addEventListener("mousedown",this.onDrawingStart.bind(this)),this.selectionCanvas.addEventListener("mousemove",this.onDrawing.bind(this)),this.selectionCanvas.addEventListener("mouseup",this.onDrawingEnd.bind(this)),this.selectionCanvas.addEventListener("wheel",this.onSelectScroll.bind(this)))},t.prototype.cleanupCanvasEvents=function(){this.selectionCanvas&&(this.selectionCanvas.removeEventListener("mousedown",this.onDrawingStart.bind(this)),this.selectionCanvas.removeEventListener("mousemove",this.onDrawing.bind(this)),this.selectionCanvas.removeEventListener("mouseup",this.onDrawingEnd.bind(this)),this.selectionCanvas.removeEventListener("wheel",this.onSelectScroll.bind(this)),this.selectionCanvas=null)},t.prototype.getDrawingCanvas=function(){return this.selectionCanvas},t}();function le(t){t.strokeStyle="black",t.lineWidth=2,t.fillStyle="rgba(200, 200, 200, 0.25)",t.lineJoin="round",t.lineCap="round"}var pe,fe=function(){return fe=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},fe.apply(this,arguments)},ge=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};!function(t){t[t.inactive=0]="inactive",t[t.lasso=1]="lasso",t[t.box=2]="box"}(pe||(pe={}));var ve,ye=function(){function t(t){var n,r=this;this.isDragging=!1,this.isDraggedNodeSelected=!1,this.isLassoActiveDueToModifierKey=!1,this.overlay=null,this.previousPosition=null,this.originalSizeKey="originalSize",this.originalBorderKey="originalBorder",this.handleSelectionClear=function(){r.updateSelectedNodes([])},this.handleEnterNode=function(t){var e=r.graph.getNodeAttribute(t.node,"label"),n=r.graph.getNodeAttribute(t.node,"labelToDisplay");r.graph.getNodeAttribute(t.node,"originalLabel")||r.graph.setNodeAttribute(t.node,"originalLabel",e),r.graph.setNodeAttribute(t.node,"label",n),r.graph.setNodeAttribute(t.node,"hovered",!0),r.neighborHighlightingEnabled&&r.graph.forEachNeighbor(t.node,(function(e){var n=r.graph.getNodeAttribute(e,"border");r.graph.setNodeAttribute(e,"border",3),r.graph.setNodeAttribute(e,r.originalBorderKey,n);var i=r.getUndirectedEdge(t.node,e),o=r.graph.getEdgeAttribute(i,"size");r.graph.setEdgeAttribute(i,"size",3),r.graph.setEdgeAttribute(i,r.originalSizeKey,o)}))},this.handleLeaveNode=function(t){var e=r.graph.getNodeAttribute(t.node,"originalLabel");r.graph.setNodeAttribute(t.node,"label",e),r.graph.setNodeAttribute(t.node,"hovered",void 0),r.neighborHighlightingEnabled&&r.graph.forEachNeighbor(t.node,(function(e){var n=r.graph.getNodeAttribute(e,r.originalBorderKey);r.graph.setNodeAttribute(e,"border",n);var i=r.getUndirectedEdge(t.node,e);r.graph.setEdgeAttribute(i,"size",void 0)}))},this.handleDownNode=function(t){r.isDragging=!0,r.draggedNode=t.node;var e=Number(t.node);r.graph.setNodeAttribute(r.draggedNode,"highlighted",!0),r.isDraggedNodeSelected=r.selectedNodes.some((function(t){return t===e})),r.isDraggedNodeSelected?r.selectedNodes.map((function(t){return r.graph.updateNodeAttribute(t,"fixed",(function(){return!0}))})):r.graph.setNodeAttribute(r.draggedNode,"fixed",!0),r.previousPosition=r.sigma.viewportToGraph(t.event),!r.animator.isRunning()&&r._animate&&r.animator.start(),r.animator.resetNIters()},this.handleNodeDoubleClick=function(t){t.preventSigmaDefault();var e=Number(t.node);r.selectedNodes.some((function(t){return t===e}))?r.updateSelectedNodes(r.selectedNodes.filter((function(t){return t!==e}))):r.addSelectedNodes([e])},this.handleMouseMoveBody=function(t){if(r.isDragging&&r.draggedNode&&r.previousPosition){r.animator.resetNIters();var e=r.sigma.viewportToGraph(t),n=e.x-r.previousPosition.x,i=e.y-r.previousPosition.y;r.previousPosition=e,r.isDraggedNodeSelected?r.selectedNodes.map((function(t){return r.graph.updateNodeAttributes(t,(function(t){return fe(fe({},t),{x:t.x+n,y:t.y+i})}))})):r.graph.updateNodeAttributes(r.draggedNode,(function(t){return fe(fe({},t),{x:t.x+n,y:t.y+i})})),t.preventSigmaDefault(),t.original.preventDefault(),t.original.stopPropagation()}},this.handleMouseUp=function(){r.draggedNode&&(r.isDraggedNodeSelected?r.selectedNodes.map((function(t){return r.graph.removeNodeAttribute(t,"fixed")})):(r.graph.removeNodeAttribute(r.draggedNode,"fixed"),r.graph.removeNodeAttribute(r.draggedNode,"highlighted")),r.previousPosition=null),r.animator&&r.animator.forceNodePositionUpdate(),r.isDragging=!1,r.draggedNode=null,r.isDraggedNodeSelected=!1},this.handleMouseDown=function(){r.sigma.getCustomBBox()||r.sigma.setCustomBBox(r.sigma.getBBox())},this.handleDoubleClickStage=function(t){r.handleSelectionClear(),t.preventSigmaDefault()},this.handleWheel=function(t){var e=r.sigma.getCamera(),n=e.getState(),i=Math.max(-1.5,Math.min(1.5,t.delta)),o=e.getBoundedRatio(n.ratio*(1-i/8));t.original.deltaMode!==WheelEvent.DOM_DELTA_PIXEL&&console.warn("WheelEvent.deltaMode is not DOM_DELTA_PIXEL. Zoom behavior may not be as expected.");var a=r.sigma.getViewportZoomedState(t,o);e.setState(a),t.preventSigmaDefault(),t.sigmaDefaultPrevented=!0},this.handleLassoModifierDown=function(t){"Alt"===t.key&&r.mode===pe.inactive&&(r.setSelectMode(pe.lasso),r.isLassoActiveDueToModifierKey=!0,r.graphControls.highlightLassoSelectButton(!0))},this.handleLassoModifierUp=function(t){"Alt"===t.key&&r.isLassoActiveDueToModifierKey&&(r.setSelectMode(pe.inactive),r.isLassoActiveDueToModifierKey=!1,r.graphControls.highlightLassoSelectButton(!1))},this.graphContainer=((n=document.createElement("div")).className="graph-container",n.style.width="100%",n.style.height="calc(100% - 40px)",n.style.position="relative",n.style.top="40px",n),this.sigmaContainer=function(t){var e=document.createElement("div");return e.className="sigma-container",e.style.width="100%",e.style.height="100%",t.appendChild(e),e}(this.graphContainer),this.sigma=new e.Sigma(t.graph,this.sigmaContainer,t.settings),this.graph=t.graph,this.animator=t.animator,this._animate=!0,this.mode=t.mode,this._isFullScreen=t.isFullScreen,this.highlightedNodeColor=t.highlightedNodeColor||"#FF00FFDD",this.neighborHighlightingEnabled=t.neighborHighlightingEnabled,this.allowNodeMovement=void 0===t.allowNodeMovement||t.allowNodeMovement,this.graphInteraction=new ie(this.sigma,this.graph,this.animator),this.graphControls=new ue({isFullScreen:this._isFullScreen,animate:this._animate,onZoomIn:this.zoomIn.bind(this),onZoomOut:this.zoomOut.bind(this),onResetView:this.resetView.bind(this),onToggleFullScreen:this.toggleFullScreen.bind(this),onToggleLassoSelect:this.toggleLassoSelect.bind(this),onToggleBoxSelect:this.toggleBoxSelect.bind(this),onClearSelection:this.handleSelectionClear.bind(this),onInvertSelection:this.invertSelection.bind(this),onTogglePlayPause:this.togglePlayPause.bind(this)}),this.graphContainer.appendChild(this.graphControls.getControlsContainer()),this.drawingManager=new de(this.sigma,this.mode,this.addSelectedNodes.bind(this),this.updateSelectedNodes.bind(this)),this._selectedNodes=t.selectedNodes,this._highlightedNodes=t.highlightedNodes||[],this.onSelectedNodesChange=t.onSelectedNodesChange,this.onHighlightedNodesChange=t.onHighlightedNodesChange,this.onFullScreenChange=t.onFullScreenChange,this.initializeGraph(),this.initializeOverlay(),this.registerEvents(),this.bindEventHandlers(),document.addEventListener("keydown",this.handleLassoModifierDown),document.addEventListener("keyup",this.handleLassoModifierUp)}return t.prototype.getGraphContainer=function(){return this.graphContainer},Object.defineProperty(t.prototype,"selectedNodes",{get:function(){return this._selectedNodes},enumerable:!1,configurable:!0}),t.prototype.setSelectedNodes=function(t,e){void 0===e&&(e=!0),this._selectedNodes=t,this.updateNodeSelection(),e&&this.onSelectedNodesChange(t)},t.prototype.updateNodeSelection=function(){var t=new Set(this.selectedNodes);this.graph.updateEachNodeAttributes((function(e,n){var r=Number(e),i=t.has(r),o=n.hovered;if(n.labelBeforeSelection||o||(n.labelBeforeSelection=n.originalLabel||n.label),i)return fe(fe({},n),{label:void 0,originalLabel:void 0,highlighted:!0});var a=n.labelBeforeSelection;return fe(fe({},n),{label:a,originalLabel:a,highlighted:!1})}))},Object.defineProperty(t.prototype,"highlightedNodes",{get:function(){return this._highlightedNodes},set:function(t){this._highlightedNodes=t,this.updateNodeHighlighting(),this.onHighlightedNodesChange(t)},enumerable:!1,configurable:!0}),t.prototype.updateHighlightedNodes=function(t){this.highlightedNodes=t},t.prototype.updateNodeHighlighting=function(){var t=this,e=new Set(this.highlightedNodes);this.graph.updateEachNodeAttributes((function(n,r){var i=Number(n),o=e.has(i);if(o&&(void 0!==r.border||void 0!==r.originalBorder))return r.hasOwnProperty("originalBorder")||(r.originalBorder=r.border||null),fe(fe({},r),{border:t.highlightedNodeColor});if(!o&&r.hasOwnProperty("originalBorder")){var a=null===r.originalBorder?void 0:r.originalBorder;return delete r.originalBorder,fe(fe({},r),{border:a})}return r}))},Object.defineProperty(t.prototype,"isFullScreen",{get:function(){return this._isFullScreen},set:function(t){this._isFullScreen=t,this.onFullScreenChange(t)},enumerable:!1,configurable:!0}),t.prototype.updateGraph=function(t){this.graph=t,this.sigma.setGraph(t),this.clearQuadtreeCache()},t.prototype.updateAnimator=function(t){this.animator&&this.animator.kill(),this.animator=t},t.prototype.zoomInAndOut=function(){this.sigma.getCamera().animatedZoom(),this.sigma.getCamera().animatedUnzoom()},t.prototype.resetGraphBounds=function(){this.sigma.setCustomBBox(null)},t.prototype.refresh=function(){this.sigma.refresh()},t.prototype.cleanup=function(){this.sigma.off("enterNode",this.handleEnterNode),this.sigma.off("leaveNode",this.handleLeaveNode),this.sigma.off("downNode",this.handleDownNode),this.sigma.off("doubleClickNode",this.handleNodeDoubleClick),this.sigma.off("doubleClickStage",this.handleDoubleClickStage),this.sigma.getMouseCaptor().off("wheel",this.handleWheel),this.allowNodeMovement&&(this.sigma.getMouseCaptor().off("mousemovebody",this.handleMouseMoveBody),this.sigma.getMouseCaptor().off("mouseup",this.handleMouseUp),this.sigma.getMouseCaptor().off("mousedown",this.handleMouseDown))},t.prototype.dispose=function(){this.sigma&&(this.sigma.clear(),this.sigma.kill(),Object.values(this.sigma.webGLContexts).forEach((function(t){var e;null===(e=t.getExtension("WEBGL_lose_context"))||void 0===e||e.loseContext()})))},t.prototype.initializeGraph=function(){this.sigma.setGraph(this.graph),this.clearQuadtreeCache()},t.prototype.initializeOverlay=function(){var t=this;this.overlay=function(e){var n=document.createElement("div");n.className="webgl-overlay",n.innerText='Graph is not shown because the WebGL context was lost.\nThis can happen when the browser has too many other objects to display. Usually, clicking "Restore Context" will be able to bring the graph back.';var r=document.createElement("button");return r.innerText="Restore Graph Display",r.style.marginTop="20px",r.style.padding="10px 20px",r.style.fontSize="1rem",r.style.cursor="pointer",r.addEventListener("click",(function(){return t.handleContextRestored()})),n.appendChild(r),n.style.position="absolute",n.style.top="0",n.style.left="0",n.style.width="100%",n.style.height="100%",n.style.backgroundColor="rgba(0, 0, 0, 0.7)",n.style.color="white",n.style.display="flex",n.style.flexDirection="column",n.style.justifyContent="center",n.style.alignItems="center",n.style.zIndex="1000",n.style.visibility="hidden",n}(),this.graphContainer.appendChild(this.overlay)},t.prototype.registerEvents=function(){this.sigma.on("enterNode",this.handleEnterNode),this.sigma.on("leaveNode",this.handleLeaveNode),this.sigma.on("downNode",this.handleDownNode),this.sigma.on("doubleClickNode",this.handleNodeDoubleClick),this.sigma.on("doubleClickStage",this.handleDoubleClickStage),this.sigma.getMouseCaptor().on("wheel",this.handleWheel),this.allowNodeMovement&&(this.sigma.getMouseCaptor().on("mousemovebody",this.handleMouseMoveBody),this.sigma.getMouseCaptor().on("mouseup",this.handleMouseUp),this.sigma.getMouseCaptor().on("mousedown",this.handleMouseDown));var t=this.sigma.getCanvases().nodes;t&&(t.addEventListener("webglcontextlost",this.handleContextLost.bind(this)),t.addEventListener("webglcontextrestored",this.handleContextRestored.bind(this)))},t.prototype.bindEventHandlers=function(){this.handleEnterNode=this.handleEnterNode.bind(this),this.handleLeaveNode=this.handleLeaveNode.bind(this),this.handleDownNode=this.handleDownNode.bind(this),this.handleNodeDoubleClick=this.handleNodeDoubleClick.bind(this),this.handleDoubleClickStage=this.handleDoubleClickStage.bind(this),this.handleMouseMoveBody=this.handleMouseMoveBody.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleWheel=this.handleWheel.bind(this),this.handleSelectionClear=this.handleSelectionClear.bind(this),this.handleLassoModifierDown=this.handleLassoModifierDown.bind(this),this.handleLassoModifierUp=this.handleLassoModifierUp.bind(this)},t.prototype.clearQuadtreeCache=function(){this.sigma.quadtree.cache&&(this.sigma.quadtree.cache=null,this.sigma.quadtree.lastRectangle=null)},t.prototype.updateSelectedNodes=function(t){this.setSelectedNodes(t)},t.prototype.addSelectedNodes=function(t){var e=this;this.setSelectedNodes(ge(ge([],this.selectedNodes,!0),t.filter((function(t){return!e.selectedNodes.includes(t)})),!0))},t.prototype.getUndirectedEdge=function(t,e){if(this.graph.hasEdge(t,e))return this.graph.edge(t,e);if(this.graph.hasEdge(e,t))return this.graph.edge(e,t);throw new Error("neighbor node = ".concat(e," does not have an edge with ").concat(t))},t.prototype.setSelectMode=function(t){this.updateSelectionMode(t),this.updateSelectionModeButtonStates(),this.toggleSelectionCanvas()},t.prototype.updateSelectionMode=function(t){this.mode=t,this.drawingManager.setMode(t)},t.prototype.updateSelectionModeButtonStates=function(){this.graphControls.highlightLassoSelectButton(this.mode===pe.lasso),this.graphControls.highlightBoxSelectButton(this.mode===pe.box),this.mode===pe.inactive&&(this.graphControls.highlightLassoSelectButton(!1),this.graphControls.highlightBoxSelectButton(!1))},t.prototype.toggleSelectionCanvas=function(){this.mode===pe.inactive?this.removeSelectionCanvas():this.showSelectionCanvas()},t.prototype.handleContextLost=function(t){t.preventDefault(),console.log("WebGL context lost."),this.overlay&&(this.overlay.style.visibility="visible")},t.prototype.handleContextRestored=function(){this.dispose(),this.sigma=new e.Sigma(this.graph,this.sigmaContainer,this.sigma.getSettings()),this.registerEvents(),this.overlay&&(this.overlay.style.visibility="hidden"),console.log("WebGL context restored.")},t.prototype.showSelectionCanvas=function(){if(!this.drawingManager.getDrawingCanvas()){this.drawingManager.createDrawingCanvas();var t=this.drawingManager.getDrawingCanvas();t&&this.graphContainer.appendChild(t)}},t.prototype.removeSelectionCanvas=function(){var t=this.drawingManager.getDrawingCanvas();t&&(this.drawingManager.cleanupCanvasEvents(),this.graphContainer.removeChild(t))},t.prototype.zoomIn=function(){this.graphInteraction.zoomIn()},t.prototype.zoomOut=function(){this.graphInteraction.zoomOut()},t.prototype.resetView=function(){return t=this,n=function(){return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(h){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,h])}}}(this,(function(t){switch(t.label){case 0:return[4,this.graphInteraction.resetView()];case 1:return t.sent(),[2]}}))},new((e=void 0)||(e=Promise))((function(r,i){function o(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var n;t.done?r(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(o,a)}s((n=n.apply(t,[])).next())}));var t,e,n},t.prototype.toggleFullScreen=function(){this._isFullScreen=!this._isFullScreen,this.onFullScreenChange(this._isFullScreen),this.graphControls.updateFullScreenButton(this._isFullScreen)},t.prototype.toggleLassoSelect=function(){this.mode!==pe.lasso?this.setSelectMode(pe.lasso):this.setSelectMode(pe.inactive)},t.prototype.toggleBoxSelect=function(){this.mode!==pe.box?this.setSelectMode(pe.box):this.setSelectMode(pe.inactive)},t.prototype.invertSelection=function(){var t=this,e=[];this.graph.forEachNode((function(n){var r=Number(n);t.selectedNodes.some((function(t){return t===r}))||e.push(r)})),this.updateSelectedNodes(e)},t.prototype.updateAnimatorState=function(){this.animator&&(this._animate?this.animator.isRunning()||this.animator.start():this.animator.isRunning()&&this.animator.stop())},t.prototype.togglePlayPause=function(){this._animate=!this._animate,this.graphControls.updatePlayPauseButton(this._animate),this.updateAnimatorState()},t}(),me=function(){return me=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},me.apply(this,arguments)},be=function(){function t(t,e,n,r){var i=this;this.callback=null,this.graph=t,this.endPositions=e,this.animation_type=n,this.frameID=null,this.running=!1,this.step=new Array(t.nodes().length),this.graph.forEachNode((function(t,n){var o=Number(t),a=e[o].x-n.x,s=e[o].y-n.y;a/=r,s/=r,i.step[o]={x:a,y:s}})),this.niters=0,this.maxiters=r}return t.prototype.isRunning=function(){return this.running},t.prototype.resetNIters=function(){this.niters=0},t.prototype.updateNodePositions=function(){var t=this;this.graph.updateEachNodeAttributes((function(e,n){var r=Number(e);return me(me({},n),{x:n.x+t.step[r].x,y:n.y+t.step[r].y})}))},t.prototype.runFrame=function(){var t=this;this.updateNodePositions(),this.niters+=1,this.niters>this.maxiters?this._kill():this.frameID=window.requestAnimationFrame((function(){return t.runFrame()}))},t.prototype._stop=function(){return null!==this.callback&&this.callback(),this.callback=null,this.running=!1,this.resetNIters(),null!==this.frameID&&(window.cancelAnimationFrame(this.frameID),this.frameID=null),this},t.prototype.run=function(t){this.callback=t,this.running||(this.running=!0,this.runFrame())},t.prototype._kill=function(){this._stop()},t}(),we=function(){function t(t){var e=this;this.sliderValues={},this.sliderConfigs=[],this.views=[],this.listeners={},this.sliderConfigs=t,t.forEach((function(t){e.sliderValues[t.label]=t.initialValue,e.listeners[t.label]=[]}))}return t.prototype.callListeners=function(t){var e=this;this.listeners[t].forEach((function(n){n(e.sliderValues[t])}))},t.prototype.getView=function(t){var e=this,n=new _e(t,this.sliderConfigs);return Object.keys(this.sliderValues).forEach((function(t){n.addListener(t,(function(n){var r=Number(n.target.value);e.setSliderValue(t,r),e.callListeners(t)}))})),this.views.push(n),n},t.prototype.getSliderValue=function(t){return this.sliderValues[t]||null},t.prototype.setSliderValue=function(t,e){this.sliderValues[t]=e,this.views.forEach((function(n){n.setSliderValue(t,e)}))},t.prototype.addListener=function(t,e){this.listeners[t].push(e)},t}(),_e=function(){function t(t,e){var n=this;this.sliders={},this.sliderValues={};var r=this.createSliderContainer();t.appendChild(r),e.forEach((function(t){var e=n.createSliderWrapper(t),i=e.wrapper,o=e.slider,a=e.labelElement;r.appendChild(i),n.sliders[t.label]=o,n.sliderValues[t.label]=a,o.addEventListener("input",(function(){a.textContent=o.value}))}))}return t.prototype.createSliderContainer=function(){var t=document.createElement("div");return t.className="slider-container",t},t.prototype.createSliderWrapper=function(t){var e=document.createElement("div");e.className="slider-wrapper";var n=document.createElement("label");n.className="slider-label",n.textContent="".concat(t.label,":");var r=document.createElement("input");r.type="range",r.className="slider",r.min=t.minValue.toString(),r.max=t.maxValue.toString(),r.step=t.step.toString(),r.value=t.initialValue.toString();var i=document.createElement("span");return i.className="slider-value",i.textContent=t.initialValue.toString(),e.appendChild(n),e.appendChild(r),e.appendChild(i),{wrapper:e,slider:r,labelElement:i}},t.prototype.setSliderValue=function(t,e){this.sliders[t].value=e.toString(),this.sliderValues[t].textContent=e.toString()},t.prototype.addListener=function(t,e){this.sliders[t].addEventListener("change",e)},t}(),xe=function(){function t(t,e,n){this.container=t,this.graphManager=new ye(n),this.initializeSliderView(e)}return t.prototype.initializeSliderView=function(t){this.sliderView=t.getView(this.container)},t.prototype.appendGraphToContainer=function(){this.container.appendChild(this.graphManager.getGraphContainer())},t}(),Ce=n(698),Ee=n.n(Ce),Le=function(){return Le=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Le.apply(this,arguments)},Se=n(739).graphToByteArrays,Me=function(t,e,n){return t.reduce((function(t,r){var i,o=null===(i=e[n])||void 0===i?void 0:i.nodes[r];return o&&t.push.apply(t,o.points),t}),[])},Ae=function(t,e,n){var r=new Set,i=n[t];return e.forEach((function(t){r.add(i[t])})),Array.from(r)},Ne=function(t,e){var n=new(Ee());t.nodes.forEach((function(t,e){var r,i;n.addNode(e,Le(Le({},t),{x:null!==(r=t.x)&&void 0!==r?r:Math.random(),y:null!==(i=t.y)&&void 0!==i?i:Math.random()}))}));var r=t.nodes.length,i=Math.ceil(e*r/2);return t.edges.slice(0,i).forEach((function(t){n.addEdge(t.s,t.t)})),n},ke=function(t){return{label:t.label,minValue:t.minValue,maxValue:t.maxValue,initialValue:t.initialValue,step:t.step}},Pe=function(){return Pe=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Pe.apply(this,arguments)},De=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{h(r.next(t))}catch(t){o(t)}}function s(t){try{h(r.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}h((r=r.apply(t,e||[])).next())}))},Ge=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(h){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,h])}}},Fe=function(){function t(t){var e=this;this.views=[],this.selectedNodes=[],this.selectedPoints=[],this.initialLayoutPromise=null;var n=t.graphData,r=t.sliderConfig,i=t.sigmaSettings,a=t.onSelectedNodesChange,s=t.onSelectedPointsChange,h=t.onFullScreenChange,u=t.onCoarsenessChange,c=t.onConnectivityChange,d=t.nodeColors,l=t.nodeLabels,p=t.nodeHoverLabels,f=t.layoutConfig;this.graphData=n,this.sliderConfig=r,this.sigmaSettings=i,this.nodeColors=d,this.nodeLabels=l,this.nodeHoverLabels=p,this.layoutConfig=f||{},this.onSelectedNodesChange=a,this.onSelectedPointsChange=s,this.onFullScreenChange=h,this.onCoarsenessChange=u,this.onConnectivityChange=c,this.selectedLevel=this.sliderConfig.selectedLevel,this.sliderManager=new we([ke(r.coarseness),ke(r.connectivity)]),this.addSliderListeners(),this.nDataPoints=Math.max.apply(Math,this.graphData[this.selectedLevel].nodes.map((function(t){return Math.max.apply(Math,t.points)})))+1,this.dataPointMaps=function(t,e){var n={};return Object.keys(t).forEach((function(r){n[r]=function(t,e){var n=Array(e);return t.forEach((function(t,e){t.forEach((function(t){n[t]=e}))})),n}(t[r].nodes.map((function(t){return t.points})),e)})),n}(this.graphData,this.nDataPoints),this.currentGraph=Ne(this.graphData[this.selectedLevel],6);var g=Pe(Pe(Pe({},nt),o().inferSettings(this.currentGraph)),this.layoutConfig);this.initialLayoutPromise=this.runInitialLayout({iterations:300,settings:g}).then((function(){e.initialLayoutPromise=null})),this.animator=this.getNewAnimator(),this.updateNodeAttributes()}return t.prototype.getView=function(t){return De(this,void 0,void 0,(function(){var e,n=this;return Ge(this,(function(r){switch(r.label){case 0:return this.initialLayoutPromise?[4,this.initialLayoutPromise]:[3,2];case 1:r.sent(),r.label=2;case 2:return e=new xe(t,this.sliderManager,{graph:this.currentGraph,animator:this.animator,mode:pe.inactive,settings:this.sigmaSettings,isFullScreen:!1,neighborHighlightingEnabled:!1,selectedNodes:[],onSelectedNodesChange:function(t){n.selectedNodes=t,n.selectedPoints=Me(n.selectedNodes,n.graphData,n.selectedLevel),n.onSelectedNodesChange(t),n.onSelectedPointsChange(n.selectedPoints)},onFullScreenChange:function(t){return n.onFullScreenChange(t)},onHighlightedNodesChange:function(){}}),this.views.push(e),e.appendGraphToContainer(),this.animator.start(),[2,e]}}))}))},t.prototype.setConnectivityLevel=function(t){var e=this,n=this.graphData[this.selectedLevel];this.currentGraph.clearEdges();var r=n.nodes.length,i=Math.ceil(t*r/2);n.edges.slice(0,i).forEach((function(t){e.currentGraph.addEdge(t.s,t.t)})),this.resetAnimator()},t.prototype.setCoarsenessLevel=function(t,e){return void 0===e&&(e=!0),De(this,void 0,void 0,(function(){var n,r,i;return Ge(this,(function(o){return n=this.selectedPoints,r=this.initializeNewGraph(t),i=Ae(t,n,this.dataPointMaps),this.updateGraphAndViews(r,i,e),[2]}))}))},t.prototype.setNodeColors=function(t){this.nodeColors=t,this.updateNodeColors()},t.prototype.setNodeLabels=function(t){this.nodeLabels=t,this.updateNodeLabels()},t.prototype.setNodeHoverLabels=function(t){this.nodeHoverLabels=t,this.updateNodeHoverLabels()},t.prototype.setSelectedNodes=function(t){this.selectedNodes=t,this.selectedPoints=Me(this.selectedNodes,this.graphData,this.selectedLevel),this.updateViewsSelectedNodes(),this.onSelectedNodesChange(this.selectedNodes),this.onSelectedPointsChange(this.selectedPoints)},t.prototype.setSelectedPoints=function(t){this.selectedPoints=t,this.selectedNodes=Ae(this.selectedLevel,t,this.dataPointMaps),this.onSelectedPointsChange(t),this.updateViewsSelectedNodes(),this.onSelectedNodesChange(this.selectedNodes)},t.prototype.cleanup=function(){this.views.forEach((function(t){t.graphManager.cleanup()})),this.animator.kill()},t.prototype.dispose=function(){this.views.forEach((function(t){t.graphManager.dispose()})),this.animator.kill()},t.prototype.initializeNewGraph=function(t){var e=this.dataPointMaps[this.selectedLevel],n=this.currentGraph;this.selectedLevel=t;var r=Number(this.sliderManager.getSliderValue(this.sliderConfig.connectivity.label)),i=Ne(this.graphData[t],r),o=function(t,e){var n=new Array(e.nodes().length);return e.forEachNode((function(e,r){var i=Number(e),o=r.points,a=new Set;o.forEach((function(e){a.add(t[e])})),n[i]=Array.from(a)})),n}(e,i);return function(t,e,n){e.updateEachNodeAttributes((function(e,r){var i=Number(e),o=n[i],a=o.map((function(e){return t.getNodeAttribute(e,"x")})),s=o.map((function(e){return t.getNodeAttribute(e,"y")})),h=a.reduce((function(t,e){return t+e}),0)/a.length,u=s.reduce((function(t,e){return t+e}),0)/s.length;return Le(Le({},r),{x:h+.1*Math.random(),y:u+.1*Math.random()})}))}(n,i,o),i},t.prototype.updateGraphAndViews=function(t,e,n){var r=this;this.selectedNodes=e,this.updateAllGraphViews(t,e),this.updateNodeAttributes(),this.onSelectedNodesChange(e),function(t,e){return void 0===e&&(e={}),r=function(){var n,r,i,h,u,c,d,l,p;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(h){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,h])}}}(this,(function(f){for(n=Le(Le(Le({},nt),o().inferSettings(t)),e),r=(0,s.kS)(t),i=(0,a.Q6)(void 0).fromEntry,h=Se(t,i),function(t,e,n){for(var r=0;r<40;r++)J(t,e.nodes,e.edges,n)}(n,h,r),u=t.nodes().length,c=[],d=0;d<u;d++)l=h.nodes[10*d],p=h.nodes[10*d+1],c.push({x:l,y:p});return[2,c]}))},new((n=void 0)||(n=Promise))((function(t,e){function i(t){try{a(r.next(t))}catch(t){e(t)}}function o(t){try{a(r.throw(t))}catch(t){e(t)}}function a(e){var r;e.done?t(e.value):(r=e.value,r instanceof n?r:new n((function(t){t(r)}))).then(i,o)}a((r=r.apply(void 0,[])).next())}));var n,r}(t,this.layoutConfig).then((function(t){n&&r.views.forEach((function(t){t.graphManager.resetGraphBounds()}));var e=new be(r.currentGraph,t,"linear",20);r.animator.kill(),e.run((function(){r.animator=r.getNewAnimator(),r.views.forEach((function(t){t.graphManager.updateAnimator(r.animator)})),r.animator.start()}))}))},t.prototype.updateNodeColors=function(){if(this.nodeColors){var t=this.nodeColors[this.selectedLevel];t&&this.currentGraph.updateEachNodeAttributes((function(e,n){var r=Number(e),i=t[r];return Pe(Pe({},n),{color:i||n.color})}))}},t.prototype.updateNodeLabels=function(){if(this.nodeLabels){var t=this.nodeLabels[this.selectedLevel];t&&this.currentGraph.updateEachNodeAttributes((function(e,n){var r=Number(e),i=t[r];return Pe(Pe({},n),{label:i||n.label})}))}},t.prototype.updateNodeHoverLabels=function(){if(this.nodeHoverLabels){var t=this.nodeHoverLabels[this.selectedLevel];t&&this.currentGraph.updateEachNodeAttributes((function(e,n){var r=Number(e),i=t[r];return Pe(Pe({},n),{labelToDisplay:i||n.labelToDisplay})}))}},t.prototype.updateViewsSelectedNodes=function(){var t=this;this.views.forEach((function(e){e.graphManager.setSelectedNodes(t.selectedNodes,!1)}))},t.prototype.updateNodeAttributes=function(){this.updateNodeColors(),this.updateNodeLabels(),this.updateNodeHoverLabels()},t.prototype.runInitialLayout=function(t){return De(this,void 0,void 0,(function(){return Ge(this,(function(e){switch(e.label){case 0:return[4,te(this.currentGraph,t)];case 1:return e.sent(),this.animator.forceNodePositionUpdate(),[2]}}))}))},t.prototype.resetAnimator=function(){this.animator.kill(),this.animator=this.getNewAnimator(),this.startAnimator()},t.prototype.startAnimator=function(){var t=this;this.animator.start(),this.views.forEach((function(e){e.graphManager.updateAnimator(t.animator)}))},t.prototype.getNewAnimator=function(){return new rt(this.currentGraph,{settings:Pe(Pe(Pe({},nt),o().inferSettings(this.currentGraph)),this.layoutConfig)},{maxiters:1500,miniters:200,convergenceThreshold:.1})},t.prototype.addSliderListeners=function(){var t=this;this.sliderManager.addListener(this.sliderConfig.coarseness.label,(function(e){t.onCoarsenessChange(e),t.handleCoarsenessChange(e)})),this.sliderManager.addListener(this.sliderConfig.connectivity.label,(function(e){t.onConnectivityChange(e),t.handleConnectivityChange(e)}))},t.prototype.handleCoarsenessChange=function(t){this.setCoarsenessLevel(t.toString())},t.prototype.handleConnectivityChange=function(t){this.setConnectivityLevel(t)},t.prototype.updateAllGraphViews=function(t,e){this.currentGraph=t,this.views.forEach((function(e){e.graphManager.updateGraph(t)})),this.selectedNodes=e,this.updateViewsSelectedNodes()},t}(),Oe=n(524),Te=n(533),Re=(ve=function(t,e){return ve=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},ve(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}ve(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),je=function(t){function e(e){var n=t.call(this,e,"\nattribute vec2 a_position;\nattribute float a_size;\nattribute vec4 a_color;\nattribute vec4 a_border;\n\nuniform float u_ratio;\nuniform float u_scale;\nuniform mat3 u_matrix;\n\nvarying vec4 v_color;\nvarying vec4 v_border_color;\nvarying float v_border;\n\nconst float bias = 255.0 / 254.0;\n\nvoid main() {\n gl_Position = vec4(\n (u_matrix * vec3(a_position, 1)).xy,\n 0,\n 1\n );\n\n // Multiply the point size twice:\n // - x SCALING_RATIO to correct the canvas scaling\n // - x 2 to correct the formulae\n gl_PointSize = a_size * u_ratio * u_scale * 2.0;\n\n v_border = (1.0 / u_ratio) * (0.5 / a_size);\n\n // Extract the color:\n v_color = a_color;\n v_border_color = a_border;\n v_color.a *= bias;\n v_border_color.a *= bias;\n}\n","\nprecision mediump float;\n\nvarying vec4 v_color;\nvarying vec4 v_border_color;\nvarying float v_border;\n\nconst float radius = 0.5;\nconst float halfRadius = 0.35;\n\nvoid main(void) {\n vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);\n vec4 white = vec4(1.0, 1.0, 1.0, 1.0);\n float distToCenter = length(gl_PointCoord - vec2(0.5, 0.5));\n\n float t = 0.0;\n if (distToCenter < halfRadius - v_border)\n gl_FragColor = v_color;\n else if (distToCenter < halfRadius)\n gl_FragColor = mix(v_border_color, v_color, (halfRadius - distToCenter) / v_border);\n else if (distToCenter < radius - v_border)\n gl_FragColor = v_border_color;\n else if (distToCenter < radius)\n gl_FragColor = mix(transparent, v_border_color, (radius - distToCenter) / v_border);\n else\n gl_FragColor = transparent;\n}\n",1,5)||this;return n.borderColorLocation=e.getAttribLocation(n.program,"a_border"),n.bind(),n}return Re(e,t),e.prototype.bind=function(){t.prototype.bind.call(this);var e=this.gl;e.enableVertexAttribArray(this.borderColorLocation),e.vertexAttribPointer(this.borderColorLocation,4,e.UNSIGNED_BYTE,!0,this.attributes*Float32Array.BYTES_PER_ELEMENT,16)},e.prototype.process=function(t,e,n){var r=this.array,i=1*n*5;if(e)return r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,void(r[i++]=0);var o=(0,Oe.floatColor)(t.color),a=(0,Oe.floatColor)(t.border);r[i++]=t.x,r[i++]=t.y,r[i++]=t.size,r[i++]=o,r[i++]=a},e.prototype.render=function(t){var e=this.gl,n=this.program;e.useProgram(n),e.uniform1f(this.ratioLocation,1/Math.sqrt(t.ratio)),e.uniform1f(this.scaleLocation,t.scalingRatio),e.uniformMatrix3fv(this.matrixLocation,!1,t.matrix),e.drawArrays(e.POINTS,0,this.array.length/5)},e}(Te.AbstractNodeProgram)})(),r})(),t.exports=e()},352:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n,r,i,o=t[1]||"",a=t[3];if(!a)return o;if(e&&"function"==typeof btoa){var s=(n=a,r=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),i="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(r),"/*# ".concat(i," */")),h=a.sources.map((function(t){return"/*# sourceURL=".concat(a.sourceRoot||"").concat(t," */")}));return[o].concat(h).concat([s]).join("\n")}return[o].join("\n")}(e,t);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,r){"string"==typeof t&&(t=[[null,t,""]]);var i={};if(r)for(var o=0;o<this.length;o++){var a=this[o][0];null!=a&&(i[a]=!0)}for(var s=0;s<t.length;s++){var h=[].concat(t[s]);r&&i[h[0]]||(n&&(h[2]?h[2]="".concat(n," and ").concat(h[2]):h[2]=n),e.push(h))}},e}},204:(t,e,n)=>{var r=n(379),i=n(889);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[t.id,i,""]]);r(i,{insert:"head",singleton:!1}),t.exports=i.locals||{}},136:(t,e,n)=>{var r=n(379),i=n(134);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[t.id,i,""]]);r(i,{insert:"head",singleton:!1}),t.exports=i.locals||{}},379:(t,e,n)=>{"use strict";var r,i=function(){var t={};return function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}t[e]=n}return t[e]}}(),o=[];function a(t){for(var e=-1,n=0;n<o.length;n++)if(o[n].identifier===t){e=n;break}return e}function s(t,e){for(var n={},r=[],i=0;i<t.length;i++){var s=t[i],h=e.base?s[0]+e.base:s[0],u=n[h]||0,c="".concat(h," ").concat(u);n[h]=u+1;var d=a(c),l={css:s[1],media:s[2],sourceMap:s[3]};-1!==d?(o[d].references++,o[d].updater(l)):o.push({identifier:c,updater:g(l,e),references:1}),r.push(c)}return r}function h(t){var e=document.createElement("style"),r=t.attributes||{};if(void 0===r.nonce){var o=n.nc;o&&(r.nonce=o)}if(Object.keys(r).forEach((function(t){e.setAttribute(t,r[t])})),"function"==typeof t.insert)t.insert(e);else{var a=i(t.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(e)}return e}var u,c=(u=[],function(t,e){return u[t]=e,u.filter(Boolean).join("\n")});function d(t,e,n,r){var i=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(t.styleSheet)t.styleSheet.cssText=c(e,i);else{var o=document.createTextNode(i),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(o,a[e]):t.appendChild(o)}}function l(t,e,n){var r=n.css,i=n.media,o=n.sourceMap;if(i?t.setAttribute("media",i):t.removeAttribute("media"),o&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleSheet)t.styleSheet.cssText=r;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(r))}}var p=null,f=0;function g(t,e){var n,r,i;if(e.singleton){var o=f++;n=p||(p=h(e)),r=d.bind(null,n,o,!1),i=d.bind(null,n,o,!0)}else n=h(e),r=l.bind(null,n,e),i=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(n)};return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else i()}}t.exports=function(t,e){(e=e||{}).singleton||"boolean"==typeof e.singleton||(e.singleton=(void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r));var n=s(t=t||[],e);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var r=0;r<n.length;r++){var i=a(n[r]);o[i].references--}for(var h=s(t,e),u=0;u<n.length;u++){var c=a(n[u]);0===o[c].references&&(o[c].updater(),o.splice(c,1))}n=h}}}},146:e=>{"use strict";e.exports=t},147:t=>{"use strict";t.exports=JSON.parse('{"name":"landscape-widget","version":"0.3.2-rc.0","description":"Jupyter widget for interactive graph visualization","keywords":["jupyter","jupyterlab","jupyterlab-extension","widgets"],"files":["lib/**/*.js","dist/*.js","css/*.css"],"author":{"name":"BlueLightAI","email":"support@bluelightai.com"},"license":"SEE LICENSE IN LICENSE.txt","main":"lib/index.js","types":"./lib/index.d.ts","repository":{"type":"git","url":"https://github.com/BlueLightAI/jupyter-landscapes"},"scripts":{"build":"yarn run build:lib && yarn run build:nbextension && yarn run build:labextension:dev","build:prod":"yarn run build:lib && yarn run build:nbextension && yarn run build:labextension","build:labextension":"jupyter labextension build .","build:labextension:dev":"jupyter labextension build --development True .","build:lib":"tsc","build:nbextension":"webpack","build:license-report-json":"license-report --output=json --config=.license-reportrc > ./license-report.json","build:license-report-html":"license-report --output=html --config=.license-reportrc > ./license-report.html","clean":"yarn run clean:lib && yarn run clean:nbextension && yarn run clean:labextension","clean:lib":"rimraf lib","clean:labextension":"rimraf landscape_widget/labextension","clean:nbextension":"rimraf landscape_widget/nbextension/static/index.js","lint":"eslint . --ext .ts,.tsx --fix","lint:check":"eslint . --ext .ts,.tsx","prepack":"yarn run build:lib","test":"jest","watch":"npm-run-all -p watch:*","watch:lib":"tsc -w","watch:nbextension":"webpack --watch --mode=development","watch:labextension":"jupyter labextension watch ."},"dependencies":{"@jupyter-widgets/base":"^1.1.10 || ^2 || ^3 || ^4 || ^5 || ^6","blai-graph-widget":"link:./blai-graph-widget","graphology":"^0.25.1","graphology-components":"^1.5.4","graphology-layout-forceatlas2":"^0.10.1","graphology-types":"^0.24.7","lodash":"^4.17.21","rand-seed":"^1.0.2"},"devDependencies":{"@babel/core":"^7.5.0","@babel/preset-env":"^7.5.0","@jupyter-widgets/base-manager":"^1.0.3","@jupyterlab/builder":"^3.6.1","@lumino/application":"^1.6.0","@lumino/widgets":"^1.6.0","@types/jest":"^26.0.0","@types/webpack-env":"^1.13.6","@typescript-eslint/eslint-plugin":"^3.6.0","@typescript-eslint/parser":"^3.6.0","acorn":"^7.2.0","css-loader":"^3.2.0","eslint":"^7.4.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","fs-extra":"^7.0.0","identity-obj-proxy":"^3.0.0","jest":"^29.0.0","license-report":"^6.5.0","mkdirp":"^0.5.1","npm-run-all":"^4.1.3","prettier":"^2.0.5","rimraf":"^2.6.2","sass":"^1.58.0","sass-loader":"^13.2.0","source-map-loader":"^1.1.3","style-loader":"^1.0.0","ts-jest":"^29.0.0","ts-loader":"^8.0.0","typescript":"~4.5.0","webpack":"^5.61.0","webpack-cli":"^4.0.0"},"resolutions":{"blai-graph-widget":"file:./blai-graph-widget"},"jupyterlab":{"extension":"lib/plugin","outputDir":"landscape_widget/labextension/","webpackConfig":"./lab.webpack.config.js","sharedPackages":{"@jupyter-widgets/base":{"bundled":false,"singleton":true}}}}')}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var o=n[t]={id:t,exports:{}};return e[t].call(o.exports,o,o.exports,r),o.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.nc=void 0;var i={};return(()=>{"use strict";r.r(i),r.d(i,{LandscapeModel:()=>b,LandscapeView:()=>w,MODULE_NAME:()=>n,MODULE_VERSION:()=>e});const t=r(147),e=t.version,n=t.name;var o=r(146),a=(r(204),r(916)),s=(r(136),function(t,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},s(t,e)});function h(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var u,c=function(){function t(){}return t._xfnv1a=function(t){for(var e=2166136261,n=0;n<t.length;n++)e=Math.imul(e^t.charCodeAt(n),16777619);return function(){return e+=e<<13,e^=e>>>7,e+=e<<3,e^=e>>>17,(e+=e<<5)>>>0}},t}(),d=function(t){function e(n){var r=t.call(this)||this;return r.a=e._xfnv1a(n)(),r}return h(e,t),e.prototype.next=function(){var t=this.a+=1831565813;return t=Math.imul(t^t>>>15,1|t),(((t^=t+Math.imul(t^t>>>7,61|t))^t>>>14)>>>0)/4294967296},e}(c),l=function(t){function e(n){var r=t.call(this)||this,i=e._xfnv1a(n);return r.a=i(),r.b=i(),r.c=i(),r.d=i(),r}return h(e,t),e.prototype.next=function(){this.a>>>=0,this.b>>>=0,this.c>>>=0,this.d>>>=0;var t=this.a+this.b|0;return this.a=this.b^this.b>>>9,this.b=this.c+(this.c<<3)|0,this.c=this.c<<21|this.c>>>11,this.d=this.d+1|0,t=t+this.d|0,this.c=this.c+t|0,(t>>>0)/4294967296},e}(c),p=function(t){function e(n){var r=t.call(this)||this,i=e._xfnv1a(n);return r.a=i(),r.b=i(),r.c=i(),r.d=i(),r}return h(e,t),e.prototype.next=function(){var t=this.b<<9,e=5*this.a;return e=e<<7|9*(e>>>25),this.c^=this.a,this.d^=this.b,this.b^=this.c,this.a^=this.d,this.c^=t,this.d=this.d<<11|this.d>>>21,(e>>>0)/4294967296},e}(c);!function(t){t.sfc32="sfc32",t.mulberry32="mulberry32",t.xoshiro128ss="xoshiro128ss"}(u||(u={}));var f=function(){function t(t,e){void 0===e&&(e=u.sfc32),this.str=t,this.prng=e,this.generator=this._initializeGenerator()}return t.prototype.next=function(){return this.generator.next()},t.prototype._initializeGenerator=function(){if(function(t){return null===t}(t=this.str)||function(t){return void 0===t}(t))return this.wrap();var t;switch(this.prng){case"sfc32":return new l(this.str);case"mulberry32":return new d(this.str);case"xoshiro128ss":return new p(this.str);default:return this.wrap()}},t.prototype.wrap=function(){return{next:function(){return Math.random()}}},t}(),g=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{h(r.next(t))}catch(t){o(t)}}function s(t){try{h(r.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}h((r=r.apply(t,e||[])).next())}))};const v={0:{nodes:[{points:[1,2],size:5},{points:[3],size:5}],edges:[{s:0,t:1}]},1:{nodes:[{points:[1,2,3],size:5}],edges:[]}},y=Object(),m={allowInvalidContainer:!0};class b extends o.DOMWidgetModel{initialize(t,e){super.initialize(t,e),this.on("change:colors",this.updateNodeColors,this),this.on("change:node_labels",this.updateNodeLabels,this),this.on("change:node_hover_labels",this.updateNodeHoverLabels,this),this.on("change:selected_level",this.updateSelectedLevel,this),this.on("change:avg_degree",this.updateAvgDegree,this),this.on("change:selected_points",this.updateSelectedPoints,this),this.on("msg:custom",this.handleCustomMessage,this),this.loadGraph()}loadGraph(){return g(this,void 0,void 0,(function*(){const t=this.get("graph"),e=Object.keys(t).map(Number),n=Math.min(...e),r=Math.max(...e),i=this.get("selected_level")||Math.floor((n+r)/2),o={coarseness:{label:"Coarseness",minValue:n,maxValue:r,initialValue:i,step:1},connectivity:{label:"Connectivity",minValue:0,maxValue:20,initialValue:this.get("avg_degree")||6,step:.1},selectedLevel:i.toString()};this.multiResolutionGraph=new a.MultiResolutionGraph({graphData:t,sliderConfig:o,sigmaSettings:Object.assign(Object.assign({},m),this.get("sigma_settings")||{}),onSelectedNodesChange:()=>{},onSelectedPointsChange:this.setSelectedPoints.bind(this),onFullScreenChange:this.toggleExpandedLayout.bind(this),onCoarsenessChange:this.setCoarsenessLevel.bind(this),onConnectivityChange:this.setConnectivityLevel.bind(this),layoutConfig:this.get("layout_config")}),this.updateNodeProperties()}))}updateNodeProperties(){this.updateNodeColors(),this.updateNodeLabels(),this.updateNodeHoverLabels()}setSelectedPoints(t){this.set("selected_points",t),this.save_changes()}toggleExpandedLayout(t){this.set("is_expanded_layout",t),this.save_changes()}setCoarsenessLevel(t){this.set("selected_level",t),this.save_changes()}setConnectivityLevel(t){this.set("avg_degree",t),this.save_changes()}updateNodeColors(){if(!this.multiResolutionGraph)return;const t=this.get("colors");t&&this.multiResolutionGraph.setNodeColors(t)}updateNodeLabels(){if(!this.multiResolutionGraph)return;const t=this.get("node_labels");t&&this.multiResolutionGraph.setNodeLabels(t)}updateNodeHoverLabels(){if(!this.multiResolutionGraph)return;const t=this.get("node_hover_labels");t&&this.multiResolutionGraph.setNodeHoverLabels(t)}updateSelectedLevel(){if(!this.multiResolutionGraph)return;const t=this.get("selected_level");t&&(this.multiResolutionGraph.setCoarsenessLevel(t),this.multiResolutionGraph.sliderManager.setSliderValue("Coarseness",t))}updateAvgDegree(){if(!this.multiResolutionGraph)return;const t=this.get("avg_degree");(t||0===t)&&(this.multiResolutionGraph.setConnectivityLevel(t),this.multiResolutionGraph.sliderManager.setSliderValue("Connectivity",t))}updateSelectedPoints(){if(!this.multiResolutionGraph)return;const t=this.get("selected_points");t&&this.multiResolutionGraph.setSelectedPoints(t)}disposeGraph(){this.multiResolutionGraph.cleanup(),this.multiResolutionGraph.dispose()}handleCustomMessage(t){"dispose_graph"===t.event_type&&this.disposeGraph()}defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:b.model_name,_model_module:b.model_module,_model_module_version:b.model_module_version,_view_name:b.view_name,_view_module:b.view_module,_view_module_version:b.view_module_version,graph:v,colors:null,node_labels:y,node_hover_labels:null,node_sizes:null,selected_nodes:[],sigma_settings:m,background_color:null,is_expanded_layout:!1})}}b.serializers=Object.assign({},o.DOMWidgetModel.serializers),b.model_name="LandscapeModel",b.model_module=n,b.model_module_version=e,b.view_name="LandscapeView",b.view_module=n,b.view_module_version=e;class w extends o.DOMWidgetView{constructor(t){super(t),this.view=null;const e=new f;this.containerId=`landscape-container-${e.next().toString(36).substring(2)}`}render(){this.createLandscapeContainer(),this.setupGraphManager(),this.model.on("change:background_color",this.setBackgroundColor,this)}createLandscapeContainer(){this._landscapeContainer=document.createElement("div"),this._landscapeContainer.id=this.containerId,this._landscapeContainer.style.position="relative",this._landscapeContainer.classList.add("landscape-container"),this.setBackgroundColor(),this.el.appendChild(this._landscapeContainer),this.el.classList.add("custom-widget")}setupGraphManager(){return g(this,void 0,void 0,(function*(){const t=document.getElementById(this.containerId);t&&this.model.multiResolutionGraph?(this.view=yield this.model.multiResolutionGraph.getView(t),this.view.graphManager.zoomInAndOut()):setTimeout((()=>this.setupGraphManager()),100)}))}setBackgroundColor(){const t=this.model.get("background_color");t&&(this.el.style.backgroundColor=t,this._landscapeContainer.style.backgroundColor=t,this._landscapeContainer.style.setProperty("--sigma-background-color",t))}}})(),i})()));
|
|
1
|
+
define("landscape-widget",["@jupyter-widgets/base"],(t=>(()=>{var e={889:(t,e,n)=>{(e=n(352)(!1)).push([t.id,".custom-widget {\n padding: 5px;\n}\n\n.landscape-container {\n height: 100%;\n width: 100%;\n}\n",""]),t.exports=e},134:(t,e,n)=>{(e=n(352)(!1)).push([t.id,".graph-container .controls-container>button{display:flex;justify-content:center;align-items:center;border-radius:4px;border:none;margin:0 4px 0 0;padding:0;background-color:#e2e4e7}.graph-container .controls-container>button:hover{background-color:#cbcdd0}.graph-container .controls-container>button.active{background-color:#bddde8}.graph-container .controls-container>button[data-tooltip]:before{position:absolute;display:none;pointer-events:none;transition:opacity .3s;content:attr(data-tooltip);background-color:#33455f;color:#fff;font-size:1rem;line-height:1.4;border-radius:4px;padding:4px 8px;max-width:300px;margin-bottom:14px;white-space:nowrap;font-weight:500;bottom:100%}.graph-container .controls-container>button[data-tooltip]:hover:before{display:block}.graph-container .controls-container>button[data-tooltip]:last-of-type:before{left:100%;transform:translateX(-100%)}.graph-container .webgl-overlay{font-size:20px;text-align:center;opacity:.9}.graph-container .webgl-overlay>button{font-size:16px;background-color:#007bff;color:#fff;border:none;border-radius:4px}.slider-container{position:absolute;top:0;width:490px;display:flex;border:1px solid #d3d3d3;border-radius:4px;height:40px;box-sizing:border-box}.slider-container .slider-wrapper{display:flex;align-items:center;padding:0 5px}.slider-container .slider-wrapper .slider-label{margin:0;font-size:14px}.slider-container .slider-wrapper .slider{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:110px;height:4px;margin-right:10px;margin-left:5px;border-radius:4px;background:#2196f3;outline:none;cursor:pointer}.slider-container .slider-wrapper .slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:16px;height:16px;background:#2196f3;border-radius:50%}.slider-container .slider-wrapper .slider::-moz-range-thumb{width:16px;height:16px;background:#2196f3;border-radius:50%;border:none}.slider-container .slider-wrapper .slider:hover::-webkit-slider-thumb{background:#1976d2}.slider-container .slider-wrapper .slider:hover::-moz-range-thumb{background:#1976d2}.slider-container .slider-wrapper .slider:hover::-ms-thumb{background:#1976d2}.slider-container .slider-wrapper .slider:active::-webkit-slider-thumb{background:#0d47a1}.slider-container .slider-wrapper .slider:active::-moz-range-thumb{background:#0d47a1}.slider-container .slider-wrapper .slider:active::-ms-thumb{background:#0d47a1}.slider-container .slider-wrapper .slider-value{min-width:20px;text-align:center}\n",""]),t.exports=e},916:function(t){var e;e=()=>(()=>{var t={796:t=>{t.exports=function(t,e){var n=e.length;if(0!==n){var r=t.length;t.length+=n;for(var i=0;i<n;i++)t[r+i]=e[i]}}},187:t=>{"use strict";var e,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};e=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var i=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(n,r){function i(n){t.removeListener(e,o),r(n)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",i),n([].slice.call(arguments))}g(t,e,o,{once:!0}),"error"!==e&&function(t,e,n){"function"==typeof t.on&&g(t,"error",e,{once:!0})}(t,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function s(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function h(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function u(t,e,n,r){var i,o,a,u;if(s(n),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),o=t._events),a=o[e]),void 0===a)a=o[e]=n,++t._eventsCount;else if("function"==typeof a?a=o[e]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(i=h(t))>0&&a.length>i&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=a.length,u=c,console&&console.warn&&console.warn(u)}return t}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=c.bind(r);return i.listener=n,r.wrapFn=i,i}function l(t,e,n){var r=t._events;if(void 0===r)return[];var i=r[e];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(i):f(i,i.length)}function p(t){var e=this._events;if(void 0!==e){var n=e[t];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function f(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}function g(t,e,n,r){if("function"==typeof t.on)r.once?t.once(e,n):t.on(e,n);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function i(o){r.once&&t.removeEventListener(e,i),n(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(t){if("number"!=typeof t||t<0||i(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");a=t}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||i(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},o.prototype.getMaxListeners=function(){return h(this)},o.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var i="error"===t,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var a;if(e.length>0&&(a=e[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var h=o[t];if(void 0===h)return!1;if("function"==typeof h)r(h,this,e);else{var u=h.length,c=f(h,u);for(n=0;n<u;++n)r(c[n],this,e)}return!0},o.prototype.addListener=function(t,e){return u(this,t,e,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(t,e){return u(this,t,e,!0)},o.prototype.once=function(t,e){return s(e),this.on(t,d(this,t,e)),this},o.prototype.prependOnceListener=function(t,e){return s(e),this.prependListener(t,d(this,t,e)),this},o.prototype.removeListener=function(t,e){var n,r,i,o,a;if(s(e),void 0===(r=this._events))return this;if(void 0===(n=r[t]))return this;if(n===e||n.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===e||n[o].listener===e){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(n,i),1===n.length&&(r[t]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",t,a||e)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(t){var e,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[t]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(void 0!==e)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},o.prototype.listeners=function(t){return l(this,t,!0)},o.prototype.rawListeners=function(t){return l(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):p.call(t,e)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},803:(t,e,n)=>{var r=n(186),i=(n(212).B,n(325).De,n(341));e.kS=function(t){var e=[];return function(t,e){if(!r(t))throw new Error("graphology-components: the given graph is not a valid graphology instance.");if(t.order){var n=new i(t),o=n.push.bind(n);n.forEachNodeYetUnseen((function(r){var i,a=[];for(n.push(r);0!==n.size;)i=n.pop(),a.push(i),t.forEachNeighbor(i,o);e(a)}))}}(t,(function(t){e.push(t)})),e}},341:t=>{function e(t){this.graph=t,this.stack=new Array(t.order),this.seen=new Set,this.size=0}e.prototype.hasAlreadySeenEverything=function(){return this.seen.size===this.graph.order},e.prototype.countUnseenNodes=function(){return this.graph.order-this.seen.size},e.prototype.forEachNodeYetUnseen=function(t){var e=this.seen,n=this.graph;n.someNode((function(r,i){return e.size===n.order||!e.has(r)&&!!t(r,i)}))},e.prototype.has=function(t){return this.seen.has(t)},e.prototype.push=function(t){var e=this.seen.size;return this.seen.add(t),e!==this.seen.size&&(this.stack[this.size++]=t,!0)},e.prototype.pushWith=function(t,e){var n=this.seen.size;return this.seen.add(t),n!==this.seen.size&&(this.stack[this.size++]=e,!0)},e.prototype.pop=function(){if(0!==this.size)return this.stack[--this.size]},t.exports=e},847:t=>{t.exports={linLogMode:!1,outboundAttractionDistribution:!1,adjustSizes:!1,edgeWeightInfluence:1,scalingRatio:1,strongGravityMode:!1,gravity:1,slowDown:1,barnesHutOptimize:!1,barnesHutTheta:.5}},739:(t,e)=>{e.assign=function(t){t=t||{};var e,n,r,i=Array.prototype.slice.call(arguments).slice(1);for(e=0,r=i.length;e<r;e++)if(i[e])for(n in i[e])t[n]=i[e][n];return t},e.validateSettings=function(t){return"linLogMode"in t&&"boolean"!=typeof t.linLogMode?{message:"the `linLogMode` setting should be a boolean."}:"outboundAttractionDistribution"in t&&"boolean"!=typeof t.outboundAttractionDistribution?{message:"the `outboundAttractionDistribution` setting should be a boolean."}:"adjustSizes"in t&&"boolean"!=typeof t.adjustSizes?{message:"the `adjustSizes` setting should be a boolean."}:"edgeWeightInfluence"in t&&"number"!=typeof t.edgeWeightInfluence?{message:"the `edgeWeightInfluence` setting should be a number."}:!("scalingRatio"in t)||"number"==typeof t.scalingRatio&&t.scalingRatio>=0?"strongGravityMode"in t&&"boolean"!=typeof t.strongGravityMode?{message:"the `strongGravityMode` setting should be a boolean."}:!("gravity"in t)||"number"==typeof t.gravity&&t.gravity>=0?"slowDown"in t&&!("number"==typeof t.slowDown||t.slowDown>=0)?{message:"the `slowDown` setting should be a number >= 0."}:"barnesHutOptimize"in t&&"boolean"!=typeof t.barnesHutOptimize?{message:"the `barnesHutOptimize` setting should be a boolean."}:!("barnesHutTheta"in t)||"number"==typeof t.barnesHutTheta&&t.barnesHutTheta>=0?null:{message:"the `barnesHutTheta` setting should be a number >= 0."}:{message:"the `gravity` setting should be a number >= 0."}:{message:"the `scalingRatio` setting should be a number >= 0."}},e.graphToByteArrays=function(t,e){var n,r=t.order,i=t.size,o={},a=new Float32Array(10*r),s=new Float32Array(3*i);return n=0,t.forEachNode((function(t,e){o[t]=n,a[n]=e.x,a[n+1]=e.y,a[n+2]=0,a[n+3]=0,a[n+4]=0,a[n+5]=0,a[n+6]=1,a[n+7]=1,a[n+8]=e.size||1,a[n+9]=e.fixed?1:0,n+=10})),n=0,t.forEachEdge((function(t,r,i,h,u,c,d){var l=o[i],p=o[h],f=e(t,r,i,h,u,c,d);a[l+6]+=f,a[p+6]+=f,s[n]=l,s[n+1]=p,s[n+2]=f,n+=3})),{nodes:a,edges:s}},e.assignLayoutChanges=function(t,e,n){var r=0;t.updateEachNodeAttributes((function(t,i){return i.x=e[r],i.y=e[r+1],r+=10,n?n(t,i):i}))},e.readGraphPositions=function(t,e){var n=0;t.forEachNode((function(t,r){e[n]=r.x,e[n+1]=r.y,n+=10}))},e.collectLayoutChanges=function(t,e,n){for(var r=t.nodes(),i={},o=0,a=0,s=e.length;o<s;o+=10){if(n){var h=Object.assign({},t.getNodeAttributes(r[a]));h.x=e[o],h.y=e[o+1],h=n(r[a],h),i[r[a]]={x:h.x,y:h.y}}else i[r[a]]={x:e[o],y:e[o+1]};a++}return i},e.createWorker=function(t){var e=window.URL||window.webkitURL,n=t.toString(),r=e.createObjectURL(new Blob(["("+n+").call(this);"],{type:"text/javascript"})),i=new Worker(r);return e.revokeObjectURL(r),i}},404:(t,e,n)=>{var r=n(186),i=n(308).Q6,o=n(810),a=n(739),s=n(847);function h(t,e,n){if(!r(e))throw new Error("graphology-layout-forceatlas2: the given graph is not a valid graphology instance.");"number"==typeof n&&(n={iterations:n});var h=n.iterations;if("number"!=typeof h)throw new Error("graphology-layout-forceatlas2: invalid number of iterations.");if(h<=0)throw new Error("graphology-layout-forceatlas2: you should provide a positive number of iterations.");var u=i("getEdgeWeight"in n?n.getEdgeWeight:"weight").fromEntry,c="function"==typeof n.outputReducer?n.outputReducer:null,d=a.assign({},s,n.settings),l=a.validateSettings(d);if(l)throw new Error("graphology-layout-forceatlas2: "+l.message);var p,f=a.graphToByteArrays(e,u);for(p=0;p<h;p++)o(d,f.nodes,f.edges);if(!t)return a.collectLayoutChanges(e,f.nodes);a.assignLayoutChanges(e,f.nodes,c)}var u=h.bind(null,!1);u.assign=h.bind(null,!0),u.inferSettings=function(t){var e="number"==typeof t?t:t.order;return{barnesHutOptimize:e>2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(e)}},t.exports=u},810:t=>{var e=10;t.exports=function(t,n,r){var i,o,a,s,h,u,c,d,l,p,f,g,v,y,m,b,w,_,x,C,E,L,S,M=n.length,A=r.length,N=t.adjustSizes,k=t.barnesHutTheta*t.barnesHutTheta,P=[];for(a=0;a<M;a+=e)n[a+4]=n[a+2],n[a+5]=n[a+3],n[a+2]=0,n[a+3]=0;if(t.outboundAttractionDistribution){for(f=0,a=0;a<M;a+=e)f+=n[a+6];f/=M/e}if(t.barnesHutOptimize){var D,G,F,O=1/0,T=-1/0,R=1/0,j=-1/0;for(a=0;a<M;a+=e)O=Math.min(O,n[a+0]),T=Math.max(T,n[a+0]),R=Math.min(R,n[a+1]),j=Math.max(j,n[a+1]);var z=T-O,B=j-R;for(z>B?j=(R-=(z-B)/2)+z:T=(O-=(B-z)/2)+B,P[0]=-1,P[1]=(O+T)/2,P[2]=(R+j)/2,P[3]=Math.max(T-O,j-R),P[4]=-1,P[5]=-1,P[6]=0,P[7]=0,P[8]=0,i=1,a=0;a<M;a+=e)for(o=0,F=3;;){if(!(P[o+5]>=0)){if(P[o+0]<0){P[o+0]=a;break}if(P[o+5]=9*i,d=P[o+3]/2,P[(l=P[o+5])+0]=-1,P[l+1]=P[o+1]-d,P[l+2]=P[o+2]-d,P[l+3]=d,P[l+4]=l+9,P[l+5]=-1,P[l+6]=0,P[l+7]=0,P[l+8]=0,P[(l+=9)+0]=-1,P[l+1]=P[o+1]-d,P[l+2]=P[o+2]+d,P[l+3]=d,P[l+4]=l+9,P[l+5]=-1,P[l+6]=0,P[l+7]=0,P[l+8]=0,P[(l+=9)+0]=-1,P[l+1]=P[o+1]+d,P[l+2]=P[o+2]-d,P[l+3]=d,P[l+4]=l+9,P[l+5]=-1,P[l+6]=0,P[l+7]=0,P[l+8]=0,P[(l+=9)+0]=-1,P[l+1]=P[o+1]+d,P[l+2]=P[o+2]+d,P[l+3]=d,P[l+4]=P[o+4],P[l+5]=-1,P[l+6]=0,P[l+7]=0,P[l+8]=0,i+=4,D=n[P[o+0]+0]<P[o+1]?n[P[o+0]+1]<P[o+2]?P[o+5]:P[o+5]+9:n[P[o+0]+1]<P[o+2]?P[o+5]+18:P[o+5]+27,P[o+6]=n[P[o+0]+6],P[o+7]=n[P[o+0]+0],P[o+8]=n[P[o+0]+1],P[D+0]=P[o+0],P[o+0]=-1,D===(G=n[a+0]<P[o+1]?n[a+1]<P[o+2]?P[o+5]:P[o+5]+9:n[a+1]<P[o+2]?P[o+5]+18:P[o+5]+27)){if(F--){o=D;continue}F=3;break}P[G+0]=a;break}D=n[a+0]<P[o+1]?n[a+1]<P[o+2]?P[o+5]:P[o+5]+9:n[a+1]<P[o+2]?P[o+5]+18:P[o+5]+27,P[o+7]=(P[o+7]*P[o+6]+n[a+0]*n[a+6])/(P[o+6]+n[a+6]),P[o+8]=(P[o+8]*P[o+6]+n[a+1]*n[a+6])/(P[o+6]+n[a+6]),P[o+6]+=n[a+6],o=D}}if(t.barnesHutOptimize){for(g=t.scalingRatio,a=0;a<M;a+=e)for(o=0;;)if(P[o+5]>=0){if(b=Math.pow(n[a+0]-P[o+7],2)+Math.pow(n[a+1]-P[o+8],2),4*(p=P[o+3])*p/b<k){if(v=n[a+0]-P[o+7],y=n[a+1]-P[o+8],!0===N?b>0?(w=g*n[a+6]*P[o+6]/b,n[a+2]+=v*w,n[a+3]+=y*w):b<0&&(w=-g*n[a+6]*P[o+6]/Math.sqrt(b),n[a+2]+=v*w,n[a+3]+=y*w):b>0&&(w=g*n[a+6]*P[o+6]/b,n[a+2]+=v*w,n[a+3]+=y*w),(o=P[o+4])<0)break;continue}o=P[o+5]}else if((u=P[o+0])>=0&&u!==a&&(b=(v=n[a+0]-n[u+0])*v+(y=n[a+1]-n[u+1])*y,!0===N?b>0?(w=g*n[a+6]*n[u+6]/b,n[a+2]+=v*w,n[a+3]+=y*w):b<0&&(w=-g*n[a+6]*n[u+6]/Math.sqrt(b),n[a+2]+=v*w,n[a+3]+=y*w):b>0&&(w=g*n[a+6]*n[u+6]/b,n[a+2]+=v*w,n[a+3]+=y*w)),(o=P[o+4])<0)break}else for(g=t.scalingRatio,s=0;s<M;s+=e)for(h=0;h<s;h+=e)v=n[s+0]-n[h+0],y=n[s+1]-n[h+1],!0===N?(b=Math.sqrt(v*v+y*y)-n[s+8]-n[h+8])>0?(w=g*n[s+6]*n[h+6]/b/b,n[s+2]+=v*w,n[s+3]+=y*w,n[h+2]-=v*w,n[h+3]-=y*w):b<0&&(w=100*g*n[s+6]*n[h+6],n[s+2]+=v*w,n[s+3]+=y*w,n[h+2]-=v*w,n[h+3]-=y*w):(b=Math.sqrt(v*v+y*y))>0&&(w=g*n[s+6]*n[h+6]/b/b,n[s+2]+=v*w,n[s+3]+=y*w,n[h+2]-=v*w,n[h+3]-=y*w);for(l=t.gravity/t.scalingRatio,g=t.scalingRatio,a=0;a<M;a+=e)w=0,v=n[a+0],y=n[a+1],b=Math.sqrt(Math.pow(v,2)+Math.pow(y,2)),t.strongGravityMode?b>0&&(w=g*n[a+6]*l):b>0&&(w=g*n[a+6]*l/b),n[a+2]-=v*w,n[a+3]-=y*w;for(g=1*(t.outboundAttractionDistribution?f:1),c=0;c<A;c+=3)s=r[c+0],h=r[c+1],d=r[c+2],m=Math.pow(d,t.edgeWeightInfluence),v=n[s+0]-n[h+0],y=n[s+1]-n[h+1],!0===N?(b=Math.sqrt(v*v+y*y)-n[s+8]-n[h+8],t.linLogMode?t.outboundAttractionDistribution?b>0&&(w=-g*m*Math.log(1+b)/b/n[s+6]):b>0&&(w=-g*m*Math.log(1+b)/b):t.outboundAttractionDistribution?b>0&&(w=-g*m/n[s+6]):b>0&&(w=-g*m)):(b=Math.sqrt(Math.pow(v,2)+Math.pow(y,2)),t.linLogMode?t.outboundAttractionDistribution?b>0&&(w=-g*m*Math.log(1+b)/b/n[s+6]):b>0&&(w=-g*m*Math.log(1+b)/b):t.outboundAttractionDistribution?(b=1,w=-g*m/n[s+6]):(b=1,w=-g*m)),b>0&&(n[s+2]+=v*w,n[s+3]+=y*w,n[h+2]-=v*w,n[h+3]-=y*w);if(!0===N)for(a=0;a<M;a+=e)1!==n[a+9]&&((_=Math.sqrt(Math.pow(n[a+2],2)+Math.pow(n[a+3],2)))>10&&(n[a+2]=10*n[a+2]/_,n[a+3]=10*n[a+3]/_),x=n[a+6]*Math.sqrt((n[a+4]-n[a+2])*(n[a+4]-n[a+2])+(n[a+5]-n[a+3])*(n[a+5]-n[a+3])),C=Math.sqrt((n[a+4]+n[a+2])*(n[a+4]+n[a+2])+(n[a+5]+n[a+3])*(n[a+5]+n[a+3]))/2,E=.1*Math.log(1+C)/(1+Math.sqrt(x)),L=n[a+0]+n[a+2]*(E/t.slowDown),n[a+0]=L,S=n[a+1]+n[a+3]*(E/t.slowDown),n[a+1]=S);else for(a=0;a<M;a+=e)1!==n[a+9]&&(x=n[a+6]*Math.sqrt((n[a+4]-n[a+2])*(n[a+4]-n[a+2])+(n[a+5]-n[a+3])*(n[a+5]-n[a+3])),C=Math.sqrt((n[a+4]+n[a+2])*(n[a+4]+n[a+2])+(n[a+5]+n[a+3])*(n[a+5]+n[a+3]))/2,E=n[a+7]*Math.log(1+C)/(1+Math.sqrt(x)),n[a+7]=Math.min(1,Math.sqrt(E*(Math.pow(n[a+2],2)+Math.pow(n[a+3],2))/(1+Math.sqrt(x)))),L=n[a+0]+n[a+2]*(E/t.slowDown),n[a+0]=L,S=n[a+1]+n[a+3]*(E/t.slowDown),n[a+1]=S);return{}}},325:(t,e)=>{e.De=function(t,e,n,r,i,o){return o=Object.assign({},o),e?null==n?t.addUndirectedEdge(r,i,o):t.addUndirectedEdgeWithKey(n,r,i,o):null==n?t.addDirectedEdge(r,i,o):t.addDirectedEdgeWithKey(n,r,i,o)}},212:(t,e)=>{e.B=function(t,e,n){return n=Object.assign({},n),t.addNode(e,n)}},308:(t,e)=>{function n(t){return"number"!=typeof t||isNaN(t)?1:t}e.Q6=function(t){return function(t,e){var n={},r=function(t){return void 0===t?e:t};"function"==typeof e&&(r=e);var i=function(e){return r(e[t])},o=function(){return r(void 0)};return"string"==typeof t?(n.fromAttributes=i,n.fromGraph=function(t,e){return i(t.getEdgeAttributes(e))},n.fromEntry=function(t,e){return i(e)},n.fromPartialEntry=n.fromEntry,n.fromMinimalEntry=n.fromEntry):"function"==typeof t?(n.fromAttributes=function(){throw new Error("graphology-utils/getters/createEdgeValueGetter: irrelevant usage.")},n.fromGraph=function(e,n){var i=e.extremities(n);return r(t(n,e.getEdgeAttributes(n),i[0],i[1],e.getNodeAttributes(i[0]),e.getNodeAttributes(i[1]),e.isUndirected(n)))},n.fromEntry=function(e,n,i,o,a,s,h){return r(t(e,n,i,o,a,s,h))},n.fromPartialEntry=function(e,n,i,o){return r(t(e,n,i,o))},n.fromMinimalEntry=function(e,n){return r(t(e,n))}):(n.fromAttributes=o,n.fromGraph=o,n.fromEntry=o,n.fromMinimalEntry=o),n}(t,n)}},186:t=>{t.exports=function(t){return null!==t&&"object"==typeof t&&"function"==typeof t.addUndirectedEdgeWithKey&&"function"==typeof t.dropNode&&"boolean"==typeof t.multi}},698:function(t){t.exports=function(){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,r(t,e)}function n(t){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},n(t)}function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}function i(t,e,n){return i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}()?Reflect.construct.bind():function(t,e,n){var i=[null];i.push.apply(i,e);var o=new(Function.bind.apply(t,i));return n&&r(o,n.prototype),o},i.apply(null,arguments)}function o(t){var e="function"==typeof Map?new Map:void 0;return o=function(t){if(null===t||(o=t,-1===Function.toString.call(o).indexOf("[native code]")))return t;var o;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,a)}function a(){return i(t,arguments,n(this).constructor)}return a.prototype=Object.create(t.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),r(a,t)},o(t)}function a(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var s=function(){for(var t=arguments[0],e=1,n=arguments.length;e<n;e++)if(arguments[e])for(var r in arguments[e])t[r]=arguments[e][r];return t};function h(t,e,n,r){var i=t._nodes.get(e),o=null;return i?o="mixed"===r?i.out&&i.out[n]||i.undirected&&i.undirected[n]:"directed"===r?i.out&&i.out[n]:i.undirected&&i.undirected[n]:o}function u(e){return"object"===t(e)&&null!==e}function c(t){var e;for(e in t)return!1;return!0}function d(t,e,n){Object.defineProperty(t,e,{enumerable:!1,configurable:!1,writable:!0,value:n})}function l(t,e,n){var r={enumerable:!0,configurable:!0};"function"==typeof n?r.get=n:(r.value=n,r.writable=!1),Object.defineProperty(t,e,r)}function p(t){return!(!u(t)||t.attributes&&!Array.isArray(t.attributes))}"function"==typeof Object.assign&&(s=Object.assign);var f,g={exports:{}},v="object"==typeof Reflect?Reflect:null,y=v&&"function"==typeof v.apply?v.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};f=v&&"function"==typeof v.ownKeys?v.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var m=Number.isNaN||function(t){return t!=t};function b(){b.init.call(this)}g.exports=b,g.exports.once=function(t,e){return new Promise((function(n,r){function i(n){t.removeListener(e,o),r(n)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",i),n([].slice.call(arguments))}N(t,e,o,{once:!0}),"error"!==e&&function(t,e,n){"function"==typeof t.on&&N(t,"error",e,{once:!0})}(t,i)}))},b.EventEmitter=b,b.prototype._events=void 0,b.prototype._eventsCount=0,b.prototype._maxListeners=void 0;var w=10;function _(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function x(t){return void 0===t._maxListeners?b.defaultMaxListeners:t._maxListeners}function C(t,e,n,r){var i,o,a,s;if(_(n),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),o=t._events),a=o[e]),void 0===a)a=o[e]=n,++t._eventsCount;else if("function"==typeof a?a=o[e]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(i=x(t))>0&&a.length>i&&!a.warned){a.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=t,h.type=e,h.count=a.length,s=h,console&&console.warn&&console.warn(s)}return t}function E(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function L(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=E.bind(r);return i.listener=n,r.wrapFn=i,i}function S(t,e,n){var r=t._events;if(void 0===r)return[];var i=r[e];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(i):A(i,i.length)}function M(t){var e=this._events;if(void 0!==e){var n=e[t];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function A(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}function N(t,e,n,r){if("function"==typeof t.on)r.once?t.once(e,n):t.on(e,n);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function i(o){r.once&&t.removeEventListener(e,i),n(o)}))}}function k(t){if("function"!=typeof t)throw new Error("obliterator/iterator: expecting a function!");this.next=t}Object.defineProperty(b,"defaultMaxListeners",{enumerable:!0,get:function(){return w},set:function(t){if("number"!=typeof t||t<0||m(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");w=t}}),b.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},b.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||m(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},b.prototype.getMaxListeners=function(){return x(this)},b.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var r="error"===t,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var s=i[t];if(void 0===s)return!1;if("function"==typeof s)y(s,this,e);else{var h=s.length,u=A(s,h);for(n=0;n<h;++n)y(u[n],this,e)}return!0},b.prototype.addListener=function(t,e){return C(this,t,e,!1)},b.prototype.on=b.prototype.addListener,b.prototype.prependListener=function(t,e){return C(this,t,e,!0)},b.prototype.once=function(t,e){return _(e),this.on(t,L(this,t,e)),this},b.prototype.prependOnceListener=function(t,e){return _(e),this.prependListener(t,L(this,t,e)),this},b.prototype.removeListener=function(t,e){var n,r,i,o,a;if(_(e),void 0===(r=this._events))return this;if(void 0===(n=r[t]))return this;if(n===e||n.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===e||n[o].listener===e){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(n,i),1===n.length&&(r[t]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",t,a||e)}return this},b.prototype.off=b.prototype.removeListener,b.prototype.removeAllListeners=function(t){var e,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[t]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(void 0!==e)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},b.prototype.listeners=function(t){return S(this,t,!0)},b.prototype.rawListeners=function(t){return S(this,t,!1)},b.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):M.call(t,e)},b.prototype.listenerCount=M,b.prototype.eventNames=function(){return this._eventsCount>0?f(this._events):[]},"undefined"!=typeof Symbol&&(k.prototype[Symbol.iterator]=function(){return this}),k.of=function(){var t=arguments,e=t.length,n=0;return new k((function(){return n>=e?{done:!0}:{done:!1,value:t[n++]}}))},k.empty=function(){return new k((function(){return{done:!0}}))},k.fromSequence=function(t){var e=0,n=t.length;return new k((function(){return e>=n?{done:!0}:{done:!1,value:t[e++]}}))},k.is=function(t){return t instanceof k||"object"==typeof t&&null!==t&&"function"==typeof t.next};var P=k,D={};D.ARRAY_BUFFER_SUPPORT="undefined"!=typeof ArrayBuffer,D.SYMBOL_SUPPORT="undefined"!=typeof Symbol;var G=P,F=D,O=F.ARRAY_BUFFER_SUPPORT,T=F.SYMBOL_SUPPORT,R=function(t){var e=function(t){return"string"==typeof t||Array.isArray(t)||O&&ArrayBuffer.isView(t)?G.fromSequence(t):"object"!=typeof t||null===t?null:T&&"function"==typeof t[Symbol.iterator]?t[Symbol.iterator]():"function"==typeof t.next?t:null}(t);if(!e)throw new Error("obliterator: target is not iterable nor a valid iterator.");return e},j=R,z=function(t,e){for(var n,r=arguments.length>1?e:1/0,i=r!==1/0?new Array(r):[],o=0,a=j(t);;){if(o===r)return i;if((n=a.next()).done)return o!==e&&(i.length=o),i;i[o++]=n.value}},B=function(t){function n(e){var n;return(n=t.call(this)||this).name="GraphError",n.message=e,n}return e(n,t),n}(o(Error)),U=function(t){function n(e){var r;return(r=t.call(this,e)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(a(r),n.prototype.constructor),r}return e(n,t),n}(B),I=function(t){function n(e){var r;return(r=t.call(this,e)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(a(r),n.prototype.constructor),r}return e(n,t),n}(B),H=function(t){function n(e){var r;return(r=t.call(this,e)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(a(r),n.prototype.constructor),r}return e(n,t),n}(B);function W(t,e){this.key=t,this.attributes=e,this.clear()}function V(t,e){this.key=t,this.attributes=e,this.clear()}function q(t,e){this.key=t,this.attributes=e,this.clear()}function Z(t,e,n,r,i){this.key=e,this.attributes=i,this.undirected=t,this.source=n,this.target=r}function Y(t,e,n,r,i,o,a){var s,h,u,c;if(r=""+r,0===n){if(!(s=t._nodes.get(r)))throw new I("Graph.".concat(e,': could not find the "').concat(r,'" node in the graph.'));u=i,c=o}else if(3===n){if(i=""+i,!(h=t._edges.get(i)))throw new I("Graph.".concat(e,': could not find the "').concat(i,'" edge in the graph.'));var d=h.source.key,l=h.target.key;if(r===d)s=h.target;else{if(r!==l)throw new I("Graph.".concat(e,': the "').concat(r,'" node is not attached to the "').concat(i,'" edge (').concat(d,", ").concat(l,")."));s=h.source}u=o,c=a}else{if(!(h=t._edges.get(r)))throw new I("Graph.".concat(e,': could not find the "').concat(r,'" edge in the graph.'));s=1===n?h.source:h.target,u=i,c=o}return[s,u,c]}W.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}},V.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}},q.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}},Z.prototype.attach=function(){var t="out",e="in";this.undirected&&(t=e="undirected");var n=this.source.key,r=this.target.key;this.source[t][r]=this,this.undirected&&n===r||(this.target[e][n]=this)},Z.prototype.attachMulti=function(){var t="out",e="in",n=this.source.key,r=this.target.key;this.undirected&&(t=e="undirected");var i=this.source[t],o=i[r];if(void 0===o)return i[r]=this,void(this.undirected&&n===r||(this.target[e][n]=this));o.previous=this,this.next=o,i[r]=this,this.target[e][n]=this},Z.prototype.detach=function(){var t=this.source.key,e=this.target.key,n="out",r="in";this.undirected&&(n=r="undirected"),delete this.source[n][e],delete this.target[r][t]},Z.prototype.detachMulti=function(){var t=this.source.key,e=this.target.key,n="out",r="in";this.undirected&&(n=r="undirected"),void 0===this.previous?void 0===this.next?(delete this.source[n][e],delete this.target[r][t]):(this.next.previous=void 0,this.source[n][e]=this.next,this.target[r][t]=this.next):(this.previous.next=this.next,void 0!==this.next&&(this.next.previous=this.previous))};var K=[{name:function(t){return"get".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o=Y(this,e,n,t,r,i),a=o[0],s=o[1];return a.attributes[s]}}},{name:function(t){return"get".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,r){return Y(this,e,n,t,r)[0].attributes}}},{name:function(t){return"has".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o=Y(this,e,n,t,r,i),a=o[0],s=o[1];return a.attributes.hasOwnProperty(s)}}},{name:function(t){return"set".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i,o){var a=Y(this,e,n,t,r,i,o),s=a[0],h=a[1],u=a[2];return s.attributes[h]=u,this.emit("nodeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:h}),this}}},{name:function(t){return"update".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i,o){var a=Y(this,e,n,t,r,i,o),s=a[0],h=a[1],u=a[2];if("function"!=typeof u)throw new U("Graph.".concat(e,": updater should be a function."));var c=s.attributes,d=u(c[h]);return c[h]=d,this.emit("nodeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:h}),this}}},{name:function(t){return"remove".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o=Y(this,e,n,t,r,i),a=o[0],s=o[1];return delete a.attributes[s],this.emit("nodeAttributesUpdated",{key:a.key,type:"remove",attributes:a.attributes,name:s}),this}}},{name:function(t){return"replace".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o=Y(this,e,n,t,r,i),a=o[0],s=o[1];if(!u(s))throw new U("Graph.".concat(e,": provided attributes are not a plain object."));return a.attributes=s,this.emit("nodeAttributesUpdated",{key:a.key,type:"replace",attributes:a.attributes}),this}}},{name:function(t){return"merge".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o=Y(this,e,n,t,r,i),a=o[0],h=o[1];if(!u(h))throw new U("Graph.".concat(e,": provided attributes are not a plain object."));return s(a.attributes,h),this.emit("nodeAttributesUpdated",{key:a.key,type:"merge",attributes:a.attributes,data:h}),this}}},{name:function(t){return"update".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o=Y(this,e,n,t,r,i),a=o[0],s=o[1];if("function"!=typeof s)throw new U("Graph.".concat(e,": provided updater is not a function."));return a.attributes=s(a.attributes),this.emit("nodeAttributesUpdated",{key:a.key,type:"update",attributes:a.attributes}),this}}}],X=[{name:function(t){return"get".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new H("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new H("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+r;if(r=arguments[2],!(i=h(this,o,a,n)))throw new I("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else{if("mixed"!==n)throw new H("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(i=this._edges.get(t)))throw new I("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}return i.attributes[r]}}},{name:function(t){return"get".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new H("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new H("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var i=""+t,o=""+arguments[1];if(!(r=h(this,i,o,n)))throw new I("Graph.".concat(e,': could not find an edge for the given path ("').concat(i,'" - "').concat(o,'").'))}else{if("mixed"!==n)throw new H("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(r=this._edges.get(t)))throw new I("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}return r.attributes}}},{name:function(t){return"has".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new H("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new H("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+r;if(r=arguments[2],!(i=h(this,o,a,n)))throw new I("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else{if("mixed"!==n)throw new H("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(i=this._edges.get(t)))throw new I("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}return i.attributes.hasOwnProperty(r)}}},{name:function(t){return"set".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new H("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new H("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+t,s=""+r;if(r=arguments[2],i=arguments[3],!(o=h(this,a,s,n)))throw new I("Graph.".concat(e,': could not find an edge for the given path ("').concat(a,'" - "').concat(s,'").'))}else{if("mixed"!==n)throw new H("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(o=this._edges.get(t)))throw new I("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}return o.attributes[r]=i,this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:r}),this}}},{name:function(t){return"update".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new H("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new H("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+t,s=""+r;if(r=arguments[2],i=arguments[3],!(o=h(this,a,s,n)))throw new I("Graph.".concat(e,': could not find an edge for the given path ("').concat(a,'" - "').concat(s,'").'))}else{if("mixed"!==n)throw new H("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(o=this._edges.get(t)))throw new I("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}if("function"!=typeof i)throw new U("Graph.".concat(e,": updater should be a function."));return o.attributes[r]=i(o.attributes[r]),this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:r}),this}}},{name:function(t){return"remove".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new H("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new H("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+r;if(r=arguments[2],!(i=h(this,o,a,n)))throw new I("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else{if("mixed"!==n)throw new H("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(i=this._edges.get(t)))throw new I("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}return delete i.attributes[r],this.emit("edgeAttributesUpdated",{key:i.key,type:"remove",attributes:i.attributes,name:r}),this}}},{name:function(t){return"replace".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new H("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new H("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+r;if(r=arguments[2],!(i=h(this,o,a,n)))throw new I("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else{if("mixed"!==n)throw new H("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(i=this._edges.get(t)))throw new I("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}if(!u(r))throw new U("Graph.".concat(e,": provided attributes are not a plain object."));return i.attributes=r,this.emit("edgeAttributesUpdated",{key:i.key,type:"replace",attributes:i.attributes}),this}}},{name:function(t){return"merge".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new H("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new H("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+r;if(r=arguments[2],!(i=h(this,o,a,n)))throw new I("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else{if("mixed"!==n)throw new H("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(i=this._edges.get(t)))throw new I("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}if(!u(r))throw new U("Graph.".concat(e,": provided attributes are not a plain object."));return s(i.attributes,r),this.emit("edgeAttributesUpdated",{key:i.key,type:"merge",attributes:i.attributes,data:r}),this}}},{name:function(t){return"update".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new H("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new H("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+r;if(r=arguments[2],!(i=h(this,o,a,n)))throw new I("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else{if("mixed"!==n)throw new H("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(i=this._edges.get(t)))throw new I("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}if("function"!=typeof r)throw new U("Graph.".concat(e,": provided updater is not a function."));return i.attributes=r(i.attributes),this.emit("edgeAttributesUpdated",{key:i.key,type:"update",attributes:i.attributes}),this}}}],Q=P,J=R,$=function(){var t=arguments,e=null,n=-1;return new Q((function(){for(var r=null;;){if(null===e){if(++n>=t.length)return{done:!0};e=J(t[n])}if(!0!==(r=e.next()).done)break;e=null}return r}))},tt=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function et(t,e,n,r){var i=!1;for(var o in e)if(o!==r){var a=e[o];if(i=n(a.key,a.attributes,a.source.key,a.target.key,a.source.attributes,a.target.attributes,a.undirected),t&&i)return a.key}}function nt(t,e,n,r){var i,o,a,s=!1;for(var h in e)if(h!==r){i=e[h];do{if(o=i.source,a=i.target,s=n(i.key,i.attributes,o.key,a.key,o.attributes,a.attributes,i.undirected),t&&s)return i.key;i=i.next}while(void 0!==i)}}function rt(t,e){var n,r=Object.keys(t),i=r.length,o=0;return new P((function(){do{if(n)n=n.next;else{if(o>=i)return{done:!0};var a=r[o++];if(a===e){n=void 0;continue}n=t[a]}}while(!n);return{done:!1,value:{edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected}}}))}function it(t,e,n,r){var i=e[n];if(i){var o=i.source,a=i.target;return r(i.key,i.attributes,o.key,a.key,o.attributes,a.attributes,i.undirected)&&t?i.key:void 0}}function ot(t,e,n,r){var i=e[n];if(i){var o=!1;do{if(o=r(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected),t&&o)return i.key;i=i.next}while(void 0!==i)}}function at(t,e){var n=t[e];return void 0!==n.next?new P((function(){if(!n)return{done:!0};var t={edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected};return n=n.next,{done:!1,value:t}})):P.of({edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected})}function st(t,e,n,r){if(0!==e.size)for(var i,o,a="mixed"!==n&&n!==e.type,s="undirected"===n,h=!1,u=e._edges.values();!0!==(i=u.next()).done;)if(o=i.value,!a||o.undirected===s){var c=o,d=c.key,l=c.attributes,p=c.source,f=c.target;if(h=r(d,l,p.key,f.key,p.attributes,f.attributes,o.undirected),t&&h)return d}}function ht(t,e,n,r,i,o){var a,s=e?nt:et;if("undirected"!==n){if("out"!==r&&(a=s(t,i.in,o),t&&a))return a;if("in"!==r&&(a=s(t,i.out,o,r?void 0:i.key),t&&a))return a}if("directed"!==n&&(a=s(t,i.undirected,o),t&&a))return a}function ut(t,e,n,r,i,o,a){var s,h=n?ot:it;if("undirected"!==e){if(void 0!==i.in&&"out"!==r&&(s=h(t,i.in,o,a),t&&s))return s;if(void 0!==i.out&&"in"!==r&&(r||i.key!==o)&&(s=h(t,i.out,o,a),t&&s))return s}if("directed"!==e&&void 0!==i.undirected&&(s=h(t,i.undirected,o,a),t&&s))return s}var ct=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function dt(){this.A=null,this.B=null}function lt(t,e,n,r,i){for(var o in r){var a=r[o],s=a.source,h=a.target,u=s===n?h:s;if(!e||!e.has(u.key)){var c=i(u.key,u.attributes);if(t&&c)return u.key}}}function pt(t,e,n,r,i){if("mixed"!==e){if("undirected"===e)return lt(t,null,r,r.undirected,i);if("string"==typeof n)return lt(t,null,r,r[n],i)}var o,a=new dt;if("undirected"!==e){if("out"!==n){if(o=lt(t,null,r,r.in,i),t&&o)return o;a.wrap(r.in)}if("in"!==n){if(o=lt(t,a,r,r.out,i),t&&o)return o;a.wrap(r.out)}}if("directed"!==e&&(o=lt(t,a,r,r.undirected,i),t&&o))return o}function ft(t,e,n){var r=Object.keys(n),i=r.length,o=0;return new P((function(){var a=null;do{if(o>=i)return t&&t.wrap(n),{done:!0};var s=n[r[o++]],h=s.source,u=s.target;a=h===e?u:h,t&&t.has(a.key)&&(a=null)}while(null===a);return{done:!1,value:{neighbor:a.key,attributes:a.attributes}}}))}function gt(t,e,n,r,i){for(var o,a,s,h,u,c,d,l=r._nodes.values(),p=r.type;!0!==(o=l.next()).done;){var f=!1;if(a=o.value,"undirected"!==p)for(s in h=a.out){u=h[s];do{if(c=u.target,f=!0,d=i(a.key,c.key,a.attributes,c.attributes,u.key,u.attributes,u.undirected),t&&d)return u;u=u.next}while(u)}if("directed"!==p)for(s in h=a.undirected)if(!(e&&a.key>s)){u=h[s];do{if((c=u.target).key!==s&&(c=u.source),f=!0,d=i(a.key,c.key,a.attributes,c.attributes,u.key,u.attributes,u.undirected),t&&d)return u;u=u.next}while(u)}if(n&&!f&&(d=i(a.key,null,a.attributes,null,null,null,null),t&&d))return null}}function vt(t){if(!u(t))throw new U('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in t))throw new U("Graph.import: serialized node is missing its key.");if("attributes"in t&&(!u(t.attributes)||null===t.attributes))throw new U("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function yt(t){if(!u(t))throw new U('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in t))throw new U("Graph.import: serialized edge is missing its source.");if(!("target"in t))throw new U("Graph.import: serialized edge is missing its target.");if("attributes"in t&&(!u(t.attributes)||null===t.attributes))throw new U("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in t&&"boolean"!=typeof t.undirected)throw new U("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}dt.prototype.wrap=function(t){null===this.A?this.A=t:null===this.B&&(this.B=t)},dt.prototype.has=function(t){return null!==this.A&&t in this.A||null!==this.B&&t in this.B};var mt,bt=(mt=255&Math.floor(256*Math.random()),function(){return mt++}),wt=new Set(["directed","undirected","mixed"]),_t=new Set(["domain","_events","_eventsCount","_maxListeners"]),xt={allowSelfLoops:!0,multi:!1,type:"mixed"};function Ct(t,e,n){var r=new t.NodeDataClass(e,n);return t._nodes.set(e,r),t.emit("nodeAdded",{key:e,attributes:n}),r}function Et(t,e,n,r,i,o,a,s){if(!r&&"undirected"===t.type)throw new H("Graph.".concat(e,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(r&&"directed"===t.type)throw new H("Graph.".concat(e,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(s&&!u(s))throw new U("Graph.".concat(e,': invalid attributes. Expecting an object but got "').concat(s,'"'));if(o=""+o,a=""+a,s=s||{},!t.allowSelfLoops&&o===a)throw new H("Graph.".concat(e,': source & target are the same ("').concat(o,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var h=t._nodes.get(o),c=t._nodes.get(a);if(!h)throw new I("Graph.".concat(e,': source node "').concat(o,'" not found.'));if(!c)throw new I("Graph.".concat(e,': target node "').concat(a,'" not found.'));var d={key:null,undirected:r,source:o,target:a,attributes:s};if(n)i=t._edgeKeyGenerator();else if(i=""+i,t._edges.has(i))throw new H("Graph.".concat(e,': the "').concat(i,'" edge already exists in the graph.'));if(!t.multi&&(r?void 0!==h.undirected[a]:void 0!==h.out[a]))throw new H("Graph.".concat(e,': an edge linking "').concat(o,'" to "').concat(a,"\" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option."));var l=new Z(r,i,h,c,s);t._edges.set(i,l);var p=o===a;return r?(h.undirectedDegree++,c.undirectedDegree++,p&&(h.undirectedLoops++,t._undirectedSelfLoopCount++)):(h.outDegree++,c.inDegree++,p&&(h.directedLoops++,t._directedSelfLoopCount++)),t.multi?l.attachMulti():l.attach(),r?t._undirectedSize++:t._directedSize++,d.key=i,t.emit("edgeAdded",d),i}function Lt(t,e,n,r,i,o,a,h,c){if(!r&&"undirected"===t.type)throw new H("Graph.".concat(e,": you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead."));if(r&&"directed"===t.type)throw new H("Graph.".concat(e,": you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead."));if(h)if(c){if("function"!=typeof h)throw new U("Graph.".concat(e,': invalid updater function. Expecting a function but got "').concat(h,'"'))}else if(!u(h))throw new U("Graph.".concat(e,': invalid attributes. Expecting an object but got "').concat(h,'"'));var d;if(o=""+o,a=""+a,c&&(d=h,h=void 0),!t.allowSelfLoops&&o===a)throw new H("Graph.".concat(e,': source & target are the same ("').concat(o,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var l,p,f=t._nodes.get(o),g=t._nodes.get(a);if(!n&&(l=t._edges.get(i))){if(!(l.source.key===o&&l.target.key===a||r&&l.source.key===a&&l.target.key===o))throw new H("Graph.".concat(e,': inconsistency detected when attempting to merge the "').concat(i,'" edge with "').concat(o,'" source & "').concat(a,'" target vs. ("').concat(l.source.key,'", "').concat(l.target.key,'").'));p=l}if(p||t.multi||!f||(p=r?f.undirected[a]:f.out[a]),p){var v=[p.key,!1,!1,!1];if(c?!d:!h)return v;if(c){var y=p.attributes;p.attributes=d(y),t.emit("edgeAttributesUpdated",{type:"replace",key:p.key,attributes:p.attributes})}else s(p.attributes,h),t.emit("edgeAttributesUpdated",{type:"merge",key:p.key,attributes:p.attributes,data:h});return v}h=h||{},c&&d&&(h=d(h));var m={key:null,undirected:r,source:o,target:a,attributes:h};if(n)i=t._edgeKeyGenerator();else if(i=""+i,t._edges.has(i))throw new H("Graph.".concat(e,': the "').concat(i,'" edge already exists in the graph.'));var b=!1,w=!1;f||(f=Ct(t,o,{}),b=!0,o===a&&(g=f,w=!0)),g||(g=Ct(t,a,{}),w=!0),l=new Z(r,i,f,g,h),t._edges.set(i,l);var _=o===a;return r?(f.undirectedDegree++,g.undirectedDegree++,_&&(f.undirectedLoops++,t._undirectedSelfLoopCount++)):(f.outDegree++,g.inDegree++,_&&(f.directedLoops++,t._directedSelfLoopCount++)),t.multi?l.attachMulti():l.attach(),r?t._undirectedSize++:t._directedSize++,m.key=i,t.emit("edgeAdded",m),[i,!0,b,w]}function St(t,e){t._edges.delete(e.key);var n=e.source,r=e.target,i=e.attributes,o=e.undirected,a=n===r;o?(n.undirectedDegree--,r.undirectedDegree--,a&&(n.undirectedLoops--,t._undirectedSelfLoopCount--)):(n.outDegree--,r.inDegree--,a&&(n.directedLoops--,t._directedSelfLoopCount--)),t.multi?e.detachMulti():e.detach(),o?t._undirectedSize--:t._directedSize--,t.emit("edgeDropped",{key:e.key,attributes:i,source:n.key,target:r.key,undirected:o})}var Mt=function(n){function r(t){var e;if(e=n.call(this)||this,"boolean"!=typeof(t=s({},xt,t)).multi)throw new U("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(t.multi,'".'));if(!wt.has(t.type))throw new U('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(t.type,'".'));if("boolean"!=typeof t.allowSelfLoops)throw new U("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(t.allowSelfLoops,'".'));var r="mixed"===t.type?W:"directed"===t.type?V:q;d(a(e),"NodeDataClass",r);var i="geid_"+bt()+"_",o=0;return d(a(e),"_attributes",{}),d(a(e),"_nodes",new Map),d(a(e),"_edges",new Map),d(a(e),"_directedSize",0),d(a(e),"_undirectedSize",0),d(a(e),"_directedSelfLoopCount",0),d(a(e),"_undirectedSelfLoopCount",0),d(a(e),"_edgeKeyGenerator",(function(){var t;do{t=i+o++}while(e._edges.has(t));return t})),d(a(e),"_options",t),_t.forEach((function(t){return d(a(e),t,e[t])})),l(a(e),"order",(function(){return e._nodes.size})),l(a(e),"size",(function(){return e._edges.size})),l(a(e),"directedSize",(function(){return e._directedSize})),l(a(e),"undirectedSize",(function(){return e._undirectedSize})),l(a(e),"selfLoopCount",(function(){return e._directedSelfLoopCount+e._undirectedSelfLoopCount})),l(a(e),"directedSelfLoopCount",(function(){return e._directedSelfLoopCount})),l(a(e),"undirectedSelfLoopCount",(function(){return e._undirectedSelfLoopCount})),l(a(e),"multi",e._options.multi),l(a(e),"type",e._options.type),l(a(e),"allowSelfLoops",e._options.allowSelfLoops),l(a(e),"implementation",(function(){return"graphology"})),e}e(r,n);var i=r.prototype;return i._resetInstanceCounters=function(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0},i.hasNode=function(t){return this._nodes.has(""+t)},i.hasDirectedEdge=function(t,e){if("undirected"===this.type)return!1;if(1===arguments.length){var n=""+t,r=this._edges.get(n);return!!r&&!r.undirected}if(2===arguments.length){t=""+t,e=""+e;var i=this._nodes.get(t);return!!i&&i.out.hasOwnProperty(e)}throw new U("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.hasUndirectedEdge=function(t,e){if("directed"===this.type)return!1;if(1===arguments.length){var n=""+t,r=this._edges.get(n);return!!r&&r.undirected}if(2===arguments.length){t=""+t,e=""+e;var i=this._nodes.get(t);return!!i&&i.undirected.hasOwnProperty(e)}throw new U("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.hasEdge=function(t,e){if(1===arguments.length){var n=""+t;return this._edges.has(n)}if(2===arguments.length){t=""+t,e=""+e;var r=this._nodes.get(t);return!!r&&(void 0!==r.out&&r.out.hasOwnProperty(e)||void 0!==r.undirected&&r.undirected.hasOwnProperty(e))}throw new U("Graph.hasEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.directedEdge=function(t,e){if("undirected"!==this.type){if(t=""+t,e=""+e,this.multi)throw new H("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var n=this._nodes.get(t);if(!n)throw new I('Graph.directedEdge: could not find the "'.concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new I('Graph.directedEdge: could not find the "'.concat(e,'" target node in the graph.'));var r=n.out&&n.out[e]||void 0;return r?r.key:void 0}},i.undirectedEdge=function(t,e){if("directed"!==this.type){if(t=""+t,e=""+e,this.multi)throw new H("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var n=this._nodes.get(t);if(!n)throw new I('Graph.undirectedEdge: could not find the "'.concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new I('Graph.undirectedEdge: could not find the "'.concat(e,'" target node in the graph.'));var r=n.undirected&&n.undirected[e]||void 0;return r?r.key:void 0}},i.edge=function(t,e){if(this.multi)throw new H("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new I('Graph.edge: could not find the "'.concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new I('Graph.edge: could not find the "'.concat(e,'" target node in the graph.'));var r=n.out&&n.out[e]||n.undirected&&n.undirected[e]||void 0;if(r)return r.key},i.areDirectedNeighbors=function(t,e){t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new I('Graph.areDirectedNeighbors: could not find the "'.concat(t,'" node in the graph.'));return"undirected"!==this.type&&(e in n.in||e in n.out)},i.areOutNeighbors=function(t,e){t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new I('Graph.areOutNeighbors: could not find the "'.concat(t,'" node in the graph.'));return"undirected"!==this.type&&e in n.out},i.areInNeighbors=function(t,e){t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new I('Graph.areInNeighbors: could not find the "'.concat(t,'" node in the graph.'));return"undirected"!==this.type&&e in n.in},i.areUndirectedNeighbors=function(t,e){t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new I('Graph.areUndirectedNeighbors: could not find the "'.concat(t,'" node in the graph.'));return"directed"!==this.type&&e in n.undirected},i.areNeighbors=function(t,e){t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new I('Graph.areNeighbors: could not find the "'.concat(t,'" node in the graph.'));return"undirected"!==this.type&&(e in n.in||e in n.out)||"directed"!==this.type&&e in n.undirected},i.areInboundNeighbors=function(t,e){t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new I('Graph.areInboundNeighbors: could not find the "'.concat(t,'" node in the graph.'));return"undirected"!==this.type&&e in n.in||"directed"!==this.type&&e in n.undirected},i.areOutboundNeighbors=function(t,e){t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new I('Graph.areOutboundNeighbors: could not find the "'.concat(t,'" node in the graph.'));return"undirected"!==this.type&&e in n.out||"directed"!==this.type&&e in n.undirected},i.inDegree=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new I('Graph.inDegree: could not find the "'.concat(t,'" node in the graph.'));return"undirected"===this.type?0:e.inDegree},i.outDegree=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new I('Graph.outDegree: could not find the "'.concat(t,'" node in the graph.'));return"undirected"===this.type?0:e.outDegree},i.directedDegree=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new I('Graph.directedDegree: could not find the "'.concat(t,'" node in the graph.'));return"undirected"===this.type?0:e.inDegree+e.outDegree},i.undirectedDegree=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new I('Graph.undirectedDegree: could not find the "'.concat(t,'" node in the graph.'));return"directed"===this.type?0:e.undirectedDegree},i.inboundDegree=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new I('Graph.inboundDegree: could not find the "'.concat(t,'" node in the graph.'));var n=0;return"directed"!==this.type&&(n+=e.undirectedDegree),"undirected"!==this.type&&(n+=e.inDegree),n},i.outboundDegree=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new I('Graph.outboundDegree: could not find the "'.concat(t,'" node in the graph.'));var n=0;return"directed"!==this.type&&(n+=e.undirectedDegree),"undirected"!==this.type&&(n+=e.outDegree),n},i.degree=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new I('Graph.degree: could not find the "'.concat(t,'" node in the graph.'));var n=0;return"directed"!==this.type&&(n+=e.undirectedDegree),"undirected"!==this.type&&(n+=e.inDegree+e.outDegree),n},i.inDegreeWithoutSelfLoops=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new I('Graph.inDegreeWithoutSelfLoops: could not find the "'.concat(t,'" node in the graph.'));return"undirected"===this.type?0:e.inDegree-e.directedLoops},i.outDegreeWithoutSelfLoops=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new I('Graph.outDegreeWithoutSelfLoops: could not find the "'.concat(t,'" node in the graph.'));return"undirected"===this.type?0:e.outDegree-e.directedLoops},i.directedDegreeWithoutSelfLoops=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new I('Graph.directedDegreeWithoutSelfLoops: could not find the "'.concat(t,'" node in the graph.'));return"undirected"===this.type?0:e.inDegree+e.outDegree-2*e.directedLoops},i.undirectedDegreeWithoutSelfLoops=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new I('Graph.undirectedDegreeWithoutSelfLoops: could not find the "'.concat(t,'" node in the graph.'));return"directed"===this.type?0:e.undirectedDegree-2*e.undirectedLoops},i.inboundDegreeWithoutSelfLoops=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new I('Graph.inboundDegreeWithoutSelfLoops: could not find the "'.concat(t,'" node in the graph.'));var n=0,r=0;return"directed"!==this.type&&(n+=e.undirectedDegree,r+=2*e.undirectedLoops),"undirected"!==this.type&&(n+=e.inDegree,r+=e.directedLoops),n-r},i.outboundDegreeWithoutSelfLoops=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new I('Graph.outboundDegreeWithoutSelfLoops: could not find the "'.concat(t,'" node in the graph.'));var n=0,r=0;return"directed"!==this.type&&(n+=e.undirectedDegree,r+=2*e.undirectedLoops),"undirected"!==this.type&&(n+=e.outDegree,r+=e.directedLoops),n-r},i.degreeWithoutSelfLoops=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new I('Graph.degreeWithoutSelfLoops: could not find the "'.concat(t,'" node in the graph.'));var n=0,r=0;return"directed"!==this.type&&(n+=e.undirectedDegree,r+=2*e.undirectedLoops),"undirected"!==this.type&&(n+=e.inDegree+e.outDegree,r+=2*e.directedLoops),n-r},i.source=function(t){t=""+t;var e=this._edges.get(t);if(!e)throw new I('Graph.source: could not find the "'.concat(t,'" edge in the graph.'));return e.source.key},i.target=function(t){t=""+t;var e=this._edges.get(t);if(!e)throw new I('Graph.target: could not find the "'.concat(t,'" edge in the graph.'));return e.target.key},i.extremities=function(t){t=""+t;var e=this._edges.get(t);if(!e)throw new I('Graph.extremities: could not find the "'.concat(t,'" edge in the graph.'));return[e.source.key,e.target.key]},i.opposite=function(t,e){t=""+t,e=""+e;var n=this._edges.get(e);if(!n)throw new I('Graph.opposite: could not find the "'.concat(e,'" edge in the graph.'));var r=n.source.key,i=n.target.key;if(t===r)return i;if(t===i)return r;throw new I('Graph.opposite: the "'.concat(t,'" node is not attached to the "').concat(e,'" edge (').concat(r,", ").concat(i,")."))},i.hasExtremity=function(t,e){t=""+t,e=""+e;var n=this._edges.get(t);if(!n)throw new I('Graph.hasExtremity: could not find the "'.concat(t,'" edge in the graph.'));return n.source.key===e||n.target.key===e},i.isUndirected=function(t){t=""+t;var e=this._edges.get(t);if(!e)throw new I('Graph.isUndirected: could not find the "'.concat(t,'" edge in the graph.'));return e.undirected},i.isDirected=function(t){t=""+t;var e=this._edges.get(t);if(!e)throw new I('Graph.isDirected: could not find the "'.concat(t,'" edge in the graph.'));return!e.undirected},i.isSelfLoop=function(t){t=""+t;var e=this._edges.get(t);if(!e)throw new I('Graph.isSelfLoop: could not find the "'.concat(t,'" edge in the graph.'));return e.source===e.target},i.addNode=function(t,e){var n=function(t,e,n){if(n&&!u(n))throw new U('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(n,'"'));if(e=""+e,n=n||{},t._nodes.has(e))throw new H('Graph.addNode: the "'.concat(e,'" node already exist in the graph.'));var r=new t.NodeDataClass(e,n);return t._nodes.set(e,r),t.emit("nodeAdded",{key:e,attributes:n}),r}(this,t,e);return n.key},i.mergeNode=function(t,e){if(e&&!u(e))throw new U('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(e,'"'));t=""+t,e=e||{};var n=this._nodes.get(t);return n?(e&&(s(n.attributes,e),this.emit("nodeAttributesUpdated",{type:"merge",key:t,attributes:n.attributes,data:e})),[t,!1]):(n=new this.NodeDataClass(t,e),this._nodes.set(t,n),this.emit("nodeAdded",{key:t,attributes:e}),[t,!0])},i.updateNode=function(t,e){if(e&&"function"!=typeof e)throw new U('Graph.updateNode: invalid updater function. Expecting a function but got "'.concat(e,'"'));t=""+t;var n=this._nodes.get(t);if(n){if(e){var r=n.attributes;n.attributes=e(r),this.emit("nodeAttributesUpdated",{type:"replace",key:t,attributes:n.attributes})}return[t,!1]}var i=e?e({}):{};return n=new this.NodeDataClass(t,i),this._nodes.set(t,n),this.emit("nodeAdded",{key:t,attributes:i}),[t,!0]},i.dropNode=function(t){t=""+t;var e,n=this._nodes.get(t);if(!n)throw new I('Graph.dropNode: could not find the "'.concat(t,'" node in the graph.'));if("undirected"!==this.type){for(var r in n.out){e=n.out[r];do{St(this,e),e=e.next}while(e)}for(var i in n.in){e=n.in[i];do{St(this,e),e=e.next}while(e)}}if("directed"!==this.type)for(var o in n.undirected){e=n.undirected[o];do{St(this,e),e=e.next}while(e)}this._nodes.delete(t),this.emit("nodeDropped",{key:t,attributes:n.attributes})},i.dropEdge=function(t){var e;if(arguments.length>1){var n=""+arguments[0],r=""+arguments[1];if(!(e=h(this,n,r,this.type)))throw new I('Graph.dropEdge: could not find the "'.concat(n,'" -> "').concat(r,'" edge in the graph.'))}else if(t=""+t,!(e=this._edges.get(t)))throw new I('Graph.dropEdge: could not find the "'.concat(t,'" edge in the graph.'));return St(this,e),this},i.dropDirectedEdge=function(t,e){if(arguments.length<2)throw new H("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new H("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");var n=h(this,t=""+t,e=""+e,"directed");if(!n)throw new I('Graph.dropDirectedEdge: could not find a "'.concat(t,'" -> "').concat(e,'" edge in the graph.'));return St(this,n),this},i.dropUndirectedEdge=function(t,e){if(arguments.length<2)throw new H("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new H("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");var n=h(this,t,e,"undirected");if(!n)throw new I('Graph.dropUndirectedEdge: could not find a "'.concat(t,'" -> "').concat(e,'" edge in the graph.'));return St(this,n),this},i.clear=function(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")},i.clearEdges=function(){for(var t,e=this._nodes.values();!0!==(t=e.next()).done;)t.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")},i.getAttribute=function(t){return this._attributes[t]},i.getAttributes=function(){return this._attributes},i.hasAttribute=function(t){return this._attributes.hasOwnProperty(t)},i.setAttribute=function(t,e){return this._attributes[t]=e,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this},i.updateAttribute=function(t,e){if("function"!=typeof e)throw new U("Graph.updateAttribute: updater should be a function.");var n=this._attributes[t];return this._attributes[t]=e(n),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this},i.removeAttribute=function(t){return delete this._attributes[t],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:t}),this},i.replaceAttributes=function(t){if(!u(t))throw new U("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=t,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this},i.mergeAttributes=function(t){if(!u(t))throw new U("Graph.mergeAttributes: provided attributes are not a plain object.");return s(this._attributes,t),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:t}),this},i.updateAttributes=function(t){if("function"!=typeof t)throw new U("Graph.updateAttributes: provided updater is not a function.");return this._attributes=t(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this},i.updateEachNodeAttributes=function(t,e){if("function"!=typeof t)throw new U("Graph.updateEachNodeAttributes: expecting an updater function.");if(e&&!p(e))throw new U("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var n,r,i=this._nodes.values();!0!==(n=i.next()).done;)(r=n.value).attributes=t(r.key,r.attributes);this.emit("eachNodeAttributesUpdated",{hints:e||null})},i.updateEachEdgeAttributes=function(t,e){if("function"!=typeof t)throw new U("Graph.updateEachEdgeAttributes: expecting an updater function.");if(e&&!p(e))throw new U("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var n,r,i,o,a=this._edges.values();!0!==(n=a.next()).done;)i=(r=n.value).source,o=r.target,r.attributes=t(r.key,r.attributes,i.key,o.key,i.attributes,o.attributes,r.undirected);this.emit("eachEdgeAttributesUpdated",{hints:e||null})},i.forEachAdjacencyEntry=function(t){if("function"!=typeof t)throw new U("Graph.forEachAdjacencyEntry: expecting a callback.");gt(!1,!1,!1,this,t)},i.forEachAdjacencyEntryWithOrphans=function(t){if("function"!=typeof t)throw new U("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");gt(!1,!1,!0,this,t)},i.forEachAssymetricAdjacencyEntry=function(t){if("function"!=typeof t)throw new U("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");gt(!1,!0,!1,this,t)},i.forEachAssymetricAdjacencyEntryWithOrphans=function(t){if("function"!=typeof t)throw new U("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");gt(!1,!0,!0,this,t)},i.nodes=function(){return"function"==typeof Array.from?Array.from(this._nodes.keys()):z(this._nodes.keys(),this._nodes.size)},i.forEachNode=function(t){if("function"!=typeof t)throw new U("Graph.forEachNode: expecting a callback.");for(var e,n,r=this._nodes.values();!0!==(e=r.next()).done;)t((n=e.value).key,n.attributes)},i.findNode=function(t){if("function"!=typeof t)throw new U("Graph.findNode: expecting a callback.");for(var e,n,r=this._nodes.values();!0!==(e=r.next()).done;)if(t((n=e.value).key,n.attributes))return n.key},i.mapNodes=function(t){if("function"!=typeof t)throw new U("Graph.mapNode: expecting a callback.");for(var e,n,r=this._nodes.values(),i=new Array(this.order),o=0;!0!==(e=r.next()).done;)n=e.value,i[o++]=t(n.key,n.attributes);return i},i.someNode=function(t){if("function"!=typeof t)throw new U("Graph.someNode: expecting a callback.");for(var e,n,r=this._nodes.values();!0!==(e=r.next()).done;)if(t((n=e.value).key,n.attributes))return!0;return!1},i.everyNode=function(t){if("function"!=typeof t)throw new U("Graph.everyNode: expecting a callback.");for(var e,n,r=this._nodes.values();!0!==(e=r.next()).done;)if(!t((n=e.value).key,n.attributes))return!1;return!0},i.filterNodes=function(t){if("function"!=typeof t)throw new U("Graph.filterNodes: expecting a callback.");for(var e,n,r=this._nodes.values(),i=[];!0!==(e=r.next()).done;)t((n=e.value).key,n.attributes)&&i.push(n.key);return i},i.reduceNodes=function(t,e){if("function"!=typeof t)throw new U("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new U("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");for(var n,r,i=e,o=this._nodes.values();!0!==(n=o.next()).done;)i=t(i,(r=n.value).key,r.attributes);return i},i.nodeEntries=function(){var t=this._nodes.values();return new P((function(){var e=t.next();if(e.done)return e;var n=e.value;return{value:{node:n.key,attributes:n.attributes},done:!1}}))},i.export=function(){var t=this,e=new Array(this._nodes.size),n=0;this._nodes.forEach((function(t,r){e[n++]=function(t,e){var n={key:t};return c(e.attributes)||(n.attributes=s({},e.attributes)),n}(r,t)}));var r=new Array(this._edges.size);return n=0,this._edges.forEach((function(e,i){r[n++]=function(t,e,n){var r={key:e,source:n.source.key,target:n.target.key};return c(n.attributes)||(r.attributes=s({},n.attributes)),"mixed"===t&&n.undirected&&(r.undirected=!0),r}(t.type,i,e)})),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:e,edges:r}},i.import=function(t){var e,n,i,o,a,s=this,h=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t instanceof r)return t.forEachNode((function(t,e){h?s.mergeNode(t,e):s.addNode(t,e)})),t.forEachEdge((function(t,e,n,r,i,o,a){h?a?s.mergeUndirectedEdgeWithKey(t,n,r,e):s.mergeDirectedEdgeWithKey(t,n,r,e):a?s.addUndirectedEdgeWithKey(t,n,r,e):s.addDirectedEdgeWithKey(t,n,r,e)})),this;if(!u(t))throw new U("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(t.attributes){if(!u(t.attributes))throw new U("Graph.import: invalid attributes. Expecting a plain object.");h?this.mergeAttributes(t.attributes):this.replaceAttributes(t.attributes)}if(t.nodes){if(i=t.nodes,!Array.isArray(i))throw new U("Graph.import: invalid nodes. Expecting an array.");for(e=0,n=i.length;e<n;e++){vt(o=i[e]);var c=o,d=c.key,l=c.attributes;h?this.mergeNode(d,l):this.addNode(d,l)}}if(t.edges){var p=!1;if("undirected"===this.type&&(p=!0),i=t.edges,!Array.isArray(i))throw new U("Graph.import: invalid edges. Expecting an array.");for(e=0,n=i.length;e<n;e++){yt(a=i[e]);var f=a,g=f.source,v=f.target,y=f.attributes,m=f.undirected,b=void 0===m?p:m;"key"in a?(h?b?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:b?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,a.key,g,v,y):(h?b?this.mergeUndirectedEdge:this.mergeDirectedEdge:b?this.addUndirectedEdge:this.addDirectedEdge).call(this,g,v,y)}}return this},i.nullCopy=function(t){var e=new r(s({},this._options,t));return e.replaceAttributes(s({},this.getAttributes())),e},i.emptyCopy=function(t){var e=this.nullCopy(t);return this._nodes.forEach((function(t,n){var r=s({},t.attributes);t=new e.NodeDataClass(n,r),e._nodes.set(n,t)})),e},i.copy=function(t){if("string"==typeof(t=t||{}).type&&t.type!==this.type&&"mixed"!==t.type)throw new H('Graph.copy: cannot create an incompatible copy from "'.concat(this.type,'" type to "').concat(t.type,'" because this would mean losing information about the current graph.'));if("boolean"==typeof t.multi&&t.multi!==this.multi&&!0!==t.multi)throw new H("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if("boolean"==typeof t.allowSelfLoops&&t.allowSelfLoops!==this.allowSelfLoops&&!0!==t.allowSelfLoops)throw new H("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");for(var e,n,r=this.emptyCopy(t),i=this._edges.values();!0!==(e=i.next()).done;)Et(r,"copy",!1,(n=e.value).undirected,n.key,n.source.key,n.target.key,s({},n.attributes));return r},i.toJSON=function(){return this.export()},i.toString=function(){return"[object Graph]"},i.inspect=function(){var e=this,n={};this._nodes.forEach((function(t,e){n[e]=t.attributes}));var r={},i={};this._edges.forEach((function(t,n){var o,a=t.undirected?"--":"->",s="",h=t.source.key,u=t.target.key;t.undirected&&h>u&&(o=h,h=u,u=o);var c="(".concat(h,")").concat(a,"(").concat(u,")");n.startsWith("geid_")?e.multi&&(void 0===i[c]?i[c]=0:i[c]++,s+="".concat(i[c],". ")):s+="[".concat(n,"]: "),r[s+=c]=t.attributes}));var o={};for(var a in this)this.hasOwnProperty(a)&&!_t.has(a)&&"function"!=typeof this[a]&&"symbol"!==t(a)&&(o[a]=this[a]);return o.attributes=this._attributes,o.nodes=n,o.edges=r,d(o,"constructor",this.constructor),o},r}(g.exports.EventEmitter);"undefined"!=typeof Symbol&&(Mt.prototype[Symbol.for("nodejs.util.inspect.custom")]=Mt.prototype.inspect),[{name:function(t){return"".concat(t,"Edge")},generateKey:!0},{name:function(t){return"".concat(t,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(t){return"".concat(t,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(t){return"".concat(t,"EdgeWithKey")}},{name:function(t){return"".concat(t,"DirectedEdgeWithKey")},type:"directed"},{name:function(t){return"".concat(t,"UndirectedEdgeWithKey")},type:"undirected"}].forEach((function(t){["add","merge","update"].forEach((function(e){var n=t.name(e),r="add"===e?Et:Lt;t.generateKey?Mt.prototype[n]=function(i,o,a){return r(this,n,!0,"undirected"===(t.type||this.type),null,i,o,a,"update"===e)}:Mt.prototype[n]=function(i,o,a,s){return r(this,n,!1,"undirected"===(t.type||this.type),i,o,a,s,"update"===e)}}))})),function(t){K.forEach((function(e){var n=e.name,r=e.attacher;r(t,n("Node"),0),r(t,n("Source"),1),r(t,n("Target"),2),r(t,n("Opposite"),3)}))}(Mt),function(t){X.forEach((function(e){var n=e.name,r=e.attacher;r(t,n("Edge"),"mixed"),r(t,n("DirectedEdge"),"directed"),r(t,n("UndirectedEdge"),"undirected")}))}(Mt),function(t){tt.forEach((function(e){!function(t,e){var n=e.name,r=e.type,i=e.direction;t.prototype[n]=function(t,e){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return[];if(!arguments.length)return function(t,e){if(0===t.size)return[];if("mixed"===e||e===t.type)return"function"==typeof Array.from?Array.from(t._edges.keys()):z(t._edges.keys(),t._edges.size);for(var n,r,i="undirected"===e?t.undirectedSize:t.directedSize,o=new Array(i),a="undirected"===e,s=t._edges.values(),h=0;!0!==(n=s.next()).done;)(r=n.value).undirected===a&&(o[h++]=r.key);return o}(this,r);if(1===arguments.length){t=""+t;var o=this._nodes.get(t);if(void 0===o)throw new I("Graph.".concat(n,': could not find the "').concat(t,'" node in the graph.'));return function(t,e,n,r){var i=[];return ht(!1,t,e,n,r,(function(t){i.push(t)})),i}(this.multi,"mixed"===r?this.type:r,i,o)}if(2===arguments.length){t=""+t,e=""+e;var a=this._nodes.get(t);if(!a)throw new I("Graph.".concat(n,': could not find the "').concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new I("Graph.".concat(n,': could not find the "').concat(e,'" target node in the graph.'));return function(t,e,n,r,i){var o=[];return ut(!1,t,e,n,r,i,(function(t){o.push(t)})),o}(r,this.multi,i,a,e)}throw new U("Graph.".concat(n,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(t,e),function(t,e){var n=e.name,r=e.type,i=e.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[o]=function(t,e,n){if("mixed"===r||"mixed"===this.type||r===this.type){if(1===arguments.length)return st(!1,this,r,n=t);if(2===arguments.length){t=""+t,n=e;var a=this._nodes.get(t);if(void 0===a)throw new I("Graph.".concat(o,': could not find the "').concat(t,'" node in the graph.'));return ht(!1,this.multi,"mixed"===r?this.type:r,i,a,n)}if(3===arguments.length){t=""+t,e=""+e;var s=this._nodes.get(t);if(!s)throw new I("Graph.".concat(o,': could not find the "').concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new I("Graph.".concat(o,': could not find the "').concat(e,'" target node in the graph.'));return ut(!1,r,this.multi,i,s,e,n)}throw new U("Graph.".concat(o,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}};var a="map"+n[0].toUpperCase()+n.slice(1);t.prototype[a]=function(){var t,e=Array.prototype.slice.call(arguments),n=e.pop();if(0===e.length){var i=0;"directed"!==r&&(i+=this.undirectedSize),"undirected"!==r&&(i+=this.directedSize),t=new Array(i);var a=0;e.push((function(e,r,i,o,s,h,u){t[a++]=n(e,r,i,o,s,h,u)}))}else t=[],e.push((function(e,r,i,o,a,s,h){t.push(n(e,r,i,o,a,s,h))}));return this[o].apply(this,e),t};var s="filter"+n[0].toUpperCase()+n.slice(1);t.prototype[s]=function(){var t=Array.prototype.slice.call(arguments),e=t.pop(),n=[];return t.push((function(t,r,i,o,a,s,h){e(t,r,i,o,a,s,h)&&n.push(t)})),this[o].apply(this,t),n};var h="reduce"+n[0].toUpperCase()+n.slice(1);t.prototype[h]=function(){var t,e,n=Array.prototype.slice.call(arguments);if(n.length<2||n.length>4)throw new U("Graph.".concat(h,": invalid number of arguments (expecting 2, 3 or 4 and got ").concat(n.length,")."));if("function"==typeof n[n.length-1]&&"function"!=typeof n[n.length-2])throw new U("Graph.".concat(h,": missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array."));2===n.length?(t=n[0],e=n[1],n=[]):3===n.length?(t=n[1],e=n[2],n=[n[0]]):4===n.length&&(t=n[2],e=n[3],n=[n[0],n[1]]);var r=e;return n.push((function(e,n,i,o,a,s,h){r=t(r,e,n,i,o,a,s,h)})),this[o].apply(this,n),r}}(t,e),function(t,e){var n=e.name,r=e.type,i=e.direction,o="find"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[o]=function(t,e,n){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return!1;if(1===arguments.length)return st(!0,this,r,n=t);if(2===arguments.length){t=""+t,n=e;var a=this._nodes.get(t);if(void 0===a)throw new I("Graph.".concat(o,': could not find the "').concat(t,'" node in the graph.'));return ht(!0,this.multi,"mixed"===r?this.type:r,i,a,n)}if(3===arguments.length){t=""+t,e=""+e;var s=this._nodes.get(t);if(!s)throw new I("Graph.".concat(o,': could not find the "').concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new I("Graph.".concat(o,': could not find the "').concat(e,'" target node in the graph.'));return ut(!0,r,this.multi,i,s,e,n)}throw new U("Graph.".concat(o,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))};var a="some"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[a]=function(){var t=Array.prototype.slice.call(arguments),e=t.pop();return t.push((function(t,n,r,i,o,a,s){return e(t,n,r,i,o,a,s)})),!!this[o].apply(this,t)};var s="every"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[s]=function(){var t=Array.prototype.slice.call(arguments),e=t.pop();return t.push((function(t,n,r,i,o,a,s){return!e(t,n,r,i,o,a,s)})),!this[o].apply(this,t)}}(t,e),function(t,e){var n=e.name,r=e.type,i=e.direction,o=n.slice(0,-1)+"Entries";t.prototype[o]=function(t,e){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return P.empty();if(!arguments.length)return function(t,e){if(0===t.size)return P.empty();var n="mixed"!==e&&e!==t.type,r="undirected"===e,i=t._edges.values();return new P((function(){for(var t,e;;){if((t=i.next()).done)return t;if(e=t.value,!n||e.undirected===r)break}return{value:{edge:e.key,attributes:e.attributes,source:e.source.key,target:e.target.key,sourceAttributes:e.source.attributes,targetAttributes:e.target.attributes,undirected:e.undirected},done:!1}}))}(this,r);if(1===arguments.length){t=""+t;var n=this._nodes.get(t);if(!n)throw new I("Graph.".concat(o,': could not find the "').concat(t,'" node in the graph.'));return function(t,e,n){var r=P.empty();return"undirected"!==t&&("out"!==e&&void 0!==n.in&&(r=$(r,rt(n.in))),"in"!==e&&void 0!==n.out&&(r=$(r,rt(n.out,e?void 0:n.key)))),"directed"!==t&&void 0!==n.undirected&&(r=$(r,rt(n.undirected))),r}(r,i,n)}if(2===arguments.length){t=""+t,e=""+e;var a=this._nodes.get(t);if(!a)throw new I("Graph.".concat(o,': could not find the "').concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new I("Graph.".concat(o,': could not find the "').concat(e,'" target node in the graph.'));return function(t,e,n,r){var i=P.empty();return"undirected"!==t&&(void 0!==n.in&&"out"!==e&&r in n.in&&(i=$(i,at(n.in,r))),void 0!==n.out&&"in"!==e&&r in n.out&&(e||n.key!==r)&&(i=$(i,at(n.out,r)))),"directed"!==t&&void 0!==n.undirected&&r in n.undirected&&(i=$(i,at(n.undirected,r))),i}(r,i,a,e)}throw new U("Graph.".concat(o,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(t,e)}))}(Mt),function(t){ct.forEach((function(e){(function(t,e){var n=e.name,r=e.type,i=e.direction;t.prototype[n]=function(t){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return[];t=""+t;var e=this._nodes.get(t);if(void 0===e)throw new I("Graph.".concat(n,': could not find the "').concat(t,'" node in the graph.'));return function(t,e,n){if("mixed"!==t){if("undirected"===t)return Object.keys(n.undirected);if("string"==typeof e)return Object.keys(n[e])}var r=[];return pt(!1,t,e,n,(function(t){r.push(t)})),r}("mixed"===r?this.type:r,i,e)}})(t,e),function(t,e){var n=e.name,r=e.type,i=e.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[o]=function(t,e){if("mixed"===r||"mixed"===this.type||r===this.type){t=""+t;var n=this._nodes.get(t);if(void 0===n)throw new I("Graph.".concat(o,': could not find the "').concat(t,'" node in the graph.'));pt(!1,"mixed"===r?this.type:r,i,n,e)}};var a="map"+n[0].toUpperCase()+n.slice(1);t.prototype[a]=function(t,e){var n=[];return this[o](t,(function(t,r){n.push(e(t,r))})),n};var s="filter"+n[0].toUpperCase()+n.slice(1);t.prototype[s]=function(t,e){var n=[];return this[o](t,(function(t,r){e(t,r)&&n.push(t)})),n};var h="reduce"+n[0].toUpperCase()+n.slice(1);t.prototype[h]=function(t,e,n){if(arguments.length<3)throw new U("Graph.".concat(h,": missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array."));var r=n;return this[o](t,(function(t,n){r=e(r,t,n)})),r}}(t,e),function(t,e){var n=e.name,r=e.type,i=e.direction,o=n[0].toUpperCase()+n.slice(1,-1),a="find"+o;t.prototype[a]=function(t,e){if("mixed"===r||"mixed"===this.type||r===this.type){t=""+t;var n=this._nodes.get(t);if(void 0===n)throw new I("Graph.".concat(a,': could not find the "').concat(t,'" node in the graph.'));return pt(!0,"mixed"===r?this.type:r,i,n,e)}};var s="some"+o;t.prototype[s]=function(t,e){return!!this[a](t,e)};var h="every"+o;t.prototype[h]=function(t,e){return!this[a](t,(function(t,n){return!e(t,n)}))}}(t,e),function(t,e){var n=e.name,r=e.type,i=e.direction,o=n.slice(0,-1)+"Entries";t.prototype[o]=function(t){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return P.empty();t=""+t;var e=this._nodes.get(t);if(void 0===e)throw new I("Graph.".concat(o,': could not find the "').concat(t,'" node in the graph.'));return function(t,e,n){if("mixed"!==t){if("undirected"===t)return ft(null,n,n.undirected);if("string"==typeof e)return ft(null,n,n[e])}var r=P.empty(),i=new dt;return"undirected"!==t&&("out"!==e&&(r=$(r,ft(i,n,n.in))),"in"!==e&&(r=$(r,ft(i,n,n.out)))),"directed"!==t&&(r=$(r,ft(i,n,n.undirected))),r}("mixed"===r?this.type:r,i,e)}}(t,e)}))}(Mt);var At=function(t){function n(e){var n=s({type:"directed"},e);if("multi"in n&&!1!==n.multi)throw new U("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("directed"!==n.type)throw new U('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return t.call(this,n)||this}return e(n,t),n}(Mt),Nt=function(t){function n(e){var n=s({type:"undirected"},e);if("multi"in n&&!1!==n.multi)throw new U("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("undirected"!==n.type)throw new U('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return t.call(this,n)||this}return e(n,t),n}(Mt),kt=function(t){function n(e){var n=s({multi:!0},e);if("multi"in n&&!0!==n.multi)throw new U("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");return t.call(this,n)||this}return e(n,t),n}(Mt),Pt=function(t){function n(e){var n=s({type:"directed",multi:!0},e);if("multi"in n&&!0!==n.multi)throw new U("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("directed"!==n.type)throw new U('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return t.call(this,n)||this}return e(n,t),n}(Mt),Dt=function(t){function n(e){var n=s({type:"undirected",multi:!0},e);if("multi"in n&&!0!==n.multi)throw new U("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("undirected"!==n.type)throw new U('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return t.call(this,n)||this}return e(n,t),n}(Mt);function Gt(t){t.from=function(e,n){var r=s({},e.options,n),i=new t(r);return i.import(e),i}}return Gt(Mt),Gt(At),Gt(Nt),Gt(kt),Gt(Pt),Gt(Dt),Mt.Graph=Mt,Mt.DirectedGraph=At,Mt.UndirectedGraph=Nt,Mt.MultiGraph=kt,Mt.MultiDirectedGraph=Pt,Mt.MultiUndirectedGraph=Dt,Mt.InvalidArgumentsGraphError=U,Mt.NotFoundGraphError=I,Mt.UsageGraphError=H,Mt}()},554:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=n(227),s=o(n(941)),h=n(524),u=n(291),c=1.5,d=function(t){function e(){var e=t.call(this)||this;return e.x=.5,e.y=.5,e.angle=0,e.ratio=1,e.minRatio=null,e.maxRatio=null,e.nextFrame=null,e.previousState=null,e.enabled=!0,e.previousState=e.getState(),e}return i(e,t),e.from=function(t){return(new e).setState(t)},e.prototype.enable=function(){return this.enabled=!0,this},e.prototype.disable=function(){return this.enabled=!1,this},e.prototype.getState=function(){return{x:this.x,y:this.y,angle:this.angle,ratio:this.ratio}},e.prototype.hasState=function(t){return this.x===t.x&&this.y===t.y&&this.ratio===t.ratio&&this.angle===t.angle},e.prototype.getPreviousState=function(){var t=this.previousState;return t?{x:t.x,y:t.y,angle:t.angle,ratio:t.ratio}:null},e.prototype.getBoundedRatio=function(t){var e=t;return"number"==typeof this.minRatio&&(e=Math.max(e,this.minRatio)),"number"==typeof this.maxRatio&&(e=Math.min(e,this.maxRatio)),e},e.prototype.validateState=function(t){var e={};return"number"==typeof t.x&&(e.x=t.x),"number"==typeof t.y&&(e.y=t.y),"number"==typeof t.angle&&(e.angle=t.angle),"number"==typeof t.ratio&&(e.ratio=this.getBoundedRatio(t.ratio)),e},e.prototype.isAnimated=function(){return!!this.nextFrame},e.prototype.setState=function(t){if(!this.enabled)return this;this.previousState=this.getState();var e=this.validateState(t);return"number"==typeof e.x&&(this.x=e.x),"number"==typeof e.y&&(this.y=e.y),"number"==typeof e.angle&&(this.angle=e.angle),"number"==typeof e.ratio&&(this.ratio=e.ratio),this.hasState(this.previousState)||this.emit("updated",this.getState()),this},e.prototype.updateState=function(t){return this.setState(t(this.getState())),this},e.prototype.animate=function(t,e,n){var r=this;if(this.enabled){var i=Object.assign({},a.ANIMATE_DEFAULTS,e),o=this.validateState(t),u="function"==typeof i.easing?i.easing:s.default[i.easing],c=Date.now(),d=this.getState(),l=function(){var t=(Date.now()-c)/i.duration;if(t>=1)return r.nextFrame=null,r.setState(o),void(r.animationCallback&&(r.animationCallback.call(null),r.animationCallback=void 0));var e=u(t),n={};"number"==typeof o.x&&(n.x=d.x+(o.x-d.x)*e),"number"==typeof o.y&&(n.y=d.y+(o.y-d.y)*e),"number"==typeof o.angle&&(n.angle=d.angle+(o.angle-d.angle)*e),"number"==typeof o.ratio&&(n.ratio=d.ratio+(o.ratio-d.ratio)*e),r.setState(n),r.nextFrame=(0,h.requestFrame)(l)};this.nextFrame?((0,h.cancelFrame)(this.nextFrame),this.animationCallback&&this.animationCallback.call(null),this.nextFrame=(0,h.requestFrame)(l)):l(),this.animationCallback=n}},e.prototype.animatedZoom=function(t){if(t){if("number"==typeof t)return this.animate({ratio:this.ratio/t});this.animate({ratio:this.ratio/(t.factor||c)},t)}else this.animate({ratio:this.ratio/c})},e.prototype.animatedUnzoom=function(t){if(t){if("number"==typeof t)return this.animate({ratio:this.ratio*t});this.animate({ratio:this.ratio*(t.factor||c)},t)}else this.animate({ratio:this.ratio*c})},e.prototype.animatedReset=function(t){this.animate({x:.5,y:.5,ratio:1,angle:0},t)},e.prototype.copy=function(){return e.from(this.getState())},e}(u.TypedEventEmitter);e.default=d},760:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__assign||function(){return o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},o.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.getWheelDelta=e.getTouchCoords=e.getTouchesArray=e.getWheelCoords=e.getMouseCoords=e.getPosition=void 0;var a=n(291);function s(t,e){var n=e.getBoundingClientRect();return{x:t.clientX-n.left,y:t.clientY-n.top}}function h(t,e){var n=o(o({},s(t,e)),{sigmaDefaultPrevented:!1,preventSigmaDefault:function(){n.sigmaDefaultPrevented=!0},original:t});return n}function u(t){for(var e=[],n=0,r=Math.min(t.length,2);n<r;n++)e.push(t[n]);return e}function c(t){if(void 0!==t.deltaY)return-3*t.deltaY/360;if(void 0!==t.detail)return t.detail/-9;throw new Error("Captor: could not extract delta from event.")}e.getPosition=s,e.getMouseCoords=h,e.getWheelCoords=function(t,e){return o(o({},h(t,e)),{delta:c(t)})},e.getTouchesArray=u,e.getTouchCoords=function(t,e){return{touches:u(t.touches).map((function(t){return s(t,e)})),original:t}},e.getWheelDelta=c;var d=function(t){function e(e,n){var r=t.call(this)||this;return r.container=e,r.renderer=n,r}return i(e,t),e}(a.TypedEventEmitter);e.default=d},886:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),a=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&o(e,t,n);return a(e,t),e};Object.defineProperty(e,"__esModule",{value:!0});var h=s(n(760)),u=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.enabled=!0,r.draggedEvents=0,r.downStartTime=null,r.lastMouseX=null,r.lastMouseY=null,r.isMouseDown=!1,r.isMoving=!1,r.movingTimeout=null,r.startCameraState=null,r.clicks=0,r.doubleClickTimeout=null,r.currentWheelDirection=0,r.handleClick=r.handleClick.bind(r),r.handleRightClick=r.handleRightClick.bind(r),r.handleDown=r.handleDown.bind(r),r.handleUp=r.handleUp.bind(r),r.handleMove=r.handleMove.bind(r),r.handleWheel=r.handleWheel.bind(r),r.handleOut=r.handleOut.bind(r),e.addEventListener("click",r.handleClick,!1),e.addEventListener("contextmenu",r.handleRightClick,!1),e.addEventListener("mousedown",r.handleDown,!1),e.addEventListener("wheel",r.handleWheel,!1),e.addEventListener("mouseout",r.handleOut,!1),document.addEventListener("mousemove",r.handleMove,!1),document.addEventListener("mouseup",r.handleUp,!1),r}return i(e,t),e.prototype.kill=function(){var t=this.container;t.removeEventListener("click",this.handleClick),t.removeEventListener("contextmenu",this.handleRightClick),t.removeEventListener("mousedown",this.handleDown),t.removeEventListener("wheel",this.handleWheel),t.removeEventListener("mouseout",this.handleOut),document.removeEventListener("mousemove",this.handleMove),document.removeEventListener("mouseup",this.handleUp)},e.prototype.handleClick=function(t){var e=this;if(this.enabled){if(this.clicks++,2===this.clicks)return this.clicks=0,"number"==typeof this.doubleClickTimeout&&(clearTimeout(this.doubleClickTimeout),this.doubleClickTimeout=null),this.handleDoubleClick(t);setTimeout((function(){e.clicks=0,e.doubleClickTimeout=null}),300),this.draggedEvents<3&&this.emit("click",(0,h.getMouseCoords)(t,this.container))}},e.prototype.handleRightClick=function(t){this.enabled&&this.emit("rightClick",(0,h.getMouseCoords)(t,this.container))},e.prototype.handleDoubleClick=function(t){if(this.enabled){t.preventDefault(),t.stopPropagation();var e=(0,h.getMouseCoords)(t,this.container);if(this.emit("doubleClick",e),!e.sigmaDefaultPrevented){var n=this.renderer.getCamera(),r=n.getBoundedRatio(n.getState().ratio/2.2);n.animate(this.renderer.getViewportZoomedState((0,h.getPosition)(t,this.container),r),{easing:"quadraticInOut",duration:200})}}},e.prototype.handleDown=function(t){if(this.enabled){if(0===t.button){this.startCameraState=this.renderer.getCamera().getState();var e=(0,h.getPosition)(t,this.container),n=e.x,r=e.y;this.lastMouseX=n,this.lastMouseY=r,this.draggedEvents=0,this.downStartTime=Date.now(),this.isMouseDown=!0}this.emit("mousedown",(0,h.getMouseCoords)(t,this.container))}},e.prototype.handleUp=function(t){var e=this;if(this.enabled&&this.isMouseDown){var n=this.renderer.getCamera();this.isMouseDown=!1,"number"==typeof this.movingTimeout&&(clearTimeout(this.movingTimeout),this.movingTimeout=null);var r=(0,h.getPosition)(t,this.container),i=r.x,o=r.y,a=n.getState(),s=n.getPreviousState()||{x:0,y:0};this.isMoving?n.animate({x:a.x+3*(a.x-s.x),y:a.y+3*(a.y-s.y)},{duration:200,easing:"quadraticOut"}):this.lastMouseX===i&&this.lastMouseY===o||n.setState({x:a.x,y:a.y}),this.isMoving=!1,setTimeout((function(){e.draggedEvents=0,e.renderer.refresh()}),0),this.emit("mouseup",(0,h.getMouseCoords)(t,this.container))}},e.prototype.handleMove=function(t){var e=this;if(this.enabled){var n=(0,h.getMouseCoords)(t,this.container);if(this.emit("mousemovebody",n),t.target===this.container&&this.emit("mousemove",n),!n.sigmaDefaultPrevented&&this.isMouseDown){this.isMoving=!0,this.draggedEvents++,"number"==typeof this.movingTimeout&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout((function(){e.movingTimeout=null,e.isMoving=!1}),100);var r=this.renderer.getCamera(),i=(0,h.getPosition)(t,this.container),o=i.x,a=i.y,s=this.renderer.viewportToFramedGraph({x:this.lastMouseX,y:this.lastMouseY}),u=this.renderer.viewportToFramedGraph({x:o,y:a}),c=s.x-u.x,d=s.y-u.y,l=r.getState(),p=l.x+c,f=l.y+d;r.setState({x:p,y:f}),this.lastMouseX=o,this.lastMouseY=a,t.preventDefault(),t.stopPropagation()}}},e.prototype.handleWheel=function(t){var e=this;if(this.enabled){t.preventDefault(),t.stopPropagation();var n=(0,h.getWheelDelta)(t);if(n){var r=(0,h.getWheelCoords)(t,this.container);if(this.emit("wheel",r),!r.sigmaDefaultPrevented){var i=n>0?1/1.7:1.7,o=this.renderer.getCamera(),a=o.getBoundedRatio(o.getState().ratio*i),s=n>0?1:-1,u=Date.now();this.currentWheelDirection===s&&this.lastWheelTriggerTime&&u-this.lastWheelTriggerTime<50||(o.animate(this.renderer.getViewportZoomedState((0,h.getPosition)(t,this.container),a),{easing:"quadraticOut",duration:250},(function(){e.currentWheelDirection=0})),this.currentWheelDirection=s,this.lastWheelTriggerTime=u)}}}},e.prototype.handleOut=function(){},e}(h.default);e.default=u},311:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),a=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&o(e,t,n);return a(e,t),e},h=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a};Object.defineProperty(e,"__esModule",{value:!0});var u=s(n(760)),c=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.enabled=!0,r.isMoving=!1,r.hasMoved=!1,r.touchMode=0,r.startTouchesPositions=[],r.handleStart=r.handleStart.bind(r),r.handleLeave=r.handleLeave.bind(r),r.handleMove=r.handleMove.bind(r),e.addEventListener("touchstart",r.handleStart,!1),e.addEventListener("touchend",r.handleLeave,!1),e.addEventListener("touchcancel",r.handleLeave,!1),e.addEventListener("touchmove",r.handleMove,!1),r}return i(e,t),e.prototype.kill=function(){var t=this.container;t.removeEventListener("touchstart",this.handleStart),t.removeEventListener("touchend",this.handleLeave),t.removeEventListener("touchcancel",this.handleLeave),t.removeEventListener("touchmove",this.handleMove)},e.prototype.getDimensions=function(){return{width:this.container.offsetWidth,height:this.container.offsetHeight}},e.prototype.dispatchRelatedMouseEvent=function(t,e,n,r){var i=n||e.touches[0],o=new MouseEvent(t,{clientX:i.clientX,clientY:i.clientY,altKey:e.altKey,ctrlKey:e.ctrlKey});o.isFakeSigmaMouseEvent=!0,(r||this.container).dispatchEvent(o)},e.prototype.handleStart=function(t){var e=this;if(this.enabled){t.preventDefault(),1===t.touches.length&&this.dispatchRelatedMouseEvent("mousedown",t);var n=(0,u.getTouchesArray)(t.touches);if(this.touchMode=n.length,this.startCameraState=this.renderer.getCamera().getState(),this.startTouchesPositions=n.map((function(t){return(0,u.getPosition)(t,e.container)})),this.lastTouches=n,this.lastTouchesPositions=this.startTouchesPositions,2===this.touchMode){var r=h(this.startTouchesPositions,2),i=r[0],o=i.x,a=i.y,s=r[1],c=s.x,d=s.y;this.startTouchesAngle=Math.atan2(d-a,c-o),this.startTouchesDistance=Math.sqrt(Math.pow(c-o,2)+Math.pow(d-a,2))}this.emit("touchdown",(0,u.getTouchCoords)(t,this.container))}},e.prototype.handleLeave=function(t){if(this.enabled){switch(t.preventDefault(),0===t.touches.length&&this.lastTouches&&this.lastTouches.length&&(this.dispatchRelatedMouseEvent("mouseup",t,this.lastTouches[0],document),this.hasMoved||this.dispatchRelatedMouseEvent("click",t,this.lastTouches[0])),this.movingTimeout&&(this.isMoving=!1,clearTimeout(this.movingTimeout)),this.touchMode){case 2:if(1===t.touches.length){this.handleStart(t),t.preventDefault();break}case 1:if(this.isMoving){var e=this.renderer.getCamera(),n=e.getState(),r=e.getPreviousState()||{x:0,y:0};e.animate({x:n.x+3*(n.x-r.x),y:n.y+3*(n.y-r.y)},{duration:200,easing:"quadraticOut"})}this.hasMoved=!1,this.isMoving=!1,this.touchMode=0}this.emit("touchup",(0,u.getTouchCoords)(t,this.container))}},e.prototype.handleMove=function(t){var e,n=this;if(this.enabled){t.preventDefault(),1===t.touches.length&&this.dispatchRelatedMouseEvent("mousemove",t);var r=(0,u.getTouchesArray)(t.touches),i=r.map((function(t){return(0,u.getPosition)(t,n.container)}));if(this.lastTouches=r,this.lastTouchesPositions=i,this.hasMoved||(this.hasMoved=i.some((function(t,e){var r=n.startTouchesPositions[e];return t.x!==r.x||t.y!==r.y}))),this.hasMoved){this.isMoving=!0,this.movingTimeout&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout((function(){n.isMoving=!1}),200);var o=this.renderer.getCamera(),a=this.startCameraState;switch(this.touchMode){case 1:var s=this.renderer.viewportToFramedGraph((this.startTouchesPositions||[])[0]),c=s.x,d=s.y,l=this.renderer.viewportToFramedGraph(i[0]),p=l.x,f=l.y;o.setState({x:a.x+c-p,y:a.y+d-f});break;case 2:var g={},v=i[0],y=v.x,m=v.y,b=i[1],w=b.x,_=b.y,x=Math.atan2(_-m,w-y)-this.startTouchesAngle,C=Math.hypot(_-m,w-y)/this.startTouchesDistance,E=o.getBoundedRatio(a.ratio/C);g.ratio=E,g.angle=a.angle+x;var L=this.getDimensions(),S=this.renderer.viewportToFramedGraph((this.startTouchesPositions||[])[0],{cameraState:a}),M=Math.min(L.width,L.height),A=M/L.width,N=E/M;f=m-M/2/(M/L.height),p=(e=h([(p=y-M/2/A)*Math.cos(-g.angle)-f*Math.sin(-g.angle),f*Math.cos(-g.angle)+p*Math.sin(-g.angle)],2))[0],f=e[1],g.x=S.x-p*N,g.y=S.y+f*N,o.setState(g)}this.emit("touchmove",(0,u.getTouchCoords)(t,this.container))}}},e}(u.default);e.default=c},98:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.edgeLabelsToDisplayFromNodes=e.LabelGrid=void 0;var n=function(){function t(t,e){this.key=t,this.size=e}return t.compare=function(t,e){return t.size>e.size?-1:t.size<e.size||t.key>e.key?1:-1},t}(),r=function(){function t(){this.width=0,this.height=0,this.cellSize=0,this.columns=0,this.rows=0,this.cells={}}return t.prototype.resizeAndClear=function(t,e){this.width=t.width,this.height=t.height,this.cellSize=e,this.columns=Math.ceil(t.width/e),this.rows=Math.ceil(t.height/e),this.cells={}},t.prototype.getIndex=function(t){var e=Math.floor(t.x/this.cellSize);return Math.floor(t.y/this.cellSize)*this.columns+e},t.prototype.add=function(t,e,r){var i=new n(t,e),o=this.getIndex(r),a=this.cells[o];a||(a=[],this.cells[o]=a),a.push(i)},t.prototype.organize=function(){for(var t in this.cells)this.cells[t].sort(n.compare)},t.prototype.getLabelsToDisplay=function(t,e){var n=this.cellSize*this.cellSize,r=n/t/t*e/n,i=Math.ceil(r),o=[];for(var a in this.cells)for(var s=this.cells[a],h=0;h<Math.min(i,s.length);h++)o.push(s[h].key);return o},t}();e.LabelGrid=r,e.edgeLabelsToDisplayFromNodes=function(t){var e=t.graph,n=t.hoveredNode,r=t.highlightedNodes,i=t.displayedNodeLabels,o=[];return e.forEachEdge((function(t,e,a,s){(a===n||s===n||r.has(a)||r.has(s)||i.has(a)&&i.has(s))&&o.push(t)})),o}},461:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.rectangleCollidesWithQuad=e.squareCollidesWithQuad=e.getCircumscribedAlignedRectangle=e.isRectangleAligned=void 0;var i=r(n(796)),o=!1;function a(t){return t.x1===t.x2||t.y1===t.y2}function s(t){var e=Math.sqrt(Math.pow(t.x2-t.x1,2)+Math.pow(t.y2-t.y1,2)),n=(t.y1-t.y2)*t.height/e,r=(t.x2-t.x1)*t.height/e,i={x:t.x1,y:t.y1},o={x:t.x2,y:t.y2},a={x:t.x1+n,y:t.y1+r},s={x:t.x2+n,y:t.y2+r},h=Math.min(i.x,o.x,a.x,s.x),u=Math.max(i.x,o.x,a.x,s.x),c=Math.min(i.y,o.y,a.y,s.y);return{x1:h,y1:c,x2:u,y2:c,height:Math.max(i.y,o.y,a.y,s.y)-c}}function h(t,e,n,r,i,o,a){return t<r+o&&t+n>r&&e<i+a&&e+n>i}function u(t,e,n,r,i,o,a,s){return t<i+a&&t+n>i&&e<o+s&&e+r>o}function c(t,e,n,r,i,o){var a=t<n+i/2;return e<r+o/2?a?1:2:a?3:4}e.isRectangleAligned=a,e.getCircumscribedAlignedRectangle=s,e.squareCollidesWithQuad=h,e.rectangleCollidesWithQuad=u;var d=function(){function t(t){var e;void 0===t&&(t={}),this.containers=((e={})[5460]=[],e),this.cache=null,this.lastRectangle=null;var n=Math.pow(4,5);this.data=new Float32Array((4*n-1)/3*4),t.boundaries?this.resize(t.boundaries):this.resize({x:0,y:0,width:1,height:1})}return t.prototype.add=function(t,e,n,r){return function(t,e,n,r,i,a,s){for(var u=i-s,c=a-s,d=2*s,l=0,p=0;;){if(l>=5)return n[p]=n[p]||[],void n[p].push(r);var f=4*p+4,g=4*p+8,v=4*p+12,y=4*p+16,m=h(u,c,d,e[f+0],e[f+1],e[f+2],e[f+3]),b=h(u,c,d,e[g+0],e[g+1],e[g+2],e[g+3]),w=h(u,c,d,e[v+0],e[v+1],e[v+2],e[v+3]),_=h(u,c,d,e[y+0],e[y+1],e[y+2],e[y+3]),x=[m,b,w,_].reduce((function(t,e){return e?t+1:t}),0);if(0===x&&0===l)return n[5460].push(r),void(!o&&n[5460].length>=5&&(o=!0,console.warn("sigma/quadtree.insertNode: At least 5 nodes are outside the global quadtree zone. You might have a problem with the normalization function or the custom bounding box.")));if(0===x)throw new Error("sigma/quadtree.insertNode: no collision (level: ".concat(l,", key: ").concat(r,", x: ").concat(i,", y: ").concat(a,", size: ").concat(s,")."));if(3===x)throw new Error("sigma/quadtree.insertNode: 3 impossible collisions (level: ".concat(l,", key: ").concat(r,", x: ").concat(i,", y: ").concat(a,", size: ").concat(s,")."));if(x>1)return n[p]=n[p]||[],void n[p].push(r);l++,m&&(p=f),b&&(p=g),w&&(p=v),_&&(p=y)}}(0,this.data,this.containers,t,e,n,r),this},t.prototype.resize=function(t){this.clear(),this.data[0]=t.x,this.data[1]=t.y,this.data[2]=t.width,this.data[3]=t.height,function(t,e){for(var n=[0,0];n.length;){var r=n.pop(),i=n.pop(),o=4*i+4,a=4*i+8,s=4*i+12,h=4*i+16,u=e[i+0],c=e[i+1],d=e[i+2]/2,l=e[i+3]/2;e[o+0]=u,e[o+1]=c,e[o+2]=d,e[o+3]=l,e[a+0]=u+d,e[a+1]=c,e[a+2]=d,e[a+3]=l,e[s+0]=u,e[s+1]=c+l,e[s+2]=d,e[s+3]=l,e[h+0]=u+d,e[h+1]=c+l,e[h+2]=d,e[h+3]=l,r<4&&(n.push(h,r+1),n.push(s,r+1),n.push(a,r+1),n.push(o,r+1))}}(0,this.data)},t.prototype.clear=function(){var t;return this.containers=((t={})[5460]=[],t),this},t.prototype.point=function(t,e){var n=this.containers[5460].slice(),r=0,o=0;do{this.containers[r]&&(0,i.default)(n,this.containers[r]),r=4*r+4*c(t,e,this.data[r+0],this.data[r+1],this.data[r+2],this.data[r+3]),o++}while(o<=5);return n},t.prototype.rectangle=function(t,e,n,r,o){var h=this.lastRectangle;return h&&t===h.x1&&n===h.x2&&e===h.y1&&r===h.y2&&o===h.height||(this.lastRectangle={x1:t,y1:e,x2:n,y2:r,height:o},a(this.lastRectangle)||(this.lastRectangle=s(this.lastRectangle)),this.cache=function(t,e,n,r,o,a,s){for(var h,c=[0,0],d=[];c.length;){var l=c.pop(),p=c.pop();if((h=n[p])&&(0,i.default)(d,h),!(l>=5)){var f=4*p+4,g=4*p+8,v=4*p+12,y=4*p+16,m=u(r,o,a,s,e[f+0],e[f+1],e[f+2],e[f+3]),b=u(r,o,a,s,e[g+0],e[g+1],e[g+2],e[g+3]),w=u(r,o,a,s,e[v+0],e[v+1],e[v+2],e[v+3]),_=u(r,o,a,s,e[y+0],e[y+1],e[y+2],e[y+3]);m&&c.push(f,l+1),b&&c.push(g,l+1),w&&c.push(v,l+1),_&&c.push(y,l+1)}}return d}(0,this.data,this.containers,t,e,Math.abs(t-n)||Math.abs(e-r),o),(0,i.default)(this.cache,this.containers[5460])),this.cache},t}();e.default=d},26:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Sigma=e.MouseCaptor=e.QuadTree=e.Camera=void 0;var i=r(n(248));e.Sigma=i.default;var o=r(n(554));e.Camera=o.default;var a=r(n(461));e.QuadTree=a.default;var s=r(n(886));e.MouseCaptor=s.default,e.default=i.default},294:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,n,r,i){var o=i.edgeLabelSize,a=i.edgeLabelFont,s=i.edgeLabelWeight,h=i.edgeLabelColor.attribute?e[i.edgeLabelColor.attribute]||i.edgeLabelColor.color||"#000":i.edgeLabelColor.color,u=e.label;if(u){t.fillStyle=h,t.font="".concat(s," ").concat(o,"px ").concat(a);var c,d,l=n.size,p=r.size,f=n.x,g=n.y,v=r.x,y=r.y,m=v-f,b=y-g,w=Math.sqrt(m*m+b*b);if(!(w<l+p)){c=((f+=m*l/w)+(v-=m*p/w))/2,d=((g+=b*l/w)+(y-=b*p/w))/2,m=v-f,b=y-g,w=Math.sqrt(m*m+b*b);var _,x=t.measureText(u).width;if(x>w){for(u+="…",x=t.measureText(u).width;x>w&&u.length>1;)u=u.slice(0,-2)+"…",x=t.measureText(u).width;if(u.length<4)return}_=m>0?b>0?Math.acos(m/w):Math.asin(b/w):b>0?Math.acos(m/w)+Math.PI:Math.asin(m/w)+Math.PI/2,t.save(),t.translate(c,d),t.rotate(_),t.fillText(u,-x/2,e.size/2+o),t.restore()}}}},607:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(577));e.default=function(t,e,n){var r=n.labelSize,o=n.labelFont,a=n.labelWeight;if(t.font="".concat(a," ").concat(r,"px ").concat(o),t.fillStyle="#FFF",t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=8,t.shadowColor="#000","string"==typeof e.label){var s=t.measureText(e.label).width,h=Math.round(s+5),u=Math.round(r+4),c=Math.max(e.size,r/2)+2,d=Math.asin(u/2/c),l=Math.sqrt(Math.abs(Math.pow(c,2)-Math.pow(u/2,2)));t.beginPath(),t.moveTo(e.x+l,e.y+u/2),t.lineTo(e.x+c+h,e.y+u/2),t.lineTo(e.x+c+h,e.y-u/2),t.lineTo(e.x+l,e.y-u/2),t.arc(e.x,e.y,c,d,-d),t.closePath(),t.fill()}else t.beginPath(),t.arc(e.x,e.y,e.size+2,0,2*Math.PI),t.closePath(),t.fill();t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=0,(0,i.default)(t,e,n)}},577:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,n){if(e.label){var r=n.labelSize,i=n.labelFont,o=n.labelWeight,a=n.labelColor.attribute?e[n.labelColor.attribute]||n.labelColor.color||"#000":n.labelColor.color;t.fillStyle=a,t.font="".concat(o," ").concat(r,"px ").concat(i),t.fillText(e.label,e.x+e.size+3,e.y+r/3)}}},917:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.createEdgeCompoundProgram=e.AbstractEdgeProgram=void 0;var o=function(t){function e(e,n,r,i,o){return t.call(this,e,n,r,i,o)||this}return i(e,t),e}(n(973).AbstractProgram);e.AbstractEdgeProgram=o,e.createEdgeCompoundProgram=function(t){return function(){function e(e,n){this.programs=t.map((function(t){return new t(e,n)}))}return e.prototype.bufferData=function(){this.programs.forEach((function(t){return t.bufferData()}))},e.prototype.allocate=function(t){this.programs.forEach((function(e){return e.allocate(t)}))},e.prototype.bind=function(){},e.prototype.computeIndices=function(){this.programs.forEach((function(t){return t.computeIndices()}))},e.prototype.render=function(t){this.programs.forEach((function(e){e.bind(),e.bufferData(),e.render(t)}))},e.prototype.process=function(t,e,n,r,i){this.programs.forEach((function(o){return o.process(t,e,n,r,i)}))},e}()}},533:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.createNodeCompoundProgram=e.AbstractNodeProgram=void 0;var o=function(t){function e(e,n,r,i,o){var a=t.call(this,e,n,r,i,o)||this;a.positionLocation=e.getAttribLocation(a.program,"a_position"),a.sizeLocation=e.getAttribLocation(a.program,"a_size"),a.colorLocation=e.getAttribLocation(a.program,"a_color");var s=e.getUniformLocation(a.program,"u_matrix");if(null===s)throw new Error("AbstractNodeProgram: error while getting matrixLocation");a.matrixLocation=s;var h=e.getUniformLocation(a.program,"u_ratio");if(null===h)throw new Error("AbstractNodeProgram: error while getting ratioLocation");a.ratioLocation=h;var u=e.getUniformLocation(a.program,"u_scale");if(null===u)throw new Error("AbstractNodeProgram: error while getting scaleLocation");return a.scaleLocation=u,a}return i(e,t),e.prototype.bind=function(){var t=this.gl;t.enableVertexAttribArray(this.positionLocation),t.enableVertexAttribArray(this.sizeLocation),t.enableVertexAttribArray(this.colorLocation),t.vertexAttribPointer(this.positionLocation,2,t.FLOAT,!1,this.attributes*Float32Array.BYTES_PER_ELEMENT,0),t.vertexAttribPointer(this.sizeLocation,1,t.FLOAT,!1,this.attributes*Float32Array.BYTES_PER_ELEMENT,8),t.vertexAttribPointer(this.colorLocation,4,t.UNSIGNED_BYTE,!0,this.attributes*Float32Array.BYTES_PER_ELEMENT,12)},e}(n(973).AbstractProgram);e.AbstractNodeProgram=o,e.createNodeCompoundProgram=function(t){return function(){function e(e,n){this.programs=t.map((function(t){return new t(e,n)}))}return e.prototype.bufferData=function(){this.programs.forEach((function(t){return t.bufferData()}))},e.prototype.allocate=function(t){this.programs.forEach((function(e){return e.allocate(t)}))},e.prototype.bind=function(){},e.prototype.render=function(t){this.programs.forEach((function(e){e.bind(),e.bufferData(),e.render(t)}))},e.prototype.process=function(t,e,n){this.programs.forEach((function(r){return r.process(t,e,n)}))},e}()}},973:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractProgram=void 0;var r=n(538),i=function(){function t(t,e,n,i,o){this.array=new Float32Array,this.points=i,this.attributes=o,this.gl=t,this.vertexShaderSource=e,this.fragmentShaderSource=n;var a=t.createBuffer();if(null===a)throw new Error("AbstractProgram: error while creating the buffer");this.buffer=a,t.bindBuffer(t.ARRAY_BUFFER,this.buffer),this.vertexShader=(0,r.loadVertexShader)(t,this.vertexShaderSource),this.fragmentShader=(0,r.loadFragmentShader)(t,this.fragmentShaderSource),this.program=(0,r.loadProgram)(t,[this.vertexShader,this.fragmentShader])}return t.prototype.bufferData=function(){var t=this.gl;t.bufferData(t.ARRAY_BUFFER,this.array,t.DYNAMIC_DRAW)},t.prototype.allocate=function(t){this.array=new Float32Array(this.points*this.attributes*t)},t.prototype.hasNothingToRender=function(){return 0===this.array.length},t}();e.AbstractProgram=i},638:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(917),o=r(n(747)),a=r(n(874)),s=(0,i.createEdgeCompoundProgram)([a.default,o.default]);e.default=s},747:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=n(524),s=o(n(191)),h=o(n(83)),u=function(t){function e(e){var n=t.call(this,e,s.default,h.default,3,9)||this;n.positionLocation=e.getAttribLocation(n.program,"a_position"),n.colorLocation=e.getAttribLocation(n.program,"a_color"),n.normalLocation=e.getAttribLocation(n.program,"a_normal"),n.radiusLocation=e.getAttribLocation(n.program,"a_radius"),n.barycentricLocation=e.getAttribLocation(n.program,"a_barycentric");var r=e.getUniformLocation(n.program,"u_matrix");if(null===r)throw new Error("EdgeArrowHeadProgram: error while getting matrixLocation");n.matrixLocation=r;var i=e.getUniformLocation(n.program,"u_sqrtZoomRatio");if(null===i)throw new Error("EdgeArrowHeadProgram: error while getting sqrtZoomRatioLocation");n.sqrtZoomRatioLocation=i;var o=e.getUniformLocation(n.program,"u_correctionRatio");if(null===o)throw new Error("EdgeArrowHeadProgram: error while getting correctionRatioLocation");return n.correctionRatioLocation=o,n.bind(),n}return i(e,t),e.prototype.bind=function(){var t=this.gl;t.enableVertexAttribArray(this.positionLocation),t.enableVertexAttribArray(this.normalLocation),t.enableVertexAttribArray(this.radiusLocation),t.enableVertexAttribArray(this.colorLocation),t.enableVertexAttribArray(this.barycentricLocation),t.vertexAttribPointer(this.positionLocation,2,t.FLOAT,!1,9*Float32Array.BYTES_PER_ELEMENT,0),t.vertexAttribPointer(this.normalLocation,2,t.FLOAT,!1,9*Float32Array.BYTES_PER_ELEMENT,8),t.vertexAttribPointer(this.radiusLocation,1,t.FLOAT,!1,9*Float32Array.BYTES_PER_ELEMENT,16),t.vertexAttribPointer(this.colorLocation,4,t.UNSIGNED_BYTE,!0,9*Float32Array.BYTES_PER_ELEMENT,20),t.vertexAttribPointer(this.barycentricLocation,3,t.FLOAT,!1,9*Float32Array.BYTES_PER_ELEMENT,24)},e.prototype.computeIndices=function(){},e.prototype.process=function(t,e,n,r,i){if(r)for(var o=27*i,s=o+27;o<s;o++)this.array[o]=0;else{var h=n.size||1,u=e.size||1,c=t.x,d=t.y,l=e.x,p=e.y,f=(0,a.floatColor)(n.color),g=l-c,v=p-d,y=g*g+v*v,m=0,b=0;y&&(m=-v*(y=1/Math.sqrt(y))*h,b=g*y*h);var w=27*i,_=this.array;_[w++]=l,_[w++]=p,_[w++]=-m,_[w++]=-b,_[w++]=u,_[w++]=f,_[w++]=1,_[w++]=0,_[w++]=0,_[w++]=l,_[w++]=p,_[w++]=-m,_[w++]=-b,_[w++]=u,_[w++]=f,_[w++]=0,_[w++]=1,_[w++]=0,_[w++]=l,_[w++]=p,_[w++]=-m,_[w++]=-b,_[w++]=u,_[w++]=f,_[w++]=0,_[w++]=0,_[w]=1}},e.prototype.render=function(t){if(!this.hasNothingToRender()){var e=this.gl,n=this.program;e.useProgram(n),e.uniformMatrix3fv(this.matrixLocation,!1,t.matrix),e.uniform1f(this.sqrtZoomRatioLocation,Math.sqrt(t.ratio)),e.uniform1f(this.correctionRatioLocation,t.correctionRatio),e.drawArrays(e.TRIANGLES,0,this.array.length/9)}},e}(n(917).AbstractEdgeProgram);e.default=u},874:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=n(917),s=n(524),h=o(n(73)),u=o(n(879)),c=function(t){function e(e){var n=t.call(this,e,h.default,u.default,4,6)||this,r=e.createBuffer();if(null===r)throw new Error("EdgeClampedProgram: error while getting resolutionLocation");n.indicesBuffer=r,n.positionLocation=e.getAttribLocation(n.program,"a_position"),n.colorLocation=e.getAttribLocation(n.program,"a_color"),n.normalLocation=e.getAttribLocation(n.program,"a_normal"),n.radiusLocation=e.getAttribLocation(n.program,"a_radius");var i=e.getUniformLocation(n.program,"u_matrix");if(null===i)throw new Error("EdgeClampedProgram: error while getting matrixLocation");n.matrixLocation=i;var o=e.getUniformLocation(n.program,"u_sqrtZoomRatio");if(null===o)throw new Error("EdgeClampedProgram: error while getting cameraRatioLocation");n.sqrtZoomRatioLocation=o;var a=e.getUniformLocation(n.program,"u_correctionRatio");if(null===a)throw new Error("EdgeClampedProgram: error while getting viewportRatioLocation");return n.correctionRatioLocation=a,n.canUse32BitsIndices=(0,s.canUse32BitsIndices)(e),n.IndicesArray=n.canUse32BitsIndices?Uint32Array:Uint16Array,n.indicesArray=new n.IndicesArray,n.indicesType=n.canUse32BitsIndices?e.UNSIGNED_INT:e.UNSIGNED_SHORT,n.bind(),n}return i(e,t),e.prototype.bind=function(){var t=this.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indicesBuffer),t.enableVertexAttribArray(this.positionLocation),t.enableVertexAttribArray(this.normalLocation),t.enableVertexAttribArray(this.colorLocation),t.enableVertexAttribArray(this.radiusLocation),t.vertexAttribPointer(this.positionLocation,2,t.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,0),t.vertexAttribPointer(this.normalLocation,2,t.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,8),t.vertexAttribPointer(this.colorLocation,4,t.UNSIGNED_BYTE,!0,6*Float32Array.BYTES_PER_ELEMENT,16),t.vertexAttribPointer(this.radiusLocation,1,t.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,20)},e.prototype.process=function(t,e,n,r,i){if(r)for(var o=24*i,a=o+24;o<a;o++)this.array[o]=0;else{var h=n.size||1,u=t.x,c=t.y,d=e.x,l=e.y,p=e.size||1,f=(0,s.floatColor)(n.color),g=d-u,v=l-c,y=g*g+v*v,m=0,b=0;y&&(m=-v*(y=1/Math.sqrt(y))*h,b=g*y*h);var w=24*i,_=this.array;_[w++]=u,_[w++]=c,_[w++]=m,_[w++]=b,_[w++]=f,_[w++]=0,_[w++]=u,_[w++]=c,_[w++]=-m,_[w++]=-b,_[w++]=f,_[w++]=0,_[w++]=d,_[w++]=l,_[w++]=m,_[w++]=b,_[w++]=f,_[w++]=p,_[w++]=d,_[w++]=l,_[w++]=-m,_[w++]=-b,_[w++]=f,_[w]=-p}},e.prototype.computeIndices=function(){for(var t=this.array.length/6,e=t+t/2,n=new this.IndicesArray(e),r=0,i=0;r<t;r+=4)n[i++]=r,n[i++]=r+1,n[i++]=r+2,n[i++]=r+2,n[i++]=r+1,n[i++]=r+3;this.indicesArray=n},e.prototype.bufferData=function(){t.prototype.bufferData.call(this);var e=this.gl;e.bufferData(e.ELEMENT_ARRAY_BUFFER,this.indicesArray,e.STATIC_DRAW)},e.prototype.render=function(t){if(!this.hasNothingToRender()){var e=this.gl,n=this.program;e.useProgram(n),e.uniformMatrix3fv(this.matrixLocation,!1,t.matrix),e.uniform1f(this.sqrtZoomRatioLocation,Math.sqrt(t.ratio)),e.uniform1f(this.correctionRatioLocation,t.correctionRatio),e.drawElements(e.TRIANGLES,this.indicesArray.length,this.indicesType,0)}},e}(a.AbstractEdgeProgram);e.default=c},857:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=n(524),s=o(n(372)),h=o(n(879)),u=function(t){function e(e){var n=t.call(this,e,s.default,h.default,4,5)||this,r=e.createBuffer();if(null===r)throw new Error("EdgeProgram: error while creating indicesBuffer");n.indicesBuffer=r,n.positionLocation=e.getAttribLocation(n.program,"a_position"),n.colorLocation=e.getAttribLocation(n.program,"a_color"),n.normalLocation=e.getAttribLocation(n.program,"a_normal");var i=e.getUniformLocation(n.program,"u_matrix");if(null===i)throw new Error("EdgeProgram: error while getting matrixLocation");n.matrixLocation=i;var o=e.getUniformLocation(n.program,"u_correctionRatio");if(null===o)throw new Error("EdgeProgram: error while getting correctionRatioLocation");n.correctionRatioLocation=o;var u=e.getUniformLocation(n.program,"u_sqrtZoomRatio");if(null===u)throw new Error("EdgeProgram: error while getting sqrtZoomRatioLocation");return n.sqrtZoomRatioLocation=u,n.canUse32BitsIndices=(0,a.canUse32BitsIndices)(e),n.IndicesArray=n.canUse32BitsIndices?Uint32Array:Uint16Array,n.indicesArray=new n.IndicesArray,n.indicesType=n.canUse32BitsIndices?e.UNSIGNED_INT:e.UNSIGNED_SHORT,n.bind(),n}return i(e,t),e.prototype.bind=function(){var t=this.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indicesBuffer),t.enableVertexAttribArray(this.positionLocation),t.enableVertexAttribArray(this.normalLocation),t.enableVertexAttribArray(this.colorLocation),t.vertexAttribPointer(this.positionLocation,2,t.FLOAT,!1,5*Float32Array.BYTES_PER_ELEMENT,0),t.vertexAttribPointer(this.normalLocation,2,t.FLOAT,!1,5*Float32Array.BYTES_PER_ELEMENT,8),t.vertexAttribPointer(this.colorLocation,4,t.UNSIGNED_BYTE,!0,5*Float32Array.BYTES_PER_ELEMENT,16)},e.prototype.computeIndices=function(){for(var t=this.array.length/5,e=t+t/2,n=new this.IndicesArray(e),r=0,i=0;r<t;r+=4)n[i++]=r,n[i++]=r+1,n[i++]=r+2,n[i++]=r+2,n[i++]=r+1,n[i++]=r+3;this.indicesArray=n},e.prototype.bufferData=function(){t.prototype.bufferData.call(this);var e=this.gl;e.bufferData(e.ELEMENT_ARRAY_BUFFER,this.indicesArray,e.STATIC_DRAW)},e.prototype.process=function(t,e,n,r,i){if(r)for(var o=20*i,s=o+20;o<s;o++)this.array[o]=0;else{var h=n.size||1,u=t.x,c=t.y,d=e.x,l=e.y,p=(0,a.floatColor)(n.color),f=d-u,g=l-c,v=f*f+g*g,y=0,m=0;v&&(y=-g*(v=1/Math.sqrt(v))*h,m=f*v*h);var b=20*i,w=this.array;w[b++]=u,w[b++]=c,w[b++]=y,w[b++]=m,w[b++]=p,w[b++]=u,w[b++]=c,w[b++]=-y,w[b++]=-m,w[b++]=p,w[b++]=d,w[b++]=l,w[b++]=y,w[b++]=m,w[b++]=p,w[b++]=d,w[b++]=l,w[b++]=-y,w[b++]=-m,w[b]=p}},e.prototype.render=function(t){if(!this.hasNothingToRender()){var e=this.gl,n=this.program;e.useProgram(n),e.uniformMatrix3fv(this.matrixLocation,!1,t.matrix),e.uniform1f(this.sqrtZoomRatioLocation,Math.sqrt(t.ratio)),e.uniform1f(this.correctionRatioLocation,t.correctionRatio),e.drawElements(e.TRIANGLES,this.indicesArray.length,this.indicesType,0)}},e}(n(917).AbstractEdgeProgram);e.default=u},37:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=n(524),s=o(n(146)),h=o(n(546)),u=function(t){function e(e){var n=t.call(this,e,s.default,h.default,1,4)||this;return n.bind(),n}return i(e,t),e.prototype.process=function(t,e,n){var r=this.array,i=1*n*4;if(e)return r[i++]=0,r[i++]=0,r[i++]=0,void(r[i++]=0);var o=(0,a.floatColor)(t.color);r[i++]=t.x,r[i++]=t.y,r[i++]=t.size,r[i]=o},e.prototype.render=function(t){if(!this.hasNothingToRender()){var e=this.gl,n=this.program;e.useProgram(n),e.uniform1f(this.ratioLocation,1/Math.sqrt(t.ratio)),e.uniform1f(this.scaleLocation,t.scalingRatio),e.uniformMatrix3fv(this.matrixLocation,!1,t.matrix),e.drawArrays(e.POINTS,0,this.array.length/4)}},e}(n(533).AbstractNodeProgram);e.default=u},83:t=>{(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{default:()=>r});const r="precision mediump float;\n\nvarying vec4 v_color;\n\nvoid main(void) {\n gl_FragColor = v_color;\n}\n";t.exports=n})()},191:t=>{(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{default:()=>r});const r="attribute vec2 a_position;\nattribute vec2 a_normal;\nattribute float a_radius;\nattribute vec4 a_color;\nattribute vec3 a_barycentric;\n\nuniform mat3 u_matrix;\nuniform float u_sqrtZoomRatio;\nuniform float u_correctionRatio;\n\nvarying vec4 v_color;\n\nconst float minThickness = 1.7;\nconst float bias = 255.0 / 254.0;\nconst float arrowHeadWidthLengthRatio = 0.66;\nconst float arrowHeadLengthThicknessRatio = 2.5;\n\nvoid main() {\n float normalLength = length(a_normal);\n vec2 unitNormal = a_normal / normalLength;\n\n // These first computations are taken from edge.vert.glsl and\n // edge.clamped.vert.glsl. Please read it to get better comments on what's\n // happening:\n float pixelsThickness = max(normalLength, minThickness * u_sqrtZoomRatio);\n float webGLThickness = pixelsThickness * u_correctionRatio;\n float adaptedWebGLThickness = webGLThickness * u_sqrtZoomRatio;\n float adaptedWebGLNodeRadius = a_radius * 2.0 * u_correctionRatio * u_sqrtZoomRatio;\n float adaptedWebGLArrowHeadLength = adaptedWebGLThickness * 2.0 * arrowHeadLengthThicknessRatio;\n float adaptedWebGLArrowHeadHalfWidth = adaptedWebGLArrowHeadLength * arrowHeadWidthLengthRatio / 2.0;\n\n float da = a_barycentric.x;\n float db = a_barycentric.y;\n float dc = a_barycentric.z;\n\n vec2 delta = vec2(\n da * (adaptedWebGLNodeRadius * unitNormal.y)\n + db * ((adaptedWebGLNodeRadius + adaptedWebGLArrowHeadLength) * unitNormal.y + adaptedWebGLArrowHeadHalfWidth * unitNormal.x)\n + dc * ((adaptedWebGLNodeRadius + adaptedWebGLArrowHeadLength) * unitNormal.y - adaptedWebGLArrowHeadHalfWidth * unitNormal.x),\n\n da * (-adaptedWebGLNodeRadius * unitNormal.x)\n + db * (-(adaptedWebGLNodeRadius + adaptedWebGLArrowHeadLength) * unitNormal.x + adaptedWebGLArrowHeadHalfWidth * unitNormal.y)\n + dc * (-(adaptedWebGLNodeRadius + adaptedWebGLArrowHeadLength) * unitNormal.x - adaptedWebGLArrowHeadHalfWidth * unitNormal.y)\n );\n\n vec2 position = (u_matrix * vec3(a_position + delta, 1)).xy;\n\n gl_Position = vec4(position, 0, 1);\n\n // Extract the color:\n v_color = a_color;\n v_color.a *= bias;\n}\n";t.exports=n})()},73:t=>{(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{default:()=>r});const r="attribute vec4 a_color;\nattribute vec2 a_normal;\nattribute vec2 a_position;\nattribute float a_radius;\n\nuniform mat3 u_matrix;\nuniform float u_sqrtZoomRatio;\nuniform float u_correctionRatio;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_thickness;\n\nconst float minThickness = 1.7;\nconst float bias = 255.0 / 254.0;\nconst float arrowHeadLengthThicknessRatio = 2.5;\n\nvoid main() {\n float normalLength = length(a_normal);\n vec2 unitNormal = a_normal / normalLength;\n\n // These first computations are taken from edge.vert.glsl. Please read it to\n // get better comments on what's happening:\n float pixelsThickness = max(normalLength, minThickness * u_sqrtZoomRatio);\n float webGLThickness = pixelsThickness * u_correctionRatio;\n float adaptedWebGLThickness = webGLThickness * u_sqrtZoomRatio;\n\n // Here, we move the point to leave space for the arrow head:\n float direction = sign(a_radius);\n float adaptedWebGLNodeRadius = direction * a_radius * 2.0 * u_correctionRatio * u_sqrtZoomRatio;\n float adaptedWebGLArrowHeadLength = adaptedWebGLThickness * 2.0 * arrowHeadLengthThicknessRatio;\n\n vec2 compensationVector = vec2(-direction * unitNormal.y, direction * unitNormal.x) * (adaptedWebGLNodeRadius + adaptedWebGLArrowHeadLength);\n\n // Here is the proper position of the vertex\n gl_Position = vec4((u_matrix * vec3(a_position + unitNormal * adaptedWebGLThickness + compensationVector, 1)).xy, 0, 1);\n\n v_thickness = webGLThickness / u_sqrtZoomRatio;\n\n v_normal = unitNormal;\n v_color = a_color;\n v_color.a *= bias;\n}\n";t.exports=n})()},879:t=>{(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{default:()=>r});const r="precision mediump float;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_thickness;\n\nconst float feather = 0.001;\nconst vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);\n\nvoid main(void) {\n float dist = length(v_normal) * v_thickness;\n\n float t = smoothstep(\n v_thickness - feather,\n v_thickness,\n dist\n );\n\n gl_FragColor = mix(v_color, transparent, t);\n}\n";t.exports=n})()},372:t=>{(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{default:()=>r});const r='attribute vec4 a_color;\nattribute vec2 a_normal;\nattribute vec2 a_position;\n\nuniform mat3 u_matrix;\nuniform float u_sqrtZoomRatio;\nuniform float u_correctionRatio;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_thickness;\n\nconst float minThickness = 1.7;\nconst float bias = 255.0 / 254.0;\n\nvoid main() {\n float normalLength = length(a_normal);\n vec2 unitNormal = a_normal / normalLength;\n\n // We require edges to be at least `minThickness` pixels thick *on screen*\n // (so we need to compensate the SQRT zoom ratio):\n float pixelsThickness = max(normalLength, minThickness * u_sqrtZoomRatio);\n\n // Then, we need to retrieve the normalized thickness of the edge in the WebGL\n // referential (in a ([0, 1], [0, 1]) space), using our "magic" correction\n // ratio:\n float webGLThickness = pixelsThickness * u_correctionRatio;\n\n // Finally, we adapt the edge thickness to the "SQRT rule" in sigma (so that\n // items are not too big when zoomed in, and not too small when zoomed out).\n // The exact computation should be `adapted = value * zoom / sqrt(zoom)`, but\n // it\'s simpler like this:\n float adaptedWebGLThickness = webGLThickness * u_sqrtZoomRatio;\n\n // Here is the proper position of the vertex\n gl_Position = vec4((u_matrix * vec3(a_position + unitNormal * adaptedWebGLThickness, 1)).xy, 0, 1);\n\n // For the fragment shader though, we need a thickness that takes the "magic"\n // correction ratio into account (as in webGLThickness), but so that the\n // antialiasing effect does not depend on the zoom level. So here\'s yet\n // another thickness version:\n v_thickness = webGLThickness / u_sqrtZoomRatio;\n\n v_normal = unitNormal;\n v_color = a_color;\n v_color.a *= bias;\n}\n';t.exports=n})()},546:t=>{(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{default:()=>r});const r="precision mediump float;\n\nvarying vec4 v_color;\nvarying float v_border;\n\nconst float radius = 0.5;\nconst vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);\n\nvoid main(void) {\n vec2 m = gl_PointCoord - vec2(0.5, 0.5);\n float dist = radius - length(m);\n\n float t = 0.0;\n if (dist > v_border)\n t = 1.0;\n else if (dist > 0.0)\n t = dist / v_border;\n\n gl_FragColor = mix(transparent, v_color, t);\n}\n";t.exports=n})()},146:t=>{(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{default:()=>r});const r="attribute vec2 a_position;\nattribute float a_size;\nattribute vec4 a_color;\n\nuniform float u_ratio;\nuniform float u_scale;\nuniform mat3 u_matrix;\n\nvarying vec4 v_color;\nvarying float v_border;\n\nconst float bias = 255.0 / 254.0;\n\nvoid main() {\n gl_Position = vec4(\n (u_matrix * vec3(a_position, 1)).xy,\n 0,\n 1\n );\n\n // Multiply the point size twice:\n // - x SCALING_RATIO to correct the canvas scaling\n // - x 2 to correct the formulae\n gl_PointSize = a_size * u_ratio * u_scale * 2.0;\n\n v_border = (1.0 / u_ratio) * (0.5 / a_size);\n\n // Extract the color:\n v_color = a_color;\n v_color.a *= bias;\n}\n";t.exports=n})()},538:(t,e)=>{"use strict";function n(t,e,n){var r="VERTEX"===t?e.VERTEX_SHADER:e.FRAGMENT_SHADER,i=e.createShader(r);if(null===i)throw new Error("loadShader: error while creating the shader");if(e.shaderSource(i,n),e.compileShader(i),!e.getShaderParameter(i,e.COMPILE_STATUS)){var o=e.getShaderInfoLog(i);throw e.deleteShader(i),new Error("loadShader: error while compiling the shader:\n".concat(o,"\n").concat(n))}return i}Object.defineProperty(e,"__esModule",{value:!0}),e.loadProgram=e.loadFragmentShader=e.loadVertexShader=void 0,e.loadVertexShader=function(t,e){return n("VERTEX",t,e)},e.loadFragmentShader=function(t,e){return n("FRAGMENT",t,e)},e.loadProgram=function(t,e){var n,r,i=t.createProgram();if(null===i)throw new Error("loadProgram: error while creating the program.");for(n=0,r=e.length;n<r;n++)t.attachShader(i,e[n]);if(t.linkProgram(i),!t.getProgramParameter(i,t.LINK_STATUS))throw t.deleteProgram(i),new Error("loadProgram: error while linking the program.");return i}},482:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSettings=e.validateSettings=e.DEFAULT_EDGE_PROGRAM_CLASSES=e.DEFAULT_NODE_PROGRAM_CLASSES=e.DEFAULT_SETTINGS=void 0;var i=n(524),o=r(n(577)),a=r(n(607)),s=r(n(294)),h=r(n(37)),u=r(n(857)),c=r(n(638));e.DEFAULT_SETTINGS={hideEdgesOnMove:!1,hideLabelsOnMove:!1,renderLabels:!0,renderEdgeLabels:!1,enableEdgeClickEvents:!1,enableEdgeWheelEvents:!1,enableEdgeHoverEvents:!1,defaultNodeColor:"#999",defaultNodeType:"circle",defaultEdgeColor:"#ccc",defaultEdgeType:"line",labelFont:"Arial",labelSize:14,labelWeight:"normal",labelColor:{color:"#000"},edgeLabelFont:"Arial",edgeLabelSize:14,edgeLabelWeight:"normal",edgeLabelColor:{attribute:"color"},stagePadding:30,labelDensity:1,labelGridCellSize:100,labelRenderedSizeThreshold:6,nodeReducer:null,edgeReducer:null,zIndex:!1,minCameraRatio:null,maxCameraRatio:null,labelRenderer:o.default,hoverRenderer:a.default,edgeLabelRenderer:s.default,allowInvalidContainer:!1,nodeProgramClasses:{},nodeHoverProgramClasses:{},edgeProgramClasses:{}},e.DEFAULT_NODE_PROGRAM_CLASSES={circle:h.default},e.DEFAULT_EDGE_PROGRAM_CLASSES={arrow:c.default,line:u.default},e.validateSettings=function(t){if("number"!=typeof t.labelDensity||t.labelDensity<0)throw new Error("Settings: invalid `labelDensity`. Expecting a positive number.");var e=t.minCameraRatio,n=t.maxCameraRatio;if("number"==typeof e&&"number"==typeof n&&n<e)throw new Error("Settings: invalid camera ratio boundaries. Expecting `maxCameraRatio` to be greater than `minCameraRatio`.")},e.resolveSettings=function(t){var n=(0,i.assign)({},e.DEFAULT_SETTINGS,t);return n.nodeProgramClasses=(0,i.assign)({},e.DEFAULT_NODE_PROGRAM_CLASSES,n.nodeProgramClasses),n.edgeProgramClasses=(0,i.assign)({},e.DEFAULT_EDGE_PROGRAM_CLASSES,n.edgeProgramClasses),n}},248:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__assign||function(){return o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},o.apply(this,arguments)},a=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var h=s(n(796)),u=s(n(554)),c=s(n(886)),d=s(n(461)),l=n(291),p=n(524),f=n(98),g=n(482),v=s(n(311)),y=n(132),m=n(822);function b(t,e,n){if(!n.hasOwnProperty("x")||!n.hasOwnProperty("y"))throw new Error('Sigma: could not find a valid position (x, y) for node "'.concat(e,'". All your nodes must have a number "x" and "y". Maybe your forgot to apply a layout or your "nodeReducer" is not returning the correct data?'));return n.color||(n.color=t.defaultNodeColor),n.label||""===n.label||(n.label=null),void 0!==n.label&&null!==n.label?n.label=""+n.label:n.label=null,n.size||(n.size=2),n.hasOwnProperty("hidden")||(n.hidden=!1),n.hasOwnProperty("highlighted")||(n.highlighted=!1),n.hasOwnProperty("forceLabel")||(n.forceLabel=!1),n.type&&""!==n.type||(n.type=t.defaultNodeType),n.zIndex||(n.zIndex=0),n}function w(t,e,n){return n.color||(n.color=t.defaultEdgeColor),n.label||(n.label=""),n.size||(n.size=.5),n.hasOwnProperty("hidden")||(n.hidden=!1),n.hasOwnProperty("forceLabel")||(n.forceLabel=!1),n.type&&""!==n.type||(n.type=t.defaultEdgeType),n.zIndex||(n.zIndex=0),n}var _=function(t){function e(e,n,r){void 0===r&&(r={});var i=t.call(this)||this;if(i.elements={},i.canvasContexts={},i.webGLContexts={},i.activeListeners={},i.quadtree=new d.default,i.labelGrid=new f.LabelGrid,i.nodeDataCache={},i.edgeDataCache={},i.nodesWithForcedLabels=[],i.edgesWithForcedLabels=[],i.nodeExtent={x:[0,1],y:[0,1]},i.matrix=(0,y.identity)(),i.invMatrix=(0,y.identity)(),i.correctionRatio=1,i.customBBox=null,i.normalizationFunction=(0,p.createNormalizationFunction)({x:[0,1],y:[0,1]}),i.cameraSizeRatio=1,i.width=0,i.height=0,i.pixelRatio=(0,p.getPixelRatio)(),i.displayedLabels=new Set,i.highlightedNodes=new Set,i.hoveredNode=null,i.hoveredEdge=null,i.renderFrame=null,i.renderHighlightedNodesFrame=null,i.needToProcess=!1,i.needToSoftProcess=!1,i.checkEdgesEventsFrame=null,i.nodePrograms={},i.nodeHoverPrograms={},i.edgePrograms={},i.settings=(0,g.resolveSettings)(r),(0,g.validateSettings)(i.settings),(0,p.validateGraph)(e),!(n instanceof HTMLElement))throw new Error("Sigma: container should be an html element.");for(var o in i.graph=e,i.container=n,i.createWebGLContext("edges",{preserveDrawingBuffer:!0}),i.createCanvasContext("edgeLabels"),i.createWebGLContext("nodes"),i.createCanvasContext("labels"),i.createCanvasContext("hovers"),i.createWebGLContext("hoverNodes"),i.createCanvasContext("mouse"),i.webGLContexts){var a=i.webGLContexts[o];a.blendFunc(a.ONE,a.ONE_MINUS_SRC_ALPHA),a.enable(a.BLEND)}for(var s in i.settings.nodeProgramClasses){var h=i.settings.nodeProgramClasses[s];i.nodePrograms[s]=new h(i.webGLContexts.nodes,i);var l=h;s in i.settings.nodeHoverProgramClasses&&(l=i.settings.nodeHoverProgramClasses[s]),i.nodeHoverPrograms[s]=new l(i.webGLContexts.hoverNodes,i)}for(var s in i.settings.edgeProgramClasses){var m=i.settings.edgeProgramClasses[s];i.edgePrograms[s]=new m(i.webGLContexts.edges,i)}return i.resize(),i.camera=new u.default,i.bindCameraHandlers(),i.mouseCaptor=new c.default(i.elements.mouse,i),i.touchCaptor=new v.default(i.elements.mouse,i),i.bindEventHandlers(),i.bindGraphHandlers(),i.handleSettingsUpdate(),i.process(),i.render(),i}return i(e,t),e.prototype.createCanvas=function(t){var e=(0,p.createElement)("canvas",{position:"absolute"},{class:"sigma-".concat(t)});return this.elements[t]=e,this.container.appendChild(e),e},e.prototype.createCanvasContext=function(t){var e=this.createCanvas(t);return this.canvasContexts[t]=e.getContext("2d",{preserveDrawingBuffer:!1,antialias:!1}),this},e.prototype.createWebGLContext=function(t,e){var n,r=this.createCanvas(t),i=o({preserveDrawingBuffer:!1,antialias:!1},e||{});return(n=r.getContext("webgl2",i))||(n=r.getContext("webgl",i)),n||(n=r.getContext("experimental-webgl",i)),this.webGLContexts[t]=n,this},e.prototype.bindCameraHandlers=function(){var t=this;return this.activeListeners.camera=function(){t._scheduleRefresh()},this.camera.on("updated",this.activeListeners.camera),this},e.prototype.mouseIsOnNode=function(t,e,n){var r=t.x,i=t.y,o=e.x,a=e.y;return r>o-n&&r<o+n&&i>a-n&&i<a+n&&Math.sqrt(Math.pow(r-o,2)+Math.pow(i-a,2))<n},e.prototype.getQuadNodes=function(t){var e=this.viewportToFramedGraph(t);return this.quadtree.point(e.x,1-e.y)},e.prototype.getNodeAtPosition=function(t){for(var e=t.x,n=t.y,r=this.getQuadNodes(t),i=1/0,o=null,a=0,s=r.length;a<s;a++){var h=r[a],u=this.nodeDataCache[h],c=this.framedGraphToViewport(u),d=this.scaleSize(u.size);if(!u.hidden&&this.mouseIsOnNode(t,c,d)){var l=Math.sqrt(Math.pow(e-c.x,2)+Math.pow(n-c.y,2));l<i&&(i=l,o=h)}}return o},e.prototype.bindEventHandlers=function(){var t=this;this.activeListeners.handleResize=function(){t.needToSoftProcess=!0,t._scheduleRefresh()},window.addEventListener("resize",this.activeListeners.handleResize),this.activeListeners.handleMove=function(e){var n={event:e,preventSigmaDefault:function(){e.preventSigmaDefault()}},r=t.getNodeAtPosition(e);if(r&&t.hoveredNode!==r&&!t.nodeDataCache[r].hidden)return t.hoveredNode&&t.emit("leaveNode",o(o({},n),{node:t.hoveredNode})),t.hoveredNode=r,t.emit("enterNode",o(o({},n),{node:r})),void t.scheduleHighlightedNodesRender();if(t.hoveredNode){var i=t.nodeDataCache[t.hoveredNode],a=t.framedGraphToViewport(i),s=t.scaleSize(i.size);if(!t.mouseIsOnNode(e,a,s)){var h=t.hoveredNode;return t.hoveredNode=null,t.emit("leaveNode",o(o({},n),{node:h})),void t.scheduleHighlightedNodesRender()}}!0===t.settings.enableEdgeHoverEvents?t.checkEdgeHoverEvents(n):"debounce"===t.settings.enableEdgeHoverEvents&&(t.checkEdgesEventsFrame||(t.checkEdgesEventsFrame=(0,p.requestFrame)((function(){t.checkEdgeHoverEvents(n),t.checkEdgesEventsFrame=null}))))};var e=function(e){return function(n){var r={event:n,preventSigmaDefault:function(){n.preventSigmaDefault()}},i=n.original.isFakeSigmaMouseEvent?t.getNodeAtPosition(n):t.hoveredNode;if(i)return t.emit("".concat(e,"Node"),o(o({},r),{node:i}));if("wheel"===e?t.settings.enableEdgeWheelEvents:t.settings.enableEdgeClickEvents){var a=t.getEdgeAtPoint(n.x,n.y);if(a)return t.emit("".concat(e,"Edge"),o(o({},r),{edge:a}))}return t.emit("".concat(e,"Stage"),r)}};return this.activeListeners.handleClick=e("click"),this.activeListeners.handleRightClick=e("rightClick"),this.activeListeners.handleDoubleClick=e("doubleClick"),this.activeListeners.handleWheel=e("wheel"),this.activeListeners.handleDown=e("down"),this.mouseCaptor.on("mousemove",this.activeListeners.handleMove),this.mouseCaptor.on("click",this.activeListeners.handleClick),this.mouseCaptor.on("rightClick",this.activeListeners.handleRightClick),this.mouseCaptor.on("doubleClick",this.activeListeners.handleDoubleClick),this.mouseCaptor.on("wheel",this.activeListeners.handleWheel),this.mouseCaptor.on("mousedown",this.activeListeners.handleDown),this},e.prototype.bindGraphHandlers=function(){var t=this,e=this.graph;return this.activeListeners.graphUpdate=function(){t.needToProcess=!0,t._scheduleRefresh()},this.activeListeners.softGraphUpdate=function(){t.needToSoftProcess=!0,t._scheduleRefresh()},this.activeListeners.dropNodeGraphUpdate=function(e){delete t.nodeDataCache[e.key],t.hoveredNode===e.key&&(t.hoveredNode=null),t.activeListeners.graphUpdate()},this.activeListeners.dropEdgeGraphUpdate=function(e){delete t.edgeDataCache[e.key],t.hoveredEdge===e.key&&(t.hoveredEdge=null),t.activeListeners.graphUpdate()},this.activeListeners.clearEdgesGraphUpdate=function(){t.edgeDataCache={},t.hoveredEdge=null,t.activeListeners.graphUpdate()},this.activeListeners.clearGraphUpdate=function(){t.nodeDataCache={},t.hoveredNode=null,t.activeListeners.clearEdgesGraphUpdate()},e.on("nodeAdded",this.activeListeners.graphUpdate),e.on("nodeDropped",this.activeListeners.dropNodeGraphUpdate),e.on("nodeAttributesUpdated",this.activeListeners.softGraphUpdate),e.on("eachNodeAttributesUpdated",this.activeListeners.graphUpdate),e.on("edgeAdded",this.activeListeners.graphUpdate),e.on("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),e.on("edgeAttributesUpdated",this.activeListeners.softGraphUpdate),e.on("eachEdgeAttributesUpdated",this.activeListeners.graphUpdate),e.on("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),e.on("cleared",this.activeListeners.clearGraphUpdate),this},e.prototype.unbindGraphHandlers=function(){var t=this.graph;t.removeListener("nodeAdded",this.activeListeners.graphUpdate),t.removeListener("nodeDropped",this.activeListeners.dropNodeGraphUpdate),t.removeListener("nodeAttributesUpdated",this.activeListeners.softGraphUpdate),t.removeListener("eachNodeAttributesUpdated",this.activeListeners.graphUpdate),t.removeListener("edgeAdded",this.activeListeners.graphUpdate),t.removeListener("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),t.removeListener("edgeAttributesUpdated",this.activeListeners.softGraphUpdate),t.removeListener("eachEdgeAttributesUpdated",this.activeListeners.graphUpdate),t.removeListener("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),t.removeListener("cleared",this.activeListeners.clearGraphUpdate)},e.prototype.checkEdgeHoverEvents=function(t){var e=this.hoveredNode?null:this.getEdgeAtPoint(t.event.x,t.event.y);return e!==this.hoveredEdge&&(this.hoveredEdge&&this.emit("leaveEdge",o(o({},t),{edge:this.hoveredEdge})),e&&this.emit("enterEdge",o(o({},t),{edge:e})),this.hoveredEdge=e),this},e.prototype.getEdgeAtPoint=function(t,e){var n,r,i=this,o=this.edgeDataCache,s=this.nodeDataCache;if(!(0,m.isPixelColored)(this.webGLContexts.edges,t*this.pixelRatio,e*this.pixelRatio))return null;var h=this.viewportToGraph({x:t,y:e}),u=h.x,c=h.y,d=0;if(this.graph.someEdge((function(t,e,n,r,a,h){var u=a.x,c=a.y,l=h.x,p=h.y;if(o[t].hidden||s[n].hidden||s[r].hidden)return!1;if(u!==l||c!==p){var f=Math.sqrt(Math.pow(l-u,2)+Math.pow(p-c,2)),g=i.graphToViewport({x:u,y:c}),v=g.x,y=g.y,m=i.graphToViewport({x:l,y:p}),b=m.x,w=m.y,_=Math.sqrt(Math.pow(b-v,2)+Math.pow(w-y,2));return d=f/_,!0}})),!d)return null;var l=this.graph.filterEdges((function(t,e,n,r,a,h){return!(o[t].hidden||s[n].hidden||s[r].hidden)&&(!!(0,m.doEdgeCollideWithPoint)(u,c,a.x,a.y,h.x,h.y,o[t].size*d/i.cameraSizeRatio)||void 0)}));if(0===l.length)return null;var p=l[l.length-1],f=-1/0;try{for(var g=a(l),v=g.next();!v.done;v=g.next()){var y=v.value,b=this.graph.getEdgeAttribute(y,"zIndex");b>=f&&(p=y,f=b)}}catch(t){n={error:t}}finally{try{v&&!v.done&&(r=g.return)&&r.call(g)}finally{if(n)throw n.error}}return p},e.prototype.process=function(t){var e=this;void 0===t&&(t=!1);var n=this.graph,r=this.settings,i=this.getDimensions(),o=[1/0,-1/0],a=[1/0,-1/0];this.quadtree.clear(),this.labelGrid.resizeAndClear(i,r.labelGridCellSize),this.highlightedNodes=new Set,this.nodeExtent=(0,p.graphExtent)(n),this.nodesWithForcedLabels=[],this.edgesWithForcedLabels=[];var s=new u.default,h=(0,p.matrixFromCamera)(s.getState(),this.getDimensions(),this.getGraphDimensions(),this.getSetting("stagePadding")||0);this.normalizationFunction=(0,p.createNormalizationFunction)(this.customBBox||this.nodeExtent);for(var c={},d=n.nodes(),l=0,f=d.length;l<f;l++){var g=d[l],v=Object.assign({},n.getNodeAttributes(g));r.nodeReducer&&(v=r.nodeReducer(g,v)),c[(m=b(this.settings,g,v)).type]=(c[m.type]||0)+1,this.nodeDataCache[g]=m,this.normalizationFunction.applyTo(m),m.forceLabel&&this.nodesWithForcedLabels.push(g),this.settings.zIndex&&(m.zIndex<o[0]&&(o[0]=m.zIndex),m.zIndex>o[1]&&(o[1]=m.zIndex))}for(var y in this.nodePrograms){if(!this.nodePrograms.hasOwnProperty(y))throw new Error('Sigma: could not find a suitable program for node type "'.concat(y,'"!'));t||this.nodePrograms[y].allocate(c[y]||0),c[y]=0}for(this.settings.zIndex&&o[0]!==o[1]&&(d=(0,p.zIndexOrdering)(o,(function(t){return e.nodeDataCache[t].zIndex}),d)),l=0,f=d.length;l<f;l++){g=d[l];var m=this.nodeDataCache[g];this.quadtree.add(g,m.x,1-m.y,m.size/this.width),"string"!=typeof m.label||m.hidden||this.labelGrid.add(g,m.size,this.framedGraphToViewport(m,{matrix:h}));var _=this.nodePrograms[m.type];if(!_)throw new Error('Sigma: could not find a suitable program for node type "'.concat(m.type,'"!'));_.process(m,m.hidden,c[m.type]++),m.highlighted&&!m.hidden&&this.highlightedNodes.add(g)}this.labelGrid.organize();var x={},C=n.edges();for(l=0,f=C.length;l<f;l++){var E=C[l];v=Object.assign({},n.getEdgeAttributes(E)),r.edgeReducer&&(v=r.edgeReducer(E,v)),x[(m=w(this.settings,0,v)).type]=(x[m.type]||0)+1,this.edgeDataCache[E]=m,m.forceLabel&&!m.hidden&&this.edgesWithForcedLabels.push(E),this.settings.zIndex&&(m.zIndex<a[0]&&(a[0]=m.zIndex),m.zIndex>a[1]&&(a[1]=m.zIndex))}for(var y in this.edgePrograms){if(!this.edgePrograms.hasOwnProperty(y))throw new Error('Sigma: could not find a suitable program for edge type "'.concat(y,'"!'));t||this.edgePrograms[y].allocate(x[y]||0),x[y]=0}for(this.settings.zIndex&&a[0]!==a[1]&&(C=(0,p.zIndexOrdering)(a,(function(t){return e.edgeDataCache[t].zIndex}),C)),l=0,f=C.length;l<f;l++){E=C[l],m=this.edgeDataCache[E];var L=n.extremities(E),S=this.nodeDataCache[L[0]],M=this.nodeDataCache[L[1]],A=m.hidden||S.hidden||M.hidden;this.edgePrograms[m.type].process(S,M,m,A,x[m.type]++)}for(var y in this.edgePrograms){var N=this.edgePrograms[y];t||"function"!=typeof N.computeIndices||N.computeIndices()}return this},e.prototype.handleSettingsUpdate=function(){return this.camera.minRatio=this.settings.minCameraRatio,this.camera.maxRatio=this.settings.maxCameraRatio,this.camera.setState(this.camera.validateState(this.camera.getState())),this},e.prototype._refresh=function(){return this.needToProcess?this.process():this.needToSoftProcess&&this.process(!0),this.needToProcess=!1,this.needToSoftProcess=!1,this.render(),this},e.prototype._scheduleRefresh=function(){var t=this;return this.renderFrame||(this.renderFrame=(0,p.requestFrame)((function(){t._refresh(),t.renderFrame=null}))),this},e.prototype.renderLabels=function(){if(!this.settings.renderLabels)return this;var t=this.camera.getState(),e=this.labelGrid.getLabelsToDisplay(t.ratio,this.settings.labelDensity);(0,h.default)(e,this.nodesWithForcedLabels),this.displayedLabels=new Set;for(var n=this.canvasContexts.labels,r=0,i=e.length;r<i;r++){var a=e[r],s=this.nodeDataCache[a];if(!this.displayedLabels.has(a)&&!s.hidden){var u=this.framedGraphToViewport(s),c=u.x,d=u.y,l=this.scaleSize(s.size);!s.forceLabel&&l<this.settings.labelRenderedSizeThreshold||c<-150||c>this.width+150||d<-50||d>this.height+50||(this.displayedLabels.add(a),this.settings.labelRenderer(n,o(o({key:a},s),{size:l,x:c,y:d}),this.settings))}}return this},e.prototype.renderEdgeLabels=function(){if(!this.settings.renderEdgeLabels)return this;var t=this.canvasContexts.edgeLabels;t.clearRect(0,0,this.width,this.height);for(var e=(0,f.edgeLabelsToDisplayFromNodes)({graph:this.graph,hoveredNode:this.hoveredNode,displayedNodeLabels:this.displayedLabels,highlightedNodes:this.highlightedNodes}).concat(this.edgesWithForcedLabels),n=new Set,r=0,i=e.length;r<i;r++){var a=e[r],s=this.graph.extremities(a),h=this.nodeDataCache[s[0]],u=this.nodeDataCache[s[1]],c=this.edgeDataCache[a];n.has(a)||c.hidden||h.hidden||u.hidden||(this.settings.edgeLabelRenderer(t,o(o({key:a},c),{size:this.scaleSize(c.size)}),o(o(o({key:s[0]},h),this.framedGraphToViewport(h)),{size:this.scaleSize(h.size)}),o(o(o({key:s[1]},u),this.framedGraphToViewport(u)),{size:this.scaleSize(u.size)}),this.settings),n.add(a))}return this},e.prototype.renderHighlightedNodes=function(){var t=this,e=this.canvasContexts.hovers;e.clearRect(0,0,this.width,this.height);var n=[];this.hoveredNode&&!this.nodeDataCache[this.hoveredNode].hidden&&n.push(this.hoveredNode),this.highlightedNodes.forEach((function(e){e!==t.hoveredNode&&n.push(e)})),n.forEach((function(n){return function(n){var r=t.nodeDataCache[n],i=t.framedGraphToViewport(r),a=i.x,s=i.y,h=t.scaleSize(r.size);t.settings.hoverRenderer(e,o(o({key:n},r),{size:h,x:a,y:s}),t.settings)}(n)}));var r={};for(var i in n.forEach((function(e){var n=t.nodeDataCache[e].type;r[n]=(r[n]||0)+1})),this.nodeHoverPrograms)this.nodeHoverPrograms[i].allocate(r[i]||0),r[i]=0;for(var i in n.forEach((function(e){var n=t.nodeDataCache[e];t.nodeHoverPrograms[n.type].process(n,n.hidden,r[n.type]++)})),this.webGLContexts.hoverNodes.clear(this.webGLContexts.hoverNodes.COLOR_BUFFER_BIT),this.nodeHoverPrograms){var a=this.nodeHoverPrograms[i];a.bind(),a.bufferData(),a.render({matrix:this.matrix,width:this.width,height:this.height,ratio:this.camera.ratio,correctionRatio:this.correctionRatio/this.camera.ratio,scalingRatio:this.pixelRatio})}},e.prototype.scheduleHighlightedNodesRender=function(){var t=this;this.renderHighlightedNodesFrame||this.renderFrame||(this.renderHighlightedNodesFrame=(0,p.requestFrame)((function(){t.renderHighlightedNodesFrame=null,t.renderHighlightedNodes(),t.renderEdgeLabels()})))},e.prototype.render=function(){var t=this;this.emit("beforeRender");var e=function(){return t.emit("afterRender"),t};if(this.renderFrame&&((0,p.cancelFrame)(this.renderFrame),this.renderFrame=null,this.needToProcess=!1,this.needToSoftProcess=!1),this.resize(),this.clear(),this.updateCachedValues(),!this.graph.order)return e();var n=this.mouseCaptor,r=this.camera.isAnimated()||n.isMoving||n.draggedEvents||n.currentWheelDirection,i=this.camera.getState(),o=this.getDimensions(),a=this.getGraphDimensions(),s=this.getSetting("stagePadding")||0;for(var h in this.matrix=(0,p.matrixFromCamera)(i,o,a,s),this.invMatrix=(0,p.matrixFromCamera)(i,o,a,s,!0),this.correctionRatio=(0,p.getMatrixImpact)(this.matrix,i,o),this.nodePrograms)(u=this.nodePrograms[h]).bind(),u.bufferData(),u.render({matrix:this.matrix,width:this.width,height:this.height,ratio:i.ratio,correctionRatio:this.correctionRatio/i.ratio,scalingRatio:this.pixelRatio});if(!this.settings.hideEdgesOnMove||!r)for(var h in this.edgePrograms){var u;(u=this.edgePrograms[h]).bind(),u.bufferData(),u.render({matrix:this.matrix,width:this.width,height:this.height,ratio:i.ratio,correctionRatio:this.correctionRatio/i.ratio,scalingRatio:this.pixelRatio})}return this.settings.hideLabelsOnMove&&r||(this.renderLabels(),this.renderEdgeLabels(),this.renderHighlightedNodes()),e()},e.prototype.updateCachedValues=function(){var t=this.camera.getState().ratio;this.cameraSizeRatio=Math.sqrt(t)},e.prototype.getCamera=function(){return this.camera},e.prototype.getContainer=function(){return this.container},e.prototype.getGraph=function(){return this.graph},e.prototype.setGraph=function(t){t!==this.graph&&(this.unbindGraphHandlers(),this.nodeDataCache={},this.edgeDataCache={},this.displayedLabels.clear(),this.highlightedNodes.clear(),this.hoveredNode=null,this.hoveredEdge=null,this.nodesWithForcedLabels.length=0,this.edgesWithForcedLabels.length=0,null!==this.checkEdgesEventsFrame&&((0,p.cancelFrame)(this.checkEdgesEventsFrame),this.checkEdgesEventsFrame=null),this.graph=t,this.bindGraphHandlers(),this.process(),this.render())},e.prototype.getMouseCaptor=function(){return this.mouseCaptor},e.prototype.getTouchCaptor=function(){return this.touchCaptor},e.prototype.getDimensions=function(){return{width:this.width,height:this.height}},e.prototype.getGraphDimensions=function(){var t=this.customBBox||this.nodeExtent;return{width:t.x[1]-t.x[0]||1,height:t.y[1]-t.y[0]||1}},e.prototype.getNodeDisplayData=function(t){var e=this.nodeDataCache[t];return e?Object.assign({},e):void 0},e.prototype.getEdgeDisplayData=function(t){var e=this.edgeDataCache[t];return e?Object.assign({},e):void 0},e.prototype.getSettings=function(){return o({},this.settings)},e.prototype.getSetting=function(t){return this.settings[t]},e.prototype.setSetting=function(t,e){return this.settings[t]=e,(0,g.validateSettings)(this.settings),this.handleSettingsUpdate(),this.needToProcess=!0,this._scheduleRefresh(),this},e.prototype.updateSetting=function(t,e){return this.settings[t]=e(this.settings[t]),(0,g.validateSettings)(this.settings),this.handleSettingsUpdate(),this.needToProcess=!0,this._scheduleRefresh(),this},e.prototype.resize=function(){var t=this.width,e=this.height;if(this.width=this.container.offsetWidth,this.height=this.container.offsetHeight,this.pixelRatio=(0,p.getPixelRatio)(),0===this.width){if(!this.settings.allowInvalidContainer)throw new Error("Sigma: Container has no width. You can set the allowInvalidContainer setting to true to stop seeing this error.");this.width=1}if(0===this.height){if(!this.settings.allowInvalidContainer)throw new Error("Sigma: Container has no height. You can set the allowInvalidContainer setting to true to stop seeing this error.");this.height=1}if(t===this.width&&e===this.height)return this;for(var n in this.emit("resize"),this.elements){var r=this.elements[n];r.style.width=this.width+"px",r.style.height=this.height+"px"}for(var n in this.canvasContexts)this.elements[n].setAttribute("width",this.width*this.pixelRatio+"px"),this.elements[n].setAttribute("height",this.height*this.pixelRatio+"px"),1!==this.pixelRatio&&this.canvasContexts[n].scale(this.pixelRatio,this.pixelRatio);for(var n in this.webGLContexts)this.elements[n].setAttribute("width",this.width*this.pixelRatio+"px"),this.elements[n].setAttribute("height",this.height*this.pixelRatio+"px"),this.webGLContexts[n].viewport(0,0,this.width*this.pixelRatio,this.height*this.pixelRatio);return this},e.prototype.clear=function(){return this.webGLContexts.nodes.clear(this.webGLContexts.nodes.COLOR_BUFFER_BIT),this.webGLContexts.edges.clear(this.webGLContexts.edges.COLOR_BUFFER_BIT),this.webGLContexts.hoverNodes.clear(this.webGLContexts.hoverNodes.COLOR_BUFFER_BIT),this.canvasContexts.labels.clearRect(0,0,this.width,this.height),this.canvasContexts.hovers.clearRect(0,0,this.width,this.height),this.canvasContexts.edgeLabels.clearRect(0,0,this.width,this.height),this},e.prototype.refresh=function(){return this.needToProcess=!0,this._refresh(),this},e.prototype.scheduleRefresh=function(){return this.needToProcess=!0,this._scheduleRefresh(),this},e.prototype.getViewportZoomedState=function(t,e){var n=this.camera.getState(),r=n.ratio,i=n.angle,o=n.x,a=n.y,s=e/r,h={x:this.width/2,y:this.height/2},u=this.viewportToFramedGraph(t),c=this.viewportToFramedGraph(h);return{angle:i,x:(u.x-c.x)*(1-s)+o,y:(u.y-c.y)*(1-s)+a,ratio:e}},e.prototype.viewRectangle=function(){var t=0*this.width/8,e=0*this.height/8,n=this.viewportToFramedGraph({x:0-t,y:0-e}),r=this.viewportToFramedGraph({x:this.width+t,y:0-e}),i=this.viewportToFramedGraph({x:0,y:this.height+e});return{x1:n.x,y1:n.y,x2:r.x,y2:r.y,height:r.y-i.y}},e.prototype.framedGraphToViewport=function(t,e){void 0===e&&(e={});var n=!!e.cameraState||!!e.viewportDimensions||!!e.graphDimensions,r=e.matrix?e.matrix:n?(0,p.matrixFromCamera)(e.cameraState||this.camera.getState(),e.viewportDimensions||this.getDimensions(),e.graphDimensions||this.getGraphDimensions(),e.padding||this.getSetting("stagePadding")||0):this.matrix,i=(0,y.multiplyVec2)(r,t);return{x:(1+i.x)*this.width/2,y:(1-i.y)*this.height/2}},e.prototype.viewportToFramedGraph=function(t,e){void 0===e&&(e={});var n=!!e.cameraState||!!e.viewportDimensions||!e.graphDimensions,r=e.matrix?e.matrix:n?(0,p.matrixFromCamera)(e.cameraState||this.camera.getState(),e.viewportDimensions||this.getDimensions(),e.graphDimensions||this.getGraphDimensions(),e.padding||this.getSetting("stagePadding")||0,!0):this.invMatrix,i=(0,y.multiplyVec2)(r,{x:t.x/this.width*2-1,y:1-t.y/this.height*2});return isNaN(i.x)&&(i.x=0),isNaN(i.y)&&(i.y=0),i},e.prototype.viewportToGraph=function(t,e){return void 0===e&&(e={}),this.normalizationFunction.inverse(this.viewportToFramedGraph(t,e))},e.prototype.graphToViewport=function(t,e){return void 0===e&&(e={}),this.framedGraphToViewport(this.normalizationFunction(t),e)},e.prototype.getBBox=function(){return(0,p.graphExtent)(this.graph)},e.prototype.getCustomBBox=function(){return this.customBBox},e.prototype.setCustomBBox=function(t){return this.customBBox=t,this._scheduleRefresh(),this},e.prototype.kill=function(){this.emit("kill"),this.removeAllListeners(),this.camera.removeListener("updated",this.activeListeners.camera),window.removeEventListener("resize",this.activeListeners.handleResize),this.mouseCaptor.kill(),this.touchCaptor.kill(),this.unbindGraphHandlers(),this.quadtree=new d.default,this.nodeDataCache={},this.edgeDataCache={},this.nodesWithForcedLabels=[],this.edgesWithForcedLabels=[],this.highlightedNodes.clear(),this.renderFrame&&((0,p.cancelFrame)(this.renderFrame),this.renderFrame=null),this.renderHighlightedNodesFrame&&((0,p.cancelFrame)(this.renderHighlightedNodesFrame),this.renderHighlightedNodesFrame=null);for(var t=this.container;t.firstChild;)t.removeChild(t.firstChild)},e.prototype.scaleSize=function(t){return t/this.cameraSizeRatio},e.prototype.getCanvases=function(){return o({},this.elements)},e}(l.TypedEventEmitter);e.default=_},291:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.TypedEventEmitter=void 0;var o=function(t){function e(){var e=t.call(this)||this;return e.rawEmitter=e,e}return i(e,t),e}(n(187).EventEmitter);e.TypedEventEmitter=o},227:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.animateNodes=e.ANIMATE_DEFAULTS=void 0;var i=n(524),o=r(n(941));e.ANIMATE_DEFAULTS={easing:"quadraticInOut",duration:150},e.animateNodes=function(t,n,r,a){var s=Object.assign({},e.ANIMATE_DEFAULTS,r),h="function"==typeof s.easing?s.easing:o.default[s.easing],u=Date.now(),c={};for(var d in n){var l=n[d];for(var p in c[d]={},l)c[d][p]=t.getNodeAttribute(d,p)}var f=null,g=function(){f=null;var e=(Date.now()-u)/s.duration;if(e>=1){for(var r in n){var o=n[r];for(var d in o)t.setNodeAttribute(r,d,o[d])}"function"==typeof a&&a()}else{for(var r in e=h(e),n){o=n[r];var l=c[r];for(var d in o)t.setNodeAttribute(r,d,o[d]*e+l[d]*(1-e))}f=(0,i.requestFrame)(g)}};return g(),function(){f&&(0,i.cancelFrame)(f)}}},109:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HTML_COLORS=void 0,e.HTML_COLORS={black:"#000000",silver:"#C0C0C0",gray:"#808080",grey:"#808080",white:"#FFFFFF",maroon:"#800000",red:"#FF0000",purple:"#800080",fuchsia:"#FF00FF",green:"#008000",lime:"#00FF00",olive:"#808000",yellow:"#FFFF00",navy:"#000080",blue:"#0000FF",teal:"#008080",aqua:"#00FFFF",darkblue:"#00008B",mediumblue:"#0000CD",darkgreen:"#006400",darkcyan:"#008B8B",deepskyblue:"#00BFFF",darkturquoise:"#00CED1",mediumspringgreen:"#00FA9A",springgreen:"#00FF7F",cyan:"#00FFFF",midnightblue:"#191970",dodgerblue:"#1E90FF",lightseagreen:"#20B2AA",forestgreen:"#228B22",seagreen:"#2E8B57",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",limegreen:"#32CD32",mediumseagreen:"#3CB371",turquoise:"#40E0D0",royalblue:"#4169E1",steelblue:"#4682B4",darkslateblue:"#483D8B",mediumturquoise:"#48D1CC",indigo:"#4B0082",darkolivegreen:"#556B2F",cadetblue:"#5F9EA0",cornflowerblue:"#6495ED",rebeccapurple:"#663399",mediumaquamarine:"#66CDAA",dimgray:"#696969",dimgrey:"#696969",slateblue:"#6A5ACD",olivedrab:"#6B8E23",slategray:"#708090",slategrey:"#708090",lightslategray:"#778899",lightslategrey:"#778899",mediumslateblue:"#7B68EE",lawngreen:"#7CFC00",chartreuse:"#7FFF00",aquamarine:"#7FFFD4",skyblue:"#87CEEB",lightskyblue:"#87CEFA",blueviolet:"#8A2BE2",darkred:"#8B0000",darkmagenta:"#8B008B",saddlebrown:"#8B4513",darkseagreen:"#8FBC8F",lightgreen:"#90EE90",mediumpurple:"#9370DB",darkviolet:"#9400D3",palegreen:"#98FB98",darkorchid:"#9932CC",yellowgreen:"#9ACD32",sienna:"#A0522D",brown:"#A52A2A",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",lightblue:"#ADD8E6",greenyellow:"#ADFF2F",paleturquoise:"#AFEEEE",lightsteelblue:"#B0C4DE",powderblue:"#B0E0E6",firebrick:"#B22222",darkgoldenrod:"#B8860B",mediumorchid:"#BA55D3",rosybrown:"#BC8F8F",darkkhaki:"#BDB76B",mediumvioletred:"#C71585",indianred:"#CD5C5C",peru:"#CD853F",chocolate:"#D2691E",tan:"#D2B48C",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",thistle:"#D8BFD8",orchid:"#DA70D6",goldenrod:"#DAA520",palevioletred:"#DB7093",crimson:"#DC143C",gainsboro:"#DCDCDC",plum:"#DDA0DD",burlywood:"#DEB887",lightcyan:"#E0FFFF",lavender:"#E6E6FA",darksalmon:"#E9967A",violet:"#EE82EE",palegoldenrod:"#EEE8AA",lightcoral:"#F08080",khaki:"#F0E68C",aliceblue:"#F0F8FF",honeydew:"#F0FFF0",azure:"#F0FFFF",sandybrown:"#F4A460",wheat:"#F5DEB3",beige:"#F5F5DC",whitesmoke:"#F5F5F5",mintcream:"#F5FFFA",ghostwhite:"#F8F8FF",salmon:"#FA8072",antiquewhite:"#FAEBD7",linen:"#FAF0E6",lightgoldenrodyellow:"#FAFAD2",oldlace:"#FDF5E6",magenta:"#FF00FF",deeppink:"#FF1493",orangered:"#FF4500",tomato:"#FF6347",hotpink:"#FF69B4",coral:"#FF7F50",darkorange:"#FF8C00",lightsalmon:"#FFA07A",orange:"#FFA500",lightpink:"#FFB6C1",pink:"#FFC0CB",gold:"#FFD700",peachpuff:"#FFDAB9",navajowhite:"#FFDEAD",moccasin:"#FFE4B5",bisque:"#FFE4C4",mistyrose:"#FFE4E1",blanchedalmond:"#FFEBCD",papayawhip:"#FFEFD5",lavenderblush:"#FFF0F5",seashell:"#FFF5EE",cornsilk:"#FFF8DC",lemonchiffon:"#FFFACD",floralwhite:"#FFFAF0",snow:"#FFFAFA",lightyellow:"#FFFFE0",ivory:"#FFFFF0"}},941:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.cubicInOut=e.cubicOut=e.cubicIn=e.quadraticInOut=e.quadraticOut=e.quadraticIn=e.linear=void 0,e.linear=function(t){return t},e.quadraticIn=function(t){return t*t},e.quadraticOut=function(t){return t*(2-t)},e.quadraticInOut=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},e.cubicIn=function(t){return t*t*t},e.cubicOut=function(t){return--t*t*t+1},e.cubicInOut=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)};var n={linear:e.linear,quadraticIn:e.quadraticIn,quadraticOut:e.quadraticOut,quadraticInOut:e.quadraticInOut,cubicIn:e.cubicIn,cubicOut:e.cubicOut,cubicInOut:e.cubicInOut};e.default=n},822:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.doEdgeCollideWithPoint=e.isPixelColored=void 0,e.isPixelColored=function(t,e,n){var r=new Uint8Array(4);return t.readPixels(e,t.drawingBufferHeight-n,1,1,t.RGBA,t.UNSIGNED_BYTE,r),r[3]>0},e.doEdgeCollideWithPoint=function(t,e,n,r,i,o,a){return!(t<n-a&&t<i-a||e<r-a&&e<o-a||t>n+a&&t>i+a||e>r+a&&e>o+a||!(Math.abs((i-n)*(r-e)-(n-t)*(o-r))/Math.sqrt(Math.pow(i-n,2)+Math.pow(o-r,2))<a/2))}},524:function(t,e,n){"use strict";var r=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.validateGraph=e.canUse32BitsIndices=e.extractPixel=e.getMatrixImpact=e.matrixFromCamera=e.getCorrectionRatio=e.floatColor=e.floatArrayColor=e.parseColor=e.zIndexOrdering=e.createNormalizationFunction=e.graphExtent=e.getPixelRatio=e.createElement=e.cancelFrame=e.requestFrame=e.assignDeep=e.assign=e.isPlainObject=void 0;var o=i(n(186)),a=n(132),s=n(109);function h(t){return"object"==typeof t&&null!==t&&t.constructor===Object}e.isPlainObject=h,e.assign=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];t=t||{};for(var r=0,i=e.length;r<i;r++){var o=e[r];o&&Object.assign(t,o)}return t},e.assignDeep=function t(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];e=e||{};for(var i=0,o=n.length;i<o;i++){var a=n[i];if(a)for(var s in a)h(a[s])?e[s]=t(e[s],a[s]):e[s]=a[s]}return e},e.requestFrame="undefined"!=typeof requestAnimationFrame?function(t){return requestAnimationFrame(t)}:function(t){return setTimeout(t,0)},e.cancelFrame="undefined"!=typeof cancelAnimationFrame?function(t){return cancelAnimationFrame(t)}:function(t){return clearTimeout(t)},e.createElement=function(t,e,n){var r=document.createElement(t);if(e)for(var i in e)r.style[i]=e[i];if(n)for(var i in n)r.setAttribute(i,n[i]);return r},e.getPixelRatio=function(){return void 0!==window.devicePixelRatio?window.devicePixelRatio:1},e.graphExtent=function(t){if(!t.order)return{x:[0,1],y:[0,1]};var e=1/0,n=-1/0,r=1/0,i=-1/0;return t.forEachNode((function(t,o){var a=o.x,s=o.y;a<e&&(e=a),a>n&&(n=a),s<r&&(r=s),s>i&&(i=s)})),{x:[e,n],y:[r,i]}},e.createNormalizationFunction=function(t){var e=r(t.x,2),n=e[0],i=e[1],o=r(t.y,2),a=o[0],s=o[1],h=Math.max(i-n,s-a),u=(i+n)/2,c=(s+a)/2;(0===h||Math.abs(h)===1/0||isNaN(h))&&(h=1),isNaN(u)&&(u=0),isNaN(c)&&(c=0);var d=function(t){return{x:.5+(t.x-u)/h,y:.5+(t.y-c)/h}};return d.applyTo=function(t){t.x=.5+(t.x-u)/h,t.y=.5+(t.y-c)/h},d.inverse=function(t){return{x:u+h*(t.x-.5),y:c+h*(t.y-.5)}},d.ratio=h,d},e.zIndexOrdering=function(t,e,n){return n.sort((function(t,n){var r=e(t)||0,i=e(n)||0;return r<i?-1:r>i?1:0}))};var u=new Int8Array(4),c=new Int32Array(u.buffer,0,1),d=new Float32Array(u.buffer,0,1),l=/^\s*rgba?\s*\(/,p=/^\s*rgba?\s*\(\s*([0-9]*)\s*,\s*([0-9]*)\s*,\s*([0-9]*)(?:\s*,\s*(.*)?)?\)\s*$/;function f(t){var e=0,n=0,r=0,i=1;if("#"===t[0])4===t.length?(e=parseInt(t.charAt(1)+t.charAt(1),16),n=parseInt(t.charAt(2)+t.charAt(2),16),r=parseInt(t.charAt(3)+t.charAt(3),16)):(e=parseInt(t.charAt(1)+t.charAt(2),16),n=parseInt(t.charAt(3)+t.charAt(4),16),r=parseInt(t.charAt(5)+t.charAt(6),16)),9===t.length&&(i=parseInt(t.charAt(7)+t.charAt(8),16)/255);else if(l.test(t)){var o=t.match(p);o&&(e=+o[1],n=+o[2],r=+o[3],o[4]&&(i=+o[4]))}return{r:e,g:n,b:r,a:i}}e.parseColor=f;var g={};for(var v in s.HTML_COLORS)g[v]=y(s.HTML_COLORS[v]),g[s.HTML_COLORS[v]]=g[v];function y(t){if(void 0!==g[t])return g[t];var e=f(t),n=e.r,r=e.g,i=e.b,o=e.a;o=255*o|0,c[0]=4278190079&(o<<24|i<<16|r<<8|n);var a=d[0];return g[t]=a,a}function m(t,e){var n=t.height/t.width,r=e.height/e.width;return n<1&&r>1||n>1&&r<1?1:Math.min(Math.max(r,1/r),Math.max(1/n,n))}e.floatArrayColor=function(t){var e=f(t=s.HTML_COLORS[t]||t),n=e.r,r=e.g,i=e.b,o=e.a;return new Float32Array([n/255,r/255,i/255,o])},e.floatColor=y,e.getCorrectionRatio=m,e.matrixFromCamera=function(t,e,n,r,i){var o=t.angle,s=t.ratio,h=t.x,u=t.y,c=e.width,d=e.height,l=(0,a.identity)(),p=Math.min(c,d)-2*r,f=m(e,n);return i?((0,a.multiply)(l,(0,a.translate)((0,a.identity)(),h,u)),(0,a.multiply)(l,(0,a.scale)((0,a.identity)(),s)),(0,a.multiply)(l,(0,a.rotate)((0,a.identity)(),o)),(0,a.multiply)(l,(0,a.scale)((0,a.identity)(),c/p/2/f,d/p/2/f))):((0,a.multiply)(l,(0,a.scale)((0,a.identity)(),p/c*2*f,p/d*2*f)),(0,a.multiply)(l,(0,a.rotate)((0,a.identity)(),-o)),(0,a.multiply)(l,(0,a.scale)((0,a.identity)(),1/s)),(0,a.multiply)(l,(0,a.translate)((0,a.identity)(),-h,-u))),l},e.getMatrixImpact=function(t,e,n){var r=(0,a.multiplyVec2)(t,{x:Math.cos(e.angle),y:Math.sin(e.angle)},0),i=r.x,o=r.y;return 1/Math.sqrt(Math.pow(i,2)+Math.pow(o,2))/n.width},e.extractPixel=function(t,e,n,r){var i=r||new Uint8Array(4);return t.readPixels(e,n,1,1,t.RGBA,t.UNSIGNED_BYTE,i),i},e.canUse32BitsIndices=function(t){return"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||!!t.getExtension("OES_element_index_uint")},e.validateGraph=function(t){if(!(0,o.default)(t))throw new Error("Sigma: invalid graph instance.");t.forEachNode((function(t,e){if(!Number.isFinite(e.x)||!Number.isFinite(e.y))throw new Error("Sigma: Coordinates of node ".concat(t," are invalid. A node must have a numeric 'x' and 'y' attribute."))}))}},132:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.multiplyVec2=e.multiply=e.translate=e.rotate=e.scale=e.identity=void 0,e.identity=function(){return Float32Array.of(1,0,0,0,1,0,0,0,1)},e.scale=function(t,e,n){return t[0]=e,t[4]="number"==typeof n?n:e,t},e.rotate=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[3]=-n,t[4]=r,t},e.translate=function(t,e,n){return t[6]=e,t[7]=n,t},e.multiply=function(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],h=t[6],u=t[7],c=t[8],d=e[0],l=e[1],p=e[2],f=e[3],g=e[4],v=e[5],y=e[6],m=e[7],b=e[8];return t[0]=d*n+l*o+p*h,t[1]=d*r+l*a+p*u,t[2]=d*i+l*s+p*c,t[3]=f*n+g*o+v*h,t[4]=f*r+g*a+v*u,t[5]=f*i+g*s+v*c,t[6]=y*n+m*o+b*h,t[7]=y*r+m*a+b*u,t[8]=y*i+m*s+b*c,t},e.multiplyVec2=function(t,e,n){void 0===n&&(n=1);var r=t[0],i=t[1],o=t[3],a=t[4],s=t[6],h=t[7],u=e.x,c=e.y;return{x:u*r+c*o+s*n,y:u*i+c*a+h*n}}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r].call(o.exports,o,o.exports,n),o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{ForceAtlasAnimator:()=>rt,GraphManager:()=>ye,GraphView:()=>xe,LinearAnimator:()=>be,MultiResolutionGraph:()=>Fe,NodeBorderProgram:()=>je,defaultSettings:()=>nt,initialGraphLayout:()=>te,iterateNoIntercomponentRepel:()=>J,relativeComponentLayout:()=>Qt});var t,e=n(26),i=n(404),o=n.n(i),a=n(308),s=n(803),h=0,u=1,c=2,d=3,l=4,p=5,f=6,g=7,v=8,y=9,m=10,b=3,w=0,_=1,x=2;class C{static _xfnv1a(t){let e=2166136261;for(let n=0;n<t.length;n++)e=Math.imul(e^t.charCodeAt(n),16777619);return()=>(e+=e<<13,e^=e>>>7,e+=e<<3,e^=e>>>17,(e+=e<<5)>>>0)}}class E extends C{constructor(t){super(),Object.defineProperty(this,"a",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.a=E._xfnv1a(t)()}next(){let t=this.a+=1831565813;return t=Math.imul(t^t>>>15,1|t),t^=t+Math.imul(t^t>>>7,61|t),((t^t>>>14)>>>0)/4294967296}}class L extends C{constructor(t){super(),Object.defineProperty(this,"a",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"b",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"c",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"d",{enumerable:!0,configurable:!0,writable:!0,value:void 0});const e=L._xfnv1a(t);this.a=e(),this.b=e(),this.c=e(),this.d=e()}next(){this.a>>>=0,this.b>>>=0,this.c>>>=0,this.d>>>=0;let t=this.a+this.b|0;return this.a=this.b^this.b>>>9,this.b=this.c+(this.c<<3)|0,this.c=this.c<<21|this.c>>>11,this.d=this.d+1|0,t=t+this.d|0,this.c=this.c+t|0,(t>>>0)/4294967296}}class S extends C{constructor(t){super(),Object.defineProperty(this,"a",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"b",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"c",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"d",{enumerable:!0,configurable:!0,writable:!0,value:void 0});const e=S._xfnv1a(t);this.a=e(),this.b=e(),this.c=e(),this.d=e()}next(){const t=this.b<<9;let e=5*this.b;return e=9*(e<<7|e>>>25),this.c^=this.a,this.d^=this.b,this.b^=this.c,this.a^=this.d,this.c^=t,this.d=this.d<<11|this.d>>>21,(e>>>0)/4294967296}}!function(t){t.sfc32="sfc32",t.mulberry32="mulberry32",t.xoshiro128ss="xoshiro128ss"}(t||(t={}));class M{constructor(e,n=t.sfc32){Object.defineProperty(this,"str",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"prng",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"generator",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.str=e,this.prng=n,this.generator=this._initializeGenerator()}next(){return this.generator.next()}_initializeGenerator(){if((t=>null===t)(t=this.str)||(t=>void 0===t)(t))return this.wrap();var t;switch(this.prng){case"sfc32":return new L(this.str);case"mulberry32":return new E(this.str);case"xoshiro128ss":return new S(this.str);default:return this.wrap()}}wrap(){return{next:()=>Math.random()}}}var A=0,N=1,k=2,P=3,D=4,G=5,F=6,O=7,T=8,R=9,j=3,z=10,B=function(t,e){var n=function(t,e){var n=Array.from({length:t},(function(t,e){return e}));return function(t,e){for(var n=new M(e||"permutation"+t.length),r=0;r<t.length-1;r++){var i=Math.floor(n.next()*(t.length-r-1))+r,o=t[r];t[r]=t[i],t[i]=o}}(n,e),n}(t-1,e);return n.push(t-1),n};function U(t,e,n,r){t[e+c]+=r,t[n+c]-=r}function I(t,e,n,r){t[e+d]+=r,t[n+d]-=r}function H(t,e,n,r){var i=t[e+h]-t[n+h],o=t[e+u]-t[n+u],a=Math.sqrt(i*i+o*o)-t[e+v]-t[n+v],s=Math.pow(a,2),c=a>0?r*t[e+f]*t[n+f]/s:100*r*t[e+f]*t[n+f];U(t,e,n,i*c),I(t,e,n,o*c)}function W(t,e,n,r,i){void 0===i&&(i=2);var o=t[e+h]-t[n+h],a=t[e+u]-t[n+u],s=o*o+a*a;if(s>0){var c=Math.sqrt(s),d=r*t[e+f]*t[n+f]/Math.pow(c,i);U(t,e,n,o*d),I(t,e,n,a*d)}}function V(t,e,n){var r=t.scalingRatio,i=t.adjustSizes,o=t.barnesHutThreshold,a=t.barnesHutTheta,s=i?H:W;n.forEach((function(t){t.length>=o?function(t,e,n,r,i){e.length;var o=function(t,e){var n,r,i,o=[],a=1/0,s=-1/0,c=1/0,d=-1/0;e.forEach((function(e){var n=Number(e)*m;a=Math.min(a,t[n+h]),s=Math.max(s,t[n+h]),c=Math.min(c,t[n+u]),d=Math.max(d,t[n+u])}));var l=s-a,p=d-c;l>p?d=(c-=(l-p)/2)+l:s=(a-=(p-l)/2)+p,o[0+A]=-1,o[0+N]=(a+s)/2,o[0+k]=(c+d)/2,o[0+P]=Math.max(s-a,d-c),o[0+D]=-1,o[0+G]=-1,o[0+F]=0,o[0+O]=0,o[0+T]=0;var g=1;return e.forEach((function(e){var a=Number(e)*m,s=0;for(i=j;;){if(!(o[s+G]>=0)){if(o[s+A]<0){o[s+A]=a;break}o[s+G]=g*R;var c=o[s+P]/2,d=o[s+G];if(o[d+A]=-1,o[d+N]=o[s+N]-c,o[d+k]=o[s+k]-c,o[d+P]=c,o[d+D]=d+R,o[d+G]=-1,o[d+F]=0,o[d+O]=0,o[d+T]=0,o[(d+=R)+A]=-1,o[d+N]=o[s+N]-c,o[d+k]=o[s+k]+c,o[d+P]=c,o[d+D]=d+R,o[d+G]=-1,o[d+F]=0,o[d+O]=0,o[d+T]=0,o[(d+=R)+A]=-1,o[d+N]=o[s+N]+c,o[d+k]=o[s+k]-c,o[d+P]=c,o[d+D]=d+R,o[d+G]=-1,o[d+F]=0,o[d+O]=0,o[d+T]=0,o[(d+=R)+A]=-1,o[d+N]=o[s+N]+c,o[d+k]=o[s+k]+c,o[d+P]=c,o[d+D]=o[s+D],o[d+G]=-1,o[d+F]=0,o[d+O]=0,o[d+T]=0,g+=4,n=t[o[s+A]+h]<o[s+N]?t[o[s+A]+u]<o[s+k]?o[s+G]:o[s+G]+R:t[o[s+A]+u]<o[s+k]?o[s+G]+2*R:o[s+G]+3*R,o[s+F]=t[o[s+A]+f],o[s+O]=t[o[s+A]+h],o[s+T]=t[o[s+A]+u],o[n+A]=o[s+A],o[s+A]=-1,r=t[a+h]<o[s+N]?t[a+u]<o[s+k]?o[s+G]:o[s+G]+R:t[a+u]<o[s+k]?o[s+G]+2*R:o[s+G]+3*R,n===r){if(i--){s=n;continue}i=j;break}o[r+A]=a;break}n=t[a+h]<o[s+N]?t[a+u]<o[s+k]?o[s+G]:o[s+G]+R:t[a+u]<o[s+k]?o[s+G]+2*R:o[s+G]+3*R,o[s+O]=(o[s+O]*o[s+F]+t[a+h]*t[a+f])/(o[s+F]+t[a+f]),o[s+T]=(o[s+T]*o[s+F]+t[a+u]*t[a+f])/(o[s+F]+t[a+f]),o[s+F]+=t[a+f],s=n}})),o}(t,e);e.forEach((function(e){for(var a=Number(e)*m,s=0;;)if(o[s+G]>=0){var l=Math.pow(t[a+h]-o[s+O],2)+Math.pow(t[a+u]-o[s+T],2),p=o[s+P];if(4*p*p/l<i){var g=t[a+h]-o[s+O],v=t[a+u]-o[s+T],y=void 0;if(!0===r?l>0?(y=n*t[a+f]*o[s+F]/l,t[a+c]+=g*y,t[a+d]+=v*y):l<0&&(y=-n*t[a+f]*o[s+F]/Math.sqrt(l),t[a+c]+=g*y,t[a+d]+=v*y):l>0&&(y=n*t[a+f]*o[s+F]/l,t[a+c]+=g*y,t[a+d]+=v*y),(s=o[s+D])<0)break;continue}s=o[s+G]}else{var b=o[s+A];if(b>=0&&b!==a&&(l=(g=t[a+h]-t[b+h])*g+(v=t[a+u]-t[b+u])*v,y=void 0,!0===r?l>0?(y=n*t[a+f]*t[b+f]/l,t[a+c]+=g*y,t[a+d]+=v*y):l<0&&(y=-n*t[a+f]*t[b+f]/Math.sqrt(l),t[a+c]+=g*y,t[a+d]+=v*y):l>0&&(y=n*t[a+f]*t[b+f]/l,t[a+c]+=g*y,t[a+d]+=v*y)),(s=o[s+D])<0)break}}))}(e,t,r,i,Math.pow(a,2)):function(t,e,n,r){for(var i=0;i<e.length;i+=1)for(var o=Number(e[i])*m,a=0;a<i;a+=1)r(t,o,Number(e[a])*m,n)}(e,t,r,s)}))}function q(t,e,n,r){var i=t[e+h]-t[n+h],o=t[e+u]-t[n+u],a=-r;U(t,e,n,i*a),I(t,e,n,o*a)}function Z(t,e,n,r){var i=t[e+h]-t[n+h],o=t[e+u]-t[n+u],a=-r;Math.sqrt(i*i+o*o)-t[e+v]-t[n+v]>0&&(U(t,e,n,i*a),I(t,e,n,o*a))}function Y(t,e,n,r){var i=t[e+h]-t[n+h],o=t[e+u]-t[n+u],a=Math.sqrt(i*i+o*o);if(a>0){var s=-r*Math.log(1+a)/a;U(t,e,n,i*s),I(t,e,n,o*s)}}function K(t,e,n,r){var i=t[e+h]-t[n+h],o=t[e+u]-t[n+u],a=Math.sqrt(i*i+o*o)-t[e+v]-t[n+v];if(a>0){var s=-r*Math.log(1+a)/a;U(t,e,n,i*s),I(t,e,n,o*s)}}function X(t,e){var n=t[e+l]-t[e+c],r=t[e+p]-t[e+d];return t[e+f]*Math.sqrt(Math.pow(n,2)+Math.pow(r,2))}function Q(t,e){var n=t[e+l]+t[e+c],r=t[e+p]+t[e+d];return Math.sqrt(Math.pow(n,2)+Math.pow(r,2))/2}function J(t,e,n,r){for(var i=t.adjustSizes,o=t.nRepulsiveCycles,a=0;a<e.length;a+=m)e[a+l]=e[a+c],e[a+p]=e[a+d],e[a+c]=0,e[a+d]=0;if(o){var s=r.map((function(t){return Array.from({length:o},(function(){return B(t.length)}))}));!function(t,e,n,r){var i=t.scalingRatio,o=t.adjustSizes?H:W;n.forEach((function(t,n){!function(t,e,n,r,i){var o=r,a=e.length*(e.length-1)/2/(e.length*o.length);o.forEach((function(r){for(var o=0;o<r.length;o+=1){var s=void 0,h=void 0;o<r.length-1?(s=Number(e[r[o]])*m,h=Number(e[r[o+1]])*m):(s=Number(e[r[o]])*m,h=Number(e[r[0]])*m),i(t,s,h,n*a)}}))}(e,t,i,r[n],o)}))}(t,e,r,s)}else V(t,e,r);for(var f=n.length,v=0;v<f;v+=b){var C=n[v+w],E=n[v+_],L=n[v+x];!0===i?t.linLogMode?K(e,C,E,L):Z(e,C,E,L):t.linLogMode?Y(e,C,E,L):q(e,C,E,L)}if(!0===i){for(a=0;a<e.length;a+=m)if(1!==e[a+y]){var S=Math.sqrt(Math.pow(e[a+c],2)+Math.pow(e[a+d],2));S>z&&(e[a+c]=e[a+c]*z/S,e[a+d]=e[a+d]*z/S);var M=X(e,a),A=Q(e,a),N=1+Math.sqrt(M),k=(P=.1*Math.log(1+A)/N)/t.slowDown;e[a+h]+=e[a+c]*k,e[a+u]+=e[a+d]*k}}else for(a=0;a<e.length;a+=m)if(1!==e[a+y]){M=X(e,a),A=Q(e,a),N=1+Math.sqrt(M);var P=e[a+g]*Math.log(1+A)/N;e[a+g]=Math.min(1,Math.sqrt(P*(Math.pow(e[a+c],2)+Math.pow(e[a+d],2))/N)),k=P/t.slowDown,e[a+h]+=e[a+c]*k,e[a+u]+=e[a+d]*k}return{}}var $=n(739),tt=$.assignLayoutChanges,et=$.graphToByteArrays,nt={linLogMode:!1,adjustSizes:!1,scalingRatio:1,slowDown:1,barnesHutTheta:.7,barnesHutThreshold:1e3},rt=function(){function t(t,e,n){this.graph=t,this.graph_components=(0,s.kS)(t),this.params=e,this.frameID=null,this.running=!1,this.getEdgeWeight=(0,a.Q6)(void 0).fromEntry,this.graphArrays=et(t,this.getEdgeWeight),this.outputReducer=null,this.niters=0,this.maxiters=n.maxiters,this.miniters=n.miniters,this.convergenceThreshold=n.convergenceThreshold}return t.prototype.isRunning=function(){return this.running},t.prototype.resetNIters=function(){this.niters=0},t.prototype.updateNodePropsArrays=function(t){var e=0,n=t;return this.graph.forEachNode((function(t,r){r.fixed&&(n.nodes[e+h]=r.x,n.nodes[e+u]=r.y,n.nodes[e+c]=0,n.nodes[e+d]=0,n.nodes[e+l]=0,n.nodes[e+p]=0),n.nodes[e+y]=r.fixed?1:0,e+=m})),n},t.prototype.forceNodePositionUpdate=function(){var t=this.graphArrays;if(t){var e=0;this.graph.forEachNode((function(n,r){t.nodes[e+h]=r.x,t.nodes[e+u]=r.y,t.nodes[e+c]=0,t.nodes[e+d]=0,t.nodes[e+l]=0,t.nodes[e+p]=0,e+=m}))}},t.prototype.hasConverged=function(){var t=0;if(!this.graphArrays)return!1;for(t=0;t<this.graphArrays.nodes.length;t+=m)if(this.graphArrays.nodes[t+7]>this.convergenceThreshold)return!1;return!0},t.prototype.runFrame=function(){var t,e=this;this.graphArrays?t=this.updateNodePropsArrays(this.graphArrays):(t=et(this.graph,this.getEdgeWeight),this.graphArrays=t),void 0!==this.params.settings?(J(this.params.settings,t.nodes,t.edges,this.graph_components),tt(this.graph,t.nodes,this.outputReducer),this.niters+=1,this.niters>this.maxiters||this.niters>this.miniters&&this.hasConverged()?this.stop():this.frameID=window.requestAnimationFrame((function(){return e.runFrame()}))):(console.error("No Settings Provided"),this.stop())},t.prototype.stop=function(){return this.running=!1,this.resetNIters(),null!==this.frameID&&(window.cancelAnimationFrame(this.frameID),this.frameID=null),this},t.prototype.start=function(){this.running||(this.running=!0,this.runFrame())},t.prototype.kill=function(){this.stop(),delete this.graphArrays},t}(),it=n(186),ot=n.n(it);function at(){var t=0,e=1,n=2,r=3,i=4,o=5,a=6,s=8,h=10,u=0,c=1,d=2,l=3,p=4,f=5,g=6,v=7,y=8,m=9,b=3;function w(t,e,r,i){t[e+n]+=i,t[r+n]-=i}function _(t,e,n,i){t[e+r]+=i,t[n+r]-=i}function x(n,r,i,o){var h=n[r+t]-n[i+t],u=n[r+e]-n[i+e],c=Math.sqrt(h*h+u*u)-n[r+s]-n[i+s],d=Math.pow(c,2),l=c>0?o*n[r+a]*n[i+a]/d:100*o*n[r+a]*n[i+a];w(n,r,i,h*l),_(n,r,i,u*l)}function C(n,r,i,o,s){void 0===s&&(s=2);var h=n[r+t]-n[i+t],u=n[r+e]-n[i+e],c=h*h+u*u;if(c>0){var d=Math.sqrt(c),l=o*n[r+a]*n[i+a]/Math.pow(d,s);w(n,r,i,h*l),_(n,r,i,u*l)}}function E(i,o,s){var w=i.scalingRatio,_=i.adjustSizes,E=i.barnesHutThreshold,L=i.barnesHutTheta,S=_?x:C;s.forEach((function(i){i.length>=E?function(i,o,s,w,_){o.length;var x=function(n,r){var i,o,s,w=[],_=1/0,x=-1/0,C=1/0,E=-1/0;r.forEach((function(r){var i=Number(r)*h;_=Math.min(_,n[i+t]),x=Math.max(x,n[i+t]),C=Math.min(C,n[i+e]),E=Math.max(E,n[i+e])}));var L=x-_,S=E-C;L>S?E=(C-=(L-S)/2)+L:x=(_-=(S-L)/2)+S,w[0+u]=-1,w[0+c]=(_+x)/2,w[0+d]=(C+E)/2,w[0+l]=Math.max(x-_,E-C),w[0+p]=-1,w[0+f]=-1,w[0+g]=0,w[0+v]=0,w[0+y]=0;var M=1;return r.forEach((function(r){var _=Number(r)*h,x=0;for(s=b;;){if(!(w[x+f]>=0)){if(w[x+u]<0){w[x+u]=_;break}w[x+f]=M*m;var C=w[x+l]/2,E=w[x+f];if(w[E+u]=-1,w[E+c]=w[x+c]-C,w[E+d]=w[x+d]-C,w[E+l]=C,w[E+p]=E+m,w[E+f]=-1,w[E+g]=0,w[E+v]=0,w[E+y]=0,w[(E+=m)+u]=-1,w[E+c]=w[x+c]-C,w[E+d]=w[x+d]+C,w[E+l]=C,w[E+p]=E+m,w[E+f]=-1,w[E+g]=0,w[E+v]=0,w[E+y]=0,w[(E+=m)+u]=-1,w[E+c]=w[x+c]+C,w[E+d]=w[x+d]-C,w[E+l]=C,w[E+p]=E+m,w[E+f]=-1,w[E+g]=0,w[E+v]=0,w[E+y]=0,w[(E+=m)+u]=-1,w[E+c]=w[x+c]+C,w[E+d]=w[x+d]+C,w[E+l]=C,w[E+p]=w[x+p],w[E+f]=-1,w[E+g]=0,w[E+v]=0,w[E+y]=0,M+=4,i=n[w[x+u]+t]<w[x+c]?n[w[x+u]+e]<w[x+d]?w[x+f]:w[x+f]+m:n[w[x+u]+e]<w[x+d]?w[x+f]+2*m:w[x+f]+3*m,w[x+g]=n[w[x+u]+a],w[x+v]=n[w[x+u]+t],w[x+y]=n[w[x+u]+e],w[i+u]=w[x+u],w[x+u]=-1,o=n[_+t]<w[x+c]?n[_+e]<w[x+d]?w[x+f]:w[x+f]+m:n[_+e]<w[x+d]?w[x+f]+2*m:w[x+f]+3*m,i===o){if(s--){x=i;continue}s=b;break}w[o+u]=_;break}i=n[_+t]<w[x+c]?n[_+e]<w[x+d]?w[x+f]:w[x+f]+m:n[_+e]<w[x+d]?w[x+f]+2*m:w[x+f]+3*m,w[x+v]=(w[x+v]*w[x+g]+n[_+t]*n[_+a])/(w[x+g]+n[_+a]),w[x+y]=(w[x+y]*w[x+g]+n[_+e]*n[_+a])/(w[x+g]+n[_+a]),w[x+g]+=n[_+a],x=i}})),w}(i,o);o.forEach((function(o){for(var c=Number(o)*h,d=0;;)if(x[d+f]>=0){var m=Math.pow(i[c+t]-x[d+v],2)+Math.pow(i[c+e]-x[d+y],2),b=x[d+l];if(4*b*b/m<_){var C=i[c+t]-x[d+v],E=i[c+e]-x[d+y],L=void 0;if(!0===w?m>0?(L=s*i[c+a]*x[d+g]/m,i[c+n]+=C*L,i[c+r]+=E*L):m<0&&(L=-s*i[c+a]*x[d+g]/Math.sqrt(m),i[c+n]+=C*L,i[c+r]+=E*L):m>0&&(L=s*i[c+a]*x[d+g]/m,i[c+n]+=C*L,i[c+r]+=E*L),(d=x[d+p])<0)break;continue}d=x[d+f]}else{var S=x[d+u];if(S>=0&&S!==c&&(m=(C=i[c+t]-i[S+t])*C+(E=i[c+e]-i[S+e])*E,L=void 0,!0===w?m>0?(L=s*i[c+a]*i[S+a]/m,i[c+n]+=C*L,i[c+r]+=E*L):m<0&&(L=-s*i[c+a]*i[S+a]/Math.sqrt(m),i[c+n]+=C*L,i[c+r]+=E*L):m>0&&(L=s*i[c+a]*i[S+a]/m,i[c+n]+=C*L,i[c+r]+=E*L)),(d=x[d+p])<0)break}}))}(o,i,w,_,Math.pow(L,2)):function(t,e,n,r){for(var i=0;i<e.length;i+=1)for(var o=Number(e[i])*h,a=0;a<i;a+=1)r(t,o,Number(e[a])*h,n)}(o,i,w,S)}))}function L(n,r,i,o){var a=n[r+t]-n[i+t],s=n[r+e]-n[i+e],h=-o;w(n,r,i,a*h),_(n,r,i,s*h)}function S(n,r,i,o){var a=n[r+t]-n[i+t],h=n[r+e]-n[i+e],u=-o;Math.sqrt(a*a+h*h)-n[r+s]-n[i+s]>0&&(w(n,r,i,a*u),_(n,r,i,h*u))}function M(n,r,i,o){var a=n[r+t]-n[i+t],s=n[r+e]-n[i+e],h=Math.sqrt(a*a+s*s);if(h>0){var u=-o*Math.log(1+h)/h;w(n,r,i,a*u),_(n,r,i,s*u)}}function A(n,r,i,o){var a=n[r+t]-n[i+t],h=n[r+e]-n[i+e],u=Math.sqrt(a*a+h*h)-n[r+s]-n[i+s];if(u>0){var c=-o*Math.log(1+u)/u;w(n,r,i,a*c),_(n,r,i,h*c)}}function N(t,e){var s=t[e+i]-t[e+n],h=t[e+o]-t[e+r];return t[e+a]*Math.sqrt(Math.pow(s,2)+Math.pow(h,2))}function k(t,e){var a=t[e+i]+t[e+n],s=t[e+o]+t[e+r];return Math.sqrt(Math.pow(a,2)+Math.pow(s,2))/2}function P(a,s,u,c){for(var d=a.adjustSizes,l=0;l<s.length;l+=h)s[l+i]=s[l+n],s[l+o]=s[l+r],s[l+n]=0,s[l+r]=0;E(a,s,c);for(var p=u.length,f=0;f<p;f+=3){var g=u[f+0],v=u[f+1],y=u[f+2];!0===d?a.linLogMode?A(s,g,v,y):S(s,g,v,y):a.linLogMode?M(s,g,v,y):L(s,g,v,y)}if(!0===d){for(l=0;l<s.length;l+=h)if(1!==s[l+9]){var m=Math.sqrt(Math.pow(s[l+n],2)+Math.pow(s[l+r],2));m>10&&(s[l+n]=10*s[l+n]/m,s[l+r]=10*s[l+r]/m);var b=N(s,l),w=k(s,l),_=1+Math.sqrt(b),x=(C=.1*Math.log(1+w)/_)/a.slowDown;s[l+t]+=s[l+n]*x,s[l+e]+=s[l+r]*x}}else for(l=0;l<s.length;l+=h)if(1!==s[l+9]){b=N(s,l),w=k(s,l),_=1+Math.sqrt(b);var C=s[l+7]*Math.log(1+w)/_;s[l+7]=Math.min(1,Math.sqrt(C*(Math.pow(s[l+n],2)+Math.pow(s[l+r],2))/_)),x=C/a.slowDown,s[l+t]+=s[l+n]*x,s[l+e]+=s[l+r]*x}return{}}self.onmessage=function(t){for(var e=t.data,n=new Float32Array(e.nodes),r=new Float32Array(e.edges),i=0;i<e.iterations;i++)P(e.settings,n,r,e.components);self.postMessage({nodes:n.buffer,edges:r.buffer,__messageId:e.__messageId},[n.buffer,r.buffer])}}var st={value:()=>{}};function ht(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new ut(r)}function ut(t){this._=t}function ct(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function dt(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=st,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}ut.prototype=ht.prototype={constructor:ut,on:function(t,e){var n,r,i=this._,o=(r=i,(t+"").trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),a=-1,s=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a<s;)if(n=(t=o[a]).type)i[n]=dt(i[n],t.name,e);else if(null==e)for(n in i)i[n]=dt(i[n],t.name,null);return this}for(;++a<s;)if((n=(t=o[a]).type)&&(n=ct(i[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new ut(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(r=this._[t]).length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};const lt=ht;var pt,ft,gt=0,vt=0,yt=0,mt=1e3,bt=0,wt=0,_t=0,xt="object"==typeof performance&&performance.now?performance:Date,Ct="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Et(){return wt||(Ct(Lt),wt=xt.now()+_t)}function Lt(){wt=0}function St(){this._call=this._time=this._next=null}function Mt(t,e,n){var r=new St;return r.restart(t,e,n),r}function At(){wt=(bt=xt.now())+_t,gt=vt=0;try{!function(){Et(),++gt;for(var t,e=pt;e;)(t=wt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--gt}()}finally{gt=0,function(){for(var t,e,n=pt,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:pt=e);ft=t,kt(r)}(),wt=0}}function Nt(){var t=xt.now(),e=t-bt;e>mt&&(_t-=e,bt=t)}function kt(t){gt||(vt&&(vt=clearTimeout(vt)),t-wt>24?(t<1/0&&(vt=setTimeout(At,t-xt.now()-_t)),yt&&(yt=clearInterval(yt))):(yt||(bt=xt.now(),yt=setInterval(Nt,mt)),gt=1,Ct(At)))}St.prototype=Mt.prototype={constructor:St,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Et():+n)+(null==e?0:+e),this._next||ft===this||(ft?ft._next=this:pt=this,ft=this),this._call=t,this._time=n,kt()},stop:function(){this._call&&(this._call=null,this._time=1/0,kt())}};const Pt=4294967296;function Dt(t){return t.x}function Gt(t){return t.y}var Ft=Math.PI*(3-Math.sqrt(5));function Ot(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,o,a,s,h,u,c,d,l,p=t._root,f={data:r},g=t._x0,v=t._y0,y=t._x1,m=t._y1;if(!p)return t._root=f,t;for(;p.length;)if((u=e>=(o=(g+y)/2))?g=o:y=o,(c=n>=(a=(v+m)/2))?v=a:m=a,i=p,!(p=p[d=c<<1|u]))return i[d]=f,t;if(s=+t._x.call(null,p.data),h=+t._y.call(null,p.data),e===s&&n===h)return f.next=p,i?i[d]=f:t._root=f,t;do{i=i?i[d]=new Array(4):t._root=new Array(4),(u=e>=(o=(g+y)/2))?g=o:y=o,(c=n>=(a=(v+m)/2))?v=a:m=a}while((d=c<<1|u)==(l=(h>=a)<<1|s>=o));return i[l]=p,i[d]=f,t}function Tt(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function Rt(t){return t[0]}function jt(t){return t[1]}function zt(t,e,n){var r=new Bt(null==e?Rt:e,null==n?jt:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function Bt(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function Ut(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var It=zt.prototype=Bt.prototype;function Ht(t){return function(){return t}}function Wt(t){return 1e-6*(t()-.5)}function Vt(t){return t.x+t.vx}function qt(t){return t.y+t.vy}function Zt(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(e[1]-t[1])*(n[0]-t[0])}function Yt(t,e){return t[0]-e[0]||t[1]-e[1]}function Kt(t){const e=t.length,n=[0,1];let r,i=2;for(r=2;r<e;++r){for(;i>1&&Zt(t[n[i-2]],t[n[i-1]],t[r])<=0;)--i;n[i++]=r}return n.slice(0,i)}function Xt(t,e,n){var r={};t.forEach((function(t,e){t.forEach((function(t){var n=Number(t);r[n]=e}))}));var i=t.map((function(t){return t.map((function(t){var n=Number(t)*m;return[e[n+h],e[n+u]]}))})),o=i.map((function(t){return function(t){if((n=t.length)<3)return null;var e,n,r=new Array(n),i=new Array(n);for(e=0;e<n;++e)r[e]=[+t[e][0],+t[e][1],e];for(r.sort(Yt),e=0;e<n;++e)i[e]=[r[e][0],-r[e][1]];var o=Kt(r),a=Kt(i),s=a[0]===o[0],h=a[a.length-1]===o[o.length-1],u=[];for(e=o.length-1;e>=0;--e)u.push(t[r[o[e]][2]]);for(e=+s;e<a.length-h;++e)u.push(t[r[a[e]][2]]);return u}(t)})),a=o.map((function(t,e){if(null===t){var n=i[e];return 1===n.length?n[0]:[(n[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2]}return function(t){for(var e,n,r=-1,i=t.length,o=0,a=0,s=t[i-1],h=0;++r<i;)e=s,s=t[r],h+=n=e[0]*s[1]-s[0]*e[1],o+=(e[0]+s[0])*n,a+=(e[1]+s[1])*n;return[o/(h*=3),a/h]}(t)})),s=o.map((function(t,e){var n=a[e],r=0;if(null===t){var o=i[e];if(1===o.length)r=5;else{var s=o[1][0]-o[0][0],h=o[1][1]-o[0][1];r=Math.sqrt(Math.pow(s,2)+Math.pow(h,2))/2}}else for(var u=0;u<t.length;u+=1){var c=t[u],d=(s=c[0]-n[0],h=c[1]-n[1],Math.sqrt(Math.pow(s,2)+Math.pow(h,2)));r=Math.max(d,r)}return r})),c=t.map((function(t,e){var n=Object.create(t);return n.radius=s[e],n})),d=function(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,h=Mt(d),u=lt("tick","end"),c=function(){let t=1;return()=>(t=(1664525*t+1013904223)%Pt)/Pt}();function d(){l(),u.call("tick",e),n<r&&(h.stop(),u.call("end",e))}function l(r){var h,u,c=t.length;void 0===r&&(r=1);for(var d=0;d<r;++d)for(n+=(o-n)*i,s.forEach((function(t){t(n)})),h=0;h<c;++h)null==(u=t[h]).fx?u.x+=u.vx*=a:(u.x=u.fx,u.vx=0),null==u.fy?u.y+=u.vy*=a:(u.y=u.fy,u.vy=0);return e}function p(){for(var e,n=0,r=t.length;n<r;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var i=10*Math.sqrt(.5+n),o=n*Ft;e.x=i*Math.cos(o),e.y=i*Math.sin(o)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function f(e){return e.initialize&&e.initialize(t,c),e}return null==t&&(t=[]),p(),e={tick:l,restart:function(){return h.restart(d),e},stop:function(){return h.stop(),e},nodes:function(n){return arguments.length?(t=n,p(),s.forEach(f),e):t},alpha:function(t){return arguments.length?(n=+t,e):n},alphaMin:function(t){return arguments.length?(r=+t,e):r},alphaDecay:function(t){return arguments.length?(i=+t,e):+i},alphaTarget:function(t){return arguments.length?(o=+t,e):o},velocityDecay:function(t){return arguments.length?(a=1-t,e):1-a},randomSource:function(t){return arguments.length?(c=t,s.forEach(f),e):c},force:function(t,n){return arguments.length>1?(null==n?s.delete(t):s.set(t,f(n)),e):s.get(t)},find:function(e,n,r){var i,o,a,s,h,u=0,c=t.length;for(null==r?r=1/0:r*=r,u=0;u<c;++u)(a=(i=e-(s=t[u]).x)*i+(o=n-s.y)*o)<r&&(h=s,r=a);return h},on:function(t,n){return arguments.length>1?(u.on(t,n),e):u.on(t)}}}(c).force("charge",function(){var t,e,n,r,i,o=Ht(-30),a=1,s=1/0,h=.81;function u(n){var i,o=t.length,a=zt(t,Dt,Gt).visitAfter(d);for(r=n,i=0;i<o;++i)e=t[i],a.visit(l)}function c(){if(t){var e,n,r=t.length;for(i=new Array(r),e=0;e<r;++e)n=t[e],i[n.index]=+o(n,e,t)}}function d(t){var e,n,r,o,a,s=0,h=0;if(t.length){for(r=o=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(s+=e.value,h+=n,r+=n*e.x,o+=n*e.y);t.x=r/h,t.y=o/h}else{(e=t).x=e.data.x,e.y=e.data.y;do{s+=i[e.data.index]}while(e=e.next)}t.value=s}function l(t,o,u,c){if(!t.value)return!0;var d=t.x-e.x,l=t.y-e.y,p=c-o,f=d*d+l*l;if(p*p/h<f)return f<s&&(0===d&&(f+=(d=Wt(n))*d),0===l&&(f+=(l=Wt(n))*l),f<a&&(f=Math.sqrt(a*f)),e.vx+=d*t.value*r/f,e.vy+=l*t.value*r/f),!0;if(!(t.length||f>=s)){(t.data!==e||t.next)&&(0===d&&(f+=(d=Wt(n))*d),0===l&&(f+=(l=Wt(n))*l),f<a&&(f=Math.sqrt(a*f)));do{t.data!==e&&(p=i[t.data.index]*r/f,e.vx+=d*p,e.vy+=l*p)}while(t=t.next)}}return u.initialize=function(e,r){t=e,n=r,c()},u.strength=function(t){return arguments.length?(o="function"==typeof t?t:Ht(+t),c(),u):o},u.distanceMin=function(t){return arguments.length?(a=t*t,u):Math.sqrt(a)},u.distanceMax=function(t){return arguments.length?(s=t*t,u):Math.sqrt(s)},u.theta=function(t){return arguments.length?(h=t*t,u):Math.sqrt(h)},u}()).force("center",function(t,e){var n,r=1;function i(){var i,o,a=n.length,s=0,h=0;for(i=0;i<a;++i)s+=(o=n[i]).x,h+=o.y;for(s=(s/a-t)*r,h=(h/a-e)*r,i=0;i<a;++i)(o=n[i]).x-=s,o.y-=h}return null==t&&(t=0),null==e&&(e=0),i.initialize=function(t){n=t},i.x=function(e){return arguments.length?(t=+e,i):t},i.y=function(t){return arguments.length?(e=+t,i):e},i.strength=function(t){return arguments.length?(r=+t,i):r},i}(0,0)).force("collision",function(t){var e,n,r,i=1,o=1;function a(){for(var t,a,h,u,c,d,l,p=e.length,f=0;f<o;++f)for(a=zt(e,Vt,qt).visitAfter(s),t=0;t<p;++t)h=e[t],d=n[h.index],l=d*d,u=h.x+h.vx,c=h.y+h.vy,a.visit(g);function g(t,e,n,o,a){var s=t.data,p=t.r,f=d+p;if(!s)return e>u+f||o<u-f||n>c+f||a<c-f;if(s.index>h.index){var g=u-s.x-s.vx,v=c-s.y-s.vy,y=g*g+v*v;y<f*f&&(0===g&&(y+=(g=Wt(r))*g),0===v&&(y+=(v=Wt(r))*v),y=(f-(y=Math.sqrt(y)))/y*i,h.vx+=(g*=y)*(f=(p*=p)/(l+p)),h.vy+=(v*=y)*f,s.vx-=g*(f=1-f),s.vy-=v*f)}}}function s(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function h(){if(e){var r,i,o=e.length;for(n=new Array(o),r=0;r<o;++r)i=e[r],n[i.index]=+t(i,r,e)}}return"function"!=typeof t&&(t=Ht(null==t?1:+t)),a.initialize=function(t,n){e=t,r=n,h()},a.iterations=function(t){return arguments.length?(o=+t,a):o},a.strength=function(t){return arguments.length?(i=+t,a):i},a.radius=function(e){return arguments.length?(t="function"==typeof e?e:Ht(+e),h(),a):t},a}().radius((function(t){return t.radius})));return d.stop(),d.tick(n),{vertices:t.map((function(t){return t.map((function(t){return Number(t)}))})).flat(),node_to_component_id:r,components_to_circle_pack:c,polygon_centroids_initial:a}}It.copy=function(){var t,e,n=new Bt(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=Ut(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=Ut(e));return n},It.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return Ot(this.cover(e,n),e,n,t)},It.addAll=function(t){var e,n,r,i,o=t.length,a=new Array(o),s=new Array(o),h=1/0,u=1/0,c=-1/0,d=-1/0;for(n=0;n<o;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(i=+this._y.call(null,e))||(a[n]=r,s[n]=i,r<h&&(h=r),r>c&&(c=r),i<u&&(u=i),i>d&&(d=i));if(h>c||u>d)return this;for(this.cover(h,u).cover(c,d),n=0;n<o;++n)Ot(this,a[n],s[n],t[n]);return this},It.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,o=(r=Math.floor(e))+1;else{for(var a,s,h=i-n||1,u=this._root;n>t||t>=i||r>e||e>=o;)switch(s=(e<r)<<1|t<n,(a=new Array(4))[s]=u,u=a,h*=2,s){case 0:i=n+h,o=r+h;break;case 1:n=i-h,o=r+h;break;case 2:i=n+h,r=o-h;break;case 3:n=i-h,r=o-h}this._root&&this._root.length&&(this._root=u)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this},It.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},It.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},It.find=function(t,e,n){var r,i,o,a,s,h,u,c=this._x0,d=this._y0,l=this._x1,p=this._y1,f=[],g=this._root;for(g&&f.push(new Tt(g,c,d,l,p)),null==n?n=1/0:(c=t-n,d=e-n,l=t+n,p=e+n,n*=n);h=f.pop();)if(!(!(g=h.node)||(i=h.x0)>l||(o=h.y0)>p||(a=h.x1)<c||(s=h.y1)<d))if(g.length){var v=(i+a)/2,y=(o+s)/2;f.push(new Tt(g[3],v,y,a,s),new Tt(g[2],i,y,v,s),new Tt(g[1],v,o,a,y),new Tt(g[0],i,o,v,y)),(u=(e>=y)<<1|t>=v)&&(h=f[f.length-1],f[f.length-1]=f[f.length-1-u],f[f.length-1-u]=h)}else{var m=t-+this._x.call(null,g.data),b=e-+this._y.call(null,g.data),w=m*m+b*b;if(w<n){var _=Math.sqrt(n=w);c=t-_,d=e-_,l=t+_,p=e+_,r=g.data}}return r},It.remove=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t)))return this;var e,n,r,i,o,a,s,h,u,c,d,l,p=this._root,f=this._x0,g=this._y0,v=this._x1,y=this._y1;if(!p)return this;if(p.length)for(;;){if((u=o>=(s=(f+v)/2))?f=s:v=s,(c=a>=(h=(g+y)/2))?g=h:y=h,e=p,!(p=p[d=c<<1|u]))return this;if(!p.length)break;(e[d+1&3]||e[d+2&3]||e[d+3&3])&&(n=e,l=d)}for(;p.data!==t;)if(r=p,!(p=p.next))return this;return(i=p.next)&&delete p.next,r?(i?r.next=i:delete r.next,this):e?(i?e[d]=i:delete e[d],(p=e[0]||e[1]||e[2]||e[3])&&p===(e[3]||e[2]||e[1]||e[0])&&!p.length&&(n?n[l]=p:this._root=p),this):(this._root=i,this)},It.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},It.root=function(){return this._root},It.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},It.visit=function(t){var e,n,r,i,o,a,s=[],h=this._root;for(h&&s.push(new Tt(h,this._x0,this._y0,this._x1,this._y1));e=s.pop();)if(!t(h=e.node,r=e.x0,i=e.y0,o=e.x1,a=e.y1)&&h.length){var u=(r+o)/2,c=(i+a)/2;(n=h[3])&&s.push(new Tt(n,u,c,o,a)),(n=h[2])&&s.push(new Tt(n,r,c,u,a)),(n=h[1])&&s.push(new Tt(n,u,i,o,c)),(n=h[0])&&s.push(new Tt(n,r,i,u,c))}return this},It.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new Tt(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var o,a=e.x0,s=e.y0,h=e.x1,u=e.y1,c=(a+h)/2,d=(s+u)/2;(o=i[0])&&n.push(new Tt(o,a,s,c,d)),(o=i[1])&&n.push(new Tt(o,c,s,h,d)),(o=i[2])&&n.push(new Tt(o,a,d,c,u)),(o=i[3])&&n.push(new Tt(o,c,d,h,u))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},It.x=function(t){return arguments.length?(this._x=t,this):this._x},It.y=function(t){return arguments.length?(this._y=t,this):this._y};var Qt=function(t,e,n){var r=e.filter((function(t){return t.length>1})),i=e.filter((function(t){return 1===t.length})),o=Xt(r,t,n),a=Number.MAX_VALUE,s=Number.MIN_VALUE,c=Number.MAX_VALUE,d=Number.MIN_VALUE;o.vertices.forEach((function(e){var n=o.node_to_component_id[e],r=o.polygon_centroids_initial[n],i=o.components_to_circle_pack[n].x+t[e*m+h]-r[0],l=o.components_to_circle_pack[n].y+t[e*m+u]-r[1];t[e*m+h]=i,t[e*m+u]=l;var p=t[e*m+v];s=Math.max(s,i+p),a=Math.min(a,i-p),d=Math.max(d,l+p),c=Math.min(c,l-p)}));var l=Xt(i,t,n),p=Number.MAX_VALUE,f=Number.MIN_VALUE,g=Number.MAX_VALUE,y=Number.MIN_VALUE,b=r.reduce((function(t,e){return t+e.length}),0);if(l.vertices.forEach((function(e){var n=l.node_to_component_id[e],r=l.components_to_circle_pack[n].x,i=l.components_to_circle_pack[n].y,o=t[e*m+v];f=Math.max(r+o,f),p=Math.min(r-o,p),y=Math.max(i+o,y),g=Math.min(i-o,g)})),0===b)l.vertices.forEach((function(e){var n=l.node_to_component_id[e],r=l.components_to_circle_pack[n].x,i=l.components_to_circle_pack[n].y;t[e*m+h]=r,t[e*m+u]=i}));else{var w=(d+c)/2,_=(s-a)*(d-c),x=(f-p)*(y-g),C=i.length/b,E=Math.sqrt(C*_/x);f=-1/0,p=1/0,l.vertices.forEach((function(e){var n=l.node_to_component_id[e],r=l.components_to_circle_pack[n].x,i=l.components_to_circle_pack[n].y;t[e*m+h]=a-r*E,t[e*m+u]=w+i*E;var o=t[e*m+v];f=Math.max(a-r*E+o,f),p=Math.min(a-r*E-o,p)}));var L=f-a,S=.1*Math.max(f-p,s-a);l.vertices.forEach((function(e){t[e*m+h]-=L+S}))}},Jt=n(847),$t=n(739),te=function(t,e,n,r){return void 0===n&&(n=!0),void 0===r&&(r=!1),o=function(){var i,o,h,u,c,d,l,p,f,g,v;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(h){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,h])}}}(this,(function(y){switch(y.label){case 0:if(!ot()(t))throw new Error("graphology-layout-forceatlas2: the given graph is not a valid graphology instance.");if(i=e.iterations,o=(0,s.kS)(t),"number"!=typeof i)throw new Error("graphology-layout-forceatlas2: invalid number of iterations.");if(i<=0)throw new Error("graphology-layout-forceatlas2: you should provide a positive number of iterations.");if(h=(0,a.Q6)("getEdgeWeight"in e?e.getEdgeWeight:"weight").fromEntry,u="function"==typeof e.outputReducer?e.outputReducer:null,c=$t.assign({},Jt,e.settings),d=$t.validateSettings(c))throw new Error("graphology-layout-forceatlas2: ".concat(d.message));return l=$t.graphToByteArrays(t,h),n?(f=$t.createWorker(at),g={iterations:i,settings:c,nodes:l.nodes.buffer,edges:l.edges.buffer,components:o,__messageId:"initialGraphLayout"},f.postMessage(g,[l.nodes.buffer,l.edges.buffer]),[4,new Promise((function(t){f.onmessage=function(e){t(new Float32Array(e.data.nodes)),f.terminate()}}))]):[3,2];case 1:return p=y.sent(),[3,3];case 2:if(r){for(v=0;v<.9*i;v++)c.nRepulsiveCycles=v%5==0?null:40,c.randomSeed="iteration".concat(v),J(c,l.nodes,l.edges,o);for(c.nRepulsiveCycles=null,v=.1*i;v<i;v++)J(c,l.nodes,l.edges,o)}else for(v=0;v<i;v++)J(c,l.nodes,l.edges,o);p=l.nodes,y.label=3;case 3:return Qt(p,o,100),$t.assignLayoutChanges(t,p,u),[2]}}))},new((i=void 0)||(i=Promise))((function(t,e){function n(t){try{a(o.next(t))}catch(t){e(t)}}function r(t){try{a(o.throw(t))}catch(t){e(t)}}function a(e){var o;e.done?t(e.value):(o=e.value,o instanceof i?o:new i((function(t){t(o)}))).then(n,r)}a((o=o.apply(void 0,[])).next())}));var i,o},ee=function(){return ee=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},ee.apply(this,arguments)},ne=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{h(r.next(t))}catch(t){o(t)}}function s(t){try{h(r.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}h((r=r.apply(t,e||[])).next())}))},re=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(h){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,h])}}},ie=function(){function t(t,e,n){this.zoomFactor=1.5,this.zoomDuration=200,this.sigma=t,this.graph=e,this.animator=n}return t.prototype.getFramedGraphBounds=function(){var t=this.sigma.getBBox(),e=t.x,n=e[0],r=e[1],i=t.y,o=i[0],a=i[1];return[this.sigma.viewportToFramedGraph(this.sigma.graphToViewport({x:n,y:o})),this.sigma.viewportToFramedGraph(this.sigma.graphToViewport({x:r,y:a}))]},t.prototype.getFramedGraphZoomRatio=function(t,e){var n=this.sigma.getDimensions(),r=n.width,i=n.height,o=Math.max(r,i),a=o/r,s=o/i;return Math.max((e.x-t.x)*a,(e.y-t.y)*s)},t.prototype.applyInitialLayout=function(t){return ne(this,void 0,void 0,(function(){return re(this,(function(e){switch(e.label){case 0:return[4,te(this.graph,t)];case 1:return e.sent(),this.animator.forceNodePositionUpdate(),[2]}}))}))},t.prototype.zoomIn=function(){this.sigma.getCamera().animatedZoom({duration:this.zoomDuration,factor:this.zoomFactor})},t.prototype.zoomOut=function(){this.sigma.getCamera().animatedUnzoom({duration:this.zoomDuration,factor:this.zoomFactor})},t.prototype.resetView=function(){return ne(this,void 0,void 0,(function(){var t,e,n,r,i,a,s;return re(this,(function(h){switch(h.label){case 0:return t=ee(ee({},nt),o().inferSettings(this.graph)),e={iterations:300,settings:t},this.animator.stop(),this.sigma.getCustomBBox()||this.sigma.setCustomBBox(this.sigma.getBBox()),[4,this.applyInitialLayout(e)];case 1:return h.sent(),n=this.getFramedGraphBounds(),r=n[0],i=n[1],a={x:(i.x+r.x)/2,y:(i.y+r.y)/2},s=this.getFramedGraphZoomRatio(r,i),this.sigma.getCamera().animate(ee(ee({},a),{ratio:s,angle:0}),{duration:this.zoomDuration}),this.animator.start(),[2]}}))}))},t}(),oe="\n <svg\n width='32'\n height='32'\n viewBox='0 0 32 32'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n >\n <g clip-path='url(#clip0_9590_459423)'>\n <path\n d='M14.9999 15.9987C15.2448 15.9987 15.4812 16.0887 15.6643 16.2514C15.8473 16.4142 15.9642 16.6384 15.9929 16.8817L15.9999 16.9987V21.9987C15.9996 22.2536 15.902 22.4987 15.727 22.6841C15.5521 22.8694 15.3129 22.9809 15.0585 22.9959C14.804 23.0108 14.5535 22.928 14.3581 22.7644C14.1626 22.6008 14.037 22.3688 14.0069 22.1157L13.9999 21.9987V19.4127L8.70688 24.7057C8.52693 24.885 8.28545 24.9892 8.0315 24.9969C7.77755 25.0047 7.53017 24.9155 7.33961 24.7474C7.14904 24.5794 7.02958 24.3451 7.00549 24.0922C6.98139 23.8393 7.05447 23.5867 7.20988 23.3857L7.29288 23.2917L12.5859 17.9987H9.99988C9.745 17.9984 9.49985 17.9008 9.31452 17.7258C9.12918 17.5509 9.01765 17.3117 9.00271 17.0573C8.98778 16.8029 9.07056 16.5523 9.23415 16.3569C9.39774 16.1614 9.62979 16.0358 9.88288 16.0057L9.99988 15.9987H14.9999ZM23.2929 7.29169C23.4728 7.11235 23.7143 7.00822 23.9683 7.00047C24.2222 6.99271 24.4696 7.08191 24.6602 7.24994C24.8507 7.41798 24.9702 7.65225 24.9943 7.90517C25.0184 8.15809 24.9453 8.4107 24.7899 8.61169L24.7069 8.70569L19.4139 13.9987H21.9999C22.2548 13.999 22.4999 14.0966 22.6853 14.2715C22.8706 14.4465 22.9821 14.6856 22.9971 14.9401C23.012 15.1945 22.9292 15.4451 22.7656 15.6405C22.602 15.836 22.37 15.9616 22.1169 15.9917L21.9999 15.9987H16.9999C16.755 15.9987 16.5185 15.9087 16.3355 15.746C16.1525 15.5832 16.0355 15.3589 16.0069 15.1157L15.9999 14.9987V9.99869C16.0002 9.74381 16.0978 9.49866 16.2727 9.31333C16.4477 9.12799 16.6868 9.01646 16.9413 9.00152C17.1957 8.98659 17.4463 9.06937 17.6417 9.23296C17.8372 9.39655 17.9628 9.6286 17.9929 9.88169L17.9999 9.99869V12.5847L23.2929 7.29169Z'\n fill='black'\n />\n </g>\n <defs>\n <clip-path id='clip0_9590_459423'>\n <rect width='24' height='24' fill='white' transform='translate(4 4)' />\n </clip-path>\n </defs>\n </svg>\n",ae="\n<svg\n width='32'\n height='32'\n viewBox='0 0 32 32'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n >\n <g clip-path='url(#clip0_9590_459383)'>\n <path\n d='M13.793 16.793C13.973 16.6137 14.2144 16.5095 14.4684 16.5018C14.7223 16.494 14.9697 16.5832 15.1603 16.7512C15.3508 16.9193 15.4703 17.1536 15.4944 17.4065C15.5185 17.6594 15.4454 17.912 15.29 18.113L15.207 18.207L10.414 23H13C13.2549 23.0003 13.5 23.0979 13.6854 23.2728C13.8707 23.4478 13.9822 23.687 13.9972 23.9414C14.0121 24.1958 13.9293 24.4464 13.7657 24.6418C13.6021 24.8373 13.3701 24.9629 13.117 24.993L13 25H8C7.75507 25 7.51866 24.91 7.33563 24.7473C7.15259 24.5845 7.03566 24.3603 7.007 24.117L7 24V19C7.00028 18.7451 7.09788 18.5 7.27285 18.3146C7.44782 18.1293 7.68695 18.0178 7.94139 18.0028C8.19584 17.9879 8.44638 18.0707 8.64183 18.2343C8.83729 18.3979 8.9629 18.6299 8.993 18.883L9 19V21.586L13.793 16.793ZM24 7C24.2449 7.00003 24.4813 7.08996 24.6644 7.25272C24.8474 7.41547 24.9643 7.63975 24.993 7.883L25 8V13C24.9997 13.2549 24.9021 13.5 24.7272 13.6854C24.5522 13.8707 24.313 13.9822 24.0586 13.9972C23.8042 14.0121 23.5536 13.9293 23.3582 13.7657C23.1627 13.6021 23.0371 13.3701 23.007 13.117L23 13V10.414L18.207 15.207C18.027 15.3863 17.7856 15.4905 17.5316 15.4982C17.2777 15.506 17.0303 15.4168 16.8397 15.2488C16.6492 15.0807 16.5297 14.8464 16.5056 14.5935C16.4815 14.3406 16.5546 14.088 16.71 13.887L16.793 13.793L21.586 9H19C18.7451 8.99972 18.5 8.90212 18.3146 8.72715C18.1293 8.55218 18.0178 8.31305 18.0028 8.05861C17.9879 7.80416 18.0707 7.55362 18.2343 7.35817C18.3979 7.16271 18.6299 7.0371 18.883 7.007L19 7H24Z'\n fill='black'\n />\n </g>\n <defs>\n <clip-path id='clip0_9590_459383'>\n <rect width='24' height='24' fill='white' transform='translate(4 4)' />\n </clip-path>\n </defs>\n </svg>\n",se='\n<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 8L24 16L12 24V8Z" fill="#122239" stroke="#122239" stroke-linejoin="round" stroke-width="2" stroke-linecap="round" />\n</svg>\n',he='\n<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">\n <rect x="10" y="8" width="4" height="16" fill="#122239" stroke="#122239" stroke-width="2"/>\n <rect x="18" y="8" width="4" height="16" fill="#122239" stroke="#122239" stroke-width="2"/>\n</svg>\n',ue=function(){function t(t){var e,n=t.isFullScreen,r=t.animate,i=t.onZoomIn,o=t.onZoomOut,a=t.onResetView,s=t.onToggleFullScreen,h=t.onToggleLassoSelect,u=t.onToggleBoxSelect,c=t.onClearSelection,d=t.onInvertSelection,l=t.onTogglePlayPause;this.controlsContainer=((e=document.createElement("div")).className="controls-container",e.style.position="absolute",e.style.display="flex",e.style.bottom="10px",e.style.right="10px",e.style.zIndex="10",e),this.zoomInButton=ce("\n<svg\n width='32'\n height='32'\n viewBox='0 0 32 32'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n>\n <path d='M9 16H23' stroke='#122239' stroke-width='2' stroke-linecap='round' />\n <path d='M16 9L16 23' stroke='#122239' stroke-width='2' stroke-linecap='round' />\n</svg>\n",i,"Zoom In"),this.zoomOutButton=ce("\n<svg width='32' height='32' viewBox='0 0 32 32' fill='none' xmlns='http://www.w3.org/2000/svg'>\n <path\n d='M9 16H23'\n stroke='#122239'\n stroke-width='2'\n stroke-linecap='round'\n stroke-linejoin='round'\n />\n</svg>",o,"Zoom Out"),this.resetButton=ce("\n<svg\n width='32'\n height='32'\n viewBox='0 0 32 32'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n>\n <path\n d='M25.295 18C25.388 17.9999 25.48 18.0181 25.5659 18.0538C25.6517 18.0894 25.7297 18.1417 25.7952 18.2076C25.8608 18.2735 25.9126 18.3518 25.9478 18.4378C25.9829 18.5239 26.0007 18.616 26 18.709V21.913C26.0007 22.0055 25.9831 22.0973 25.9482 22.183C25.9134 22.2688 25.862 22.3468 25.797 22.4126C25.732 22.4785 25.6546 22.5309 25.5694 22.5668C25.4841 22.6027 25.3925 22.6215 25.3 22.622C25.2075 22.6215 25.116 22.6027 25.0307 22.5668C24.9454 22.5309 24.868 22.4785 24.803 22.4126C24.738 22.3468 24.6866 22.2688 24.6518 22.183C24.6169 22.0973 24.5994 22.0055 24.6 21.913V20.788C22.779 23.844 19.399 26 15.757 26C11.347 26 7.65102 23.279 6.04802 19.085C5.98071 18.9103 5.98495 18.716 6.05982 18.5444C6.13469 18.3728 6.27416 18.2375 6.44802 18.168C6.80802 18.027 7.21402 18.208 7.35402 18.573C8.75402 22.235 11.942 24.583 15.757 24.583C19.128 24.583 22.277 22.401 23.744 19.429L22.273 19.439C22.1805 19.4391 22.0888 19.421 22.0033 19.3857C21.9178 19.3504 21.84 19.2985 21.7746 19.2332C21.7091 19.1678 21.6571 19.0901 21.6217 19.0046C21.5863 18.9192 21.568 18.8275 21.568 18.735C21.5656 18.5482 21.6375 18.3681 21.7678 18.2342C21.8981 18.1003 22.0762 18.0236 22.263 18.021L25.295 18ZM16.245 6C20.653 6 24.35 8.721 25.953 12.915C26.0203 13.0897 26.0161 13.284 25.9412 13.4556C25.8663 13.6272 25.7269 13.7625 25.553 13.832C25.467 13.8655 25.3752 13.8817 25.2829 13.8794C25.1906 13.8772 25.0996 13.8566 25.0153 13.8189C24.931 13.7813 24.8551 13.7272 24.7918 13.6599C24.7286 13.5926 24.6794 13.5135 24.647 13.427C23.247 9.765 20.059 7.417 16.244 7.417C12.873 7.417 9.72402 9.599 8.25702 12.571L9.72802 12.561C9.82055 12.5609 9.9122 12.579 9.99773 12.6143C10.0833 12.6496 10.161 12.7015 10.2265 12.7668C10.2919 12.8322 10.3439 12.9099 10.3793 12.9954C10.4148 13.0808 10.433 13.1725 10.433 13.265C10.4354 13.4518 10.3636 13.6319 10.2333 13.7658C10.1029 13.8997 9.92483 13.9764 9.73802 13.979L6.70502 14C6.61206 14.0001 6.52 13.9819 6.43414 13.9462C6.34828 13.9106 6.27033 13.8583 6.20479 13.7924C6.13925 13.7265 6.08741 13.6482 6.05226 13.5622C6.01711 13.4761 5.99936 13.384 6.00002 13.291V10.087C6.00002 9.695 6.31302 9.378 6.70002 9.378C7.08602 9.378 7.40002 9.695 7.40002 10.087V11.212C9.22102 8.156 12.601 6 16.243 6H16.245Z'\n fill='#122239'\n stroke='#122239'\n stroke-width='0.5'\n />\n <circle cx='16' cy='16' r='3' fill='#122239' />\n</svg>\n",a,"Reset View"),this.fullScreenButton=ce(n?oe:ae,s,n?"Scale back":"Expand"),this.lassoSelectButton=ce("\n<svg\n width='32'\n height='32'\n viewBox='0 0 32 32'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n >\n <path\n d='M11 26C10.379 25.5343 9.875 24.9303 9.52786 24.2361C9.18073 23.5418 9 22.7762 9 22M7.3 18C6.45485 16.8376 5.99974 15.4372 6 14C6 9.6 10.5 6 16 6C21.5 6 26 9.6 26 14C26 18.4 21.5 22 16 22C14.2809 22.0287 12.5758 21.6877 11 21'\n stroke='#122239'\n stroke-width='2'\n stroke-linecap='round'\n stroke-linejoin='round'\n />\n <path\n d='M9 22C9.53043 22 10.0391 21.7893 10.4142 21.4142C10.7893 21.0391 11 20.5304 11 20C11 19.4696 10.7893 18.9609 10.4142 18.5858C10.0391 18.2107 9.53043 18 9 18C8.46957 18 7.96086 18.2107 7.58579 18.5858C7.21071 18.9609 7 19.4696 7 20C7 20.5304 7.21071 21.0391 7.58579 21.4142C7.96086 21.7893 8.46957 22 9 22V22Z'\n stroke='#122239'\n stroke-width='1.5'\n stroke-linecap='round'\n stroke-linejoin='round'\n />\n </svg>\n",h,"Lasso Select"),this.boxSelectButton=ce("\n<svg width='32' height='32' viewBox='0 0 32 32' fill='none' xmlns='http://www.w3.org/2000/svg'>\n <path\n d='M6 17.6667V14.3333C6 14.1123 6.0878 13.9004 6.24408 13.7441C6.40036 13.5878 6.61232 13.5 6.83333 13.5C7.05435 13.5 7.26631 13.5878 7.42259 13.7441C7.57887 13.9004 7.66667 14.1123 7.66667 14.3333V17.6667C7.66667 17.8877 7.57887 18.0996 7.42259 18.2559C7.26631 18.4122 7.05435 18.5 6.83333 18.5C6.61232 18.5 6.40036 18.4122 6.24408 18.2559C6.0878 18.0996 6 17.8877 6 17.6667ZM10.1667 6H7.66667C7.22464 6 6.80072 6.17559 6.48816 6.48816C6.17559 6.80072 6 7.22464 6 7.66667V10.1667C6 10.3877 6.0878 10.5996 6.24408 10.7559C6.40036 10.9122 6.61232 11 6.83333 11C7.05435 11 7.26631 10.9122 7.42259 10.7559C7.57887 10.5996 7.66667 10.3877 7.66667 10.1667V7.66667H10.1667C10.3877 7.66667 10.5996 7.57887 10.7559 7.42259C10.9122 7.26631 11 7.05435 11 6.83333C11 6.61232 10.9122 6.40036 10.7559 6.24408C10.5996 6.0878 10.3877 6 10.1667 6ZM10.1667 24.3333H7.66667V21.8333C7.66667 21.6123 7.57887 21.4004 7.42259 21.2441C7.26631 21.0878 7.05435 21 6.83333 21C6.61232 21 6.40036 21.0878 6.24408 21.2441C6.0878 21.4004 6 21.6123 6 21.8333V24.3333C6 24.7754 6.17559 25.1993 6.48816 25.5118C6.80072 25.8244 7.22464 26 7.66667 26H10.1667C10.3877 26 10.5996 25.9122 10.7559 25.7559C10.9122 25.5996 11 25.3877 11 25.1667C11 24.9457 10.9122 24.7337 10.7559 24.5774C10.5996 24.4211 10.3877 24.3333 10.1667 24.3333ZM17.6667 24.3333H14.3333C14.1123 24.3333 13.9004 24.4211 13.7441 24.5774C13.5878 24.7337 13.5 24.9457 13.5 25.1667C13.5 25.3877 13.5878 25.5996 13.7441 25.7559C13.9004 25.9122 14.1123 26 14.3333 26H17.6667C17.8877 26 18.0996 25.9122 18.2559 25.7559C18.4122 25.5996 18.5 25.3877 18.5 25.1667C18.5 24.9457 18.4122 24.7337 18.2559 24.5774C18.0996 24.4211 17.8877 24.3333 17.6667 24.3333ZM25.1667 13.5C24.9457 13.5 24.7337 13.5878 24.5774 13.7441C24.4211 13.9004 24.3333 14.1123 24.3333 14.3333V17.6667C24.3333 17.8877 24.4211 18.0996 24.5774 18.2559C24.7337 18.4122 24.9457 18.5 25.1667 18.5C25.3877 18.5 25.5996 18.4122 25.7559 18.2559C25.9122 18.0996 26 17.8877 26 17.6667V14.3333C26 14.1123 25.9122 13.9004 25.7559 13.7441C25.5996 13.5878 25.3877 13.5 25.1667 13.5ZM24.3333 6H21.8333C21.6123 6 21.4004 6.0878 21.2441 6.24408C21.0878 6.40036 21 6.61232 21 6.83333C21 7.05435 21.0878 7.26631 21.2441 7.42259C21.4004 7.57887 21.6123 7.66667 21.8333 7.66667H24.3333V10.1667C24.3333 10.3877 24.4211 10.5996 24.5774 10.7559C24.7337 10.9122 24.9457 11 25.1667 11C25.3877 11 25.5996 10.9122 25.7559 10.7559C25.9122 10.5996 26 10.3877 26 10.1667V7.66667C26 7.22464 25.8244 6.80072 25.5118 6.48816C25.1993 6.17559 24.7754 6 24.3333 6ZM17.6667 6H14.3333C14.1123 6 13.9004 6.0878 13.7441 6.24408C13.5878 6.40036 13.5 6.61232 13.5 6.83333C13.5 7.05435 13.5878 7.26631 13.7441 7.42259C13.9004 7.57887 14.1123 7.66667 14.3333 7.66667H17.6667C17.8877 7.66667 18.0996 7.57887 18.2559 7.42259C18.4122 7.26631 18.5 7.05435 18.5 6.83333C18.5 6.61232 18.4122 6.40036 18.2559 6.24408C18.0996 6.0878 17.8877 6 17.6667 6ZM25.1667 21C24.9457 21 24.7337 21.0878 24.5774 21.2441C24.4211 21.4004 24.3333 21.6123 24.3333 21.8333V24.3333H21.8333C21.6123 24.3333 21.4004 24.4211 21.2441 24.5774C21.0878 24.7337 21 24.9457 21 25.1667C21 25.3877 21.0878 25.5996 21.2441 25.7559C21.4004 25.9122 21.6123 26 21.8333 26H24.3333C24.7754 26 25.1993 25.8244 25.5118 25.5118C25.8244 25.1993 26 24.7754 26 24.3333V21.8333C26 21.6123 25.9122 21.4004 25.7559 21.2441C25.5996 21.0878 25.3877 21 25.1667 21Z'\n fill='#122239'\n stroke='#122239'\n stroke-width='0.5'\n />\n</svg>\n",u,"Box Select"),this.clearSelectionButton=ce("<svg\n width='32'\n height='32'\n viewBox='0 0 32 32'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n>\n <path\n d='M6 17.6667V14.3333C6 14.1123 6.0878 13.9004 6.24408 13.7441C6.40036 13.5878 6.61232 13.5 6.83333 13.5C7.05435 13.5 7.26631 13.5878 7.42259 13.7441C7.57887 13.9004 7.66667 14.1123 7.66667 14.3333V17.6667C7.66667 17.8877 7.57887 18.0996 7.42259 18.2559C7.26631 18.4122 7.05435 18.5 6.83333 18.5C6.61232 18.5 6.40036 18.4122 6.24408 18.2559C6.0878 18.0996 6 17.8877 6 17.6667ZM10.1667 6H7.66667C7.22464 6 6.80072 6.17559 6.48816 6.48816C6.17559 6.80072 6 7.22464 6 7.66667V10.1667C6 10.3877 6.0878 10.5996 6.24408 10.7559C6.40036 10.9122 6.61232 11 6.83333 11C7.05435 11 7.26631 10.9122 7.42259 10.7559C7.57887 10.5996 7.66667 10.3877 7.66667 10.1667V7.66667H10.1667C10.3877 7.66667 10.5996 7.57887 10.7559 7.42259C10.9122 7.26631 11 7.05435 11 6.83333C11 6.61232 10.9122 6.40036 10.7559 6.24408C10.5996 6.0878 10.3877 6 10.1667 6ZM10.1667 24.3333H7.66667V21.8333C7.66667 21.6123 7.57887 21.4004 7.42259 21.2441C7.26631 21.0878 7.05435 21 6.83333 21C6.61232 21 6.40036 21.0878 6.24408 21.2441C6.0878 21.4004 6 21.6123 6 21.8333V24.3333C6 24.7754 6.17559 25.1993 6.48816 25.5118C6.80072 25.8244 7.22464 26 7.66667 26H10.1667C10.3877 26 10.5996 25.9122 10.7559 25.7559C10.9122 25.5996 11 25.3877 11 25.1667C11 24.9457 10.9122 24.7337 10.7559 24.5774C10.5996 24.4211 10.3877 24.3333 10.1667 24.3333ZM17.6667 24.3333H14.3333C14.1123 24.3333 13.9004 24.4211 13.7441 24.5774C13.5878 24.7337 13.5 24.9457 13.5 25.1667C13.5 25.3877 13.5878 25.5996 13.7441 25.7559C13.9004 25.9122 14.1123 26 14.3333 26H17.6667C17.8877 26 18.0996 25.9122 18.2559 25.7559C18.4122 25.5996 18.5 25.3877 18.5 25.1667C18.5 24.9457 18.4122 24.7337 18.2559 24.5774C18.0996 24.4211 17.8877 24.3333 17.6667 24.3333ZM25.1667 13.5C24.9457 13.5 24.7337 13.5878 24.5774 13.7441C24.4211 13.9004 24.3333 14.1123 24.3333 14.3333V17.6667C24.3333 17.8877 24.4211 18.0996 24.5774 18.2559C24.7337 18.4122 24.9457 18.5 25.1667 18.5C25.3877 18.5 25.5996 18.4122 25.7559 18.2559C25.9122 18.0996 26 17.8877 26 17.6667V14.3333C26 14.1123 25.9122 13.9004 25.7559 13.7441C25.5996 13.5878 25.3877 13.5 25.1667 13.5ZM24.3333 6H21.8333C21.6123 6 21.4004 6.0878 21.2441 6.24408C21.0878 6.40036 21 6.61232 21 6.83333C21 7.05435 21.0878 7.26631 21.2441 7.42259C21.4004 7.57887 21.6123 7.66667 21.8333 7.66667H24.3333V10.1667C24.3333 10.3877 24.4211 10.5996 24.5774 10.7559C24.7337 10.9122 24.9457 11 25.1667 11C25.3877 11 25.5996 10.9122 25.7559 10.7559C25.9122 10.5996 26 10.3877 26 10.1667V7.66667C26 7.22464 25.8244 6.80072 25.5118 6.48816C25.1993 6.17559 24.7754 6 24.3333 6ZM17.6667 6H14.3333C14.1123 6 13.9004 6.0878 13.7441 6.24408C13.5878 6.40036 13.5 6.61232 13.5 6.83333C13.5 7.05435 13.5878 7.26631 13.7441 7.42259C13.9004 7.57887 14.1123 7.66667 14.3333 7.66667H17.6667C17.8877 7.66667 18.0996 7.57887 18.2559 7.42259C18.4122 7.26631 18.5 7.05435 18.5 6.83333C18.5 6.61232 18.4122 6.40036 18.2559 6.24408C18.0996 6.0878 17.8877 6 17.6667 6ZM25.1667 21C24.9457 21 24.7337 21.0878 24.5774 21.2441C24.4211 21.4004 24.3333 21.6123 24.3333 21.8333V24.3333H21.8333C21.6123 24.3333 21.4004 24.4211 21.2441 24.5774C21.0878 24.7337 21 24.9457 21 25.1667C21 25.3877 21.0878 25.5996 21.2441 25.7559C21.4004 25.9122 21.6123 26 21.8333 26H24.3333C24.7754 26 25.1993 25.8244 25.5118 25.5118C25.8244 25.1993 26 24.7754 26 24.3333V21.8333C26 21.6123 25.9122 21.4004 25.7559 21.2441C25.5996 21.0878 25.3877 21 25.1667 21Z'\n fill='#122239'\n stroke='#122239'\n stroke-width='0.5'\n />\n <path\n d='M19.8225 12.1835C19.5859 11.9469 19.2036 11.9469 18.967 12.1835L16 15.1445L13.033 12.1775C12.7964 11.9408 12.4141 11.9408 12.1775 12.1775C11.9408 12.4141 11.9408 12.7964 12.1775 13.033L15.1445 16L12.1775 18.967C11.9408 19.2036 11.9408 19.5859 12.1775 19.8225C12.4141 20.0592 12.7964 20.0592 13.033 19.8225L16 16.8555L18.967 19.8225C19.2036 20.0592 19.5859 20.0592 19.8225 19.8225C20.0592 19.5859 20.0592 19.2036 19.8225 18.967L16.8555 16L19.8225 13.033C20.0531 12.8024 20.0531 12.4141 19.8225 12.1835V12.1835Z'\n fill='#122239'\n stroke='#122239'\n stroke-width='0.5'\n />\n</svg>\n",c,"Clear Selection"),this.invertSelectionButton=ce("<svg width='32'\n height='32'\n viewBox='0 0 32 32'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n>\n <path\n fill-rule='evenodd'\n clip-rule='evenodd'\n d='M16 6C10.4772 6 6 10.4772 6 16C6 21.5228 10.4772 26 16 26C21.5228 26 26 21.5228 26 16C26 10.4772 21.5228 6 16 6ZM7.53846 16C7.53846 11.3268 11.3268 7.53846 16 7.53846C16.0002 7.53846 15.9998 7.53846 16 7.53846L16.0006 12.4497C15.059 12.4497 14.156 12.8238 13.4902 13.4896C12.8244 14.1554 12.4503 15.0584 12.4503 16C12.4503 16.9416 12.8244 17.8446 13.4902 18.5104C14.156 19.1762 15.059 19.5503 16.0006 19.5503V24.4615C16.0004 24.4615 16.0008 24.4615 16.0006 24.4615C11.3274 24.4615 7.53846 20.6732 7.53846 16ZM16.0006 19.5503C16.9422 19.5503 17.8452 19.1762 18.5111 18.5104C19.1769 17.8446 19.5509 16.9416 19.5509 16C19.5509 15.0584 19.1769 14.1554 18.5111 13.4896C17.8452 12.8238 16.9422 12.4497 16.0006 12.4497V19.5503Z'\n fill='#122239'\n />\n <path\n d='M16 7.53846C11.3268 7.53846 7.53846 11.3268 7.53846 16C7.53846 20.6732 11.3274 24.4615 16.0006 24.4615M16 7.53846C15.9998 7.53846 16.0002 7.53846 16 7.53846ZM16 7.53846L16.0006 12.4497M16.0006 12.4497C15.059 12.4497 14.156 12.8238 13.4902 13.4896C12.8244 14.1554 12.4503 15.0584 12.4503 16C12.4503 16.9416 12.8244 17.8446 13.4902 18.5104C14.156 19.1762 15.059 19.5503 16.0006 19.5503M16.0006 12.4497C16.9422 12.4497 17.8452 12.8238 18.5111 13.4896C19.1769 14.1554 19.5509 15.0584 19.5509 16C19.5509 16.9416 19.1769 17.8446 18.5111 18.5104C17.8452 19.1762 16.9422 19.5503 16.0006 19.5503M16.0006 12.4497V19.5503M16.0006 19.5503V24.4615M16.0006 24.4615C16.0008 24.4615 16.0004 24.4615 16.0006 24.4615ZM6 16C6 10.4772 10.4772 6 16 6C21.5228 6 26 10.4772 26 16C26 21.5228 21.5228 26 16 26C10.4772 26 6 21.5228 6 16Z'\n stroke='#122239'\n stroke-width='0.5'\n />\n</svg>\n",d,"Invert Selection"),this.playPauseButton=ce(r?he:se,l,r?"Pause Animation":"Play Animation"),this.controlsContainer.append(this.zoomInButton,this.zoomOutButton,this.resetButton,this.fullScreenButton,this.lassoSelectButton,this.boxSelectButton,this.clearSelectionButton,this.invertSelectionButton,this.playPauseButton)}return t.prototype.updateFullScreenButton=function(t){this.fullScreenButton.innerHTML=t?oe:ae,this.fullScreenButton.setAttribute("data-tooltip",t?"Scale back":"Expand")},t.prototype.updatePlayPauseButton=function(t){this.playPauseButton.innerHTML=t?he:se,this.playPauseButton.setAttribute("data-tooltip",t?"Pause Animation":"Play Animation")},t.prototype.highlightLassoSelectButton=function(t){this.lassoSelectButton.classList.toggle("active",t)},t.prototype.highlightBoxSelectButton=function(t){this.boxSelectButton.classList.toggle("active",t)},t.prototype.getControlsContainer=function(){return this.controlsContainer},t}();function ce(t,e,n,r){var i=document.createElement("button");return i.setAttribute("data-tooltip",n),i.innerHTML=t,r&&(i.className=r),i.addEventListener("click",e),i}var de=function(){function t(t,e,n,r){this.selectionCanvas=null,this.sigma=t,this.mode=e,this.addSelectedNodes=n,this.updateSelectedNodes=r,this.isDrawing=!1,this.lassoDrawnPoints=[],this.boxInitialPoint=null,this.selectionCanvas=null}return t.prototype.getNormalizedPosition=function(t){var e=this.selectionCanvas.getBoundingClientRect();return{x:t.clientX-e.left,y:t.clientY-e.top}},t.prototype.drawSmoothFilledPath=function(t){var e=this.selectionCanvas.getContext("2d");le(e);var n,r,i=t[0],o=t[1],a=t.length;e.beginPath(),e.moveTo(i.x,i.y);for(var s=1;s<a;s+=1){var h=(r=o,{x:(n=i).x+(r.x-n.x)/2,y:n.y+(r.y-n.y)/2});e.quadraticCurveTo(i.x,i.y,h.x,h.y),i=t[s],o=t[s+1]}e.lineTo(i.x,i.y),e.stroke(),e.fill()},t.prototype.getGraphNodesInCurrentPath=function(){var t=this,e=this.sigma.viewRectangle(),n=this.sigma.getGraph(),r=this.sigma.quadtree.rectangle(e.x1,1-e.y1,e.x2,1-e.y2,e.height),i=Array.from(new Set(r)),o=this.selectionCanvas.getContext("2d"),a=[];return i.forEach((function(e){var r=Number(e),i=n.getNodeAttributes(r),s=i.x,h=i.y,u=t.sigma.graphToViewport({x:s,y:h});o.isPointInPath(u.x,u.y)&&a.push(r)})),a},t.prototype.onDrawingStart=function(t){if(t.preventDefault(),this.mode!==pe.inactive){this.isDrawing=!0;var e=this.getNormalizedPosition(t);this.mode===pe.lasso&&(this.lassoDrawnPoints=[],this.lassoDrawnPoints.push(e)),this.mode===pe.box&&(this.boxInitialPoint=e),t.stopPropagation()}},t.prototype.onDrawing=function(t){if(this.mode!==pe.inactive&&this.isDrawing){var e=this.getNormalizedPosition(t),n=this.selectionCanvas.getContext("2d");if(le(n),n.clearRect(0,0,n.canvas.width,n.canvas.height),this.mode===pe.lasso&&(this.lassoDrawnPoints.push(e),this.drawSmoothFilledPath(this.lassoDrawnPoints)),this.mode===pe.box&&this.boxInitialPoint){n.beginPath();var r=e.x-this.boxInitialPoint.x,i=e.y-this.boxInitialPoint.y;n.rect(this.boxInitialPoint.x,this.boxInitialPoint.y,r,i),n.fill()}t.stopPropagation()}},t.prototype.onDrawingEnd=function(t){if(this.mode!==pe.inactive){var e=this.getGraphNodesInCurrentPath();this.isDrawing=!1,t.shiftKey?this.addSelectedNodes(e):this.updateSelectedNodes(e);var n=this.selectionCanvas.getContext("2d");n.clearRect(0,0,this.selectionCanvas.width,this.selectionCanvas.height),n.beginPath(),this.mode===pe.lasso&&(this.lassoDrawnPoints=[]),this.mode===pe.box&&(this.boxInitialPoint=null),t.stopPropagation()}},t.prototype.onSelectScroll=function(t){this.sigma.getMouseCaptor().handleWheel(t)},t.prototype.setMode=function(t){this.mode=t},t.prototype.createDrawingCanvas=function(){this.selectionCanvas||(this.selectionCanvas=function(t){var e=t.offsetWidth,n=t.offsetHeight,r=document.createElement("canvas");return r.width=e,r.height=n,r.style.position="absolute",r.style.top="0px",r.style.cursor="crosshair",r}({offsetWidth:this.sigma.getContainer().offsetWidth,offsetHeight:this.sigma.getContainer().offsetHeight}),this.selectionCanvas.addEventListener("mousedown",this.onDrawingStart.bind(this)),this.selectionCanvas.addEventListener("mousemove",this.onDrawing.bind(this)),this.selectionCanvas.addEventListener("mouseup",this.onDrawingEnd.bind(this)),this.selectionCanvas.addEventListener("wheel",this.onSelectScroll.bind(this)))},t.prototype.cleanupCanvasEvents=function(){this.selectionCanvas&&(this.selectionCanvas.removeEventListener("mousedown",this.onDrawingStart.bind(this)),this.selectionCanvas.removeEventListener("mousemove",this.onDrawing.bind(this)),this.selectionCanvas.removeEventListener("mouseup",this.onDrawingEnd.bind(this)),this.selectionCanvas.removeEventListener("wheel",this.onSelectScroll.bind(this)),this.selectionCanvas=null)},t.prototype.getDrawingCanvas=function(){return this.selectionCanvas},t}();function le(t){t.strokeStyle="black",t.lineWidth=2,t.fillStyle="rgba(200, 200, 200, 0.25)",t.lineJoin="round",t.lineCap="round"}var pe,fe=function(){return fe=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},fe.apply(this,arguments)},ge=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};!function(t){t[t.inactive=0]="inactive",t[t.lasso=1]="lasso",t[t.box=2]="box"}(pe||(pe={}));var ve,ye=function(){function t(t){var n,r=this;this.isDragging=!1,this.isDraggedNodeSelected=!1,this.isLassoActiveDueToModifierKey=!1,this.overlay=null,this.previousPosition=null,this.originalSizeKey="originalSize",this.originalBorderKey="originalBorder",this.handleSelectionClear=function(){r.updateSelectedNodes([])},this.handleEnterNode=function(t){var e=r.graph.getNodeAttribute(t.node,"label"),n=r.graph.getNodeAttribute(t.node,"labelToDisplay");r.graph.getNodeAttribute(t.node,"originalLabel")||r.graph.setNodeAttribute(t.node,"originalLabel",e),r.graph.setNodeAttribute(t.node,"label",n),r.graph.setNodeAttribute(t.node,"hovered",!0),r.neighborHighlightingEnabled&&r.graph.forEachNeighbor(t.node,(function(e){var n=r.graph.getNodeAttribute(e,"border");r.graph.setNodeAttribute(e,"border",3),r.graph.setNodeAttribute(e,r.originalBorderKey,n);var i=r.getUndirectedEdge(t.node,e),o=r.graph.getEdgeAttribute(i,"size");r.graph.setEdgeAttribute(i,"size",3),r.graph.setEdgeAttribute(i,r.originalSizeKey,o)}))},this.handleLeaveNode=function(t){var e=r.graph.getNodeAttribute(t.node,"originalLabel");r.graph.setNodeAttribute(t.node,"label",e),r.graph.setNodeAttribute(t.node,"hovered",void 0),r.neighborHighlightingEnabled&&r.graph.forEachNeighbor(t.node,(function(e){var n=r.graph.getNodeAttribute(e,r.originalBorderKey);r.graph.setNodeAttribute(e,"border",n);var i=r.getUndirectedEdge(t.node,e);r.graph.setEdgeAttribute(i,"size",void 0)}))},this.handleDownNode=function(t){r.isDragging=!0,r.draggedNode=t.node;var e=Number(t.node);r.graph.setNodeAttribute(r.draggedNode,"highlighted",!0),r.isDraggedNodeSelected=r.selectedNodes.some((function(t){return t===e})),r.isDraggedNodeSelected?r.selectedNodes.map((function(t){return r.graph.updateNodeAttribute(t,"fixed",(function(){return!0}))})):r.graph.setNodeAttribute(r.draggedNode,"fixed",!0),r.previousPosition=r.sigma.viewportToGraph(t.event),!r.animator.isRunning()&&r._animate&&r.animator.start(),r.animator.resetNIters()},this.handleNodeDoubleClick=function(t){t.preventSigmaDefault();var e=Number(t.node);r.selectedNodes.some((function(t){return t===e}))?r.updateSelectedNodes(r.selectedNodes.filter((function(t){return t!==e}))):r.addSelectedNodes([e])},this.handleMouseMoveBody=function(t){if(r.isDragging&&r.draggedNode&&r.previousPosition){r.animator.resetNIters();var e=r.sigma.viewportToGraph(t),n=e.x-r.previousPosition.x,i=e.y-r.previousPosition.y;r.previousPosition=e,r.isDraggedNodeSelected?r.selectedNodes.map((function(t){return r.graph.updateNodeAttributes(t,(function(t){return fe(fe({},t),{x:t.x+n,y:t.y+i})}))})):r.graph.updateNodeAttributes(r.draggedNode,(function(t){return fe(fe({},t),{x:t.x+n,y:t.y+i})})),t.preventSigmaDefault(),t.original.preventDefault(),t.original.stopPropagation()}},this.handleMouseUp=function(){r.draggedNode&&(r.isDraggedNodeSelected?r.selectedNodes.map((function(t){return r.graph.removeNodeAttribute(t,"fixed")})):(r.graph.removeNodeAttribute(r.draggedNode,"fixed"),r.graph.removeNodeAttribute(r.draggedNode,"highlighted")),r.previousPosition=null),r.animator&&r.animator.forceNodePositionUpdate(),r.isDragging=!1,r.draggedNode=null,r.isDraggedNodeSelected=!1},this.handleMouseDown=function(){r.sigma.getCustomBBox()||r.sigma.setCustomBBox(r.sigma.getBBox())},this.handleDoubleClickStage=function(t){r.handleSelectionClear(),t.preventSigmaDefault()},this.handleWheel=function(t){var e=r.sigma.getCamera(),n=e.getState(),i=Math.max(-1.5,Math.min(1.5,t.delta)),o=e.getBoundedRatio(n.ratio*(1-i/8));t.original.deltaMode!==WheelEvent.DOM_DELTA_PIXEL&&console.warn("WheelEvent.deltaMode is not DOM_DELTA_PIXEL. Zoom behavior may not be as expected.");var a=r.sigma.getViewportZoomedState(t,o);e.setState(a),t.preventSigmaDefault(),t.sigmaDefaultPrevented=!0},this.handleLassoModifierDown=function(t){"Alt"===t.key&&r.mode===pe.inactive&&(r.setSelectMode(pe.lasso),r.isLassoActiveDueToModifierKey=!0,r.graphControls.highlightLassoSelectButton(!0))},this.handleLassoModifierUp=function(t){"Alt"===t.key&&r.isLassoActiveDueToModifierKey&&(r.setSelectMode(pe.inactive),r.isLassoActiveDueToModifierKey=!1,r.graphControls.highlightLassoSelectButton(!1))},this.graphContainer=((n=document.createElement("div")).className="graph-container",n.style.width="100%",n.style.height="calc(100% - 40px)",n.style.position="relative",n.style.top="40px",n),this.sigmaContainer=function(t){var e=document.createElement("div");return e.className="sigma-container",e.style.width="100%",e.style.height="100%",t.appendChild(e),e}(this.graphContainer),this.sigma=new e.Sigma(t.graph,this.sigmaContainer,t.settings),this.graph=t.graph,this.animator=t.animator,this._animate=!0,this.mode=t.mode,this._isFullScreen=t.isFullScreen,this.highlightedNodeColor=t.highlightedNodeColor||"#FF00FFDD",this.neighborHighlightingEnabled=t.neighborHighlightingEnabled,this.allowNodeMovement=void 0===t.allowNodeMovement||t.allowNodeMovement,this.graphInteraction=new ie(this.sigma,this.graph,this.animator),this.graphControls=new ue({isFullScreen:this._isFullScreen,animate:this._animate,onZoomIn:this.zoomIn.bind(this),onZoomOut:this.zoomOut.bind(this),onResetView:this.resetView.bind(this),onToggleFullScreen:this.toggleFullScreen.bind(this),onToggleLassoSelect:this.toggleLassoSelect.bind(this),onToggleBoxSelect:this.toggleBoxSelect.bind(this),onClearSelection:this.handleSelectionClear.bind(this),onInvertSelection:this.invertSelection.bind(this),onTogglePlayPause:this.togglePlayPause.bind(this)}),this.graphContainer.appendChild(this.graphControls.getControlsContainer()),this.drawingManager=new de(this.sigma,this.mode,this.addSelectedNodes.bind(this),this.updateSelectedNodes.bind(this)),this._selectedNodes=t.selectedNodes,this._highlightedNodes=t.highlightedNodes||[],this.onSelectedNodesChange=t.onSelectedNodesChange,this.onHighlightedNodesChange=t.onHighlightedNodesChange,this.onFullScreenChange=t.onFullScreenChange,this.initializeGraph(),this.initializeOverlay(),this.registerEvents(),this.bindEventHandlers(),document.addEventListener("keydown",this.handleLassoModifierDown),document.addEventListener("keyup",this.handleLassoModifierUp)}return t.prototype.getGraphContainer=function(){return this.graphContainer},Object.defineProperty(t.prototype,"selectedNodes",{get:function(){return this._selectedNodes},enumerable:!1,configurable:!0}),t.prototype.setSelectedNodes=function(t,e){void 0===e&&(e=!0),this._selectedNodes=t,this.updateNodeSelection(),e&&this.onSelectedNodesChange(t)},t.prototype.updateNodeSelection=function(){var t=new Set(this.selectedNodes);this.graph.updateEachNodeAttributes((function(e,n){var r=Number(e),i=t.has(r),o=n.hovered;if(n.labelBeforeSelection||o||(n.labelBeforeSelection=n.originalLabel||n.label),i)return fe(fe({},n),{label:void 0,originalLabel:void 0,highlighted:!0});var a=n.labelBeforeSelection;return fe(fe({},n),{label:a,originalLabel:a,highlighted:!1})}))},Object.defineProperty(t.prototype,"highlightedNodes",{get:function(){return this._highlightedNodes},set:function(t){this._highlightedNodes=t,this.updateNodeHighlighting(),this.onHighlightedNodesChange(t)},enumerable:!1,configurable:!0}),t.prototype.updateHighlightedNodes=function(t){this.highlightedNodes=t},t.prototype.updateNodeHighlighting=function(){var t=this,e=new Set(this.highlightedNodes);this.graph.updateEachNodeAttributes((function(n,r){var i=Number(n),o=e.has(i);if(o&&(void 0!==r.border||void 0!==r.originalBorder))return r.hasOwnProperty("originalBorder")||(r.originalBorder=r.border||null),fe(fe({},r),{border:t.highlightedNodeColor});if(!o&&r.hasOwnProperty("originalBorder")){var a=null===r.originalBorder?void 0:r.originalBorder;return delete r.originalBorder,fe(fe({},r),{border:a})}return r}))},Object.defineProperty(t.prototype,"isFullScreen",{get:function(){return this._isFullScreen},set:function(t){this._isFullScreen=t,this.onFullScreenChange(t)},enumerable:!1,configurable:!0}),t.prototype.updateGraph=function(t){this.graph=t,this.sigma.setGraph(t),this.clearQuadtreeCache()},t.prototype.updateAnimator=function(t){this.animator&&this.animator.kill(),this.animator=t},t.prototype.zoomInAndOut=function(){this.sigma.getCamera().animatedZoom(),this.sigma.getCamera().animatedUnzoom()},t.prototype.resetGraphBounds=function(){this.sigma.setCustomBBox(null)},t.prototype.refresh=function(){this.sigma.refresh()},t.prototype.cleanup=function(){this.sigma.off("enterNode",this.handleEnterNode),this.sigma.off("leaveNode",this.handleLeaveNode),this.sigma.off("downNode",this.handleDownNode),this.sigma.off("doubleClickNode",this.handleNodeDoubleClick),this.sigma.off("doubleClickStage",this.handleDoubleClickStage),this.sigma.getMouseCaptor().off("wheel",this.handleWheel),this.allowNodeMovement&&(this.sigma.getMouseCaptor().off("mousemovebody",this.handleMouseMoveBody),this.sigma.getMouseCaptor().off("mouseup",this.handleMouseUp),this.sigma.getMouseCaptor().off("mousedown",this.handleMouseDown))},t.prototype.dispose=function(){this.sigma&&(this.sigma.clear(),this.sigma.kill(),Object.values(this.sigma.webGLContexts).forEach((function(t){var e;null===(e=t.getExtension("WEBGL_lose_context"))||void 0===e||e.loseContext()})))},t.prototype.initializeGraph=function(){this.sigma.setGraph(this.graph),this.clearQuadtreeCache()},t.prototype.initializeOverlay=function(){var t=this;this.overlay=function(e){var n=document.createElement("div");n.className="webgl-overlay",n.innerText='Graph is not shown because the WebGL context was lost.\nThis can happen when the browser has too many other objects to display. Usually, clicking "Restore Context" will be able to bring the graph back.';var r=document.createElement("button");return r.innerText="Restore Graph Display",r.style.marginTop="20px",r.style.padding="10px 20px",r.style.fontSize="1rem",r.style.cursor="pointer",r.addEventListener("click",(function(){return t.handleContextRestored()})),n.appendChild(r),n.style.position="absolute",n.style.top="0",n.style.left="0",n.style.width="100%",n.style.height="100%",n.style.backgroundColor="rgba(0, 0, 0, 0.7)",n.style.color="white",n.style.display="flex",n.style.flexDirection="column",n.style.justifyContent="center",n.style.alignItems="center",n.style.zIndex="1000",n.style.visibility="hidden",n}(),this.graphContainer.appendChild(this.overlay)},t.prototype.registerEvents=function(){this.sigma.on("enterNode",this.handleEnterNode),this.sigma.on("leaveNode",this.handleLeaveNode),this.sigma.on("downNode",this.handleDownNode),this.sigma.on("doubleClickNode",this.handleNodeDoubleClick),this.sigma.on("doubleClickStage",this.handleDoubleClickStage),this.sigma.getMouseCaptor().on("wheel",this.handleWheel),this.allowNodeMovement&&(this.sigma.getMouseCaptor().on("mousemovebody",this.handleMouseMoveBody),this.sigma.getMouseCaptor().on("mouseup",this.handleMouseUp),this.sigma.getMouseCaptor().on("mousedown",this.handleMouseDown));var t=this.sigma.getCanvases().nodes;t&&(t.addEventListener("webglcontextlost",this.handleContextLost.bind(this)),t.addEventListener("webglcontextrestored",this.handleContextRestored.bind(this)))},t.prototype.bindEventHandlers=function(){this.handleEnterNode=this.handleEnterNode.bind(this),this.handleLeaveNode=this.handleLeaveNode.bind(this),this.handleDownNode=this.handleDownNode.bind(this),this.handleNodeDoubleClick=this.handleNodeDoubleClick.bind(this),this.handleDoubleClickStage=this.handleDoubleClickStage.bind(this),this.handleMouseMoveBody=this.handleMouseMoveBody.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleWheel=this.handleWheel.bind(this),this.handleSelectionClear=this.handleSelectionClear.bind(this),this.handleLassoModifierDown=this.handleLassoModifierDown.bind(this),this.handleLassoModifierUp=this.handleLassoModifierUp.bind(this)},t.prototype.clearQuadtreeCache=function(){this.sigma.quadtree.cache&&(this.sigma.quadtree.cache=null,this.sigma.quadtree.lastRectangle=null)},t.prototype.updateSelectedNodes=function(t){this.setSelectedNodes(t)},t.prototype.addSelectedNodes=function(t){var e=this;this.setSelectedNodes(ge(ge([],this.selectedNodes,!0),t.filter((function(t){return!e.selectedNodes.includes(t)})),!0))},t.prototype.getUndirectedEdge=function(t,e){if(this.graph.hasEdge(t,e))return this.graph.edge(t,e);if(this.graph.hasEdge(e,t))return this.graph.edge(e,t);throw new Error("neighbor node = ".concat(e," does not have an edge with ").concat(t))},t.prototype.setSelectMode=function(t){this.updateSelectionMode(t),this.updateSelectionModeButtonStates(),this.toggleSelectionCanvas()},t.prototype.updateSelectionMode=function(t){this.mode=t,this.drawingManager.setMode(t)},t.prototype.updateSelectionModeButtonStates=function(){this.graphControls.highlightLassoSelectButton(this.mode===pe.lasso),this.graphControls.highlightBoxSelectButton(this.mode===pe.box),this.mode===pe.inactive&&(this.graphControls.highlightLassoSelectButton(!1),this.graphControls.highlightBoxSelectButton(!1))},t.prototype.toggleSelectionCanvas=function(){this.mode===pe.inactive?this.removeSelectionCanvas():this.showSelectionCanvas()},t.prototype.handleContextLost=function(t){t.preventDefault(),console.log("WebGL context lost."),this.overlay&&(this.overlay.style.visibility="visible")},t.prototype.handleContextRestored=function(){this.dispose(),this.sigma=new e.Sigma(this.graph,this.sigmaContainer,this.sigma.getSettings()),this.registerEvents(),this.overlay&&(this.overlay.style.visibility="hidden"),console.log("WebGL context restored.")},t.prototype.showSelectionCanvas=function(){if(!this.drawingManager.getDrawingCanvas()){this.drawingManager.createDrawingCanvas();var t=this.drawingManager.getDrawingCanvas();t&&this.graphContainer.appendChild(t)}},t.prototype.removeSelectionCanvas=function(){var t=this.drawingManager.getDrawingCanvas();t&&(this.drawingManager.cleanupCanvasEvents(),this.graphContainer.removeChild(t))},t.prototype.zoomIn=function(){this.graphInteraction.zoomIn()},t.prototype.zoomOut=function(){this.graphInteraction.zoomOut()},t.prototype.resetView=function(){return t=this,n=function(){return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(h){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,h])}}}(this,(function(t){switch(t.label){case 0:return[4,this.graphInteraction.resetView()];case 1:return t.sent(),[2]}}))},new((e=void 0)||(e=Promise))((function(r,i){function o(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var n;t.done?r(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(o,a)}s((n=n.apply(t,[])).next())}));var t,e,n},t.prototype.toggleFullScreen=function(){this._isFullScreen=!this._isFullScreen,this.onFullScreenChange(this._isFullScreen),this.graphControls.updateFullScreenButton(this._isFullScreen)},t.prototype.toggleLassoSelect=function(){this.mode!==pe.lasso?this.setSelectMode(pe.lasso):this.setSelectMode(pe.inactive)},t.prototype.toggleBoxSelect=function(){this.mode!==pe.box?this.setSelectMode(pe.box):this.setSelectMode(pe.inactive)},t.prototype.invertSelection=function(){var t=this,e=[];this.graph.forEachNode((function(n){var r=Number(n);t.selectedNodes.some((function(t){return t===r}))||e.push(r)})),this.updateSelectedNodes(e)},t.prototype.updateAnimatorState=function(){this.animator&&(this._animate?this.animator.isRunning()||this.animator.start():this.animator.isRunning()&&this.animator.stop())},t.prototype.togglePlayPause=function(){this._animate=!this._animate,this.graphControls.updatePlayPauseButton(this._animate),this.updateAnimatorState()},t}(),me=function(){return me=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},me.apply(this,arguments)},be=function(){function t(t,e,n,r){var i=this;this.callback=null,this.graph=t,this.endPositions=e,this.animation_type=n,this.frameID=null,this.running=!1,this.step=new Array(t.nodes().length),this.graph.forEachNode((function(t,n){var o=Number(t),a=e[o].x-n.x,s=e[o].y-n.y;a/=r,s/=r,i.step[o]={x:a,y:s}})),this.niters=0,this.maxiters=r}return t.prototype.isRunning=function(){return this.running},t.prototype.resetNIters=function(){this.niters=0},t.prototype.updateNodePositions=function(){var t=this;this.graph.updateEachNodeAttributes((function(e,n){var r=Number(e);return me(me({},n),{x:n.x+t.step[r].x,y:n.y+t.step[r].y})}))},t.prototype.runFrame=function(){var t=this;this.updateNodePositions(),this.niters+=1,this.niters>this.maxiters?this._kill():this.frameID=window.requestAnimationFrame((function(){return t.runFrame()}))},t.prototype._stop=function(){return null!==this.callback&&this.callback(),this.callback=null,this.running=!1,this.resetNIters(),null!==this.frameID&&(window.cancelAnimationFrame(this.frameID),this.frameID=null),this},t.prototype.run=function(t){this.callback=t,this.running||(this.running=!0,this.runFrame())},t.prototype._kill=function(){this._stop()},t}(),we=function(){function t(t){var e=this;this.sliderValues={},this.sliderConfigs=[],this.views=[],this.listeners={},this.sliderConfigs=t,t.forEach((function(t){e.sliderValues[t.label]=t.initialValue,e.listeners[t.label]=[]}))}return t.prototype.callListeners=function(t){var e=this;this.listeners[t].forEach((function(n){n(e.sliderValues[t])}))},t.prototype.getView=function(t){var e=this,n=new _e(t,this.sliderConfigs);return Object.keys(this.sliderValues).forEach((function(t){n.addListener(t,(function(n){var r=Number(n.target.value);e.setSliderValue(t,r),e.callListeners(t)}))})),this.views.push(n),n},t.prototype.getSliderValue=function(t){return this.sliderValues[t]||null},t.prototype.setSliderValue=function(t,e){this.sliderValues[t]=e,this.views.forEach((function(n){n.setSliderValue(t,e)}))},t.prototype.addListener=function(t,e){this.listeners[t].push(e)},t}(),_e=function(){function t(t,e){var n=this;this.sliders={},this.sliderValues={};var r=this.createSliderContainer();t.appendChild(r),e.forEach((function(t){var e=n.createSliderWrapper(t),i=e.wrapper,o=e.slider,a=e.labelElement;r.appendChild(i),n.sliders[t.label]=o,n.sliderValues[t.label]=a,o.addEventListener("input",(function(){a.textContent=o.value}))}))}return t.prototype.createSliderContainer=function(){var t=document.createElement("div");return t.className="slider-container",t},t.prototype.createSliderWrapper=function(t){var e=document.createElement("div");e.className="slider-wrapper";var n=document.createElement("label");n.className="slider-label",n.textContent="".concat(t.label,":");var r=document.createElement("input");r.type="range",r.className="slider",r.min=t.minValue.toString(),r.max=t.maxValue.toString(),r.step=t.step.toString(),r.value=t.initialValue.toString();var i=document.createElement("span");return i.className="slider-value",i.textContent=t.initialValue.toString(),e.appendChild(n),e.appendChild(r),e.appendChild(i),{wrapper:e,slider:r,labelElement:i}},t.prototype.setSliderValue=function(t,e){this.sliders[t].value=e.toString(),this.sliderValues[t].textContent=e.toString()},t.prototype.addListener=function(t,e){this.sliders[t].addEventListener("change",e)},t}(),xe=function(){function t(t,e,n){this.container=t,this.graphManager=new ye(n),this.initializeSliderView(e)}return t.prototype.initializeSliderView=function(t){this.sliderView=t.getView(this.container)},t.prototype.appendGraphToContainer=function(){this.container.appendChild(this.graphManager.getGraphContainer())},t}(),Ce=n(698),Ee=n.n(Ce),Le=function(){return Le=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Le.apply(this,arguments)},Se=n(739).graphToByteArrays,Me=function(t,e,n){return t.reduce((function(t,r){var i,o=null===(i=e[n])||void 0===i?void 0:i.nodes[r];return o&&t.push.apply(t,o.points),t}),[])},Ae=function(t,e,n){var r=new Set,i=n[t];return e.forEach((function(t){r.add(i[t])})),Array.from(r)},Ne=function(t,e){var n=new(Ee());t.nodes.forEach((function(t,e){var r,i;n.addNode(e,Le(Le({},t),{x:null!==(r=t.x)&&void 0!==r?r:Math.random(),y:null!==(i=t.y)&&void 0!==i?i:Math.random()}))}));var r=t.nodes.length,i=Math.ceil(e*r/2);return t.edges.slice(0,i).forEach((function(t){n.addEdge(t.s,t.t)})),n},ke=function(t){return{label:t.label,minValue:t.minValue,maxValue:t.maxValue,initialValue:t.initialValue,step:t.step}},Pe=function(){return Pe=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Pe.apply(this,arguments)},De=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{h(r.next(t))}catch(t){o(t)}}function s(t){try{h(r.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}h((r=r.apply(t,e||[])).next())}))},Ge=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(h){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,h])}}},Fe=function(){function t(t){var e=this;this.views=[],this.selectedNodes=[],this.selectedPoints=[],this.initialLayoutPromise=null;var n=t.graphData,r=t.sliderConfig,i=t.sigmaSettings,a=t.onSelectedNodesChange,s=t.onSelectedPointsChange,h=t.onFullScreenChange,u=t.onCoarsenessChange,c=t.onConnectivityChange,d=t.nodeColors,l=t.nodeLabels,p=t.nodeHoverLabels,f=t.layoutConfig;this.graphData=n,this.sliderConfig=r,this.sigmaSettings=i,this.nodeColors=d,this.nodeLabels=l,this.nodeHoverLabels=p,this.layoutConfig=f||{},this.onSelectedNodesChange=a,this.onSelectedPointsChange=s,this.onFullScreenChange=h,this.onCoarsenessChange=u,this.onConnectivityChange=c,this.selectedLevel=this.sliderConfig.selectedLevel,this.sliderManager=new we([ke(r.coarseness),ke(r.connectivity)]),this.addSliderListeners(),this.nDataPoints=Math.max.apply(Math,this.graphData[this.selectedLevel].nodes.map((function(t){return Math.max.apply(Math,t.points)})))+1,this.dataPointMaps=function(t,e){var n={};return Object.keys(t).forEach((function(r){n[r]=function(t,e){var n=Array(e);return t.forEach((function(t,e){t.forEach((function(t){n[t]=e}))})),n}(t[r].nodes.map((function(t){return t.points})),e)})),n}(this.graphData,this.nDataPoints),this.currentGraph=Ne(this.graphData[this.selectedLevel],6);var g=Pe(Pe(Pe({},nt),o().inferSettings(this.currentGraph)),this.layoutConfig);this.initialLayoutPromise=this.runInitialLayout({iterations:300,settings:g}).then((function(){e.initialLayoutPromise=null})),this.animator=this.getNewAnimator(),this.updateNodeAttributes()}return t.prototype.getView=function(t){return De(this,void 0,void 0,(function(){var e,n=this;return Ge(this,(function(r){switch(r.label){case 0:return this.initialLayoutPromise?[4,this.initialLayoutPromise]:[3,2];case 1:r.sent(),r.label=2;case 2:return e=new xe(t,this.sliderManager,{graph:this.currentGraph,animator:this.animator,mode:pe.inactive,settings:this.sigmaSettings,isFullScreen:!1,neighborHighlightingEnabled:!1,selectedNodes:[],onSelectedNodesChange:function(t){n.selectedNodes=t,n.selectedPoints=Me(n.selectedNodes,n.graphData,n.selectedLevel),n.onSelectedNodesChange(t),n.onSelectedPointsChange(n.selectedPoints)},onFullScreenChange:function(t){return n.onFullScreenChange(t)},onHighlightedNodesChange:function(){}}),this.views.push(e),e.appendGraphToContainer(),this.animator.start(),[2,e]}}))}))},t.prototype.setConnectivityLevel=function(t){var e=this,n=this.graphData[this.selectedLevel];this.currentGraph.clearEdges();var r=n.nodes.length,i=Math.ceil(t*r/2);n.edges.slice(0,i).forEach((function(t){e.currentGraph.addEdge(t.s,t.t)})),this.resetAnimator()},t.prototype.setCoarsenessLevel=function(t,e){return void 0===e&&(e=!0),De(this,void 0,void 0,(function(){var n,r,i;return Ge(this,(function(o){return n=this.selectedPoints,r=this.initializeNewGraph(t),i=Ae(t,n,this.dataPointMaps),this.updateGraphAndViews(r,i,e),[2]}))}))},t.prototype.setNodeColors=function(t){this.nodeColors=t,this.updateNodeColors()},t.prototype.setNodeLabels=function(t){this.nodeLabels=t,this.updateNodeLabels()},t.prototype.setNodeHoverLabels=function(t){this.nodeHoverLabels=t,this.updateNodeHoverLabels()},t.prototype.setSelectedNodes=function(t){this.selectedNodes=t,this.selectedPoints=Me(this.selectedNodes,this.graphData,this.selectedLevel),this.updateViewsSelectedNodes(),this.onSelectedNodesChange(this.selectedNodes),this.onSelectedPointsChange(this.selectedPoints)},t.prototype.setSelectedPoints=function(t){this.selectedPoints=t,this.selectedNodes=Ae(this.selectedLevel,t,this.dataPointMaps),this.onSelectedPointsChange(t),this.updateViewsSelectedNodes(),this.onSelectedNodesChange(this.selectedNodes)},t.prototype.cleanup=function(){this.views.forEach((function(t){t.graphManager.cleanup()})),this.animator.kill()},t.prototype.dispose=function(){this.views.forEach((function(t){t.graphManager.dispose()})),this.animator.kill()},t.prototype.initializeNewGraph=function(t){var e=this.dataPointMaps[this.selectedLevel],n=this.currentGraph;this.selectedLevel=t;var r=Number(this.sliderManager.getSliderValue(this.sliderConfig.connectivity.label)),i=Ne(this.graphData[t],r),o=function(t,e){var n=new Array(e.nodes().length);return e.forEachNode((function(e,r){var i=Number(e),o=r.points,a=new Set;o.forEach((function(e){a.add(t[e])})),n[i]=Array.from(a)})),n}(e,i);return function(t,e,n){e.updateEachNodeAttributes((function(e,r){var i=Number(e),o=n[i],a=o.map((function(e){return t.getNodeAttribute(e,"x")})),s=o.map((function(e){return t.getNodeAttribute(e,"y")})),h=a.reduce((function(t,e){return t+e}),0)/a.length,u=s.reduce((function(t,e){return t+e}),0)/s.length;return Le(Le({},r),{x:h+.1*Math.random(),y:u+.1*Math.random()})}))}(n,i,o),i},t.prototype.updateGraphAndViews=function(t,e,n){var r=this;this.selectedNodes=e,this.updateAllGraphViews(t,e),this.updateNodeAttributes(),this.onSelectedNodesChange(e),function(t,e){return void 0===e&&(e={}),r=function(){var n,r,i,h,u,c,d,l,p;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(h){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,h])}}}(this,(function(f){for(n=Le(Le(Le({},nt),o().inferSettings(t)),e),r=(0,s.kS)(t),i=(0,a.Q6)(void 0).fromEntry,h=Se(t,i),function(t,e,n){for(var r=0;r<40;r++)J(t,e.nodes,e.edges,n)}(n,h,r),u=t.nodes().length,c=[],d=0;d<u;d++)l=h.nodes[10*d],p=h.nodes[10*d+1],c.push({x:l,y:p});return[2,c]}))},new((n=void 0)||(n=Promise))((function(t,e){function i(t){try{a(r.next(t))}catch(t){e(t)}}function o(t){try{a(r.throw(t))}catch(t){e(t)}}function a(e){var r;e.done?t(e.value):(r=e.value,r instanceof n?r:new n((function(t){t(r)}))).then(i,o)}a((r=r.apply(void 0,[])).next())}));var n,r}(t,this.layoutConfig).then((function(t){n&&r.views.forEach((function(t){t.graphManager.resetGraphBounds()}));var e=new be(r.currentGraph,t,"linear",20);r.animator.kill(),e.run((function(){r.animator=r.getNewAnimator(),r.views.forEach((function(t){t.graphManager.updateAnimator(r.animator)})),r.animator.start()}))}))},t.prototype.updateNodeColors=function(){if(this.nodeColors){var t=this.nodeColors[this.selectedLevel];t&&this.currentGraph.updateEachNodeAttributes((function(e,n){var r=Number(e),i=t[r];return Pe(Pe({},n),{color:i||n.color})}))}},t.prototype.updateNodeLabels=function(){if(this.nodeLabels){var t=this.nodeLabels[this.selectedLevel];t&&this.currentGraph.updateEachNodeAttributes((function(e,n){var r=Number(e),i=t[r];return Pe(Pe({},n),{label:i||n.label})}))}},t.prototype.updateNodeHoverLabels=function(){if(this.nodeHoverLabels){var t=this.nodeHoverLabels[this.selectedLevel];t&&this.currentGraph.updateEachNodeAttributes((function(e,n){var r=Number(e),i=t[r];return Pe(Pe({},n),{labelToDisplay:i||n.labelToDisplay})}))}},t.prototype.updateViewsSelectedNodes=function(){var t=this;this.views.forEach((function(e){e.graphManager.setSelectedNodes(t.selectedNodes,!1)}))},t.prototype.updateNodeAttributes=function(){this.updateNodeColors(),this.updateNodeLabels(),this.updateNodeHoverLabels()},t.prototype.runInitialLayout=function(t){return De(this,void 0,void 0,(function(){return Ge(this,(function(e){switch(e.label){case 0:return[4,te(this.currentGraph,t)];case 1:return e.sent(),this.animator.forceNodePositionUpdate(),[2]}}))}))},t.prototype.resetAnimator=function(){this.animator.kill(),this.animator=this.getNewAnimator(),this.startAnimator()},t.prototype.startAnimator=function(){var t=this;this.animator.start(),this.views.forEach((function(e){e.graphManager.updateAnimator(t.animator)}))},t.prototype.getNewAnimator=function(){return new rt(this.currentGraph,{settings:Pe(Pe(Pe({},nt),o().inferSettings(this.currentGraph)),this.layoutConfig)},{maxiters:1500,miniters:200,convergenceThreshold:.1})},t.prototype.addSliderListeners=function(){var t=this;this.sliderManager.addListener(this.sliderConfig.coarseness.label,(function(e){t.onCoarsenessChange(e),t.handleCoarsenessChange(e)})),this.sliderManager.addListener(this.sliderConfig.connectivity.label,(function(e){t.onConnectivityChange(e),t.handleConnectivityChange(e)}))},t.prototype.handleCoarsenessChange=function(t){this.setCoarsenessLevel(t.toString())},t.prototype.handleConnectivityChange=function(t){this.setConnectivityLevel(t)},t.prototype.updateAllGraphViews=function(t,e){this.currentGraph=t,this.views.forEach((function(e){e.graphManager.updateGraph(t)})),this.selectedNodes=e,this.updateViewsSelectedNodes()},t}(),Oe=n(524),Te=n(533),Re=(ve=function(t,e){return ve=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},ve(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}ve(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),je=function(t){function e(e){var n=t.call(this,e,"\nattribute vec2 a_position;\nattribute float a_size;\nattribute vec4 a_color;\nattribute vec4 a_border;\n\nuniform float u_ratio;\nuniform float u_scale;\nuniform mat3 u_matrix;\n\nvarying vec4 v_color;\nvarying vec4 v_border_color;\nvarying float v_border;\n\nconst float bias = 255.0 / 254.0;\n\nvoid main() {\n gl_Position = vec4(\n (u_matrix * vec3(a_position, 1)).xy,\n 0,\n 1\n );\n\n // Multiply the point size twice:\n // - x SCALING_RATIO to correct the canvas scaling\n // - x 2 to correct the formulae\n gl_PointSize = a_size * u_ratio * u_scale * 2.0;\n\n v_border = (1.0 / u_ratio) * (0.5 / a_size);\n\n // Extract the color:\n v_color = a_color;\n v_border_color = a_border;\n v_color.a *= bias;\n v_border_color.a *= bias;\n}\n","\nprecision mediump float;\n\nvarying vec4 v_color;\nvarying vec4 v_border_color;\nvarying float v_border;\n\nconst float radius = 0.5;\nconst float halfRadius = 0.35;\n\nvoid main(void) {\n vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);\n vec4 white = vec4(1.0, 1.0, 1.0, 1.0);\n float distToCenter = length(gl_PointCoord - vec2(0.5, 0.5));\n\n float t = 0.0;\n if (distToCenter < halfRadius - v_border)\n gl_FragColor = v_color;\n else if (distToCenter < halfRadius)\n gl_FragColor = mix(v_border_color, v_color, (halfRadius - distToCenter) / v_border);\n else if (distToCenter < radius - v_border)\n gl_FragColor = v_border_color;\n else if (distToCenter < radius)\n gl_FragColor = mix(transparent, v_border_color, (radius - distToCenter) / v_border);\n else\n gl_FragColor = transparent;\n}\n",1,5)||this;return n.borderColorLocation=e.getAttribLocation(n.program,"a_border"),n.bind(),n}return Re(e,t),e.prototype.bind=function(){t.prototype.bind.call(this);var e=this.gl;e.enableVertexAttribArray(this.borderColorLocation),e.vertexAttribPointer(this.borderColorLocation,4,e.UNSIGNED_BYTE,!0,this.attributes*Float32Array.BYTES_PER_ELEMENT,16)},e.prototype.process=function(t,e,n){var r=this.array,i=1*n*5;if(e)return r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,void(r[i++]=0);var o=(0,Oe.floatColor)(t.color),a=(0,Oe.floatColor)(t.border);r[i++]=t.x,r[i++]=t.y,r[i++]=t.size,r[i++]=o,r[i++]=a},e.prototype.render=function(t){var e=this.gl,n=this.program;e.useProgram(n),e.uniform1f(this.ratioLocation,1/Math.sqrt(t.ratio)),e.uniform1f(this.scaleLocation,t.scalingRatio),e.uniformMatrix3fv(this.matrixLocation,!1,t.matrix),e.drawArrays(e.POINTS,0,this.array.length/5)},e}(Te.AbstractNodeProgram)})(),r})(),t.exports=e()},352:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n,r,i,o=t[1]||"",a=t[3];if(!a)return o;if(e&&"function"==typeof btoa){var s=(n=a,r=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),i="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(r),"/*# ".concat(i," */")),h=a.sources.map((function(t){return"/*# sourceURL=".concat(a.sourceRoot||"").concat(t," */")}));return[o].concat(h).concat([s]).join("\n")}return[o].join("\n")}(e,t);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,r){"string"==typeof t&&(t=[[null,t,""]]);var i={};if(r)for(var o=0;o<this.length;o++){var a=this[o][0];null!=a&&(i[a]=!0)}for(var s=0;s<t.length;s++){var h=[].concat(t[s]);r&&i[h[0]]||(n&&(h[2]?h[2]="".concat(n," and ").concat(h[2]):h[2]=n),e.push(h))}},e}},204:(t,e,n)=>{var r=n(379),i=n(889);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[t.id,i,""]]);r(i,{insert:"head",singleton:!1}),t.exports=i.locals||{}},136:(t,e,n)=>{var r=n(379),i=n(134);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[t.id,i,""]]);r(i,{insert:"head",singleton:!1}),t.exports=i.locals||{}},379:(t,e,n)=>{"use strict";var r,i=function(){var t={};return function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}t[e]=n}return t[e]}}(),o=[];function a(t){for(var e=-1,n=0;n<o.length;n++)if(o[n].identifier===t){e=n;break}return e}function s(t,e){for(var n={},r=[],i=0;i<t.length;i++){var s=t[i],h=e.base?s[0]+e.base:s[0],u=n[h]||0,c="".concat(h," ").concat(u);n[h]=u+1;var d=a(c),l={css:s[1],media:s[2],sourceMap:s[3]};-1!==d?(o[d].references++,o[d].updater(l)):o.push({identifier:c,updater:g(l,e),references:1}),r.push(c)}return r}function h(t){var e=document.createElement("style"),r=t.attributes||{};if(void 0===r.nonce){var o=n.nc;o&&(r.nonce=o)}if(Object.keys(r).forEach((function(t){e.setAttribute(t,r[t])})),"function"==typeof t.insert)t.insert(e);else{var a=i(t.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(e)}return e}var u,c=(u=[],function(t,e){return u[t]=e,u.filter(Boolean).join("\n")});function d(t,e,n,r){var i=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(t.styleSheet)t.styleSheet.cssText=c(e,i);else{var o=document.createTextNode(i),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(o,a[e]):t.appendChild(o)}}function l(t,e,n){var r=n.css,i=n.media,o=n.sourceMap;if(i?t.setAttribute("media",i):t.removeAttribute("media"),o&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleSheet)t.styleSheet.cssText=r;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(r))}}var p=null,f=0;function g(t,e){var n,r,i;if(e.singleton){var o=f++;n=p||(p=h(e)),r=d.bind(null,n,o,!1),i=d.bind(null,n,o,!0)}else n=h(e),r=l.bind(null,n,e),i=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(n)};return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else i()}}t.exports=function(t,e){(e=e||{}).singleton||"boolean"==typeof e.singleton||(e.singleton=(void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r));var n=s(t=t||[],e);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var r=0;r<n.length;r++){var i=a(n[r]);o[i].references--}for(var h=s(t,e),u=0;u<n.length;u++){var c=a(n[u]);0===o[c].references&&(o[c].updater(),o.splice(c,1))}n=h}}}},146:e=>{"use strict";e.exports=t},147:t=>{"use strict";t.exports=JSON.parse('{"name":"landscape-widget","version":"0.3.2-rc.1","description":"Jupyter widget for interactive graph visualization","keywords":["jupyter","jupyterlab","jupyterlab-extension","widgets"],"files":["lib/**/*.js","dist/*.js","css/*.css"],"author":{"name":"BlueLightAI","email":"support@bluelightai.com"},"license":"SEE LICENSE IN LICENSE.txt","main":"lib/index.js","types":"./lib/index.d.ts","repository":{"type":"git","url":"https://github.com/BlueLightAI/jupyter-landscapes"},"scripts":{"build":"yarn run build:lib && yarn run build:nbextension && yarn run build:labextension:dev","build:prod":"yarn run build:lib && yarn run build:nbextension && yarn run build:labextension","build:labextension":"jupyter labextension build .","build:labextension:dev":"jupyter labextension build --development True .","build:lib":"tsc","build:nbextension":"webpack","build:license-report-json":"license-report --output=json --config=.license-reportrc > ./license-report.json","build:license-report-html":"license-report --output=html --config=.license-reportrc > ./license-report.html","clean":"yarn run clean:lib && yarn run clean:nbextension && yarn run clean:labextension","clean:lib":"rimraf lib","clean:labextension":"rimraf landscape_widget/labextension","clean:nbextension":"rimraf landscape_widget/nbextension/static/index.js","lint":"eslint . --ext .ts,.tsx --fix","lint:check":"eslint . --ext .ts,.tsx","prepack":"yarn run build:lib","test":"jest","watch":"npm-run-all -p watch:*","watch:lib":"tsc -w","watch:nbextension":"webpack --watch --mode=development","watch:labextension":"jupyter labextension watch ."},"dependencies":{"@jupyter-widgets/base":"^1.1.10 || ^2 || ^3 || ^4 || ^5 || ^6","blai-graph-widget":"link:./blai-graph-widget","graphology":"^0.25.1","graphology-components":"^1.5.4","graphology-layout-forceatlas2":"^0.10.1","graphology-types":"^0.24.7","lodash":"^4.17.21","rand-seed":"^1.0.2"},"devDependencies":{"@babel/core":"^7.5.0","@babel/preset-env":"^7.5.0","@jupyter-widgets/base-manager":"^1.0.3","@jupyterlab/builder":"^3.6.1","@lumino/application":"^1.6.0","@lumino/widgets":"^1.6.0","@types/jest":"^26.0.0","@types/webpack-env":"^1.13.6","@typescript-eslint/eslint-plugin":"^3.6.0","@typescript-eslint/parser":"^3.6.0","acorn":"^7.2.0","css-loader":"^3.2.0","eslint":"^7.4.0","eslint-config-prettier":"^6.11.0","eslint-plugin-prettier":"^3.1.4","fs-extra":"^7.0.0","identity-obj-proxy":"^3.0.0","jest":"^29.0.0","license-report":"^6.5.0","mkdirp":"^0.5.1","npm-run-all":"^4.1.3","prettier":"^2.0.5","rimraf":"^2.6.2","sass":"^1.58.0","sass-loader":"^13.2.0","source-map-loader":"^1.1.3","style-loader":"^1.0.0","ts-jest":"^29.0.0","ts-loader":"^8.0.0","typescript":"~4.5.0","webpack":"^5.61.0","webpack-cli":"^4.0.0"},"resolutions":{"blai-graph-widget":"file:./blai-graph-widget"},"jupyterlab":{"extension":"lib/plugin","outputDir":"landscape_widget/labextension/","webpackConfig":"./lab.webpack.config.js","sharedPackages":{"@jupyter-widgets/base":{"bundled":false,"singleton":true}}}}')}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var o=n[t]={id:t,exports:{}};return e[t].call(o.exports,o,o.exports,r),o.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.nc=void 0;var i={};return(()=>{"use strict";r.r(i),r.d(i,{LandscapeModel:()=>b,LandscapeView:()=>w,MODULE_NAME:()=>n,MODULE_VERSION:()=>e});const t=r(147),e=t.version,n=t.name;var o=r(146),a=(r(204),r(916)),s=(r(136),function(t,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},s(t,e)});function h(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var u,c=function(){function t(){}return t._xfnv1a=function(t){for(var e=2166136261,n=0;n<t.length;n++)e=Math.imul(e^t.charCodeAt(n),16777619);return function(){return e+=e<<13,e^=e>>>7,e+=e<<3,e^=e>>>17,(e+=e<<5)>>>0}},t}(),d=function(t){function e(n){var r=t.call(this)||this;return r.a=e._xfnv1a(n)(),r}return h(e,t),e.prototype.next=function(){var t=this.a+=1831565813;return t=Math.imul(t^t>>>15,1|t),(((t^=t+Math.imul(t^t>>>7,61|t))^t>>>14)>>>0)/4294967296},e}(c),l=function(t){function e(n){var r=t.call(this)||this,i=e._xfnv1a(n);return r.a=i(),r.b=i(),r.c=i(),r.d=i(),r}return h(e,t),e.prototype.next=function(){this.a>>>=0,this.b>>>=0,this.c>>>=0,this.d>>>=0;var t=this.a+this.b|0;return this.a=this.b^this.b>>>9,this.b=this.c+(this.c<<3)|0,this.c=this.c<<21|this.c>>>11,this.d=this.d+1|0,t=t+this.d|0,this.c=this.c+t|0,(t>>>0)/4294967296},e}(c),p=function(t){function e(n){var r=t.call(this)||this,i=e._xfnv1a(n);return r.a=i(),r.b=i(),r.c=i(),r.d=i(),r}return h(e,t),e.prototype.next=function(){var t=this.b<<9,e=5*this.a;return e=e<<7|9*(e>>>25),this.c^=this.a,this.d^=this.b,this.b^=this.c,this.a^=this.d,this.c^=t,this.d=this.d<<11|this.d>>>21,(e>>>0)/4294967296},e}(c);!function(t){t.sfc32="sfc32",t.mulberry32="mulberry32",t.xoshiro128ss="xoshiro128ss"}(u||(u={}));var f=function(){function t(t,e){void 0===e&&(e=u.sfc32),this.str=t,this.prng=e,this.generator=this._initializeGenerator()}return t.prototype.next=function(){return this.generator.next()},t.prototype._initializeGenerator=function(){if(function(t){return null===t}(t=this.str)||function(t){return void 0===t}(t))return this.wrap();var t;switch(this.prng){case"sfc32":return new l(this.str);case"mulberry32":return new d(this.str);case"xoshiro128ss":return new p(this.str);default:return this.wrap()}},t.prototype.wrap=function(){return{next:function(){return Math.random()}}},t}(),g=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{h(r.next(t))}catch(t){o(t)}}function s(t){try{h(r.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}h((r=r.apply(t,e||[])).next())}))};const v={0:{nodes:[{points:[1,2],size:5},{points:[3],size:5}],edges:[{s:0,t:1}]},1:{nodes:[{points:[1,2,3],size:5}],edges:[]}},y=Object(),m={allowInvalidContainer:!0};class b extends o.DOMWidgetModel{initialize(t,e){super.initialize(t,e),this.on("change:colors",this.updateNodeColors,this),this.on("change:node_labels",this.updateNodeLabels,this),this.on("change:node_hover_labels",this.updateNodeHoverLabels,this),this.on("change:selected_level",this.updateSelectedLevel,this),this.on("change:avg_degree",this.updateAvgDegree,this),this.on("change:selected_points",this.updateSelectedPoints,this),this.on("msg:custom",this.handleCustomMessage,this),this.loadGraph()}loadGraph(){return g(this,void 0,void 0,(function*(){const t=this.get("graph"),e=Object.keys(t).map(Number),n=Math.min(...e),r=Math.max(...e),i=this.get("selected_level")||Math.floor((n+r)/2),o={coarseness:{label:"Coarseness",minValue:n,maxValue:r,initialValue:i,step:1},connectivity:{label:"Connectivity",minValue:0,maxValue:20,initialValue:this.get("avg_degree")||6,step:.1},selectedLevel:i.toString()};this.multiResolutionGraph=new a.MultiResolutionGraph({graphData:t,sliderConfig:o,sigmaSettings:Object.assign(Object.assign({},m),this.get("sigma_settings")||{}),onSelectedNodesChange:()=>{},onSelectedPointsChange:this.setSelectedPoints.bind(this),onFullScreenChange:this.toggleExpandedLayout.bind(this),onCoarsenessChange:this.setCoarsenessLevel.bind(this),onConnectivityChange:this.setConnectivityLevel.bind(this),layoutConfig:this.get("layout_config")}),this.updateNodeProperties()}))}updateNodeProperties(){this.updateNodeColors(),this.updateNodeLabels(),this.updateNodeHoverLabels()}setSelectedPoints(t){this.set("selected_points",t),this.save_changes()}toggleExpandedLayout(t){this.set("is_expanded_layout",t),this.save_changes()}setCoarsenessLevel(t){this.set("selected_level",t),this.save_changes()}setConnectivityLevel(t){this.set("avg_degree",t),this.save_changes()}updateNodeColors(){if(!this.multiResolutionGraph)return;const t=this.get("colors");t&&this.multiResolutionGraph.setNodeColors(t)}updateNodeLabels(){if(!this.multiResolutionGraph)return;const t=this.get("node_labels");t&&this.multiResolutionGraph.setNodeLabels(t)}updateNodeHoverLabels(){if(!this.multiResolutionGraph)return;const t=this.get("node_hover_labels");t&&this.multiResolutionGraph.setNodeHoverLabels(t)}updateSelectedLevel(){if(!this.multiResolutionGraph)return;const t=this.get("selected_level");t&&(this.multiResolutionGraph.setCoarsenessLevel(t),this.multiResolutionGraph.sliderManager.setSliderValue("Coarseness",t))}updateAvgDegree(){if(!this.multiResolutionGraph)return;const t=this.get("avg_degree");(t||0===t)&&(this.multiResolutionGraph.setConnectivityLevel(t),this.multiResolutionGraph.sliderManager.setSliderValue("Connectivity",t))}updateSelectedPoints(){if(!this.multiResolutionGraph)return;const t=this.get("selected_points");t&&this.multiResolutionGraph.setSelectedPoints(t)}disposeGraph(){this.multiResolutionGraph.cleanup(),this.multiResolutionGraph.dispose()}handleCustomMessage(t){"dispose_graph"===t.event_type&&this.disposeGraph()}defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:b.model_name,_model_module:b.model_module,_model_module_version:b.model_module_version,_view_name:b.view_name,_view_module:b.view_module,_view_module_version:b.view_module_version,graph:v,colors:null,node_labels:y,node_hover_labels:null,node_sizes:null,selected_nodes:[],sigma_settings:m,background_color:null,is_expanded_layout:!1})}}b.serializers=Object.assign({},o.DOMWidgetModel.serializers),b.model_name="LandscapeModel",b.model_module=n,b.model_module_version=e,b.view_name="LandscapeView",b.view_module=n,b.view_module_version=e;class w extends o.DOMWidgetView{constructor(t){super(t),this.view=null;const e=new f;this.containerId=`landscape-container-${e.next().toString(36).substring(2)}`}render(){this.createLandscapeContainer(),this.setupGraphManager(),this.model.on("change:background_color",this.setBackgroundColor,this)}createLandscapeContainer(){this._landscapeContainer=document.createElement("div"),this._landscapeContainer.id=this.containerId,this._landscapeContainer.style.position="relative",this._landscapeContainer.classList.add("landscape-container"),this.setBackgroundColor(),this.el.appendChild(this._landscapeContainer),this.el.classList.add("custom-widget")}setupGraphManager(){return g(this,void 0,void 0,(function*(){const t=document.getElementById(this.containerId);t&&this.model.multiResolutionGraph?(this.view=yield this.model.multiResolutionGraph.getView(t),this.view.graphManager.zoomInAndOut()):setTimeout((()=>this.setupGraphManager()),100)}))}setBackgroundColor(){const t=this.model.get("background_color");t&&(this.el.style.backgroundColor=t,this._landscapeContainer.style.backgroundColor=t,this._landscapeContainer.style.setProperty("--sigma-background-color",t))}}})(),i})()));
|
|
2
2
|
//# sourceMappingURL=index.js.map
|