UNPKG

grapholscape

Version:
25 lines (24 loc) 1.45 MB
/** * MIT License * * Copyright (c) 2018-2024 OBDA Systems * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ var Grapholscape=function(e){"use strict";function t(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}function n(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,c(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=d(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function s(e,t,n){return(t=c(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||d(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||d(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function d(e,t){if(e){if("string"==typeof e)return r(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}"function"==typeof SuppressedError&&SuppressedError;var p="undefined"==typeof window?null:window,g=p?p.navigator:null;p&&p.document;var f,v,y,m,E,b,w,_,x,T,C,N,A,I,O,S,L,P,R,D,M,k,F,B,G,$,V,z,U=h(""),q=h({}),H=h((function(){})),j="undefined"==typeof HTMLElement?"undefined":h(HTMLElement),Y=function(e){return e&&e.instanceString&&W(e.instanceString)?e.instanceString():null},X=function(e){return null!=e&&h(e)==U},W=function(e){return null!=e&&h(e)===H},Q=function(e){return!ee(e)&&(Array.isArray?Array.isArray(e):null!=e&&e instanceof Array)},Z=function(e){return null!=e&&h(e)===q&&!Q(e)&&e.constructor===Object},J=function(e){return null!=e&&h(e)===h(1)&&!isNaN(e)},K=function(e){return"undefined"===j?void 0:null!=e&&e instanceof HTMLElement},ee=function(e){return te(e)||ne(e)},te=function(e){return"collection"===Y(e)&&e._private.single},ne=function(e){return"collection"===Y(e)&&!e._private.single},re=function(e){return"core"===Y(e)},ie=function(e){return"stylesheet"===Y(e)},oe=function(e){return null==e||!(""!==e&&!e.match(/^\s+$/))},ae=function(e){return function(e){return null!=e&&h(e)===q}(e)&&W(e.then)},se=function(e,t){t||(t=function(){if(1===arguments.length)return arguments[0];if(0===arguments.length)return"undefined";for(var e=[],t=0;t<arguments.length;t++)e.push(arguments[t]);return e.join("$")});var n=function(){var r,i=arguments,o=t.apply(this,i),a=n.cache;return(r=a[o])||(r=a[o]=e.apply(this,i)),r};return n.cache={},n},le=se((function(e){return e.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()}))})),ue=se((function(e){return e.replace(/(-\w)/g,(function(e){return e[1].toUpperCase()}))})),ce=se((function(e,t){return e+t[0].toUpperCase()+t.substring(1)}),(function(e,t){return e+"$"+t})),he=function(e){return oe(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},de="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",pe="rgb[a]?\\(("+de+"[%]?)\\s*,\\s*("+de+"[%]?)\\s*,\\s*("+de+"[%]?)(?:\\s*,\\s*("+de+"))?\\)",ge="rgb[a]?\\((?:"+de+"[%]?)\\s*,\\s*(?:"+de+"[%]?)\\s*,\\s*(?:"+de+"[%]?)(?:\\s*,\\s*(?:"+de+"))?\\)",fe="hsl[a]?\\(("+de+")\\s*,\\s*("+de+"[%])\\s*,\\s*("+de+"[%])(?:\\s*,\\s*("+de+"))?\\)",ve="hsl[a]?\\((?:"+de+")\\s*,\\s*(?:"+de+"[%])\\s*,\\s*(?:"+de+"[%])(?:\\s*,\\s*(?:"+de+"))?\\)",ye=function(e,t){return e<t?-1:e>t?1:0},me=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments,n=1;n<t.length;n++){var r=t[n];if(null!=r)for(var i=Object.keys(r),o=0;o<i.length;o++){var a=i[o];e[a]=r[a]}}return e},Ee=function(e){return(Q(e)?e:null)||function(e){return be[e.toLowerCase()]}(e)||function(e){if((4===e.length||7===e.length)&&"#"===e[0]){var t,n,r,i=16;return 4===e.length?(t=parseInt(e[1]+e[1],i),n=parseInt(e[2]+e[2],i),r=parseInt(e[3]+e[3],i)):(t=parseInt(e[1]+e[2],i),n=parseInt(e[3]+e[4],i),r=parseInt(e[5]+e[6],i)),[t,n,r]}}(e)||function(e){var t,n=new RegExp("^"+pe+"$").exec(e);if(n){t=[];for(var r=[],i=1;i<=3;i++){var o=n[i];if("%"===o[o.length-1]&&(r[i]=!0),o=parseFloat(o),r[i]&&(o=o/100*255),o<0||o>255)return;t.push(Math.floor(o))}var a=r[1]||r[2]||r[3],s=r[1]&&r[2]&&r[3];if(a&&!s)return;var l=n[4];if(void 0!==l){if((l=parseFloat(l))<0||l>1)return;t.push(l)}}return t}(e)||function(e){var t,n,r,i,o,a,s,l;function u(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var c=new RegExp("^"+fe+"$").exec(e);if(c){if((n=parseInt(c[1]))<0?n=(360- -1*n%360)%360:n>360&&(n%=360),n/=360,(r=parseFloat(c[2]))<0||r>100)return;if(r/=100,(i=parseFloat(c[3]))<0||i>100)return;if(i/=100,void 0!==(o=c[4])&&((o=parseFloat(o))<0||o>1))return;if(0===r)a=s=l=Math.round(255*i);else{var h=i<.5?i*(1+r):i+r-i*r,d=2*i-h;a=Math.round(255*u(d,h,n+1/3)),s=Math.round(255*u(d,h,n)),l=Math.round(255*u(d,h,n-1/3))}t=[a,s,l,o]}return t}(e)},be={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},we=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i<r;i++){var o=n[i];if(Z(o))throw Error("Tried to set map with object key");i<n.length-1?(null==t[o]&&(t[o]={}),t=t[o]):t[o]=e.value}},_e=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i<r;i++){var o=n[i];if(Z(o))throw Error("Tried to get map with object key");if(null==(t=t[o]))return t}return t},xe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Te(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ce(){if(v)return f;return v=1,f=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},f}function Ne(){if(b)return E;b=1;var e=function(){if(m)return y;m=1;var e="object"==typeof xe&&xe&&xe.Object===Object&&xe;return y=e}(),t="object"==typeof self&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return E=n}function Ae(){if(N)return C;N=1;var e=function(){if(T)return x;T=1;var e=/\s/;return x=function(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n},x}(),t=/^\s+/;return C=function(n){return n?n.slice(0,e(n)+1).replace(t,""):n},C}function Ie(){if(I)return A;I=1;var e=Ne().Symbol;return A=e}function Oe(){if(D)return R;D=1;var e=Ie(),t=function(){if(S)return O;S=1;var e=Ie(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,i=e?e.toStringTag:void 0;return O=function(e){var t=n.call(e,i),o=e[i];try{e[i]=void 0;var a=!0}catch(e){}var s=r.call(e);return a&&(t?e[i]=o:delete e[i]),s}}(),n=function(){if(P)return L;P=1;var e=Object.prototype.toString;return L=function(t){return e.call(t)}}(),r=e?e.toStringTag:void 0;return R=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":r&&r in Object(e)?t(e):n(e)}}function Se(){if(B)return F;B=1;var e=Oe(),t=k?M:(k=1,M=function(e){return null!=e&&"object"==typeof e});return F=function(n){return"symbol"==typeof n||t(n)&&"[object Symbol]"==e(n)}}var Le=function(){if(z)return V;z=1;var e=Ce(),t=function(){if(_)return w;_=1;var e=Ne();return w=function(){return e.Date.now()}}(),n=function(){if($)return G;$=1;var e=Ae(),t=Ce(),n=Se(),r=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,a=parseInt;return G=function(s){if("number"==typeof s)return s;if(n(s))return NaN;if(t(s)){var l="function"==typeof s.valueOf?s.valueOf():s;s=t(l)?l+"":l}if("string"!=typeof s)return 0===s?s:+s;s=e(s);var u=i.test(s);return u||o.test(s)?a(s.slice(2),u?2:8):r.test(s)?NaN:+s}}(),r=Math.max,i=Math.min;return V=function(o,a,s){var l,u,c,h,d,p,g=0,f=!1,v=!1,y=!0;if("function"!=typeof o)throw new TypeError("Expected a function");function m(e){var t=l,n=u;return l=u=void 0,g=e,h=o.apply(n,t)}function E(e){var t=e-p;return void 0===p||t>=a||t<0||v&&e-g>=c}function b(){var e=t();if(E(e))return w(e);d=setTimeout(b,function(e){var t=a-(e-p);return v?i(t,c-(e-g)):t}(e))}function w(e){return d=void 0,y&&l?m(e):(l=u=void 0,h)}function _(){var e=t(),n=E(e);if(l=arguments,u=this,p=e,n){if(void 0===d)return function(e){return g=e,d=setTimeout(b,a),f?m(e):h}(p);if(v)return clearTimeout(d),d=setTimeout(b,a),m(p)}return void 0===d&&(d=setTimeout(b,a)),h}return a=n(a)||0,e(s)&&(f=!!s.leading,c=(v="maxWait"in s)?r(n(s.maxWait)||0,a):c,y="trailing"in s?!!s.trailing:y),_.cancel=function(){void 0!==d&&clearTimeout(d),g=0,l=p=u=d=void 0},_.flush=function(){return void 0===d?h:w(t())},_},V}(),Pe=Te(Le),Re=p?p.performance:null,De=Re&&Re.now?function(){return Re.now()}:function(){return Date.now()},Me=function(){if(p){if(p.requestAnimationFrame)return function(e){p.requestAnimationFrame(e)};if(p.mozRequestAnimationFrame)return function(e){p.mozRequestAnimationFrame(e)};if(p.webkitRequestAnimationFrame)return function(e){p.webkitRequestAnimationFrame(e)};if(p.msRequestAnimationFrame)return function(e){p.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout((function(){e(De())}),1e3/60)}}(),ke=function(e){return Me(e)},Fe=De,Be=9261,Ge=5381,$e=function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Be;!(t=e.next()).done;)n=65599*n+t.value|0;return n},Ve=function(e){return 65599*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:Be)+e|0},ze=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ge;return(t<<5)+t+e|0},Ue=function(e){return 2097152*e[0]+e[1]},qe=function(e,t){return[Ve(e[0],t[0]),ze(e[1],t[1])]},He=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return $e({next:function(){return r<i?n.value=e.charCodeAt(r++):n.done=!0,n}},t)},je=function(){return Ye(arguments)},Ye=function(e){for(var t,n=0;n<e.length;n++){var r=e[n];t=0===n?He(r):He(r,t)}return t},Xe=!0,We=null!=console.warn,Qe=null!=console.trace,Ze=Number.MAX_SAFE_INTEGER||9007199254740991,Je=function(){return!0},Ke=function(){return!1},et=function(){return 0},tt=function(){},nt=function(e){throw new Error(e)},rt=function(e){if(void 0===e)return Xe;Xe=!!e},it=function(e){rt()&&(We?console.warn(e):(console.log(e),Qe&&console.trace()))},ot=function(e){return null==e?e:Q(e)?e.slice():Z(e)?function(e){return me({},e)}(e):e},at=function(e,t){for(t=e="";e++<36;t+=51*e&52?(15^e?8^Math.random()*(20^e?16:4):4).toString(16):"-");return t},st={},lt=function(){return st},ut=function(e){var t=Object.keys(e);return function(n){for(var r={},i=0;i<t.length;i++){var o=t[i],a=null==n?void 0:n[o];r[o]=void 0===a?e[o]:a}return r}},ct=function(e,t,n){for(var r=e.length-1;r>=0;r--)e[r]===t&&e.splice(r,1)},ht=function(e){e.splice(0,e.length)},dt=function(e,t,n){return n&&(t=ce(n,t)),e[t]},pt=function(e,t,n,r){n&&(t=ce(n,t)),e[t]=r},gt="undefined"!=typeof Map?Map:function(){return o((function e(){i(this,e),this._obj={}}),[{key:"set",value:function(e,t){return this._obj[e]=t,this}},{key:"delete",value:function(e){return this._obj[e]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(e){return void 0!==this._obj[e]}},{key:"get",value:function(e){return this._obj[e]}}])}(),ft=function(){return o((function e(t){if(i(this,e),this._obj=Object.create(null),this.size=0,null!=t){var n;n=null!=t.instanceString&&t.instanceString()===this.instanceString()?t.toArray():t;for(var r=0;r<n.length;r++)this.add(n[r])}}),[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(e){var t=this._obj;1!==t[e]&&(t[e]=1,this.size++)}},{key:"delete",value:function(e){var t=this._obj;1===t[e]&&(t[e]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(e){return 1===this._obj[e]}},{key:"toArray",value:function(){var e=this;return Object.keys(this._obj).filter((function(t){return e.has(t)}))}},{key:"forEach",value:function(e,t){return this.toArray().forEach(e,t)}}])}(),vt="undefined"!==("undefined"==typeof Set?"undefined":h(Set))?Set:ft,yt=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0!==e&&void 0!==t&&re(e)){var r=t.group;if(null==r&&(r=t.data&&null!=t.data.source&&null!=t.data.target?"edges":"nodes"),"nodes"===r||"edges"===r){this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:r,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:void 0===t.selectable||!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:void 0===t.grabbable||!!t.grabbable,pannable:void 0===t.pannable?"edges"===r:!!t.pannable,active:!1,classes:new vt,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(null==i.position.x&&(i.position.x=0),null==i.position.y&&(i.position.y=0),t.renderedPosition){var o=t.renderedPosition,a=e.pan(),s=e.zoom();i.position={x:(o.x-a.x)/s,y:(o.y-a.y)/s}}var l=[];Q(t.classes)?l=t.classes:X(t.classes)&&(l=t.classes.split(/\s+/));for(var u=0,c=l.length;u<c;u++){var h=l[u];h&&""!==h&&i.classes.add(h)}this.createEmitter(),(void 0===n||n)&&this.restore();var d=t.style||t.css;d&&(it("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(d))}else nt("An element must be of type `nodes` or `edges`; you specified `"+r+"`")}else nt("An element must have a core reference and parameters set")},mt=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(t,n,r){var i;Z(t)&&!ee(t)&&(t=(i=t).roots||i.root,n=i.visit,r=i.directed),r=2!==arguments.length||W(n)?r:n,n=W(n)?n:function(){};for(var o,a=this._private.cy,s=t=X(t)?this.filter(t):t,l=[],u=[],c={},h={},d={},p=0,g=this.byGroup(),f=g.nodes,v=g.edges,y=0;y<s.length;y++){var m=s[y],E=m.id();m.isNode()&&(l.unshift(m),e.bfs&&(d[E]=!0,u.push(m)),h[E]=0)}for(var b,w=function(){var t=e.bfs?l.shift():l.pop(),i=t.id();if(e.dfs){if(d[i])return 0;d[i]=!0,u.push(t)}var a,s=h[i],g=c[i],y=null!=g?g.source():null,m=null!=g?g.target():null,E=null==g?void 0:t.same(y)?m[0]:y[0];if(!0===(a=n(t,g,E,p++,s)))return o=t,1;if(!1===a)return 1;for(var b=t.connectedEdges().filter((function(e){return(!r||e.source().same(t))&&v.has(e)})),w=0;w<b.length;w++){var _=b[w],x=_.connectedNodes().filter((function(e){return!e.same(t)&&f.has(e)})),T=x.id();0===x.length||d[T]||(x=x[0],l.push(x),e.bfs&&(d[T]=!0,u.push(x)),c[T]=_,h[T]=h[i]+1)}};0!==l.length&&(0===(b=w())||1!==b););for(var _=a.collection(),x=0;x<u.length;x++){var T=u[x],C=c[T.id()];null!=C&&_.push(C),_.push(T)}return{path:a.collection(_),found:a.collection(o)}}},Et={breadthFirstSearch:mt({bfs:!0}),depthFirstSearch:mt({dfs:!0})};Et.bfs=Et.breadthFirstSearch,Et.dfs=Et.depthFirstSearch;var bt,wt,_t,xt={exports:{}},Tt=xt.exports;function Ct(){return bt||(bt=1,e=xt,function(){var t,n,r,i,o,a,s,l,u,c,h,d,p,g,f;r=Math.floor,c=Math.min,n=function(e,t){return e<t?-1:e>t?1:0},u=function(e,t,i,o,a){var s;if(null==i&&(i=0),null==a&&(a=n),i<0)throw new Error("lo must be non-negative");for(null==o&&(o=e.length);i<o;)a(t,e[s=r((i+o)/2)])<0?o=s:i=s+1;return[].splice.apply(e,[i,i-i].concat(t)),t},a=function(e,t,r){return null==r&&(r=n),e.push(t),g(e,0,e.length-1,r)},o=function(e,t){var r,i;return null==t&&(t=n),r=e.pop(),e.length?(i=e[0],e[0]=r,f(e,0,t)):i=r,i},l=function(e,t,r){var i;return null==r&&(r=n),i=e[0],e[0]=t,f(e,0,r),i},s=function(e,t,r){var i;return null==r&&(r=n),e.length&&r(e[0],t)<0&&(t=(i=[e[0],t])[0],e[0]=i[1],f(e,0,r)),t},i=function(e,t){var i,o,a,s,l,u;for(null==t&&(t=n),l=[],o=0,a=(s=function(){u=[];for(var t=0,n=r(e.length/2);0<=n?t<n:t>n;0<=n?t++:t--)u.push(t);return u}.apply(this).reverse()).length;o<a;o++)i=s[o],l.push(f(e,i,t));return l},p=function(e,t,r){var i;if(null==r&&(r=n),-1!==(i=e.indexOf(t)))return g(e,0,i,r),f(e,i,r)},h=function(e,t,r){var o,a,l,u,c;if(null==r&&(r=n),!(a=e.slice(0,t)).length)return a;for(i(a,r),l=0,u=(c=e.slice(t)).length;l<u;l++)o=c[l],s(a,o,r);return a.sort(r).reverse()},d=function(e,t,r){var a,s,l,h,d,p,g,f,v;if(null==r&&(r=n),10*t<=e.length){if(!(l=e.slice(0,t).sort(r)).length)return l;for(s=l[l.length-1],h=0,p=(g=e.slice(t)).length;h<p;h++)r(a=g[h],s)<0&&(u(l,a,0,null,r),l.pop(),s=l[l.length-1]);return l}for(i(e,r),v=[],d=0,f=c(t,e.length);0<=f?d<f:d>f;0<=f?++d:--d)v.push(o(e,r));return v},g=function(e,t,r,i){var o,a,s;for(null==i&&(i=n),o=e[r];r>t&&i(o,a=e[s=r-1>>1])<0;)e[r]=a,r=s;return e[r]=o},f=function(e,t,r){var i,o,a,s,l;for(null==r&&(r=n),o=e.length,l=t,a=e[t],i=2*t+1;i<o;)(s=i+1)<o&&!(r(e[i],e[s])<0)&&(i=s),e[t]=e[i],i=2*(t=i)+1;return e[t]=a,g(e,l,t,r)},t=function(){function e(e){this.cmp=null!=e?e:n,this.nodes=[]}return e.push=a,e.pop=o,e.replace=l,e.pushpop=s,e.heapify=i,e.updateItem=p,e.nlargest=h,e.nsmallest=d,e.prototype.push=function(e){return a(this.nodes,e,this.cmp)},e.prototype.pop=function(){return o(this.nodes,this.cmp)},e.prototype.peek=function(){return this.nodes[0]},e.prototype.contains=function(e){return-1!==this.nodes.indexOf(e)},e.prototype.replace=function(e){return l(this.nodes,e,this.cmp)},e.prototype.pushpop=function(e){return s(this.nodes,e,this.cmp)},e.prototype.heapify=function(){return i(this.nodes,this.cmp)},e.prototype.updateItem=function(e){return p(this.nodes,e,this.cmp)},e.prototype.clear=function(){return this.nodes=[]},e.prototype.empty=function(){return 0===this.nodes.length},e.prototype.size=function(){return this.nodes.length},e.prototype.clone=function(){var t;return(t=new e).nodes=this.nodes.slice(0),t},e.prototype.toArray=function(){return this.nodes.slice(0)},e.prototype.insert=e.prototype.push,e.prototype.top=e.prototype.peek,e.prototype.front=e.prototype.peek,e.prototype.has=e.prototype.contains,e.prototype.copy=e.prototype.clone,e}(),e.exports=t}.call(Tt)),xt.exports;var e}var Nt=Te(_t?wt:(_t=1,wt=Ct())),At=ut({root:null,weight:function(e){return 1},directed:!1}),It={dijkstra:function(e){if(!Z(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var n=At(e),r=n.root,i=n.weight,o=n.directed,a=this,s=i,l=X(r)?this.filter(r)[0]:r[0],u={},c={},h={},d=this.byGroup(),p=d.nodes,g=d.edges;g.unmergeBy((function(e){return e.isLoop()}));for(var f=function(e){return u[e.id()]},v=function(e,t){u[e.id()]=t,y.updateItem(e)},y=new Nt((function(e,t){return f(e)-f(t)})),m=0;m<p.length;m++){var E=p[m];u[E.id()]=E.same(l)?0:1/0,y.push(E)}for(var b=function(e,t){for(var n,r=(o?e.edgesTo(t):e.edgesWith(t)).intersect(g),i=1/0,a=0;a<r.length;a++){var l=r[a],u=s(l);(u<i||!n)&&(i=u,n=l)}return{edge:n,dist:i}};y.size()>0;){var w=y.pop(),_=f(w),x=w.id();if(h[x]=_,_!==1/0)for(var T=w.neighborhood().intersect(p),C=0;C<T.length;C++){var N=T[C],A=N.id(),I=b(w,N),O=_+I.dist;O<f(N)&&(v(N,O),c[A]={node:w,edge:I.edge})}}return{distanceTo:function(e){var t=X(e)?p.filter(e)[0]:e[0];return h[t.id()]},pathTo:function(e){var t=X(e)?p.filter(e)[0]:e[0],n=[],r=t,i=r.id();if(t.length>0)for(n.unshift(t);c[i];){var o=c[i];n.unshift(o.edge),n.unshift(o.node),i=(r=o.node).id()}return a.spawn(n)}}}},Ot={kruskal:function(e){e=e||function(e){return 1};for(var t=this.byGroup(),n=t.nodes,r=t.edges,i=n.length,o=new Array(i),a=n,s=function(e){for(var t=0;t<o.length;t++){if(o[t].has(e))return t}},l=0;l<i;l++)o[l]=this.spawn(n[l]);for(var u=r.sort((function(t,n){return e(t)-e(n)})),c=0;c<u.length;c++){var h=u[c],d=h.source()[0],p=h.target()[0],g=s(d),f=s(p),v=o[g],y=o[f];g!==f&&(a.merge(h),v.merge(y),o.splice(f,1))}return a}},St=ut({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),Lt={aStar:function(e){var t=this.cy(),n=St(e),r=n.root,i=n.goal,o=n.heuristic,a=n.directed,s=n.weight;r=t.collection(r)[0],i=t.collection(i)[0];var l,u,c=r.id(),h=i.id(),d={},p={},g={},f=new Nt((function(e,t){return p[e.id()]-p[t.id()]})),v=new vt,y={},m={},E=function(e,t){f.push(e),v.add(t)};E(r,c),d[c]=0,p[c]=o(r);for(var b,w=0;f.size()>0;){if(l=f.pop(),u=l.id(),v.delete(u),w++,u===h){for(var _=[],x=i,T=h,C=m[T];_.unshift(x),null!=C&&_.unshift(C),null!=(x=y[T]);)C=m[T=x.id()];return{found:!0,distance:d[u],path:this.spawn(_),steps:w}}g[u]=!0;for(var N=l._private.edges,A=0;A<N.length;A++){var I=N[A];if(this.hasElementWithId(I.id())&&(!a||I.data("source")===u)){var O=I.source(),S=I.target(),L=O.id()!==u?O:S,P=L.id();if(this.hasElementWithId(P)&&!g[P]){var R=d[u]+s(I);b=P,v.has(b)?R<d[P]&&(d[P]=R,p[P]=R+o(L),y[P]=l,m[P]=I):(d[P]=R,p[P]=R+o(L),E(L,P),y[P]=l,m[P]=I)}}}}return{found:!1,distance:void 0,path:void 0,steps:w}}},Pt=ut({weight:function(e){return 1},directed:!1}),Rt={floydWarshall:function(e){for(var t=this.cy(),n=Pt(e),r=n.weight,i=n.directed,o=r,a=this.byGroup(),s=a.nodes,l=a.edges,u=s.length,c=u*u,h=function(e){return s.indexOf(e)},d=function(e){return s[e]},p=new Array(c),g=0;g<c;g++){var f=g%u,v=(g-f)/u;p[g]=v===f?0:1/0}for(var y=new Array(c),m=new Array(c),E=0;E<l.length;E++){var b=l[E],w=b.source()[0],_=b.target()[0];if(w!==_){var x=h(w),T=h(_),C=x*u+T,N=o(b);if(p[C]>N&&(p[C]=N,y[C]=T,m[C]=b),!i){var A=T*u+x;!i&&p[A]>N&&(p[A]=N,y[A]=x,m[A]=b)}}}for(var I=0;I<u;I++)for(var O=0;O<u;O++)for(var S=O*u+I,L=0;L<u;L++){var P=O*u+L,R=I*u+L;p[S]+p[R]<p[P]&&(p[P]=p[S]+p[R],y[P]=y[S])}var D=function(e){return h(function(e){return(X(e)?t.filter(e):e)[0]}(e))},M={distance:function(e,t){var n=D(e),r=D(t);return p[n*u+r]},path:function(e,n){var r=D(e),i=D(n),o=d(r);if(r===i)return o.collection();if(null==y[r*u+i])return t.collection();var a,s=t.collection(),l=r;for(s.merge(o);r!==i;)l=r,r=y[r*u+i],a=m[l*u+r],s.merge(a),s.merge(d(r));return s}};return M}},Dt=ut({weight:function(e){return 1},directed:!1,root:null}),Mt={bellmanFord:function(e){var t=this,n=Dt(e),r=n.weight,i=n.directed,o=n.root,a=r,s=this,l=this.cy(),u=this.byGroup(),c=u.edges,h=u.nodes,d=h.length,p=new gt,g=!1,f=[];o=l.collection(o)[0],c.unmergeBy((function(e){return e.isLoop()}));for(var v=c.length,y=function(e){var t=p.get(e.id());return t||(t={},p.set(e.id(),t)),t},m=function(e){return(X(e)?l.$(e):e)[0]},E=0;E<d;E++){var b=h[E],w=y(b);b.same(o)?w.dist=0:w.dist=1/0,w.pred=null,w.edge=null}for(var _=!1,x=function(e,t,n,r,i,o){var a=r.dist+o;a<i.dist&&!n.same(r.edge)&&(i.dist=a,i.pred=e,i.edge=n,_=!0)},T=1;T<d;T++){_=!1;for(var C=0;C<v;C++){var N=c[C],A=N.source(),I=N.target(),O=a(N),S=y(A),L=y(I);x(A,0,N,S,L,O),i||x(I,0,N,L,S,O)}if(!_)break}if(_)for(var P=[],R=0;R<v;R++){var D=c[R],M=D.source(),k=D.target(),F=a(D),B=y(M).dist,G=y(k).dist;if(B+F<G||!i&&G+F<B){if(g||(it("Graph contains a negative weight cycle for Bellman-Ford"),g=!0),!1===e.findNegativeWeightCycles)break;var $=[];B+F<G&&$.push(M),!i&&G+F<B&&$.push(k);for(var V=$.length,z=0;z<V;z++){var U=$[z],q=[U];q.push(y(U).edge);for(var H=y(U).pred;-1===q.indexOf(H);)q.push(H),q.push(y(H).edge),H=y(H).pred;for(var j=(q=q.slice(q.indexOf(H)))[0].id(),Y=0,W=2;W<q.length;W+=2)q[W].id()<j&&(j=q[W].id(),Y=W);(q=q.slice(Y).concat(q.slice(0,Y))).push(q[0]);var Q=q.map((function(e){return e.id()})).join(",");-1===P.indexOf(Q)&&(f.push(s.spawn(q)),P.push(Q))}}}return{distanceTo:function(e){return y(m(e)).dist},pathTo:function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o,r=[],i=m(e);;){if(null==i)return t.spawn();var a=y(i),l=a.edge,u=a.pred;if(r.unshift(i[0]),i.same(n)&&r.length>0)break;null!=l&&r.unshift(l),i=u}return s.spawn(r)},hasNegativeWeightCycle:g,negativeWeightCycles:f}}},kt=Math.sqrt(2),Ft=function(e,t,n){0===n.length&&nt("Karger-Stein must be run on a connected (sub)graph");for(var r=n[e],i=r[1],o=r[2],a=t[i],s=t[o],l=n,u=l.length-1;u>=0;u--){var c=l[u],h=c[1],d=c[2];(t[h]===a&&t[d]===s||t[h]===s&&t[d]===a)&&l.splice(u,1)}for(var p=0;p<l.length;p++){var g=l[p];g[1]===s?(l[p]=g.slice(),l[p][1]=a):g[2]===s&&(l[p]=g.slice(),l[p][2]=a)}for(var f=0;f<t.length;f++)t[f]===s&&(t[f]=a);return l},Bt=function(e,t,n,r){for(;n>r;){var i=Math.floor(Math.random()*t.length);t=Ft(i,e,t),n--}return t},Gt={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,r=t.edges;r.unmergeBy((function(e){return e.isLoop()}));var i=n.length,o=r.length,a=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),s=Math.floor(i/kt);if(!(i<2)){for(var l=[],u=0;u<o;u++){var c=r[u];l.push([u,n.indexOf(c.source()),n.indexOf(c.target())])}for(var h=1/0,d=[],p=new Array(i),g=new Array(i),f=new Array(i),v=function(e,t){for(var n=0;n<i;n++)t[n]=e[n]},y=0;y<=a;y++){for(var m=0;m<i;m++)g[m]=m;var E=Bt(g,l.slice(),i,s),b=E.slice();v(g,f);var w=Bt(g,E,s,2),_=Bt(f,b,s,2);w.length<=_.length&&w.length<h?(h=w.length,d=w,v(g,p)):_.length<=w.length&&_.length<h&&(h=_.length,d=_,v(f,p))}for(var x=this.spawn(d.map((function(e){return r[e[0]]}))),T=this.spawn(),C=this.spawn(),N=p[0],A=0;A<p.length;A++){var I=p[A],O=n[A];I===N?T.merge(O):C.merge(O)}var S=function(t){var n=e.spawn();return t.forEach((function(t){n.merge(t),t.connectedEdges().forEach((function(t){e.contains(t)&&!x.contains(t)&&n.merge(t)}))})),n},L=[S(T),S(C)];return{cut:x,components:L,partition1:T,partition2:C}}nt("At least 2 nodes are required for Karger-Stein algorithm")}},$t=function(e,t,n){return{x:e.x*t+n.x,y:e.y*t+n.y}},Vt=function(e,t,n){return{x:(e.x-n.x)/t,y:(e.y-n.y)/t}},zt=function(e){return{x:e[0],y:e[1]}},Ut=function(e,t){return Math.atan2(t,e)-Math.PI/2},qt=Math.log2||function(e){return Math.log(e)/Math.log(2)},Ht=function(e){return e>0?1:e<0?-1:0},jt=function(e,t){return Math.sqrt(Yt(e,t))},Yt=function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},Xt=function(e){for(var t=e.length,n=0,r=0;r<t;r++)n+=e[r];for(var i=0;i<t;i++)e[i]=e[i]/n;return e},Wt=function(e,t,n,r){return(1-r)*(1-r)*e+2*(1-r)*r*t+r*r*n},Qt=function(e,t,n,r){return{x:Wt(e.x,t.x,n.x,r),y:Wt(e.y,t.y,n.y,r)}},Zt=function(e,t,n){return Math.max(e,Math.min(n,t))},Jt=function(e){if(null==e)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(null!=e.x1&&null!=e.y1){if(null!=e.x2&&null!=e.y2&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(null!=e.w&&null!=e.h&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},Kt=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},en=function(e,t,n){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},tn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},nn=function(e){var t,n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0];if(1===o.length)t=n=r=i=o[0];else if(2===o.length)t=r=o[0],i=n=o[1];else if(4===o.length){var a=l(o,4);t=a[0],n=a[1],r=a[2],i=a[3]}return e.x1-=i,e.x2+=n,e.y1-=t,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},rn=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},on=function(e,t){return!(e.x1>t.x2)&&(!(t.x1>e.x2)&&(!(e.x2<t.x1)&&(!(t.x2<e.x1)&&(!(e.y2<t.y1)&&(!(t.y2<e.y1)&&(!(e.y1>t.y2)&&!(t.y1>e.y2)))))))},an=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},sn=function(e,t){return an(e,t.x1,t.y1)&&an(e,t.x2,t.y2)},ln=function(e,t,n,r,i,o,a){var s,l,u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"auto",c="auto"===u?Nn(i,o):u,h=i/2,d=o/2,p=(c=Math.min(c,h,d))!==h,g=c!==d;if(p){var f=r-d-a;if((s=bn(e,t,n,r,n-h+c-a,f,n+h-c+a,f,!1)).length>0)return s}if(g){var v=n+h+a;if((s=bn(e,t,n,r,v,r-d+c-a,v,r+d-c+a,!1)).length>0)return s}if(p){var y=r+d+a;if((s=bn(e,t,n,r,n-h+c-a,y,n+h-c+a,y,!1)).length>0)return s}if(g){var m=n-h-a;if((s=bn(e,t,n,r,m,r-d+c-a,m,r+d-c+a,!1)).length>0)return s}var E=n-h+c,b=r-d+c;if((l=mn(e,t,n,r,E,b,c+a)).length>0&&l[0]<=E&&l[1]<=b)return[l[0],l[1]];var w=n+h-c,_=r-d+c;if((l=mn(e,t,n,r,w,_,c+a)).length>0&&l[0]>=w&&l[1]<=_)return[l[0],l[1]];var x=n+h-c,T=r+d-c;if((l=mn(e,t,n,r,x,T,c+a)).length>0&&l[0]>=x&&l[1]>=T)return[l[0],l[1]];var C=n-h+c,N=r+d-c;return(l=mn(e,t,n,r,C,N,c+a)).length>0&&l[0]<=C&&l[1]>=N?[l[0],l[1]]:[]},un=function(e,t,n,r,i,o,a){var s=a,l=Math.min(n,i),u=Math.max(n,i),c=Math.min(r,o),h=Math.max(r,o);return l-s<=e&&e<=u+s&&c-s<=t&&t<=h+s},cn=function(e,t,n,r,i,o,a,s,l){var u=Math.min(n,a,i)-l,c=Math.max(n,a,i)+l,h=Math.min(r,s,o)-l,d=Math.max(r,s,o)+l;return!(e<u||e>c||t<h||t>d)},hn=function(e,t,n,r,i,o,a,s){var l=[];!function(e,t,n,r,i){var o,a,s,l,u,c,h,d;0===e&&(e=1e-5),s=-27*(r/=e)+(t/=e)*(9*(n/=e)-t*t*2),o=(a=(3*n-t*t)/9)*a*a+(s/=54)*s,i[1]=0,h=t/3,o>0?(u=(u=s+Math.sqrt(o))<0?-Math.pow(-u,1/3):Math.pow(u,1/3),c=(c=s-Math.sqrt(o))<0?-Math.pow(-c,1/3):Math.pow(c,1/3),i[0]=-h+u+c,h+=(u+c)/2,i[4]=i[2]=-h,h=Math.sqrt(3)*(-c+u)/2,i[3]=h,i[5]=-h):(i[5]=i[3]=0,0===o?(d=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3),i[0]=2*d-h,i[4]=i[2]=-(d+h)):(l=(a=-a)*a*a,l=Math.acos(s/Math.sqrt(l)),d=2*Math.sqrt(a),i[0]=-h+d*Math.cos(l/3),i[2]=-h+d*Math.cos((l+2*Math.PI)/3),i[4]=-h+d*Math.cos((l+4*Math.PI)/3)))}(1*n*n-4*n*i+2*n*a+4*i*i-4*i*a+a*a+r*r-4*r*o+2*r*s+4*o*o-4*o*s+s*s,9*n*i-3*n*n-3*n*a-6*i*i+3*i*a+9*r*o-3*r*r-3*r*s-6*o*o+3*o*s,3*n*n-6*n*i+n*a-n*e+2*i*i+2*i*e-a*e+3*r*r-6*r*o+r*s-r*t+2*o*o+2*o*t-s*t,1*n*i-n*n+n*e-i*e+r*o-r*r+r*t-o*t,l);for(var u=[],c=0;c<6;c+=2)Math.abs(l[c+1])<1e-7&&l[c]>=0&&l[c]<=1&&u.push(l[c]);u.push(1),u.push(0);for(var h,d,p,g=-1,f=0;f<u.length;f++)h=Math.pow(1-u[f],2)*n+2*(1-u[f])*u[f]*i+u[f]*u[f]*a,d=Math.pow(1-u[f],2)*r+2*(1-u[f])*u[f]*o+u[f]*u[f]*s,p=Math.pow(h-e,2)+Math.pow(d-t,2),g>=0?p<g&&(g=p):g=p;return g},dn=function(e,t,n,r,i,o){var a=[e-n,t-r],s=[i-n,o-r],l=s[0]*s[0]+s[1]*s[1],u=a[0]*a[0]+a[1]*a[1],c=a[0]*s[0]+a[1]*s[1],h=c*c/l;return c<0?u:h>l?(e-i)*(e-i)+(t-o)*(t-o):u-h},pn=function(e,t,n){for(var r,i,o,a,s=0,l=0;l<n.length/2;l++)if(r=n[2*l],i=n[2*l+1],l+1<n.length/2?(o=n[2*(l+1)],a=n[2*(l+1)+1]):(o=n[2*(l+1-n.length/2)],a=n[2*(l+1-n.length/2)+1]),r==e&&o==e);else{if(!(r>=e&&e>=o||r<=e&&e<=o))continue;(e-r)/(o-r)*(a-i)+i>t&&s++}return s%2!=0},gn=function(e,t,n,r,i,o,a,s,l){var u,c=new Array(n.length);null!=s[0]?(u=Math.atan(s[1]/s[0]),s[0]<0?u+=Math.PI/2:u=-u-Math.PI/2):u=s;for(var h,d=Math.cos(-u),p=Math.sin(-u),g=0;g<c.length/2;g++)c[2*g]=o/2*(n[2*g]*d-n[2*g+1]*p),c[2*g+1]=a/2*(n[2*g+1]*d+n[2*g]*p),c[2*g]+=r,c[2*g+1]+=i;if(l>0){var f=vn(c,-l);h=fn(f)}else h=c;return pn(e,t,h)},fn=function(e){for(var t,n,r,i,o,a,s,l,u=new Array(e.length/2),c=0;c<e.length/4;c++){t=e[4*c],n=e[4*c+1],r=e[4*c+2],i=e[4*c+3],c<e.length/4-1?(o=e[4*(c+1)],a=e[4*(c+1)+1],s=e[4*(c+1)+2],l=e[4*(c+1)+3]):(o=e[0],a=e[1],s=e[2],l=e[3]);var h=bn(t,n,r,i,o,a,s,l,!0);u[2*c]=h[0],u[2*c+1]=h[1]}return u},vn=function(e,t){for(var n,r,i,o,a=new Array(2*e.length),s=0;s<e.length/2;s++){n=e[2*s],r=e[2*s+1],s<e.length/2-1?(i=e[2*(s+1)],o=e[2*(s+1)+1]):(i=e[0],o=e[1]);var l=o-r,u=-(i-n),c=Math.sqrt(l*l+u*u),h=l/c,d=u/c;a[4*s]=n+h*t,a[4*s+1]=r+d*t,a[4*s+2]=i+h*t,a[4*s+3]=o+d*t}return a},yn=function(e,t,n,r,i,o,a){return e-=i,t-=o,(e/=n/2+a)*e+(t/=r/2+a)*t<=1},mn=function(e,t,n,r,i,o,a){var s=[n-e,r-t],l=[e-i,t-o],u=s[0]*s[0]+s[1]*s[1],c=2*(l[0]*s[0]+l[1]*s[1]),h=c*c-4*u*(l[0]*l[0]+l[1]*l[1]-a*a);if(h<0)return[];var d=(-c+Math.sqrt(h))/(2*u),p=(-c-Math.sqrt(h))/(2*u),g=Math.min(d,p),f=Math.max(d,p),v=[];if(g>=0&&g<=1&&v.push(g),f>=0&&f<=1&&v.push(f),0===v.length)return[];var y=v[0]*s[0]+e,m=v[0]*s[1]+t;return v.length>1?v[0]==v[1]?[y,m]:[y,m,v[1]*s[0]+e,v[1]*s[1]+t]:[y,m]},En=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},bn=function(e,t,n,r,i,o,a,s,l){var u=e-i,c=n-e,h=a-i,d=t-o,p=r-t,g=s-o,f=h*d-g*u,v=c*d-p*u,y=g*c-h*p;if(0!==y){var m=f/y,E=v/y,b=-.001;return b<=m&&m<=1.001&&b<=E&&E<=1.001||l?[e+m*c,t+m*p]:[]}return 0===f||0===v?En(e,n,a)===a?[a,s]:En(e,n,i)===i?[i,o]:En(i,a,n)===n?[n,r]:[]:[]},wn=function(e,t,n,r,i,o,a,s){var l,u,c,h,d,p,g=[],f=new Array(n.length),v=!0;if(null==o&&(v=!1),v){for(var y=0;y<f.length/2;y++)f[2*y]=n[2*y]*o+r,f[2*y+1]=n[2*y+1]*a+i;if(s>0){var m=vn(f,-s);u=fn(m)}else u=f}else u=n;for(var E=0;E<u.length/2;E++)c=u[2*E],h=u[2*E+1],E<u.length/2-1?(d=u[2*(E+1)],p=u[2*(E+1)+1]):(d=u[0],p=u[1]),0!==(l=bn(e,t,r,i,c,h,d,p)).length&&g.push(l[0],l[1]);return g},_n=function(e,t,n){var r=[e[0]-t[0],e[1]-t[1]],i=Math.sqrt(r[0]*r[0]+r[1]*r[1]),o=(i-n)/i;return o<0&&(o=1e-5),[t[0]+o*r[0],t[1]+o*r[1]]},xn=function(e,t){var n=Cn(e,t);return n=Tn(n)},Tn=function(e){for(var t,n,r=e.length/2,i=1/0,o=1/0,a=-1/0,s=-1/0,l=0;l<r;l++)t=e[2*l],n=e[2*l+1],i=Math.min(i,t),a=Math.max(a,t),o=Math.min(o,n),s=Math.max(s,n);for(var u=2/(a-i),c=2/(s-o),h=0;h<r;h++)t=e[2*h]=e[2*h]*u,n=e[2*h+1]=e[2*h+1]*c,i=Math.min(i,t),a=Math.max(a,t),o=Math.min(o,n),s=Math.max(s,n);if(o<-1)for(var d=0;d<r;d++)n=e[2*d+1]=e[2*d+1]+(-1-o);return e},Cn=function(e,t){var n=1/e*2*Math.PI,r=e%2==0?Math.PI/2+n/2:Math.PI/2;r+=t;for(var i,o=new Array(2*e),a=0;a<e;a++)i=a*n+r,o[2*a]=Math.cos(i),o[2*a+1]=Math.sin(-i);return o},Nn=function(e,t){return Math.min(e/4,t/4,8)},An=function(e,t){return Math.min(e/10,t/10,8)},In=function(e,t){return{heightOffset:Math.min(15,.05*t),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},On=ut({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),Sn={pageRank:function(e){for(var t=On(e),n=t.dampingFactor,r=t.precision,i=t.iterations,o=t.weight,a=this._private.cy,s=this.byGroup(),l=s.nodes,u=s.edges,c=l.length,h=c*c,d=u.length,p=new Array(h),g=new Array(c),f=(1-n)/c,v=0;v<c;v++){for(var y=0;y<c;y++){p[v*c+y]=0}g[v]=0}for(var m=0;m<d;m++){var E=u[m],b=E.data("source"),w=E.data("target");if(b!==w){var _=l.indexOfId(b),x=l.indexOfId(w),T=o(E);p[x*c+_]+=T,g[_]+=T}}for(var C=1/c+f,N=0;N<c;N++)if(0===g[N])for(var A=0;A<c;A++){p[A*c+N]=C}else for(var I=0;I<c;I++){var O=I*c+N;p[O]=p[O]/g[N]+f}for(var S,L=new Array(c),P=new Array(c),R=0;R<c;R++)L[R]=1;for(var D=0;D<i;D++){for(var M=0;M<c;M++)P[M]=0;for(var k=0;k<c;k++)for(var F=0;F<c;F++){var B=k*c+F;P[k]+=p[B]*L[F]}Xt(P),S=L,L=P,P=S;for(var G=0,$=0;$<c;$++){var V=S[$]-L[$];G+=V*V}if(G<r)break}return{rank:function(e){return e=a.collection(e)[0],L[l.indexOf(e)]}}}},Ln=ut({root:null,weight:function(e){return 1},directed:!1,alpha:0}),Pn={degreeCentralityNormalized:function(e){e=Ln(e);var t=this.cy(),n=this.nodes(),r=n.length;if(e.directed){for(var i={},o={},a=0,s=0,l=0;l<r;l++){var u=n[l],c=u.id();e.root=u;var h=this.degreeCentrality(e);a<h.indegree&&(a=h.indegree),s<h.outdegree&&(s=h.outdegree),i[c]=h.indegree,o[c]=h.outdegree}return{indegree:function(e){return 0==a?0:(X(e)&&(e=t.filter(e)),i[e.id()]/a)},outdegree:function(e){return 0===s?0:(X(e)&&(e=t.filter(e)),o[e.id()]/s)}}}for(var d={},p=0,g=0;g<r;g++){var f=n[g];e.root=f;var v=this.degreeCentrality(e);p<v.degree&&(p=v.degree),d[f.id()]=v.degree}return{degree:function(e){return 0===p?0:(X(e)&&(e=t.filter(e)),d[e.id()]/p)}}},degreeCentrality:function(e){e=Ln(e);var t=this.cy(),n=this,r=e,i=r.root,o=r.weight,a=r.directed,s=r.alpha;if(i=t.collection(i)[0],a){for(var l=i.connectedEdges(),u=l.filter((function(e){return e.target().same(i)&&n.has(e)})),c=l.filter((function(e){return e.source().same(i)&&n.has(e)})),h=u.length,d=c.length,p=0,g=0,f=0;f<u.length;f++)p+=o(u[f]);for(var v=0;v<c.length;v++)g+=o(c[v]);return{indegree:Math.pow(h,1-s)*Math.pow(p,s),outdegree:Math.pow(d,1-s)*Math.pow(g,s)}}for(var y=i.connectedEdges().intersection(n),m=y.length,E=0,b=0;b<y.length;b++)E+=o(y[b]);return{degree:Math.pow(m,1-s)*Math.pow(E,s)}}};Pn.dc=Pn.degreeCentrality,Pn.dcn=Pn.degreeCentralityNormalised=Pn.degreeCentralityNormalized;var Rn=ut({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Dn={closenessCentralityNormalized:function(e){for(var t=Rn(e),n=t.harmonic,r=t.weight,i=t.directed,o=this.cy(),a={},s=0,l=this.nodes(),u=this.floydWarshall({weight:r,directed:i}),c=0;c<l.length;c++){for(var h=0,d=l[c],p=0;p<l.length;p++)if(c!==p){var g=u.distance(d,l[p]);h+=n?1/g:g}n||(h=1/h),s<h&&(s=h),a[d.id()]=h}return{closeness:function(e){return 0==s?0:(e=X(e)?o.filter(e)[0].id():e.id(),a[e]/s)}}},closenessCentrality:function(e){var t=Rn(e),n=t.root,r=t.weight,i=t.directed,o=t.harmonic;n=this.filter(n)[0];for(var a=this.dijkstra({root:n,weight:r,directed:i}),s=0,l=this.nodes(),u=0;u<l.length;u++){var c=l[u];if(!c.same(n)){var h=a.distanceTo(c);s+=o?1/h:h}}return o?s:1/s}};Dn.cc=Dn.closenessCentrality,Dn.ccn=Dn.closenessCentralityNormalised=Dn.closenessCentralityNormalized;var Mn=ut({weight:null,directed:!1}),kn={betweennessCentrality:function(e){for(var t=Mn(e),n=t.directed,r=t.weight,i=null!=r,o=this.cy(),a=this.nodes(),s={},l={},u=0,c=function(e,t){l[e]=t,t>u&&(u=t)},h=function(e){return l[e]},d=0;d<a.length;d++){var p=a[d],g=p.id();s[g]=n?p.outgoers().nodes():p.openNeighborhood().nodes(),c(g,0)}for(var f=function(){for(var e=a[v].id(),t=[],n={},l={},u={},d=new Nt((function(e,t){return u[e]-u[t]})),p=0;p<a.length;p++){var g=a[p].id();n[g]=[],l[g]=0,u[g]=1/0}for(l[e]=1,u[e]=0,d.push(e);!d.empty();){var f=d.pop();if(t.push(f),i)for(var y=0;y<s[f].length;y++){var m=s[f][y],E=o.getElementById(f),b=void 0;b=E.edgesTo(m).length>0?E.edgesTo(m)[0]:m.edgesTo(E)[0];var w=r(b);m=m.id(),u[m]>u[f]+w&&(u[m]=u[f]+w,d.nodes.indexOf(m)<0?d.push(m):d.updateItem(m),l[m]=0,n[m]=[]),u[m]==u[f]+w&&(l[m]=l[m]+l[f],n[m].push(f))}else for(var _=0;_<s[f].length;_++){var x=s[f][_].id();u[x]==1/0&&(d.push(x),u[x]=u[f]+1),u[x]==u[f]+1&&(l[x]=l[x]+l[f],n[x].push(f))}}for(var T={},C=0;C<a.length;C++)T[a[C].id()]=0;for(;t.length>0;){for(var N=t.pop(),A=0;A<n[N].length;A++){var I=n[N][A];T[I]=T[I]+l[I]/l[N]*(1+T[N])}N!=a[v].id()&&c(N,h(N)+T[N])}},v=0;v<a.length;v++)f();var y={betweenness:function(e){var t=o.collection(e).id();return h(t)},betweennessNormalized:function(e){if(0==u)return 0;var t=o.collection(e).id();return h(t)/u}};return y.betweennessNormalised=y.betweennessNormalized,y}};kn.bc=kn.betweennessCentrality;var Fn=ut({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(e){return 1}]}),Bn=function(e,t){for(var n=0,r=0;r<t.length;r++)n+=t[r](e);return n},Gn=function(e,t){for(var n,r=0;r<t;r++){n=0;for(var i=0;i<t;i++)n+=e[i*t+r];for(var o=0;o<t;o++)e[o*t+r]=e[o*t+r]/n}},$n=function(e,t,n){for(var r=new Array(n*n),i=0;i<n;i++){for(var o=0;o<n;o++)r[i*n+o]=0;for(var a=0;a<n;a++)for(var s=0;s<n;s++)r[i*n+s]+=e[i*n+a]*t[a*n+s]}return r},Vn=function(e,t,n){for(var r=e.slice(0),i=1;i<n;i++)e=$n(e,r,t);return e},zn=function(e,t,n){for(var r=new Array(t*t),i=0;i<t*t;i++)r[i]=Math.pow(e[i],n);return Gn(r,t),r},Un=function(e,t,n,r){for(var i=0;i<n;i++){if(Math.round(e[i]*Math.pow(10,r))/Math.pow(10,r)!==Math.round(t[i]*Math.pow(10,r))/Math.pow(10,r))return!1}return!0},qn=function(e,t){for(var n=0;n<e.length;n++)if(!t[n]||e[n].id()!==t[n].id())return!1;return!0},Hn=function(e){for(var t=this.nodes(),n=this.edges(),r=this.cy(),i=function(e){return Fn(e)}(e),o={},a=0;a<t.length;a++)o[t[a].id()]=a;for(var s,l=t.length,u=l*l,c=new Array(u),h=0;h<u;h++)c[h]=0;for(var d=0;d<n.length;d++){var p=n[d],g=o[p.source().id()],f=o[p.target().id()],v=Bn(p,i.attributes);c[g*l+f]+=v,c[f*l+g]+=v}!function(e,t,n){for(var r=0;r<t;r++)e[r*t+r]=n}(c,l,i.multFactor),Gn(c,l);for(var y=!0,m=0;y&&m<i.maxIterations;)y=!1,s=Vn(c,l,i.expandFactor),c=zn(s,l,i.inflateFactor),Un(c,s,u,4)||(y=!0),m++;var E=function(e,t,n,r){for(var i=[],o=0;o<t;o++){for(var a=[],s=0;s<t;s++)Math.round(1e3*e[o*t+s])/1e3>0&&a.push(n[s]);0!==a.length&&i.push(r.collection(a))}return i}(c,l,t,r);return E=function(e){for(var t=0;t<e.length;t++)for(var n=0;n<e.length;n++)t!=n&&qn(e[t],e[n])&&e.splice(n,1);return e}(E),E},jn={markovClustering:Hn,mcl:Hn},Yn=function(e){return e},Xn=function(e,t){return Math.abs(t-e)},Wn=function(e,t,n){return e+Xn(t,n)},Qn=function(e,t,n){return e+Math.pow(n-t,2)},Zn=function(e){return Math.sqrt(e)},Jn=function(e,t,n){return Math.max(e,Xn(t,n))},Kn=function(e,t,n,r,i){for(var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Yn,a=r,s=0;s<e;s++)a=i(a,t(s),n(s));return o(a)},er={euclidean:function(e,t,n){return e>=2?Kn(e,t,n,0,Qn,Zn):Kn(e,t,n,0,Wn)},squaredEuclidean:function(e,t,n){return Kn(e,t,n,0,Qn)},manhattan:function(e,t,n){return Kn(e,t,n,0,Wn)},max:function(e,t,n){return Kn(e,t,n,-1/0,Jn)}};function tr(e,t,n,r,i,o){var a;return a=W(e)?e:er[e]||er.euclidean,0===t&&W(e)?a(i,o):a(t,n,r,i,o)}er["squared-euclidean"]=er.squaredEuclidean,er.squaredeuclidean=er.squaredEuclidean;var nr=ut({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),rr=function(e){return nr(e)},ir=function(e,t,n,r,i){var o="kMedoids"!==i?function(e){return n[e]}:function(e){return r[e](n)},a=n,s=t;return tr(e,r.length,o,(function(e){return r[e](t)}),a,s)},or=function(e,t,n){for(var r=n.length,i=new Array(r),o=new Array(r),a=new Array(t),s=null,l=0;l<r;l++)i[l]=e.min(n[l]).value,o[l]=e.max(n[l]).value;for(var u=0;u<t;u++){s=[];for(var c=0;c<r;c++)s[c]=Math.random()*(o[c]-i[c])+i[c];a[u]=s}return a},ar=function(e,t,n,r,i){for(var o=1/0,a=0,s=0;s<t.length;s++){var l=ir(n,e,t[s],r,i);l<o&&(o=l,a=s)}return a},sr=function(e,t,n){for(var r=[],i=null,o=0;o<t.length;o++)n[(i=t[o]).id()]===e&&r.push(i);return r},lr=function(e,t,n){return Math.abs(t-e)<=n},ur=function(e,t,n){for(var r=0;r<e.length;r++)for(var i=0;i<e[r].length;i++){if(Math.abs(e[r][i]-t[r][i])>n)return!1}return!0},cr=function(e,t,n){for(var r=0;r<n;r++)if(e===t[r])return!0;return!1},hr=function(e,t){var n=new Array(t);if(e.length<50)for(var r=0;r<t;r++){for(var i=e[Math.floor(Math.random()*e.length)];cr(i,n,r);)i=e[Math.floor(Math.random()*e.length)];n[r]=i}else for(var o=0;o<t;o++)n[o]=e[Math.floor(Math.random()*e.length)];return n},dr=function(e,t,n){for(var r=0,i=0;i<t.length;i++)r+=ir("manhattan",t[i],e,n,"kMedoids");return r},pr=function(e,t,n,r,i){for(var o,a,s=0;s<t.length;s++)for(var l=0;l<e.length;l++)r[s][l]=Math.pow(n[s][l],i.m);for(var u=0;u<e.length;u++)for(var c=0;c<i.attributes.length;c++){o=0,a=0;for(var h=0;h<t.length;h++)o+=r[h][u]*i.attributes[c](t[h]),a+=r[h][u];e[u][c]=o/a}},gr=function(e,t,n,r,i){for(var o=0;o<e.length;o++)t[o]=e[o].slice();for(var a,s,l,u=2/(i.m-1),c=0;c<n.length;c++)for(var h=0;h<r.length;h++){a=0;for(var d=0;d<n.length;d++)s=ir(i.distance,r[h],n[c],i.attributes,"cmeans"),l=ir(i.distance,r[h],n[d],i.attributes,"cmeans"),a+=Math.pow(s/l,u);e[h][c]=1/a}},fr=function(e){var t,n,r,i,o,a=this.cy(),s=this.nodes(),l=rr(e);i=new Array(s.length);for(var u=0;u<s.length;u++)i[u]=new Array(l.k);r=new Array(s.length);for(var c=0;c<s.length;c++)r[c]=new Array(l.k);for(var h=0;h<s.length;h++){for(var d=0,p=0;p<l.k;p++)r[h][p]=Math.random(),d+=r[h][p];for(var g=0;g<l.k;g++)r[h][g]=r[h][g]/d}n=new Array(l.k);for(var f=0;f<l.k;f++)n[f]=new Array(l.attributes.length);o=new Array(s.length);for(var v=0;v<s.length;v++)o[v]=new Array(l.k);for(var y=!0,m=0;y&&m<l.maxIterations;)y=!1,pr(n,s,r,o,l),gr(r,i,n,s,l),ur(r,i,l.sensitivityThreshold)||(y=!0),m++;return t=function(e,t,n,r){for(var i,o,a=new Array(n.k),s=0;s<a.length;s++)a[s]=[];for(var l=0;l<t.length;l++){i=-1/0,o=-1;for(var u=0;u<t[0].length;u++)t[l][u]>i&&(i=t[l][u],o=u);a[o].push(e[l])}for(var c=0;c<a.length;c++)a[c]=r.collection(a[c]);return a}(s,r,l,a),{clusters:t,degreeOfMembership