@nocobase/app 1.3.38-beta → 1.4.0-alpha
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/client/.umirc.ts +12 -14
- package/client/src/pages/index.tsx +3 -0
- package/dist/client/4607.bae81918.async.js +1 -0
- package/dist/client/5617.d114c98c.async.js +78 -0
- package/dist/client/5721.ee2b0cf3.async.js +7 -0
- package/dist/client/index.html +2 -1
- package/dist/client/index.html.tpl +2 -1
- package/dist/client/npm._at_ant-design.e1f1f4b0.async.js +110 -0
- package/dist/client/{npm._at_antv.5ea2df50.async.js → npm._at_antv.56fcebdf.async.js} +5 -5
- package/dist/client/npm._at_budibase.113c5b6a.async.js +36 -0
- package/dist/client/npm._at_dnd-kit.2fac5dde.async.js +9 -0
- package/dist/client/npm._at_emotion.6969cd50.async.js +2 -0
- package/dist/client/npm._at_formily.b1a03e41.async.js +96 -0
- package/dist/client/npm._at_formulajs.ff63776b.async.js +1 -0
- package/dist/client/npm._at_rc-component.43f95f42.async.js +5 -0
- package/dist/client/npm._at_remix-run.9a0418a9.async.js +2 -0
- package/dist/client/npm.ahooks.b416801a.async.js +6 -0
- package/dist/client/npm.antd-style.ecb45bdd.async.js +1 -0
- package/dist/client/npm.antd.732d7b9d.async.js +476 -0
- package/dist/client/npm.axios.c42e25ff.async.js +11 -0
- package/dist/client/npm.bignumber.js.cb49cd48.async.js +1 -0
- package/dist/client/npm.buffer.6f3eca94.async.js +1 -0
- package/dist/client/npm.cytoscape.cba0c14d.async.js +5 -0
- package/dist/client/{npm.d3-selection.e2684be8.async.js → npm.d3-selection.15d6ab5b.async.js} +1 -1
- package/dist/client/npm.d3-shape.b48fc404.async.js +1 -0
- package/dist/client/{npm.d3-transition.83e0f431.async.js → npm.d3-transition.5fd82a9c.async.js} +1 -1
- package/dist/client/{npm.dayjs.f4357565.async.js → npm.dayjs.0a5fd152.async.js} +1 -1
- package/dist/client/{npm.decimal.js.bb6d6d2e.async.js → npm.decimal.js.19391b1c.async.js} +1 -1
- package/dist/client/npm.dompurify.d5071c22.async.js +3 -0
- package/dist/client/{npm.elkjs.d0ff4db1.async.js → npm.elkjs.f35a7d45.async.js} +4 -4
- package/dist/client/npm.gl-matrix.d851d654.async.js +1 -0
- package/dist/client/{npm.handlebars.c04806e7.async.js → npm.handlebars.ade4c4fe.async.js} +5 -5
- package/dist/client/{npm.highlight.js.4213abe5.async.js → npm.highlight.js.8a8320c8.async.js} +1 -1
- package/dist/client/{npm.html-tokenize.360bb6e8.async.js → npm.html-tokenize.a6d58ae7.async.js} +1 -1
- package/dist/client/npm.htmlparser2.27ad86bc.async.js +2 -0
- package/dist/client/npm.i18next.98bb572b.async.js +1 -0
- package/dist/client/npm.json5.d58066fd.async.js +14 -0
- package/dist/client/npm.jstat.733c0b2c.async.js +1 -0
- package/dist/client/{npm.layout-base.49e322a0.async.js → npm.layout-base.0bdb6d00.async.js} +1 -1
- package/dist/client/npm.lodash-es.c06b3dd5.async.js +1 -0
- package/dist/client/npm.lodash.0ff318b3.async.js +37 -0
- package/dist/client/npm.markdown-it.5b35f93d.async.js +15 -0
- package/dist/client/npm.mathjs.fd97f3b7.async.js +52 -0
- package/dist/client/npm.mermaid.defd0c88.async.js +1529 -0
- package/dist/client/npm.moment.36abbf2c.async.js +4 -0
- package/dist/client/npm.picomatch.7a2f1314.async.js +1 -0
- package/dist/client/npm.postcss.2ccf11ae.async.js +27 -0
- package/dist/client/{npm.quill.e91b3c12.async.js → npm.quill.9d4c2cd1.async.js} +7 -7
- package/dist/client/{npm.rc-menu.2e06b9c3.async.js → npm.rc-menu.adf5ade6.async.js} +1 -1
- package/dist/client/npm.rc-picker.ef8a3e8b.async.js +1 -0
- package/dist/client/{npm.rc-select.13236fb8.async.js → npm.rc-select.7c36e54e.async.js} +2 -2
- package/dist/client/{npm.rc-table.de3dd762.async.js → npm.rc-table.a153e021.async.js} +1 -1
- package/dist/client/npm.rc-tree.f61b7d87.async.js +1 -0
- package/dist/client/npm.rc-util.23a9b855.async.js +18 -0
- package/dist/client/npm.react-dom.b9fb5fd7.async.js +11 -0
- package/dist/client/npm.react-image-lightbox.727d3218.async.js +3 -0
- package/dist/client/npm.react-router-dom.832efba3.async.js +1 -0
- package/dist/client/npm.readable-stream.6e743f2a.async.js +1 -0
- package/dist/client/p__index.89314c11.async.js +1533 -0
- package/dist/client/umi.9e319d79.js +21 -0
- package/lib/index.js +11 -3
- package/package.json +6 -6
- package/src/index.ts +12 -9
- package/dist/client/4607.6d585996.async.js +0 -1
- package/dist/client/5721.cf90e884.async.js +0 -8
- package/dist/client/6718.1e7fe05d.async.js +0 -66
- package/dist/client/npm._at_ant-design.4fe52a2f.async.js +0 -110
- package/dist/client/npm._at_dnd-kit.01a3ad70.async.js +0 -6
- package/dist/client/npm._at_emotion.0c6b11eb.async.js +0 -2
- package/dist/client/npm._at_formily.f9d0b213.async.js +0 -101
- package/dist/client/npm._at_formulajs.fe3f9fca.async.js +0 -1
- package/dist/client/npm._at_rc-component.086dbf23.async.js +0 -5
- package/dist/client/npm._at_remix-run.55137b87.async.js +0 -3
- package/dist/client/npm.ahooks.c3df4eb6.async.js +0 -6
- package/dist/client/npm.antd-style.47ebbe31.async.js +0 -1
- package/dist/client/npm.antd.91188318.async.js +0 -476
- package/dist/client/npm.axios.f696c6e5.async.js +0 -2
- package/dist/client/npm.bignumber.js.70d3d7e8.async.js +0 -1
- package/dist/client/npm.buffer.9cce4593.async.js +0 -1
- package/dist/client/npm.cytoscape.39239e7b.async.js +0 -5
- package/dist/client/npm.d3-shape.3660138b.async.js +0 -1
- package/dist/client/npm.dompurify.93b5a130.async.js +0 -3
- package/dist/client/npm.gl-matrix.31b80e16.async.js +0 -1
- package/dist/client/npm.htmlparser2.cbbea4c4.async.js +0 -2
- package/dist/client/npm.i18next.eee0fc0f.async.js +0 -1
- package/dist/client/npm.json5.87aca70f.async.js +0 -14
- package/dist/client/npm.jstat.657c7dba.async.js +0 -1
- package/dist/client/npm.lodash-es.5eff0420.async.js +0 -1
- package/dist/client/npm.lodash.0f9322fa.async.js +0 -37
- package/dist/client/npm.markdown-it.5875530c.async.js +0 -15
- package/dist/client/npm.mathjs.d8df2940.async.js +0 -53
- package/dist/client/npm.mermaid.7057e144.async.js +0 -1530
- package/dist/client/npm.moment.3c26e672.async.js +0 -4
- package/dist/client/npm.postcss.368fceaf.async.js +0 -28
- package/dist/client/npm.rc-picker.218fa2cc.async.js +0 -1
- package/dist/client/npm.rc-tree.bdb9cee8.async.js +0 -1
- package/dist/client/npm.rc-util.87a2c212.async.js +0 -18
- package/dist/client/npm.react-dom.6236e62b.async.js +0 -11
- package/dist/client/npm.react-image-lightbox.0e0cf81f.async.js +0 -3
- package/dist/client/npm.react-router-dom.06c80c5d.async.js +0 -2
- package/dist/client/npm.readable-stream.41117b5f.async.js +0 -1
- package/dist/client/p__index.4c7bade9.async.js +0 -1509
- package/dist/client/umi.016284ce.js +0 -22
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
(self.webpackChunknocobase=self.webpackChunknocobase||[]).push([[8329],{71377:function(su,Qg,fi){(function(qe,Nt){su.exports=Nt()})(this,function(){"use strict";function qe(r){"@babel/helpers - typeof";return qe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qe(r)}function Nt(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function ci(r,e){for(var t=0;t<e.length;t++){var a=e[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}function mn(r,e,t){return e&&ci(r.prototype,e),t&&ci(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}function di(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function gr(r,e){return uu(r)||lu(r,e)||vu(r,e)||fu()}function uu(r){if(Array.isArray(r))return r}function lu(r,e){var t=r==null?null:typeof Symbol!="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var a=[],n=!0,i=!1,o,s;try{for(t=t.call(r);!(n=(o=t.next()).done)&&(a.push(o.value),!(e&&a.length===e));n=!0);}catch(l){i=!0,s=l}finally{try{!n&&t.return!=null&&t.return()}finally{if(i)throw s}}return a}}function vu(r,e){if(r){if(typeof r=="string")return hi(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return hi(r,e)}}function hi(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,a=new Array(e);t<e;t++)a[t]=r[t];return a}function fu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var $e=typeof window=="undefined"?null:window,gi=$e?$e.navigator:null;$e&&$e.document;var cu=qe(""),pi=qe({}),du=qe(function(){}),hu=typeof HTMLElement=="undefined"?"undefined":qe(HTMLElement),Ft=function(e){return e&&e.instanceString&&ze(e.instanceString)?e.instanceString():null},ve=function(e){return e!=null&&qe(e)==cu},ze=function(e){return e!=null&&qe(e)===du},Ae=function(e){return!vr(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Ce=function(e){return e!=null&&qe(e)===pi&&!Ae(e)&&e.constructor===Object},gu=function(e){return e!=null&&qe(e)===pi},ae=function(e){return e!=null&&qe(e)===qe(1)&&!isNaN(e)},pu=function(e){return ae(e)&&Math.floor(e)===e},ba=function(e){if(hu!=="undefined")return e!=null&&e instanceof HTMLElement},vr=function(e){return Vt(e)||mi(e)},Vt=function(e){return Ft(e)==="collection"&&e._private.single},mi=function(e){return Ft(e)==="collection"&&!e._private.single},yn=function(e){return Ft(e)==="core"},yi=function(e){return Ft(e)==="stylesheet"},mu=function(e){return Ft(e)==="event"},Ir=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},yu=function(e){return typeof HTMLElement=="undefined"?!1:e instanceof HTMLElement},bu=function(e){return Ce(e)&&ae(e.x1)&&ae(e.x2)&&ae(e.y1)&&ae(e.y2)},wu=function(e){return gu(e)&&ze(e.then)},xu=function(){return gi&&gi.userAgent.match(/msie|trident|edge/i)},qt=function(e,t){t||(t=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);return i.join("$")});var a=function n(){var i=this,o=arguments,s,l=t.apply(i,o),u=n.cache;return(s=u[l])||(s=u[l]=e.apply(i,o)),s};return a.cache={},a},bn=qt(function(r){return r.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),wa=qt(function(r){return r.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),bi=qt(function(r,e){return r+e[0].toUpperCase()+e.substring(1)},function(r,e){return r+"$"+e}),wi=function(e){return Ir(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},He="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",Eu="rgb[a]?\\(("+He+"[%]?)\\s*,\\s*("+He+"[%]?)\\s*,\\s*("+He+"[%]?)(?:\\s*,\\s*("+He+"))?\\)",Cu="rgb[a]?\\((?:"+He+"[%]?)\\s*,\\s*(?:"+He+"[%]?)\\s*,\\s*(?:"+He+"[%]?)(?:\\s*,\\s*(?:"+He+"))?\\)",Su="hsl[a]?\\(("+He+")\\s*,\\s*("+He+"[%])\\s*,\\s*("+He+"[%])(?:\\s*,\\s*("+He+"))?\\)",Tu="hsl[a]?\\((?:"+He+")\\s*,\\s*(?:"+He+"[%])\\s*,\\s*(?:"+He+"[%])(?:\\s*,\\s*(?:"+He+"))?\\)",Du="\\#[0-9a-fA-F]{3}",ku="\\#[0-9a-fA-F]{6}",xi=function(e,t){return e<t?-1:e>t?1:0},Pu=function(e,t){return-1*xi(e,t)},de=Object.assign!=null?Object.assign.bind(Object):function(r){for(var e=arguments,t=1;t<e.length;t++){var a=e[t];if(a!=null)for(var n=Object.keys(a),i=0;i<n.length;i++){var o=n[i];r[o]=a[o]}}return r},Bu=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var t=e.length===4,a,n,i,o=16;return t?(a=parseInt(e[1]+e[1],o),n=parseInt(e[2]+e[2],o),i=parseInt(e[3]+e[3],o)):(a=parseInt(e[1]+e[2],o),n=parseInt(e[3]+e[4],o),i=parseInt(e[5]+e[6],o)),[a,n,i]}},Lu=function(e){var t,a,n,i,o,s,l,u;function v(d,m,p){return p<0&&(p+=1),p>1&&(p-=1),p<1/6?d+(m-d)*6*p:p<1/2?m:p<2/3?d+(m-d)*(2/3-p)*6:d}var f=new RegExp("^"+Su+"$").exec(e);if(f){if(a=parseInt(f[1]),a<0?a=(360- -1*a%360)%360:a>360&&(a=a%360),a/=360,n=parseFloat(f[2]),n<0||n>100||(n=n/100,i=parseFloat(f[3]),i<0||i>100)||(i=i/100,o=f[4],o!==void 0&&(o=parseFloat(o),o<0||o>1)))return;if(n===0)s=l=u=Math.round(i*255);else{var c=i<.5?i*(1+n):i+n-i*n,h=2*i-c;s=Math.round(255*v(h,c,a+1/3)),l=Math.round(255*v(h,c,a)),u=Math.round(255*v(h,c,a-1/3))}t=[s,l,u,o]}return t},Mu=function(e){var t,a=new RegExp("^"+Eu+"$").exec(e);if(a){t=[];for(var n=[],i=1;i<=3;i++){var o=a[i];if(o[o.length-1]==="%"&&(n[i]=!0),o=parseFloat(o),n[i]&&(o=o/100*255),o<0||o>255)return;t.push(Math.floor(o))}var s=n[1]||n[2]||n[3],l=n[1]&&n[2]&&n[3];if(s&&!l)return;var u=a[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;t.push(u)}}return t},Au=function(e){return Ou[e.toLowerCase()]},Ru=function(e){return(Ae(e)?e:null)||Au(e)||Bu(e)||Mu(e)||Lu(e)},Ou={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]},Ei=function(e){for(var t=e.map,a=e.keys,n=a.length,i=0;i<n;i++){var o=a[i];if(Ce(o))throw Error("Tried to set map with object key");i<a.length-1?(t[o]==null&&(t[o]={}),t=t[o]):t[o]=e.value}},Ci=function(e){for(var t=e.map,a=e.keys,n=a.length,i=0;i<n;i++){var o=a[i];if(Ce(o))throw Error("Tried to get map with object key");if(t=t[o],t==null)return t}return t};function Iu(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var Zr=Iu,$t=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof fi.g!="undefined"?fi.g:typeof self!="undefined"?self:{};function zu(r,e){return e={exports:{}},r(e,e.exports),e.exports}var Nu=typeof $t=="object"&&$t&&$t.Object===Object&&$t,Fu=Nu,Vu=typeof self=="object"&&self&&self.Object===Object&&self,qu=Fu||Vu||Function("return this")(),xa=qu,$u=function(){return xa.Date.now()},wn=$u,Hu=/\s/;function Wu(r){for(var e=r.length;e--&&Hu.test(r.charAt(e)););return e}var Gu=Wu,Ku=/^\s+/;function Yu(r){return r&&r.slice(0,Gu(r)+1).replace(Ku,"")}var Xu=Yu,Uu=xa.Symbol,lt=Uu,Si=Object.prototype,Zu=Si.hasOwnProperty,Qu=Si.toString,Ht=lt?lt.toStringTag:void 0;function _u(r){var e=Zu.call(r,Ht),t=r[Ht];try{r[Ht]=void 0;var a=!0}catch(i){}var n=Qu.call(r);return a&&(e?r[Ht]=t:delete r[Ht]),n}var Ju=_u,ju=Object.prototype,el=ju.toString;function rl(r){return el.call(r)}var tl=rl,al="[object Null]",nl="[object Undefined]",Ti=lt?lt.toStringTag:void 0;function il(r){return r==null?r===void 0?nl:al:Ti&&Ti in Object(r)?Ju(r):tl(r)}var Di=il;function ol(r){return r!=null&&typeof r=="object"}var sl=ol,ul="[object Symbol]";function ll(r){return typeof r=="symbol"||sl(r)&&Di(r)==ul}var Wt=ll,ki=0/0,vl=/^[-+]0x[0-9a-f]+$/i,fl=/^0b[01]+$/i,cl=/^0o[0-7]+$/i,dl=parseInt;function hl(r){if(typeof r=="number")return r;if(Wt(r))return ki;if(Zr(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=Zr(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=Xu(r);var t=fl.test(r);return t||cl.test(r)?dl(r.slice(2),t?2:8):vl.test(r)?ki:+r}var Pi=hl,gl="Expected a function",pl=Math.max,ml=Math.min;function yl(r,e,t){var a,n,i,o,s,l,u=0,v=!1,f=!1,c=!0;if(typeof r!="function")throw new TypeError(gl);e=Pi(e)||0,Zr(t)&&(v=!!t.leading,f="maxWait"in t,i=f?pl(Pi(t.maxWait)||0,e):i,c="trailing"in t?!!t.trailing:c);function h(C){var x=a,k=n;return a=n=void 0,u=C,o=r.apply(k,x),o}function d(C){return u=C,s=setTimeout(g,e),v?h(C):o}function m(C){var x=C-l,k=C-u,E=e-x;return f?ml(E,i-k):E}function p(C){var x=C-l,k=C-u;return l===void 0||x>=e||x<0||f&&k>=i}function g(){var C=wn();if(p(C))return y(C);s=setTimeout(g,m(C))}function y(C){return s=void 0,c&&a?h(C):(a=n=void 0,o)}function b(){s!==void 0&&clearTimeout(s),u=0,a=l=n=s=void 0}function w(){return s===void 0?o:y(wn())}function D(){var C=wn(),x=p(C);if(a=arguments,n=this,l=C,x){if(s===void 0)return d(l);if(f)return clearTimeout(s),s=setTimeout(g,e),h(l)}return s===void 0&&(s=setTimeout(g,e)),o}return D.cancel=b,D.flush=w,D}var Ea=yl,xn=$e?$e.performance:null,Bi=xn&&xn.now?function(){return xn.now()}:function(){return Date.now()},bl=function(){if($e){if($e.requestAnimationFrame)return function(r){$e.requestAnimationFrame(r)};if($e.mozRequestAnimationFrame)return function(r){$e.mozRequestAnimationFrame(r)};if($e.webkitRequestAnimationFrame)return function(r){$e.webkitRequestAnimationFrame(r)};if($e.msRequestAnimationFrame)return function(r){$e.msRequestAnimationFrame(r)}}return function(r){r&&setTimeout(function(){r(Bi())},1e3/60)}}(),Ca=function(e){return bl(e)},Br=Bi,vt=9261,Li=65599,Gt=5381,Mi=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:vt,a=t,n;n=e.next(),!n.done;)a=a*Li+n.value|0;return a},Kt=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:vt;return t*Li+e|0},Yt=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Gt;return(t<<5)+t+e|0},wl=function(e,t){return e*2097152+t},zr=function(e){return e[0]*2097152+e[1]},Sa=function(e,t){return[Kt(e[0],t[0]),Yt(e[1],t[1])]},xl=function(e,t){var a={value:0,done:!1},n=0,i=e.length,o={next:function(){return n<i?a.value=e[n++]:a.done=!0,a}};return Mi(o,t)},Qr=function(e,t){var a={value:0,done:!1},n=0,i=e.length,o={next:function(){return n<i?a.value=e.charCodeAt(n++):a.done=!0,a}};return Mi(o,t)},Ai=function(){return El(arguments)},El=function(e){for(var t,a=0;a<e.length;a++){var n=e[a];a===0?t=Qr(n):t=Qr(n,t)}return t},Ri=!0,Cl=console.warn!=null,Sl=console.trace!=null,En=Number.MAX_SAFE_INTEGER||9007199254740991,Oi=function(){return!0},Ta=function(){return!1},Ii=function(){return 0},Cn=function(){},Ne=function(e){throw new Error(e)},zi=function(e){if(e!==void 0)Ri=!!e;else return Ri},Be=function(e){zi()&&(Cl?console.warn(e):(console.log(e),Sl&&console.trace()))},Tl=function(e){return de({},e)},Cr=function(e){return e==null?e:Ae(e)?e.slice():Ce(e)?Tl(e):e},Dl=function(e){return e.slice()},Ni=function(e,t){for(t=e="";e++<36;t+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return t},kl={},Fi=function(){return kl},Ke=function(e){var t=Object.keys(e);return function(a){for(var n={},i=0;i<t.length;i++){var o=t[i],s=a==null?void 0:a[o];n[o]=s===void 0?e[o]:s}return n}},Nr=function(e,t,a){for(var n=e.length-1;n>=0&&!(e[n]===t&&(e.splice(n,1),a));n--);},Sn=function(e){e.splice(0,e.length)},Pl=function(e,t){for(var a=0;a<t.length;a++){var n=t[a];e.push(n)}},pr=function(e,t,a){return a&&(t=bi(a,t)),e[t]},Fr=function(e,t,a,n){a&&(t=bi(a,t)),e[t]=n},Bl=function(){function r(){Nt(this,r),this._obj={}}return mn(r,[{key:"set",value:function(t,a){return this._obj[t]=a,this}},{key:"delete",value:function(t){return this._obj[t]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(t){return this._obj[t]!==void 0}},{key:"get",value:function(t){return this._obj[t]}}]),r}(),Sr=typeof Map!="undefined"?Map:Bl,Ll="undefined",Ml=function(){function r(e){if(Nt(this,r),this._obj=Object.create(null),this.size=0,e!=null){var t;e.instanceString!=null&&e.instanceString()===this.instanceString()?t=e.toArray():t=e;for(var a=0;a<t.length;a++)this.add(t[a])}}return mn(r,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(t){var a=this._obj;a[t]!==1&&(a[t]=1,this.size++)}},{key:"delete",value:function(t){var a=this._obj;a[t]===1&&(a[t]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(t){return this._obj[t]===1}},{key:"toArray",value:function(){var t=this;return Object.keys(this._obj).filter(function(a){return t.has(a)})}},{key:"forEach",value:function(t,a){return this.toArray().forEach(t,a)}}]),r}(),ft=(typeof Set=="undefined"?"undefined":qe(Set))!==Ll?Set:Ml,Da=function(e,t){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||t===void 0||!yn(e)){Ne("An element must have a core reference and parameters set");return}var n=t.group;if(n==null&&(t.data&&t.data.source!=null&&t.data.target!=null?n="edges":n="nodes"),n!=="nodes"&&n!=="edges"){Ne("An element must be of type `nodes` or `edges`; you specified `"+n+"`");return}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:n,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:t.selectable===void 0?!0:!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:t.grabbable===void 0?!0:!!t.grabbable,pannable:t.pannable===void 0?n==="edges":!!t.pannable,active:!1,classes:new ft,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(i.position.x==null&&(i.position.x=0),i.position.y==null&&(i.position.y=0),t.renderedPosition){var o=t.renderedPosition,s=e.pan(),l=e.zoom();i.position={x:(o.x-s.x)/l,y:(o.y-s.y)/l}}var u=[];Ae(t.classes)?u=t.classes:ve(t.classes)&&(u=t.classes.split(/\s+/));for(var v=0,f=u.length;v<f;v++){var c=u[v];!c||c===""||i.classes.add(c)}this.createEmitter();var h=t.style||t.css;h&&(Be("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(h)),(a===void 0||a)&&this.restore()},Vi=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(a,n,i){var o;Ce(a)&&!vr(a)&&(o=a,a=o.roots||o.root,n=o.visit,i=o.directed),i=arguments.length===2&&!ze(n)?n:i,n=ze(n)?n:function(){};for(var s=this._private.cy,l=a=ve(a)?this.filter(a):a,u=[],v=[],f={},c={},h={},d=0,m,p=this.byGroup(),g=p.nodes,y=p.edges,b=0;b<l.length;b++){var w=l[b],D=w.id();w.isNode()&&(u.unshift(w),e.bfs&&(h[D]=!0,v.push(w)),c[D]=0)}for(var C=function(){var A=e.bfs?u.shift():u.pop(),B=A.id();if(e.dfs){if(h[B])return"continue";h[B]=!0,v.push(A)}var O=c[B],R=f[B],M=R!=null?R.source():null,I=R!=null?R.target():null,V=R==null?void 0:A.same(M)?I[0]:M[0],G=void 0;if(G=n(A,R,V,d++,O),G===!0)return m=A,"break";if(G===!1)return"break";for(var z=A.connectedEdges().filter(function(U){return(!i||U.source().same(A))&&y.has(U)}),H=0;H<z.length;H++){var Y=z[H],Q=Y.connectedNodes().filter(function(U){return!U.same(A)&&g.has(U)}),X=Q.id();Q.length!==0&&!h[X]&&(Q=Q[0],u.push(Q),e.bfs&&(h[X]=!0,v.push(Q)),f[X]=Y,c[X]=c[B]+1)}};u.length!==0;){var x=C();if(x!=="continue"&&x==="break")break}for(var k=s.collection(),E=0;E<v.length;E++){var P=v[E],L=f[P.id()];L!=null&&k.push(L),k.push(P)}return{path:s.collection(k),found:s.collection(m)}}},Xt={breadthFirstSearch:Vi({bfs:!0}),depthFirstSearch:Vi({dfs:!0})};Xt.bfs=Xt.breadthFirstSearch,Xt.dfs=Xt.depthFirstSearch;var Al=zu(function(r,e){(function(){var t,a,n,i,o,s,l,u,v,f,c,h,d,m,p;n=Math.floor,f=Math.min,a=function(g,y){return g<y?-1:g>y?1:0},v=function(g,y,b,w,D){var C;if(b==null&&(b=0),D==null&&(D=a),b<0)throw new Error("lo must be non-negative");for(w==null&&(w=g.length);b<w;)C=n((b+w)/2),D(y,g[C])<0?w=C:b=C+1;return[].splice.apply(g,[b,b-b].concat(y)),y},s=function(g,y,b){return b==null&&(b=a),g.push(y),m(g,0,g.length-1,b)},o=function(g,y){var b,w;return y==null&&(y=a),b=g.pop(),g.length?(w=g[0],g[0]=b,p(g,0,y)):w=b,w},u=function(g,y,b){var w;return b==null&&(b=a),w=g[0],g[0]=y,p(g,0,b),w},l=function(g,y,b){var w;return b==null&&(b=a),g.length&&b(g[0],y)<0&&(w=[g[0],y],y=w[0],g[0]=w[1],p(g,0,b)),y},i=function(g,y){var b,w,D,C,x,k;for(y==null&&(y=a),C=function(){k=[];for(var E=0,P=n(g.length/2);0<=P?E<P:E>P;0<=P?E++:E--)k.push(E);return k}.apply(this).reverse(),x=[],w=0,D=C.length;w<D;w++)b=C[w],x.push(p(g,b,y));return x},d=function(g,y,b){var w;if(b==null&&(b=a),w=g.indexOf(y),w!==-1)return m(g,0,w,b),p(g,w,b)},c=function(g,y,b){var w,D,C,x,k;if(b==null&&(b=a),D=g.slice(0,y),!D.length)return D;for(i(D,b),k=g.slice(y),C=0,x=k.length;C<x;C++)w=k[C],l(D,w,b);return D.sort(b).reverse()},h=function(g,y,b){var w,D,C,x,k,E,P,L,T;if(b==null&&(b=a),y*10<=g.length){if(C=g.slice(0,y).sort(b),!C.length)return C;for(D=C[C.length-1],P=g.slice(y),x=0,E=P.length;x<E;x++)w=P[x],b(w,D)<0&&(v(C,w,0,null,b),C.pop(),D=C[C.length-1]);return C}for(i(g,b),T=[],k=0,L=f(y,g.length);0<=L?k<L:k>L;0<=L?++k:--k)T.push(o(g,b));return T},m=function(g,y,b,w){var D,C,x;for(w==null&&(w=a),D=g[b];b>y;){if(x=b-1>>1,C=g[x],w(D,C)<0){g[b]=C,b=x;continue}break}return g[b]=D},p=function(g,y,b){var w,D,C,x,k;for(b==null&&(b=a),D=g.length,k=y,C=g[y],w=2*y+1;w<D;)x=w+1,x<D&&!(b(g[w],g[x])<0)&&(w=x),g[y]=g[w],y=w,w=2*y+1;return g[y]=C,m(g,k,y,b)},t=function(){g.push=s,g.pop=o,g.replace=u,g.pushpop=l,g.heapify=i,g.updateItem=d,g.nlargest=c,g.nsmallest=h;function g(y){this.cmp=y!=null?y:a,this.nodes=[]}return g.prototype.push=function(y){return s(this.nodes,y,this.cmp)},g.prototype.pop=function(){return o(this.nodes,this.cmp)},g.prototype.peek=function(){return this.nodes[0]},g.prototype.contains=function(y){return this.nodes.indexOf(y)!==-1},g.prototype.replace=function(y){return u(this.nodes,y,this.cmp)},g.prototype.pushpop=function(y){return l(this.nodes,y,this.cmp)},g.prototype.heapify=function(){return i(this.nodes,this.cmp)},g.prototype.updateItem=function(y){return d(this.nodes,y,this.cmp)},g.prototype.clear=function(){return this.nodes=[]},g.prototype.empty=function(){return this.nodes.length===0},g.prototype.size=function(){return this.nodes.length},g.prototype.clone=function(){var y;return y=new g,y.nodes=this.nodes.slice(0),y},g.prototype.toArray=function(){return this.nodes.slice(0)},g.prototype.insert=g.prototype.push,g.prototype.top=g.prototype.peek,g.prototype.front=g.prototype.peek,g.prototype.has=g.prototype.contains,g.prototype.copy=g.prototype.clone,g}(),function(g,y){return r.exports=y()}(this,function(){return t})}).call($t)}),Ut=Al,Rl=Ke({root:null,weight:function(e){return 1},directed:!1}),Ol={dijkstra:function(e){if(!Ce(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var a=Rl(e),n=a.root,i=a.weight,o=a.directed,s=this,l=i,u=ve(n)?this.filter(n)[0]:n[0],v={},f={},c={},h=this.byGroup(),d=h.nodes,m=h.edges;m.unmergeBy(function(O){return O.isLoop()});for(var p=function(R){return v[R.id()]},g=function(R,M){v[R.id()]=M,y.updateItem(R)},y=new Ut(function(O,R){return p(O)-p(R)}),b=0;b<d.length;b++){var w=d[b];v[w.id()]=w.same(u)?0:1/0,y.push(w)}for(var D=function(R,M){for(var I=(o?R.edgesTo(M):R.edgesWith(M)).intersect(m),V=1/0,G,z=0;z<I.length;z++){var H=I[z],Y=l(H);(Y<V||!G)&&(V=Y,G=H)}return{edge:G,dist:V}};y.size()>0;){var C=y.pop(),x=p(C),k=C.id();if(c[k]=x,x!==1/0)for(var E=C.neighborhood().intersect(d),P=0;P<E.length;P++){var L=E[P],T=L.id(),A=D(C,L),B=x+A.dist;B<p(L)&&(g(L,B),f[T]={node:C,edge:A.edge})}}return{distanceTo:function(R){var M=ve(R)?d.filter(R)[0]:R[0];return c[M.id()]},pathTo:function(R){var M=ve(R)?d.filter(R)[0]:R[0],I=[],V=M,G=V.id();if(M.length>0)for(I.unshift(M);f[G];){var z=f[G];I.unshift(z.edge),I.unshift(z.node),V=z.node,G=V.id()}return s.spawn(I)}}}},Il={kruskal:function(e){e=e||function(b){return 1};for(var t=this.byGroup(),a=t.nodes,n=t.edges,i=a.length,o=new Array(i),s=a,l=function(w){for(var D=0;D<o.length;D++){var C=o[D];if(C.has(w))return D}},u=0;u<i;u++)o[u]=this.spawn(a[u]);for(var v=n.sort(function(b,w){return e(b)-e(w)}),f=0;f<v.length;f++){var c=v[f],h=c.source()[0],d=c.target()[0],m=l(h),p=l(d),g=o[m],y=o[p];m!==p&&(s.merge(c),g.merge(y),o.splice(p,1))}return s}},zl=Ke({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),Nl={aStar:function(e){var t=this.cy(),a=zl(e),n=a.root,i=a.goal,o=a.heuristic,s=a.directed,l=a.weight;n=t.collection(n)[0],i=t.collection(i)[0];var u=n.id(),v=i.id(),f={},c={},h={},d=new Ut(function(G,z){return c[G.id()]-c[z.id()]}),m=new ft,p={},g={},y=function(z,H){d.push(z),m.add(H)},b,w,D=function(){b=d.pop(),w=b.id(),m.delete(w)},C=function(z){return m.has(z)};y(n,u),f[u]=0,c[u]=o(n);for(var x=0;d.size()>0;){if(D(),x++,w===v){for(var k=[],E=i,P=v,L=g[P];k.unshift(E),L!=null&&k.unshift(L),E=p[P],E!=null;)P=E.id(),L=g[P];return{found:!0,distance:f[w],path:this.spawn(k),steps:x}}h[w]=!0;for(var T=b._private.edges,A=0;A<T.length;A++){var B=T[A];if(this.hasElementWithId(B.id())&&!(s&&B.data("source")!==w)){var O=B.source(),R=B.target(),M=O.id()!==w?O:R,I=M.id();if(this.hasElementWithId(I)&&!h[I]){var V=f[w]+l(B);if(!C(I)){f[I]=V,c[I]=V+o(M),y(M,I),p[I]=b,g[I]=B;continue}V<f[I]&&(f[I]=V,c[I]=V+o(M),p[I]=b,g[I]=B)}}}}return{found:!1,distance:void 0,path:void 0,steps:x}}},Fl=Ke({weight:function(e){return 1},directed:!1}),Vl={floydWarshall:function(e){for(var t=this.cy(),a=Fl(e),n=a.weight,i=a.directed,o=n,s=this.byGroup(),l=s.nodes,u=s.edges,v=l.length,f=v*v,c=function(Y){return l.indexOf(Y)},h=function(Y){return l[Y]},d=new Array(f),m=0;m<f;m++){var p=m%v,g=(m-p)/v;g===p?d[m]=0:d[m]=1/0}for(var y=new Array(f),b=new Array(f),w=0;w<u.length;w++){var D=u[w],C=D.source()[0],x=D.target()[0];if(C!==x){var k=c(C),E=c(x),P=k*v+E,L=o(D);if(d[P]>L&&(d[P]=L,y[P]=E,b[P]=D),!i){var T=E*v+k;!i&&d[T]>L&&(d[T]=L,y[T]=k,b[T]=D)}}}for(var A=0;A<v;A++)for(var B=0;B<v;B++)for(var O=B*v+A,R=0;R<v;R++){var M=B*v+R,I=A*v+R;d[O]+d[I]<d[M]&&(d[M]=d[O]+d[I],y[M]=y[O])}var V=function(Y){return(ve(Y)?t.filter(Y):Y)[0]},G=function(Y){return c(V(Y))},z={distance:function(Y,Q){var X=G(Y),U=G(Q);return d[X*v+U]},path:function(Y,Q){var X=G(Y),U=G(Q),N=h(X);if(X===U)return N.collection();if(y[X*v+U]==null)return t.collection();var _=t.collection(),j=X,J;for(_.merge(N);X!==U;)j=X,X=y[X*v+U],J=b[j*v+X],_.merge(J),_.merge(h(X));return _}};return z}},ql=Ke({weight:function(e){return 1},directed:!1,root:null}),$l={bellmanFord:function(e){var t=this,a=ql(e),n=a.weight,i=a.directed,o=a.root,s=n,l=this,u=this.cy(),v=this.byGroup(),f=v.edges,c=v.nodes,h=c.length,d=new Sr,m=!1,p=[];o=u.collection(o)[0],f.unmergeBy(function(ue){return ue.isLoop()});for(var g=f.length,y=function(ie){var fe=d.get(ie.id());return fe||(fe={},d.set(ie.id(),fe)),fe},b=function(ie){return(ve(ie)?u.$(ie):ie)[0]},w=function(ie){return y(b(ie)).dist},D=function(ie){for(var fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:o,Ee=b(ie),we=[],ge=Ee;;){if(ge==null)return t.spawn();var xe=y(ge),q=xe.edge,S=xe.pred;if(we.unshift(ge[0]),ge.same(fe)&&we.length>0)break;q!=null&&we.unshift(q),ge=S}return l.spawn(we)},C=0;C<h;C++){var x=c[C],k=y(x);x.same(o)?k.dist=0:k.dist=1/0,k.pred=null,k.edge=null}for(var E=!1,P=function(ie,fe,Ee,we,ge,xe){var q=we.dist+xe;q<ge.dist&&!Ee.same(we.edge)&&(ge.dist=q,ge.pred=ie,ge.edge=Ee,E=!0)},L=1;L<h;L++){E=!1;for(var T=0;T<g;T++){var A=f[T],B=A.source(),O=A.target(),R=s(A),M=y(B),I=y(O);P(B,O,A,M,I,R),i||P(O,B,A,I,M,R)}if(!E)break}if(E)for(var V=[],G=0;G<g;G++){var z=f[G],H=z.source(),Y=z.target(),Q=s(z),X=y(H).dist,U=y(Y).dist;if(X+Q<U||!i&&U+Q<X)if(m||(Be("Graph contains a negative weight cycle for Bellman-Ford"),m=!0),e.findNegativeWeightCycles!==!1){var N=[];X+Q<U&&N.push(H),!i&&U+Q<X&&N.push(Y);for(var _=N.length,j=0;j<_;j++){var J=N[j],ee=[J];ee.push(y(J).edge);for(var oe=y(J).pred;ee.indexOf(oe)===-1;)ee.push(oe),ee.push(y(oe).edge),oe=y(oe).pred;ee=ee.slice(ee.indexOf(oe));for(var he=ee[0].id(),re=0,te=2;te<ee.length;te+=2)ee[te].id()<he&&(he=ee[te].id(),re=te);ee=ee.slice(re).concat(ee.slice(0,re)),ee.push(ee[0]);var le=ee.map(function(ue){return ue.id()}).join(",");V.indexOf(le)===-1&&(p.push(l.spawn(ee)),V.push(le))}}else break}return{distanceTo:w,pathTo:D,hasNegativeWeightCycle:m,negativeWeightCycles:p}}},Hl=Math.sqrt(2),Wl=function(e,t,a){a.length===0&&Ne("Karger-Stein must be run on a connected (sub)graph");for(var n=a[e],i=n[1],o=n[2],s=t[i],l=t[o],u=a,v=u.length-1;v>=0;v--){var f=u[v],c=f[1],h=f[2];(t[c]===s&&t[h]===l||t[c]===l&&t[h]===s)&&u.splice(v,1)}for(var d=0;d<u.length;d++){var m=u[d];m[1]===l?(u[d]=m.slice(),u[d][1]=s):m[2]===l&&(u[d]=m.slice(),u[d][2]=s)}for(var p=0;p<t.length;p++)t[p]===l&&(t[p]=s);return u},Tn=function(e,t,a,n){for(;a>n;){var i=Math.floor(Math.random()*t.length);t=Wl(i,e,t),a--}return t},Gl={kargerStein:function(){var e=this,t=this.byGroup(),a=t.nodes,n=t.edges;n.unmergeBy(function(I){return I.isLoop()});var i=a.length,o=n.length,s=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),l=Math.floor(i/Hl);if(i<2){Ne("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],v=0;v<o;v++){var f=n[v];u.push([v,a.indexOf(f.source()),a.indexOf(f.target())])}for(var c=1/0,h=[],d=new Array(i),m=new Array(i),p=new Array(i),g=function(V,G){for(var z=0;z<i;z++)G[z]=V[z]},y=0;y<=s;y++){for(var b=0;b<i;b++)m[b]=b;var w=Tn(m,u.slice(),i,l),D=w.slice();g(m,p);var C=Tn(m,w,l,2),x=Tn(p,D,l,2);C.length<=x.length&&C.length<c?(c=C.length,h=C,g(m,d)):x.length<=C.length&&x.length<c&&(c=x.length,h=x,g(p,d))}for(var k=this.spawn(h.map(function(I){return n[I[0]]})),E=this.spawn(),P=this.spawn(),L=d[0],T=0;T<d.length;T++){var A=d[T],B=a[T];A===L?E.merge(B):P.merge(B)}var O=function(V){var G=e.spawn();return V.forEach(function(z){G.merge(z),z.connectedEdges().forEach(function(H){e.contains(H)&&!k.contains(H)&&G.merge(H)})}),G},R=[O(E),O(P)],M={cut:k,components:R,partition1:E,partition2:P};return M}},Kl=function(e){return{x:e.x,y:e.y}},ka=function(e,t,a){return{x:e.x*t+a.x,y:e.y*t+a.y}},qi=function(e,t,a){return{x:(e.x-a.x)/t,y:(e.y-a.y)/t}},ct=function(e){return{x:e[0],y:e[1]}},Yl=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=1/0,i=t;i<a;i++){var o=e[i];isFinite(o)&&(n=Math.min(o,n))}return n},Xl=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=-1/0,i=t;i<a;i++){var o=e[i];isFinite(o)&&(n=Math.max(o,n))}return n},Ul=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=0,i=0,o=t;o<a;o++){var s=e[o];isFinite(s)&&(n+=s,i++)}return n/i},Zl=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;n?e=e.slice(t,a):(a<e.length&&e.splice(a,e.length-a),t>0&&e.splice(0,t));for(var s=0,l=e.length-1;l>=0;l--){var u=e[l];o?isFinite(u)||(e[l]=-1/0,s++):e.splice(l,1)}i&&e.sort(function(c,h){return c-h});var v=e.length,f=Math.floor(v/2);return v%2!==0?e[f+1+s]:(e[f-1+s]+e[f+s])/2},Ql=function(e){return Math.PI*e/180},Pa=function(e,t){return Math.atan2(t,e)-Math.PI/2},Dn=Math.log2||function(r){return Math.log(r)/Math.log(2)},$i=function(e){return e>0?1:e<0?-1:0},_r=function(e,t){return Math.sqrt(Jr(e,t))},Jr=function(e,t){var a=t.x-e.x,n=t.y-e.y;return a*a+n*n},_l=function(e){for(var t=e.length,a=0,n=0;n<t;n++)a+=e[n];for(var i=0;i<t;i++)e[i]=e[i]/a;return e},Ge=function(e,t,a,n){return(1-n)*(1-n)*e+2*(1-n)*n*t+n*n*a},dt=function(e,t,a,n){return{x:Ge(e.x,t.x,a.x,n),y:Ge(e.y,t.y,a.y,n)}},Jl=function(e,t,a,n){var i={x:t.x-e.x,y:t.y-e.y},o=_r(e,t),s={x:i.x/o,y:i.y/o};return a=a==null?0:a,n=n!=null?n:a*o,{x:e.x+s.x*n,y:e.y+s.y*n}},Zt=function(e,t,a){return Math.max(e,Math.min(a,t))},or=function(e){if(e==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(e.x1!=null&&e.y1!=null){if(e.x2!=null&&e.y2!=null&&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(e.w!=null&&e.h!=null&&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}}},jl=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},ev=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},rv=function(e,t,a){return{x1:e.x1+t,x2:e.x2+t,y1:e.y1+a,y2:e.y2+a,w:e.w,h:e.h}},Hi=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},tv=function(e,t,a){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,a),e.y2=Math.max(e.y2,a),e.h=e.y2-e.y1},Ba=function(e){var t=arguments.length>1&&arguments[1]!==void 0?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},La=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],a,n,i,o;if(t.length===1)a=n=i=o=t[0];else if(t.length===2)a=i=t[0],o=n=t[1];else if(t.length===4){var s=gr(t,4);a=s[0],n=s[1],i=s[2],o=s[3]}return e.x1-=o,e.x2+=n,e.y1-=a,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Wi=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},kn=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)},ht=function(e,t,a){return e.x1<=t&&t<=e.x2&&e.y1<=a&&a<=e.y2},av=function(e,t){return ht(e,t.x,t.y)},Gi=function(e,t){return ht(e,t.x1,t.y1)&&ht(e,t.x2,t.y2)},Ki=function(e,t,a,n,i,o,s){var l=Jt(i,o),u=i/2,v=o/2,f;{var c=a-u+l-s,h=n-v-s,d=a+u-l+s,m=h;if(f=Vr(e,t,a,n,c,h,d,m,!1),f.length>0)return f}{var p=a+u+s,g=n-v+l-s,y=p,b=n+v-l+s;if(f=Vr(e,t,a,n,p,g,y,b,!1),f.length>0)return f}{var w=a-u+l-s,D=n+v+s,C=a+u-l+s,x=D;if(f=Vr(e,t,a,n,w,D,C,x,!1),f.length>0)return f}{var k=a-u-s,E=n-v+l-s,P=k,L=n+v-l+s;if(f=Vr(e,t,a,n,k,E,P,L,!1),f.length>0)return f}var T;{var A=a-u+l,B=n-v+l;if(T=Qt(e,t,a,n,A,B,l+s),T.length>0&&T[0]<=A&&T[1]<=B)return[T[0],T[1]]}{var O=a+u-l,R=n-v+l;if(T=Qt(e,t,a,n,O,R,l+s),T.length>0&&T[0]>=O&&T[1]<=R)return[T[0],T[1]]}{var M=a+u-l,I=n+v-l;if(T=Qt(e,t,a,n,M,I,l+s),T.length>0&&T[0]>=M&&T[1]>=I)return[T[0],T[1]]}{var V=a-u+l,G=n+v-l;if(T=Qt(e,t,a,n,V,G,l+s),T.length>0&&T[0]<=V&&T[1]>=G)return[T[0],T[1]]}return[]},nv=function(e,t,a,n,i,o,s){var l=s,u=Math.min(a,i),v=Math.max(a,i),f=Math.min(n,o),c=Math.max(n,o);return u-l<=e&&e<=v+l&&f-l<=t&&t<=c+l},iv=function(e,t,a,n,i,o,s,l,u){var v={x1:Math.min(a,s,i)-u,x2:Math.max(a,s,i)+u,y1:Math.min(n,l,o)-u,y2:Math.max(n,l,o)+u};return!(e<v.x1||e>v.x2||t<v.y1||t>v.y2)},ov=function(e,t,a,n){a-=n;var i=t*t-4*e*a;if(i<0)return[];var o=Math.sqrt(i),s=2*e,l=(-t+o)/s,u=(-t-o)/s;return[l,u]},sv=function(e,t,a,n,i){var o=1e-5;e===0&&(e=o),t/=e,a/=e,n/=e;var s,l,u,v,f,c,h,d;if(l=(3*a-t*t)/9,u=-(27*n)+t*(9*a-2*(t*t)),u/=54,s=l*l*l+u*u,i[1]=0,h=t/3,s>0){f=u+Math.sqrt(s),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),c=u-Math.sqrt(s),c=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3),i[0]=-h+f+c,h+=(f+c)/2,i[4]=i[2]=-h,h=Math.sqrt(3)*(-c+f)/2,i[3]=h,i[5]=-h;return}if(i[5]=i[3]=0,s===0){d=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),i[0]=-h+2*d,i[4]=i[2]=-(d+h);return}l=-l,v=l*l*l,v=Math.acos(u/Math.sqrt(v)),d=2*Math.sqrt(l),i[0]=-h+d*Math.cos(v/3),i[2]=-h+d*Math.cos((v+2*Math.PI)/3),i[4]=-h+d*Math.cos((v+4*Math.PI)/3)},uv=function(e,t,a,n,i,o,s,l){var u=1*a*a-4*a*i+2*a*s+4*i*i-4*i*s+s*s+n*n-4*n*o+2*n*l+4*o*o-4*o*l+l*l,v=1*9*a*i-3*a*a-3*a*s-6*i*i+3*i*s+9*n*o-3*n*n-3*n*l-6*o*o+3*o*l,f=1*3*a*a-6*a*i+a*s-a*e+2*i*i+2*i*e-s*e+3*n*n-6*n*o+n*l-n*t+2*o*o+2*o*t-l*t,c=1*a*i-a*a+a*e-i*e+n*o-n*n+n*t-o*t,h=[];sv(u,v,f,c,h);for(var d=1e-7,m=[],p=0;p<6;p+=2)Math.abs(h[p+1])<d&&h[p]>=0&&h[p]<=1&&m.push(h[p]);m.push(1),m.push(0);for(var g=-1,y,b,w,D=0;D<m.length;D++)y=Math.pow(1-m[D],2)*a+2*(1-m[D])*m[D]*i+m[D]*m[D]*s,b=Math.pow(1-m[D],2)*n+2*(1-m[D])*m[D]*o+m[D]*m[D]*l,w=Math.pow(y-e,2)+Math.pow(b-t,2),g>=0?w<g&&(g=w):g=w;return g},lv=function(e,t,a,n,i,o){var s=[e-a,t-n],l=[i-a,o-n],u=l[0]*l[0]+l[1]*l[1],v=s[0]*s[0]+s[1]*s[1],f=s[0]*l[0]+s[1]*l[1],c=f*f/u;return f<0?v:c>u?(e-i)*(e-i)+(t-o)*(t-o):v-c},sr=function(e,t,a){for(var n,i,o,s,l,u=0,v=0;v<a.length/2;v++)if(n=a[v*2],i=a[v*2+1],v+1<a.length/2?(o=a[(v+1)*2],s=a[(v+1)*2+1]):(o=a[(v+1-a.length/2)*2],s=a[(v+1-a.length/2)*2+1]),!(n==e&&o==e))if(n>=e&&e>=o||n<=e&&e<=o)l=(e-n)/(o-n)*(s-i)+i,l>t&&u++;else continue;return u%2!==0},Lr=function(e,t,a,n,i,o,s,l,u){var v=new Array(a.length),f;l[0]!=null?(f=Math.atan(l[1]/l[0]),l[0]<0?f=f+Math.PI/2:f=-f-Math.PI/2):f=l;for(var c=Math.cos(-f),h=Math.sin(-f),d=0;d<v.length/2;d++)v[d*2]=o/2*(a[d*2]*c-a[d*2+1]*h),v[d*2+1]=s/2*(a[d*2+1]*c+a[d*2]*h),v[d*2]+=n,v[d*2+1]+=i;var m;if(u>0){var p=Aa(v,-u);m=Ma(p)}else m=v;return sr(e,t,m)},vv=function(e,t,a,n,i,o,s){for(var l=new Array(a.length),u=o/2,v=s/2,f=Ln(o,s),c=f*f,h=0;h<a.length/4;h++){var d=void 0,m=void 0;h===0?d=a.length-2:d=h*4-2,m=h*4+2;var p=n+u*a[h*4],g=i+v*a[h*4+1],y=-a[d]*a[m]-a[d+1]*a[m+1],b=f/Math.tan(Math.acos(y)/2),w=p-b*a[d],D=g-b*a[d+1],C=p+b*a[m],x=g+b*a[m+1];l[h*4]=w,l[h*4+1]=D,l[h*4+2]=C,l[h*4+3]=x;var k=a[d+1],E=-a[d],P=k*a[m]+E*a[m+1];P<0&&(k*=-1,E*=-1);var L=w+k*f,T=D+E*f,A=Math.pow(L-e,2)+Math.pow(T-t,2);if(A<=c)return!0}return sr(e,t,l)},Ma=function(e){for(var t=new Array(e.length/2),a,n,i,o,s,l,u,v,f=0;f<e.length/4;f++){a=e[f*4],n=e[f*4+1],i=e[f*4+2],o=e[f*4+3],f<e.length/4-1?(s=e[(f+1)*4],l=e[(f+1)*4+1],u=e[(f+1)*4+2],v=e[(f+1)*4+3]):(s=e[0],l=e[1],u=e[2],v=e[3]);var c=Vr(a,n,i,o,s,l,u,v,!0);t[f*2]=c[0],t[f*2+1]=c[1]}return t},Aa=function(e,t){for(var a=new Array(e.length*2),n,i,o,s,l=0;l<e.length/2;l++){n=e[l*2],i=e[l*2+1],l<e.length/2-1?(o=e[(l+1)*2],s=e[(l+1)*2+1]):(o=e[0],s=e[1]);var u=s-i,v=-(o-n),f=Math.sqrt(u*u+v*v),c=u/f,h=v/f;a[l*4]=n+c*t,a[l*4+1]=i+h*t,a[l*4+2]=o+c*t,a[l*4+3]=s+h*t}return a},fv=function(e,t,a,n,i,o){var s=a-e,l=n-t;s/=i,l/=o;var u=Math.sqrt(s*s+l*l),v=u-1;if(v<0)return[];var f=v/u;return[(a-e)*f+e,(n-t)*f+t]},jr=function(e,t,a,n,i,o,s){return e-=i,t-=o,e/=a/2+s,t/=n/2+s,e*e+t*t<=1},Qt=function(e,t,a,n,i,o,s){var l=[a-e,n-t],u=[e-i,t-o],v=l[0]*l[0]+l[1]*l[1],f=2*(u[0]*l[0]+u[1]*l[1]),c=u[0]*u[0]+u[1]*u[1]-s*s,h=f*f-4*v*c;if(h<0)return[];var d=(-f+Math.sqrt(h))/(2*v),m=(-f-Math.sqrt(h))/(2*v),p=Math.min(d,m),g=Math.max(d,m),y=[];if(p>=0&&p<=1&&y.push(p),g>=0&&g<=1&&y.push(g),y.length===0)return[];var b=y[0]*l[0]+e,w=y[0]*l[1]+t;if(y.length>1){if(y[0]==y[1])return[b,w];var D=y[1]*l[0]+e,C=y[1]*l[1]+t;return[b,w,D,C]}else return[b,w]},Pn=function(e,t,a){return t<=e&&e<=a||a<=e&&e<=t?e:e<=t&&t<=a||a<=t&&t<=e?t:a},Vr=function(e,t,a,n,i,o,s,l,u){var v=e-i,f=a-e,c=s-i,h=t-o,d=n-t,m=l-o,p=c*h-m*v,g=f*h-d*v,y=m*f-c*d;if(y!==0){var b=p/y,w=g/y,D=.001,C=0-D,x=1+D;return C<=b&&b<=x&&C<=w&&w<=x?[e+b*f,t+b*d]:u?[e+b*f,t+b*d]:[]}else return p===0||g===0?Pn(e,a,s)===s?[s,l]:Pn(e,a,i)===i?[i,o]:Pn(i,s,a)===a?[a,n]:[]:[]},_t=function(e,t,a,n,i,o,s,l){var u=[],v,f=new Array(a.length),c=!0;o==null&&(c=!1);var h;if(c){for(var d=0;d<f.length/2;d++)f[d*2]=a[d*2]*o+n,f[d*2+1]=a[d*2+1]*s+i;if(l>0){var m=Aa(f,-l);h=Ma(m)}else h=f}else h=a;for(var p,g,y,b,w=0;w<h.length/2;w++)p=h[w*2],g=h[w*2+1],w<h.length/2-1?(y=h[(w+1)*2],b=h[(w+1)*2+1]):(y=h[0],b=h[1]),v=Vr(e,t,n,i,p,g,y,b),v.length!==0&&u.push(v[0],v[1]);return u},cv=function(e,t,a,n,i,o,s,l){for(var u=[],v,f=new Array(a.length),c=o/2,h=s/2,d=Ln(o,s),m=0;m<a.length/4;m++){var p=void 0,g=void 0;m===0?p=a.length-2:p=m*4-2,g=m*4+2;var y=n+c*a[m*4],b=i+h*a[m*4+1],w=-a[p]*a[g]-a[p+1]*a[g+1],D=d/Math.tan(Math.acos(w)/2),C=y-D*a[p],x=b-D*a[p+1],k=y+D*a[g],E=b+D*a[g+1];m===0?(f[a.length-2]=C,f[a.length-1]=x):(f[m*4-2]=C,f[m*4-1]=x),f[m*4]=k,f[m*4+1]=E;var P=a[p+1],L=-a[p],T=P*a[g]+L*a[g+1];T<0&&(P*=-1,L*=-1);var A=C+P*d,B=x+L*d;v=Qt(e,t,n,i,A,B,d),v.length!==0&&u.push(v[0],v[1])}for(var O=0;O<f.length/4;O++)v=Vr(e,t,n,i,f[O*4],f[O*4+1],f[O*4+2],f[O*4+3],!1),v.length!==0&&u.push(v[0],v[1]);if(u.length>2){for(var R=[u[0],u[1]],M=Math.pow(R[0]-e,2)+Math.pow(R[1]-t,2),I=1;I<u.length/2;I++){var V=Math.pow(u[I*2]-e,2)+Math.pow(u[I*2+1]-t,2);V<=M&&(R[0]=u[I*2],R[1]=u[I*2+1],M=V)}return R}return u},Ra=function(e,t,a){var n=[e[0]-t[0],e[1]-t[1]],i=Math.sqrt(n[0]*n[0]+n[1]*n[1]),o=(i-a)/i;return o<0&&(o=1e-5),[t[0]+o*n[0],t[1]+o*n[1]]},nr=function(e,t){var a=Bn(e,t);return a=Yi(a),a},Yi=function(e){for(var t,a,n=e.length/2,i=1/0,o=1/0,s=-1/0,l=-1/0,u=0;u<n;u++)t=e[2*u],a=e[2*u+1],i=Math.min(i,t),s=Math.max(s,t),o=Math.min(o,a),l=Math.max(l,a);for(var v=2/(s-i),f=2/(l-o),c=0;c<n;c++)t=e[2*c]=e[2*c]*v,a=e[2*c+1]=e[2*c+1]*f,i=Math.min(i,t),s=Math.max(s,t),o=Math.min(o,a),l=Math.max(l,a);if(o<-1)for(var h=0;h<n;h++)a=e[2*h+1]=e[2*h+1]+(-1-o);return e},Bn=function(e,t){var a=1/e*2*Math.PI,n=e%2===0?Math.PI/2+a/2:Math.PI/2;n+=t;for(var i=new Array(e*2),o,s=0;s<e;s++)o=s*a+n,i[2*s]=Math.cos(o),i[2*s+1]=Math.sin(-o);return i},Jt=function(e,t){return Math.min(e/4,t/4,8)},Ln=function(e,t){return Math.min(e/10,t/10,8)},Xi=function(){return 8},dv=function(e,t,a){return[e-2*t+a,2*(t-e),e]},Mn=function(e,t){return{heightOffset:Math.min(15,.05*t),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},hv=Ke({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),gv={pageRank:function(e){for(var t=hv(e),a=t.dampingFactor,n=t.precision,i=t.iterations,o=t.weight,s=this._private.cy,l=this.byGroup(),u=l.nodes,v=l.edges,f=u.length,c=f*f,h=v.length,d=new Array(c),m=new Array(f),p=(1-a)/f,g=0;g<f;g++){for(var y=0;y<f;y++){var b=g*f+y;d[b]=0}m[g]=0}for(var w=0;w<h;w++){var D=v[w],C=D.data("source"),x=D.data("target");if(C!==x){var k=u.indexOfId(C),E=u.indexOfId(x),P=o(D),L=E*f+k;d[L]+=P,m[k]+=P}}for(var T=1/f+p,A=0;A<f;A++)if(m[A]===0)for(var B=0;B<f;B++){var O=B*f+A;d[O]=T}else for(var R=0;R<f;R++){var M=R*f+A;d[M]=d[M]/m[A]+p}for(var I=new Array(f),V=new Array(f),G,z=0;z<f;z++)I[z]=1;for(var H=0;H<i;H++){for(var Y=0;Y<f;Y++)V[Y]=0;for(var Q=0;Q<f;Q++)for(var X=0;X<f;X++){var U=Q*f+X;V[Q]+=d[U]*I[X]}_l(V),G=I,I=V,V=G;for(var N=0,_=0;_<f;_++){var j=G[_]-I[_];N+=j*j}if(N<n)break}var J={rank:function(oe){return oe=s.collection(oe)[0],I[u.indexOf(oe)]}};return J}},Ui=Ke({root:null,weight:function(e){return 1},directed:!1,alpha:0}),gt={degreeCentralityNormalized:function(e){e=Ui(e);var t=this.cy(),a=this.nodes(),n=a.length;if(e.directed){for(var v={},f={},c=0,h=0,d=0;d<n;d++){var m=a[d],p=m.id();e.root=m;var g=this.degreeCentrality(e);c<g.indegree&&(c=g.indegree),h<g.outdegree&&(h=g.outdegree),v[p]=g.indegree,f[p]=g.outdegree}return{indegree:function(b){return c==0?0:(ve(b)&&(b=t.filter(b)),v[b.id()]/c)},outdegree:function(b){return h===0?0:(ve(b)&&(b=t.filter(b)),f[b.id()]/h)}}}else{for(var i={},o=0,s=0;s<n;s++){var l=a[s];e.root=l;var u=this.degreeCentrality(e);o<u.degree&&(o=u.degree),i[l.id()]=u.degree}return{degree:function(b){return o===0?0:(ve(b)&&(b=t.filter(b)),i[b.id()]/o)}}}},degreeCentrality:function(e){e=Ui(e);var t=this.cy(),a=this,n=e,i=n.root,o=n.weight,s=n.directed,l=n.alpha;if(i=t.collection(i)[0],s){for(var h=i.connectedEdges(),d=h.filter(function(C){return C.target().same(i)&&a.has(C)}),m=h.filter(function(C){return C.source().same(i)&&a.has(C)}),p=d.length,g=m.length,y=0,b=0,w=0;w<d.length;w++)y+=o(d[w]);for(var D=0;D<m.length;D++)b+=o(m[D]);return{indegree:Math.pow(p,1-l)*Math.pow(y,l),outdegree:Math.pow(g,1-l)*Math.pow(b,l)}}else{for(var u=i.connectedEdges().intersection(a),v=u.length,f=0,c=0;c<u.length;c++)f+=o(u[c]);return{degree:Math.pow(v,1-l)*Math.pow(f,l)}}}};gt.dc=gt.degreeCentrality,gt.dcn=gt.degreeCentralityNormalised=gt.degreeCentralityNormalized;var Zi=Ke({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),pt={closenessCentralityNormalized:function(e){for(var t=Zi(e),a=t.harmonic,n=t.weight,i=t.directed,o=this.cy(),s={},l=0,u=this.nodes(),v=this.floydWarshall({weight:n,directed:i}),f=0;f<u.length;f++){for(var c=0,h=u[f],d=0;d<u.length;d++)if(f!==d){var m=v.distance(h,u[d]);a?c+=1/m:c+=m}a||(c=1/c),l<c&&(l=c),s[h.id()]=c}return{closeness:function(g){return l==0?0:(ve(g)?g=o.filter(g)[0].id():g=g.id(),s[g]/l)}}},closenessCentrality:function(e){var t=Zi(e),a=t.root,n=t.weight,i=t.directed,o=t.harmonic;a=this.filter(a)[0];for(var s=this.dijkstra({root:a,weight:n,directed:i}),l=0,u=this.nodes(),v=0;v<u.length;v++){var f=u[v];if(!f.same(a)){var c=s.distanceTo(f);o?l+=1/c:l+=c}}return o?l:1/l}};pt.cc=pt.closenessCentrality,pt.ccn=pt.closenessCentralityNormalised=pt.closenessCentralityNormalized;var pv=Ke({weight:null,directed:!1}),An={betweennessCentrality:function(e){for(var t=pv(e),a=t.directed,n=t.weight,i=n!=null,o=this.cy(),s=this.nodes(),l={},u={},v=0,f={set:function(b,w){u[b]=w,w>v&&(v=w)},get:function(b){return u[b]}},c=0;c<s.length;c++){var h=s[c],d=h.id();a?l[d]=h.outgoers().nodes():l[d]=h.openNeighborhood().nodes(),f.set(d,0)}for(var m=function(b){for(var w=s[b].id(),D=[],C={},x={},k={},E=new Ut(function(X,U){return k[X]-k[U]}),P=0;P<s.length;P++){var L=s[P].id();C[L]=[],x[L]=0,k[L]=1/0}for(x[w]=1,k[w]=0,E.push(w);!E.empty();){var T=E.pop();if(D.push(T),i)for(var A=0;A<l[T].length;A++){var B=l[T][A],O=o.getElementById(T),R=void 0;O.edgesTo(B).length>0?R=O.edgesTo(B)[0]:R=B.edgesTo(O)[0];var M=n(R);B=B.id(),k[B]>k[T]+M&&(k[B]=k[T]+M,E.nodes.indexOf(B)<0?E.push(B):E.updateItem(B),x[B]=0,C[B]=[]),k[B]==k[T]+M&&(x[B]=x[B]+x[T],C[B].push(T))}else for(var I=0;I<l[T].length;I++){var V=l[T][I].id();k[V]==1/0&&(E.push(V),k[V]=k[T]+1),k[V]==k[T]+1&&(x[V]=x[V]+x[T],C[V].push(T))}}for(var G={},z=0;z<s.length;z++)G[s[z].id()]=0;for(;D.length>0;){for(var H=D.pop(),Y=0;Y<C[H].length;Y++){var Q=C[H][Y];G[Q]=G[Q]+x[Q]/x[H]*(1+G[H])}H!=s[b].id()&&f.set(H,f.get(H)+G[H])}},p=0;p<s.length;p++)m(p);var g={betweenness:function(b){var w=o.collection(b).id();return f.get(w)},betweennessNormalized:function(b){if(v==0)return 0;var w=o.collection(b).id();return f.get(w)/v}};return g.betweennessNormalised=g.betweennessNormalized,g}};An.bc=An.betweennessCentrality;var mv=Ke({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(r){return 1}]}),yv=function(e){return mv(e)},bv=function(e,t){for(var a=0,n=0;n<t.length;n++)a+=t[n](e);return a},wv=function(e,t,a){for(var n=0;n<t;n++)e[n*t+n]=a},Qi=function(e,t){for(var a,n=0;n<t;n++){a=0;for(var i=0;i<t;i++)a+=e[i*t+n];for(var o=0;o<t;o++)e[o*t+n]=e[o*t+n]/a}},xv=function(e,t,a){for(var n=new Array(a*a),i=0;i<a;i++){for(var o=0;o<a;o++)n[i*a+o]=0;for(var s=0;s<a;s++)for(var l=0;l<a;l++)n[i*a+l]+=e[i*a+s]*t[s*a+l]}return n},Ev=function(e,t,a){for(var n=e.slice(0),i=1;i<a;i++)e=xv(e,n,t);return e},Cv=function(e,t,a){for(var n=new Array(t*t),i=0;i<t*t;i++)n[i]=Math.pow(e[i],a);return Qi(n,t),n},Sv=function(e,t,a,n){for(var i=0;i<a;i++){var o=Math.round(e[i]*Math.pow(10,n))/Math.pow(10,n),s=Math.round(t[i]*Math.pow(10,n))/Math.pow(10,n);if(o!==s)return!1}return!0},Tv=function(e,t,a,n){for(var i=[],o=0;o<t;o++){for(var s=[],l=0;l<t;l++)Math.round(e[o*t+l]*1e3)/1e3>0&&s.push(a[l]);s.length!==0&&i.push(n.collection(s))}return i},Dv=function(e,t){for(var a=0;a<e.length;a++)if(!t[a]||e[a].id()!==t[a].id())return!1;return!0},kv=function(e){for(var t=0;t<e.length;t++)for(var a=0;a<e.length;a++)t!=a&&Dv(e[t],e[a])&&e.splice(a,1);return e},_i=function(e){for(var t=this.nodes(),a=this.edges(),n=this.cy(),i=yv(e),o={},s=0;s<t.length;s++)o[t[s].id()]=s;for(var l=t.length,u=l*l,v=new Array(u),f,c=0;c<u;c++)v[c]=0;for(var h=0;h<a.length;h++){var d=a[h],m=o[d.source().id()],p=o[d.target().id()],g=bv(d,i.attributes);v[m*l+p]+=g,v[p*l+m]+=g}wv(v,l,i.multFactor),Qi(v,l);for(var y=!0,b=0;y&&b<i.maxIterations;)y=!1,f=Ev(v,l,i.expandFactor),v=Cv(f,l,i.inflateFactor),Sv(v,f,u,4)||(y=!0),b++;var w=Tv(v,l,t,n);return w=kv(w),w},Pv={markovClustering:_i,mcl:_i},Bv=function(e){return e},Ji=function(e,t){return Math.abs(t-e)},ji=function(e,t,a){return e+Ji(t,a)},eo=function(e,t,a){return e+Math.pow(a-t,2)},Lv=function(e){return Math.sqrt(e)},Mv=function(e,t,a){return Math.max(e,Ji(t,a))},jt=function(e,t,a,n,i){for(var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:Bv,s=n,l,u,v=0;v<e;v++)l=t(v),u=a(v),s=i(s,l,u);return o(s)},mt={euclidean:function(e,t,a){return e>=2?jt(e,t,a,0,eo,Lv):jt(e,t,a,0,ji)},squaredEuclidean:function(e,t,a){return jt(e,t,a,0,eo)},manhattan:function(e,t,a){return jt(e,t,a,0,ji)},max:function(e,t,a){return jt(e,t,a,-1/0,Mv)}};mt["squared-euclidean"]=mt.squaredEuclidean,mt.squaredeuclidean=mt.squaredEuclidean;function Oa(r,e,t,a,n,i){var o;return ze(r)?o=r:o=mt[r]||mt.euclidean,e===0&&ze(r)?o(n,i):o(e,t,a,n,i)}var Av=Ke({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Rn=function(e){return Av(e)},Ia=function(e,t,a,n,i){var o=i!=="kMedoids",s=o?function(f){return a[f]}:function(f){return n[f](a)},l=function(c){return n[c](t)},u=a,v=t;return Oa(e,n.length,s,l,u,v)},On=function(e,t,a){for(var n=a.length,i=new Array(n),o=new Array(n),s=new Array(t),l=null,u=0;u<n;u++)i[u]=e.min(a[u]).value,o[u]=e.max(a[u]).value;for(var v=0;v<t;v++){l=[];for(var f=0;f<n;f++)l[f]=Math.random()*(o[f]-i[f])+i[f];s[v]=l}return s},ro=function(e,t,a,n,i){for(var o=1/0,s=0,l=0;l<t.length;l++){var u=Ia(a,e,t[l],n,i);u<o&&(o=u,s=l)}return s},to=function(e,t,a){for(var n=[],i=null,o=0;o<t.length;o++)i=t[o],a[i.id()]===e&&n.push(i);return n},Rv=function(e,t,a){return Math.abs(t-e)<=a},Ov=function(e,t,a){for(var n=0;n<e.length;n++)for(var i=0;i<e[n].length;i++){var o=Math.abs(e[n][i]-t[n][i]);if(o>a)return!1}return!0},Iv=function(e,t,a){for(var n=0;n<a;n++)if(e===t[n])return!0;return!1},ao=function(e,t){var a=new Array(t);if(e.length<50)for(var n=0;n<t;n++){for(var i=e[Math.floor(Math.random()*e.length)];Iv(i,a,n);)i=e[Math.floor(Math.random()*e.length)];a[n]=i}else for(var o=0;o<t;o++)a[o]=e[Math.floor(Math.random()*e.length)];return a},no=function(e,t,a){for(var n=0,i=0;i<t.length;i++)n+=Ia("manhattan",t[i],e,a,"kMedoids");return n},zv=function(e){var t=this.cy(),a=this.nodes(),n=null,i=Rn(e),o=new Array(i.k),s={},l;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,l=On(a,i.k,i.attributes)):qe(i.testCentroids)==="object"?l=i.testCentroids:l=On(a,i.k,i.attributes):l=On(a,i.k,i.attributes);for(var u=!0,v=0;u&&v<i.maxIterations;){for(var f=0;f<a.length;f++)n=a[f],s[n.id()]=ro(n,l,i.distance,i.attributes,"kMeans");u=!1;for(var c=0;c<i.k;c++){var h=to(c,a,s);if(h.length!==0){for(var d=i.attributes.length,m=l[c],p=new Array(d),g=new Array(d),y=0;y<d;y++){g[y]=0;for(var b=0;b<h.length;b++)n=h[b],g[y]+=i.attributes[y](n);p[y]=g[y]/h.length,Rv(p[y],m[y],i.sensitivityThreshold)||(u=!0)}l[c]=p,o[c]=t.collection(h)}}v++}return o},Nv=function(e){var t=this.cy(),a=this.nodes(),n=null,i=Rn(e),o=new Array(i.k),s,l={},u,v=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(qe(i.testCentroids)==="object"?s=i.testCentroids:s=ao(a,i.k)):s=ao(a,i.k);for(var f=!0,c=0;f&&c<i.maxIterations;){for(var h=0;h<a.length;h++)n=a[h],l[n.id()]=ro(n,s,i.distance,i.attributes,"kMedoids");f=!1;for(var d=0;d<s.length;d++){var m=to(d,a,l);if(m.length!==0){v[d]=no(s[d],m,i.attributes);for(var p=0;p<m.length;p++)u=no(m[p],m,i.attributes),u<v[d]&&(v[d]=u,s[d]=m[p],f=!0);o[d]=t.collection(m)}}c++}return o},Fv=function(e,t,a,n,i){for(var o,s,l=0;l<t.length;l++)for(var u=0;u<e.length;u++)n[l][u]=Math.pow(a[l][u],i.m);for(var v=0;v<e.length;v++)for(var f=0;f<i.attributes.length;f++){o=0,s=0;for(var c=0;c<t.length;c++)o+=n[c][v]*i.attributes[f](t[c]),s+=n[c][v];e[v][f]=o/s}},Vv=function(e,t,a,n,i){for(var o=0;o<e.length;o++)t[o]=e[o].slice();for(var s,l,u,v=2/(i.m-1),f=0;f<a.length;f++)for(var c=0;c<n.length;c++){s=0;for(var h=0;h<a.length;h++)l=Ia(i.distance,n[c],a[f],i.attributes,"cmeans"),u=Ia(i.distance,n[c],a[h],i.attributes,"cmeans"),s+=Math.pow(l/u,v);e[c][f]=1/s}},qv=function(e,t,a,n){for(var i=new Array(a.k),o=0;o<i.length;o++)i[o]=[];for(var s,l,u=0;u<t.length;u++){s=-1/0,l=-1;for(var v=0;v<t[0].length;v++)t[u][v]>s&&(s=t[u][v],l=v);i[l].push(e[u])}for(var f=0;f<i.length;f++)i[f]=n.collection(i[f]);return i},io=function(e){var t=this.cy(),a=this.nodes(),n=Rn(e),i,o,s,l,u;l=new Array(a.length);for(var v=0;v<a.length;v++)l[v]=new Array(n.k);s=new Array(a.length);for(var f=0;f<a.length;f++)s[f]=new Array(n.k);for(var c=0;c<a.length;c++){for(var h=0,d=0;d<n.k;d++)s[c][d]=Math.random(),h+=s[c][d];for(var m=0;m<n.k;m++)s[c][m]=s[c][m]/h}o=new Array(n.k);for(var p=0;p<n.k;p++)o[p]=new Array(n.attributes.length);u=new Array(a.length);for(var g=0;g<a.length;g++)u[g]=new Array(n.k);for(var y=!0,b=0;y&&b<n.maxIterations;)y=!1,Fv(o,a,s,u,n),Vv(s,l,o,a,n),Ov(s,l,n.sensitivityThreshold)||(y=!0),b++;return i=qv(a,s,n,t),{clusters:i,degreeOfMembership:s}},$v={kMeans:zv,kMedoids:Nv,fuzzyCMeans:io,fcm:io},Hv=Ke({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),Wv={single:"min",complete:"max"},Gv=function(e){var t=Hv(e),a=Wv[t.linkage];return a!=null&&(t.linkage=a),t},oo=function(e,t,a,n,i){for(var o=0,s=1/0,l,u=i.attributes,v=function(E,P){return Oa(i.distance,u.length,function(L){return u[L](E)},function(L){return u[L](P)},E,P)},f=0;f<e.length;f++){var c=e[f].key,h=a[c][n[c]];h<s&&(o=c,s=h)}if(i.mode==="threshold"&&s>=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var d=t[o],m=t[n[o]],p;i.mode==="dendrogram"?p={left:d,right:m,key:d.key}:p={value:d.value.concat(m.value),key:d.key},e[d.index]=p,e.splice(m.index,1),t[d.key]=p;for(var g=0;g<e.length;g++){var y=e[g];d.key===y.key?l=1/0:i.linkage==="min"?(l=a[d.key][y.key],a[d.key][y.key]>a[m.key][y.key]&&(l=a[m.key][y.key])):i.linkage==="max"?(l=a[d.key][y.key],a[d.key][y.key]<a[m.key][y.key]&&(l=a[m.key][y.key])):i.linkage==="mean"?l=(a[d.key][y.key]*d.size+a[m.key][y.key]*m.size)/(d.size+m.size):i.mode==="dendrogram"?l=v(y.value,d.value):l=v(y.value[0],d.value[0]),a[d.key][y.key]=a[y.key][d.key]=l}for(var b=0;b<e.length;b++){var w=e[b].key;if(n[w]===d.key||n[w]===m.key){for(var D=w,C=0;C<e.length;C++){var x=e[C].key;a[w][x]<a[w][D]&&(D=x)}n[w]=D}e[b].index=b}return d.key=m.key=d.index=m.index=null,!0},za=function r(e,t,a){e&&(e.value?t.push(e.value):(e.left&&r(e.left,t),e.right&&r(e.right,t)))},Kv=function r(e,t){if(!e)return"";if(e.left&&e.right){var a=r(e.left,t),n=r(e.right,t),i=t.add({group:"nodes",data:{id:a+","+n}});return t.add({group:"edges",data:{source:a,target:i.id()}}),t.add({group:"edges",data:{source:n,target:i.id()}}),i.id()}else if(e.value)return e.value.id()},Yv=function r(e,t,a){if(!e)return[];var n=[],i=[],o=[];return t===0?(e.left&&za(e.left,n),e.right&&za(e.right,i),o=n.concat(i),[a.collection(o)]):t===1?e.value?[a.collection(e.value)]:(e.left&&za(e.left,n),e.right&&za(e.right,i),[a.collection(n),a.collection(i)]):e.value?[a.collection(e.value)]:(e.left&&(n=r(e.left,t-1,a)),e.right&&(i=r(e.right,t-1,a)),n.concat(i))},so=function(e){for(var t=this.cy(),a=this.nodes(),n=Gv(e),i=n.attributes,o=function(b,w){return Oa(n.distance,i.length,function(D){return i[D](b)},function(D){return i[D](w)},b,w)},s=[],l=[],u=[],v=[],f=0;f<a.length;f++){var c={value:n.mode==="dendrogram"?a[f]:[a[f]],key:f,index:f};s[f]=c,v[f]=c,l[f]=[],u[f]=0}for(var h=0;h<s.length;h++)for(var d=0;d<=h;d++){var m=void 0;n.mode==="dendrogram"?m=h===d?1/0:o(s[h].value,s[d].value):m=h===d?1/0:o(s[h].value[0],s[d].value[0]),l[h][d]=m,l[d][h]=m,m<l[h][u[h]]&&(u[h]=d)}for(var p=oo(s,v,l,u,n);p;)p=oo(s,v,l,u,n);var g;return n.mode==="dendrogram"?(g=Yv(s[0],n.dendrogramDepth,t),n.addDendrogram&&Kv(s[0],t)):(g=new Array(s.length),s.forEach(function(y,b){y.key=y.index=null,g[b]=t.collection(y.value)})),g},Xv={hierarchicalClustering:so,hca:so},Uv=Ke({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),Zv=function(e){var t=e.damping,a=e.preference;.5<=t&&t<1||Ne("Damping must range on [0.5, 1). Got: ".concat(t));var n=["median","mean","min","max"];return n.some(function(i){return i===a})||ae(a)||Ne("Preference must be one of [".concat(n.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(a)),Uv(e)},Qv=function(e,t,a,n){var i=function(s,l){return n[l](s)};return-Oa(e,n.length,function(o){return i(t,o)},function(o){return i(a,o)},t,a)},_v=function(e,t){var a=null;return t==="median"?a=Zl(e):t==="mean"?a=Ul(e):t==="min"?a=Yl(e):t==="max"?a=Xl(e):a=t,a},Jv=function(e,t,a){for(var n=[],i=0;i<e;i++)t[i*e+i]+a[i*e+i]>0&&n.push(i);return n},uo=function(e,t,a){for(var n=[],i=0;i<e;i++){for(var o=-1,s=-1/0,l=0;l<a.length;l++){var u=a[l];t[i*e+u]>s&&(o=u,s=t[i*e+u])}o>0&&n.push(o)}for(var v=0;v<a.length;v++)n[a[v]]=a[v];return n},jv=function(e,t,a){for(var n=uo(e,t,a),i=0;i<a.length;i++){for(var o=[],s=0;s<n.length;s++)n[s]===a[i]&&o.push(s);for(var l=-1,u=-1/0,v=0;v<o.length;v++){for(var f=0,c=0;c<o.length;c++)f+=t[o[c]*e+o[v]];f>u&&(l=v,u=f)}a[i]=o[l]}return n=uo(e,t,a),n},lo=function(e){for(var t=this.cy(),a=this.nodes(),n=Zv(e),i={},o=0;o<a.length;o++)i[a[o].id()]=o;var s,l,u,v,f,c;s=a.length,l=s*s,u=new Array(l);for(var h=0;h<l;h++)u[h]=-1/0;for(var d=0;d<s;d++)for(var m=0;m<s;m++)d!==m&&(u[d*s+m]=Qv(n.distance,a[d],a[m],n.attributes));v=_v(u,n.preference);for(var p=0;p<s;p++)u[p*s+p]=v;f=new Array(l);for(var g=0;g<l;g++)f[g]=0;c=new Array(l);for(var y=0;y<l;y++)c[y]=0;for(var b=new Array(s),w=new Array(s),D=new Array(s),C=0;C<s;C++)b[C]=0,w[C]=0,D[C]=0;for(var x=new Array(s*n.minIterations),k=0;k<x.length;k++)x[k]=0;var E;for(E=0;E<n.maxIterations;E++){for(var P=0;P<s;P++){for(var L=-1/0,T=-1/0,A=-1,B=0,O=0;O<s;O++)b[O]=f[P*s+O],B=c[P*s+O]+u[P*s+O],B>=L?(T=L,L=B,A=O):B>T&&(T=B);for(var R=0;R<s;R++)f[P*s+R]=(1-n.damping)*(u[P*s+R]-L)+n.damping*b[R];f[P*s+A]=(1-n.damping)*(u[P*s+A]-T)+n.damping*b[A]}for(var M=0;M<s;M++){for(var I=0,V=0;V<s;V++)b[V]=c[V*s+M],w[V]=Math.max(0,f[V*s+M]),I+=w[V];I-=w[M],w[M]=f[M*s+M],I+=w[M];for(var G=0;G<s;G++)c[G*s+M]=(1-n.damping)*Math.min(0,I-w[G])+n.damping*b[G];c[M*s+M]=(1-n.damping)*(I-w[M])+n.damping*b[M]}for(var z=0,H=0;H<s;H++){var Y=c[H*s+H]+f[H*s+H]>0?1:0;x[E%n.minIterations*s+H]=Y,z+=Y}if(z>0&&(E>=n.minIterations-1||E==n.maxIterations-1)){for(var Q=0,X=0;X<s;X++){D[X]=0;for(var U=0;U<n.minIterations;U++)D[X]+=x[U*s+X];(D[X]===0||D[X]===n.minIterations)&&Q++}if(Q===s)break}}for(var N=Jv(s,f,c),_=jv(s,u,N),j={},J=0;J<N.length;J++)j[N[J]]=[];for(var ee=0;ee<a.length;ee++){var oe=i[a[ee].id()],he=_[oe];he!=null&&j[he].push(a[ee])}for(var re=new Array(N.length),te=0;te<N.length;te++)re[te]=t.collection(j[N[te]]);return re},ef={affinityPropagation:lo,ap:lo},rf=Ke({root:void 0,directed:!1}),tf={hierholzer:function(e){if(!Ce(e)){var t=arguments;e={root:t[0],directed:t[1]}}var a=rf(e),n=a.root,i=a.directed,o=this,s=!1,l,u,v;n&&(v=ve(n)?this.filter(n)[0].id():n[0].id());var f={},c={};i?o.forEach(function(y){var b=y.id();if(y.isNode()){var w=y.indegree(!0),D=y.outdegree(!0),C=w-D,x=D-w;C==1?l?s=!0:l=b:x==1?u?s=!0:u=b:(x>1||C>1)&&(s=!0),f[b]=[],y.outgoers().forEach(function(k){k.isEdge()&&f[b].push(k.id())})}else c[b]=[void 0,y.target().id()]}):o.forEach(function(y){var b=y.id();if(y.isNode()){var w=y.degree(!0);w%2&&(l?u?s=!0:u=b:l=b),f[b]=[],y.connectedEdges().forEach(function(D){return f[b].push(D.id())})}else c[b]=[y.source().id(),y.target().id()]});var h={found:!1,trail:void 0};if(s)return h;if(u&&l)if(i){if(v&&u!=v)return h;v=u}else{if(v&&u!=v&&l!=v)return h;v||(v=u)}else v||(v=o[0].id());var d=function(b){for(var w=b,D=[b],C,x,k;f[w].length;)C=f[w].shift(),x=c[C][0],k=c[C][1],w!=k?(f[k]=f[k].filter(function(E){return E!=C}),w=k):!i&&w!=x&&(f[x]=f[x].filter(function(E){return E!=C}),w=x),D.unshift(C),D.unshift(w);return D},m=[],p=[];for(p=d(v);p.length!=1;)f[p[0]].length==0?(m.unshift(o.getElementById(p.shift())),m.unshift(o.getElementById(p.shift()))):p=d(p.shift()).concat(p);m.unshift(o.getElementById(p.shift()));for(var g in f)if(f[g].length)return h;return h.found=!0,h.trail=this.spawn(m,!0),h}},Na=function(){var e=this,t={},a=0,n=0,i=[],o=[],s={},l=function(c,h){for(var d=o.length-1,m=[],p=e.spawn();o[d].x!=c||o[d].y!=h;)m.push(o.pop().edge),d--;m.push(o.pop().edge),m.forEach(function(g){var y=g.connectedNodes().intersection(e);p.merge(g),y.forEach(function(b){var w=b.id(),D=b.connectedEdges().intersection(e);p.merge(b),t[w].cutVertex?p.merge(D.filter(function(C){return C.isLoop()})):p.merge(D)})}),i.push(p)},u=function f(c,h,d){c===d&&(n+=1),t[h]={id:a,low:a++,cutVertex:!1};var m=e.getElementById(h).connectedEdges().intersection(e);if(m.size()===0)i.push(e.spawn(e.getElementById(h)));else{var p,g,y,b;m.forEach(function(w){p=w.source().id(),g=w.target().id(),y=p===h?g:p,y!==d&&(b=w.id(),s[b]||(s[b]=!0,o.push({x:h,y,edge:w})),y in t?t[h].low=Math.min(t[h].low,t[y].id):(f(c,y,h),t[h].low=Math.min(t[h].low,t[y].low),t[h].id<=t[y].low&&(t[h].cutVertex=!0,l(h,y))))})}};e.forEach(function(f){if(f.isNode()){var c=f.id();c in t||(n=0,u(c,c),t[c].cutVertex=n>1)}});var v=Object.keys(t).filter(function(f){return t[f].cutVertex}).map(function(f){return e.getElementById(f)});return{cut:e.spawn(v),components:i}},af={hopcroftTarjanBiconnected:Na,htbc:Na,htb:Na,hopcroftTarjanBiconnectedComponents:Na},Fa=function(){var e=this,t={},a=0,n=[],i=[],o=e.spawn(e),s=function l(u){i.push(u),t[u]={index:a,low:a++,explored:!1};var v=e.getElementById(u).connectedEdges().intersection(e);if(v.forEach(function(m){var p=m.target().id();p!==u&&(p in t||l(p),t[p].explored||(t[u].low=Math.min(t[u].low,t[p].low)))}),t[u].index===t[u].low){for(var f=e.spawn();;){var c=i.pop();if(f.merge(e.getElementById(c)),t[c].low=t[u].index,t[c].explored=!0,c===u)break}var h=f.edgesWith(f),d=f.merge(h);n.push(d),o=o.difference(d)}};return e.forEach(function(l){if(l.isNode()){var u=l.id();u in t||s(u)}}),{cut:o,components:n}},nf={tarjanStronglyConnected:Fa,tsc:Fa,tscc:Fa,tarjanStronglyConnectedComponents:Fa},vo={};[Xt,Ol,Il,Nl,Vl,$l,Gl,gv,gt,pt,An,Pv,$v,Xv,ef,tf,af,nf].forEach(function(r){de(vo,r)});var fo=0,co=1,ho=2,Mr=function r(e){if(!(this instanceof r))return new r(e);this.id="Thenable/1.0.7",this.state=fo,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};Mr.prototype={fulfill:function(e){return go(this,co,"fulfillValue",e)},reject:function(e){return go(this,ho,"rejectReason",e)},then:function(e,t){var a=this,n=new Mr;return a.onFulfilled.push(yo(e,n,"fulfill")),a.onRejected.push(yo(t,n,"reject")),po(a),n.proxy}};var go=function(e,t,a,n){return e.state===fo&&(e.state=t,e[a]=n,po(e)),e},po=function(e){e.state===co?mo(e,"onFulfilled",e.fulfillValue):e.state===ho&&mo(e,"onRejected",e.rejectReason)},mo=function(e,t,a){if(e[t].length!==0){var n=e[t];e[t]=[];var i=function(){for(var s=0;s<n.length;s++)n[s](a)};typeof setImmediate=="function"?setImmediate(i):setTimeout(i,0)}},yo=function(e,t,a){return function(n){if(typeof e!="function")t[a].call(t,n);else{var i;try{i=e(n)}catch(o){t.reject(o);return}of(t,i)}}},of=function r(e,t){if(e===t||e.proxy===t){e.reject(new TypeError("cannot resolve promise with itself"));return}var a;if(qe(t)==="object"&&t!==null||typeof t=="function")try{a=t.then}catch(i){e.reject(i);return}if(typeof a=="function"){var n=!1;try{a.call(t,function(i){n||(n=!0,i===t?e.reject(new TypeError("circular thenable chain")):r(e,i))},function(i){n||(n=!0,e.reject(i))})}catch(i){n||e.reject(i)}return}e.fulfill(t)};Mr.all=function(r){return new Mr(function(e,t){for(var a=new Array(r.length),n=0,i=function(l,u){a[l]=u,n++,n===r.length&&e(a)},o=0;o<r.length;o++)(function(s){var l=r[s],u=l!=null&&l.then!=null;if(u)l.then(function(f){i(s,f)},function(f){t(f)});else{var v=l;i(s,v)}})(o)})},Mr.resolve=function(r){return new Mr(function(e,t){e(r)})},Mr.reject=function(r){return new Mr(function(e,t){t(r)})};var yt=typeof Promise!="undefined"?Promise:Mr,In=function(e,t,a){var n=yn(e),i=!n,o=this._private=de({duration:1e3},t,a);if(o.target=e,o.style=o.style||o.css,o.started=!1,o.playing=!1,o.hooked=!1,o.applying=!1,o.progress=0,o.completes=[],o.frames=[],o.complete&&ze(o.complete)&&o.completes.push(o.complete),i){var s=e.position();o.startPosition=o.startPosition||{x:s.x,y:s.y},o.startStyle=o.startStyle||e.cy().style().getAnimationStartStyle(e,o.style)}if(n){var l=e.pan();o.startPan={x:l.x,y:l.y},o.startZoom=e.zoom()}this.length=1,this[0]=this},et=In.prototype;de(et,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var t,a=e.target._private.animation;e.queue?t=a.queue:t=a.current,t.push(this),vr(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return e.progress===1&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var t=this._private;return e===void 0?t.progress*t.duration:this.progress(e/t.duration)},progress:function(e){var t=this._private,a=t.playing;return e===void 0?t.progress:(a&&this.pause(),t.progress=e,t.started=!1,a&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var e=this._private,t=e.playing;t&&this.pause(),e.progress=1-e.progress,e.started=!1;var a=function(u,v){var f=e[u];f!=null&&(e[u]=e[v],e[v]=f)};if(a("zoom","startZoom"),a("pan","startPan"),a("position","startPosition"),e.style)for(var n=0;n<e.style.length;n++){var i=e.style[n],o=i.name,s=e.startStyle[o];e.startStyle[o]=i,e.style[n]=s}return t&&this.play(),this},promise:function(e){var t=this._private,a;switch(e){case"frame":a=t.frames;break;default:case"complete":case"completed":a=t.completes}return new yt(function(n,i){a.push(function(){n()})})}}),et.complete=et.completed,et.run=et.play,et.running=et.playing;var sf={animated:function(){return function(){var t=this,a=t.length!==void 0,n=a?t:[t],i=this._private.cy||this;if(!i.styleEnabled())return!1;var o=n[0];if(o)return o._private.animation.current.length>0}},clearQueue:function(){return function(){var t=this,a=t.length!==void 0,n=a?t:[t],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var o=0;o<n.length;o++){var s=n[o];s._private.animation.queue=[]}return this}},delay:function(){return function(t,a){var n=this._private.cy||this;return n.styleEnabled()?this.animate({delay:t,duration:t,complete:a}):this}},delayAnimation:function(){return function(t,a){var n=this._private.cy||this;return n.styleEnabled()?this.animation({delay:t,duration:t,complete:a}):this}},animation:function(){return function(t,a){var n=this,i=n.length!==void 0,o=i?n:[n],s=this._private.cy||this,l=!i,u=!l;if(!s.styleEnabled())return this;var v=s.style();t=de({},t,a);var f=Object.keys(t).length===0;if(f)return new In(o[0],t);switch(t.duration===void 0&&(t.duration=400),t.duration){case"slow":t.duration=600;break;case"fast":t.duration=200;break}if(u&&(t.style=v.getPropsList(t.style||t.css),t.css=void 0),u&&t.renderedPosition!=null){var c=t.renderedPosition,h=s.pan(),d=s.zoom();t.position=qi(c,d,h)}if(l&&t.panBy!=null){var m=t.panBy,p=s.pan();t.pan={x:p.x+m.x,y:p.y+m.y}}var g=t.center||t.centre;if(l&&g!=null){var y=s.getCenterPan(g.eles,t.zoom);y!=null&&(t.pan=y)}if(l&&t.fit!=null){var b=t.fit,w=s.getFitViewport(b.eles||b.boundingBox,b.padding);w!=null&&(t.pan=w.pan,t.zoom=w.zoom)}if(l&&Ce(t.zoom)){var D=s.getZoomedViewport(t.zoom);D!=null?(D.zoomed&&(t.zoom=D.zoom),D.panned&&(t.pan=D.pan)):t.zoom=null}return new In(o[0],t)}},animate:function(){return function(t,a){var n=this,i=n.length!==void 0,o=i?n:[n],s=this._private.cy||this;if(!s.styleEnabled())return this;a&&(t=de({},t,a));for(var l=0;l<o.length;l++){var u=o[l],v=u.animated()&&(t.queue===void 0||t.queue),f=u.animation(t,v?{queue:!0}:void 0);f.play()}return this}},stop:function(){return function(t,a){var n=this,i=n.length!==void 0,o=i?n:[n],s=this._private.cy||this;if(!s.styleEnabled())return this;for(var l=0;l<o.length;l++){for(var u=o[l],v=u._private,f=v.animation.current,c=0;c<f.length;c++){var h=f[c],d=h._private;a&&(d.duration=0)}t&&(v.animation.queue=[]),a||(v.animation.current=[])}return s.notify("draw"),this}}},uf=Array.isArray,Va=uf,lf=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,vf=/^\w*$/;function ff(r,e){if(Va(r))return!1;var t=typeof r;return t=="number"||t=="symbol"||t=="boolean"||r==null||Wt(r)?!0:vf.test(r)||!lf.test(r)||e!=null&&r in Object(e)}var cf=ff,df="[object AsyncFunction]",hf="[object Function]",gf="[object GeneratorFunction]",pf="[object Proxy]";function mf(r){if(!Zr(r))return!1;var e=Di(r);return e==hf||e==gf||e==df||e==pf}var yf=mf,bf=xa["__core-js_shared__"],zn=bf,bo=function(){var r=/[^.]+$/.exec(zn&&zn.keys&&zn.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function wf(r){return!!bo&&bo in r}var xf=wf,Ef=Function.prototype,Cf=Ef.toString;function Sf(r){if(r!=null){try{return Cf.call(r)}catch(e){}try{return r+""}catch(e){}}return""}var Tf=Sf,Df=/[\\^$.*+?()[\]{}|]/g,kf=/^\[object .+?Constructor\]$/,Pf=Function.prototype,Bf=Object.prototype,Lf=Pf.toString,Mf=Bf.hasOwnProperty,Af=RegExp("^"+Lf.call(Mf).replace(Df,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Rf(r){if(!Zr(r)||xf(r))return!1;var e=yf(r)?Af:kf;return e.test(Tf(r))}var Of=Rf;function If(r,e){return r==null?void 0:r[e]}var zf=If;function Nf(r,e){var t=zf(r,e);return Of(t)?t:void 0}var Nn=Nf,Ff=Nn(Object,"create"),ea=Ff;function Vf(){this.__data__=ea?ea(null):{},this.size=0}var qf=Vf;function $f(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}var Hf=$f,Wf="__lodash_hash_undefined__",Gf=Object.prototype,Kf=Gf.hasOwnProperty;function Yf(r){var e=this.__data__;if(ea){var t=e[r];return t===Wf?void 0:t}return Kf.call(e,r)?e[r]:void 0}var Xf=Yf,Uf=Object.prototype,Zf=Uf.hasOwnProperty;function Qf(r){var e=this.__data__;return ea?e[r]!==void 0:Zf.call(e,r)}var _f=Qf,Jf="__lodash_hash_undefined__";function jf(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=ea&&e===void 0?Jf:e,this}var ec=jf;function bt(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var a=r[e];this.set(a[0],a[1])}}bt.prototype.clear=qf,bt.prototype.delete=Hf,bt.prototype.get=Xf,bt.prototype.has=_f,bt.prototype.set=ec;var wo=bt;function rc(){this.__data__=[],this.size=0}var tc=rc;function ac(r,e){return r===e||r!==r&&e!==e}var xo=ac;function nc(r,e){for(var t=r.length;t--;)if(xo(r[t][0],e))return t;return-1}var qa=nc,ic=Array.prototype,oc=ic.splice;function sc(r){var e=this.__data__,t=qa(e,r);if(t<0)return!1;var a=e.length-1;return t==a?e.pop():oc.call(e,t,1),--this.size,!0}var uc=sc;function lc(r){var e=this.__data__,t=qa(e,r);return t<0?void 0:e[t][1]}var vc=lc;function fc(r){return qa(this.__data__,r)>-1}var cc=fc;function dc(r,e){var t=this.__data__,a=qa(t,r);return a<0?(++this.size,t.push([r,e])):t[a][1]=e,this}var hc=dc;function wt(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var a=r[e];this.set(a[0],a[1])}}wt.prototype.clear=tc,wt.prototype.delete=uc,wt.prototype.get=vc,wt.prototype.has=cc,wt.prototype.set=hc;var gc=wt,pc=Nn(xa,"Map"),mc=pc;function yc(){this.size=0,this.__data__={hash:new wo,map:new(mc||gc),string:new wo}}var bc=yc;function wc(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}var xc=wc;function Ec(r,e){var t=r.__data__;return xc(e)?t[typeof e=="string"?"string":"hash"]:t.map}var $a=Ec;function Cc(r){var e=$a(this,r).delete(r);return this.size-=e?1:0,e}var Sc=Cc;function Tc(r){return $a(this,r).get(r)}var Dc=Tc;function kc(r){return $a(this,r).has(r)}var Pc=kc;function Bc(r,e){var t=$a(this,r),a=t.size;return t.set(r,e),this.size+=t.size==a?0:1,this}var Lc=Bc;function xt(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var a=r[e];this.set(a[0],a[1])}}xt.prototype.clear=bc,xt.prototype.delete=Sc,xt.prototype.get=Dc,xt.prototype.has=Pc,xt.prototype.set=Lc;var Eo=xt,Mc="Expected a function";function Fn(r,e){if(typeof r!="function"||e!=null&&typeof e!="function")throw new TypeError(Mc);var t=function(){var a=arguments,n=e?e.apply(this,a):a[0],i=t.cache;if(i.has(n))return i.get(n);var o=r.apply(this,a);return t.cache=i.set(n,o)||i,o};return t.cache=new(Fn.Cache||Eo),t}Fn.Cache=Eo;var Ac=Fn,Rc=500;function Oc(r){var e=Ac(r,function(a){return t.size===Rc&&t.clear(),a}),t=e.cache;return e}var Ic=Oc,zc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Nc=/\\(\\)?/g,Fc=Ic(function(r){var e=[];return r.charCodeAt(0)===46&&e.push(""),r.replace(zc,function(t,a,n,i){e.push(n?i.replace(Nc,"$1"):a||t)}),e}),Co=Fc;function Vc(r,e){for(var t=-1,a=r==null?0:r.length,n=Array(a);++t<a;)n[t]=e(r[t],t,r);return n}var So=Vc,qc=1/0,To=lt?lt.prototype:void 0,Do=To?To.toString:void 0;function ko(r){if(typeof r=="string")return r;if(Va(r))return So(r,ko)+"";if(Wt(r))return Do?Do.call(r):"";var e=r+"";return e=="0"&&1/r==-qc?"-0":e}var $c=ko;function Hc(r){return r==null?"":$c(r)}var Po=Hc;function Wc(r,e){return Va(r)?r:cf(r,e)?[r]:Co(Po(r))}var Bo=Wc,Gc=1/0;function Kc(r){if(typeof r=="string"||Wt(r))return r;var e=r+"";return e=="0"&&1/r==-Gc?"-0":e}var Vn=Kc;function Yc(r,e){e=Bo(e,r);for(var t=0,a=e.length;r!=null&&t<a;)r=r[Vn(e[t++])];return t&&t==a?r:void 0}var Xc=Yc;function Uc(r,e,t){var a=r==null?void 0:Xc(r,e);return a===void 0?t:a}var Zc=Uc,Qc=function(){try{var r=Nn(Object,"defineProperty");return r({},"",{}),r}catch(e){}}(),Lo=Qc;function _c(r,e,t){e=="__proto__"&&Lo?Lo(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t}var Jc=_c,jc=Object.prototype,ed=jc.hasOwnProperty;function rd(r,e,t){var a=r[e];(!(ed.call(r,e)&&xo(a,t))||t===void 0&&!(e in r))&&Jc(r,e,t)}var td=rd,ad=9007199254740991,nd=/^(?:0|[1-9]\d*)$/;function id(r,e){var t=typeof r;return e=e==null?ad:e,!!e&&(t=="number"||t!="symbol"&&nd.test(r))&&r>-1&&r%1==0&&r<e}var od=id;function sd(r,e,t,a){if(!Zr(r))return r;e=Bo(e,r);for(var n=-1,i=e.length,o=i-1,s=r;s!=null&&++n<i;){var l=Vn(e[n]),u=t;if(l==="__proto__"||l==="constructor"||l==="prototype")return r;if(n!=o){var v=s[l];u=a?a(v,l,s):void 0,u===void 0&&(u=Zr(v)?v:od(e[n+1])?[]:{})}td(s,l,u),s=s[l]}return r}var ud=sd;function ld(r,e,t){return r==null?r:ud(r,e,t)}var vd=ld;function fd(r,e){var t=-1,a=r.length;for(e||(e=Array(a));++t<a;)e[t]=r[t];return e}var cd=fd;function dd(r){return Va(r)?So(r,Vn):Wt(r)?[r]:cd(Co(Po(r)))}var hd=dd,gd={data:function(e){var t={field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(n){},beforeSet:function(n,i){},onSet:function(n){},canSet:function(n){return!0}};return e=de({},t,e),function(n,i){var o=e,s=this,l=s.length!==void 0,u=l?s:[s],v=l?s[0]:s;if(ve(n)){var f=n.indexOf(".")!==-1,c=f&&hd(n);if(o.allowGetting&&i===void 0){var h;return v&&(o.beforeGet(v),c&&v._private[o.field][n]===void 0?h=Zc(v._private[o.field],c):h=v._private[o.field][n]),h}else if(o.allowSetting&&i!==void 0){var d=!o.immutableKeys[n];if(d){var m=di({},n,i);o.beforeSet(s,m);for(var p=0,g=u.length;p<g;p++){var y=u[p];o.canSet(y)&&(c&&v._private[o.field][n]===void 0?vd(y._private[o.field],c,i):y._private[o.field][n]=i)}o.updateStyle&&s.updateStyle(),o.onSet(s),o.settingTriggersEvent&&s[o.triggerFnName](o.settingEvent)}}}else if(o.allowSetting&&Ce(n)){var b=n,w,D,C=Object.keys(b);o.beforeSet(s,b);for(var x=0;x<C.length;x++){w=C[x],D=b[w];var k=!o.immutableKeys[w];if(k)for(var E=0;E<u.length;E++){var P=u[E];o.canSet(P)&&(P._private[o.field][w]=D)}}o.updateStyle&&s.updateStyle(),o.onSet(s),o.settingTriggersEvent&&s[o.triggerFnName](o.settingEvent)}else if(o.allowBinding&&ze(n)){var L=n;s.on(o.bindingEvent,L)}else if(o.allowGetting&&n===void 0){var T;return v&&(o.beforeGet(v),T=v._private[o.field]),T}return s}},removeData:function(e){var t={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return e=de({},t,e),function(n){var i=e,o=this,s=o.length!==void 0,l=s?o:[o];if(ve(n)){for(var u=n.split(/\s+/),v=u.length,f=0;f<v;f++){var c=u[f];if(!Ir(c)){var h=!i.immutableKeys[c];if(h)for(var d=0,m=l.length;d<m;d++)l[d]._private[i.field][c]=void 0}}i.triggerEvent&&o[i.triggerFnName](i.event)}else if(n===void 0){for(var p=0,g=l.length;p<g;p++)for(var y=l[p]._private[i.field],b=Object.keys(y),w=0;w<b.length;w++){var D=b[w],C=!i.immutableKeys[D];C&&(y[D]=void 0)}i.triggerEvent&&o[i.triggerFnName](i.event)}return o}}},pd={eventAliasesOn:function(e){var t=e;t.addListener=t.listen=t.bind=t.on,t.unlisten=t.unbind=t.off=t.removeListener,t.trigger=t.emit,t.pon=t.promiseOn=function(a,n){var i=this,o=Array.prototype.slice.call(arguments,0);return new yt(function(s,l){var u=function(h){i.off.apply(i,f),s(h)},v=o.concat([u]),f=v.concat([]);i.on.apply(i,v)})}}},Le={};[sf,gd,pd].forEach(function(r){de(Le,r)});var md={animate:Le.animate(),animation:Le.animation(),animated:Le.animated(),clearQueue:Le.clearQueue(),delay:Le.delay(),delayAnimation:Le.delayAnimation(),stop:Le.stop()},Ha={classes:function(e){var t=this;if(e===void 0){var a=[];return t[0]._private.classes.forEach(function(d){return a.push(d)}),a}else Ae(e)||(e=(e||"").match(/\S+/g)||[]);for(var n=[],i=new ft(e),o=0;o<t.length;o++){for(var s=t[o],l=s._private,u=l.classes,v=!1,f=0;f<e.length;f++){var c=e[f],h=u.has(c);if(!h){v=!0;break}}v||(v=u.size!==e.length),v&&(l.classes=i,n.push(s))}return n.length>0&&this.spawn(n).updateStyle().emit("class"),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return t!=null&&t._private.classes.has(e)},toggleClass:function(e,t){Ae(e)||(e=e.match(/\S+/g)||[]);for(var a=this,n=t===void 0,i=[],o=0,s=a.length;o<s;o++)for(var l=a[o],u=l._private.classes,v=!1,f=0;f<e.length;f++){var c=e[f],h=u.has(c),d=!1;t||n&&!h?(u.add(c),d=!0):(!t||n&&h)&&(u.delete(c),d=!0),!v&&d&&(i.push(l),v=!0)}return i.length>0&&this.spawn(i).updateStyle().emit("class"),a},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var a=this;if(t==null)t=250;else if(t===0)return a;return a.addClass(e),setTimeout(function(){a.removeClass(e)},t),a}};Ha.className=Ha.classNames=Ha.classes;var Se={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:He,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Se.variable="(?:[\\w-.]|(?:\\\\"+Se.metaChar+"))+",Se.className="(?:[\\w-]|(?:\\\\"+Se.metaChar+"))+",Se.value=Se.string+"|"+Se.number,Se.id=Se.variable,function(){var r,e,t;for(r=Se.comparatorOp.split("|"),t=0;t<r.length;t++)e=r[t],Se.comparatorOp+="|@"+e;for(r=Se.comparatorOp.split("|"),t=0;t<r.length;t++)e=r[t],!(e.indexOf("!")>=0)&&e!=="="&&(Se.comparatorOp+="|\\!"+e)}();var Me=function(){return{checks:[]}},ne={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},qn=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(r,e){return Pu(r.selector,e.selector)}),yd=function(){for(var r={},e,t=0;t<qn.length;t++)e=qn[t],r[e.selector]=e.matches;return r}(),bd=function(e,t){return yd[e](t)},wd="("+qn.map(function(r){return r.selector}).join("|")+")",Et=function(e){return e.replace(new RegExp("\\\\("+Se.metaChar+")","g"),function(t,a){return a})},qr=function(e,t,a){e[e.length-1]=a},$n=[{name:"group",query:!0,regex:"("+Se.group+")",populate:function(e,t,a){var n=gr(a,1),i=n[0];t.checks.push({type:ne.GROUP,value:i==="*"?i:i+"s"})}},{name:"state",query:!0,regex:wd,populate:function(e,t,a){var n=gr(a,1),i=n[0];t.checks.push({type:ne.STATE,value:i})}},{name:"id",query:!0,regex:"\\#("+Se.id+")",populate:function(e,t,a){var n=gr(a,1),i=n[0];t.checks.push({type:ne.ID,value:Et(i)})}},{name:"className",query:!0,regex:"\\.("+Se.className+")",populate:function(e,t,a){var n=gr(a,1),i=n[0];t.checks.push({type:ne.CLASS,value:Et(i)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+Se.variable+")\\s*\\]",populate:function(e,t,a){var n=gr(a,1),i=n[0];t.checks.push({type:ne.DATA_EXIST,field:Et(i)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+Se.variable+")\\s*("+Se.comparatorOp+")\\s*("+Se.value+")\\s*\\]",populate:function(e,t,a){var n=gr(a,3),i=n[0],o=n[1],s=n[2],l=new RegExp("^"+Se.string+"$").exec(s)!=null;l?s=s.substring(1,s.length-1):s=parseFloat(s),t.checks.push({type:ne.DATA_COMPARE,field:Et(i),operator:o,value:s})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+Se.boolOp+")\\s*("+Se.variable+")\\s*\\]",populate:function(e,t,a){var n=gr(a,2),i=n[0],o=n[1];t.checks.push({type:ne.DATA_BOOL,field:Et(o),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+Se.meta+")\\s*("+Se.comparatorOp+")\\s*("+Se.number+")\\s*\\]\\]",populate:function(e,t,a){var n=gr(a,3),i=n[0],o=n[1],s=n[2];t.checks.push({type:ne.META_COMPARE,field:Et(i),operator:o,value:parseFloat(s)})}},{name:"nextQuery",separator:!0,regex:Se.separator,populate:function(e,t){var a=e.currentSubject,n=e.edgeCount,i=e.compoundCount,o=e[e.length-1];a!=null&&(o.subject=a,e.currentSubject=null),o.edgeCount=n,o.compoundCount=i,e.edgeCount=0,e.compoundCount=0;var s=e[e.length++]=Me();return s}},{name:"directedEdge",separator:!0,regex:Se.directedEdge,populate:function(e,t){if(e.currentSubject==null){var a=Me(),n=t,i=Me();return a.checks.push({type:ne.DIRECTED_EDGE,source:n,target:i}),qr(e,t,a),e.edgeCount++,i}else{var o=Me(),s=t,l=Me();return o.checks.push({type:ne.NODE_SOURCE,source:s,target:l}),qr(e,t,o),e.edgeCount++,l}}},{name:"undirectedEdge",separator:!0,regex:Se.undirectedEdge,populate:function(e,t){if(e.currentSubject==null){var a=Me(),n=t,i=Me();return a.checks.push({type:ne.UNDIRECTED_EDGE,nodes:[n,i]}),qr(e,t,a),e.edgeCount++,i}else{var o=Me(),s=t,l=Me();return o.checks.push({type:ne.NODE_NEIGHBOR,node:s,neighbor:l}),qr(e,t,o),l}}},{name:"child",separator:!0,regex:Se.child,populate:function(e,t){if(e.currentSubject==null){var a=Me(),n=Me(),i=e[e.length-1];return a.checks.push({type:ne.CHILD,parent:i,child:n}),qr(e,t,a),e.compoundCount++,n}else if(e.currentSubject===t){var o=Me(),s=e[e.length-1],l=Me(),u=Me(),v=Me(),f=Me();return o.checks.push({type:ne.COMPOUND_SPLIT,left:s,right:l,subject:u}),u.checks=t.checks,t.checks=[{type:ne.TRUE}],f.checks.push({type:ne.TRUE}),l.checks.push({type:ne.PARENT,parent:f,child:v}),qr(e,s,o),e.currentSubject=u,e.compoundCount++,v}else{var c=Me(),h=Me(),d=[{type:ne.PARENT,parent:c,child:h}];return c.checks=t.checks,t.checks=d,e.compoundCount++,h}}},{name:"descendant",separator:!0,regex:Se.descendant,populate:function(e,t){if(e.currentSubject==null){var a=Me(),n=Me(),i=e[e.length-1];return a.checks.push({type:ne.DESCENDANT,ancestor:i,descendant:n}),qr(e,t,a),e.compoundCount++,n}else if(e.currentSubject===t){var o=Me(),s=e[e.length-1],l=Me(),u=Me(),v=Me(),f=Me();return o.checks.push({type:ne.COMPOUND_SPLIT,left:s,right:l,subject:u}),u.checks=t.checks,t.checks=[{type:ne.TRUE}],f.checks.push({type:ne.TRUE}),l.checks.push({type:ne.ANCESTOR,ancestor:f,descendant:v}),qr(e,s,o),e.currentSubject=u,e.compoundCount++,v}else{var c=Me(),h=Me(),d=[{type:ne.ANCESTOR,ancestor:c,descendant:h}];return c.checks=t.checks,t.checks=d,e.compoundCount++,h}}},{name:"subject",modifier:!0,regex:Se.subject,populate:function(e,t){if(e.currentSubject!=null&&e.currentSubject!==t)return Be("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=t;var a=e[e.length-1],n=a.checks[0],i=n==null?null:n.type;i===ne.DIRECTED_EDGE?n.type=ne.NODE_TARGET:i===ne.UNDIRECTED_EDGE&&(n.type=ne.NODE_NEIGHBOR,n.node=n.nodes[1],n.neighbor=n.nodes[0],n.nodes=null)}}];$n.forEach(function(r){return r.regexObj=new RegExp("^"+r.regex)});var xd=function(e){for(var t,a,n,i=0;i<$n.length;i++){var o=$n[i],s=o.name,l=e.match(o.regexObj);if(l!=null){a=l,t=o,n=s;var u=l[0];e=e.substring(u.length);break}}return{expr:t,match:a,name:n,remaining:e}},Ed=function(e){var t=e.match(/^\s+/);if(t){var a=t[0];e=e.substring(a.length)}return e},Cd=function(e){var t=this,a=t.inputText=e,n=t[0]=Me();for(t.length=1,a=Ed(a);;){var i=xd(a);if(i.expr==null)return Be("The selector `"+e+"`is invalid"),!1;var o=i.match.slice(1),s=i.expr.populate(t,n,o);if(s===!1)return!1;if(s!=null&&(n=s),a=i.remaining,a.match(/^\s*$/))break}var l=t[t.length-1];t.currentSubject!=null&&(l.subject=t.currentSubject),l.edgeCount=t.edgeCount,l.compoundCount=t.compoundCount;for(var u=0;u<t.length;u++){var v=t[u];if(v.compoundCount>0&&v.edgeCount>0)return Be("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(v.edgeCount>1)return Be("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;v.edgeCount===1&&Be("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},Sd=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(v){return v==null?"":v},t=function(v){return ve(v)?'"'+v+'"':e(v)},a=function(v){return" "+v+" "},n=function(v,f){var c=v.type,h=v.value;switch(c){case ne.GROUP:{var d=e(h);return d.substring(0,d.length-1)}case ne.DATA_COMPARE:{var m=v.field,p=v.operator;return"["+m+a(e(p))+t(h)+"]"}case ne.DATA_BOOL:{var g=v.operator,y=v.field;return"["+e(g)+y+"]"}case ne.DATA_EXIST:{var b=v.field;return"["+b+"]"}case ne.META_COMPARE:{var w=v.operator,D=v.field;return"[["+D+a(e(w))+t(h)+"]]"}case ne.STATE:return h;case ne.ID:return"#"+h;case ne.CLASS:return"."+h;case ne.PARENT:case ne.CHILD:return i(v.parent,f)+a(">")+i(v.child,f);case ne.ANCESTOR:case ne.DESCENDANT:return i(v.ancestor,f)+" "+i(v.descendant,f);case ne.COMPOUND_SPLIT:{var C=i(v.left,f),x=i(v.subject,f),k=i(v.right,f);return C+(C.length>0?" ":"")+x+k}case ne.TRUE:return""}},i=function(v,f){return v.checks.reduce(function(c,h,d){return c+(f===v&&d===0?"$":"")+n(h,f)},"")},o="",s=0;s<this.length;s++){var l=this[s];o+=i(l,l.subject),this.length>1&&s<this.length-1&&(o+=", ")}return this.toStringCache=o,o},Td={parse:Cd,toString:Sd},Mo=function(e,t,a){var n,i=ve(e),o=ae(e),s=ve(a),l,u,v=!1,f=!1,c=!1;switch(t.indexOf("!")>=0&&(t=t.replace("!",""),f=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),v=!0),(i||s||v)&&(l=!i&&!o?"":""+e,u=""+a),v&&(e=l=l.toLowerCase(),a=u=u.toLowerCase()),t){case"*=":n=l.indexOf(u)>=0;break;case"$=":n=l.indexOf(u,l.length-u.length)>=0;break;case"^=":n=l.indexOf(u)===0;break;case"=":n=e===a;break;case">":c=!0,n=e>a;break;case">=":c=!0,n=e>=a;break;case"<":c=!0,n=e<a;break;case"<=":c=!0,n=e<=a;break;default:n=!1;break}return f&&(e!=null||!c)&&(n=!n),n},Dd=function(e,t){switch(t){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},kd=function(e){return e!==void 0},Hn=function(e,t){return e.data(t)},Pd=function(e,t){return e[t]()},Fe=[],Ie=function(e,t){return e.checks.every(function(a){return Fe[a.type](a,t)})};Fe[ne.GROUP]=function(r,e){var t=r.value;return t==="*"||t===e.group()},Fe[ne.STATE]=function(r,e){var t=r.value;return bd(t,e)},Fe[ne.ID]=function(r,e){var t=r.value;return e.id()===t},Fe[ne.CLASS]=function(r,e){var t=r.value;return e.hasClass(t)},Fe[ne.META_COMPARE]=function(r,e){var t=r.field,a=r.operator,n=r.value;return Mo(Pd(e,t),a,n)},Fe[ne.DATA_COMPARE]=function(r,e){var t=r.field,a=r.operator,n=r.value;return Mo(Hn(e,t),a,n)},Fe[ne.DATA_BOOL]=function(r,e){var t=r.field,a=r.operator;return Dd(Hn(e,t),a)},Fe[ne.DATA_EXIST]=function(r,e){var t=r.field;return r.operator,kd(Hn(e,t))},Fe[ne.UNDIRECTED_EDGE]=function(r,e){var t=r.nodes[0],a=r.nodes[1],n=e.source(),i=e.target();return Ie(t,n)&&Ie(a,i)||Ie(a,n)&&Ie(t,i)},Fe[ne.NODE_NEIGHBOR]=function(r,e){return Ie(r.node,e)&&e.neighborhood().some(function(t){return t.isNode()&&Ie(r.neighbor,t)})},Fe[ne.DIRECTED_EDGE]=function(r,e){return Ie(r.source,e.source())&&Ie(r.target,e.target())},Fe[ne.NODE_SOURCE]=function(r,e){return Ie(r.source,e)&&e.outgoers().some(function(t){return t.isNode()&&Ie(r.target,t)})},Fe[ne.NODE_TARGET]=function(r,e){return Ie(r.target,e)&&e.incomers().some(function(t){return t.isNode()&&Ie(r.source,t)})},Fe[ne.CHILD]=function(r,e){return Ie(r.child,e)&&Ie(r.parent,e.parent())},Fe[ne.PARENT]=function(r,e){return Ie(r.parent,e)&&e.children().some(function(t){return Ie(r.child,t)})},Fe[ne.DESCENDANT]=function(r,e){return Ie(r.descendant,e)&&e.ancestors().some(function(t){return Ie(r.ancestor,t)})},Fe[ne.ANCESTOR]=function(r,e){return Ie(r.ancestor,e)&&e.descendants().some(function(t){return Ie(r.descendant,t)})},Fe[ne.COMPOUND_SPLIT]=function(r,e){return Ie(r.subject,e)&&Ie(r.left,e)&&Ie(r.right,e)},Fe[ne.TRUE]=function(){return!0},Fe[ne.COLLECTION]=function(r,e){var t=r.value;return t.has(e)},Fe[ne.FILTER]=function(r,e){var t=r.value;return t(e)};var Bd=function(e){var t=this;if(t.length===1&&t[0].checks.length===1&&t[0].checks[0].type===ne.ID)return e.getElementById(t[0].checks[0].value).collection();var a=function(i){for(var o=0;o<t.length;o++){var s=t[o];if(Ie(s,i))return!0}return!1};return t.text()==null&&(a=function(){return!0}),e.filter(a)},Ld=function(e){for(var t=this,a=0;a<t.length;a++){var n=t[a];if(Ie(n,e))return!0}return!1},Md={matches:Ld,filter:Bd},$r=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||ve(e)&&e.match(/^\s*$/)||(vr(e)?this.addQuery({checks:[{type:ne.COLLECTION,value:e.collection()}]}):ze(e)?this.addQuery({checks:[{type:ne.FILTER,value:e}]}):ve(e)?this.parse(e)||(this.invalid=!0):Ne("A selector must be created from a string; found "))},Hr=$r.prototype;[Td,Md].forEach(function(r){return de(Hr,r)}),Hr.text=function(){return this.inputText},Hr.size=function(){return this.length},Hr.eq=function(r){return this[r]},Hr.sameText=function(r){return!this.invalid&&!r.invalid&&this.text()===r.text()},Hr.addQuery=function(r){this[this.length++]=r},Hr.selector=Hr.toString;var Wr={allAre:function(e){var t=new $r(e);return this.every(function(a){return t.matches(a)})},is:function(e){var t=new $r(e);return this.some(function(a){return t.matches(a)})},some:function(e,t){for(var a=0;a<this.length;a++){var n=t?e.apply(t,[this[a],a,this]):e(this[a],a,this);if(n)return!0}return!1},every:function(e,t){for(var a=0;a<this.length;a++){var n=t?e.apply(t,[this[a],a,this]):e(this[a],a,this);if(!n)return!1}return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var t=this.length,a=e.length;return t!==a?!1:t===1?this[0]===e[0]:this.every(function(n){return e.hasElementWithId(n.id())})},anySame:function(e){return e=this.cy().collection(e),this.some(function(t){return e.hasElementWithId(t.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var t=this.neighborhood();return e.every(function(a){return t.hasElementWithId(a.id())})},contains:function(e){e=this.cy().collection(e);var t=this;return e.every(function(a){return t.hasElementWithId(a.id())})}};Wr.allAreNeighbours=Wr.allAreNeighbors,Wr.has=Wr.contains,Wr.equal=Wr.equals=Wr.same;var cr=function(e,t){return function(n,i,o,s){var l=n,u=this,v;if(l==null?v="":vr(l)&&l.length===1&&(v=l.id()),u.length===1&&v){var f=u[0]._private,c=f.traversalCache=f.traversalCache||{},h=c[t]=c[t]||[],d=Qr(v),m=h[d];return m||(h[d]=e.call(u,n,i,o,s))}else return e.call(u,n,i,o,s)}},Ct={parent:function(e){var t=[];if(this.length===1){var a=this[0]._private.parent;if(a)return a}for(var n=0;n<this.length;n++){var i=this[n],o=i._private.parent;o&&t.push(o)}return this.spawn(t,!0).filter(e)},parents:function(e){for(var t=[],a=this.parent();a.nonempty();){for(var n=0;n<a.length;n++){var i=a[n];t.push(i)}a=a.parent()}return this.spawn(t,!0).filter(e)},commonAncestors:function(e){for(var t,a=0;a<this.length;a++){var n=this[a],i=n.parents();t=t||i,t=t.intersect(i)}return t.filter(e)},orphans:function(e){return this.stdFilter(function(t){return t.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(t){return t.isChild()}).filter(e)},children:cr(function(r){for(var e=[],t=0;t<this.length;t++)for(var a=this[t],n=a._private.children,i=0;i<n.length;i++)e.push(n[i]);return this.spawn(e,!0).filter(r)},"children"),siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length!==0},isChildless:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length===0},isChild:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent!=null},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent==null},descendants:function(e){var t=[];function a(n){for(var i=0;i<n.length;i++){var o=n[i];t.push(o),o.children().nonempty()&&a(o.children())}}return a(this.children()),this.spawn(t,!0).filter(e)}};function Wn(r,e,t,a){for(var n=[],i=new ft,o=r.cy(),s=o.hasCompoundNodes(),l=0;l<r.length;l++){var u=r[l];t?n.push(u):s&&a(n,i,u)}for(;n.length>0;){var v=n.shift();e(v),i.add(v.id()),s&&a(n,i,v)}return r}function Ao(r,e,t){if(t.isParent())for(var a=t._private.children,n=0;n<a.length;n++){var i=a[n];e.has(i.id())||r.push(i)}}Ct.forEachDown=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Wn(this,r,e,Ao)};function Ro(r,e,t){if(t.isChild()){var a=t._private.parent;e.has(a.id())||r.push(a)}}Ct.forEachUp=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Wn(this,r,e,Ro)};function Ad(r,e,t){Ro(r,e,t),Ao(r,e,t)}Ct.forEachUpAndDown=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Wn(this,r,e,Ad)},Ct.ancestors=Ct.parents;var ra,Oo;ra=Oo={data:Le.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:Le.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Le.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Le.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Le.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Le.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}},ra.attr=ra.data,ra.removeAttr=ra.removeData;var Rd=Oo,Wa={};function Gn(r){return function(e){var t=this;if(e===void 0&&(e=!0),t.length!==0)if(t.isNode()&&!t.removed()){for(var a=0,n=t[0],i=n._private.edges,o=0;o<i.length;o++){var s=i[o];!e&&s.isLoop()||(a+=r(n,s))}return a}else return}}de(Wa,{degree:Gn(function(r,e){return e.source().same(e.target())?2:1}),indegree:Gn(function(r,e){return e.target().same(r)?1:0}),outdegree:Gn(function(r,e){return e.source().same(r)?1:0})});function St(r,e){return function(t){for(var a,n=this.nodes(),i=0;i<n.length;i++){var o=n[i],s=o[r](t);s!==void 0&&(a===void 0||e(s,a))&&(a=s)}return a}}de(Wa,{minDegree:St("degree",function(r,e){return r<e}),maxDegree:St("degree",function(r,e){return r>e}),minIndegree:St("indegree",function(r,e){return r<e}),maxIndegree:St("indegree",function(r,e){return r>e}),minOutdegree:St("outdegree",function(r,e){return r<e}),maxOutdegree:St("outdegree",function(r,e){return r>e})}),de(Wa,{totalDegree:function(e){for(var t=0,a=this.nodes(),n=0;n<a.length;n++)t+=a[n].degree(e);return t}});var mr,Io,zo=function(e,t,a){for(var n=0;n<e.length;n++){var i=e[n];if(!i.locked()){var o=i._private.position,s={x:t.x!=null?t.x-o.x:0,y:t.y!=null?t.y-o.y:0};i.isParent()&&!(s.x===0&&s.y===0)&&i.children().shift(s,a),i.dirtyBoundingBoxCache()}}},No={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:function(e){e.updateCompoundBounds()},beforeSet:function(e,t){zo(e,t,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};mr=Io={position:Le.data(No),silentPosition:Le.data(de({},No,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,t){zo(e,t,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,t){if(Ce(e))t?this.silentPosition(e):this.position(e);else if(ze(e)){var a=e,n=this.cy();n.startBatch();for(var i=0;i<this.length;i++){var o=this[i],s=void 0;(s=a(o,i))&&(t?o.silentPosition(s):o.position(s))}n.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,t,a){var n;if(Ce(e)?(n={x:ae(e.x)?e.x:0,y:ae(e.y)?e.y:0},a=t):ve(e)&&ae(t)&&(n={x:0,y:0},n[e]=t),n!=null){var i=this.cy();i.startBatch();for(var o=0;o<this.length;o++){var s=this[o];if(!(i.hasCompoundNodes()&&s.isChild()&&s.ancestors().anySame(this))){var l=s.position(),u={x:l.x+n.x,y:l.y+n.y};a?s.silentPosition(u):s.position(u)}}i.endBatch()}return this},silentShift:function(e,t){return Ce(e)?this.shift(e,!0):ve(e)&&ae(t)&&this.shift(e,t,!0),this},renderedPosition:function(e,t){var a=this[0],n=this.cy(),i=n.zoom(),o=n.pan(),s=Ce(e)?e:void 0,l=s!==void 0||t!==void 0&&ve(e);if(a&&a.isNode())if(l)for(var u=0;u<this.length;u++){var v=this[u];t!==void 0?v.position(e,(t-o[e])/i):s!==void 0&&v.position(qi(s,i,o))}else{var f=a.position();return s=ka(f,i,o),e===void 0?s:s[e]}else if(!l)return;return this},relativePosition:function(e,t){var a=this[0],n=this.cy(),i=Ce(e)?e:void 0,o=i!==void 0||t!==void 0&&ve(e),s=n.hasCompoundNodes();if(a&&a.isNode())if(o)for(var l=0;l<this.length;l++){var u=this[l],v=s?u.parent():null,f=v&&v.length>0,c=f;f&&(v=v[0]);var h=c?v.position():{x:0,y:0};t!==void 0?u.position(e,t+h[e]):i!==void 0&&u.position({x:i.x+h.x,y:i.y+h.y})}else{var d=a.position(),m=s?a.parent():null,p=m&&m.length>0,g=p;p&&(m=m[0]);var y=g?m.position():{x:0,y:0};return i={x:d.x-y.x,y:d.y-y.y},e===void 0?i:i[e]}else if(!o)return;return this}},mr.modelPosition=mr.point=mr.position,mr.modelPositions=mr.points=mr.positions,mr.renderedPoint=mr.renderedPosition,mr.relativePoint=mr.relativePosition;var Od=Io,Tt,Gr;Tt=Gr={},Gr.renderedBoundingBox=function(r){var e=this.boundingBox(r),t=this.cy(),a=t.zoom(),n=t.pan(),i=e.x1*a+n.x,o=e.x2*a+n.x,s=e.y1*a+n.y,l=e.y2*a+n.y;return{x1:i,x2:o,y1:s,y2:l,w:o-i,h:l-s}},Gr.dirtyCompoundBoundsCache=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(t){if(t.isParent()){var a=t._private;a.compoundBoundsClean=!1,a.bbCache=null,r||t.emitAndNotify("bounds")}}),this)},Gr.updateCompoundBounds=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!r&&e.batching())return this;function t(o){if(!o.isParent())return;var s=o._private,l=o.children(),u=o.pstyle("compound-sizing-wrt-labels").value==="include",v={width:{val:o.pstyle("min-width").pfValue,left:o.pstyle("min-width-bias-left"),right:o.pstyle("min-width-bias-right")},height:{val:o.pstyle("min-height").pfValue,top:o.pstyle("min-height-bias-top"),bottom:o.pstyle("min-height-bias-bottom")}},f=l.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),c=s.position;(f.w===0||f.h===0)&&(f={w:o.pstyle("width").pfValue,h:o.pstyle("height").pfValue},f.x1=c.x-f.w/2,f.x2=c.x+f.w/2,f.y1=c.y-f.h/2,f.y2=c.y+f.h/2);function h(E,P,L){var T=0,A=0,B=P+L;return E>0&&B>0&&(T=P/B*E,A=L/B*E),{biasDiff:T,biasComplementDiff:A}}function d(E,P,L,T){if(L.units==="%")switch(T){case"width":return E>0?L.pfValue*E:0;case"height":return P>0?L.pfValue*P:0;case"average":return E>0&&P>0?L.pfValue*(E+P)/2:0;case"min":return E>0&&P>0?E>P?L.pfValue*P:L.pfValue*E:0;case"max":return E>0&&P>0?E>P?L.pfValue*E:L.pfValue*P:0;default:return 0}else return L.units==="px"?L.pfValue:0}var m=v.width.left.value;v.width.left.units==="px"&&v.width.val>0&&(m=m*100/v.width.val);var p=v.width.right.value;v.width.right.units==="px"&&v.width.val>0&&(p=p*100/v.width.val);var g=v.height.top.value;v.height.top.units==="px"&&v.height.val>0&&(g=g*100/v.height.val);var y=v.height.bottom.value;v.height.bottom.units==="px"&&v.height.val>0&&(y=y*100/v.height.val);var b=h(v.width.val-f.w,m,p),w=b.biasDiff,D=b.biasComplementDiff,C=h(v.height.val-f.h,g,y),x=C.biasDiff,k=C.biasComplementDiff;s.autoPadding=d(f.w,f.h,o.pstyle("padding"),o.pstyle("padding-relative-to").value),s.autoWidth=Math.max(f.w,v.width.val),c.x=(-w+f.x1+f.x2+D)/2,s.autoHeight=Math.max(f.h,v.height.val),c.y=(-x+f.y1+f.y2+k)/2}for(var a=0;a<this.length;a++){var n=this[a],i=n._private;(!i.compoundBoundsClean||r)&&(t(n),e.batching()||(i.compoundBoundsClean=!0))}return this};var dr=function(e){return e===1/0||e===-1/0?0:e},yr=function(e,t,a,n,i){n-t===0||i-a===0||t==null||a==null||n==null||i==null||(e.x1=t<e.x1?t:e.x1,e.x2=n>e.x2?n:e.x2,e.y1=a<e.y1?a:e.y1,e.y2=i>e.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},rt=function(e,t){return t==null?e:yr(e,t.x1,t.y1,t.x2,t.y2)},ta=function(e,t,a){return pr(e,t,a)},Ga=function(e,t,a){if(!t.cy().headless()){var n=t._private,i=n.rstyle,o=i.arrowWidth/2,s=t.pstyle(a+"-arrow-shape").value,l,u;if(s!=="none"){a==="source"?(l=i.srcX,u=i.srcY):a==="target"?(l=i.tgtX,u=i.tgtY):(l=i.midX,u=i.midY);var v=n.arrowBounds=n.arrowBounds||{},f=v[a]=v[a]||{};f.x1=l-o,f.y1=u-o,f.x2=l+o,f.y2=u+o,f.w=f.x2-f.x1,f.h=f.y2-f.y1,Ba(f,1),yr(e,f.x1,f.y1,f.x2,f.y2)}}},Kn=function(e,t,a){if(!t.cy().headless()){var n;a?n=a+"-":n="";var i=t._private,o=i.rstyle,s=t.pstyle(n+"label").strValue;if(s){var l=t.pstyle("text-halign"),u=t.pstyle("text-valign"),v=ta(o,"labelWidth",a),f=ta(o,"labelHeight",a),c=ta(o,"labelX",a),h=ta(o,"labelY",a),d=t.pstyle(n+"text-margin-x").pfValue,m=t.pstyle(n+"text-margin-y").pfValue,p=t.isEdge(),g=t.pstyle(n+"text-rotation"),y=t.pstyle("text-outline-width").pfValue,b=t.pstyle("text-border-width").pfValue,w=b/2,D=t.pstyle("text-background-padding").pfValue,C=2,x=f,k=v,E=k/2,P=x/2,L,T,A,B;if(p)L=c-E,T=c+E,A=h-P,B=h+P;else{switch(l.value){case"left":L=c-k,T=c;break;case"center":L=c-E,T=c+E;break;case"right":L=c,T=c+k;break}switch(u.value){case"top":A=h-x,B=h;break;case"center":A=h-P,B=h+P;break;case"bottom":A=h,B=h+x;break}}L+=d-Math.max(y,w)-D-C,T+=d+Math.max(y,w)+D+C,A+=m-Math.max(y,w)-D-C,B+=m+Math.max(y,w)+D+C;var O=a||"main",R=i.labelBounds,M=R[O]=R[O]||{};M.x1=L,M.y1=A,M.x2=T,M.y2=B,M.w=T-L,M.h=B-A;var I=p&&g.strValue==="autorotate",V=g.pfValue!=null&&g.pfValue!==0;if(I||V){var G=I?ta(i.rstyle,"labelAngle",a):g.pfValue,z=Math.cos(G),H=Math.sin(G),Y=(L+T)/2,Q=(A+B)/2;if(!p){switch(l.value){case"left":Y=T;break;case"right":Y=L;break}switch(u.value){case"top":Q=B;break;case"bottom":Q=A;break}}var X=function(he,re){return he=he-Y,re=re-Q,{x:he*z-re*H+Y,y:he*H+re*z+Q}},U=X(L,A),N=X(L,B),_=X(T,A),j=X(T,B);L=Math.min(U.x,N.x,_.x,j.x),T=Math.max(U.x,N.x,_.x,j.x),A=Math.min(U.y,N.y,_.y,j.y),B=Math.max(U.y,N.y,_.y,j.y)}var J=O+"Rot",ee=R[J]=R[J]||{};ee.x1=L,ee.y1=A,ee.x2=T,ee.y2=B,ee.w=T-L,ee.h=B-A,yr(e,L,A,T,B),yr(i.labelBounds.all,L,A,T,B)}return e}},Id=function(e,t){if(!t.cy().headless()){var a=t.pstyle("outline-opacity").value,n=t.pstyle("outline-width").value;if(a>0&&n>0){var i=t.pstyle("outline-offset").value,o=t.pstyle("shape").value,s=n+i,l=(e.w+s*2)/e.w,u=(e.h+s*2)/e.h,v=0,f=0;["diamond","pentagon","round-triangle"].includes(o)?(l=(e.w+s*2.4)/e.w,f=-s/3.6):["concave-hexagon","rhomboid","right-rhomboid"].includes(o)?l=(e.w+s*2.4)/e.w:o==="star"?(l=(e.w+s*2.8)/e.w,u=(e.h+s*2.6)/e.h,f=-s/3.8):o==="triangle"?(l=(e.w+s*2.8)/e.w,u=(e.h+s*2.4)/e.h,f=-s/1.4):o==="vee"&&(l=(e.w+s*4.4)/e.w,u=(e.h+s*3.8)/e.h,f=-s*.5);var c=e.h*u-e.h,h=e.w*l-e.w;if(La(e,[Math.ceil(c/2),Math.ceil(h/2)]),v!=0||f!==0){var d=rv(e,v,f);Hi(e,d)}}}},zd=function(e,t){var a=e._private.cy,n=a.styleEnabled(),i=a.headless(),o=or(),s=e._private,l=e.isNode(),u=e.isEdge(),v,f,c,h,d,m,p=s.rstyle,g=l&&n?e.pstyle("bounds-expansion").pfValue:[0],y=function(le){return le.pstyle("display").value!=="none"},b=!n||y(e)&&(!u||y(e.source())&&y(e.target()));if(b){var w=0,D=0;n&&t.includeOverlays&&(w=e.pstyle("overlay-opacity").value,w!==0&&(D=e.pstyle("overlay-padding").value));var C=0,x=0;n&&t.includeUnderlays&&(C=e.pstyle("underlay-opacity").value,C!==0&&(x=e.pstyle("underlay-padding").value));var k=Math.max(D,x),E=0,P=0;if(n&&(E=e.pstyle("width").pfValue,P=E/2),l&&t.includeNodes){var L=e.position();d=L.x,m=L.y;var T=e.outerWidth(),A=T/2,B=e.outerHeight(),O=B/2;v=d-A,f=d+A,c=m-O,h=m+O,yr(o,v,c,f,h),n&&t.includeOutlines&&Id(o,e)}else if(u&&t.includeEdges)if(n&&!i){var R=e.pstyle("curve-style").strValue;if(v=Math.min(p.srcX,p.midX,p.tgtX),f=Math.max(p.srcX,p.midX,p.tgtX),c=Math.min(p.srcY,p.midY,p.tgtY),h=Math.max(p.srcY,p.midY,p.tgtY),v-=P,f+=P,c-=P,h+=P,yr(o,v,c,f,h),R==="haystack"){var M=p.haystackPts;if(M&&M.length===2){if(v=M[0].x,c=M[0].y,f=M[1].x,h=M[1].y,v>f){var I=v;v=f,f=I}if(c>h){var V=c;c=h,h=V}yr(o,v-P,c-P,f+P,h+P)}}else if(R==="bezier"||R==="unbundled-bezier"||R==="segments"||R==="taxi"){var G;switch(R){case"bezier":case"unbundled-bezier":G=p.bezierPts;break;case"segments":case"taxi":G=p.linePts;break}if(G!=null)for(var z=0;z<G.length;z++){var H=G[z];v=H.x-P,f=H.x+P,c=H.y-P,h=H.y+P,yr(o,v,c,f,h)}}}else{var Y=e.source(),Q=Y.position(),X=e.target(),U=X.position();if(v=Q.x,f=U.x,c=Q.y,h=U.y,v>f){var N=v;v=f,f=N}if(c>h){var _=c;c=h,h=_}v-=P,f+=P,c-=P,h+=P,yr(o,v,c,f,h)}if(n&&t.includeEdges&&u&&(Ga(o,e,"mid-source"),Ga(o,e,"mid-target"),Ga(o,e,"source"),Ga(o,e,"target")),n){var j=e.pstyle("ghost").value==="yes";if(j){var J=e.pstyle("ghost-offset-x").pfValue,ee=e.pstyle("ghost-offset-y").pfValue;yr(o,o.x1+J,o.y1+ee,o.x2+J,o.y2+ee)}}var oe=s.bodyBounds=s.bodyBounds||{};Wi(oe,o),La(oe,g),Ba(oe,1),n&&(v=o.x1,f=o.x2,c=o.y1,h=o.y2,yr(o,v-k,c-k,f+k,h+k));var he=s.overlayBounds=s.overlayBounds||{};Wi(he,o),La(he,g),Ba(he,1);var re=s.labelBounds=s.labelBounds||{};re.all!=null?ev(re.all):re.all=or(),n&&t.includeLabels&&(t.includeMainLabels&&Kn(o,e,null),u&&(t.includeSourceLabels&&Kn(o,e,"source"),t.includeTargetLabels&&Kn(o,e,"target")))}return o.x1=dr(o.x1),o.y1=dr(o.y1),o.x2=dr(o.x2),o.y2=dr(o.y2),o.w=dr(o.x2-o.x1),o.h=dr(o.y2-o.y1),o.w>0&&o.h>0&&b&&(La(o,g),Ba(o,1)),o},Fo=function(e){var t=0,a=function(o){return(o?1:0)<<t++},n=0;return n+=a(e.incudeNodes),n+=a(e.includeEdges),n+=a(e.includeLabels),n+=a(e.includeMainLabels),n+=a(e.includeSourceLabels),n+=a(e.includeTargetLabels),n+=a(e.includeOverlays),n+=a(e.includeOutlines),n},Vo=function(e){if(e.isEdge()){var t=e.source().position(),a=e.target().position(),n=function(o){return Math.round(o)};return xl([n(t.x),n(t.y),n(a.x),n(a.y)])}else return 0},qo=function(e,t){var a=e._private,n,i=e.isEdge(),o=t==null?$o:Fo(t),s=o===$o,l=Vo(e),u=a.bbCachePosKey===l,v=t.useCache&&u,f=function(m){return m._private.bbCache==null||m._private.styleDirty},c=!v||f(e)||i&&f(e.source())||f(e.target());if(c?(u||e.recalculateRenderedStyle(v),n=zd(e,aa),a.bbCache=n,a.bbCachePosKey=l):n=a.bbCache,!s){var h=e.isNode();n=or(),(t.includeNodes&&h||t.includeEdges&&!h)&&(t.includeOverlays?rt(n,a.overlayBounds):rt(n,a.bodyBounds)),t.includeLabels&&(t.includeMainLabels&&(!i||t.includeSourceLabels&&t.includeTargetLabels)?rt(n,a.labelBounds.all):(t.includeMainLabels&&rt(n,a.labelBounds.mainRot),t.includeSourceLabels&&rt(n,a.labelBounds.sourceRot),t.includeTargetLabels&&rt(n,a.labelBounds.targetRot))),n.w=n.x2-n.x1,n.h=n.y2-n.y1}return n},aa={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},$o=Fo(aa),Ho=Ke(aa);Gr.boundingBox=function(r){var e;if(this.length===1&&this[0]._private.bbCache!=null&&!this[0]._private.styleDirty&&(r===void 0||r.useCache===void 0||r.useCache===!0))r===void 0?r=aa:r=Ho(r),e=qo(this[0],r);else{e=or(),r=r||aa;var t=Ho(r),a=this,n=a.cy(),i=n.styleEnabled();if(i)for(var o=0;o<a.length;o++){var s=a[o],l=s._private,u=Vo(s),v=l.bbCachePosKey===u,f=t.useCache&&v&&!l.styleDirty;s.recalculateRenderedStyle(f)}this.updateCompoundBounds(!r.useCache);for(var c=0;c<a.length;c++){var h=a[c];rt(e,qo(h,t))}}return e.x1=dr(e.x1),e.y1=dr(e.y1),e.x2=dr(e.x2),e.y2=dr(e.y2),e.w=dr(e.x2-e.x1),e.h=dr(e.y2-e.y1),e},Gr.dirtyBoundingBoxCache=function(){for(var r=0;r<this.length;r++){var e=this[r]._private;e.bbCache=null,e.bbCachePosKey=null,e.bodyBounds=null,e.overlayBounds=null,e.labelBounds.all=null,e.labelBounds.source=null,e.labelBounds.target=null,e.labelBounds.main=null,e.labelBounds.sourceRot=null,e.labelBounds.targetRot=null,e.labelBounds.mainRot=null,e.arrowBounds.source=null,e.arrowBounds.target=null,e.arrowBounds["mid-source"]=null,e.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this},Gr.boundingBoxAt=function(r){var e=this.nodes(),t=this.cy(),a=t.hasCompoundNodes(),n=t.collection();if(a&&(n=e.filter(function(u){return u.isParent()}),e=e.not(n)),Ce(r)){var i=r;r=function(){return i}}var o=function(v,f){return v._private.bbAtOldPos=r(v,f)},s=function(v){return v._private.bbAtOldPos};t.startBatch(),e.forEach(o).silentPositions(r),a&&(n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),n.updateCompoundBounds(!0));var l=jl(this.boundingBox({useCache:!1}));return e.silentPositions(s),a&&(n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),n.updateCompoundBounds(!0)),t.endBatch(),l},Tt.boundingbox=Tt.bb=Tt.boundingBox,Tt.renderedBoundingbox=Tt.renderedBoundingBox;var Nd=Gr,na,ia;na=ia={};var Wo=function(e){e.uppercaseName=wi(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=wi(e.outerName),na[e.name]=function(){var a=this[0],n=a._private,i=n.cy,o=i._private.styleEnabled;if(a)if(o){if(a.isParent())return a.updateCompoundBounds(),n[e.autoName]||0;var s=a.pstyle(e.name);switch(s.strValue){case"label":return a.recalculateRenderedStyle(),n.rstyle[e.labelName]||0;default:return s.pfValue}}else return 1},na["outer"+e.uppercaseName]=function(){var a=this[0],n=a._private,i=n.cy,o=i._private.styleEnabled;if(a)if(o){var s=a[e.name](),l=a.pstyle("border-width").pfValue,u=2*a.padding();return s+l+u}else return 1},na["rendered"+e.uppercaseName]=function(){var a=this[0];if(a){var n=a[e.name]();return n*this.cy().zoom()}},na["rendered"+e.uppercaseOuterName]=function(){var a=this[0];if(a){var n=a[e.outerName]();return n*this.cy().zoom()}}};Wo({name:"width"}),Wo({name:"height"}),ia.padding=function(){var r=this[0],e=r._private;return r.isParent()?(r.updateCompoundBounds(),e.autoPadding!==void 0?e.autoPadding:r.pstyle("padding").pfValue):r.pstyle("padding").pfValue},ia.paddedHeight=function(){var r=this[0];return r.height()+2*r.padding()},ia.paddedWidth=function(){var r=this[0];return r.width()+2*r.padding()};var Fd=ia,Vd=function(e,t){if(e.isEdge())return t(e)},qd=function(e,t){if(e.isEdge()){var a=e.cy();return ka(t(e),a.zoom(),a.pan())}},$d=function(e,t){if(e.isEdge()){var a=e.cy(),n=a.pan(),i=a.zoom();return t(e).map(function(o){return ka(o,i,n)})}},Hd=function(e){return e.renderer().getControlPoints(e)},Wd=function(e){return e.renderer().getSegmentPoints(e)},Gd=function(e){return e.renderer().getSourceEndpoint(e)},Kd=function(e){return e.renderer().getTargetEndpoint(e)},Yd=function(e){return e.renderer().getEdgeMidpoint(e)},Go={controlPoints:{get:Hd,mult:!0},segmentPoints:{get:Wd,mult:!0},sourceEndpoint:{get:Gd},targetEndpoint:{get:Kd},midpoint:{get:Yd}},Xd=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},Ud=Object.keys(Go).reduce(function(r,e){var t=Go[e],a=Xd(e);return r[e]=function(){return Vd(this,t.get)},t.mult?r[a]=function(){return $d(this,t.get)}:r[a]=function(){return qd(this,t.get)},r},{}),Zd=de({},Od,Nd,Fd,Ud);var Ko=function(e,t){this.recycle(e,t)};function oa(){return!1}function Ka(){return!0}Ko.prototype={instanceString:function(){return"event"},recycle:function(e,t){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=oa,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?Ka:oa):e!=null&&e.type?t=e:this.type=e,t!=null&&(this.originalEvent=t.originalEvent,this.type=t.type!=null?t.type:this.type,this.cy=t.cy,this.target=t.target,this.position=t.position,this.renderedPosition=t.renderedPosition,this.namespace=t.namespace,this.layout=t.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var a=this.position,n=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:a.x*n+i.x,y:a.y*n+i.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=Ka;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=Ka;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Ka,this.stopPropagation()},isDefaultPrevented:oa,isPropagationStopped:oa,isImmediatePropagationStopped:oa};var Yo=/^([^.]+)(\.(?:[^.]+))?$/,Qd=".*",Xo={qualifierCompare:function(e,t){return e===t},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},Uo=Object.keys(Xo),_d={};function Ya(){for(var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_d,e=arguments.length>1?arguments[1]:void 0,t=0;t<Uo.length;t++){var a=Uo[t];this[a]=r[a]||Xo[a]}this.context=e||this.context,this.listeners=[],this.emitting=0}var Kr=Ya.prototype,Zo=function(e,t,a,n,i,o,s){ze(n)&&(i=n,n=null),s&&(o==null?o=s:o=de({},o,s));for(var l=Ae(a)?a:a.split(/\s+/),u=0;u<l.length;u++){var v=l[u];if(!Ir(v)){var f=v.match(Yo);if(f){var c=f[1],h=f[2]?f[2]:null,d=t(e,v,c,h,n,i,o);if(d===!1)break}}}},Qo=function(e,t){return e.addEventFields(e.context,t),new Ko(t.type,t)},Jd=function(e,t,a){if(mu(a)){t(e,a);return}else if(Ce(a)){t(e,Qo(e,a));return}for(var n=Ae(a)?a:a.split(/\s+/),i=0;i<n.length;i++){var o=n[i];if(!Ir(o)){var s=o.match(Yo);if(s){var l=s[1],u=s[2]?s[2]:null,v=Qo(e,{type:l,namespace:u,target:e.context});t(e,v)}}}};Kr.on=Kr.addListener=function(r,e,t,a,n){return Zo(this,function(i,o,s,l,u,v,f){ze(v)&&i.listeners.push({event:o,callback:v,type:s,namespace:l,qualifier:u,conf:f})},r,e,t,a,n),this},Kr.one=function(r,e,t,a){return this.on(r,e,t,a,{one:!0})},Kr.removeListener=Kr.off=function(r,e,t,a){var n=this;this.emitting!==0&&(this.listeners=Dl(this.listeners));for(var i=this.listeners,o=function(u){var v=i[u];Zo(n,function(f,c,h,d,m,p){if((v.type===h||r==="*")&&(!d&&v.namespace!==".*"||v.namespace===d)&&(!m||f.qualifierCompare(v.qualifier,m))&&(!p||v.callback===p))return i.splice(u,1),!1},r,e,t,a)},s=i.length-1;s>=0;s--)o(s);return this},Kr.removeAllListeners=function(){return this.removeListener("*")},Kr.emit=Kr.trigger=function(r,e,t){var a=this.listeners,n=a.length;return this.emitting++,Ae(e)||(e=[e]),Jd(this,function(i,o){t!=null&&(a=[{event:o.event,type:o.type,namespace:o.namespace,callback:t}],n=a.length);for(var s=function(v){var f=a[v];if(f.type===o.type&&(!f.namespace||f.namespace===o.namespace||f.namespace===Qd)&&i.eventMatches(i.context,f,o)){var c=[o];e!=null&&Pl(c,e),i.beforeEmit(i.context,f,o),f.conf&&f.conf.one&&(i.listeners=i.listeners.filter(function(m){return m!==f}));var h=i.callbackContext(i.context,f,o),d=f.callback.apply(h,c);i.afterEmit(i.context,f,o),d===!1&&(o.stopPropagation(),o.preventDefault())}},l=0;l<n;l++)s(l);i.bubble(i.context)&&!o.isPropagationStopped()&&i.parent(i.context).emit(o,e)},r),this.emitting--,this};var jd={qualifierCompare:function(e,t){return e==null||t==null?e==null&&t==null:e.sameText(t)},eventMatches:function(e,t,a){var n=t.qualifier;return n!=null?e!==a.target&&Vt(a.target)&&n.matches(a.target):!0},addEventFields:function(e,t){t.cy=e.cy(),t.target=e},callbackContext:function(e,t,a){return t.qualifier!=null?a.target:e},beforeEmit:function(e,t){t.conf&&t.conf.once&&t.conf.onceCollection.removeListener(t.event,t.qualifier,t.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},Xa=function(e){return ve(e)?new $r(e):e},_o={createEmitter:function(){for(var e=0;e<this.length;e++){var t=this[e],a=t._private;a.emitter||(a.emitter=new Ya(jd,t))}return this},emitter:function(){return this._private.emitter},on:function(e,t,a){for(var n=Xa(t),i=0;i<this.length;i++){var o=this[i];o.emitter().on(e,n,a)}return this},removeListener:function(e,t,a){for(var n=Xa(t),i=0;i<this.length;i++){var o=this[i];o.emitter().removeListener(e,n,a)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){var t=this[e];t.emitter().removeAllListeners()}return this},one:function(e,t,a){for(var n=Xa(t),i=0;i<this.length;i++){var o=this[i];o.emitter().one(e,n,a)}return this},once:function(e,t,a){for(var n=Xa(t),i=0;i<this.length;i++){var o=this[i];o.emitter().on(e,n,a,{once:!0,onceCollection:this})}},emit:function(e,t){for(var a=0;a<this.length;a++){var n=this[a];n.emitter().emit(e,t)}return this},emitAndNotify:function(e,t){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,t),this}};Le.eventAliasesOn(_o);var Jo={nodes:function(e){return this.filter(function(t){return t.isNode()}).filter(e)},edges:function(e){return this.filter(function(t){return t.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),t=this.spawn(),a=0;a<this.length;a++){var n=this[a];n.isNode()?e.push(n):t.push(n)}return{nodes:e,edges:t}},filter:function(e,t){if(e===void 0)return this;if(ve(e)||vr(e))return new $r(e).filter(this);if(ze(e)){for(var a=this.spawn(),n=this,i=0;i<n.length;i++){var o=n[i],s=t?e.apply(t,[o,i,n]):e(o,i,n);s&&a.push(o)}return a}return this.spawn()},not:function(e){if(e){ve(e)&&(e=this.filter(e));for(var t=this.spawn(),a=0;a<this.length;a++){var n=this[a],i=e.has(n);i||t.push(n)}return t}else return this},absoluteComplement:function(){var e=this.cy();return e.mutableElements().not(this)},intersect:function(e){if(ve(e)){var t=e;return this.filter(t)}for(var a=this.spawn(),n=this,i=e,o=this.length<e.length,s=o?n:i,l=o?i:n,u=0;u<s.length;u++){var v=s[u];l.has(v)&&a.push(v)}return a},xor:function(e){var t=this._private.cy;ve(e)&&(e=t.$(e));var a=this.spawn(),n=this,i=e,o=function(l,u){for(var v=0;v<l.length;v++){var f=l[v],c=f._private.data.id,h=u.hasElementWithId(c);h||a.push(f)}};return o(n,i),o(i,n),a},diff:function(e){var t=this._private.cy;ve(e)&&(e=t.$(e));var a=this.spawn(),n=this.spawn(),i=this.spawn(),o=this,s=e,l=function(v,f,c){for(var h=0;h<v.length;h++){var d=v[h],m=d._private.data.id,p=f.hasElementWithId(m);p?i.merge(d):c.push(d)}};return l(o,s,a),l(s,o,n),{left:a,right:n,both:i}},add:function(e){var t=this._private.cy;if(!e)return this;if(ve(e)){var a=e;e=t.mutableElements().filter(a)}for(var n=this.spawnSelf(),i=0;i<e.length;i++){var o=e[i],s=!this.has(o);s&&n.push(o)}return n},merge:function(e){var t=this._private,a=t.cy;if(!e)return this;if(e&&ve(e)){var n=e;e=a.mutableElements().filter(n)}for(var i=t.map,o=0;o<e.length;o++){var s=e[o],l=s._private.data.id,u=!i.has(l);if(u){var v=this.length++;this[v]=s,i.set(l,{ele:s,index:v})}}return this},unmergeAt:function(e){var t=this[e],a=t.id(),n=this._private,i=n.map;this[e]=void 0,i.delete(a);var o=e===this.length-1;if(this.length>1&&!o){var s=this.length-1,l=this[s],u=l._private.data.id;this[s]=void 0,this[e]=l,i.set(u,{ele:l,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,a=e._private.data.id,n=t.map,i=n.get(a);if(!i)return this;var o=i.index;return this.unmergeAt(o),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&ve(e)){var a=e;e=t.mutableElements().filter(a)}for(var n=0;n<e.length;n++)this.unmergeOne(e[n]);return this},unmergeBy:function(e){for(var t=this.length-1;t>=0;t--){var a=this[t];e(a)&&this.unmergeAt(t)}return this},map:function(e,t){for(var a=[],n=this,i=0;i<n.length;i++){var o=n[i],s=t?e.apply(t,[o,i,n]):e(o,i,n);a.push(s)}return a},reduce:function(e,t){for(var a=t,n=this,i=0;i<n.length;i++)a=e(a,n[i],i,n);return a},max:function(e,t){for(var a=-1/0,n,i=this,o=0;o<i.length;o++){var s=i[o],l=t?e.apply(t,[s,o,i]):e(s,o,i);l>a&&(a=l,n=s)}return{value:a,ele:n}},min:function(e,t){for(var a=1/0,n,i=this,o=0;o<i.length;o++){var s=i[o],l=t?e.apply(t,[s,o,i]):e(s,o,i);l<a&&(a=l,n=s)}return{value:a,ele:n}}},De=Jo;De.u=De["|"]=De["+"]=De.union=De.or=De.add,De["\\"]=De["!"]=De["-"]=De.difference=De.relativeComplement=De.subtract=De.not,De.n=De["&"]=De["."]=De.and=De.intersection=De.intersect,De["^"]=De["(+)"]=De["(-)"]=De.symmetricDifference=De.symdiff=De.xor,De.fnFilter=De.filterFn=De.stdFilter=De.filter,De.complement=De.abscomp=De.absoluteComplement;var eh={isNode:function(){return this.group()==="nodes"},isEdge:function(){return this.group()==="edges"},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},jo=function(e,t){var a=e.cy(),n=a.hasCompoundNodes();function i(v){var f=v.pstyle("z-compound-depth");return f.value==="auto"?n?v.zDepth():0:f.value==="bottom"?-1:f.value==="top"?En:0}var o=i(e)-i(t);if(o!==0)return o;function s(v){var f=v.pstyle("z-index-compare");return f.value==="auto"&&v.isNode()?1:0}var l=s(e)-s(t);if(l!==0)return l;var u=e.pstyle("z-index").value-t.pstyle("z-index").value;return u!==0?u:e.poolIndex()-t.poolIndex()},Ua={forEach:function(e,t){if(ze(e))for(var a=this.length,n=0;n<a;n++){var i=this[n],o=t?e.apply(t,[i,n,this]):e(i,n,this);if(o===!1)break}return this},toArray:function(){for(var e=[],t=0;t<this.length;t++)e.push(this[t]);return e},slice:function(e,t){var a=[],n=this.length;t==null&&(t=n),e==null&&(e=0),e<0&&(e=n+e),t<0&&(t=n+t);for(var i=e;i>=0&&i<t&&i<n;i++)a.push(this[i]);return this.spawn(a)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return this.length===0},nonempty:function(){return!this.empty()},sort:function(e){if(!ze(e))return this;var t=this.toArray().sort(e);return this.spawn(t)},sortByZIndex:function(){return this.sort(jo)},zDepth:function(){var e=this[0];if(e){var t=e._private,a=t.group;if(a==="nodes"){var n=t.data.parent?e.parents().size():0;return e.isParent()?n:En-1}else{var i=t.source,o=t.target,s=i.zDepth(),l=o.zDepth();return Math.max(s,l,0)}}}};Ua.each=Ua.forEach;var rh=function(){var e="undefined",t=(typeof Symbol=="undefined"?"undefined":qe(Symbol))!=e&&qe(Symbol.iterator)!=e;t&&(Ua[Symbol.iterator]=function(){var a=this,n={value:void 0,done:!1},i=0,o=this.length;return di({next:function(){return i<o?n.value=a[i++]:(n.value=void 0,n.done=!0),n}},Symbol.iterator,function(){return this})})};rh();var th=Ke({nodeDimensionsIncludeLabels:!1}),Za={layoutDimensions:function(e){e=th(e);var t;if(!this.takesUpSpace())t={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var a=this.boundingBox();t={w:a.w,h:a.h}}else t={w:this.outerWidth(),h:this.outerHeight()};return(t.w===0||t.h===0)&&(t.w=t.h=1),t},layoutPositions:function(e,t,a){var n=this.nodes().filter(function(D){return!D.isParent()}),i=this.cy(),o=t.eles,s=function(C){return C.id()},l=qt(a,s);e.emit({type:"layoutstart",layout:e}),e.animations=[];var u=function(C,x,k){var E={x:x.x1+x.w/2,y:x.y1+x.h/2},P={x:(k.x-E.x)*C,y:(k.y-E.y)*C};return{x:E.x+P.x,y:E.y+P.y}},v=t.spacingFactor&&t.spacingFactor!==1,f=function(){if(!v)return null;for(var C=or(),x=0;x<n.length;x++){var k=n[x],E=l(k,x);tv(C,E.x,E.y)}return C},c=f(),h=qt(function(D,C){var x=l(D,C);if(v){var k=Math.abs(t.spacingFactor);x=u(k,c,x)}return t.transform!=null&&(x=t.transform(D,x)),x},s);if(t.animate){for(var d=0;d<n.length;d++){var m=n[d],p=h(m,d),g=t.animateFilter==null||t.animateFilter(m,d);if(g){var y=m.animation({position:p,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(y)}else m.position(p)}if(t.fit){var b=i.animation({fit:{boundingBox:o.boundingBoxAt(h),padding:t.padding},duration:t.animationDuration,easing:t.animationEasing});e.animations.push(b)}else if(t.zoom!==void 0&&t.pan!==void 0){var w=i.animation({zoom:t.zoom,pan:t.pan,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(w)}e.animations.forEach(function(D){return D.play()}),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),yt.all(e.animations.map(function(D){return D.promise()})).then(function(){e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e})})}else n.positions(h),t.fit&&i.fit(t.eles,t.padding),t.zoom!=null&&i.zoom(t.zoom),t.pan&&i.pan(t.pan),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){var t=this.cy();return t.makeLayout(de({},e,{eles:this}))}};Za.createLayout=Za.makeLayout=Za.layout;function es(r,e,t){var a=t._private,n=a.styleCache=a.styleCache||[],i;return(i=n[r])!=null||(i=n[r]=e(t)),i}function Qa(r,e){return r=Qr(r),function(a){return es(r,e,a)}}function _a(r,e){r=Qr(r);var t=function(n){return e.call(n)};return function(){var n=this[0];if(n)return es(r,t,n)}}var Ye={recalculateRenderedStyle:function(e){var t=this.cy(),a=t.renderer(),n=t.styleEnabled();return a&&n&&a.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),t=function(i){return i._private.styleCache=null};if(e.hasCompoundNodes()){var a;a=this.spawnSelf().merge(this.descendants()).merge(this.parents()),a.merge(a.connectedEdges()),a.forEach(t)}else this.forEach(function(n){t(n),n.connectedEdges().forEach(t)});return this},updateStyle:function(e){var t=this._private.cy;if(!t.styleEnabled())return this;if(t.batching()){var a=t._private.batchStyleEles;return a.merge(this),this}var n=t.hasCompoundNodes(),i=this;e=!!(e||e===void 0),n&&(i=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var o=i;return e?o.emitAndNotify("style"):o.emit("style"),i.forEach(function(s){return s._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var t=0;t<this.length;t++){var a=this[t];a._private.styleDirty&&(a._private.styleDirty=!1,e.style().apply(a))}},parsedStyle:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,a=this[0],n=a.cy();if(n.styleEnabled()&&a){this.cleanStyle();var i=a._private.style[e];return i!=null?i:t?n.style().getDefaultProperty(e):null}},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var a=t.pstyle(e);return a.pfValue!==void 0?a.pfValue:a.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled()&&t)return t.pstyle(e).units},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var a=this[0];if(a)return t.style().getRenderedStyle(a,e)},style:function(e,t){var a=this.cy();if(!a.styleEnabled())return this;var n=!1,i=a.style();if(Ce(e)){var o=e;i.applyBypass(this,o,n),this.emitAndNotify("style")}else if(ve(e))if(t===void 0){var s=this[0];return s?i.getStylePropertyValue(s,e):void 0}else i.applyBypass(this,e,t,n),this.emitAndNotify("style");else if(e===void 0){var l=this[0];return l?i.getRawStyle(l):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var a=!1,n=t.style(),i=this;if(e===void 0)for(var o=0;o<i.length;o++){var s=i[o];n.removeAllBypasses(s,a)}else{e=e.split(/\s+/);for(var l=0;l<i.length;l++){var u=i[l];n.removeBypasses(u,e,a)}}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var t=e.hasCompoundNodes(),a=this[0];if(a){var n=a._private,i=a.pstyle("opacity").value;if(!t)return i;var o=n.data.parent?a.parents():null;if(o)for(var s=0;s<o.length;s++){var l=o[s],u=l.pstyle("opacity").value;i=u*i}return i}},transparent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var t=this[0],a=t.cy().hasCompoundNodes();if(t)return a?t.effectiveOpacity()===0:t.pstyle("opacity").value===0},backgrounding:function(){var e=this.cy();if(!e.styleEnabled())return!1;var t=this[0];return!!t._private.backgrounding}};function Yn(r,e){var t=r._private,a=t.data.parent?r.parents():null;if(a)for(var n=0;n<a.length;n++){var i=a[n];if(!e(i))return!1}return!0}function Xn(r){var e=r.ok,t=r.edgeOkViaNode||r.ok,a=r.parentOk||r.ok;return function(){var n=this.cy();if(!n.styleEnabled())return!0;var i=this[0],o=n.hasCompoundNodes();if(i){var s=i._private;if(!e(i))return!1;if(i.isNode())return!o||Yn(i,a);var l=s.source,u=s.target;return t(l)&&(!o||Yn(l,t))&&(l===u||t(u)&&(!o||Yn(u,t)))}}}var Dt=Qa("eleTakesUpSpace",function(r){return r.pstyle("display").value==="element"&&r.width()!==0&&(r.isNode()?r.height()!==0:!0)});Ye.takesUpSpace=_a("takesUpSpace",Xn({ok:Dt}));var ah=Qa("eleInteractive",function(r){return r.pstyle("events").value==="yes"&&r.pstyle("visibility").value==="visible"&&Dt(r)}),nh=Qa("parentInteractive",function(r){return r.pstyle("visibility").value==="visible"&&Dt(r)});Ye.interactive=_a("interactive",Xn({ok:ah,parentOk:nh,edgeOkViaNode:Dt})),Ye.noninteractive=function(){var r=this[0];if(r)return!r.interactive()};var ih=Qa("eleVisible",function(r){return r.pstyle("visibility").value==="visible"&&r.pstyle("opacity").pfValue!==0&&Dt(r)}),oh=Dt;Ye.visible=_a("visible",Xn({ok:ih,edgeOkViaNode:oh})),Ye.hidden=function(){var r=this[0];if(r)return!r.visible()},Ye.isBundledBezier=_a("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1}),Ye.bypass=Ye.css=Ye.style,Ye.renderedCss=Ye.renderedStyle,Ye.removeBypass=Ye.removeCss=Ye.removeStyle,Ye.pstyle=Ye.parsedStyle;var Yr={};function rs(r){return function(){var e=arguments,t=[];if(e.length===2){var a=e[0],n=e[1];this.on(r.event,a,n)}else if(e.length===1&&ze(e[0])){var i=e[0];this.on(r.event,i)}else if(e.length===0||e.length===1&&Ae(e[0])){for(var o=e.length===1?e[0]:null,s=0;s<this.length;s++){var l=this[s],u=!r.ableField||l._private[r.ableField],v=l._private[r.field]!=r.value;if(r.overrideAble){var f=r.overrideAble(l);if(f!==void 0&&(u=f,!f))return this}u&&(l._private[r.field]=r.value,v&&t.push(l))}var c=this.spawn(t);c.updateStyle(),c.emit(r.event),o&&c.emit(o)}return this}}function kt(r){Yr[r.field]=function(){var e=this[0];if(e){if(r.overrideField){var t=r.overrideField(e);if(t!==void 0)return t}return e._private[r.field]}},Yr[r.on]=rs({event:r.on,field:r.field,ableField:r.ableField,overrideAble:r.overrideAble,value:!0}),Yr[r.off]=rs({event:r.off,field:r.field,ableField:r.ableField,overrideAble:r.overrideAble,value:!1})}kt({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"}),kt({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"}),kt({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"}),kt({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"}),Yr.deselect=Yr.unselect,Yr.grabbed=function(){var r=this[0];if(r)return r._private.grabbed},kt({field:"active",on:"activate",off:"unactivate"}),kt({field:"pannable",on:"panify",off:"unpanify"}),Yr.inactive=function(){var r=this[0];if(r)return!r._private.active};var Je={},ts=function(e){return function(a){for(var n=this,i=[],o=0;o<n.length;o++){var s=n[o];if(s.isNode()){for(var l=!1,u=s.connectedEdges(),v=0;v<u.length;v++){var f=u[v],c=f.source(),h=f.target();if(e.noIncomingEdges&&h===s&&c!==s||e.noOutgoingEdges&&c===s&&h!==s){l=!0;break}}l||i.push(s)}}return this.spawn(i,!0).filter(a)}},as=function(e){return function(t){for(var a=this,n=[],i=0;i<a.length;i++){var o=a[i];if(o.isNode())for(var s=o.connectedEdges(),l=0;l<s.length;l++){var u=s[l],v=u.source(),f=u.target();e.outgoing&&v===o?(n.push(u),n.push(f)):e.incoming&&f===o&&(n.push(u),n.push(v))}}return this.spawn(n,!0).filter(t)}},ns=function(e){return function(t){for(var a=this,n=[],i={};;){var o=e.outgoing?a.outgoers():a.incomers();if(o.length===0)break;for(var s=!1,l=0;l<o.length;l++){var u=o[l],v=u.id();i[v]||(i[v]=!0,n.push(u),s=!0)}if(!s)break;a=o}return this.spawn(n,!0).filter(t)}};Je.clearTraversalCache=function(){for(var r=0;r<this.length;r++)this[r]._private.traversalCache=null},de(Je,{roots:ts({noIncomingEdges:!0}),leaves:ts({noOutgoingEdges:!0}),outgoers:cr(as({outgoing:!0}),"outgoers"),successors:ns({outgoing:!0}),incomers:cr(as({incoming:!0}),"incomers"),predecessors:ns({incoming:!0})}),de(Je,{neighborhood:cr(function(r){for(var e=[],t=this.nodes(),a=0;a<t.length;a++)for(var n=t[a],i=n.connectedEdges(),o=0;o<i.length;o++){var s=i[o],l=s.source(),u=s.target(),v=n===l?u:l;v.length>0&&e.push(v[0]),e.push(s[0])}return this.spawn(e,!0).filter(r)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),Je.neighbourhood=Je.neighborhood,Je.closedNeighbourhood=Je.closedNeighborhood,Je.openNeighbourhood=Je.openNeighborhood,de(Je,{source:cr(function(e){var t=this[0],a;return t&&(a=t._private.source||t.cy().collection()),a&&e?a.filter(e):a},"source"),target:cr(function(e){var t=this[0],a;return t&&(a=t._private.target||t.cy().collection()),a&&e?a.filter(e):a},"target"),sources:is({attr:"source"}),targets:is({attr:"target"})});function is(r){return function(t){for(var a=[],n=0;n<this.length;n++){var i=this[n],o=i._private[r.attr];o&&a.push(o)}return this.spawn(a,!0).filter(t)}}de(Je,{edgesWith:cr(os(),"edgesWith"),edgesTo:cr(os({thisIsSrc:!0}),"edgesTo")});function os(r){return function(t){var a=[],n=this._private.cy,i=r||{};ve(t)&&(t=n.$(t));for(var o=0;o<t.length;o++)for(var s=t[o]._private.edges,l=0;l<s.length;l++){var u=s[l],v=u._private.data,f=this.hasElementWithId(v.source)&&t.hasElementWithId(v.target),c=t.hasElementWithId(v.source)&&this.hasElementWithId(v.target),h=f||c;h&&((i.thisIsSrc||i.thisIsTgt)&&(i.thisIsSrc&&!f||i.thisIsTgt&&!c)||a.push(u))}return this.spawn(a,!0)}}de(Je,{connectedEdges:cr(function(r){for(var e=[],t=this,a=0;a<t.length;a++){var n=t[a];if(n.isNode())for(var i=n._private.edges,o=0;o<i.length;o++){var s=i[o];e.push(s)}}return this.spawn(e,!0).filter(r)},"connectedEdges"),connectedNodes:cr(function(r){for(var e=[],t=this,a=0;a<t.length;a++){var n=t[a];n.isEdge()&&(e.push(n.source()[0]),e.push(n.target()[0]))}return this.spawn(e,!0).filter(r)},"connectedNodes"),parallelEdges:cr(ss(),"parallelEdges"),codirectedEdges:cr(ss({codirected:!0}),"codirectedEdges")});function ss(r){var e={codirected:!1};return r=de({},e,r),function(a){for(var n=[],i=this.edges(),o=r,s=0;s<i.length;s++)for(var l=i[s],u=l._private,v=u.source,f=v._private.data.id,c=u.data.target,h=v._private.edges,d=0;d<h.length;d++){var m=h[d],p=m._private.data,g=p.target,y=p.source,b=g===c&&y===f,w=f===g&&c===y;(o.codirected&&b||!o.codirected&&(b||w))&&n.push(m)}return this.spawn(n,!0).filter(a)}}de(Je,{components:function(e){var t=this,a=t.cy(),n=a.collection(),i=e==null?t.nodes():e.nodes(),o=[];e!=null&&i.empty()&&(i=e.sources());var s=function(v,f){n.merge(v),i.unmerge(v),f.merge(v)};if(i.empty())return t.spawn();var l=function(){var v=a.collection();o.push(v);var f=i[0];s(f,v),t.bfs({directed:!1,roots:f,visit:function(h){return s(h,v)}}),v.forEach(function(c){c.connectedEdges().forEach(function(h){t.has(h)&&v.has(h.source())&&v.has(h.target())&&v.merge(h)})})};do l();while(i.length>0);return o},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),Je.componentsOf=Je.components;var Xe=function(e,t){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){Ne("A collection must have a reference to the core");return}var i=new Sr,o=!1;if(!t)t=[];else if(t.length>0&&Ce(t[0])&&!Vt(t[0])){o=!0;for(var s=[],l=new ft,u=0,v=t.length;u<v;u++){var f=t[u];f.data==null&&(f.data={});var c=f.data;if(c.id==null)c.id=Ni();else if(e.hasElementWithId(c.id)||l.has(c.id))continue;var h=new Da(e,f,!1);s.push(h),l.add(c.id)}t=s}this.length=0;for(var d=0,m=t.length;d<m;d++){var p=t[d][0];if(p!=null){var g=p._private.data.id;(!a||!i.has(g))&&(a&&i.set(g,{index:this.length,ele:p}),this[this.length]=p,this.length++)}}this._private={eles:this,cy:e,get map(){return this.lazyMap==null&&this.rebuildMap(),this.lazyMap},set map(y){this.lazyMap=y},rebuildMap:function(){for(var b=this.lazyMap=new Sr,w=this.eles,D=0;D<w.length;D++){var C=w[D];b.set(C.id(),{index:D,ele:C})}}},a&&(this._private.map=i),o&&!n&&this.restore()},Re=Da.prototype=Xe.prototype=Object.create(Array.prototype);Re.instanceString=function(){return"collection"},Re.spawn=function(r,e){return new Xe(this.cy(),r,e)},Re.spawnSelf=function(){return this.spawn(this)},Re.cy=function(){return this._private.cy},Re.renderer=function(){return this._private.cy.renderer()},Re.element=function(){return this[0]},Re.collection=function(){return mi(this)?this:new Xe(this._private.cy,[this])},Re.unique=function(){return new Xe(this._private.cy,this,!0)},Re.hasElementWithId=function(r){return r=""+r,this._private.map.has(r)},Re.getElementById=function(r){r=""+r;var e=this._private.cy,t=this._private.map.get(r);return t?t.ele:new Xe(e)},Re.$id=Re.getElementById,Re.poolIndex=function(){var r=this._private.cy,e=r._private.elements,t=this[0]._private.data.id;return e._private.map.get(t).index},Re.indexOf=function(r){var e=r[0]._private.data.id;return this._private.map.get(e).index},Re.indexOfId=function(r){return r=""+r,this._private.map.get(r).index},Re.json=function(r){var e=this.element(),t=this.cy();if(e==null&&r)return this;if(e!=null){var a=e._private;if(Ce(r)){if(t.startBatch(),r.data){e.data(r.data);var n=a.data;if(e.isEdge()){var i=!1,o={},s=r.data.source,l=r.data.target;s!=null&&s!=n.source&&(o.source=""+s,i=!0),l!=null&&l!=n.target&&(o.target=""+l,i=!0),i&&(e=e.move(o))}else{var u="parent"in r.data,v=r.data.parent;u&&(v!=null||n.parent!=null)&&v!=n.parent&&(v===void 0&&(v=null),v!=null&&(v=""+v),e=e.move({parent:v}))}}r.position&&e.position(r.position);var f=function(m,p,g){var y=r[m];y!=null&&y!==a[m]&&(y?e[p]():e[g]())};return f("removed","remove","restore"),f("selected","select","unselect"),f("selectable","selectify","unselectify"),f("locked","lock","unlock"),f("grabbable","grabify","ungrabify"),f("pannable","panify","unpanify"),r.classes!=null&&e.classes(r.classes),t.endBatch(),this}else if(r===void 0){var c={data:Cr(a.data),position:Cr(a.position),group:a.group,removed:a.removed,selected:a.selected,selectable:a.selectable,locked:a.locked,grabbable:a.grabbable,pannable:a.pannable,classes:null};c.classes="";var h=0;return a.classes.forEach(function(d){return c.classes+=h++===0?d:" "+d}),c}}},Re.jsons=function(){for(var r=[],e=0;e<this.length;e++){var t=this[e],a=t.json();r.push(a)}return r},Re.clone=function(){for(var r=this.cy(),e=[],t=0;t<this.length;t++){var a=this[t],n=a.json(),i=new Da(r,n,!1);e.push(i)}return new Xe(r,e)},Re.copy=Re.clone,Re.restore=function(){for(var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this,a=t.cy(),n=a._private,i=[],o=[],s,l=0,u=t.length;l<u;l++){var v=t[l];e&&!v.removed()||(v.isNode()?i.push(v):o.push(v))}s=i.concat(o);var f,c=function(){s.splice(f,1),f--};for(f=0;f<s.length;f++){var h=s[f],d=h._private,m=d.data;if(h.clearTraversalCache(),!(!e&&!d.removed)){if(m.id===void 0)m.id=Ni();else if(ae(m.id))m.id=""+m.id;else if(Ir(m.id)||!ve(m.id)){Ne("Can not create element with invalid string ID `"+m.id+"`"),c();continue}else if(a.hasElementWithId(m.id)){Ne("Can not create second element with ID `"+m.id+"`"),c();continue}}var p=m.id;if(h.isNode()){var g=d.position;g.x==null&&(g.x=0),g.y==null&&(g.y=0)}if(h.isEdge()){for(var y=h,b=["source","target"],w=b.length,D=!1,C=0;C<w;C++){var x=b[C],k=m[x];ae(k)&&(k=m[x]=""+m[x]),k==null||k===""?(Ne("Can not create edge `"+p+"` with unspecified "+x),D=!0):a.hasElementWithId(k)||(Ne("Can not create edge `"+p+"` with nonexistant "+x+" `"+k+"`"),D=!0)}if(D){c();continue}var E=a.getElementById(m.source),P=a.getElementById(m.target);E.same(P)?E._private.edges.push(y):(E._private.edges.push(y),P._private.edges.push(y)),y._private.source=E,y._private.target=P}d.map=new Sr,d.map.set(p,{ele:h,index:0}),d.removed=!1,e&&a.addToPool(h)}for(var L=0;L<i.length;L++){var T=i[L],A=T._private.data;ae(A.parent)&&(A.parent=""+A.parent);var B=A.parent,O=B!=null;if(O||T._private.parent){var R=T._private.parent?a.collection().merge(T._private.parent):a.getElementById(B);if(R.empty())A.parent=void 0;else if(R[0].removed())Be("Node added with missing parent, reference to parent removed"),A.parent=void 0,T._private.parent=null;else{for(var M=!1,I=R;!I.empty();){if(T.same(I)){M=!0,A.parent=void 0;break}I=I.parent()}M||(R[0]._private.children.push(T),T._private.parent=R[0],n.hasCompoundNodes=!0)}}}if(s.length>0){for(var V=s.length===t.length?t:new Xe(a,s),G=0;G<V.length;G++){var z=V[G];z.isNode()||(z.parallelEdges().clearTraversalCache(),z.source().clearTraversalCache(),z.target().clearTraversalCache())}var H;n.hasCompoundNodes?H=a.collection().merge(V).merge(V.connectedNodes()).merge(V.parent()):H=V,H.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(r),r?V.emitAndNotify("add"):e&&V.emit("add")}return t},Re.removed=function(){var r=this[0];return r&&r._private.removed},Re.inside=function(){var r=this[0];return r&&!r._private.removed},Re.remove=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this,a=[],n={},i=t._private.cy;function o(B){for(var O=B._private.edges,R=0;R<O.length;R++)l(O[R])}function s(B){for(var O=B._private.children,R=0;R<O.length;R++)l(O[R])}function l(B){var O=n[B.id()];e&&B.removed()||O||(n[B.id()]=!0,B.isNode()?(a.push(B),o(B),s(B)):a.unshift(B))}for(var u=0,v=t.length;u<v;u++){var f=t[u];l(f)}function c(B,O){var R=B._private.edges;Nr(R,O),B.clearTraversalCache()}function h(B){B.clearTraversalCache()}var d=[];d.ids={};function m(B,O){O=O[0],B=B[0];var R=B._private.children,M=B.id();Nr(R,O),O._private.parent=null,d.ids[M]||(d.ids[M]=!0,d.push(B))}t.dirtyCompoundBoundsCache(),e&&i.removeFromPool(a);for(var p=0;p<a.length;p++){var g=a[p];if(g.isEdge()){var y=g.source()[0],b=g.target()[0];c(y,g),c(b,g);for(var w=g.parallelEdges(),D=0;D<w.length;D++){var C=w[D];h(C),C.isBundledBezier()&&C.dirtyBoundingBoxCache()}}else{var x=g.parent();x.length!==0&&m(x,g)}e&&(g._private.removed=!0)}var k=i._private.elements;i._private.hasCompoundNodes=!1;for(var E=0;E<k.length;E++){var P=k[E];if(P.isParent()){i._private.hasCompoundNodes=!0;break}}var L=new Xe(this.cy(),a);L.size()>0&&(r?L.emitAndNotify("remove"):e&&L.emit("remove"));for(var T=0;T<d.length;T++){var A=d[T];(!e||!A.removed())&&A.updateStyle()}return L},Re.move=function(r){var e=this._private.cy,t=this,a=!1,n=!1,i=function(d){return d==null?d:""+d};if(r.source!==void 0||r.target!==void 0){var o=i(r.source),s=i(r.target),l=o!=null&&e.hasElementWithId(o),u=s!=null&&e.hasElementWithId(s);(l||u)&&(e.batch(function(){t.remove(a,n),t.emitAndNotify("moveout");for(var h=0;h<t.length;h++){var d=t[h],m=d._private.data;d.isEdge()&&(l&&(m.source=o),u&&(m.target=s))}t.restore(a,n)}),t.emitAndNotify("move"))}else if(r.parent!==void 0){var v=i(r.parent),f=v===null||e.hasElementWithId(v);if(f){var c=v===null?void 0:v;e.batch(function(){var h=t.remove(a,n);h.emitAndNotify("moveout");for(var d=0;d<t.length;d++){var m=t[d],p=m._private.data;m.isNode()&&(p.parent=c)}h.restore(a,n)}),t.emitAndNotify("move")}}return this},[vo,md,Ha,Wr,Ct,Rd,Wa,Zd,_o,Jo,eh,Ua,Za,Ye,Yr,Je].forEach(function(r){de(Re,r)});var sh={add:function(e){var t,a=this;if(vr(e)){var n=e;if(n._private.cy===a)t=n.restore();else{for(var i=[],o=0;o<n.length;o++){var s=n[o];i.push(s.json())}t=new Xe(a,i)}}else if(Ae(e)){var l=e;t=new Xe(a,l)}else if(Ce(e)&&(Ae(e.nodes)||Ae(e.edges))){for(var u=e,v=[],f=["nodes","edges"],c=0,h=f.length;c<h;c++){var d=f[c],m=u[d];if(Ae(m))for(var p=0,g=m.length;p<g;p++){var y=de({group:d},m[p]);v.push(y)}}t=new Xe(a,v)}else{var b=e;t=new Da(a,b).collection()}return t},remove:function(e){if(!vr(e)){if(ve(e)){var t=e;e=this.$(t)}}return e.remove()}};function uh(r,e,t,a){var n=4,i=.001,o=1e-7,s=10,l=11,u=1/(l-1),v=typeof Float32Array!="undefined";if(arguments.length!==4)return!1;for(var f=0;f<4;++f)if(typeof arguments[f]!="number"||isNaN(arguments[f])||!isFinite(arguments[f]))return!1;r=Math.min(r,1),t=Math.min(t,1),r=Math.max(r,0),t=Math.max(t,0);var c=v?new Float32Array(l):new Array(l);function h(P,L){return 1-3*L+3*P}function d(P,L){return 3*L-6*P}function m(P){return 3*P}function p(P,L,T){return((h(L,T)*P+d(L,T))*P+m(L))*P}function g(P,L,T){return 3*h(L,T)*P*P+2*d(L,T)*P+m(L)}function y(P,L){for(var T=0;T<n;++T){var A=g(L,r,t);if(A===0)return L;var B=p(L,r,t)-P;L-=B/A}return L}function b(){for(var P=0;P<l;++P)c[P]=p(P*u,r,t)}function w(P,L,T){var A,B,O=0;do B=L+(T-L)/2,A=p(B,r,t)-P,A>0?T=B:L=B;while(Math.abs(A)>o&&++O<s);return B}function D(P){for(var L=0,T=1,A=l-1;T!==A&&c[T]<=P;++T)L+=u;--T;var B=(P-c[T])/(c[T+1]-c[T]),O=L+B*u,R=g(O,r,t);return R>=i?y(P,O):R===0?O:w(P,L,L+u)}var C=!1;function x(){C=!0,(r!==e||t!==a)&&b()}var k=function(L){return C||x(),r===e&&t===a?L:L===0?0:L===1?1:p(D(L),e,a)};k.getControlPoints=function(){return[{x:r,y:e},{x:t,y:a}]};var E="generateBezier("+[r,e,t,a]+")";return k.toString=function(){return E},k}var lh=function(){function r(a){return-a.tension*a.x-a.friction*a.v}function e(a,n,i){var o={x:a.x+i.dx*n,v:a.v+i.dv*n,tension:a.tension,friction:a.friction};return{dx:o.v,dv:r(o)}}function t(a,n){var i={dx:a.v,dv:r(a)},o=e(a,n*.5,i),s=e(a,n*.5,o),l=e(a,n,s),u=1/6*(i.dx+2*(o.dx+s.dx)+l.dx),v=1/6*(i.dv+2*(o.dv+s.dv)+l.dv);return a.x=a.x+u*n,a.v=a.v+v*n,a}return function a(n,i,o){var s={x:-1,v:0,tension:null,friction:null},l=[0],u=0,v=1/1e4,f=16/1e3,c,h,d;for(n=parseFloat(n)||500,i=parseFloat(i)||20,o=o||null,s.tension=n,s.friction=i,c=o!==null,c?(u=a(n,i),h=u/o*f):h=f;d=t(d||s,h),l.push(1+d.x),u+=16,Math.abs(d.x)>v&&Math.abs(d.v)>v;);return c?function(m){return l[m*(l.length-1)|0]}:u}}(),Oe=function(e,t,a,n){var i=uh(e,t,a,n);return function(o,s,l){return o+(s-o)*i(l)}},Ja={linear:function(e,t,a){return e+(t-e)*a},ease:Oe(.25,.1,.25,1),"ease-in":Oe(.42,0,1,1),"ease-out":Oe(0,0,.58,1),"ease-in-out":Oe(.42,0,.58,1),"ease-in-sine":Oe(.47,0,.745,.715),"ease-out-sine":Oe(.39,.575,.565,1),"ease-in-out-sine":Oe(.445,.05,.55,.95),"ease-in-quad":Oe(.55,.085,.68,.53),"ease-out-quad":Oe(.25,.46,.45,.94),"ease-in-out-quad":Oe(.455,.03,.515,.955),"ease-in-cubic":Oe(.55,.055,.675,.19),"ease-out-cubic":Oe(.215,.61,.355,1),"ease-in-out-cubic":Oe(.645,.045,.355,1),"ease-in-quart":Oe(.895,.03,.685,.22),"ease-out-quart":Oe(.165,.84,.44,1),"ease-in-out-quart":Oe(.77,0,.175,1),"ease-in-quint":Oe(.755,.05,.855,.06),"ease-out-quint":Oe(.23,1,.32,1),"ease-in-out-quint":Oe(.86,0,.07,1),"ease-in-expo":Oe(.95,.05,.795,.035),"ease-out-expo":Oe(.19,1,.22,1),"ease-in-out-expo":Oe(1,0,0,1),"ease-in-circ":Oe(.6,.04,.98,.335),"ease-out-circ":Oe(.075,.82,.165,1),"ease-in-out-circ":Oe(.785,.135,.15,.86),spring:function(e,t,a){if(a===0)return Ja.linear;var n=lh(e,t,a);return function(i,o,s){return i+(o-i)*n(s)}},"cubic-bezier":Oe};function us(r,e,t,a,n){if(a===1||e===t)return t;var i=n(e,t,a);return r==null||((r.roundValue||r.color)&&(i=Math.round(i)),r.min!==void 0&&(i=Math.max(i,r.min)),r.max!==void 0&&(i=Math.min(i,r.max))),i}function ls(r,e){return r.pfValue!=null||r.value!=null?r.pfValue!=null&&(e==null||e.type.units!=="%")?r.pfValue:r.value:r}function Pt(r,e,t,a,n){var i=n!=null?n.type:null;t<0?t=0:t>1&&(t=1);var o=ls(r,n),s=ls(e,n);if(ae(o)&&ae(s))return us(i,o,s,t,a);if(Ae(o)&&Ae(s)){for(var l=[],u=0;u<s.length;u++){var v=o[u],f=s[u];if(v!=null&&f!=null){var c=us(i,v,f,t,a);l.push(c)}else l.push(f)}return l}}function vh(r,e,t,a){var n=!a,i=r._private,o=e._private,s=o.easing,l=o.startTime,u=a?r:r.cy(),v=u.style();if(!o.easingImpl)if(s==null)o.easingImpl=Ja.linear;else{var f;if(ve(s)){var c=v.parse("transition-timing-function",s);f=c.value}else f=s;var h,d;ve(f)?(h=f,d=[]):(h=f[1],d=f.slice(2).map(function(V){return+V})),d.length>0?(h==="spring"&&d.push(o.duration),o.easingImpl=Ja[h].apply(null,d)):o.easingImpl=Ja[h]}var m=o.easingImpl,p;if(o.duration===0?p=1:p=(t-l)/o.duration,o.applying&&(p=o.progress),p<0?p=0:p>1&&(p=1),o.delay==null){var g=o.startPosition,y=o.position;if(y&&n&&!r.locked()){var b={};sa(g.x,y.x)&&(b.x=Pt(g.x,y.x,p,m)),sa(g.y,y.y)&&(b.y=Pt(g.y,y.y,p,m)),r.position(b)}var w=o.startPan,D=o.pan,C=i.pan,x=D!=null&&a;x&&(sa(w.x,D.x)&&(C.x=Pt(w.x,D.x,p,m)),sa(w.y,D.y)&&(C.y=Pt(w.y,D.y,p,m)),r.emit("pan"));var k=o.startZoom,E=o.zoom,P=E!=null&&a;P&&(sa(k,E)&&(i.zoom=Zt(i.minZoom,Pt(k,E,p,m),i.maxZoom)),r.emit("zoom")),(x||P)&&r.emit("viewport");var L=o.style;if(L&&L.length>0&&n){for(var T=0;T<L.length;T++){var A=L[T],B=A.name,O=A,R=o.startStyle[B],M=v.properties[R.name],I=Pt(R,O,p,m,M);v.overrideBypass(r,B,I)}r.emit("style")}}return o.progress=p,p}function sa(r,e){return r==null||e==null?!1:ae(r)&&ae(e)?!0:!!(r&&e)}function fh(r,e,t,a){var n=e._private;n.started=!0,n.startTime=t-n.progress*n.duration}function vs(r,e){var t=e._private.aniEles,a=[];function n(v,f){var c=v._private,h=c.animation.current,d=c.animation.queue,m=!1;if(h.length===0){var p=d.shift();p&&h.push(p)}for(var g=function(C){for(var x=C.length-1;x>=0;x--){var k=C[x];k()}C.splice(0,C.length)},y=h.length-1;y>=0;y--){var b=h[y],w=b._private;if(w.stopped){h.splice(y,1),w.hooked=!1,w.playing=!1,w.started=!1,g(w.frames);continue}!w.playing&&!w.applying||(w.playing&&w.applying&&(w.applying=!1),w.started||fh(v,b,r),vh(v,b,r,f),w.applying&&(w.applying=!1),g(w.frames),w.step!=null&&w.step(r),b.completed()&&(h.splice(y,1),w.hooked=!1,w.playing=!1,w.started=!1,g(w.completes)),m=!0)}return!f&&h.length===0&&d.length===0&&a.push(v),m}for(var i=!1,o=0;o<t.length;o++){var s=t[o],l=n(s);i=i||l}var u=n(e,!0);(i||u)&&(t.length>0?e.notify("draw",t):e.notify("draw")),t.unmerge(a),e.emit("step")}var ch={animate:Le.animate(),animation:Le.animation(),animated:Le.animated(),clearQueue:Le.clearQueue(),delay:Le.delay(),delayAnimation:Le.delayAnimation(),stop:Le.stop(),addToAnimationPool:function(e){var t=this;t.styleEnabled()&&t._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function t(){e._private.animationsRunning&&Ca(function(i){vs(i,e),t()})}var a=e.renderer();a&&a.beforeRender?a.beforeRender(function(i,o){vs(o,e)},a.beforeRenderPriorities.animations):t()}},dh={qualifierCompare:function(e,t){return e==null||t==null?e==null&&t==null:e.sameText(t)},eventMatches:function(e,t,a){var n=t.qualifier;return n!=null?e!==a.target&&Vt(a.target)&&n.matches(a.target):!0},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,a){return t.qualifier!=null?a.target:e}},ja=function(e){return ve(e)?new $r(e):e},fs={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Ya(dh,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,a){return this.emitter().on(e,ja(t),a),this},removeListener:function(e,t,a){return this.emitter().removeListener(e,ja(t),a),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,a){return this.emitter().one(e,ja(t),a),this},once:function(e,t,a){return this.emitter().one(e,ja(t),a),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};Le.eventAliasesOn(fs);var Un={png:function(e){var t=this._private.renderer;return e=e||{},t.png(e)},jpg:function(e){var t=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",t.jpg(e)}};Un.jpeg=Un.jpg;var en={layout:function(e){var t=this;if(e==null){Ne("Layout options must be specified to make a layout");return}if(e.name==null){Ne("A `name` must be specified to make a layout");return}var a=e.name,n=t.extension("layout",a);if(n==null){Ne("No such layout `"+a+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;ve(e.eles)?i=t.$(e.eles):i=e.eles!=null?e.eles:t.$();var o=new n(de({},e,{cy:t,eles:i}));return o}};en.createLayout=en.makeLayout=en.layout;var hh={notify:function(e,t){var a=this._private;if(this.batching()){a.batchNotifications=a.batchNotifications||{};var n=a.batchNotifications[e]=a.batchNotifications[e]||this.collection();t!=null&&n.merge(t);return}if(a.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(e,t)}},notifications:function(e){var t=this._private;return e===void 0?t.notificationsEnabled:(t.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach(function(a){var n=e.batchNotifications[a];n.empty()?t.notify(a):t.notify(a,n)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch(function(){for(var a=Object.keys(e),n=0;n<a.length;n++){var i=a[n],o=e[i],s=t.getElementById(i);s.data(o)}})}},gh=Ke({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1}),Zn={renderTo:function(e,t,a,n){var i=this._private.renderer;return i.renderTo(e,t,a,n),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(e){var t=this,a=t.extension("renderer",e.name);if(a==null){Ne("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}e.wheelSensitivity!==void 0&&Be("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");var n=gh(e);n.cy=t,t._private.renderer=new a(n),this.notify("init")},destroyRenderer:function(){var e=this;e.notify("destroy");var t=e.container();if(t)for(t._cyreg=null;t.childNodes.length>0;)t.removeChild(t.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(a){var n=a._private;n.rscratch={},n.rstyle={},n.animation.current=[],n.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};Zn.invalidateDimensions=Zn.resize;var rn={collection:function(e,t){return ve(e)?this.$(e):vr(e)?e.collection():Ae(e)?(t||(t={}),new Xe(this,e,t.unique,t.removed)):new Xe(this)},nodes:function(e){var t=this.$(function(a){return a.isNode()});return e?t.filter(e):t},edges:function(e){var t=this.$(function(a){return a.isEdge()});return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};rn.elements=rn.filter=rn.$;var je={},ua="t",ph="f";je.apply=function(r){for(var e=this,t=e._private,a=t.cy,n=a.collection(),i=0;i<r.length;i++){var o=r[i],s=e.getContextMeta(o);if(!s.empty){var l=e.getContextStyle(s),u=e.applyContextStyle(s,l,o);o._private.appliedInitStyle?e.updateTransitions(o,u.diffProps):o._private.appliedInitStyle=!0;var v=e.updateStyleHints(o);v&&n.push(o)}}return n},je.getPropertiesDiff=function(r,e){var t=this,a=t._private.propDiffs=t._private.propDiffs||{},n=r+"-"+e,i=a[n];if(i)return i;for(var o=[],s={},l=0;l<t.length;l++){var u=t[l],v=r[l]===ua,f=e[l]===ua,c=v!==f,h=u.mappedProperties.length>0;if(c||f&&h){var d=void 0;c&&h||c?d=u.properties:h&&(d=u.mappedProperties);for(var m=0;m<d.length;m++){for(var p=d[m],g=p.name,y=!1,b=l+1;b<t.length;b++){var w=t[b],D=e[b]===ua;if(D&&(y=w.properties[p.name]!=null,y))break}!s[g]&&!y&&(s[g]=!0,o.push(g))}}}return a[n]=o,o},je.getContextMeta=function(r){for(var e=this,t="",a,n=r._private.styleCxtKey||"",i=0;i<e.length;i++){var o=e[i],s=o.selector&&o.selector.matches(r);s?t+=ua:t+=ph}return a=e.getPropertiesDiff(n,t),r._private.styleCxtKey=t,{key:t,diffPropNames:a,empty:a.length===0}},je.getContextStyle=function(r){var e=r.key,t=this,a=this._private.contextStyles=this._private.contextStyles||{};if(a[e])return a[e];for(var n={_private:{key:e}},i=0;i<t.length;i++){var o=t[i],s=e[i]===ua;if(s)for(var l=0;l<o.properties.length;l++){var u=o.properties[l];n[u.name]=u}}return a[e]=n,n},je.applyContextStyle=function(r,e,t){for(var a=this,n=r.diffPropNames,i={},o=a.types,s=0;s<n.length;s++){var l=n[s],u=e[l],v=t.pstyle(l);if(!u)if(v)v.bypass?u={name:l,deleteBypassed:!0}:u={name:l,delete:!0};else continue;if(v!==u){if(u.mapped===o.fn&&v!=null&&v.mapping!=null&&v.mapping.value===u.value){var f=v.mapping,c=f.fnValue=u.value(t);if(c===f.prevFnValue)continue}var h=i[l]={prev:v};a.applyParsedProperty(t,u),h.next=t.pstyle(l),h.next&&h.next.bypass&&(h.next=h.next.bypassed)}}return{diffProps:i}},je.updateStyleHints=function(r){var e=r._private,t=this,a=t.propertyGroupNames,n=t.propertyGroupKeys,i=function(ee,oe,he){return t.getPropertiesHash(ee,oe,he)},o=e.styleKey;if(r.removed())return!1;var s=e.group==="nodes",l=r._private.style;a=Object.keys(l);for(var u=0;u<n.length;u++){var v=n[u];e.styleKeys[v]=[vt,Gt]}for(var f=function(ee,oe){return e.styleKeys[oe][0]=Kt(ee,e.styleKeys[oe][0])},c=function(ee,oe){return e.styleKeys[oe][1]=Yt(ee,e.styleKeys[oe][1])},h=function(ee,oe){f(ee,oe),c(ee,oe)},d=function(ee,oe){for(var he=0;he<ee.length;he++){var re=ee.charCodeAt(he);f(re,oe),c(re,oe)}},m=2e9,p=function(ee){return-128<ee&&ee<128&&Math.floor(ee)!==ee?m-(ee*1024|0):ee},g=0;g<a.length;g++){var y=a[g],b=l[y];if(b!=null){var w=this.properties[y],D=w.type,C=w.groupKey,x=void 0;w.hashOverride!=null?x=w.hashOverride(r,b):b.pfValue!=null&&(x=b.pfValue);var k=w.enums==null?b.value:null,E=x!=null,P=k!=null,L=E||P,T=b.units;if(D.number&&L&&!D.multiple){var A=E?x:k;h(p(A),C),!E&&T!=null&&d(T,C)}else d(b.strValue,C)}}for(var B=[vt,Gt],O=0;O<n.length;O++){var R=n[O],M=e.styleKeys[R];B[0]=Kt(M[0],B[0]),B[1]=Yt(M[1],B[1])}e.styleKey=wl(B[0],B[1]);var I=e.styleKeys;e.labelDimsKey=zr(I.labelDimensions);var V=i(r,["label"],I.labelDimensions);if(e.labelKey=zr(V),e.labelStyleKey=zr(Sa(I.commonLabel,V)),!s){var G=i(r,["source-label"],I.labelDimensions);e.sourceLabelKey=zr(G),e.sourceLabelStyleKey=zr(Sa(I.commonLabel,G));var z=i(r,["target-label"],I.labelDimensions);e.targetLabelKey=zr(z),e.targetLabelStyleKey=zr(Sa(I.commonLabel,z))}if(s){var H=e.styleKeys,Y=H.nodeBody,Q=H.nodeBorder,X=H.nodeOutline,U=H.backgroundImage,N=H.compound,_=H.pie,j=[Y,Q,X,U,N,_].filter(function(J){return J!=null}).reduce(Sa,[vt,Gt]);e.nodeKey=zr(j),e.hasPie=_!=null&&_[0]!==vt&&_[1]!==Gt}return o!==e.styleKey},je.clearStyleHints=function(r){var e=r._private;e.styleCxtKey="",e.styleKeys={},e.styleKey=null,e.labelKey=null,e.labelStyleKey=null,e.sourceLabelKey=null,e.sourceLabelStyleKey=null,e.targetLabelKey=null,e.targetLabelStyleKey=null,e.nodeKey=null,e.hasPie=null},je.applyParsedProperty=function(r,e){var t=this,a=e,n=r._private.style,i,o=t.types,s=t.properties[a.name].type,l=a.bypass,u=n[a.name],v=u&&u.bypass,f=r._private,c="mapping",h=function(Y){return Y==null?null:Y.pfValue!=null?Y.pfValue:Y.value},d=function(){var Y=h(u),Q=h(a);t.checkTriggers(r,a.name,Y,Q)};if(e.name==="curve-style"&&r.isEdge()&&(e.value!=="bezier"&&r.isLoop()||e.value==="haystack"&&(r.source().isParent()||r.target().isParent()))&&(a=e=this.parse(e.name,"bezier",l)),a.delete)return n[a.name]=void 0,d(),!0;if(a.deleteBypassed)return u?u.bypass?(u.bypassed=void 0,d(),!0):!1:(d(),!0);if(a.deleteBypass)return u?u.bypass?(n[a.name]=u.bypassed,d(),!0):!1:(d(),!0);var m=function(){Be("Do not assign mappings to elements without corresponding data (i.e. ele `"+r.id()+"` has no mapping for property `"+a.name+"` with data field `"+a.field+"`); try a `["+a.field+"]` selector to limit scope to elements with `"+a.field+"` defined")};switch(a.mapped){case o.mapData:{for(var p=a.field.split("."),g=f.data,y=0;y<p.length&&g;y++){var b=p[y];g=g[b]}if(g==null)return m(),!1;var w;if(ae(g)){var D=a.fieldMax-a.fieldMin;D===0?w=0:w=(g-a.fieldMin)/D}else return Be("Do not use continuous mappers without specifying numeric data (i.e. `"+a.field+": "+g+"` for `"+r.id()+"` is non-numeric)"),!1;if(w<0?w=0:w>1&&(w=1),s.color){var C=a.valueMin[0],x=a.valueMax[0],k=a.valueMin[1],E=a.valueMax[1],P=a.valueMin[2],L=a.valueMax[2],T=a.valueMin[3]==null?1:a.valueMin[3],A=a.valueMax[3]==null?1:a.valueMax[3],B=[Math.round(C+(x-C)*w),Math.round(k+(E-k)*w),Math.round(P+(L-P)*w),Math.round(T+(A-T)*w)];i={bypass:a.bypass,name:a.name,value:B,strValue:"rgb("+B[0]+", "+B[1]+", "+B[2]+")"}}else if(s.number){var O=a.valueMin+(a.valueMax-a.valueMin)*w;i=this.parse(a.name,O,a.bypass,c)}else return!1;if(!i)return m(),!1;i.mapping=a,a=i;break}case o.data:{for(var R=a.field.split("."),M=f.data,I=0;I<R.length&&M;I++){var V=R[I];M=M[V]}if(M!=null&&(i=this.parse(a.name,M,a.bypass,c)),!i)return m(),!1;i.mapping=a,a=i;break}case o.fn:{var G=a.value,z=a.fnValue!=null?a.fnValue:G(r);if(a.prevFnValue=z,z==null)return Be("Custom function mappers may not return null (i.e. `"+a.name+"` for ele `"+r.id()+"` is null)"),!1;if(i=this.parse(a.name,z,a.bypass,c),!i)return Be("Custom function mappers may not return invalid values for the property type (i.e. `"+a.name+"` for ele `"+r.id()+"` is invalid)"),!1;i.mapping=Cr(a),a=i;break}case void 0:break;default:return!1}return l?(v?a.bypassed=u.bypassed:a.bypassed=u,n[a.name]=a):v?u.bypassed=a:n[a.name]=a,d(),!0},je.cleanElements=function(r,e){for(var t=0;t<r.length;t++){var a=r[t];if(this.clearStyleHints(a),a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),!e)a._private.style={};else for(var n=a._private.style,i=Object.keys(n),o=0;o<i.length;o++){var s=i[o],l=n[s];l!=null&&(l.bypass?l.bypassed=null:n[s]=null)}}},je.update=function(){var r=this._private.cy,e=r.mutableElements();e.updateStyle()},je.updateTransitions=function(r,e){var t=this,a=r._private,n=r.pstyle("transition-property").value,i=r.pstyle("transition-duration").pfValue,o=r.pstyle("transition-delay").pfValue;if(n.length>0&&i>0){for(var s={},l=!1,u=0;u<n.length;u++){var v=n[u],f=r.pstyle(v),c=e[v];if(c){var h=c.prev,d=h,m=c.next!=null?c.next:f,p=!1,g=void 0,y=1e-6;d&&(ae(d.pfValue)&&ae(m.pfValue)?(p=m.pfValue-d.pfValue,g=d.pfValue+y*p):ae(d.value)&&ae(m.value)?(p=m.value-d.value,g=d.value+y*p):Ae(d.value)&&Ae(m.value)&&(p=d.value[0]!==m.value[0]||d.value[1]!==m.value[1]||d.value[2]!==m.value[2],g=d.strValue),p&&(s[v]=m.strValue,this.applyBypass(r,v,g),l=!0))}}if(!l)return;a.transitioning=!0,new yt(function(b){o>0?r.delayAnimation(o).play().promise().then(b):b()}).then(function(){return r.animation({style:s,duration:i,easing:r.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){t.removeBypasses(r,n),r.emitAndNotify("style"),a.transitioning=!1})}else a.transitioning&&(this.removeBypasses(r,n),r.emitAndNotify("style"),a.transitioning=!1)},je.checkTrigger=function(r,e,t,a,n,i){var o=this.properties[e],s=n(o);s!=null&&s(t,a)&&i(o)},je.checkZOrderTrigger=function(r,e,t,a){var n=this;this.checkTrigger(r,e,t,a,function(i){return i.triggersZOrder},function(){n._private.cy.notify("zorder",r)})},je.checkBoundsTrigger=function(r,e,t,a){this.checkTrigger(r,e,t,a,function(n){return n.triggersBounds},function(n){r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache(),n.triggersBoundsOfParallelBeziers&&e==="curve-style"&&(t==="bezier"||a==="bezier")&&r.parallelEdges().forEach(function(i){i.isBundledBezier()&&i.dirtyBoundingBoxCache()}),n.triggersBoundsOfConnectedEdges&&e==="display"&&(t==="none"||a==="none")&&r.connectedEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})},je.checkTriggers=function(r,e,t,a){r.dirtyStyleCache(),this.checkZOrderTrigger(r,e,t,a),this.checkBoundsTrigger(r,e,t,a)};var la={};la.applyBypass=function(r,e,t,a){var n=this,i=[],o=!0;if(e==="*"||e==="**"){if(t!==void 0)for(var s=0;s<n.properties.length;s++){var l=n.properties[s],u=l.name,v=this.parse(u,t,!0);v&&i.push(v)}}else if(ve(e)){var f=this.parse(e,t,!0);f&&i.push(f)}else if(Ce(e)){var c=e;a=t;for(var h=Object.keys(c),d=0;d<h.length;d++){var m=h[d],p=c[m];if(p===void 0&&(p=c[wa(m)]),p!==void 0){var g=this.parse(m,p,!0);g&&i.push(g)}}}else return!1;if(i.length===0)return!1;for(var y=!1,b=0;b<r.length;b++){for(var w=r[b],D={},C=void 0,x=0;x<i.length;x++){var k=i[x];if(a){var E=w.pstyle(k.name);C=D[k.name]={prev:E}}y=this.applyParsedProperty(w,Cr(k))||y,a&&(C.next=w.pstyle(k.name))}y&&this.updateStyleHints(w),a&&this.updateTransitions(w,D,o)}return y},la.overrideBypass=function(r,e,t){e=bn(e);for(var a=0;a<r.length;a++){var n=r[a],i=n._private.style[e],o=this.properties[e].type,s=o.color,l=o.mutiple,u=i?i.pfValue!=null?i.pfValue:i.value:null;!i||!i.bypass?this.applyBypass(n,e,t):(i.value=t,i.pfValue!=null&&(i.pfValue=t),s?i.strValue="rgb("+t.join(",")+")":l?i.strValue=t.join(" "):i.strValue=""+t,this.updateStyleHints(n)),this.checkTriggers(n,e,u,t)}},la.removeAllBypasses=function(r,e){return this.removeBypasses(r,this.propertyNames,e)},la.removeBypasses=function(r,e,t){for(var a=!0,n=0;n<r.length;n++){for(var i=r[n],o={},s=0;s<e.length;s++){var l=e[s],u=this.properties[l],v=i.pstyle(u.name);if(!(!v||!v.bypass)){var f="",c=this.parse(l,f,!0),h=o[u.name]={prev:v};this.applyParsedProperty(i,c),h.next=i.pstyle(u.name)}}this.updateStyleHints(i),t&&this.updateTransitions(i,o,a)}};var Qn={};Qn.getEmSizeInPixels=function(){var r=this.containerCss("font-size");return r!=null?parseFloat(r):1},Qn.containerCss=function(r){var e=this._private.cy,t=e.container(),a=e.window();if(a&&t&&a.getComputedStyle)return a.getComputedStyle(t).getPropertyValue(r)};var Tr={};Tr.getRenderedStyle=function(r,e){return e?this.getStylePropertyValue(r,e,!0):this.getRawStyle(r,!0)},Tr.getRawStyle=function(r,e){var t=this;if(r=r[0],r){for(var a={},n=0;n<t.properties.length;n++){var i=t.properties[n],o=t.getStylePropertyValue(r,i.name,e);o!=null&&(a[i.name]=o,a[wa(i.name)]=o)}return a}},Tr.getIndexedStyle=function(r,e,t,a){var n=r.pstyle(e)[t][a];return n!=null?n:r.cy().style().getDefaultProperty(e)[t][0]},Tr.getStylePropertyValue=function(r,e,t){var a=this;if(r=r[0],r){var n=a.properties[e];n.alias&&(n=n.pointsTo);var i=n.type,o=r.pstyle(n.name);if(o){var s=o.value,l=o.units,u=o.strValue;if(t&&i.number&&s!=null&&ae(s)){var v=r.cy().zoom(),f=function(p){return p*v},c=function(p,g){return f(p)+g},h=Ae(s),d=h?l.every(function(m){return m!=null}):l!=null;return d?h?s.map(function(m,p){return c(m,l[p])}).join(" "):c(s,l):h?s.map(function(m){return ve(m)?m:""+f(m)}).join(" "):""+f(s)}else if(u!=null)return u}return null}},Tr.getAnimationStartStyle=function(r,e){for(var t={},a=0;a<e.length;a++){var n=e[a],i=n.name,o=r.pstyle(i);o!==void 0&&(Ce(o)?o=this.parse(i,o.strValue):o=this.parse(i,o)),o&&(t[i]=o)}return t},Tr.getPropsList=function(r){var e=this,t=[],a=r,n=e.properties;if(a)for(var i=Object.keys(a),o=0;o<i.length;o++){var s=i[o],l=a[s],u=n[s]||n[bn(s)],v=this.parse(u.name,l);v&&t.push(v)}return t},Tr.getNonDefaultPropertiesHash=function(r,e,t){var a=t.slice(),n,i,o,s,l,u;for(l=0;l<e.length;l++)if(n=e[l],i=r.pstyle(n,!1),i!=null)if(i.pfValue!=null)a[0]=Kt(s,a[0]),a[1]=Yt(s,a[1]);else for(o=i.strValue,u=0;u<o.length;u++)s=o.charCodeAt(u),a[0]=Kt(s,a[0]),a[1]=Yt(s,a[1]);return a},Tr.getPropertiesHash=Tr.getNonDefaultPropertiesHash;var tn={};tn.appendFromJson=function(r){for(var e=this,t=0;t<r.length;t++){var a=r[t],n=a.selector,i=a.style||a.css,o=Object.keys(i);e.selector(n);for(var s=0;s<o.length;s++){var l=o[s],u=i[l];e.css(l,u)}}return e},tn.fromJson=function(r){var e=this;return e.resetToDefault(),e.appendFromJson(r),e},tn.json=function(){for(var r=[],e=this.defaultLength;e<this.length;e++){for(var t=this[e],a=t.selector,n=t.properties,i={},o=0;o<n.length;o++){var s=n[o];i[s.name]=s.strValue}r.push({selector:a?a.toString():"core",style:i})}return r};var _n={};_n.appendFromString=function(r){var e=this,t=this,a=""+r,n,i,o;a=a.replace(/[/][*](\s|.)+?[*][/]/g,"");function s(){a.length>n.length?a=a.substr(n.length):a=""}function l(){i.length>o.length?i=i.substr(o.length):i=""}for(;;){var u=a.match(/^\s*$/);if(u)break;var v=a.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!v){Be("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+a);break}n=v[0];var f=v[1];if(f!=="core"){var c=new $r(f);if(c.invalid){Be("Skipping parsing of block: Invalid selector found in string stylesheet: "+f),s();continue}}var h=v[2],d=!1;i=h;for(var m=[];;){var p=i.match(/^\s*$/);if(p)break;var g=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!g){Be("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+h),d=!0;break}o=g[0];var y=g[1],b=g[2],w=e.properties[y];if(!w){Be("Skipping property: Invalid property name in: "+o),l();continue}var D=t.parse(y,b);if(!D){Be("Skipping property: Invalid property definition in: "+o),l();continue}m.push({name:y,val:b}),l()}if(d){s();break}t.selector(f);for(var C=0;C<m.length;C++){var x=m[C];t.css(x.name,x.val)}s()}return t},_n.fromString=function(r){var e=this;return e.resetToDefault(),e.appendFromString(r),e};var Ue={};(function(){var r=He,e=Cu,t=Tu,a=Du,n=ku,i=function(j){return"^"+j+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},o=function(j){var J=r+"|\\w+|"+e+"|"+t+"|"+a+"|"+n;return"^"+j+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+r+")\\s*\\,\\s*("+r+")\\s*,\\s*("+J+")\\s*\\,\\s*("+J+")\\)$"},s=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];Ue.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},nonNegativeNumber:{number:!0,min:0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials","null"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi"]},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","right-rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},arrowWidth:{number:!0,units:"%|px|em",implicitUnits:"px",enums:["match-line"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},justification:{enums:["left","center","right","auto"]},text:{string:!0},data:{mapping:!0,regex:i("data")},layoutData:{mapping:!0,regex:i("layoutData")},scratch:{mapping:!0,regex:i("scratch")},mapData:{mapping:!0,regex:o("mapData")},mapLayoutData:{mapping:!0,regex:o("mapLayoutData")},mapScratch:{mapping:!0,regex:o("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:s,singleRegexMatchValue:!0},urls:{regexes:s,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position","endpoints"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:function(j,J){switch(j.length){case 2:return J[0]!=="deg"&&J[0]!=="rad"&&J[1]!=="deg"&&J[1]!=="rad";case 1:return ve(j[0])||J[0]==="deg"||J[0]==="rad";default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+r+")\\s*,\\s*("+r+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+r+")\\s*,\\s*("+r+")\\s*,\\s*("+r+")\\s*,\\s*("+r+")\\s*\\)$"],enums:["linear","ease","ease-in","ease-out","ease-in-out","ease-in-sine","ease-out-sine","ease-in-out-sine","ease-in-quad","ease-out-quad","ease-in-out-quad","ease-in-cubic","ease-out-cubic","ease-in-out-cubic","ease-in-quart","ease-out-quart","ease-in-out-quart","ease-in-quint","ease-out-quint","ease-in-out-quint","ease-in-expo","ease-out-expo","ease-in-out-expo","ease-in-circ","ease-out-circ","ease-in-out-circ"]},gradientDirection:{enums:["to-bottom","to-top","to-left","to-right","to-bottom-right","to-bottom-left","to-top-right","to-top-left","to-right-bottom","to-left-bottom","to-right-top","to-left-top"]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:function(j){var J=j.length;return J===1||J===2||J===4}}};var l={zeroNonZero:function(j,J){return(j==null||J==null)&&j!==J||j==0&&J!=0?!0:j!=0&&J==0},any:function(j,J){return j!=J},emptyNonEmpty:function(j,J){var ee=Ir(j),oe=Ir(J);return ee&&!oe||!ee&&oe}},u=Ue.types,v=[{name:"label",type:u.text,triggersBounds:l.any,triggersZOrder:l.emptyNonEmpty},{name:"text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any}],f=[{name:"source-label",type:u.text,triggersBounds:l.any},{name:"source-text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"source-text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"source-text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"source-text-offset",type:u.size,triggersBounds:l.any}],c=[{name:"target-label",type:u.text,triggersBounds:l.any},{name:"target-text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"target-text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"target-text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"target-text-offset",type:u.size,triggersBounds:l.any}],h=[{name:"font-family",type:u.fontFamily,triggersBounds:l.any},{name:"font-style",type:u.fontStyle,triggersBounds:l.any},{name:"font-weight",type:u.fontWeight,triggersBounds:l.any},{name:"font-size",type:u.size,triggersBounds:l.any},{name:"text-transform",type:u.textTransform,triggersBounds:l.any},{name:"text-wrap",type:u.textWrap,triggersBounds:l.any},{name:"text-overflow-wrap",type:u.textOverflowWrap,triggersBounds:l.any},{name:"text-max-width",type:u.size,triggersBounds:l.any},{name:"text-outline-width",type:u.size,triggersBounds:l.any},{name:"line-height",type:u.positiveNumber,triggersBounds:l.any}],d=[{name:"text-valign",type:u.valign,triggersBounds:l.any},{name:"text-halign",type:u.halign,triggersBounds:l.any},{name:"color",type:u.color},{name:"text-outline-color",type:u.color},{name:"text-outline-opacity",type:u.zeroOneNumber},{name:"text-background-color",type:u.color},{name:"text-background-opacity",type:u.zeroOneNumber},{name:"text-background-padding",type:u.size,triggersBounds:l.any},{name:"text-border-opacity",type:u.zeroOneNumber},{name:"text-border-color",type:u.color},{name:"text-border-width",type:u.size,triggersBounds:l.any},{name:"text-border-style",type:u.borderStyle,triggersBounds:l.any},{name:"text-background-shape",type:u.textBackgroundShape,triggersBounds:l.any},{name:"text-justification",type:u.justification}],m=[{name:"events",type:u.bool,triggersZOrder:l.any},{name:"text-events",type:u.bool,triggersZOrder:l.any}],p=[{name:"display",type:u.display,triggersZOrder:l.any,triggersBounds:l.any,triggersBoundsOfConnectedEdges:!0},{name:"visibility",type:u.visibility,triggersZOrder:l.any},{name:"opacity",type:u.zeroOneNumber,triggersZOrder:l.zeroNonZero},{name:"text-opacity",type:u.zeroOneNumber},{name:"min-zoomed-font-size",type:u.size},{name:"z-compound-depth",type:u.zCompoundDepth,triggersZOrder:l.any},{name:"z-index-compare",type:u.zIndexCompare,triggersZOrder:l.any},{name:"z-index",type:u.number,triggersZOrder:l.any}],g=[{name:"overlay-padding",type:u.size,triggersBounds:l.any},{name:"overlay-color",type:u.color},{name:"overlay-opacity",type:u.zeroOneNumber,triggersBounds:l.zeroNonZero},{name:"overlay-shape",type:u.overlayShape,triggersBounds:l.any}],y=[{name:"underlay-padding",type:u.size,triggersBounds:l.any},{name:"underlay-color",type:u.color},{name:"underlay-opacity",type:u.zeroOneNumber,triggersBounds:l.zeroNonZero},{name:"underlay-shape",type:u.overlayShape,triggersBounds:l.any}],b=[{name:"transition-property",type:u.propList},{name:"transition-duration",type:u.time},{name:"transition-delay",type:u.time},{name:"transition-timing-function",type:u.easing}],w=function(j,J){return J.value==="label"?-j.poolIndex():J.pfValue},D=[{name:"height",type:u.nodeSize,triggersBounds:l.any,hashOverride:w},{name:"width",type:u.nodeSize,triggersBounds:l.any,hashOverride:w},{name:"shape",type:u.nodeShape,triggersBounds:l.any},{name:"shape-polygon-points",type:u.polygonPointList,triggersBounds:l.any},{name:"background-color",type:u.color},{name:"background-fill",type:u.fill},{name:"background-opacity",type:u.zeroOneNumber},{name:"background-blacken",type:u.nOneOneNumber},{name:"background-gradient-stop-colors",type:u.colors},{name:"background-gradient-stop-positions",type:u.percentages},{name:"background-gradient-direction",type:u.gradientDirection},{name:"padding",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"padding-relative-to",type:u.paddingRelativeTo,triggersBounds:l.any},{name:"bounds-expansion",type:u.boundsExpansion,triggersBounds:l.any}],C=[{name:"border-color",type:u.color},{name:"border-opacity",type:u.zeroOneNumber},{name:"border-width",type:u.size,triggersBounds:l.any},{name:"border-style",type:u.borderStyle}],x=[{name:"outline-color",type:u.color},{name:"outline-opacity",type:u.zeroOneNumber},{name:"outline-width",type:u.size,triggersBounds:l.any},{name:"outline-style",type:u.borderStyle},{name:"outline-offset",type:u.size,triggersBounds:l.any}],k=[{name:"background-image",type:u.urls},{name:"background-image-crossorigin",type:u.bgCrossOrigin},{name:"background-image-opacity",type:u.zeroOneNumbers},{name:"background-image-containment",type:u.bgContainment},{name:"background-image-smoothing",type:u.bools},{name:"background-position-x",type:u.bgPos},{name:"background-position-y",type:u.bgPos},{name:"background-width-relative-to",type:u.bgRelativeTo},{name:"background-height-relative-to",type:u.bgRelativeTo},{name:"background-repeat",type:u.bgRepeat},{name:"background-fit",type:u.bgFit},{name:"background-clip",type:u.bgClip},{name:"background-width",type:u.bgWH},{name:"background-height",type:u.bgWH},{name:"background-offset-x",type:u.bgPos},{name:"background-offset-y",type:u.bgPos}],E=[{name:"position",type:u.position,triggersBounds:l.any},{name:"compound-sizing-wrt-labels",type:u.compoundIncludeLabels,triggersBounds:l.any},{name:"min-width",type:u.size,triggersBounds:l.any},{name:"min-width-bias-left",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-width-bias-right",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-height",type:u.size,triggersBounds:l.any},{name:"min-height-bias-top",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-height-bias-bottom",type:u.sizeMaybePercent,triggersBounds:l.any}],P=[{name:"line-style",type:u.lineStyle},{name:"line-color",type:u.color},{name:"line-fill",type:u.fill},{name:"line-cap",type:u.lineCap},{name:"line-opacity",type:u.zeroOneNumber},{name:"line-dash-pattern",type:u.numbers},{name:"line-dash-offset",type:u.number},{name:"line-gradient-stop-colors",type:u.colors},{name:"line-gradient-stop-positions",type:u.percentages},{name:"curve-style",type:u.curveStyle,triggersBounds:l.any,triggersBoundsOfParallelBeziers:!0},{name:"haystack-radius",type:u.zeroOneNumber,triggersBounds:l.any},{name:"source-endpoint",type:u.edgeEndpoint,triggersBounds:l.any},{name:"target-endpoint",type:u.edgeEndpoint,triggersBounds:l.any},{name:"control-point-step-size",type:u.size,triggersBounds:l.any},{name:"control-point-distances",type:u.bidirectionalSizes,triggersBounds:l.any},{name:"control-point-weights",type:u.numbers,triggersBounds:l.any},{name:"segment-distances",type:u.bidirectionalSizes,triggersBounds:l.any},{name:"segment-weights",type:u.numbers,triggersBounds:l.any},{name:"taxi-turn",type:u.bidirectionalSizeMaybePercent,triggersBounds:l.any},{name:"taxi-turn-min-distance",type:u.size,triggersBounds:l.any},{name:"taxi-direction",type:u.axisDirection,triggersBounds:l.any},{name:"edge-distances",type:u.edgeDistances,triggersBounds:l.any},{name:"arrow-scale",type:u.positiveNumber,triggersBounds:l.any},{name:"loop-direction",type:u.angle,triggersBounds:l.any},{name:"loop-sweep",type:u.angle,triggersBounds:l.any},{name:"source-distance-from-node",type:u.size,triggersBounds:l.any},{name:"target-distance-from-node",type:u.size,triggersBounds:l.any}],L=[{name:"ghost",type:u.bool,triggersBounds:l.any},{name:"ghost-offset-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"ghost-offset-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"ghost-opacity",type:u.zeroOneNumber}],T=[{name:"selection-box-color",type:u.color},{name:"selection-box-opacity",type:u.zeroOneNumber},{name:"selection-box-border-color",type:u.color},{name:"selection-box-border-width",type:u.size},{name:"active-bg-color",type:u.color},{name:"active-bg-opacity",type:u.zeroOneNumber},{name:"active-bg-size",type:u.size},{name:"outside-texture-bg-color",type:u.color},{name:"outside-texture-bg-opacity",type:u.zeroOneNumber}],A=[];Ue.pieBackgroundN=16,A.push({name:"pie-size",type:u.sizeMaybePercent});for(var B=1;B<=Ue.pieBackgroundN;B++)A.push({name:"pie-"+B+"-background-color",type:u.color}),A.push({name:"pie-"+B+"-background-size",type:u.percent}),A.push({name:"pie-"+B+"-background-opacity",type:u.zeroOneNumber});var O=[],R=Ue.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:u.arrowShape,triggersBounds:l.any},{name:"arrow-color",type:u.color},{name:"arrow-fill",type:u.arrowFill},{name:"arrow-width",type:u.arrowWidth}].forEach(function(_){R.forEach(function(j){var J=j+"-"+_.name,ee=_.type,oe=_.triggersBounds;O.push({name:J,type:ee,triggersBounds:oe})})},{});var M=Ue.properties=[].concat(m,b,p,g,y,L,d,h,v,f,c,D,C,x,k,A,E,P,O,T),I=Ue.propertyGroups={behavior:m,transition:b,visibility:p,overlay:g,underlay:y,ghost:L,commonLabel:d,labelDimensions:h,mainLabel:v,sourceLabel:f,targetLabel:c,nodeBody:D,nodeBorder:C,nodeOutline:x,backgroundImage:k,pie:A,compound:E,edgeLine:P,edgeArrow:O,core:T},V=Ue.propertyGroupNames={},G=Ue.propertyGroupKeys=Object.keys(I);G.forEach(function(_){V[_]=I[_].map(function(j){return j.name}),I[_].forEach(function(j){return j.groupKey=_})});var z=Ue.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"edge-text-rotation",pointsTo:"text-rotation"},{name:"padding-left",pointsTo:"padding"},{name:"padding-right",pointsTo:"padding"},{name:"padding-top",pointsTo:"padding"},{name:"padding-bottom",pointsTo:"padding"}];Ue.propertyNames=M.map(function(_){return _.name});for(var H=0;H<M.length;H++){var Y=M[H];M[Y.name]=Y}for(var Q=0;Q<z.length;Q++){var X=z[Q],U=M[X.pointsTo],N={name:X.name,alias:!0,pointsTo:U};M.push(N),M[X.name]=N}})(),Ue.getDefaultProperty=function(r){return this.getDefaultProperties()[r]},Ue.getDefaultProperties=function(){var r=this._private;if(r.defaultProperties!=null)return r.defaultProperties;for(var e=de({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"overlay-shape":"round-rectangle","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid","outline-color":"#999","outline-opacity":1,"outline-width":0,"outline-offset":0,"outline-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(l,u){for(var v=1;v<=Ue.pieBackgroundN;v++){var f=u.name.replace("{{i}}",v),c=u.value;l[f]=c}return l},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"taxi-turn":"50%","taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"},{name:"arrow-width",value:1}].reduce(function(l,u){return Ue.arrowPrefixes.forEach(function(v){var f=v+"-"+u.name,c=u.value;l[f]=c}),l},{})),t={},a=0;a<this.properties.length;a++){var n=this.properties[a];if(!n.pointsTo){var i=n.name,o=e[i],s=this.parse(i,o);t[i]=s}}return r.defaultProperties=t,r.defaultProperties},Ue.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};var an={};an.parse=function(r,e,t,a){var n=this;if(ze(e))return n.parseImplWarn(r,e,t,a);var i=a==="mapping"||a===!0||a===!1||a==null?"dontcare":a,o=t?"t":"f",s=""+e,l=Ai(r,s,o,i),u=n.propCache=n.propCache||[],v;return(v=u[l])||(v=u[l]=n.parseImplWarn(r,e,t,a)),(t||a==="mapping")&&(v=Cr(v),v&&(v.value=Cr(v.value))),v},an.parseImplWarn=function(r,e,t,a){var n=this.parseImpl(r,e,t,a);return!n&&e!=null&&Be("The style property `".concat(r,": ").concat(e,"` is invalid")),n&&(n.name==="width"||n.name==="height")&&e==="label"&&Be("The style value of `label` is deprecated for `"+n.name+"`"),n},an.parseImpl=function(r,e,t,a){var n=this;r=bn(r);var i=n.properties[r],o=e,s=n.types;if(!i||e===void 0)return null;i.alias&&(i=i.pointsTo,r=i.name);var l=ve(e);l&&(e=e.trim());var u=i.type;if(!u)return null;if(t&&(e===""||e===null))return{name:r,value:e,bypass:!0,deleteBypass:!0};if(ze(e))return{name:r,value:e,strValue:"fn",mapped:s.fn,bypass:t};var v,f;if(!(!l||a||e.length<7||e[1]!=="a")){if(e.length>=7&&e[0]==="d"&&(v=new RegExp(s.data.regex).exec(e))){if(t)return!1;var c=s.data;return{name:r,value:v,strValue:""+e,mapped:c,field:v[1],bypass:t}}else if(e.length>=10&&e[0]==="m"&&(f=new RegExp(s.mapData.regex).exec(e))){if(t||u.multiple)return!1;var h=s.mapData;if(!(u.color||u.number))return!1;var d=this.parse(r,f[4]);if(!d||d.mapped)return!1;var m=this.parse(r,f[5]);if(!m||m.mapped)return!1;if(d.pfValue===m.pfValue||d.strValue===m.strValue)return Be("`"+r+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+r+": "+d.strValue+"`"),this.parse(r,d.strValue);if(u.color){var p=d.value,g=m.value,y=p[0]===g[0]&&p[1]===g[1]&&p[2]===g[2]&&(p[3]===g[3]||(p[3]==null||p[3]===1)&&(g[3]==null||g[3]===1));if(y)return!1}return{name:r,value:f,strValue:""+e,mapped:h,field:f[1],fieldMin:parseFloat(f[2]),fieldMax:parseFloat(f[3]),valueMin:d.value,valueMax:m.value,bypass:t}}}if(u.multiple&&a!=="multiple"){var b;if(l?b=e.split(/\s+/):Ae(e)?b=e:b=[e],u.evenMultiple&&b.length%2!==0)return null;for(var w=[],D=[],C=[],x="",k=!1,E=0;E<b.length;E++){var P=n.parse(r,b[E],t,"multiple");k=k||ve(P.value),w.push(P.value),C.push(P.pfValue!=null?P.pfValue:P.value),D.push(P.units),x+=(E>0?" ":"")+P.strValue}return u.validate&&!u.validate(w,D)?null:u.singleEnum&&k?w.length===1&&ve(w[0])?{name:r,value:w[0],strValue:w[0],bypass:t}:null:{name:r,value:w,pfValue:C,strValue:x,bypass:t,units:D}}var L=function(){for(var j=0;j<u.enums.length;j++){var J=u.enums[j];if(J===e)return{name:r,value:e,strValue:""+e,bypass:t}}return null};if(u.number){var T,A="px";if(u.units&&(T=u.units),u.implicitUnits&&(A=u.implicitUnits),!u.unitless)if(l){var B="px|em"+(u.allowPercent?"|\\%":"");T&&(B=T);var O=e.match("^("+He+")("+B+")?$");O&&(e=O[1],T=O[2]||A)}else(!T||u.implicitUnits)&&(T=A);if(e=parseFloat(e),isNaN(e)&&u.enums===void 0)return null;if(isNaN(e)&&u.enums!==void 0)return e=o,L();if(u.integer&&!pu(e)||u.min!==void 0&&(e<u.min||u.strictMin&&e===u.min)||u.max!==void 0&&(e>u.max||u.strictMax&&e===u.max))return null;var R={name:r,value:e,strValue:""+e+(T||""),units:T,bypass:t};return u.unitless||T!=="px"&&T!=="em"?R.pfValue=e:R.pfValue=T==="px"||!T?e:this.getEmSizeInPixels()*e,(T==="ms"||T==="s")&&(R.pfValue=T==="ms"?e:1e3*e),(T==="deg"||T==="rad")&&(R.pfValue=T==="rad"?e:Ql(e)),T==="%"&&(R.pfValue=e/100),R}else if(u.propList){var M=[],I=""+e;if(I!=="none"){for(var V=I.split(/\s*,\s*|\s+/),G=0;G<V.length;G++){var z=V[G].trim();n.properties[z]?M.push(z):Be("`"+z+"` is not a valid property name")}if(M.length===0)return null}return{name:r,value:M,strValue:M.length===0?"none":M.join(" "),bypass:t}}else if(u.color){var H=Ru(e);return H?{name:r,value:H,pfValue:H,strValue:"rgb("+H[0]+","+H[1]+","+H[2]+")",bypass:t}:null}else if(u.regex||u.regexes){if(u.enums){var Y=L();if(Y)return Y}for(var Q=u.regexes?u.regexes:[u.regex],X=0;X<Q.length;X++){var U=new RegExp(Q[X]),N=U.exec(e);if(N)return{name:r,value:u.singleRegexMatchValue?N[1]:N,strValue:""+e,bypass:t}}return null}else return u.string?{name:r,value:""+e,strValue:""+e,bypass:t}:u.enums?L():null};var er=function r(e){if(!(this instanceof r))return new r(e);if(!yn(e)){Ne("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},rr=er.prototype;rr.instanceString=function(){return"style"},rr.clear=function(){for(var r=this._private,e=r.cy,t=e.elements(),a=0;a<this.length;a++)this[a]=void 0;return this.length=0,r.contextStyles={},r.propDiffs={},this.cleanElements(t,!0),t.forEach(function(n){var i=n[0]._private;i.styleDirty=!0,i.appliedInitStyle=!1}),this},rr.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},rr.core=function(r){return this._private.coreStyle[r]||this.getDefaultProperty(r)},rr.selector=function(r){var e=r==="core"?null:new $r(r),t=this.length++;return this[t]={selector:e,properties:[],mappedProperties:[],index:t},this},rr.css=function(){var r=this,e=arguments;if(e.length===1)for(var t=e[0],a=0;a<r.properties.length;a++){var n=r.properties[a],i=t[n.name];i===void 0&&(i=t[wa(n.name)]),i!==void 0&&this.cssRule(n.name,i)}else e.length===2&&this.cssRule(e[0],e[1]);return this},rr.style=rr.css,rr.cssRule=function(r,e){var t=this.parse(r,e);if(t){var a=this.length-1;this[a].properties.push(t),this[a].properties[t.name]=t,t.name.match(/pie-(\d+)-background-size/)&&t.value&&(this._private.hasPie=!0),t.mapped&&this[a].mappedProperties.push(t);var n=!this[a].selector;n&&(this._private.coreStyle[t.name]=t)}return this},rr.append=function(r){return yi(r)?r.appendToStyle(this):Ae(r)?this.appendFromJson(r):ve(r)&&this.appendFromString(r),this},er.fromJson=function(r,e){var t=new er(r);return t.fromJson(e),t},er.fromString=function(r,e){return new er(r).fromString(e)},[je,la,Qn,Tr,tn,_n,Ue,an].forEach(function(r){de(rr,r)}),er.types=rr.types,er.properties=rr.properties,er.propertyGroups=rr.propertyGroups,er.propertyGroupNames=rr.propertyGroupNames,er.propertyGroupKeys=rr.propertyGroupKeys;var mh={style:function(e){if(e){var t=this.setStyle(e);t.update()}return this._private.style},setStyle:function(e){var t=this._private;return yi(e)?t.style=e.generateStyle(this):Ae(e)?t.style=er.fromJson(this,e):ve(e)?t.style=er.fromString(this,e):t.style=er(this),t.style},updateStyle:function(){this.mutableElements().updateStyle()}},yh="single",tt={autolock:function(e){if(e!==void 0)this._private.autolock=!!e;else return this._private.autolock;return this},autoungrabify:function(e){if(e!==void 0)this._private.autoungrabify=!!e;else return this._private.autoungrabify;return this},autounselectify:function(e){if(e!==void 0)this._private.autounselectify=!!e;else return this._private.autounselectify;return this},selectionType:function(e){var t=this._private;if(t.selectionType==null&&(t.selectionType=yh),e!==void 0)(e==="additive"||e==="single")&&(t.selectionType=e);else return t.selectionType;return this},panningEnabled:function(e){if(e!==void 0)this._private.panningEnabled=!!e;else return this._private.panningEnabled;return this},userPanningEnabled:function(e){if(e!==void 0)this._private.userPanningEnabled=!!e;else return this._private.userPanningEnabled;return this},zoomingEnabled:function(e){if(e!==void 0)this._private.zoomingEnabled=!!e;else return this._private.zoomingEnabled;return this},userZoomingEnabled:function(e){if(e!==void 0)this._private.userZoomingEnabled=!!e;else return this._private.userZoomingEnabled;return this},boxSelectionEnabled:function(e){if(e!==void 0)this._private.boxSelectionEnabled=!!e;else return this._private.boxSelectionEnabled;return this},pan:function(){var e=arguments,t=this._private.pan,a,n,i,o,s;switch(e.length){case 0:return t;case 1:if(ve(e[0]))return a=e[0],t[a];if(Ce(e[0])){if(!this._private.panningEnabled)return this;i=e[0],o=i.x,s=i.y,ae(o)&&(t.x=o),ae(s)&&(t.y=s),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;a=e[0],n=e[1],(a==="x"||a==="y")&&ae(n)&&(t[a]=n),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(e,t){var a=arguments,n=this._private.pan,i,o,s,l,u;if(!this._private.panningEnabled)return this;switch(a.length){case 1:Ce(e)&&(s=a[0],l=s.x,u=s.y,ae(l)&&(n.x+=l),ae(u)&&(n.y+=u),this.emit("pan viewport"));break;case 2:i=e,o=t,(i==="x"||i==="y")&&ae(o)&&(n[i]+=o),this.emit("pan viewport");break}return this.notify("viewport"),this},fit:function(e,t){var a=this.getFitViewport(e,t);if(a){var n=this._private;n.zoom=a.zoom,n.pan=a.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,t){if(ae(e)&&t===void 0&&(t=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var a;if(ve(e)){var n=e;e=this.$(n)}else if(bu(e)){var i=e;a={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2},a.w=a.x2-a.x1,a.h=a.y2-a.y1}else vr(e)||(e=this.mutableElements());if(!(vr(e)&&e.empty())){a=a||e.boundingBox();var o=this.width(),s=this.height(),l;if(t=ae(t)?t:0,!isNaN(o)&&!isNaN(s)&&o>0&&s>0&&!isNaN(a.w)&&!isNaN(a.h)&&a.w>0&&a.h>0){l=Math.min((o-2*t)/a.w,(s-2*t)/a.h),l=l>this._private.maxZoom?this._private.maxZoom:l,l=l<this._private.minZoom?this._private.minZoom:l;var u={x:(o-l*(a.x1+a.x2))/2,y:(s-l*(a.y1+a.y2))/2};return{zoom:l,pan:u}}}}},zoomRange:function(e,t){var a=this._private;if(t==null){var n=e;e=n.min,t=n.max}return ae(e)&&ae(t)&&e<=t?(a.minZoom=e,a.maxZoom=t):ae(e)&&t===void 0&&e<=a.maxZoom?a.minZoom=e:ae(t)&&e===void 0&&t>=a.minZoom&&(a.maxZoom=t),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t=this._private,a=t.pan,n=t.zoom,i,o,s=!1;if(t.zoomingEnabled||(s=!0),ae(e)?o=e:Ce(e)&&(o=e.level,e.position!=null?i=ka(e.position,n,a):e.renderedPosition!=null&&(i=e.renderedPosition),i!=null&&!t.panningEnabled&&(s=!0)),o=o>t.maxZoom?t.maxZoom:o,o=o<t.minZoom?t.minZoom:o,s||!ae(o)||o===n||i!=null&&(!ae(i.x)||!ae(i.y)))return null;if(i!=null){var l=a,u=n,v=o,f={x:-v/u*(i.x-l.x)+i.x,y:-v/u*(i.y-l.y)+i.y};return{zoomed:!0,panned:!0,zoom:v,pan:f}}else return{zoomed:!0,panned:!1,zoom:o,pan:a}},zoom:function(e){if(e===void 0)return this._private.zoom;var t=this.getZoomedViewport(e),a=this._private;return t==null||!t.zoomed?this:(a.zoom=t.zoom,t.panned&&(a.pan.x=t.pan.x,a.pan.y=t.pan.y),this.emit("zoom"+(t.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},viewport:function(e){var t=this._private,a=!0,n=!0,i=[],o=!1,s=!1;if(!e)return this;if(ae(e.zoom)||(a=!1),Ce(e.pan)||(n=!1),!a&&!n)return this;if(a){var l=e.zoom;l<t.minZoom||l>t.maxZoom||!t.zoomingEnabled?o=!0:(t.zoom=l,i.push("zoom"))}if(n&&(!o||!e.cancelOnFailedZoom)&&t.panningEnabled){var u=e.pan;ae(u.x)&&(t.pan.x=u.x,s=!1),ae(u.y)&&(t.pan.y=u.y,s=!1),s||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(ve(e)){var a=e;e=this.mutableElements().filter(a)}else vr(e)||(e=this.mutableElements());if(e.length!==0){var n=e.boundingBox(),i=this.width(),o=this.height();t=t===void 0?this._private.zoom:t;var s={x:(i-t*(n.x1+n.x2))/2,y:(o-t*(n.y1+n.y2))/2};return s}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,t=e.container,a=this;return e.sizeCache=e.sizeCache||(t?function(){var n=a.window().getComputedStyle(t),i=function(s){return parseFloat(n.getPropertyValue(s))};return{width:t.clientWidth-i("padding-left")-i("padding-right"),height:t.clientHeight-i("padding-top")-i("padding-bottom")}}():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,a=this.renderedExtent(),n={x1:(a.x1-e.x)/t,x2:(a.x2-e.x)/t,y1:(a.y1-e.y)/t,y2:(a.y2-e.y)/t};return n.w=n.x2-n.x1,n.h=n.y2-n.y1,n},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};tt.centre=tt.center,tt.autolockNodes=tt.autolock,tt.autoungrabifyNodes=tt.autoungrabify;var va={data:Le.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Le.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Le.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Le.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};va.attr=va.data,va.removeAttr=va.removeData;var fa=function(e){var t=this;e=de({},e);var a=e.container;a&&!ba(a)&&ba(a[0])&&(a=a[0]);var n=a?a._cyreg:null;n=n||{},n&&n.cy&&(n.cy.destroy(),n={});var i=n.readies=n.readies||[];a&&(a._cyreg=n),n.cy=t;var o=$e!==void 0&&a!==void 0&&!e.headless,s=e;s.layout=de({name:o?"grid":"null"},s.layout),s.renderer=de({name:o?"canvas":"null"},s.renderer);var l=function(d,m,p){return m!==void 0?m:p!==void 0?p:d},u=this._private={container:a,ready:!1,options:s,elements:new Xe(this),listeners:[],aniEles:new Xe(this),data:s.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,s.zoomingEnabled),userZoomingEnabled:l(!0,s.userZoomingEnabled),panningEnabled:l(!0,s.panningEnabled),userPanningEnabled:l(!0,s.userPanningEnabled),boxSelectionEnabled:l(!0,s.boxSelectionEnabled),autolock:l(!1,s.autolock,s.autolockNodes),autoungrabify:l(!1,s.autoungrabify,s.autoungrabifyNodes),autounselectify:l(!1,s.autounselectify),styleEnabled:s.styleEnabled===void 0?o:s.styleEnabled,zoom:ae(s.zoom)?s.zoom:1,pan:{x:Ce(s.pan)&&ae(s.pan.x)?s.pan.x:0,y:Ce(s.pan)&&ae(s.pan.y)?s.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,s.multiClickDebounceTime)};this.createEmitter(),this.selectionType(s.selectionType),this.zoomRange({min:s.minZoom,max:s.maxZoom});var v=function(d,m){var p=d.some(wu);if(p)return yt.all(d).then(m);m(d)};u.styleEnabled&&t.setStyle([]);var f=de({},s,s.renderer);t.initRenderer(f);var c=function(d,m,p){t.notifications(!1);var g=t.mutableElements();g.length>0&&g.remove(),d!=null&&(Ce(d)||Ae(d))&&t.add(d),t.one("layoutready",function(b){t.notifications(!0),t.emit(b),t.one("load",m),t.emitAndNotify("load")}).one("layoutstop",function(){t.one("done",p),t.emit("done")});var y=de({},t._private.options.layout);y.eles=t.elements(),t.layout(y).run()};v([s.style,s.elements],function(h){var d=h[0],m=h[1];u.styleEnabled&&t.style().append(d),c(m,function(){t.startAnimationLoop(),u.ready=!0,ze(s.ready)&&t.on("ready",s.ready);for(var p=0;p<i.length;p++){var g=i[p];t.on("ready",g)}n&&(n.readies=[]),t.emit("ready")},s.done)})},nn=fa.prototype;de(nn,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit("ready",[],e):this.on("ready",e),this},destroy:function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit("destroy"),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},window:function(){var e=this._private.container;if(e==null)return $e;var t=this._private.container.ownerDocument;return t===void 0||t==null?$e:t.defaultView||$e},mount:function(e){if(e!=null){var t=this,a=t._private,n=a.options;return!ba(e)&&ba(e[0])&&(e=e[0]),t.stopAnimationLoop(),t.destroyRenderer(),a.container=e,a.styleEnabled=!0,t.invalidateSize(),t.initRenderer(de({},n,n.renderer,{name:n.renderer.name==="null"?"canvas":n.renderer.name})),t.startAnimationLoop(),t.style(n.style),t.emit("mount"),t}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return Cr(this._private.options)},json:function(e){var t=this,a=t._private,n=t.mutableElements(),i=function(w){return t.getElementById(w.id())};if(Ce(e)){if(t.startBatch(),e.elements){var o={},s=function(w,D){for(var C=[],x=[],k=0;k<w.length;k++){var E=w[k];if(!E.data.id){Be("cy.json() cannot handle elements without an ID attribute");continue}var P=""+E.data.id,L=t.getElementById(P);o[P]=!0,L.length!==0?x.push({ele:L,json:E}):(D&&(E.group=D),C.push(E))}t.add(C);for(var T=0;T<x.length;T++){var A=x[T],B=A.ele,O=A.json;B.json(O)}};if(Ae(e.elements))s(e.elements);else for(var l=["nodes","edges"],u=0;u<l.length;u++){var v=l[u],f=e.elements[v];Ae(f)&&s(f,v)}var c=t.collection();n.filter(function(b){return!o[b.id()]}).forEach(function(b){b.isParent()?c.merge(b):b.remove()}),c.forEach(function(b){return b.children().move({parent:null})}),c.forEach(function(b){return i(b).remove()})}e.style&&t.style(e.style),e.zoom!=null&&e.zoom!==a.zoom&&t.zoom(e.zoom),e.pan&&(e.pan.x!==a.pan.x||e.pan.y!==a.pan.y)&&t.pan(e.pan),e.data&&t.data(e.data);for(var h=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],d=0;d<h.length;d++){var m=h[d];e[m]!=null&&t[m](e[m])}return t.endBatch(),this}else{var p=!!e,g={};p?g.elements=this.elements().map(function(b){return b.json()}):(g.elements={},n.forEach(function(b){var w=b.group();g.elements[w]||(g.elements[w]=[]),g.elements[w].push(b.json())})),this._private.styleEnabled&&(g.style=t.style().json()),g.data=Cr(t.data());var y=a.options;return g.zoomingEnabled=a.zoomingEnabled,g.userZoomingEnabled=a.userZoomingEnabled,g.zoom=a.zoom,g.minZoom=a.minZoom,g.maxZoom=a.maxZoom,g.panningEnabled=a.panningEnabled,g.userPanningEnabled=a.userPanningEnabled,g.pan=Cr(a.pan),g.boxSelectionEnabled=a.boxSelectionEnabled,g.renderer=Cr(y.renderer),g.hideEdgesOnViewport=y.hideEdgesOnViewport,g.textureOnViewport=y.textureOnViewport,g.wheelSensitivity=y.wheelSensitivity,g.motionBlur=y.motionBlur,g.multiClickDebounceTime=y.multiClickDebounceTime,g}}}),nn.$id=nn.getElementById,[sh,ch,fs,Un,en,hh,Zn,rn,mh,tt,va].forEach(function(r){de(nn,r)});var bh={fit:!0,directed:!1,padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}},wh={maximal:!1,acyclic:!1},Bt=function(e){return e.scratch("breadthfirst")},cs=function(e,t){return e.scratch("breadthfirst",t)};function ds(r){this.options=de({},bh,wh,r)}ds.prototype.run=function(){var r=this.options,e=r,t=r.cy,a=e.eles,n=a.nodes().filter(function(re){return!re.isParent()}),i=a,o=e.directed,s=e.acyclic||e.maximal||e.maximalAdjustments>0,l=or(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()}),u;if(vr(e.roots))u=e.roots;else if(Ae(e.roots)){for(var v=[],f=0;f<e.roots.length;f++){var c=e.roots[f],h=t.getElementById(c);v.push(h)}u=t.collection(v)}else if(ve(e.roots))u=t.$(e.roots);else if(o)u=n.roots();else{var d=a.components();u=t.collection();for(var m=function(te){var le=d[te],ue=le.maxDegree(!1),ie=le.filter(function(fe){return fe.degree(!1)===ue});u=u.add(ie)},p=0;p<d.length;p++)m(p)}var g=[],y={},b=function(te,le){g[le]==null&&(g[le]=[]);var ue=g[le].length;g[le].push(te),cs(te,{index:ue,depth:le})},w=function(te,le){var ue=Bt(te),ie=ue.depth,fe=ue.index;g[ie][fe]=null,b(te,le)};i.bfs({roots:u,directed:e.directed,visit:function(te,le,ue,ie,fe){var Ee=te[0],we=Ee.id();b(Ee,fe),y[we]=!0}});for(var D=[],C=0;C<n.length;C++){var x=n[C];y[x.id()]||D.push(x)}var k=function(te){for(var le=g[te],ue=0;ue<le.length;ue++){var ie=le[ue];if(ie==null){le.splice(ue,1),ue--;continue}cs(ie,{depth:te,index:ue})}},E=function(){for(var te=0;te<g.length;te++)k(te)},P=function(te,le){for(var ue=Bt(te),ie=te.incomers().filter(function(S){return S.isNode()&&a.has(S)}),fe=-1,Ee=te.id(),we=0;we<ie.length;we++){var ge=ie[we],xe=Bt(ge);fe=Math.max(fe,xe.depth)}if(ue.depth<=fe){if(!e.acyclic&&le[Ee])return null;var q=fe+1;return w(te,q),le[Ee]=q,!0}return!1};if(o&&s){var L=[],T={},A=function(te){return L.push(te)},B=function(){return L.shift()};for(n.forEach(function(re){return L.push(re)});L.length>0;){var O=B(),R=P(O,T);if(R)O.outgoers().filter(function(re){return re.isNode()&&a.has(re)}).forEach(A);else if(R===null){Be("Detected double maximal shift for node `"+O.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}E();var M=0;if(e.avoidOverlap)for(var I=0;I<n.length;I++){var V=n[I],G=V.layoutDimensions(e),z=G.w,H=G.h;M=Math.max(M,z,H)}var Y={},Q=function(te){if(Y[te.id()])return Y[te.id()];for(var le=Bt(te).depth,ue=te.neighborhood(),ie=0,fe=0,Ee=0;Ee<ue.length;Ee++){var we=ue[Ee];if(!(we.isEdge()||we.isParent()||!n.has(we))){var ge=Bt(we);if(ge!=null){var xe=ge.index,q=ge.depth;if(!(xe==null||q==null)){var S=g[q].length;q<le&&(ie+=xe/S,fe++)}}}}return fe=Math.max(1,fe),ie=ie/fe,fe===0&&(ie=0),Y[te.id()]=ie,ie},X=function(te,le){var ue=Q(te),ie=Q(le),fe=ue-ie;return fe===0?xi(te.id(),le.id()):fe};e.depthSort!==void 0&&(X=e.depthSort);for(var U=0;U<g.length;U++)g[U].sort(X),k(U);for(var N=[],_=0;_<D.length;_++)N.push(D[_]);g.unshift(N),E();for(var j=0,J=0;J<g.length;J++)j=Math.max(g[J].length,j);var ee={x:l.x1+l.w/2,y:l.x1+l.h/2},oe=g.reduce(function(re,te){return Math.max(re,te.length)},0),he=function(te){var le=Bt(te),ue=le.depth,ie=le.index,fe=g[ue].length,Ee=Math.max(l.w/((e.grid?oe:fe)+1),M),we=Math.max(l.h/(g.length+1),M),ge=Math.min(l.w/2/g.length,l.h/2/g.length);if(ge=Math.max(ge,M),e.circle){var q=ge*ue+ge-(g.length>0&&g[0].length<=3?ge/2:0),S=2*Math.PI/g[ue].length*ie;return ue===0&&g[0].length===1&&(q=1),{x:ee.x+q*Math.cos(S),y:ee.y+q*Math.sin(S)}}else{var xe={x:ee.x+(ie+1-(fe+1)/2)*Ee,y:(ue+1)*we};return xe}};return a.nodes().layoutPositions(this,e,he),this};var xh={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function hs(r){this.options=de({},xh,r)}hs.prototype.run=function(){var r=this.options,e=r,t=r.cy,a=e.eles,n=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,i=a.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));for(var o=or(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},l=e.sweep===void 0?2*Math.PI-2*Math.PI/i.length:e.sweep,u=l/Math.max(1,i.length-1),v,f=0,c=0;c<i.length;c++){var h=i[c],d=h.layoutDimensions(e),m=d.w,p=d.h;f=Math.max(f,m,p)}if(ae(e.radius)?v=e.radius:i.length<=1?v=0:v=Math.min(o.h,o.w)/2-f,i.length>1&&e.avoidOverlap){f*=1.75;var g=Math.cos(u)-Math.cos(0),y=Math.sin(u)-Math.sin(0),b=Math.sqrt(f*f/(g*g+y*y));v=Math.max(b,v)}var w=function(C,x){var k=e.startAngle+x*u*(n?1:-1),E=v*Math.cos(k),P=v*Math.sin(k),L={x:s.x+E,y:s.y+P};return L};return a.nodes().layoutPositions(this,e,w),this};var Eh={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function gs(r){this.options=de({},Eh,r)}gs.prototype.run=function(){for(var r=this.options,e=r,t=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,a=r.cy,n=e.eles,i=n.nodes().not(":parent"),o=or(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:a.width(),h:a.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},l=[],u=0,v=0;v<i.length;v++){var f=i[v],c=void 0;c=e.concentric(f),l.push({value:c,node:f}),f._private.scratch.concentric=c}i.updateStyle();for(var h=0;h<i.length;h++){var d=i[h],m=d.layoutDimensions(e);u=Math.max(u,m.w,m.h)}l.sort(function(re,te){return te.value-re.value});for(var p=e.levelWidth(i),g=[[]],y=g[0],b=0;b<l.length;b++){var w=l[b];if(y.length>0){var D=Math.abs(y[0].value-w.value);D>=p&&(y=[],g.push(y))}y.push(w)}var C=u+e.minNodeSpacing;if(!e.avoidOverlap){var x=g.length>0&&g[0].length>1,k=Math.min(o.w,o.h)/2-C,E=k/(g.length+x?1:0);C=Math.min(C,E)}for(var P=0,L=0;L<g.length;L++){var T=g[L],A=e.sweep===void 0?2*Math.PI-2*Math.PI/T.length:e.sweep,B=T.dTheta=A/Math.max(1,T.length-1);if(T.length>1&&e.avoidOverlap){var O=Math.cos(B)-Math.cos(0),R=Math.sin(B)-Math.sin(0),M=Math.sqrt(C*C/(O*O+R*R));P=Math.max(M,P)}T.r=P,P+=C}if(e.equidistant){for(var I=0,V=0,G=0;G<g.length;G++){var z=g[G],H=z.r-V;I=Math.max(I,H)}V=0;for(var Y=0;Y<g.length;Y++){var Q=g[Y];Y===0&&(V=Q.r),Q.r=V,V+=I}}for(var X={},U=0;U<g.length;U++)for(var N=g[U],_=N.dTheta,j=N.r,J=0;J<N.length;J++){var ee=N[J],oe=e.startAngle+(t?1:-1)*_*J,he={x:s.x+j*Math.cos(oe),y:s.y+j*Math.sin(oe)};X[ee.node.id()]=he}return n.nodes().layoutPositions(this,e,function(re){var te=re.id();return X[te]}),this};var Jn,Ch={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,t){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function on(r){this.options=de({},Ch,r),this.options.layout=this;var e=this.options.eles.nodes(),t=this.options.eles.edges(),a=t.filter(function(n){var i=n.source().data("id"),o=n.target().data("id"),s=e.some(function(u){return u.data("id")===i}),l=e.some(function(u){return u.data("id")===o});return!s||!l});this.options.eles=this.options.eles.not(a)}on.prototype.run=function(){var r=this.options,e=r.cy,t=this;t.stopped=!1,(r.animate===!0||r.animate===!1)&&t.emit({type:"layoutstart",layout:t}),r.debug===!0?Jn=!0:Jn=!1;var a=Sh(e,t,r);Jn&&kh(a),r.randomize&&Ph(a);var n=Br(),i=function(){Bh(a,e,r),r.fit===!0&&e.fit(r.padding)},o=function(c){return!(t.stopped||c>=r.numIter||(Lh(a,r),a.temperature=a.temperature*r.coolingFactor,a.temperature<r.minTemp))},s=function(){if(r.animate===!0||r.animate===!1)i(),t.one("layoutstop",r.stop),t.emit({type:"layoutstop",layout:t});else{var c=r.eles.nodes(),h=ps(a,r,c);c.layoutPositions(t,r,h)}},l=0,u=!0;if(r.animate===!0){var v=function f(){for(var c=0;u&&c<r.refresh;)u=o(l),l++,c++;if(!u)ys(a,r),s();else{var h=Br();h-n>=r.animationThreshold&&i(),Ca(f)}};v()}else{for(;u;)u=o(l),l++;ys(a,r),s()}return this},on.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},on.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var Sh=function(e,t,a){for(var n=a.eles.edges(),i=a.eles.nodes(),o=or(a.boundingBox?a.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),s={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:n.size(),temperature:a.initialTemp,clientWidth:o.w,clientHeight:o.h,boundingBox:o},l=a.eles.components(),u={},v=0;v<l.length;v++)for(var f=l[v],c=0;c<f.length;c++){var h=f[c];u[h.id()]=v}for(var v=0;v<s.nodeSize;v++){var d=i[v],m=d.layoutDimensions(a),p={};p.isLocked=d.locked(),p.id=d.data("id"),p.parentId=d.data("parent"),p.cmptId=u[d.id()],p.children=[],p.positionX=d.position("x"),p.positionY=d.position("y"),p.offsetX=0,p.offsetY=0,p.height=m.w,p.width=m.h,p.maxX=p.positionX+p.width/2,p.minX=p.positionX-p.width/2,p.maxY=p.positionY+p.height/2,p.minY=p.positionY-p.height/2,p.padLeft=parseFloat(d.style("padding")),p.padRight=parseFloat(d.style("padding")),p.padTop=parseFloat(d.style("padding")),p.padBottom=parseFloat(d.style("padding")),p.nodeRepulsion=ze(a.nodeRepulsion)?a.nodeRepulsion(d):a.nodeRepulsion,s.layoutNodes.push(p),s.idToIndex[p.id]=v}for(var g=[],y=0,b=-1,w=[],v=0;v<s.nodeSize;v++){var d=s.layoutNodes[v],D=d.parentId;D!=null?s.layoutNodes[s.idToIndex[D]].children.push(d.id):(g[++b]=d.id,w.push(d.id))}for(s.graphSet.push(w);y<=b;){var C=g[y++],x=s.idToIndex[C],h=s.layoutNodes[x],k=h.children;if(k.length>0){s.graphSet.push(k);for(var v=0;v<k.length;v++)g[++b]=k[v]}}for(var v=0;v<s.graphSet.length;v++)for(var E=s.graphSet[v],c=0;c<E.length;c++){var P=s.idToIndex[E[c]];s.indexToGraph[P]=v}for(var v=0;v<s.edgeSize;v++){var L=n[v],T={};T.id=L.data("id"),T.sourceId=L.data("source"),T.targetId=L.data("target");var A=ze(a.idealEdgeLength)?a.idealEdgeLength(L):a.idealEdgeLength,B=ze(a.edgeElasticity)?a.edgeElasticity(L):a.edgeElasticity,O=s.idToIndex[T.sourceId],R=s.idToIndex[T.targetId],M=s.indexToGraph[O],I=s.indexToGraph[R];if(M!=I){for(var V=Th(T.sourceId,T.targetId,s),G=s.graphSet[V],z=0,p=s.layoutNodes[O];G.indexOf(p.id)===-1;)p=s.layoutNodes[s.idToIndex[p.parentId]],z++;for(p=s.layoutNodes[R];G.indexOf(p.id)===-1;)p=s.layoutNodes[s.idToIndex[p.parentId]],z++;A*=z*a.nestingFactor}T.idealLength=A,T.elasticity=B,s.layoutEdges.push(T)}return s},Th=function(e,t,a){var n=Dh(e,t,0,a);return 2>n.count?0:n.graph},Dh=function r(e,t,a,n){var i=n.graphSet[a];if(-1<i.indexOf(e)&&-1<i.indexOf(t))return{count:2,graph:a};for(var o=0,s=0;s<i.length;s++){var l=i[s],u=n.idToIndex[l],v=n.layoutNodes[u].children;if(v.length!==0){var f=n.indexToGraph[n.idToIndex[v[0]]],c=r(e,t,f,n);if(c.count!==0)if(c.count===1){if(o++,o===2)break}else return c}}return{count:o,graph:a}},kh,Ph=function(e,t){for(var a=e.clientWidth,n=e.clientHeight,i=0;i<e.nodeSize;i++){var o=e.layoutNodes[i];o.children.length===0&&!o.isLocked&&(o.positionX=Math.random()*a,o.positionY=Math.random()*n)}},ps=function(e,t,a){var n=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return t.boundingBox&&(a.forEach(function(o){var s=e.layoutNodes[e.idToIndex[o.data("id")]];i.x1=Math.min(i.x1,s.positionX),i.x2=Math.max(i.x2,s.positionX),i.y1=Math.min(i.y1,s.positionY),i.y2=Math.max(i.y2,s.positionY)}),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(o,s){var l=e.layoutNodes[e.idToIndex[o.data("id")]];if(t.boundingBox){var u=(l.positionX-i.x1)/i.w,v=(l.positionY-i.y1)/i.h;return{x:n.x1+u*n.w,y:n.y1+v*n.h}}else return{x:l.positionX,y:l.positionY}}},Bh=function(e,t,a){var n=a.layout,i=a.eles.nodes(),o=ps(e,a,i);i.positions(o),e.ready!==!0&&(e.ready=!0,n.one("layoutready",a.ready),n.emit({type:"layoutready",layout:this}))},Lh=function(e,t,a){Mh(e,t),Oh(e),Ih(e,t),zh(e),Nh(e)},Mh=function(e,t){for(var a=0;a<e.graphSet.length;a++)for(var n=e.graphSet[a],i=n.length,o=0;o<i;o++)for(var s=e.layoutNodes[e.idToIndex[n[o]]],l=o+1;l<i;l++){var u=e.layoutNodes[e.idToIndex[n[l]]];Ah(s,u,e,t)}},ms=function(e){return-e+2*e*Math.random()},Ah=function(e,t,a,n){var i=e.cmptId,o=t.cmptId;if(!(i!==o&&!a.isCompound)){var s=t.positionX-e.positionX,l=t.positionY-e.positionY,u=1;s===0&&l===0&&(s=ms(u),l=ms(u));var v=Rh(e,t,s,l);if(v>0)var f=n.nodeOverlap*v,c=Math.sqrt(s*s+l*l),h=f*s/c,d=f*l/c;else var m=sn(e,s,l),p=sn(t,-1*s,-1*l),g=p.x-m.x,y=p.y-m.y,b=g*g+y*y,c=Math.sqrt(b),f=(e.nodeRepulsion+t.nodeRepulsion)/b,h=f*g/c,d=f*y/c;e.isLocked||(e.offsetX-=h,e.offsetY-=d),t.isLocked||(t.offsetX+=h,t.offsetY+=d)}},Rh=function(e,t,a,n){if(a>0)var i=e.maxX-t.minX;else var i=t.maxX-e.minX;if(n>0)var o=e.maxY-t.minY;else var o=t.maxY-e.minY;return i>=0&&o>=0?Math.sqrt(i*i+o*o):0},sn=function(e,t,a){var n=e.positionX,i=e.positionY,o=e.height||1,s=e.width||1,l=a/t,u=o/s,v={};return t===0&&0<a||t===0&&0>a?(v.x=n,v.y=i+o/2,v):0<t&&-1*u<=l&&l<=u?(v.x=n+s/2,v.y=i+s*a/2/t,v):0>t&&-1*u<=l&&l<=u?(v.x=n-s/2,v.y=i-s*a/2/t,v):0<a&&(l<=-1*u||l>=u)?(v.x=n+o*t/2/a,v.y=i+o/2,v):(0>a&&(l<=-1*u||l>=u)&&(v.x=n-o*t/2/a,v.y=i-o/2),v)},Oh=function(e,t){for(var a=0;a<e.edgeSize;a++){var n=e.layoutEdges[a],i=e.idToIndex[n.sourceId],o=e.layoutNodes[i],s=e.idToIndex[n.targetId],l=e.layoutNodes[s],u=l.positionX-o.positionX,v=l.positionY-o.positionY;if(!(u===0&&v===0)){var f=sn(o,u,v),c=sn(l,-1*u,-1*v),h=c.x-f.x,d=c.y-f.y,m=Math.sqrt(h*h+d*d),p=Math.pow(n.idealLength-m,2)/n.elasticity;if(m!==0)var g=p*h/m,y=p*d/m;else var g=0,y=0;o.isLocked||(o.offsetX+=g,o.offsetY+=y),l.isLocked||(l.offsetX-=g,l.offsetY-=y)}}},Ih=function(e,t){if(t.gravity!==0)for(var a=1,n=0;n<e.graphSet.length;n++){var i=e.graphSet[n],o=i.length;if(n===0)var s=e.clientHeight/2,l=e.clientWidth/2;else var u=e.layoutNodes[e.idToIndex[i[0]]],v=e.layoutNodes[e.idToIndex[u.parentId]],s=v.positionX,l=v.positionY;for(var f=0;f<o;f++){var c=e.layoutNodes[e.idToIndex[i[f]]];if(!c.isLocked){var h=s-c.positionX,d=l-c.positionY,m=Math.sqrt(h*h+d*d);if(m>a){var p=t.gravity*h/m,g=t.gravity*d/m;c.offsetX+=p,c.offsetY+=g}}}}},zh=function(e,t){var a=[],n=0,i=-1;for(a.push.apply(a,e.graphSet[0]),i+=e.graphSet[0].length;n<=i;){var o=a[n++],s=e.idToIndex[o],l=e.layoutNodes[s],u=l.children;if(0<u.length&&!l.isLocked){for(var v=l.offsetX,f=l.offsetY,c=0;c<u.length;c++){var h=e.layoutNodes[e.idToIndex[u[c]]];h.offsetX+=v,h.offsetY+=f,a[++i]=u[c]}l.offsetX=0,l.offsetY=0}}},Nh=function(e,t){for(var a=0;a<e.nodeSize;a++){var n=e.layoutNodes[a];0<n.children.length&&(n.maxX=void 0,n.minX=void 0,n.maxY=void 0,n.minY=void 0)}for(var a=0;a<e.nodeSize;a++){var n=e.layoutNodes[a];if(!(0<n.children.length||n.isLocked)){var i=Fh(n.offsetX,n.offsetY,e.temperature);n.positionX+=i.x,n.positionY+=i.y,n.offsetX=0,n.offsetY=0,n.minX=n.positionX-n.width,n.maxX=n.positionX+n.width,n.minY=n.positionY-n.height,n.maxY=n.positionY+n.height,Vh(n,e)}}for(var a=0;a<e.nodeSize;a++){var n=e.layoutNodes[a];0<n.children.length&&!n.isLocked&&(n.positionX=(n.maxX+n.minX)/2,n.positionY=(n.maxY+n.minY)/2,n.width=n.maxX-n.minX,n.height=n.maxY-n.minY)}},Fh=function(e,t,a){var n=Math.sqrt(e*e+t*t);if(n>a)var i={x:a*e/n,y:a*t/n};else var i={x:e,y:t};return i},Vh=function r(e,t){var a=e.parentId;if(a!=null){var n=t.layoutNodes[t.idToIndex[a]],i=!1;if((n.maxX==null||e.maxX+n.padRight>n.maxX)&&(n.maxX=e.maxX+n.padRight,i=!0),(n.minX==null||e.minX-n.padLeft<n.minX)&&(n.minX=e.minX-n.padLeft,i=!0),(n.maxY==null||e.maxY+n.padBottom>n.maxY)&&(n.maxY=e.maxY+n.padBottom,i=!0),(n.minY==null||e.minY-n.padTop<n.minY)&&(n.minY=e.minY-n.padTop,i=!0),i)return r(n,t)}},ys=function(e,t){for(var a=e.layoutNodes,n=[],i=0;i<a.length;i++){var o=a[i],s=o.cmptId,l=n[s]=n[s]||[];l.push(o)}for(var u=0,i=0;i<n.length;i++){var v=n[i];if(v){v.x1=1/0,v.x2=-1/0,v.y1=1/0,v.y2=-1/0;for(var f=0;f<v.length;f++){var c=v[f];v.x1=Math.min(v.x1,c.positionX-c.width/2),v.x2=Math.max(v.x2,c.positionX+c.width/2),v.y1=Math.min(v.y1,c.positionY-c.height/2),v.y2=Math.max(v.y2,c.positionY+c.height/2)}v.w=v.x2-v.x1,v.h=v.y2-v.y1,u+=v.w*v.h}}n.sort(function(y,b){return b.w*b.h-y.w*y.h});for(var h=0,d=0,m=0,p=0,g=Math.sqrt(u)*e.clientWidth/e.clientHeight,i=0;i<n.length;i++){var v=n[i];if(v){for(var f=0;f<v.length;f++){var c=v[f];c.isLocked||(c.positionX+=h-v.x1,c.positionY+=d-v.y1)}h+=v.w+t.componentSpacing,m+=v.w+t.componentSpacing,p=Math.max(p,v.h),m>g&&(d+=p+t.componentSpacing,h=0,m=0,p=0)}}},qh={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function bs(r){this.options=de({},qh,r)}bs.prototype.run=function(){var r=this.options,e=r,t=r.cy,a=e.eles,n=a.nodes().not(":parent");e.sort&&(n=n.sort(e.sort));var i=or(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()});if(i.h===0||i.w===0)a.nodes().layoutPositions(this,e,function(Y){return{x:i.x1,y:i.y1}});else{var o=n.size(),s=Math.sqrt(o*i.h/i.w),l=Math.round(s),u=Math.round(i.w/i.h*s),v=function(Q){if(Q==null)return Math.min(l,u);var X=Math.min(l,u);X==l?l=Q:u=Q},f=function(Q){if(Q==null)return Math.max(l,u);var X=Math.max(l,u);X==l?l=Q:u=Q},c=e.rows,h=e.cols!=null?e.cols:e.columns;if(c!=null&&h!=null)l=c,u=h;else if(c!=null&&h==null)l=c,u=Math.ceil(o/l);else if(c==null&&h!=null)u=h,l=Math.ceil(o/u);else if(u*l>o){var d=v(),m=f();(d-1)*m>=o?v(d-1):(m-1)*d>=o&&f(m-1)}else for(;u*l<o;){var p=v(),g=f();(g+1)*p>=o?f(g+1):v(p+1)}var y=i.w/u,b=i.h/l;if(e.condense&&(y=0,b=0),e.avoidOverlap)for(var w=0;w<n.length;w++){var D=n[w],C=D._private.position;(C.x==null||C.y==null)&&(C.x=0,C.y=0);var x=D.layoutDimensions(e),k=e.avoidOverlapPadding,E=x.w+k,P=x.h+k;y=Math.max(y,E),b=Math.max(b,P)}for(var L={},T=function(Q,X){return!!L["c-"+Q+"-"+X]},A=function(Q,X){L["c-"+Q+"-"+X]=!0},B=0,O=0,R=function(){O++,O>=u&&(O=0,B++)},M={},I=0;I<n.length;I++){var V=n[I],G=e.position(V);if(G&&(G.row!==void 0||G.col!==void 0)){var z={row:G.row,col:G.col};if(z.col===void 0)for(z.col=0;T(z.row,z.col);)z.col++;else if(z.row===void 0)for(z.row=0;T(z.row,z.col);)z.row++;M[V.id()]=z,A(z.row,z.col)}}var H=function(Q,X){var U,N;if(Q.locked()||Q.isParent())return!1;var _=M[Q.id()];if(_)U=_.col*y+y/2+i.x1,N=_.row*b+b/2+i.y1;else{for(;T(B,O);)R();U=O*y+y/2+i.x1,N=B*b+b/2+i.y1,A(B,O),R()}return{x:U,y:N}};n.layoutPositions(this,e,H)}return this};var $h={ready:function(){},stop:function(){}};function jn(r){this.options=de({},$h,r)}jn.prototype.run=function(){var r=this.options,e=r.eles,t=this;return r.cy,t.emit("layoutstart"),e.nodes().positions(function(){return{x:0,y:0}}),t.one("layoutready",r.ready),t.emit("layoutready"),t.one("layoutstop",r.stop),t.emit("layoutstop"),this},jn.prototype.stop=function(){return this};var Hh={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function ws(r){this.options=de({},Hh,r)}ws.prototype.run=function(){var r=this.options,e=r.eles,t=e.nodes(),a=ze(r.positions);function n(i){if(r.positions==null)return Kl(i.position());if(a)return r.positions(i);var o=r.positions[i._private.data.id];return o==null?null:o}return t.layoutPositions(this,r,function(i,o){var s=n(i);return i.locked()||s==null?!1:s}),this};var Wh={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function xs(r){this.options=de({},Wh,r)}xs.prototype.run=function(){var r=this.options,e=r.cy,t=r.eles,a=or(r.boundingBox?r.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),n=function(o,s){return{x:a.x1+Math.round(Math.random()*a.w),y:a.y1+Math.round(Math.random()*a.h)}};return t.nodes().layoutPositions(this,r,n),this};var Gh=[{name:"breadthfirst",impl:ds},{name:"circle",impl:hs},{name:"concentric",impl:gs},{name:"cose",impl:on},{name:"grid",impl:bs},{name:"null",impl:jn},{name:"preset",impl:ws},{name:"random",impl:xs}];function Es(r){this.options=r,this.notifications=0}var Cs=function(){},Ss=function(){throw new Error("A headless instance can not render images")};Es.prototype={recalculateRenderedStyle:Cs,notify:function(){this.notifications++},init:Cs,isHeadless:function(){return!0},png:Ss,jpg:Ss};var ei={};ei.arrowShapeWidth=.3,ei.registerArrowShapes=function(){var r=this.arrowShapes={},e=this,t=function(u,v,f,c,h,d,m){var p=h.x-f/2-m,g=h.x+f/2+m,y=h.y-f/2-m,b=h.y+f/2+m,w=p<=u&&u<=g&&y<=v&&v<=b;return w},a=function(u,v,f,c,h){var d=u*Math.cos(c)-v*Math.sin(c),m=u*Math.sin(c)+v*Math.cos(c),p=d*f,g=m*f,y=p+h.x,b=g+h.y;return{x:y,y:b}},n=function(u,v,f,c){for(var h=[],d=0;d<u.length;d+=2){var m=u[d],p=u[d+1];h.push(a(m,p,v,f,c))}return h},i=function(u){for(var v=[],f=0;f<u.length;f++){var c=u[f];v.push(c.x,c.y)}return v},o=function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").pfValue*2},s=function(u,v){ve(v)&&(v=r[v]),r[u]=de({name:u,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(c,h,d,m,p,g){var y=i(n(this.points,d+2*g,m,p)),b=sr(c,h,y);return b},roughCollide:t,draw:function(c,h,d,m){var p=n(this.points,h,d,m);e.arrowShapeImpl("polygon")(c,p)},spacing:function(c){return 0},gap:o},v)};s("none",{collide:Ta,roughCollide:Ta,draw:Cn,spacing:Ii,gap:Ii}),s("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),s("arrow","triangle"),s("triangle-backcurve",{points:r.triangle.points,controlPoint:[0,-.15],roughCollide:t,draw:function(u,v,f,c,h){var d=n(this.points,v,f,c),m=this.controlPoint,p=a(m[0],m[1],v,f,c);e.arrowShapeImpl(this.name)(u,d,p)},gap:function(u){return o(u)*.8}}),s("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(u,v,f,c,h,d,m){var p=i(n(this.points,f+2*m,c,h)),g=i(n(this.pointsTee,f+2*m,c,h)),y=sr(u,v,p)||sr(u,v,g);return y},draw:function(u,v,f,c,h){var d=n(this.points,v,f,c),m=n(this.pointsTee,v,f,c);e.arrowShapeImpl(this.name)(u,d,m)}}),s("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(u,v,f,c,h,d,m){var p=h,g=Math.pow(p.x-u,2)+Math.pow(p.y-v,2)<=Math.pow((f+2*m)*this.radius,2),y=i(n(this.points,f+2*m,c,h));return sr(u,v,y)||g},draw:function(u,v,f,c,h){var d=n(this.pointsTr,v,f,c);e.arrowShapeImpl(this.name)(u,d,c.x,c.y,this.radius*v)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),s("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(u,v){var f=this.baseCrossLinePts.slice(),c=v/u,h=3,d=5;return f[h]=f[h]-c,f[d]=f[d]-c,f},collide:function(u,v,f,c,h,d,m){var p=i(n(this.points,f+2*m,c,h)),g=i(n(this.crossLinePts(f,d),f+2*m,c,h)),y=sr(u,v,p)||sr(u,v,g);return y},draw:function(u,v,f,c,h){var d=n(this.points,v,f,c),m=n(this.crossLinePts(v,h),v,f,c);e.arrowShapeImpl(this.name)(u,d,m)}}),s("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(u){return o(u)*.525}}),s("circle",{radius:.15,collide:function(u,v,f,c,h,d,m){var p=h,g=Math.pow(p.x-u,2)+Math.pow(p.y-v,2)<=Math.pow((f+2*m)*this.radius,2);return g},draw:function(u,v,f,c,h){e.arrowShapeImpl(this.name)(u,c.x,c.y,this.radius*v)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),s("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(u){return 1},gap:function(u){return 1}}),s("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),s("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}}),s("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(u){return .95*u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}})};var at={};at.projectIntoViewport=function(r,e){var t=this.cy,a=this.findContainerClientCoords(),n=a[0],i=a[1],o=a[4],s=t.pan(),l=t.zoom(),u=((r-n)/o-s.x)/l,v=((e-i)/o-s.y)/l;return[u,v]},at.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var r=this.container,e=r.getBoundingClientRect(),t=this.cy.window().getComputedStyle(r),a=function(g){return parseFloat(t.getPropertyValue(g))},n={left:a("padding-left"),right:a("padding-right"),top:a("padding-top"),bottom:a("padding-bottom")},i={left:a("border-left-width"),right:a("border-right-width"),top:a("border-top-width"),bottom:a("border-bottom-width")},o=r.clientWidth,s=r.clientHeight,l=n.left+n.right,u=n.top+n.bottom,v=i.left+i.right,f=e.width/(o+v),c=o-l,h=s-u,d=e.left+n.left+i.left,m=e.top+n.top+i.top;return this.containerBB=[d,m,c,h,f]},at.invalidateContainerClientCoordsCache=function(){this.containerBB=null},at.findNearestElement=function(r,e,t,a){return this.findNearestElements(r,e,t,a)[0]},at.findNearestElements=function(r,e,t,a){var n=this,i=this,o=i.getCachedZSortedEles(),s=[],l=i.cy.zoom(),u=i.cy.hasCompoundNodes(),v=(a?24:8)/l,f=(a?8:2)/l,c=(a?8:2)/l,h=1/0,d,m;t&&(o=o.interactive);function p(x,k){if(x.isNode()){if(m)return;m=x,s.push(x)}if(x.isEdge()&&(k==null||k<h))if(d){if(d.pstyle("z-compound-depth").value===x.pstyle("z-compound-depth").value&&d.pstyle("z-compound-depth").value===x.pstyle("z-compound-depth").value){for(var E=0;E<s.length;E++)if(s[E].isEdge()){s[E]=x,d=x,h=k!=null?k:h;break}}}else s.push(x),d=x,h=k!=null?k:h}function g(x){var k=x.outerWidth()+2*f,E=x.outerHeight()+2*f,P=k/2,L=E/2,T=x.position();if(T.x-P<=r&&r<=T.x+P&&T.y-L<=e&&e<=T.y+L){var A=i.nodeShapes[n.getNodeShape(x)];if(A.checkPoint(r,e,0,k,E,T.x,T.y))return p(x,0),!0}}function y(x){var k=x._private,E=k.rscratch,P=x.pstyle("width").pfValue,L=x.pstyle("arrow-scale").value,T=P/2+v,A=T*T,B=T*2,I=k.source,V=k.target,O;if(E.edgeType==="segments"||E.edgeType==="straight"||E.edgeType==="haystack"){for(var R=E.allpts,M=0;M+3<R.length;M+=2)if(nv(r,e,R[M],R[M+1],R[M+2],R[M+3],B)&&A>(O=lv(r,e,R[M],R[M+1],R[M+2],R[M+3])))return p(x,O),!0}else if(E.edgeType==="bezier"||E.edgeType==="multibezier"||E.edgeType==="self"||E.edgeType==="compound"){for(var R=E.allpts,M=0;M+5<E.allpts.length;M+=4)if(iv(r,e,R[M],R[M+1],R[M+2],R[M+3],R[M+4],R[M+5],B)&&A>(O=uv(r,e,R[M],R[M+1],R[M+2],R[M+3],R[M+4],R[M+5])))return p(x,O),!0}for(var I=I||k.source,V=V||k.target,G=n.getArrowWidth(P,L),z=[{name:"source",x:E.arrowStartX,y:E.arrowStartY,angle:E.srcArrowAngle},{name:"target",x:E.arrowEndX,y:E.arrowEndY,angle:E.tgtArrowAngle},{name:"mid-source",x:E.midX,y:E.midY,angle:E.midsrcArrowAngle},{name:"mid-target",x:E.midX,y:E.midY,angle:E.midtgtArrowAngle}],M=0;M<z.length;M++){var H=z[M],Y=i.arrowShapes[x.pstyle(H.name+"-arrow-shape").value],Q=x.pstyle("width").pfValue;if(Y.roughCollide(r,e,G,H.angle,{x:H.x,y:H.y},Q,v)&&Y.collide(r,e,G,H.angle,{x:H.x,y:H.y},Q,v))return p(x),!0}u&&s.length>0&&(g(I),g(V))}function b(x,k,E){return pr(x,k,E)}function w(x,k){var E=x._private,P=c,L;k?L=k+"-":L="",x.boundingBox();var T=E.labelBounds[k||"main"],A=x.pstyle(L+"label").value,B=x.pstyle("text-events").strValue==="yes";if(!(!B||!A)){var O=b(E.rscratch,"labelX",k),R=b(E.rscratch,"labelY",k),M=b(E.rscratch,"labelAngle",k),I=x.pstyle(L+"text-margin-x").pfValue,V=x.pstyle(L+"text-margin-y").pfValue,G=T.x1-P-I,z=T.x2+P-I,H=T.y1-P-V,Y=T.y2+P-V;if(M){var Q=Math.cos(M),X=Math.sin(M),U=function(he,re){return he=he-O,re=re-R,{x:he*Q-re*X+O,y:he*X+re*Q+R}},N=U(G,H),_=U(G,Y),j=U(z,H),J=U(z,Y),ee=[N.x+I,N.y+V,j.x+I,j.y+V,J.x+I,J.y+V,_.x+I,_.y+V];if(sr(r,e,ee))return p(x),!0}else if(ht(T,r,e))return p(x),!0}}for(var D=o.length-1;D>=0;D--){var C=o[D];C.isNode()?g(C)||w(C):y(C)||w(C)||w(C,"source")||w(C,"target")}return s},at.getAllInBox=function(r,e,t,a){var n=this.getCachedZSortedEles().interactive,i=[],o=Math.min(r,t),s=Math.max(r,t),l=Math.min(e,a),u=Math.max(e,a);r=o,t=s,e=l,a=u;for(var v=or({x1:r,y1:e,x2:t,y2:a}),f=0;f<n.length;f++){var c=n[f];if(c.isNode()){var h=c,d=h.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:!1});kn(v,d)&&!Gi(d,v)&&i.push(h)}else{var m=c,p=m._private,g=p.rscratch;if(g.startX!=null&&g.startY!=null&&!ht(v,g.startX,g.startY)||g.endX!=null&&g.endY!=null&&!ht(v,g.endX,g.endY))continue;if(g.edgeType==="bezier"||g.edgeType==="multibezier"||g.edgeType==="self"||g.edgeType==="compound"||g.edgeType==="segments"||g.edgeType==="haystack"){for(var y=p.rstyle.bezierPts||p.rstyle.linePts||p.rstyle.haystackPts,b=!0,w=0;w<y.length;w++)if(!av(v,y[w])){b=!1;break}b&&i.push(m)}else(g.edgeType==="haystack"||g.edgeType==="straight")&&i.push(m)}}return i};var un={};un.calculateArrowAngles=function(r){var e=r._private.rscratch,t=e.edgeType==="haystack",a=e.edgeType==="bezier",n=e.edgeType==="multibezier",i=e.edgeType==="segments",o=e.edgeType==="compound",s=e.edgeType==="self",l,u,v,f,c,h,g,y;if(t?(v=e.haystackPts[0],f=e.haystackPts[1],c=e.haystackPts[2],h=e.haystackPts[3]):(v=e.arrowStartX,f=e.arrowStartY,c=e.arrowEndX,h=e.arrowEndY),g=e.midX,y=e.midY,i)l=v-e.segpts[0],u=f-e.segpts[1];else if(n||o||s||a){var d=e.allpts,m=Ge(d[0],d[2],d[4],.1),p=Ge(d[1],d[3],d[5],.1);l=v-m,u=f-p}else l=v-g,u=f-y;e.srcArrowAngle=Pa(l,u);var g=e.midX,y=e.midY;if(t&&(g=(v+c)/2,y=(f+h)/2),l=c-v,u=h-f,i){var d=e.allpts;if(d.length/2%2===0){var b=d.length/2,w=b-2;l=d[b]-d[w],u=d[b+1]-d[w+1]}else{var b=d.length/2-1,w=b-2,D=b+2;l=d[b]-d[w],u=d[b+1]-d[w+1]}}else if(n||o||s){var d=e.allpts,C=e.ctrlpts,x,k,E,P;if(C.length/2%2===0){var L=d.length/2-1,T=L+2,A=T+2;x=Ge(d[L],d[T],d[A],0),k=Ge(d[L+1],d[T+1],d[A+1],0),E=Ge(d[L],d[T],d[A],1e-4),P=Ge(d[L+1],d[T+1],d[A+1],1e-4)}else{var T=d.length/2-1,L=T-2,A=T+2;x=Ge(d[L],d[T],d[A],.4999),k=Ge(d[L+1],d[T+1],d[A+1],.4999),E=Ge(d[L],d[T],d[A],.5),P=Ge(d[L+1],d[T+1],d[A+1],.5)}l=E-x,u=P-k}if(e.midtgtArrowAngle=Pa(l,u),e.midDispX=l,e.midDispY=u,l*=-1,u*=-1,i){var d=e.allpts;if(d.length/2%2!==0){var b=d.length/2-1,D=b+2;l=-(d[D]-d[b]),u=-(d[D+1]-d[b+1])}}if(e.midsrcArrowAngle=Pa(l,u),i)l=c-e.segpts[e.segpts.length-2],u=h-e.segpts[e.segpts.length-1];else if(n||o||s||a){var d=e.allpts,B=d.length,m=Ge(d[B-6],d[B-4],d[B-2],.9),p=Ge(d[B-5],d[B-3],d[B-1],.9);l=c-m,u=h-p}else l=c-g,u=h-y;e.tgtArrowAngle=Pa(l,u)},un.getArrowWidth=un.getArrowHeight=function(r,e){var t=this.arrowWidthCache=this.arrowWidthCache||{},a=t[r+", "+e];return a||(a=Math.max(Math.pow(r*13.37,.9),29)*e,t[r+", "+e]=a,a)};var tr={};tr.findMidptPtsEtc=function(r,e){var t=e.posPts,a=e.intersectionPts,n=e.vectorNormInverse,i,o=r.pstyle("source-endpoint"),s=r.pstyle("target-endpoint"),l=o.units!=null&&s.units!=null,u=function(D,C,x,k){var E=k-C,P=x-D,L=Math.sqrt(P*P+E*E);return{x:-E/L,y:P/L}},v=r.pstyle("edge-distances").value;switch(v){case"node-position":i=t;break;case"intersection":i=a;break;case"endpoints":{if(l){var f=this.manualEndptToPx(r.source()[0],o),c=gr(f,2),h=c[0],d=c[1],m=this.manualEndptToPx(r.target()[0],s),p=gr(m,2),g=p[0],y=p[1],b={x1:h,y1:d,x2:g,y2:y};n=u(h,d,g,y),i=b}else Be("Edge ".concat(r.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),i=a;break}}return{midptPts:i,vectorNormInverse:n}},tr.findHaystackPoints=function(r){for(var e=0;e<r.length;e++){var t=r[e],a=t._private,n=a.rscratch;if(!n.haystack){var i=Math.random()*2*Math.PI;n.source={x:Math.cos(i),y:Math.sin(i)},i=Math.random()*2*Math.PI,n.target={x:Math.cos(i),y:Math.sin(i)}}var o=a.source,s=a.target,l=o.position(),u=s.position(),v=o.width(),f=s.width(),c=o.height(),h=s.height(),d=t.pstyle("haystack-radius").value,m=d/2;n.haystackPts=n.allpts=[n.source.x*v*m+l.x,n.source.y*c*m+l.y,n.target.x*f*m+u.x,n.target.y*h*m+u.y],n.midX=(n.allpts[0]+n.allpts[2])/2,n.midY=(n.allpts[1]+n.allpts[3])/2,n.edgeType="haystack",n.haystack=!0,this.storeEdgeProjections(t),this.calculateArrowAngles(t),this.recalculateEdgeLabelProjections(t),this.calculateLabelAngles(t)}},tr.findSegmentsPoints=function(r,e){var t=r._private.rscratch,a=r.pstyle("segment-weights"),n=r.pstyle("segment-distances"),i=Math.min(a.pfValue.length,n.pfValue.length);t.edgeType="segments",t.segpts=[];for(var o=0;o<i;o++){var s=a.pfValue[o],l=n.pfValue[o],u=1-s,v=s,f=this.findMidptPtsEtc(r,e),c=f.midptPts,h=f.vectorNormInverse,d={x:c.x1*u+c.x2*v,y:c.y1*u+c.y2*v};t.segpts.push(d.x+h.x*l,d.y+h.y*l)}},tr.findLoopPoints=function(r,e,t,a){var n=r._private.rscratch,i=e.dirCounts,o=e.srcPos,s=r.pstyle("control-point-distances"),l=s?s.pfValue[0]:void 0,u=r.pstyle("loop-direction").pfValue,v=r.pstyle("loop-sweep").pfValue,f=r.pstyle("control-point-step-size").pfValue;n.edgeType="self";var c=t,h=f;a&&(c=0,h=l);var d=u-Math.PI/2,m=d-v/2,p=d+v/2,g=u+"_"+v;c=i[g]===void 0?i[g]=0:++i[g],n.ctrlpts=[o.x+Math.cos(m)*1.4*h*(c/3+1),o.y+Math.sin(m)*1.4*h*(c/3+1),o.x+Math.cos(p)*1.4*h*(c/3+1),o.y+Math.sin(p)*1.4*h*(c/3+1)]},tr.findCompoundLoopPoints=function(r,e,t,a){var n=r._private.rscratch;n.edgeType="compound";var i=e.srcPos,o=e.tgtPos,s=e.srcW,l=e.srcH,u=e.tgtW,v=e.tgtH,f=r.pstyle("control-point-step-size").pfValue,c=r.pstyle("control-point-distances"),h=c?c.pfValue[0]:void 0,d=t,m=f;a&&(d=0,m=h);var p=50,g={x:i.x-s/2,y:i.y-l/2},y={x:o.x-u/2,y:o.y-v/2},b={x:Math.min(g.x,y.x),y:Math.min(g.y,y.y)},w=.5,D=Math.max(w,Math.log(s*.01)),C=Math.max(w,Math.log(u*.01));n.ctrlpts=[b.x,b.y-(1+Math.pow(p,1.12)/100)*m*(d/3+1)*D,b.x-(1+Math.pow(p,1.12)/100)*m*(d/3+1)*C,b.y]},tr.findStraightEdgePoints=function(r){r._private.rscratch.edgeType="straight"},tr.findBezierPoints=function(r,e,t,a,n){var i=r._private.rscratch,o=r.pstyle("control-point-step-size").pfValue,s=r.pstyle("control-point-distances"),l=r.pstyle("control-point-weights"),u=s&&l?Math.min(s.value.length,l.value.length):1,v=s?s.pfValue[0]:void 0,f=l.value[0],c=a;i.edgeType=c?"multibezier":"bezier",i.ctrlpts=[];for(var h=0;h<u;h++){var d=(.5-e.eles.length/2+t)*o*(n?-1:1),m=void 0,p=$i(d);c&&(v=s?s.pfValue[h]:o,f=l.value[h]),a?m=v:m=v!==void 0?p*v:void 0;var g=m!==void 0?m:d,y=1-f,b=f,w=this.findMidptPtsEtc(r,e),D=w.midptPts,C=w.vectorNormInverse,x={x:D.x1*y+D.x2*b,y:D.y1*y+D.y2*b};i.ctrlpts.push(x.x+C.x*g,x.y+C.y*g)}},tr.findTaxiPoints=function(r,e){var t=r._private.rscratch;t.edgeType="segments";var a="vertical",n="horizontal",i="leftward",o="rightward",s="downward",l="upward",u="auto",v=e.posPts,f=e.srcW,c=e.srcH,h=e.tgtW,d=e.tgtH,m=r.pstyle("edge-distances").value,p=m!=="node-position",g=r.pstyle("taxi-direction").value,y=g,b=r.pstyle("taxi-turn"),w=b.units==="%",D=b.pfValue,C=D<0,x=r.pstyle("taxi-turn-min-distance").pfValue,k=p?(f+h)/2:0,E=p?(c+d)/2:0,P=v.x2-v.x1,L=v.y2-v.y1,T=function(K,se){return K>0?Math.max(K-se,0):Math.min(K+se,0)},A=T(P,k),B=T(L,E),O=!1;y===u?g=Math.abs(A)>Math.abs(B)?n:a:y===l||y===s?(g=a,O=!0):(y===i||y===o)&&(g=n,O=!0);var R=g===a,M=R?B:A,I=R?L:P,V=$i(I),G=!1;!(O&&(w||C))&&(y===s&&I<0||y===l&&I>0||y===i&&I>0||y===o&&I<0)&&(V*=-1,M=V*Math.abs(M),G=!0);var z;if(w){var H=D<0?1+D:D;z=H*M}else{var Y=D<0?M:0;z=Y+D*V}var Q=function(K){return Math.abs(K)<x||Math.abs(K)>=Math.abs(M)},X=Q(z),U=Q(Math.abs(M)-Math.abs(z)),N=X||U;if(N&&!G)if(R){var _=Math.abs(I)<=c/2,j=Math.abs(P)<=h/2;if(_){var J=(v.x1+v.x2)/2,ee=v.y1,oe=v.y2;t.segpts=[J,ee,J,oe]}else if(j){var he=(v.y1+v.y2)/2,re=v.x1,te=v.x2;t.segpts=[re,he,te,he]}else t.segpts=[v.x1,v.y2]}else{var le=Math.abs(I)<=f/2,ue=Math.abs(L)<=d/2;if(le){var ie=(v.y1+v.y2)/2,fe=v.x1,Ee=v.x2;t.segpts=[fe,ie,Ee,ie]}else if(ue){var we=(v.x1+v.x2)/2,ge=v.y1,xe=v.y2;t.segpts=[we,ge,we,xe]}else t.segpts=[v.x2,v.y1]}else if(R){var q=v.y1+z+(p?c/2*V:0),S=v.x1,F=v.x2;t.segpts=[S,q,F,q]}else{var Z=v.x1+z+(p?f/2*V:0),$=v.y1,W=v.y2;t.segpts=[Z,$,Z,W]}},tr.tryToCorrectInvalidPoints=function(r,e){var t=r._private.rscratch;if(t.edgeType==="bezier"){var a=e.srcPos,n=e.tgtPos,i=e.srcW,o=e.srcH,s=e.tgtW,l=e.tgtH,u=e.srcShape,v=e.tgtShape,f=!ae(t.startX)||!ae(t.startY),c=!ae(t.arrowStartX)||!ae(t.arrowStartY),h=!ae(t.endX)||!ae(t.endY),d=!ae(t.arrowEndX)||!ae(t.arrowEndY),m=3,p=this.getArrowWidth(r.pstyle("width").pfValue,r.pstyle("arrow-scale").value)*this.arrowShapeWidth,g=m*p,y=_r({x:t.ctrlpts[0],y:t.ctrlpts[1]},{x:t.startX,y:t.startY}),b=y<g,w=_r({x:t.ctrlpts[0],y:t.ctrlpts[1]},{x:t.endX,y:t.endY}),D=w<g,C=!1;if(f||c||b){C=!0;var x={x:t.ctrlpts[0]-a.x,y:t.ctrlpts[1]-a.y},k=Math.sqrt(x.x*x.x+x.y*x.y),E={x:x.x/k,y:x.y/k},P=Math.max(i,o),L={x:t.ctrlpts[0]+E.x*2*P,y:t.ctrlpts[1]+E.y*2*P},T=u.intersectLine(a.x,a.y,i,o,L.x,L.y,0);b?(t.ctrlpts[0]=t.ctrlpts[0]+E.x*(g-y),t.ctrlpts[1]=t.ctrlpts[1]+E.y*(g-y)):(t.ctrlpts[0]=T[0]+E.x*g,t.ctrlpts[1]=T[1]+E.y*g)}if(h||d||D){C=!0;var A={x:t.ctrlpts[0]-n.x,y:t.ctrlpts[1]-n.y},B=Math.sqrt(A.x*A.x+A.y*A.y),O={x:A.x/B,y:A.y/B},R=Math.max(i,o),M={x:t.ctrlpts[0]+O.x*2*R,y:t.ctrlpts[1]+O.y*2*R},I=v.intersectLine(n.x,n.y,s,l,M.x,M.y,0);D?(t.ctrlpts[0]=t.ctrlpts[0]+O.x*(g-w),t.ctrlpts[1]=t.ctrlpts[1]+O.y*(g-w)):(t.ctrlpts[0]=I[0]+O.x*g,t.ctrlpts[1]=I[1]+O.y*g)}C&&this.findEndpoints(r)}},tr.storeAllpts=function(r){var e=r._private.rscratch;if(e.edgeType==="multibezier"||e.edgeType==="bezier"||e.edgeType==="self"||e.edgeType==="compound"){e.allpts=[],e.allpts.push(e.startX,e.startY);for(var t=0;t+1<e.ctrlpts.length;t+=2)e.allpts.push(e.ctrlpts[t],e.ctrlpts[t+1]),t+3<e.ctrlpts.length&&e.allpts.push((e.ctrlpts[t]+e.ctrlpts[t+2])/2,(e.ctrlpts[t+1]+e.ctrlpts[t+3])/2);e.allpts.push(e.endX,e.endY);var a,n;e.ctrlpts.length/2%2===0?(a=e.allpts.length/2-1,e.midX=e.allpts[a],e.midY=e.allpts[a+1]):(a=e.allpts.length/2-3,n=.5,e.midX=Ge(e.allpts[a],e.allpts[a+2],e.allpts[a+4],n),e.midY=Ge(e.allpts[a+1],e.allpts[a+3],e.allpts[a+5],n))}else if(e.edgeType==="straight")e.allpts=[e.startX,e.startY,e.endX,e.endY],e.midX=(e.startX+e.endX+e.arrowStartX+e.arrowEndX)/4,e.midY=(e.startY+e.endY+e.arrowStartY+e.arrowEndY)/4;else if(e.edgeType==="segments")if(e.allpts=[],e.allpts.push(e.startX,e.startY),e.allpts.push.apply(e.allpts,e.segpts),e.allpts.push(e.endX,e.endY),e.segpts.length%4===0){var i=e.segpts.length/2,o=i-2;e.midX=(e.segpts[o]+e.segpts[i])/2,e.midY=(e.segpts[o+1]+e.segpts[i+1])/2}else{var s=e.segpts.length/2-1;e.midX=e.segpts[s],e.midY=e.segpts[s+1]}},tr.checkForInvalidEdgeWarning=function(r){var e=r[0]._private.rscratch;e.nodesOverlap||ae(e.startX)&&ae(e.startY)&&ae(e.endX)&&ae(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,Be("Edge `"+r.id()+"` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap."))},tr.findEdgeControlPoints=function(r){var e=this;if(!(!r||r.length===0)){for(var t=this,a=t.cy,n=a.hasCompoundNodes(),i={map:new Sr,get:function(x){var k=this.map.get(x[0]);return k!=null?k.get(x[1]):null},set:function(x,k){var E=this.map.get(x[0]);E==null&&(E=new Sr,this.map.set(x[0],E)),E.set(x[1],k)}},o=[],s=[],l=0;l<r.length;l++){var u=r[l],v=u._private,f=u.pstyle("curve-style").value;if(!(u.removed()||!u.takesUpSpace())){if(f==="haystack"){s.push(u);continue}var c=f==="unbundled-bezier"||f==="segments"||f==="straight"||f==="straight-triangle"||f==="taxi",h=f==="unbundled-bezier"||f==="bezier",d=v.source,m=v.target,p=d.poolIndex(),g=m.poolIndex(),y=[p,g].sort(),b=i.get(y);b==null&&(b={eles:[]},i.set(y,b),o.push(y)),b.eles.push(u),c&&(b.hasUnbundled=!0),h&&(b.hasBezier=!0)}}for(var w=function(x){var k=o[x],E=i.get(k),P=void 0;if(!E.hasUnbundled){var L=E.eles[0].parallelEdges().filter(function(xe){return xe.isBundledBezier()});Sn(E.eles),L.forEach(function(xe){return E.eles.push(xe)}),E.eles.sort(function(xe,q){return xe.poolIndex()-q.poolIndex()})}var T=E.eles[0],A=T.source(),B=T.target();if(A.poolIndex()>B.poolIndex()){var O=A;A=B,B=O}var R=E.srcPos=A.position(),M=E.tgtPos=B.position(),I=E.srcW=A.outerWidth(),V=E.srcH=A.outerHeight(),G=E.tgtW=B.outerWidth(),z=E.tgtH=B.outerHeight(),H=E.srcShape=t.nodeShapes[e.getNodeShape(A)],Y=E.tgtShape=t.nodeShapes[e.getNodeShape(B)];E.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var Q=0;Q<E.eles.length;Q++){var X=E.eles[Q],U=X[0]._private.rscratch,N=X.pstyle("curve-style").value,_=N==="unbundled-bezier"||N==="segments"||N==="taxi",j=!A.same(X.source());if(!E.calculatedIntersection&&A!==B&&(E.hasBezier||E.hasUnbundled)){E.calculatedIntersection=!0;var J=H.intersectLine(R.x,R.y,I,V,M.x,M.y,0),ee=E.srcIntn=J,oe=Y.intersectLine(M.x,M.y,G,z,R.x,R.y,0),he=E.tgtIntn=oe,re=E.intersectionPts={x1:J[0],x2:oe[0],y1:J[1],y2:oe[1]},te=E.posPts={x1:R.x,x2:M.x,y1:R.y,y2:M.y},le=oe[1]-J[1],ue=oe[0]-J[0],ie=Math.sqrt(ue*ue+le*le),fe=E.vector={x:ue,y:le},Ee=E.vectorNorm={x:fe.x/ie,y:fe.y/ie},we={x:-Ee.y,y:Ee.x};E.nodesOverlap=!ae(ie)||Y.checkPoint(J[0],J[1],0,G,z,M.x,M.y)||H.checkPoint(oe[0],oe[1],0,I,V,R.x,R.y),E.vectorNormInverse=we,P={nodesOverlap:E.nodesOverlap,dirCounts:E.dirCounts,calculatedIntersection:!0,hasBezier:E.hasBezier,hasUnbundled:E.hasUnbundled,eles:E.eles,srcPos:M,tgtPos:R,srcW:G,srcH:z,tgtW:I,tgtH:V,srcIntn:he,tgtIntn:ee,srcShape:Y,tgtShape:H,posPts:{x1:te.x2,y1:te.y2,x2:te.x1,y2:te.y1},intersectionPts:{x1:re.x2,y1:re.y2,x2:re.x1,y2:re.y1},vector:{x:-fe.x,y:-fe.y},vectorNorm:{x:-Ee.x,y:-Ee.y},vectorNormInverse:{x:-we.x,y:-we.y}}}var ge=j?P:E;U.nodesOverlap=ge.nodesOverlap,U.srcIntn=ge.srcIntn,U.tgtIntn=ge.tgtIntn,n&&(A.isParent()||A.isChild()||B.isParent()||B.isChild())&&(A.parents().anySame(B)||B.parents().anySame(A)||A.same(B)&&A.isParent())?e.findCompoundLoopPoints(X,ge,Q,_):A===B?e.findLoopPoints(X,ge,Q,_):N==="segments"?e.findSegmentsPoints(X,ge):N==="taxi"?e.findTaxiPoints(X,ge):N==="straight"||!_&&E.eles.length%2===1&&Q===Math.floor(E.eles.length/2)?e.findStraightEdgePoints(X):e.findBezierPoints(X,ge,Q,_,j),e.findEndpoints(X),e.tryToCorrectInvalidPoints(X,ge),e.checkForInvalidEdgeWarning(X),e.storeAllpts(X),e.storeEdgeProjections(X),e.calculateArrowAngles(X),e.recalculateEdgeLabelProjections(X),e.calculateLabelAngles(X)}},D=0;D<o.length;D++)w(D);this.findHaystackPoints(s)}};function Ts(r){var e=[];if(r!=null){for(var t=0;t<r.length;t+=2){var a=r[t],n=r[t+1];e.push({x:a,y:n})}return e}}tr.getSegmentPoints=function(r){var e=r[0]._private.rscratch,t=e.edgeType;if(t==="segments")return this.recalculateRenderedStyle(r),Ts(e.segpts)},tr.getControlPoints=function(r){var e=r[0]._private.rscratch,t=e.edgeType;if(t==="bezier"||t==="multibezier"||t==="self"||t==="compound")return this.recalculateRenderedStyle(r),Ts(e.ctrlpts)},tr.getEdgeMidpoint=function(r){var e=r[0]._private.rscratch;return this.recalculateRenderedStyle(r),{x:e.midX,y:e.midY}};var ca={};ca.manualEndptToPx=function(r,e){var t=this,a=r.position(),n=r.outerWidth(),i=r.outerHeight();if(e.value.length===2){var o=[e.pfValue[0],e.pfValue[1]];return e.units[0]==="%"&&(o[0]=o[0]*n),e.units[1]==="%"&&(o[1]=o[1]*i),o[0]+=a.x,o[1]+=a.y,o}else{var s=e.pfValue[0];s=-Math.PI/2+s;var l=2*Math.max(n,i),u=[a.x+Math.cos(s)*l,a.y+Math.sin(s)*l];return t.nodeShapes[this.getNodeShape(r)].intersectLine(a.x,a.y,n,i,u[0],u[1],0)}},ca.findEndpoints=function(r){var e=this,t,a=r.source()[0],n=r.target()[0],i=a.position(),o=n.position(),s=r.pstyle("target-arrow-shape").value,l=r.pstyle("source-arrow-shape").value,u=r.pstyle("target-distance-from-node").pfValue,v=r.pstyle("source-distance-from-node").pfValue,f=r.pstyle("curve-style").value,c=r._private.rscratch,h=c.edgeType,d=f==="taxi",m=h==="self"||h==="compound",p=h==="bezier"||h==="multibezier"||m,g=h!=="bezier",y=h==="straight"||h==="segments",b=h==="segments",w=p||g||y,D=m||d,C=r.pstyle("source-endpoint"),x=D?"outside-to-node":C.value,k=r.pstyle("target-endpoint"),E=D?"outside-to-node":k.value;c.srcManEndpt=C,c.tgtManEndpt=k;var P,L,T,A;if(p){var B=[c.ctrlpts[0],c.ctrlpts[1]],O=g?[c.ctrlpts[c.ctrlpts.length-2],c.ctrlpts[c.ctrlpts.length-1]]:B;P=O,L=B}else if(y){var R=b?c.segpts.slice(0,2):[o.x,o.y],M=b?c.segpts.slice(c.segpts.length-2):[i.x,i.y];P=M,L=R}if(E==="inside-to-node")t=[o.x,o.y];else if(k.units)t=this.manualEndptToPx(n,k);else if(E==="outside-to-line")t=c.tgtIntn;else if(E==="outside-to-node"||E==="outside-to-node-or-label"?T=P:(E==="outside-to-line"||E==="outside-to-line-or-label")&&(T=[i.x,i.y]),t=e.nodeShapes[this.getNodeShape(n)].intersectLine(o.x,o.y,n.outerWidth(),n.outerHeight(),T[0],T[1],0),E==="outside-to-node-or-label"||E==="outside-to-line-or-label"){var I=n._private.rscratch,V=I.labelWidth,G=I.labelHeight,z=I.labelX,H=I.labelY,Y=V/2,Q=G/2,X=n.pstyle("text-valign").value;X==="top"?H-=Q:X==="bottom"&&(H+=Q);var U=n.pstyle("text-halign").value;U==="left"?z-=Y:U==="right"&&(z+=Y);var N=_t(T[0],T[1],[z-Y,H-Q,z+Y,H-Q,z+Y,H+Q,z-Y,H+Q],o.x,o.y);if(N.length>0){var _=i,j=Jr(_,ct(t)),J=Jr(_,ct(N)),ee=j;if(J<j&&(t=N,ee=J),N.length>2){var oe=Jr(_,{x:N[2],y:N[3]});oe<ee&&(t=[N[2],N[3]])}}}var he=Ra(t,P,e.arrowShapes[s].spacing(r)+u),re=Ra(t,P,e.arrowShapes[s].gap(r)+u);if(c.endX=re[0],c.endY=re[1],c.arrowEndX=he[0],c.arrowEndY=he[1],x==="inside-to-node")t=[i.x,i.y];else if(C.units)t=this.manualEndptToPx(a,C);else if(x==="outside-to-line")t=c.srcIntn;else if(x==="outside-to-node"||x==="outside-to-node-or-label"?A=L:(x==="outside-to-line"||x==="outside-to-line-or-label")&&(A=[o.x,o.y]),t=e.nodeShapes[this.getNodeShape(a)].intersectLine(i.x,i.y,a.outerWidth(),a.outerHeight(),A[0],A[1],0),x==="outside-to-node-or-label"||x==="outside-to-line-or-label"){var te=a._private.rscratch,le=te.labelWidth,ue=te.labelHeight,ie=te.labelX,fe=te.labelY,Ee=le/2,we=ue/2,ge=a.pstyle("text-valign").value;ge==="top"?fe-=we:ge==="bottom"&&(fe+=we);var xe=a.pstyle("text-halign").value;xe==="left"?ie-=Ee:xe==="right"&&(ie+=Ee);var q=_t(A[0],A[1],[ie-Ee,fe-we,ie+Ee,fe-we,ie+Ee,fe+we,ie-Ee,fe+we],i.x,i.y);if(q.length>0){var S=o,F=Jr(S,ct(t)),Z=Jr(S,ct(q)),$=F;if(Z<F&&(t=[q[0],q[1]],$=Z),q.length>2){var W=Jr(S,{x:q[2],y:q[3]});W<$&&(t=[q[2],q[3]])}}}var ce=Ra(t,L,e.arrowShapes[l].spacing(r)+v),K=Ra(t,L,e.arrowShapes[l].gap(r)+v);c.startX=K[0],c.startY=K[1],c.arrowStartX=ce[0],c.arrowStartY=ce[1],w&&(!ae(c.startX)||!ae(c.startY)||!ae(c.endX)||!ae(c.endY)?c.badLine=!0:c.badLine=!1)},ca.getSourceEndpoint=function(r){var e=r[0]._private.rscratch;switch(this.recalculateRenderedStyle(r),e.edgeType){case"haystack":return{x:e.haystackPts[0],y:e.haystackPts[1]};default:return{x:e.arrowStartX,y:e.arrowStartY}}},ca.getTargetEndpoint=function(r){var e=r[0]._private.rscratch;switch(this.recalculateRenderedStyle(r),e.edgeType){case"haystack":return{x:e.haystackPts[2],y:e.haystackPts[3]};default:return{x:e.arrowEndX,y:e.arrowEndY}}};var ri={};function Kh(r,e,t){for(var a=function(u,v,f,c){return Ge(u,v,f,c)},n=e._private,i=n.rstyle.bezierPts,o=0;o<r.bezierProjPcts.length;o++){var s=r.bezierProjPcts[o];i.push({x:a(t[0],t[2],t[4],s),y:a(t[1],t[3],t[5],s)})}}ri.storeEdgeProjections=function(r){var e=r._private,t=e.rscratch,a=t.edgeType;if(e.rstyle.bezierPts=null,e.rstyle.linePts=null,e.rstyle.haystackPts=null,a==="multibezier"||a==="bezier"||a==="self"||a==="compound"){e.rstyle.bezierPts=[];for(var n=0;n+5<t.allpts.length;n+=4)Kh(this,r,t.allpts.slice(n,n+6))}else if(a==="segments")for(var i=e.rstyle.linePts=[],n=0;n+1<t.allpts.length;n+=2)i.push({x:t.allpts[n],y:t.allpts[n+1]});else if(a==="haystack"){var o=t.haystackPts;e.rstyle.haystackPts=[{x:o[0],y:o[1]},{x:o[2],y:o[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(r.pstyle("width").pfValue,r.pstyle("arrow-scale").value)*this.arrowShapeWidth},ri.recalculateEdgeProjections=function(r){this.findEdgeControlPoints(r)};var Dr={};Dr.recalculateNodeLabelProjection=function(r){var e=r.pstyle("label").strValue;if(!Ir(e)){var t,a,n=r._private,i=r.width(),o=r.height(),s=r.padding(),l=r.position(),u=r.pstyle("text-halign").strValue,v=r.pstyle("text-valign").strValue,f=n.rscratch,c=n.rstyle;switch(u){case"left":t=l.x-i/2-s;break;case"right":t=l.x+i/2+s;break;default:t=l.x}switch(v){case"top":a=l.y-o/2-s;break;case"bottom":a=l.y+o/2+s;break;default:a=l.y}f.labelX=t,f.labelY=a,c.labelX=t,c.labelY=a,this.calculateLabelAngles(r),this.applyLabelDimensions(r)}};var Ds=function(e,t){var a=Math.atan(t/e);return e===0&&a<0&&(a=a*-1),a},ks=function(e,t){var a=t.x-e.x,n=t.y-e.y;return Ds(a,n)},Yh=function(e,t,a,n){var i=Zt(0,n-.001,1),o=Zt(0,n+.001,1),s=dt(e,t,a,i),l=dt(e,t,a,o);return ks(s,l)};Dr.recalculateEdgeLabelProjections=function(r){var e,t=r._private,a=t.rscratch,n=this,i={mid:r.pstyle("label").strValue,source:r.pstyle("source-label").strValue,target:r.pstyle("target-label").strValue};if(i.mid||i.source||i.target){e={x:a.midX,y:a.midY};var o=function(f,c,h){Fr(t.rscratch,f,c,h),Fr(t.rstyle,f,c,h)};o("labelX",null,e.x),o("labelY",null,e.y);var s=Ds(a.midDispX,a.midDispY);o("labelAutoAngle",null,s);var l=function v(){if(v.cache)return v.cache;for(var f=[],c=0;c+5<a.allpts.length;c+=4){var h={x:a.allpts[c],y:a.allpts[c+1]},d={x:a.allpts[c+2],y:a.allpts[c+3]},m={x:a.allpts[c+4],y:a.allpts[c+5]};f.push({p0:h,p1:d,p2:m,startDist:0,length:0,segments:[]})}var p=t.rstyle.bezierPts,g=n.bezierProjPcts.length;function y(x,k,E,P,L){var T=_r(k,E),A=x.segments[x.segments.length-1],B={p0:k,p1:E,t0:P,t1:L,startDist:A?A.startDist+A.length:0,length:T};x.segments.push(B),x.length+=T}for(var b=0;b<f.length;b++){var w=f[b],D=f[b-1];D&&(w.startDist=D.startDist+D.length),y(w,w.p0,p[b*g],0,n.bezierProjPcts[0]);for(var C=0;C<g-1;C++)y(w,p[b*g+C],p[b*g+C+1],n.bezierProjPcts[C],n.bezierProjPcts[C+1]);y(w,p[b*g+g-1],w.p2,n.bezierProjPcts[g-1],1)}return v.cache=f},u=function(f){var c,h=f==="source";if(i[f]){var d=r.pstyle(f+"-text-offset").pfValue;switch(a.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var m=l(),p,g=0,y=0,b=0;b<m.length;b++){for(var w=m[h?b:m.length-1-b],D=0;D<w.segments.length;D++){var C=w.segments[h?D:w.segments.length-1-D],x=b===m.length-1&&D===w.segments.length-1;if(g=y,y+=C.length,y>=d||x){p={cp:w,segment:C};break}}if(p)break}var k=p.cp,E=p.segment,P=(d-g)/E.length,L=E.t1-E.t0,T=h?E.t0+L*P:E.t1-L*P;T=Zt(0,T,1),e=dt(k.p0,k.p1,k.p2,T),c=Yh(k.p0,k.p1,k.p2,T);break}case"straight":case"segments":case"haystack":{for(var A=0,B,O,R,M,I=a.allpts.length,V=0;V+3<I&&(h?(R={x:a.allpts[V],y:a.allpts[V+1]},M={x:a.allpts[V+2],y:a.allpts[V+3]}):(R={x:a.allpts[I-2-V],y:a.allpts[I-1-V]},M={x:a.allpts[I-4-V],y:a.allpts[I-3-V]}),B=_r(R,M),O=A,A+=B,!(A>=d));V+=2);var G=d-O,z=G/B;z=Zt(0,z,1),e=Jl(R,M,z),c=ks(R,M);break}}o("labelX",f,e.x),o("labelY",f,e.y),o("labelAutoAngle",f,c)}};u("source"),u("target"),this.applyLabelDimensions(r)}},Dr.applyLabelDimensions=function(r){this.applyPrefixedLabelDimensions(r),r.isEdge()&&(this.applyPrefixedLabelDimensions(r,"source"),this.applyPrefixedLabelDimensions(r,"target"))},Dr.applyPrefixedLabelDimensions=function(r,e){var t=r._private,a=this.getLabelText(r,e),n=this.calculateLabelDimensions(r,a),i=r.pstyle("line-height").pfValue,o=r.pstyle("text-wrap").strValue,s=pr(t.rscratch,"labelWrapCachedLines",e)||[],l=o!=="wrap"?1:Math.max(s.length,1),u=n.height/l,v=u*i,f=n.width,c=n.height+(l-1)*(i-1)*u;Fr(t.rstyle,"labelWidth",e,f),Fr(t.rscratch,"labelWidth",e,f),Fr(t.rstyle,"labelHeight",e,c),Fr(t.rscratch,"labelHeight",e,c),Fr(t.rscratch,"labelLineHeight",e,v)},Dr.getLabelText=function(r,e){var t=r._private,a=e?e+"-":"",n=r.pstyle(a+"label").strValue,i=r.pstyle("text-transform").value,o=function(G,z){return z?(Fr(t.rscratch,G,e,z),z):pr(t.rscratch,G,e)};if(!n)return"";i=="none"||(i=="uppercase"?n=n.toUpperCase():i=="lowercase"&&(n=n.toLowerCase()));var s=r.pstyle("text-wrap").value;if(s==="wrap"){var l=o("labelKey");if(l!=null&&o("labelWrapKey")===l)return o("labelWrapCachedText");for(var u="\u200B",v=n.split(`
|
|
3
|
-
`),f=r.pstyle("text-max-width").pfValue,c=r.pstyle("text-overflow-wrap").value,h=c==="anywhere",d=[],m=/[\s\u200b]+/,p=h?"":" ",g=0;g<v.length;g++){var y=v[g],b=this.calculateLabelDimensions(r,y),w=b.width;if(h){var D=y.split("").join(u);y=D}if(w>f){for(var C=y.split(m),x="",k=0;k<C.length;k++){var E=C[k],P=x.length===0?E:x+p+E,L=this.calculateLabelDimensions(r,P),T=L.width;T<=f?x+=E+p:(x&&d.push(x),x=E+p)}x.match(/^[\s\u200b]+$/)||d.push(x)}else d.push(y)}o("labelWrapCachedLines",d),n=o("labelWrapCachedText",d.join(`
|
|
4
|
-
`)),o("labelWrapKey",l)}else if(s==="ellipsis"){var A=r.pstyle("text-max-width").pfValue,B="",O="\u2026",R=!1;if(this.calculateLabelDimensions(r,n).width<A)return n;for(var M=0;M<n.length;M++){var I=this.calculateLabelDimensions(r,B+n[M]+O).width;if(I>A)break;B+=n[M],M===n.length-1&&(R=!0)}return R||(B+=O),B}return n},Dr.getLabelJustification=function(r){var e=r.pstyle("text-justification").strValue,t=r.pstyle("text-halign").strValue;if(e==="auto")if(r.isNode())switch(t){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return e},Dr.calculateLabelDimensions=function(r,e){var t=this,a=Qr(e,r._private.labelDimsKey),n=t.labelDimCache||(t.labelDimCache=[]),i=n[a];if(i!=null)return i;var o=0,s=r.pstyle("font-style").strValue,l=r.pstyle("font-size").pfValue,u=r.pstyle("font-family").strValue,v=r.pstyle("font-weight").strValue,f=this.labelCalcCanvas,c=this.labelCalcCanvasContext;if(!f){f=this.labelCalcCanvas=document.createElement("canvas"),c=this.labelCalcCanvasContext=f.getContext("2d");var h=f.style;h.position="absolute",h.left="-9999px",h.top="-9999px",h.zIndex="-1",h.visibility="hidden",h.pointerEvents="none"}c.font="".concat(s," ").concat(v," ").concat(l,"px ").concat(u);for(var d=0,m=0,p=e.split(`
|
|
5
|
-
`),g=0;g<p.length;g++){var y=p[g],b=c.measureText(y),w=Math.ceil(b.width),D=l;d=Math.max(w,d),m+=D}return d+=o,m+=o,n[a]={width:d,height:m}},Dr.calculateLabelAngle=function(r,e){var t=r._private,a=t.rscratch,n=r.isEdge(),i=e?e+"-":"",o=r.pstyle(i+"text-rotation"),s=o.strValue;return s==="none"?0:n&&s==="autorotate"?a.labelAutoAngle:s==="autorotate"?0:o.pfValue},Dr.calculateLabelAngles=function(r){var e=this,t=r.isEdge(),a=r._private,n=a.rscratch;n.labelAngle=e.calculateLabelAngle(r),t&&(n.sourceLabelAngle=e.calculateLabelAngle(r,"source"),n.targetLabelAngle=e.calculateLabelAngle(r,"target"))};var Ps={},Bs=28,Ls=!1;Ps.getNodeShape=function(r){var e=this,t=r.pstyle("shape").value;if(t==="cutrectangle"&&(r.width()<Bs||r.height()<Bs))return Ls||(Be("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),Ls=!0),"rectangle";if(r.isParent())return t==="rectangle"||t==="roundrectangle"||t==="round-rectangle"||t==="cutrectangle"||t==="cut-rectangle"||t==="barrel"?t:"rectangle";if(t==="polygon"){var a=r.pstyle("shape-polygon-points").value;return e.nodeShapes.makePolygon(a).name}return t};var ln={};ln.registerCalculationListeners=function(){var r=this.cy,e=r.collection(),t=this,a=function(o){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(o),s)for(var l=0;l<o.length;l++){var u=o[l],v=u._private,f=v.rstyle;f.clean=!1,f.cleanConnected=!1}};t.binder(r).on("bounds.* dirty.*",function(o){var s=o.target;a(s)}).on("style.* background.*",function(o){var s=o.target;a(s,!1)});var n=function(o){if(o){var s=t.onUpdateEleCalcsFns;e.cleanStyle();for(var l=0;l<e.length;l++){var u=e[l],v=u._private.rstyle;u.isNode()&&!v.cleanConnected&&(a(u.connectedEdges()),v.cleanConnected=!0)}if(s)for(var f=0;f<s.length;f++){var c=s[f];c(o,e)}t.recalculateRenderedStyle(e),e=r.collection()}};t.flushRenderedStyleQueue=function(){n(!0)},t.beforeRender(n,t.beforeRenderPriorities.eleCalcs)},ln.onUpdateEleCalcs=function(r){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(r)},ln.recalculateRenderedStyle=function(r,e){var t=function(w){return w._private.rstyle.cleanConnected},a=[],n=[];if(!this.destroyed){e===void 0&&(e=!0);for(var i=0;i<r.length;i++){var o=r[i],s=o._private,l=s.rstyle;o.isEdge()&&(!t(o.source())||!t(o.target()))&&(l.clean=!1),!(e&&l.clean||o.removed())&&o.pstyle("display").value!=="none"&&(s.group==="nodes"?n.push(o):a.push(o),l.clean=!0)}for(var u=0;u<n.length;u++){var v=n[u],f=v._private,c=f.rstyle,h=v.position();this.recalculateNodeLabelProjection(v),c.nodeX=h.x,c.nodeY=h.y,c.nodeW=v.pstyle("width").pfValue,c.nodeH=v.pstyle("height").pfValue}this.recalculateEdgeProjections(a);for(var d=0;d<a.length;d++){var m=a[d],p=m._private,g=p.rstyle,y=p.rscratch;g.srcX=y.arrowStartX,g.srcY=y.arrowStartY,g.tgtX=y.arrowEndX,g.tgtY=y.arrowEndY,g.midX=y.midX,g.midY=y.midY,g.labelAngle=y.labelAngle,g.sourceLabelAngle=y.sourceLabelAngle,g.targetLabelAngle=y.targetLabelAngle}}};var vn={};vn.updateCachedGrabbedEles=function(){var r=this.cachedZSortedEles;if(r){r.drag=[],r.nondrag=[];for(var e=[],t=0;t<r.length;t++){var a=r[t],n=a._private.rscratch;a.grabbed()&&!a.isParent()?e.push(a):n.inDragLayer?r.drag.push(a):r.nondrag.push(a)}for(var t=0;t<e.length;t++){var a=e[t];r.drag.push(a)}}},vn.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null},vn.getCachedZSortedEles=function(r){if(r||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(jo),e.interactive=e.filter(function(t){return t.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var Ms={};[at,un,tr,ca,ri,Dr,Ps,ln,vn].forEach(function(r){de(Ms,r)});var As={};As.getCachedImage=function(r,e,t){var a=this,n=a.imageCache=a.imageCache||{},i=n[r];if(i)return i.image.complete||i.image.addEventListener("load",t),i.image;i=n[r]=n[r]||{};var o=i.image=new Image;o.addEventListener("load",t),o.addEventListener("error",function(){o.error=!0});var s="data:",l=r.substring(0,s.length).toLowerCase()===s;return l||(e=e==="null"?null:e,o.crossOrigin=e),o.src=r,o};var Lt={};Lt.registerBinding=function(r,e,t,a){var n=Array.prototype.slice.apply(arguments,[1]),i=this.binder(r);return i.on.apply(i,n)},Lt.binder=function(r){var e=this,t=e.cy.window(),a=r===t||r===t.document||r===t.document.body||yu(r);if(e.supportsPassiveEvents==null){var n=!1;try{var i=Object.defineProperty({},"passive",{get:function(){return n=!0,!0}});t.addEventListener("test",null,i)}catch(s){}e.supportsPassiveEvents=n}var o=function(l,u,v){var f=Array.prototype.slice.call(arguments);return a&&e.supportsPassiveEvents&&(f[2]={capture:v!=null?v:!1,passive:!1,once:!1}),e.bindings.push({target:r,args:f}),(r.addEventListener||r.on).apply(r,f),this};return{on:o,addEventListener:o,addListener:o,bind:o}},Lt.nodeIsDraggable=function(r){return r&&r.isNode()&&!r.locked()&&r.grabbable()},Lt.nodeIsGrabbable=function(r){return this.nodeIsDraggable(r)&&r.interactive()},Lt.load=function(){var r=this,e=r.cy.window(),t=function(S){return S.selected()},a=function(S,F,Z,$){S==null&&(S=r.cy);for(var W=0;W<F.length;W++){var ce=F[W];S.emit({originalEvent:Z,type:ce,position:$})}},n=function(S){return S.shiftKey||S.metaKey||S.ctrlKey},i=function(S,F){var Z=!0;if(r.cy.hasCompoundNodes()&&S&&S.pannable())for(var $=0;F&&$<F.length;$++){var S=F[$];if(S.isNode()&&S.isParent()&&!S.pannable()){Z=!1;break}}else Z=!0;return Z},o=function(S){S[0]._private.grabbed=!0},s=function(S){S[0]._private.grabbed=!1},l=function(S){S[0]._private.rscratch.inDragLayer=!0},u=function(S){S[0]._private.rscratch.inDragLayer=!1},v=function(S){S[0]._private.rscratch.isGrabTarget=!0},f=function(S){S[0]._private.rscratch.isGrabTarget=!1},c=function(S,F){var Z=F.addToList,$=Z.has(S);!$&&S.grabbable()&&!S.locked()&&(Z.merge(S),o(S))},h=function(S,F){if(S.cy().hasCompoundNodes()&&!(F.inDragLayer==null&&F.addToList==null)){var Z=S.descendants();F.inDragLayer&&(Z.forEach(l),Z.connectedEdges().forEach(l)),F.addToList&&c(Z,F)}},d=function(S,F){F=F||{};var Z=S.cy().hasCompoundNodes();F.inDragLayer&&(S.forEach(l),S.neighborhood().stdFilter(function($){return!Z||$.isEdge()}).forEach(l)),F.addToList&&S.forEach(function($){c($,F)}),h(S,F),g(S,{inDragLayer:F.inDragLayer}),r.updateCachedGrabbedEles()},m=d,p=function(S){S&&(r.getCachedZSortedEles().forEach(function(F){s(F),u(F),f(F)}),r.updateCachedGrabbedEles())},g=function(S,F){if(!(F.inDragLayer==null&&F.addToList==null)&&S.cy().hasCompoundNodes()){var Z=S.ancestors().orphans();if(!Z.same(S)){var $=Z.descendants().spawnSelf().merge(Z).unmerge(S).unmerge(S.descendants()),W=$.connectedEdges();F.inDragLayer&&(W.forEach(l),$.forEach(l)),F.addToList&&$.forEach(function(ce){c(ce,F)})}}},y=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},b=typeof MutationObserver!="undefined",w=typeof ResizeObserver!="undefined";b?(r.removeObserver=new MutationObserver(function(q){for(var S=0;S<q.length;S++){var F=q[S],Z=F.removedNodes;if(Z)for(var $=0;$<Z.length;$++){var W=Z[$];if(W===r.container){r.destroy();break}}}}),r.container.parentNode&&r.removeObserver.observe(r.container.parentNode,{childList:!0})):r.registerBinding(r.container,"DOMNodeRemoved",function(q){r.destroy()});var D=Ea(function(){r.cy.resize()},100);b&&(r.styleObserver=new MutationObserver(D),r.styleObserver.observe(r.container,{attributes:!0})),r.registerBinding(e,"resize",D),w&&(r.resizeObserver=new ResizeObserver(D),r.resizeObserver.observe(r.container));var C=function(S,F){for(;S!=null;)F(S),S=S.parentNode},x=function(){r.invalidateContainerClientCoordsCache()};C(r.container,function(q){r.registerBinding(q,"transitionend",x),r.registerBinding(q,"animationend",x),r.registerBinding(q,"scroll",x)}),r.registerBinding(r.container,"contextmenu",function(q){q.preventDefault()});var k=function(){return r.selection[4]!==0},E=function(S){for(var F=r.findContainerClientCoords(),Z=F[0],$=F[1],W=F[2],ce=F[3],K=S.touches?S.touches:[S],se=!1,ye=0;ye<K.length;ye++){var Pe=K[ye];if(Z<=Pe.clientX&&Pe.clientX<=Z+W&&$<=Pe.clientY&&Pe.clientY<=$+ce){se=!0;break}}if(!se)return!1;for(var pe=r.container,Te=S.target,me=Te.parentNode,be=!1;me;){if(me===pe){be=!0;break}me=me.parentNode}return!!be};r.registerBinding(r.container,"mousedown",function(S){if(E(S)){S.preventDefault(),y(),r.hoverData.capture=!0,r.hoverData.which=S.which;var F=r.cy,Z=[S.clientX,S.clientY],$=r.projectIntoViewport(Z[0],Z[1]),W=r.selection,ce=r.findNearestElements($[0],$[1],!0,!1),K=ce[0],se=r.dragData.possibleDragElements;r.hoverData.mdownPos=$,r.hoverData.mdownGPos=Z;var ye=function(){r.hoverData.tapholdCancelled=!1,clearTimeout(r.hoverData.tapholdTimeout),r.hoverData.tapholdTimeout=setTimeout(function(){if(!r.hoverData.tapholdCancelled){var Ve=r.hoverData.down;Ve?Ve.emit({originalEvent:S,type:"taphold",position:{x:$[0],y:$[1]}}):F.emit({originalEvent:S,type:"taphold",position:{x:$[0],y:$[1]}})}},r.tapholdDuration)};if(S.which==3){r.hoverData.cxtStarted=!0;var Pe={originalEvent:S,type:"cxttapstart",position:{x:$[0],y:$[1]}};K?(K.activate(),K.emit(Pe),r.hoverData.down=K):F.emit(Pe),r.hoverData.downTime=new Date().getTime(),r.hoverData.cxtDragged=!1}else if(S.which==1){K&&K.activate();{if(K!=null&&r.nodeIsGrabbable(K)){var pe=function(Ve){return{originalEvent:S,type:Ve,position:{x:$[0],y:$[1]}}},Te=function(Ve){Ve.emit(pe("grab"))};if(v(K),!K.selected())se=r.dragData.possibleDragElements=F.collection(),m(K,{addToList:se}),K.emit(pe("grabon")).emit(pe("grab"));else{se=r.dragData.possibleDragElements=F.collection();var me=F.$(function(be){return be.isNode()&&be.selected()&&r.nodeIsGrabbable(be)});d(me,{addToList:se}),K.emit(pe("grabon")),me.forEach(Te)}r.redrawHint("eles",!0),r.redrawHint("drag",!0)}r.hoverData.down=K,r.hoverData.downs=ce,r.hoverData.downTime=new Date().getTime()}a(K,["mousedown","tapstart","vmousedown"],S,{x:$[0],y:$[1]}),K==null?(W[4]=1,r.data.bgActivePosistion={x:$[0],y:$[1]},r.redrawHint("select",!0),r.redraw()):K.pannable()&&(W[4]=1),ye()}W[0]=W[2]=$[0],W[1]=W[3]=$[1]}},!1),r.registerBinding(e,"mousemove",function(S){var F=r.hoverData.capture;if(!(!F&&!E(S))){var Z=!1,$=r.cy,W=$.zoom(),ce=[S.clientX,S.clientY],K=r.projectIntoViewport(ce[0],ce[1]),se=r.hoverData.mdownPos,ye=r.hoverData.mdownGPos,Pe=r.selection,pe=null;!r.hoverData.draggingEles&&!r.hoverData.dragging&&!r.hoverData.selecting&&(pe=r.findNearestElement(K[0],K[1],!0,!1));var Te=r.hoverData.last,me=r.hoverData.down,be=[K[0]-Pe[2],K[1]-Pe[3]],Ve=r.dragData.possibleDragElements,Qe;if(ye){var br=ce[0]-ye[0],wr=br*br,_e=ce[1]-ye[1],hr=_e*_e,ir=wr+hr;r.hoverData.isOverThresholdDrag=Qe=ir>=r.desktopTapThreshold2}var Or=n(S);Qe&&(r.hoverData.tapholdCancelled=!0);var Ur=function(){var Pr=r.hoverData.dragDelta=r.hoverData.dragDelta||[];Pr.length===0?(Pr.push(be[0]),Pr.push(be[1])):(Pr[0]+=be[0],Pr[1]+=be[1])};Z=!0,a(pe,["mousemove","vmousemove","tapdrag"],S,{x:K[0],y:K[1]});var It=function(){r.data.bgActivePosistion=void 0,r.hoverData.selecting||$.emit({originalEvent:S,type:"boxstart",position:{x:K[0],y:K[1]}}),Pe[4]=1,r.hoverData.selecting=!0,r.redrawHint("select",!0),r.redraw()};if(r.hoverData.which===3){if(Qe){var st={originalEvent:S,type:"cxtdrag",position:{x:K[0],y:K[1]}};me?me.emit(st):$.emit(st),r.hoverData.cxtDragged=!0,(!r.hoverData.cxtOver||pe!==r.hoverData.cxtOver)&&(r.hoverData.cxtOver&&r.hoverData.cxtOver.emit({originalEvent:S,type:"cxtdragout",position:{x:K[0],y:K[1]}}),r.hoverData.cxtOver=pe,pe&&pe.emit({originalEvent:S,type:"cxtdragover",position:{x:K[0],y:K[1]}}))}}else if(r.hoverData.dragging){if(Z=!0,$.panningEnabled()&&$.userPanningEnabled()){var zt;if(r.hoverData.justStartedPan){var hn=r.hoverData.mdownPos;zt={x:(K[0]-hn[0])*W,y:(K[1]-hn[1])*W},r.hoverData.justStartedPan=!1}else zt={x:be[0]*W,y:be[1]*W};$.panBy(zt),$.emit("dragpan"),r.hoverData.dragged=!0}K=r.projectIntoViewport(S.clientX,S.clientY)}else if(Pe[4]==1&&(me==null||me.pannable())){if(Qe){if(!r.hoverData.dragging&&$.boxSelectionEnabled()&&(Or||!$.panningEnabled()||!$.userPanningEnabled()))It();else if(!r.hoverData.selecting&&$.panningEnabled()&&$.userPanningEnabled()){var ut=i(me,r.hoverData.downs);ut&&(r.hoverData.dragging=!0,r.hoverData.justStartedPan=!0,Pe[4]=0,r.data.bgActivePosistion=ct(se),r.redrawHint("select",!0),r.redraw())}me&&me.pannable()&&me.active()&&me.unactivate()}}else{if(me&&me.pannable()&&me.active()&&me.unactivate(),(!me||!me.grabbed())&&pe!=Te&&(Te&&a(Te,["mouseout","tapdragout"],S,{x:K[0],y:K[1]}),pe&&a(pe,["mouseover","tapdragover"],S,{x:K[0],y:K[1]}),r.hoverData.last=pe),me)if(Qe){if($.boxSelectionEnabled()&&Or)me&&me.grabbed()&&(p(Ve),me.emit("freeon"),Ve.emit("free"),r.dragData.didDrag&&(me.emit("dragfreeon"),Ve.emit("dragfree"))),It();else if(me&&me.grabbed()&&r.nodeIsDraggable(me)){var ur=!r.dragData.didDrag;ur&&r.redrawHint("eles",!0),r.dragData.didDrag=!0,r.hoverData.draggingEles||d(Ve,{inDragLayer:!0});var ar={x:0,y:0};if(ae(be[0])&&ae(be[1])&&(ar.x+=be[0],ar.y+=be[1],ur)){var lr=r.hoverData.dragDelta;lr&&ae(lr[0])&&ae(lr[1])&&(ar.x+=lr[0],ar.y+=lr[1])}r.hoverData.draggingEles=!0,Ve.silentShift(ar).emit("position drag"),r.redrawHint("drag",!0),r.redraw()}}else Ur();Z=!0}if(Pe[2]=K[0],Pe[3]=K[1],Z)return S.stopPropagation&&S.stopPropagation(),S.preventDefault&&S.preventDefault(),!1}},!1);var P,L,T;r.registerBinding(e,"mouseup",function(S){var F=r.hoverData.capture;if(F){r.hoverData.capture=!1;var Z=r.cy,$=r.projectIntoViewport(S.clientX,S.clientY),W=r.selection,ce=r.findNearestElement($[0],$[1],!0,!1),K=r.dragData.possibleDragElements,se=r.hoverData.down,ye=n(S);if(r.data.bgActivePosistion&&(r.redrawHint("select",!0),r.redraw()),r.hoverData.tapholdCancelled=!0,r.data.bgActivePosistion=void 0,se&&se.unactivate(),r.hoverData.which===3){var Pe={originalEvent:S,type:"cxttapend",position:{x:$[0],y:$[1]}};if(se?se.emit(Pe):Z.emit(Pe),!r.hoverData.cxtDragged){var pe={originalEvent:S,type:"cxttap",position:{x:$[0],y:$[1]}};se?se.emit(pe):Z.emit(pe)}r.hoverData.cxtDragged=!1,r.hoverData.which=null}else if(r.hoverData.which===1){if(a(ce,["mouseup","tapend","vmouseup"],S,{x:$[0],y:$[1]}),!r.dragData.didDrag&&!r.hoverData.dragged&&!r.hoverData.selecting&&!r.hoverData.isOverThresholdDrag&&(a(se,["click","tap","vclick"],S,{x:$[0],y:$[1]}),L=!1,S.timeStamp-T<=Z.multiClickDebounceTime()?(P&&clearTimeout(P),L=!0,T=null,a(se,["dblclick","dbltap","vdblclick"],S,{x:$[0],y:$[1]})):(P=setTimeout(function(){L||a(se,["oneclick","onetap","voneclick"],S,{x:$[0],y:$[1]})},Z.multiClickDebounceTime()),T=S.timeStamp)),se==null&&!r.dragData.didDrag&&!r.hoverData.selecting&&!r.hoverData.dragged&&!n(S)&&(Z.$(t).unselect(["tapunselect"]),K.length>0&&r.redrawHint("eles",!0),r.dragData.possibleDragElements=K=Z.collection()),ce==se&&!r.dragData.didDrag&&!r.hoverData.selecting&&ce!=null&&ce._private.selectable&&(r.hoverData.dragging||(Z.selectionType()==="additive"||ye?ce.selected()?ce.unselect(["tapunselect"]):ce.select(["tapselect"]):ye||(Z.$(t).unmerge(ce).unselect(["tapunselect"]),ce.select(["tapselect"]))),r.redrawHint("eles",!0)),r.hoverData.selecting){var Te=Z.collection(r.getAllInBox(W[0],W[1],W[2],W[3]));r.redrawHint("select",!0),Te.length>0&&r.redrawHint("eles",!0),Z.emit({type:"boxend",originalEvent:S,position:{x:$[0],y:$[1]}});var me=function(Qe){return Qe.selectable()&&!Qe.selected()};Z.selectionType()==="additive"||ye||Z.$(t).unmerge(Te).unselect(),Te.emit("box").stdFilter(me).select().emit("boxselect"),r.redraw()}if(r.hoverData.dragging&&(r.hoverData.dragging=!1,r.redrawHint("select",!0),r.redrawHint("eles",!0),r.redraw()),!W[4]){r.redrawHint("drag",!0),r.redrawHint("eles",!0);var be=se&&se.grabbed();p(K),be&&(se.emit("freeon"),K.emit("free"),r.dragData.didDrag&&(se.emit("dragfreeon"),K.emit("dragfree")))}}W[4]=0,r.hoverData.down=null,r.hoverData.cxtStarted=!1,r.hoverData.draggingEles=!1,r.hoverData.selecting=!1,r.hoverData.isOverThresholdDrag=!1,r.dragData.didDrag=!1,r.hoverData.dragged=!1,r.hoverData.dragDelta=[],r.hoverData.mdownPos=null,r.hoverData.mdownGPos=null}},!1);var A=function(S){if(!r.scrollingPage){var F=r.cy,Z=F.zoom(),$=F.pan(),W=r.projectIntoViewport(S.clientX,S.clientY),ce=[W[0]*Z+$.x,W[1]*Z+$.y];if(r.hoverData.draggingEles||r.hoverData.dragging||r.hoverData.cxtStarted||k()){S.preventDefault();return}if(F.panningEnabled()&&F.userPanningEnabled()&&F.zoomingEnabled()&&F.userZoomingEnabled()){S.preventDefault(),r.data.wheelZooming=!0,clearTimeout(r.data.wheelTimeout),r.data.wheelTimeout=setTimeout(function(){r.data.wheelZooming=!1,r.redrawHint("eles",!0),r.redraw()},150);var K;S.deltaY!=null?K=S.deltaY/-250:S.wheelDeltaY!=null?K=S.wheelDeltaY/1e3:K=S.wheelDelta/1e3,K=K*r.wheelSensitivity;var se=S.deltaMode===1;se&&(K*=33);var ye=F.zoom()*Math.pow(10,K);S.type==="gesturechange"&&(ye=r.gestureStartZoom*S.scale),F.zoom({level:ye,renderedPosition:{x:ce[0],y:ce[1]}}),F.emit(S.type==="gesturechange"?"pinchzoom":"scrollzoom")}}};r.registerBinding(r.container,"wheel",A,!0),r.registerBinding(e,"scroll",function(S){r.scrollingPage=!0,clearTimeout(r.scrollingPageTimeout),r.scrollingPageTimeout=setTimeout(function(){r.scrollingPage=!1},250)},!0),r.registerBinding(r.container,"gesturestart",function(S){r.gestureStartZoom=r.cy.zoom(),r.hasTouchStarted||S.preventDefault()},!0),r.registerBinding(r.container,"gesturechange",function(q){r.hasTouchStarted||A(q)},!0),r.registerBinding(r.container,"mouseout",function(S){var F=r.projectIntoViewport(S.clientX,S.clientY);r.cy.emit({originalEvent:S,type:"mouseout",position:{x:F[0],y:F[1]}})},!1),r.registerBinding(r.container,"mouseover",function(S){var F=r.projectIntoViewport(S.clientX,S.clientY);r.cy.emit({originalEvent:S,type:"mouseover",position:{x:F[0],y:F[1]}})},!1);var B,O,R,M,I,V,G,z,H,Y,Q,X,U,N=function(S,F,Z,$){return Math.sqrt((Z-S)*(Z-S)+($-F)*($-F))},_=function(S,F,Z,$){return(Z-S)*(Z-S)+($-F)*($-F)},j;r.registerBinding(r.container,"touchstart",j=function(S){if(r.hasTouchStarted=!0,!!E(S)){y(),r.touchData.capture=!0,r.data.bgActivePosistion=void 0;var F=r.cy,Z=r.touchData.now,$=r.touchData.earlier;if(S.touches[0]){var W=r.projectIntoViewport(S.touches[0].clientX,S.touches[0].clientY);Z[0]=W[0],Z[1]=W[1]}if(S.touches[1]){var W=r.projectIntoViewport(S.touches[1].clientX,S.touches[1].clientY);Z[2]=W[0],Z[3]=W[1]}if(S.touches[2]){var W=r.projectIntoViewport(S.touches[2].clientX,S.touches[2].clientY);Z[4]=W[0],Z[5]=W[1]}if(S.touches[1]){r.touchData.singleTouchMoved=!0,p(r.dragData.touchDragEles);var ce=r.findContainerClientCoords();H=ce[0],Y=ce[1],Q=ce[2],X=ce[3],B=S.touches[0].clientX-H,O=S.touches[0].clientY-Y,R=S.touches[1].clientX-H,M=S.touches[1].clientY-Y,U=0<=B&&B<=Q&&0<=R&&R<=Q&&0<=O&&O<=X&&0<=M&&M<=X;var K=F.pan(),se=F.zoom();I=N(B,O,R,M),V=_(B,O,R,M),G=[(B+R)/2,(O+M)/2],z=[(G[0]-K.x)/se,(G[1]-K.y)/se];var ye=200,Pe=ye*ye;if(V<Pe&&!S.touches[2]){var pe=r.findNearestElement(Z[0],Z[1],!0,!0),Te=r.findNearestElement(Z[2],Z[3],!0,!0);pe&&pe.isNode()?(pe.activate().emit({originalEvent:S,type:"cxttapstart",position:{x:Z[0],y:Z[1]}}),r.touchData.start=pe):Te&&Te.isNode()?(Te.activate().emit({originalEvent:S,type:"cxttapstart",position:{x:Z[0],y:Z[1]}}),r.touchData.start=Te):F.emit({originalEvent:S,type:"cxttapstart",position:{x:Z[0],y:Z[1]}}),r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxt=!0,r.touchData.cxtDragged=!1,r.data.bgActivePosistion=void 0,r.redraw();return}}if(S.touches[2])F.boxSelectionEnabled()&&S.preventDefault();else if(!S.touches[1]){if(S.touches[0]){var me=r.findNearestElements(Z[0],Z[1],!0,!0),be=me[0];if(be!=null&&(be.activate(),r.touchData.start=be,r.touchData.starts=me,r.nodeIsGrabbable(be))){var Ve=r.dragData.touchDragEles=F.collection(),Qe=null;r.redrawHint("eles",!0),r.redrawHint("drag",!0),be.selected()?(Qe=F.$(function(ir){return ir.selected()&&r.nodeIsGrabbable(ir)}),d(Qe,{addToList:Ve})):m(be,{addToList:Ve}),v(be);var br=function(Or){return{originalEvent:S,type:Or,position:{x:Z[0],y:Z[1]}}};be.emit(br("grabon")),Qe?Qe.forEach(function(ir){ir.emit(br("grab"))}):be.emit(br("grab"))}a(be,["touchstart","tapstart","vmousedown"],S,{x:Z[0],y:Z[1]}),be==null&&(r.data.bgActivePosistion={x:W[0],y:W[1]},r.redrawHint("select",!0),r.redraw()),r.touchData.singleTouchMoved=!1,r.touchData.singleTouchStartTime=+new Date,clearTimeout(r.touchData.tapholdTimeout),r.touchData.tapholdTimeout=setTimeout(function(){r.touchData.singleTouchMoved===!1&&!r.pinching&&!r.touchData.selecting&&a(r.touchData.start,["taphold"],S,{x:Z[0],y:Z[1]})},r.tapholdDuration)}}if(S.touches.length>=1){for(var wr=r.touchData.startPosition=[null,null,null,null,null,null],_e=0;_e<Z.length;_e++)wr[_e]=$[_e]=Z[_e];var hr=S.touches[0];r.touchData.startGPosition=[hr.clientX,hr.clientY]}}},!1);var J;r.registerBinding(window,"touchmove",J=function(S){var F=r.touchData.capture;if(!(!F&&!E(S))){var Z=r.selection,$=r.cy,W=r.touchData.now,ce=r.touchData.earlier,K=$.zoom();if(S.touches[0]){var se=r.projectIntoViewport(S.touches[0].clientX,S.touches[0].clientY);W[0]=se[0],W[1]=se[1]}if(S.touches[1]){var se=r.projectIntoViewport(S.touches[1].clientX,S.touches[1].clientY);W[2]=se[0],W[3]=se[1]}if(S.touches[2]){var se=r.projectIntoViewport(S.touches[2].clientX,S.touches[2].clientY);W[4]=se[0],W[5]=se[1]}var ye=r.touchData.startGPosition,Pe;if(F&&S.touches[0]&&ye){for(var pe=[],Te=0;Te<W.length;Te++)pe[Te]=W[Te]-ce[Te];var me=S.touches[0].clientX-ye[0],be=me*me,Ve=S.touches[0].clientY-ye[1],Qe=Ve*Ve,br=be+Qe;Pe=br>=r.touchTapThreshold2}if(F&&r.touchData.cxt){S.preventDefault();var wr=S.touches[0].clientX-H,_e=S.touches[0].clientY-Y,hr=S.touches[1].clientX-H,ir=S.touches[1].clientY-Y,Or=_(wr,_e,hr,ir),Ur=Or/V,It=150,st=It*It,zt=1.5,hn=zt*zt;if(Ur>=hn||Or>=st){r.touchData.cxt=!1,r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var ut={originalEvent:S,type:"cxttapend",position:{x:W[0],y:W[1]}};r.touchData.start?(r.touchData.start.unactivate().emit(ut),r.touchData.start=null):$.emit(ut)}}if(F&&r.touchData.cxt){var ut={originalEvent:S,type:"cxtdrag",position:{x:W[0],y:W[1]}};r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),r.touchData.start?r.touchData.start.emit(ut):$.emit(ut),r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxtDragged=!0;var ur=r.findNearestElement(W[0],W[1],!0,!0);(!r.touchData.cxtOver||ur!==r.touchData.cxtOver)&&(r.touchData.cxtOver&&r.touchData.cxtOver.emit({originalEvent:S,type:"cxtdragout",position:{x:W[0],y:W[1]}}),r.touchData.cxtOver=ur,ur&&ur.emit({originalEvent:S,type:"cxtdragover",position:{x:W[0],y:W[1]}}))}else if(F&&S.touches[2]&&$.boxSelectionEnabled())S.preventDefault(),r.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,r.touchData.selecting||$.emit({originalEvent:S,type:"boxstart",position:{x:W[0],y:W[1]}}),r.touchData.selecting=!0,r.touchData.didSelect=!0,Z[4]=1,!Z||Z.length===0||Z[0]===void 0?(Z[0]=(W[0]+W[2]+W[4])/3,Z[1]=(W[1]+W[3]+W[5])/3,Z[2]=(W[0]+W[2]+W[4])/3+1,Z[3]=(W[1]+W[3]+W[5])/3+1):(Z[2]=(W[0]+W[2]+W[4])/3,Z[3]=(W[1]+W[3]+W[5])/3),r.redrawHint("select",!0),r.redraw();else if(F&&S.touches[1]&&!r.touchData.didSelect&&$.zoomingEnabled()&&$.panningEnabled()&&$.userZoomingEnabled()&&$.userPanningEnabled()){S.preventDefault(),r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var ar=r.dragData.touchDragEles;if(ar){r.redrawHint("drag",!0);for(var lr=0;lr<ar.length;lr++){var gn=ar[lr]._private;gn.grabbed=!1,gn.rscratch.inDragLayer=!1}}var Pr=r.touchData.start,wr=S.touches[0].clientX-H,_e=S.touches[0].clientY-Y,hr=S.touches[1].clientX-H,ir=S.touches[1].clientY-Y,au=N(wr,_e,hr,ir),$g=au/I;if(U){var Hg=wr-B,Wg=_e-O,Gg=hr-R,Kg=ir-M,Yg=(Hg+Gg)/2,Xg=(Wg+Kg)/2,ma=$.zoom(),li=ma*$g,pn=$.pan(),nu=z[0]*ma+pn.x,iu=z[1]*ma+pn.y,Ug={x:-li/ma*(nu-pn.x-Yg)+nu,y:-li/ma*(iu-pn.y-Xg)+iu};if(Pr&&Pr.active()){var ar=r.dragData.touchDragEles;p(ar),r.redrawHint("drag",!0),r.redrawHint("eles",!0),Pr.unactivate().emit("freeon"),ar.emit("free"),r.dragData.didDrag&&(Pr.emit("dragfreeon"),ar.emit("dragfree"))}$.viewport({zoom:li,pan:Ug,cancelOnFailedZoom:!0}),$.emit("pinchzoom"),I=au,B=wr,O=_e,R=hr,M=ir,r.pinching=!0}if(S.touches[0]){var se=r.projectIntoViewport(S.touches[0].clientX,S.touches[0].clientY);W[0]=se[0],W[1]=se[1]}if(S.touches[1]){var se=r.projectIntoViewport(S.touches[1].clientX,S.touches[1].clientY);W[2]=se[0],W[3]=se[1]}if(S.touches[2]){var se=r.projectIntoViewport(S.touches[2].clientX,S.touches[2].clientY);W[4]=se[0],W[5]=se[1]}}else if(S.touches[0]&&!r.touchData.didSelect){var xr=r.touchData.start,vi=r.touchData.last,ur;if(!r.hoverData.draggingEles&&!r.swipePanning&&(ur=r.findNearestElement(W[0],W[1],!0,!0)),F&&xr!=null&&S.preventDefault(),F&&xr!=null&&r.nodeIsDraggable(xr))if(Pe){var ar=r.dragData.touchDragEles,ou=!r.dragData.didDrag;ou&&d(ar,{inDragLayer:!0}),r.dragData.didDrag=!0;var ya={x:0,y:0};if(ae(pe[0])&&ae(pe[1])&&(ya.x+=pe[0],ya.y+=pe[1],ou)){r.redrawHint("eles",!0);var Er=r.touchData.dragDelta;Er&&ae(Er[0])&&ae(Er[1])&&(ya.x+=Er[0],ya.y+=Er[1])}r.hoverData.draggingEles=!0,ar.silentShift(ya).emit("position drag"),r.redrawHint("drag",!0),r.touchData.startPosition[0]==ce[0]&&r.touchData.startPosition[1]==ce[1]&&r.redrawHint("eles",!0),r.redraw()}else{var Er=r.touchData.dragDelta=r.touchData.dragDelta||[];Er.length===0?(Er.push(pe[0]),Er.push(pe[1])):(Er[0]+=pe[0],Er[1]+=pe[1])}if(a(xr||ur,["touchmove","tapdrag","vmousemove"],S,{x:W[0],y:W[1]}),(!xr||!xr.grabbed())&&ur!=vi&&(vi&&vi.emit({originalEvent:S,type:"tapdragout",position:{x:W[0],y:W[1]}}),ur&&ur.emit({originalEvent:S,type:"tapdragover",position:{x:W[0],y:W[1]}})),r.touchData.last=ur,F)for(var lr=0;lr<W.length;lr++)W[lr]&&r.touchData.startPosition[lr]&&Pe&&(r.touchData.singleTouchMoved=!0);if(F&&(xr==null||xr.pannable())&&$.panningEnabled()&&$.userPanningEnabled()){var Zg=i(xr,r.touchData.starts);Zg&&(S.preventDefault(),r.data.bgActivePosistion||(r.data.bgActivePosistion=ct(r.touchData.startPosition)),r.swipePanning?($.panBy({x:pe[0]*K,y:pe[1]*K}),$.emit("dragpan")):Pe&&(r.swipePanning=!0,$.panBy({x:me*K,y:Ve*K}),$.emit("dragpan"),xr&&(xr.unactivate(),r.redrawHint("select",!0),r.touchData.start=null)));var se=r.projectIntoViewport(S.touches[0].clientX,S.touches[0].clientY);W[0]=se[0],W[1]=se[1]}}for(var Te=0;Te<W.length;Te++)ce[Te]=W[Te];F&&S.touches.length>0&&!r.hoverData.draggingEles&&!r.swipePanning&&r.data.bgActivePosistion!=null&&(r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),r.redraw())}},!1);var ee;r.registerBinding(e,"touchcancel",ee=function(S){var F=r.touchData.start;r.touchData.capture=!1,F&&F.unactivate()});var oe,he,re,te;if(r.registerBinding(e,"touchend",oe=function(S){var F=r.touchData.start,Z=r.touchData.capture;if(Z)S.touches.length===0&&(r.touchData.capture=!1),S.preventDefault();else return;var $=r.selection;r.swipePanning=!1,r.hoverData.draggingEles=!1;var W=r.cy,ce=W.zoom(),K=r.touchData.now,se=r.touchData.earlier;if(S.touches[0]){var ye=r.projectIntoViewport(S.touches[0].clientX,S.touches[0].clientY);K[0]=ye[0],K[1]=ye[1]}if(S.touches[1]){var ye=r.projectIntoViewport(S.touches[1].clientX,S.touches[1].clientY);K[2]=ye[0],K[3]=ye[1]}if(S.touches[2]){var ye=r.projectIntoViewport(S.touches[2].clientX,S.touches[2].clientY);K[4]=ye[0],K[5]=ye[1]}F&&F.unactivate();var Pe;if(r.touchData.cxt){if(Pe={originalEvent:S,type:"cxttapend",position:{x:K[0],y:K[1]}},F?F.emit(Pe):W.emit(Pe),!r.touchData.cxtDragged){var pe={originalEvent:S,type:"cxttap",position:{x:K[0],y:K[1]}};F?F.emit(pe):W.emit(pe)}r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxt=!1,r.touchData.start=null,r.redraw();return}if(!S.touches[2]&&W.boxSelectionEnabled()&&r.touchData.selecting){r.touchData.selecting=!1;var Te=W.collection(r.getAllInBox($[0],$[1],$[2],$[3]));$[0]=void 0,$[1]=void 0,$[2]=void 0,$[3]=void 0,$[4]=0,r.redrawHint("select",!0),W.emit({type:"boxend",originalEvent:S,position:{x:K[0],y:K[1]}});var me=function(st){return st.selectable()&&!st.selected()};Te.emit("box").stdFilter(me).select().emit("boxselect"),Te.nonempty()&&r.redrawHint("eles",!0),r.redraw()}if(F!=null&&F.unactivate(),S.touches[2])r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);else if(!S.touches[1]){if(!S.touches[0]){if(!S.touches[0]){r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var be=r.dragData.touchDragEles;if(F!=null){var Ve=F._private.grabbed;p(be),r.redrawHint("drag",!0),r.redrawHint("eles",!0),Ve&&(F.emit("freeon"),be.emit("free"),r.dragData.didDrag&&(F.emit("dragfreeon"),be.emit("dragfree"))),a(F,["touchend","tapend","vmouseup","tapdragout"],S,{x:K[0],y:K[1]}),F.unactivate(),r.touchData.start=null}else{var Qe=r.findNearestElement(K[0],K[1],!0,!0);a(Qe,["touchend","tapend","vmouseup","tapdragout"],S,{x:K[0],y:K[1]})}var br=r.touchData.startPosition[0]-K[0],wr=br*br,_e=r.touchData.startPosition[1]-K[1],hr=_e*_e,ir=wr+hr,Or=ir*ce*ce;r.touchData.singleTouchMoved||(F||W.$(":selected").unselect(["tapunselect"]),a(F,["tap","vclick"],S,{x:K[0],y:K[1]}),he=!1,S.timeStamp-te<=W.multiClickDebounceTime()?(re&&clearTimeout(re),he=!0,te=null,a(F,["dbltap","vdblclick"],S,{x:K[0],y:K[1]})):(re=setTimeout(function(){he||a(F,["onetap","voneclick"],S,{x:K[0],y:K[1]})},W.multiClickDebounceTime()),te=S.timeStamp)),F!=null&&!r.dragData.didDrag&&F._private.selectable&&Or<r.touchTapThreshold2&&!r.pinching&&(W.selectionType()==="single"?(W.$(t).unmerge(F).unselect(["tapunselect"]),F.select(["tapselect"])):F.selected()?F.unselect(["tapunselect"]):F.select(["tapselect"]),r.redrawHint("eles",!0)),r.touchData.singleTouchMoved=!0}}}for(var Ur=0;Ur<K.length;Ur++)se[Ur]=K[Ur];r.dragData.didDrag=!1,S.touches.length===0&&(r.touchData.dragDelta=[],r.touchData.startPosition=[null,null,null,null,null,null],r.touchData.startGPosition=null,r.touchData.didSelect=!1),S.touches.length<2&&(S.touches.length===1&&(r.touchData.startGPosition=[S.touches[0].clientX,S.touches[0].clientY]),r.pinching=!1,r.redrawHint("eles",!0),r.redraw())},!1),typeof TouchEvent=="undefined"){var le=[],ue=function(S){return{clientX:S.clientX,clientY:S.clientY,force:1,identifier:S.pointerId,pageX:S.pageX,pageY:S.pageY,radiusX:S.width/2,radiusY:S.height/2,screenX:S.screenX,screenY:S.screenY,target:S.target}},ie=function(S){return{event:S,touch:ue(S)}},fe=function(S){le.push(ie(S))},Ee=function(S){for(var F=0;F<le.length;F++){var Z=le[F];if(Z.event.pointerId===S.pointerId){le.splice(F,1);return}}},we=function(S){var F=le.filter(function(Z){return Z.event.pointerId===S.pointerId})[0];F.event=S,F.touch=ue(S)},ge=function(S){S.touches=le.map(function(F){return F.touch})},xe=function(S){return S.pointerType==="mouse"||S.pointerType===4};r.registerBinding(r.container,"pointerdown",function(q){xe(q)||(q.preventDefault(),fe(q),ge(q),j(q))}),r.registerBinding(r.container,"pointerup",function(q){xe(q)||(Ee(q),ge(q),oe(q))}),r.registerBinding(r.container,"pointercancel",function(q){xe(q)||(Ee(q),ge(q),ee(q))}),r.registerBinding(r.container,"pointermove",function(q){xe(q)||(q.preventDefault(),we(q),ge(q),J(q))})}};var Ar={};Ar.generatePolygon=function(r,e){return this.nodeShapes[r]={renderer:this,name:r,points:e,draw:function(a,n,i,o,s){this.renderer.nodeShapeImpl("polygon",a,n,i,o,s,this.points)},intersectLine:function(a,n,i,o,s,l,u){return _t(s,l,this.points,a,n,i/2,o/2,u)},checkPoint:function(a,n,i,o,s,l,u){return Lr(a,n,this.points,l,u,o,s,[0,-1],i)}}},Ar.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,t,a,n,i){this.renderer.nodeShapeImpl(this.name,e,t,a,n,i)},intersectLine:function(e,t,a,n,i,o,s){return fv(i,o,e,t,a/2+s,n/2+s)},checkPoint:function(e,t,a,n,i,o,s){return jr(e,t,n,i,o,s,a)}}},Ar.generateRoundPolygon=function(r,e){for(var t=new Array(e.length*2),a=0;a<e.length/2;a++){var n=a*2,i=void 0;a<e.length/2-1?i=(a+1)*2:i=0,t[a*4]=e[n],t[a*4+1]=e[n+1];var o=e[i]-e[n],s=e[i+1]-e[n+1],l=Math.sqrt(o*o+s*s);t[a*4+2]=o/l,t[a*4+3]=s/l}return this.nodeShapes[r]={renderer:this,name:r,points:t,draw:function(v,f,c,h,d){this.renderer.nodeShapeImpl("round-polygon",v,f,c,h,d,this.points)},intersectLine:function(v,f,c,h,d,m,p){return cv(d,m,this.points,v,f,c,h)},checkPoint:function(v,f,c,h,d,m,p){return vv(v,f,this.points,m,p,h,d)}}},Ar.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:nr(4,0),draw:function(e,t,a,n,i){this.renderer.nodeShapeImpl(this.name,e,t,a,n,i)},intersectLine:function(e,t,a,n,i,o,s){return Ki(i,o,e,t,a,n,s)},checkPoint:function(e,t,a,n,i,o,s){var l=Jt(n,i),u=l*2;return!!(Lr(e,t,this.points,o,s,n,i-u,[0,-1],a)||Lr(e,t,this.points,o,s,n-u,i,[0,-1],a)||jr(e,t,u,u,o-n/2+l,s-i/2+l,a)||jr(e,t,u,u,o+n/2-l,s-i/2+l,a)||jr(e,t,u,u,o+n/2-l,s+i/2-l,a)||jr(e,t,u,u,o-n/2+l,s+i/2-l,a))}}},Ar.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:Xi(),points:nr(4,0),draw:function(e,t,a,n,i){this.renderer.nodeShapeImpl(this.name,e,t,a,n,i)},generateCutTrianglePts:function(e,t,a,n){var i=this.cornerLength,o=t/2,s=e/2,l=a-s,u=a+s,v=n-o,f=n+o;return{topLeft:[l,v+i,l+i,v,l+i,v+i],topRight:[u-i,v,u,v+i,u-i,v+i],bottomRight:[u,f-i,u-i,f,u-i,f-i],bottomLeft:[l+i,f,l,f-i,l+i,f-i]}},intersectLine:function(e,t,a,n,i,o,s){var l=this.generateCutTrianglePts(a+2*s,n+2*s,e,t),u=[].concat.apply([],[l.topLeft.splice(0,4),l.topRight.splice(0,4),l.bottomRight.splice(0,4),l.bottomLeft.splice(0,4)]);return _t(i,o,u,e,t)},checkPoint:function(e,t,a,n,i,o,s){if(Lr(e,t,this.points,o,s,n,i-2*this.cornerLength,[0,-1],a)||Lr(e,t,this.points,o,s,n-2*this.cornerLength,i,[0,-1],a))return!0;var l=this.generateCutTrianglePts(n,i,o,s);return sr(e,t,l.topLeft)||sr(e,t,l.topRight)||sr(e,t,l.bottomRight)||sr(e,t,l.bottomLeft)}}},Ar.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:nr(4,0),draw:function(e,t,a,n,i){this.renderer.nodeShapeImpl(this.name,e,t,a,n,i)},intersectLine:function(e,t,a,n,i,o,s){var l=.15,u=.5,v=.85,f=this.generateBarrelBezierPts(a+2*s,n+2*s,e,t),c=function(m){var p=dt({x:m[0],y:m[1]},{x:m[2],y:m[3]},{x:m[4],y:m[5]},l),g=dt({x:m[0],y:m[1]},{x:m[2],y:m[3]},{x:m[4],y:m[5]},u),y=dt({x:m[0],y:m[1]},{x:m[2],y:m[3]},{x:m[4],y:m[5]},v);return[m[0],m[1],p.x,p.y,g.x,g.y,y.x,y.y,m[4],m[5]]},h=[].concat(c(f.topLeft),c(f.topRight),c(f.bottomRight),c(f.bottomLeft));return _t(i,o,h,e,t)},generateBarrelBezierPts:function(e,t,a,n){var i=t/2,o=e/2,s=a-o,l=a+o,u=n-i,v=n+i,f=Mn(e,t),c=f.heightOffset,h=f.widthOffset,d=f.ctrlPtOffsetPct*e,m={topLeft:[s,u+c,s+d,u,s+h,u],topRight:[l-h,u,l-d,u,l,u+c],bottomRight:[l,v-c,l-d,v,l-h,v],bottomLeft:[s+h,v,s+d,v,s,v-c]};return m.topLeft.isTop=!0,m.topRight.isTop=!0,m.bottomLeft.isBottom=!0,m.bottomRight.isBottom=!0,m},checkPoint:function(e,t,a,n,i,o,s){var l=Mn(n,i),u=l.heightOffset,v=l.widthOffset;if(Lr(e,t,this.points,o,s,n,i-2*u,[0,-1],a)||Lr(e,t,this.points,o,s,n-2*v,i,[0,-1],a))return!0;for(var f=this.generateBarrelBezierPts(n,i,o,s),c=function(x,k,E){var P=E[4],L=E[2],T=E[0],A=E[5],B=E[1],O=Math.min(P,T),R=Math.max(P,T),M=Math.min(A,B),I=Math.max(A,B);if(O<=x&&x<=R&&M<=k&&k<=I){var V=dv(P,L,T),G=ov(V[0],V[1],V[2],x),z=G.filter(function(H){return 0<=H&&H<=1});if(z.length>0)return z[0]}return null},h=Object.keys(f),d=0;d<h.length;d++){var m=h[d],p=f[m],g=c(e,t,p);if(g!=null){var y=p[5],b=p[3],w=p[1],D=Ge(y,b,w,g);if(p.isTop&&D<=t||p.isBottom&&t<=D)return!0}}return!1}}},Ar.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:nr(4,0),draw:function(e,t,a,n,i){this.renderer.nodeShapeImpl(this.name,e,t,a,n,i)},intersectLine:function(e,t,a,n,i,o,s){var l=e-(a/2+s),u=t-(n/2+s),v=u,f=e+(a/2+s),c=Vr(i,o,e,t,l,u,f,v,!1);return c.length>0?c:Ki(i,o,e,t,a,n,s)},checkPoint:function(e,t,a,n,i,o,s){var l=Jt(n,i),u=2*l;if(Lr(e,t,this.points,o,s,n,i-u,[0,-1],a)||Lr(e,t,this.points,o,s,n-u,i,[0,-1],a))return!0;var v=n/2+2*a,f=i/2+2*a,c=[o-v,s-f,o-v,s,o+v,s,o+v,s-f];return!!(sr(e,t,c)||jr(e,t,u,u,o+n/2-l,s+i/2-l,a)||jr(e,t,u,u,o-n/2+l,s+i/2-l,a))}}},Ar.registerNodeShapes=function(){var r=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",nr(3,0)),this.generateRoundPolygon("round-triangle",nr(3,0)),this.generatePolygon("rectangle",nr(4,0)),r.square=r.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var t=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",t),this.generateRoundPolygon("round-diamond",t)}this.generatePolygon("pentagon",nr(5,0)),this.generateRoundPolygon("round-pentagon",nr(5,0)),this.generatePolygon("hexagon",nr(6,0)),this.generateRoundPolygon("round-hexagon",nr(6,0)),this.generatePolygon("heptagon",nr(7,0)),this.generateRoundPolygon("round-heptagon",nr(7,0)),this.generatePolygon("octagon",nr(8,0)),this.generateRoundPolygon("round-octagon",nr(8,0));var a=new Array(20);{var n=Bn(5,0),i=Bn(5,Math.PI/5),o=.5*(3-Math.sqrt(5));o*=1.57;for(var s=0;s<i.length/2;s++)i[s*2]*=o,i[s*2+1]*=o;for(var s=0;s<20/4;s++)a[s*4]=n[s*2],a[s*4+1]=n[s*2+1],a[s*4+2]=i[s*2],a[s*4+3]=i[s*2+1]}a=Yi(a),this.generatePolygon("star",a),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.generatePolygon("right-rhomboid",[-.333,-1,1,-1,.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);{var l=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",l),this.generateRoundPolygon("round-tag",l)}r.makePolygon=function(u){var v=u.join("$"),f="polygon-"+v,c;return(c=this[f])?c:e.generatePolygon(f,u)}};var da={};da.timeToRender=function(){return this.redrawTotalTime/this.redrawCount},da.redraw=function(r){r=r||Fi();var e=this;e.averageRedrawTime===void 0&&(e.averageRedrawTime=0),e.lastRedrawTime===void 0&&(e.lastRedrawTime=0),e.lastDrawTime===void 0&&(e.lastDrawTime=0),e.requestedFrame=!0,e.renderOptions=r},da.beforeRender=function(r,e){if(!this.destroyed){e==null&&Ne("Priority is not optional for beforeRender");var t=this.beforeRenderCallbacks;t.push({fn:r,priority:e}),t.sort(function(a,n){return n.priority-a.priority})}};var Rs=function(e,t,a){for(var n=e.beforeRenderCallbacks,i=0;i<n.length;i++)n[i].fn(t,a)};da.startRenderLoop=function(){var r=this,e=r.cy;if(!r.renderLoopStarted){r.renderLoopStarted=!0;var t=function a(n){if(!r.destroyed){if(!e.batching())if(r.requestedFrame&&!r.skipFrame){Rs(r,!0,n);var i=Br();r.render(r.renderOptions);var o=r.lastDrawTime=Br();r.averageRedrawTime===void 0&&(r.averageRedrawTime=o-i),r.redrawCount===void 0&&(r.redrawCount=0),r.redrawCount++,r.redrawTotalTime===void 0&&(r.redrawTotalTime=0);var s=o-i;r.redrawTotalTime+=s,r.lastRedrawTime=s,r.averageRedrawTime=r.averageRedrawTime/2+s/2,r.requestedFrame=!1}else Rs(r,!1,n);r.skipFrame=!1,Ca(a)}};Ca(t)}};var Xh=function(e){this.init(e)},Os=Xh,Mt=Os.prototype;Mt.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"],Mt.init=function(r){var e=this;e.options=r,e.cy=r.cy;var t=e.container=r.cy.container(),a=e.cy.window();if(a){var n=a.document,i=n.head,o="__________cytoscape_stylesheet",s="__________cytoscape_container",l=n.getElementById(o)!=null;if(t.className.indexOf(s)<0&&(t.className=(t.className||"")+" "+s),!l){var u=n.createElement("style");u.id=o,u.textContent="."+s+" { position: relative; }",i.insertBefore(u,i.children[0])}var v=a.getComputedStyle(t),f=v.getPropertyValue("position");f==="static"&&Be("A Cytoscape container has style position:static and so can not use UI extensions properly")}e.selection=[void 0,void 0,void 0,void 0,0],e.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],e.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},e.dragData={possibleDragElements:[]},e.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},e.redraws=0,e.showFps=r.showFps,e.debug=r.debug,e.hideEdgesOnViewport=r.hideEdgesOnViewport,e.textureOnViewport=r.textureOnViewport,e.wheelSensitivity=r.wheelSensitivity,e.motionBlurEnabled=r.motionBlur,e.forcedPixelRatio=ae(r.pixelRatio)?r.pixelRatio:null,e.motionBlur=r.motionBlur,e.motionBlurOpacity=r.motionBlurOpacity,e.motionBlurTransparency=1-e.motionBlurOpacity,e.motionBlurPxRatio=1,e.mbPxRBlurry=1,e.minMbLowQualFrames=4,e.fullQualityMb=!1,e.clearedForMotionBlur=[],e.desktopTapThreshold=r.desktopTapThreshold,e.desktopTapThreshold2=r.desktopTapThreshold*r.desktopTapThreshold,e.touchTapThreshold=r.touchTapThreshold,e.touchTapThreshold2=r.touchTapThreshold*r.touchTapThreshold,e.tapholdDuration=500,e.bindings=[],e.beforeRenderCallbacks=[],e.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},e.registerNodeShapes(),e.registerArrowShapes(),e.registerCalculationListeners()},Mt.notify=function(r,e){var t=this,a=t.cy;if(!this.destroyed){if(r==="init"){t.load();return}if(r==="destroy"){t.destroy();return}(r==="add"||r==="remove"||r==="move"&&a.hasCompoundNodes()||r==="load"||r==="zorder"||r==="mount")&&t.invalidateCachedZSortedEles(),r==="viewport"&&t.redrawHint("select",!0),(r==="load"||r==="resize"||r==="mount")&&(t.invalidateContainerClientCoordsCache(),t.matchCanvasSize(t.container)),t.redrawHint("eles",!0),t.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}},Mt.destroy=function(){var r=this;r.destroyed=!0,r.cy.stopAnimationLoop();for(var e=0;e<r.bindings.length;e++){var t=r.bindings[e],a=t,n=a.target;(n.off||n.removeEventListener).apply(n,a.args)}if(r.bindings=[],r.beforeRenderCallbacks=[],r.onUpdateEleCalcsFns=[],r.removeObserver&&r.removeObserver.disconnect(),r.styleObserver&&r.styleObserver.disconnect(),r.resizeObserver&&r.resizeObserver.disconnect(),r.labelCalcDiv)try{document.body.removeChild(r.labelCalcDiv)}catch(i){}},Mt.isHeadless=function(){return!1},[ei,Ms,As,Lt,Ar,da].forEach(function(r){de(Mt,r)});var ti=1e3/60,Is={setupDequeueing:function(e){return function(){var a=this,n=this.renderer;if(!a.dequeueingSetup){a.dequeueingSetup=!0;var i=Ea(function(){n.redrawHint("eles",!0),n.redrawHint("drag",!0),n.redraw()},e.deqRedrawThreshold),o=function(u,v){var f=Br(),c=n.averageRedrawTime,h=n.lastRedrawTime,d=[],m=n.cy.extent(),p=n.getPixelRatio();for(u||n.flushRenderedStyleQueue();;){var g=Br(),y=g-f,b=g-v;if(h<ti){var w=ti-(u?c:0);if(b>=e.deqFastCost*w)break}else if(u){if(y>=e.deqCost*h||y>=e.deqAvgCost*c)break}else if(b>=e.deqNoDrawCost*ti)break;var D=e.deq(a,p,m);if(D.length>0)for(var C=0;C<D.length;C++)d.push(D[C]);else break}d.length>0&&(e.onDeqd(a,d),!u&&e.shouldRedraw(a,d,p,m)&&i())},s=e.priority||Cn;n.beforeRender(o,s(a))}}}},Uh=function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ta;Nt(this,r),this.idsByKey=new Sr,this.keyForId=new Sr,this.cachesByLvl=new Sr,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=t}return mn(r,[{key:"getIdsFor",value:function(t){t==null&&Ne("Can not get id list for null key");var a=this.idsByKey,n=this.idsByKey.get(t);return n||(n=new ft,a.set(t,n)),n}},{key:"addIdForKey",value:function(t,a){t!=null&&this.getIdsFor(t).add(a)}},{key:"deleteIdForKey",value:function(t,a){t!=null&&this.getIdsFor(t).delete(a)}},{key:"getNumberOfIdsForKey",value:function(t){return t==null?0:this.getIdsFor(t).size}},{key:"updateKeyMappingFor",value:function(t){var a=t.id(),n=this.keyForId.get(a),i=this.getKey(t);this.deleteIdForKey(n,a),this.addIdForKey(i,a),this.keyForId.set(a,i)}},{key:"deleteKeyMappingFor",value:function(t){var a=t.id(),n=this.keyForId.get(a);this.deleteIdForKey(n,a),this.keyForId.delete(a)}},{key:"keyHasChangedFor",value:function(t){var a=t.id(),n=this.keyForId.get(a),i=this.getKey(t);return n!==i}},{key:"isInvalid",value:function(t){return this.keyHasChangedFor(t)||this.doesEleInvalidateKey(t)}},{key:"getCachesAt",value:function(t){var a=this.cachesByLvl,n=this.lvls,i=a.get(t);return i||(i=new Sr,a.set(t,i),n.push(t)),i}},{key:"getCache",value:function(t,a){return this.getCachesAt(a).get(t)}},{key:"get",value:function(t,a){var n=this.getKey(t),i=this.getCache(n,a);return i!=null&&this.updateKeyMappingFor(t),i}},{key:"getForCachedKey",value:function(t,a){var n=this.keyForId.get(t.id()),i=this.getCache(n,a);return i}},{key:"hasCache",value:function(t,a){return this.getCachesAt(a).has(t)}},{key:"has",value:function(t,a){var n=this.getKey(t);return this.hasCache(n,a)}},{key:"setCache",value:function(t,a,n){n.key=t,this.getCachesAt(a).set(t,n)}},{key:"set",value:function(t,a,n){var i=this.getKey(t);this.setCache(i,a,n),this.updateKeyMappingFor(t)}},{key:"deleteCache",value:function(t,a){this.getCachesAt(a).delete(t)}},{key:"delete",value:function(t,a){var n=this.getKey(t);this.deleteCache(n,a)}},{key:"invalidateKey",value:function(t){var a=this;this.lvls.forEach(function(n){return a.deleteCache(t,n)})}},{key:"invalidate",value:function(t){var a=t.id(),n=this.keyForId.get(a);this.deleteKeyMappingFor(t);var i=this.doesEleInvalidateKey(t);return i&&this.invalidateKey(n),i||this.getNumberOfIdsForKey(n)===0}}]),r}(),zs=25,fn=50,cn=-4,ai=3,Zh=7.99,Qh=8,_h=1024,Jh=1024,jh=1024,eg=.2,rg=.8,tg=10,ag=.15,ng=.1,ig=.9,og=.9,sg=100,ug=1,At={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},lg=Ke({getKey:null,doesEleInvalidateKey:Ta,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Oi,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),ha=function(e,t){var a=this;a.renderer=e,a.onDequeues=[];var n=lg(t);de(a,n),a.lookup=new Uh(n.getKey,n.doesEleInvalidateKey),a.setupDequeueing()},We=ha.prototype;We.reasons=At,We.getTextureQueue=function(r){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[r]=e.eleImgCaches[r]||[]},We.getRetiredTextureQueue=function(r){var e=this,t=e.eleImgCaches.retired=e.eleImgCaches.retired||{},a=t[r]=t[r]||[];return a},We.getElementQueue=function(){var r=this,e=r.eleCacheQueue=r.eleCacheQueue||new Ut(function(t,a){return a.reqs-t.reqs});return e},We.getElementKeyToQueue=function(){var r=this,e=r.eleKeyToCacheQueue=r.eleKeyToCacheQueue||{};return e},We.getElement=function(r,e,t,a,n){var i=this,o=this.renderer,s=o.cy.zoom(),l=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!r.visible()||r.removed()||!i.allowEdgeTxrCaching&&r.isEdge()||!i.allowParentTxrCaching&&r.isParent())return null;if(a==null&&(a=Math.ceil(Dn(s*t))),a<cn)a=cn;else if(s>=Zh||a>ai)return null;var u=Math.pow(2,a),v=e.h*u,f=e.w*u,c=o.eleTextBiggerThanMin(r,u);if(!this.isVisible(r,c))return null;var h=l.get(r,a);if(h&&h.invalidated&&(h.invalidated=!1,h.texture.invalidatedWidth-=h.width),h)return h;var d;if(v<=zs?d=zs:v<=fn?d=fn:d=Math.ceil(v/fn)*fn,v>jh||f>Jh)return null;var m=i.getTextureQueue(d),p=m[m.length-2],g=function(){return i.recycleTexture(d,f)||i.addTexture(d,f)};p||(p=m[m.length-1]),p||(p=g()),p.width-p.usedWidth<f&&(p=g());for(var y=function(R){return R&&R.scaledLabelShown===c},b=n&&n===At.dequeue,w=n&&n===At.highQuality,D=n&&n===At.downscale,C,x=a+1;x<=ai;x++){var k=l.get(r,x);if(k){C=k;break}}var E=C&&C.level===a+1?C:null,P=function(){p.context.drawImage(E.texture.canvas,E.x,0,E.width,E.height,p.usedWidth,0,f,v)};if(p.context.setTransform(1,0,0,1,0,0),p.context.clearRect(p.usedWidth,0,f,d),y(E))P();else if(y(C))if(w){for(var L=C.level;L>a;L--)E=i.getElement(r,e,t,L,At.downscale);P()}else return i.queueElement(r,C.level-1),C;else{var T;if(!b&&!w&&!D)for(var A=a-1;A>=cn;A--){var B=l.get(r,A);if(B){T=B;break}}if(y(T))return i.queueElement(r,a),T;p.context.translate(p.usedWidth,0),p.context.scale(u,u),this.drawElement(p.context,r,e,c,!1),p.context.scale(1/u,1/u),p.context.translate(-p.usedWidth,0)}return h={x:p.usedWidth,texture:p,level:a,scale:u,width:f,height:v,scaledLabelShown:c},p.usedWidth+=Math.ceil(f+Qh),p.eleCaches.push(h),l.set(r,a,h),i.checkTextureFullness(p),h},We.invalidateElements=function(r){for(var e=0;e<r.length;e++)this.invalidateElement(r[e])},We.invalidateElement=function(r){var e=this,t=e.lookup,a=[],n=t.isInvalid(r);if(n){for(var i=cn;i<=ai;i++){var o=t.getForCachedKey(r,i);o&&a.push(o)}var s=t.invalidate(r);if(s)for(var l=0;l<a.length;l++){var u=a[l],v=u.texture;v.invalidatedWidth+=u.width,u.invalidated=!0,e.checkTextureUtility(v)}e.removeFromQueue(r)}},We.checkTextureUtility=function(r){r.invalidatedWidth>=eg*r.width&&this.retireTexture(r)},We.checkTextureFullness=function(r){var e=this,t=e.getTextureQueue(r.height);r.usedWidth/r.width>rg&&r.fullnessChecks>=tg?Nr(t,r):r.fullnessChecks++},We.retireTexture=function(r){var e=this,t=r.height,a=e.getTextureQueue(t),n=this.lookup;Nr(a,r),r.retired=!0;for(var i=r.eleCaches,o=0;o<i.length;o++){var s=i[o];n.deleteCache(s.key,s.level)}Sn(i);var l=e.getRetiredTextureQueue(t);l.push(r)},We.addTexture=function(r,e){var t=this,a=t.getTextureQueue(r),n={};return a.push(n),n.eleCaches=[],n.height=r,n.width=Math.max(_h,e),n.usedWidth=0,n.invalidatedWidth=0,n.fullnessChecks=0,n.canvas=t.renderer.makeOffscreenCanvas(n.width,n.height),n.context=n.canvas.getContext("2d"),n},We.recycleTexture=function(r,e){for(var t=this,a=t.getTextureQueue(r),n=t.getRetiredTextureQueue(r),i=0;i<n.length;i++){var o=n[i];if(o.width>=e)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,Sn(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),Nr(n,o),a.push(o),o}},We.queueElement=function(r,e){var t=this,a=t.getElementQueue(),n=t.getElementKeyToQueue(),i=this.getKey(r),o=n[i];if(o)o.level=Math.max(o.level,e),o.eles.merge(r),o.reqs++,a.updateItem(o);else{var s={eles:r.spawn().merge(r),level:e,reqs:1,key:i};a.push(s),n[i]=s}},We.dequeue=function(r){for(var e=this,t=e.getElementQueue(),a=e.getElementKeyToQueue(),n=[],i=e.lookup,o=0;o<ug&&t.size()>0;o++){var s=t.pop(),l=s.key,u=s.eles[0],v=i.hasCache(u,s.level);if(a[l]=null,v)continue;n.push(s);var f=e.getBoundingBox(u);e.getElement(u,f,r,s.level,At.dequeue)}return n},We.removeFromQueue=function(r){var e=this,t=e.getElementQueue(),a=e.getElementKeyToQueue(),n=this.getKey(r),i=a[n];i!=null&&(i.eles.length===1?(i.reqs=En,t.updateItem(i),t.pop(),a[n]=null):i.eles.unmerge(r))},We.onDequeue=function(r){this.onDequeues.push(r)},We.offDequeue=function(r){Nr(this.onDequeues,r)},We.setupDequeueing=Is.setupDequeueing({deqRedrawThreshold:sg,deqCost:ag,deqAvgCost:ng,deqNoDrawCost:ig,deqFastCost:og,deq:function(e,t,a){return e.dequeue(t,a)},onDeqd:function(e,t){for(var a=0;a<e.onDequeues.length;a++){var n=e.onDequeues[a];n(t)}},shouldRedraw:function(e,t,a,n){for(var i=0;i<t.length;i++)for(var o=t[i].eles,s=0;s<o.length;s++){var l=o[s].boundingBox();if(kn(l,n))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var vg=1,ga=-4,dn=2,fg=3.99,cg=50,dg=50,hg=.15,gg=.1,pg=.9,mg=.9,yg=1,Ns=250,bg=4e3*4e3,wg=!0,Fs=function(e){var t=this,a=t.renderer=e,n=a.cy;t.layersByLevel={},t.firstGet=!0,t.lastInvalidationTime=Br()-2*Ns,t.skipping=!1,t.eleTxrDeqs=n.collection(),t.scheduleElementRefinement=Ea(function(){t.refineElementTextures(t.eleTxrDeqs),t.eleTxrDeqs.unmerge(t.eleTxrDeqs)},dg),a.beforeRender(function(o,s){s-t.lastInvalidationTime<=Ns?t.skipping=!0:t.skipping=!1},a.beforeRenderPriorities.lyrTxrSkip);var i=function(s,l){return l.reqs-s.reqs};t.layersQueue=new Ut(i),t.setupDequeueing()},Ze=Fs.prototype,Vs=0,xg=Math.pow(2,53)-1;Ze.makeLayer=function(r,e){var t=Math.pow(2,e),a=Math.ceil(r.w*t),n=Math.ceil(r.h*t),i=this.renderer.makeOffscreenCanvas(a,n),o={id:Vs=++Vs%xg,bb:r,level:e,width:a,height:n,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},s=o.context,l=-o.bb.x1,u=-o.bb.y1;return s.scale(t,t),s.translate(l,u),o},Ze.getLayers=function(r,e,t){var a=this,n=a.renderer,i=n.cy,o=i.zoom(),s=a.firstGet;if(a.firstGet=!1,t==null){if(t=Math.ceil(Dn(o*e)),t<ga)t=ga;else if(o>=fg||t>dn)return null}a.validateLayersElesOrdering(t,r);var l=a.layersByLevel,u=Math.pow(2,t),v=l[t]=l[t]||[],f,c=a.levelIsComplete(t,r),h,d=function(){var P=function(O){if(a.validateLayersElesOrdering(O,r),a.levelIsComplete(O,r))return h=l[O],!0},L=function(O){if(!h)for(var R=t+O;ga<=R&&R<=dn&&!P(R);R+=O);};L(1),L(-1);for(var T=v.length-1;T>=0;T--){var A=v[T];A.invalid&&Nr(v,A)}};if(!c)d();else return v;var m=function(){if(!f){f=or();for(var P=0;P<r.length;P++)Hi(f,r[P].boundingBox())}return f},p=function(P){P=P||{};var L=P.after;m();var T=f.w*u*(f.h*u);if(T>bg)return null;var A=a.makeLayer(f,t);if(L!=null){var B=v.indexOf(L)+1;v.splice(B,0,A)}else(P.insert===void 0||P.insert)&&v.unshift(A);return A};if(a.skipping&&!s)return null;for(var g=null,y=r.length/vg,b=!s,w=0;w<r.length;w++){var D=r[w],C=D._private.rscratch,x=C.imgLayerCaches=C.imgLayerCaches||{},k=x[t];if(k){g=k;continue}if((!g||g.eles.length>=y||!Gi(g.bb,D.boundingBox()))&&(g=p({insert:!0,after:g}),!g))return null;h||b?a.queueLayer(g,D):a.drawEleInLayer(g,D,t,e),g.eles.push(D),x[t]=g}return h||(b?null:v)},Ze.getEleLevelForLayerLevel=function(r,e){return r},Ze.drawEleInLayer=function(r,e,t,a){var n=this,i=this.renderer,o=r.context,s=e.boundingBox();s.w===0||s.h===0||!e.visible()||(t=n.getEleLevelForLayerLevel(t,a),i.setImgSmoothing(o,!1),i.drawCachedElement(o,e,null,null,t,wg),i.setImgSmoothing(o,!0))},Ze.levelIsComplete=function(r,e){var t=this,a=t.layersByLevel[r];if(!a||a.length===0)return!1;for(var n=0,i=0;i<a.length;i++){var o=a[i];if(o.reqs>0||o.invalid)return!1;n+=o.eles.length}return n===e.length},Ze.validateLayersElesOrdering=function(r,e){var t=this.layersByLevel[r];if(t)for(var a=0;a<t.length;a++){for(var n=t[a],i=-1,o=0;o<e.length;o++)if(n.eles[0]===e[o]){i=o;break}if(i<0){this.invalidateLayer(n);continue}for(var s=i,o=0;o<n.eles.length;o++)if(n.eles[o]!==e[s+o]){this.invalidateLayer(n);break}}},Ze.updateElementsInLayers=function(r,e){for(var t=this,a=Vt(r[0]),n=0;n<r.length;n++)for(var i=a?null:r[n],o=a?r[n]:r[n].ele,s=o._private.rscratch,l=s.imgLayerCaches=s.imgLayerCaches||{},u=ga;u<=dn;u++){var v=l[u];v&&(i&&t.getEleLevelForLayerLevel(v.level)!==i.level||e(v,o,i))}},Ze.haveLayers=function(){for(var r=this,e=!1,t=ga;t<=dn;t++){var a=r.layersByLevel[t];if(a&&a.length>0){e=!0;break}}return e},Ze.invalidateElements=function(r){var e=this;r.length!==0&&(e.lastInvalidationTime=Br(),!(r.length===0||!e.haveLayers())&&e.updateElementsInLayers(r,function(a,n,i){e.invalidateLayer(a)}))},Ze.invalidateLayer=function(r){if(this.lastInvalidationTime=Br(),!r.invalid){var e=r.level,t=r.eles,a=this.layersByLevel[e];Nr(a,r),r.elesQueue=[],r.invalid=!0,r.replacement&&(r.replacement.invalid=!0);for(var n=0;n<t.length;n++){var i=t[n]._private.rscratch.imgLayerCaches;i&&(i[e]=null)}}},Ze.refineElementTextures=function(r){var e=this;e.updateElementsInLayers(r,function(a,n,i){var o=a.replacement;if(o||(o=a.replacement=e.makeLayer(a.bb,a.level),o.replaces=a,o.eles=a.eles),!o.reqs)for(var s=0;s<o.eles.length;s++)e.queueLayer(o,o.eles[s])})},Ze.enqueueElementRefinement=function(r){this.eleTxrDeqs.merge(r),this.scheduleElementRefinement()},Ze.queueLayer=function(r,e){var t=this,a=t.layersQueue,n=r.elesQueue,i=n.hasId=n.hasId||{};if(!r.replacement){if(e){if(i[e.id()])return;n.push(e),i[e.id()]=!0}r.reqs?(r.reqs++,a.updateItem(r)):(r.reqs=1,a.push(r))}},Ze.dequeue=function(r){for(var e=this,t=e.layersQueue,a=[],n=0;n<yg&&t.size()!==0;){var i=t.peek();if(i.replacement){t.pop();continue}if(i.replaces&&i!==i.replaces.replacement){t.pop();continue}if(i.invalid){t.pop();continue}var o=i.elesQueue.shift();o&&(e.drawEleInLayer(i,o,i.level,r),n++),a.length===0&&a.push(!0),i.elesQueue.length===0&&(t.pop(),i.reqs=0,i.replaces&&e.applyLayerReplacement(i),e.requestRedraw())}return a},Ze.applyLayerReplacement=function(r){var e=this,t=e.layersByLevel[r.level],a=r.replaces,n=t.indexOf(a);if(!(n<0||a.invalid)){t[n]=r;for(var i=0;i<r.eles.length;i++){var o=r.eles[i]._private,s=o.imgLayerCaches=o.imgLayerCaches||{};s&&(s[r.level]=r)}e.requestRedraw()}},Ze.requestRedraw=Ea(function(){var r=this.renderer;r.redrawHint("eles",!0),r.redrawHint("drag",!0),r.redraw()},100),Ze.setupDequeueing=Is.setupDequeueing({deqRedrawThreshold:cg,deqCost:hg,deqAvgCost:gg,deqNoDrawCost:pg,deqFastCost:mg,deq:function(e,t){return e.dequeue(t)},onDeqd:Cn,shouldRedraw:Oi,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var qs={},$s;function Eg(r,e){for(var t=0;t<e.length;t++){var a=e[t];r.lineTo(a.x,a.y)}}function Cg(r,e,t){for(var a,n=0;n<e.length;n++){var i=e[n];n===0&&(a=i),r.lineTo(i.x,i.y)}r.quadraticCurveTo(t.x,t.y,a.x,a.y)}function Hs(r,e,t){r.beginPath&&r.beginPath();for(var a=e,n=0;n<a.length;n++){var i=a[n];r.lineTo(i.x,i.y)}var o=t,s=t[0];r.moveTo(s.x,s.y);for(var n=1;n<o.length;n++){var i=o[n];r.lineTo(i.x,i.y)}r.closePath&&r.closePath()}function Sg(r,e,t,a,n){r.beginPath&&r.beginPath(),r.arc(t,a,n,0,Math.PI*2,!1);var i=e,o=i[0];r.moveTo(o.x,o.y);for(var s=0;s<i.length;s++){var l=i[s];r.lineTo(l.x,l.y)}r.closePath&&r.closePath()}function Tg(r,e,t,a){r.arc(e,t,a,0,Math.PI*2,!1)}qs.arrowShapeImpl=function(r){return($s||($s={polygon:Eg,"triangle-backcurve":Cg,"triangle-tee":Hs,"circle-triangle":Sg,"triangle-cross":Hs,circle:Tg}))[r]};var kr={};kr.drawElement=function(r,e,t,a,n,i){var o=this;e.isNode()?o.drawNode(r,e,t,a,n,i):o.drawEdge(r,e,t,a,n,i)},kr.drawElementOverlay=function(r,e){var t=this;e.isNode()?t.drawNodeOverlay(r,e):t.drawEdgeOverlay(r,e)},kr.drawElementUnderlay=function(r,e){var t=this;e.isNode()?t.drawNodeUnderlay(r,e):t.drawEdgeUnderlay(r,e)},kr.drawCachedElementPortion=function(r,e,t,a,n,i,o,s){var l=this,u=t.getBoundingBox(e);if(!(u.w===0||u.h===0)){var v=t.getElement(e,u,a,n,i);if(v!=null){var f=s(l,e);if(f===0)return;var c=o(l,e),h=u.x1,d=u.y1,m=u.w,p=u.h,g,y,b,w,D;if(c!==0){var C=t.getRotationPoint(e);b=C.x,w=C.y,r.translate(b,w),r.rotate(c),D=l.getImgSmoothing(r),D||l.setImgSmoothing(r,!0);var x=t.getRotationOffset(e);g=x.x,y=x.y}else g=h,y=d;var k;f!==1&&(k=r.globalAlpha,r.globalAlpha=k*f),r.drawImage(v.texture.canvas,v.x,0,v.width,v.height,g,y,m,p),f!==1&&(r.globalAlpha=k),c!==0&&(r.rotate(-c),r.translate(-b,-w),D||l.setImgSmoothing(r,!1))}else t.drawElement(r,e)}};var Dg=function(){return 0},kg=function(e,t){return e.getTextAngle(t,null)},Pg=function(e,t){return e.getTextAngle(t,"source")},Bg=function(e,t){return e.getTextAngle(t,"target")},Lg=function(e,t){return t.effectiveOpacity()},ni=function(e,t){return t.pstyle("text-opacity").pfValue*t.effectiveOpacity()};kr.drawCachedElement=function(r,e,t,a,n,i){var o=this,s=o.data,l=s.eleTxrCache,u=s.lblTxrCache,v=s.slbTxrCache,f=s.tlbTxrCache,c=e.boundingBox(),h=i===!0?l.reasons.highQuality:null;if(!(c.w===0||c.h===0||!e.visible())&&(!a||kn(c,a))){var d=e.isEdge(),m=e.element()._private.rscratch.badLine;o.drawElementUnderlay(r,e),o.drawCachedElementPortion(r,e,l,t,n,h,Dg,Lg),(!d||!m)&&o.drawCachedElementPortion(r,e,u,t,n,h,kg,ni),d&&!m&&(o.drawCachedElementPortion(r,e,v,t,n,h,Pg,ni),o.drawCachedElementPortion(r,e,f,t,n,h,Bg,ni)),o.drawElementOverlay(r,e)}},kr.drawElements=function(r,e){for(var t=this,a=0;a<e.length;a++){var n=e[a];t.drawElement(r,n)}},kr.drawCachedElements=function(r,e,t,a){for(var n=this,i=0;i<e.length;i++){var o=e[i];n.drawCachedElement(r,o,t,a)}},kr.drawCachedNodes=function(r,e,t,a){for(var n=this,i=0;i<e.length;i++){var o=e[i];o.isNode()&&n.drawCachedElement(r,o,t,a)}},kr.drawLayeredElements=function(r,e,t,a){var n=this,i=n.data.lyrTxrCache.getLayers(e,t);if(i)for(var o=0;o<i.length;o++){var s=i[o],l=s.bb;l.w===0||l.h===0||r.drawImage(s.canvas,l.x1,l.y1,l.w,l.h)}else n.drawCachedElements(r,e,t,a)};var Rr={};Rr.drawEdge=function(r,e,t){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this,s=e._private.rscratch;if(!(i&&!e.visible())&&!(s.badLine||s.allpts==null||isNaN(s.allpts[0]))){var l;t&&(l=t,r.translate(-l.x1,-l.y1));var u=i?e.pstyle("opacity").value:1,v=i?e.pstyle("line-opacity").value:1,f=e.pstyle("curve-style").value,c=e.pstyle("line-style").value,h=e.pstyle("width").pfValue,d=e.pstyle("line-cap").value,m=u*v,p=u*v,g=function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m;f==="straight-triangle"?(o.eleStrokeStyle(r,e,T),o.drawEdgeTrianglePath(e,r,s.allpts)):(r.lineWidth=h,r.lineCap=d,o.eleStrokeStyle(r,e,T),o.drawEdgePath(e,r,s.allpts,c),r.lineCap="butt")},y=function(){n&&o.drawEdgeOverlay(r,e)},b=function(){n&&o.drawEdgeUnderlay(r,e)},w=function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p;o.drawArrowheads(r,e,T)},D=function(){o.drawElementText(r,e,null,a)};r.lineJoin="round";var C=e.pstyle("ghost").value==="yes";if(C){var x=e.pstyle("ghost-offset-x").pfValue,k=e.pstyle("ghost-offset-y").pfValue,E=e.pstyle("ghost-opacity").value,P=m*E;r.translate(x,k),g(P),w(P),r.translate(-x,-k)}b(),g(),w(),y(),D(),t&&r.translate(l.x1,l.y1)}};var Ws=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,a){if(a.visible()){var n=a.pstyle("".concat(e,"-opacity")).value;if(n!==0){var i=this,o=i.usePaths(),s=a._private.rscratch,l=a.pstyle("".concat(e,"-padding")).pfValue,u=2*l,v=a.pstyle("".concat(e,"-color")).value;t.lineWidth=u,s.edgeType==="self"&&!o?t.lineCap="butt":t.lineCap="round",i.colorStrokeStyle(t,v[0],v[1],v[2],n),i.drawEdgePath(a,t,s.allpts,"solid")}}}};Rr.drawEdgeOverlay=Ws("overlay"),Rr.drawEdgeUnderlay=Ws("underlay"),Rr.drawEdgePath=function(r,e,t,a){var n=r._private.rscratch,i=e,o,s=!1,l=this.usePaths(),u=r.pstyle("line-dash-pattern").pfValue,v=r.pstyle("line-dash-offset").pfValue;if(l){var f=t.join("$"),c=n.pathCacheKey&&n.pathCacheKey===f;c?(o=e=n.pathCache,s=!0):(o=e=new Path2D,n.pathCacheKey=f,n.pathCache=o)}if(i.setLineDash)switch(a){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(u),i.lineDashOffset=v;break;case"solid":i.setLineDash([]);break}if(!s&&!n.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(t[0],t[1]),n.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var h=2;h+3<t.length;h+=4)e.quadraticCurveTo(t[h],t[h+1],t[h+2],t[h+3]);break;case"straight":case"segments":case"haystack":for(var d=2;d+1<t.length;d+=2)e.lineTo(t[d],t[d+1]);break}e=i,l?e.stroke(o):e.stroke(),e.setLineDash&&e.setLineDash([])},Rr.drawEdgeTrianglePath=function(r,e,t){e.fillStyle=e.strokeStyle;for(var a=r.pstyle("width").pfValue,n=0;n+1<t.length;n+=2){var i=[t[n+2]-t[n],t[n+3]-t[n+1]],o=Math.sqrt(i[0]*i[0]+i[1]*i[1]),s=[i[1]/o,-i[0]/o],l=[s[0]*a/2,s[1]*a/2];e.beginPath(),e.moveTo(t[n]-l[0],t[n+1]-l[1]),e.lineTo(t[n]+l[0],t[n+1]+l[1]),e.lineTo(t[n+2],t[n+3]),e.closePath(),e.fill()}},Rr.drawArrowheads=function(r,e,t){var a=e._private.rscratch,n=a.edgeType==="haystack";n||this.drawArrowhead(r,e,"source",a.arrowStartX,a.arrowStartY,a.srcArrowAngle,t),this.drawArrowhead(r,e,"mid-target",a.midX,a.midY,a.midtgtArrowAngle,t),this.drawArrowhead(r,e,"mid-source",a.midX,a.midY,a.midsrcArrowAngle,t),n||this.drawArrowhead(r,e,"target",a.arrowEndX,a.arrowEndY,a.tgtArrowAngle,t)},Rr.drawArrowhead=function(r,e,t,a,n,i,o){if(!(isNaN(a)||a==null||isNaN(n)||n==null||isNaN(i)||i==null)){var s=this,l=e.pstyle(t+"-arrow-shape").value;if(l!=="none"){var u=e.pstyle(t+"-arrow-fill").value==="hollow"?"both":"filled",v=e.pstyle(t+"-arrow-fill").value,f=e.pstyle("width").pfValue,c=e.pstyle(t+"-arrow-width"),h=c.value==="match-line"?f:c.pfValue;c.units==="%"&&(h*=f);var d=e.pstyle("opacity").value;o===void 0&&(o=d);var m=r.globalCompositeOperation;(o!==1||v==="hollow")&&(r.globalCompositeOperation="destination-out",s.colorFillStyle(r,255,255,255,1),s.colorStrokeStyle(r,255,255,255,1),s.drawArrowShape(e,r,u,f,l,h,a,n,i),r.globalCompositeOperation=m);var p=e.pstyle(t+"-arrow-color").value;s.colorFillStyle(r,p[0],p[1],p[2],o),s.colorStrokeStyle(r,p[0],p[1],p[2],o),s.drawArrowShape(e,r,v,f,l,h,a,n,i)}}},Rr.drawArrowShape=function(r,e,t,a,n,i,o,s,l){var u=this,v=this.usePaths()&&n!=="triangle-cross",f=!1,c,h=e,d={x:o,y:s},m=r.pstyle("arrow-scale").value,p=this.getArrowWidth(a,m),g=u.arrowShapes[n];if(v){var y=u.arrowPathCache=u.arrowPathCache||[],b=Qr(n),w=y[b];w!=null?(c=e=w,f=!0):(c=e=new Path2D,y[b]=c)}f||(e.beginPath&&e.beginPath(),v?g.draw(e,1,0,{x:0,y:0},1):g.draw(e,p,l,d,a),e.closePath&&e.closePath()),e=h,v&&(e.translate(o,s),e.rotate(l),e.scale(p,p)),(t==="filled"||t==="both")&&(v?e.fill(c):e.fill()),(t==="hollow"||t==="both")&&(e.lineWidth=i/(v?p:1),e.lineJoin="miter",v?e.stroke(c):e.stroke()),v&&(e.scale(1/p,1/p),e.rotate(-l),e.translate(-o,-s))};var ii={};ii.safeDrawImage=function(r,e,t,a,n,i,o,s,l,u){if(!(n<=0||i<=0||l<=0||u<=0))try{r.drawImage(e,t,a,n,i,o,s,l,u)}catch(v){Be(v)}},ii.drawInscribedImage=function(r,e,t,a,n){var i=this,o=t.position(),s=o.x,l=o.y,u=t.cy().style(),v=u.getIndexedStyle.bind(u),f=v(t,"background-fit","value",a),c=v(t,"background-repeat","value",a),h=t.width(),d=t.height(),m=t.padding()*2,p=h+(v(t,"background-width-relative-to","value",a)==="inner"?0:m),g=d+(v(t,"background-height-relative-to","value",a)==="inner"?0:m),y=t._private.rscratch,b=v(t,"background-clip","value",a),w=b==="node",D=v(t,"background-image-opacity","value",a)*n,C=v(t,"background-image-smoothing","value",a),x=e.width||e.cachedW,k=e.height||e.cachedH;(x==null||k==null)&&(document.body.appendChild(e),x=e.cachedW=e.width||e.offsetWidth,k=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var E=x,P=k;if(v(t,"background-width","value",a)!=="auto"&&(v(t,"background-width","units",a)==="%"?E=v(t,"background-width","pfValue",a)*p:E=v(t,"background-width","pfValue",a)),v(t,"background-height","value",a)!=="auto"&&(v(t,"background-height","units",a)==="%"?P=v(t,"background-height","pfValue",a)*g:P=v(t,"background-height","pfValue",a)),!(E===0||P===0)){if(f==="contain"){var L=Math.min(p/E,g/P);E*=L,P*=L}else if(f==="cover"){var L=Math.max(p/E,g/P);E*=L,P*=L}var T=s-p/2,A=v(t,"background-position-x","units",a),B=v(t,"background-position-x","pfValue",a);A==="%"?T+=(p-E)*B:T+=B;var O=v(t,"background-offset-x","units",a),R=v(t,"background-offset-x","pfValue",a);O==="%"?T+=(p-E)*R:T+=R;var M=l-g/2,I=v(t,"background-position-y","units",a),V=v(t,"background-position-y","pfValue",a);I==="%"?M+=(g-P)*V:M+=V;var G=v(t,"background-offset-y","units",a),z=v(t,"background-offset-y","pfValue",a);G==="%"?M+=(g-P)*z:M+=z,y.pathCache&&(T-=s,M-=l,s=0,l=0);var H=r.globalAlpha;r.globalAlpha=D;var Y=i.getImgSmoothing(r),Q=!1;if(C==="no"&&Y?(i.setImgSmoothing(r,!1),Q=!0):C==="yes"&&!Y&&(i.setImgSmoothing(r,!0),Q=!0),c==="no-repeat")w&&(r.save(),y.pathCache?r.clip(y.pathCache):(i.nodeShapes[i.getNodeShape(t)].draw(r,s,l,p,g),r.clip())),i.safeDrawImage(r,e,0,0,x,k,T,M,E,P),w&&r.restore();else{var X=r.createPattern(e,c);r.fillStyle=X,i.nodeShapes[i.getNodeShape(t)].draw(r,s,l,p,g),r.translate(T,M),r.fill(),r.translate(-T,-M)}r.globalAlpha=H,Q&&i.setImgSmoothing(r,Y)}};var nt={};nt.eleTextBiggerThanMin=function(r,e){if(!e){var t=r.cy().zoom(),a=this.getPixelRatio(),n=Math.ceil(Dn(t*a));e=Math.pow(2,n)}var i=r.pstyle("font-size").pfValue*e,o=r.pstyle("min-zoomed-font-size").pfValue;return!(i<o)},nt.drawElementText=function(r,e,t,a,n){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this;if(a==null){if(i&&!o.eleTextBiggerThanMin(e))return}else if(a===!1)return;if(e.isNode()){var s=e.pstyle("label");if(!s||!s.value)return;var l=o.getLabelJustification(e);r.textAlign=l,r.textBaseline="bottom"}else{var u=e.element()._private.rscratch.badLine,v=e.pstyle("label"),f=e.pstyle("source-label"),c=e.pstyle("target-label");if(u||(!v||!v.value)&&(!f||!f.value)&&(!c||!c.value))return;r.textAlign="center",r.textBaseline="bottom"}var h=!t,d;t&&(d=t,r.translate(-d.x1,-d.y1)),n==null?(o.drawText(r,e,null,h,i),e.isEdge()&&(o.drawText(r,e,"source",h,i),o.drawText(r,e,"target",h,i))):o.drawText(r,e,n,h,i),t&&r.translate(d.x1,d.y1)},nt.getFontCache=function(r){var e;this.fontCaches=this.fontCaches||[];for(var t=0;t<this.fontCaches.length;t++)if(e=this.fontCaches[t],e.context===r)return e;return e={context:r},this.fontCaches.push(e),e},nt.setupTextStyle=function(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=e.pstyle("font-style").strValue,n=e.pstyle("font-size").pfValue+"px",i=e.pstyle("font-family").strValue,o=e.pstyle("font-weight").strValue,s=t?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*s,u=e.pstyle("color").value,v=e.pstyle("text-outline-color").value;r.font=a+" "+o+" "+n+" "+i,r.lineJoin="round",this.colorFillStyle(r,u[0],u[1],u[2],s),this.colorStrokeStyle(r,v[0],v[1],v[2],l)};function Mg(r,e,t,a,n){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5;r.beginPath(),r.moveTo(e+i,t),r.lineTo(e+a-i,t),r.quadraticCurveTo(e+a,t,e+a,t+i),r.lineTo(e+a,t+n-i),r.quadraticCurveTo(e+a,t+n,e+a-i,t+n),r.lineTo(e+i,t+n),r.quadraticCurveTo(e,t+n,e,t+n-i),r.lineTo(e,t+i),r.quadraticCurveTo(e,t,e+i,t),r.closePath(),r.fill()}nt.getTextAngle=function(r,e){var t,a=r._private,n=a.rscratch,i=e?e+"-":"",o=r.pstyle(i+"text-rotation"),s=pr(n,"labelAngle",e);return o.strValue==="autorotate"?t=r.isEdge()?s:0:o.strValue==="none"?t=0:t=o.pfValue,t},nt.drawText=function(r,e,t){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=e._private,o=i.rscratch,s=n?e.effectiveOpacity():1;if(!(n&&(s===0||e.pstyle("text-opacity").value===0))){t==="main"&&(t=null);var l=pr(o,"labelX",t),u=pr(o,"labelY",t),v,f,c=this.getLabelText(e,t);if(c!=null&&c!==""&&!isNaN(l)&&!isNaN(u)){this.setupTextStyle(r,e,n);var h=t?t+"-":"",d=pr(o,"labelWidth",t),m=pr(o,"labelHeight",t),p=e.pstyle(h+"text-margin-x").pfValue,g=e.pstyle(h+"text-margin-y").pfValue,y=e.isEdge(),b=e.pstyle("text-halign").value,w=e.pstyle("text-valign").value;y&&(b="center",w="center"),l+=p,u+=g;var D;switch(a?D=this.getTextAngle(e,t):D=0,D!==0&&(v=l,f=u,r.translate(v,f),r.rotate(D),l=0,u=0),w){case"top":break;case"center":u+=m/2;break;case"bottom":u+=m;break}var C=e.pstyle("text-background-opacity").value,x=e.pstyle("text-border-opacity").value,k=e.pstyle("text-border-width").pfValue,E=e.pstyle("text-background-padding").pfValue;if(C>0||k>0&&x>0){var P=l-E;switch(b){case"left":P-=d;break;case"center":P-=d/2;break}var L=u-m-E,T=d+2*E,A=m+2*E;if(C>0){var B=r.fillStyle,O=e.pstyle("text-background-color").value;r.fillStyle="rgba("+O[0]+","+O[1]+","+O[2]+","+C*s+")";var R=e.pstyle("text-background-shape").strValue;R.indexOf("round")===0?Mg(r,P,L,T,A,2):r.fillRect(P,L,T,A),r.fillStyle=B}if(k>0&&x>0){var M=r.strokeStyle,I=r.lineWidth,V=e.pstyle("text-border-color").value,G=e.pstyle("text-border-style").value;if(r.strokeStyle="rgba("+V[0]+","+V[1]+","+V[2]+","+x*s+")",r.lineWidth=k,r.setLineDash)switch(G){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash([4,2]);break;case"double":r.lineWidth=k/4,r.setLineDash([]);break;case"solid":r.setLineDash([]);break}if(r.strokeRect(P,L,T,A),G==="double"){var z=k/2;r.strokeRect(P+z,L+z,T-z*2,A-z*2)}r.setLineDash&&r.setLineDash([]),r.lineWidth=I,r.strokeStyle=M}}var H=2*e.pstyle("text-outline-width").pfValue;if(H>0&&(r.lineWidth=H),e.pstyle("text-wrap").value==="wrap"){var Y=pr(o,"labelWrapCachedLines",t),Q=pr(o,"labelLineHeight",t),X=d/2,U=this.getLabelJustification(e);switch(U==="auto"||(b==="left"?U==="left"?l+=-d:U==="center"&&(l+=-X):b==="center"?U==="left"?l+=-X:U==="right"&&(l+=X):b==="right"&&(U==="center"?l+=X:U==="right"&&(l+=d))),w){case"top":u-=(Y.length-1)*Q;break;case"center":case"bottom":u-=(Y.length-1)*Q;break}for(var N=0;N<Y.length;N++)H>0&&r.strokeText(Y[N],l,u),r.fillText(Y[N],l,u),u+=Q}else H>0&&r.strokeText(c,l,u),r.fillText(c,l,u);D!==0&&(r.rotate(-D),r.translate(-v,-f))}}};var Rt={};Rt.drawNode=function(r,e,t){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this,s,l,u=e._private,v=u.rscratch,f=e.position();if(!(!ae(f.x)||!ae(f.y))&&!(i&&!e.visible())){var c=i?e.effectiveOpacity():1,h=o.usePaths(),d,m=!1,p=e.padding();s=e.width()+2*p,l=e.height()+2*p;var g;t&&(g=t,r.translate(-g.x1,-g.y1));for(var y=e.pstyle("background-image"),b=y.value,w=new Array(b.length),D=new Array(b.length),C=0,x=0;x<b.length;x++){var k=b[x],E=w[x]=k!=null&&k!=="none";if(E){var P=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",x);C++,D[x]=o.getCachedImage(k,P,function(){u.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var L=e.pstyle("background-blacken").value,T=e.pstyle("border-width").pfValue,A=e.pstyle("background-opacity").value*c,B=e.pstyle("border-color").value,O=e.pstyle("border-style").value,R=e.pstyle("border-opacity").value*c,M=e.pstyle("outline-width").pfValue,I=e.pstyle("outline-color").value,V=e.pstyle("outline-style").value,G=e.pstyle("outline-opacity").value*c,z=e.pstyle("outline-offset").value;r.lineJoin="miter";var H=function(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:A;o.eleFillStyle(r,e,q)},Y=function(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:R;o.colorStrokeStyle(r,B[0],B[1],B[2],q)},Q=function(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:G;o.colorStrokeStyle(r,I[0],I[1],I[2],q)},X=function(q,S,F,Z){var $=o.nodePathCache=o.nodePathCache||[],W=Ai(F==="polygon"?F+","+Z.join(","):F,""+S,""+q),ce=$[W],K,se=!1;return ce!=null?(K=ce,se=!0,v.pathCache=K):(K=new Path2D,$[W]=v.pathCache=K),{path:K,cacheHit:se}},U=e.pstyle("shape").strValue,N=e.pstyle("shape-polygon-points").pfValue;if(h){r.translate(f.x,f.y);var _=X(s,l,U,N);d=_.path,m=_.cacheHit}var j=function(){if(!m){var q=f;h&&(q={x:0,y:0}),o.nodeShapes[o.getNodeShape(e)].draw(d||r,q.x,q.y,s,l)}h?r.fill(d):r.fill()},J=function(){for(var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:c,S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,F=u.backgrounding,Z=0,$=0;$<D.length;$++){var W=e.cy().style().getIndexedStyle(e,"background-image-containment","value",$);if(S&&W==="over"||!S&&W==="inside"){Z++;continue}w[$]&&D[$].complete&&!D[$].error&&(Z++,o.drawInscribedImage(r,D[$],e,$,q))}u.backgrounding=Z!==C,F!==u.backgrounding&&e.updateStyle(!1)},ee=function(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;o.hasPie(e)&&(o.drawPie(r,e,S),q&&(h||o.nodeShapes[o.getNodeShape(e)].draw(r,f.x,f.y,s,l)))},oe=function(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:c,S=(L>0?L:-L)*q,F=L>0?0:255;L!==0&&(o.colorFillStyle(r,F,F,F,S),h?r.fill(d):r.fill())},he=function(){if(T>0){if(r.lineWidth=T,r.lineCap="butt",r.setLineDash)switch(O){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash([4,2]);break;case"solid":case"double":r.setLineDash([]);break}if(h?r.stroke(d):r.stroke(),O==="double"){r.lineWidth=T/3;var q=r.globalCompositeOperation;r.globalCompositeOperation="destination-out",h?r.stroke(d):r.stroke(),r.globalCompositeOperation=q}r.setLineDash&&r.setLineDash([])}},re=function(){if(M>0){if(r.lineWidth=M,r.lineCap="butt",r.setLineDash)switch(V){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash([4,2]);break;case"solid":case"double":r.setLineDash([]);break}var q=f;h&&(q={x:0,y:0});var S=o.getNodeShape(e),F=(s+T+(M+z))/s,Z=(l+T+(M+z))/l,$=s*F,W=l*Z,ce=o.nodeShapes[S].points,K;if(h){var se=X($,W,S,ce);K=se.path}if(S==="ellipse")o.drawEllipsePath(K||r,q.x,q.y,$,W);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(S)){var ye=0,Pe=0,pe=0;S==="round-diamond"?ye=(T+z+M)*1.4:S==="round-heptagon"?(ye=(T+z+M)*1.075,pe=-(T/2+z+M)/35):S==="round-hexagon"?ye=(T+z+M)*1.12:S==="round-pentagon"?(ye=(T+z+M)*1.13,pe=-(T/2+z+M)/15):S==="round-tag"?(ye=(T+z+M)*1.12,Pe=(T/2+M+z)*.07):S==="round-triangle"&&(ye=(T+z+M)*(Math.PI/2),pe=-(T+z/2+M)/Math.PI),ye!==0&&(F=(s+ye)/s,Z=(l+ye)/l),o.drawRoundPolygonPath(K||r,q.x+Pe,q.y+pe,s*F,l*Z,ce)}else if(["roundrectangle","round-rectangle"].includes(S))o.drawRoundRectanglePath(K||r,q.x,q.y,$,W);else if(["cutrectangle","cut-rectangle"].includes(S))o.drawCutRectanglePath(K||r,q.x,q.y,$,W);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(S))o.drawBottomRoundRectanglePath(K||r,q.x,q.y,$,W);else if(S==="barrel")o.drawBarrelPath(K||r,q.x,q.y,$,W);else if(S.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(S)){var Te=(T+M+z)/s;ce=Ma(Aa(ce,Te)),o.drawPolygonPath(K||r,q.x,q.y,s,l,ce)}else{var me=(T+M+z)/s;ce=Ma(Aa(ce,-me)),o.drawPolygonPath(K||r,q.x,q.y,s,l,ce)}if(h?r.stroke(K):r.stroke(),V==="double"){r.lineWidth=T/3;var be=r.globalCompositeOperation;r.globalCompositeOperation="destination-out",h?r.stroke(K):r.stroke(),r.globalCompositeOperation=be}r.setLineDash&&r.setLineDash([])}},te=function(){n&&o.drawNodeOverlay(r,e,f,s,l)},le=function(){n&&o.drawNodeUnderlay(r,e,f,s,l)},ue=function(){o.drawElementText(r,e,null,a)},ie=e.pstyle("ghost").value==="yes";if(ie){var fe=e.pstyle("ghost-offset-x").pfValue,Ee=e.pstyle("ghost-offset-y").pfValue,we=e.pstyle("ghost-opacity").value,ge=we*c;r.translate(fe,Ee),Q(),re(),H(we*A),j(),J(ge,!0),Y(we*R),he(),ee(L!==0||T!==0),J(ge,!1),oe(ge),r.translate(-fe,-Ee)}h&&r.translate(-f.x,-f.y),le(),h&&r.translate(f.x,f.y),Q(),re(),H(),j(),J(c,!0),Y(),he(),ee(L!==0||T!==0),J(c,!1),oe(),h&&r.translate(-f.x,-f.y),ue(),te(),t&&r.translate(g.x1,g.y1)}};var Gs=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,a,n,i,o){var s=this;if(a.visible()){var l=a.pstyle("".concat(e,"-padding")).pfValue,u=a.pstyle("".concat(e,"-opacity")).value,v=a.pstyle("".concat(e,"-color")).value,f=a.pstyle("".concat(e,"-shape")).value;if(u>0){if(n=n||a.position(),i==null||o==null){var c=a.padding();i=a.width()+2*c,o=a.height()+2*c}s.colorFillStyle(t,v[0],v[1],v[2],u),s.nodeShapes[f].draw(t,n.x,n.y,i+l*2,o+l*2),t.fill()}}}};Rt.drawNodeOverlay=Gs("overlay"),Rt.drawNodeUnderlay=Gs("underlay"),Rt.hasPie=function(r){return r=r[0],r._private.hasPie},Rt.drawPie=function(r,e,t,a){e=e[0],a=a||e.position();var n=e.cy().style(),i=e.pstyle("pie-size"),o=a.x,s=a.y,l=e.width(),u=e.height(),v=Math.min(l,u)/2,f=0,c=this.usePaths();c&&(o=0,s=0),i.units==="%"?v=v*i.pfValue:i.pfValue!==void 0&&(v=i.pfValue/2);for(var h=1;h<=n.pieBackgroundN;h++){var d=e.pstyle("pie-"+h+"-background-size").value,m=e.pstyle("pie-"+h+"-background-color").value,p=e.pstyle("pie-"+h+"-background-opacity").value*t,g=d/100;g+f>1&&(g=1-f);var y=1.5*Math.PI+2*Math.PI*f,b=2*Math.PI*g,w=y+b;d===0||f>=1||f+g>1||(r.beginPath(),r.moveTo(o,s),r.arc(o,s,v,y,w),r.closePath(),this.colorFillStyle(r,m[0],m[1],m[2],p),r.fill(),f+=g)}};var fr={},Ag=100;fr.getPixelRatio=function(){var r=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=r.backingStorePixelRatio||r.webkitBackingStorePixelRatio||r.mozBackingStorePixelRatio||r.msBackingStorePixelRatio||r.oBackingStorePixelRatio||r.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/e},fr.paintCache=function(r){for(var e=this.paintCaches=this.paintCaches||[],t=!0,a,n=0;n<e.length;n++)if(a=e[n],a.context===r){t=!1;break}return t&&(a={context:r},e.push(a)),a},fr.createGradientStyleFor=function(r,e,t,a,n){var i,o=this.usePaths(),s=t.pstyle(e+"-gradient-stop-colors").value,l=t.pstyle(e+"-gradient-stop-positions").pfValue;if(a==="radial-gradient")if(t.isEdge()){var u=t.sourceEndpoint(),v=t.targetEndpoint(),f=t.midpoint(),c=_r(u,f),h=_r(v,f);i=r.createRadialGradient(f.x,f.y,0,f.x,f.y,Math.max(c,h))}else{var d=o?{x:0,y:0}:t.position(),m=t.paddedWidth(),p=t.paddedHeight();i=r.createRadialGradient(d.x,d.y,0,d.x,d.y,Math.max(m,p))}else if(t.isEdge()){var g=t.sourceEndpoint(),y=t.targetEndpoint();i=r.createLinearGradient(g.x,g.y,y.x,y.y)}else{var b=o?{x:0,y:0}:t.position(),w=t.paddedWidth(),D=t.paddedHeight(),C=w/2,x=D/2,k=t.pstyle("background-gradient-direction").value;switch(k){case"to-bottom":i=r.createLinearGradient(b.x,b.y-x,b.x,b.y+x);break;case"to-top":i=r.createLinearGradient(b.x,b.y+x,b.x,b.y-x);break;case"to-left":i=r.createLinearGradient(b.x+C,b.y,b.x-C,b.y);break;case"to-right":i=r.createLinearGradient(b.x-C,b.y,b.x+C,b.y);break;case"to-bottom-right":case"to-right-bottom":i=r.createLinearGradient(b.x-C,b.y-x,b.x+C,b.y+x);break;case"to-top-right":case"to-right-top":i=r.createLinearGradient(b.x-C,b.y+x,b.x+C,b.y-x);break;case"to-bottom-left":case"to-left-bottom":i=r.createLinearGradient(b.x+C,b.y-x,b.x-C,b.y+x);break;case"to-top-left":case"to-left-top":i=r.createLinearGradient(b.x+C,b.y+x,b.x-C,b.y-x);break}}if(!i)return null;for(var E=l.length===s.length,P=s.length,L=0;L<P;L++)i.addColorStop(E?l[L]:L/(P-1),"rgba("+s[L][0]+","+s[L][1]+","+s[L][2]+","+n+")");return i},fr.gradientFillStyle=function(r,e,t,a){var n=this.createGradientStyleFor(r,"background",e,t,a);if(!n)return null;r.fillStyle=n},fr.colorFillStyle=function(r,e,t,a,n){r.fillStyle="rgba("+e+","+t+","+a+","+n+")"},fr.eleFillStyle=function(r,e,t){var a=e.pstyle("background-fill").value;if(a==="linear-gradient"||a==="radial-gradient")this.gradientFillStyle(r,e,a,t);else{var n=e.pstyle("background-color").value;this.colorFillStyle(r,n[0],n[1],n[2],t)}},fr.gradientStrokeStyle=function(r,e,t,a){var n=this.createGradientStyleFor(r,"line",e,t,a);if(!n)return null;r.strokeStyle=n},fr.colorStrokeStyle=function(r,e,t,a,n){r.strokeStyle="rgba("+e+","+t+","+a+","+n+")"},fr.eleStrokeStyle=function(r,e,t){var a=e.pstyle("line-fill").value;if(a==="linear-gradient"||a==="radial-gradient")this.gradientStrokeStyle(r,e,a,t);else{var n=e.pstyle("line-color").value;this.colorStrokeStyle(r,n[0],n[1],n[2],t)}},fr.matchCanvasSize=function(r){var e=this,t=e.data,a=e.findContainerClientCoords(),n=a[2],i=a[3],o=e.getPixelRatio(),s=e.motionBlurPxRatio;(r===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||r===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])&&(o=s);var l=n*o,u=i*o,v;if(!(l===e.canvasWidth&&u===e.canvasHeight)){e.fontCaches=null;var f=t.canvasContainer;f.style.width=n+"px",f.style.height=i+"px";for(var c=0;c<e.CANVAS_LAYERS;c++)v=t.canvases[c],v.width=l,v.height=u,v.style.width=n+"px",v.style.height=i+"px";for(var c=0;c<e.BUFFER_COUNT;c++)v=t.bufferCanvases[c],v.width=l,v.height=u,v.style.width=n+"px",v.style.height=i+"px";e.textureMult=1,o<=1&&(v=t.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,v.width=l*e.textureMult,v.height=u*e.textureMult),e.canvasWidth=l,e.canvasHeight=u}},fr.renderTo=function(r,e,t,a){this.render({forcedContext:r,forcedZoom:e,forcedPan:t,drawAllLayers:!0,forcedPxRatio:a})},fr.render=function(r){r=r||Fi();var e=r.forcedContext,t=r.drawAllLayers,a=r.drawOnlyNodeLayer,n=r.forcedZoom,i=r.forcedPan,o=this,s=r.forcedPxRatio===void 0?this.getPixelRatio():r.forcedPxRatio,l=o.cy,u=o.data,v=u.canvasNeedsRedraw,f=o.textureOnViewport&&!e&&(o.pinching||o.hoverData.dragging||o.swipePanning||o.data.wheelZooming),c=r.motionBlur!==void 0?r.motionBlur:o.motionBlur,h=o.motionBlurPxRatio,d=l.hasCompoundNodes(),m=o.hoverData.draggingEles,p=!!(o.hoverData.selecting||o.touchData.selecting);c=c&&!e&&o.motionBlurEnabled&&!p;var g=c;e||(o.prevPxRatio!==s&&(o.invalidateContainerClientCoordsCache(),o.matchCanvasSize(o.container),o.redrawHint("eles",!0),o.redrawHint("drag",!0)),o.prevPxRatio=s),!e&&o.motionBlurTimeout&&clearTimeout(o.motionBlurTimeout),c&&(o.mbFrames==null&&(o.mbFrames=0),o.mbFrames++,o.mbFrames<3&&(g=!1),o.mbFrames>o.minMbLowQualFrames&&(o.motionBlurPxRatio=o.mbPxRBlurry)),o.clearingMotionBlur&&(o.motionBlurPxRatio=1),o.textureDrawLastFrame&&!f&&(v[o.NODE]=!0,v[o.SELECT_BOX]=!0);var y=l.style(),b=l.zoom(),w=n!==void 0?n:b,D=l.pan(),C={x:D.x,y:D.y},x={zoom:b,pan:{x:D.x,y:D.y}},k=o.prevViewport,E=k===void 0||x.zoom!==k.zoom||x.pan.x!==k.pan.x||x.pan.y!==k.pan.y;!E&&!(m&&!d)&&(o.motionBlurPxRatio=1),i&&(C=i),w*=s,C.x*=s,C.y*=s;var P=o.getCachedZSortedEles();function L(re,te,le,ue,ie){var fe=re.globalCompositeOperation;re.globalCompositeOperation="destination-out",o.colorFillStyle(re,255,255,255,o.motionBlurTransparency),re.fillRect(te,le,ue,ie),re.globalCompositeOperation=fe}function T(re,te){var le,ue,ie,fe;!o.clearingMotionBlur&&(re===u.bufferContexts[o.MOTIONBLUR_BUFFER_NODE]||re===u.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG])?(le={x:D.x*h,y:D.y*h},ue=b*h,ie=o.canvasWidth*h,fe=o.canvasHeight*h):(le=C,ue=w,ie=o.canvasWidth,fe=o.canvasHeight),re.setTransform(1,0,0,1,0,0),te==="motionBlur"?L(re,0,0,ie,fe):!e&&(te===void 0||te)&&re.clearRect(0,0,ie,fe),t||(re.translate(le.x,le.y),re.scale(ue,ue)),i&&re.translate(i.x,i.y),n&&re.scale(n,n)}if(f||(o.textureDrawLastFrame=!1),f){if(o.textureDrawLastFrame=!0,!o.textureCache){o.textureCache={},o.textureCache.bb=l.mutableElements().boundingBox(),o.textureCache.texture=o.data.bufferCanvases[o.TEXTURE_BUFFER];var A=o.data.bufferContexts[o.TEXTURE_BUFFER];A.setTransform(1,0,0,1,0,0),A.clearRect(0,0,o.canvasWidth*o.textureMult,o.canvasHeight*o.textureMult),o.render({forcedContext:A,drawOnlyNodeLayer:!0,forcedPxRatio:s*o.textureMult});var x=o.textureCache.viewport={zoom:l.zoom(),pan:l.pan(),width:o.canvasWidth,height:o.canvasHeight};x.mpan={x:(0-x.pan.x)/x.zoom,y:(0-x.pan.y)/x.zoom}}v[o.DRAG]=!1,v[o.NODE]=!1;var B=u.contexts[o.NODE],O=o.textureCache.texture,x=o.textureCache.viewport;B.setTransform(1,0,0,1,0,0),c?L(B,0,0,x.width,x.height):B.clearRect(0,0,x.width,x.height);var R=y.core("outside-texture-bg-color").value,M=y.core("outside-texture-bg-opacity").value;o.colorFillStyle(B,R[0],R[1],R[2],M),B.fillRect(0,0,x.width,x.height);var b=l.zoom();T(B,!1),B.clearRect(x.mpan.x,x.mpan.y,x.width/x.zoom/s,x.height/x.zoom/s),B.drawImage(O,x.mpan.x,x.mpan.y,x.width/x.zoom/s,x.height/x.zoom/s)}else o.textureOnViewport&&!e&&(o.textureCache=null);var I=l.extent(),V=o.pinching||o.hoverData.dragging||o.swipePanning||o.data.wheelZooming||o.hoverData.draggingEles||o.cy.animated(),G=o.hideEdgesOnViewport&&V,z=[];if(z[o.NODE]=!v[o.NODE]&&c&&!o.clearedForMotionBlur[o.NODE]||o.clearingMotionBlur,z[o.NODE]&&(o.clearedForMotionBlur[o.NODE]=!0),z[o.DRAG]=!v[o.DRAG]&&c&&!o.clearedForMotionBlur[o.DRAG]||o.clearingMotionBlur,z[o.DRAG]&&(o.clearedForMotionBlur[o.DRAG]=!0),v[o.NODE]||t||a||z[o.NODE]){var H=c&&!z[o.NODE]&&h!==1,B=e||(H?o.data.bufferContexts[o.MOTIONBLUR_BUFFER_NODE]:u.contexts[o.NODE]),Y=c&&!H?"motionBlur":void 0;T(B,Y),G?o.drawCachedNodes(B,P.nondrag,s,I):o.drawLayeredElements(B,P.nondrag,s,I),o.debug&&o.drawDebugPoints(B,P.nondrag),!t&&!c&&(v[o.NODE]=!1)}if(!a&&(v[o.DRAG]||t||z[o.DRAG])){var H=c&&!z[o.DRAG]&&h!==1,B=e||(H?o.data.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG]:u.contexts[o.DRAG]);T(B,c&&!H?"motionBlur":void 0),G?o.drawCachedNodes(B,P.drag,s,I):o.drawCachedElements(B,P.drag,s,I),o.debug&&o.drawDebugPoints(B,P.drag),!t&&!c&&(v[o.DRAG]=!1)}if(o.showFps||!a&&v[o.SELECT_BOX]&&!t){var B=e||u.contexts[o.SELECT_BOX];if(T(B),o.selection[4]==1&&(o.hoverData.selecting||o.touchData.selecting)){var b=o.cy.zoom(),Q=y.core("selection-box-border-width").value/b;B.lineWidth=Q,B.fillStyle="rgba("+y.core("selection-box-color").value[0]+","+y.core("selection-box-color").value[1]+","+y.core("selection-box-color").value[2]+","+y.core("selection-box-opacity").value+")",B.fillRect(o.selection[0],o.selection[1],o.selection[2]-o.selection[0],o.selection[3]-o.selection[1]),Q>0&&(B.strokeStyle="rgba("+y.core("selection-box-border-color").value[0]+","+y.core("selection-box-border-color").value[1]+","+y.core("selection-box-border-color").value[2]+","+y.core("selection-box-opacity").value+")",B.strokeRect(o.selection[0],o.selection[1],o.selection[2]-o.selection[0],o.selection[3]-o.selection[1]))}if(u.bgActivePosistion&&!o.hoverData.selecting){var b=o.cy.zoom(),X=u.bgActivePosistion;B.fillStyle="rgba("+y.core("active-bg-color").value[0]+","+y.core("active-bg-color").value[1]+","+y.core("active-bg-color").value[2]+","+y.core("active-bg-opacity").value+")",B.beginPath(),B.arc(X.x,X.y,y.core("active-bg-size").pfValue/b,0,2*Math.PI),B.fill()}var U=o.lastRedrawTime;if(o.showFps&&U){U=Math.round(U);var N=Math.round(1e3/U);B.setTransform(1,0,0,1,0,0),B.fillStyle="rgba(255, 0, 0, 0.75)",B.strokeStyle="rgba(255, 0, 0, 0.75)",B.lineWidth=1,B.fillText("1 frame = "+U+" ms = "+N+" fps",0,20);var _=60;B.strokeRect(0,30,250,20),B.fillRect(0,30,250*Math.min(N/_,1),20)}t||(v[o.SELECT_BOX]=!1)}if(c&&h!==1){var j=u.contexts[o.NODE],J=o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_NODE],ee=u.contexts[o.DRAG],oe=o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_DRAG],he=function(te,le,ue){te.setTransform(1,0,0,1,0,0),ue||!g?te.clearRect(0,0,o.canvasWidth,o.canvasHeight):L(te,0,0,o.canvasWidth,o.canvasHeight);var ie=h;te.drawImage(le,0,0,o.canvasWidth*ie,o.canvasHeight*ie,0,0,o.canvasWidth,o.canvasHeight)};(v[o.NODE]||z[o.NODE])&&(he(j,J,z[o.NODE]),v[o.NODE]=!1),(v[o.DRAG]||z[o.DRAG])&&(he(ee,oe,z[o.DRAG]),v[o.DRAG]=!1)}o.prevViewport=x,o.clearingMotionBlur&&(o.clearingMotionBlur=!1,o.motionBlurCleared=!0,o.motionBlur=!0),c&&(o.motionBlurTimeout=setTimeout(function(){o.motionBlurTimeout=null,o.clearedForMotionBlur[o.NODE]=!1,o.clearedForMotionBlur[o.DRAG]=!1,o.motionBlur=!1,o.clearingMotionBlur=!f,o.mbFrames=0,v[o.NODE]=!0,v[o.DRAG]=!0,o.redraw()},Ag)),e||l.emit("render")};var Xr={};Xr.drawPolygonPath=function(r,e,t,a,n,i){var o=a/2,s=n/2;r.beginPath&&r.beginPath(),r.moveTo(e+o*i[0],t+s*i[1]);for(var l=1;l<i.length/2;l++)r.lineTo(e+o*i[l*2],t+s*i[l*2+1]);r.closePath()},Xr.drawRoundPolygonPath=function(r,e,t,a,n,i){var o=a/2,s=n/2,l=Ln(a,n);r.beginPath&&r.beginPath();for(var u=0;u<i.length/4;u++){var v=void 0,f=void 0;u===0?v=i.length-2:v=u*4-2,f=u*4+2;var c=e+o*i[u*4],h=t+s*i[u*4+1],d=-i[v]*i[f]-i[v+1]*i[f+1],m=l/Math.tan(Math.acos(d)/2),p=c-m*i[v],g=h-m*i[v+1],y=c+m*i[f],b=h+m*i[f+1];u===0?r.moveTo(p,g):r.lineTo(p,g),r.arcTo(c,h,y,b,l)}r.closePath()},Xr.drawRoundRectanglePath=function(r,e,t,a,n){var i=a/2,o=n/2,s=Jt(a,n);r.beginPath&&r.beginPath(),r.moveTo(e,t-o),r.arcTo(e+i,t-o,e+i,t,s),r.arcTo(e+i,t+o,e,t+o,s),r.arcTo(e-i,t+o,e-i,t,s),r.arcTo(e-i,t-o,e,t-o,s),r.lineTo(e,t-o),r.closePath()},Xr.drawBottomRoundRectanglePath=function(r,e,t,a,n){var i=a/2,o=n/2,s=Jt(a,n);r.beginPath&&r.beginPath(),r.moveTo(e,t-o),r.lineTo(e+i,t-o),r.lineTo(e+i,t),r.arcTo(e+i,t+o,e,t+o,s),r.arcTo(e-i,t+o,e-i,t,s),r.lineTo(e-i,t-o),r.lineTo(e,t-o),r.closePath()},Xr.drawCutRectanglePath=function(r,e,t,a,n){var i=a/2,o=n/2,s=Xi();r.beginPath&&r.beginPath(),r.moveTo(e-i+s,t-o),r.lineTo(e+i-s,t-o),r.lineTo(e+i,t-o+s),r.lineTo(e+i,t+o-s),r.lineTo(e+i-s,t+o),r.lineTo(e-i+s,t+o),r.lineTo(e-i,t+o-s),r.lineTo(e-i,t-o+s),r.closePath()},Xr.drawBarrelPath=function(r,e,t,a,n){var i=a/2,o=n/2,s=e-i,l=e+i,u=t-o,v=t+o,f=Mn(a,n),c=f.widthOffset,h=f.heightOffset,d=f.ctrlPtOffsetPct*c;r.beginPath&&r.beginPath(),r.moveTo(s,u+h),r.lineTo(s,v-h),r.quadraticCurveTo(s+d,v,s+c,v),r.lineTo(l-c,v),r.quadraticCurveTo(l-d,v,l,v-h),r.lineTo(l,u+h),r.quadraticCurveTo(l-d,u,l-c,u),r.lineTo(s+c,u),r.quadraticCurveTo(s+d,u,s,u+h),r.closePath()};for(var Ks=Math.sin(0),Ys=Math.cos(0),oi={},si={},Xs=Math.PI/40,Ot=0*Math.PI;Ot<2*Math.PI;Ot+=Xs)oi[Ot]=Math.sin(Ot),si[Ot]=Math.cos(Ot);Xr.drawEllipsePath=function(r,e,t,a,n){if(r.beginPath&&r.beginPath(),r.ellipse)r.ellipse(e,t,a/2,n/2,0,0,2*Math.PI);else for(var i,o,s=a/2,l=n/2,u=0*Math.PI;u<2*Math.PI;u+=Xs)i=e-s*oi[u]*Ks+s*si[u]*Ys,o=t+l*si[u]*Ks+l*oi[u]*Ys,u===0?r.moveTo(i,o):r.lineTo(i,o);r.closePath()};var pa={};pa.createBuffer=function(r,e){var t=document.createElement("canvas");return t.width=r,t.height=e,[t,t.getContext("2d")]},pa.bufferCanvasImage=function(r){var e=this.cy,t=e.mutableElements(),a=t.boundingBox(),n=this.findContainerClientCoords(),i=r.full?Math.ceil(a.w):n[2],o=r.full?Math.ceil(a.h):n[3],s=ae(r.maxWidth)||ae(r.maxHeight),l=this.getPixelRatio(),u=1;if(r.scale!==void 0)i*=r.scale,o*=r.scale,u=r.scale;else if(s){var v=1/0,f=1/0;ae(r.maxWidth)&&(v=u*r.maxWidth/i),ae(r.maxHeight)&&(f=u*r.maxHeight/o),u=Math.min(v,f),i*=u,o*=u}s||(i*=l,o*=l,u*=l);var c=document.createElement("canvas");c.width=i,c.height=o,c.style.width=i+"px",c.style.height=o+"px";var h=c.getContext("2d");if(i>0&&o>0){h.clearRect(0,0,i,o),h.globalCompositeOperation="source-over";var d=this.getCachedZSortedEles();if(r.full)h.translate(-a.x1*u,-a.y1*u),h.scale(u,u),this.drawElements(h,d),h.scale(1/u,1/u),h.translate(a.x1*u,a.y1*u);else{var m=e.pan(),p={x:m.x*u,y:m.y*u};u*=e.zoom(),h.translate(p.x,p.y),h.scale(u,u),this.drawElements(h,d),h.scale(1/u,1/u),h.translate(-p.x,-p.y)}r.bg&&(h.globalCompositeOperation="destination-over",h.fillStyle=r.bg,h.rect(0,0,i,o),h.fill())}return c};function Rg(r,e){for(var t=atob(r),a=new ArrayBuffer(t.length),n=new Uint8Array(a),i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return new Blob([a],{type:e})}function Us(r){var e=r.indexOf(",");return r.substr(e+1)}function Zs(r,e,t){var a=function(){return e.toDataURL(t,r.quality)};switch(r.output){case"blob-promise":return new yt(function(n,i){try{e.toBlob(function(o){o!=null?n(o):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},t,r.quality)}catch(o){i(o)}});case"blob":return Rg(Us(a()),t);case"base64":return Us(a());case"base64uri":default:return a()}}pa.png=function(r){return Zs(r,this.bufferCanvasImage(r),"image/png")},pa.jpg=function(r){return Zs(r,this.bufferCanvasImage(r),"image/jpeg")};var Qs={};Qs.nodeShapeImpl=function(r,e,t,a,n,i,o){switch(r){case"ellipse":return this.drawEllipsePath(e,t,a,n,i);case"polygon":return this.drawPolygonPath(e,t,a,n,i,o);case"round-polygon":return this.drawRoundPolygonPath(e,t,a,n,i,o);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,t,a,n,i);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,t,a,n,i);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,t,a,n,i);case"barrel":return this.drawBarrelPath(e,t,a,n,i)}};var Og=_s,ke=_s.prototype;ke.CANVAS_LAYERS=3,ke.SELECT_BOX=0,ke.DRAG=1,ke.NODE=2,ke.BUFFER_COUNT=3,ke.TEXTURE_BUFFER=0,ke.MOTIONBLUR_BUFFER_NODE=1,ke.MOTIONBLUR_BUFFER_DRAG=2;function _s(r){var e=this;e.data={canvases:new Array(ke.CANVAS_LAYERS),contexts:new Array(ke.CANVAS_LAYERS),canvasNeedsRedraw:new Array(ke.CANVAS_LAYERS),bufferCanvases:new Array(ke.BUFFER_COUNT),bufferContexts:new Array(ke.CANVAS_LAYERS)};var t="-webkit-tap-highlight-color",a="rgba(0,0,0,0)";e.data.canvasContainer=document.createElement("div");var n=e.data.canvasContainer.style;e.data.canvasContainer.style[t]=a,n.position="relative",n.zIndex="0",n.overflow="hidden";var i=r.cy.container();i.appendChild(e.data.canvasContainer),i.style[t]=a;var o={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};xu()&&(o["-ms-touch-action"]="none",o["touch-action"]="none");for(var s=0;s<ke.CANVAS_LAYERS;s++){var l=e.data.canvases[s]=document.createElement("canvas");e.data.contexts[s]=l.getContext("2d"),Object.keys(o).forEach(function(U){l.style[U]=o[U]}),l.style.position="absolute",l.setAttribute("data-id","layer"+s),l.style.zIndex=String(ke.CANVAS_LAYERS-s),e.data.canvasContainer.appendChild(l),e.data.canvasNeedsRedraw[s]=!1}e.data.topCanvas=e.data.canvases[0],e.data.canvases[ke.NODE].setAttribute("data-id","layer"+ke.NODE+"-node"),e.data.canvases[ke.SELECT_BOX].setAttribute("data-id","layer"+ke.SELECT_BOX+"-selectbox"),e.data.canvases[ke.DRAG].setAttribute("data-id","layer"+ke.DRAG+"-drag");for(var s=0;s<ke.BUFFER_COUNT;s++)e.data.bufferCanvases[s]=document.createElement("canvas"),e.data.bufferContexts[s]=e.data.bufferCanvases[s].getContext("2d"),e.data.bufferCanvases[s].style.position="absolute",e.data.bufferCanvases[s].setAttribute("data-id","buffer"+s),e.data.bufferCanvases[s].style.zIndex=String(-s-1),e.data.bufferCanvases[s].style.visibility="hidden";e.pathsEnabled=!0;var u=or(),v=function(N){return{x:(N.x1+N.x2)/2,y:(N.y1+N.y2)/2}},f=function(N){return{x:-N.w/2,y:-N.h/2}},c=function(N){var _=N[0]._private,j=_.oldBackgroundTimestamp===_.backgroundTimestamp;return!j},h=function(N){return N[0]._private.nodeKey},d=function(N){return N[0]._private.labelStyleKey},m=function(N){return N[0]._private.sourceLabelStyleKey},p=function(N){return N[0]._private.targetLabelStyleKey},g=function(N,_,j,J,ee){return e.drawElement(N,_,j,!1,!1,ee)},y=function(N,_,j,J,ee){return e.drawElementText(N,_,j,J,"main",ee)},b=function(N,_,j,J,ee){return e.drawElementText(N,_,j,J,"source",ee)},w=function(N,_,j,J,ee){return e.drawElementText(N,_,j,J,"target",ee)},D=function(N){return N.boundingBox(),N[0]._private.bodyBounds},C=function(N){return N.boundingBox(),N[0]._private.labelBounds.main||u},x=function(N){return N.boundingBox(),N[0]._private.labelBounds.source||u},k=function(N){return N.boundingBox(),N[0]._private.labelBounds.target||u},E=function(N,_){return _},P=function(N){return v(D(N))},L=function(N,_,j){var J=N?N+"-":"";return{x:_.x+j.pstyle(J+"text-margin-x").pfValue,y:_.y+j.pstyle(J+"text-margin-y").pfValue}},T=function(N,_,j){var J=N[0]._private.rscratch;return{x:J[_],y:J[j]}},A=function(N){return L("",T(N,"labelX","labelY"),N)},B=function(N){return L("source",T(N,"sourceLabelX","sourceLabelY"),N)},O=function(N){return L("target",T(N,"targetLabelX","targetLabelY"),N)},R=function(N){return f(D(N))},M=function(N){return f(x(N))},I=function(N){return f(k(N))},V=function(N){var _=C(N),j=f(C(N));if(N.isNode()){switch(N.pstyle("text-halign").value){case"left":j.x=-_.w;break;case"right":j.x=0;break}switch(N.pstyle("text-valign").value){case"top":j.y=-_.h;break;case"bottom":j.y=0;break}}return j},G=e.data.eleTxrCache=new ha(e,{getKey:h,doesEleInvalidateKey:c,drawElement:g,getBoundingBox:D,getRotationPoint:P,getRotationOffset:R,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),z=e.data.lblTxrCache=new ha(e,{getKey:d,drawElement:y,getBoundingBox:C,getRotationPoint:A,getRotationOffset:V,isVisible:E}),H=e.data.slbTxrCache=new ha(e,{getKey:m,drawElement:b,getBoundingBox:x,getRotationPoint:B,getRotationOffset:M,isVisible:E}),Y=e.data.tlbTxrCache=new ha(e,{getKey:p,drawElement:w,getBoundingBox:k,getRotationPoint:O,getRotationOffset:I,isVisible:E}),Q=e.data.lyrTxrCache=new Fs(e);e.onUpdateEleCalcs(function(N,_){G.invalidateElements(_),z.invalidateElements(_),H.invalidateElements(_),Y.invalidateElements(_),Q.invalidateElements(_);for(var j=0;j<_.length;j++){var J=_[j]._private;J.oldBackgroundTimestamp=J.backgroundTimestamp}});var X=function(N){for(var _=0;_<N.length;_++)Q.enqueueElementRefinement(N[_].ele)};G.onDequeue(X),z.onDequeue(X),H.onDequeue(X),Y.onDequeue(X)}ke.redrawHint=function(r,e){var t=this;switch(r){case"eles":t.data.canvasNeedsRedraw[ke.NODE]=e;break;case"drag":t.data.canvasNeedsRedraw[ke.DRAG]=e;break;case"select":t.data.canvasNeedsRedraw[ke.SELECT_BOX]=e;break}};var Ig=typeof Path2D!="undefined";ke.path2dEnabled=function(r){if(r===void 0)return this.pathsEnabled;this.pathsEnabled=!!r},ke.usePaths=function(){return Ig&&this.pathsEnabled},ke.setImgSmoothing=function(r,e){r.imageSmoothingEnabled!=null?r.imageSmoothingEnabled=e:(r.webkitImageSmoothingEnabled=e,r.mozImageSmoothingEnabled=e,r.msImageSmoothingEnabled=e)},ke.getImgSmoothing=function(r){return r.imageSmoothingEnabled!=null?r.imageSmoothingEnabled:r.webkitImageSmoothingEnabled||r.mozImageSmoothingEnabled||r.msImageSmoothingEnabled},ke.makeOffscreenCanvas=function(r,e){var t;return(typeof OffscreenCanvas=="undefined"?"undefined":qe(OffscreenCanvas))!=="undefined"?t=new OffscreenCanvas(r,e):(t=document.createElement("canvas"),t.width=r,t.height=e),t},[qs,kr,Rr,ii,nt,Rt,fr,Xr,pa,Qs].forEach(function(r){de(ke,r)});var zg=[{name:"null",impl:Es},{name:"base",impl:Os},{name:"canvas",impl:Og}],Ng=[{type:"layout",extensions:Gh},{type:"renderer",extensions:zg}],Js={},js={};function eu(r,e,t){var a=t,n=function(k){Be("Can not register `"+e+"` for `"+r+"` since `"+k+"` already exists in the prototype and can not be overridden")};if(r==="core"){if(fa.prototype[e])return n(e);fa.prototype[e]=t}else if(r==="collection"){if(Xe.prototype[e])return n(e);Xe.prototype[e]=t}else if(r==="layout"){for(var i=function(k){this.options=k,t.call(this,k),Ce(this._private)||(this._private={}),this._private.cy=k.cy,this._private.listeners=[],this.createEmitter()},o=i.prototype=Object.create(t.prototype),s=[],l=0;l<s.length;l++){var u=s[l];o[u]=o[u]||function(){return this}}o.start&&!o.run?o.run=function(){return this.start(),this}:!o.start&&o.run&&(o.start=function(){return this.run(),this});var v=t.prototype.stop;o.stop=function(){var x=this.options;if(x&&x.animate){var k=this.animations;if(k)for(var E=0;E<k.length;E++)k[E].stop()}return v?v.call(this):this.emit("layoutstop"),this},o.destroy||(o.destroy=function(){return this}),o.cy=function(){return this._private.cy};var f=function(k){return k._private.cy},c={addEventFields:function(k,E){E.layout=k,E.cy=f(k),E.target=k},bubble:function(){return!0},parent:function(k){return f(k)}};de(o,{createEmitter:function(){return this._private.emitter=new Ya(c,this),this},emitter:function(){return this._private.emitter},on:function(k,E){return this.emitter().on(k,E),this},one:function(k,E){return this.emitter().one(k,E),this},once:function(k,E){return this.emitter().one(k,E),this},removeListener:function(k,E){return this.emitter().removeListener(k,E),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(k,E){return this.emitter().emit(k,E),this}}),Le.eventAliasesOn(o),a=i}else if(r==="renderer"&&e!=="null"&&e!=="base"){var h=ru("renderer","base"),d=h.prototype,m=t,p=t.prototype,g=function(){h.apply(this,arguments),m.apply(this,arguments)},y=g.prototype;for(var b in d){var w=d[b],D=p[b]!=null;if(D)return n(b);y[b]=w}for(var C in p)y[C]=p[C];d.clientFunctions.forEach(function(x){y[x]=y[x]||function(){Ne("Renderer does not implement `renderer."+x+"()` on its prototype")}}),a=g}else if(r==="__proto__"||r==="constructor"||r==="prototype")return Ne(r+" is an illegal type to be registered, possibly lead to prototype pollutions");return Ei({map:Js,keys:[r,e],value:a})}function ru(r,e){return Ci({map:Js,keys:[r,e]})}function Fg(r,e,t,a,n){return Ei({map:js,keys:[r,e,t,a],value:n})}function Vg(r,e,t,a){return Ci({map:js,keys:[r,e,t,a]})}var ui=function(){if(arguments.length===2)return ru.apply(null,arguments);if(arguments.length===3)return eu.apply(null,arguments);if(arguments.length===4)return Vg.apply(null,arguments);if(arguments.length===5)return Fg.apply(null,arguments);Ne("Invalid extension access syntax")};fa.prototype.extension=ui,Ng.forEach(function(r){r.extensions.forEach(function(e){eu(r.type,e.name,e.impl)})});var tu=function r(){if(!(this instanceof r))return new r;this.length=0},it=tu.prototype;it.instanceString=function(){return"stylesheet"},it.selector=function(r){var e=this.length++;return this[e]={selector:r,properties:[]},this},it.css=function(r,e){var t=this.length-1;if(ve(r))this[t].properties.push({name:r,value:e});else if(Ce(r))for(var a=r,n=Object.keys(a),i=0;i<n.length;i++){var o=n[i],s=a[o];if(s!=null){var l=er.properties[o]||er.properties[wa(o)];if(l!=null){var u=l.name,v=s;this[t].properties.push({name:u,value:v})}}}return this},it.style=it.css,it.generateStyle=function(r){var e=new er(r);return this.appendToStyle(e)},it.appendToStyle=function(r){for(var e=0;e<this.length;e++){var t=this[e],a=t.selector,n=t.properties;r.selector(a);for(var i=0;i<n.length;i++){var o=n[i];r.css(o.name,o.value)}}return r};var qg="3.28.0",ot=function(e){if(e===void 0&&(e={}),Ce(e))return new fa(e);if(ve(e))return ui.apply(ui,arguments)};return ot.use=function(r){var e=Array.prototype.slice.call(arguments,1);return e.unshift(ot),r.apply(null,e),this},ot.warnings=function(r){return zi(r)},ot.version=qg,ot.stylesheet=ot.Stylesheet=tu,ot})}}]);
|